aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/evas/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/evas/src/lib')
-rw-r--r--libraries/evas/src/lib/Evas.h12236
-rw-r--r--libraries/evas/src/lib/Evas_GL.h1412
-rw-r--r--libraries/evas/src/lib/Makefile.am261
-rw-r--r--libraries/evas/src/lib/Makefile.in1092
-rw-r--r--libraries/evas/src/lib/cache/Makefile.am27
-rw-r--r--libraries/evas/src/lib/cache/Makefile.in683
-rw-r--r--libraries/evas/src/lib/cache/evas_cache.h175
-rw-r--r--libraries/evas/src/lib/cache/evas_cache_engine_image.c699
-rw-r--r--libraries/evas/src/lib/cache/evas_cache_image.c1433
-rw-r--r--libraries/evas/src/lib/cache/evas_preload.c264
-rw-r--r--libraries/evas/src/lib/canvas/Makefile.am68
-rw-r--r--libraries/evas/src/lib/canvas/Makefile.in760
-rw-r--r--libraries/evas/src/lib/canvas/evas_async_events.c173
-rw-r--r--libraries/evas/src/lib/canvas/evas_callbacks.c534
-rw-r--r--libraries/evas/src/lib/canvas/evas_clip.c321
-rw-r--r--libraries/evas/src/lib/canvas/evas_data.c72
-rw-r--r--libraries/evas/src/lib/canvas/evas_events.c1602
-rw-r--r--libraries/evas/src/lib/canvas/evas_filter.c1427
-rw-r--r--libraries/evas/src/lib/canvas/evas_focus.c59
-rw-r--r--libraries/evas/src/lib/canvas/evas_font_dir.c1349
-rw-r--r--libraries/evas/src/lib/canvas/evas_gl.c245
-rw-r--r--libraries/evas/src/lib/canvas/evas_key.c245
-rw-r--r--libraries/evas/src/lib/canvas/evas_key_grab.c179
-rw-r--r--libraries/evas/src/lib/canvas/evas_layer.c193
-rw-r--r--libraries/evas/src/lib/canvas/evas_main.c671
-rw-r--r--libraries/evas/src/lib/canvas/evas_map.c1031
-rw-r--r--libraries/evas/src/lib/canvas/evas_name.c40
-rw-r--r--libraries/evas/src/lib/canvas/evas_object_box.c2128
-rw-r--r--libraries/evas/src/lib/canvas/evas_object_grid.c465
-rw-r--r--libraries/evas/src/lib/canvas/evas_object_image.c3895
-rw-r--r--libraries/evas/src/lib/canvas/evas_object_inform.c79
-rw-r--r--libraries/evas/src/lib/canvas/evas_object_intercept.c625
-rw-r--r--libraries/evas/src/lib/canvas/evas_object_line.c461
-rw-r--r--libraries/evas/src/lib/canvas/evas_object_main.c1319
-rw-r--r--libraries/evas/src/lib/canvas/evas_object_polygon.c554
-rw-r--r--libraries/evas/src/lib/canvas/evas_object_rectangle.c387
-rw-r--r--libraries/evas/src/lib/canvas/evas_object_smart.c920
-rw-r--r--libraries/evas/src/lib/canvas/evas_object_smart_clipped.c183
-rw-r--r--libraries/evas/src/lib/canvas/evas_object_table.c1373
-rw-r--r--libraries/evas/src/lib/canvas/evas_object_text.c1943
-rw-r--r--libraries/evas/src/lib/canvas/evas_object_textblock.c9569
-rw-r--r--libraries/evas/src/lib/canvas/evas_rectangle.c98
-rw-r--r--libraries/evas/src/lib/canvas/evas_render.c1866
-rw-r--r--libraries/evas/src/lib/canvas/evas_smart.c266
-rw-r--r--libraries/evas/src/lib/canvas/evas_stack.c391
-rw-r--r--libraries/evas/src/lib/canvas/evas_stats.c185
-rw-r--r--libraries/evas/src/lib/canvas/evas_touch_point.c110
-rw-r--r--libraries/evas/src/lib/cserve/Makefile.am32
-rw-r--r--libraries/evas/src/lib/cserve/Makefile.in688
-rw-r--r--libraries/evas/src/lib/cserve/evas_cs.h285
-rw-r--r--libraries/evas/src/lib/cserve/evas_cs_client.c528
-rw-r--r--libraries/evas/src/lib/cserve/evas_cs_main.c9
-rw-r--r--libraries/evas/src/lib/cserve/evas_cs_mem.c168
-rw-r--r--libraries/evas/src/lib/cserve/evas_cs_server.c380
-rw-r--r--libraries/evas/src/lib/engines/Makefile.am16
-rw-r--r--libraries/evas/src/lib/engines/Makefile.in736
-rw-r--r--libraries/evas/src/lib/engines/common/Makefile.am118
-rw-r--r--libraries/evas/src/lib/engines/common/Makefile.in1005
-rw-r--r--libraries/evas/src/lib/engines/common/evas_blend.h8
-rw-r--r--libraries/evas/src/lib/engines/common/evas_blend_main.c325
-rw-r--r--libraries/evas/src/lib/engines/common/evas_blend_private.h31
-rw-r--r--libraries/evas/src/lib/engines/common/evas_blit_main.c700
-rw-r--r--libraries/evas/src/lib/engines/common/evas_convert_color.c246
-rw-r--r--libraries/evas/src/lib/engines/common/evas_convert_color.h16
-rw-r--r--libraries/evas/src/lib/engines/common/evas_convert_colorspace.c186
-rw-r--r--libraries/evas/src/lib/engines/common/evas_convert_colorspace.h12
-rw-r--r--libraries/evas/src/lib/engines/common/evas_convert_gry_1.c6
-rw-r--r--libraries/evas/src/lib/engines/common/evas_convert_gry_1.h9
-rw-r--r--libraries/evas/src/lib/engines/common/evas_convert_gry_4.c10
-rw-r--r--libraries/evas/src/lib/engines/common/evas_convert_gry_4.h9
-rw-r--r--libraries/evas/src/lib/engines/common/evas_convert_gry_8.c78
-rw-r--r--libraries/evas/src/lib/engines/common/evas_convert_gry_8.h12
-rw-r--r--libraries/evas/src/lib/engines/common/evas_convert_grypal_6.c23
-rw-r--r--libraries/evas/src/lib/engines/common/evas_convert_grypal_6.h6
-rw-r--r--libraries/evas/src/lib/engines/common/evas_convert_main.c632
-rw-r--r--libraries/evas/src/lib/engines/common/evas_convert_main.h9
-rw-r--r--libraries/evas/src/lib/engines/common/evas_convert_rgb_16.c2089
-rw-r--r--libraries/evas/src/lib/engines/common/evas_convert_rgb_16.h50
-rw-r--r--libraries/evas/src/lib/engines/common/evas_convert_rgb_24.c89
-rw-r--r--libraries/evas/src/lib/engines/common/evas_convert_rgb_24.h10
-rw-r--r--libraries/evas/src/lib/engines/common/evas_convert_rgb_32.c460
-rw-r--r--libraries/evas/src/lib/engines/common/evas_convert_rgb_32.h24
-rw-r--r--libraries/evas/src/lib/engines/common/evas_convert_rgb_8.c248
-rw-r--r--libraries/evas/src/lib/engines/common/evas_convert_rgb_8.h14
-rw-r--r--libraries/evas/src/lib/engines/common/evas_convert_yuv.c1258
-rw-r--r--libraries/evas/src/lib/engines/common/evas_convert_yuv.h9
-rw-r--r--libraries/evas/src/lib/engines/common/evas_cpu.c270
-rw-r--r--libraries/evas/src/lib/engines/common/evas_draw.h36
-rw-r--r--libraries/evas/src/lib/engines/common/evas_draw_main.c576
-rw-r--r--libraries/evas/src/lib/engines/common/evas_font.h76
-rw-r--r--libraries/evas/src/lib/engines/common/evas_font_default_walk.x144
-rw-r--r--libraries/evas/src/lib/engines/common/evas_font_draw.c615
-rw-r--r--libraries/evas/src/lib/engines/common/evas_font_load.c929
-rw-r--r--libraries/evas/src/lib/engines/common/evas_font_main.c547
-rw-r--r--libraries/evas/src/lib/engines/common/evas_font_ot.c336
-rw-r--r--libraries/evas/src/lib/engines/common/evas_font_ot.h45
-rw-r--r--libraries/evas/src/lib/engines/common/evas_font_private.h52
-rw-r--r--libraries/evas/src/lib/engines/common/evas_font_query.c789
-rw-r--r--libraries/evas/src/lib/engines/common/evas_image.h63
-rw-r--r--libraries/evas/src/lib/engines/common/evas_image_data.c147
-rw-r--r--libraries/evas/src/lib/engines/common/evas_image_load.c381
-rw-r--r--libraries/evas/src/lib/engines/common/evas_image_main.c818
-rw-r--r--libraries/evas/src/lib/engines/common/evas_image_private.h17
-rw-r--r--libraries/evas/src/lib/engines/common/evas_image_save.c51
-rw-r--r--libraries/evas/src/lib/engines/common/evas_image_scalecache.c846
-rw-r--r--libraries/evas/src/lib/engines/common/evas_line.h11
-rw-r--r--libraries/evas/src/lib/engines/common/evas_line_main.c678
-rw-r--r--libraries/evas/src/lib/engines/common/evas_map_image.c432
-rw-r--r--libraries/evas/src/lib/engines/common/evas_map_image.h10
-rw-r--r--libraries/evas/src/lib/engines/common/evas_map_image_core.c226
-rw-r--r--libraries/evas/src/lib/engines/common/evas_map_image_internal.c117
-rw-r--r--libraries/evas/src/lib/engines/common/evas_map_image_loop.c116
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_add/Makefile.am13
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_add/Makefile.in543
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_add/op_add_color_.c33
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_add/op_add_color_i386.c33
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_add/op_add_mask_color_.c33
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_add/op_add_mask_color_i386.c33
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_add/op_add_pixel_.c33
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_add/op_add_pixel_color_.c33
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_add/op_add_pixel_color_i386.c29
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_add/op_add_pixel_i386.c33
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_add/op_add_pixel_mask_.c37
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_add/op_add_pixel_mask_i386.c33
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_add_main_.c541
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_blend/Makefile.am50
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_blend/Makefile.in720
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_color_.c109
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_color_i386.c138
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_color_neon.c223
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_color_sse3.c166
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_mask_color_.c185
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_mask_color_i386.c251
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_mask_color_neon.c562
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_mask_color_sse3.c320
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_master_sse3.c77
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_.c162
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_color_.c284
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_color_i386.c221
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_color_neon.c570
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_color_sse3.c543
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_i386.c217
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_mask_.c189
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_mask_i386.c157
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_mask_neon.c129
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_mask_sse3.c300
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_neon.c530
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_sse3.c316
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_blend_main_.c671
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_copy/Makefile.am18
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_copy/Makefile.in548
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_color_.c138
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_color_i386.c150
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_color_neon.c212
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_mask_color_.c170
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_mask_color_i386.c193
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_mask_color_neon.c170
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_pixel_.c117
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_pixel_color_.c236
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_pixel_color_i386.c255
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_pixel_color_neon.c238
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_pixel_i386.c131
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_pixel_mask_.c150
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_pixel_mask_i386.c176
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_pixel_mask_neon.c151
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_pixel_neon.c158
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_copy_main_.c675
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_mask/Makefile.am13
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_mask/Makefile.in543
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_mask/op_mask_color_.c49
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_mask/op_mask_color_i386.c58
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_mask/op_mask_mask_color_.c63
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_mask/op_mask_mask_color_i386.c13
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_mask/op_mask_pixel_.c48
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_mask/op_mask_pixel_color_.c100
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_mask/op_mask_pixel_color_i386.c13
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_mask/op_mask_pixel_i386.c58
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_mask/op_mask_pixel_mask_.c62
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_mask/op_mask_pixel_mask_i386.c13
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_mask_main_.c309
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_mul/Makefile.am13
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_mul/Makefile.in543
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_mul/op_mul_color_.c65
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_mul/op_mul_color_i386.c66
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_mul/op_mul_mask_color_.c72
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_mul/op_mul_mask_color_i386.c92
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_mul/op_mul_pixel_.c56
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_mul/op_mul_pixel_color_.c122
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_mul/op_mul_pixel_color_i386.c120
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_mul/op_mul_pixel_i386.c66
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_mul/op_mul_pixel_mask_.c117
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_mul/op_mul_pixel_mask_i386.c63
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_mul_main_.c308
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_sub/Makefile.am14
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_sub/Makefile.in543
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_sub/op_sub_color_.c33
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_sub/op_sub_color_i386.c33
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_sub/op_sub_mask_color_.c33
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_sub/op_sub_mask_color_i386.c33
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_sub/op_sub_pixel_.c33
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_sub/op_sub_pixel_color_.c33
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_sub/op_sub_pixel_color_i386.c29
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_sub/op_sub_pixel_i386.c33
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_sub/op_sub_pixel_mask_.c37
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_sub/op_sub_pixel_mask_i386.c33
-rw-r--r--libraries/evas/src/lib/engines/common/evas_op_sub_main_.c542
-rw-r--r--libraries/evas/src/lib/engines/common/evas_pipe.c1733
-rw-r--r--libraries/evas/src/lib/engines/common/evas_pipe.h111
-rw-r--r--libraries/evas/src/lib/engines/common/evas_polygon.h13
-rw-r--r--libraries/evas/src/lib/engines/common/evas_polygon_main.c293
-rw-r--r--libraries/evas/src/lib/engines/common/evas_rectangle.h11
-rw-r--r--libraries/evas/src/lib/engines/common/evas_rectangle_main.c73
-rw-r--r--libraries/evas/src/lib/engines/common/evas_regionbuf.c357
-rw-r--r--libraries/evas/src/lib/engines/common/evas_scale_main.c6
-rw-r--r--libraries/evas/src/lib/engines/common/evas_scale_main.h13
-rw-r--r--libraries/evas/src/lib/engines/common/evas_scale_sample.c398
-rw-r--r--libraries/evas/src/lib/engines/common/evas_scale_smooth.c532
-rw-r--r--libraries/evas/src/lib/engines/common/evas_scale_smooth.h19
-rw-r--r--libraries/evas/src/lib/engines/common/evas_scale_smooth_scaler.c211
-rw-r--r--libraries/evas/src/lib/engines/common/evas_scale_smooth_scaler_down.c43
-rw-r--r--libraries/evas/src/lib/engines/common/evas_scale_smooth_scaler_downx.c259
-rw-r--r--libraries/evas/src/lib/engines/common/evas_scale_smooth_scaler_downx_downy.c387
-rw-r--r--libraries/evas/src/lib/engines/common/evas_scale_smooth_scaler_downy.c260
-rw-r--r--libraries/evas/src/lib/engines/common/evas_scale_smooth_scaler_noscale.c62
-rw-r--r--libraries/evas/src/lib/engines/common/evas_scale_smooth_scaler_up.c266
-rw-r--r--libraries/evas/src/lib/engines/common/evas_scale_span.c653
-rw-r--r--libraries/evas/src/lib/engines/common/evas_scale_span.h14
-rw-r--r--libraries/evas/src/lib/engines/common/evas_text_utils.c472
-rw-r--r--libraries/evas/src/lib/engines/common/evas_text_utils.h89
-rw-r--r--libraries/evas/src/lib/engines/common/evas_tiler.c1391
-rw-r--r--libraries/evas/src/lib/engines/common/language/evas_bidi_utils.c641
-rw-r--r--libraries/evas/src/lib/engines/common/language/evas_bidi_utils.h157
-rw-r--r--libraries/evas/src/lib/engines/common/language/evas_language_utils.c146
-rw-r--r--libraries/evas/src/lib/engines/common/language/evas_language_utils.h132
-rw-r--r--libraries/evas/src/lib/engines/common/language/evas_script_table.h3087
-rw-r--r--libraries/evas/src/lib/engines/common_16/Makefile.am32
-rw-r--r--libraries/evas/src/lib/engines/common_16/Makefile.in698
-rw-r--r--libraries/evas/src/lib/engines/common_16/evas_soft16_dither_mask.c293
-rw-r--r--libraries/evas/src/lib/engines/common_16/evas_soft16_font.c295
-rw-r--r--libraries/evas/src/lib/engines/common_16/evas_soft16_image_scaled_sampled.c471
-rw-r--r--libraries/evas/src/lib/engines/common_16/evas_soft16_image_unscaled.c287
-rw-r--r--libraries/evas/src/lib/engines/common_16/evas_soft16_line.c444
-rw-r--r--libraries/evas/src/lib/engines/common_16/evas_soft16_main.c594
-rw-r--r--libraries/evas/src/lib/engines/common_16/evas_soft16_point_blend.c149
-rw-r--r--libraries/evas/src/lib/engines/common_16/evas_soft16_polygon.c231
-rw-r--r--libraries/evas/src/lib/engines/common_16/evas_soft16_rectangle.c121
-rw-r--r--libraries/evas/src/lib/engines/common_16/evas_soft16_scanline_blend.c353
-rw-r--r--libraries/evas/src/lib/engines/common_16/evas_soft16_scanline_fill.c86
-rw-r--r--libraries/evas/src/lib/engines/common_8/Makefile.am32
-rw-r--r--libraries/evas/src/lib/engines/common_8/Makefile.in696
-rw-r--r--libraries/evas/src/lib/engines/common_8/evas_soft8_dither_mask.c100
-rw-r--r--libraries/evas/src/lib/engines/common_8/evas_soft8_font.c285
-rw-r--r--libraries/evas/src/lib/engines/common_8/evas_soft8_image_scaled_sampled.c463
-rw-r--r--libraries/evas/src/lib/engines/common_8/evas_soft8_image_unscaled.c284
-rw-r--r--libraries/evas/src/lib/engines/common_8/evas_soft8_line.c426
-rw-r--r--libraries/evas/src/lib/engines/common_8/evas_soft8_main.c656
-rw-r--r--libraries/evas/src/lib/engines/common_8/evas_soft8_polygon.c230
-rw-r--r--libraries/evas/src/lib/engines/common_8/evas_soft8_rectangle.c125
-rw-r--r--libraries/evas/src/lib/engines/common_8/evas_soft8_scanline_blend.c447
-rw-r--r--libraries/evas/src/lib/engines/common_8/evas_soft8_scanline_fill.c53
-rw-r--r--libraries/evas/src/lib/file/Makefile.am25
-rw-r--r--libraries/evas/src/lib/file/Makefile.in680
-rw-r--r--libraries/evas/src/lib/file/evas_module.c586
-rw-r--r--libraries/evas/src/lib/file/evas_module.h94
-rw-r--r--libraries/evas/src/lib/file/evas_path.c154
-rw-r--r--libraries/evas/src/lib/file/evas_path.h15
-rw-r--r--libraries/evas/src/lib/include/Makefile.am13
-rw-r--r--libraries/evas/src/lib/include/Makefile.in542
-rw-r--r--libraries/evas/src/lib/include/evas_blend_ops.h378
-rw-r--r--libraries/evas/src/lib/include/evas_common.h1242
-rw-r--r--libraries/evas/src/lib/include/evas_common_soft16.h100
-rw-r--r--libraries/evas/src/lib/include/evas_common_soft8.h184
-rw-r--r--libraries/evas/src/lib/include/evas_inline.x259
-rw-r--r--libraries/evas/src/lib/include/evas_macros.h217
-rw-r--r--libraries/evas/src/lib/include/evas_mmx.h735
-rw-r--r--libraries/evas/src/lib/include/evas_options.h69
-rw-r--r--libraries/evas/src/lib/include/evas_private.h1107
-rw-r--r--libraries/evas/src/lib/main.c150
278 files changed, 116037 insertions, 0 deletions
diff --git a/libraries/evas/src/lib/Evas.h b/libraries/evas/src/lib/Evas.h
new file mode 100644
index 0000000..5898290
--- /dev/null
+++ b/libraries/evas/src/lib/Evas.h
@@ -0,0 +1,12236 @@
1/**
2@mainpage Evas
3
4@version 1.1
5@date 2000-2011
6
7Please see the @ref authors page for contact details.
8@link Evas.h Evas API @endlink
9
10@section toc Table of Contents
11
12@li @ref intro
13@li @ref work
14@li @ref compiling
15@li @ref install
16@li @ref next_steps
17@li @ref intro_example
18
19
20@section intro What is Evas?
21
22Evas is a clean display canvas API for several target display systems
23that can draw anti-aliased text, smooth super and sub-sampled scaled
24images, alpha-blend objects and much more.
25
26It abstracts any need to know much about what the characteristics of
27your display system are or what graphics calls are used to draw them
28and how. It deals on an object level where all you do is create and
29manipulate objects in a canvas, set their properties, and the rest is
30done for you.
31
32Evas optimises the rendering pipeline to minimise effort in redrawing
33changes made to the canvas and so takes this work out of the
34programmers hand, saving a lot of time and energy.
35
36It's small and lean, designed to work on embedded systems all the way
37to large and powerful multi-cpu workstations. It can be compiled to
38only have the features you need for your target platform if you so
39wish, thus keeping it small and lean. It has several display
40back-ends, letting it display on several display systems, making it
41portable for cross-device and cross-platform development.
42
43@subsection intro_not_evas What Evas is not?
44
45Evas is not a widget set or widget toolkit, however it is their
46base. See Elementary (http://docs.enlightenment.org/auto/elementary/)
47for a toolkit based on Evas, Edje, Ecore and other Enlightenment
48technologies.
49
50It is not dependent or aware of main loops, input or output
51systems. Input should be polled from various sources and fed to
52Evas. Similarly, it will not create windows or report windows updates
53to your system, rather just drawing the pixels and reporting to the
54user the areas that were changed. Of course these operations are quite
55common and thus they are ready to use in Ecore, particularly in
56Ecore_Evas (http://docs.enlightenment.org/auto/ecore/).
57
58
59@section work How does Evas work?
60
61Evas is a canvas display library. This is markedly different from most
62display and windowing systems as a canvas is structural and is also a
63state engine, whereas most display and windowing systems are immediate
64mode display targets. Evas handles the logic between a structural
65display via its state engine, and controls the target windowing system
66in order to produce rendered results of the current canvas' state on
67the display.
68
69Immediate mode display systems retain very little, or no state. A
70program will execute a series of commands, as in the pseudo code:
71
72@verbatim
73draw line from position (0, 0) to position (100, 200);
74
75draw rectangle from position (10, 30) to position (50, 500);
76
77bitmap_handle = create_bitmap();
78scale bitmap_handle to size 100 x 100;
79draw image bitmap_handle at position (10, 30);
80@endverbatim
81
82The series of commands is executed by the windowing system and the
83results are displayed on the screen (normally). Once the commands are
84executed the display system has little or no idea of how to reproduce
85this image again, and so has to be instructed by the application how
86to redraw sections of the screen whenever needed. Each successive
87command will be executed as instructed by the application and either
88emulated by software or sent to the graphics hardware on the device to
89be performed.
90
91The advantage of such a system is that it is simple, and gives a
92program tight control over how something looks and is drawn. Given the
93increasing complexity of displays and demands by users to have better
94looking interfaces, more and more work is needing to be done at this
95level by the internals of widget sets, custom display widgets and
96other programs. This means more and more logic and display rendering
97code needs to be written time and time again, each time the
98application needs to figure out how to minimise redraws so that
99display is fast and interactive, and keep track of redraw logic. The
100power comes at a high-price, lots of extra code and work. Programmers
101not very familiar with graphics programming will often make mistakes
102at this level and produce code that is sub optimal. Those familiar
103with this kind of programming will simply get bored by writing the
104same code again and again.
105
106For example, if in the above scene, the windowing system requires the
107application to redraw the area from 0, 0 to 50, 50 (also referred as
108"expose event"), then the programmer must calculate manually the
109updates and repaint it again:
110
111@verbatim
112Redraw from position (0, 0) to position (50, 50):
113
114// what was in area (0, 0, 50, 50)?
115
116// 1. intersection part of line (0, 0) to (100, 200)?
117 draw line from position (0, 0) to position (25, 50);
118
119// 2. intersection part of rectangle (10, 30) to (50, 500)?
120 draw rectangle from position (10, 30) to position (50, 50)
121
122// 3. intersection part of image at (10, 30), size 100 x 100?
123 bitmap_subimage = subregion from position (0, 0) to position (40, 20)
124 draw image bitmap_subimage at position (10, 30);
125@endverbatim
126
127The clever reader might have noticed that, if all elements in the
128above scene are opaque, then the system is doing useless paints: part
129of the line is behind the rectangle, and part of the rectangle is
130behind the image. These useless paints tend to be very costly, as
131pixels tend to be 4 bytes in size, thus an overlapping region of 100 x
132100 pixels is around 40000 useless writes! The developer could write
133code to calculate the overlapping areas and avoid painting then, but
134then it should be mixed with the "expose event" handling mentioned
135above and quickly one realizes the initially simpler method became
136really complex.
137
138Evas is a structural system in which the programmer creates and
139manages display objects and their properties, and as a result of this
140higher level state management, the canvas is able to redraw the set of
141objects when needed to represent the current state of the canvas.
142
143For example, the pseudo code:
144
145@verbatim
146line_handle = create_line();
147set line_handle from position (0, 0) to position (100, 200);
148show line_handle;
149
150rectangle_handle = create_rectangle();
151move rectangle_handle to position (10, 30);
152resize rectangle_handle to size 40 x 470;
153show rectangle_handle;
154
155bitmap_handle = create_bitmap();
156scale bitmap_handle to size 100 x 100;
157move bitmap_handle to position (10, 30);
158show bitmap_handle;
159
160render scene;
161@endverbatim
162
163This may look longer, but when the display needs to be refreshed or
164updated, the programmer only moves, resizes, shows, hides etc. the
165objects that need to change. The programmer simply thinks at the
166object logic level, and the canvas software does the rest of the work
167for them, figuring out what actually changed in the canvas since it
168was last drawn, how to most efficiently redraw the canvas and its
169contents to reflect the current state, and then it can go off and do
170the actual drawing of the canvas.
171
172This lets the programmer think in a more natural way when dealing with
173a display, and saves time and effort of working out how to load and
174display images, render given the current display system etc. Since
175Evas also is portable across different display systems, this also
176gives the programmer the ability to have their code ported and
177displayed on different display systems with very little work.
178
179Evas can be seen as a display system that stands somewhere between a
180widget set and an immediate mode display system. It retains basic
181display logic, but does very little high-level logic such as
182scrollbars, sliders, push buttons etc.
183
184
185@section compiling How to compile using Evas ?
186
187Evas is a library your application links to. The procedure for this is
188very simple. You simply have to compile your application with the
189appropriate compiler flags that the @c pkg-config script outputs. For
190example:
191
192Compiling C or C++ files into object files:
193
194@verbatim
195gcc -c -o main.o main.c `pkg-config --cflags evas`
196@endverbatim
197
198Linking object files into a binary executable:
199
200@verbatim
201gcc -o my_application main.o `pkg-config --libs evas`
202@endverbatim
203
204You simply have to make sure that @c pkg-config is in your shell's @c
205PATH (see the manual page for your appropriate shell) and @c evas.pc
206in @c /usr/lib/pkgconfig or its path in the @c PKG_CONFIG_PATH
207environment variable. It's that simple to link and use Evas once you
208have written your code to use it.
209
210Since the program is linked to Evas, it is now able to use any
211advertised API calls to display graphics in a canvas managed by it, as
212well as use the API calls provided to manage data.
213
214You should make sure you add any extra compile and link flags to your
215compile commands that your application may need as well. The above
216example is only guaranteed to make Evas add it's own requirements.
217
218
219@section install How is it installed?
220
221Simple:
222
223@verbatim
224./configure
225make
226su -
227...
228make install
229@endverbatim
230
231@section next_steps Next Steps
232
233After you understood what Evas is and installed it in your system you
234should proceed understanding the programming interface for all
235objects, then see the specific for the most used elements. We'd
236recommend you to take a while to learn Ecore
237(http://docs.enlightenment.org/auto/ecore/) and Edje
238(http://docs.enlightenment.org/auto/edje/) as they will likely save
239you tons of work compared to using just Evas directly.
240
241Recommended reading:
242
243@li @ref Evas_Object_Group, where you'll get how to basically
244 manipulate generic objects lying on an Evas canvas, handle canvas
245 and object events, etc.
246@li @ref Evas_Object_Rectangle, to learn about the most basic object
247 type on Evas -- the rectangle.
248@li @ref Evas_Object_Polygon, to learn how to create polygon elements
249 on the canvas.
250@li @ref Evas_Line_Group, to learn how to create line elements on the
251 canvas.
252@li @ref Evas_Object_Image, to learn about image objects, over which
253 Evas can do a plethora of operations.
254@li @ref Evas_Object_Text, to learn how to create textual elements on
255 the canvas.
256@li @ref Evas_Object_Textblock, to learn how to create multiline
257 textual elements on the canvas.
258@li @ref Evas_Smart_Object_Group and @ref Evas_Smart_Group, to define
259 new objects that provide @b custom functions to handle clipping,
260 hiding, moving, resizing, color setting and more. These could
261 be as simple as a group of objects that move together (see @ref
262 Evas_Smart_Object_Clipped) up to implementations of what
263 ends to be a widget, providing some intelligence (thus the name)
264 to Evas objects -- like a button or check box, for example.
265
266@section intro_example Introductory Example
267
268@include evas-buffer-simple.c
269*/
270
271/**
272@page authors Authors
273@author Carsten Haitzler <raster@@rasterman.com>
274@author Till Adam <till@@adam-lilienthal.de>
275@author Steve Ireland <sireland@@pobox.com>
276@author Brett Nash <nash@@nash.id.au>
277@author Tilman Sauerbeck <tilman@@code-monkey.de>
278@author Corey Donohoe <atmos@@atmos.org>
279@author Yuri Hudobin <glassy_ape@@users.sourceforge.net>
280@author Nathan Ingersoll <ningerso@@d.umn.edu>
281@author Willem Monsuwe <willem@@stack.nl>
282@author Jose O Gonzalez <jose_ogp@@juno.com>
283@author Bernhard Nemec <Bernhard.Nemec@@viasyshc.com>
284@author Jorge Luis Zapata Muga <jorgeluis.zapata@@gmail.com>
285@author Cedric Bail <cedric.bail@@free.fr>
286@author Gustavo Sverzut Barbieri <barbieri@@profusion.mobi>
287@author Vincent Torri <vtorri@@univ-evry.fr>
288@author Tim Horton <hortont424@@gmail.com>
289@author Tom Hacohen <tom@@stosb.com>
290@author Mathieu Taillefumier <mathieu.taillefumier@@free.fr>
291@author Iván Briano <ivan@@profusion.mobi>
292@author Gustavo Lima Chaves <glima@@profusion.mobi>
293@author Samsung Electronics <tbd>
294@author Samsung SAIT <tbd>
295@author Sung W. Park <sungwoo@@gmail.com>
296@author Jiyoun Park <jy0703.park@@samsung.com>
297@author Myoungwoon Roy Kim(roy_kim) <myoungwoon.kim@@samsung.com> <myoungwoon@@gmail.com>
298@author Thierry el Borgi <thierry@@substantiel.fr>
299@author ChunEon Park <hermet@@hermet.pe.kr>
300@author Christopher 'devilhorns' Michael <cpmichael1@comcast.net>
301@author Seungsoo Woo <om101.woo@samsung.com>
302
303Please contact <enlightenment-devel@lists.sourceforge.net> to get in
304contact with the developers and maintainers.
305*/
306
307#ifndef _EVAS_H
308#define _EVAS_H
309
310#include <time.h>
311
312#include <Eina.h>
313
314#ifdef EAPI
315# undef EAPI
316#endif
317
318#ifdef _WIN32
319# ifdef EFL_EVAS_BUILD
320# ifdef DLL_EXPORT
321# define EAPI __declspec(dllexport)
322# else
323# define EAPI
324# endif /* ! DLL_EXPORT */
325# else
326# define EAPI __declspec(dllimport)
327# endif /* ! EFL_EVAS_BUILD */
328#else
329# ifdef __GNUC__
330# if __GNUC__ >= 4
331# define EAPI __attribute__ ((visibility("default")))
332# else
333# define EAPI
334# endif
335# else
336# define EAPI
337# endif
338#endif /* ! _WIN32 */
339
340#ifdef __cplusplus
341extern "C" {
342#endif
343
344#define EVAS_VERSION_MAJOR 1
345#define EVAS_VERSION_MINOR 0
346
347typedef struct _Evas_Version
348{
349 int major;
350 int minor;
351 int micro;
352 int revision;
353} Evas_Version;
354
355EAPI extern Evas_Version *evas_version;
356
357/**
358 * @file
359 * @brief These routines are used for Evas library interaction.
360 *
361 * @todo check boolean return values and convert to Eina_Bool
362 * @todo change all api to use EINA_SAFETY_*
363 * @todo finish api documentation
364 */
365
366/* BiDi exposed stuff */
367 /*FIXME: document */
368typedef enum _Evas_BiDi_Direction
369{
370 EVAS_BIDI_DIRECTION_NATURAL,
371 EVAS_BIDI_DIRECTION_NEUTRAL = EVAS_BIDI_DIRECTION_NATURAL,
372 EVAS_BIDI_DIRECTION_LTR,
373 EVAS_BIDI_DIRECTION_RTL
374} Evas_BiDi_Direction;
375
376/**
377 * Identifier of callbacks to be set for Evas canvases or Evas
378 * objects.
379 *
380 * The following figure illustrates some Evas callbacks:
381 *
382 * @image html evas-callbacks.png
383 * @image rtf evas-callbacks.png
384 * @image latex evas-callbacks.eps
385 *
386 * @see evas_object_event_callback_add()
387 * @see evas_event_callback_add()
388 */
389typedef enum _Evas_Callback_Type
390{
391 /*
392 * The following events are only for use with Evas objects, with
393 * evas_object_event_callback_add():
394 */
395 EVAS_CALLBACK_MOUSE_IN, /**< Mouse In Event */
396 EVAS_CALLBACK_MOUSE_OUT, /**< Mouse Out Event */
397 EVAS_CALLBACK_MOUSE_DOWN, /**< Mouse Button Down Event */
398 EVAS_CALLBACK_MOUSE_UP, /**< Mouse Button Up Event */
399 EVAS_CALLBACK_MOUSE_MOVE, /**< Mouse Move Event */
400 EVAS_CALLBACK_MOUSE_WHEEL, /**< Mouse Wheel Event */
401 EVAS_CALLBACK_MULTI_DOWN, /**< Multi-touch Down Event */
402 EVAS_CALLBACK_MULTI_UP, /**< Multi-touch Up Event */
403 EVAS_CALLBACK_MULTI_MOVE, /**< Multi-touch Move Event */
404 EVAS_CALLBACK_FREE, /**< Object Being Freed (Called after Del) */
405 EVAS_CALLBACK_KEY_DOWN, /**< Key Press Event */
406 EVAS_CALLBACK_KEY_UP, /**< Key Release Event */
407 EVAS_CALLBACK_FOCUS_IN, /**< Focus In Event */
408 EVAS_CALLBACK_FOCUS_OUT, /**< Focus Out Event */
409 EVAS_CALLBACK_SHOW, /**< Show Event */
410 EVAS_CALLBACK_HIDE, /**< Hide Event */
411 EVAS_CALLBACK_MOVE, /**< Move Event */
412 EVAS_CALLBACK_RESIZE, /**< Resize Event */
413 EVAS_CALLBACK_RESTACK, /**< Restack Event */
414 EVAS_CALLBACK_DEL, /**< Object Being Deleted (called before Free) */
415 EVAS_CALLBACK_HOLD, /**< Events go on/off hold */
416 EVAS_CALLBACK_CHANGED_SIZE_HINTS, /**< Size hints changed event */
417 EVAS_CALLBACK_IMAGE_PRELOADED, /**< Image has been preloaded */
418
419 /*
420 * The following events are only for use with Evas canvases, with
421 * evas_event_callback_add():
422 */
423 EVAS_CALLBACK_CANVAS_FOCUS_IN, /**< Canvas got focus as a whole */
424 EVAS_CALLBACK_CANVAS_FOCUS_OUT, /**< Canvas lost focus as a whole */
425 EVAS_CALLBACK_RENDER_FLUSH_PRE, /**< Called just before rendering is updated on the canvas target */
426 EVAS_CALLBACK_RENDER_FLUSH_POST, /**< Called just after rendering is updated on the canvas target */
427 EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN, /**< Canvas object got focus */
428 EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT, /**< Canvas object lost focus */
429
430 /*
431 * More Evas object event types - see evas_object_event_callback_add():
432 */
433 EVAS_CALLBACK_IMAGE_UNLOADED, /**< Image data has been unloaded (by some mechanims in Evas that throw out original image data) */
434
435 EVAS_CALLBACK_LAST /**< kept as last element/sentinel -- not really an event */
436} Evas_Callback_Type; /**< The types of events triggering a callback */
437
438/**
439 * @def EVAS_CALLBACK_PRIORITY_BEFORE
440 * Slightly more prioritized than default.
441 * @since 1.1.0
442 */
443#define EVAS_CALLBACK_PRIORITY_BEFORE -100
444/**
445 * @def EVAS_CALLBACK_PRIORITY_DEFAULT
446 * Default callback priority level
447 * @since 1.1.0
448 */
449#define EVAS_CALLBACK_PRIORITY_DEFAULT 0
450/**
451 * @def EVAS_CALLBACK_PRIORITY_AFTER
452 * Slightly less prioritized than default.
453 * @since 1.1.0
454 */
455#define EVAS_CALLBACK_PRIORITY_AFTER 100
456
457/**
458 * @typedef Evas_Callback_Priority
459 *
460 * Callback priority value. Range is -32k - 32k. The lower the number, the
461 * bigger the priority.
462 *
463 * @see EVAS_CALLBACK_PRIORITY_AFTER
464 * @see EVAS_CALLBACK_PRIORITY_BEFORE
465 * @see EVAS_CALLBACK_PRIORITY_DEFAULT
466 *
467 * @since 1.1.0
468 */
469typedef short Evas_Callback_Priority;
470
471/**
472 * Flags for Mouse Button events
473 */
474typedef enum _Evas_Button_Flags
475{
476 EVAS_BUTTON_NONE = 0, /**< No extra mouse button data */
477 EVAS_BUTTON_DOUBLE_CLICK = (1 << 0), /**< This mouse button press was the 2nd press of a double click */
478 EVAS_BUTTON_TRIPLE_CLICK = (1 << 1) /**< This mouse button press was the 3rd press of a triple click */
479} Evas_Button_Flags; /**< Flags for Mouse Button events */
480
481/**
482 * Flags for Events
483 */
484typedef enum _Evas_Event_Flags
485{
486 EVAS_EVENT_FLAG_NONE = 0, /**< No fancy flags set */
487 EVAS_EVENT_FLAG_ON_HOLD = (1 << 0), /**< This event is being delivered but should be put "on hold" until the on hold flag is unset. the event should be used for informational purposes and maybe some indications visually, but not actually perform anything */
488 EVAS_EVENT_FLAG_ON_SCROLL = (1 << 1) /**< This event flag indicates the event occurs while scrolling; for exameple, DOWN event occurs during scrolling; the event should be used for informational purposes and maybe some indications visually, but not actually perform anything */
489} Evas_Event_Flags; /**< Flags for Events */
490
491/**
492 * State of Evas_Coord_Touch_Point
493 */
494typedef enum _Evas_Touch_Point_State
495{
496 EVAS_TOUCH_POINT_DOWN, /**< Touch point is pressed down */
497 EVAS_TOUCH_POINT_UP, /**< Touch point is released */
498 EVAS_TOUCH_POINT_MOVE, /**< Touch point is moved */
499 EVAS_TOUCH_POINT_STILL, /**< Touch point is not moved after pressed */
500 EVAS_TOUCH_POINT_CANCEL /**< Touch point is calcelled */
501} Evas_Touch_Point_State;
502
503/**
504 * Flags for Font Hinting
505 * @ingroup Evas_Font_Group
506 */
507typedef enum _Evas_Font_Hinting_Flags
508{
509 EVAS_FONT_HINTING_NONE, /**< No font hinting */
510 EVAS_FONT_HINTING_AUTO, /**< Automatic font hinting */
511 EVAS_FONT_HINTING_BYTECODE /**< Bytecode font hinting */
512} Evas_Font_Hinting_Flags; /**< Flags for Font Hinting */
513
514/**
515 * Colorspaces for pixel data supported by Evas
516 * @ingroup Evas_Object_Image
517 */
518typedef enum _Evas_Colorspace
519{
520 EVAS_COLORSPACE_ARGB8888, /**< ARGB 32 bits per pixel, high-byte is Alpha, accessed 1 32bit word at a time */
521 /* these are not currently supported - but planned for the future */
522 EVAS_COLORSPACE_YCBCR422P601_PL, /**< YCbCr 4:2:2 Planar, ITU.BT-601 specifications. The data pointed to is just an array of row pointer, pointing to the Y rows, then the Cb, then Cr rows */
523 EVAS_COLORSPACE_YCBCR422P709_PL,/**< YCbCr 4:2:2 Planar, ITU.BT-709 specifications. The data pointed to is just an array of row pointer, pointing to the Y rows, then the Cb, then Cr rows */
524 EVAS_COLORSPACE_RGB565_A5P, /**< 16bit rgb565 + Alpha plane at end - 5 bits of the 8 being used per alpha byte */
525 EVAS_COLORSPACE_GRY8, /**< 8bit grayscale */
526 EVAS_COLORSPACE_YCBCR422601_PL, /**< YCbCr 4:2:2, ITU.BT-601 specifications. The data poitned to is just an array of row pointer, pointing to line of Y,Cb,Y,Cr bytes */
527 EVAS_COLORSPACE_YCBCR420NV12601_PL, /**< YCbCr 4:2:0, ITU.BT-601 specification. The data pointed to is just an array of row pointer, pointing to the Y rows, then the Cb,Cr rows. */
528 EVAS_COLORSPACE_YCBCR420TM12601_PL, /**< YCbCr 4:2:0, ITU.BT-601 specification. The data pointed to is just an array of tiled row pointer, pointing to the Y rows, then the Cb,Cr rows. */
529} Evas_Colorspace; /**< Colorspaces for pixel data supported by Evas */
530
531/**
532 * How to pack items into cells in a table.
533 * @ingroup Evas_Object_Table
534 *
535 * @see evas_object_table_homogeneous_set() for an explanation of the funcion of
536 * each one.
537 */
538typedef enum _Evas_Object_Table_Homogeneous_Mode
539{
540 EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE = 0,
541 EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE = 1,
542 EVAS_OBJECT_TABLE_HOMOGENEOUS_ITEM = 2
543} Evas_Object_Table_Homogeneous_Mode; /**< Table cell pack mode. */
544
545typedef struct _Evas_Coord_Rectangle Evas_Coord_Rectangle; /**< A generic rectangle handle */
546typedef struct _Evas_Point Evas_Point; /**< integer point */
547
548typedef struct _Evas_Coord_Point Evas_Coord_Point; /**< Evas_Coord point */
549typedef struct _Evas_Coord_Precision_Point Evas_Coord_Precision_Point; /**< Evas_Coord point with sub-pixel precision */
550
551typedef struct _Evas_Position Evas_Position; /**< associates given point in Canvas and Output */
552typedef struct _Evas_Precision_Position Evas_Precision_Position; /**< associates given point in Canvas and Output, with sub-pixel precision */
553
554/**
555 * @typedef Evas_Smart_Class
556 *
557 * A smart object's @b base class definition
558 *
559 * @ingroup Evas_Smart_Group
560 */
561typedef struct _Evas_Smart_Class Evas_Smart_Class;
562
563/**
564 * @typedef Evas_Smart_Cb_Description
565 *
566 * A smart object callback description, used to provide introspection
567 *
568 * @ingroup Evas_Smart_Group
569 */
570typedef struct _Evas_Smart_Cb_Description Evas_Smart_Cb_Description;
571
572/**
573 * @typedef Evas_Map
574 *
575 * An opaque handle to map points
576 *
577 * @see evas_map_new()
578 * @see evas_map_free()
579 * @see evas_map_dup()
580 *
581 * @ingroup Evas_Object_Group_Map
582 */
583typedef struct _Evas_Map Evas_Map;
584
585/**
586 * @typedef Evas
587 *
588 * An opaque handle to an Evas canvas.
589 *
590 * @see evas_new()
591 * @see evas_free()
592 *
593 * @ingroup Evas_Canvas
594 */
595typedef struct _Evas Evas;
596
597/**
598 * @typedef Evas_Object
599 * An Evas Object handle.
600 * @ingroup Evas_Object_Group
601 */
602typedef struct _Evas_Object Evas_Object;
603
604typedef void Evas_Performance; /**< An Evas Performance handle */
605typedef struct _Evas_Modifier Evas_Modifier; /**< An opaque type containing information on which modifier keys are registered in an Evas canvas */
606typedef struct _Evas_Lock Evas_Lock; /**< An opaque type containing information on which lock keys are registered in an Evas canvas */
607typedef struct _Evas_Smart Evas_Smart; /**< An Evas Smart Object handle */
608typedef struct _Evas_Native_Surface Evas_Native_Surface; /**< A generic datatype for engine specific native surface information */
609
610 /**
611 * @typedef Evas_Video_Surface
612 *
613 * A generic datatype for video specific surface information
614 * @see evas_object_image_video_surface_set
615 * @see evas_object_image_video_surface_get
616 * @since 1.1.0
617 */
618typedef struct _Evas_Video_Surface Evas_Video_Surface;
619
620typedef unsigned long long Evas_Modifier_Mask; /**< An Evas modifier mask type */
621
622typedef int Evas_Coord;
623typedef int Evas_Font_Size;
624typedef int Evas_Angle;
625
626struct _Evas_Coord_Rectangle /**< A rectangle in Evas_Coord */
627{
628 Evas_Coord x; /**< top-left x co-ordinate of rectangle */
629 Evas_Coord y; /**< top-left y co-ordinate of rectangle */
630 Evas_Coord w; /**< width of rectangle */
631 Evas_Coord h; /**< height of rectangle */
632};
633
634struct _Evas_Point
635{
636 int x, y;
637};
638
639struct _Evas_Coord_Point
640{
641 Evas_Coord x, y;
642};
643
644struct _Evas_Coord_Precision_Point
645{
646 Evas_Coord x, y;
647 double xsub, ysub;
648};
649
650struct _Evas_Position
651{
652 Evas_Point output;
653 Evas_Coord_Point canvas;
654};
655
656struct _Evas_Precision_Position
657{
658 Evas_Point output;
659 Evas_Coord_Precision_Point canvas;
660};
661
662typedef enum _Evas_Aspect_Control
663{
664 EVAS_ASPECT_CONTROL_NONE = 0, /**< Preference on scaling unset */
665 EVAS_ASPECT_CONTROL_NEITHER = 1, /**< Same effect as unset preference on scaling */
666 EVAS_ASPECT_CONTROL_HORIZONTAL = 2, /**< Use all horizontal container space to place an object, using the given aspect */
667 EVAS_ASPECT_CONTROL_VERTICAL = 3, /**< Use all vertical container space to place an object, using the given aspect */
668 EVAS_ASPECT_CONTROL_BOTH = 4 /**< Use all horizontal @b and vertical container spaces to place an object (never growing it out of those bounds), using the given aspect */
669} Evas_Aspect_Control; /**< Aspect types/policies for scaling size hints, used for evas_object_size_hint_aspect_set() */
670
671typedef struct _Evas_Pixel_Import_Source Evas_Pixel_Import_Source; /**< A source description of pixels for importing pixels */
672typedef struct _Evas_Engine_Info Evas_Engine_Info; /**< A generic Evas Engine information structure */
673typedef struct _Evas_Device Evas_Device; /**< A source device handle - where the event came from */
674typedef struct _Evas_Event_Mouse_Down Evas_Event_Mouse_Down; /**< Event structure for #EVAS_CALLBACK_MOUSE_DOWN event callbacks */
675typedef struct _Evas_Event_Mouse_Up Evas_Event_Mouse_Up; /**< Event structure for #EVAS_CALLBACK_MOUSE_UP event callbacks */
676typedef struct _Evas_Event_Mouse_In Evas_Event_Mouse_In; /**< Event structure for #EVAS_CALLBACK_MOUSE_IN event callbacks */
677typedef struct _Evas_Event_Mouse_Out Evas_Event_Mouse_Out; /**< Event structure for #EVAS_CALLBACK_MOUSE_OUT event callbacks */
678typedef struct _Evas_Event_Mouse_Move Evas_Event_Mouse_Move; /**< Event structure for #EVAS_CALLBACK_MOUSE_MOVE event callbacks */
679typedef struct _Evas_Event_Mouse_Wheel Evas_Event_Mouse_Wheel; /**< Event structure for #EVAS_CALLBACK_MOUSE_WHEEL event callbacks */
680typedef struct _Evas_Event_Multi_Down Evas_Event_Multi_Down; /**< Event structure for #EVAS_CALLBACK_MULTI_DOWN event callbacks */
681typedef struct _Evas_Event_Multi_Up Evas_Event_Multi_Up; /**< Event structure for #EVAS_CALLBACK_MULTI_UP event callbacks */
682typedef struct _Evas_Event_Multi_Move Evas_Event_Multi_Move; /**< Event structure for #EVAS_CALLBACK_MULTI_MOVE event callbacks */
683typedef struct _Evas_Event_Key_Down Evas_Event_Key_Down; /**< Event structure for #EVAS_CALLBACK_KEY_DOWN event callbacks */
684typedef struct _Evas_Event_Key_Up Evas_Event_Key_Up; /**< Event structure for #EVAS_CALLBACK_KEY_UP event callbacks */
685typedef struct _Evas_Event_Hold Evas_Event_Hold; /**< Event structure for #EVAS_CALLBACK_HOLD event callbacks */
686
687typedef enum _Evas_Load_Error
688{
689 EVAS_LOAD_ERROR_NONE = 0, /**< No error on load */
690 EVAS_LOAD_ERROR_GENERIC = 1, /**< A non-specific error occurred */
691 EVAS_LOAD_ERROR_DOES_NOT_EXIST = 2, /**< File (or file path) does not exist */
692 EVAS_LOAD_ERROR_PERMISSION_DENIED = 3, /**< Permission deinied to an existing file (or path) */
693 EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED = 4, /**< Allocation of resources failure prevented load */
694 EVAS_LOAD_ERROR_CORRUPT_FILE = 5, /**< File corrupt (but was detected as a known format) */
695 EVAS_LOAD_ERROR_UNKNOWN_FORMAT = 6 /**< File is not a known format */
696} Evas_Load_Error; /**< Evas image load error codes one can get - see evas_load_error_str() too. */
697
698
699typedef enum _Evas_Alloc_Error
700{
701 EVAS_ALLOC_ERROR_NONE = 0, /**< No allocation error */
702 EVAS_ALLOC_ERROR_FATAL = 1, /**< Allocation failed despite attempts to free up memory */
703 EVAS_ALLOC_ERROR_RECOVERED = 2 /**< Allocation succeeded, but extra memory had to be found by freeing up speculative resources */
704} Evas_Alloc_Error; /**< Possible allocation errors returned by evas_alloc_error() */
705
706typedef enum _Evas_Fill_Spread
707{
708 EVAS_TEXTURE_REFLECT = 0, /**< image fill tiling mode - tiling reflects */
709 EVAS_TEXTURE_REPEAT = 1, /**< tiling repeats */
710 EVAS_TEXTURE_RESTRICT = 2, /**< tiling clamps - range offset ignored */
711 EVAS_TEXTURE_RESTRICT_REFLECT = 3, /**< tiling clamps and any range offset reflects */
712 EVAS_TEXTURE_RESTRICT_REPEAT = 4, /**< tiling clamps and any range offset repeats */
713 EVAS_TEXTURE_PAD = 5 /**< tiling extends with end values */
714} Evas_Fill_Spread; /**< Fill types used for evas_object_image_fill_spread_set() */
715
716typedef enum _Evas_Pixel_Import_Pixel_Format
717{
718 EVAS_PIXEL_FORMAT_NONE = 0, /**< No pixel format */
719 EVAS_PIXEL_FORMAT_ARGB32 = 1, /**< ARGB 32bit pixel format with A in the high byte per 32bit pixel word */
720 EVAS_PIXEL_FORMAT_YUV420P_601 = 2 /**< YUV 420 Planar format with CCIR 601 color encoding wuth contiguous planes in the order Y, U and V */
721} Evas_Pixel_Import_Pixel_Format; /**< Pixel format for import call. See evas_object_image_pixels_import() */
722
723struct _Evas_Pixel_Import_Source
724{
725 Evas_Pixel_Import_Pixel_Format format; /**< pixel format type ie ARGB32, YUV420P_601 etc. */
726 int w, h; /**< width and height of source in pixels */
727 void **rows; /**< an array of pointers (size depends on format) pointing to left edge of each scanline */
728};
729
730/* magic version number to know what the native surf struct looks like */
731#define EVAS_NATIVE_SURFACE_VERSION 2
732
733typedef enum _Evas_Native_Surface_Type
734{
735 EVAS_NATIVE_SURFACE_NONE,
736 EVAS_NATIVE_SURFACE_X11,
737 EVAS_NATIVE_SURFACE_OPENGL
738} Evas_Native_Surface_Type;
739
740struct _Evas_Native_Surface
741{
742 int version;
743 Evas_Native_Surface_Type type;
744 union {
745 struct {
746 void *visual; /**< visual of the pixmap to use (Visual) */
747 unsigned long pixmap; /**< pixmap id to use (Pixmap) */
748 } x11;
749 struct {
750 unsigned int texture_id; /**< opengl texture id to use from glGenTextures() */
751 unsigned int framebuffer_id; /**< 0 if not a FBO, FBO id otherwise from glGenFramebuffers() */
752 unsigned int internal_format; /**< same as 'internalFormat' for glTexImage2D() */
753 unsigned int format; /**< same as 'format' for glTexImage2D() */
754 unsigned int x, y, w, h; /**< region inside the texture to use (image size is assumed as texture size, with 0, 0 being the top-left and co-ordinates working down to the right and bottom being positive) */
755 } opengl;
756 } data;
757};
758
759/**
760 * @def EVAS_VIDEO_SURFACE_VERSION
761 * Magic version number to know what the video surf struct looks like
762 * @since 1.1.0
763 */
764#define EVAS_VIDEO_SURFACE_VERSION 1
765
766typedef void (*Evas_Video_Cb)(void *data, Evas_Object *obj, const Evas_Video_Surface *surface);
767typedef void (*Evas_Video_Coord_Cb)(void *data, Evas_Object *obj, const Evas_Video_Surface *surface, Evas_Coord a, Evas_Coord b);
768
769struct _Evas_Video_Surface
770{
771 int version;
772
773 Evas_Video_Coord_Cb move; /**< Move the video surface to this position */
774 Evas_Video_Coord_Cb resize; /**< Resize the video surface to that size */
775 Evas_Video_Cb show; /**< Show the video overlay surface */
776 Evas_Video_Cb hide; /**< Hide the video overlay surface */
777 Evas_Video_Cb update_pixels; /**< Please update the Evas_Object_Image pixels when called */
778
779 Evas_Object *parent;
780 void *data;
781};
782
783#define EVAS_LAYER_MIN -32768 /**< bottom-most layer number */
784#define EVAS_LAYER_MAX 32767 /**< top-most layer number */
785
786#define EVAS_COLOR_SPACE_ARGB 0 /**< Not used for anything */
787#define EVAS_COLOR_SPACE_AHSV 1 /**< Not used for anything */
788#define EVAS_TEXT_INVALID -1 /**< Not used for anything */
789#define EVAS_TEXT_SPECIAL -2 /**< Not used for anything */
790
791#define EVAS_HINT_EXPAND 1.0 /**< Use with evas_object_size_hint_weight_set(), evas_object_size_hint_weight_get(), evas_object_size_hint_expand_set(), evas_object_size_hint_expand_get() */
792#define EVAS_HINT_FILL -1.0 /**< Use with evas_object_size_hint_align_set(), evas_object_size_hint_align_get(), evas_object_size_hint_fill_set(), evas_object_size_hint_fill_get() */
793#define evas_object_size_hint_fill_set evas_object_size_hint_align_set /**< Convenience macro to make it easier to understand that align is also used for fill properties (as fill is mutually exclusive to align) */
794#define evas_object_size_hint_fill_get evas_object_size_hint_align_get /**< Convenience macro to make it easier to understand that align is also used for fill properties (as fill is mutually exclusive to align) */
795#define evas_object_size_hint_expand_set evas_object_size_hint_weight_set /**< Convenience macro to make it easier to understand that weight is also used for expand properties */
796#define evas_object_size_hint_expand_get evas_object_size_hint_weight_get /**< Convenience macro to make it easier to understand that weight is also used for expand properties */
797
798/**
799 * How the object should be rendered to output.
800 * @ingroup Evas_Object_Group_Extras
801 */
802typedef enum _Evas_Render_Op
803{
804 EVAS_RENDER_BLEND = 0, /**< default op: d = d*(1-sa) + s */
805 EVAS_RENDER_BLEND_REL = 1, /**< d = d*(1 - sa) + s*da */
806 EVAS_RENDER_COPY = 2, /**< d = s */
807 EVAS_RENDER_COPY_REL = 3, /**< d = s*da */
808 EVAS_RENDER_ADD = 4, /**< d = d + s */
809 EVAS_RENDER_ADD_REL = 5, /**< d = d + s*da */
810 EVAS_RENDER_SUB = 6, /**< d = d - s */
811 EVAS_RENDER_SUB_REL = 7, /**< d = d - s*da */
812 EVAS_RENDER_TINT = 8, /**< d = d*s + d*(1 - sa) + s*(1 - da) */
813 EVAS_RENDER_TINT_REL = 9, /**< d = d*(1 - sa + s) */
814 EVAS_RENDER_MASK = 10, /**< d = d*sa */
815 EVAS_RENDER_MUL = 11 /**< d = d*s */
816} Evas_Render_Op; /**< How the object should be rendered to output. */
817
818typedef enum _Evas_Border_Fill_Mode
819{
820 EVAS_BORDER_FILL_NONE = 0, /**< Image's center region is @b not to be rendered */
821 EVAS_BORDER_FILL_DEFAULT = 1, /**< Image's center region is to be @b blended with objects underneath it, if it has transparency. This is the default behavior for image objects */
822 EVAS_BORDER_FILL_SOLID = 2 /**< Image's center region is to be made solid, even if it has transparency on it */
823} Evas_Border_Fill_Mode; /**< How an image's center region (the complement to the border region) should be rendered by Evas */
824
825typedef enum _Evas_Image_Scale_Hint
826{
827 EVAS_IMAGE_SCALE_HINT_NONE = 0, /**< No scale hint at all */
828 EVAS_IMAGE_SCALE_HINT_DYNAMIC = 1, /**< Image is being re-scaled over time, thus turning scaling cache @b off for its data */
829 EVAS_IMAGE_SCALE_HINT_STATIC = 2 /**< Image is not being re-scaled over time, thus turning scaling cache @b on for its data */
830} Evas_Image_Scale_Hint; /**< How an image's data is to be treated by Evas, with regard to scaling cache */
831
832typedef enum _Evas_Image_Animated_Loop_Hint
833{
834 EVAS_IMAGE_ANIMATED_HINT_NONE = 0,
835 EVAS_IMAGE_ANIMATED_HINT_LOOP = 1, /**< Image's animation mode is loop like 1->2->3->1->2->3 */
836 EVAS_IMAGE_ANIMATED_HINT_PINGPONG = 2 /**< Image's animation mode is pingpong like 1->2->3->2->1-> ... */
837} Evas_Image_Animated_Loop_Hint;
838
839typedef enum _Evas_Engine_Render_Mode
840{
841 EVAS_RENDER_MODE_BLOCKING = 0,
842 EVAS_RENDER_MODE_NONBLOCKING = 1,
843} Evas_Engine_Render_Mode;
844
845typedef enum _Evas_Image_Content_Hint
846{
847 EVAS_IMAGE_CONTENT_HINT_NONE = 0, /**< No hint at all */
848 EVAS_IMAGE_CONTENT_HINT_DYNAMIC = 1, /**< The contents will change over time */
849 EVAS_IMAGE_CONTENT_HINT_STATIC = 2 /**< The contents won't change over time */
850} Evas_Image_Content_Hint; /**< How an image's data is to be treated by Evas, for optimization */
851
852struct _Evas_Engine_Info /** Generic engine information. Generic info is useless */
853{
854 int magic; /**< Magic number */
855};
856
857struct _Evas_Event_Mouse_Down /** Mouse button press event */
858{
859 int button; /**< Mouse button number that went down (1 - 32) */
860
861 Evas_Point output; /**< The X/Y location of the cursor */
862 Evas_Coord_Point canvas; /**< The X/Y location of the cursor */
863
864 void *data;
865 Evas_Modifier *modifiers; /**< modifier keys pressed during the event */
866 Evas_Lock *locks;
867
868 Evas_Button_Flags flags; /**< button flags set during the event */
869 unsigned int timestamp;
870 Evas_Event_Flags event_flags;
871 Evas_Device *dev;
872};
873
874struct _Evas_Event_Mouse_Up /** Mouse button release event */
875{
876 int button; /**< Mouse button number that was raised (1 - 32) */
877
878 Evas_Point output;
879 Evas_Coord_Point canvas;
880
881 void *data;
882 Evas_Modifier *modifiers;
883 Evas_Lock *locks;
884
885 Evas_Button_Flags flags;
886 unsigned int timestamp;
887 Evas_Event_Flags event_flags;
888 Evas_Device *dev;
889};
890
891struct _Evas_Event_Mouse_In /** Mouse enter event */
892{
893 int buttons; /**< Button pressed mask, Bits set to 1 are buttons currently pressed (bit 0 = mouse button 1, bit 1 = mouse button 2 etc.) */
894
895 Evas_Point output;
896 Evas_Coord_Point canvas;
897
898 void *data;
899 Evas_Modifier *modifiers;
900 Evas_Lock *locks;
901 unsigned int timestamp;
902 Evas_Event_Flags event_flags;
903 Evas_Device *dev;
904};
905
906struct _Evas_Event_Mouse_Out /** Mouse leave event */
907{
908 int buttons; /**< Button pressed mask, Bits set to 1 are buttons currently pressed (bit 0 = mouse button 1, bit 1 = mouse button 2 etc.) */
909
910
911 Evas_Point output;
912 Evas_Coord_Point canvas;
913
914 void *data;
915 Evas_Modifier *modifiers;
916 Evas_Lock *locks;
917 unsigned int timestamp;
918 Evas_Event_Flags event_flags;
919 Evas_Device *dev;
920};
921
922struct _Evas_Event_Mouse_Move /** Mouse button down event */
923{
924 int buttons; /**< Button pressed mask, Bits set to 1 are buttons currently pressed (bit 0 = mouse button 1, bit 1 = mouse button 2 etc.) */
925
926 Evas_Position cur, prev;
927
928 void *data;
929 Evas_Modifier *modifiers;
930 Evas_Lock *locks;
931 unsigned int timestamp;
932 Evas_Event_Flags event_flags;
933 Evas_Device *dev;
934};
935
936struct _Evas_Event_Mouse_Wheel /** Wheel event */
937{
938 int direction; /* 0 = default up/down wheel FIXME: more wheel types */
939 int z; /* ...,-2,-1 = down, 1,2,... = up */
940
941 Evas_Point output;
942 Evas_Coord_Point canvas;
943
944 void *data;
945 Evas_Modifier *modifiers;
946 Evas_Lock *locks;
947 unsigned int timestamp;
948 Evas_Event_Flags event_flags;
949 Evas_Device *dev;
950};
951
952struct _Evas_Event_Multi_Down /** Multi button press event */
953{
954 int device; /**< Multi device number that went down (1 or more for extra touches) */
955 double radius, radius_x, radius_y;
956 double pressure, angle;
957
958 Evas_Point output;
959 Evas_Coord_Precision_Point canvas;
960
961 void *data;
962 Evas_Modifier *modifiers;
963 Evas_Lock *locks;
964
965 Evas_Button_Flags flags;
966 unsigned int timestamp;
967 Evas_Event_Flags event_flags;
968 Evas_Device *dev;
969};
970
971struct _Evas_Event_Multi_Up /** Multi button release event */
972{
973 int device; /**< Multi device number that went up (1 or more for extra touches) */
974 double radius, radius_x, radius_y;
975 double pressure, angle;
976
977 Evas_Point output;
978 Evas_Coord_Precision_Point canvas;
979
980 void *data;
981 Evas_Modifier *modifiers;
982 Evas_Lock *locks;
983
984 Evas_Button_Flags flags;
985 unsigned int timestamp;
986 Evas_Event_Flags event_flags;
987 Evas_Device *dev;
988};
989
990struct _Evas_Event_Multi_Move /** Multi button down event */
991{
992 int device; /**< Multi device number that moved (1 or more for extra touches) */
993 double radius, radius_x, radius_y;
994 double pressure, angle;
995
996 Evas_Precision_Position cur;
997
998 void *data;
999 Evas_Modifier *modifiers;
1000 Evas_Lock *locks;
1001 unsigned int timestamp;
1002 Evas_Event_Flags event_flags;
1003 Evas_Device *dev;
1004};
1005
1006struct _Evas_Event_Key_Down /** Key press event */
1007{
1008 char *keyname; /**< the name string of the key pressed */
1009 void *data;
1010 Evas_Modifier *modifiers;
1011 Evas_Lock *locks;
1012
1013 const char *key; /**< The logical key : (eg shift+1 == exclamation) */
1014 const char *string; /**< A UTF8 string if this keystroke has produced a visible string to be ADDED */
1015 const char *compose; /**< A UTF8 string if this keystroke has modified a string in the middle of being composed - this string replaces the previous one */
1016 unsigned int timestamp;
1017 Evas_Event_Flags event_flags;
1018 Evas_Device *dev;
1019};
1020
1021struct _Evas_Event_Key_Up /** Key release event */
1022{
1023 char *keyname; /**< the name string of the key released */
1024 void *data;
1025 Evas_Modifier *modifiers;
1026 Evas_Lock *locks;
1027
1028 const char *key; /**< The logical key : (eg shift+1 == exclamation) */
1029 const char *string; /**< A UTF8 string if this keystroke has produced a visible string to be ADDED */
1030 const char *compose; /**< A UTF8 string if this keystroke has modified a string in the middle of being composed - this string replaces the previous one */
1031 unsigned int timestamp;
1032 Evas_Event_Flags event_flags;
1033 Evas_Device *dev;
1034};
1035
1036struct _Evas_Event_Hold /** Hold change event */
1037{
1038 int hold; /**< The hold flag */
1039 void *data;
1040
1041 unsigned int timestamp;
1042 Evas_Event_Flags event_flags;
1043 Evas_Device *dev;
1044};
1045
1046/**
1047 * How the mouse pointer should be handled by Evas.
1048 *
1049 * In the mode #EVAS_OBJECT_POINTER_MODE_AUTOGRAB, when a mouse button
1050 * is pressed down over an object and held, with the mouse pointer
1051 * being moved outside of it, the pointer still behaves as being bound
1052 * to that object, albeit out of its drawing region. When the button
1053 * is released, the event will be fed to the object, that may check if
1054 * the final position is over it or not and do something about it.
1055 *
1056 * In the mode #EVAS_OBJECT_POINTER_MODE_NOGRAB, the pointer will
1057 * always be bound to the object right below it.
1058 *
1059 * @ingroup Evas_Object_Group_Extras
1060 */
1061typedef enum _Evas_Object_Pointer_Mode
1062{
1063 EVAS_OBJECT_POINTER_MODE_AUTOGRAB, /**< default, X11-like */
1064 EVAS_OBJECT_POINTER_MODE_NOGRAB /**< pointer always bound to the object right below it */
1065} Evas_Object_Pointer_Mode; /**< How the mouse pointer should be handled by Evas. */
1066
1067typedef void (*Evas_Smart_Cb) (void *data, Evas_Object *obj, void *event_info); /**< Evas smart objects' "smart callback" function signature */
1068typedef void (*Evas_Event_Cb) (void *data, Evas *e, void *event_info); /**< Evas event callback function signature */
1069typedef Eina_Bool (*Evas_Object_Event_Post_Cb) (void *data, Evas *e);
1070typedef void (*Evas_Object_Event_Cb) (void *data, Evas *e, Evas_Object *obj, void *event_info); /**< Evas object event callback function signature */
1071typedef void (*Evas_Async_Events_Put_Cb)(void *target, Evas_Callback_Type type, void *event_info);
1072
1073/**
1074 * @defgroup Evas_Group Top Level Functions
1075 *
1076 * Functions that affect Evas as a whole.
1077 */
1078
1079/**
1080 * Initialize Evas
1081 *
1082 * @return The init counter value.
1083 *
1084 * This function initializes Evas and increments a counter of the
1085 * number of calls to it. It returns the new counter's value.
1086 *
1087 * @see evas_shutdown().
1088 *
1089 * Most EFL users wouldn't be using this function directly, because
1090 * they wouldn't access Evas directly by themselves. Instead, they
1091 * would be using higher level helpers, like @c ecore_evas_init().
1092 * See http://docs.enlightenment.org/auto/ecore/.
1093 *
1094 * You should be using this if your use is something like the
1095 * following. The buffer engine is just one of the many ones Evas
1096 * provides.
1097 *
1098 * @dontinclude evas-buffer-simple.c
1099 * @skip int main
1100 * @until return -1;
1101 * And being the canvas creation something like:
1102 * @skip static Evas *create_canvas
1103 * @until evas_output_viewport_set(canvas,
1104 *
1105 * Note that this is code creating an Evas canvas with no usage of
1106 * Ecore helpers at all -- no linkage with Ecore on this scenario,
1107 * thus. Again, this wouldn't be on Evas common usage for most
1108 * developers. See the full @ref Example_Evas_Buffer_Simple "example".
1109 *
1110 * @ingroup Evas_Group
1111 */
1112EAPI int evas_init (void);
1113
1114/**
1115 * Shutdown Evas
1116 *
1117 * @return Evas' init counter value.
1118 *
1119 * This function finalizes Evas, decrementing the counter of the
1120 * number of calls to the function evas_init(). This new value for the
1121 * counter is returned.
1122 *
1123 * @see evas_init().
1124 *
1125 * If you were the sole user of Evas, by means of evas_init(), you can
1126 * check if it's being properly shut down by expecting a return value
1127 * of 0.
1128 *
1129 * Example code follows.
1130 * @dontinclude evas-buffer-simple.c
1131 * @skip // NOTE: use ecore_evas_buffer_new
1132 * @until evas_shutdown
1133 * Where that function would contain:
1134 * @skip evas_free(canvas)
1135 * @until evas_free(canvas)
1136 *
1137 * Most users would be using ecore_evas_shutdown() instead, like told
1138 * in evas_init(). See the full @ref Example_Evas_Buffer_Simple
1139 * "example".
1140 *
1141 * @ingroup Evas_Group
1142 */
1143EAPI int evas_shutdown (void);
1144
1145
1146/**
1147 * Return if any allocation errors have occurred during the prior function
1148 * @return The allocation error flag
1149 *
1150 * This function will return if any memory allocation errors occurred during,
1151 * and what kind they were. The return value will be one of
1152 * EVAS_ALLOC_ERROR_NONE, EVAS_ALLOC_ERROR_FATAL or EVAS_ALLOC_ERROR_RECOVERED
1153 * with each meaning something different.
1154 *
1155 * EVAS_ALLOC_ERROR_NONE means that no errors occurred at all and the function
1156 * worked as expected.
1157 *
1158 * EVAS_ALLOC_ERROR_FATAL means the function was completely unable to perform
1159 * its job and will have exited as cleanly as possible. The programmer
1160 * should consider this as a sign of very low memory and should try and safely
1161 * recover from the prior functions failure (or try free up memory elsewhere
1162 * and try again after more memory is freed).
1163 *
1164 * EVAS_ALLOC_ERROR_RECOVERED means that an allocation error occurred, but was
1165 * recovered from by evas finding memory of its own it has allocated and
1166 * freeing what it sees as not really usefully allocated memory. What is freed
1167 * may vary. Evas may reduce the resolution of images, free cached images or
1168 * fonts, trhow out pre-rendered data, reduce the complexity of change lists
1169 * etc. Evas and the program will function as per normal after this, but this
1170 * is a sign of low memory, and it is suggested that the program try and
1171 * identify memory it doesn't need, and free it.
1172 *
1173 * Example:
1174 * @code
1175 * extern Evas_Object *object;
1176 * void callback (void *data, Evas *e, Evas_Object *obj, void *event_info);
1177 *
1178 * evas_object_event_callback_add(object, EVAS_CALLBACK_MOUSE_DOWN, callback, NULL);
1179 * if (evas_alloc_error() == EVAS_ALLOC_ERROR_FATAL)
1180 * {
1181 * fprintf(stderr, "ERROR: Completely unable to attach callback. Must\n");
1182 * fprintf(stderr, " destroy object now as it cannot be used.\n");
1183 * evas_object_del(object);
1184 * object = NULL;
1185 * fprintf(stderr, "WARNING: Memory is really low. Cleaning out RAM.\n");
1186 * my_memory_cleanup();
1187 * }
1188 * if (evas_alloc_error() == EVAS_ALLOC_ERROR_RECOVERED)
1189 * {
1190 * fprintf(stderr, "WARNING: Memory is really low. Cleaning out RAM.\n");
1191 * my_memory_cleanup();
1192 * }
1193 * @endcode
1194 *
1195 * @ingroup Evas_Group
1196 */
1197EAPI Evas_Alloc_Error evas_alloc_error (void);
1198
1199
1200/**
1201 * @brief Get evas' internal asynchronous events read file descriptor.
1202 *
1203 * @return The canvas' asynchronous events read file descriptor.
1204 *
1205 * Evas' asynchronous events are meant to be dealt with internally,
1206 * i. e., when building stuff to be glued together into the EFL
1207 * infrastructure -- a module, for example. The context which demands
1208 * its use is when calculations need to be done out of the main
1209 * thread, asynchronously, and some action must be performed after
1210 * that.
1211 *
1212 * An example of actual use of this API is for image asynchronous
1213 * preload inside evas. If the canvas was instantiated through
1214 * ecore-evas usage, ecore itself will take care of calling those
1215 * events' processing.
1216 *
1217 * This function returns the read file descriptor where to get the
1218 * asynchronous events of the canvas. Naturally, other mainloops,
1219 * apart from ecore, may make use of it.
1220 *
1221 * @ingroup Evas_Group
1222 */
1223EAPI int evas_async_events_fd_get (void) EINA_WARN_UNUSED_RESULT EINA_PURE;
1224
1225/**
1226 * @brief Trigger the processing of all events waiting on the file
1227 * descriptor returned by evas_async_events_fd_get().
1228 *
1229 * @return The number of events processed.
1230 *
1231 * All asynchronous events queued up by evas_async_events_put() are
1232 * processed here. More precisely, the callback functions, informed
1233 * together with other event parameters, when queued, get called (with
1234 * those parameters), in that order.
1235 *
1236 * @ingroup Evas_Group
1237 */
1238EAPI int evas_async_events_process (void);
1239
1240/**
1241* Insert asynchronous events on the canvas.
1242 *
1243 * @param target The target to be affected by the events.
1244 * @param type The type of callback function.
1245 * @param event_info Information about the event.
1246 * @param func The callback function pointer.
1247 *
1248 * This is the way, for a routine running outside evas' main thread,
1249 * to report an asynchronous event. A callback function is informed,
1250 * whose call is to happen after evas_async_events_process() is
1251 * called.
1252 *
1253 * @ingroup Evas_Group
1254 */
1255EAPI Eina_Bool evas_async_events_put (const void *target, Evas_Callback_Type type, void *event_info, Evas_Async_Events_Put_Cb func) EINA_ARG_NONNULL(1, 4);
1256
1257/**
1258 * @defgroup Evas_Canvas Canvas Functions
1259 *
1260 * Low level Evas canvas functions. Sub groups will present more high
1261 * level ones, though.
1262 *
1263 * Most of these functions deal with low level Evas actions, like:
1264 * @li create/destroy raw canvases, not bound to any displaying engine
1265 * @li tell a canvas i got focused (in a windowing context, for example)
1266 * @li tell a canvas a region should not be calculated anymore in rendering
1267 * @li tell a canvas to render its contents, immediately
1268 *
1269 * Most users will be using Evas by means of the @c Ecore_Evas
1270 * wrapper, which deals with all the above mentioned issues
1271 * automatically for them. Thus, you'll be looking at this section
1272 * only if you're building low level stuff.
1273 *
1274 * The groups within present you functions that deal with the canvas
1275 * directly, too, and not yet with its @b objects. They are the
1276 * functions you need to use at a minimum to get a working canvas.
1277 *
1278 * Some of the funcions in this group are exemplified @ref
1279 * Example_Evas_Events "here".
1280 */
1281
1282/**
1283 * Creates a new empty evas.
1284 *
1285 * Note that before you can use the evas, you will to at a minimum:
1286 * @li Set its render method with @ref evas_output_method_set .
1287 * @li Set its viewport size with @ref evas_output_viewport_set .
1288 * @li Set its size of the canvas with @ref evas_output_size_set .
1289 * @li Ensure that the render engine is given the correct settings
1290 * with @ref evas_engine_info_set .
1291 *
1292 * This function should only fail if the memory allocation fails
1293 *
1294 * @note this function is very low level. Instead of using it
1295 * directly, consider using the high level functions in
1296 * Ecore_Evas such as @c ecore_evas_new(). See
1297 * http://docs.enlightenment.org/auto/ecore/.
1298 *
1299 * @attention it is recommended that one calls evas_init() before
1300 * creating new canvas.
1301 *
1302 * @return A new uninitialised Evas canvas on success. Otherwise, @c
1303 * NULL.
1304 * @ingroup Evas_Canvas
1305 */
1306EAPI Evas *evas_new (void) EINA_WARN_UNUSED_RESULT EINA_MALLOC;
1307
1308/**
1309 * Frees the given evas and any objects created on it.
1310 *
1311 * Any objects with 'free' callbacks will have those callbacks called
1312 * in this function.
1313 *
1314 * @param e The given evas.
1315 *
1316 * @ingroup Evas_Canvas
1317 */
1318EAPI void evas_free (Evas *e) EINA_ARG_NONNULL(1);
1319
1320/**
1321 * Inform to the evas that it got the focus.
1322 *
1323 * @param e The evas to change information.
1324 * @ingroup Evas_Canvas
1325 */
1326EAPI void evas_focus_in (Evas *e);
1327
1328/**
1329 * Inform to the evas that it lost the focus.
1330 *
1331 * @param e The evas to change information.
1332 * @ingroup Evas_Canvas
1333 */
1334EAPI void evas_focus_out (Evas *e);
1335
1336/**
1337 * Get the focus state known by the given evas
1338 *
1339 * @param e The evas to query information.
1340 * @ingroup Evas_Canvas
1341 */
1342EAPI Eina_Bool evas_focus_state_get (const Evas *e) EINA_PURE;
1343
1344/**
1345 * Push the nochange flag up 1
1346 *
1347 * This tells evas, that while the nochange flag is greater than 0, do not
1348 * mark objects as "changed" when making changes.
1349 *
1350 * @param e The evas to change information.
1351 * @ingroup Evas_Canvas
1352 */
1353EAPI void evas_nochange_push (Evas *e);
1354
1355/**
1356 * Pop the nochange flag down 1
1357 *
1358 * This tells evas, that while the nochange flag is greater than 0, do not
1359 * mark objects as "changed" when making changes.
1360 *
1361 * @param e The evas to change information.
1362 * @ingroup Evas_Canvas
1363 */
1364EAPI void evas_nochange_pop (Evas *e);
1365
1366
1367/**
1368 * Attaches a specific pointer to the evas for fetching later
1369 *
1370 * @param e The canvas to attach the pointer to
1371 * @param data The pointer to attach
1372 * @ingroup Evas_Canvas
1373 */
1374EAPI void evas_data_attach_set (Evas *e, void *data) EINA_ARG_NONNULL(1);
1375
1376/**
1377 * Returns the pointer attached by evas_data_attach_set()
1378 *
1379 * @param e The canvas to attach the pointer to
1380 * @return The pointer attached
1381 * @ingroup Evas_Canvas
1382 */
1383EAPI void *evas_data_attach_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
1384
1385
1386/**
1387 * Add a damage rectangle.
1388 *
1389 * @param e The given canvas pointer.
1390 * @param x The rectangle's left position.
1391 * @param y The rectangle's top position.
1392 * @param w The rectangle's width.
1393 * @param h The rectangle's height.
1394 *
1395 * This is the function by which one tells evas that a part of the
1396 * canvas has to be repainted.
1397 *
1398 * @ingroup Evas_Canvas
1399 */
1400EAPI void evas_damage_rectangle_add (Evas *e, int x, int y, int w, int h) EINA_ARG_NONNULL(1);
1401
1402/**
1403 * Add an "obscured region" to an Evas canvas.
1404 *
1405 * @param e The given canvas pointer.
1406 * @param x The rectangle's top left corner's horizontal coordinate.
1407 * @param y The rectangle's top left corner's vertical coordinate
1408 * @param w The rectangle's width.
1409 * @param h The rectangle's height.
1410 *
1411 * This is the function by which one tells an Evas canvas that a part
1412 * of it <b>must not</b> be repainted. The region must be
1413 * rectangular and its coordinates inside the canvas viewport are
1414 * passed in the call. After this call, the region specified won't
1415 * participate in any form in Evas' calculations and actions during
1416 * its rendering updates, having its displaying content frozen as it
1417 * was just after this function took place.
1418 *
1419 * We call it "obscured region" because the most common use case for
1420 * this rendering (partial) freeze is something else (most problaby
1421 * other canvas) being on top of the specified rectangular region,
1422 * thus shading it completely from the user's final scene in a
1423 * display. To avoid unnecessary processing, one should indicate to the
1424 * obscured canvas not to bother about the non-important area.
1425 *
1426 * The majority of users won't have to worry about this funcion, as
1427 * they'll be using just one canvas in their applications, with
1428 * nothing inset or on top of it in any form.
1429 *
1430 * To make this region one that @b has to be repainted again, call the
1431 * function evas_obscured_clear().
1432 *
1433 * @note This is a <b>very low level function</b>, which most of
1434 * Evas' users wouldn't care about.
1435 *
1436 * @note This function does @b not flag the canvas as having its state
1437 * changed. If you want to re-render it afterwards expecting new
1438 * contents, you have to add "damage" regions yourself (see
1439 * evas_damage_rectangle_add()).
1440 *
1441 * @see evas_obscured_clear()
1442 * @see evas_render_updates()
1443 *
1444 * Example code follows.
1445 * @dontinclude evas-events.c
1446 * @skip add an obscured
1447 * @until evas_obscured_clear(evas);
1448 *
1449 * In that example, pressing the "Ctrl" and "o" keys will impose or
1450 * remove an obscured region in the middle of the canvas. You'll get
1451 * the same contents at the time the key was pressed, if toggling it
1452 * on, until you toggle it off again (make sure the animation is
1453 * running on to get the idea better). See the full @ref
1454 * Example_Evas_Events "example".
1455 *
1456 * @ingroup Evas_Canvas
1457 */
1458EAPI void evas_obscured_rectangle_add (Evas *e, int x, int y, int w, int h) EINA_ARG_NONNULL(1);
1459
1460/**
1461 * Remove all "obscured regions" from an Evas canvas.
1462 *
1463 * @param e The given canvas pointer.
1464 *
1465 * This function removes all the rectangles from the obscured regions
1466 * list of the canvas @p e. It takes obscured areas added with
1467 * evas_obscured_rectangle_add() and make them again a regions that @b
1468 * have to be repainted on rendering updates.
1469 *
1470 * @note This is a <b>very low level function</b>, which most of
1471 * Evas' users wouldn't care about.
1472 *
1473 * @note This function does @b not flag the canvas as having its state
1474 * changed. If you want to re-render it afterwards expecting new
1475 * contents, you have to add "damage" regions yourself (see
1476 * evas_damage_rectangle_add()).
1477 *
1478 * @see evas_obscured_rectangle_add() for an example
1479 * @see evas_render_updates()
1480 *
1481 * @ingroup Evas_Canvas
1482 */
1483EAPI void evas_obscured_clear (Evas *e) EINA_ARG_NONNULL(1);
1484
1485/**
1486 * Force immediate renderization of the given Evas canvas.
1487 *
1488 * @param e The given canvas pointer.
1489 * @return A newly allocated list of updated rectangles of the canvas
1490 * (@c Eina_Rectangle structs). Free this list with
1491 * evas_render_updates_free().
1492 *
1493 * This function forces an immediate renderization update of the given
1494 * canvas @e.
1495 *
1496 * @note This is a <b>very low level function</b>, which most of
1497 * Evas' users wouldn't care about. One would use it, for example, to
1498 * grab an Evas' canvas update regions and paint them back, using the
1499 * canvas' pixmap, on a displaying system working below Evas.
1500 *
1501 * @note Evas is a stateful canvas. If no operations changing its
1502 * state took place since the last rendering action, you won't see no
1503 * changes and this call will be a no-op.
1504 *
1505 * Example code follows.
1506 * @dontinclude evas-events.c
1507 * @skip add an obscured
1508 * @until d.obscured = !d.obscured;
1509 *
1510 * See the full @ref Example_Evas_Events "example".
1511 *
1512 * @ingroup Evas_Canvas
1513 */
1514EAPI Eina_List *evas_render_updates (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1515
1516/**
1517 * Free the rectangles returned by evas_render_updates().
1518 *
1519 * @param updates The list of updated rectangles of the canvas.
1520 *
1521 * This function removes the region from the render updates list. It
1522 * makes the region doesn't be render updated anymore.
1523 *
1524 * @see evas_render_updates() for an example
1525 *
1526 * @ingroup Evas_Canvas
1527 */
1528EAPI void evas_render_updates_free (Eina_List *updates);
1529
1530/**
1531 * Force renderization of the given canvas.
1532 *
1533 * @param e The given canvas pointer.
1534 *
1535 * @ingroup Evas_Canvas
1536 */
1537EAPI void evas_render (Evas *e) EINA_ARG_NONNULL(1);
1538
1539/**
1540 * Update the canvas internal objects but not triggering immediate
1541 * renderization.
1542 *
1543 * @param e The given canvas pointer.
1544 *
1545 * This function updates the canvas internal objects not triggering
1546 * renderization. To force renderization function evas_render() should
1547 * be used.
1548 *
1549 * @see evas_render.
1550 *
1551 * @ingroup Evas_Canvas
1552 */
1553EAPI void evas_norender (Evas *e) EINA_ARG_NONNULL(1);
1554
1555/**
1556 * Make the canvas discard internally cached data used for rendering.
1557 *
1558 * @param e The given canvas pointer.
1559 *
1560 * This function flushes the arrays of delete, active and render objects.
1561 * Other things it may also discard are: shared memory segments,
1562 * temporary scratch buffers, cached data to avoid re-compute of that data etc.
1563 *
1564 * @ingroup Evas_Canvas
1565 */
1566EAPI void evas_render_idle_flush (Evas *e) EINA_ARG_NONNULL(1);
1567
1568/**
1569 * Make the canvas discard as much data as possible used by the engine at
1570 * runtime.
1571 *
1572 * @param e The given canvas pointer.
1573 *
1574 * This function will unload images, delete textures and much more, where
1575 * possible. You may also want to call evas_render_idle_flush() immediately
1576 * prior to this to perhaps discard a little more, though evas_render_dump()
1577 * should implicitly delete most of what evas_render_idle_flush() might
1578 * discard too.
1579 *
1580 * @ingroup Evas_Canvas
1581 */
1582EAPI void evas_render_dump (Evas *e) EINA_ARG_NONNULL(1);
1583
1584/**
1585 * @defgroup Evas_Output_Method Render Engine Functions
1586 *
1587 * Functions that are used to set the render engine for a given
1588 * function, and then get that engine working.
1589 *
1590 * The following code snippet shows how they can be used to
1591 * initialise an evas that uses the X11 software engine:
1592 * @code
1593 * Evas *evas;
1594 * Evas_Engine_Info_Software_X11 *einfo;
1595 * extern Display *display;
1596 * extern Window win;
1597 *
1598 * evas_init();
1599 *
1600 * evas = evas_new();
1601 * evas_output_method_set(evas, evas_render_method_lookup("software_x11"));
1602 * evas_output_size_set(evas, 640, 480);
1603 * evas_output_viewport_set(evas, 0, 0, 640, 480);
1604 * einfo = (Evas_Engine_Info_Software_X11 *)evas_engine_info_get(evas);
1605 * einfo->info.display = display;
1606 * einfo->info.visual = DefaultVisual(display, DefaultScreen(display));
1607 * einfo->info.colormap = DefaultColormap(display, DefaultScreen(display));
1608 * einfo->info.drawable = win;
1609 * einfo->info.depth = DefaultDepth(display, DefaultScreen(display));
1610 * evas_engine_info_set(evas, (Evas_Engine_Info *)einfo);
1611 * @endcode
1612 *
1613 * @ingroup Evas_Canvas
1614 */
1615
1616/**
1617 * Look up a numeric ID from a string name of a rendering engine.
1618 *
1619 * @param name the name string of an engine
1620 * @return A numeric (opaque) ID for the rendering engine
1621 * @ingroup Evas_Output_Method
1622 *
1623 * This function looks up a numeric return value for the named engine
1624 * in the string @p name. This is a normal C string, NUL byte
1625 * terminated. The name is case sensitive. If the rendering engine is
1626 * available, a numeric ID for that engine is returned that is not
1627 * 0. If the engine is not available, 0 is returned, indicating an
1628 * invalid engine.
1629 *
1630 * The programmer should NEVER rely on the numeric ID of an engine
1631 * unless it is returned by this function. Programs should NOT be
1632 * written accessing render method ID's directly, without first
1633 * obtaining it from this function.
1634 *
1635 * @attention it is mandatory that one calls evas_init() before
1636 * looking up the render method.
1637 *
1638 * Example:
1639 * @code
1640 * int engine_id;
1641 * Evas *evas;
1642 *
1643 * evas_init();
1644 *
1645 * evas = evas_new();
1646 * if (!evas)
1647 * {
1648 * fprintf(stderr, "ERROR: Canvas creation failed. Fatal error.\n");
1649 * exit(-1);
1650 * }
1651 * engine_id = evas_render_method_lookup("software_x11");
1652 * if (!engine_id)
1653 * {
1654 * fprintf(stderr, "ERROR: Requested rendering engine is absent.\n");
1655 * exit(-1);
1656 * }
1657 * evas_output_method_set(evas, engine_id);
1658 * @endcode
1659 */
1660EAPI int evas_render_method_lookup (const char *name) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1661
1662/**
1663 * List all the rendering engines compiled into the copy of the Evas library
1664 *
1665 * @return A linked list whose data members are C strings of engine names
1666 * @ingroup Evas_Output_Method
1667 *
1668 * Calling this will return a handle (pointer) to an Evas linked
1669 * list. Each node in the linked list will have the data pointer be a
1670 * (char *) pointer to the name string of the rendering engine
1671 * available. The strings should never be modified, neither should the
1672 * list be modified. This list should be cleaned up as soon as the
1673 * program no longer needs it using evas_render_method_list_free(). If
1674 * no engines are available from Evas, NULL will be returned.
1675 *
1676 * Example:
1677 * @code
1678 * Eina_List *engine_list, *l;
1679 * char *engine_name;
1680 *
1681 * engine_list = evas_render_method_list();
1682 * if (!engine_list)
1683 * {
1684 * fprintf(stderr, "ERROR: Evas supports no engines! Exit.\n");
1685 * exit(-1);
1686 * }
1687 * printf("Available Evas Engines:\n");
1688 * EINA_LIST_FOREACH(engine_list, l, engine_name)
1689 * printf("%s\n", engine_name);
1690 * evas_render_method_list_free(engine_list);
1691 * @endcode
1692 */
1693EAPI Eina_List *evas_render_method_list (void) EINA_WARN_UNUSED_RESULT;
1694
1695/**
1696 * This function should be called to free a list of engine names
1697 *
1698 * @param list The Eina_List base pointer for the engine list to be freed
1699 * @ingroup Evas_Output_Method
1700 *
1701 * When this function is called it will free the engine list passed in
1702 * as @p list. The list should only be a list of engines generated by
1703 * calling evas_render_method_list(). If @p list is NULL, nothing will
1704 * happen.
1705 *
1706 * Example:
1707 * @code
1708 * Eina_List *engine_list, *l;
1709 * char *engine_name;
1710 *
1711 * engine_list = evas_render_method_list();
1712 * if (!engine_list)
1713 * {
1714 * fprintf(stderr, "ERROR: Evas supports no engines! Exit.\n");
1715 * exit(-1);
1716 * }
1717 * printf("Available Evas Engines:\n");
1718 * EINA_LIST_FOREACH(engine_list, l, engine_name)
1719 * printf("%s\n", engine_name);
1720 * evas_render_method_list_free(engine_list);
1721 * @endcode
1722 */
1723EAPI void evas_render_method_list_free (Eina_List *list);
1724
1725
1726/**
1727 * Sets the output engine for the given evas.
1728 *
1729 * Once the output engine for an evas is set, any attempt to change it
1730 * will be ignored. The value for @p render_method can be found using
1731 * @ref evas_render_method_lookup .
1732 *
1733 * @param e The given evas.
1734 * @param render_method The numeric engine value to use.
1735 *
1736 * @attention it is mandatory that one calls evas_init() before
1737 * setting the output method.
1738 *
1739 * @ingroup Evas_Output_Method
1740 */
1741EAPI void evas_output_method_set (Evas *e, int render_method) EINA_ARG_NONNULL(1);
1742
1743/**
1744 * Retrieves the number of the output engine used for the given evas.
1745 * @param e The given evas.
1746 * @return The ID number of the output engine being used. @c 0 is
1747 * returned if there is an error.
1748 * @ingroup Evas_Output_Method
1749 */
1750EAPI int evas_output_method_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
1751
1752
1753/**
1754 * Retrieves the current render engine info struct from the given evas.
1755 *
1756 * The returned structure is publicly modifiable. The contents are
1757 * valid until either @ref evas_engine_info_set or @ref evas_render
1758 * are called.
1759 *
1760 * This structure does not need to be freed by the caller.
1761 *
1762 * @param e The given evas.
1763 * @return A pointer to the Engine Info structure. @c NULL is returned if
1764 * an engine has not yet been assigned.
1765 * @ingroup Evas_Output_Method
1766 */
1767EAPI Evas_Engine_Info *evas_engine_info_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
1768
1769/**
1770 * Applies the engine settings for the given evas from the given @c
1771 * Evas_Engine_Info structure.
1772 *
1773 * To get the Evas_Engine_Info structure to use, call @ref
1774 * evas_engine_info_get . Do not try to obtain a pointer to an
1775 * @c Evas_Engine_Info structure in any other way.
1776 *
1777 * You will need to call this function at least once before you can
1778 * create objects on an evas or render that evas. Some engines allow
1779 * their settings to be changed more than once.
1780 *
1781 * Once called, the @p info pointer should be considered invalid.
1782 *
1783 * @param e The pointer to the Evas Canvas
1784 * @param info The pointer to the Engine Info to use
1785 * @return 1 if no error occurred, 0 otherwise
1786 * @ingroup Evas_Output_Method
1787 */
1788EAPI Eina_Bool evas_engine_info_set (Evas *e, Evas_Engine_Info *info) EINA_ARG_NONNULL(1);
1789
1790/**
1791 * @defgroup Evas_Output_Size Output and Viewport Resizing Functions
1792 *
1793 * Functions that set and retrieve the output and viewport size of an
1794 * evas.
1795 *
1796 * @ingroup Evas_Canvas
1797 */
1798
1799/**
1800 * Sets the output size of the render engine of the given evas.
1801 *
1802 * The evas will render to a rectangle of the given size once this
1803 * function is called. The output size is independent of the viewport
1804 * size. The viewport will be stretched to fill the given rectangle.
1805 *
1806 * The units used for @p w and @p h depend on the engine used by the
1807 * evas.
1808 *
1809 * @param e The given evas.
1810 * @param w The width in output units, usually pixels.
1811 * @param h The height in output units, usually pixels.
1812 * @ingroup Evas_Output_Size
1813 */
1814EAPI void evas_output_size_set (Evas *e, int w, int h) EINA_ARG_NONNULL(1);
1815
1816/**
1817 * Retrieve the output size of the render engine of the given evas.
1818 *
1819 * The output size is given in whatever the output units are for the
1820 * engine.
1821 *
1822 * If either @p w or @p h is @c NULL, then it is ignored. If @p e is
1823 * invalid, the returned results are undefined.
1824 *
1825 * @param e The given evas.
1826 * @param w The pointer to an integer to store the width in.
1827 * @param h The pointer to an integer to store the height in.
1828 * @ingroup Evas_Output_Size
1829 */
1830EAPI void evas_output_size_get (const Evas *e, int *w, int *h) EINA_ARG_NONNULL(1);
1831
1832/**
1833 * Sets the output viewport of the given evas in evas units.
1834 *
1835 * The output viewport is the area of the evas that will be visible to
1836 * the viewer. The viewport will be stretched to fit the output
1837 * target of the evas when rendering is performed.
1838 *
1839 * @note The coordinate values do not have to map 1-to-1 with the output
1840 * target. However, it is generally advised that it is done for ease
1841 * of use.
1842 *
1843 * @param e The given evas.
1844 * @param x The top-left corner x value of the viewport.
1845 * @param y The top-left corner y value of the viewport.
1846 * @param w The width of the viewport. Must be greater than 0.
1847 * @param h The height of the viewport. Must be greater than 0.
1848 * @ingroup Evas_Output_Size
1849 */
1850EAPI void evas_output_viewport_set (Evas *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
1851
1852/**
1853 * Get the render engine's output viewport co-ordinates in canvas units.
1854 * @param e The pointer to the Evas Canvas
1855 * @param x The pointer to a x variable to be filled in
1856 * @param y The pointer to a y variable to be filled in
1857 * @param w The pointer to a width variable to be filled in
1858 * @param h The pointer to a height variable to be filled in
1859 * @ingroup Evas_Output_Size
1860 *
1861 * Calling this function writes the current canvas output viewport
1862 * size and location values into the variables pointed to by @p x, @p
1863 * y, @p w and @p h. On success the variables have the output
1864 * location and size values written to them in canvas units. Any of @p
1865 * x, @p y, @p w or @p h that are NULL will not be written to. If @p e
1866 * is invalid, the results are undefined.
1867 *
1868 * Example:
1869 * @code
1870 * extern Evas *evas;
1871 * Evas_Coord x, y, width, height;
1872 *
1873 * evas_output_viewport_get(evas, &x, &y, &w, &h);
1874 * @endcode
1875 */
1876EAPI void evas_output_viewport_get (const Evas *e, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
1877
1878/**
1879 * @defgroup Evas_Coord_Mapping_Group Coordinate Mapping Functions
1880 *
1881 * Functions that are used to map coordinates from the canvas to the
1882 * screen or the screen to the canvas.
1883 *
1884 * @ingroup Evas_Canvas
1885 */
1886
1887/**
1888 * Convert/scale an ouput screen co-ordinate into canvas co-ordinates
1889 *
1890 * @param e The pointer to the Evas Canvas
1891 * @param x The screen/output x co-ordinate
1892 * @return The screen co-ordinate translated to canvas unit co-ordinates
1893 * @ingroup Evas_Coord_Mapping_Group
1894 *
1895 * This function takes in a horizontal co-ordinate as the @p x
1896 * parameter and converts it into canvas units, accounting for output
1897 * size, viewport size and location, returning it as the function
1898 * return value. If @p e is invalid, the results are undefined.
1899 *
1900 * Example:
1901 * @code
1902 * extern Evas *evas;
1903 * extern int screen_x;
1904 * Evas_Coord canvas_x;
1905 *
1906 * canvas_x = evas_coord_screen_x_to_world(evas, screen_x);
1907 * @endcode
1908 */
1909EAPI Evas_Coord evas_coord_screen_x_to_world (const Evas *e, int x) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1910
1911/**
1912 * Convert/scale an ouput screen co-ordinate into canvas co-ordinates
1913 *
1914 * @param e The pointer to the Evas Canvas
1915 * @param y The screen/output y co-ordinate
1916 * @return The screen co-ordinate translated to canvas unit co-ordinates
1917 * @ingroup Evas_Coord_Mapping_Group
1918 *
1919 * This function takes in a vertical co-ordinate as the @p y parameter
1920 * and converts it into canvas units, accounting for output size,
1921 * viewport size and location, returning it as the function return
1922 * value. If @p e is invalid, the results are undefined.
1923 *
1924 * Example:
1925 * @code
1926 * extern Evas *evas;
1927 * extern int screen_y;
1928 * Evas_Coord canvas_y;
1929 *
1930 * canvas_y = evas_coord_screen_y_to_world(evas, screen_y);
1931 * @endcode
1932 */
1933EAPI Evas_Coord evas_coord_screen_y_to_world (const Evas *e, int y) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1934
1935/**
1936 * Convert/scale a canvas co-ordinate into output screen co-ordinates
1937 *
1938 * @param e The pointer to the Evas Canvas
1939 * @param x The canvas x co-ordinate
1940 * @return The output/screen co-ordinate translated to output co-ordinates
1941 * @ingroup Evas_Coord_Mapping_Group
1942 *
1943 * This function takes in a horizontal co-ordinate as the @p x
1944 * parameter and converts it into output units, accounting for output
1945 * size, viewport size and location, returning it as the function
1946 * return value. If @p e is invalid, the results are undefined.
1947 *
1948 * Example:
1949 * @code
1950 * extern Evas *evas;
1951 * int screen_x;
1952 * extern Evas_Coord canvas_x;
1953 *
1954 * screen_x = evas_coord_world_x_to_screen(evas, canvas_x);
1955 * @endcode
1956 */
1957EAPI int evas_coord_world_x_to_screen (const Evas *e, Evas_Coord x) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1958
1959/**
1960 * Convert/scale a canvas co-ordinate into output screen co-ordinates
1961 *
1962 * @param e The pointer to the Evas Canvas
1963 * @param y The canvas y co-ordinate
1964 * @return The output/screen co-ordinate translated to output co-ordinates
1965 * @ingroup Evas_Coord_Mapping_Group
1966 *
1967 * This function takes in a vertical co-ordinate as the @p x parameter
1968 * and converts it into output units, accounting for output size,
1969 * viewport size and location, returning it as the function return
1970 * value. If @p e is invalid, the results are undefined.
1971 *
1972 * Example:
1973 * @code
1974 * extern Evas *evas;
1975 * int screen_y;
1976 * extern Evas_Coord canvas_y;
1977 *
1978 * screen_y = evas_coord_world_y_to_screen(evas, canvas_y);
1979 * @endcode
1980 */
1981EAPI int evas_coord_world_y_to_screen (const Evas *e, Evas_Coord y) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1982
1983/**
1984 * @defgroup Evas_Pointer_Group Pointer (Mouse) Functions
1985 *
1986 * Functions that deal with the status of the pointer (mouse cursor).
1987 *
1988 * @ingroup Evas_Canvas
1989 */
1990
1991/**
1992 * This function returns the current known pointer co-ordinates
1993 *
1994 * @param e The pointer to the Evas Canvas
1995 * @param x The pointer to an integer to be filled in
1996 * @param y The pointer to an integer to be filled in
1997 * @ingroup Evas_Pointer_Group
1998 *
1999 * This function returns the current known screen/output co-ordinates
2000 * of the mouse pointer and sets the contents of the integers pointed
2001 * to by @p x and @p y to contain these co-ordinates. If @p e is not a
2002 * valid canvas the results of this function are undefined.
2003 *
2004 * Example:
2005 * @code
2006 * extern Evas *evas;
2007 * int mouse_x, mouse_y;
2008 *
2009 * evas_pointer_output_xy_get(evas, &mouse_x, &mouse_y);
2010 * printf("Mouse is at screen position %i, %i\n", mouse_x, mouse_y);
2011 * @endcode
2012 */
2013EAPI void evas_pointer_output_xy_get (const Evas *e, int *x, int *y) EINA_ARG_NONNULL(1);
2014
2015/**
2016 * This function returns the current known pointer co-ordinates
2017 *
2018 * @param e The pointer to the Evas Canvas
2019 * @param x The pointer to a Evas_Coord to be filled in
2020 * @param y The pointer to a Evas_Coord to be filled in
2021 * @ingroup Evas_Pointer_Group
2022 *
2023 * This function returns the current known canvas unit co-ordinates of
2024 * the mouse pointer and sets the contents of the Evas_Coords pointed
2025 * to by @p x and @p y to contain these co-ordinates. If @p e is not a
2026 * valid canvas the results of this function are undefined.
2027 *
2028 * Example:
2029 * @code
2030 * extern Evas *evas;
2031 * Evas_Coord mouse_x, mouse_y;
2032 *
2033 * evas_pointer_output_xy_get(evas, &mouse_x, &mouse_y);
2034 * printf("Mouse is at canvas position %f, %f\n", mouse_x, mouse_y);
2035 * @endcode
2036 */
2037EAPI void evas_pointer_canvas_xy_get (const Evas *e, Evas_Coord *x, Evas_Coord *y) EINA_ARG_NONNULL(1);
2038
2039/**
2040 * Returns a bitmask with the mouse buttons currently pressed, set to 1
2041 *
2042 * @param e The pointer to the Evas Canvas
2043 * @return A bitmask of the currently depressed buttons on the cavas
2044 * @ingroup Evas_Pointer_Group
2045 *
2046 * Calling this function will return a 32-bit integer with the
2047 * appropriate bits set to 1 that correspond to a mouse button being
2048 * depressed. This limits Evas to a mouse devices with a maximum of 32
2049 * buttons, but that is generally in excess of any host system's
2050 * pointing device abilities.
2051 *
2052 * A canvas by default begins with no mouse buttons being pressed and
2053 * only calls to evas_event_feed_mouse_down(),
2054 * evas_event_feed_mouse_down_data(), evas_event_feed_mouse_up() and
2055 * evas_event_feed_mouse_up_data() will alter that.
2056 *
2057 * The least significant bit corresponds to the first mouse button
2058 * (button 1) and the most significant bit corresponds to the last
2059 * mouse button (button 32).
2060 *
2061 * If @p e is not a valid canvas, the return value is undefined.
2062 *
2063 * Example:
2064 * @code
2065 * extern Evas *evas;
2066 * int button_mask, i;
2067 *
2068 * button_mask = evas_pointer_button_down_mask_get(evas);
2069 * printf("Buttons currently pressed:\n");
2070 * for (i = 0; i < 32; i++)
2071 * {
2072 * if ((button_mask & (1 << i)) != 0) printf("Button %i\n", i + 1);
2073 * }
2074 * @endcode
2075 */
2076EAPI int evas_pointer_button_down_mask_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2077
2078/**
2079 * Returns whether the mouse pointer is logically inside the canvas
2080 *
2081 * @param e The pointer to the Evas Canvas
2082 * @return An integer that is 1 if the mouse is inside the canvas, 0 otherwise
2083 * @ingroup Evas_Pointer_Group
2084 *
2085 * When this function is called it will return a value of either 0 or
2086 * 1, depending on if evas_event_feed_mouse_in(),
2087 * evas_event_feed_mouse_in_data(), or evas_event_feed_mouse_out(),
2088 * evas_event_feed_mouse_out_data() have been called to feed in a
2089 * mouse enter event into the canvas.
2090 *
2091 * A return value of 1 indicates the mouse is logically inside the
2092 * canvas, and 0 implies it is logically outside the canvas.
2093 *
2094 * A canvas begins with the mouse being assumed outside (0).
2095 *
2096 * If @p e is not a valid canvas, the return value is undefined.
2097 *
2098 * Example:
2099 * @code
2100 * extern Evas *evas;
2101 *
2102 * if (evas_pointer_inside_get(evas)) printf("Mouse is in!\n");
2103 * else printf("Mouse is out!\n");
2104 * @endcode
2105 */
2106EAPI Eina_Bool evas_pointer_inside_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2107 EAPI void evas_sync(Evas *e) EINA_ARG_NONNULL(1);
2108
2109/**
2110 * @defgroup Evas_Canvas_Events Canvas Events
2111 *
2112 * Functions relating to canvas events, which are mainly reports on
2113 * its internal states changing (an object got focused, the rendering
2114 * is updated, etc).
2115 *
2116 * Some of the funcions in this group are exemplified @ref
2117 * Example_Evas_Events "here".
2118 *
2119 * @ingroup Evas_Canvas
2120 */
2121
2122/**
2123 * @addtogroup Evas_Canvas_Events
2124 * @{
2125 */
2126
2127/**
2128 * Add (register) a callback function to a given canvas event.
2129 *
2130 * @param e Canvas to attach a callback to
2131 * @param type The type of event that will trigger the callback
2132 * @param func The (callback) function to be called when the event is
2133 * triggered
2134 * @param data The data pointer to be passed to @p func
2135 *
2136 * This function adds a function callback to the canvas @p e when the
2137 * event of type @p type occurs on it. The function pointer is @p
2138 * func.
2139 *
2140 * In the event of a memory allocation error during the addition of
2141 * the callback to the canvas, evas_alloc_error() should be used to
2142 * determine the nature of the error, if any, and the program should
2143 * sensibly try and recover.
2144 *
2145 * A callback function must have the ::Evas_Event_Cb prototype
2146 * definition. The first parameter (@p data) in this definition will
2147 * have the same value passed to evas_event_callback_add() as the @p
2148 * data parameter, at runtime. The second parameter @p e is the canvas
2149 * pointer on which the event occurred. The third parameter @p
2150 * event_info is a pointer to a data structure that may or may not be
2151 * passed to the callback, depending on the event type that triggered
2152 * the callback. This is so because some events don't carry extra
2153 * context with them, but others do.
2154 *
2155 * The event type @p type to trigger the function may be one of
2156 * #EVAS_CALLBACK_RENDER_FLUSH_PRE, #EVAS_CALLBACK_RENDER_FLUSH_POST,
2157 * #EVAS_CALLBACK_CANVAS_FOCUS_IN, #EVAS_CALLBACK_CANVAS_FOCUS_OUT,
2158 * #EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN and
2159 * #EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT. This determines the kind of
2160 * event that will trigger the callback to be called. Only the last
2161 * two of the event types listed here provide useful event information
2162 * data -- a pointer to the recently focused Evas object. For the
2163 * others the @p event_info pointer is going to be @c NULL.
2164 *
2165 * Example:
2166 * @dontinclude evas-events.c
2167 * @skip evas_event_callback_add(d.canvas, EVAS_CALLBACK_RENDER_FLUSH_PRE
2168 * @until two canvas event callbacks
2169 *
2170 * Looking to the callbacks registered above,
2171 * @dontinclude evas-events.c
2172 * @skip called when our rectangle gets focus
2173 * @until let's have our events back
2174 *
2175 * we see that the canvas flushes its rendering pipeline
2176 * (#EVAS_CALLBACK_RENDER_FLUSH_PRE) whenever the @c _resize_cb
2177 * routine takes place: it has to redraw that image at a different
2178 * size. Also, the callback on an object being focused comes just
2179 * after we focus it explicitly, on code.
2180 *
2181 * See the full @ref Example_Evas_Events "example".
2182 *
2183 * @note Be careful not to add the same callback multiple times, if
2184 * that's not what you want, because Evas won't check if a callback
2185 * existed before exactly as the one being registered (and thus, call
2186 * it more than once on the event, in this case). This would make
2187 * sense if you passed different functions and/or callback data, only.
2188 */
2189EAPI void evas_event_callback_add (Evas *e, Evas_Callback_Type type, Evas_Event_Cb func, const void *data) EINA_ARG_NONNULL(1, 3);
2190
2191/**
2192 * Add (register) a callback function to a given canvas event with a
2193 * non-default priority set. Except for the priority field, it's exactly the
2194 * same as @ref evas_event_callback_add
2195 *
2196 * @param e Canvas to attach a callback to
2197 * @param type The type of event that will trigger the callback
2198 * @param priority The priority of the callback, lower values called first.
2199 * @param func The (callback) function to be called when the event is
2200 * triggered
2201 * @param data The data pointer to be passed to @p func
2202 *
2203 * @see evas_event_callback_add
2204 * @since 1.1.0
2205 */
2206EAPI void evas_event_callback_priority_add(Evas *e, Evas_Callback_Type type, Evas_Callback_Priority priority, Evas_Event_Cb func, const void *data) EINA_ARG_NONNULL(1, 4);
2207
2208/**
2209 * Delete a callback function from the canvas.
2210 *
2211 * @param e Canvas to remove a callback from
2212 * @param type The type of event that was triggering the callback
2213 * @param func The function that was to be called when the event was triggered
2214 * @return The data pointer that was to be passed to the callback
2215 *
2216 * This function removes the most recently added callback from the
2217 * canvas @p e which was triggered by the event type @p type and was
2218 * calling the function @p func when triggered. If the removal is
2219 * successful it will also return the data pointer that was passed to
2220 * evas_event_callback_add() when the callback was added to the
2221 * canvas. If not successful NULL will be returned.
2222 *
2223 * Example:
2224 * @code
2225 * extern Evas *e;
2226 * void *my_data;
2227 * void focus_in_callback(void *data, Evas *e, void *event_info);
2228 *
2229 * my_data = evas_event_callback_del(ebject, EVAS_CALLBACK_CANVAS_FOCUS_IN, focus_in_callback);
2230 * @endcode
2231 */
2232EAPI void *evas_event_callback_del (Evas *e, Evas_Callback_Type type, Evas_Event_Cb func) EINA_ARG_NONNULL(1, 3);
2233
2234/**
2235 * Delete (unregister) a callback function registered to a given
2236 * canvas event.
2237 *
2238 * @param e Canvas to remove an event callback from
2239 * @param type The type of event that was triggering the callback
2240 * @param func The function that was to be called when the event was
2241 * triggered
2242 * @param data The data pointer that was to be passed to the callback
2243 * @return The data pointer that was to be passed to the callback
2244 *
2245 * This function removes <b>the first</b> added callback from the
2246 * canvas @p e matching the event type @p type, the registered
2247 * function pointer @p func and the callback data pointer @p data. If
2248 * the removal is successful it will also return the data pointer that
2249 * was passed to evas_event_callback_add() (that will be the same as
2250 * the parameter) when the callback(s) was(were) added to the
2251 * canvas. If not successful @c NULL will be returned. A common use
2252 * would be to remove an exact match of a callback.
2253 *
2254 * Example:
2255 * @dontinclude evas-events.c
2256 * @skip evas_event_callback_del_full(evas, EVAS_CALLBACK_RENDER_FLUSH_PRE,
2257 * @until _object_focus_in_cb, NULL);
2258 *
2259 * See the full @ref Example_Evas_Events "example".
2260 *
2261 * @note For deletion of canvas events callbacks filtering by just
2262 * type and function pointer, user evas_event_callback_del().
2263 */
2264EAPI void *evas_event_callback_del_full (Evas *e, Evas_Callback_Type type, Evas_Event_Cb func, const void *data) EINA_ARG_NONNULL(1, 3);
2265
2266/**
2267 * Push a callback on the post-event callback stack
2268 *
2269 * @param e Canvas to push the callback on
2270 * @param func The function that to be called when the stack is unwound
2271 * @param data The data pointer to be passed to the callback
2272 *
2273 * Evas has a stack of callbacks that get called after all the callbacks for
2274 * an event have triggered (all the objects it triggers on and al the callbacks
2275 * in each object triggered). When all these have been called, the stack is
2276 * unwond from most recently to least recently pushed item and removed from the
2277 * stack calling the callback set for it.
2278 *
2279 * This is intended for doing reverse logic-like processing, example - when a
2280 * child object that happens to get the event later is meant to be able to
2281 * "steal" functions from a parent and thus on unwind of this stack hav its
2282 * function called first, thus being able to set flags, or return 0 from the
2283 * post-callback that stops all other post-callbacks in the current stack from
2284 * being called (thus basically allowing a child to take control, if the event
2285 * callback prepares information ready for taking action, but the post callback
2286 * actually does the action).
2287 *
2288 */
2289EAPI void evas_post_event_callback_push (Evas *e, Evas_Object_Event_Post_Cb func, const void *data);
2290
2291/**
2292 * Remove a callback from the post-event callback stack
2293 *
2294 * @param e Canvas to push the callback on
2295 * @param func The function that to be called when the stack is unwound
2296 *
2297 * This removes a callback from the stack added with
2298 * evas_post_event_callback_push(). The first instance of the function in
2299 * the callback stack is removed from being executed when the stack is
2300 * unwound. Further instances may still be run on unwind.
2301 */
2302EAPI void evas_post_event_callback_remove (Evas *e, Evas_Object_Event_Post_Cb func);
2303
2304/**
2305 * Remove a callback from the post-event callback stack
2306 *
2307 * @param e Canvas to push the callback on
2308 * @param func The function that to be called when the stack is unwound
2309 * @param data The data pointer to be passed to the callback
2310 *
2311 * This removes a callback from the stack added with
2312 * evas_post_event_callback_push(). The first instance of the function and data
2313 * in the callback stack is removed from being executed when the stack is
2314 * unwound. Further instances may still be run on unwind.
2315 */
2316EAPI void evas_post_event_callback_remove_full (Evas *e, Evas_Object_Event_Post_Cb func, const void *data);
2317
2318/**
2319 * @defgroup Evas_Event_Freezing_Group Input Events Freezing Functions
2320 *
2321 * Functions that deal with the freezing of input event processing of
2322 * an Evas canvas.
2323 *
2324 * There might be scenarios during a graphical user interface
2325 * program's use when the developer whishes the users wouldn't be able
2326 * to deliver input events to this application. It may, for example,
2327 * be the time for it to populate a view or to change some
2328 * layout. Assuming proper behavior with user interaction during this
2329 * exact time would be hard, as things are in a changing state. The
2330 * programmer can then tell the canvas to ignore input events,
2331 * bringing it back to normal behavior when he/she wants.
2332 *
2333 * Some of the funcions in this group are exemplified @ref
2334 * Example_Evas_Events "here".
2335 *
2336 * @ingroup Evas_Canvas_Events
2337 */
2338
2339/**
2340 * @addtogroup Evas_Event_Freezing_Group
2341 * @{
2342 */
2343
2344/**
2345 * Freeze all input events processing.
2346 *
2347 * @param e The canvas to freeze input events processing on.
2348 *
2349 * This function will indicate to Evas that the canvas @p e is to have
2350 * all input event processing frozen until a matching
2351 * evas_event_thaw() function is called on the same canvas. All events
2352 * of this kind during the freeze will get @b discarded. Every freeze
2353 * call must be matched by a thaw call in order to completely thaw out
2354 * a canvas (i.e. these calls may be nested). The most common use is
2355 * when you don't want the user to interect with your user interface
2356 * when you're populating a view or changing the layout.
2357 *
2358 * Example:
2359 * @dontinclude evas-events.c
2360 * @skip freeze input for 3 seconds
2361 * @until }
2362 * @dontinclude evas-events.c
2363 * @skip let's have our events back
2364 * @until }
2365 *
2366 * See the full @ref Example_Evas_Events "example".
2367 *
2368 * If you run that example, you'll see the canvas ignoring all input
2369 * events for 3 seconds, when the "f" key is pressed. In a more
2370 * realistic code we would be freezing while a toolkit or Edje was
2371 * doing some UI changes, thawing it back afterwards.
2372 */
2373EAPI void evas_event_freeze (Evas *e) EINA_ARG_NONNULL(1);
2374
2375/**
2376 * Thaw a canvas out after freezing (for input events).
2377 *
2378 * @param e The canvas to thaw out.
2379 *
2380 * This will thaw out a canvas after a matching evas_event_freeze()
2381 * call. If this call completely thaws out a canvas, i.e., there's no
2382 * other unbalanced call to evas_event_freeze(), events will start to
2383 * be processed again, but any "missed" events will @b not be
2384 * evaluated.
2385 *
2386 * See evas_event_freeze() for an example.
2387 */
2388EAPI void evas_event_thaw (Evas *e) EINA_ARG_NONNULL(1);
2389
2390/**
2391 * Return the freeze count on input events of a given canvas.
2392 *
2393 * @param e The canvas to fetch the freeze count from.
2394 *
2395 * This returns the number of times the canvas has been told to freeze
2396 * input events. It is possible to call evas_event_freeze() multiple
2397 * times, and these must be matched by evas_event_thaw() calls. This
2398 * call allows the program to discover just how many times things have
2399 * been frozen in case it may want to break out of a deep freeze state
2400 * where the count is high.
2401 *
2402 * Example:
2403 * @code
2404 * extern Evas *evas;
2405 *
2406 * while (evas_event_freeze_get(evas) > 0) evas_event_thaw(evas);
2407 * @endcode
2408 *
2409 */
2410EAPI int evas_event_freeze_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2411
2412/**
2413 * After thaw of a canvas, re-evaluate the state of objects and call callbacks
2414 *
2415 * @param e The canvas to evaluate after a thaw
2416 *
2417 * This is normally called after evas_event_thaw() to re-evaluate mouse
2418 * containment and other states and thus also call callbacks for mouse in and
2419 * out on new objects if the state change demands it.
2420 */
2421EAPI void evas_event_thaw_eval (Evas *e) EINA_ARG_NONNULL(1);
2422
2423/**
2424 * @}
2425 */
2426
2427/**
2428 * @defgroup Evas_Event_Feeding_Group Input Events Feeding Functions
2429 *
2430 * Functions to tell Evas that input events happened and should be
2431 * processed.
2432 *
2433 * As explained in @ref intro_not_evas, Evas does not know how to poll
2434 * for input events, so the developer should do it and then feed such
2435 * events to the canvas to be processed. This is only required if
2436 * operating Evas directly. Modules such as Ecore_Evas do that for
2437 * you.
2438 *
2439 * Some of the funcions in this group are exemplified @ref
2440 * Example_Evas_Events "here".
2441 *
2442 * @ingroup Evas_Canvas_Events
2443 */
2444
2445/**
2446 * @addtogroup Evas_Event_Feeding_Group
2447 * @{
2448 */
2449
2450/**
2451 * Mouse down event feed.
2452 *
2453 * @param e The given canvas pointer.
2454 * @param b The button number.
2455 * @param flags The evas button flags.
2456 * @param timestamp The timestamp of the mouse down event.
2457 * @param data The data for canvas.
2458 *
2459 * This function will set some evas properties that is necessary when
2460 * the mouse button is pressed. It prepares information to be treated
2461 * by the callback function.
2462 *
2463 */
2464EAPI void evas_event_feed_mouse_down (Evas *e, int b, Evas_Button_Flags flags, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2465
2466/**
2467 * Mouse up event feed.
2468 *
2469 * @param e The given canvas pointer.
2470 * @param b The button number.
2471 * @param flags evas button flags.
2472 * @param timestamp The timestamp of the mouse up event.
2473 * @param data The data for canvas.
2474 *
2475 * This function will set some evas properties that is necessary when
2476 * the mouse button is released. It prepares information to be treated
2477 * by the callback function.
2478 *
2479 */
2480EAPI void evas_event_feed_mouse_up (Evas *e, int b, Evas_Button_Flags flags, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2481
2482/**
2483 * Mouse move event feed.
2484 *
2485 * @param e The given canvas pointer.
2486 * @param x The horizontal position of the mouse pointer.
2487 * @param y The vertical position of the mouse pointer.
2488 * @param timestamp The timestamp of the mouse up event.
2489 * @param data The data for canvas.
2490 *
2491 * This function will set some evas properties that is necessary when
2492 * the mouse is moved from its last position. It prepares information
2493 * to be treated by the callback function.
2494 *
2495 */
2496EAPI void evas_event_feed_mouse_move (Evas *e, int x, int y, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2497
2498/**
2499 * Mouse in event feed.
2500 *
2501 * @param e The given canvas pointer.
2502 * @param timestamp The timestamp of the mouse up event.
2503 * @param data The data for canvas.
2504 *
2505 * This function will set some evas properties that is necessary when
2506 * the mouse in event happens. It prepares information to be treated
2507 * by the callback function.
2508 *
2509 */
2510EAPI void evas_event_feed_mouse_in (Evas *e, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2511
2512/**
2513 * Mouse out event feed.
2514 *
2515 * @param e The given canvas pointer.
2516 * @param timestamp Timestamp of the mouse up event.
2517 * @param data The data for canvas.
2518 *
2519 * This function will set some evas properties that is necessary when
2520 * the mouse out event happens. It prepares information to be treated
2521 * by the callback function.
2522 *
2523 */
2524EAPI void evas_event_feed_mouse_out (Evas *e, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2525 EAPI void evas_event_feed_multi_down (Evas *e, int d, int x, int y, double rad, double radx, double rady, double pres, double ang, double fx, double fy, Evas_Button_Flags flags, unsigned int timestamp, const void *data);
2526 EAPI void evas_event_feed_multi_up (Evas *e, int d, int x, int y, double rad, double radx, double rady, double pres, double ang, double fx, double fy, Evas_Button_Flags flags, unsigned int timestamp, const void *data);
2527 EAPI void evas_event_feed_multi_move (Evas *e, int d, int x, int y, double rad, double radx, double rady, double pres, double ang, double fx, double fy, unsigned int timestamp, const void *data);
2528
2529/**
2530 * Mouse cancel event feed.
2531 *
2532 * @param e The given canvas pointer.
2533 * @param timestamp The timestamp of the mouse up event.
2534 * @param data The data for canvas.
2535 *
2536 * This function will call evas_event_feed_mouse_up() when a
2537 * mouse cancel event happens.
2538 *
2539 */
2540EAPI void evas_event_feed_mouse_cancel (Evas *e, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2541
2542/**
2543 * Mouse wheel event feed.
2544 *
2545 * @param e The given canvas pointer.
2546 * @param direction The wheel mouse direction.
2547 * @param z How much mouse wheel was scrolled up or down.
2548 * @param timestamp The timestamp of the mouse up event.
2549 * @param data The data for canvas.
2550 *
2551 * This function will set some evas properties that is necessary when
2552 * the mouse wheel is scrolled up or down. It prepares information to
2553 * be treated by the callback function.
2554 *
2555 */
2556EAPI void evas_event_feed_mouse_wheel (Evas *e, int direction, int z, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2557
2558/**
2559 * Key down event feed
2560 *
2561 * @param e The canvas to thaw out
2562 * @param keyname Name of the key
2563 * @param key The key pressed.
2564 * @param string A String
2565 * @param compose The compose string
2566 * @param timestamp Timestamp of the mouse up event
2567 * @param data Data for canvas.
2568 *
2569 * This function will set some evas properties that is necessary when
2570 * a key is pressed. It prepares information to be treated by the
2571 * callback function.
2572 *
2573 */
2574EAPI void evas_event_feed_key_down (Evas *e, const char *keyname, const char *key, const char *string, const char *compose, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2575
2576/**
2577 * Key up event feed
2578 *
2579 * @param e The canvas to thaw out
2580 * @param keyname Name of the key
2581 * @param key The key released.
2582 * @param string string
2583 * @param compose compose
2584 * @param timestamp Timestamp of the mouse up event
2585 * @param data Data for canvas.
2586 *
2587 * This function will set some evas properties that is necessary when
2588 * a key is released. It prepares information to be treated by the
2589 * callback function.
2590 *
2591 */
2592EAPI void evas_event_feed_key_up (Evas *e, const char *keyname, const char *key, const char *string, const char *compose, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2593
2594/**
2595 * Hold event feed
2596 *
2597 * @param e The given canvas pointer.
2598 * @param hold The hold.
2599 * @param timestamp The timestamp of the mouse up event.
2600 * @param data The data for canvas.
2601 *
2602 * This function makes the object to stop sending events.
2603 *
2604 */
2605EAPI void evas_event_feed_hold (Evas *e, int hold, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2606
2607/**
2608 * Re feed event.
2609 *
2610 * @param e The given canvas pointer.
2611 * @param event_copy the event to refeed
2612 * @param event_type Event type
2613 *
2614 * This function re-feeds the event pointed by event_copy
2615 *
2616 * This function call evas_event_feed_* functions, so it can
2617 * cause havoc if not used wisely. Please use it responsibly.
2618 */
2619EAPI void evas_event_refeed_event (Evas *e, void *event_copy, Evas_Callback_Type event_type) EINA_ARG_NONNULL(1);
2620
2621
2622/**
2623 * @}
2624 */
2625
2626/**
2627 * @}
2628 */
2629
2630/**
2631 * @defgroup Evas_Image_Group Image Functions
2632 *
2633 * Functions that deals with images at canvas level.
2634 *
2635 * @ingroup Evas_Canvas
2636 */
2637
2638/**
2639 * @addtogroup Evas_Image_Group
2640 * @{
2641 */
2642
2643/**
2644 * Flush the image cache of the canvas.
2645 *
2646 * @param e The given evas pointer.
2647 *
2648 * This function flushes image cache of canvas.
2649 *
2650 */
2651EAPI void evas_image_cache_flush (Evas *e) EINA_ARG_NONNULL(1);
2652
2653/**
2654 * Reload the image cache
2655 *
2656 * @param e The given evas pointer.
2657 *
2658 * This function reloads the image cache of canvas.
2659 *
2660 */
2661EAPI void evas_image_cache_reload (Evas *e) EINA_ARG_NONNULL(1);
2662
2663/**
2664 * Set the image cache.
2665 *
2666 * @param e The given evas pointer.
2667 * @param size The cache size.
2668 *
2669 * This function sets the image cache of canvas in bytes.
2670 *
2671 */
2672EAPI void evas_image_cache_set (Evas *e, int size) EINA_ARG_NONNULL(1);
2673
2674/**
2675 * Get the image cache
2676 *
2677 * @param e The given evas pointer.
2678 *
2679 * This function returns the image cache size of canvas in bytes.
2680 *
2681 */
2682EAPI int evas_image_cache_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2683
2684/**
2685 * Get the maximum image size evas can possibly handle
2686 *
2687 * @param e The given evas pointer.
2688 * @param maxw Pointer to hold the return value in pixels of the maxumum width
2689 * @param maxh Pointer to hold the return value in pixels of the maximum height
2690 *
2691 * This function returns the larges image or surface size that evas can handle
2692 * in pixels, and if there is one, returns EINA_TRUE. It returns EINA_FALSE
2693 * if no extra constraint on maximum image size exists. You still should
2694 * check the return values of @p maxw and @p maxh as there may still be a
2695 * limit, just a much higher one.
2696 *
2697 * @since 1.1
2698 */
2699EAPI Eina_Bool evas_image_max_size_get (const Evas *e, int *maxw, int *maxh) EINA_ARG_NONNULL(1);
2700
2701/**
2702 * @}
2703 */
2704
2705/**
2706 * @defgroup Evas_Font_Group Font Functions
2707 *
2708 * Functions that deals with fonts.
2709 *
2710 * @ingroup Evas_Canvas
2711 */
2712
2713/**
2714 * Changes the font hinting for the given evas.
2715 *
2716 * @param e The given evas.
2717 * @param hinting The hinting to use, one of #EVAS_FONT_HINTING_NONE,
2718 * #EVAS_FONT_HINTING_AUTO, #EVAS_FONT_HINTING_BYTECODE.
2719 * @ingroup Evas_Font_Group
2720 */
2721EAPI void evas_font_hinting_set (Evas *e, Evas_Font_Hinting_Flags hinting) EINA_ARG_NONNULL(1);
2722
2723/**
2724 * Retrieves the font hinting used by the given evas.
2725 *
2726 * @param e The given evas to query.
2727 * @return The hinting in use, one of #EVAS_FONT_HINTING_NONE,
2728 * #EVAS_FONT_HINTING_AUTO, #EVAS_FONT_HINTING_BYTECODE.
2729 * @ingroup Evas_Font_Group
2730 */
2731EAPI Evas_Font_Hinting_Flags evas_font_hinting_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2732
2733/**
2734 * Checks if the font hinting is supported by the given evas.
2735 *
2736 * @param e The given evas to query.
2737 * @param hinting The hinting to use, one of #EVAS_FONT_HINTING_NONE,
2738 * #EVAS_FONT_HINTING_AUTO, #EVAS_FONT_HINTING_BYTECODE.
2739 * @return @c EINA_TRUE if it is supported, @c EINA_FALSE otherwise.
2740 * @ingroup Evas_Font_Group
2741 */
2742EAPI Eina_Bool evas_font_hinting_can_hint (const Evas *e, Evas_Font_Hinting_Flags hinting) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2743
2744
2745/**
2746 * Force the given evas and associated engine to flush its font cache.
2747 *
2748 * @param e The given evas to flush font cache.
2749 * @ingroup Evas_Font_Group
2750 */
2751EAPI void evas_font_cache_flush (Evas *e) EINA_ARG_NONNULL(1);
2752
2753/**
2754 * Changes the size of font cache of the given evas.
2755 *
2756 * @param e The given evas to flush font cache.
2757 * @param size The size, in bytes.
2758 *
2759 * @ingroup Evas_Font_Group
2760 */
2761EAPI void evas_font_cache_set (Evas *e, int size) EINA_ARG_NONNULL(1);
2762
2763/**
2764 * Changes the size of font cache of the given evas.
2765 *
2766 * @param e The given evas to flush font cache.
2767 * @return The size, in bytes.
2768 *
2769 * @ingroup Evas_Font_Group
2770 */
2771EAPI int evas_font_cache_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2772
2773
2774/**
2775 * List of available font descriptions known or found by this evas.
2776 *
2777 * The list depends on Evas compile time configuration, such as
2778 * fontconfig support, and the paths provided at runtime as explained
2779 * in @ref Evas_Font_Path_Group.
2780 *
2781 * @param e The evas instance to query.
2782 * @return a newly allocated list of strings. Do not change the
2783 * strings. Be sure to call evas_font_available_list_free()
2784 * after you're done.
2785 *
2786 * @ingroup Evas_Font_Group
2787 */
2788EAPI Eina_List *evas_font_available_list (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2789
2790/**
2791 * Free list of font descriptions returned by evas_font_dir_available_list().
2792 *
2793 * @param e The evas instance that returned such list.
2794 * @param available the list returned by evas_font_dir_available_list().
2795 *
2796 * @ingroup Evas_Font_Group
2797 */
2798EAPI void evas_font_available_list_free(Evas *e, Eina_List *available) EINA_ARG_NONNULL(1);
2799
2800/**
2801 * @defgroup Evas_Font_Path_Group Font Path Functions
2802 *
2803 * Functions that edit the paths being used to load fonts.
2804 *
2805 * @ingroup Evas_Font_Group
2806 */
2807
2808/**
2809 * Removes all font paths loaded into memory for the given evas.
2810 * @param e The given evas.
2811 * @ingroup Evas_Font_Path_Group
2812 */
2813EAPI void evas_font_path_clear (Evas *e) EINA_ARG_NONNULL(1);
2814
2815/**
2816 * Appends a font path to the list of font paths used by the given evas.
2817 * @param e The given evas.
2818 * @param path The new font path.
2819 * @ingroup Evas_Font_Path_Group
2820 */
2821EAPI void evas_font_path_append (Evas *e, const char *path) EINA_ARG_NONNULL(1, 2);
2822
2823/**
2824 * Prepends a font path to the list of font paths used by the given evas.
2825 * @param e The given evas.
2826 * @param path The new font path.
2827 * @ingroup Evas_Font_Path_Group
2828 */
2829EAPI void evas_font_path_prepend (Evas *e, const char *path) EINA_ARG_NONNULL(1, 2);
2830
2831/**
2832 * Retrieves the list of font paths used by the given evas.
2833 * @param e The given evas.
2834 * @return The list of font paths used.
2835 * @ingroup Evas_Font_Path_Group
2836 */
2837EAPI const Eina_List *evas_font_path_list (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2838
2839/**
2840 * @defgroup Evas_Object_Group Generic Object Functions
2841 *
2842 * Functions that manipulate generic Evas objects.
2843 *
2844 * All Evas displaying units are Evas objects. One handles them all by
2845 * means of the handle ::Evas_Object. Besides Evas treats their
2846 * objects equally, they have @b types, which define their specific
2847 * behavior (and individual API).
2848 *
2849 * Evas comes with a set of built-in object types:
2850 * - rectangle,
2851 * - line,
2852 * - polygon,
2853 * - text,
2854 * - textblock and
2855 * - image.
2856 *
2857 * These functions apply to @b any Evas object, whichever type thay
2858 * may have.
2859 *
2860 * @note The built-in types which are most used are rectangles, text
2861 * and images. In fact, with these ones one can create 2D interfaces
2862 * of arbitrary complexity and EFL makes it easy.
2863 */
2864
2865/**
2866 * @defgroup Evas_Object_Group_Basic Basic Object Manipulation
2867 *
2868 * Methods that are broadly used, like those that change the color,
2869 * clippers and geometry of an Evas object.
2870 *
2871 * An example on the most used functions in this group can be seen @ref
2872 * Example_Evas_Object_Manipulation "here".
2873 *
2874 * For function dealing with stacking, the examples are gathered @ref
2875 * Example_Evas_Stacking "here".
2876 *
2877 * @ingroup Evas_Object_Group
2878 */
2879
2880/**
2881 * @addtogroup Evas_Object_Group_Basic
2882 * @{
2883 */
2884
2885/**
2886 * Clip one object to another.
2887 *
2888 * @param obj The object to be clipped
2889 * @param clip The object to clip @p obj by
2890 *
2891 * This function will clip the object @p obj to the area occupied by
2892 * the object @p clip. This means the object @p obj will only be
2893 * visible within the area occupied by the clipping object (@p clip).
2894 *
2895 * The color of the object being clipped will be multiplied by the
2896 * color of the clipping one, so the resulting color for the former
2897 * will be <code>RESULT = (OBJ * CLIP) / (255 * 255)</code>, per color
2898 * element (red, green, blue and alpha).
2899 *
2900 * Clipping is recursive, so clipping objects may be clipped by
2901 * others, and their color will in term be multiplied. You may @b not
2902 * set up circular clipping lists (i.e. object 1 clips object 2, which
2903 * clips object 1): the behavior of Evas is undefined in this case.
2904 *
2905 * Objects which do not clip others are visible in the canvas as
2906 * normal; <b>those that clip one or more objects become invisible
2907 * themselves</b>, only affecting what they clip. If an object ceases
2908 * to have other objects being clipped by it, it will become visible
2909 * again.
2910 *
2911 * The visibility of an object affects the objects that are clipped by
2912 * it, so if the object clipping others is not shown (as in
2913 * evas_object_show()), the objects clipped by it will not be shown
2914 * either.
2915 *
2916 * If @p obj was being clipped by another object when this function is
2917 * called, it gets implicitly removed from the old clipper's domain
2918 * and is made now to be clipped by its new clipper.
2919 *
2920 * The following figure illustrates some clipping in Evas:
2921 *
2922 * @image html clipping.png
2923 * @image rtf clipping.png
2924 * @image latex clipping.eps
2925 *
2926 * @note At the moment the <b>only objects that can validly be used to
2927 * clip other objects are rectangle objects</b>. All other object
2928 * types are invalid and the result of using them is undefined. The
2929 * clip object @p clip must be a valid object, but can also be @c
2930 * NULL, in which case the effect of this function is the same as
2931 * calling evas_object_clip_unset() on the @p obj object.
2932 *
2933 * Example:
2934 * @dontinclude evas-object-manipulation.c
2935 * @skip solid white clipper (note that it's the default color for a
2936 * @until evas_object_show(d.clipper);
2937 *
2938 * See the full @ref Example_Evas_Object_Manipulation "example".
2939 */
2940EAPI void evas_object_clip_set (Evas_Object *obj, Evas_Object *clip) EINA_ARG_NONNULL(1, 2);
2941
2942/**
2943 * Get the object clipping @p obj (if any).
2944 *
2945 * @param obj The object to get the clipper from
2946 *
2947 * This function returns the object clipping @p obj. If @p obj is
2948 * not being clipped at all, @c NULL is returned. The object @p obj
2949 * must be a valid ::Evas_Object.
2950 *
2951 * See also evas_object_clip_set(), evas_object_clip_unset() and
2952 * evas_object_clipees_get().
2953 *
2954 * Example:
2955 * @dontinclude evas-object-manipulation.c
2956 * @skip if (evas_object_clip_get(d.img) == d.clipper)
2957 * @until return
2958 *
2959 * See the full @ref Example_Evas_Object_Manipulation "example".
2960 */
2961EAPI Evas_Object *evas_object_clip_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
2962
2963/**
2964 * Disable/cease clipping on a clipped @p obj object.
2965 *
2966 * @param obj The object to cease clipping on
2967 *
2968 * This function disables clipping for the object @p obj, if it was
2969 * already clipped, i.e., its visibility and color get detached from
2970 * the previous clipper. If it wasn't, this has no effect. The object
2971 * @p obj must be a valid ::Evas_Object.
2972 *
2973 * See also evas_object_clip_set() (for an example),
2974 * evas_object_clipees_get() and evas_object_clip_get().
2975 *
2976 */
2977EAPI void evas_object_clip_unset (Evas_Object *obj);
2978
2979/**
2980 * Return a list of objects currently clipped by @p obj.
2981 *
2982 * @param obj The object to get a list of clippees from
2983 * @return a list of objects being clipped by @p obj
2984 *
2985 * This returns the internal list handle that contains all objects
2986 * clipped by the object @p obj. If none are clipped by it, the call
2987 * returns @c NULL. This list is only valid until the clip list is
2988 * changed and should be fetched again with another call to
2989 * evas_object_clipees_get() if any objects being clipped by this
2990 * object are unclipped, clipped by a new object, deleted or get the
2991 * clipper deleted. These operations will invalidate the list
2992 * returned, so it should not be used anymore after that point. Any
2993 * use of the list after this may have undefined results, possibly
2994 * leading to crashes. The object @p obj must be a valid
2995 * ::Evas_Object.
2996 *
2997 * See also evas_object_clip_set(), evas_object_clip_unset() and
2998 * evas_object_clip_get().
2999 *
3000 * Example:
3001 * @code
3002 * extern Evas_Object *obj;
3003 * Evas_Object *clipper;
3004 *
3005 * clipper = evas_object_clip_get(obj);
3006 * if (clipper)
3007 * {
3008 * Eina_List *clippees, *l;
3009 * Evas_Object *obj_tmp;
3010 *
3011 * clippees = evas_object_clipees_get(clipper);
3012 * printf("Clipper clips %i objects\n", eina_list_count(clippees));
3013 * EINA_LIST_FOREACH(clippees, l, obj_tmp)
3014 * evas_object_show(obj_tmp);
3015 * }
3016 * @endcode
3017 */
3018EAPI const Eina_List *evas_object_clipees_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3019
3020
3021/**
3022 * Sets or unsets a given object as the currently focused one on its
3023 * canvas.
3024 *
3025 * @param obj The object to be focused or unfocused.
3026 * @param focus @c EINA_TRUE, to set it as focused or @c EINA_FALSE,
3027 * to take away the focus from it.
3028 *
3029 * Changing focus only affects where (key) input events go. There can
3030 * be only one object focused at any time. If @p focus is @c
3031 * EINA_TRUE, @p obj will be set as the currently focused object and
3032 * it will receive all keyboard events that are not exclusive key
3033 * grabs on other objects.
3034 *
3035 * Example:
3036 * @dontinclude evas-events.c
3037 * @skip evas_object_focus_set
3038 * @until evas_object_focus_set
3039 *
3040 * See the full example @ref Example_Evas_Events "here".
3041 *
3042 * @see evas_object_focus_get
3043 * @see evas_focus_get
3044 * @see evas_object_key_grab
3045 * @see evas_object_key_ungrab
3046 */
3047EAPI void evas_object_focus_set (Evas_Object *obj, Eina_Bool focus) EINA_ARG_NONNULL(1);
3048
3049/**
3050 * Retrieve whether an object has the focus.
3051 *
3052 * @param obj The object to retrieve focus information from.
3053 * @return @c EINA_TRUE if the object has the focus, @c EINA_FALSE
3054 * otherwise.
3055 *
3056 * If the passed object is the currently focused one, @c EINA_TRUE is
3057 * returned. @c EINA_FALSE is returned, otherwise.
3058 *
3059 * Example:
3060 * @dontinclude evas-events.c
3061 * @skip And again
3062 * @until something is bad
3063 *
3064 * See the full example @ref Example_Evas_Events "here".
3065 *
3066 * @see evas_object_focus_set
3067 * @see evas_focus_get
3068 * @see evas_object_key_grab
3069 * @see evas_object_key_ungrab
3070 */
3071EAPI Eina_Bool evas_object_focus_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3072
3073
3074/**
3075 * Sets the layer of the its canvas that the given object will be part
3076 * of.
3077 *
3078 * @param obj The given Evas object.
3079 * @param l The number of the layer to place the object on.
3080 * Must be between #EVAS_LAYER_MIN and #EVAS_LAYER_MAX.
3081 *
3082 * If you don't use this function, you'll be dealing with an @b unique
3083 * layer of objects, the default one. Additional layers are handy when
3084 * you don't want a set of objects to interfere with another set with
3085 * regard to @b stacking. Two layers are completely disjoint in that
3086 * matter.
3087 *
3088 * This is a low-level function, which you'd be using when something
3089 * should be always on top, for example.
3090 *
3091 * @warning Be careful, it doesn't make sense to change the layer of
3092 * smart objects' children. Smart objects have a layer of their own,
3093 * which should contain all their children objects.
3094 *
3095 * @see evas_object_layer_get()
3096 */
3097EAPI void evas_object_layer_set (Evas_Object *obj, short l) EINA_ARG_NONNULL(1);
3098
3099/**
3100 * Retrieves the layer of its canvas that the given object is part of.
3101 *
3102 * @param obj The given Evas object to query layer from
3103 * @return Number of the its layer
3104 *
3105 * @see evas_object_layer_set()
3106 */
3107EAPI short evas_object_layer_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3108
3109
3110/**
3111 * Sets the name of the given Evas object to the given name.
3112 *
3113 * @param obj The given object.
3114 * @param name The given name.
3115 *
3116 * There might be occasions where one would like to name his/her
3117 * objects.
3118 *
3119 * Example:
3120 * @dontinclude evas-events.c
3121 * @skip d.bg = evas_object_rectangle_add(d.canvas);
3122 * @until evas_object_name_set(d.bg, "our dear rectangle");
3123 *
3124 * See the full @ref Example_Evas_Events "example".
3125 */
3126EAPI void evas_object_name_set (Evas_Object *obj, const char *name) EINA_ARG_NONNULL(1);
3127
3128/**
3129 * Retrieves the name of the given Evas object.
3130 *
3131 * @param obj The given object.
3132 * @return The name of the object or @c NULL, if no name has been given
3133 * to it.
3134 *
3135 * Example:
3136 * @dontinclude evas-events.c
3137 * @skip fprintf(stdout, "An object got focused: %s\n",
3138 * @until evas_focus_get
3139 *
3140 * See the full @ref Example_Evas_Events "example".
3141 */
3142EAPI const char *evas_object_name_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3143
3144
3145/**
3146 * Increments object reference count to defer its deletion.
3147 *
3148 * @param obj The given Evas object to reference
3149 *
3150 * This increments the reference count of an object, which if greater
3151 * than 0 will defer deletion by evas_object_del() until all
3152 * references are released back (counter back to 0). References cannot
3153 * go below 0 and unreferencing past that will result in the reference
3154 * count being limited to 0. References are limited to <c>2^32 - 1</c>
3155 * for an object. Referencing it more than this will result in it
3156 * being limited to this value.
3157 *
3158 * @see evas_object_unref()
3159 * @see evas_object_del()
3160 *
3161 * @note This is a <b>very simple<b> reference counting mechanism! For
3162 * instance, Evas is not ready to check for pending references on a
3163 * canvas deletion, or things like that. This is useful on scenarios
3164 * where, inside a code block, callbacks exist which would possibly
3165 * delete an object we are operating on afterwards. Then, one would
3166 * evas_object_ref() it on the beginning of the block and
3167 * evas_object_unref() it on the end. It would then be deleted at this
3168 * point, if it should be.
3169 *
3170 * Example:
3171 * @code
3172 * evas_object_ref(obj);
3173 *
3174 * // action here...
3175 * evas_object_smart_callback_call(obj, SIG_SELECTED, NULL);
3176 * // more action here...
3177 * evas_object_unref(obj);
3178 * @endcode
3179 *
3180 * @ingroup Evas_Object_Group_Basic
3181 * @since 1.1.0
3182 */
3183EAPI void evas_object_ref (Evas_Object *obj);
3184
3185/**
3186 * Decrements object reference count.
3187 *
3188 * @param obj The given Evas object to unreference
3189 *
3190 * This decrements the reference count of an object. If the object has
3191 * had evas_object_del() called on it while references were more than
3192 * 0, it will be deleted at the time this function is called and puts
3193 * the counter back to 0. See evas_object_ref() for more information.
3194 *
3195 * @see evas_object_ref() (for an example)
3196 * @see evas_object_del()
3197 *
3198 * @ingroup Evas_Object_Group_Basic
3199 * @since 1.1.0
3200 */
3201EAPI void evas_object_unref (Evas_Object *obj);
3202
3203
3204/**
3205 * Marks the given Evas object for deletion (when Evas will free its
3206 * memory).
3207 *
3208 * @param obj The given Evas object.
3209 *
3210 * This call will mark @p obj for deletion, which will take place
3211 * whenever it has no more references to it (see evas_object_ref() and
3212 * evas_object_unref()).
3213 *
3214 * At actual deletion time, which may or may not be just after this
3215 * call, ::EVAS_CALLBACK_DEL and ::EVAS_CALLBACK_FREE callbacks will
3216 * be called. If the object currently had the focus, its
3217 * ::EVAS_CALLBACK_FOCUS_OUT callback will also be called.
3218 *
3219 * @see evas_object_ref()
3220 * @see evas_object_unref()
3221 *
3222 * @ingroup Evas_Object_Group_Basic
3223 */
3224EAPI void evas_object_del (Evas_Object *obj) EINA_ARG_NONNULL(1);
3225
3226/**
3227 * Move the given Evas object to the given location inside its
3228 * canvas' viewport.
3229 *
3230 * @param obj The given Evas object.
3231 * @param x X position to move the object to, in canvas units.
3232 * @param y Y position to move the object to, in canvas units.
3233 *
3234 * Besides being moved, the object's ::EVAS_CALLBACK_MOVE callback
3235 * will be called.
3236 *
3237 * @note Naturally, newly created objects are placed at the canvas'
3238 * origin: <code>0, 0</code>.
3239 *
3240 * Example:
3241 * @dontinclude evas-object-manipulation.c
3242 * @skip evas_object_image_border_set(d.clipper_border, 3, 3, 3, 3);
3243 * @until evas_object_show
3244 *
3245 * See the full @ref Example_Evas_Object_Manipulation "example".
3246 *
3247 * @ingroup Evas_Object_Group_Basic
3248 */
3249EAPI void evas_object_move (Evas_Object *obj, Evas_Coord x, Evas_Coord y) EINA_ARG_NONNULL(1);
3250
3251/**
3252 * Changes the size of the given Evas object.
3253 *
3254 * @param obj The given Evas object.
3255 * @param w The new width of the Evas object.
3256 * @param h The new height of the Evas object.
3257 *
3258 * Besides being resized, the object's ::EVAS_CALLBACK_RESIZE callback
3259 * will be called.
3260 *
3261 * @note Newly created objects have zeroed dimensions. Then, you most
3262 * probably want to use evas_object_resize() on them after they are
3263 * created.
3264 *
3265 * @note Be aware that resizing an object changes its drawing area,
3266 * but that does imply the object is rescaled! For instance, images
3267 * are filled inside their drawing area using the specifications of
3268 * evas_object_image_fill_set(). Thus to scale the image to match
3269 * exactly your drawing area, you need to change the
3270 * evas_object_image_fill_set() as well.
3271 *
3272 * @note This is more evident in images, but text, textblock, lines
3273 * and polygons will behave similarly. Check their specific APIs to
3274 * know how to achieve your desired behavior. Consider the following
3275 * example:
3276 *
3277 * @code
3278 * // rescale image to fill exactly its area without tiling:
3279 * evas_object_resize(img, w, h);
3280 * evas_object_image_fill_set(img, 0, 0, w, h);
3281 * @endcode
3282 *
3283 * @ingroup Evas_Object_Group_Basic
3284 */
3285EAPI void evas_object_resize (Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
3286
3287/**
3288 * Retrieves the position and (rectangular) size of the given Evas
3289 * object.
3290 *
3291 * @param obj The given Evas object.
3292 * @param x Pointer to an integer in which to store the X coordinate
3293 * of the object.
3294 * @param y Pointer to an integer in which to store the Y coordinate
3295 * of the object.
3296 * @param w Pointer to an integer in which to store the width of the
3297 * object.
3298 * @param h Pointer to an integer in which to store the height of the
3299 * object.
3300 *
3301 * The position, naturally, will be relative to the top left corner of
3302 * the canvas' viewport.
3303 *
3304 * @note Use @c NULL pointers on the geometry components you're not
3305 * interested in: they'll be ignored by the function.
3306 *
3307 * Example:
3308 * @dontinclude evas-events.c
3309 * @skip int w, h, cw, ch;
3310 * @until return
3311 *
3312 * See the full @ref Example_Evas_Events "example".
3313 *
3314 * @ingroup Evas_Object_Group_Basic
3315 */
3316EAPI void evas_object_geometry_get (const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
3317
3318
3319/**
3320 * Makes the given Evas object visible.
3321 *
3322 * @param obj The given Evas object.
3323 *
3324 * Besides becoming visible, the object's ::EVAS_CALLBACK_SHOW
3325 * callback will be called.
3326 *
3327 * @see evas_object_hide() for more on object visibility.
3328 * @see evas_object_visible_get()
3329 *
3330 * @ingroup Evas_Object_Group_Basic
3331 */
3332EAPI void evas_object_show (Evas_Object *obj) EINA_ARG_NONNULL(1);
3333
3334/**
3335 * Makes the given Evas object invisible.
3336 *
3337 * @param obj The given Evas object.
3338 *
3339 * Hidden objects, besides not being shown at all in your canvas,
3340 * won't be checked for changes on the canvas rendering
3341 * process. Furthermore, they will not catch input events. Thus, they
3342 * are much ligher (in processing needs) than an object that is
3343 * invisible due to indirect causes, such as being clipped or out of
3344 * the canvas' viewport.
3345 *
3346 * Besides becoming hidden, @p obj object's ::EVAS_CALLBACK_SHOW
3347 * callback will be called.
3348 *
3349 * @note All objects are created in the hidden state! If you want them
3350 * shown, use evas_object_show() after their creation.
3351 *
3352 * @see evas_object_show()
3353 * @see evas_object_visible_get()
3354 *
3355 * Example:
3356 * @dontinclude evas-object-manipulation.c
3357 * @skip if (evas_object_visible_get(d.clipper))
3358 * @until return
3359 *
3360 * See the full @ref Example_Evas_Object_Manipulation "example".
3361 *
3362 * @ingroup Evas_Object_Group_Basic
3363 */
3364EAPI void evas_object_hide (Evas_Object *obj) EINA_ARG_NONNULL(1);
3365
3366/**
3367 * Retrieves whether or not the given Evas object is visible.
3368 *
3369 * @param obj The given Evas object.
3370 * @return @c EINA_TRUE if the object is visible, @c EINA_FALSE
3371 * otherwise.
3372 *
3373 * This retrieves an object's visibily as the one enforced by
3374 * evas_object_show() and evas_object_hide().
3375 *
3376 * @note The value returned isn't, by any means, influenced by
3377 * clippers covering @obj, it being out of its canvas' viewport or
3378 * stacked below other object.
3379 *
3380 * @see evas_object_show()
3381 * @see evas_object_hide() (for an example)
3382 *
3383 * @ingroup Evas_Object_Group_Basic
3384 */
3385EAPI Eina_Bool evas_object_visible_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3386
3387
3388/**
3389 * Sets the general/main color of the given Evas object to the given
3390 * one.
3391 *
3392 * @param obj The given Evas object.
3393 * @param r The red component of the given color.
3394 * @param g The green component of the given color.
3395 * @param b The blue component of the given color.
3396 * @param a The alpha component of the given color.
3397 *
3398 * @see evas_object_color_get() (for an example)
3399 * @note These color values are expected to be premultiplied by @p a.
3400 *
3401 * @ingroup Evas_Object_Group_Basic
3402 */
3403EAPI void evas_object_color_set (Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
3404
3405/**
3406 * Retrieves the general/main color of the given Evas object.
3407 *
3408 * @param obj The given Evas object to retrieve color from.
3409 * @param r Pointer to an integer in which to store the red component
3410 * of the color.
3411 * @param g Pointer to an integer in which to store the green
3412 * component of the color.
3413 * @param b Pointer to an integer in which to store the blue component
3414 * of the color.
3415 * @param a Pointer to an integer in which to store the alpha
3416 * component of the color.
3417 *
3418 * Retrieves the “main” color's RGB component (and alpha channel)
3419 * values, <b>which range from 0 to 255</b>. For the alpha channel,
3420 * which defines the object's transparency level, 0 means totally
3421 * trasparent, while 255 means opaque. These color values are
3422 * premultiplied by the alpha value.
3423 *
3424 * Usually you’ll use this attribute for text and rectangle objects,
3425 * where the “main” color is their unique one. If set for objects
3426 * which themselves have colors, like the images one, those colors get
3427 * modulated by this one.
3428 *
3429 * @note All newly created Evas rectangles get the default color
3430 * values of <code>255 255 255 255</code> (opaque white).
3431 *
3432 * @note Use @c NULL pointers on the components you're not interested
3433 * in: they'll be ignored by the function.
3434 *
3435 * Example:
3436 * @dontinclude evas-object-manipulation.c
3437 * @skip int alpha, r, g, b;
3438 * @until return
3439 *
3440 * See the full @ref Example_Evas_Object_Manipulation "example".
3441 *
3442 * @ingroup Evas_Object_Group_Basic
3443 */
3444EAPI void evas_object_color_get (const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
3445
3446
3447/**
3448 * Retrieves the Evas canvas that the given object lives on.
3449 *
3450 * @param obj The given Evas object.
3451 * @return A pointer to the canvas where the object is on.
3452 *
3453 * This function is most useful at code contexts where you need to
3454 * operate on the canvas but have only the object pointer.
3455 *
3456 * @ingroup Evas_Object_Group_Basic
3457 */
3458EAPI Evas *evas_object_evas_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3459
3460/**
3461 * Retrieves the type of the given Evas object.
3462 *
3463 * @param obj The given object.
3464 * @return The type of the object.
3465 *
3466 * For Evas' builtin types, the return strings will be one of:
3467 * - <c>"rectangle"</c>,
3468 * - <c>"line"</c>,
3469 * - <c>"polygon"</c>,
3470 * - <c>"text"</c>,
3471 * - <c>"textblock"</c> and
3472 * - <c>"image"</c>.
3473 *
3474 * For Evas smart objects (see @ref Evas_Smart_Group), the name of the
3475 * smart class itself is returned on this call. For the built-in smart
3476 * objects, these names are:
3477 * - <c>"EvasObjectSmartClipped"</c>, for the clipped smart object
3478 * - <c>"Evas_Object_Box"</c>, for the box object and
3479 * - <c>"Evas_Object_Table"</c>, for the table object.
3480 *
3481 * Example:
3482 * @dontinclude evas-object-manipulation.c
3483 * @skip d.img = evas_object_image_filled_add(d.canvas);
3484 * @until border on the
3485 *
3486 * See the full @ref Example_Evas_Object_Manipulation "example".
3487 */
3488EAPI const char *evas_object_type_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3489
3490/**
3491 * Raise @p obj to the top of its layer.
3492 *
3493 * @param obj the object to raise
3494 *
3495 * @p obj will, then, be the highest one in the layer it belongs
3496 * to. Object on other layers won't get touched.
3497 *
3498 * @see evas_object_stack_above()
3499 * @see evas_object_stack_below()
3500 * @see evas_object_lower()
3501 */
3502EAPI void evas_object_raise (Evas_Object *obj) EINA_ARG_NONNULL(1);
3503
3504/**
3505 * Lower @p obj to the bottom of its layer.
3506 *
3507 * @param obj the object to lower
3508 *
3509 * @p obj will, then, be the lowest one in the layer it belongs
3510 * to. Objects on other layers won't get touched.
3511 *
3512 * @see evas_object_stack_above()
3513 * @see evas_object_stack_below()
3514 * @see evas_object_raise()
3515 */
3516EAPI void evas_object_lower (Evas_Object *obj) EINA_ARG_NONNULL(1);
3517
3518/**
3519 * Stack @p obj immediately above @p above
3520 *
3521 * @param obj the object to stack
3522 * @param above the object above which to stack
3523 *
3524 * Objects, in a given canvas, are stacked in the order they get added
3525 * to it. This means that, if they overlap, the highest ones will
3526 * cover the lowest ones, in that order. This function is a way to
3527 * change the stacking order for the objects.
3528 *
3529 * This function is intended to be used with <b>objects belonging to
3530 * the same layer</b> in a given canvas, otherwise it will fail (and
3531 * accomplish nothing).
3532 *
3533 * If you have smart objects on your canvas and @p obj is a member of
3534 * one of them, then @p above must also be a member of the same
3535 * smart object.
3536 *
3537 * Similarly, if @p obj is not a member of a smart object, @p above
3538 * must not be either.
3539 *
3540 * @see evas_object_layer_get()
3541 * @see evas_object_layer_set()
3542 * @see evas_object_stack_below()
3543 */
3544EAPI void evas_object_stack_above (Evas_Object *obj, Evas_Object *above) EINA_ARG_NONNULL(1, 2);
3545
3546/**
3547 * Stack @p obj immediately below @p below
3548 *
3549 * @param obj the object to stack
3550 * @param below the object below which to stack
3551 *
3552 * Objects, in a given canvas, are stacked in the order they get added
3553 * to it. This means that, if they overlap, the highest ones will
3554 * cover the lowest ones, in that order. This function is a way to
3555 * change the stacking order for the objects.
3556 *
3557 * This function is intended to be used with <b>objects belonging to
3558 * the same layer</b> in a given canvas, otherwise it will fail (and
3559 * accomplish nothing).
3560 *
3561 * If you have smart objects on your canvas and @p obj is a member of
3562 * one of them, then @p below must also be a member of the same
3563 * smart object.
3564 *
3565 * Similarly, if @p obj is not a member of a smart object, @p below
3566 * must not be either.
3567 *
3568 * @see evas_object_layer_get()
3569 * @see evas_object_layer_set()
3570 * @see evas_object_stack_below()
3571 */
3572EAPI void evas_object_stack_below (Evas_Object *obj, Evas_Object *below) EINA_ARG_NONNULL(1, 2);
3573
3574/**
3575 * Get the Evas object stacked right above @p obj
3576 *
3577 * @param obj an #Evas_Object
3578 * @return the #Evas_Object directly above @p obj, if any, or @c NULL,
3579 * if none
3580 *
3581 * This function will traverse layers in its search, if there are
3582 * objects on layers above the one @p obj is placed at.
3583 *
3584 * @see evas_object_layer_get()
3585 * @see evas_object_layer_set()
3586 * @see evas_object_below_get()
3587 *
3588 */
3589EAPI Evas_Object *evas_object_above_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3590
3591/**
3592 * Get the Evas object stacked right below @p obj
3593 *
3594 * @param obj an #Evas_Object
3595 * @return the #Evas_Object directly below @p obj, if any, or @c NULL,
3596 * if none
3597 *
3598 * This function will traverse layers in its search, if there are
3599 * objects on layers below the one @p obj is placed at.
3600 *
3601 * @see evas_object_layer_get()
3602 * @see evas_object_layer_set()
3603 * @see evas_object_below_get()
3604 */
3605EAPI Evas_Object *evas_object_below_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3606
3607/**
3608 * @}
3609 */
3610
3611/**
3612 * @defgroup Evas_Object_Group_Events Object Events
3613 *
3614 * Objects generate events when they are moved, resized, when their
3615 * visibility change, when they are deleted and so on. These methods
3616 * allow one to be notified about and to handle such events.
3617 *
3618 * Objects also generate events on input (keyboard and mouse), if they
3619 * accept them (are visible, focused, etc).
3620 *
3621 * For each of those events, Evas provides a way for one to register
3622 * callback functions to be issued just after they happen.
3623 *
3624 * The following figure illustrates some Evas (event) callbacks:
3625 *
3626 * @image html evas-callbacks.png
3627 * @image rtf evas-callbacks.png
3628 * @image latex evas-callbacks.eps
3629 *
3630 * Thees events have their values in the #Evas_Callback_Type
3631 * enumeration, which has also ones happening on the canvas level (se
3632 * #Evas_Canvas_Events).
3633 *
3634 * Examples on this group of functions can be found @ref
3635 * Example_Evas_Stacking "here" and @ref Example_Evas_Events "here".
3636 *
3637 * @ingroup Evas_Object_Group
3638 */
3639
3640/**
3641 * @addtogroup Evas_Object_Group_Events
3642 * @{
3643 */
3644
3645/**
3646 * Add (register) a callback function to a given Evas object event.
3647 *
3648 * @param obj Object to attach a callback to
3649 * @param type The type of event that will trigger the callback
3650 * @param func The function to be called when the event is triggered
3651 * @param data The data pointer to be passed to @p func
3652 *
3653 * This function adds a function callback to an object when the event
3654 * of type @p type occurs on object @p obj. The function is @p func.
3655 *
3656 * In the event of a memory allocation error during addition of the
3657 * callback to the object, evas_alloc_error() should be used to
3658 * determine the nature of the error, if any, and the program should
3659 * sensibly try and recover.
3660 *
3661 * A callback function must have the ::Evas_Object_Event_Cb prototype
3662 * definition. The first parameter (@p data) in this definition will
3663 * have the same value passed to evas_object_event_callback_add() as
3664 * the @p data parameter, at runtime. The second parameter @p e is the
3665 * canvas pointer on which the event occurred. The third parameter is
3666 * a pointer to the object on which event occurred. Finally, the
3667 * fourth parameter @p event_info is a pointer to a data structure
3668 * that may or may not be passed to the callback, depending on the
3669 * event type that triggered the callback. This is so because some
3670 * events don't carry extra context with them, but others do.
3671 *
3672 * The event type @p type to trigger the function may be one of
3673 * #EVAS_CALLBACK_MOUSE_IN, #EVAS_CALLBACK_MOUSE_OUT,
3674 * #EVAS_CALLBACK_MOUSE_DOWN, #EVAS_CALLBACK_MOUSE_UP,
3675 * #EVAS_CALLBACK_MOUSE_MOVE, #EVAS_CALLBACK_MOUSE_WHEEL,
3676 * #EVAS_CALLBACK_MULTI_DOWN, #EVAS_CALLBACK_MULTI_UP,
3677 * #EVAS_CALLBACK_MULTI_MOVE, #EVAS_CALLBACK_FREE,
3678 * #EVAS_CALLBACK_KEY_DOWN, #EVAS_CALLBACK_KEY_UP,
3679 * #EVAS_CALLBACK_FOCUS_IN, #EVAS_CALLBACK_FOCUS_OUT,
3680 * #EVAS_CALLBACK_SHOW, #EVAS_CALLBACK_HIDE, #EVAS_CALLBACK_MOVE,
3681 * #EVAS_CALLBACK_RESIZE, #EVAS_CALLBACK_RESTACK, #EVAS_CALLBACK_DEL,
3682 * #EVAS_CALLBACK_HOLD, #EVAS_CALLBACK_CHANGED_SIZE_HINTS,
3683 * #EVAS_CALLBACK_IMAGE_PRELOADED or #EVAS_CALLBACK_IMAGE_UNLOADED.
3684 *
3685 * This determines the kind of event that will trigger the callback.
3686 * What follows is a list explaining better the nature of each type of
3687 * event, along with their associated @p event_info pointers:
3688 *
3689 * - #EVAS_CALLBACK_MOUSE_IN: @p event_info is a pointer to an
3690 * #Evas_Event_Mouse_In struct\n\n
3691 * This event is triggered when the mouse pointer enters the area
3692 * (not shaded by other objects) of the object @p obj. This may
3693 * occur by the mouse pointer being moved by
3694 * evas_event_feed_mouse_move() calls, or by the object being shown,
3695 * raised, moved, resized, or other objects being moved out of the
3696 * way, hidden or lowered, whatever may cause the mouse pointer to
3697 * get on top of @p obj, having been on top of another object
3698 * previously.
3699 *
3700 * - #EVAS_CALLBACK_MOUSE_OUT: @p event_info is a pointer to an
3701 * #Evas_Event_Mouse_Out struct\n\n
3702 * This event is triggered exactly like #EVAS_CALLBACK_MOUSE_IN is,
3703 * but it occurs when the mouse pointer exits an object's area. Note
3704 * that no mouse out events will be reported if the mouse pointer is
3705 * implicitly grabbed to an object (mouse buttons are down, having
3706 * been pressed while the pointer was over that object). In these
3707 * cases, mouse out events will be reported once all buttons are
3708 * released, if the mouse pointer has left the object's area. The
3709 * indirect ways of taking off the mouse pointer from an object,
3710 * like cited above, for #EVAS_CALLBACK_MOUSE_IN, also apply here,
3711 * naturally.
3712 *
3713 * - #EVAS_CALLBACK_MOUSE_DOWN: @p event_info is a pointer to an
3714 * #Evas_Event_Mouse_Down struct\n\n
3715 * This event is triggered by a mouse button being pressed while the
3716 * mouse pointer is over an object. If the pointer mode for Evas is
3717 * #EVAS_OBJECT_POINTER_MODE_AUTOGRAB (default), this causes this
3718 * object to <b>passively grab the mouse</b> until all mouse buttons
3719 * have been released: all future mouse events will be reported to
3720 * only this object until no buttons are down. That includes mouse
3721 * move events, mouse in and mouse out events, and further button
3722 * presses. When all buttons are released, event propagation will
3723 * occur as normal (see #Evas_Object_Pointer_Mode).
3724 *
3725 * - #EVAS_CALLBACK_MOUSE_UP: @p event_info is a pointer to an
3726 * #Evas_Event_Mouse_Up struct\n\n
3727 * This event is triggered by a mouse button being released while
3728 * the mouse pointer is over an object's area (or when passively
3729 * grabbed to an object).
3730 *
3731 * - #EVAS_CALLBACK_MOUSE_MOVE: @p event_info is a pointer to an
3732 * #Evas_Event_Mouse_Move struct\n\n
3733 * This event is triggered by the mouse pointer being moved while
3734 * over an object's area (or while passively grabbed to an object).
3735 *
3736 * - #EVAS_CALLBACK_MOUSE_WHEEL: @p event_info is a pointer to an
3737 * #Evas_Event_Mouse_Wheel struct\n\n
3738 * This event is triggered by the mouse wheel being rolled while the
3739 * mouse pointer is over an object (or passively grabbed to an
3740 * object).
3741 *
3742 * - #EVAS_CALLBACK_MULTI_DOWN: @p event_info is a pointer to an
3743 * #Evas_Event_Multi_Down struct
3744 *
3745 * - #EVAS_CALLBACK_MULTI_UP: @p event_info is a pointer to an
3746 * #Evas_Event_Multi_Up struct
3747 *
3748 * - #EVAS_CALLBACK_MULTI_MOVE: @p event_info is a pointer to an
3749 * #Evas_Event_Multi_Move struct
3750 *
3751 * - #EVAS_CALLBACK_FREE: @p event_info is @c NULL \n\n
3752 * This event is triggered just before Evas is about to free all
3753 * memory used by an object and remove all references to it. This is
3754 * useful for programs to use if they attached data to an object and
3755 * want to free it when the object is deleted. The object is still
3756 * valid when this callback is called, but after it returns, there
3757 * is no guarantee on the object's validity.
3758 *
3759 * - #EVAS_CALLBACK_KEY_DOWN: @p event_info is a pointer to an
3760 * #Evas_Event_Key_Down struct\n\n
3761 * This callback is called when a key is pressed and the focus is on
3762 * the object, or a key has been grabbed to a particular object
3763 * which wants to intercept the key press regardless of what object
3764 * has the focus.
3765 *
3766 * - #EVAS_CALLBACK_KEY_UP: @p event_info is a pointer to an
3767 * #Evas_Event_Key_Up struct \n\n
3768 * This callback is called when a key is released and the focus is
3769 * on the object, or a key has been grabbed to a particular object
3770 * which wants to intercept the key release regardless of what
3771 * object has the focus.
3772 *
3773 * - #EVAS_CALLBACK_FOCUS_IN: @p event_info is @c NULL \n\n
3774 * This event is called when an object gains the focus. When it is
3775 * called the object has already gained the focus.
3776 *
3777 * - #EVAS_CALLBACK_FOCUS_OUT: @p event_info is @c NULL \n\n
3778 * This event is triggered when an object loses the focus. When it
3779 * is called the object has already lost the focus.
3780 *
3781 * - #EVAS_CALLBACK_SHOW: @p event_info is @c NULL \n\n
3782 * This event is triggered by the object being shown by
3783 * evas_object_show().
3784 *
3785 * - #EVAS_CALLBACK_HIDE: @p event_info is @c NULL \n\n
3786 * This event is triggered by an object being hidden by
3787 * evas_object_hide().
3788 *
3789 * - #EVAS_CALLBACK_MOVE: @p event_info is @c NULL \n\n
3790 * This event is triggered by an object being
3791 * moved. evas_object_move() can trigger this, as can any
3792 * object-specific manipulations that would mean the object's origin
3793 * could move.
3794 *
3795 * - #EVAS_CALLBACK_RESIZE: @p event_info is @c NULL \n\n
3796 * This event is triggered by an object being resized. Resizes can
3797 * be triggered by evas_object_resize() or by any object-specific
3798 * calls that may cause the object to resize.
3799 *
3800 * - #EVAS_CALLBACK_RESTACK: @p event_info is @c NULL \n\n
3801 * This event is triggered by an object being re-stacked. Stacking
3802 * changes can be triggered by
3803 * evas_object_stack_below()/evas_object_stack_above() and others.
3804 *
3805 * - #EVAS_CALLBACK_DEL: @p event_info is @c NULL.
3806 *
3807 * - #EVAS_CALLBACK_HOLD: @p event_info is a pointer to an
3808 * #Evas_Event_Hold struct
3809 *
3810 * - #EVAS_CALLBACK_CHANGED_SIZE_HINTS: @p event_info is @c NULL.
3811 *
3812 * - #EVAS_CALLBACK_IMAGE_PRELOADED: @p event_info is @c NULL.
3813 *
3814 * - #EVAS_CALLBACK_IMAGE_UNLOADED: @p event_info is @c NULL.
3815 *
3816 * @note Be careful not to add the same callback multiple times, if
3817 * that's not what you want, because Evas won't check if a callback
3818 * existed before exactly as the one being registered (and thus, call
3819 * it more than once on the event, in this case). This would make
3820 * sense if you passed different functions and/or callback data, only.
3821 *
3822 * Example:
3823 * @dontinclude evas-events.c
3824 * @skip evas_object_event_callback_add(
3825 * @until }
3826 *
3827 * See the full example @ref Example_Evas_Events "here".
3828 *
3829 */
3830 EAPI void evas_object_event_callback_add (Evas_Object *obj, Evas_Callback_Type type, Evas_Object_Event_Cb func, const void *data) EINA_ARG_NONNULL(1, 3);
3831
3832/**
3833 * Add (register) a callback function to a given Evas object event with a
3834 * non-default priority set. Except for the priority field, it's exactly the
3835 * same as @ref evas_object_event_callback_add
3836 *
3837 * @param obj Object to attach a callback to
3838 * @param type The type of event that will trigger the callback
3839 * @param priority The priority of the callback, lower values called first.
3840 * @param func The function to be called when the event is triggered
3841 * @param data The data pointer to be passed to @p func
3842 *
3843 * @see evas_object_event_callback_add
3844 * @since 1.1.0
3845 */
3846EAPI void evas_object_event_callback_priority_add(Evas_Object *obj, Evas_Callback_Type type, Evas_Callback_Priority priority, Evas_Object_Event_Cb func, const void *data) EINA_ARG_NONNULL(1, 4);
3847
3848/**
3849 * Delete a callback function from an object
3850 *
3851 * @param obj Object to remove a callback from
3852 * @param type The type of event that was triggering the callback
3853 * @param func The function that was to be called when the event was triggered
3854 * @return The data pointer that was to be passed to the callback
3855 *
3856 * This function removes the most recently added callback from the
3857 * object @p obj which was triggered by the event type @p type and was
3858 * calling the function @p func when triggered. If the removal is
3859 * successful it will also return the data pointer that was passed to
3860 * evas_object_event_callback_add() when the callback was added to the
3861 * object. If not successful NULL will be returned.
3862 *
3863 * Example:
3864 * @code
3865 * extern Evas_Object *object;
3866 * void *my_data;
3867 * void up_callback(void *data, Evas *e, Evas_Object *obj, void *event_info);
3868 *
3869 * my_data = evas_object_event_callback_del(object, EVAS_CALLBACK_MOUSE_UP, up_callback);
3870 * @endcode
3871 */
3872EAPI void *evas_object_event_callback_del (Evas_Object *obj, Evas_Callback_Type type, Evas_Object_Event_Cb func) EINA_ARG_NONNULL(1, 3);
3873
3874/**
3875 * Delete (unregister) a callback function registered to a given
3876 * Evas object event.
3877 *
3878 * @param obj Object to remove a callback from
3879 * @param type The type of event that was triggering the callback
3880 * @param func The function that was to be called when the event was
3881 * triggered
3882 * @param data The data pointer that was to be passed to the callback
3883 * @return The data pointer that was to be passed to the callback
3884 *
3885 * This function removes the most recently added callback from the
3886 * object @p obj, which was triggered by the event type @p type and was
3887 * calling the function @p func with data @p data, when triggered. If
3888 * the removal is successful it will also return the data pointer that
3889 * was passed to evas_object_event_callback_add() (that will be the
3890 * same as the parameter) when the callback was added to the
3891 * object. In errors, @c NULL will be returned.
3892 *
3893 * @note For deletion of Evas object events callbacks filtering by
3894 * just type and function pointer, user
3895 * evas_object_event_callback_del().
3896 *
3897 * Example:
3898 * @code
3899 * extern Evas_Object *object;
3900 * void *my_data;
3901 * void up_callback(void *data, Evas *e, Evas_Object *obj, void *event_info);
3902 *
3903 * my_data = evas_object_event_callback_del_full(object, EVAS_CALLBACK_MOUSE_UP, up_callback, data);
3904 * @endcode
3905 */
3906EAPI void *evas_object_event_callback_del_full(Evas_Object *obj, Evas_Callback_Type type, Evas_Object_Event_Cb func, const void *data) EINA_ARG_NONNULL(1, 3);
3907
3908
3909/**
3910 * Set whether an Evas object is to pass (ignore) events.
3911 *
3912 * @param obj the Evas object to operate on
3913 * @param pass whether @p obj is to pass events (@c EINA_TRUE) or not
3914 * (@c EINA_FALSE)
3915 *
3916 * If @p pass is @c EINA_TRUE, it will make events on @p obj to be @b
3917 * ignored. They will be triggered on the @b next lower object (that
3918 * is not set to pass events), instead (see evas_object_below_get()).
3919 *
3920 * If @p pass is @c EINA_FALSE, events will be processed on that
3921 * object as normal.
3922 *
3923 * @see evas_object_pass_events_get() for an example
3924 * @see evas_object_repeat_events_set()
3925 * @see evas_object_propagate_events_set()
3926 * @see evas_object_freeze_events_set()
3927 */
3928EAPI void evas_object_pass_events_set (Evas_Object *obj, Eina_Bool pass) EINA_ARG_NONNULL(1);
3929
3930/**
3931 * Determine whether an object is set to pass (ignore) events.
3932 *
3933 * @param obj the Evas object to get information from.
3934 * @return pass whether @p obj is set to pass events (@c EINA_TRUE) or not
3935 * (@c EINA_FALSE)
3936 *
3937 * Example:
3938 * @dontinclude evas-stacking.c
3939 * @skip if (strcmp(ev->keyname, "p") == 0)
3940 * @until }
3941 *
3942 * See the full @ref Example_Evas_Stacking "example".
3943 *
3944 * @see evas_object_pass_events_set()
3945 * @see evas_object_repeat_events_get()
3946 * @see evas_object_propagate_events_get()
3947 * @see evas_object_freeze_events_get()
3948 */
3949EAPI Eina_Bool evas_object_pass_events_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3950
3951/**
3952 * Set whether an Evas object is to repeat events.
3953 *
3954 * @param obj the Evas object to operate on
3955 * @param repeat whether @p obj is to repeat events (@c EINA_TRUE) or not
3956 * (@c EINA_FALSE)
3957 *
3958 * If @p repeat is @c EINA_TRUE, it will make events on @p obj to also
3959 * be repeated for the @b next lower object in the objects' stack (see
3960 * see evas_object_below_get()).
3961 *
3962 * If @p repeat is @c EINA_FALSE, events occurring on @p obj will be
3963 * processed only on it.
3964 *
3965 * Example:
3966 * @dontinclude evas-stacking.c
3967 * @skip if (strcmp(ev->keyname, "r") == 0)
3968 * @until }
3969 *
3970 * See the full @ref Example_Evas_Stacking "example".
3971 *
3972 * @see evas_object_repeat_events_get()
3973 * @see evas_object_pass_events_set()
3974 * @see evas_object_propagate_events_set()
3975 * @see evas_object_freeze_events_set()
3976 */
3977EAPI void evas_object_repeat_events_set (Evas_Object *obj, Eina_Bool repeat) EINA_ARG_NONNULL(1);
3978
3979/**
3980 * Determine whether an object is set to repeat events.
3981 *
3982 * @param obj the given Evas object pointer
3983 * @retrieve whether @p obj is set to repeat events (@c EINA_TRUE)
3984 * or not (@c EINA_FALSE)
3985 *
3986 * @see evas_object_repeat_events_set() for an example
3987 * @see evas_object_pass_events_get()
3988 * @see evas_object_propagate_events_get()
3989 * @see evas_object_freeze_events_get()
3990 */
3991EAPI Eina_Bool evas_object_repeat_events_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
3992
3993/**
3994 * Set whether events on a smart object's member should get propagated
3995 * up to its parent.
3996 *
3997 * @param obj the smart object's child to operate on
3998 * @param prop whether to propagate events (@c EINA_TRUE) or not (@c
3999 * EINA_FALSE)
4000 *
4001 * This function has @b no effect if @p obj is not a member of a smart
4002 * object.
4003 *
4004 * If @p prop is @c EINA_TRUE, events occurring on this object will be
4005 * propagated on to the smart object of which @p obj is a member. If
4006 * @p prop is @c EINA_FALSE, events occurring on this object will @b
4007 * not be propagated on to the smart object of which @p obj is a
4008 * member. The default value is @c EINA_TRUE.
4009 *
4010 * @see evas_object_propagate_events_get()
4011 * @see evas_object_repeat_events_set()
4012 * @see evas_object_pass_events_set()
4013 * @see evas_object_freeze_events_set()
4014 */
4015EAPI void evas_object_propagate_events_set (Evas_Object *obj, Eina_Bool prop) EINA_ARG_NONNULL(1);
4016
4017/**
4018 * Retrieve whether an Evas object is set to propagate events.
4019 *
4020 * @param obj the given Evas object pointer
4021 * @return whether @p obj is set to propagate events (@c EINA_TRUE)
4022 * or not (@c EINA_FALSE)
4023 *
4024 * @see evas_object_propagate_events_set()
4025 * @see evas_object_repeat_events_get()
4026 * @see evas_object_pass_events_get()
4027 * @see evas_object_freeze_events_get()
4028 */
4029EAPI Eina_Bool evas_object_propagate_events_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
4030
4031/**
4032 * Set whether an Evas object is to freeze (discard) events.
4033 *
4034 * @param obj the Evas object to operate on
4035 * @param pass whether @p obj is to freeze events (@c EINA_TRUE) or not
4036 * (@c EINA_FALSE)
4037 *
4038 * If @p freeze is @c EINA_TRUE, it will make events on @p obj to be @b
4039 * discarded. Unlike evas_object_pass_events_set(), events will not be
4040 * passed to @b next lower object. This API can be used for blocking
4041 * events while @p obj is on transiting.
4042 *
4043 * If @p freeze is @c EINA_FALSE, events will be processed on that
4044 * object as normal.
4045 *
4046 * @see evas_object_freeze_events_get()
4047 * @see evas_object_pass_events_set()
4048 * @see evas_object_repeat_events_set()
4049 * @see evas_object_propagate_events_set()
4050 * @since 1.1.0
4051 */
4052EAPI void evas_object_freeze_events_set(Evas_Object *obj, Eina_Bool freeze) EINA_ARG_NONNULL(1);
4053
4054/**
4055 * Determine whether an object is set to freeze (discard) events.
4056 *
4057 * @param obj the Evas object to get information from.
4058 * @return freeze whether @p obj is set to freeze events (@c EINA_TRUE) or
4059 * not (@c EINA_FALSE)
4060 *
4061 * @see evas_object_freeze_events_set()
4062 * @see evas_object_pass_events_get()
4063 * @see evas_object_repeat_events_get()
4064 * @see evas_object_propagate_events_get()
4065 * @since 1.1.0
4066 */
4067EAPI Eina_Bool evas_object_freeze_events_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
4068
4069/**
4070 * @}
4071 */
4072
4073/**
4074 * @defgroup Evas_Object_Group_Map UV Mapping (Rotation, Perspective, 3D...)
4075 *
4076 * Evas allows different transformations to be applied to all kinds of
4077 * objects. These are applied by means of UV mapping.
4078 *
4079 * With UV mapping, one maps points in the source object to a 3D space
4080 * positioning at target. This allows rotation, perspective, scale and
4081 * lots of other effects, depending on the map that is used.
4082 *
4083 * Each map point may carry a multiplier color. If properly
4084 * calculated, these can do shading effects on the object, producing
4085 * 3D effects.
4086 *
4087 * As usual, Evas provides both the raw and easy to use methods. The
4088 * raw methods allow developer to create its maps somewhere else,
4089 * maybe load them from some file format. The easy to use methods,
4090 * calculate the points given some high-level parameters, such as
4091 * rotation angle, ambient light and so on.
4092 *
4093 * @note applying mapping will reduce performance, so use with
4094 * care. The impact on performance depends on engine in
4095 * use. Software is quite optimized, but not as fast as OpenGL.
4096 *
4097 * @section sec-map-points Map points
4098 * @subsection subsec-rotation Rotation
4099 *
4100 * A map consists of a set of points, currently only four are supported. Each
4101 * of these points contains a set of canvas coordinates @c x and @c y that
4102 * can be used to alter the geometry of the mapped object, and a @c z
4103 * coordinate that indicates the depth of that point. This last coordinate
4104 * does not normally affect the map, but it's used by several of the utility
4105 * functions to calculate the right position of the point given other
4106 * parameters.
4107 *
4108 * The coordinates for each point are set with evas_map_point_coord_set().
4109 * The following image shows a map set to match the geometry of an existing
4110 * object.
4111 *
4112 * @image html map-set-map-points-1.png
4113 * @image rtf map-set-map-points-1.png
4114 * @image latex map-set-map-points-1.eps
4115 *
4116 * This is a common practice, so there are a few functions that help make it
4117 * easier.
4118 *
4119 * evas_map_util_points_populate_from_geometry() sets the coordinates of each
4120 * point in the given map to match the rectangle defined by the function
4121 * parameters.
4122 *
4123 * evas_map_util_points_populate_from_object() and
4124 * evas_map_util_points_populate_from_object_full() both take an object and
4125 * set the map points to match its geometry. The difference between the two
4126 * is that the first function sets the @c z value of all points to 0, while
4127 * the latter receives the value to set in said coordinate as a parameter.
4128 *
4129 * The following lines of code all produce the same result as in the image
4130 * above.
4131 * @code
4132 * evas_map_util_points_populate_from_geometry(m, 100, 100, 200, 200, 0);
4133 * // Assuming o is our original object
4134 * evas_object_move(o, 100, 100);
4135 * evas_object_resize(o, 200, 200);
4136 * evas_map_util_points_populate_from_object(m, o);
4137 * evas_map_util_points_populate_from_object_full(m, o, 0);
4138 * @endcode
4139 *
4140 * Several effects can be applied to an object by simply setting each point
4141 * of the map to the right coordinates. For example, a simulated perspective
4142 * could be achieve as follows.
4143 *
4144 * @image html map-set-map-points-2.png
4145 * @image rtf map-set-map-points-2.png
4146 * @image latex map-set-map-points-2.eps
4147 *
4148 * As said before, the @c z coordinate is unused here so when setting points
4149 * by hand, its value is of no importance.
4150 *
4151 * @image html map-set-map-points-3.png
4152 * @image rtf map-set-map-points-3.png
4153 * @image latex map-set-map-points-3.eps
4154 *
4155 * In all three cases above, setting the map to be used by the object is the
4156 * same.
4157 * @code
4158 * evas_object_map_set(o, m);
4159 * evas_object_map_enable_set(o, EINA_TRUE);
4160 * @endcode
4161 *
4162 * Doing things this way, however, is a lot of work that can be avoided by
4163 * using the provided utility functions, as described in the next section.
4164 *
4165 * @section map-utils Utility functions
4166 *
4167 * Utility functions take an already set up map and alter it to produce a
4168 * specific effect. For example, to rotate an object around its own center
4169 * you would need to take the rotation angle, the coordinates of each corner
4170 * of the object and do all the math to get the new set of coordinates that
4171 * need to tbe set in the map.
4172 *
4173 * Or you can use this code:
4174 * @code
4175 * evas_object_geometry_get(o, &x, &y, &w, &h);
4176 * m = evas_map_new(4);
4177 * evas_map_util_points_populate_from_object(m, o);
4178 * evas_map_util_rotate(m, 45, x + (w / 2), y + (h / 2));
4179 * evas_object_map_set(o, m);
4180 * evas_object_map_enable_set(o, EINA_TRUE);
4181 * evas_map_free(m);
4182 * @endcode
4183 *
4184 * Which will rotate the object around its center point in a 45 degree angle
4185 * in the clockwise direction, taking it from this
4186 *
4187 * @image html map-rotation-2d-1.png
4188 * @image rtf map-rotation-2d-1.png
4189 * @image latex map-rotation-2d-1.eps
4190 *
4191 * to this
4192 *
4193 * @image html map-rotation-2d-2.png
4194 * @image rtf map-rotation-2d-2.png
4195 * @image latex map-rotation-2d-2.eps
4196 *
4197 * Objects may be rotated around any other point just by setting the last two
4198 * paramaters of the evas_map_util_rotate() function to the right values. A
4199 * circle of roughly the diameter of the object overlaid on each image shows
4200 * where the center of rotation is set for each example.
4201 *
4202 * For example, this code
4203 * @code
4204 * evas_object_geometry_get(o, &x, &y, &w, &h);
4205 * m = evas_map_new(4);
4206 * evas_map_util_points_populate_from_object(m, o);
4207 * evas_map_util_rotate(m, 45, x + w - 20, y + h - 20);
4208 * evas_object_map_set(o, m);
4209 * evas_object_map_enable_set(o, EINA_TRUE);
4210 * evas_map_free(m);
4211 * @endcode
4212 *
4213 * produces something like
4214 *
4215 * @image html map-rotation-2d-3.png
4216 * @image rtf map-rotation-2d-3.png
4217 * @image latex map-rotation-2d-3.eps
4218 *
4219 * And the following
4220 * @code
4221 * evas_output_size_get(evas, &w, &h);
4222 * m = evas_map_new(4);
4223 * evas_map_util_points_populate_from_object(m, o);
4224 * evas_map_util_rotate(m, 45, w, h);
4225 * evas_object_map_set(o, m);
4226 * evas_object_map_enable_set(o, EINA_TRUE);
4227 * evas_map_free(m);
4228 * @endcode
4229 *
4230 * rotates the object around the center of the window
4231 *
4232 * @image html map-rotation-2d-4.png
4233 * @image rtf map-rotation-2d-4.png
4234 * @image latex map-rotation-2d-4.eps
4235 *
4236 * @subsection subsec-3d 3D Maps
4237 *
4238 * Maps can also be used to achieve the effect of 3-dimensionality. When doing
4239 * this, the @c z coordinate of each point counts, with higher values meaning
4240 * the point is further into the screen, and smaller values (negative, usually)
4241 * meaning the point is closwer towards the user.
4242 *
4243 * Thinking in 3D also introduces the concept of back-face of an object. An
4244 * object is said to be facing the user when all its points are placed in a
4245 * clockwise fashion. The next image shows this, with each point showing the
4246 * with which is identified within the map.
4247 *
4248 * @image html map-point-order-face.png
4249 * @image rtf map-point-order-face.png
4250 * @image latex map-point-order-face.eps
4251 *
4252 * Rotating this map around the @c Y axis would leave the order of the points
4253 * in a counter-clockwise fashion, as seen in the following image.
4254 *
4255 * @image html map-point-order-back.png
4256 * @image rtf map-point-order-back.png
4257 * @image latex map-point-order-back.eps
4258 *
4259 * This way we can say that we are looking at the back face of the object.
4260 * This will have stronger implications later when we talk about lighting.
4261 *
4262 * To know if a map is facing towards the user or not it's enough to use
4263 * the evas_map_util_clockwise_get() function, but this is normally done
4264 * after all the other operations are applied on the map.
4265 *
4266 * @subsection subsec-3d-rot 3D rotation and perspective
4267 *
4268 * Much like evas_map_util_rotate(), there's the function
4269 * evas_map_util_3d_rotate() that transforms the map to apply a 3D rotation
4270 * to an object. As in its 2D counterpart, the rotation can be applied around
4271 * any point in the canvas, this time with a @c z coordinate too. The rotation
4272 * can also be around any of the 3 axis.
4273 *
4274 * Starting from this simple setup
4275 *
4276 * @image html map-3d-basic-1.png
4277 * @image rtf map-3d-basic-1.png
4278 * @image latex map-3d-basic-1.eps
4279 *
4280 * and setting maps so that the blue square to rotate on all axis around a
4281 * sphere that uses the object as its center, and the red square to rotate
4282 * around the @c Y axis, we get the following. A simple overlay over the image
4283 * shows the original geometry of each object and the axis around which they
4284 * are being rotated, with the @c Z one not appearing due to being orthogonal
4285 * to the screen.
4286 *
4287 * @image html map-3d-basic-2.png
4288 * @image rtf map-3d-basic-2.png
4289 * @image latex map-3d-basic-2.eps
4290 *
4291 * which doesn't look very real. This can be helped by adding perspective
4292 * to the transformation, which can be simply done by calling
4293 * evas_map_util_3d_perspective() on the map after its position has been set.
4294 * The result in this case, making the vanishing point the center of each
4295 * object:
4296 *
4297 * @image html map-3d-basic-3.png
4298 * @image rtf map-3d-basic-3.png
4299 * @image latex map-3d-basic-3.eps
4300 *
4301 * @section sec-color Color and lighting
4302 *
4303 * Each point in a map can be set to a color, which will be multiplied with
4304 * the objects own color and linearly interpolated in between adjacent points.
4305 * This is done with evas_map_point_color_set() for each point of the map,
4306 * or evas_map_util_points_color_set() to set every point to the same color.
4307 *
4308 * When using 3D effects, colors can be used to improve the looks of them by
4309 * simulating a light source. The evas_map_util_3d_lighting() function makes
4310 * this task easier by taking the coordinates of the light source and its
4311 * color, along with the color of the ambient light. Evas then sets the color
4312 * of each point based on the distance to the light source, the angle with
4313 * which the object is facing the light and the ambient light. Here, the
4314 * orientation of each point as explained before, becomes more important.
4315 * If the map is defined counter-clockwise, the object will be facing away
4316 * from the user and thus become obscured, since no light would be reflecting
4317 * from it.
4318 *
4319 * @image html map-light.png
4320 * @image rtf map-light.png
4321 * @image latex map-light.eps
4322 * @note Object facing the light source
4323 *
4324 * @image html map-light2.png
4325 * @image rtf map-light2.png
4326 * @image latex map-light2.eps
4327 * @note Same object facing away from the user
4328 *
4329 * @section Image mapping
4330 *
4331 * @image html map-uv-mapping-1.png
4332 * @image rtf map-uv-mapping-1.png
4333 * @image latex map-uv-mapping-1.eps
4334 *
4335 * Images need some special handlign when mapped. Evas can easily take care
4336 * of objects and do almost anything with them, but it's completely oblivious
4337 * to the content of images, so each point in the map needs to be told to what
4338 * pixel in the source image it belongs. Failing to do may sometimes result
4339 * in the expected behavior, or it may look like a partial work.
4340 *
4341 * The next image illustrates one possibility of a map being set to an image
4342 * object, without setting the right UV mapping for each point. The objects
4343 * themselves are mapped properly to their new geometry, but the image content
4344 * may not be displayed correctly within the mapped object.
4345 *
4346 * @image html map-uv-mapping-2.png
4347 * @image rtf map-uv-mapping-2.png
4348 * @image latex map-uv-mapping-2.eps
4349 *
4350 * Once Evas knows how to handle the source image within the map, it will
4351 * transform it as needed. This is done with evas_map_point_image_uv_set(),
4352 * which tells the map to which pixel in image it maps.
4353 *
4354 * To match our example images to the maps above all we need is the size of
4355 * each image, which can always be found with evas_object_image_size_get().
4356 *
4357 * @code
4358 * evas_map_point_image_uv_set(m, 0, 0, 0);
4359 * evas_map_point_image_uv_set(m, 1, 150, 0);
4360 * evas_map_point_image_uv_set(m, 2, 150, 200);
4361 * evas_map_point_image_uv_set(m, 3, 0, 200);
4362 * evas_object_map_set(o, m);
4363 * evas_object_map_enable_set(o, EINA_TRUE);
4364 *
4365 * evas_map_point_image_uv_set(m, 0, 0, 0);
4366 * evas_map_point_image_uv_set(m, 1, 120, 0);
4367 * evas_map_point_image_uv_set(m, 2, 120, 160);
4368 * evas_map_point_image_uv_set(m, 3, 0, 160);
4369 * evas_object_map_set(o2, m);
4370 * evas_object_map_enable_set(o2, EINA_TRUE);
4371 * @endcode
4372 *
4373 * To get
4374 *
4375 * @image html map-uv-mapping-3.png
4376 * @image rtf map-uv-mapping-3.png
4377 * @image latex map-uv-mapping-3.eps
4378 *
4379 * Maps can also be set to use part of an image only, or even map them inverted,
4380 * and combined with evas_object_image_source_set() it can be used to achieve
4381 * more interesting results.
4382 *
4383 * @code
4384 * evas_object_image_size_get(evas_object_image_source_get(o), &w, &h);
4385 * evas_map_point_image_uv_set(m, 0, 0, h);
4386 * evas_map_point_image_uv_set(m, 1, w, h);
4387 * evas_map_point_image_uv_set(m, 2, w, h / 3);
4388 * evas_map_point_image_uv_set(m, 3, 0, h / 3);
4389 * evas_object_map_set(o, m);
4390 * evas_object_map_enable_set(o, EINA_TRUE);
4391 * @endcode
4392 *
4393 * @image html map-uv-mapping-4.png
4394 * @image rtf map-uv-mapping-4.png
4395 * @image latex map-uv-mapping-4.eps
4396 *
4397 * Examples:
4398 * @li @ref Example_Evas_Map_Overview
4399 *
4400 * @ingroup Evas_Object_Group
4401 *
4402 * @{
4403 */
4404
4405/**
4406 * Enable or disable the map that is set.
4407 *
4408 * Enable or disable the use of map for the object @p obj.
4409 * On enable, the object geometry will be saved, and the new geometry will
4410 * change (position and size) to reflect the map geometry set.
4411 *
4412 * If the object doesn't have a map set (with evas_object_map_set()), the
4413 * initial geometry will be undefined. It is advised to always set a map
4414 * to the object first, and then call this function to enable its use.
4415 *
4416 * @param obj object to enable the map on
4417 * @param enabled enabled state
4418 */
4419EAPI void evas_object_map_enable_set (Evas_Object *obj, Eina_Bool enabled);
4420
4421/**
4422 * Get the map enabled state
4423 *
4424 * This returns the currently enabled state of the map on the object indicated.
4425 * The default map enable state is off. You can enable and disable it with
4426 * evas_object_map_enable_set().
4427 *
4428 * @param obj object to get the map enabled state from
4429 * @return the map enabled state
4430 */
4431EAPI Eina_Bool evas_object_map_enable_get (const Evas_Object *obj);
4432
4433/**
4434 * Set the map source object
4435 *
4436 * This sets the object from which the map is taken - can be any object that
4437 * has map enabled on it.
4438 *
4439 * Currently not implemented. for future use.
4440 *
4441 * @param obj object to set the map source of
4442 * @param src the source object from which the map is taken
4443 */
4444EAPI void evas_object_map_source_set (Evas_Object *obj, Evas_Object *src);
4445
4446/**
4447 * Get the map source object
4448 *
4449 * @param obj object to set the map source of
4450 * @return the object set as the source
4451 *
4452 * @see evas_object_map_source_set()
4453 */
4454EAPI Evas_Object *evas_object_map_source_get (const Evas_Object *obj);
4455
4456/**
4457 * Set current object transformation map.
4458 *
4459 * This sets the map on a given object. It is copied from the @p map pointer,
4460 * so there is no need to keep the @p map object if you don't need it anymore.
4461 *
4462 * A map is a set of 4 points which have canvas x, y coordinates per point,
4463 * with an optional z point value as a hint for perspective correction, if it
4464 * is available. As well each point has u and v coordinates. These are like
4465 * "texture coordinates" in OpenGL in that they define a point in the source
4466 * image that is mapped to that map vertex/point. The u corresponds to the x
4467 * coordinate of this mapped point and v, the y coordinate. Note that these
4468 * coordinates describe a bounding region to sample. If you have a 200x100
4469 * source image and want to display it at 200x100 with proper pixel
4470 * precision, then do:
4471 *
4472 * @code
4473 * Evas_Map *m = evas_map_new(4);
4474 * evas_map_point_coord_set(m, 0, 0, 0, 0);
4475 * evas_map_point_coord_set(m, 1, 200, 0, 0);
4476 * evas_map_point_coord_set(m, 2, 200, 100, 0);
4477 * evas_map_point_coord_set(m, 3, 0, 100, 0);
4478 * evas_map_point_image_uv_set(m, 0, 0, 0);
4479 * evas_map_point_image_uv_set(m, 1, 200, 0);
4480 * evas_map_point_image_uv_set(m, 2, 200, 100);
4481 * evas_map_point_image_uv_set(m, 3, 0, 100);
4482 * evas_object_map_set(obj, m);
4483 * evas_map_free(m);
4484 * @endcode
4485 *
4486 * Note that the map points a uv coordinates match the image geometry. If
4487 * the @p map parameter is NULL, the stored map will be freed and geometry
4488 * prior to enabling/setting a map will be restored.
4489 *
4490 * @param obj object to change transformation map
4491 * @param map new map to use
4492 *
4493 * @see evas_map_new()
4494 */
4495EAPI void evas_object_map_set (Evas_Object *obj, const Evas_Map *map);
4496
4497/**
4498 * Get current object transformation map.
4499 *
4500 * This returns the current internal map set on the indicated object. It is
4501 * intended for read-only acces and is only valid as long as the object is
4502 * not deleted or the map on the object is not changed. If you wish to modify
4503 * the map and set it back do the following:
4504 *
4505 * @code
4506 * const Evas_Map *m = evas_object_map_get(obj);
4507 * Evas_Map *m2 = evas_map_dup(m);
4508 * evas_map_util_rotate(m2, 30.0, 0, 0);
4509 * evas_object_map_set(obj);
4510 * evas_map_free(m2);
4511 * @endcode
4512 *
4513 * @param obj object to query transformation map.
4514 * @return map reference to map in use. This is an internal data structure, so
4515 * do not modify it.
4516 *
4517 * @see evas_object_map_set()
4518 */
4519EAPI const Evas_Map *evas_object_map_get (const Evas_Object *obj);
4520
4521
4522/**
4523 * Populate source and destination map points to match exactly object.
4524 *
4525 * Usually one initialize map of an object to match it's original
4526 * position and size, then transform these with evas_map_util_*
4527 * functions, such as evas_map_util_rotate() or
4528 * evas_map_util_3d_rotate(). The original set is done by this
4529 * function, avoiding code duplication all around.
4530 *
4531 * @param m map to change all 4 points (must be of size 4).
4532 * @param obj object to use unmapped geometry to populate map coordinates.
4533 * @param z Point Z Coordinate hint (pre-perspective transform). This value
4534 * will be used for all four points.
4535 *
4536 * @see evas_map_util_points_populate_from_object()
4537 * @see evas_map_point_coord_set()
4538 * @see evas_map_point_image_uv_set()
4539 */
4540EAPI void evas_map_util_points_populate_from_object_full(Evas_Map *m, const Evas_Object *obj, Evas_Coord z);
4541
4542/**
4543 * Populate source and destination map points to match exactly object.
4544 *
4545 * Usually one initialize map of an object to match it's original
4546 * position and size, then transform these with evas_map_util_*
4547 * functions, such as evas_map_util_rotate() or
4548 * evas_map_util_3d_rotate(). The original set is done by this
4549 * function, avoiding code duplication all around.
4550 *
4551 * Z Point coordinate is assumed as 0 (zero).
4552 *
4553 * @param m map to change all 4 points (must be of size 4).
4554 * @param obj object to use unmapped geometry to populate map coordinates.
4555 *
4556 * @see evas_map_util_points_populate_from_object_full()
4557 * @see evas_map_util_points_populate_from_geometry()
4558 * @see evas_map_point_coord_set()
4559 * @see evas_map_point_image_uv_set()
4560 */
4561EAPI void evas_map_util_points_populate_from_object (Evas_Map *m, const Evas_Object *obj);
4562
4563/**
4564 * Populate source and destination map points to match given geometry.
4565 *
4566 * Similar to evas_map_util_points_populate_from_object_full(), this
4567 * call takes raw values instead of querying object's unmapped
4568 * geometry. The given width will be used to calculate destination
4569 * points (evas_map_point_coord_set()) and set the image uv
4570 * (evas_map_point_image_uv_set()).
4571 *
4572 * @param m map to change all 4 points (must be of size 4).
4573 * @param x Point X Coordinate
4574 * @param y Point Y Coordinate
4575 * @param w width to use to calculate second and third points.
4576 * @param h height to use to calculate third and fourth points.
4577 * @param z Point Z Coordinate hint (pre-perspective transform). This value
4578 * will be used for all four points.
4579 *
4580 * @see evas_map_util_points_populate_from_object()
4581 * @see evas_map_point_coord_set()
4582 * @see evas_map_point_image_uv_set()
4583 */
4584EAPI void evas_map_util_points_populate_from_geometry (Evas_Map *m, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Evas_Coord z);
4585
4586/**
4587 * Set color of all points to given color.
4588 *
4589 * This call is useful to reuse maps after they had 3d lightning or
4590 * any other colorization applied before.
4591 *
4592 * @param m map to change the color of.
4593 * @param r red (0 - 255)
4594 * @param g green (0 - 255)
4595 * @param b blue (0 - 255)
4596 * @param a alpha (0 - 255)
4597 *
4598 * @see evas_map_point_color_set()
4599 */
4600EAPI void evas_map_util_points_color_set (Evas_Map *m, int r, int g, int b, int a);
4601
4602/**
4603 * Change the map to apply the given rotation.
4604 *
4605 * This rotates the indicated map's coordinates around the center coordinate
4606 * given by @p cx and @p cy as the rotation center. The points will have their
4607 * X and Y coordinates rotated clockwise by @p degrees degress (360.0 is a
4608 * full rotation). Negative values for degrees will rotate counter-clockwise
4609 * by that amount. All coordinates are canvas global coordinates.
4610 *
4611 * @param m map to change.
4612 * @param degrees amount of degrees from 0.0 to 360.0 to rotate.
4613 * @param cx rotation's center horizontal position.
4614 * @param cy rotation's center vertical position.
4615 *
4616 * @see evas_map_point_coord_set()
4617 * @see evas_map_util_zoom()
4618 */
4619EAPI void evas_map_util_rotate (Evas_Map *m, double degrees, Evas_Coord cx, Evas_Coord cy);
4620
4621/**
4622 * Change the map to apply the given zooming.
4623 *
4624 * Like evas_map_util_rotate(), this zooms the points of the map from a center
4625 * point. That center is defined by @p cx and @p cy. The @p zoomx and @p zoomy
4626 * parameters specify how much to zoom in the X and Y direction respectively.
4627 * A value of 1.0 means "don't zoom". 2.0 means "dobule the size". 0.5 is
4628 * "half the size" etc. All coordinates are canvas global coordinates.
4629 *
4630 * @param m map to change.
4631 * @param zoomx horizontal zoom to use.
4632 * @param zoomy vertical zoom to use.
4633 * @param cx zooming center horizontal position.
4634 * @param cy zooming center vertical position.
4635 *
4636 * @see evas_map_point_coord_set()
4637 * @see evas_map_util_rotate()
4638 */
4639EAPI void evas_map_util_zoom (Evas_Map *m, double zoomx, double zoomy, Evas_Coord cx, Evas_Coord cy);
4640
4641/**
4642 * Rotate the map around 3 axes in 3D
4643 *
4644 * This will rotate not just around the "Z" axis as in evas_map_util_rotate()
4645 * (which is a convenience call for those only wanting 2D). This will rotate
4646 * around the X, Y and Z axes. The Z axis points "into" the screen with low
4647 * values at the screen and higher values further away. The X axis runs from
4648 * left to right on the screen and the Y axis from top to bottom. Like with
4649 * evas_map_util_rotate() you provide a center point to rotate around (in 3D).
4650 *
4651 * @param m map to change.
4652 * @param dx amount of degrees from 0.0 to 360.0 to rotate arount X axis.
4653 * @param dy amount of degrees from 0.0 to 360.0 to rotate arount Y axis.
4654 * @param dz amount of degrees from 0.0 to 360.0 to rotate arount Z axis.
4655 * @param cx rotation's center horizontal position.
4656 * @param cy rotation's center vertical position.
4657 * @param cz rotation's center vertical position.
4658 */
4659EAPI void evas_map_util_3d_rotate (Evas_Map *m, double dx, double dy, double dz, Evas_Coord cx, Evas_Coord cy, Evas_Coord cz);
4660
4661/**
4662 * Perform lighting calculations on the given Map
4663 *
4664 * This is used to apply lighting calculations (from a single light source)
4665 * to a given map. The R, G and B values of each vertex will be modified to
4666 * reflect the lighting based on the lixth point coordinates, the light
4667 * color and the ambient color, and at what angle the map is facing the
4668 * light source. A surface should have its points be declared in a
4669 * clockwise fashion if the face is "facing" towards you (as opposed to
4670 * away from you) as faces have a "logical" side for lighting.
4671 *
4672 * @image html map-light3.png
4673 * @image rtf map-light3.png
4674 * @image latex map-light3.eps
4675 * @note Grey object, no lighting used
4676 *
4677 * @image html map-light4.png
4678 * @image rtf map-light4.png
4679 * @image latex map-light4.eps
4680 * @note Lights out! Every color set to 0
4681 *
4682 * @image html map-light5.png
4683 * @image rtf map-light5.png
4684 * @image latex map-light5.eps
4685 * @note Ambient light to full black, red light coming from close at the
4686 * bottom-left vertex
4687 *
4688 * @image html map-light6.png
4689 * @image rtf map-light6.png
4690 * @image latex map-light6.eps
4691 * @note Same light as before, but not the light is set to 0 and ambient light
4692 * is cyan
4693 *
4694 * @image html map-light7.png
4695 * @image rtf map-light7.png
4696 * @image latex map-light7.eps
4697 * @note Both lights are on
4698 *
4699 * @image html map-light8.png
4700 * @image rtf map-light8.png
4701 * @image latex map-light8.eps
4702 * @note Both lights again, but this time both are the same color.
4703 *
4704 * @param m map to change.
4705 * @param lx X coordinate in space of light point
4706 * @param ly Y coordinate in space of light point
4707 * @param lz Z coordinate in space of light point
4708 * @param lr light red value (0 - 255)
4709 * @param lg light green value (0 - 255)
4710 * @param lb light blue value (0 - 255)
4711 * @param ar ambient color red value (0 - 255)
4712 * @param ag ambient color green value (0 - 255)
4713 * @param ab ambient color blue value (0 - 255)
4714 */
4715EAPI void evas_map_util_3d_lighting (Evas_Map *m, Evas_Coord lx, Evas_Coord ly, Evas_Coord lz, int lr, int lg, int lb, int ar, int ag, int ab);
4716
4717/**
4718 * Apply a perspective transform to the map
4719 *
4720 * This applies a given perspective (3D) to the map coordinates. X, Y and Z
4721 * values are used. The px and py points specify the "infinite distance" point
4722 * in the 3D conversion (where all lines converge to like when artists draw
4723 * 3D by hand). The @p z0 value specifis the z value at which there is a 1:1
4724 * mapping between spatial coorinates and screen coordinates. Any points
4725 * on this z value will not have their X and Y values modified in the transform.
4726 * Those further away (Z value higher) will shrink into the distance, and
4727 * those less than this value will expand and become bigger. The @p foc value
4728 * determines the "focal length" of the camera. This is in reality the distance
4729 * between the camera lens plane itself (at or closer than this rendering
4730 * results are undefined) and the "z0" z value. This allows for some "depth"
4731 * control and @p foc must be greater than 0.
4732 *
4733 * @param m map to change.
4734 * @param px The pespective distance X coordinate
4735 * @param py The pespective distance Y coordinate
4736 * @param z0 The "0" z plane value
4737 * @param foc The focal distance
4738 */
4739EAPI void evas_map_util_3d_perspective (Evas_Map *m, Evas_Coord px, Evas_Coord py, Evas_Coord z0, Evas_Coord foc);
4740
4741/**
4742 * Get the clockwise state of a map
4743 *
4744 * This determines if the output points (X and Y. Z is not used) are
4745 * clockwise or anti-clockwise. This can be used for "back-face culling". This
4746 * is where you hide objects that "face away" from you. In this case objects
4747 * that are not clockwise.
4748 *
4749 * @param m map to query.
4750 * @return 1 if clockwise, 0 otherwise
4751 */
4752EAPI Eina_Bool evas_map_util_clockwise_get (Evas_Map *m);
4753
4754
4755/**
4756 * Create map of transformation points to be later used with an Evas object.
4757 *
4758 * This creates a set of points (currently only 4 is supported. no other
4759 * number for @p count will work). That is empty and ready to be modified
4760 * with evas_map calls.
4761 *
4762 * @param count number of points in the map.
4763 * @return a newly allocated map or @c NULL on errors.
4764 *
4765 * @see evas_map_free()
4766 * @see evas_map_dup()
4767 * @see evas_map_point_coord_set()
4768 * @see evas_map_point_image_uv_set()
4769 * @see evas_map_util_points_populate_from_object_full()
4770 * @see evas_map_util_points_populate_from_object()
4771 *
4772 * @see evas_object_map_set()
4773 */
4774EAPI Evas_Map *evas_map_new (int count);
4775
4776/**
4777 * Set the smoothing for map rendering
4778 *
4779 * This sets smoothing for map rendering. If the object is a type that has
4780 * its own smoothing settings, then both the smooth settings for this object
4781 * and the map must be turned off. By default smooth maps are enabled.
4782 *
4783 * @param m map to modify. Must not be NULL.
4784 * @param enabled enable or disable smooth map rendering
4785 */
4786EAPI void evas_map_smooth_set (Evas_Map *m, Eina_Bool enabled);
4787
4788/**
4789 * get the smoothing for map rendering
4790 *
4791 * This gets smoothing for map rendering.
4792 *
4793 * @param m map to get the smooth from. Must not be NULL.
4794 */
4795EAPI Eina_Bool evas_map_smooth_get (const Evas_Map *m);
4796
4797/**
4798 * Set the alpha flag for map rendering
4799 *
4800 * This sets alpha flag for map rendering. If the object is a type that has
4801 * its own alpha settings, then this will take precedence. Only image objects
4802 * have this currently.
4803 * Setting this off stops alpha blending of the map area, and is
4804 * useful if you know the object and/or all sub-objects is 100% solid.
4805 *
4806 * @param m map to modify. Must not be NULL.
4807 * @param enabled enable or disable alpha map rendering
4808 */
4809EAPI void evas_map_alpha_set (Evas_Map *m, Eina_Bool enabled);
4810
4811/**
4812 * get the alpha flag for map rendering
4813 *
4814 * This gets the alph flag for map rendering.
4815 *
4816 * @param m map to get the alpha from. Must not be NULL.
4817 */
4818EAPI Eina_Bool evas_map_alpha_get (const Evas_Map *m);
4819
4820/**
4821 * Copy a previously allocated map.
4822 *
4823 * This makes a duplicate of the @p m object and returns it.
4824 *
4825 * @param m map to copy. Must not be NULL.
4826 * @return newly allocated map with the same count and contents as @p m.
4827 */
4828EAPI Evas_Map *evas_map_dup (const Evas_Map *m);
4829
4830/**
4831 * Free a previously allocated map.
4832 *
4833 * This frees a givem map @p m and all memory associated with it. You must NOT
4834 * free a map returned by evas_object_map_get() as this is internal.
4835 *
4836 * @param m map to free.
4837 */
4838EAPI void evas_map_free (Evas_Map *m);
4839
4840/**
4841 * Get a maps size.
4842 *
4843 * Returns the number of points in a map. Should be at least 4.
4844 *
4845 * @param m map to get size.
4846 * @return -1 on error, points otherwise.
4847 */
4848EAPI int evas_map_count_get (const Evas_Map *m) EINA_CONST;
4849
4850/**
4851 * Change the map point's coordinate.
4852 *
4853 * This sets the fixed point's coordinate in the map. Note that points
4854 * describe the outline of a quadrangle and are ordered either clockwise
4855 * or anit-clock-wise. It is suggested to keep your quadrangles concave and
4856 * non-complex, though these polygon modes may work, they may not render
4857 * a desired set of output. The quadrangle will use points 0 and 1 , 1 and 2,
4858 * 2 and 3, and 3 and 0 to describe the edges of the quandrangle.
4859 *
4860 * The X and Y and Z coordinates are in canvas units. Z is optional and may
4861 * or may not be honored in drawing. Z is a hint and does not affect the
4862 * X and Y rendered coordinates. It may be used for calculating fills with
4863 * perspective correct rendering.
4864 *
4865 * Remember all coordinates are canvas global ones like with move and reize
4866 * in evas.
4867 *
4868 * @param m map to change point. Must not be @c NULL.
4869 * @param idx index of point to change. Must be smaller than map size.
4870 * @param x Point X Coordinate
4871 * @param y Point Y Coordinate
4872 * @param z Point Z Coordinate hint (pre-perspective transform)
4873 *
4874 * @see evas_map_util_rotate()
4875 * @see evas_map_util_zoom()
4876 * @see evas_map_util_points_populate_from_object_full()
4877 * @see evas_map_util_points_populate_from_object()
4878 */
4879EAPI void evas_map_point_coord_set (Evas_Map *m, int idx, Evas_Coord x, Evas_Coord y, Evas_Coord z);
4880
4881/**
4882 * Get the map point's coordinate.
4883 *
4884 * This returns the coordinates of the given point in the map.
4885 *
4886 * @param m map to query point.
4887 * @param idx index of point to query. Must be smaller than map size.
4888 * @param x where to return the X coordinate.
4889 * @param y where to return the Y coordinate.
4890 * @param z where to return the Z coordinate.
4891 */
4892EAPI void evas_map_point_coord_get (const Evas_Map *m, int idx, Evas_Coord *x, Evas_Coord *y, Evas_Coord *z);
4893
4894/**
4895 * Change the map point's U and V texture source point
4896 *
4897 * This sets the U and V coordinates for the point. This determines which
4898 * coordinate in the source image is mapped to the given point, much like
4899 * OpenGL and textures. Notes that these points do select the pixel, but
4900 * are double floating point values to allow for accuracy and sub-pixel
4901 * selection.
4902 *
4903 * @param m map to change the point of.
4904 * @param idx index of point to change. Must be smaller than map size.
4905 * @param u the X coordinate within the image/texture source
4906 * @param v the Y coordinate within the image/texture source
4907 *
4908 * @see evas_map_point_coord_set()
4909 * @see evas_object_map_set()
4910 * @see evas_map_util_points_populate_from_object_full()
4911 * @see evas_map_util_points_populate_from_object()
4912 */
4913EAPI void evas_map_point_image_uv_set (Evas_Map *m, int idx, double u, double v);
4914
4915/**
4916 * Get the map point's U and V texture source points
4917 *
4918 * This returns the texture points set by evas_map_point_image_uv_set().
4919 *
4920 * @param m map to query point.
4921 * @param idx index of point to query. Must be smaller than map size.
4922 * @param u where to write the X coordinate within the image/texture source
4923 * @param v where to write the Y coordinate within the image/texture source
4924 */
4925EAPI void evas_map_point_image_uv_get (const Evas_Map *m, int idx, double *u, double *v);
4926
4927/**
4928 * Set the color of a vertex in the map
4929 *
4930 * This sets the color of the vertex in the map. Colors will be linearly
4931 * interpolated between vertex points through the map. Color will multiply
4932 * the "texture" pixels (like GL_MODULATE in OpenGL). The default color of
4933 * a vertex in a map is white solid (255, 255, 255, 255) which means it will
4934 * have no affect on modifying the texture pixels.
4935 *
4936 * @param m map to change the color of.
4937 * @param idx index of point to change. Must be smaller than map size.
4938 * @param r red (0 - 255)
4939 * @param g green (0 - 255)
4940 * @param b blue (0 - 255)
4941 * @param a alpha (0 - 255)
4942 *
4943 * @see evas_map_util_points_color_set()
4944 * @see evas_map_point_coord_set()
4945 * @see evas_object_map_set()
4946 */
4947EAPI void evas_map_point_color_set (Evas_Map *m, int idx, int r, int g, int b, int a);
4948
4949/**
4950 * Get the color set on a vertex in the map
4951 *
4952 * This gets the color set by evas_map_point_color_set() on the given vertex
4953 * of the map.
4954 *
4955 * @param m map to get the color of the vertex from.
4956 * @param idx index of point get. Must be smaller than map size.
4957 * @param r pointer to red return
4958 * @param g pointer to green return
4959 * @param b pointer to blue return
4960 * @param a pointer to alpha return (0 - 255)
4961 *
4962 * @see evas_map_point_coord_set()
4963 * @see evas_object_map_set()
4964 */
4965EAPI void evas_map_point_color_get (const Evas_Map *m, int idx, int *r, int *g, int *b, int *a);
4966/**
4967 * @}
4968 */
4969
4970/**
4971 * @defgroup Evas_Object_Group_Size_Hints Size Hints
4972 *
4973 * Objects may carry hints, so that another object that acts as a
4974 * manager (see @ref Evas_Smart_Object_Group) may know how to properly
4975 * position and resize its subordinate objects. The Size Hints provide
4976 * a common interface that is recommended as the protocol for such
4977 * information.
4978 *
4979 * For example, box objects use alignment hints to align its
4980 * lines/columns inside its container, padding hints to set the
4981 * padding between each individual child, etc.
4982 *
4983 * Examples on their usage:
4984 * - @ref Example_Evas_Size_Hints "evas-hints.c"
4985 * - @ref Example_Evas_Aspect_Hints "evas-aspect-hints.c"
4986 *
4987 * @ingroup Evas_Object_Group
4988 */
4989
4990/**
4991 * @addtogroup Evas_Object_Group_Size_Hints
4992 * @{
4993 */
4994
4995/**
4996 * Retrieves the hints for an object's minimum size.
4997 *
4998 * @param obj The given Evas object to query hints from.
4999 * @param w Pointer to an integer in which to store the minimum width.
5000 * @param h Pointer to an integer in which to store the minimum height.
5001 *
5002 * These are hints on the minimim sizes @p obj should have. This is
5003 * not a size enforcement in any way, it's just a hint that should be
5004 * used whenever appropriate.
5005 *
5006 * @note Use @c NULL pointers on the hint components you're not
5007 * interested in: they'll be ignored by the function.
5008 *
5009 * @see evas_object_size_hint_min_set() for an example
5010 */
5011EAPI void evas_object_size_hint_min_get (const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
5012
5013/**
5014 * Sets the hints for an object's minimum size.
5015 *
5016 * @param obj The given Evas object to query hints from.
5017 * @param w Integer to use as the minimum width hint.
5018 * @param h Integer to use as the minimum height hint.
5019 *
5020 * This is not a size enforcement in any way, it's just a hint that
5021 * should be used whenever appropriate.
5022 *
5023 * Values @c 0 will be treated as unset hint components, when queried
5024 * by managers.
5025 *
5026 * Example:
5027 * @dontinclude evas-hints.c
5028 * @skip evas_object_size_hint_min_set
5029 * @until return
5030 *
5031 * In this example the minimum size hints change de behavior of an
5032 * Evas box when layouting its children. See the full @ref
5033 * Example_Evas_Size_Hints "example".
5034 *
5035 * @see evas_object_size_hint_min_get()
5036 */
5037EAPI void evas_object_size_hint_min_set (Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
5038
5039/**
5040 * Retrieves the hints for an object's maximum size.
5041 *
5042 * @param obj The given Evas object to query hints from.
5043 * @param w Pointer to an integer in which to store the maximum width.
5044 * @param h Pointer to an integer in which to store the maximum height.
5045 *
5046 * These are hints on the maximum sizes @p obj should have. This is
5047 * not a size enforcement in any way, it's just a hint that should be
5048 * used whenever appropriate.
5049 *
5050 * @note Use @c NULL pointers on the hint components you're not
5051 * interested in: they'll be ignored by the function.
5052 *
5053 * @see evas_object_size_hint_max_set()
5054 */
5055EAPI void evas_object_size_hint_max_get (const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
5056
5057/**
5058 * Sets the hints for an object's maximum size.
5059 *
5060 * @param obj The given Evas object to query hints from.
5061 * @param w Integer to use as the maximum width hint.
5062 * @param h Integer to use as the maximum height hint.
5063 *
5064 * This is not a size enforcement in any way, it's just a hint that
5065 * should be used whenever appropriate.
5066 *
5067 * Values @c -1 will be treated as unset hint components, when queried
5068 * by managers.
5069 *
5070 * Example:
5071 * @dontinclude evas-hints.c
5072 * @skip evas_object_size_hint_max_set
5073 * @until return
5074 *
5075 * In this example the maximum size hints change de behavior of an
5076 * Evas box when layouting its children. See the full @ref
5077 * Example_Evas_Size_Hints "example".
5078 *
5079 * @see evas_object_size_hint_max_get()
5080 */
5081EAPI void evas_object_size_hint_max_set (Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
5082
5083/**
5084 * Retrieves the hints for an object's optimum size.
5085 *
5086 * @param obj The given Evas object to query hints from.
5087 * @param w Pointer to an integer in which to store the requested width.
5088 * @param h Pointer to an integer in which to store the requested height.
5089 *
5090 * These are hints on the optimum sizes @p obj should have. This is
5091 * not a size enforcement in any way, it's just a hint that should be
5092 * used whenever appropriate.
5093 *
5094 * @note Use @c NULL pointers on the hint components you're not
5095 * interested in: they'll be ignored by the function.
5096 *
5097 * @see evas_object_size_hint_request_set()
5098 */
5099EAPI void evas_object_size_hint_request_get (const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
5100
5101/**
5102 * Sets the hints for an object's optimum size.
5103 *
5104 * @param obj The given Evas object to query hints from.
5105 * @param w Integer to use as the preferred width hint.
5106 * @param h Integer to use as the preferred height hint.
5107 *
5108 * This is not a size enforcement in any way, it's just a hint that
5109 * should be used whenever appropriate.
5110 *
5111 * Values @c 0 will be treated as unset hint components, when queried
5112 * by managers.
5113 *
5114 * @see evas_object_size_hint_request_get()
5115 */
5116EAPI void evas_object_size_hint_request_set (Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
5117
5118/**
5119 * Retrieves the hints for an object's aspect ratio.
5120 *
5121 * @param obj The given Evas object to query hints from.
5122 * @param aspect Returns the policy/type of aspect ratio applied to @p obj.
5123 * @param w Pointer to an integer in which to store the aspect's width
5124 * ratio term.
5125 * @param h Pointer to an integer in which to store the aspect's
5126 * height ratio term.
5127 *
5128 * The different aspect ratio policies are documented in the
5129 * #Evas_Aspect_Control type. A container respecting these size hints
5130 * would @b resize its children accordingly to those policies.
5131 *
5132 * For any policy, if any of the given aspect ratio terms are @c 0,
5133 * the object's container should ignore the aspect and scale @p obj to
5134 * occupy the whole available area. If they are both positive
5135 * integers, that proportion will be respected, under each scaling
5136 * policy.
5137 *
5138 * These images illustrate some of the #Evas_Aspect_Control policies:
5139 *
5140 * @image html any-policy.png
5141 * @image rtf any-policy.png
5142 * @image latex any-policy.eps
5143 *
5144 * @image html aspect-control-none-neither.png
5145 * @image rtf aspect-control-none-neither.png
5146 * @image latex aspect-control-none-neither.eps
5147 *
5148 * @image html aspect-control-both.png
5149 * @image rtf aspect-control-both.png
5150 * @image latex aspect-control-both.eps
5151 *
5152 * @image html aspect-control-horizontal.png
5153 * @image rtf aspect-control-horizontal.png
5154 * @image latex aspect-control-horizontal.eps
5155 *
5156 * This is not a size enforcement in any way, it's just a hint that
5157 * should be used whenever appropriate.
5158 *
5159 * @note Use @c NULL pointers on the hint components you're not
5160 * interested in: they'll be ignored by the function.
5161 *
5162 * Example:
5163 * @dontinclude evas-aspect-hints.c
5164 * @skip if (strcmp(ev->keyname, "c") == 0)
5165 * @until }
5166 *
5167 * See the full @ref Example_Evas_Aspect_Hints "example".
5168 *
5169 * @see evas_object_size_hint_aspect_set()
5170 */
5171EAPI void evas_object_size_hint_aspect_get (const Evas_Object *obj, Evas_Aspect_Control *aspect, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
5172
5173/**
5174 * Sets the hints for an object's aspect ratio.
5175 *
5176 * @param obj The given Evas object to query hints from.
5177 * @param aspect The policy/type of aspect ratio to apply to @p obj.
5178 * @param w Integer to use as aspect width ratio term.
5179 * @param h Integer to use as aspect height ratio term.
5180 *
5181 * This is not a size enforcement in any way, it's just a hint that should
5182 * be used whenever appropriate.
5183 *
5184 * If any of the given aspect ratio terms are @c 0,
5185 * the object's container will ignore the aspect and scale @p obj to
5186 * occupy the whole available area, for any given policy.
5187 *
5188 * @see evas_object_size_hint_aspect_get() for more information.
5189 */
5190EAPI void evas_object_size_hint_aspect_set (Evas_Object *obj, Evas_Aspect_Control aspect, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
5191
5192/**
5193 * Retrieves the hints for on object's alignment.
5194 *
5195 * @param obj The given Evas object to query hints from.
5196 * @param x Pointer to a double in which to store the horizontal
5197 * alignment hint.
5198 * @param y Pointer to a double in which to store the vertical
5199 * alignment hint.
5200 *
5201 * This is not a size enforcement in any way, it's just a hint that
5202 * should be used whenever appropriate.
5203 *
5204 * @note Use @c NULL pointers on the hint components you're not
5205 * interested in: they'll be ignored by the function.
5206 *
5207 * @see evas_object_size_hint_align_set() for more information
5208 */
5209EAPI void evas_object_size_hint_align_get (const Evas_Object *obj, double *x, double *y) EINA_ARG_NONNULL(1);
5210
5211/**
5212 * Sets the hints for an object's alignment.
5213 *
5214 * @param obj The given Evas object to query hints from.
5215 * @param x Double, ranging from @c 0.0 to @c 1.0 or with the
5216 * special value #EVAS_HINT_FILL, to use as horizontal alignment hint.
5217 * @param y Double, ranging from @c 0.0 to @c 1.0 or with the
5218 * special value #EVAS_HINT_FILL, to use as vertical alignment hint.
5219 *
5220 * These are hints on how to align an object <b>inside the boundaries
5221 * of a container/manager</b>. Accepted values are in the @c 0.0 to @c
5222 * 1.0 range, with the special value #EVAS_HINT_FILL used to specify
5223 * "justify" or "fill" by some users. In this case, maximum size hints
5224 * should be enforced with higher priority, if they are set. Also, any
5225 * padding hint set on objects should add up to the alignment space on
5226 * the final scene composition.
5227 *
5228 * See documentation of possible users: in Evas, they are the @ref
5229 * Evas_Object_Box "box" and @ref Evas_Object_Table "table" smart
5230 * objects.
5231 *
5232 * For the horizontal component, @c 0.0 means to the left, @c 1.0
5233 * means to the right. Analogously, for the vertical component, @c 0.0
5234 * to the top, @c 1.0 means to the bottom.
5235 *
5236 * See the following figure:
5237 *
5238 * @image html alignment-hints.png
5239 * @image rtf alignment-hints.png
5240 * @image latex alignment-hints.eps
5241 *
5242 * This is not a size enforcement in any way, it's just a hint that
5243 * should be used whenever appropriate.
5244 *
5245 * Example:
5246 * @dontinclude evas-hints.c
5247 * @skip evas_object_size_hint_align_set
5248 * @until return
5249 *
5250 * In this example the alignment hints change de behavior of an Evas
5251 * box when layouting its children. See the full @ref
5252 * Example_Evas_Size_Hints "example".
5253 *
5254 * @see evas_object_size_hint_align_get()
5255 * @see evas_object_size_hint_max_set()
5256 * @see evas_object_size_hint_padding_set()
5257 */
5258EAPI void evas_object_size_hint_align_set (Evas_Object *obj, double x, double y) EINA_ARG_NONNULL(1);
5259
5260/**
5261 * Retrieves the hints for an object's weight.
5262 *
5263 * @param obj The given Evas object to query hints from.
5264 * @param x Pointer to a double in which to store the horizontal weight.
5265 * @param y Pointer to a double in which to store the vertical weight.
5266 *
5267 * Accepted values are zero or positive values. Some users might use
5268 * this hint as a boolean, but some might consider it as a @b
5269 * proportion, see documentation of possible users, which in Evas are
5270 * the @ref Evas_Object_Box "box" and @ref Evas_Object_Table "table"
5271 * smart objects.
5272 *
5273 * This is not a size enforcement in any way, it's just a hint that
5274 * should be used whenever appropriate.
5275 *
5276 * @note Use @c NULL pointers on the hint components you're not
5277 * interested in: they'll be ignored by the function.
5278 *
5279 * @see evas_object_size_hint_weight_set() for an example
5280 */
5281EAPI void evas_object_size_hint_weight_get (const Evas_Object *obj, double *x, double *y) EINA_ARG_NONNULL(1);
5282
5283/**
5284 * Sets the hints for an object's weight.
5285 *
5286 * @param obj The given Evas object to query hints from.
5287 * @param x Nonnegative double value to use as horizontal weight hint.
5288 * @param y Nonnegative double value to use as vertical weight hint.
5289 *
5290 * This is not a size enforcement in any way, it's just a hint that
5291 * should be used whenever appropriate.
5292 *
5293 * This is a hint on how a container object should @b resize a given
5294 * child within its area. Containers may adhere to the simpler logic
5295 * of just expanding the child object's dimensions to fit its own (see
5296 * the #EVAS_HINT_EXPAND helper weight macro) or the complete one of
5297 * taking each child's weight hint as real @b weights to how much of
5298 * its size to allocate for them in each axis. A container is supposed
5299 * to, after @b normalizing the weights of its children (with weight
5300 * hints), distribute the space it has to layout them by those factors
5301 * -- most weighted children get larger in this process than the least
5302 * ones.
5303 *
5304 * Example:
5305 * @dontinclude evas-hints.c
5306 * @skip evas_object_size_hint_weight_set
5307 * @until return
5308 *
5309 * In this example the weight hints change de behavior of an Evas box
5310 * when layouting its children. See the full @ref
5311 * Example_Evas_Size_Hints "example".
5312 *
5313 * @see evas_object_size_hint_weight_get() for more information
5314 */
5315EAPI void evas_object_size_hint_weight_set (Evas_Object *obj, double x, double y) EINA_ARG_NONNULL(1);
5316
5317/**
5318 * Retrieves the hints for an object's padding space.
5319 *
5320 * @param obj The given Evas object to query hints from.
5321 * @param l Pointer to an integer in which to store left padding.
5322 * @param r Pointer to an integer in which to store right padding.
5323 * @param t Pointer to an integer in which to store top padding.
5324 * @param b Pointer to an integer in which to store bottom padding.
5325 *
5326 * Padding is extra space an object takes on each of its delimiting
5327 * rectangle sides, in canvas units. This space will be rendered
5328 * transparent, naturally, as in the following figure:
5329 *
5330 * @image html padding-hints.png
5331 * @image rtf padding-hints.png
5332 * @image latex padding-hints.eps
5333 *
5334 * This is not a size enforcement in any way, it's just a hint that
5335 * should be used whenever appropriate.
5336 *
5337 * @note Use @c NULL pointers on the hint components you're not
5338 * interested in: they'll be ignored by the function.
5339 *
5340 * Example:
5341 * @dontinclude evas-hints.c
5342 * @skip evas_object_size_hint_padding_set
5343 * @until return
5344 *
5345 * In this example the padding hints change de behavior of an Evas box
5346 * when layouting its children. See the full @ref
5347 * Example_Evas_Size_Hints "example".
5348 *
5349 * @see evas_object_size_hint_padding_set()
5350 */
5351EAPI void evas_object_size_hint_padding_get (const Evas_Object *obj, Evas_Coord *l, Evas_Coord *r, Evas_Coord *t, Evas_Coord *b) EINA_ARG_NONNULL(1);
5352
5353/**
5354 * Sets the hints for an object's padding space.
5355 *
5356 * @param obj The given Evas object to query hints from.
5357 * @param l Integer to specify left padding.
5358 * @param r Integer to specify right padding.
5359 * @param t Integer to specify top padding.
5360 * @param b Integer to specify bottom padding.
5361 *
5362 * This is not a size enforcement in any way, it's just a hint that
5363 * should be used whenever appropriate.
5364 *
5365 * @see evas_object_size_hint_padding_get() for more information
5366 */
5367EAPI void evas_object_size_hint_padding_set (Evas_Object *obj, Evas_Coord l, Evas_Coord r, Evas_Coord t, Evas_Coord b) EINA_ARG_NONNULL(1);
5368
5369/**
5370 * @}
5371 */
5372
5373/**
5374 * @defgroup Evas_Object_Group_Extras Extra Object Manipulation
5375 *
5376 * Miscellaneous functions that also apply to any object, but are less
5377 * used or not implemented by all objects.
5378 *
5379 * Examples on this group of functions can be found @ref
5380 * Example_Evas_Stacking "here" and @ref Example_Evas_Events "here".
5381 *
5382 * @ingroup Evas_Object_Group
5383 */
5384
5385/**
5386 * @addtogroup Evas_Object_Group_Extras
5387 * @{
5388 */
5389
5390/**
5391 * Set an attached data pointer to an object with a given string key.
5392 *
5393 * @param obj The object to attach the data pointer to
5394 * @param key The string key for the data to access it
5395 * @param data The ponter to the data to be attached
5396 *
5397 * This attaches the pointer @p data to the object @p obj, given the
5398 * access string @p key. This pointer will stay "hooked" to the object
5399 * until a new pointer with the same string key is attached with
5400 * evas_object_data_set() or it is deleted with
5401 * evas_object_data_del(). On deletion of the object @p obj, the
5402 * pointers will not be accessible from the object anymore.
5403 *
5404 * You can find the pointer attached under a string key using
5405 * evas_object_data_get(). It is the job of the calling application to
5406 * free any data pointed to by @p data when it is no longer required.
5407 *
5408 * If @p data is @c NULL, the old value stored at @p key will be
5409 * removed but no new value will be stored. This is synonymous with
5410 * calling evas_object_data_del() with @p obj and @p key.
5411 *
5412 * @note This function is very handy when you have data associated
5413 * specifically to an Evas object, being of use only when dealing with
5414 * it. Than you don't have the burden to a pointer to it elsewhere,
5415 * using this family of functions.
5416 *
5417 * Example:
5418 *
5419 * @code
5420 * int *my_data;
5421 * extern Evas_Object *obj;
5422 *
5423 * my_data = malloc(500);
5424 * evas_object_data_set(obj, "name_of_data", my_data);
5425 * printf("The data that was attached was %p\n", evas_object_data_get(obj, "name_of_data"));
5426 * @endcode
5427 */
5428EAPI void evas_object_data_set (Evas_Object *obj, const char *key, const void *data) EINA_ARG_NONNULL(1, 2);
5429
5430/**
5431 * Return an attached data pointer on an Evas object by its given
5432 * string key.
5433 *
5434 * @param obj The object to which the data was attached
5435 * @param key The string key the data was stored under
5436 * @return The data pointer stored, or @c NULL if none was stored
5437 *
5438 * This function will return the data pointer attached to the object
5439 * @p obj, stored using the string key @p key. If the object is valid
5440 * and a data pointer was stored under the given key, that pointer
5441 * will be returned. If this is not the case, @c NULL will be
5442 * returned, signifying an invalid object or a non-existent key. It is
5443 * possible that a @c NULL pointer was stored given that key, but this
5444 * situation is non-sensical and thus can be considered an error as
5445 * well. @c NULL pointers are never stored as this is the return value
5446 * if an error occurs.
5447 *
5448 * Example:
5449 *
5450 * @code
5451 * int *my_data;
5452 * extern Evas_Object *obj;
5453 *
5454 * my_data = evas_object_data_get(obj, "name_of_my_data");
5455 * if (my_data) printf("Data stored was %p\n", my_data);
5456 * else printf("No data was stored on the object\n");
5457 * @endcode
5458 */
5459EAPI void *evas_object_data_get (const Evas_Object *obj, const char *key) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
5460
5461/**
5462 * Delete an attached data pointer from an object.
5463 *
5464 * @param obj The object to delete the data pointer from
5465 * @param key The string key the data was stored under
5466 * @return The original data pointer stored at @p key on @p obj
5467 *
5468 * This will remove the stored data pointer from @p obj stored under
5469 * @p key and return this same pointer, if actually there was data
5470 * there, or @c NULL, if nothing was stored under that key.
5471 *
5472 * Example:
5473 *
5474 * @code
5475 * int *my_data;
5476 * extern Evas_Object *obj;
5477 *
5478 * my_data = evas_object_data_del(obj, "name_of_my_data");
5479 * @endcode
5480 */
5481EAPI void *evas_object_data_del (Evas_Object *obj, const char *key) EINA_ARG_NONNULL(1, 2);
5482
5483
5484/**
5485 * Set pointer behavior.
5486 *
5487 * @param obj
5488 * @param setting desired behavior.
5489 *
5490 * This function has direct effect on event callbacks related to
5491 * mouse.
5492 *
5493 * If @p setting is EVAS_OBJECT_POINTER_MODE_AUTOGRAB, then when mouse
5494 * is down at this object, events will be restricted to it as source,
5495 * mouse moves, for example, will be emitted even if outside this
5496 * object area.
5497 *
5498 * If @p setting is EVAS_OBJECT_POINTER_MODE_NOGRAB, then events will
5499 * be emitted just when inside this object area.
5500 *
5501 * The default value is EVAS_OBJECT_POINTER_MODE_AUTOGRAB.
5502 *
5503 * @ingroup Evas_Object_Group_Extras
5504 */
5505EAPI void evas_object_pointer_mode_set (Evas_Object *obj, Evas_Object_Pointer_Mode setting) EINA_ARG_NONNULL(1);
5506
5507/**
5508 * Determine how pointer will behave.
5509 * @param obj
5510 * @return pointer behavior.
5511 * @ingroup Evas_Object_Group_Extras
5512 */
5513EAPI Evas_Object_Pointer_Mode evas_object_pointer_mode_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5514
5515
5516/**
5517 * Sets whether or not the given Evas object is to be drawn anti-aliased.
5518 *
5519 * @param obj The given Evas object.
5520 * @param anti_alias 1 if the object is to be anti_aliased, 0 otherwise.
5521 * @ingroup Evas_Object_Group_Extras
5522 */
5523EAPI void evas_object_anti_alias_set (Evas_Object *obj, Eina_Bool antialias) EINA_ARG_NONNULL(1);
5524
5525/**
5526 * Retrieves whether or not the given Evas object is to be drawn anti_aliased.
5527 * @param obj The given Evas object.
5528 * @return @c 1 if the object is to be anti_aliased. @c 0 otherwise.
5529 * @ingroup Evas_Object_Group_Extras
5530 */
5531EAPI Eina_Bool evas_object_anti_alias_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5532
5533
5534/**
5535 * Sets the scaling factor for an Evas object. Does not affect all
5536 * objects.
5537 *
5538 * @param obj The given Evas object.
5539 * @param scale The scaling factor. <c>1.0</c> means no scaling,
5540 * default size.
5541 *
5542 * This will multiply the object's dimension by the given factor, thus
5543 * altering its geometry (width and height). Useful when you want
5544 * scalable UI elements, possibly at run time.
5545 *
5546 * @note Only text and textblock objects have scaling change
5547 * handlers. Other objects won't change visually on this call.
5548 *
5549 * @see evas_object_scale_get()
5550 *
5551 * @ingroup Evas_Object_Group_Extras
5552 */
5553EAPI void evas_object_scale_set (Evas_Object *obj, double scale) EINA_ARG_NONNULL(1);
5554
5555/**
5556 * Retrieves the scaling factor for the given Evas object.
5557 *
5558 * @param obj The given Evas object.
5559 * @return The scaling factor.
5560 *
5561 * @ingroup Evas_Object_Group_Extras
5562 *
5563 * @see evas_object_scale_set()
5564 */
5565EAPI double evas_object_scale_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5566
5567
5568/**
5569 * Sets the render_op to be used for rendering the Evas object.
5570 * @param obj The given Evas object.
5571 * @param render_op one of the Evas_Render_Op values.
5572 * @ingroup Evas_Object_Group_Extras
5573 */
5574EAPI void evas_object_render_op_set (Evas_Object *obj, Evas_Render_Op op) EINA_ARG_NONNULL(1);
5575
5576/**
5577 * Retrieves the current value of the operation used for rendering the Evas object.
5578 * @param obj The given Evas object.
5579 * @return one of the enumerated values in Evas_Render_Op.
5580 * @ingroup Evas_Object_Group_Extras
5581 */
5582EAPI Evas_Render_Op evas_object_render_op_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5583
5584/**
5585 * Set whether to use precise (usually expensive) point collision
5586 * detection for a given Evas object.
5587 *
5588 * @param obj The given object.
5589 * @param precise whether to use precise point collision detection or
5590 * not The default value is false.
5591 *
5592 * Use this function to make Evas treat objects' transparent areas as
5593 * @b not belonging to it with regard to mouse pointer events. By
5594 * default, all of the object's boundary rectangle will be taken in
5595 * account for them.
5596 *
5597 * @warning By using precise point collision detection you'll be
5598 * making Evas more resource intensive.
5599 *
5600 * Example code follows.
5601 * @dontinclude evas-events.c
5602 * @skip if (strcmp(ev->keyname, "p") == 0)
5603 * @until }
5604 *
5605 * See the full example @ref Example_Evas_Events "here".
5606 *
5607 * @see evas_object_precise_is_inside_get()
5608 * @ingroup Evas_Object_Group_Extras
5609 */
5610 EAPI void evas_object_precise_is_inside_set(Evas_Object *obj, Eina_Bool precise) EINA_ARG_NONNULL(1);
5611
5612/**
5613 * Determine whether an object is set to use precise point collision
5614 * detection.
5615 *
5616 * @param obj The given object.
5617 * @return whether @p obj is set to use precise point collision
5618 * detection or not The default value is false.
5619 *
5620 * @see evas_object_precise_is_inside_set() for an example
5621 *
5622 * @ingroup Evas_Object_Group_Extras
5623 */
5624 EAPI Eina_Bool evas_object_precise_is_inside_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5625
5626/**
5627 * Set a hint flag on the given Evas object that it's used as a "static
5628 * clipper".
5629 *
5630 * @param obj The given object.
5631 * @param is_static_clip @c EINA_TRUE if it's to be used as a static
5632 * clipper, @c EINA_FALSE otherwise
5633 *
5634 * This is a hint to Evas that this object is used as a big static
5635 * clipper and shouldn't be moved with children and otherwise
5636 * considered specially. The default value for new objects is @c
5637 * EINA_FALSE.
5638 *
5639 * @see evas_object_static_clip_get()
5640 *
5641 * @ingroup Evas_Object_Group_Extras
5642 */
5643 EAPI void evas_object_static_clip_set (Evas_Object *obj, Eina_Bool is_static_clip) EINA_ARG_NONNULL(1);
5644
5645/**
5646 * Get the "static clipper" hint flag for a given Evas object.
5647 *
5648 * @param obj The given object.
5649 * @returrn @c EINA_TRUE if it's set as a static clipper, @c
5650 * EINA_FALSE otherwise
5651 *
5652 * @see evas_object_static_clip_set() for more details
5653 *
5654 * @ingroup Evas_Object_Group_Extras
5655 */
5656 EAPI Eina_Bool evas_object_static_clip_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5657
5658/**
5659 * @}
5660 */
5661
5662/**
5663 * @defgroup Evas_Object_Group_Find Finding Objects
5664 *
5665 * Functions that allows finding objects by their position, name or
5666 * other properties.
5667 *
5668 * @ingroup Evas_Object_Group
5669 */
5670
5671/**
5672 * @addtogroup Evas_Object_Group_Find
5673 * @{
5674 */
5675
5676/**
5677 * Retrieve the object that currently has focus.
5678 *
5679 * @param e The Evas canvas to query for focused object on.
5680 * @return The object that has focus or @c NULL if there is not one.
5681 *
5682 * Evas can have (at most) one of its objects focused at a time.
5683 * Focused objects will be the ones having <b>key events</b> delivered
5684 * to, which the programmer can act upon by means of
5685 * evas_object_event_callback_add() usage.
5686 *
5687 * @note Most users wouldn't be dealing directly with Evas' focused
5688 * objects. Instead, they would be using a higher level library for
5689 * that (like a toolkit, as Elementary) to handle focus and who's
5690 * receiving input for them.
5691 *
5692 * This call returns the object that currently has focus on the canvas
5693 * @p e or @c NULL, if none.
5694 *
5695 * @see evas_object_focus_set
5696 * @see evas_object_focus_get
5697 * @see evas_object_key_grab
5698 * @see evas_object_key_ungrab
5699 *
5700 * Example:
5701 * @dontinclude evas-events.c
5702 * @skip evas_event_callback_add(d.canvas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN,
5703 * @until evas_object_focus_set(d.bg, EINA_TRUE);
5704 * @dontinclude evas-events.c
5705 * @skip called when our rectangle gets focus
5706 * @until }
5707 *
5708 * In this example the @c event_info is exactly a pointer to that
5709 * focused rectangle. See the full @ref Example_Evas_Events "example".
5710 *
5711 * @ingroup Evas_Object_Group_Find
5712 */
5713EAPI Evas_Object *evas_focus_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5714
5715/**
5716 * Retrieves the object on the given evas with the given name.
5717 * @param e The given evas.
5718 * @param name The given name.
5719 * @return If successful, the Evas object with the given name. Otherwise,
5720 * @c NULL.
5721 * @ingroup Evas_Object_Group_Find
5722 */
5723EAPI Evas_Object *evas_object_name_find (const Evas *e, const char *name) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5724
5725/**
5726 * Retrieve the Evas object stacked at the top of a given position in
5727 * a canvas
5728 *
5729 * @param e A handle to the canvas.
5730 * @param x The horizontal coordinate of the position
5731 * @param y The vertical coordinate of the position
5732 * @param include_pass_events_objects Boolean flag to include or not
5733 * objects which pass events in this calculation
5734 * @param include_hidden_objects Boolean flag to include or not hidden
5735 * objects in this calculation
5736 * @return The Evas object that is over all other objects at the given
5737 * position.
5738 *
5739 * This function will traverse all the layers of the given canvas,
5740 * from top to bottom, querying for objects with areas covering the
5741 * given position. The user can remove from from the query
5742 * objects which are hidden and/or which are set to pass events.
5743 *
5744 * @warning This function will @b skip objects parented by smart
5745 * objects, acting only on the ones at the "top level", with regard to
5746 * object parenting.
5747 */
5748EAPI Evas_Object *evas_object_top_at_xy_get (const Evas *e, Evas_Coord x, Evas_Coord y, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5749
5750/**
5751 * Retrieve the Evas object stacked at the top at the position of the
5752 * mouse cursor, over a given canvas
5753 *
5754 * @param e A handle to the canvas.
5755 * @return The Evas object that is over all other objects at the mouse
5756 * pointer's position
5757 *
5758 * This function will traverse all the layers of the given canvas,
5759 * from top to bottom, querying for objects with areas covering the
5760 * mouse pointer's position, over @p e.
5761 *
5762 * @warning This function will @b skip objects parented by smart
5763 * objects, acting only on the ones at the "top level", with regard to
5764 * object parenting.
5765 */
5766EAPI Evas_Object *evas_object_top_at_pointer_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5767
5768/**
5769 * Retrieve the Evas object stacked at the top of a given rectangular
5770 * region in a canvas
5771 *
5772 * @param e A handle to the canvas.
5773 * @param x The top left corner's horizontal coordinate for the
5774 * rectangular region
5775 * @param y The top left corner's vertical coordinate for the
5776 * rectangular region
5777 * @param w The width of the rectangular region
5778 * @param h The height of the rectangular region
5779 * @param include_pass_events_objects Boolean flag to include or not
5780 * objects which pass events in this calculation
5781 * @param include_hidden_objects Boolean flag to include or not hidden
5782 * objects in this calculation
5783 * @return The Evas object that is over all other objects at the given
5784 * rectangular region.
5785 *
5786 * This function will traverse all the layers of the given canvas,
5787 * from top to bottom, querying for objects with areas overlapping
5788 * with the given rectangular region inside @p e. The user can remove
5789 * from the query objects which are hidden and/or which are set to
5790 * pass events.
5791 *
5792 * @warning This function will @b skip objects parented by smart
5793 * objects, acting only on the ones at the "top level", with regard to
5794 * object parenting.
5795 */
5796EAPI Evas_Object *evas_object_top_in_rectangle_get (const Evas *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5797
5798/**
5799 * Retrieve a list of Evas objects lying over a given position in
5800 * a canvas
5801 *
5802 * @param e A handle to the canvas.
5803 * @param x The horizontal coordinate of the position
5804 * @param y The vertical coordinate of the position
5805 * @param include_pass_events_objects Boolean flag to include or not
5806 * objects which pass events in this calculation
5807 * @param include_hidden_objects Boolean flag to include or not hidden
5808 * objects in this calculation
5809 * @return The list of Evas objects that are over the given position
5810 * in @p e
5811 *
5812 * This function will traverse all the layers of the given canvas,
5813 * from top to bottom, querying for objects with areas covering the
5814 * given position. The user can remove from from the query
5815 * objects which are hidden and/or which are set to pass events.
5816 *
5817 * @warning This function will @b skip objects parented by smart
5818 * objects, acting only on the ones at the "top level", with regard to
5819 * object parenting.
5820 */
5821EAPI Eina_List *evas_objects_at_xy_get (const Evas *e, Evas_Coord x, Evas_Coord y, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5822 EAPI Eina_List *evas_objects_in_rectangle_get (const Evas *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5823
5824/**
5825 * Get the lowest (stacked) Evas object on the canvas @p
5826 *
5827 * @param e a valid canvas pointer
5828 * @return a pointer to the lowest object on it, if any, or @c NULL,
5829 * otherwise
5830 *
5831 * This function will take all populated layers in the canvas into
5832 * account, getting the lowest object for the lowest layer, naturally.
5833 *
5834 * @see evas_object_layer_get()
5835 * @see evas_object_layer_set()
5836 * @see evas_object_below_get()
5837 * @see evas_object_above_get()
5838 *
5839 * @warning This function will @b skip objects parented by smart
5840 * objects, acting only on the ones at the "top level", with regard to
5841 * object parenting.
5842 */
5843EAPI Evas_Object *evas_object_bottom_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5844
5845/**
5846 * Get the highest (stacked) Evas object on the canvas @p
5847 *
5848 * @param e a valid canvas pointer
5849 * @return a pointer to the highest object on it, if any, or @c NULL,
5850 * otherwise
5851 *
5852 * This function will take all populated layers in the canvas into
5853 * account, getting the highest object for the highest layer,
5854 * naturally.
5855 *
5856 * @see evas_object_layer_get()
5857 * @see evas_object_layer_set()
5858 * @see evas_object_below_get()
5859 * @see evas_object_above_get()
5860 *
5861 * @warning This function will @b skip objects parented by smart
5862 * objects, acting only on the ones at the "top level", with regard to
5863 * object parenting.
5864 */
5865EAPI Evas_Object *evas_object_top_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
5866
5867/**
5868 * @}
5869 */
5870
5871/**
5872 * @defgroup Evas_Object_Group_Interceptors Object Method Interceptors
5873 *
5874 * Evas provides a way to intercept method calls. The interceptor
5875 * callback may opt to completely deny the call, or may check and
5876 * change the parameters before continuing. The continuation of an
5877 * intercepted call is done by calling the intercepted call again,
5878 * from inside the interceptor callback.
5879 *
5880 * @ingroup Evas_Object_Group
5881 */
5882
5883/**
5884 * @addtogroup Evas_Object_Group_Interceptors
5885 * @{
5886 */
5887
5888typedef void (*Evas_Object_Intercept_Show_Cb) (void *data, Evas_Object *obj);
5889typedef void (*Evas_Object_Intercept_Hide_Cb) (void *data, Evas_Object *obj);
5890typedef void (*Evas_Object_Intercept_Move_Cb) (void *data, Evas_Object *obj, Evas_Coord x, Evas_Coord y);
5891typedef void (*Evas_Object_Intercept_Resize_Cb) (void *data, Evas_Object *obj, Evas_Coord w, Evas_Coord h);
5892typedef void (*Evas_Object_Intercept_Raise_Cb) (void *data, Evas_Object *obj);
5893typedef void (*Evas_Object_Intercept_Lower_Cb) (void *data, Evas_Object *obj);
5894typedef void (*Evas_Object_Intercept_Stack_Above_Cb) (void *data, Evas_Object *obj, Evas_Object *above);
5895typedef void (*Evas_Object_Intercept_Stack_Below_Cb) (void *data, Evas_Object *obj, Evas_Object *above);
5896typedef void (*Evas_Object_Intercept_Layer_Set_Cb) (void *data, Evas_Object *obj, int l);
5897typedef void (*Evas_Object_Intercept_Color_Set_Cb) (void *data, Evas_Object *obj, int r, int g, int b, int a);
5898typedef void (*Evas_Object_Intercept_Clip_Set_Cb) (void *data, Evas_Object *obj, Evas_Object *clip);
5899typedef void (*Evas_Object_Intercept_Clip_Unset_Cb) (void *data, Evas_Object *obj);
5900
5901/**
5902 * Set the callback function that intercepts a show event of a object.
5903 *
5904 * @param obj The given canvas object pointer.
5905 * @param func The given function to be the callback function.
5906 * @param data The data passed to the callback function.
5907 *
5908 * This function sets a callback function to intercepts a show event
5909 * of a canvas object.
5910 *
5911 * @see evas_object_intercept_show_callback_del().
5912 *
5913 */
5914EAPI void evas_object_intercept_show_callback_add (Evas_Object *obj, Evas_Object_Intercept_Show_Cb func, const void *data) EINA_ARG_NONNULL(1, 2);
5915
5916/**
5917 * Unset the callback function that intercepts a show event of a
5918 * object.
5919 *
5920 * @param obj The given canvas object pointer.
5921 * @param func The given callback function.
5922 *
5923 * This function sets a callback function to intercepts a show event
5924 * of a canvas object.
5925 *
5926 * @see evas_object_intercept_show_callback_add().
5927 *
5928 */
5929EAPI void *evas_object_intercept_show_callback_del (Evas_Object *obj, Evas_Object_Intercept_Show_Cb func) EINA_ARG_NONNULL(1, 2);
5930
5931/**
5932 * Set the callback function that intercepts a hide event of a object.
5933 *
5934 * @param obj The given canvas object pointer.
5935 * @param func The given function to be the callback function.
5936 * @param data The data passed to the callback function.
5937 *
5938 * This function sets a callback function to intercepts a hide event
5939 * of a canvas object.
5940 *
5941 * @see evas_object_intercept_hide_callback_del().
5942 *
5943 */
5944EAPI void evas_object_intercept_hide_callback_add (Evas_Object *obj, Evas_Object_Intercept_Hide_Cb func, const void *data) EINA_ARG_NONNULL(1, 2);
5945
5946/**
5947 * Unset the callback function that intercepts a hide event of a
5948 * object.
5949 *
5950 * @param obj The given canvas object pointer.
5951 * @param func The given callback function.
5952 *
5953 * This function sets a callback function to intercepts a hide event
5954 * of a canvas object.
5955 *
5956 * @see evas_object_intercept_hide_callback_add().
5957 *
5958 */
5959EAPI void *evas_object_intercept_hide_callback_del (Evas_Object *obj, Evas_Object_Intercept_Hide_Cb func) EINA_ARG_NONNULL(1, 2);
5960
5961/**
5962 * Set the callback function that intercepts a move event of a object.
5963 *
5964 * @param obj The given canvas object pointer.
5965 * @param func The given function to be the callback function.
5966 * @param data The data passed to the callback function.
5967 *
5968 * This function sets a callback function to intercepts a move event
5969 * of a canvas object.
5970 *
5971 * @see evas_object_intercept_move_callback_del().
5972 *
5973 */
5974EAPI void evas_object_intercept_move_callback_add (Evas_Object *obj, Evas_Object_Intercept_Move_Cb func, const void *data) EINA_ARG_NONNULL(1, 2);
5975
5976/**
5977 * Unset the callback function that intercepts a move event of a
5978 * object.
5979 *
5980 * @param obj The given canvas object pointer.
5981 * @param func The given callback function.
5982 *
5983 * This function sets a callback function to intercepts a move event
5984 * of a canvas object.
5985 *
5986 * @see evas_object_intercept_move_callback_add().
5987 *
5988 */
5989EAPI void *evas_object_intercept_move_callback_del (Evas_Object *obj, Evas_Object_Intercept_Move_Cb func) EINA_ARG_NONNULL(1, 2);
5990
5991 EAPI void evas_object_intercept_resize_callback_add (Evas_Object *obj, Evas_Object_Intercept_Resize_Cb func, const void *data) EINA_ARG_NONNULL(1, 2);
5992 EAPI void *evas_object_intercept_resize_callback_del (Evas_Object *obj, Evas_Object_Intercept_Resize_Cb func) EINA_ARG_NONNULL(1, 2);
5993 EAPI void evas_object_intercept_raise_callback_add (Evas_Object *obj, Evas_Object_Intercept_Raise_Cb func, const void *data) EINA_ARG_NONNULL(1, 2);
5994 EAPI void *evas_object_intercept_raise_callback_del (Evas_Object *obj, Evas_Object_Intercept_Raise_Cb func) EINA_ARG_NONNULL(1, 2);
5995 EAPI void evas_object_intercept_lower_callback_add (Evas_Object *obj, Evas_Object_Intercept_Lower_Cb func, const void *data) EINA_ARG_NONNULL(1, 2);
5996 EAPI void *evas_object_intercept_lower_callback_del (Evas_Object *obj, Evas_Object_Intercept_Lower_Cb func) EINA_ARG_NONNULL(1, 2);
5997 EAPI void evas_object_intercept_stack_above_callback_add (Evas_Object *obj, Evas_Object_Intercept_Stack_Above_Cb func, const void *data) EINA_ARG_NONNULL(1, 2);
5998 EAPI void *evas_object_intercept_stack_above_callback_del (Evas_Object *obj, Evas_Object_Intercept_Stack_Above_Cb func) EINA_ARG_NONNULL(1, 2);
5999 EAPI void evas_object_intercept_stack_below_callback_add (Evas_Object *obj, Evas_Object_Intercept_Stack_Below_Cb func, const void *data) EINA_ARG_NONNULL(1, 2);
6000 EAPI void *evas_object_intercept_stack_below_callback_del (Evas_Object *obj, Evas_Object_Intercept_Stack_Below_Cb func) EINA_ARG_NONNULL(1, 2);
6001 EAPI void evas_object_intercept_layer_set_callback_add (Evas_Object *obj, Evas_Object_Intercept_Layer_Set_Cb func, const void *data) EINA_ARG_NONNULL(1, 2);
6002 EAPI void *evas_object_intercept_layer_set_callback_del (Evas_Object *obj, Evas_Object_Intercept_Layer_Set_Cb func) EINA_ARG_NONNULL(1, 2);
6003 EAPI void evas_object_intercept_color_set_callback_add (Evas_Object *obj, Evas_Object_Intercept_Color_Set_Cb func, const void *data) EINA_ARG_NONNULL(1, 2);
6004 EAPI void *evas_object_intercept_color_set_callback_del (Evas_Object *obj, Evas_Object_Intercept_Color_Set_Cb func) EINA_ARG_NONNULL(1, 2);
6005 EAPI void evas_object_intercept_clip_set_callback_add (Evas_Object *obj, Evas_Object_Intercept_Clip_Set_Cb func, const void *data) EINA_ARG_NONNULL(1, 2);
6006 EAPI void *evas_object_intercept_clip_set_callback_del (Evas_Object *obj, Evas_Object_Intercept_Clip_Set_Cb func) EINA_ARG_NONNULL(1, 2);
6007 EAPI void evas_object_intercept_clip_unset_callback_add (Evas_Object *obj, Evas_Object_Intercept_Clip_Unset_Cb func, const void *data) EINA_ARG_NONNULL(1, 2);
6008 EAPI void *evas_object_intercept_clip_unset_callback_del (Evas_Object *obj, Evas_Object_Intercept_Clip_Unset_Cb func) EINA_ARG_NONNULL(1, 2);
6009
6010/**
6011 * @}
6012 */
6013
6014/**
6015 * @defgroup Evas_Object_Specific Specific Object Functions
6016 *
6017 * Functions that work on specific objects.
6018 *
6019 */
6020
6021/**
6022 * @defgroup Evas_Object_Rectangle Rectangle Object Functions
6023 *
6024 * @brief Function to create evas rectangle objects.
6025 *
6026 * This function may seem useless given there are no functions to manipulate
6027 * the created rectangle, however the rectangle is actually very useful and can
6028 * be manipulate using the generic @ref Evas_Object_Group
6029 * "evas object functions".
6030 *
6031 * For an example of use of an evas_object_rectangle see @ref
6032 * Example_Evas_Object_Manipulation "here".
6033 *
6034 * @ingroup Evas_Object_Specific
6035 */
6036
6037/**
6038 * Adds a rectangle to the given evas.
6039 * @param e The given evas.
6040 * @return The new rectangle object.
6041 *
6042 * @ingroup Evas_Object_Rectangle
6043 */
6044EAPI Evas_Object *evas_object_rectangle_add (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
6045
6046/**
6047 * @defgroup Evas_Object_Image Image Object Functions
6048 *
6049 * Here are grouped together functions used to create and manipulate
6050 * image objects. They are available to whichever occasion one needs
6051 * complex imagery on a GUI that could not be achieved by the other
6052 * Evas' primitive object types, or to make image manipulations.
6053 *
6054 * Evas will support whichever image file types it was compiled with
6055 * support to (its image loaders) -- check your software packager for
6056 * that information and see
6057 * evas_object_image_extension_can_load_get().
6058 *
6059 * @section Evas_Object_Image_Basics Image object basics
6060 *
6061 * The most common use of image objects -- to display an image on the
6062 * canvas -- is achieved by a common function triplet:
6063 * @code
6064 * img = evas_object_image_add(canvas);
6065 * evas_object_image_file_set(img, "path/to/img", NULL);
6066 * evas_object_image_fill_set(img, 0, 0, w, h);
6067 * @endcode
6068 * The first function, naturally, is creating the image object. Then,
6069 * one must set an source file on it, so that it knows where to fetch
6070 * image data from. Next, one must set <b>how to fill the image
6071 * object's area</b> with that given pixel data. One could use just a
6072 * sub-region of the original image or even have it tiled repeatedly
6073 * on the image object. For the common case of having the whole source
6074 * image to be displayed on the image object, streched to the
6075 * destination's size, there's also a function helper, to be used
6076 * instead of evas_object_image_fill_set():
6077 * @code
6078 * evas_object_image_filled_set(img, EINA_TRUE);
6079 * @endcode
6080 * See those functions' documentation for more details.
6081 *
6082 * @section Evas_Object_Image_Scale Scale and resizing
6083 *
6084 * Resizing of image objects will scale their respective source images
6085 * to their areas, if they are set to "fill" the object's area
6086 * (evas_object_image_filled_set()). If the user wants any control on
6087 * the aspect ratio of an image for different sizes, he/she has to
6088 * take care of that themselves. There are functions to make images to
6089 * get loaded scaled (up or down) in memory, already, if the user is
6090 * going to use them at pre-determined sizes and wants to save
6091 * computations.
6092 *
6093 * Evas has even a scale cache, which will take care of caching scaled
6094 * versions of images with more often usage/hits. Finally, one can
6095 * have images being rescaled @b smoothly by Evas (more
6096 * computationally expensive) or not.
6097 *
6098 * @section Evas_Object_Image_Performance Performance hints
6099 *
6100 * When dealing with image objects, there are some tricks to boost the
6101 * performance of your application, if it does intense image loading
6102 * and/or manipulations, as in animations on a UI.
6103 *
6104 * @subsection Evas_Object_Image_Load Load hints
6105 *
6106 * In image viewer applications, for example, the user will be looking
6107 * at a given image, at full size, and will desire that the navigation
6108 * to the adjacent images on his/her album be fluid and fast. Thus,
6109 * while displaying a given image, the program can be on the
6110 * background loading the next and previous imagens already, so that
6111 * displaying them on the sequence is just a matter of repainting the
6112 * screen (and not decoding image data).
6113 *
6114 * Evas addresses this issue with <b>image pre-loading</b>. The code
6115 * for the situation above would be something like the following:
6116 * @code
6117 * prev = evas_object_image_filled_add(canvas);
6118 * evas_object_image_file_set(prev, "/path/to/prev", NULL);
6119 * evas_object_image_preload(prev, EINA_TRUE);
6120 *
6121 * next = evas_object_image_filled_add(canvas);
6122 * evas_object_image_file_set(next, "/path/to/next", NULL);
6123 * evas_object_image_preload(next, EINA_TRUE);
6124 * @endcode
6125 *
6126 * If you're loading images which are too big, consider setting
6127 * previously it's loading size to something smaller, in case you
6128 * won't expose them in real size. It may speed up the loading
6129 * considerably:
6130 * @code
6131 * //to load a scaled down version of the image in memory, if that's
6132 * //the size you'll be displaying it anyway
6133 * evas_object_image_load_scale_down_set(img, zoom);
6134 *
6135 * //optional: if you know you'll be showing a sub-set of the image's
6136 * //pixels, you can avoid loading the complementary data
6137 * evas_object_image_load_region_set(img, x, y, w, h);
6138 * @endcode
6139 * Refer to Elementary's Photocam widget for a high level (smart)
6140 * object which does lots of loading speed-ups for you.
6141 *
6142 * @subsection Evas_Object_Image_Animation Animation hints
6143 *
6144 * If you want to animate image objects on a UI (what you'd get by
6145 * concomitant usage of other libraries, like Ecore and Edje), there
6146 * are also some tips on how to boost the performance of your
6147 * application. If the animation involves resizing of an image (thus,
6148 * re-scaling), you'd better turn off smooth scaling on it @b during
6149 * the animation, turning it back on afterwrads, for less
6150 * computations. Also, in this case you'd better flag the image object
6151 * in question not to cache scaled versions of it:
6152 * @code
6153 * evas_object_image_scale_hint_set(wd->img, EVAS_IMAGE_SCALE_HINT_DYNAMIC);
6154 *
6155 * // resizing takes place in between
6156 *
6157 * evas_object_image_scale_hint_set(wd->img, EVAS_IMAGE_SCALE_HINT_STATIC);
6158 * @endcode
6159 *
6160 * Finally, movement of opaque images through the canvas is less
6161 * expensive than of translucid ones, because of blending
6162 * computations.
6163 *
6164 * @section Evas_Object_Image_Borders Borders
6165 *
6166 * Evas provides facilities for one to specify an image's region to be
6167 * treated specially -- as "borders". This will make those regions be
6168 * treated specially on resizing scales, by keeping their aspect. This
6169 * makes setting frames around other objects on UIs easy.
6170 * See the following figures for a visual explanation:\n
6171 * @htmlonly
6172 * <img src="image-borders.png" style="max-width: 100%;" />
6173 * <a href="image-borders.png">Full-size</a>
6174 * @endhtmlonly
6175 * @image rtf image-borders.png
6176 * @image latex image-borders.eps width=\textwidth
6177 * @htmlonly
6178 * <img src="border-effect.png" style="max-width: 100%;" />
6179 * <a href="border-effect.png">Full-size</a>
6180 * @endhtmlonly
6181 * @image rtf border-effect.png
6182 * @image latex border-effect.eps width=\textwidth
6183 *
6184 * @section Evas_Object_Image_Manipulation Manipulating pixels
6185 *
6186 * Evas image objects can be used to manipulate raw pixels in many
6187 * ways. The meaning of the data in the pixel arrays will depend on
6188 * the image's color space, be warned (see next section). You can set
6189 * your own data as an image's pixel data, fetch an image's pixel data
6190 * for saving/altering, convert images between different color spaces
6191 * and even advanced operations like setting a native surface as image
6192 * objecs' data.
6193 *
6194 * @section Evas_Object_Image_Color_Spaces Color spaces
6195 *
6196 * Image objects may return or accept "image data" in multiple
6197 * formats. This is based on the color space of an object. Here is a
6198 * rundown on formats:
6199 *
6200 * - #EVAS_COLORSPACE_ARGB8888:
6201 * .
6202 * This pixel format is a linear block of pixels, starting at the
6203 * top-left row by row until the bottom right of the image or pixel
6204 * region. All pixels are 32-bit unsigned int's with the high-byte
6205 * being alpha and the low byte being blue in the format ARGB. Alpha
6206 * may or may not be used by evas depending on the alpha flag of the
6207 * image, but if not used, should be set to 0xff anyway.
6208 * \n\n
6209 * This colorspace uses premultiplied alpha. That means that R, G
6210 * and B cannot exceed A in value. The conversion from
6211 * non-premultiplied colorspace is:
6212 * \n\n
6213 * R = (r * a) / 255; G = (g * a) / 255; B = (b * a) / 255;
6214 * \n\n
6215 * So 50% transparent blue will be: 0x80000080. This will not be
6216 * "dark" - just 50% transparent. Values are 0 == black, 255 ==
6217 * solid or full red, green or blue.
6218 *
6219 * - #EVAS_COLORSPACE_YCBCR422P601_PL:
6220 * .
6221 * This is a pointer-list indirected set of YUV (YCbCr) pixel
6222 * data. This means that the data returned or set is not actual
6223 * pixel data, but pointers TO lines of pixel data. The list of
6224 * pointers will first be N rows of pointers to the Y plane -
6225 * pointing to the first pixel at the start of each row in the Y
6226 * plane. N is the height of the image data in pixels. Each pixel in
6227 * the Y, U and V planes is 1 byte exactly, packed. The next N / 2
6228 * pointers will point to rows in the U plane, and the next N / 2
6229 * pointers will point to the V plane rows. U and V planes are half
6230 * the horizontal and vertical resolution of the Y plane.
6231 * \n\n
6232 * Row order is top to bottom and row pixels are stored left to
6233 * right.
6234 * \n\n
6235 * There is a limitation that these images MUST be a multiple of 2
6236 * pixels in size horizontally or vertically. This is due to the U
6237 * and V planes being half resolution. Also note that this assumes
6238 * the itu601 YUV colorspace specification. This is defined for
6239 * standard television and mpeg streams. HDTV may use the itu709
6240 * specification.
6241 * \n\n
6242 * Values are 0 to 255, indicating full or no signal in that plane
6243 * respectively.
6244 *
6245 * - #EVAS_COLORSPACE_YCBCR422P709_PL:
6246 * .
6247 * Not implemented yet.
6248 *
6249 * - #EVAS_COLORSPACE_RGB565_A5P:
6250 * .
6251 * In the process of being implemented in 1 engine only. This may
6252 * change.
6253 * \n\n
6254 * This is a pointer to image data for 16-bit half-word pixel data
6255 * in 16bpp RGB 565 format (5 bits red, 6 bits green, 5 bits blue),
6256 * with the high-byte containing red and the low byte containing
6257 * blue, per pixel. This data is packed row by row from the top-left
6258 * to the bottom right.
6259 * \n\n
6260 * If the image has an alpha channel enabled there will be an extra
6261 * alpha plane after the color pixel plane. If not, then this data
6262 * will not exist and should not be accessed in any way. This plane
6263 * is a set of pixels with 1 byte per pixel defining the alpha
6264 * values of all pixels in the image from the top-left to the bottom
6265 * right of the image, row by row. Even though the values of the
6266 * alpha pixels can be 0 to 255, only values 0 through to 32 are
6267 * used, 32 being solid and 0 being transparent.
6268 * \n\n
6269 * RGB values can be 0 to 31 for red and blue and 0 to 63 for green,
6270 * with 0 being black and 31 or 63 being full red, green or blue
6271 * respectively. This colorspace is also pre-multiplied like
6272 * EVAS_COLORSPACE_ARGB8888 so:
6273 * \n\n
6274 * R = (r * a) / 32; G = (g * a) / 32; B = (b * a) / 32;
6275 *
6276 * - #EVAS_COLORSPACE_GRY8:
6277 * .
6278 * The image is just a alpha mask (8 bit's per pixel). This is used
6279 * for alpha masking.
6280 *
6281 * Some examples on this group of functions can be found @ref
6282 * Example_Evas_Images "here".
6283 *
6284 * @ingroup Evas_Object_Specific
6285 */
6286
6287/**
6288 * @addtogroup Evas_Object_Image
6289 * @{
6290 */
6291
6292typedef void (*Evas_Object_Image_Pixels_Get_Cb) (void *data, Evas_Object *o);
6293
6294
6295/**
6296 * Creates a new image object on the given Evas @p e canvas.
6297 *
6298 * @param e The given canvas.
6299 * @return The created image object handle.
6300 *
6301 * @note If you intend to @b display an image somehow in a GUI,
6302 * besides binding it to a real image file/source (with
6303 * evas_object_image_file_set(), for example), you'll have to tell
6304 * this image object how to fill its space with the pixels it can get
6305 * from the source. See evas_object_image_filled_add(), for a helper
6306 * on the common case of scaling up an image source to the whole area
6307 * of the image object.
6308 *
6309 * @see evas_object_image_fill_set()
6310 *
6311 * Example:
6312 * @code
6313 * img = evas_object_image_add(canvas);
6314 * evas_object_image_file_set(img, "/path/to/img", NULL);
6315 * @endcode
6316 */
6317EAPI Evas_Object *evas_object_image_add (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
6318
6319/**
6320 * Creates a new image object that @b automatically scales its bound
6321 * image to the object's area, on both axis.
6322 *
6323 * @param e The given canvas.
6324 * @return The created image object handle.
6325 *
6326 * This is a helper function around evas_object_image_add() and
6327 * evas_object_image_filled_set(). It has the same effect of applying
6328 * those functions in sequence, which is a very common use case.
6329 *
6330 * @note Whenever this object gets resized, the bound image will be
6331 * rescaled, too.
6332 *
6333 * @see evas_object_image_add()
6334 * @see evas_object_image_filled_set()
6335 * @see evas_object_image_fill_set()
6336 */
6337EAPI Evas_Object *evas_object_image_filled_add (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
6338
6339
6340/**
6341 * Sets the data for an image from memory to be loaded
6342 *
6343 * This is the same as evas_object_image_file_set() but the file to be loaded
6344 * may exist at an address in memory (the data for the file, not the filename
6345 * itself). The @p data at the address is copied and stored for future use, so
6346 * no @p data needs to be kept after this call is made. It will be managed and
6347 * freed for you when no longer needed. The @p size is limited to 2 gigabytes
6348 * in size, and must be greater than 0. A NULL @p data pointer is also invalid.
6349 * Set the filename to NULL to reset to empty state and have the image file
6350 * data freed from memory using evas_object_image_file_set().
6351 *
6352 * The @p format is optional (pass NULL if you don't need/use it). It is used
6353 * to help Evas guess better which loader to use for the data. It may simply
6354 * be the "extension" of the file as it would normally be on disk such as
6355 * "jpg" or "png" or "gif" etc.
6356 *
6357 * @param obj The given image object.
6358 * @param data The image file data address
6359 * @param size The size of the image file data in bytes
6360 * @param format The format of the file (optional), or @c NULL if not needed
6361 * @param key The image key in file, or @c NULL.
6362 */
6363EAPI void evas_object_image_memfile_set (Evas_Object *obj, void *data, int size, char *format, char *key) EINA_ARG_NONNULL(1, 2);
6364
6365/**
6366 * Set the source file from where an image object must fetch the real
6367 * image data (it may be an Eet file, besides pure image ones).
6368 *
6369 * @param obj The given image object.
6370 * @param file The image file path.
6371 * @param key The image key in @p file (if its an Eet one), or @c
6372 * NULL, otherwise.
6373 *
6374 * If the file supports multiple data stored in it (as Eet files do),
6375 * you can specify the key to be used as the index of the image in
6376 * this file.
6377 *
6378 * Example:
6379 * @code
6380 * img = evas_object_image_add(canvas);
6381 * evas_object_image_file_set(img, "/path/to/img", NULL);
6382 * err = evas_object_image_load_error_get(img);
6383 * if (err != EVAS_LOAD_ERROR_NONE)
6384 * {
6385 * fprintf(stderr, "could not load image '%s'. error string is \"%s\"\n",
6386 * valid_path, evas_load_error_str(err));
6387 * }
6388 * else
6389 * {
6390 * evas_object_image_fill_set(img, 0, 0, w, h);
6391 * evas_object_resize(img, w, h);
6392 * evas_object_show(img);
6393 * }
6394 * @endcode
6395 */
6396EAPI void evas_object_image_file_set (Evas_Object *obj, const char *file, const char *key) EINA_ARG_NONNULL(1);
6397
6398/**
6399 * Retrieve the source file from where an image object is to fetch the
6400 * real image data (it may be an Eet file, besides pure image ones).
6401 *
6402 * @param obj The given image object.
6403 * @param file Location to store the image file path.
6404 * @param key Location to store the image key (if @p file is an Eet
6405 * one).
6406 *
6407 * You must @b not modify the strings on the returned pointers.
6408 *
6409 * @note Use @c NULL pointers on the file components you're not
6410 * interested in: they'll be ignored by the function.
6411 */
6412EAPI void evas_object_image_file_get (const Evas_Object *obj, const char **file, const char **key) EINA_ARG_NONNULL(1, 2);
6413
6414/**
6415 * Set the dimensions for an image object's border, a region which @b
6416 * won't ever be scaled together with its center.
6417 *
6418 * @param obj The given image object.
6419 * @param l The border's left width.
6420 * @param r The border's right width.
6421 * @param t The border's top width.
6422 * @param b The border's bottom width.
6423 *
6424 * When Evas is rendering, an image source may be scaled to fit the
6425 * size of its image object. This function sets an area from the
6426 * borders of the image inwards which is @b not to be scaled. This
6427 * function is useful for making frames and for widget theming, where,
6428 * for example, buttons may be of varying sizes, but their border size
6429 * must remain constant.
6430 *
6431 * The units used for @p l, @p r, @p t and @p b are canvas units.
6432 *
6433 * @note The border region itself @b may be scaled by the
6434 * evas_object_image_border_scale_set() function.
6435 *
6436 * @note By default, image objects have no borders set, i. e. @c l, @c
6437 * r, @c t and @c b start as @c 0.
6438 *
6439 * See the following figures for visual explanation:\n
6440 * @htmlonly
6441 * <img src="image-borders.png" style="max-width: 100%;" />
6442 * <a href="image-borders.png">Full-size</a>
6443 * @endhtmlonly
6444 * @image rtf image-borders.png
6445 * @image latex image-borders.eps width=\textwidth
6446 * @htmlonly
6447 * <img src="border-effect.png" style="max-width: 100%;" />
6448 * <a href="border-effect.png">Full-size</a>
6449 * @endhtmlonly
6450 * @image rtf border-effect.png
6451 * @image latex border-effect.eps width=\textwidth
6452 *
6453 * @see evas_object_image_border_get()
6454 * @see evas_object_image_border_center_fill_set()
6455 */
6456EAPI void evas_object_image_border_set (Evas_Object *obj, int l, int r, int t, int b) EINA_ARG_NONNULL(1);
6457
6458/**
6459 * Retrieve the dimensions for an image object's border, a region
6460 * which @b won't ever be scaled together with its center.
6461 *
6462 * @param obj The given image object.
6463 * @param l Location to store the border's left width in.
6464 * @param r Location to store the border's right width in.
6465 * @param t Location to store the border's top width in.
6466 * @param b Location to store the border's bottom width in.
6467 *
6468 * @note Use @c NULL pointers on the border components you're not
6469 * interested in: they'll be ignored by the function.
6470 *
6471 * See @ref evas_object_image_border_set() for more details.
6472 */
6473EAPI void evas_object_image_border_get (const Evas_Object *obj, int *l, int *r, int *t, int *b) EINA_ARG_NONNULL(1);
6474
6475/**
6476 * Sets @b how the center part of the given image object (not the
6477 * borders) should be drawn when Evas is rendering it.
6478 *
6479 * @param obj The given image object.
6480 * @param fill Fill mode of the center region of @p obj (a value in
6481 * #Evas_Border_Fill_Mode).
6482 *
6483 * This function sets how the center part of the image object's source
6484 * image is to be drawn, which must be one of the values in
6485 * #Evas_Border_Fill_Mode. By center we mean the complementary part of
6486 * that defined by evas_object_image_border_set(). This one is very
6487 * useful for making frames and decorations. You would most probably
6488 * also be using a filled image (as in evas_object_image_filled_set())
6489 * to use as a frame.
6490 *
6491 * @see evas_object_image_border_center_fill_get()
6492 */
6493EAPI void evas_object_image_border_center_fill_set (Evas_Object *obj, Evas_Border_Fill_Mode fill) EINA_ARG_NONNULL(1);
6494
6495/**
6496 * Retrieves @b how the center part of the given image object (not the
6497 * borders) is to be drawn when Evas is rendering it.
6498 *
6499 * @param obj The given image object.
6500 * @return fill Fill mode of the center region of @p obj (a value in
6501 * #Evas_Border_Fill_Mode).
6502 *
6503 * See @ref evas_object_image_fill_set() for more details.
6504 */
6505EAPI Evas_Border_Fill_Mode evas_object_image_border_center_fill_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6506
6507/**
6508 * Set whether the image object's fill property should track the
6509 * object's size.
6510 *
6511 * @param obj The given image object.
6512 * @param setting @c EINA_TRUE, to make the fill property follow
6513 * object size or @c EINA_FALSE, otherwise
6514 *
6515 * If @p setting is @c EINA_TRUE, then every evas_object_resize() will
6516 * @b automatically trigger a call to evas_object_image_fill_set()
6517 * with the that new size (and @c 0, @c 0 as source image's origin),
6518 * so the bound image will fill the whole object's area.
6519 *
6520 * @see evas_object_image_filled_add()
6521 * @see evas_object_image_fill_get()
6522 */
6523EAPI void evas_object_image_filled_set (Evas_Object *obj, Eina_Bool setting) EINA_ARG_NONNULL(1);
6524
6525/**
6526 * Retrieve whether the image object's fill property should track the
6527 * object's size.
6528 *
6529 * @param obj The given image object.
6530 * @return @c EINA_TRUE if it is tracking, @c EINA_FALSE, if not (and
6531 * evas_object_fill_set() must be called manually).
6532 *
6533 * @see evas_object_image_filled_set() for more information
6534 */
6535EAPI Eina_Bool evas_object_image_filled_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6536
6537/**
6538 * Sets the scaling factor (multiplier) for the borders of an image
6539 * object.
6540 *
6541 * @param obj The given image object.
6542 * @param scale The scale factor (default is @c 1.0 - i.e. no scaling)
6543 *
6544 * @see evas_object_image_border_set()
6545 * @see evas_object_image_border_scale_get()
6546 */
6547EAPI void evas_object_image_border_scale_set (Evas_Object *obj, double scale);
6548
6549/**
6550 * Retrieves the scaling factor (multiplier) for the borders of an
6551 * image object.
6552 *
6553 * @param obj The given image object.
6554 * @return The scale factor set for its borders
6555 *
6556 * @see evas_object_image_border_set()
6557 * @see evas_object_image_border_scale_set()
6558 */
6559EAPI double evas_object_image_border_scale_get (const Evas_Object *obj);
6560
6561/**
6562 * Set how to fill an image object's drawing rectangle given the
6563 * (real) image bound to it.
6564 *
6565 * @param obj The given image object to operate on.
6566 * @param x The x coordinate (from the top left corner of the bound
6567 * image) to start drawing from.
6568 * @param y The y coordinate (from the top left corner of the bound
6569 * image) to start drawing from.
6570 * @param w The width the bound image will be displayed at.
6571 * @param h The height the bound image will be displayed at.
6572 *
6573 * Note that if @p w or @p h are smaller than the dimensions of
6574 * @p obj, the displayed image will be @b tiled around the object's
6575 * area. To have only one copy of the bound image drawn, @p x and @p y
6576 * must be 0 and @p w and @p h need to be the exact width and height
6577 * of the image object itself, respectively.
6578 *
6579 * See the following image to better understand the effects of this
6580 * call. On this diagram, both image object and original image source
6581 * have @c a x @c a dimentions and the image itself is a circle, with
6582 * empty space around it:
6583 *
6584 * @image html image-fill.png
6585 * @image rtf image-fill.png
6586 * @image latex image-fill.eps
6587 *
6588 * @warning The default values for the fill parameters are @p x = 0,
6589 * @p y = 0, @p w = 0 and @p h = 0. Thus, if you're not using the
6590 * evas_object_image_filled_add() helper and want your image
6591 * displayed, you'll have to set valid values with this fuction on
6592 * your object.
6593 *
6594 * @note evas_object_image_filled_set() is a helper function which
6595 * will @b override the values set here automatically, for you, in a
6596 * given way.
6597 */
6598EAPI void evas_object_image_fill_set (Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
6599
6600/**
6601 * Retrieve how an image object is to fill its drawing rectangle,
6602 * given the (real) image bound to it.
6603 *
6604 * @param obj The given image object.
6605 * @param x Location to store the x coordinate (from the top left
6606 * corner of the bound image) to start drawing from.
6607 * @param y Location to store the y coordinate (from the top left
6608 * corner of the bound image) to start drawing from.
6609 * @param w Location to store the width the bound image is to be
6610 * displayed at.
6611 * @param h Location to store the height the bound image is to be
6612 * displayed at.
6613 *
6614 * @note Use @c NULL pointers on the fill components you're not
6615 * interested in: they'll be ignored by the function.
6616 *
6617 * See @ref evas_object_image_fill_set() for more details.
6618 */
6619EAPI void evas_object_image_fill_get (const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
6620
6621/**
6622 * Sets the tiling mode for the given evas image object's fill.
6623 * @param obj The given evas image object.
6624 * @param spread One of EVAS_TEXTURE_REFLECT, EVAS_TEXTURE_REPEAT,
6625 * EVAS_TEXTURE_RESTRICT, or EVAS_TEXTURE_PAD.
6626 */
6627EAPI void evas_object_image_fill_spread_set (Evas_Object *obj, Evas_Fill_Spread spread) EINA_ARG_NONNULL(1);
6628
6629/**
6630 * Retrieves the spread (tiling mode) for the given image object's
6631 * fill.
6632 *
6633 * @param obj The given evas image object.
6634 * @return The current spread mode of the image object.
6635 */
6636EAPI Evas_Fill_Spread evas_object_image_fill_spread_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6637
6638/**
6639 * Sets the size of the given image object.
6640 *
6641 * @param obj The given image object.
6642 * @param w The new width of the image.
6643 * @param h The new height of the image.
6644 *
6645 * This function will scale down or crop the image so that it is
6646 * treated as if it were at the given size. If the size given is
6647 * smaller than the image, it will be cropped. If the size given is
6648 * larger, then the image will be treated as if it were in the upper
6649 * left hand corner of a larger image that is otherwise transparent.
6650 */
6651EAPI void evas_object_image_size_set (Evas_Object *obj, int w, int h) EINA_ARG_NONNULL(1);
6652
6653/**
6654 * Retrieves the size of the given image object.
6655 *
6656 * @param obj The given image object.
6657 * @param w Location to store the width of the image in, or @c NULL.
6658 * @param h Location to store the height of the image in, or @c NULL.
6659 *
6660 * See @ref evas_object_image_size_set() for more details.
6661 */
6662EAPI void evas_object_image_size_get (const Evas_Object *obj, int *w, int *h) EINA_ARG_NONNULL(1);
6663
6664/**
6665 * Retrieves the row stride of the given image object.
6666 *
6667 * @param obj The given image object.
6668 * @return The stride of the image (<b>in bytes</b>).
6669 *
6670 * The row stride is the number of bytes between the start of a row
6671 * and the start of the next row for image data.
6672 */
6673EAPI int evas_object_image_stride_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6674
6675/**
6676 * Retrieves a number representing any error that occurred during the
6677 * last loading of the given image object's source image.
6678 *
6679 * @param obj The given image object.
6680 * @return A value giving the last error that occurred. It should be
6681 * one of the #Evas_Load_Error values. #EVAS_LOAD_ERROR_NONE
6682 * is returned if there was no error.
6683 */
6684EAPI Evas_Load_Error evas_object_image_load_error_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6685
6686/**
6687 * Sets the raw image data of the given image object.
6688 *
6689 * @param obj The given image object.
6690 * @param data The raw data, or @c NULL.
6691 *
6692 * Note that the raw data must be of the same size (see
6693 * evas_object_image_size_set(), which has to be called @b before this
6694 * one) and colorspace (see evas_object_image_colorspace_set()) of the
6695 * image. If data is @c NULL, the current image data will be
6696 * freed. Naturally, if one does not set an image object's data
6697 * manually, it will still have one, allocated by Evas.
6698 *
6699 * @see evas_object_image_data_get()
6700 */
6701EAPI void evas_object_image_data_set (Evas_Object *obj, void *data) EINA_ARG_NONNULL(1);
6702
6703/**
6704 * Get a pointer to the raw image data of the given image object.
6705 *
6706 * @param obj The given image object.
6707 * @param for_writing Whether the data being retrieved will be
6708 * modified (@c EINA_TRUE) or not (@c EINA_FALSE).
6709 * @return The raw image data.
6710 *
6711 * This function returns a pointer to an image object's internal pixel
6712 * buffer, for reading only or read/write. If you request it for
6713 * writing, the image will be marked dirty so that it gets redrawn at
6714 * the next update.
6715 *
6716 * Each time you call this function on an image object, its data
6717 * buffer will have an internal reference counter
6718 * incremented. Decrement it back by using
6719 * evas_object_image_data_set(). This is specially important for the
6720 * directfb Evas engine.
6721 *
6722 * This is best suited for when you want to modify an existing image,
6723 * without changing its dimensions.
6724 *
6725 * @note The contents' formart returned by it depend on the color
6726 * space of the given image object.
6727 *
6728 * @note You may want to use evas_object_image_data_update_add() to
6729 * inform data changes, if you did any.
6730 *
6731 * @see evas_object_image_data_set()
6732 */
6733EAPI void *evas_object_image_data_get (const Evas_Object *obj, Eina_Bool for_writing) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6734
6735/**
6736 * Converts the raw image data of the given image object to the
6737 * specified colorspace.
6738 *
6739 * Note that this function does not modify the raw image data. If the
6740 * requested colorspace is the same as the image colorspace nothing is
6741 * done and NULL is returned. You should use
6742 * evas_object_image_colorspace_get() to check the current image
6743 * colorspace.
6744 *
6745 * See @ref evas_object_image_colorspace_get.
6746 *
6747 * @param obj The given image object.
6748 * @param to_cspace The colorspace to which the image raw data will be converted.
6749 * @return data A newly allocated data in the format specified by to_cspace.
6750 */
6751EAPI void *evas_object_image_data_convert (Evas_Object *obj, Evas_Colorspace to_cspace) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6752
6753/**
6754 * Replaces the raw image data of the given image object.
6755 *
6756 * @param obj The given image object.
6757 * @param data The raw data to replace.
6758 *
6759 * This function lets the application replace an image object's
6760 * internal pixel buffer with an user-allocated one. For best results,
6761 * you should generally first call evas_object_image_size_set() with
6762 * the width and height for the new buffer.
6763 *
6764 * This call is best suited for when you will be using image data with
6765 * different dimensions than the existing image data, if any. If you
6766 * only need to modify the existing image in some fashion, then using
6767 * evas_object_image_data_get() is probably what you are after.
6768 *
6769 * Note that the caller is responsible for freeing the buffer when
6770 * finished with it, as user-set image data will not be automatically
6771 * freed when the image object is deleted.
6772 *
6773 * See @ref evas_object_image_data_get() for more details.
6774 *
6775 */
6776EAPI void evas_object_image_data_copy_set (Evas_Object *obj, void *data) EINA_ARG_NONNULL(1);
6777
6778/**
6779 * Mark a sub-region of the given image object to be redrawn.
6780 *
6781 * @param obj The given image object.
6782 * @param x X-offset of the region to be updated.
6783 * @param y Y-offset of the region to be updated.
6784 * @param w Width of the region to be updated.
6785 * @param h Height of the region to be updated.
6786 *
6787 * This function schedules a particular rectangular region of an image
6788 * object to be updated (redrawn) at the next rendering cycle.
6789 */
6790EAPI void evas_object_image_data_update_add (Evas_Object *obj, int x, int y, int w, int h) EINA_ARG_NONNULL(1);
6791
6792/**
6793 * Enable or disable alpha channel usage on the given image object.
6794 *
6795 * @param obj The given image object.
6796 * @param has_alpha Whether to use alpha channel (@c EINA_TRUE) data
6797 * or not (@c EINA_FALSE).
6798 *
6799 * This function sets a flag on an image object indicating whether or
6800 * not to use alpha channel data. A value of @c EINA_TRUE makes it use
6801 * alpha channel data, and @c EINA_FALSE makes it ignore that
6802 * data. Note that this has nothing to do with an object's color as
6803 * manipulated by evas_object_color_set().
6804 *
6805 * @see evas_object_image_alpha_get()
6806 */
6807EAPI void evas_object_image_alpha_set (Evas_Object *obj, Eina_Bool has_alpha) EINA_ARG_NONNULL(1);
6808
6809/**
6810 * Retrieve whether alpha channel data is being used on the given
6811 * image object.
6812 *
6813 * @param obj The given image object.
6814 * @return Whether the alpha channel data is being used (@c EINA_TRUE)
6815 * or not (@c EINA_FALSE).
6816 *
6817 * This function returns @c EINA_TRUE if the image object's alpha
6818 * channel is being used, or @c EINA_FALSE otherwise.
6819 *
6820 * See @ref evas_object_image_alpha_set() for more details.
6821 */
6822EAPI Eina_Bool evas_object_image_alpha_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6823
6824/**
6825 * Sets whether to use high-quality image scaling algorithm on the
6826 * given image object.
6827 *
6828 * @param obj The given image object.
6829 * @param smooth_scale Whether to use smooth scale or not.
6830 *
6831 * When enabled, a higher quality image scaling algorithm is used when
6832 * scaling images to sizes other than the source image's original
6833 * one. This gives better results but is more computationally
6834 * expensive.
6835 *
6836 * @note Image objects get created originally with smooth scaling @b
6837 * on.
6838 *
6839 * @see evas_object_image_smooth_scale_get()
6840 */
6841EAPI void evas_object_image_smooth_scale_set (Evas_Object *obj, Eina_Bool smooth_scale) EINA_ARG_NONNULL(1);
6842
6843/**
6844 * Retrieves whether the given image object is using high-quality
6845 * image scaling algorithm.
6846 *
6847 * @param obj The given image object.
6848 * @return Whether smooth scale is being used.
6849 *
6850 * See @ref evas_object_image_smooth_scale_set() for more details.
6851 */
6852EAPI Eina_Bool evas_object_image_smooth_scale_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6853
6854/**
6855 * Preload an image object's image data in the background
6856 *
6857 * @param obj The given image object.
6858 * @param cancel @c EINA_FALSE will add it the preloading work queue,
6859 * @c EINA_TRUE will remove it (if it was issued before).
6860 *
6861 * This function requests the preload of the data image in the
6862 * background. The work is queued before being processed (because
6863 * there might be other pending requests of this type).
6864 *
6865 * Whenever the image data gets loaded, Evas will call
6866 * #EVAS_CALLBACK_IMAGE_PRELOADED registered callbacks on @p obj (what
6867 * may be immediately, if the data was already preloaded before).
6868 *
6869 * Use @c EINA_TRUE for @p cancel on scenarios where you don't need
6870 * the image data preloaded anymore.
6871 *
6872 * @note Any evas_object_show() call after evas_object_image_preload()
6873 * will make the latter to be @b cancelled, with the loading process
6874 * now taking place @b synchronously (and, thus, blocking the return
6875 * of the former until the image is loaded). It is highly advisable,
6876 * then, that the user preload an image with it being @b hidden, just
6877 * to be shown on the #EVAS_CALLBACK_IMAGE_PRELOADED event's callback.
6878 */
6879EAPI void evas_object_image_preload (Evas_Object *obj, Eina_Bool cancel) EINA_ARG_NONNULL(1);
6880
6881/**
6882 * Reload an image object's image data.
6883 *
6884 * @param obj The given image object pointer.
6885 *
6886 * This function reloads the image data bound to image object @p obj.
6887 */
6888EAPI void evas_object_image_reload (Evas_Object *obj) EINA_ARG_NONNULL(1);
6889
6890/**
6891 * Save the given image object's contents to an (image) file.
6892 *
6893 * @param obj The given image object.
6894 * @param file The filename to be used to save the image (extension
6895 * obligatory).
6896 * @param key The image key in the file (if an Eet one), or @c NULL,
6897 * otherwise.
6898 * @param flags String containing the flags to be used (@c NULL for
6899 * none).
6900 *
6901 * The extension suffix on @p file will determine which <b>saver
6902 * module</b> Evas is to use when saving, thus the final file's
6903 * format. If the file supports multiple data stored in it (Eet ones),
6904 * you can specify the key to be used as the index of the image in it.
6905 *
6906 * You can specify some flags when saving the image. Currently
6907 * acceptable flags are @c quality and @c compress. Eg.: @c
6908 * "quality=100 compress=9"
6909 */
6910EAPI Eina_Bool evas_object_image_save (const Evas_Object *obj, const char *file, const char *key, const char *flags) EINA_ARG_NONNULL(1, 2);
6911
6912/**
6913 * Import pixels from given source to a given canvas image object.
6914 *
6915 * @param obj The given canvas object.
6916 * @param pixels The pixel's source to be imported.
6917 *
6918 * This function imports pixels from a given source to a given canvas image.
6919 *
6920 */
6921EAPI Eina_Bool evas_object_image_pixels_import (Evas_Object *obj, Evas_Pixel_Import_Source *pixels) EINA_ARG_NONNULL(1, 2);
6922
6923/**
6924 * Set the callback function to get pixels from a canva's image.
6925 *
6926 * @param obj The given canvas pointer.
6927 * @param func The callback function.
6928 * @param data The data pointer to be passed to @a func.
6929 *
6930 * This functions sets a function to be the callback function that get
6931 * pixes from a image of the canvas.
6932 *
6933 */
6934EAPI void evas_object_image_pixels_get_callback_set(Evas_Object *obj, Evas_Object_Image_Pixels_Get_Cb func, void *data) EINA_ARG_NONNULL(1, 2);
6935
6936/**
6937 * Mark whether the given image object is dirty (needs to be redrawn).
6938 *
6939 * @param obj The given image object.
6940 * @param dirty Whether the image is dirty.
6941 */
6942EAPI void evas_object_image_pixels_dirty_set (Evas_Object *obj, Eina_Bool dirty) EINA_ARG_NONNULL(1);
6943
6944/**
6945 * Retrieves whether the given image object is dirty (needs to be redrawn).
6946 *
6947 * @param obj The given image object.
6948 * @return Whether the image is dirty.
6949 */
6950EAPI Eina_Bool evas_object_image_pixels_dirty_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6951
6952/**
6953 * Set the DPI resolution of an image object's source image.
6954 *
6955 * @param obj The given canvas pointer.
6956 * @param dpi The new DPI resolution.
6957 *
6958 * This function sets the DPI resolution of a given loaded canvas
6959 * image. Most useful for the SVG image loader.
6960 *
6961 * @see evas_object_image_load_dpi_get()
6962 */
6963EAPI void evas_object_image_load_dpi_set (Evas_Object *obj, double dpi) EINA_ARG_NONNULL(1);
6964
6965/**
6966 * Get the DPI resolution of a loaded image object in the canvas.
6967 *
6968 * @param obj The given canvas pointer.
6969 * @return The DPI resolution of the given canvas image.
6970 *
6971 * This function returns the DPI resolution of the given canvas image.
6972 *
6973 * @see evas_object_image_load_dpi_set() for more details
6974 */
6975EAPI double evas_object_image_load_dpi_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
6976
6977/**
6978 * Set the size of a given image object's source image, when loading
6979 * it.
6980 *
6981 * @param obj The given canvas object.
6982 * @param w The new width of the image's load size.
6983 * @param h The new height of the image's load size.
6984 *
6985 * This function sets a new (loading) size for the given canvas
6986 * image.
6987 *
6988 * @see evas_object_image_load_size_get()
6989 */
6990EAPI void evas_object_image_load_size_set (Evas_Object *obj, int w, int h) EINA_ARG_NONNULL(1);
6991
6992/**
6993 * Get the size of a given image object's source image, when loading
6994 * it.
6995 *
6996 * @param obj The given image object.
6997 * @param w Where to store the new width of the image's load size.
6998 * @param h Where to store the new height of the image's load size.
6999 *
7000 * @note Use @c NULL pointers on the size components you're not
7001 * interested in: they'll be ignored by the function.
7002 *
7003 * @see evas_object_image_load_size_set() for more details
7004 */
7005EAPI void evas_object_image_load_size_get (const Evas_Object *obj, int *w, int *h) EINA_ARG_NONNULL(1);
7006
7007/**
7008 * Set the scale down factor of a given image object's source image,
7009 * when loading it.
7010 *
7011 * @param obj The given image object pointer.
7012 * @param scale_down The scale down factor.
7013 *
7014 * This function sets the scale down factor of a given canvas
7015 * image. Most useful for the SVG image loader.
7016 *
7017 * @see evas_object_image_load_scale_down_get()
7018 */
7019EAPI void evas_object_image_load_scale_down_set (Evas_Object *obj, int scale_down) EINA_ARG_NONNULL(1);
7020
7021/**
7022 * get the scale down factor of a given image object's source image,
7023 * when loading it.
7024 *
7025 * @param obj The given image object pointer.
7026 *
7027 * @see evas_object_image_load_scale_down_set() for more details
7028 */
7029EAPI int evas_object_image_load_scale_down_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7030
7031/**
7032 * Inform a given image object to load a selective region of its
7033 * source image.
7034 *
7035 * @param obj The given image object pointer.
7036 * @param x X-offset of the region to be loaded.
7037 * @param y Y-offset of the region to be loaded.
7038 * @param w Width of the region to be loaded.
7039 * @param h Height of the region to be loaded.
7040 *
7041 * This function is useful when one is not showing all of an image's
7042 * area on its image object.
7043 *
7044 * @note The image loader for the image format in question has to
7045 * support selective region loading in order to this function to take
7046 * effect.
7047 *
7048 * @see evas_object_image_load_region_get()
7049 */
7050EAPI void evas_object_image_load_region_set (Evas_Object *obj, int x, int y, int w, int h) EINA_ARG_NONNULL(1);
7051
7052/**
7053 * Retrieve the coordinates of a given image object's selective
7054 * (source image) load region.
7055 *
7056 * @param obj The given image object pointer.
7057 * @param x Where to store the X-offset of the region to be loaded.
7058 * @param y Where to store the Y-offset of the region to be loaded.
7059 * @param w Where to store the width of the region to be loaded.
7060 * @param h Where to store the height of the region to be loaded.
7061 *
7062 * @note Use @c NULL pointers on the coordinates you're not interested
7063 * in: they'll be ignored by the function.
7064 *
7065 * @see evas_object_image_load_region_get()
7066 */
7067EAPI void evas_object_image_load_region_get (const Evas_Object *obj, int *x, int *y, int *w, int *h) EINA_ARG_NONNULL(1);
7068
7069/**
7070 * Define if the orientation information in the image file should be honored.
7071 *
7072 * @param obj The given image object pointer.
7073 * @param enable @p EINA_TRUE means that it should honor the orientation information
7074 * @since 1.1
7075 */
7076EAPI void evas_object_image_load_orientation_set (Evas_Object *obj, Eina_Bool enable) EINA_ARG_NONNULL(1);
7077
7078/**
7079 * Get if the orientation information in the image file should be honored.
7080 *
7081 * @param obj The given image object pointer.
7082 * @since 1.1
7083 */
7084EAPI Eina_Bool evas_object_image_load_orientation_get (const Evas_Object *obj) EINA_ARG_NONNULL(1);
7085
7086/**
7087 * Set the colorspace of a given image of the canvas.
7088 *
7089 * @param obj The given image object pointer.
7090 * @param cspace The new color space.
7091 *
7092 * This function sets the colorspace of given canvas image.
7093 *
7094 */
7095EAPI void evas_object_image_colorspace_set (Evas_Object *obj, Evas_Colorspace cspace) EINA_ARG_NONNULL(1);
7096
7097/**
7098 * Get the colorspace of a given image of the canvas.
7099 *
7100 * @param obj The given image object pointer.
7101 * @return The colorspace of the image.
7102 *
7103 * This function returns the colorspace of given canvas image.
7104 *
7105 */
7106EAPI Evas_Colorspace evas_object_image_colorspace_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7107
7108/**
7109 * Set the native surface of a given image of the canvas
7110 *
7111 * @param obj The given canvas pointer.
7112 * @param surf The new native surface.
7113 *
7114 * This function sets a native surface of a given canvas image.
7115 *
7116 */
7117EAPI void evas_object_image_native_surface_set (Evas_Object *obj, Evas_Native_Surface *surf) EINA_ARG_NONNULL(1, 2);
7118
7119/**
7120 * Get the native surface of a given image of the canvas
7121 *
7122 * @param obj The given canvas pointer.
7123 * @return The native surface of the given canvas image.
7124 *
7125 * This function returns the native surface of a given canvas image.
7126 *
7127 */
7128EAPI Evas_Native_Surface *evas_object_image_native_surface_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7129
7130/**
7131 * Set the video surface linked to a given image of the canvas
7132 *
7133 * @param obj The given canvas pointer.
7134 * @param surf The new video surface.
7135 * @since 1.1.0
7136 *
7137 * This function link a video surface to a given canvas image.
7138 *
7139 */
7140EAPI void evas_object_image_video_surface_set (Evas_Object *obj, Evas_Video_Surface *surf) EINA_ARG_NONNULL(1);
7141
7142/**
7143 * Get the video surface linekd to a given image of the canvas
7144 *
7145 * @param obj The given canvas pointer.
7146 * @return The video surface of the given canvas image.
7147 * @since 1.1.0
7148 *
7149 * This function returns the video surface linked to a given canvas image.
7150 *
7151 */
7152EAPI const Evas_Video_Surface *evas_object_image_video_surface_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7153
7154/**
7155 * Set the scale hint of a given image of the canvas.
7156 *
7157 * @param obj The given image object pointer.
7158 * @param hint The scale hint, a value in
7159 * #Evas_Image_Scale_Hint.
7160 *
7161 * This function sets the scale hint value of the given image object
7162 * in the canvas, which will affect how Evas is to cache scaled
7163 * versions of its original source image.
7164 *
7165 * @see evas_object_image_scale_hint_get()
7166 */
7167EAPI void evas_object_image_scale_hint_set (Evas_Object *obj, Evas_Image_Scale_Hint hint) EINA_ARG_NONNULL(1);
7168
7169/**
7170 * Get the scale hint of a given image of the canvas.
7171 *
7172 * @param obj The given image object pointer.
7173 * @return The scale hint value set on @p obj, a value in
7174 * #Evas_Image_Scale_Hint.
7175 *
7176 * This function returns the scale hint value of the given image
7177 * object of the canvas.
7178 *
7179 * @see evas_object_image_scale_hint_set() for more details.
7180 */
7181EAPI Evas_Image_Scale_Hint evas_object_image_scale_hint_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7182
7183/**
7184 * Set the content hint setting of a given image object of the canvas.
7185 *
7186 * @param obj The given canvas pointer.
7187 * @param hint The content hint value, one of the
7188 * #Evas_Image_Content_Hint ones.
7189 *
7190 * This function sets the content hint value of the given image of the
7191 * canvas. For example, if you're on the GL engine and your driver
7192 * implementation supports it, setting this hint to
7193 * #EVAS_IMAGE_CONTENT_HINT_DYNAMIC will make it need @b zero copies
7194 * at texture upload time, which is an "expensive" operation.
7195 *
7196 * @see evas_object_image_content_hint_get()
7197 */
7198EAPI void evas_object_image_content_hint_set (Evas_Object *obj, Evas_Image_Content_Hint hint) EINA_ARG_NONNULL(1);
7199
7200/**
7201 * Get the content hint setting of a given image object of the canvas.
7202 *
7203 * @param obj The given canvas pointer.
7204 * @return hint The content hint value set on it, one of the
7205 * #Evas_Image_Content_Hint ones (#EVAS_IMAGE_CONTENT_HINT_NONE means
7206 * an error).
7207 *
7208 * This function returns the content hint value of the given image of
7209 * the canvas.
7210 *
7211 * @see evas_object_image_content_hint_set()
7212 */
7213EAPI Evas_Image_Content_Hint evas_object_image_content_hint_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7214
7215
7216/**
7217 * Enable an image to be used as an alpha mask.
7218 *
7219 * This will set any flags, and discard any excess image data not used as an
7220 * alpha mask.
7221 *
7222 * Note there is little point in using a image as alpha mask unless it has an
7223 * alpha channel.
7224 *
7225 * @param obj Object to use as an alpha mask.
7226 * @param ismask Use image as alphamask, must be true.
7227 */
7228EAPI void evas_object_image_alpha_mask_set (Evas_Object *obj, Eina_Bool ismask) EINA_ARG_NONNULL(1);
7229
7230/**
7231 * Set the source object on an image object to used as a @b proxy.
7232 *
7233 * @param obj Proxy (image) object.
7234 * @param src Source object to use for the proxy.
7235 * @return @c EINA_TRUE on success, @c EINA_FALSE on error.
7236 *
7237 * If an image object is set to behave as a @b proxy, it will mirror
7238 * the rendering contents of a given @b source object in its drawing
7239 * region, without affecting that source in any way. The source must
7240 * be another valid Evas object. Other effects may be applied to the
7241 * proxy, such as a map (see evas_object_map_set()) to create a
7242 * reflection of the original object (for example).
7243 *
7244 * Any existing source object on @p obj will be removed after this
7245 * call. Setting @p src to @c NULL clears the proxy object (not in
7246 * "proxy state" anymore).
7247 *
7248 * @warning You cannot set a proxy as another proxy's source.
7249 *
7250 * @see evas_object_image_source_get()
7251 * @see evas_object_image_source_unset()
7252 */
7253EAPI Eina_Bool evas_object_image_source_set (Evas_Object *obj, Evas_Object *src) EINA_ARG_NONNULL(1);
7254
7255/**
7256 * Get the current source object of an image object.
7257 *
7258 * @param obj Image object
7259 * @return Source object (if any), or @c NULL, if not in "proxy mode"
7260 * (or on errors).
7261 *
7262 * @see evas_object_image_source_set() for more details
7263 */
7264EAPI Evas_Object *evas_object_image_source_get (Evas_Object *obj) EINA_ARG_NONNULL(1);
7265
7266/**
7267 * Clear the source object on a proxy image object.
7268 *
7269 * @param obj Image object to clear source of.
7270 * @return @c EINA_TRUE on success, @c EINA_FALSE on error.
7271 *
7272 * This is equivalent to calling evas_object_image_source_set() with a
7273 * @c NULL source.
7274 */
7275EAPI Eina_Bool evas_object_image_source_unset (Evas_Object *obj) EINA_ARG_NONNULL(1);
7276
7277/**
7278 * Check if a file extension may be supported by @ref Evas_Object_Image.
7279 *
7280 * @param file The file to check
7281 * @return EINA_TRUE if we may be able to opeen it, EINA_FALSE if it's unlikely.
7282 * @since 1.1.0
7283 *
7284 * If file is a Eina_Stringshare, use directly @ref evas_object_image_extension_can_load_fast_get.
7285 *
7286 * This functions is threadsafe.
7287 */
7288EAPI Eina_Bool evas_object_image_extension_can_load_get(const char *file);
7289
7290/**
7291 * Check if a file extension may be supported by @ref Evas_Object_Image.
7292 *
7293 * @param file The file to check, it should be an Eina_Stringshare.
7294 * @return EINA_TRUE if we may be able to opeen it, EINA_FALSE if it's unlikely.
7295 * @since 1.1.0
7296 *
7297 * This functions is threadsafe.
7298 */
7299EAPI Eina_Bool evas_object_image_extension_can_load_fast_get(const char *file);
7300
7301/**
7302 * Check if an image object can be animated (have multiple frames)
7303 *
7304 * @param obj Image object
7305 * @return whether obj support animation
7306 *
7307 * This returns if the image file of an image object is capable of animation
7308 * such as an animated gif file might. This is only useful to be called once
7309 * the image object file has been set.
7310 *
7311 * Example:
7312 * @code
7313 * extern Evas_Object *obj;
7314 *
7315 * if (evas_object_image_animated_get(obj))
7316 * {
7317 * int frame_count;
7318 * int loop_count;
7319 * Evas_Image_Animated_Loop_Hint loop_type;
7320 * double duration;
7321 *
7322 * frame_count = evas_object_image_animated_frame_count_get(obj);
7323 * printf("This image has %d frames\n",frame_count);
7324 *
7325 * duration = evas_object_image_animated_frame_duration_get(obj,1,0);
7326 * printf("Frame 1's duration is %f. You had better set object's frame to 2 after this duration using timer\n");
7327 *
7328 * loop_count = evas_object_image_animated_loop_count_get(obj);
7329 * printf("loop count is %d. You had better run loop %d times\n",loop_count,loop_count);
7330 *
7331 * loop_type = evas_object_image_animated_loop_type_get(obj);
7332 * if (loop_type == EVAS_IMAGE_ANIMATED_HINT_LOOP)
7333 * printf("You had better set frame like 1->2->3->1->2->3...\n");
7334 * else if (loop_type == EVAS_IMAGE_ANIMATED_HINT_PINGPONG)
7335 * printf("You had better set frame like 1->2->3->2->1->2...\n");
7336 * else
7337 * printf("Unknown loop type\n");
7338 *
7339 * evas_object_image_animated_frame_set(obj,1);
7340 * printf("You set image object's frame to 1. You can see frame 1\n");
7341 * }
7342 * @endcode
7343 *
7344 * @see evas_object_image_animated_get()
7345 * @see evas_object_image_animated_frame_count_get()
7346 * @see evas_object_image_animated_loop_type_get()
7347 * @see evas_object_image_animated_loop_count_get()
7348 * @see evas_object_image_animated_frame_duration_get()
7349 * @see evas_object_image_animated_frame_set()
7350 * @since 1.1.0
7351 */
7352EAPI Eina_Bool evas_object_image_animated_get(const Evas_Object *obj);
7353
7354/**
7355 * Get the total number of frames of the image object.
7356 *
7357 * @param obj Image object
7358 * @return The number of frames
7359 *
7360 * This returns total number of frames the image object supports (if animated)
7361 *
7362 * @see evas_object_image_animated_get()
7363 * @see evas_object_image_animated_frame_count_get()
7364 * @see evas_object_image_animated_loop_type_get()
7365 * @see evas_object_image_animated_loop_count_get()
7366 * @see evas_object_image_animated_frame_duration_get()
7367 * @see evas_object_image_animated_frame_set()
7368 * @since 1.1.0
7369 */
7370EAPI int evas_object_image_animated_frame_count_get(const Evas_Object *obj);
7371
7372/**
7373 * Get the kind of looping the image object does.
7374 *
7375 * @param obj Image object
7376 * @return Loop type of the image object
7377 *
7378 * This returns the kind of looping the image object wants to do.
7379 *
7380 * If it returns EVAS_IMAGE_ANIMATED_HINT_LOOP, you should display frames in a sequence like:
7381 * 1->2->3->1->2->3->1...
7382 * If it returns EVAS_IMAGE_ANIMATED_HINT_PINGPONG, it is better to
7383 * display frames in a sequence like: 1->2->3->2->1->2->3->1...
7384 *
7385 * The default type is EVAS_IMAGE_ANIMATED_HINT_LOOP.
7386 *
7387 * @see evas_object_image_animated_get()
7388 * @see evas_object_image_animated_frame_count_get()
7389 * @see evas_object_image_animated_loop_type_get()
7390 * @see evas_object_image_animated_loop_count_get()
7391 * @see evas_object_image_animated_frame_duration_get()
7392 * @see evas_object_image_animated_frame_set()
7393 * @since 1.1.0
7394 */
7395EAPI Evas_Image_Animated_Loop_Hint evas_object_image_animated_loop_type_get(const Evas_Object *obj);
7396
7397/**
7398 * Get the number times the animation of the object loops.
7399 *
7400 * @param obj Image object
7401 * @return The number of loop of an animated image object
7402 *
7403 * This returns loop count of image. The loop count is the number of times
7404 * the animation will play fully from first to last frame until the animation
7405 * should stop (at the final frame).
7406 *
7407 * If 0 is returned, then looping should happen indefinitely (no limit to
7408 * the number of times it loops).
7409 *
7410 * @see evas_object_image_animated_get()
7411 * @see evas_object_image_animated_frame_count_get()
7412 * @see evas_object_image_animated_loop_type_get()
7413 * @see evas_object_image_animated_loop_count_get()
7414 * @see evas_object_image_animated_frame_duration_get()
7415 * @see evas_object_image_animated_frame_set()
7416 * @since 1.1.0
7417 */
7418EAPI int evas_object_image_animated_loop_count_get(const Evas_Object *obj);
7419
7420/**
7421 * Get the duration of a sequence of frames.
7422 *
7423 * @param obj Image object
7424 * @param start_frame The first frame
7425 * @param fram_num Number of frames in the sequence
7426 *
7427 * This returns total duration that the specified sequence of frames should
7428 * take in seconds.
7429 *
7430 * If you set start_frame to 1 and frame_num 0, you get frame 1's duration
7431 * If you set start_frame to 1 and frame_num 1, you get frame 1's duration +
7432 * frame2's duration
7433 *
7434 * @see evas_object_image_animated_get()
7435 * @see evas_object_image_animated_frame_count_get()
7436 * @see evas_object_image_animated_loop_type_get()
7437 * @see evas_object_image_animated_loop_count_get()
7438 * @see evas_object_image_animated_frame_duration_get()
7439 * @see evas_object_image_animated_frame_set()
7440 * @since 1.1.0
7441 */
7442EAPI double evas_object_image_animated_frame_duration_get(const Evas_Object *obj, int start_frame, int fram_num);
7443
7444/**
7445 * Set the frame to current frame of an image object
7446 *
7447 * @param obj The given image object.
7448 * @param frame_num The index of current frame
7449 *
7450 * This set image object's current frame to frame_num with 1 being the first
7451 * frame.
7452 *
7453 * @see evas_object_image_animated_get()
7454 * @see evas_object_image_animated_frame_count_get()
7455 * @see evas_object_image_animated_loop_type_get()
7456 * @see evas_object_image_animated_loop_count_get()
7457 * @see evas_object_image_animated_frame_duration_get()
7458 * @see evas_object_image_animated_frame_set()
7459 * @since 1.1.0
7460 */
7461EAPI void evas_object_image_animated_frame_set(Evas_Object *obj, int frame_num);
7462/**
7463 * @}
7464 */
7465
7466/**
7467 * @defgroup Evas_Object_Text Text Object Functions
7468 *
7469 * Functions that operate on single line, single style text objects.
7470 *
7471 * For multiline and multiple style text, see @ref Evas_Object_Textblock.
7472 *
7473 * See some @ref Example_Evas_Text "examples" on this group of functions.
7474 *
7475 * @ingroup Evas_Object_Specific
7476 */
7477
7478/**
7479 * @addtogroup Evas_Object_Text
7480 * @{
7481 */
7482
7483/* basic styles (4 bits allocated use 0->10 now, 5 left) */
7484#define EVAS_TEXT_STYLE_MASK_BASIC 0xf
7485
7486/**
7487 * Text style type creation macro. Use style types on the 's'
7488 * arguments, being 'x' your style variable.
7489 */
7490#define EVAS_TEXT_STYLE_BASIC_SET(x, s) \
7491 do { x = ((x) & ~EVAS_TEXT_STYLE_MASK_BASIC) | (s); } while (0)
7492
7493#define EVAS_TEXT_STYLE_MASK_SHADOW_DIRECTION (0x7 << 4)
7494
7495/**
7496 * Text style type creation macro. This one will impose shadow
7497 * directions on the style type variable -- use the @c
7498 * EVAS_TEXT_STYLE_SHADOW_DIRECTION_* values on 's', incremmentally.
7499 */
7500#define EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET(x, s) \
7501 do { x = ((x) & ~EVAS_TEXT_STYLE_MASK_SHADOW_DIRECTION) | (s); } while (0)
7502
7503 typedef enum _Evas_Text_Style_Type
7504 {
7505 EVAS_TEXT_STYLE_PLAIN, /**< plain, standard text */
7506 EVAS_TEXT_STYLE_SHADOW, /**< text with shadow underneath */
7507 EVAS_TEXT_STYLE_OUTLINE, /**< text with an outline */
7508 EVAS_TEXT_STYLE_SOFT_OUTLINE, /**< text with a soft outline */
7509 EVAS_TEXT_STYLE_GLOW, /**< text with a glow effect */
7510 EVAS_TEXT_STYLE_OUTLINE_SHADOW, /**< text with both outline and shadow effects */
7511 EVAS_TEXT_STYLE_FAR_SHADOW, /**< text with (far) shadow underneath */
7512 EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW, /**< text with outline and soft shadow effects combined */
7513 EVAS_TEXT_STYLE_SOFT_SHADOW, /**< text with (soft) shadow underneath */
7514 EVAS_TEXT_STYLE_FAR_SOFT_SHADOW, /**< text with (far soft) shadow underneath */
7515
7516 /* OR these to modify shadow direction (3 bits needed) */
7517 EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_RIGHT = (0x0 << 4), /**< shadow growing to bottom right */
7518 EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM = (0x1 << 4), /**< shadow growing to the bottom */
7519 EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_LEFT = (0x2 << 4), /**< shadow growing to bottom left */
7520 EVAS_TEXT_STYLE_SHADOW_DIRECTION_LEFT = (0x3 << 4), /**< shadow growing to the left */
7521 EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP_LEFT = (0x4 << 4), /**< shadow growing to top left */
7522 EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP = (0x5 << 4), /**< shadow growing to the top */
7523 EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP_RIGHT = (0x6 << 4), /**< shadow growing to top right */
7524 EVAS_TEXT_STYLE_SHADOW_DIRECTION_RIGHT = (0x7 << 4) /**< shadow growing to the right */
7525 } Evas_Text_Style_Type; /**< Types of styles to be applied on text objects. The @c EVAS_TEXT_STYLE_SHADOW_DIRECTION_* ones are to be ORed together with others imposing shadow, to change shadow's direction */
7526
7527/**
7528 * Creates a new text object on the provided canvas.
7529 *
7530 * @param e The canvas to create the text object on.
7531 * @return @c NULL on error, a pointer to a new text object on
7532 * success.
7533 *
7534 * Text objects are for simple, single line text elements. If you want
7535 * more elaborated text blocks, see @ref Evas_Object_Textblock.
7536 *
7537 * @see evas_object_text_font_source_set()
7538 * @see evas_object_text_font_set()
7539 * @see evas_object_text_text_set()
7540 */
7541EAPI Evas_Object *evas_object_text_add (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
7542
7543/**
7544 * Set the font (source) file to be used on a given text object.
7545 *
7546 * @param obj The text object to set font for.
7547 * @param font The font file's path.
7548 *
7549 * This function allows the font file to be explicitly set for a given
7550 * text object, overriding system lookup, which will first occur in
7551 * the given file's contents.
7552 *
7553 * @see evas_object_text_font_get()
7554 */
7555EAPI void evas_object_text_font_source_set (Evas_Object *obj, const char *font) EINA_ARG_NONNULL(1);
7556
7557/**
7558 * Get the font file's path which is being used on a given text
7559 * object.
7560 *
7561 * @param obj The text object to set font for.
7562 * @param font The font file's path.
7563 *
7564 * @see evas_object_text_font_get() for more details
7565 */
7566EAPI const char *evas_object_text_font_source_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7567
7568/**
7569 * Set the font family and size on a given text object.
7570 *
7571 * @param obj The text object to set font for.
7572 * @param font The font (family) name.
7573 * @param size The font size, in points.
7574 *
7575 * This function allows the font name and size of a text object to be
7576 * set. The @p font string has to follow fontconfig's convention on
7577 * naming fonts, as it's the underlying lybrary used to query system
7578 * fonts by Evas (see the @c fc-list command's output, on your system,
7579 * to get an idea).
7580 *
7581 * @see evas_object_text_font_get()
7582 * @see evas_object_text_font_source_set()
7583 */
7584 EAPI void evas_object_text_font_set (Evas_Object *obj, const char *font, Evas_Font_Size size) EINA_ARG_NONNULL(1);
7585
7586/**
7587 * Retrieve the font family and size in use on a given text object.
7588 *
7589 * @param obj The evas text object to query for font information.
7590 * @param font A pointer to the location to store the font name in.
7591 * @param size A pointer to the location to store the font size in.
7592 *
7593 * This function allows the font name and size of a text object to be
7594 * queried. Be aware that the font name string is still owned by Evas
7595 * and should @b not have free() called on it by the caller of the
7596 * function.
7597 *
7598 * @see evas_object_text_font_set()
7599 */
7600EAPI void evas_object_text_font_get (const Evas_Object *obj, const char **font, Evas_Font_Size *size) EINA_ARG_NONNULL(1);
7601
7602/**
7603 * Sets the text string to be displayed by the given text object.
7604 *
7605 * @param obj The text object to set text string on.
7606 * @param text Text string to display on it.
7607 *
7608 * @see evas_object_text_text_get()
7609 */
7610EAPI void evas_object_text_text_set (Evas_Object *obj, const char *text) EINA_ARG_NONNULL(1);
7611
7612/**
7613 * Retrieves the text string currently being displayed by the given
7614 * text object.
7615 *
7616 * @param obj The given text object.
7617 * @return The text string currently being displayed on it.
7618 *
7619 * @note Do not free() the return value.
7620 *
7621 * @see evas_object_text_text_set()
7622 */
7623EAPI const char *evas_object_text_text_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7624
7625/**
7626 * @brief Sets the BiDi delimiters used in the textblock.
7627 *
7628 * BiDi delimiters are use for in-paragraph separation of bidi segments. This
7629 * is useful for example in recipients fields of e-mail clients where bidi
7630 * oddities can occur when mixing rtl and ltr.
7631 *
7632 * @param obj The given text object.
7633 * @param delim A null terminated string of delimiters, e.g ",|".
7634 * @since 1.1.0
7635 */
7636EAPI void evas_object_text_bidi_delimiters_set(Evas_Object *obj, const char *delim);
7637
7638/**
7639 * @brief Gets the BiDi delimiters used in the textblock.
7640 *
7641 * BiDi delimiters are use for in-paragraph separation of bidi segments. This
7642 * is useful for example in recipients fields of e-mail clients where bidi
7643 * oddities can occur when mixing rtl and ltr.
7644 *
7645 * @param obj The given text object.
7646 * @return A null terminated string of delimiters, e.g ",|". If empty, returns NULL.
7647 * @since 1.1.0
7648 */
7649EAPI const char *evas_object_text_bidi_delimiters_get(const Evas_Object *obj);
7650
7651 EAPI Evas_Coord evas_object_text_ascent_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7652 EAPI Evas_Coord evas_object_text_descent_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7653 EAPI Evas_Coord evas_object_text_max_ascent_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7654 EAPI Evas_Coord evas_object_text_max_descent_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7655 EAPI Evas_Coord evas_object_text_horiz_advance_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7656 EAPI Evas_Coord evas_object_text_vert_advance_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7657 EAPI Evas_Coord evas_object_text_inset_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7658
7659/**
7660 * Retrieve position and dimension information of a character within a text @c Evas_Object.
7661 *
7662 * This function is used to obtain the X, Y, width and height of a the character
7663 * located at @p pos within the @c Evas_Object @p obj. @p obj must be a text object
7664 * as created with evas_object_text_add(). Any of the @c Evas_Coord parameters (@p cx,
7665 * @p cy, @p cw, @p ch) may be NULL in which case no value will be assigned to that
7666 * parameter.
7667 *
7668 * @param obj The text object to retrieve position information for.
7669 * @param pos The character position to request co-ordinates for.
7670 * @param cx A pointer to an @c Evas_Coord to store the X value in (can be NULL).
7671 * @param cy A pointer to an @c Evas_Coord to store the Y value in (can be NULL).
7672 * @param cw A pointer to an @c Evas_Coord to store the Width value in (can be NULL).
7673 * @param ch A pointer to an @c Evas_Coord to store the Height value in (can be NULL).
7674 *
7675 * @returns EINA_FALSE on success, EINA_TRUE on error.
7676 */
7677EAPI Eina_Bool evas_object_text_char_pos_get (const Evas_Object *obj, int pos, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch) EINA_ARG_NONNULL(1);
7678 EAPI int evas_object_text_char_coords_get (const Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch) EINA_ARG_NONNULL(1);
7679
7680/**
7681 * Returns the logical position of the last char in the text
7682 * up to the pos given. this is NOT the position of the last char
7683 * because of the possibility of RTL in the text.
7684 */
7685EAPI int evas_object_text_last_up_to_pos (const Evas_Object *obj, Evas_Coord x, Evas_Coord y) EINA_ARG_NONNULL(1);
7686
7687/**
7688 * Retrieves the style on use on the given text object.
7689 *
7690 * @param obj the given text object to set style on.
7691 * @return the style type in use.
7692 *
7693 * @see evas_object_text_style_set() for more details.
7694 */
7695EAPI Evas_Text_Style_Type evas_object_text_style_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
7696
7697/**
7698 * Sets the style to apply on the given text object.
7699 *
7700 * @param obj the given text object to set style on.
7701 * @param type a style type.
7702 *
7703 * Text object styles are one of the values in
7704 * #Evas_Text_Style_Type. Some of those values are combinations of
7705 * more than one style, and some account for the direction of the
7706 * rendering of shadow effects.
7707 *
7708 * @note One may use the helper macros #EVAS_TEXT_STYLE_BASIC_SET and
7709 * #EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET to assemble a style value.
7710 *
7711 * The following figure illustrates the text styles:
7712 *
7713 * @image html text-styles.png
7714 * @image rtf text-styles.png
7715 * @image latex text-styles.eps
7716 *
7717 * @see evas_object_text_style_get()
7718 * @see evas_object_text_shadow_color_set()
7719 * @see evas_object_text_outline_color_set()
7720 * @see evas_object_text_glow_color_set()
7721 * @see evas_object_text_glow2_color_set()
7722 */
7723EAPI void evas_object_text_style_set (Evas_Object *obj, Evas_Text_Style_Type type) EINA_ARG_NONNULL(1);
7724
7725/**
7726 * Sets the shadow color for the given text object.
7727 *
7728 * @param obj The given Evas text object.
7729 * @param r The red component of the given color.
7730 * @param g The green component of the given color.
7731 * @param b The blue component of the given color.
7732 * @param a The alpha component of the given color.
7733 *
7734 * Shadow effects, which are fading colors decorating the text
7735 * underneath it, will just be shown if the object is set to one of
7736 * the following styles:
7737 *
7738 * - #EVAS_TEXT_STYLE_SHADOW
7739 * - #EVAS_TEXT_STYLE_OUTLINE_SHADOW
7740 * - #EVAS_TEXT_STYLE_FAR_SHADOW
7741 * - #EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW
7742 * - #EVAS_TEXT_STYLE_SOFT_SHADOW
7743 * - #EVAS_TEXT_STYLE_FAR_SOFT_SHADOW
7744 *
7745 * One can also change de direction the shadow grows to, with
7746 * evas_object_text_style_set().
7747 *
7748 * @see evas_object_text_shadow_color_get()
7749 */
7750EAPI void evas_object_text_shadow_color_set (Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
7751
7752/**
7753 * Retrieves the shadow color for the given text object.
7754 *
7755 * @param obj The given Evas text object.
7756 * @param r Pointer to variable to hold the red component of the given
7757 * color.
7758 * @param g Pointer to variable to hold the green component of the
7759 * given color.
7760 * @param b Pointer to variable to hold the blue component of the
7761 * given color.
7762 * @param a Pointer to variable to hold the alpha component of the
7763 * given color.
7764 *
7765 * @note Use @c NULL pointers on the color components you're not
7766 * interested in: they'll be ignored by the function.
7767 *
7768 * @see evas_object_text_shadow_color_set() for more details.
7769 */
7770EAPI void evas_object_text_shadow_color_get (const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
7771
7772/**
7773 * Sets the glow color for the given text object.
7774 *
7775 * @param obj The given Evas text object.
7776 * @param r The red component of the given color.
7777 * @param g The green component of the given color.
7778 * @param b The blue component of the given color.
7779 * @param a The alpha component of the given color.
7780 *
7781 * Glow effects, which are glowing colors decorating the text's
7782 * surroundings, will just be shown if the object is set to the
7783 * #EVAS_TEXT_STYLE_GLOW style.
7784 *
7785 * @note Glow effects are placed from a short distance of the text
7786 * itself, but no touching it. For glowing effects right on the
7787 * borders of the glyphs, see 'glow 2' effects
7788 * (evas_object_text_glow2_color_set()).
7789 *
7790 * @see evas_object_text_glow_color_get()
7791 */
7792EAPI void evas_object_text_glow_color_set (Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
7793
7794/**
7795 * Retrieves the glow color for the given text object.
7796 *
7797 * @param obj The given Evas text object.
7798 * @param r Pointer to variable to hold the red component of the given
7799 * color.
7800 * @param g Pointer to variable to hold the green component of the
7801 * given color.
7802 * @param b Pointer to variable to hold the blue component of the
7803 * given color.
7804 * @param a Pointer to variable to hold the alpha component of the
7805 * given color.
7806 *
7807 * @note Use @c NULL pointers on the color components you're not
7808 * interested in: they'll be ignored by the function.
7809 *
7810 * @see evas_object_text_glow_color_set() for more details.
7811 */
7812EAPI void evas_object_text_glow_color_get (const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
7813
7814/**
7815 * Sets the 'glow 2' color for the given text object.
7816 *
7817 * @param obj The given Evas text object.
7818 * @param r The red component of the given color.
7819 * @param g The green component of the given color.
7820 * @param b The blue component of the given color.
7821 * @param a The alpha component of the given color.
7822 *
7823 * 'Glow 2' effects, which are glowing colors decorating the text's
7824 * (immediate) surroundings, will just be shown if the object is set
7825 * to the #EVAS_TEXT_STYLE_GLOW style. See also
7826 * evas_object_text_glow_color_set().
7827 *
7828 * @see evas_object_text_glow2_color_get()
7829 */
7830EAPI void evas_object_text_glow2_color_set (Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
7831
7832/**
7833 * Retrieves the 'glow 2' color for the given text object.
7834 *
7835 * @param obj The given Evas text object.
7836 * @param r Pointer to variable to hold the red component of the given
7837 * color.
7838 * @param g Pointer to variable to hold the green component of the
7839 * given color.
7840 * @param b Pointer to variable to hold the blue component of the
7841 * given color.
7842 * @param a Pointer to variable to hold the alpha component of the
7843 * given color.
7844 *
7845 * @note Use @c NULL pointers on the color components you're not
7846 * interested in: they'll be ignored by the function.
7847 *
7848 * @see evas_object_text_glow2_color_set() for more details.
7849 */
7850EAPI void evas_object_text_glow2_color_get (const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
7851
7852/**
7853 * Sets the outline color for the given text object.
7854 *
7855 * @param obj The given Evas text object.
7856 * @param r The red component of the given color.
7857 * @param g The green component of the given color.
7858 * @param b The blue component of the given color.
7859 * @param a The alpha component of the given color.
7860 *
7861 * Outline effects (colored lines around text glyphs) will just be
7862 * shown if the object is set to one of the following styles:
7863 * - #EVAS_TEXT_STYLE_OUTLINE
7864 * - #EVAS_TEXT_STYLE_SOFT_OUTLINE
7865 * - #EVAS_TEXT_STYLE_OUTLINE_SHADOW
7866 * - #EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW
7867 *
7868 * @see evas_object_text_outline_color_get()
7869 */
7870EAPI void evas_object_text_outline_color_set(Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
7871
7872/**
7873 * Retrieves the outline color for the given text object.
7874 *
7875 * @param obj The given Evas text object.
7876 * @param r Pointer to variable to hold the red component of the given
7877 * color.
7878 * @param g Pointer to variable to hold the green component of the
7879 * given color.
7880 * @param b Pointer to variable to hold the blue component of the
7881 * given color.
7882 * @param a Pointer to variable to hold the alpha component of the
7883 * given color.
7884 *
7885 * @note Use @c NULL pointers on the color components you're not
7886 * interested in: they'll be ignored by the function.
7887 *
7888 * @see evas_object_text_outline_color_set() for more details.
7889 */
7890EAPI void evas_object_text_outline_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
7891
7892/**
7893 * Gets the text style pad of a text object.
7894 *
7895 * @param obj The given text object.
7896 * @param l The left pad (or @c NULL).
7897 * @param r The right pad (or @c NULL).
7898 * @param t The top pad (or @c NULL).
7899 * @param b The bottom pad (or @c NULL).
7900 *
7901 */
7902EAPI void evas_object_text_style_pad_get (const Evas_Object *obj, int *l, int *r, int *t, int *b) EINA_ARG_NONNULL(1);
7903
7904/**
7905 * Retrieves the direction of the text currently being displayed in the
7906 * text object.
7907 * @param obj The given evas text object.
7908 * @return the direction of the text
7909 */
7910EAPI Evas_BiDi_Direction evas_object_text_direction_get (const Evas_Object *obj) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
7911
7912/**
7913 * @}
7914 */
7915
7916/**
7917 * @defgroup Evas_Object_Textblock Textblock Object Functions
7918 *
7919 * Functions used to create and manipulate textblock objects. Unlike
7920 * @ref Evas_Object_Text, these handle complex text, doing multiple
7921 * styles and multiline text based on HTML-like tags. Of these extra
7922 * features will be heavier on memory and processing cost.
7923 *
7924 * @section Evas_Object_Textblock_Tutorial Textblock Object Tutorial
7925 *
7926 * This part explains about the textblock object's API and proper usage.
7927 * If you want to develop textblock, you should also refer to @ref Evas_Object_Textblock_Internal.
7928 * The main user of the textblock object is the edje entry object in Edje, so
7929 * that's a good place to learn from, but I think this document is more than
7930 * enough, if it's not, please contact me and I'll update it.
7931 *
7932 * @subsection textblock_intro Introduction
7933 * The textblock objects is, as implied, an object that can show big chunks of
7934 * text. Textblock supports many features including: Text formatting, automatic
7935 * and manual text alignment, embedding items (for example icons) and more.
7936 * Textblock has three important parts, the text paragraphs, the format nodes
7937 * and the cursors.
7938 *
7939 * You can use markup to format text, for example: "<font_size=50>Big!</font_size>".
7940 * You can also put more than one style directive in one tag:
7941 * "<font_size=50 color=#F00>Big and Red!</font_size>".
7942 * Please notice that we used "</font_size>" although the format also included
7943 * color, this is because the first format determines the matching closing tag's
7944 * name. You can also use anonymous tags, like: "<font_size=30>Big</>" which
7945 * just pop any type of format, but it's advised to use the named alternatives
7946 * instead.
7947 *
7948 * @subsection textblock_cursors Textblock Object Cursors
7949 * A textblock Cursor @ref Evas_Textblock_Cursor is data type that represents
7950 * a position in a textblock. Each cursor contains information about the
7951 * paragraph it points to, the position in that paragraph and the object itself.
7952 * Cursors register to textblock objects upon creation, this means that once
7953 * you created a cursor, it belongs to a specific obj and you can't for example
7954 * copy a cursor "into" a cursor of a different object. Registered cursors
7955 * also have the added benefit of updating automatically upon textblock changes,
7956 * this means that if you have a cursor pointing to a specific character, it'll
7957 * still point to it even after you change the whole object completely (as long
7958 * as the char was not deleted), this is not possible without updating, because
7959 * as mentioned, each cursor holds a character position. There are many
7960 * functions that handle cursors, just check out the evas_textblock_cursor*
7961 * functions. For creation and deletion of cursors check out:
7962 * @see evas_object_textblock_cursor_new()
7963 * @see evas_textblock_cursor_free()
7964 * @note Cursors are generally the correct way to handle text in the textblock object, and there are enough functions to do everything you need with them (no need to get big chunks of text and processing them yourself).
7965 *
7966 * @subsection textblock_paragraphs Textblock Object Paragraphs
7967 * The textblock object is made out of text splitted to paragraphs (delimited
7968 * by the paragraph separation character). Each paragraph has many (or none)
7969 * format nodes associated with it which are responsible for the formatting
7970 * of that paragraph.
7971 *
7972 * @subsection textblock_format_nodes Textblock Object Format Nodes
7973 * As explained in @ref textblock_paragraphs each one of the format nodes
7974 * is associated with a paragraph.
7975 * There are two types of format nodes, visible and invisible:
7976 * Visible: formats that a cursor can point to, i.e formats that
7977 * occupy space, for example: newlines, tabs, items and etc. Some visible items
7978 * are made of two parts, in this case, only the opening tag is visible.
7979 * A closing tag (i.e a </tag> tag) should NEVER be visible.
7980 * Invisible: formats that don't occupy space, for example: bold and underline.
7981 * Being able to access format nodes is very important for some uses. For
7982 * example, edje uses the "<a>" format to create links in the text (and pop
7983 * popups above them when clicked). For the textblock object a is just a
7984 * formatting instruction (how to color the text), but edje utilizes the access
7985 * to the format nodes to make it do more.
7986 * For more information, take a look at all the evas_textblock_node_format_*
7987 * functions.
7988 * The translation of "<tag>" tags to actual format is done according to the
7989 * tags defined in the style, see @ref evas_textblock_style_set
7990 *
7991 * @subsection textblock_special_formats Special Formats
7992 * Textblock supports various format directives that can be used either in
7993 * markup, or by calling @ref evas_object_textblock_format_append or
7994 * @ref evas_object_textblock_format_prepend. In addition to the mentioned
7995 * format directives, textblock allows creating additional format directives
7996 * using "tags" that can be set in the style see @ref evas_textblock_style_set .
7997 *
7998 * Textblock supports the following formats:
7999 * @li font - Font description in fontconfig like format, e.g: "Sans:style=Italic:lang=hi". or "Serif:style=Bold".
8000 * @li font_weight - Overrides the weight defined in "font". E.g: "font_weight=Bold" is the same as "font=:style=Bold". Supported weights: "normal", "thin", "ultralight", "light", "book", "medium", "semibold", "bold", "ultrabold", "black", and "extrablack".
8001 * @li font_style - Overrides the style defined in "font". E.g: "font_style=Italic" is the same as "font=:style=Italic". Supported styles: "normal", "oblique", and "italic".
8002 * @li font_width - Overrides the width defined in "font". E.g: "font_width=Condensed" is the same as "font=:style=Condensed". Supported widths: "normal", "ultracondensed", "extracondensed", "condensed", "semicondensed", "semiexpanded", "expanded", "extraexpanded", and "ultraexpanded".
8003 * @li lang - Overrides the language defined in "font". E.g: "lang=he" is the same as "font=:lang=he".
8004 * @li font_fallbacks - A comma delimited list of fonts to try if finding the main font fails.
8005 * @li font_size - The font size in points.
8006 * @li font_source - The source of the font, e.g an eet file.
8007 * @li color - Text color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8008 * @li underline_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8009 * @li underline2_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8010 * @li outline_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8011 * @li shadow_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8012 * @li glow_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8013 * @li glow2_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8014 * @li backing_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8015 * @li strikethrough_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8016 * @li align - Either "auto" (meaning according to text direction), "left", "right", "center", "middle", a value between 0.0 and 1.0, or a value between 0% to 100%.
8017 * @li valign - Either "top", "bottom", "middle", "center", "baseline", "base", a value between 0.0 and 1.0, or a value between 0% to 100%.
8018 * @li wrap - "word", "char", "mixed", or "none".
8019 * @li left_margin - Either "reset", or a pixel value indicating the margin.
8020 * @li right_margin - Either "reset", or a pixel value indicating the margin.
8021 * @li underline - "on", "off", "single", or "double".
8022 * @li strikethrough - "on" or "off"
8023 * @li backing - "on" or "off"
8024 * @li style - Either "off", "none", "plain", "shadow", "outline", "soft_outline", "outline_shadow", "outline_soft_shadow", "glow", "far_shadow", "soft_shadow", or "far_soft_shadow".
8025 * @li tabstops - Pixel value for tab width.
8026 * @li linesize - Force a line size in pixels.
8027 * @li linerelsize - Either a floating point value or a percentage indicating the wanted size of the line relative to the calculated size.
8028 * @li linegap - Force a line gap in pixels.
8029 * @li linerelgap - Either a floating point value or a percentage indicating the wanted size of the line relative to the calculated size.
8030 * @li item - Creates an empty space that should be filled by an upper layer. Use "size", "abssize", or "relsize". To define the items size, and an optional: vsize=full/ascent to define the item's position in the line.
8031 * @li linefill - Either a float value or percentage indicating how much to fill the line.
8032 * @li ellipsis - Value between 0.0-1.0 to indicate the type of ellipsis, or -1.0 to indicate ellipsis isn't wanted.
8033 * @li password - "on" or "off". This is used to specifically turn replacing chars with the replacement char (i.e password mode) on and off.
8034 *
8035 *
8036 * @todo put here some usage examples
8037 *
8038 * @ingroup Evas_Object_Specific
8039 *
8040 * @{
8041 */
8042
8043 typedef struct _Evas_Textblock_Style Evas_Textblock_Style;
8044 typedef struct _Evas_Textblock_Cursor Evas_Textblock_Cursor;
8045 /**
8046 * @typedef Evas_Object_Textblock_Node_Format
8047 * A format node.
8048 */
8049 typedef struct _Evas_Object_Textblock_Node_Format Evas_Object_Textblock_Node_Format;
8050 typedef struct _Evas_Textblock_Rectangle Evas_Textblock_Rectangle;
8051
8052 struct _Evas_Textblock_Rectangle
8053 {
8054 Evas_Coord x, y, w, h;
8055 };
8056
8057 typedef enum _Evas_Textblock_Text_Type
8058 {
8059 EVAS_TEXTBLOCK_TEXT_RAW,
8060 EVAS_TEXTBLOCK_TEXT_PLAIN,
8061 EVAS_TEXTBLOCK_TEXT_MARKUP
8062 } Evas_Textblock_Text_Type;
8063
8064 typedef enum _Evas_Textblock_Cursor_Type
8065 {
8066 EVAS_TEXTBLOCK_CURSOR_UNDER,
8067 EVAS_TEXTBLOCK_CURSOR_BEFORE
8068 } Evas_Textblock_Cursor_Type;
8069
8070
8071/**
8072 * Adds a textblock to the given evas.
8073 * @param e The given evas.
8074 * @return The new textblock object.
8075 */
8076EAPI Evas_Object *evas_object_textblock_add(Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
8077
8078
8079/**
8080 * Returns the unescaped version of escape.
8081 * @param escape the string to be escaped
8082 * @return the unescaped version of escape
8083 */
8084EAPI const char *evas_textblock_escape_string_get(const char *escape) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8085
8086/**
8087 * Returns the escaped version of the string.
8088 * @param string to escape
8089 * @param len_ret the len of the part of the string that was used.
8090 * @return the escaped string.
8091 */
8092EAPI const char *evas_textblock_string_escape_get(const char *string, int *len_ret) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8093
8094/**
8095 * Return the unescaped version of the string between start and end.
8096 *
8097 * @param escape_start the start of the string.
8098 * @param escape_end the end of the string.
8099 * @return the unescaped version of the range
8100 */
8101EAPI const char *evas_textblock_escape_string_range_get(const char *escape_start, const char *escape_end) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
8102
8103
8104/**
8105 * Creates a new textblock style.
8106 * @return The new textblock style.
8107 */
8108EAPI Evas_Textblock_Style *evas_textblock_style_new(void) EINA_WARN_UNUSED_RESULT EINA_MALLOC;
8109
8110/**
8111 * Destroys a textblock style.
8112 * @param ts The textblock style to free.
8113 */
8114EAPI void evas_textblock_style_free(Evas_Textblock_Style *ts) EINA_ARG_NONNULL(1);
8115
8116/**
8117 * Sets the style ts to the style passed as text by text.
8118 * Expected a string consisting of many (or none) tag='format' pairs.
8119 *
8120 * @param ts the style to set.
8121 * @param text the text to parse - NOT NULL.
8122 * @return Returns no value.
8123 */
8124EAPI void evas_textblock_style_set(Evas_Textblock_Style *ts, const char *text) EINA_ARG_NONNULL(1);
8125
8126/**
8127 * Return the text of the style ts.
8128 * @param ts the style to get it's text.
8129 * @return the text of the style or null on error.
8130 */
8131EAPI const char *evas_textblock_style_get(const Evas_Textblock_Style *ts) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8132
8133
8134/**
8135 * Set the objects style to ts.
8136 * @param obj the Evas object to set the style to.
8137 * @param ts the style to set.
8138 * @return Returns no value.
8139 */
8140EAPI void evas_object_textblock_style_set(Evas_Object *obj, Evas_Textblock_Style *ts) EINA_ARG_NONNULL(1);
8141
8142/**
8143 * Return the style of an object.
8144 * @param obj the object to get the style from.
8145 * @return the style of the object.
8146 */
8147EAPI const Evas_Textblock_Style *evas_object_textblock_style_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8148
8149/**
8150 * @brief Set the "replacement character" to use for the given textblock object.
8151 *
8152 * @param obj The given textblock object.
8153 * @param ch The charset name.
8154 */
8155EAPI void evas_object_textblock_replace_char_set(Evas_Object *obj, const char *ch) EINA_ARG_NONNULL(1);
8156
8157/**
8158 * @brief Get the "replacement character" for given textblock object. Returns
8159 * NULL if no replacement character is in use.
8160 *
8161 * @param obj The given textblock object
8162 * @return replacement character or @c NULL
8163 */
8164EAPI const char *evas_object_textblock_replace_char_get(Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8165
8166/**
8167 * @brief Sets the vertical alignment of text within the textblock object
8168 * as a whole.
8169 *
8170 * Normally alignment is 0.0 (top of object). Values given should be
8171 * between 0.0 and 1.0 (1.0 bottom of object, 0.5 being vertically centered
8172 * etc.).
8173 *
8174 * @param obj The given textblock object.
8175 * @param align A value between 0.0 and 1.0
8176 * @since 1.1.0
8177 */
8178EAPI void evas_object_textblock_valign_set(Evas_Object *obj, double align);
8179
8180/**
8181 * @brief Gets the vertical alignment of a textblock
8182 *
8183 * @param obj The given textblock object.
8184 * @return The elignment set for the object
8185 * @since 1.1.0
8186 */
8187EAPI double evas_object_textblock_valign_get(const Evas_Object *obj);
8188
8189/**
8190 * @brief Sets the BiDi delimiters used in the textblock.
8191 *
8192 * BiDi delimiters are use for in-paragraph separation of bidi segments. This
8193 * is useful for example in recipients fields of e-mail clients where bidi
8194 * oddities can occur when mixing rtl and ltr.
8195 *
8196 * @param obj The given textblock object.
8197 * @param delim A null terminated string of delimiters, e.g ",|".
8198 * @since 1.1.0
8199 */
8200EAPI void evas_object_textblock_bidi_delimiters_set(Evas_Object *obj, const char *delim);
8201
8202/**
8203 * @brief Gets the BiDi delimiters used in the textblock.
8204 *
8205 * BiDi delimiters are use for in-paragraph separation of bidi segments. This
8206 * is useful for example in recipients fields of e-mail clients where bidi
8207 * oddities can occur when mixing rtl and ltr.
8208 *
8209 * @param obj The given textblock object.
8210 * @return A null terminated string of delimiters, e.g ",|". If empty, returns NULL.
8211 * @since 1.1.0
8212 */
8213EAPI const char *evas_object_textblock_bidi_delimiters_get(const Evas_Object *obj);
8214
8215/**
8216 * @brief Sets newline mode. When true, newline character will behave
8217 * as a paragraph separator.
8218 *
8219 * @param obj The given textblock object.
8220 * @param mode EINA_TRUE for legacy mode, EINA_FALSE otherwise.
8221 * @since 1.1.0
8222 */
8223EAPI void evas_object_textblock_legacy_newline_set(Evas_Object *obj, Eina_Bool mode) EINA_ARG_NONNULL(1);
8224
8225/**
8226 * @brief Gets newline mode. When true, newline character behaves
8227 * as a paragraph separator.
8228 *
8229 * @param obj The given textblock object.
8230 * @return EINA_TRUE if in legacy mode, EINA_FALSE otherwise.
8231 * @since 1.1.0
8232 */
8233EAPI Eina_Bool evas_object_textblock_legacy_newline_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8234
8235
8236/**
8237 * Sets the tetxblock's text to the markup text.
8238 *
8239 * @note assumes text does not include the unicode object replacement char (0xFFFC)
8240 *
8241 * @param obj the textblock object.
8242 * @param text the markup text to use.
8243 * @return Return no value.
8244 */
8245EAPI void evas_object_textblock_text_markup_set(Evas_Object *obj, const char *text) EINA_ARG_NONNULL(1);
8246
8247/**
8248 * Prepends markup to the cursor cur.
8249 *
8250 * @note assumes text does not include the unicode object replacement char (0xFFFC)
8251 *
8252 * @param cur the cursor to prepend to.
8253 * @param text the markup text to prepend.
8254 * @return Return no value.
8255 */
8256EAPI void evas_object_textblock_text_markup_prepend(Evas_Textblock_Cursor *cur, const char *text) EINA_ARG_NONNULL(1, 2);
8257
8258/**
8259 * Return the markup of the object.
8260 *
8261 * @param obj the Evas object.
8262 * @return the markup text of the object.
8263 */
8264EAPI const char *evas_object_textblock_text_markup_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
8265
8266
8267/**
8268 * Return the object's main cursor.
8269 *
8270 * @param obj the object.
8271 * @return the obj's main cursor.
8272 */
8273EAPI Evas_Textblock_Cursor *evas_object_textblock_cursor_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8274
8275/**
8276 * Create a new cursor, associate it to the obj and init it to point
8277 * to the start of the textblock. Association to the object means the cursor
8278 * will be updated when the object will change.
8279 *
8280 * @note if you need speed and you know what you are doing, it's slightly faster to just allocate the cursor yourself and not associate it. (only people developing the actual object, and not users of the object).
8281 *
8282 * @param obj the object to associate to.
8283 * @return the new cursor.
8284 */
8285EAPI Evas_Textblock_Cursor *evas_object_textblock_cursor_new(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
8286
8287
8288/**
8289 * Free the cursor and unassociate it from the object.
8290 * @note do not use it to free unassociated cursors.
8291 *
8292 * @param cur the cursor to free.
8293 * @return Returns no value.
8294 */
8295EAPI void evas_textblock_cursor_free(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8296
8297
8298/**
8299 * Sets the cursor to the start of the first text node.
8300 *
8301 * @param cur the cursor to update.
8302 * @return Returns no value.
8303 */
8304EAPI void evas_textblock_cursor_paragraph_first(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8305
8306/**
8307 * sets the cursor to the end of the last text node.
8308 *
8309 * @param cur the cursor to set.
8310 * @return Returns no value.
8311 */
8312EAPI void evas_textblock_cursor_paragraph_last(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8313
8314/**
8315 * Advances to the start of the next text node
8316 *
8317 * @param cur the cursor to update
8318 * @return #EINA_TRUE if it managed to advance a paragraph, #EINA_FALSE otherwise.
8319 */
8320EAPI Eina_Bool evas_textblock_cursor_paragraph_next(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8321
8322/**
8323 * Advances to the end of the previous text node
8324 *
8325 * @param cur the cursor to update
8326 * @return #EINA_TRUE if it managed to advance a paragraph, #EINA_FALSE otherwise.
8327 */
8328EAPI Eina_Bool evas_textblock_cursor_paragraph_prev(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8329
8330/**
8331 * Returns the
8332 *
8333 * @param obj The evas, must not be NULL.
8334 * @param anchor the anchor name to get
8335 * @return Returns the list format node corresponding to the anchor, may be null if there are none.
8336 */
8337EAPI const Eina_List *evas_textblock_node_format_list_get(const Evas_Object *obj, const char *anchor) EINA_ARG_NONNULL(1, 2);
8338
8339/**
8340 * Returns the first format node.
8341 *
8342 * @param obj The evas, must not be NULL.
8343 * @return Returns the first format node, may be null if there are none.
8344 */
8345EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_node_format_first_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
8346
8347/**
8348 * Returns the last format node.
8349 *
8350 * @param obj The evas textblock, must not be NULL.
8351 * @return Returns the first format node, may be null if there are none.
8352 */
8353EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_node_format_last_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
8354
8355/**
8356 * Returns the next format node (after n)
8357 *
8358 * @param n the current format node - not null.
8359 * @return Returns the next format node, may be null.
8360 */
8361EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_node_format_next_get(const Evas_Object_Textblock_Node_Format *n) EINA_ARG_NONNULL(1);
8362
8363/**
8364 * Returns the prev format node (after n)
8365 *
8366 * @param n the current format node - not null.
8367 * @return Returns the prev format node, may be null.
8368 */
8369EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_node_format_prev_get(const Evas_Object_Textblock_Node_Format *n) EINA_ARG_NONNULL(1);
8370
8371/**
8372 * Remove a format node and it's match. i.e, removes a <tag> </tag> pair.
8373 * Assumes the node is the first part of <tag> i.e, this won't work if
8374 * n is a closing tag.
8375 *
8376 * @param obj the Evas object of the textblock - not null.
8377 * @param n the current format node - not null.
8378 */
8379EAPI void evas_textblock_node_format_remove_pair(Evas_Object *obj, Evas_Object_Textblock_Node_Format *n) EINA_ARG_NONNULL(1, 2);
8380
8381/**
8382 * Sets the cursor to point to the place where format points to.
8383 *
8384 * @param cur the cursor to update.
8385 * @param n the format node to update according.
8386 * @deprecated duplicate of evas_textblock_cursor_at_format_set
8387 */
8388EINA_DEPRECATED EAPI void evas_textblock_cursor_set_at_format(Evas_Textblock_Cursor *cur, const Evas_Object_Textblock_Node_Format *n) EINA_ARG_NONNULL(1, 2);
8389
8390/**
8391 * Return the format node at the position pointed by cur.
8392 *
8393 * @param cur the position to look at.
8394 * @return the format node if found, NULL otherwise.
8395 * @see evas_textblock_cursor_format_is_visible_get()
8396 */
8397EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_cursor_format_get(const Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8398
8399/**
8400 * Get the text format representation of the format node.
8401 *
8402 * @param fmt the format node.
8403 * @return the textual format of the format node.
8404 */
8405EAPI const char *evas_textblock_node_format_text_get(const Evas_Object_Textblock_Node_Format *fnode) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8406
8407/**
8408 * Set the cursor to point to the position of fmt.
8409 *
8410 * @param cur the cursor to update
8411 * @param fmt the format to update according to.
8412 */
8413EAPI void evas_textblock_cursor_at_format_set(Evas_Textblock_Cursor *cur, const Evas_Object_Textblock_Node_Format *fmt) EINA_ARG_NONNULL(1, 2);
8414
8415/**
8416 * Check if the current cursor position is a visible format. This way is more
8417 * efficient than evas_textblock_cursor_format_get() to check for the existence
8418 * of a visible format.
8419 *
8420 * @param cur the cursor to look at.
8421 * @return #EINA_TRUE if the cursor points to a visible format, #EINA_FALSE otherwise.
8422 * @see evas_textblock_cursor_format_get()
8423 */
8424EAPI Eina_Bool evas_textblock_cursor_format_is_visible_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8425
8426/**
8427 * Advances to the next format node
8428 *
8429 * @param cur the cursor to be updated.
8430 * @return #EINA_TRUE on success #EINA_FALSE otherwise.
8431 */
8432EAPI Eina_Bool evas_textblock_cursor_format_next(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8433
8434/**
8435 * Advances to the previous format node.
8436 *
8437 * @param cur the cursor to update.
8438 * @return #EINA_TRUE on success #EINA_FALSE otherwise.
8439 */
8440EAPI Eina_Bool evas_textblock_cursor_format_prev(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8441
8442/**
8443 * Returns true if the cursor points to a format.
8444 *
8445 * @param cur the cursor to check.
8446 * @return Returns #EINA_TRUE if a cursor points to a format #EINA_FALSE otherwise.
8447 */
8448EAPI Eina_Bool evas_textblock_cursor_is_format(const Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8449
8450/**
8451 * Advances 1 char forward.
8452 *
8453 * @param cur the cursor to advance.
8454 * @return #EINA_TRUE on success #EINA_FALSE otherwise.
8455 */
8456EAPI Eina_Bool evas_textblock_cursor_char_next(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8457
8458/**
8459 * Advances 1 char backward.
8460 *
8461 * @param cur the cursor to advance.
8462 * @return #EINA_TRUE on success #EINA_FALSE otherwise.
8463 */
8464EAPI Eina_Bool evas_textblock_cursor_char_prev(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8465
8466/**
8467 * Go to the first char in the node the cursor is pointing on.
8468 *
8469 * @param cur the cursor to update.
8470 * @return Returns no value.
8471 */
8472EAPI void evas_textblock_cursor_paragraph_char_first(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8473
8474/**
8475 * Go to the last char in a text node.
8476 *
8477 * @param cur the cursor to update.
8478 * @return Returns no value.
8479 */
8480EAPI void evas_textblock_cursor_paragraph_char_last(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8481
8482/**
8483 * Go to the start of the current line
8484 *
8485 * @param cur the cursor to update.
8486 * @return Returns no value.
8487 */
8488EAPI void evas_textblock_cursor_line_char_first(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8489
8490/**
8491 * Go to the end of the current line.
8492 *
8493 * @param cur the cursor to update.
8494 * @return Returns no value.
8495 */
8496EAPI void evas_textblock_cursor_line_char_last(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8497
8498/**
8499 * Return the current cursor pos.
8500 *
8501 * @param cur the cursor to take the position from.
8502 * @return the position or -1 on error
8503 */
8504EAPI int evas_textblock_cursor_pos_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8505
8506/**
8507 * Set the cursor pos.
8508 *
8509 * @param cur the cursor to be set.
8510 * @param pos the pos to set.
8511 */
8512EAPI void evas_textblock_cursor_pos_set(Evas_Textblock_Cursor *cur, int pos) EINA_ARG_NONNULL(1);
8513
8514/**
8515 * Go to the start of the line passed
8516 *
8517 * @param cur cursor to update.
8518 * @param line numer to set.
8519 * @return #EINA_TRUE on success, #EINA_FALSE on error.
8520 */
8521EAPI Eina_Bool evas_textblock_cursor_line_set(Evas_Textblock_Cursor *cur, int line) EINA_ARG_NONNULL(1);
8522
8523/**
8524 * Compare two cursors.
8525 *
8526 * @param cur1 the first cursor.
8527 * @param cur2 the second cursor.
8528 * @return -1 if cur1 < cur2, 0 if cur1 == cur2 and 1 otherwise.
8529 */
8530EAPI int evas_textblock_cursor_compare(const Evas_Textblock_Cursor *cur1, const Evas_Textblock_Cursor *cur2) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
8531
8532/**
8533 * Make cur_dest point to the same place as cur. Does not work if they don't
8534 * point to the same object.
8535 *
8536 * @param cur the source cursor.
8537 * @param cur_dest destination cursor.
8538 * @return Returns no value.
8539 */
8540EAPI void evas_textblock_cursor_copy(const Evas_Textblock_Cursor *cur, Evas_Textblock_Cursor *cur_dest) EINA_ARG_NONNULL(1, 2);
8541
8542
8543/**
8544 * Adds text to the current cursor position and set the cursor to *before*
8545 * the start of the text just added.
8546 *
8547 * @param cur the cursor to where to add text at.
8548 * @param _text the text to add.
8549 * @return Returns the len of the text added.
8550 * @see evas_textblock_cursor_text_prepend()
8551 */
8552EAPI int evas_textblock_cursor_text_append(Evas_Textblock_Cursor *cur, const char *text) EINA_ARG_NONNULL(1, 2);
8553
8554/**
8555 * Adds text to the current cursor position and set the cursor to *after*
8556 * the start of the text just added.
8557 *
8558 * @param cur the cursor to where to add text at.
8559 * @param _text the text to add.
8560 * @return Returns the len of the text added.
8561 * @see evas_textblock_cursor_text_append()
8562 */
8563EAPI int evas_textblock_cursor_text_prepend(Evas_Textblock_Cursor *cur, const char *text) EINA_ARG_NONNULL(1, 2);
8564
8565
8566/**
8567 * Adds format to the current cursor position. If the format being added is a
8568 * visible format, add it *before* the cursor position, otherwise, add it after.
8569 * This behavior is because visible formats are like characters and invisible
8570 * should be stacked in a way that the last one is added last.
8571 *
8572 * This function works with native formats, that means that style defined
8573 * tags like <br> won't work here. For those kind of things use markup prepend.
8574 *
8575 * @param cur the cursor to where to add format at.
8576 * @param format the format to add.
8577 * @return Returns true if a visible format was added, false otherwise.
8578 * @see evas_textblock_cursor_format_prepend()
8579 */
8580
8581/**
8582 * Check if the current cursor position points to the terminating null of the
8583 * last paragraph. (shouldn't be allowed to point to the terminating null of
8584 * any previous paragraph anyway.
8585 *
8586 * @param cur the cursor to look at.
8587 * @return #EINA_TRUE if the cursor points to the terminating null, #EINA_FALSE otherwise.
8588 */
8589EAPI Eina_Bool evas_textblock_cursor_format_append(Evas_Textblock_Cursor *cur, const char *format) EINA_ARG_NONNULL(1, 2);
8590
8591/**
8592 * Adds format to the current cursor position. If the format being added is a
8593 * visible format, add it *before* the cursor position, otherwise, add it after.
8594 * This behavior is because visible formats are like characters and invisible
8595 * should be stacked in a way that the last one is added last.
8596 * If the format is visible the cursor is advanced after it.
8597 *
8598 * This function works with native formats, that means that style defined
8599 * tags like <br> won't work here. For those kind of things use markup prepend.
8600 *
8601 * @param cur the cursor to where to add format at.
8602 * @param format the format to add.
8603 * @return Returns true if a visible format was added, false otherwise.
8604 * @see evas_textblock_cursor_format_prepend()
8605 */
8606EAPI Eina_Bool evas_textblock_cursor_format_prepend(Evas_Textblock_Cursor *cur, const char *format) EINA_ARG_NONNULL(1, 2);
8607
8608/**
8609 * Delete the character at the location of the cursor. If there's a format
8610 * pointing to this position, delete it as well.
8611 *
8612 * @param cur the cursor pointing to the current location.
8613 * @return Returns no value.
8614 */
8615EAPI void evas_textblock_cursor_char_delete(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8616
8617/**
8618 * Delete the range between cur1 and cur2.
8619 *
8620 * @param cur1 one side of the range.
8621 * @param cur2 the second side of the range
8622 * @return Returns no value.
8623 */
8624EAPI void evas_textblock_cursor_range_delete(Evas_Textblock_Cursor *cur1, Evas_Textblock_Cursor *cur2) EINA_ARG_NONNULL(1, 2);
8625
8626
8627/**
8628 * Return the text of the paragraph cur points to - returns the text in markup..
8629 *
8630 * @param cur the cursor pointing to the paragraph.
8631 * @return the text on success, NULL otherwise.
8632 */
8633EAPI const char *evas_textblock_cursor_paragraph_text_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8634
8635/**
8636 * Return the length of the paragraph, cheaper the eina_unicode_strlen()
8637 *
8638 * @param cur the position of the paragraph.
8639 * @return the length of the paragraph on success, -1 otehrwise.
8640 */
8641EAPI int evas_textblock_cursor_paragraph_text_length_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8642
8643/**
8644 * Return the currently visible range.
8645 *
8646 * @param start the start of the range.
8647 * @param end the end of the range.
8648 * @return EINA_TRUE on success. EINA_FALSE otherwise.
8649 * @since 1.1.0
8650 */
8651Eina_Bool evas_textblock_cursor_visible_range_get(Evas_Textblock_Cursor *start, Evas_Textblock_Cursor *end) EINA_ARG_NONNULL(1, 2);
8652
8653/**
8654 * Return the format nodes in the range between cur1 and cur2.
8655 *
8656 * @param cur1 one side of the range.
8657 * @param cur2 the other side of the range
8658 * @return the foramt nodes in the range. You have to free it.
8659 * @since 1.1.0
8660 */
8661EAPI Eina_List * evas_textblock_cursor_range_formats_get(const Evas_Textblock_Cursor *cur1, const Evas_Textblock_Cursor *cur2) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
8662
8663/**
8664 * Return the text in the range between cur1 and cur2
8665 *
8666 * @param cur1 one side of the range.
8667 * @param cur2 the other side of the range
8668 * @param format The form on which to return the text. Markup - in textblock markup. Plain - UTF8.
8669 * @return the text in the range
8670 * @see elm_entry_markup_to_utf8()
8671 */
8672EAPI char *evas_textblock_cursor_range_text_get(const Evas_Textblock_Cursor *cur1, const Evas_Textblock_Cursor *cur2, Evas_Textblock_Text_Type format) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
8673
8674/**
8675 * Return the content of the cursor.
8676 *
8677 * @param cur the cursor
8678 * @return the text in the range
8679 */
8680EAPI char *evas_textblock_cursor_content_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
8681
8682
8683/**
8684 * Returns the geometry of the cursor. Depends on the type of cursor requested.
8685 * This should be used instead of char_geometry_get because there are weird
8686 * special cases with BiDi text.
8687 * in '_' cursor mode (i.e a line below the char) it's the same as char_geometry
8688 * get, except for the case of the last char of a line which depends on the
8689 * paragraph direction.
8690 *
8691 * in '|' cursor mode (i.e a line between two chars) it is very varyable.
8692 * For example consider the following visual string:
8693 * "abcCBA" (ABC are rtl chars), a cursor pointing on A should actually draw
8694 * a '|' between the c and the C.
8695 *
8696 * @param cur the cursor.
8697 * @param cx the x of the cursor
8698 * @param cy the y of the cursor
8699 * @param cw the width of the cursor
8700 * @param ch the height of the cursor
8701 * @param dir the direction of the cursor, can be NULL.
8702 * @param ctype the type of the cursor.
8703 * @return line number of the char on success, -1 on error.
8704 */
8705EAPI int evas_textblock_cursor_geometry_get(const Evas_Textblock_Cursor *cur, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch, Evas_BiDi_Direction *dir, Evas_Textblock_Cursor_Type ctype) EINA_ARG_NONNULL(1);
8706
8707/**
8708 * Returns the geometry of the char at cur.
8709 *
8710 * @param cur the position of the char.
8711 * @param cx the x of the char.
8712 * @param cy the y of the char.
8713 * @param cw the w of the char.
8714 * @param ch the h of the char.
8715 * @return line number of the char on success, -1 on error.
8716 */
8717EAPI int evas_textblock_cursor_char_geometry_get(const Evas_Textblock_Cursor *cur, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch) EINA_ARG_NONNULL(1);
8718
8719/**
8720 * Returns the geometry of the pen at cur.
8721 *
8722 * @param cur the position of the char.
8723 * @param cpen_x the pen_x of the char.
8724 * @param cy the y of the char.
8725 * @param cadv the adv of the char.
8726 * @param ch the h of the char.
8727 * @return line number of the char on success, -1 on error.
8728 */
8729EAPI int evas_textblock_cursor_pen_geometry_get(const Evas_Textblock_Cursor *cur, Evas_Coord *cpen_x, Evas_Coord *cy, Evas_Coord *cadv, Evas_Coord *ch) EINA_ARG_NONNULL(1);
8730
8731/**
8732 * Returns the geometry of the line at cur.
8733 *
8734 * @param cur the position of the line.
8735 * @param cx the x of the line.
8736 * @param cy the y of the line.
8737 * @param cw the width of the line.
8738 * @param ch the height of the line.
8739 * @return line number of the line on success, -1 on error.
8740 */
8741EAPI int evas_textblock_cursor_line_geometry_get(const Evas_Textblock_Cursor *cur, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch) EINA_ARG_NONNULL(1);
8742
8743/**
8744 * Set the position of the cursor according to the X and Y coordinates.
8745 *
8746 * @param cur the cursor to set.
8747 * @param x coord to set by.
8748 * @param y coord to set by.
8749 * @return #EINA_TRUE on success, #EINA_FALSE otherwise.
8750 */
8751EAPI Eina_Bool evas_textblock_cursor_char_coord_set(Evas_Textblock_Cursor *cur, Evas_Coord x, Evas_Coord y) EINA_ARG_NONNULL(1);
8752
8753/**
8754 * Set the cursor position according to the y coord.
8755 *
8756 * @param cur the cur to be set.
8757 * @param y the coord to set by.
8758 * @return the line number found, -1 on error.
8759 */
8760EAPI int evas_textblock_cursor_line_coord_set(Evas_Textblock_Cursor *cur, Evas_Coord y) EINA_ARG_NONNULL(1);
8761
8762/**
8763 * Get the geometry of a range.
8764 *
8765 * @param cur1 one side of the range.
8766 * @param cur2 other side of the range.
8767 * @return a list of Rectangles representing the geometry of the range.
8768 */
8769EAPI Eina_List *evas_textblock_cursor_range_geometry_get(const Evas_Textblock_Cursor *cur1, const Evas_Textblock_Cursor *cur2) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
8770 EAPI Eina_Bool evas_textblock_cursor_format_item_geometry_get(const Evas_Textblock_Cursor *cur, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch) EINA_ARG_NONNULL(1);
8771
8772
8773/**
8774 * Checks if the cursor points to the end of the line.
8775 *
8776 * @param cur the cursor to check.
8777 * @return #EINA_TRUE if true, #EINA_FALSE otherwise.
8778 */
8779EAPI Eina_Bool evas_textblock_cursor_eol_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
8780
8781
8782/**
8783 * Get the geometry of a line number.
8784 *
8785 * @param obj the object.
8786 * @param line the line number.
8787 * @param cx x coord of the line.
8788 * @param cy y coord of the line.
8789 * @param cw w coord of the line.
8790 * @param ch h coord of the line.
8791 * @return #EINA_TRUE on success, #EINA_FALSE otherwise.
8792 */
8793EAPI Eina_Bool evas_object_textblock_line_number_geometry_get(const Evas_Object *obj, int line, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch) EINA_ARG_NONNULL(1);
8794
8795/**
8796 * Clear the textblock object.
8797 * @note Does *NOT* free the Evas object itself.
8798 *
8799 * @param obj the object to clear.
8800 * @return nothing.
8801 */
8802EAPI void evas_object_textblock_clear(Evas_Object *obj) EINA_ARG_NONNULL(1);
8803
8804/**
8805 * Get the formatted width and height. This calculates the actual size after restricting
8806 * the textblock to the current size of the object.
8807 * The main difference between this and @ref evas_object_textblock_size_native_get
8808 * is that the "native" function does not wrapping into account
8809 * it just calculates the real width of the object if it was placed on an
8810 * infinite canvas, while this function gives the size after wrapping
8811 * according to the size restrictions of the object.
8812 *
8813 * For example for a textblock containing the text: "You shall not pass!"
8814 * with no margins or padding and assuming a monospace font and a size of
8815 * 7x10 char widths (for simplicity) has a native size of 19x1
8816 * and a formatted size of 5x4.
8817 *
8818 *
8819 * @param obj the Evas object.
8820 * @param w[out] the width of the object.
8821 * @param h[out] the height of the object
8822 * @return Returns no value.
8823 * @see evas_object_textblock_size_native_get
8824 */
8825EAPI void evas_object_textblock_size_formatted_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
8826
8827/**
8828 * Get the native width and height. This calculates the actual size without taking account
8829 * the current size of the object.
8830 * The main difference between this and @ref evas_object_textblock_size_formatted_get
8831 * is that the "native" function does not take wrapping into account
8832 * it just calculates the real width of the object if it was placed on an
8833 * infinite canvas, while the "formatted" function gives the size after
8834 * wrapping text according to the size restrictions of the object.
8835 *
8836 * For example for a textblock containing the text: "You shall not pass!"
8837 * with no margins or padding and assuming a monospace font and a size of
8838 * 7x10 char widths (for simplicity) has a native size of 19x1
8839 * and a formatted size of 5x4.
8840 *
8841 * @param obj the Evas object of the textblock
8842 * @param w[out] the width returned
8843 * @param h[out] the height returned
8844 * @return Returns no value.
8845 */
8846EAPI void evas_object_textblock_size_native_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
8847 EAPI void evas_object_textblock_style_insets_get(const Evas_Object *obj, Evas_Coord *l, Evas_Coord *r, Evas_Coord *t, Evas_Coord *b) EINA_ARG_NONNULL(1);
8848/**
8849 * @}
8850 */
8851
8852/**
8853 * @defgroup Evas_Line_Group Line Object Functions
8854 *
8855 * Functions used to deal with evas line objects.
8856 *
8857 * @ingroup Evas_Object_Specific
8858 *
8859 * @{
8860 */
8861
8862/**
8863 * Adds a new evas line object to the given evas.
8864 * @param e The given evas.
8865 * @return The new evas line object.
8866 */
8867EAPI Evas_Object *evas_object_line_add (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
8868
8869/**
8870 * Sets the coordinates of the end points of the given evas line object.
8871 * @param obj The given evas line object.
8872 * @param x1 The X coordinate of the first point.
8873 * @param y1 The Y coordinate of the first point.
8874 * @param x2 The X coordinate of the second point.
8875 * @param y2 The Y coordinate of the second point.
8876 */
8877EAPI void evas_object_line_xy_set (Evas_Object *obj, Evas_Coord x1, Evas_Coord y1, Evas_Coord x2, Evas_Coord y2);
8878
8879/**
8880 * Retrieves the coordinates of the end points of the given evas line object.
8881 * @param obj The given line object.
8882 * @param x1 Pointer to an integer in which to store the X coordinate of the
8883 * first end point.
8884 * @param y1 Pointer to an integer in which to store the Y coordinate of the
8885 * first end point.
8886 * @param x2 Pointer to an integer in which to store the X coordinate of the
8887 * second end point.
8888 * @param y2 Pointer to an integer in which to store the Y coordinate of the
8889 * second end point.
8890 */
8891EAPI void evas_object_line_xy_get (const Evas_Object *obj, Evas_Coord *x1, Evas_Coord *y1, Evas_Coord *x2, Evas_Coord *y2);
8892/**
8893 * @}
8894 */
8895
8896/**
8897 * @defgroup Evas_Object_Polygon Polygon Object Functions
8898 *
8899 * Functions that operate on evas polygon objects.
8900 *
8901 * Hint: as evas does not provide ellipse, smooth paths or circle, one
8902 * can calculate points and convert these to a polygon.
8903 *
8904 * @ingroup Evas_Object_Specific
8905 *
8906 * @{
8907 */
8908
8909/**
8910 * Adds a new evas polygon object to the given evas.
8911 * @param e The given evas.
8912 * @return A new evas polygon object.
8913 */
8914EAPI Evas_Object *evas_object_polygon_add (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
8915
8916/**
8917 * Adds the given point to the given evas polygon object.
8918 * @param obj The given evas polygon object.
8919 * @param x The X coordinate of the given point.
8920 * @param y The Y coordinate of the given point.
8921 * @ingroup Evas_Polygon_Group
8922 */
8923EAPI void evas_object_polygon_point_add (Evas_Object *obj, Evas_Coord x, Evas_Coord y) EINA_ARG_NONNULL(1);
8924
8925/**
8926 * Removes all of the points from the given evas polygon object.
8927 * @param obj The given polygon object.
8928 */
8929EAPI void evas_object_polygon_points_clear (Evas_Object *obj) EINA_ARG_NONNULL(1);
8930/**
8931 * @}
8932 */
8933
8934/**
8935 * @defgroup Evas_Smart_Group Smart Functions
8936 *
8937 * Functions that deal with #Evas_Smart structs, creating definition
8938 * (classes) of objects that will have customized behavior for methods
8939 * like evas_object_move(), evas_object_resize(),
8940 * evas_object_clip_set() and others.
8941 *
8942 * These objects will accept the generic methods defined in @ref
8943 * Evas_Object_Group and the extensions defined in @ref
8944 * Evas_Smart_Object_Group. There are a couple of existent smart
8945 * objects in Evas itself (see @ref Evas_Object_Box, @ref
8946 * Evas_Object_Table and @ref Evas_Smart_Object_Clipped).
8947 *
8948 * See also some @ref Example_Evas_Smart_Objects "examples" of this
8949 * group of functions.
8950 */
8951
8952/**
8953 * @addtogroup Evas_Smart_Group
8954 * @{
8955 */
8956
8957/**
8958 * @def EVAS_SMART_CLASS_VERSION
8959 *
8960 * The version you have to put into the version field in the
8961 * #Evas_Smart_Class struct. Used to safeguard from binaries with old
8962 * smart object intefaces running with newer ones.
8963 *
8964 * @ingroup Evas_Smart_Group
8965 */
8966#define EVAS_SMART_CLASS_VERSION 4
8967/**
8968 * @struct _Evas_Smart_Class
8969 *
8970 * A smart object's @b base class definition
8971 *
8972 * @ingroup Evas_Smart_Group
8973 */
8974struct _Evas_Smart_Class
8975{
8976 const char *name; /**< the name string of the class */
8977 int version;
8978 void (*add) (Evas_Object *o); /**< code to be run when adding object to a canvas */
8979 void (*del) (Evas_Object *o); /**< code to be run when removing object to a canvas */
8980 void (*move) (Evas_Object *o, Evas_Coord x, Evas_Coord y); /**< code to be run when moving object on a canvas */
8981 void (*resize) (Evas_Object *o, Evas_Coord w, Evas_Coord h); /**< code to be run when resizing object on a canvas */
8982 void (*show) (Evas_Object *o); /**< code to be run when showing object on a canvas */
8983 void (*hide) (Evas_Object *o); /**< code to be run when hiding object on a canvas */
8984 void (*color_set) (Evas_Object *o, int r, int g, int b, int a); /**< code to be run when setting color of object on a canvas */
8985 void (*clip_set) (Evas_Object *o, Evas_Object *clip); /**< code to be run when setting clipper of object on a canvas */
8986 void (*clip_unset) (Evas_Object *o); /**< code to be run when unsetting clipper of object on a canvas */
8987 void (*calculate) (Evas_Object *o); /**< code to be run when object has rendering updates on a canvas */
8988 void (*member_add) (Evas_Object *o, Evas_Object *child); /**< code to be run when child member is added to object */
8989 void (*member_del) (Evas_Object *o, Evas_Object *child); /**< code to be run when child member is removed from object */
8990
8991 const Evas_Smart_Class *parent; /**< this class inherits from this parent */
8992 const Evas_Smart_Cb_Description *callbacks; /**< callbacks at this level, @c NULL terminated */
8993 void *interfaces; /**< to be used in a future near you */
8994 const void *data;
8995};
8996
8997/**
8998 * @struct _Evas_Smart_Cb_Description
8999 *
9000 * Describes a callback issued by a smart object
9001 * (evas_object_smart_callback_call()), as defined in its smart object
9002 * class. This is particularly useful to explain to end users and
9003 * their code (i.e., introspection) what the parameter @c event_info
9004 * will point to.
9005 *
9006 * @ingroup Evas_Smart_Group
9007 */
9008struct _Evas_Smart_Cb_Description
9009{
9010 const char *name; /**< callback name ("changed", for example) */
9011
9012 /**
9013 * @brief Hint on the type of @c event_info parameter's contents on
9014 * a #Evas_Smart_Cb callback.
9015 *
9016 * The type string uses the pattern similar to
9017 * http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-signatures,
9018 * but extended to optionally include variable names within
9019 * brackets preceding types. Example:
9020 *
9021 * @li Structure with two integers:
9022 * @c "(ii)"
9023 *
9024 * @li Structure called 'x' with two integers named 'a' and 'b':
9025 * @c "[x]([a]i[b]i)"
9026 *
9027 * @li Array of integers:
9028 * @c "ai"
9029 *
9030 * @li Array called 'x' of struct with two integers:
9031 * @c "[x]a(ii)"
9032 *
9033 * @note This type string is used as a hint and is @b not validated
9034 * or enforced in any way. Implementors should make the best
9035 * use of it to help bindings, documentation and other users
9036 * of introspection features.
9037 */
9038 const char *type;
9039};
9040
9041/**
9042 * @def EVAS_SMART_CLASS_INIT_NULL
9043 * Initializer to zero a whole Evas_Smart_Class structure.
9044 *
9045 * @see EVAS_SMART_CLASS_INIT_VERSION
9046 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
9047 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
9048 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
9049 * @ingroup Evas_Smart_Group
9050 */
9051#define EVAS_SMART_CLASS_INIT_NULL {NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
9052
9053/**
9054 * @def EVAS_SMART_CLASS_INIT_VERSION
9055 * Initializer to zero a whole Evas_Smart_Class structure and set version.
9056 *
9057 * Similar to EVAS_SMART_CLASS_INIT_NULL, but will set version field to
9058 * latest EVAS_SMART_CLASS_VERSION.
9059 *
9060 * @see EVAS_SMART_CLASS_INIT_NULL
9061 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
9062 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
9063 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
9064 * @ingroup Evas_Smart_Group
9065 */
9066#define EVAS_SMART_CLASS_INIT_VERSION {NULL, EVAS_SMART_CLASS_VERSION, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
9067
9068/**
9069 * @def EVAS_SMART_CLASS_INIT_NAME_VERSION
9070 * Initializer to zero a whole Evas_Smart_Class structure and set name
9071 * and version.
9072 *
9073 * Similar to EVAS_SMART_CLASS_INIT_NULL, but will set version field to
9074 * latest EVAS_SMART_CLASS_VERSION and name to the specified value.
9075 *
9076 * It will keep a reference to name field as a "const char *", that is,
9077 * name must be available while the structure is used (hint: static or global!)
9078 * and will not be modified.
9079 *
9080 * @see EVAS_SMART_CLASS_INIT_NULL
9081 * @see EVAS_SMART_CLASS_INIT_VERSION
9082 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
9083 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
9084 * @ingroup Evas_Smart_Group
9085 */
9086#define EVAS_SMART_CLASS_INIT_NAME_VERSION(name) {name, EVAS_SMART_CLASS_VERSION, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
9087
9088/**
9089 * @def EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
9090 * Initializer to zero a whole Evas_Smart_Class structure and set name,
9091 * version and parent class.
9092 *
9093 * Similar to EVAS_SMART_CLASS_INIT_NULL, but will set version field to
9094 * latest EVAS_SMART_CLASS_VERSION, name to the specified value and
9095 * parent class.
9096 *
9097 * It will keep a reference to name field as a "const char *", that is,
9098 * name must be available while the structure is used (hint: static or global!)
9099 * and will not be modified. Similarly, parent reference will be kept.
9100 *
9101 * @see EVAS_SMART_CLASS_INIT_NULL
9102 * @see EVAS_SMART_CLASS_INIT_VERSION
9103 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
9104 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
9105 * @ingroup Evas_Smart_Group
9106 */
9107#define EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT(name, parent) {name, EVAS_SMART_CLASS_VERSION, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, parent, NULL, NULL}
9108
9109/**
9110 * @def EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
9111 * Initializer to zero a whole Evas_Smart_Class structure and set name,
9112 * version, parent class and callbacks definition.
9113 *
9114 * Similar to EVAS_SMART_CLASS_INIT_NULL, but will set version field to
9115 * latest EVAS_SMART_CLASS_VERSION, name to the specified value, parent
9116 * class and callbacks at this level.
9117 *
9118 * It will keep a reference to name field as a "const char *", that is,
9119 * name must be available while the structure is used (hint: static or global!)
9120 * and will not be modified. Similarly, parent and callbacks reference
9121 * will be kept.
9122 *
9123 * @see EVAS_SMART_CLASS_INIT_NULL
9124 * @see EVAS_SMART_CLASS_INIT_VERSION
9125 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
9126 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
9127 * @ingroup Evas_Smart_Group
9128 */
9129#define EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS(name, parent, callbacks) {name, EVAS_SMART_CLASS_VERSION, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, parent, callbacks, NULL}
9130
9131/**
9132 * @def EVAS_SMART_SUBCLASS_NEW
9133 *
9134 * Convenience macro to subclass a given Evas smart class.
9135 *
9136 * @param smart_name The name used for the smart class. e.g:
9137 * @c "Evas_Object_Box".
9138 * @param prefix Prefix used for all variables and functions defined
9139 * and referenced by this macro.
9140 * @param api_type Type of the structure used as API for the smart
9141 * class. Either #Evas_Smart_Class or something derived from it.
9142 * @param parent_type Type of the parent class API.
9143 * @param parent_func Function that gets the parent class. e.g:
9144 * evas_object_box_smart_class_get().
9145 * @param cb_desc Array of callback descriptions for this smart class.
9146 *
9147 * This macro saves some typing when writing a smart class derived
9148 * from another one. In order to work, the user @b must provide some
9149 * functions adhering to the following guidelines:
9150 * - @<prefix@>_smart_set_user(): the @b internal @c _smart_set
9151 * function (defined by this macro) will call this one, provided by
9152 * the user, after inheriting everything from the parent, which
9153 * should <b>take care of setting the right member functions for
9154 * the class</b>, both overrides and extensions, if any.
9155 * - If this new class should be subclassable as well, a @b public @c
9156 * _smart_set() function is desirable to fill in the class used as
9157 * parent by the children. It's up to the user to provide this
9158 * interface, which will most likely call @<prefix@>_smart_set() to
9159 * get the job done.
9160 *
9161 * After the macro's usage, the following will be defined for use:
9162 * - @<prefix@>_parent_sc: A pointer to the @b parent smart
9163 * class. When calling parent functions from overloaded ones, use
9164 * this global variable.
9165 * - @<prefix@>_smart_class_new(): this function returns the
9166 * #Evas_Smart needed to create smart objects with this class,
9167 * which should be passed to evas_object_smart_add().
9168 *
9169 * @warning @p smart_name has to be a pointer to a globally available
9170 * string! The smart class created here will just have a pointer set
9171 * to that, and all object instances will depend on it for smart class
9172 * name lookup.
9173 *
9174 * @ingroup Evas_Smart_Group
9175 */
9176#define EVAS_SMART_SUBCLASS_NEW(smart_name, prefix, api_type, parent_type, parent_func, cb_desc) \
9177 static const parent_type * prefix##_parent_sc = NULL; \
9178 static void prefix##_smart_set_user(api_type *api); \
9179 static void prefix##_smart_set(api_type *api) \
9180 { \
9181 Evas_Smart_Class *sc; \
9182 if (!(sc = (Evas_Smart_Class *)api)) \
9183 return; \
9184 if (!prefix##_parent_sc) \
9185 prefix##_parent_sc = parent_func(); \
9186 evas_smart_class_inherit(sc, (const Evas_Smart_Class *)prefix##_parent_sc); \
9187 prefix##_smart_set_user(api); \
9188 } \
9189 static Evas_Smart * prefix##_smart_class_new(void) \
9190 { \
9191 static Evas_Smart *smart = NULL; \
9192 static api_type api; \
9193 if (!smart) \
9194 { \
9195 Evas_Smart_Class *sc = (Evas_Smart_Class *)&api; \
9196 memset(&api, 0, sizeof(api_type)); \
9197 sc->version = EVAS_SMART_CLASS_VERSION; \
9198 sc->name = smart_name; \
9199 sc->callbacks = cb_desc; \
9200 prefix##_smart_set(&api); \
9201 smart = evas_smart_class_new(sc); \
9202 } \
9203 return smart; \
9204 }
9205
9206/**
9207 * @def EVAS_SMART_DATA_ALLOC
9208 *
9209 * Convenience macro to allocate smart data only if needed.
9210 *
9211 * When writing a subclassable smart object, the @c .add() function
9212 * will need to check if the smart private data was already allocated
9213 * by some child object or not. This macro makes it easier to do it.
9214 *
9215 * @note This is an idiom used when one calls the parent's @c. add()
9216 * after the specialized code. Naturally, the parent's base smart data
9217 * has to be contemplated as the specialized one's first member, for
9218 * things to work.
9219 *
9220 * @param o Evas object passed to the @c .add() function
9221 * @param priv_type The type of the data to allocate
9222 *
9223 * @ingroup Evas_Smart_Group
9224 */
9225#define EVAS_SMART_DATA_ALLOC(o, priv_type) \
9226 priv_type *priv; \
9227 priv = evas_object_smart_data_get(o); \
9228 if (!priv) { \
9229 priv = (priv_type *)calloc(1, sizeof(priv_type)); \
9230 if (!priv) return; \
9231 evas_object_smart_data_set(o, priv); \
9232 }
9233
9234
9235/**
9236 * Free an #Evas_Smart struct
9237 *
9238 * @param s the #Evas_Smart struct to free
9239 *
9240 * @warning If this smart handle was created using
9241 * evas_smart_class_new(), the associated #Evas_Smart_Class will not
9242 * be freed.
9243 *
9244 * @note If you're using the #EVAS_SMART_SUBCLASS_NEW schema to create your
9245 * smart object, note that an #Evas_Smart handle will be shared amongst all
9246 * instances of the given smart class, through a static variable.
9247 * Evas will internally count references on #Evas_Smart handles and free them
9248 * when they are not referenced anymore. Thus, this function is of no use
9249 * for Evas users, most probably.
9250 */
9251EAPI void evas_smart_free (Evas_Smart *s) EINA_ARG_NONNULL(1);
9252
9253/**
9254 * Creates a new #Evas_Smart from a given #Evas_Smart_Class struct
9255 *
9256 * @param sc the smart class definition
9257 * @return a new #Evas_Smart pointer
9258 *
9259 * #Evas_Smart handles are necessary to create new @b instances of
9260 * smart objects belonging to the class described by @p sc. That
9261 * handle will contain, besides the smart class interface definition,
9262 * all its smart callbacks infrastructure set, too.
9263 *
9264 * @note If you are willing to subclass a given smart class to
9265 * construct yours, consider using the #EVAS_SMART_SUBCLASS_NEW macro,
9266 * which will make use of this function automatically for you.
9267 */
9268EAPI Evas_Smart *evas_smart_class_new (const Evas_Smart_Class *sc) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
9269
9270/**
9271 * Get the #Evas_Smart_Class handle of an #Evas_Smart struct
9272 *
9273 * @param s a valid #Evas_Smart pointer
9274 * @return the #Evas_Smart_Class in it
9275 */
9276EAPI const Evas_Smart_Class *evas_smart_class_get (const Evas_Smart *s) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
9277
9278
9279/**
9280 * @brief Get the data pointer set on an #Evas_Smart struct
9281 *
9282 * @param s a valid #Evas_Smart handle
9283 *
9284 * This data pointer is set as the data field in the #Evas_Smart_Class
9285 * passed in to evas_smart_class_new().
9286 */
9287EAPI void *evas_smart_data_get (const Evas_Smart *s) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
9288
9289/**
9290 * Get the smart callbacks known by this #Evas_Smart handle's smart
9291 * class hierarchy.
9292 *
9293 * @param s A valid #Evas_Smart handle.
9294 * @param[out] count Returns the number of elements in the returned
9295 * array.
9296 * @return The array with callback descriptions known by this smart
9297 * class, with its size returned in @a count parameter. It
9298 * should not be modified in any way. If no callbacks are
9299 * known, @c NULL is returned. The array is sorted by event
9300 * names and elements refer to the original values given to
9301 * evas_smart_class_new()'s #Evas_Smart_Class::callbacks
9302 * (pointer to them).
9303 *
9304 * This is likely different from
9305 * evas_object_smart_callbacks_descriptions_get() as it will contain
9306 * the callbacks of @b all this class hierarchy sorted, while the
9307 * direct smart class member refers only to that specific class and
9308 * should not include parent's.
9309 *
9310 * If no callbacks are known, this function returns @c NULL.
9311 *
9312 * The array elements and thus their contents will be @b references to
9313 * original values given to evas_smart_class_new() as
9314 * Evas_Smart_Class::callbacks.
9315 *
9316 * The array is sorted by Evas_Smart_Cb_Description::name. The last
9317 * array element is a @c NULL pointer and is not accounted for in @a
9318 * count. Loop iterations can check any of these size indicators.
9319 *
9320 * @note objects may provide per-instance callbacks, use
9321 * evas_object_smart_callbacks_descriptions_get() to get those
9322 * as well.
9323 * @see evas_object_smart_callbacks_descriptions_get()
9324 */
9325EAPI const Evas_Smart_Cb_Description **evas_smart_callbacks_descriptions_get(const Evas_Smart *s, unsigned int *count) EINA_ARG_NONNULL(1, 1);
9326
9327
9328/**
9329 * Find a callback description for the callback named @a name.
9330 *
9331 * @param s The #Evas_Smart where to search for class registered smart
9332 * event callbacks.
9333 * @param name Name of the desired callback, which must @b not be @c
9334 * NULL. The search has a special case for @a name being the
9335 * same pointer as registered with #Evas_Smart_Cb_Description.
9336 * One can use it to avoid excessive use of strcmp().
9337 * @return A reference to the description if found, or @c NULL, otherwise
9338 *
9339 * @see evas_smart_callbacks_descriptions_get()
9340 */
9341EAPI const Evas_Smart_Cb_Description *evas_smart_callback_description_find(const Evas_Smart *s, const char *name) EINA_ARG_NONNULL(1, 2) EINA_PURE;
9342
9343
9344/**
9345 * Sets one class to inherit from the other.
9346 *
9347 * Copy all function pointers, set @c parent to @a parent_sc and copy
9348 * everything after sizeof(Evas_Smart_Class) present in @a parent_sc,
9349 * using @a parent_sc_size as reference.
9350 *
9351 * This is recommended instead of a single memcpy() since it will take
9352 * care to not modify @a sc name, version, callbacks and possible
9353 * other members.
9354 *
9355 * @param sc child class.
9356 * @param parent_sc parent class, will provide attributes.
9357 * @param parent_sc_size size of parent_sc structure, child should be at least
9358 * this size. Everything after @c Evas_Smart_Class size is copied
9359 * using regular memcpy().
9360 */
9361EAPI Eina_Bool evas_smart_class_inherit_full (Evas_Smart_Class *sc, const Evas_Smart_Class *parent_sc, unsigned int parent_sc_size) EINA_ARG_NONNULL(1, 2);
9362
9363/**
9364 * Get the number of users of the smart instance
9365 *
9366 * @param s The Evas_Smart to get the usage count of
9367 * @return The number of uses of the smart instance
9368 *
9369 * This function tells you how many more uses of the smart instance are in
9370 * existence. This should be used before freeing/clearing any of the
9371 * Evas_Smart_Class that was used to create the smart instance. The smart
9372 * instance will refer to data in the Evas_Smart_Class used to create it and
9373 * thus you cannot remove the original data until all users of it are gone.
9374 * When the usage count goes to 0, you can evas_smart_free() the smart
9375 * instance @p s and remove from memory any of the Evas_Smart_Class that
9376 * was used to create the smart instance, if you desire. Removing it from
9377 * memory without doing this will cause problems (crashes, undefined
9378 * behavior etc. etc.), so either never remove the original
9379 * Evas_Smart_Class data from memory (have it be a constant structure and
9380 * data), or use this API call and be very careful.
9381 */
9382EAPI int evas_smart_usage_get(const Evas_Smart *s);
9383
9384 /**
9385 * @def evas_smart_class_inherit
9386 * Easy to use version of evas_smart_class_inherit_full().
9387 *
9388 * This version will use sizeof(parent_sc), copying everything.
9389 *
9390 * @param sc child class, will have methods copied from @a parent_sc
9391 * @param parent_sc parent class, will provide contents to be copied.
9392 * @return 1 on success, 0 on failure.
9393 * @ingroup Evas_Smart_Group
9394 */
9395#define evas_smart_class_inherit(sc, parent_sc) evas_smart_class_inherit_full(sc, parent_sc, sizeof(*parent_sc))
9396
9397/**
9398 * @}
9399 */
9400
9401/**
9402 * @defgroup Evas_Smart_Object_Group Smart Object Functions
9403 *
9404 * Functions dealing with Evas smart objects (instances).
9405 *
9406 * Smart objects are groupings of primitive Evas objects that behave
9407 * as a cohesive group. For instance, a file manager icon may be a
9408 * smart object composed of an image object, a text label and two
9409 * rectangles that appear behind the image and text when the icon is
9410 * selected. As a smart object, the normal Evas object API could be
9411 * used on the icon object.
9412 *
9413 * Besides that, generally smart objects implement a <b>specific
9414 * API</b>, so that users interect with its own custom features. The
9415 * API takes form of explicit exported functions one may call and
9416 * <b>smart callbacks</b>.
9417 *
9418 * @section Evas_Smart_Object_Group_Callbacks Smart events and callbacks
9419 *
9420 * Smart objects can elect events (smart events, from now on) ocurring
9421 * inside of them to be reported back to their users via callback
9422 * functions (smart callbacks). This way, you can extend Evas' own
9423 * object events. They are defined by an <b>event string</b>, which
9424 * identifies them uniquely. There's also a function prototype
9425 * definition for the callback functions: #Evas_Smart_Cb.
9426 *
9427 * When defining an #Evas_Smart_Class, smart object implementors are
9428 * strongly encorauged to properly set the Evas_Smart_Class::callbacks
9429 * callbacks description array, so that the users of the smart object
9430 * can have introspection on its events API <b>at run time</b>.
9431 *
9432 * See some @ref Example_Evas_Smart_Objects "examples" of this group
9433 * of functions.
9434 *
9435 * @see @ref Evas_Smart_Group for class definitions.
9436 */
9437
9438/**
9439 * @addtogroup Evas_Smart_Object_Group
9440 * @{
9441 */
9442
9443/**
9444 * Instantiates a new smart object described by @p s.
9445 *
9446 * @param e the canvas on which to add the object
9447 * @param s the #Evas_Smart describing the smart object
9448 * @return a new #Evas_Object handle
9449 *
9450 * This is the function one should use when defining the public
9451 * function @b adding an instance of the new smart object to a given
9452 * canvas. It will take care of setting all of its internals to work
9453 * as they should, if the user set things properly, as seem on the
9454 * #EVAS_SMART_SUBCLASS_NEW, for example.
9455 *
9456 * @ingroup Evas_Smart_Object_Group
9457 */
9458EAPI Evas_Object *evas_object_smart_add (Evas *e, Evas_Smart *s) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_MALLOC;
9459
9460/**
9461 * Set an Evas object as a member of a given smart object.
9462 *
9463 * @param obj The member object
9464 * @param smart_obj The smart object
9465 *
9466 * Members will automatically be stacked and layered together with the
9467 * smart object. The various stacking functions will operate on
9468 * members relative to the other members instead of the entire canvas,
9469 * since they now live on an exclusive layer (see
9470 * evas_object_stack_above(), for more details).
9471 *
9472 * Any @p smart_obj object's specific implementation of the @c
9473 * member_add() smart function will take place too, naturally.
9474 *
9475 * @see evas_object_smart_member_del()
9476 * @see evas_object_smart_members_get()
9477 *
9478 * @ingroup Evas_Smart_Object_Group
9479 */
9480EAPI void evas_object_smart_member_add (Evas_Object *obj, Evas_Object *smart_obj) EINA_ARG_NONNULL(1, 2);
9481
9482/**
9483 * Removes a member object from a given smart object.
9484 *
9485 * @param obj the member object
9486 * @ingroup Evas_Smart_Object_Group
9487 *
9488 * This removes a member object from a smart object, if it was added
9489 * to any. The object will still be on the canvas, but no longer
9490 * associated with whichever smart object it was associated with.
9491 *
9492 * @see evas_object_smart_member_add() for more details
9493 * @see evas_object_smart_members_get()
9494 */
9495EAPI void evas_object_smart_member_del (Evas_Object *obj) EINA_ARG_NONNULL(1);
9496
9497/**
9498 * Retrieves the list of the member objects of a given Evas smart
9499 * object
9500 *
9501 * @param obj the smart object to get members from
9502 * @return Returns the list of the member objects of @p obj.
9503 *
9504 * The returned list should be freed with @c eina_list_free() when you
9505 * no longer need it.
9506 *
9507 * @see evas_object_smart_member_add()
9508 * @see evas_object_smart_member_del()
9509*/
9510EAPI Eina_List *evas_object_smart_members_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
9511
9512/**
9513 * Gets the parent smart object of a given Evas object, if it has one.
9514 *
9515 * @param obj the Evas object you want to get the parent smart object
9516 * from
9517 * @return Returns the parent smart object of @a obj or @c NULL, if @a
9518 * obj is not a smart member of any
9519 *
9520 * @ingroup Evas_Smart_Object_Group
9521 */
9522EAPI Evas_Object *evas_object_smart_parent_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
9523
9524/**
9525 * Checks whether a given smart object or any of its smart object
9526 * parents is of a given smart class.
9527 *
9528 * @param obj An Evas smart object to check the type of
9529 * @param type The @b name (type) of the smart class to check for
9530 * @return @c EINA_TRUE, if @a obj or any of its parents is of type @a
9531 * type, @c EINA_FALSE otherwise
9532 *
9533 * If @p obj is not a smart object, this call will fail
9534 * immediately. Otherwise, make sure evas_smart_class_inherit() or its
9535 * sibling functions were used correctly when creating the smart
9536 * object's class, so it has a valid @b parent smart class pointer
9537 * set.
9538 *
9539 * The checks use smart classes names and <b>string
9540 * comparison</b>. There is a version of this same check using
9541 * <b>pointer comparison</b>, since a smart class' name is a single
9542 * string in Evas.
9543 *
9544 * @see evas_object_smart_type_check_ptr()
9545 * @see #EVAS_SMART_SUBCLASS_NEW
9546 *
9547 * @ingroup Evas_Smart_Object_Group
9548 */
9549EAPI Eina_Bool evas_object_smart_type_check (const Evas_Object *obj, const char *type) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
9550
9551/**
9552 * Checks whether a given smart object or any of its smart object
9553 * parents is of a given smart class, <b>using pointer comparison</b>.
9554 *
9555 * @param obj An Evas smart object to check the type of
9556 * @param type The type (name string) to check for. Must be the name
9557 * @return @c EINA_TRUE, if @a obj or any of its parents is of type @a
9558 * type, @c EINA_FALSE otherwise
9559 *
9560 * @see evas_object_smart_type_check() for more details
9561 *
9562 * @ingroup Evas_Smart_Object_Group
9563 */
9564EAPI Eina_Bool evas_object_smart_type_check_ptr (const Evas_Object *obj, const char *type) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
9565
9566/**
9567 * Get the #Evas_Smart from which @p obj smart object was created.
9568 *
9569 * @param obj a smart object
9570 * @return the #Evas_Smart handle or @c NULL, on errors
9571 *
9572 * @ingroup Evas_Smart_Object_Group
9573 */
9574EAPI Evas_Smart *evas_object_smart_smart_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
9575
9576/**
9577 * Retrieve user data stored on a given smart object.
9578 *
9579 * @param obj The smart object's handle
9580 * @return A pointer to data stored using
9581 * evas_object_smart_data_set(), or @c NULL, if none has been
9582 * set.
9583 *
9584 * @see evas_object_smart_data_set()
9585 *
9586 * @ingroup Evas_Smart_Object_Group
9587 */
9588EAPI void *evas_object_smart_data_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
9589
9590/**
9591 * Store a pointer to user data for a given smart object.
9592 *
9593 * @param obj The smart object's handle
9594 * @param data A pointer to user data
9595 *
9596 * This data is stored @b independently of the one set by
9597 * evas_object_data_set(), naturally.
9598 *
9599 * @see evas_object_smart_data_get()
9600 *
9601 * @ingroup Evas_Smart_Object_Group
9602 */
9603EAPI void evas_object_smart_data_set (Evas_Object *obj, void *data) EINA_ARG_NONNULL(1);
9604
9605/**
9606 * Add (register) a callback function to the smart event specified by
9607 * @p event on the smart object @p obj.
9608 *
9609 * @param obj a smart object
9610 * @param event the event's name string
9611 * @param func the callback function
9612 * @param data user data to be passed to the callback function
9613 *
9614 * Smart callbacks look very similar to Evas callbacks, but are
9615 * implemented as smart object's custom ones.
9616 *
9617 * This function adds a function callback to an smart object when the
9618 * event named @p event occurs in it. The function is @p func.
9619 *
9620 * In the event of a memory allocation error during addition of the
9621 * callback to the object, evas_alloc_error() should be used to
9622 * determine the nature of the error, if any, and the program should
9623 * sensibly try and recover.
9624 *
9625 * A smart callback function must have the ::Evas_Smart_Cb prototype
9626 * definition. The first parameter (@p data) in this definition will
9627 * have the same value passed to evas_object_smart_callback_add() as
9628 * the @p data parameter, at runtime. The second parameter @p obj is a
9629 * handle to the object on which the event occurred. The third
9630 * parameter, @p event_info, is a pointer to data which is totally
9631 * dependent on the smart object's implementation and semantic for the
9632 * given event.
9633 *
9634 * There is an infrastructure for introspection on smart objects'
9635 * events (see evas_smart_callbacks_descriptions_get()), but no
9636 * internal smart objects on Evas implement them yet.
9637 *
9638 * @see @ref Evas_Smart_Object_Group_Callbacks for more details.
9639 *
9640 * @see evas_object_smart_callback_del()
9641 * @ingroup Evas_Smart_Object_Group
9642 */
9643EAPI void evas_object_smart_callback_add (Evas_Object *obj, const char *event, Evas_Smart_Cb func, const void *data) EINA_ARG_NONNULL(1, 2, 3);
9644
9645/**
9646 * Add (register) a callback function to the smart event specified by
9647 * @p event on the smart object @p obj. Except for the priority field,
9648 * it's exactly the same as @ref evas_object_smart_callback_add
9649 *
9650 * @param obj a smart object
9651 * @param event the event's name string
9652 * @param priority The priority of the callback, lower values called first.
9653 * @param func the callback function
9654 * @param data user data to be passed to the callback function
9655 *
9656 * @see evas_object_smart_callback_add
9657 * @since 1.1.0
9658 * @ingroup Evas_Smart_Object_Group
9659 */
9660EAPI void evas_object_smart_callback_priority_add(Evas_Object *obj, const char *event, Evas_Callback_Priority priority, Evas_Smart_Cb func, const void *data);
9661
9662/**
9663 * Delete (unregister) a callback function from the smart event
9664 * specified by @p event on the smart object @p obj.
9665 *
9666 * @param obj a smart object
9667 * @param event the event's name string
9668 * @param func the callback function
9669 * @return the data pointer
9670 *
9671 * This function removes <b>the first</b> added smart callback on the
9672 * object @p obj matching the event name @p event and the registered
9673 * function pointer @p func. If the removal is successful it will also
9674 * return the data pointer that was passed to
9675 * evas_object_smart_callback_add() (that will be the same as the
9676 * parameter) when the callback(s) was(were) added to the canvas. If
9677 * not successful @c NULL will be returned.
9678 *
9679 * @see evas_object_smart_callback_add() for more details.
9680 *
9681 * @ingroup Evas_Smart_Object_Group
9682 */
9683EAPI void *evas_object_smart_callback_del (Evas_Object *obj, const char *event, Evas_Smart_Cb func) EINA_ARG_NONNULL(1, 2, 3);
9684
9685/**
9686 * Call a given smart callback on the smart object @p obj.
9687 *
9688 * @param obj the smart object
9689 * @param event the event's name string
9690 * @param event_info pointer to an event specific struct or information to
9691 * pass to the callback functions registered on this smart event
9692 *
9693 * This should be called @b internally, from the smart object's own
9694 * code, when some specific event has occurred and the implementor
9695 * wants is to pertain to the object's events API (see @ref
9696 * Evas_Smart_Object_Group_Callbacks). The documentation for the smart
9697 * object should include a list of possible events and what type of @p
9698 * event_info to expect for each of them. Also, when defining an
9699 * #Evas_Smart_Class, smart object implementors are strongly
9700 * encorauged to properly set the Evas_Smart_Class::callbacks
9701 * callbacks description array, so that the users of the smart object
9702 * can have introspection on its events API <b>at run time</b>.
9703 *
9704 * @ingroup Evas_Smart_Object_Group
9705 */
9706EAPI void evas_object_smart_callback_call (Evas_Object *obj, const char *event, void *event_info) EINA_ARG_NONNULL(1, 2);
9707
9708
9709/**
9710 * Set an smart object @b instance's smart callbacks descriptions.
9711 *
9712 * @param obj A smart object
9713 * @param descriptions @c NULL terminated array with
9714 * #Evas_Smart_Cb_Description descriptions. Array elements won't be
9715 * modified at run time, but references to them and their contents
9716 * will be made, so this array should be kept alive during the whole
9717 * object's lifetime.
9718 * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
9719 *
9720 * These descriptions are hints to be used by introspection and are
9721 * not enforced in any way.
9722 *
9723 * It will not be checked if instance callbacks descriptions have the
9724 * same name as respective possibly registered in the smart object
9725 * @b class. Both are kept in different arrays and users of
9726 * evas_object_smart_callbacks_descriptions_get() should handle this
9727 * case as they wish.
9728 *
9729 * @note Becase @p descriptions must be @c NULL terminated, and
9730 * because a @c NULL name makes little sense, too,
9731 * Evas_Smart_Cb_Description::name must @b not be @c NULL.
9732 *
9733 * @note While instance callbacks descriptions are possible, they are
9734 * @b not recommended. Use @b class callbacks descriptions
9735 * instead as they make you smart object user's life simpler and
9736 * will use less memory, as descriptions and arrays will be
9737 * shared among all instances.
9738 *
9739 * @ingroup Evas_Smart_Object_Group
9740 */
9741EAPI Eina_Bool evas_object_smart_callbacks_descriptions_set(Evas_Object *obj, const Evas_Smart_Cb_Description *descriptions) EINA_ARG_NONNULL(1);
9742
9743/**
9744 * Retrieve an smart object's know smart callback descriptions (both
9745 * instance and class ones).
9746 *
9747 * @param obj The smart object to get callback descriptions from.
9748 * @param class_descriptions Where to store class callbacks
9749 * descriptions array, if any is known. If no descriptions are
9750 * known, @c NULL is returned
9751 * @param class_count Returns how many class callbacks descriptions
9752 * are known.
9753 * @param instance_descriptions Where to store instance callbacks
9754 * descriptions array, if any is known. If no descriptions are
9755 * known, @c NULL is returned.
9756 * @param instance_count Returns how many instance callbacks
9757 * descriptions are known.
9758 *
9759 * This call searchs for registered callback descriptions for both
9760 * instance and class of the given smart object. These arrays will be
9761 * sorted by Evas_Smart_Cb_Description::name and also @c NULL
9762 * terminated, so both @a class_count and @a instance_count can be
9763 * ignored, if the caller wishes so. The terminator @c NULL is not
9764 * counted in these values.
9765 *
9766 * @note If just class descriptions are of interest, try
9767 * evas_smart_callbacks_descriptions_get() instead.
9768 *
9769 * @note Use @c NULL pointers on the descriptions/counters you're not
9770 * interested in: they'll be ignored by the function.
9771 *
9772 * @see evas_smart_callbacks_descriptions_get()
9773 *
9774 * @ingroup Evas_Smart_Object_Group
9775 */
9776EAPI void evas_object_smart_callbacks_descriptions_get(const Evas_Object *obj, const Evas_Smart_Cb_Description ***class_descriptions, unsigned int *class_count, const Evas_Smart_Cb_Description ***instance_descriptions, unsigned int *instance_count) EINA_ARG_NONNULL(1);
9777
9778/**
9779 * Find callback description for callback called @a name.
9780 *
9781 * @param obj the smart object.
9782 * @param name name of desired callback, must @b not be @c NULL. The
9783 * search have a special case for @a name being the same
9784 * pointer as registered with Evas_Smart_Cb_Description, one
9785 * can use it to avoid excessive use of strcmp().
9786 * @param class_description pointer to return class description or @c
9787 * NULL if not found. If parameter is @c NULL, no search will
9788 * be done on class descriptions.
9789 * @param instance_description pointer to return instance description
9790 * or @c NULL if not found. If parameter is @c NULL, no search
9791 * will be done on instance descriptions.
9792 * @return reference to description if found, @c NULL if not found.
9793 */
9794EAPI void evas_object_smart_callback_description_find(const Evas_Object *obj, const char *name, const Evas_Smart_Cb_Description **class_description, const Evas_Smart_Cb_Description **instance_description) EINA_ARG_NONNULL(1, 2);
9795
9796
9797/**
9798 * Mark smart object as changed, dirty.
9799 *
9800 * @param obj The given Evas smart object
9801 *
9802 * This will flag the given object as needing recalculation,
9803 * forcefully. As an effect, on the next rendering cycle it's @b
9804 * calculate() (see #Evas_Smart_Class) smart function will be called.
9805 *
9806 * @see evas_object_smart_need_recalculate_set().
9807 * @see evas_object_smart_calculate().
9808 *
9809 * @ingroup Evas_Smart_Object_Group
9810 */
9811EAPI void evas_object_smart_changed (Evas_Object *obj) EINA_ARG_NONNULL(1);
9812
9813/**
9814 * Set or unset the flag signalling that a given smart object needs to
9815 * get recalculated.
9816 *
9817 * @param obj the smart object
9818 * @param value whether one wants to set (@c EINA_TRUE) or to unset
9819 * (@c EINA_FALSE) the flag.
9820 *
9821 * If this flag is set, then the @c calculate() smart function of @p
9822 * obj will be called, if one is provided, during rendering phase of
9823 * Evas (see evas_render()), after which this flag will be
9824 * automatically unset.
9825 *
9826 * If that smart function is not provided for the given object, this
9827 * flag will be left unchanged.
9828 *
9829 * @note just setting this flag will not make the canvas' whole scene
9830 * dirty, by itself, and evas_render() will have no effect. To
9831 * force that, use evas_object_smart_changed(), that will also
9832 * automatically call this function automatically, with @c
9833 * EINA_TRUE as parameter.
9834 *
9835 * @see evas_object_smart_need_recalculate_get()
9836 * @see evas_object_smart_calculate()
9837 * @see evas_smart_objects_calculate()
9838 *
9839 * @ingroup Evas_Smart_Object_Group
9840 */
9841EAPI void evas_object_smart_need_recalculate_set(Evas_Object *obj, Eina_Bool value) EINA_ARG_NONNULL(1);
9842
9843/**
9844 * Get the value of the flag signalling that a given smart object needs to
9845 * get recalculated.
9846 *
9847 * @param obj the smart object
9848 * @return if flag is set or not.
9849 *
9850 * @note this flag will be unset during the rendering phase, when the
9851 * @c calculate() smart function is called, if one is provided.
9852 * If it's not provided, then the flag will be left unchanged
9853 * after the rendering phase.
9854 *
9855 * @see evas_object_smart_need_recalculate_set(), for more details
9856 *
9857 * @ingroup Evas_Smart_Object_Group
9858 */
9859EAPI Eina_Bool evas_object_smart_need_recalculate_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
9860
9861/**
9862 * Call the @b calculate() smart function immediataly on a given smart
9863 * object.
9864 *
9865 * @param obj the smart object's handle
9866 *
9867 * This will force immediate calculations (see #Evas_Smart_Class)
9868 * needed for renderization of this object and, besides, unset the
9869 * flag on it telling it needs recalculation for the next rendering
9870 * phase.
9871 *
9872 * @see evas_object_smart_need_recalculate_set()
9873 *
9874 * @ingroup Evas_Smart_Object_Group
9875 */
9876EAPI void evas_object_smart_calculate (Evas_Object *obj) EINA_ARG_NONNULL(1);
9877
9878/**
9879 * Call user-provided @c calculate() smart functions and unset the
9880 * flag signalling that the object needs to get recalculated to @b all
9881 * smart objects in the canvas.
9882 *
9883 * @param e The canvas to calculate all smart objects in
9884 *
9885 * @see evas_object_smart_need_recalculate_set()
9886 *
9887 * @ingroup Evas_Smart_Object_Group
9888 */
9889EAPI void evas_smart_objects_calculate (Evas *e);
9890
9891/**
9892 * This gets the internal counter that counts the number of smart calculations
9893 *
9894 * @param e The canvas to get the calculate counter from
9895 *
9896 * Whenever evas performs smart object calculations on the whole canvas
9897 * it increments a counter by 1. This is the smart object calculate counter
9898 * that this function returns the value of. It starts at the value of 0 and
9899 * will increase (and eventually wrap around to negative values and so on) by
9900 * 1 every time objects are calculated. You can use this counter to ensure
9901 * you dont re-do calculations withint the same calculation generation/run
9902 * if the calculations maybe cause self-feeding effects.
9903 *
9904 * @ingroup Evas_Smart_Object_Group
9905 * @since 1.1
9906 */
9907EAPI int evas_smart_objects_calculate_count_get (const Evas *e);
9908
9909/**
9910 * Moves all children objects of a given smart object relative to a
9911 * given offset.
9912 *
9913 * @param obj the smart object.
9914 * @param dx horizontal offset (delta).
9915 * @param dy vertical offset (delta).
9916 *
9917 * This will make each of @p obj object's children to move, from where
9918 * they before, with those delta values (offsets) on both directions.
9919 *
9920 * @note This is most useful on custom smart @c move() functions.
9921 *
9922 * @note Clipped smart objects already make use of this function on
9923 * their @c move() smart function definition.
9924 */
9925EAPI void evas_object_smart_move_children_relative(Evas_Object *obj, Evas_Coord dx, Evas_Coord dy) EINA_ARG_NONNULL(1);
9926
9927/**
9928 * @}
9929 */
9930
9931/**
9932 * @defgroup Evas_Smart_Object_Clipped Clipped Smart Object
9933 *
9934 * Clipped smart object is a base to construct other smart objects
9935 * based on the concept of having an internal clipper that is applied
9936 * to all children objects. This clipper will control the visibility,
9937 * clipping and color of sibling objects (remember that the clipping
9938 * is recursive, and clipper color modulates the color of its
9939 * clippees). By default, this base will also move children relatively
9940 * to the parent, and delete them when parent is deleted. In other
9941 * words, it is the base for simple object grouping.
9942 *
9943 * See some @ref Example_Evas_Smart_Objects "examples" of this group
9944 * of functions.
9945 *
9946 * @see evas_object_smart_clipped_smart_set()
9947 *
9948 * @ingroup Evas_Smart_Object_Group
9949 */
9950
9951/**
9952 * @addtogroup Evas_Smart_Object_Clipped
9953 * @{
9954 */
9955
9956/**
9957 * Every subclass should provide this at the beginning of their own
9958 * data set with evas_object_smart_data_set().
9959 */
9960 typedef struct _Evas_Object_Smart_Clipped_Data Evas_Object_Smart_Clipped_Data;
9961 struct _Evas_Object_Smart_Clipped_Data
9962 {
9963 Evas_Object *clipper;
9964 Evas *evas;
9965 };
9966
9967
9968/**
9969 * Get the clipper object for the given clipped smart object.
9970 *
9971 * @param obj the clipped smart object to retrieve associated clipper
9972 * from.
9973 * @return the clipper object.
9974 *
9975 * Use this function if you want to change any of this clipper's
9976 * properties, like colors.
9977 *
9978 * @see evas_object_smart_clipped_smart_add()
9979 */
9980EAPI Evas_Object *evas_object_smart_clipped_clipper_get (Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
9981
9982/**
9983 * Set a given smart class' callbacks so it implements the <b>clipped smart
9984 * object"</b>'s interface.
9985 *
9986 * @param sc The smart class handle to operate on
9987 *
9988 * This call will assign all the required methods of the @p sc
9989 * #Evas_Smart_Class instance to the implementations set for clipped
9990 * smart objects. If one wants to "subclass" it, call this function
9991 * and then override desired values. If one wants to call any original
9992 * method, save it somewhere. Example:
9993 *
9994 * @code
9995 * static Evas_Smart_Class parent_sc = EVAS_SMART_CLASS_INIT_NULL;
9996 *
9997 * static void my_class_smart_add(Evas_Object *o)
9998 * {
9999 * parent_sc.add(o);
10000 * evas_object_color_set(evas_object_smart_clipped_clipper_get(o),
10001 * 255, 0, 0, 255);
10002 * }
10003 *
10004 * Evas_Smart_Class *my_class_new(void)
10005 * {
10006 * static Evas_Smart_Class sc = EVAS_SMART_CLASS_INIT_NAME_VERSION("MyClass");
10007 * if (!parent_sc.name)
10008 * {
10009 * evas_object_smart_clipped_smart_set(&sc);
10010 * parent_sc = sc;
10011 * sc.add = my_class_smart_add;
10012 * }
10013 * return &sc;
10014 * }
10015 * @endcode
10016 *
10017 * Default behavior for each of #Evas_Smart_Class functions on a
10018 * clipped smart object are:
10019 * - @c add: creates a hidden clipper with "infinite" size, to clip
10020 * any incoming members;
10021 * - @c del: delete all children objects;
10022 * - @c move: move all objects relative relatively;
10023 * - @c resize: <b>not defined</b>;
10024 * - @c show: if there are children objects, show clipper;
10025 * - @c hide: hides clipper;
10026 * - @c color_set: set the color of clipper;
10027 * - @c clip_set: set clipper of clipper;
10028 * - @c clip_unset: unset the clipper of clipper;
10029 *
10030 * @note There are other means of assigning parent smart classes to
10031 * child ones, like the #EVAS_SMART_SUBCLASS_NEW macro or the
10032 * evas_smart_class_inherit_full() function.
10033 */
10034EAPI void evas_object_smart_clipped_smart_set (Evas_Smart_Class *sc) EINA_ARG_NONNULL(1);
10035
10036/**
10037 * Get a pointer to the <b>clipped smart object's</b> class, to use
10038 * for proper inheritance
10039 *
10040 * @see #Evas_Smart_Object_Clipped for more information on this smart
10041 * class
10042 */
10043EAPI const Evas_Smart_Class *evas_object_smart_clipped_class_get (void) EINA_CONST;
10044
10045/**
10046 * @}
10047 */
10048
10049/**
10050 * @defgroup Evas_Object_Box Box Smart Object
10051 *
10052 * A box is a convenience smart object that packs children inside it
10053 * in @b sequence, using a layouting function specified by the
10054 * user. There are a couple of pre-made layouting functions <b>built-in
10055 * in Evas</b>, all of them using children size hints to define their
10056 * size and alignment inside their cell space.
10057 *
10058 * Examples on this smart object's usage:
10059 * - @ref Example_Evas_Box
10060 * - @ref Example_Evas_Size_Hints
10061 *
10062 * @see @ref Evas_Object_Group_Size_Hints
10063 *
10064 * @ingroup Evas_Smart_Object_Group
10065 */
10066
10067/**
10068 * @addtogroup Evas_Object_Box
10069 * @{
10070 */
10071
10072/**
10073 * @typedef Evas_Object_Box_Api
10074 *
10075 * Smart class extension, providing extra box object requirements.
10076 *
10077 * @ingroup Evas_Object_Box
10078 */
10079 typedef struct _Evas_Object_Box_Api Evas_Object_Box_Api;
10080
10081/**
10082 * @typedef Evas_Object_Box_Data
10083 *
10084 * Smart object instance data, providing box object requirements.
10085 *
10086 * @ingroup Evas_Object_Box
10087 */
10088 typedef struct _Evas_Object_Box_Data Evas_Object_Box_Data;
10089
10090/**
10091 * @typedef Evas_Object_Box_Option
10092 *
10093 * The base structure for a box option. Box options are a way of
10094 * extending box items properties, which will be taken into account
10095 * for layouting decisions. The box layouting functions provided by
10096 * Evas will only rely on objects' canonical size hints to layout
10097 * them, so the basic box option has @b no (custom) property set.
10098 *
10099 * Users creating their own layouts, but not depending on extra child
10100 * items' properties, would be fine just using
10101 * evas_object_box_layout_set(). But if one desires a layout depending
10102 * on extra child properties, he/she has to @b subclass the box smart
10103 * object. Thus, by using evas_object_box_smart_class_get() and
10104 * evas_object_box_smart_set(), the @c option_new() and @c
10105 * option_free() smart class functions should be properly
10106 * redefined/extended.
10107 *
10108 * Object properties are bound to an integer identifier and must have
10109 * a name string. Their values are open to any data. See the API on
10110 * option properties for more details.
10111 *
10112 * @ingroup Evas_Object_Box
10113 */
10114 typedef struct _Evas_Object_Box_Option Evas_Object_Box_Option;
10115
10116/**
10117 * @typedef Evas_Object_Box_Layout
10118 *
10119 * Function signature for an Evas box object layouting routine. By
10120 * @a o it will be passed the box object in question, by @a priv it will
10121 * be passed the box's internal data and, by @a user_data, it will be
10122 * passed any custom data one could have set to a given box layouting
10123 * function, with evas_object_box_layout_set().
10124 *
10125 * @ingroup Evas_Object_Box
10126 */
10127 typedef void (*Evas_Object_Box_Layout) (Evas_Object *o, Evas_Object_Box_Data *priv, void *user_data);
10128
10129/**
10130 * @def EVAS_OBJECT_BOX_API_VERSION
10131 *
10132 * Current version for Evas box object smart class, a value which goes
10133 * to _Evas_Object_Box_Api::version.
10134 *
10135 * @ingroup Evas_Object_Box
10136 */
10137#define EVAS_OBJECT_BOX_API_VERSION 1
10138
10139/**
10140 * @struct _Evas_Object_Box_Api
10141 *
10142 * This structure should be used by any smart class inheriting from
10143 * the box's one, to provide custom box behavior which could not be
10144 * achieved only by providing a layout function, with
10145 * evas_object_box_layout_set().
10146 *
10147 * @extends Evas_Smart_Class
10148 * @ingroup Evas_Object_Box
10149 */
10150 struct _Evas_Object_Box_Api
10151 {
10152 Evas_Smart_Class base; /**< Base smart class struct, need for all smart objects */
10153 int version; /**< Version of this smart class definition */
10154 Evas_Object_Box_Option *(*append) (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child); /**< Smart function to append child elements in boxes */
10155 Evas_Object_Box_Option *(*prepend) (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child); /**< Smart function to prepend child elements in boxes */
10156 Evas_Object_Box_Option *(*insert_before) (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child, const Evas_Object *reference); /**< Smart function to insert a child element before another in boxes */
10157 Evas_Object_Box_Option *(*insert_after) (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child, const Evas_Object *reference); /**< Smart function to insert a child element after another in boxes */
10158 Evas_Object_Box_Option *(*insert_at) (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child, unsigned int pos); /**< Smart function to insert a child element at a given positon on boxes */
10159 Evas_Object *(*remove) (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child); /**< Smart function to remove a child element from boxes */
10160 Evas_Object *(*remove_at) (Evas_Object *o, Evas_Object_Box_Data *priv, unsigned int pos); /**< Smart function to remove a child element from boxes, by its position */
10161 Eina_Bool (*property_set) (Evas_Object *o, Evas_Object_Box_Option *opt, int property, va_list args); /**< Smart function to set a custom property on a box child */
10162 Eina_Bool (*property_get) (Evas_Object *o, Evas_Object_Box_Option *opt, int property, va_list args); /**< Smart function to retrieve a custom property from a box child */
10163 const char *(*property_name_get)(Evas_Object *o, int property); /**< Smart function to get the name of a custom property of box children */
10164 int (*property_id_get) (Evas_Object *o, const char *name); /**< Smart function to get the numerical ID of a custom property of box children */
10165 Evas_Object_Box_Option *(*option_new) (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child); /**< Smart function to create a new box option struct */
10166 void (*option_free) (Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object_Box_Option *opt); /**< Smart function to delete a box option struct */
10167 };
10168
10169/**
10170 * @def EVAS_OBJECT_BOX_API_INIT
10171 *
10172 * Initializer for a whole #Evas_Object_Box_Api structure, with
10173 * @c NULL values on its specific fields.
10174 *
10175 * @param smart_class_init initializer to use for the "base" field
10176 * (#Evas_Smart_Class).
10177 *
10178 * @see EVAS_SMART_CLASS_INIT_NULL
10179 * @see EVAS_SMART_CLASS_INIT_VERSION
10180 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
10181 * @see EVAS_OBJECT_BOX_API_INIT_NULL
10182 * @see EVAS_OBJECT_BOX_API_INIT_VERSION
10183 * @see EVAS_OBJECT_BOX_API_INIT_NAME_VERSION
10184 * @ingroup Evas_Object_Box
10185 */
10186#define EVAS_OBJECT_BOX_API_INIT(smart_class_init) {smart_class_init, EVAS_OBJECT_BOX_API_VERSION, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
10187
10188/**
10189 * @def EVAS_OBJECT_BOX_API_INIT_NULL
10190 *
10191 * Initializer to zero out a whole #Evas_Object_Box_Api structure.
10192 *
10193 * @see EVAS_OBJECT_BOX_API_INIT_VERSION
10194 * @see EVAS_OBJECT_BOX_API_INIT_NAME_VERSION
10195 * @see EVAS_OBJECT_BOX_API_INIT
10196 * @ingroup Evas_Object_Box
10197 */
10198#define EVAS_OBJECT_BOX_API_INIT_NULL EVAS_OBJECT_BOX_API_INIT(EVAS_SMART_CLASS_INIT_NULL)
10199
10200/**
10201 * @def EVAS_OBJECT_BOX_API_INIT_VERSION
10202 *
10203 * Initializer to zero out a whole #Evas_Object_Box_Api structure and
10204 * set a specific version on it.
10205 *
10206 * This is similar to #EVAS_OBJECT_BOX_API_INIT_NULL, but it will set
10207 * the version field of #Evas_Smart_Class (base field) to the latest
10208 * #EVAS_SMART_CLASS_VERSION.
10209 *
10210 * @see EVAS_OBJECT_BOX_API_INIT_NULL
10211 * @see EVAS_OBJECT_BOX_API_INIT_NAME_VERSION
10212 * @see EVAS_OBJECT_BOX_API_INIT
10213 * @ingroup Evas_Object_Box
10214 */
10215#define EVAS_OBJECT_BOX_API_INIT_VERSION EVAS_OBJECT_BOX_API_INIT(EVAS_SMART_CLASS_INIT_VERSION)
10216
10217/**
10218 * @def EVAS_OBJECT_BOX_API_INIT_NAME_VERSION
10219 *
10220 * Initializer to zero out a whole #Evas_Object_Box_Api structure and
10221 * set its name and version.
10222 *
10223 * This is similar to #EVAS_OBJECT_BOX_API_INIT_NULL, but it will also
10224 * set the version field of #Evas_Smart_Class (base field) to the
10225 * latest #EVAS_SMART_CLASS_VERSION and name it to the specific value.
10226 *
10227 * It will keep a reference to the name field as a <c>"const char *"</c>,
10228 * i.e., the name must be available while the structure is
10229 * used (hint: static or global variable!) and must not be modified.
10230 *
10231 * @see EVAS_OBJECT_BOX_API_INIT_NULL
10232 * @see EVAS_OBJECT_BOX_API_INIT_VERSION
10233 * @see EVAS_OBJECT_BOX_API_INIT
10234 * @ingroup Evas_Object_Box
10235 */
10236#define EVAS_OBJECT_BOX_API_INIT_NAME_VERSION(name) EVAS_OBJECT_BOX_API_INIT(EVAS_SMART_CLASS_INIT_NAME_VERSION(name))
10237
10238/**
10239 * @struct _Evas_Object_Box_Data
10240 *
10241 * This structure augments clipped smart object's instance data,
10242 * providing extra members required by generic box implementation. If
10243 * a subclass inherits from #Evas_Object_Box_Api, then it may augment
10244 * #Evas_Object_Box_Data to fit its own needs.
10245 *
10246 * @extends Evas_Object_Smart_Clipped_Data
10247 * @ingroup Evas_Object_Box
10248 */
10249 struct _Evas_Object_Box_Data
10250 {
10251 Evas_Object_Smart_Clipped_Data base;
10252 const Evas_Object_Box_Api *api;
10253 struct {
10254 double h, v;
10255 } align;
10256 struct {
10257 Evas_Coord h, v;
10258 } pad;
10259 Eina_List *children;
10260 struct {
10261 Evas_Object_Box_Layout cb;
10262 void *data;
10263 void (*free_data)(void *data);
10264 } layout;
10265 Eina_Bool layouting : 1;
10266 Eina_Bool children_changed : 1;
10267 };
10268
10269 struct _Evas_Object_Box_Option
10270 {
10271 Evas_Object *obj; /**< Pointer to the box child object, itself */
10272 Eina_Bool max_reached:1;
10273 Eina_Bool min_reached:1;
10274 Evas_Coord alloc_size;
10275 }; /**< #Evas_Object_Box_Option struct fields */
10276
10277/**
10278 * Set the default box @a api struct (Evas_Object_Box_Api)
10279 * with the default values. May be used to extend that API.
10280 *
10281 * @param api The box API struct to set back, most probably with
10282 * overriden fields (on class extensions scenarios)
10283 */
10284EAPI void evas_object_box_smart_set (Evas_Object_Box_Api *api) EINA_ARG_NONNULL(1);
10285
10286/**
10287 * Get the Evas box smart class, for inheritance purposes.
10288 *
10289 * @return the (canonical) Evas box smart class.
10290 *
10291 * The returned value is @b not to be modified, just use it as your
10292 * parent class.
10293 */
10294EAPI const Evas_Object_Box_Api *evas_object_box_smart_class_get (void) EINA_CONST;
10295
10296/**
10297 * Set a new layouting function to a given box object
10298 *
10299 * @param o The box object to operate on.
10300 * @param cb The new layout function to set on @p o.
10301 * @param data Data pointer to be passed to @p cb.
10302 * @param free_data Function to free @p data, if need be.
10303 *
10304 * A box layout function affects how a box object displays child
10305 * elements within its area. The list of pre-defined box layouts
10306 * available in Evas is:
10307 * - evas_object_box_layout_horizontal()
10308 * - evas_object_box_layout_vertical()
10309 * - evas_object_box_layout_homogeneous_horizontal()
10310 * - evas_object_box_layout_homogeneous_vertical()
10311 * - evas_object_box_layout_homogeneous_max_size_horizontal()
10312 * - evas_object_box_layout_homogeneous_max_size_vertical()
10313 * - evas_object_box_layout_flow_horizontal()
10314 * - evas_object_box_layout_flow_vertical()
10315 * - evas_object_box_layout_stack()
10316 *
10317 * Refer to each of their documentation texts for details on them.
10318 *
10319 * @note A box layouting function will be triggered by the @c
10320 * 'calculate' smart callback of the box's smart class.
10321 */
10322EAPI void evas_object_box_layout_set (Evas_Object *o, Evas_Object_Box_Layout cb, const void *data, void (*free_data)(void *data)) EINA_ARG_NONNULL(1, 2);
10323
10324/**
10325 * Add a new box object on the provided canvas.
10326 *
10327 * @param evas The canvas to create the box object on.
10328 * @return @c NULL on error, a pointer to a new box object on
10329 * success.
10330 *
10331 * After instantiation, if a box object hasn't its layout function
10332 * set, via evas_object_box_layout_set(), it will have it by default
10333 * set to evas_object_box_layout_horizontal(). The remaining
10334 * properties of the box must be set/retrieved via
10335 * <c>evas_object_box_{h,v}_{align,padding}_{get,set)()</c>.
10336 */
10337EAPI Evas_Object *evas_object_box_add (Evas *evas) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
10338
10339/**
10340 * Add a new box as a @b child of a given smart object.
10341 *
10342 * @param parent The parent smart object to put the new box in.
10343 * @return @c NULL on error, a pointer to a new box object on
10344 * success.
10345 *
10346 * This is a helper function that has the same effect of putting a new
10347 * box object into @p parent by use of evas_object_smart_member_add().
10348 *
10349 * @see evas_object_box_add()
10350 */
10351EAPI Evas_Object *evas_object_box_add_to (Evas_Object *parent) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
10352
10353/**
10354 * Layout function which sets the box @a o to a (basic) horizontal box
10355 *
10356 * @param o The box object in question
10357 * @param priv The smart data of the @p o
10358 * @param data The data pointer passed on
10359 * evas_object_box_layout_set(), if any
10360 *
10361 * In this layout, the box object's overall behavior is controlled by
10362 * its padding/alignment properties, which are set by the
10363 * <c>evas_object_box_{h,v}_{align,padding}_set()</c> family of
10364 * functions. The size hints of the elements in the box -- set by the
10365 * <c>evas_object_size_hint_{align,padding,weight}_set()</c> functions
10366 * -- also control the way this function works.
10367 *
10368 * \par Box's properties:
10369 * @c align_h controls the horizontal alignment of the child objects
10370 * relative to the containing box. When set to @c 0.0, children are
10371 * aligned to the left. A value of @c 1.0 makes them aligned to the
10372 * right border. Values in between align them proportionally. Note
10373 * that if the size required by the children, which is given by their
10374 * widths and the @c padding_h property of the box, is bigger than the
10375 * their container's width, the children will be displayed out of the
10376 * box's bounds. A negative value of @c align_h makes the box to
10377 * @b justify its children. The padding between them, in this case, is
10378 * corrected so that the leftmost one touches the left border and the
10379 * rightmost one touches the right border (even if they must
10380 * overlap). The @c align_v and @c padding_v properties of the box
10381 * @b don't contribute to its behaviour when this layout is chosen.
10382 *
10383 * \par Child element's properties:
10384 * @c align_x does @b not influence the box's behavior. @c padding_l
10385 * and @c padding_r sum up to the container's horizontal padding
10386 * between elements. The child's @c padding_t, @c padding_b and
10387 * @c align_y properties apply for padding/alignment relative to the
10388 * overall height of the box. Finally, there is the @c weight_x
10389 * property, which, if set to a non-zero value, tells the container
10390 * that the child width is @b not pre-defined. If the container can't
10391 * accommodate all its children, it sets the widths of the ones
10392 * <b>with weights</b> to sizes as small as they can all fit into
10393 * it. If the size required by the children is less than the
10394 * available, the box increases its childrens' (which have weights)
10395 * widths as to fit the remaining space. The @c weight_x property,
10396 * besides telling the element is resizable, gives a @b weight for the
10397 * resizing process. The parent box will try to distribute (or take
10398 * off) widths accordingly to the @b normalized list of weigths: most
10399 * weighted children remain/get larger in this process than the least
10400 * ones. @c weight_y does not influence the layout.
10401 *
10402 * If one desires that, besides having weights, child elements must be
10403 * resized bounded to a minimum or maximum size, those size hints must
10404 * be set, by the <c>evas_object_size_hint_{min,max}_set()</c>
10405 * functions.
10406 */
10407EAPI void evas_object_box_layout_horizontal (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
10408
10409/**
10410 * Layout function which sets the box @a o to a (basic) vertical box
10411 *
10412 * This function behaves analogously to
10413 * evas_object_box_layout_horizontal(). The description of its
10414 * behaviour can be derived from that function's documentation.
10415 */
10416EAPI void evas_object_box_layout_vertical (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
10417
10418/**
10419 * Layout function which sets the box @a o to a @b homogeneous
10420 * vertical box
10421 *
10422 * This function behaves analogously to
10423 * evas_object_box_layout_homogeneous_horizontal(). The description
10424 * of its behaviour can be derived from that function's documentation.
10425 */
10426EAPI void evas_object_box_layout_homogeneous_vertical (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
10427
10428/**
10429 * Layout function which sets the box @a o to a @b homogeneous
10430 * horizontal box
10431 *
10432 * @param o The box object in question
10433 * @param priv The smart data of the @p o
10434 * @param data The data pointer passed on
10435 * evas_object_box_layout_set(), if any
10436 *
10437 * In a homogeneous horizontal box, its width is divided @b equally
10438 * between the contained objects. The box's overall behavior is
10439 * controlled by its padding/alignment properties, which are set by
10440 * the <c>evas_object_box_{h,v}_{align,padding}_set()</c> family of
10441 * functions. The size hints the elements in the box -- set by the
10442 * <c>evas_object_size_hint_{align,padding,weight}_set()</c> functions
10443 * -- also control the way this function works.
10444 *
10445 * \par Box's properties:
10446 * @c align_h has no influence on the box for this layout.
10447 * @c padding_h tells the box to draw empty spaces of that size, in
10448 * pixels, between the (equal) child objects's cells. The @c align_v
10449 * and @c padding_v properties of the box don't contribute to its
10450 * behaviour when this layout is chosen.
10451 *
10452 * \par Child element's properties:
10453 * @c padding_l and @c padding_r sum up to the required width of the
10454 * child element. The @c align_x property tells the relative position
10455 * of this overall child width in its allocated cell (@r 0.0 to
10456 * extreme left, @c 1.0 to extreme right). A value of @c -1.0 to
10457 * @c align_x makes the box try to resize this child element to the exact
10458 * width of its cell (respecting the minimum and maximum size hints on
10459 * the child's width and accounting for its horizontal padding
10460 * hints). The child's @c padding_t, @c padding_b and @c align_y
10461 * properties apply for padding/alignment relative to the overall
10462 * height of the box. A value of @c -1.0 to @c align_y makes the box
10463 * try to resize this child element to the exact height of its parent
10464 * (respecting the maximum size hint on the child's height).
10465 */
10466EAPI void evas_object_box_layout_homogeneous_horizontal (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
10467
10468/**
10469 * Layout function which sets the box @a o to a <b>maximum size,
10470 * homogeneous</b> horizontal box
10471 *
10472 * @param o The box object in question
10473 * @param priv The smart data of the @p o
10474 * @param data The data pointer passed on
10475 * evas_object_box_layout_set(), if any
10476 *
10477 * In a maximum size, homogeneous horizontal box, besides having cells
10478 * of <b>equal size</b> reserved for the child objects, this size will
10479 * be defined by the size of the @b largest child in the box (in
10480 * width). The box's overall behavior is controlled by its properties,
10481 * which are set by the
10482 * <c>evas_object_box_{h,v}_{align,padding}_set()</c> family of
10483 * functions. The size hints of the elements in the box -- set by the
10484 * <c>evas_object_size_hint_{align,padding,weight}_set()</c> functions
10485 * -- also control the way this function works.
10486 *
10487 * \par Box's properties:
10488 * @c padding_h tells the box to draw empty spaces of that size, in
10489 * pixels, between the child objects's cells. @c align_h controls the
10490 * horizontal alignment of the child objects, relative to the
10491 * containing box. When set to @c 0.0, children are aligned to the
10492 * left. A value of @c 1.0 lets them aligned to the right
10493 * border. Values in between align them proportionally. A negative
10494 * value of @c align_h makes the box to @b justify its children
10495 * cells. The padding between them, in this case, is corrected so that
10496 * the leftmost one touches the left border and the rightmost one
10497 * touches the right border (even if they must overlap). The
10498 * @c align_v and @c padding_v properties of the box don't contribute to
10499 * its behaviour when this layout is chosen.
10500 *
10501 * \par Child element's properties:
10502 * @c padding_l and @c padding_r sum up to the required width of the
10503 * child element. The @c align_x property tells the relative position
10504 * of this overall child width in its allocated cell (@c 0.0 to
10505 * extreme left, @c 1.0 to extreme right). A value of @c -1.0 to
10506 * @c align_x makes the box try to resize this child element to the exact
10507 * width of its cell (respecting the minimun and maximum size hints on
10508 * the child's width and accounting for its horizontal padding
10509 * hints). The child's @c padding_t, @c padding_b and @c align_y
10510 * properties apply for padding/alignment relative to the overall
10511 * height of the box. A value of @c -1.0 to @c align_y makes the box
10512 * try to resize this child element to the exact height of its parent
10513 * (respecting the max hint on the child's height).
10514 */
10515EAPI void evas_object_box_layout_homogeneous_max_size_horizontal(Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
10516
10517/**
10518 * Layout function which sets the box @a o to a <b>maximum size,
10519 * homogeneous</b> vertical box
10520 *
10521 * This function behaves analogously to
10522 * evas_object_box_layout_homogeneous_max_size_horizontal(). The
10523 * description of its behaviour can be derived from that function's
10524 * documentation.
10525 */
10526EAPI void evas_object_box_layout_homogeneous_max_size_vertical (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
10527
10528/**
10529 * Layout function which sets the box @a o to a @b flow horizontal
10530 * box.
10531 *
10532 * @param o The box object in question
10533 * @param priv The smart data of the @p o
10534 * @param data The data pointer passed on
10535 * evas_object_box_layout_set(), if any
10536 *
10537 * In a flow horizontal box, the box's child elements are placed in
10538 * @b rows (think of text as an analogy). A row has as much elements as
10539 * can fit into the box's width. The box's overall behavior is
10540 * controlled by its properties, which are set by the
10541 * <c>evas_object_box_{h,v}_{align,padding}_set()</c> family of
10542 * functions. The size hints of the elements in the box -- set by the
10543 * <c>evas_object_size_hint_{align,padding,weight}_set()</c> functions
10544 * -- also control the way this function works.
10545 *
10546 * \par Box's properties:
10547 * @c padding_h tells the box to draw empty spaces of that size, in
10548 * pixels, between the child objects's cells. @c align_h dictates the
10549 * horizontal alignment of the rows (@c 0.0 to left align them, @c 1.0
10550 * to right align). A value of @c -1.0 to @c align_h lets the rows
10551 * @b justified horizontally. @c align_v controls the vertical alignment
10552 * of the entire set of rows (@c 0.0 to top, @c 1.0 to bottom). A
10553 * value of @c -1.0 to @c align_v makes the box to @b justify the rows
10554 * vertically. The padding between them, in this case, is corrected so
10555 * that the first row touches the top border and the last one touches
10556 * the bottom border (even if they must overlap). @c padding_v has no
10557 * influence on the layout.
10558 *
10559 * \par Child element's properties:
10560 * @c padding_l and @c padding_r sum up to the required width of the
10561 * child element. The @c align_x property has no influence on the
10562 * layout. The child's @c padding_t and @c padding_b sum up to the
10563 * required height of the child element and is the only means (besides
10564 * row justifying) of setting space between rows. Note, however, that
10565 * @c align_y dictates positioning relative to the <b>largest
10566 * height</b> required by a child object in the actual row.
10567 */
10568EAPI void evas_object_box_layout_flow_horizontal (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
10569
10570/**
10571 * Layout function which sets the box @a o to a @b flow vertical box.
10572 *
10573 * This function behaves analogously to
10574 * evas_object_box_layout_flow_horizontal(). The description of its
10575 * behaviour can be derived from that function's documentation.
10576 */
10577EAPI void evas_object_box_layout_flow_vertical (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
10578
10579/**
10580 * Layout function which sets the box @a o to a @b stacking box
10581 *
10582 * @param o The box object in question
10583 * @param priv The smart data of the @p o
10584 * @param data The data pointer passed on
10585 * evas_object_box_layout_set(), if any
10586 *
10587 * In a stacking box, all children will be given the same size -- the
10588 * box's own size -- and they will be stacked one above the other, so
10589 * that the first object in @p o's internal list of child elements
10590 * will be the bottommost in the stack.
10591 *
10592 * \par Box's properties:
10593 * No box properties are used.
10594 *
10595 * \par Child element's properties:
10596 * @c padding_l and @c padding_r sum up to the required width of the
10597 * child element. The @c align_x property tells the relative position
10598 * of this overall child width in its allocated cell (@c 0.0 to
10599 * extreme left, @c 1.0 to extreme right). A value of @c -1.0 to @c
10600 * align_x makes the box try to resize this child element to the exact
10601 * width of its cell (respecting the min and max hints on the child's
10602 * width and accounting for its horizontal padding properties). The
10603 * same applies to the vertical axis.
10604 */
10605EAPI void evas_object_box_layout_stack (Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
10606
10607/**
10608 * Set the alignment of the whole bounding box of contents, for a
10609 * given box object.
10610 *
10611 * @param o The given box object to set alignment from
10612 * @param horizontal The horizontal alignment, in pixels
10613 * @param vertical the vertical alignment, in pixels
10614 *
10615 * This will influence how a box object is to align its bounding box
10616 * of contents within its own area. The values @b must be in the range
10617 * @c 0.0 - @c 1.0, or undefined behavior is expected. For horizontal
10618 * alignment, @c 0.0 means to the left, with @c 1.0 meaning to the
10619 * right. For vertical alignment, @c 0.0 means to the top, with @c 1.0
10620 * meaning to the bottom.
10621 *
10622 * @note The default values for both alignments is @c 0.5.
10623 *
10624 * @see evas_object_box_align_get()
10625 */
10626EAPI void evas_object_box_align_set (Evas_Object *o, double horizontal, double vertical) EINA_ARG_NONNULL(1);
10627
10628/**
10629 * Get the alignment of the whole bounding box of contents, for a
10630 * given box object.
10631 *
10632 * @param o The given box object to get alignment from
10633 * @param horizontal Pointer to a variable where to store the
10634 * horizontal alignment
10635 * @param vertical Pointer to a variable where to store the vertical
10636 * alignment
10637 *
10638 * @see evas_object_box_align_set() for more information
10639 */
10640EAPI void evas_object_box_align_get (const Evas_Object *o, double *horizontal, double *vertical) EINA_ARG_NONNULL(1);
10641
10642/**
10643 * Set the (space) padding between cells set for a given box object.
10644 *
10645 * @param o The given box object to set padding from
10646 * @param horizontal The horizontal padding, in pixels
10647 * @param vertical the vertical padding, in pixels
10648 *
10649 * @note The default values for both padding components is @c 0.
10650 *
10651 * @see evas_object_box_padding_get()
10652 */
10653EAPI void evas_object_box_padding_set (Evas_Object *o, Evas_Coord horizontal, Evas_Coord vertical) EINA_ARG_NONNULL(1);
10654
10655/**
10656 * Get the (space) padding between cells set for a given box object.
10657 *
10658 * @param o The given box object to get padding from
10659 * @param horizontal Pointer to a variable where to store the
10660 * horizontal padding
10661 * @param vertical Pointer to a variable where to store the vertical
10662 * padding
10663 *
10664 * @see evas_object_box_padding_set()
10665 */
10666EAPI void evas_object_box_padding_get (const Evas_Object *o, Evas_Coord *horizontal, Evas_Coord *vertical) EINA_ARG_NONNULL(1);
10667
10668/**
10669 * Append a new @a child object to the given box object @a o.
10670 *
10671 * @param o The given box object
10672 * @param child A child Evas object to be made a member of @p o
10673 * @return A box option bound to the recently added box item or @c
10674 * NULL, on errors
10675 *
10676 * On success, the @c "child,added" smart event will take place.
10677 *
10678 * @note The actual placing of the item relative to @p o's area will
10679 * depend on the layout set to it. For example, on horizontal layouts
10680 * an item in the end of the box's list of children will appear on its
10681 * right.
10682 *
10683 * @note This call will trigger the box's _Evas_Object_Box_Api::append
10684 * smart function.
10685 */
10686EAPI Evas_Object_Box_Option *evas_object_box_append (Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
10687
10688/**
10689 * Prepend a new @a child object to the given box object @a o.
10690 *
10691 * @param o The given box object
10692 * @param child A child Evas object to be made a member of @p o
10693 * @return A box option bound to the recently added box item or @c
10694 * NULL, on errors
10695 *
10696 * On success, the @c "child,added" smart event will take place.
10697 *
10698 * @note The actual placing of the item relative to @p o's area will
10699 * depend on the layout set to it. For example, on horizontal layouts
10700 * an item in the beginning of the box's list of children will appear
10701 * on its left.
10702 *
10703 * @note This call will trigger the box's
10704 * _Evas_Object_Box_Api::prepend smart function.
10705 */
10706EAPI Evas_Object_Box_Option *evas_object_box_prepend (Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
10707
10708/**
10709 * Insert a new @a child object <b>before another existing one</b>, in
10710 * a given box object @a o.
10711 *
10712 * @param o The given box object
10713 * @param child A child Evas object to be made a member of @p o
10714 * @param reference The child object to place this new one before
10715 * @return A box option bound to the recently added box item or @c
10716 * NULL, on errors
10717 *
10718 * On success, the @c "child,added" smart event will take place.
10719 *
10720 * @note This function will fail if @p reference is not a member of @p
10721 * o.
10722 *
10723 * @note The actual placing of the item relative to @p o's area will
10724 * depend on the layout set to it.
10725 *
10726 * @note This call will trigger the box's
10727 * _Evas_Object_Box_Api::insert_before smart function.
10728 */
10729EAPI Evas_Object_Box_Option *evas_object_box_insert_before (Evas_Object *o, Evas_Object *child, const Evas_Object *reference) EINA_ARG_NONNULL(1, 2, 3);
10730
10731/**
10732 * Insert a new @a child object <b>after another existing one</b>, in
10733 * a given box object @a o.
10734 *
10735 * @param o The given box object
10736 * @param child A child Evas object to be made a member of @p o
10737 * @param reference The child object to place this new one after
10738 * @return A box option bound to the recently added box item or @c
10739 * NULL, on errors
10740 *
10741 * On success, the @c "child,added" smart event will take place.
10742 *
10743 * @note This function will fail if @p reference is not a member of @p
10744 * o.
10745 *
10746 * @note The actual placing of the item relative to @p o's area will
10747 * depend on the layout set to it.
10748 *
10749 * @note This call will trigger the box's
10750 * _Evas_Object_Box_Api::insert_after smart function.
10751 */
10752EAPI Evas_Object_Box_Option *evas_object_box_insert_after (Evas_Object *o, Evas_Object *child, const Evas_Object *referente) EINA_ARG_NONNULL(1, 2, 3);
10753
10754/**
10755 * Insert a new @a child object <b>at a given position</b>, in a given
10756 * box object @a o.
10757 *
10758 * @param o The given box object
10759 * @param child A child Evas object to be made a member of @p o
10760 * @param pos The numeric position (starting from @c 0) to place the
10761 * new child object at
10762 * @return A box option bound to the recently added box item or @c
10763 * NULL, on errors
10764 *
10765 * On success, the @c "child,added" smart event will take place.
10766 *
10767 * @note This function will fail if the given position is invalid,
10768 * given @p o's internal list of elements.
10769 *
10770 * @note The actual placing of the item relative to @p o's area will
10771 * depend on the layout set to it.
10772 *
10773 * @note This call will trigger the box's
10774 * _Evas_Object_Box_Api::insert_at smart function.
10775 */
10776EAPI Evas_Object_Box_Option *evas_object_box_insert_at (Evas_Object *o, Evas_Object *child, unsigned int pos) EINA_ARG_NONNULL(1, 2);
10777
10778/**
10779 * Remove a given object from a box object, unparenting it again.
10780 *
10781 * @param o The box object to remove a child object from
10782 * @param child The handle to the child object to be removed
10783 * @return @c EINA_TRUE, on success, @c EINA_FALSE otherwise
10784 *
10785 * On removal, you'll get an unparented object again, just as it was
10786 * before you inserted it in the box. The
10787 * _Evas_Object_Box_Api::option_free box smart callback will be called
10788 * automatilly for you and, also, the @c "child,removed" smart event
10789 * will take place.
10790 *
10791 * @note This call will trigger the box's _Evas_Object_Box_Api::remove
10792 * smart function.
10793 */
10794EAPI Eina_Bool evas_object_box_remove (Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
10795
10796/**
10797 * Remove an object, <b>bound to a given position</b> in a box object,
10798 * unparenting it again.
10799 *
10800 * @param o The box object to remove a child object from
10801 * @param in The numeric position (starting from @c 0) of the child
10802 * object to be removed
10803 * @return @c EINA_TRUE, on success, @c EINA_FALSE otherwise
10804 *
10805 * On removal, you'll get an unparented object again, just as it was
10806 * before you inserted it in the box. The @c option_free() box smart
10807 * callback will be called automatilly for you and, also, the
10808 * @c "child,removed" smart event will take place.
10809 *
10810 * @note This function will fail if the given position is invalid,
10811 * given @p o's internal list of elements.
10812 *
10813 * @note This call will trigger the box's
10814 * _Evas_Object_Box_Api::remove_at smart function.
10815 */
10816EAPI Eina_Bool evas_object_box_remove_at (Evas_Object *o, unsigned int pos) EINA_ARG_NONNULL(1);
10817
10818/**
10819 * Remove @b all child objects from a box object, unparenting them
10820 * again.
10821 *
10822 * @param o The box object to remove a child object from
10823 * @param child The handle to the child object to be removed
10824 * @return @c EINA_TRUE, on success, @c EINA_FALSE otherwise
10825 *
10826 * This has the same effect of calling evas_object_box_remove() on
10827 * each of @p o's child objects, in sequence. If, and only if, all
10828 * those calls succeed, so does this one.
10829 */
10830EAPI Eina_Bool evas_object_box_remove_all (Evas_Object *o, Eina_Bool clear) EINA_ARG_NONNULL(1);
10831
10832/**
10833 * Get an iterator to walk the list of children of a given box object.
10834 *
10835 * @param o The box to retrieve an items iterator from
10836 * @return An iterator on @p o's child objects, on success, or @c NULL,
10837 * on errors
10838 *
10839 * @note Do @b not remove or delete objects while walking the list.
10840 */
10841EAPI Eina_Iterator *evas_object_box_iterator_new (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
10842
10843/**
10844 * Get an accessor (a structure providing random items access) to the
10845 * list of children of a given box object.
10846 *
10847 * @param o The box to retrieve an items iterator from
10848 * @return An accessor on @p o's child objects, on success, or @c NULL,
10849 * on errors
10850 *
10851 * @note Do not remove or delete objects while walking the list.
10852 */
10853EAPI Eina_Accessor *evas_object_box_accessor_new (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
10854
10855/**
10856 * Get the list of children objects in a given box object.
10857 *
10858 * @param o The box to retrieve an items list from
10859 * @return A list of @p o's child objects, on success, or @c NULL,
10860 * on errors (or if it has no child objects)
10861 *
10862 * The returned list should be freed with @c eina_list_free() when you
10863 * no longer need it.
10864 *
10865 * @note This is a duplicate of the list kept by the box internally.
10866 * It's up to the user to destroy it when it no longer needs it.
10867 * It's possible to remove objects from the box when walking
10868 * this list, but these removals won't be reflected on it.
10869 */
10870EAPI Eina_List *evas_object_box_children_get (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
10871
10872/**
10873 * Get the name of the property of the child elements of the box @a o
10874 * which have @a id as identifier
10875 *
10876 * @param o The box to search child options from
10877 * @param id The numerical identifier of the option being searched, for
10878 * its name
10879 * @return The name of the given property or @c NULL, on errors.
10880 *
10881 * @note This call won't do anything for a canonical Evas box. Only
10882 * users which have @b subclassed it, setting custom box items options
10883 * (see #Evas_Object_Box_Option) on it, would benefit from this
10884 * function. They'd have to implement it and set it to be the
10885 * _Evas_Object_Box_Api::property_name_get smart class function of the
10886 * box, which is originally set to @c NULL.
10887 */
10888EAPI const char *evas_object_box_option_property_name_get (Evas_Object *o, int property) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
10889
10890/**
10891 * Get the numerical identifier of the property of the child elements
10892 * of the box @a o which have @a name as name string
10893 *
10894 * @param o The box to search child options from
10895 * @param name The name string of the option being searched, for
10896 * its ID
10897 * @return The numerical ID of the given property or @c -1, on
10898 * errors.
10899 *
10900 * @note This call won't do anything for a canonical Evas box. Only
10901 * users which have @b subclassed it, setting custom box items options
10902 * (see #Evas_Object_Box_Option) on it, would benefit from this
10903 * function. They'd have to implement it and set it to be the
10904 * _Evas_Object_Box_Api::property_id_get smart class function of the
10905 * box, which is originally set to @c NULL.
10906 */
10907EAPI int evas_object_box_option_property_id_get (Evas_Object *o, const char *name) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
10908
10909/**
10910 * Set a property value (by its given numerical identifier), on a
10911 * given box child element
10912 *
10913 * @param o The box parenting the child element
10914 * @param opt The box option structure bound to the child box element
10915 * to set a property on
10916 * @param id The numerical ID of the given property
10917 * @param ... (List of) actual value(s) to be set for this
10918 * property. It (they) @b must be of the same type the user has
10919 * defined for it (them).
10920 * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
10921 *
10922 * @note This call won't do anything for a canonical Evas box. Only
10923 * users which have @b subclassed it, setting custom box items options
10924 * (see #Evas_Object_Box_Option) on it, would benefit from this
10925 * function. They'd have to implement it and set it to be the
10926 * _Evas_Object_Box_Api::property_set smart class function of the box,
10927 * which is originally set to @c NULL.
10928 *
10929 * @note This function will internally create a variable argument
10930 * list, with the values passed after @p property, and call
10931 * evas_object_box_option_property_vset() with this list and the same
10932 * previous arguments.
10933 */
10934EAPI Eina_Bool evas_object_box_option_property_set (Evas_Object *o, Evas_Object_Box_Option *opt, int property, ...) EINA_ARG_NONNULL(1, 2);
10935
10936/**
10937 * Set a property value (by its given numerical identifier), on a
10938 * given box child element -- by a variable argument list
10939 *
10940 * @param o The box parenting the child element
10941 * @param opt The box option structure bound to the child box element
10942 * to set a property on
10943 * @param id The numerical ID of the given property
10944 * @param va_list The variable argument list implementing the value to
10945 * be set for this property. It @b must be of the same type the user has
10946 * defined for it.
10947 * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
10948 *
10949 * This is a variable argument list variant of the
10950 * evas_object_box_option_property_set(). See its documentation for
10951 * more details.
10952 */
10953EAPI Eina_Bool evas_object_box_option_property_vset (Evas_Object *o, Evas_Object_Box_Option *opt, int property, va_list args) EINA_ARG_NONNULL(1, 2);
10954
10955/**
10956 * Get a property's value (by its given numerical identifier), on a
10957 * given box child element
10958 *
10959 * @param o The box parenting the child element
10960 * @param opt The box option structure bound to the child box element
10961 * to get a property from
10962 * @param id The numerical ID of the given property
10963 * @param ... (List of) pointer(s) where to store the value(s) set for
10964 * this property. It (they) @b must point to variable(s) of the same
10965 * type the user has defined for it (them).
10966 * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
10967 *
10968 * @note This call won't do anything for a canonical Evas box. Only
10969 * users which have @b subclassed it, getting custom box items options
10970 * (see #Evas_Object_Box_Option) on it, would benefit from this
10971 * function. They'd have to implement it and get it to be the
10972 * _Evas_Object_Box_Api::property_get smart class function of the
10973 * box, which is originally get to @c NULL.
10974 *
10975 * @note This function will internally create a variable argument
10976 * list, with the values passed after @p property, and call
10977 * evas_object_box_option_property_vget() with this list and the same
10978 * previous arguments.
10979 */
10980EAPI Eina_Bool evas_object_box_option_property_get (Evas_Object *o, Evas_Object_Box_Option *opt, int property, ...) EINA_ARG_NONNULL(1, 2);
10981
10982/**
10983 * Get a property's value (by its given numerical identifier), on a
10984 * given box child element -- by a variable argument list
10985 *
10986 * @param o The box parenting the child element
10987 * @param opt The box option structure bound to the child box element
10988 * to get a property from
10989 * @param id The numerical ID of the given property
10990 * @param va_list The variable argument list with pointers to where to
10991 * store the values of this property. They @b must point to variables
10992 * of the same type the user has defined for them.
10993 * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
10994 *
10995 * This is a variable argument list variant of the
10996 * evas_object_box_option_property_get(). See its documentation for
10997 * more details.
10998 */
10999EAPI Eina_Bool evas_object_box_option_property_vget (Evas_Object *o, Evas_Object_Box_Option *opt, int property, va_list args) EINA_ARG_NONNULL(1, 2);
11000
11001/**
11002 * @}
11003 */
11004
11005/**
11006 * @defgroup Evas_Object_Table Table Smart Object.
11007 *
11008 * Convenience smart object that packs children using a tabular
11009 * layout using children size hints to define their size and
11010 * alignment inside their cell space.
11011 *
11012 * @ref tutorial_table shows how to use this Evas_Object.
11013 *
11014 * @see @ref Evas_Object_Group_Size_Hints
11015 *
11016 * @ingroup Evas_Smart_Object_Group
11017 *
11018 * @{
11019 */
11020
11021/**
11022 * @brief Create a new table.
11023 *
11024 * @param evas Canvas in which table will be added.
11025 */
11026EAPI Evas_Object *evas_object_table_add (Evas *evas) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11027
11028/**
11029 * @brief Create a table that is child of a given element @a parent.
11030 *
11031 * @see evas_object_table_add()
11032 */
11033EAPI Evas_Object *evas_object_table_add_to (Evas_Object *parent) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11034
11035/**
11036 * @brief Set how this table should layout children.
11037 *
11038 * @todo consider aspect hint and respect it.
11039 *
11040 * @par EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE
11041 * If table does not use homogeneous mode then columns and rows will
11042 * be calculated based on hints of individual cells. This operation
11043 * mode is more flexible, but more complex and heavy to calculate as
11044 * well. @b Weight properties are handled as a boolean expand. Negative
11045 * alignment will be considered as 0.5. This is the default.
11046 *
11047 * @todo @c EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE should balance weight.
11048 *
11049 * @par EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE
11050 * When homogeneous is relative to table the own table size is divided
11051 * equally among children, filling the whole table area. That is, if
11052 * table has @c WIDTH and @c COLUMNS, each cell will get <tt>WIDTH /
11053 * COLUMNS</tt> pixels. If children have minimum size that is larger
11054 * than this amount (including padding), then it will overflow and be
11055 * aligned respecting the alignment hint, possible overlapping sibling
11056 * cells. @b Weight hint is used as a boolean, if greater than zero it
11057 * will make the child expand in that axis, taking as much space as
11058 * possible (bounded to maximum size hint). Negative alignment will be
11059 * considered as 0.5.
11060 *
11061 * @par EVAS_OBJECT_TABLE_HOMOGENEOUS_ITEM
11062 * When homogeneous is relative to item it means the greatest minimum
11063 * cell size will be used. That is, if no element is set to expand,
11064 * the table will have its contents to a minimum size, the bounding
11065 * box of all these children will be aligned relatively to the table
11066 * object using evas_object_table_align_get(). If the table area is
11067 * too small to hold this minimum bounding box, then the objects will
11068 * keep their size and the bounding box will overflow the box area,
11069 * still respecting the alignment. @b Weight hint is used as a
11070 * boolean, if greater than zero it will make that cell expand in that
11071 * axis, toggling the <b>expand mode</b>, which makes the table behave
11072 * much like @b EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE, except that the
11073 * bounding box will overflow and items will not overlap siblings. If
11074 * no minimum size is provided at all then the table will fallback to
11075 * expand mode as well.
11076 */
11077EAPI void evas_object_table_homogeneous_set (Evas_Object *o, Evas_Object_Table_Homogeneous_Mode homogeneous) EINA_ARG_NONNULL(1);
11078
11079/**
11080 * Get the current layout homogeneous mode.
11081 *
11082 * @see evas_object_table_homogeneous_set()
11083 */
11084EAPI Evas_Object_Table_Homogeneous_Mode evas_object_table_homogeneous_get (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
11085
11086/**
11087 * Set padding between cells.
11088 */
11089EAPI void evas_object_table_padding_set (Evas_Object *o, Evas_Coord horizontal, Evas_Coord vertical) EINA_ARG_NONNULL(1);
11090
11091/**
11092 * Get padding between cells.
11093 */
11094EAPI void evas_object_table_padding_get (const Evas_Object *o, Evas_Coord *horizontal, Evas_Coord *vertical) EINA_ARG_NONNULL(1);
11095
11096/**
11097 * Set the alignment of the whole bounding box of contents.
11098 */
11099EAPI void evas_object_table_align_set (Evas_Object *o, double horizontal, double vertical) EINA_ARG_NONNULL(1);
11100
11101/**
11102 * Get alignment of the whole bounding box of contents.
11103 */
11104EAPI void evas_object_table_align_get (const Evas_Object *o, double *horizontal, double *vertical) EINA_ARG_NONNULL(1);
11105
11106/**
11107 * Sets the mirrored mode of the table. In mirrored mode the table items go
11108 * from right to left instead of left to right. That is, 1,1 is top right, not
11109 * top left.
11110 *
11111 * @param obj The table object.
11112 * @param mirrored the mirrored mode to set
11113 * @since 1.1.0
11114 */
11115EAPI void evas_object_table_mirrored_set (Evas_Object *o, Eina_Bool mirrored) EINA_ARG_NONNULL(1);
11116
11117/**
11118 * Gets the mirrored mode of the table.
11119 *
11120 * @param obj The table object.
11121 * @return EINA_TRUE if it's a mirrored table, EINA_FALSE otherwise.
11122 * @since 1.1.0
11123 * @see evas_object_table_mirrored_set()
11124 */
11125EAPI Eina_Bool evas_object_table_mirrored_get (const Evas_Object *o) EINA_ARG_NONNULL(1);
11126
11127/**
11128 * Get packing location of a child of table
11129 *
11130 * @param o The given table object.
11131 * @param child The child object to add.
11132 * @param col pointer to store relative-horizontal position to place child.
11133 * @param row pointer to store relative-vertical position to place child.
11134 * @param colspan pointer to store how many relative-horizontal position to use for this child.
11135 * @param rowspan pointer to store how many relative-vertical position to use for this child.
11136 *
11137 * @return 1 on success, 0 on failure.
11138 * @since 1.1.0
11139 */
11140EAPI Eina_Bool evas_object_table_pack_get(Evas_Object *o, Evas_Object *child, unsigned short *col, unsigned short *row, unsigned short *colspan, unsigned short *rowspan);
11141
11142/**
11143 * Add a new child to a table object or set its current packing.
11144 *
11145 * @param o The given table object.
11146 * @param child The child object to add.
11147 * @param col relative-horizontal position to place child.
11148 * @param row relative-vertical position to place child.
11149 * @param colspan how many relative-horizontal position to use for this child.
11150 * @param rowspan how many relative-vertical position to use for this child.
11151 *
11152 * @return 1 on success, 0 on failure.
11153 */
11154EAPI Eina_Bool evas_object_table_pack (Evas_Object *o, Evas_Object *child, unsigned short col, unsigned short row, unsigned short colspan, unsigned short rowspan) EINA_ARG_NONNULL(1, 2);
11155
11156/**
11157 * Remove child from table.
11158 *
11159 * @note removing a child will immediately call a walk over children in order
11160 * to recalculate numbers of columns and rows. If you plan to remove
11161 * all children, use evas_object_table_clear() instead.
11162 *
11163 * @return 1 on success, 0 on failure.
11164 */
11165EAPI Eina_Bool evas_object_table_unpack (Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
11166
11167/**
11168 * Faster way to remove all child objects from a table object.
11169 *
11170 * @param o The given table object.
11171 * @param clear if true, it will delete just removed children.
11172 */
11173EAPI void evas_object_table_clear (Evas_Object *o, Eina_Bool clear) EINA_ARG_NONNULL(1);
11174
11175/**
11176 * Get the number of columns and rows this table takes.
11177 *
11178 * @note columns and rows are virtual entities, one can specify a table
11179 * with a single object that takes 4 columns and 5 rows. The only
11180 * difference for a single cell table is that paddings will be
11181 * accounted proportionally.
11182 */
11183EAPI void evas_object_table_col_row_size_get(const Evas_Object *o, int *cols, int *rows) EINA_ARG_NONNULL(1);
11184
11185/**
11186 * Get an iterator to walk the list of children for the table.
11187 *
11188 * @note Do not remove or delete objects while walking the list.
11189 */
11190EAPI Eina_Iterator *evas_object_table_iterator_new (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11191
11192/**
11193 * Get an accessor to get random access to the list of children for the table.
11194 *
11195 * @note Do not remove or delete objects while walking the list.
11196 */
11197EAPI Eina_Accessor *evas_object_table_accessor_new (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11198
11199/**
11200 * Get the list of children for the table.
11201 *
11202 * @note This is a duplicate of the list kept by the table internally.
11203 * It's up to the user to destroy it when it no longer needs it.
11204 * It's possible to remove objects from the table when walking this
11205 * list, but these removals won't be reflected on it.
11206 */
11207EAPI Eina_List *evas_object_table_children_get (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11208
11209/**
11210 * Get the child of the table at the given coordinates
11211 *
11212 * @note This does not take into account col/row spanning
11213 */
11214EAPI Evas_Object *evas_object_table_child_get (const Evas_Object *o, unsigned short col, unsigned short row) EINA_ARG_NONNULL(1);
11215/**
11216 * @}
11217 */
11218
11219/**
11220 * @defgroup Evas_Object_Grid Grid Smart Object.
11221 *
11222 * Convenience smart object that packs children under a regular grid
11223 * layout, using their virtual grid location and size to determine
11224 * children's positions inside the grid object's area.
11225 *
11226 * @ingroup Evas_Smart_Object_Group
11227 * @since 1.1.0
11228 */
11229
11230/**
11231 * @addtogroup Evas_Object_Grid
11232 * @{
11233 */
11234
11235/**
11236 * Create a new grid.
11237 *
11238 * It's set to a virtual size of 1x1 by default and add children with
11239 * evas_object_grid_pack().
11240 * @since 1.1.0
11241 */
11242EAPI Evas_Object *evas_object_grid_add (Evas *evas) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11243
11244/**
11245 * Create a grid that is child of a given element @a parent.
11246 *
11247 * @see evas_object_grid_add()
11248 * @since 1.1.0
11249 */
11250EAPI Evas_Object *evas_object_grid_add_to (Evas_Object *parent) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11251
11252/**
11253 * Set the virtual resolution for the grid
11254 *
11255 * @param o The grid object to modify
11256 * @param w The virtual horizontal size (resolution) in integer units
11257 * @param h The virtual vertical size (resolution) in integer units
11258 * @since 1.1.0
11259 */
11260EAPI void evas_object_grid_size_set (Evas_Object *o, int w, int h) EINA_ARG_NONNULL(1);
11261
11262/**
11263 * Get the current virtual resolution
11264 *
11265 * @param o The grid object to query
11266 * @param w A pointer to an integer to store the virtual width
11267 * @param h A pointer to an integer to store the virtual height
11268 * @see evas_object_grid_size_set()
11269 * @since 1.1.0
11270 */
11271EAPI void evas_object_grid_size_get (const Evas_Object *o, int *w, int *h) EINA_ARG_NONNULL(1);
11272
11273/**
11274 * Sets the mirrored mode of the grid. In mirrored mode the grid items go
11275 * from right to left instead of left to right. That is, 0,0 is top right, not
11276 * to left.
11277 *
11278 * @param obj The grid object.
11279 * @param mirrored the mirrored mode to set
11280 * @since 1.1.0
11281 */
11282EAPI void evas_object_grid_mirrored_set (Evas_Object *o, Eina_Bool mirrored) EINA_ARG_NONNULL(1);
11283
11284/**
11285 * Gets the mirrored mode of the grid.
11286 *
11287 * @param obj The grid object.
11288 * @return EINA_TRUE if it's a mirrored grid, EINA_FALSE otherwise.
11289 * @see evas_object_grid_mirrored_set()
11290 * @since 1.1.0
11291 */
11292EAPI Eina_Bool evas_object_grid_mirrored_get (const Evas_Object *o) EINA_ARG_NONNULL(1);
11293
11294/**
11295 * Add a new child to a grid object.
11296 *
11297 * @param o The given grid object.
11298 * @param child The child object to add.
11299 * @param x The virtual x coordinate of the child
11300 * @param y The virtual y coordinate of the child
11301 * @param w The virtual width of the child
11302 * @param h The virtual height of the child
11303 * @return 1 on success, 0 on failure.
11304 * @since 1.1.0
11305 */
11306EAPI Eina_Bool evas_object_grid_pack (Evas_Object *o, Evas_Object *child, int x, int y, int w, int h) EINA_ARG_NONNULL(1, 2);
11307
11308/**
11309 * Remove child from grid.
11310 *
11311 * @note removing a child will immediately call a walk over children in order
11312 * to recalculate numbers of columns and rows. If you plan to remove
11313 * all children, use evas_object_grid_clear() instead.
11314 *
11315 * @return 1 on success, 0 on failure.
11316 * @since 1.1.0
11317 */
11318EAPI Eina_Bool evas_object_grid_unpack (Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
11319
11320/**
11321 * Faster way to remove all child objects from a grid object.
11322 *
11323 * @param o The given grid object.
11324 * @param clear if true, it will delete just removed children.
11325 * @since 1.1.0
11326 */
11327EAPI void evas_object_grid_clear (Evas_Object *o, Eina_Bool clear) EINA_ARG_NONNULL(1);
11328
11329/**
11330 * Get the pack options for a grid child
11331 *
11332 * Get the pack x, y, width and height in virtual coordinates set by
11333 * evas_object_grid_pack()
11334 * @param o The grid object
11335 * @param child The grid child to query for coordinates
11336 * @param x The pointer to where the x coordinate will be returned
11337 * @param y The pointer to where the y coordinate will be returned
11338 * @param w The pointer to where the width will be returned
11339 * @param h The pointer to where the height will be returned
11340 * @return 1 on success, 0 on failure.
11341 * @since 1.1.0
11342 */
11343EAPI Eina_Bool evas_object_grid_pack_get (Evas_Object *o, Evas_Object *child, int *x, int *y, int *w, int *h);
11344
11345/**
11346 * Get an iterator to walk the list of children for the grid.
11347 *
11348 * @note Do not remove or delete objects while walking the list.
11349 * @since 1.1.0
11350 */
11351EAPI Eina_Iterator *evas_object_grid_iterator_new (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11352
11353/**
11354 * Get an accessor to get random access to the list of children for the grid.
11355 *
11356 * @note Do not remove or delete objects while walking the list.
11357 * @since 1.1.0
11358 */
11359EAPI Eina_Accessor *evas_object_grid_accessor_new (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11360
11361/**
11362 * Get the list of children for the grid.
11363 *
11364 * @note This is a duplicate of the list kept by the grid internally.
11365 * It's up to the user to destroy it when it no longer needs it.
11366 * It's possible to remove objects from the grid when walking this
11367 * list, but these removals won't be reflected on it.
11368 * @since 1.1.0
11369 */
11370EAPI Eina_List *evas_object_grid_children_get (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11371
11372/**
11373 * @}
11374 */
11375
11376/**
11377 * @defgroup Evas_Cserve Shared Image Cache Server
11378 *
11379 * Evas has an (optional) module which provides client-server
11380 * infrastructure to <b>share bitmaps across multiple processes</b>,
11381 * saving data and processing power.
11382 *
11383 * Be warned that it @b doesn't work when <b>threaded image
11384 * preloading</b> is enabled for Evas, though.
11385 */
11386 typedef struct _Evas_Cserve_Stats Evas_Cserve_Stats;
11387 typedef struct _Evas_Cserve_Image_Cache Evas_Cserve_Image_Cache;
11388 typedef struct _Evas_Cserve_Image Evas_Cserve_Image;
11389 typedef struct _Evas_Cserve_Config Evas_Cserve_Config;
11390
11391/**
11392 * Statistics about the server that shares cached bitmaps.
11393 * @ingroup Evas_Cserve
11394 */
11395 struct _Evas_Cserve_Stats
11396 {
11397 int saved_memory; /**< current amount of saved memory, in bytes */
11398 int wasted_memory; /**< current amount of wasted memory, in bytes */
11399 int saved_memory_peak; /**< peak ammount of saved memory, in bytes */
11400 int wasted_memory_peak; /**< peak ammount of wasted memory, in bytes */
11401 double saved_time_image_header_load; /**< time, in seconds, saved in header loads by sharing cached loads instead */
11402 double saved_time_image_data_load; /**< time, in seconds, saved in data loads by sharing cached loads instead */
11403 };
11404
11405/**
11406 * A handle of a cache of images shared by a server.
11407 * @ingroup Evas_Cserve
11408 */
11409 struct _Evas_Cserve_Image_Cache
11410 {
11411 struct {
11412 int mem_total;
11413 int count;
11414 } active, cached;
11415 Eina_List *images;
11416 };
11417
11418/**
11419 * A handle to an image shared by a server.
11420 * @ingroup Evas_Cserve
11421 */
11422 struct _Evas_Cserve_Image
11423 {
11424 const char *file, *key;
11425 int w, h;
11426 time_t file_mod_time;
11427 time_t file_checked_time;
11428 time_t cached_time;
11429 int refcount;
11430 int data_refcount;
11431 int memory_footprint;
11432 double head_load_time;
11433 double data_load_time;
11434 Eina_Bool alpha : 1;
11435 Eina_Bool data_loaded : 1;
11436 Eina_Bool active : 1;
11437 Eina_Bool dead : 1;
11438 Eina_Bool useless : 1;
11439 };
11440
11441/**
11442 * Configuration that controls the server that shares cached bitmaps.
11443 * @ingroup Evas_Cserve
11444 */
11445 struct _Evas_Cserve_Config
11446 {
11447 int cache_max_usage;
11448 int cache_item_timeout;
11449 int cache_item_timeout_check;
11450 };
11451
11452
11453/**
11454 * Retrieves if the system wants to share bitmaps using the server.
11455 * @return @c EINA_TRUE if it wants, @c EINA_FALSE otherwise.
11456 * @ingroup Evas_Cserve
11457 */
11458EAPI Eina_Bool evas_cserve_want_get (void) EINA_WARN_UNUSED_RESULT EINA_PURE;
11459
11460/**
11461 * Retrieves if the system is connected to the server used to share
11462 * bitmaps.
11463 *
11464 * @return @c EINA_TRUE if it's connected, @c EINA_FALSE otherwise.
11465 * @ingroup Evas_Cserve
11466 */
11467EAPI Eina_Bool evas_cserve_connected_get (void) EINA_WARN_UNUSED_RESULT;
11468
11469/**
11470 * Retrieves statistics from a running bitmap sharing server.
11471 * @param stats pointer to structure to fill with statistics about the
11472 * bitmap cache server.
11473 *
11474 * @return @c EINA_TRUE if @p stats were filled with data,
11475 * @c EINA_FALSE otherwise (when @p stats is untouched)
11476 * @ingroup Evas_Cserve
11477 */
11478EAPI Eina_Bool evas_cserve_stats_get (Evas_Cserve_Stats *stats) EINA_WARN_UNUSED_RESULT;
11479
11480/**
11481 * Completely discard/clean a given images cache, thus re-setting it.
11482 *
11483 * @param cache A handle to the given images cache.
11484 */
11485EAPI void evas_cserve_image_cache_contents_clean (Evas_Cserve_Image_Cache *cache) EINA_PURE;
11486
11487/**
11488 * Retrieves the current configuration of the Evas image caching
11489 * server.
11490 *
11491 * @param config where to store current image caching server's
11492 * configuration.
11493 *
11494 * @return @c EINA_TRUE if @p config was filled with data,
11495 * @c EINA_FALSE otherwise (when @p config is untouched)
11496 *
11497 * The fields of @p config will be altered to reflect the current
11498 * configuration's values.
11499 *
11500 * @see evas_cserve_config_set()
11501 *
11502 * @ingroup Evas_Cserve
11503 */
11504EAPI Eina_Bool evas_cserve_config_get (Evas_Cserve_Config *config) EINA_WARN_UNUSED_RESULT EINA_PURE;
11505
11506/**
11507 * Changes the configurations of the Evas image caching server.
11508 *
11509 * @param config A bitmap cache configuration handle with fields set
11510 * to desired configuration values.
11511 * @return @c EINA_TRUE if @p config was successfully applied,
11512 * @c EINA_FALSE otherwise.
11513 *
11514 * @see evas_cserve_config_get()
11515 *
11516 * @ingroup Evas_Cserve
11517 */
11518EAPI Eina_Bool evas_cserve_config_set (const Evas_Cserve_Config *config) EINA_WARN_UNUSED_RESULT EINA_PURE;
11519
11520/**
11521 * Force the system to disconnect from the bitmap caching server.
11522 *
11523 * @ingroup Evas_Cserve
11524 */
11525EAPI void evas_cserve_disconnect (void);
11526
11527/**
11528 * @defgroup Evas_Utils General Utilities
11529 *
11530 * Some functions that are handy but are not specific of canvas or
11531 * objects.
11532 */
11533
11534/**
11535 * Converts the given Evas image load error code into a string
11536 * describing it in english.
11537 *
11538 * @param error the error code, a value in ::Evas_Load_Error.
11539 * @return Always returns a valid string. If the given @p error is not
11540 * supported, <code>"Unknown error"</code> is returned.
11541 *
11542 * Mostly evas_object_image_file_set() would be the function setting
11543 * that error value afterwards, but also evas_object_image_load(),
11544 * evas_object_image_save(), evas_object_image_data_get(),
11545 * evas_object_image_data_convert(), evas_object_image_pixels_import()
11546 * and evas_object_image_is_inside(). This function is meant to be
11547 * used in conjunction with evas_object_image_load_error_get(), as in:
11548 *
11549 * Example code:
11550 * @dontinclude evas-load-error-str.c
11551 * @skip img1 =
11552 * @until ecore_main_loop_begin(
11553 *
11554 * Here, being @c valid_path the path to a valid image and @c
11555 * bogus_path a path to a file which does not exist, the two outputs
11556 * of evas_load_error_str() would be (if no other errors occur):
11557 * <code>"No error on load"</code> and <code>"File (or file path) does
11558 * not exist"</code>, respectively. See the full @ref
11559 * Example_Evas_Images "example".
11560 *
11561 * @ingroup Evas_Utils
11562 */
11563EAPI const char *evas_load_error_str (Evas_Load_Error error);
11564
11565/* Evas utility routines for color space conversions */
11566/* hsv color space has h in the range 0.0 to 360.0, and s,v in the range 0.0 to 1.0 */
11567/* rgb color space has r,g,b in the range 0 to 255 */
11568
11569/**
11570 * Convert a given color from HSV to RGB format.
11571 *
11572 * @param h The Hue component of the color.
11573 * @param s The Saturation component of the color.
11574 * @param v The Value component of the color.
11575 * @param r The Red component of the color.
11576 * @param g The Green component of the color.
11577 * @param b The Blue component of the color.
11578 *
11579 * This function converts a given color in HSV color format to RGB
11580 * color format.
11581 *
11582 * @ingroup Evas_Utils
11583 **/
11584EAPI void evas_color_hsv_to_rgb (float h, float s, float v, int *r, int *g, int *b);
11585
11586/**
11587 * Convert a given color from RGB to HSV format.
11588 *
11589 * @param r The Red component of the color.
11590 * @param g The Green component of the color.
11591 * @param b The Blue component of the color.
11592 * @param h The Hue component of the color.
11593 * @param s The Saturation component of the color.
11594 * @param v The Value component of the color.
11595 *
11596 * This function converts a given color in RGB color format to HSV
11597 * color format.
11598 *
11599 * @ingroup Evas_Utils
11600 **/
11601EAPI void evas_color_rgb_to_hsv (int r, int g, int b, float *h, float *s, float *v);
11602
11603/* argb color space has a,r,g,b in the range 0 to 255 */
11604
11605/**
11606 * Pre-multiplies a rgb triplet by an alpha factor.
11607 *
11608 * @param a The alpha factor.
11609 * @param r The Red component of the color.
11610 * @param g The Green component of the color.
11611 * @param b The Blue component of the color.
11612 *
11613 * This function pre-multiplies a given rbg triplet by an alpha
11614 * factor. Alpha factor is used to define transparency.
11615 *
11616 * @ingroup Evas_Utils
11617 **/
11618EAPI void evas_color_argb_premul (int a, int *r, int *g, int *b);
11619
11620/**
11621 * Undo pre-multiplication of a rgb triplet by an alpha factor.
11622 *
11623 * @param a The alpha factor.
11624 * @param r The Red component of the color.
11625 * @param g The Green component of the color.
11626 * @param b The Blue component of the color.
11627 *
11628 * This function undoes pre-multiplication a given rbg triplet by an
11629 * alpha factor. Alpha factor is used to define transparency.
11630 *
11631 * @see evas_color_argb_premul().
11632 *
11633 * @ingroup Evas_Utils
11634 **/
11635EAPI void evas_color_argb_unpremul (int a, int *r, int *g, int *b);
11636
11637
11638/**
11639 * Pre-multiplies data by an alpha factor.
11640 *
11641 * @param data The data value.
11642 * @param len The length value.
11643 *
11644 * This function pre-multiplies a given data by an alpha
11645 * factor. Alpha factor is used to define transparency.
11646 *
11647 * @ingroup Evas_Utils
11648 **/
11649EAPI void evas_data_argb_premul (unsigned int *data, unsigned int len);
11650
11651/**
11652 * Undo pre-multiplication data by an alpha factor.
11653 *
11654 * @param data The data value.
11655 * @param len The length value.
11656 *
11657 * This function undoes pre-multiplication of a given data by an alpha
11658 * factor. Alpha factor is used to define transparency.
11659 *
11660 * @ingroup Evas_Utils
11661 **/
11662EAPI void evas_data_argb_unpremul (unsigned int *data, unsigned int len);
11663
11664/* string and font handling */
11665
11666/**
11667 * Gets the next character in the string
11668 *
11669 * Given the UTF-8 string in @p str, and starting byte position in @p pos,
11670 * this function will place in @p decoded the decoded code point at @p pos
11671 * and return the byte index for the next character in the string.
11672 *
11673 * The only boundary check done is that @p pos must be >= 0. Other than that,
11674 * no checks are performed, so passing an index value that's not within the
11675 * length of the string will result in undefined behavior.
11676 *
11677 * @param str The UTF-8 string
11678 * @param pos The byte index where to start
11679 * @param decoded Address where to store the decoded code point. Optional.
11680 *
11681 * @return The byte index of the next character
11682 *
11683 * @ingroup Evas_Utils
11684 */
11685EAPI int evas_string_char_next_get (const char *str, int pos, int *decoded) EINA_ARG_NONNULL(1);
11686
11687/**
11688 * Gets the previous character in the string
11689 *
11690 * Given the UTF-8 string in @p str, and starting byte position in @p pos,
11691 * this function will place in @p decoded the decoded code point at @p pos
11692 * and return the byte index for the previous character in the string.
11693 *
11694 * The only boundary check done is that @p pos must be >= 1. Other than that,
11695 * no checks are performed, so passing an index value that's not within the
11696 * length of the string will result in undefined behavior.
11697 *
11698 * @param str The UTF-8 string
11699 * @param pos The byte index where to start
11700 * @param decoded Address where to store the decoded code point. Optional.
11701 *
11702 * @return The byte index of the previous character
11703 *
11704 * @ingroup Evas_Utils
11705 */
11706EAPI int evas_string_char_prev_get (const char *str, int pos, int *decoded) EINA_ARG_NONNULL(1);
11707
11708/**
11709 * Get the length in characters of the string.
11710 * @param str The string to get the length of.
11711 * @return The length in characters (not bytes)
11712 * @ingroup Evas_Utils
11713 */
11714EAPI int evas_string_char_len_get (const char *str) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
11715
11716/**
11717 * @defgroup Evas_Keys Key Input Functions
11718 *
11719 * Functions which feed key events to the canvas.
11720 *
11721 * As explained in @ref intro_not_evas, Evas is @b not aware of input
11722 * systems at all. Then, the user, if using it crudely (evas_new()),
11723 * will have to feed it with input events, so that it can react
11724 * somehow. If, however, the user creates a canvas by means of the
11725 * Ecore_Evas wrapper, it will automatically bind the chosen display
11726 * engine's input events to the canvas, for you.
11727 *
11728 * This group presents the functions dealing with the feeding of key
11729 * events to the canvas. On most of them, one has to reference a given
11730 * key by a name (<code>keyname</code> argument). Those are
11731 * <b>platform dependent</b> symbolic names for the keys. Sometimes
11732 * you'll get the right <code>keyname</code> by simply using an ASCII
11733 * value of the key name, but it won't be like that always.
11734 *
11735 * Typical platforms are Linux frame buffer (Ecore_FB) and X server
11736 * (Ecore_X) when using Evas with Ecore and Ecore_Evas. Please refer
11737 * to your display engine's documentation when using evas through an
11738 * Ecore helper wrapper when you need the <code>keyname</code>s.
11739 *
11740 * Example:
11741 * @dontinclude evas-events.c
11742 * @skip mods = evas_key_modifier_get(evas);
11743 * @until {
11744 *
11745 * All the other @c evas_key functions behave on the same manner. See
11746 * the full @ref Example_Evas_Events "example".
11747 *
11748 * @ingroup Evas_Canvas
11749 */
11750
11751/**
11752 * @addtogroup Evas_Keys
11753 * @{
11754 */
11755
11756/**
11757 * Returns a handle to the list of modifier keys registered in the
11758 * canvas @p e. This is required to check for which modifiers are set
11759 * at a given time with the evas_key_modifier_is_set() function.
11760 *
11761 * @param e The pointer to the Evas canvas
11762 *
11763 * @see evas_key_modifier_add
11764 * @see evas_key_modifier_del
11765 * @see evas_key_modifier_on
11766 * @see evas_key_modifier_off
11767 * @see evas_key_modifier_is_set
11768 *
11769 * @return An ::Evas_Modifier handle to query Evas' keys subsystem
11770 * with evas_key_modifier_is_set(), or @c NULL on error.
11771 */
11772EAPI const Evas_Modifier *evas_key_modifier_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
11773
11774/**
11775 * Returns a handle to the list of lock keys registered in the canvas
11776 * @p e. This is required to check for which locks are set at a given
11777 * time with the evas_key_lock_is_set() function.
11778 *
11779 * @param e The pointer to the Evas canvas
11780 *
11781 * @see evas_key_lock_add
11782 * @see evas_key_lock_del
11783 * @see evas_key_lock_on
11784 * @see evas_key_lock_off
11785 * @see evas_key_lock_is_set
11786 *
11787 * @return An ::Evas_Lock handle to query Evas' keys subsystem with
11788 * evas_key_lock_is_set(), or @c NULL on error.
11789 */
11790EAPI const Evas_Lock *evas_key_lock_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
11791
11792
11793/**
11794 * Checks the state of a given modifier key, at the time of the
11795 * call. If the modifier is set, such as shift being pressed, this
11796 * function returns @c Eina_True.
11797 *
11798 * @param m The current modifiers set, as returned by
11799 * evas_key_modifier_get().
11800 * @param keyname The name of the modifier key to check status for.
11801 *
11802 * @return @c Eina_True if the modifier key named @p keyname is on, @c
11803 * Eina_False otherwise.
11804 *
11805 * @see evas_key_modifier_add
11806 * @see evas_key_modifier_del
11807 * @see evas_key_modifier_get
11808 * @see evas_key_modifier_on
11809 * @see evas_key_modifier_off
11810 */
11811EAPI Eina_Bool evas_key_modifier_is_set (const Evas_Modifier *m, const char *keyname) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
11812
11813
11814/**
11815 * Checks the state of a given lock key, at the time of the call. If
11816 * the lock is set, such as caps lock, this function returns @c
11817 * Eina_True.
11818 *
11819 * @param l The current locks set, as returned by evas_key_lock_get().
11820 * @param keyname The name of the lock key to check status for.
11821 *
11822 * @return @c Eina_True if the @p keyname lock key is set, @c
11823 * Eina_False otherwise.
11824 *
11825 * @see evas_key_lock_get
11826 * @see evas_key_lock_add
11827 * @see evas_key_lock_del
11828 * @see evas_key_lock_on
11829 * @see evas_key_lock_off
11830 */
11831EAPI Eina_Bool evas_key_lock_is_set (const Evas_Lock *l, const char *keyname) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
11832
11833
11834/**
11835 * Adds the @p keyname key to the current list of modifier keys.
11836 *
11837 * @param e The pointer to the Evas canvas
11838 * @param keyname The name of the modifier key to add to the list of
11839 * Evas modifiers.
11840 *
11841 * Modifiers are keys like shift, alt and ctrl, i.e., keys which are
11842 * meant to be pressed together with others, altering the behavior of
11843 * the secondly pressed keys somehow. Evas is so that these keys can
11844 * be user defined.
11845 *
11846 * This call allows custom modifiers to be added to the Evas system at
11847 * run time. It is then possible to set and unset modifier keys
11848 * programmatically for other parts of the program to check and act
11849 * on. Programmers using Evas would check for modifier keys on key
11850 * event callbacks using evas_key_modifier_is_set().
11851 *
11852 * @see evas_key_modifier_del
11853 * @see evas_key_modifier_get
11854 * @see evas_key_modifier_on
11855 * @see evas_key_modifier_off
11856 * @see evas_key_modifier_is_set
11857 *
11858 * @note If the programmer instantiates the canvas by means of the
11859 * ecore_evas_new() family of helper functions, Ecore will take
11860 * care of registering on it all standard modifiers: "Shift",
11861 * "Control", "Alt", "Meta", "Hyper", "Super".
11862 */
11863EAPI void evas_key_modifier_add (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
11864
11865/**
11866 * Removes the @p keyname key from the current list of modifier keys
11867 * on canvas @e.
11868 *
11869 * @param e The pointer to the Evas canvas
11870 * @param keyname The name of the key to remove from the modifiers list.
11871 *
11872 * @see evas_key_modifier_add
11873 * @see evas_key_modifier_get
11874 * @see evas_key_modifier_on
11875 * @see evas_key_modifier_off
11876 * @see evas_key_modifier_is_set
11877 */
11878EAPI void evas_key_modifier_del (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
11879
11880/**
11881 * Adds the @p keyname key to the current list of lock keys.
11882 *
11883 * @param e The pointer to the Evas canvas
11884 * @param keyname The name of the key to add to the locks list.
11885 *
11886 * Locks are keys like caps lock, num lock or scroll lock, i.e., keys
11887 * which are meant to be pressed once -- toggling a binary state which
11888 * is bound to it -- and thus altering the behavior of all
11889 * subsequently pressed keys somehow, depending on its state. Evas is
11890 * so that these keys can be defined by the user.
11891 *
11892 * This allows custom locks to be added to the evas system at run
11893 * time. It is then possible to set and unset lock keys
11894 * programmatically for other parts of the program to check and act
11895 * on. Programmers using Evas would check for lock keys on key event
11896 * callbacks using evas_key_lock_is_set().
11897 *
11898 * @see evas_key_lock_get
11899 * @see evas_key_lock_del
11900 * @see evas_key_lock_on
11901 * @see evas_key_lock_off
11902 * @see evas_key_lock_is_set
11903 *
11904 * @note If the programmer instantiates the canvas by means of the
11905 * ecore_evas_new() family of helper functions, Ecore will take
11906 * care of registering on it all standard lock keys: "Caps_Lock",
11907 * "Num_Lock", "Scroll_Lock".
11908 */
11909EAPI void evas_key_lock_add (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
11910
11911/**
11912 * Removes the @p keyname key from the current list of lock keys on
11913 * canvas @e.
11914 *
11915 * @param e The pointer to the Evas canvas
11916 * @param keyname The name of the key to remove from the locks list.
11917 *
11918 * @see evas_key_lock_get
11919 * @see evas_key_lock_add
11920 * @see evas_key_lock_on
11921 * @see evas_key_lock_off
11922 */
11923EAPI void evas_key_lock_del (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
11924
11925
11926/**
11927 * Enables or turns on programmatically the modifier key with name @p
11928 * keyname.
11929 *
11930 * @param e The pointer to the Evas canvas
11931 * @param keyname The name of the modifier to enable.
11932 *
11933 * The effect will be as if the key was pressed for the whole time
11934 * between this call and a matching evas_key_modifier_off().
11935 *
11936 * @see evas_key_modifier_add
11937 * @see evas_key_modifier_get
11938 * @see evas_key_modifier_off
11939 * @see evas_key_modifier_is_set
11940 */
11941EAPI void evas_key_modifier_on (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
11942
11943/**
11944 * Disables or turns off programmatically the modifier key with name
11945 * @p keyname.
11946 *
11947 * @param e The pointer to the Evas canvas
11948 * @param keyname The name of the modifier to disable.
11949 *
11950 * @see evas_key_modifier_add
11951 * @see evas_key_modifier_get
11952 * @see evas_key_modifier_on
11953 * @see evas_key_modifier_is_set
11954 */
11955EAPI void evas_key_modifier_off (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
11956
11957/**
11958 * Enables or turns on programmatically the lock key with name @p
11959 * keyname.
11960 *
11961 * @param e The pointer to the Evas canvas
11962 * @param keyname The name of the lock to enable.
11963 *
11964 * The effect will be as if the key was put on its active state after
11965 * this call.
11966 *
11967 * @see evas_key_lock_get
11968 * @see evas_key_lock_add
11969 * @see evas_key_lock_del
11970 * @see evas_key_lock_off
11971 */
11972EAPI void evas_key_lock_on (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
11973
11974/**
11975 * Disables or turns off programmatically the lock key with name @p
11976 * keyname.
11977 *
11978 * @param e The pointer to the Evas canvas
11979 * @param keyname The name of the lock to disable.
11980 *
11981 * The effect will be as if the key was put on its inactive state
11982 * after this call.
11983 *
11984 * @see evas_key_lock_get
11985 * @see evas_key_lock_add
11986 * @see evas_key_lock_del
11987 * @see evas_key_lock_on
11988 */
11989EAPI void evas_key_lock_off (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
11990
11991
11992/**
11993 * Creates a bit mask from the @p keyname @b modifier key. Values
11994 * returned from different calls to it may be ORed together,
11995 * naturally.
11996 *
11997 * @param e The canvas whom to query the bit mask from.
11998 * @param keyname The name of the modifier key to create the mask for.
11999 *
12000 * @returns the bit mask or 0 if the @p keyname key wasn't registered as a
12001 * modifier for canvas @p e.
12002 *
12003 * This function is meant to be using in conjunction with
12004 * evas_object_key_grab()/evas_object_key_ungrab(). Go check their
12005 * documentation for more information.
12006 *
12007 * @see evas_key_modifier_add
12008 * @see evas_key_modifier_get
12009 * @see evas_key_modifier_on
12010 * @see evas_key_modifier_off
12011 * @see evas_key_modifier_is_set
12012 * @see evas_object_key_grab
12013 * @see evas_object_key_ungrab
12014 */
12015EAPI Evas_Modifier_Mask evas_key_modifier_mask_get (const Evas *e, const char *keyname) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
12016
12017
12018/**
12019 * Requests @p keyname key events be directed to @p obj.
12020 *
12021 * @param obj the object to direct @p keyname events to.
12022 * @param keyname the key to request events for.
12023 * @param modifiers a mask of modifiers that must be present to
12024 * trigger the event.
12025 * @param not_modifiers a mask of modifiers that must @b not be present
12026 * to trigger the event.
12027 * @param exclusive request that the @p obj is the only object
12028 * receiving the @p keyname events.
12029 * @return @c EINA_TRUE, if the call succeeded, @c EINA_FALSE otherwise.
12030 *
12031 * Key grabs allow one or more objects to receive key events for
12032 * specific key strokes even if other objects have focus. Whenever a
12033 * key is grabbed, only the objects grabbing it will get the events
12034 * for the given keys.
12035 *
12036 * @p keyname is a platform dependent symbolic name for the key
12037 * pressed (see @ref Evas_Keys for more information).
12038 *
12039 * @p modifiers and @p not_modifiers are bit masks of all the
12040 * modifiers that must and mustn't, respectively, be pressed along
12041 * with @p keyname key in order to trigger this new key
12042 * grab. Modifiers can be things such as Shift and Ctrl as well as
12043 * user defigned types via evas_key_modifier_add(). Retrieve them with
12044 * evas_key_modifier_mask_get() or use @c 0 for empty masks.
12045 *
12046 * @p exclusive will make the given object the only one permitted to
12047 * grab the given key. If given @c EINA_TRUE, subsequent calls on this
12048 * function with different @p obj arguments will fail, unless the key
12049 * is ungrabbed again.
12050 *
12051 * Example code follows.
12052 * @dontinclude evas-events.c
12053 * @skip if (d.focus)
12054 * @until else
12055 *
12056 * See the full example @ref Example_Evas_Events "here".
12057 *
12058 * @see evas_object_key_ungrab
12059 * @see evas_object_focus_set
12060 * @see evas_object_focus_get
12061 * @see evas_focus_get
12062 * @see evas_key_modifier_add
12063 */
12064EAPI Eina_Bool evas_object_key_grab (Evas_Object *obj, const char *keyname, Evas_Modifier_Mask modifiers, Evas_Modifier_Mask not_modifiers, Eina_Bool exclusive) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
12065
12066/**
12067 * Removes the grab on @p keyname key events by @p obj.
12068 *
12069 * @param obj the object that has an existing key grab.
12070 * @param keyname the key the grab is set for.
12071 * @param modifiers a mask of modifiers that must be present to
12072 * trigger the event.
12073 * @param not_modifiers a mask of modifiers that must not not be
12074 * present to trigger the event.
12075 *
12076 * Removes a key grab on @p obj if @p keyname, @p modifiers, and @p
12077 * not_modifiers match.
12078 *
12079 * Example code follows.
12080 * @dontinclude evas-events.c
12081 * @skip got here by key grabs
12082 * @until }
12083 *
12084 * See the full example @ref Example_Evas_Events "here".
12085 *
12086 * @see evas_object_key_grab
12087 * @see evas_object_focus_set
12088 * @see evas_object_focus_get
12089 * @see evas_focus_get
12090 */
12091EAPI void evas_object_key_ungrab (Evas_Object *obj, const char *keyname, Evas_Modifier_Mask modifiers, Evas_Modifier_Mask not_modifiers) EINA_ARG_NONNULL(1, 2);
12092
12093/**
12094 * @}
12095 */
12096
12097/**
12098 * @defgroup Evas_Touch_Point_List Touch Point List Functions
12099 *
12100 * Functions to get information of touched points in the Evas.
12101 *
12102 * Evas maintains list of touched points on the canvas. Each point has
12103 * its co-ordinates, id and state. You can get the number of touched
12104 * points and information of each point using evas_touch_point_list
12105 * functions.
12106 *
12107 * @ingroup Evas_Canvas
12108 */
12109
12110/**
12111 * @addtogroup Evas_Touch_Point_List
12112 * @{
12113 */
12114
12115/**
12116 * Get the number of touched point in the evas.
12117 *
12118 * @param e The pointer to the Evas canvas.
12119 * @return The number of touched point on the evas.
12120 *
12121 * New touched point is added to the list whenever touching the evas
12122 * and point is removed whenever removing touched point from the evas.
12123 *
12124 * Example:
12125 * @code
12126 * extern Evas *evas;
12127 * int count;
12128 *
12129 * count = evas_touch_point_list_count(evas);
12130 * printf("The count of touch points: %i\n", count);
12131 * @endcode
12132 *
12133 * @see evas_touch_point_list_nth_xy_get()
12134 * @see evas_touch_point_list_nth_id_get()
12135 * @see evas_touch_point_list_nth_state_get()
12136 */
12137EAPI unsigned int evas_touch_point_list_count(Evas *e) EINA_ARG_NONNULL(1);
12138
12139/**
12140 * This function returns the nth touch point's co-ordinates.
12141 *
12142 * @param e The pointer to the Evas canvas.
12143 * @param n The number of the touched point (0 being the first).
12144 * @param x The pointer to a Evas_Coord to be filled in.
12145 * @param y The pointer to a Evas_Coord to be filled in.
12146 *
12147 * Touch point's co-ordinates is updated whenever moving that point
12148 * on the canvas.
12149 *
12150 * Example:
12151 * @code
12152 * extern Evas *evas;
12153 * Evas_Coord x, y;
12154 *
12155 * if (evas_touch_point_list_count(evas))
12156 * {
12157 * evas_touch_point_nth_xy_get(evas, 0, &x, &y);
12158 * printf("The first touch point's co-ordinate: (%i, %i)\n", x, y);
12159 * }
12160 * @endcode
12161 *
12162 * @see evas_touch_point_list_count()
12163 * @see evas_touch_point_list_nth_id_get()
12164 * @see evas_touch_point_list_nth_state_get()
12165 */
12166EAPI void evas_touch_point_list_nth_xy_get(Evas *e, unsigned int n, Evas_Coord *x, Evas_Coord *y) EINA_ARG_NONNULL(1);
12167
12168/**
12169 * This function returns the @p id of nth touch point.
12170 *
12171 * @param e The pointer to the Evas canvas.
12172 * @param n The number of the touched point (0 being the first).
12173 * @return id of nth touch point, if the call succeeded, -1 otherwise.
12174 *
12175 * The point which comes from Mouse Event has @p id 0 and The point
12176 * which comes from Multi Event has @p id that is same as Multi
12177 * Event's device id.
12178 *
12179 * Example:
12180 * @code
12181 * extern Evas *evas;
12182 * int id;
12183 *
12184 * if (evas_touch_point_list_count(evas))
12185 * {
12186 * id = evas_touch_point_nth_id_get(evas, 0);
12187 * printf("The first touch point's id: %i\n", id);
12188 * }
12189 * @endcode
12190 *
12191 * @see evas_touch_point_list_count()
12192 * @see evas_touch_point_list_nth_xy_get()
12193 * @see evas_touch_point_list_nth_state_get()
12194 */
12195EAPI int evas_touch_point_list_nth_id_get(Evas *e, unsigned int n) EINA_ARG_NONNULL(1);
12196
12197/**
12198 * This function returns the @p state of nth touch point.
12199 *
12200 * @param e The pointer to the Evas canvas.
12201 * @param n The number of the touched point (0 being the first).
12202 * @return @p state of nth touch point, if the call succeeded,
12203 * EVAS_TOUCH_POINT_CANCEL otherwise.
12204 *
12205 * The point's @p state is EVAS_TOUCH_POINT_DOWN when pressed,
12206 * EVAS_TOUCH_POINT_STILL when the point is not moved after pressed,
12207 * EVAS_TOUCH_POINT_MOVE when moved at least once after pressed and
12208 * EVAS_TOUCH_POINT_UP when released.
12209 *
12210 * Example:
12211 * @code
12212 * extern Evas *evas;
12213 * Evas_Touch_Point_State state;
12214 *
12215 * if (evas_touch_point_list_count(evas))
12216 * {
12217 * state = evas_touch_point_nth_state_get(evas, 0);
12218 * printf("The first touch point's state: %i\n", state);
12219 * }
12220 * @endcode
12221 *
12222 * @see evas_touch_point_list_count()
12223 * @see evas_touch_point_list_nth_xy_get()
12224 * @see evas_touch_point_list_nth_id_get()
12225 */
12226EAPI Evas_Touch_Point_State evas_touch_point_list_nth_state_get(Evas *e, unsigned int n) EINA_ARG_NONNULL(1);
12227
12228/**
12229 * @}
12230 */
12231
12232#ifdef __cplusplus
12233}
12234#endif
12235
12236#endif
diff --git a/libraries/evas/src/lib/Evas_GL.h b/libraries/evas/src/lib/Evas_GL.h
new file mode 100644
index 0000000..04bedea
--- /dev/null
+++ b/libraries/evas/src/lib/Evas_GL.h
@@ -0,0 +1,1412 @@
1#ifndef _EVAS_GL_H
2#define _EVAS_GL_H
3
4#include <Evas.h>
5//#include <GL/gl.h>
6
7#ifdef __cplusplus
8extern "C" {
9#endif
10
11typedef struct _Evas_GL Evas_GL;
12typedef struct _Evas_GL_Surface Evas_GL_Surface;
13typedef struct _Evas_GL_Context Evas_GL_Context;
14typedef struct _Evas_GL_Config Evas_GL_Config;
15typedef struct _Evas_GL_API Evas_GL_API;
16typedef void *Evas_GL_Func;
17typedef void *EvasGLImage;
18
19typedef enum _Evas_GL_Color_Format
20{
21 EVAS_GL_RGB_888 = 0,
22 EVAS_GL_RGBA_8888 = 1
23} Evas_GL_Color_Format;
24
25typedef enum _Evas_GL_Depth_Bits
26{
27 EVAS_GL_DEPTH_NONE = 0,
28 EVAS_GL_DEPTH_BIT_8 = 1,
29 EVAS_GL_DEPTH_BIT_16 = 2,
30 EVAS_GL_DEPTH_BIT_24 = 3,
31 EVAS_GL_DEPTH_BIT_32 = 4,
32} Evas_GL_Depth_Bits;
33
34typedef enum _Evas_GL_Stencil_Bits
35{
36 EVAS_GL_STENCIL_NONE = 0,
37 EVAS_GL_STENCIL_BIT_1 = 1,
38 EVAS_GL_STENCIL_BIT_2 = 2,
39 EVAS_GL_STENCIL_BIT_4 = 3,
40 EVAS_GL_STENCIL_BIT_8 = 4,
41 EVAS_GL_STENCIL_BIT_16 = 5,
42} Evas_GL_Stencil_Bits;
43
44struct _Evas_GL_Config
45{
46 Evas_GL_Color_Format color_format;
47 Evas_GL_Depth_Bits depth_bits;
48 Evas_GL_Stencil_Bits stencil_bits;
49};
50
51#define EVAS_GL_EXTENSIONS 1
52
53
54/**
55 * @defgroup Evas_GL Rendering GL on Evas
56 *
57 * Functions that are used to do OpenGL rendering on Evas. Evas allows you
58 * to use OpenGL to render to specially set up image objects (which act as
59 * render target surfaces).
60 *
61 * Below is an illlustrative example of how to use OpenGL to render to an
62 * object in Evas.
63 *
64 * @code
65// Simple Evas_GL example
66#include <Ecore_Evas.h>
67#include <Ecore.h>
68#include <Evas_GL.h>
69#include <stdio.h>
70
71// GL related data here..
72typedef struct _GLData
73{
74 Evas_GL_Context *ctx;
75 Evas_GL_Surface *sfc;
76 Evas_GL *evasgl;
77 Evas_GL_API *glapi;
78 GLuint program;
79 GLuint vtx_shader;
80 GLuint fgmt_shader;
81 Eina_Bool initialized : 1;
82} GLData;
83
84// callbacks we want to handle deletion on the object and updates/draws
85static void on_del (void *data, Evas *e, Evas_Object *obj, void *event_info);
86static void on_pixels (void *data, Evas_Object *obj);
87// demo - animator just to keep ticking over saying to draw the image
88static Eina_Bool on_animate (void *data);
89// gl stuff
90static int init_shaders (GLData *gld);
91static GLuint load_shader (GLData *gld, GLenum type, const char *shader_src);
92
93int
94main(int argc, char **argv)
95{
96 // config for the surface for evas_gl
97 Evas_GL_Config config =
98 {
99 EVAS_GL_RGBA_8888,
100 EVAS_GL_DEPTH_NONE,
101 EVAS_GL_STENCIL_NONE
102 };
103 // a size by default
104 int w = 256, h = 256;
105 // some variables we will use
106 Ecore_Evas *ee;
107 Evas *canvas;
108 Evas_Object *r1;
109 Evas_Native_Surface ns;
110 GLData *gld = NULL;
111
112 // regular low-leve EFL (ecore+ecore-evas) init. elm is simpler
113 ecore_init();
114 ecore_evas_init();
115 ee = ecore_evas_gl_x11_new(NULL, 0, 0, 0, 512, 512);
116 ecore_evas_title_set(ee, "Ecore_Evas Template");
117 canvas = ecore_evas_get(ee);
118
119 // alloc a data struct to hold our relevant gl info in
120 if (!(gld = calloc(1, sizeof(GLData)))) return 0;
121
122 //-//-//-// THIS IS WHERE GL INIT STUFF HAPPENS (ALA EGL)
123 //-//
124 // get the evas gl handle for doing gl things
125 gld->evasgl = evas_gl_new(canvas);
126 gld->glapi = evas_gl_api_get(gld->evasgl);
127 // create a surface and context
128 gld->sfc = evas_gl_surface_create(gld->evasgl, &config, w, h);
129 gld->ctx = evas_gl_context_create(gld->evasgl, NULL);
130 //-//
131 //-//-//-// END GL INIT BLOB
132
133 // set up the image object. a filled one by default
134 r1 = evas_object_image_filled_add(canvas);
135 // attach important data we need to the object using key names. this just
136 // avoids some global variables and means we can do nice cleanup. you can
137 // avoid this if you are lazy
138 evas_object_data_set(r1, "..gld", gld);
139 // when the object is deleted - call the on_del callback. like the above,
140 // this is just being clean
141 evas_object_event_callback_add(r1, EVAS_CALLBACK_DEL, on_del, NULL);
142 // set up an actual pixel size fot the buffer data. it may be different
143 // to the output size. any windowing system has something like this, just
144 // evas has 2 sizes, a pixel size and the output object size
145 evas_object_image_size_set(r1, w, h);
146 // set up the native surface info to use the context and surface created
147 // above
148
149 //-//-//-// THIS IS WHERE GL INIT STUFF HAPPENS (ALA EGL)
150 //-//
151 evas_gl_native_surface_get(gld->evasgl, gld->sfc, &ns);
152 evas_object_image_native_surface_set(r1, &ns);
153 evas_object_image_pixels_get_callback_set(r1, on_pixels, r1);
154 //-//
155 //-//-//-// END GL INIT BLOB
156
157 // move the image object somewhere, resize it and show it. any windowing
158 // system would need this kind of thing - place a child "window"
159 evas_object_move(r1, 128, 128);
160 evas_object_resize(r1, w, h);
161 evas_object_show(r1);
162
163 // animating - just a demo. as long as you trigger an update on the image
164 // object via evas_object_image_pixels_dirty_set(). any display system,
165 // mainloop siztem etc. will have something of this kind unless it's making
166 // you spin infinitely yourself and invent your own animation mechanism
167 //
168 // NOTE: if you delete r1, this animator will keep running trying to access
169 // r1 so you'd better delete this animator with ecore_animator_del() or
170 // structure how you do animation differently. you can also attach it like
171 // evasgl, sfc, etc. etc. if this animator is specific to this object
172 // only and delete it in the del handler for the obj.
173 ecore_animator_add(on_animate, r1);
174
175 // finally show the window for the world to see. windowing system generic
176 ecore_evas_show(ee);
177
178 // begin the mainloop and tick over the animator, handle events etc.
179 // also windowing system generic
180 ecore_main_loop_begin();
181
182 // standard EFL shutdown stuff - generic for most systems, EFL or not
183 ecore_evas_shutdown();
184 ecore_shutdown();
185 return 0;
186}
187
188static void
189on_del(void *data, Evas *e, Evas_Object *obj, void *event_info)
190{
191 // on delete of our object clean up some things that don't get auto
192 // celeted for us as they are not intrinsically bound to the image
193 // object as such (you could use the same context and surface across
194 // multiple image objects and re-use the evasgl handle too multiple times.
195 // here we bind them to 1 object only though by doing this.
196 GLData *gld = evas_object_data_get(obj, "..gld");
197 if (!gld) return;
198 Evas_GL_API *gl = gld->glapi;
199
200 evas_object_data_del(obj, "..gld");
201
202 // Do a make_current before deleting all the GL stuff.
203 evas_gl_make_current(gld->evasgl, gld->sfc, gld->ctx);
204 gl->glDeleteShader(gld->vtx_shader);
205 gl->glDeleteShader(gld->fgmt_shader);
206 gl->glDeleteProgram(gld->program);
207
208 evas_gl_surface_destroy(gld->evasgl, gld->sfc);
209 evas_gl_context_destroy(gld->evasgl, gld->ctx);
210 evas_gl_free(gld->evasgl);
211 free(gld);
212}
213
214static void
215on_pixels(void *data, Evas_Object *obj)
216{
217 // get some variable we need from the object data keys
218 GLData *gld = evas_object_data_get(obj, "..gld");
219 if (!gld) return;
220 Evas_GL_API *gl = gld->glapi;
221 GLfloat vVertices[] =
222 {
223 0.0f, 0.5f, 0.0f,
224 -0.5f, -0.5f, 0.0f,
225 0.5f, -0.5f, 0.0f
226 };
227 int w, h;
228
229 // get the image size in case it changed with evas_object_image_size_set()
230 evas_object_image_size_get(obj, &w, &h);
231 // set up the context and surface as the current one
232 evas_gl_make_current(gld->evasgl, gld->sfc, gld->ctx);
233
234 if (!gld->initialized)
235 {
236 if (!init_shaders(gld)) printf("Error Initializing Shaders\n");
237 gld->initialized = EINA_TRUE;
238 }
239
240 // GL Viewport stuff. you can avoid doing this if viewport is all the
241 // same as last frame if you want
242 gl->glViewport(0, 0, w, h);
243
244 // Clear the buffer
245 gl->glClearColor(1.0, 0.0, 0.0, 1);
246 gl->glClear(GL_COLOR_BUFFER_BIT);
247
248 // Draw a Triangle
249 gl->glEnable(GL_BLEND);
250
251 gl->glUseProgram(gld->program);
252
253 gl->glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, vVertices);
254 gl->glEnableVertexAttribArray(0);
255
256 gl->glDrawArrays(GL_TRIANGLES, 0, 3);
257
258 // Optional - Flush the GL pipeline
259 gl->glFlush();
260}
261
262static Eina_Bool
263on_animate(void *data)
264{
265 // just a demo - animate here whenever an animation tick happens and then
266 // mark the image as "dirty" meaning it needs an update next time evas
267 // renders. it will call the pixel get callback then.
268 evas_object_image_pixels_dirty_set(data, EINA_TRUE);
269 return EINA_TRUE; // keep looping
270}
271
272static GLuint
273load_shader(GLData *gld, GLenum type, const char *shader_src)
274{
275 Evas_GL_API *gl = gld->glapi;
276 GLuint shader;
277 GLint compiled = 0;
278
279 // Create the shader object
280 if (!(shader = gl->glCreateShader(type))) return 0;
281 gl->glShaderSource(shader, 1, &shader_src, NULL);
282 // Compile the shader
283 gl->glCompileShader(shader);
284 gl->glGetShaderiv(shader, GL_COMPILE_STATUS, &compiled);
285
286 if (!compiled)
287 {
288 GLint len = 0;
289
290 gl->glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &len);
291 if (len > 1)
292 {
293 char *info = malloc(sizeof(char) * len);
294
295 if (info)
296 {
297 gl->glGetShaderInfoLog(shader, len, NULL, info);
298 printf("Error compiling shader:\n"
299 "%s\n", info);
300 free(info);
301 }
302 }
303 gl->glDeleteShader(shader);
304 return 0;
305 }
306 return shader;
307}
308
309// Initialize the shader and program object
310static int
311init_shaders(GLData *gld)
312{
313 Evas_GL_API *gl = gld->glapi;
314 const char vShaderStr[] =
315 "attribute vec4 vPosition; \n"
316 "void main() \n"
317 "{ \n"
318 " gl_Position = vPosition; \n"
319 "} \n";
320 const char fShaderStr[] =
321 "precision mediump float; \n"
322 "void main() \n"
323 "{ \n"
324 " gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n"
325 "} \n";
326 GLint linked = 0;
327
328 // Load the vertex/fragment shaders
329 gld->vtx_shader = load_shader(gld, GL_VERTEX_SHADER, vShaderStr);
330 gld->fgmt_shader = load_shader(gld, GL_FRAGMENT_SHADER, fShaderStr);
331
332 // Create the program object
333 if (!(gld->program = gl->glCreateProgram())) return 0;
334
335 gl->glAttachShader(gld->program, gld->vtx_shader);
336 gl->glAttachShader(gld->program, gld->fgmt_shader);
337
338 // Bind vPosition to attribute 0
339 gl->glBindAttribLocation(gld->program, 0, "vPosition");
340 // Link the program
341 gl->glLinkProgram(gld->program);
342 gl->glGetProgramiv(gld->program, GL_LINK_STATUS, &linked);
343
344 if (!linked)
345 {
346 GLint len = 0;
347
348 gl->glGetProgramiv(gld->program, GL_INFO_LOG_LENGTH, &len);
349 if (len > 1)
350 {
351 char *info = malloc(sizeof(char) * len);
352
353 if (info)
354 {
355 gl->glGetProgramInfoLog(gld->program, len, NULL, info);
356 printf("Error linking program:\n"
357 "%s\n", info);
358 free(info);
359 }
360 }
361 gl->glDeleteProgram(gld->program);
362 return 0;
363 }
364 return 1;
365}
366 * @endcode
367 *
368 * @ingroup Evas_Canvas
369 */
370
371/**
372 * @addtogroup Evas_GL
373 * @{
374 */
375
376/**
377 * Creates a new Evas_GL object and returns a handle for gl rendering on efl.
378 *
379 * @param e The given evas canvas OpenGL is to be used on.
380 * @return The created evas_gl object, or NULl on fasilure.
381 */
382EAPI Evas_GL *evas_gl_new (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
383
384/**
385 * Frees the created Evas_GL object.
386 *
387 * @param evas_gl The given Evas_GL object.
388 */
389EAPI void evas_gl_free (Evas_GL *evas_gl) EINA_ARG_NONNULL(1);
390
391/**
392 * Creates and returns new Evas_GL_Surface object for GL Rendering.
393 *
394 * @param evas_gl The given Evas_GL object.
395 * @param config The pixel format and configuration of the rendering surface.
396 * @param width The width of the surface.
397 * @param height The height of the surface.
398 * @return The created GL surface object, or NULL on failure.
399 */
400EAPI Evas_GL_Surface *evas_gl_surface_create (Evas_GL *evas_gl, Evas_GL_Config *cfg, int w, int h) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1,2);
401
402/**
403 * Destroys the created Evas GL Surface.
404 *
405 * @param evas_gl The given Evas_GL object.
406 * @param surf The given GL surface object.
407 */
408EAPI void evas_gl_surface_destroy (Evas_GL *evas_gl, Evas_GL_Surface *surf) EINA_ARG_NONNULL(1,2);
409
410/**
411 * Creates and returns a new Evas GL context object
412 *
413 * @param evas_gl The given Evas_GL object.
414 * @return The created context, or NULL on failure.
415 */
416EAPI Evas_GL_Context *evas_gl_context_create (Evas_GL *evas_gl, Evas_GL_Context *share_ctx) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
417
418/**
419 * Destroys the given Evas GL context object
420 *
421 * @param evas_gl The given Evas_GL object.
422 * @param ctx The given Evas GL context.
423 */
424EAPI void evas_gl_context_destroy (Evas_GL *evas_gl, Evas_GL_Context *ctx) EINA_ARG_NONNULL(1,2);
425
426/**
427 * Sets the given context as a current context for the given surface
428 *
429 * @param evas_gl The given Evas_GL object.
430 * @param surf The given Evas GL surface.
431 * @param ctx The given Evas GL context.
432 * @return EINA_TRUE if successful, EINA_FALSE if not.
433 */
434EAPI Eina_Bool evas_gl_make_current (Evas_GL *evas_gl, Evas_GL_Surface *surf, Evas_GL_Context *ctx) EINA_ARG_NONNULL(1,2);
435
436/**
437 * Returns a pointer to a static, zero-terminated string describing some aspect of evas_gl.
438 *
439 * @param evas_gl The given Evas_GL object.
440 * @param name Specifies a symbolic constant, one of EVAS_GL_EXTENSIONS...
441 */
442EAPI const char *evas_gl_string_query (Evas_GL *evas_gl, int name) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
443
444/**
445 * Returns a GL or the Glue Layer's extension function.
446 *
447 * @param evas_gl The given Evas_GL object.
448 * @param name The name of the function to return.
449 */
450EAPI Evas_GL_Func evas_gl_proc_address_get (Evas_GL *evas_gl, const char *name) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1,2) EINA_PURE;
451
452/**
453 * Fills in the Native Surface information from the given Evas GL surface.
454 *
455 * @param evas_gl The given Evas_GL object.
456 * @param surf The given Evas GL surface to retrieve the Native Surface info from.
457 * @param ns The native surface structure that the function fills in.
458 * @return EINA_TRUE if successful, EINA_FALSE if not.
459 */
460EAPI Eina_Bool evas_gl_native_surface_get (Evas_GL *evas_gl, Evas_GL_Surface *surf, Evas_Native_Surface *ns) EINA_ARG_NONNULL(1,2,3);
461
462/**
463 * Get the API for rendering using OpenGL
464 *
465 * @param evas_gl The given Eva_GL object.
466 * @return The API to use.
467 *
468 * This returns a structure that contains all the OpenGL functions you can
469 * use to render in Evas. These functions consist of all the standard
470 * OpenGL-ES2.0 functions and any extra ones Evas has decided to provide in
471 * addition. This means that if you have your code ported to OpenGL-ES2.0,
472 * it will be easy to render to Evas.
473 *
474 */
475EAPI Evas_GL_API *evas_gl_api_get (Evas_GL *evas_gl) EINA_ARG_NONNULL(1);
476
477#if !defined(__gl_h_) && !defined(__gl2_h_)
478# define __gl_h_
479# define __gl2_h_
480
481/*
482 * This document is licensed under the SGI Free Software B License Version
483 * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
484 */
485
486/*-------------------------------------------------------------------------
487 * Data type definitions
488 *-----------------------------------------------------------------------*/
489
490typedef void GLvoid;
491typedef unsigned int GLenum;
492typedef unsigned char GLboolean;
493typedef unsigned int GLbitfield;
494typedef signed char GLbyte; // Changed khronos_int8_t
495typedef short GLshort;
496typedef int GLint;
497typedef int GLsizei;
498typedef unsigned char GLubyte; // Changed khronos_uint8_t
499typedef unsigned short GLushort;
500typedef unsigned int GLuint;
501typedef float GLfloat; // Changed khronos_float_t
502typedef float GLclampf; // Changed khronos_float_t
503typedef signed int GLfixed; // Changed khronos_int32_t
504
505/* GL types for handling large vertex buffer objects */
506typedef signed long int GLintptr; // Changed khronos_intptr_t
507typedef signed long int GLsizeiptr; // Changed khronos_ssize_t
508
509//#if (!defined(__gl2_h_) && !defined(__gl_h_))
510
511/* OpenGL ES core versions */
512//#define GL_ES_VERSION_2_0 1
513
514/* ClearBufferMask */
515#define GL_DEPTH_BUFFER_BIT 0x00000100
516#define GL_STENCIL_BUFFER_BIT 0x00000400
517#define GL_COLOR_BUFFER_BIT 0x00004000
518
519/* Boolean */
520#define GL_FALSE 0
521#define GL_TRUE 1
522
523/* BeginMode */
524#define GL_POINTS 0x0000
525#define GL_LINES 0x0001
526#define GL_LINE_LOOP 0x0002
527#define GL_LINE_STRIP 0x0003
528#define GL_TRIANGLES 0x0004
529#define GL_TRIANGLE_STRIP 0x0005
530#define GL_TRIANGLE_FAN 0x0006
531
532/* AlphaFunction (not supported in ES20) */
533/* GL_NEVER */
534/* GL_LESS */
535/* GL_EQUAL */
536/* GL_LEQUAL */
537/* GL_GREATER */
538/* GL_NOTEQUAL */
539/* GL_GEQUAL */
540/* GL_ALWAYS */
541
542/* BlendingFactorDest */
543#define GL_ZERO 0
544#define GL_ONE 1
545#define GL_SRC_COLOR 0x0300
546#define GL_ONE_MINUS_SRC_COLOR 0x0301
547#define GL_SRC_ALPHA 0x0302
548#define GL_ONE_MINUS_SRC_ALPHA 0x0303
549#define GL_DST_ALPHA 0x0304
550#define GL_ONE_MINUS_DST_ALPHA 0x0305
551
552/* BlendingFactorSrc */
553/* GL_ZERO */
554/* GL_ONE */
555#define GL_DST_COLOR 0x0306
556#define GL_ONE_MINUS_DST_COLOR 0x0307
557#define GL_SRC_ALPHA_SATURATE 0x0308
558/* GL_SRC_ALPHA */
559/* GL_ONE_MINUS_SRC_ALPHA */
560/* GL_DST_ALPHA */
561/* GL_ONE_MINUS_DST_ALPHA */
562
563/* BlendEquationSeparate */
564#define GL_FUNC_ADD 0x8006
565#define GL_BLEND_EQUATION 0x8009
566#define GL_BLEND_EQUATION_RGB 0x8009 /* same as BLEND_EQUATION */
567#define GL_BLEND_EQUATION_ALPHA 0x883D
568
569/* BlendSubtract */
570#define GL_FUNC_SUBTRACT 0x800A
571#define GL_FUNC_REVERSE_SUBTRACT 0x800B
572
573/* Separate Blend Functions */
574#define GL_BLEND_DST_RGB 0x80C8
575#define GL_BLEND_SRC_RGB 0x80C9
576#define GL_BLEND_DST_ALPHA 0x80CA
577#define GL_BLEND_SRC_ALPHA 0x80CB
578#define GL_CONSTANT_COLOR 0x8001
579#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
580#define GL_CONSTANT_ALPHA 0x8003
581#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
582#define GL_BLEND_COLOR 0x8005
583
584/* Buffer Objects */
585#define GL_ARRAY_BUFFER 0x8892
586#define GL_ELEMENT_ARRAY_BUFFER 0x8893
587#define GL_ARRAY_BUFFER_BINDING 0x8894
588#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
589
590#define GL_STREAM_DRAW 0x88E0
591#define GL_STATIC_DRAW 0x88E4
592#define GL_DYNAMIC_DRAW 0x88E8
593
594#define GL_BUFFER_SIZE 0x8764
595#define GL_BUFFER_USAGE 0x8765
596
597#define GL_CURRENT_VERTEX_ATTRIB 0x8626
598
599/* CullFaceMode */
600#define GL_FRONT 0x0404
601#define GL_BACK 0x0405
602#define GL_FRONT_AND_BACK 0x0408
603
604/* DepthFunction */
605/* GL_NEVER */
606/* GL_LESS */
607/* GL_EQUAL */
608/* GL_LEQUAL */
609/* GL_GREATER */
610/* GL_NOTEQUAL */
611/* GL_GEQUAL */
612/* GL_ALWAYS */
613
614/* EnableCap */
615#define GL_TEXTURE_2D 0x0DE1
616#define GL_CULL_FACE 0x0B44
617#define GL_BLEND 0x0BE2
618#define GL_DITHER 0x0BD0
619#define GL_STENCIL_TEST 0x0B90
620#define GL_DEPTH_TEST 0x0B71
621#define GL_SCISSOR_TEST 0x0C11
622#define GL_POLYGON_OFFSET_FILL 0x8037
623#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
624#define GL_SAMPLE_COVERAGE 0x80A0
625
626/* ErrorCode */
627#define GL_NO_ERROR 0
628#define GL_INVALID_ENUM 0x0500
629#define GL_INVALID_VALUE 0x0501
630#define GL_INVALID_OPERATION 0x0502
631#define GL_OUT_OF_MEMORY 0x0505
632
633/* FrontFaceDirection */
634#define GL_CW 0x0900
635#define GL_CCW 0x0901
636
637/* GetPName */
638#define GL_LINE_WIDTH 0x0B21
639#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
640#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
641#define GL_CULL_FACE_MODE 0x0B45
642#define GL_FRONT_FACE 0x0B46
643#define GL_DEPTH_RANGE 0x0B70
644#define GL_DEPTH_WRITEMASK 0x0B72
645#define GL_DEPTH_CLEAR_VALUE 0x0B73
646#define GL_DEPTH_FUNC 0x0B74
647#define GL_STENCIL_CLEAR_VALUE 0x0B91
648#define GL_STENCIL_FUNC 0x0B92
649#define GL_STENCIL_FAIL 0x0B94
650#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
651#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
652#define GL_STENCIL_REF 0x0B97
653#define GL_STENCIL_VALUE_MASK 0x0B93
654#define GL_STENCIL_WRITEMASK 0x0B98
655#define GL_STENCIL_BACK_FUNC 0x8800
656#define GL_STENCIL_BACK_FAIL 0x8801
657#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802
658#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803
659#define GL_STENCIL_BACK_REF 0x8CA3
660#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4
661#define GL_STENCIL_BACK_WRITEMASK 0x8CA5
662#define GL_VIEWPORT 0x0BA2
663#define GL_SCISSOR_BOX 0x0C10
664/* GL_SCISSOR_TEST */
665#define GL_COLOR_CLEAR_VALUE 0x0C22
666#define GL_COLOR_WRITEMASK 0x0C23
667#define GL_UNPACK_ALIGNMENT 0x0CF5
668#define GL_PACK_ALIGNMENT 0x0D05
669#define GL_MAX_TEXTURE_SIZE 0x0D33
670#define GL_MAX_VIEWPORT_DIMS 0x0D3A
671#define GL_SUBPIXEL_BITS 0x0D50
672#define GL_RED_BITS 0x0D52
673#define GL_GREEN_BITS 0x0D53
674#define GL_BLUE_BITS 0x0D54
675#define GL_ALPHA_BITS 0x0D55
676#define GL_DEPTH_BITS 0x0D56
677#define GL_STENCIL_BITS 0x0D57
678#define GL_POLYGON_OFFSET_UNITS 0x2A00
679/* GL_POLYGON_OFFSET_FILL */
680#define GL_POLYGON_OFFSET_FACTOR 0x8038
681#define GL_TEXTURE_BINDING_2D 0x8069
682#define GL_SAMPLE_BUFFERS 0x80A8
683#define GL_SAMPLES 0x80A9
684#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
685#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
686
687/* GetTextureParameter */
688/* GL_TEXTURE_MAG_FILTER */
689/* GL_TEXTURE_MIN_FILTER */
690/* GL_TEXTURE_WRAP_S */
691/* GL_TEXTURE_WRAP_T */
692
693#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
694#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
695
696/* HintMode */
697#define GL_DONT_CARE 0x1100
698#define GL_FASTEST 0x1101
699#define GL_NICEST 0x1102
700
701/* HintTarget */
702#define GL_GENERATE_MIPMAP_HINT 0x8192
703
704/* DataType */
705#define GL_BYTE 0x1400
706#define GL_UNSIGNED_BYTE 0x1401
707#define GL_SHORT 0x1402
708#define GL_UNSIGNED_SHORT 0x1403
709#define GL_INT 0x1404
710#define GL_UNSIGNED_INT 0x1405
711#define GL_FLOAT 0x1406
712#define GL_FIXED 0x140C
713
714/* PixelFormat */
715#define GL_DEPTH_COMPONENT 0x1902
716#define GL_ALPHA 0x1906
717#define GL_RGB 0x1907
718#define GL_RGBA 0x1908
719#define GL_LUMINANCE 0x1909
720#define GL_LUMINANCE_ALPHA 0x190A
721
722/* PixelType */
723/* GL_UNSIGNED_BYTE */
724#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
725#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
726#define GL_UNSIGNED_SHORT_5_6_5 0x8363
727
728/* Shaders */
729#define GL_FRAGMENT_SHADER 0x8B30
730#define GL_VERTEX_SHADER 0x8B31
731#define GL_MAX_VERTEX_ATTRIBS 0x8869
732#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB
733#define GL_MAX_VARYING_VECTORS 0x8DFC
734#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
735#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
736#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
737#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD
738#define GL_SHADER_TYPE 0x8B4F
739#define GL_DELETE_STATUS 0x8B80
740#define GL_LINK_STATUS 0x8B82
741#define GL_VALIDATE_STATUS 0x8B83
742#define GL_ATTACHED_SHADERS 0x8B85
743#define GL_ACTIVE_UNIFORMS 0x8B86
744#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
745#define GL_ACTIVE_ATTRIBUTES 0x8B89
746#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
747#define GL_SHADING_LANGUAGE_VERSION 0x8B8C
748#define GL_CURRENT_PROGRAM 0x8B8D
749
750/* StencilFunction */
751#define GL_NEVER 0x0200
752#define GL_LESS 0x0201
753#define GL_EQUAL 0x0202
754#define GL_LEQUAL 0x0203
755#define GL_GREATER 0x0204
756#define GL_NOTEQUAL 0x0205
757#define GL_GEQUAL 0x0206
758#define GL_ALWAYS 0x0207
759
760/* StencilOp */
761/* GL_ZERO */
762#define GL_KEEP 0x1E00
763#define GL_REPLACE 0x1E01
764#define GL_INCR 0x1E02
765#define GL_DECR 0x1E03
766#define GL_INVERT 0x150A
767#define GL_INCR_WRAP 0x8507
768#define GL_DECR_WRAP 0x8508
769
770/* StringName */
771#define GL_VENDOR 0x1F00
772#define GL_RENDERER 0x1F01
773#define GL_VERSION 0x1F02
774#define GL_EXTENSIONS 0x1F03
775
776/* TextureMagFilter */
777#define GL_NEAREST 0x2600
778#define GL_LINEAR 0x2601
779
780/* TextureMinFilter */
781/* GL_NEAREST */
782/* GL_LINEAR */
783#define GL_NEAREST_MIPMAP_NEAREST 0x2700
784#define GL_LINEAR_MIPMAP_NEAREST 0x2701
785#define GL_NEAREST_MIPMAP_LINEAR 0x2702
786#define GL_LINEAR_MIPMAP_LINEAR 0x2703
787
788/* TextureParameterName */
789#define GL_TEXTURE_MAG_FILTER 0x2800
790#define GL_TEXTURE_MIN_FILTER 0x2801
791#define GL_TEXTURE_WRAP_S 0x2802
792#define GL_TEXTURE_WRAP_T 0x2803
793
794/* TextureTarget */
795/* GL_TEXTURE_2D */
796#define GL_TEXTURE 0x1702
797
798#define GL_TEXTURE_CUBE_MAP 0x8513
799#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
800#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
801#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
802#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
803#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
804#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
805#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
806#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
807
808/* TextureUnit */
809#define GL_TEXTURE0 0x84C0
810#define GL_TEXTURE1 0x84C1
811#define GL_TEXTURE2 0x84C2
812#define GL_TEXTURE3 0x84C3
813#define GL_TEXTURE4 0x84C4
814#define GL_TEXTURE5 0x84C5
815#define GL_TEXTURE6 0x84C6
816#define GL_TEXTURE7 0x84C7
817#define GL_TEXTURE8 0x84C8
818#define GL_TEXTURE9 0x84C9
819#define GL_TEXTURE10 0x84CA
820#define GL_TEXTURE11 0x84CB
821#define GL_TEXTURE12 0x84CC
822#define GL_TEXTURE13 0x84CD
823#define GL_TEXTURE14 0x84CE
824#define GL_TEXTURE15 0x84CF
825#define GL_TEXTURE16 0x84D0
826#define GL_TEXTURE17 0x84D1
827#define GL_TEXTURE18 0x84D2
828#define GL_TEXTURE19 0x84D3
829#define GL_TEXTURE20 0x84D4
830#define GL_TEXTURE21 0x84D5
831#define GL_TEXTURE22 0x84D6
832#define GL_TEXTURE23 0x84D7
833#define GL_TEXTURE24 0x84D8
834#define GL_TEXTURE25 0x84D9
835#define GL_TEXTURE26 0x84DA
836#define GL_TEXTURE27 0x84DB
837#define GL_TEXTURE28 0x84DC
838#define GL_TEXTURE29 0x84DD
839#define GL_TEXTURE30 0x84DE
840#define GL_TEXTURE31 0x84DF
841#define GL_ACTIVE_TEXTURE 0x84E0
842
843/* TextureWrapMode */
844#define GL_REPEAT 0x2901
845#define GL_CLAMP_TO_EDGE 0x812F
846#define GL_MIRRORED_REPEAT 0x8370
847
848/* Uniform Types */
849#define GL_FLOAT_VEC2 0x8B50
850#define GL_FLOAT_VEC3 0x8B51
851#define GL_FLOAT_VEC4 0x8B52
852#define GL_INT_VEC2 0x8B53
853#define GL_INT_VEC3 0x8B54
854#define GL_INT_VEC4 0x8B55
855#define GL_BOOL 0x8B56
856#define GL_BOOL_VEC2 0x8B57
857#define GL_BOOL_VEC3 0x8B58
858#define GL_BOOL_VEC4 0x8B59
859#define GL_FLOAT_MAT2 0x8B5A
860#define GL_FLOAT_MAT3 0x8B5B
861#define GL_FLOAT_MAT4 0x8B5C
862#define GL_SAMPLER_2D 0x8B5E
863#define GL_SAMPLER_CUBE 0x8B60
864
865/* Vertex Arrays */
866#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622
867#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623
868#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624
869#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625
870#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
871#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645
872#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
873
874/* Read Format */
875#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A
876#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B
877
878/* Shader Source */
879#define GL_COMPILE_STATUS 0x8B81
880#define GL_INFO_LOG_LENGTH 0x8B84
881#define GL_SHADER_SOURCE_LENGTH 0x8B88
882#define GL_SHADER_COMPILER 0x8DFA
883
884/* Shader Binary */
885#define GL_SHADER_BINARY_FORMATS 0x8DF8
886#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9
887
888/* Shader Precision-Specified Types */
889#define GL_LOW_FLOAT 0x8DF0
890#define GL_MEDIUM_FLOAT 0x8DF1
891#define GL_HIGH_FLOAT 0x8DF2
892#define GL_LOW_INT 0x8DF3
893#define GL_MEDIUM_INT 0x8DF4
894#define GL_HIGH_INT 0x8DF5
895
896/* Framebuffer Object. */
897#define GL_FRAMEBUFFER 0x8D40
898#define GL_RENDERBUFFER 0x8D41
899
900#define GL_RGBA4 0x8056
901#define GL_RGB5_A1 0x8057
902#define GL_RGB565 0x8D62
903#define GL_DEPTH_COMPONENT16 0x81A5
904#define GL_STENCIL_INDEX 0x1901
905#define GL_STENCIL_INDEX8 0x8D48
906
907#define GL_RENDERBUFFER_WIDTH 0x8D42
908#define GL_RENDERBUFFER_HEIGHT 0x8D43
909#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44
910#define GL_RENDERBUFFER_RED_SIZE 0x8D50
911#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51
912#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52
913#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53
914#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54
915#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55
916
917#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
918#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
919#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
920#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
921
922#define GL_COLOR_ATTACHMENT0 0x8CE0
923#define GL_DEPTH_ATTACHMENT 0x8D00
924#define GL_STENCIL_ATTACHMENT 0x8D20
925
926#define GL_NONE 0
927
928#define GL_FRAMEBUFFER_COMPLETE 0x8CD5
929#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
930#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
931#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9
932#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD
933
934#define GL_FRAMEBUFFER_BINDING 0x8CA6
935#define GL_RENDERBUFFER_BINDING 0x8CA7
936#define GL_MAX_RENDERBUFFER_SIZE 0x84E8
937
938#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506
939
940//---------------------------//
941// GLES extension defines
942
943/* GL_OES_compressed_ETC1_RGB8_texture */
944#define GL_ETC1_RGB8_OES 0x8D64
945
946/* GL_OES_compressed_paletted_texture */
947#define GL_PALETTE4_RGB8_OES 0x8B90
948#define GL_PALETTE4_RGBA8_OES 0x8B91
949#define GL_PALETTE4_R5_G6_B5_OES 0x8B92
950#define GL_PALETTE4_RGBA4_OES 0x8B93
951#define GL_PALETTE4_RGB5_A1_OES 0x8B94
952#define GL_PALETTE8_RGB8_OES 0x8B95
953#define GL_PALETTE8_RGBA8_OES 0x8B96
954#define GL_PALETTE8_R5_G6_B5_OES 0x8B97
955#define GL_PALETTE8_RGBA4_OES 0x8B98
956#define GL_PALETTE8_RGB5_A1_OES 0x8B99
957
958/* GL_OES_depth24 */
959#define GL_DEPTH_COMPONENT24_OES 0x81A6
960
961/* GL_OES_depth32 */
962#define GL_DEPTH_COMPONENT32_OES 0x81A7
963
964/* GL_OES_get_program_binary */
965#define GL_PROGRAM_BINARY_LENGTH_OES 0x8741
966#define GL_NUM_PROGRAM_BINARY_FORMATS_OES 0x87FE
967#define GL_PROGRAM_BINARY_FORMATS_OES 0x87FF
968
969/* GL_OES_mapbuffer */
970#define GL_WRITE_ONLY_OES 0x88B9
971#define GL_BUFFER_ACCESS_OES 0x88BB
972#define GL_BUFFER_MAPPED_OES 0x88BC
973#define GL_BUFFER_MAP_POINTER_OES 0x88BD
974
975/* GL_OES_packed_depth_stencil */
976#define GL_DEPTH_STENCIL_OES 0x84F9
977#define GL_UNSIGNED_INT_24_8_OES 0x84FA
978#define GL_DEPTH24_STENCIL8_OES 0x88F0
979
980/* GL_OES_rgb8_rgba8 */
981#define GL_RGB8_OES 0x8051
982#define GL_RGBA8_OES 0x8058
983
984/* GL_OES_standard_derivatives */
985#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES 0x8B8B
986
987/* GL_OES_stencil1 */
988#define GL_STENCIL_INDEX1_OES 0x8D46
989
990/* GL_OES_stencil4 */
991#define GL_STENCIL_INDEX4_OES 0x8D47
992
993/* GL_OES_texture_3D */
994#define GL_TEXTURE_WRAP_R_OES 0x8072
995#define GL_TEXTURE_3D_OES 0x806F
996#define GL_TEXTURE_BINDING_3D_OES 0x806A
997#define GL_MAX_3D_TEXTURE_SIZE_OES 0x8073
998#define GL_SAMPLER_3D_OES 0x8B5F
999#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_OES 0x8CD4
1000
1001/* GL_OES_texture_float */
1002/* No new tokens introduced by this extension. */
1003
1004/* GL_OES_texture_float_linear */
1005/* No new tokens introduced by this extension. */
1006
1007/* GL_OES_texture_half_float */
1008#define GL_HALF_FLOAT_OES 0x8D61
1009
1010/* GL_OES_texture_half_float_linear */
1011/* No new tokens introduced by this extension. */
1012
1013/* GL_OES_texture_npot */
1014/* No new tokens introduced by this extension. */
1015
1016/* GL_OES_vertex_half_float */
1017/* GL_HALF_FLOAT_OES defined in GL_OES_texture_half_float already. */
1018
1019/* GL_OES_vertex_type_10_10_10_2 */
1020#define GL_UNSIGNED_INT_10_10_10_2_OES 0x8DF6
1021#define GL_INT_10_10_10_2_OES 0x8DF7
1022
1023/*------------------------------------------------------------------------*
1024 * AMD extension tokens
1025 *------------------------------------------------------------------------*/
1026
1027/* GL_AMD_compressed_3DC_texture */
1028#define GL_3DC_X_AMD 0x87F9
1029#define GL_3DC_XY_AMD 0x87FA
1030
1031/* GL_AMD_compressed_ATC_texture */
1032#define GL_ATC_RGB_AMD 0x8C92
1033#define GL_ATC_RGBA_EXPLICIT_ALPHA_AMD 0x8C93
1034#define GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD 0x87EE
1035
1036/* GL_AMD_performance_monitor */
1037#define GL_COUNTER_TYPE_AMD 0x8BC0
1038#define GL_COUNTER_RANGE_AMD 0x8BC1
1039#define GL_UNSIGNED_INT64_AMD 0x8BC2
1040#define GL_PERCENTAGE_AMD 0x8BC3
1041#define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4
1042#define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5
1043#define GL_PERFMON_RESULT_AMD 0x8BC6
1044
1045/* GL_AMD_program_binary_Z400 */
1046#define GL_Z400_BINARY_AMD 0x8740
1047
1048/*------------------------------------------------------------------------*
1049 * EXT extension tokens
1050 *------------------------------------------------------------------------*/
1051
1052/* GL_EXT_blend_minmax */
1053#define GL_MIN_EXT 0x8007
1054#define GL_MAX_EXT 0x8008
1055
1056/* GL_EXT_discard_framebuffer */
1057#define GL_COLOR_EXT 0x1800
1058#define GL_DEPTH_EXT 0x1801
1059#define GL_STENCIL_EXT 0x1802
1060
1061/* GL_EXT_multi_draw_arrays */
1062/* No new tokens introduced by this extension. */
1063
1064/* GL_EXT_read_format_bgra */
1065#define GL_BGRA_EXT 0x80E1
1066#define GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT 0x8365
1067#define GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT 0x8366
1068
1069/* GL_EXT_texture_filter_anisotropic */
1070#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE
1071#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
1072
1073/* GL_EXT_texture_format_BGRA8888 */
1074#define GL_BGRA_EXT 0x80E1
1075
1076/* GL_EXT_texture_type_2_10_10_10_REV */
1077#define GL_UNSIGNED_INT_2_10_10_10_REV_EXT 0x8368
1078
1079/*------------------------------------------------------------------------*
1080 * IMG extension tokens
1081 *------------------------------------------------------------------------*/
1082
1083/* GL_IMG_program_binary */
1084#define GL_SGX_PROGRAM_BINARY_IMG 0x9130
1085
1086/* GL_IMG_read_format */
1087#define GL_BGRA_IMG 0x80E1
1088#define GL_UNSIGNED_SHORT_4_4_4_4_REV_IMG 0x8365
1089
1090/* GL_IMG_shader_binary */
1091#define GL_SGX_BINARY_IMG 0x8C0A
1092
1093/* GL_IMG_texture_compression_pvrtc */
1094#define GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG 0x8C00
1095#define GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG 0x8C01
1096#define GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG 0x8C02
1097#define GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG 0x8C03
1098
1099/*------------------------------------------------------------------------*
1100 * NV extension tokens
1101 *------------------------------------------------------------------------*/
1102
1103/* GL_NV_fence */
1104#define GL_ALL_COMPLETED_NV 0x84F2
1105#define GL_FENCE_STATUS_NV 0x84F3
1106#define GL_FENCE_CONDITION_NV 0x84F4
1107
1108/*------------------------------------------------------------------------*
1109 * QCOM extension tokens
1110 *------------------------------------------------------------------------*/
1111
1112/* GL_QCOM_driver_control */
1113/* No new tokens introduced by this extension. */
1114
1115/* GL_QCOM_extended_get */
1116#define GL_TEXTURE_WIDTH_QCOM 0x8BD2
1117#define GL_TEXTURE_HEIGHT_QCOM 0x8BD3
1118#define GL_TEXTURE_DEPTH_QCOM 0x8BD4
1119#define GL_TEXTURE_INTERNAL_FORMAT_QCOM 0x8BD5
1120#define GL_TEXTURE_FORMAT_QCOM 0x8BD6
1121#define GL_TEXTURE_TYPE_QCOM 0x8BD7
1122#define GL_TEXTURE_IMAGE_VALID_QCOM 0x8BD8
1123#define GL_TEXTURE_NUM_LEVELS_QCOM 0x8BD9
1124#define GL_TEXTURE_TARGET_QCOM 0x8BDA
1125#define GL_TEXTURE_OBJECT_VALID_QCOM 0x8BDB
1126#define GL_STATE_RESTORE 0x8BDC
1127
1128/* GL_QCOM_extended_get2 */
1129/* No new tokens introduced by this extension. */
1130
1131/* GL_QCOM_perfmon_global_mode */
1132#define GL_PERFMON_GLOBAL_MODE_QCOM 0x8FA0
1133
1134/* GL_QCOM_writeonly_rendering */
1135#define GL_WRITEONLY_RENDERING_QCOM 0x8823
1136
1137/*------------------------------------------------------------------------*
1138 * End of extension tokens, start of corresponding extension functions
1139 *------------------------------------------------------------------------*/
1140
1141/* EvasGL_KHR_image */
1142#define EVAS_GL_NATIVE_PIXMAP 0x30B0 /* evasglCreateImage target */
1143
1144/* EvasGL_KHR_vg_parent_image */
1145#define EVAS_VG_PARENT_IMAGE 0x30BA /* evasglCreateImage target */
1146
1147/* EvasGL_KHR_gl_texture_2D_image */
1148#define EVAS_GL_TEXTURE_2D 0x30B1 /* evasglCreateImage target */
1149#define EVAS_GL_TEXTURE_LEVEL 0x30BC /* evasglCreateImage attribute */
1150
1151/* EvasGL_KHR_gl_texture_cubemap_image */
1152#define EVAS_GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x30B3 /* evasglCreateImage target */
1153#define EVAS_GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x30B4 /* evasglCreateImage target */
1154#define EVAS_GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x30B5 /* evasglCreateImage target */
1155#define EVAS_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x30B6 /* evasglCreateImage target */
1156#define EVAS_GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x30B7 /* evasglCreateImage target */
1157#define EVAS_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x30B8 /* evasglCreateImage target */
1158
1159/* EvasGL_KHR_gl_texture_3D_image */
1160#define EVAS_GL_TEXTURE_3D 0x30B2 /* evasglCreateImage target */
1161#define EVAS_GL_TEXTURE_ZOFFSET 0x30BD /* evasglCreateImage attribute */
1162
1163/* EvasGL_KHR_gl_renderbuffer_image */
1164#define EVAS_GL_RENDERBUFFER 0x30B9 /* evasglCreateImage target */
1165
1166#else
1167# ifndef EVAS_GL_NO_GL_H_CHECK
1168# error "You may only include either Evas_GL.h OR use your native OpenGL's headers. If you use Evas to do GL, then you cannot use the native gl headers."
1169# endif
1170#endif
1171
1172#define EVAS_GL_API_VERSION 1
1173struct _Evas_GL_API
1174{
1175 int version;
1176
1177 /* version 1: */
1178 /*------- GLES 2.0 -------*/
1179 void (*glActiveTexture) (GLenum texture);
1180 void (*glAttachShader) (GLuint program, GLuint shader);
1181 void (*glBindAttribLocation) (GLuint program, GLuint index, const char* name);
1182 void (*glBindBuffer) (GLenum target, GLuint buffer);
1183 void (*glBindFramebuffer) (GLenum target, GLuint framebuffer);
1184 void (*glBindRenderbuffer) (GLenum target, GLuint renderbuffer);
1185 void (*glBindTexture) (GLenum target, GLuint texture);
1186 void (*glBlendColor) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
1187 void (*glBlendEquation) ( GLenum mode );
1188 void (*glBlendEquationSeparate) (GLenum modeRGB, GLenum modeAlpha);
1189 void (*glBlendFunc) (GLenum sfactor, GLenum dfactor);
1190 void (*glBlendFuncSeparate) (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
1191 void (*glBufferData) (GLenum target, GLsizeiptr size, const void* data, GLenum usage);
1192 void (*glBufferSubData) (GLenum target, GLintptr offset, GLsizeiptr size, const void* data);
1193 GLenum (*glCheckFramebufferStatus) (GLenum target);
1194 void (*glClear) (GLbitfield mask);
1195 void (*glClearColor) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
1196 void (*glClearDepthf) (GLclampf depth);
1197 void (*glClearStencil) (GLint s);
1198 void (*glColorMask) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
1199 void (*glCompileShader) (GLuint shader);
1200 void (*glCompressedTexImage2D) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data);
1201 void (*glCompressedTexSubImage2D) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data);
1202 void (*glCopyTexImage2D) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
1203 void (*glCopyTexSubImage2D) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
1204 GLuint (*glCreateProgram) (void);
1205 GLuint (*glCreateShader) (GLenum type);
1206 void (*glCullFace) (GLenum mode);
1207 void (*glDeleteBuffers) (GLsizei n, const GLuint* buffers);
1208 void (*glDeleteFramebuffers) (GLsizei n, const GLuint* framebuffers);
1209 void (*glDeleteProgram) (GLuint program);
1210 void (*glDeleteRenderbuffers) (GLsizei n, const GLuint* renderbuffers);
1211 void (*glDeleteShader) (GLuint shader);
1212 void (*glDeleteTextures) (GLsizei n, const GLuint* textures);
1213 void (*glDepthFunc) (GLenum func);
1214 void (*glDepthMask) (GLboolean flag);
1215 void (*glDepthRangef) (GLclampf zNear, GLclampf zFar);
1216 void (*glDetachShader) (GLuint program, GLuint shader);
1217 void (*glDisable) (GLenum cap);
1218 void (*glDisableVertexAttribArray) (GLuint index);
1219 void (*glDrawArrays) (GLenum mode, GLint first, GLsizei count);
1220 void (*glDrawElements) (GLenum mode, GLsizei count, GLenum type, const void* indices);
1221 void (*glEnable) (GLenum cap);
1222 void (*glEnableVertexAttribArray) (GLuint index);
1223 void (*glFinish) (void);
1224 void (*glFlush) (void);
1225 void (*glFramebufferRenderbuffer) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
1226 void (*glFramebufferTexture2D) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
1227 void (*glFrontFace) (GLenum mode);
1228 void (*glGenBuffers) (GLsizei n, GLuint* buffers);
1229 void (*glGenerateMipmap) (GLenum target);
1230 void (*glGenFramebuffers) (GLsizei n, GLuint* framebuffers);
1231 void (*glGenRenderbuffers) (GLsizei n, GLuint* renderbuffers);
1232 void (*glGenTextures) (GLsizei n, GLuint* textures);
1233 void (*glGetActiveAttrib) (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name);
1234 void (*glGetActiveUniform) (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name);
1235 void (*glGetAttachedShaders) (GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders);
1236 int (*glGetAttribLocation) (GLuint program, const char* name);
1237 void (*glGetBooleanv) (GLenum pname, GLboolean* params);
1238 void (*glGetBufferParameteriv) (GLenum target, GLenum pname, GLint* params);
1239 GLenum (*glGetError) (void);
1240 void (*glGetFloatv) (GLenum pname, GLfloat* params);
1241 void (*glGetFramebufferAttachmentParameteriv) (GLenum target, GLenum attachment, GLenum pname, GLint* params);
1242 void (*glGetIntegerv) (GLenum pname, GLint* params);
1243 void (*glGetProgramiv) (GLuint program, GLenum pname, GLint* params);
1244 void (*glGetProgramInfoLog) (GLuint program, GLsizei bufsize, GLsizei* length, char* infolog);
1245 void (*glGetRenderbufferParameteriv) (GLenum target, GLenum pname, GLint* params);
1246 void (*glGetShaderiv) (GLuint shader, GLenum pname, GLint* params);
1247 void (*glGetShaderInfoLog) (GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog);
1248 void (*glGetShaderPrecisionFormat) (GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
1249 void (*glGetShaderSource) (GLuint shader, GLsizei bufsize, GLsizei* length, char* source);
1250 const GLubyte* (*glGetString) (GLenum name);
1251 void (*glGetTexParameterfv) (GLenum target, GLenum pname, GLfloat* params);
1252 void (*glGetTexParameteriv) (GLenum target, GLenum pname, GLint* params);
1253 void (*glGetUniformfv) (GLuint program, GLint location, GLfloat* params);
1254 void (*glGetUniformiv) (GLuint program, GLint location, GLint* params);
1255 int (*glGetUniformLocation) (GLuint program, const char* name);
1256 void (*glGetVertexAttribfv) (GLuint index, GLenum pname, GLfloat* params);
1257 void (*glGetVertexAttribiv) (GLuint index, GLenum pname, GLint* params);
1258 void (*glGetVertexAttribPointerv) (GLuint index, GLenum pname, void** pointer);
1259 void (*glHint) (GLenum target, GLenum mode);
1260 GLboolean (*glIsBuffer) (GLuint buffer);
1261 GLboolean (*glIsEnabled) (GLenum cap);
1262 GLboolean (*glIsFramebuffer) (GLuint framebuffer);
1263 GLboolean (*glIsProgram) (GLuint program);
1264 GLboolean (*glIsRenderbuffer) (GLuint renderbuffer);
1265 GLboolean (*glIsShader) (GLuint shader);
1266 GLboolean (*glIsTexture) (GLuint texture);
1267 void (*glLineWidth) (GLfloat width);
1268 void (*glLinkProgram) (GLuint program);
1269 void (*glPixelStorei) (GLenum pname, GLint param);
1270 void (*glPolygonOffset) (GLfloat factor, GLfloat units);
1271 void (*glReadPixels) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels);
1272 void (*glReleaseShaderCompiler) (void);
1273 void (*glRenderbufferStorage) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
1274 void (*glSampleCoverage) (GLclampf value, GLboolean invert);
1275 void (*glScissor) (GLint x, GLint y, GLsizei width, GLsizei height);
1276 void (*glShaderBinary) (GLsizei n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLsizei length);
1277 void (*glShaderSource) (GLuint shader, GLsizei count, const char** string, const GLint* length);
1278 void (*glStencilFunc) (GLenum func, GLint ref, GLuint mask);
1279 void (*glStencilFuncSeparate) (GLenum face, GLenum func, GLint ref, GLuint mask);
1280 void (*glStencilMask) (GLuint mask);
1281 void (*glStencilMaskSeparate) (GLenum face, GLuint mask);
1282 void (*glStencilOp) (GLenum fail, GLenum zfail, GLenum zpass);
1283 void (*glStencilOpSeparate) (GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
1284 void (*glTexImage2D) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels);
1285 void (*glTexParameterf) (GLenum target, GLenum pname, GLfloat param);
1286 void (*glTexParameterfv) (GLenum target, GLenum pname, const GLfloat* params);
1287 void (*glTexParameteri) (GLenum target, GLenum pname, GLint param);
1288 void (*glTexParameteriv) (GLenum target, GLenum pname, const GLint* params);
1289 void (*glTexSubImage2D) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels);
1290 void (*glUniform1f) (GLint location, GLfloat x);
1291 void (*glUniform1fv) (GLint location, GLsizei count, const GLfloat* v);
1292 void (*glUniform1i) (GLint location, GLint x);
1293 void (*glUniform1iv) (GLint location, GLsizei count, const GLint* v);
1294 void (*glUniform2f) (GLint location, GLfloat x, GLfloat y);
1295 void (*glUniform2fv) (GLint location, GLsizei count, const GLfloat* v);
1296 void (*glUniform2i) (GLint location, GLint x, GLint y);
1297 void (*glUniform2iv) (GLint location, GLsizei count, const GLint* v);
1298 void (*glUniform3f) (GLint location, GLfloat x, GLfloat y, GLfloat z);
1299 void (*glUniform3fv) (GLint location, GLsizei count, const GLfloat* v);
1300 void (*glUniform3i) (GLint location, GLint x, GLint y, GLint z);
1301 void (*glUniform3iv) (GLint location, GLsizei count, const GLint* v);
1302 void (*glUniform4f) (GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
1303 void (*glUniform4fv) (GLint location, GLsizei count, const GLfloat* v);
1304 void (*glUniform4i) (GLint location, GLint x, GLint y, GLint z, GLint w);
1305 void (*glUniform4iv) (GLint location, GLsizei count, const GLint* v);
1306 void (*glUniformMatrix2fv) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
1307 void (*glUniformMatrix3fv) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
1308 void (*glUniformMatrix4fv) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
1309 void (*glUseProgram) (GLuint program);
1310 void (*glValidateProgram) (GLuint program);
1311 void (*glVertexAttrib1f) (GLuint indx, GLfloat x);
1312 void (*glVertexAttrib1fv) (GLuint indx, const GLfloat* values);
1313 void (*glVertexAttrib2f) (GLuint indx, GLfloat x, GLfloat y);
1314 void (*glVertexAttrib2fv) (GLuint indx, const GLfloat* values);
1315 void (*glVertexAttrib3f) (GLuint indx, GLfloat x, GLfloat y, GLfloat z);
1316 void (*glVertexAttrib3fv) (GLuint indx, const GLfloat* values);
1317 void (*glVertexAttrib4f) (GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
1318 void (*glVertexAttrib4fv) (GLuint indx, const GLfloat* values);
1319 void (*glVertexAttribPointer) (GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr);
1320 void (*glViewport) (GLint x, GLint y, GLsizei width, GLsizei height);
1321
1322 /*------- GLES 2.0 Extensions -------*/
1323 // Notice these two names have been changed to fit Evas GL and not EGL!
1324 /* GL_OES_EvasGL_image */
1325 void (*glEvasGLImageTargetTexture2DOES) (GLenum target, EvasGLImage image);
1326 void (*glEvasGLImageTargetRenderbufferStorageOES) (GLenum target, EvasGLImage image);
1327
1328 /* GL_OES_get_program_binary */
1329 void (*glGetProgramBinaryOES) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary);
1330 void (*glProgramBinaryOES) (GLuint program, GLenum binaryFormat, const void *binary, GLint length);
1331 /* GL_OES_mapbuffer */
1332 void* (*glMapBufferOES) (GLenum target, GLenum access);
1333 GLboolean (*glUnmapBufferOES) (GLenum target);
1334 void (*glGetBufferPointervOES) (GLenum target, GLenum pname, void** params);
1335 /* GL_OES_texture_3D */
1336 void (*glTexImage3DOES) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels);
1337 void (*glTexSubImage3DOES) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels);
1338 void (*glCopyTexSubImage3DOES) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
1339 void (*glCompressedTexImage3DOES) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data);
1340 void (*glCompressedTexSubImage3DOES) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data);
1341 void (*glFramebufferTexture3DOES) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
1342
1343 /* AMD_performance_monitor */
1344 void (*glGetPerfMonitorGroupsAMD) (GLint* numGroups, GLsizei groupsSize, GLuint* groups);
1345 void (*glGetPerfMonitorCountersAMD) (GLuint group, GLint* numCounters, GLint* maxActiveCounters, GLsizei counterSize, GLuint* counters);
1346 void (*glGetPerfMonitorGroupStringAMD) (GLuint group, GLsizei bufSize, GLsizei* length, char* groupString);
1347 void (*glGetPerfMonitorCounterStringAMD) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei* length, char* counterString);
1348 void (*glGetPerfMonitorCounterInfoAMD) (GLuint group, GLuint counter, GLenum pname, void* data);
1349 void (*glGenPerfMonitorsAMD) (GLsizei n, GLuint* monitors);
1350 void (*glDeletePerfMonitorsAMD) (GLsizei n, GLuint* monitors);
1351 void (*glSelectPerfMonitorCountersAMD) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint* countersList);
1352 void (*glBeginPerfMonitorAMD) (GLuint monitor);
1353 void (*glEndPerfMonitorAMD) (GLuint monitor);
1354 void (*glGetPerfMonitorCounterDataAMD) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint* data, GLint* bytesWritten);
1355
1356 /* GL_EXT_discard_framebuffer */
1357 void (*glDiscardFramebufferEXT) (GLenum target, GLsizei numAttachments, const GLenum* attachments);
1358
1359 /* GL_EXT_multi_draw_arrays */
1360 void (*glMultiDrawArraysEXT) (GLenum mode, GLint* first, GLsizei* count, GLsizei primcount);
1361 void (*glMultiDrawElementsEXT) (GLenum mode, const GLsizei* count, GLenum type, const GLvoid** indices, GLsizei primcount);
1362
1363 /* GL_NV_fence */
1364 void (*glDeleteFencesNV) (GLsizei n, const GLuint* fences);
1365 void (*glGenFencesNV) (GLsizei n, GLuint* fences);
1366 GLboolean (*glIsFenceNV) (GLuint fence);
1367 GLboolean (*glTestFenceNV) (GLuint fence);
1368 void (*glGetFenceivNV) (GLuint fence, GLenum pname, GLint* params);
1369 void (*glFinishFenceNV) (GLuint fence);
1370 void (*glSetFenceNV) (GLuint, GLenum);
1371
1372 /* GL_QCOM_driver_control */
1373 void (*glGetDriverControlsQCOM) (GLint* num, GLsizei size, GLuint* driverControls);
1374 void (*glGetDriverControlStringQCOM) (GLuint driverControl, GLsizei bufSize, GLsizei* length, char* driverControlString);
1375 void (*glEnableDriverControlQCOM) (GLuint driverControl);
1376 void (*glDisableDriverControlQCOM) (GLuint driverControl);
1377
1378 /* GL_QCOM_extended_get */
1379 void (*glExtGetTexturesQCOM) (GLuint* textures, GLint maxTextures, GLint* numTextures);
1380 void (*glExtGetBuffersQCOM) (GLuint* buffers, GLint maxBuffers, GLint* numBuffers);
1381 void (*glExtGetRenderbuffersQCOM) (GLuint* renderbuffers, GLint maxRenderbuffers, GLint* numRenderbuffers);
1382 void (*glExtGetFramebuffersQCOM) (GLuint* framebuffers, GLint maxFramebuffers, GLint* numFramebuffers);
1383 void (*glExtGetTexLevelParameterivQCOM) (GLuint texture, GLenum face, GLint level, GLenum pname, GLint* params);
1384 void (*glExtTexObjectStateOverrideiQCOM) (GLenum target, GLenum pname, GLint param);
1385 void (*glExtGetTexSubImageQCOM) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, void* texels);
1386 void (*glExtGetBufferPointervQCOM) (GLenum target, void** params);
1387
1388
1389 /* GL_QCOM_extended_get2 */
1390 void (*glExtGetShadersQCOM) (GLuint* shaders, GLint maxShaders, GLint* numShaders);
1391 void (*glExtGetProgramsQCOM) (GLuint* programs, GLint maxPrograms, GLint* numPrograms);
1392 GLboolean (*glExtIsProgramBinaryQCOM) (GLuint program);
1393 void (*glExtGetProgramBinarySourceQCOM) (GLuint program, GLenum shadertype, char* source, GLint* length);
1394
1395 //------- EGL Related Extensions -------//
1396 /* EvasGL_KHR_image */
1397 EvasGLImage (*evasglCreateImage) (int target, void* buffer, int* attrib_list);
1398 void (*evasglDestroyImage) (EvasGLImage image);
1399
1400 /* future calls will be added down here for expansion */
1401 /* version 2: */
1402};
1403
1404
1405#ifdef __cplusplus
1406}
1407#endif
1408
1409#endif
1410/**
1411 * @}
1412 */
diff --git a/libraries/evas/src/lib/Makefile.am b/libraries/evas/src/lib/Makefile.am
new file mode 100644
index 0000000..6b1011a
--- /dev/null
+++ b/libraries/evas/src/lib/Makefile.am
@@ -0,0 +1,261 @@
1MAINTAINERCLEANFILES = Makefile.in
2
3SUBDIRS = canvas cache cserve file engines include
4EVAS_STATIC_MODULE =
5EVAS_STATIC_LIBADD =
6
7if EVAS_STATIC_BUILD_SOFTWARE_GENERIC
8SUBDIRS += ../modules/engines/software_generic/
9EVAS_STATIC_MODULE += ../modules/engines/software_generic/libevas_engine_software_generic.la
10endif
11if EVAS_STATIC_BUILD_BUFFER
12SUBDIRS += ../modules/engines/buffer/
13EVAS_STATIC_MODULE += ../modules/engines/buffer/libevas_engine_buffer.la
14endif
15if EVAS_STATIC_BUILD_DIRECT3D
16SUBDIRS += ../modules/engines/direct3d/
17EVAS_STATIC_MODULE += ../modules/engines/direct3d/libevas_engine_direct3d.la
18EVAS_STATIC_LIBADD += @evas_engine_direct3d_libs@
19endif
20if EVAS_STATIC_BUILD_DIRECTFB
21SUBDIRS += ../modules/engines/directfb/
22EVAS_STATIC_MODULE += ../modules/engines/directfb/libevas_engine_directfb.la
23EVAS_STATIC_LIBADD += @evas_engine_directfb_libs@
24endif
25if EVAS_STATIC_BUILD_FB
26SUBDIRS += ../modules/engines/fb/
27EVAS_STATIC_MODULE += ../modules/engines/fb/libevas_engine_fb.la
28EVAS_STATIC_LIBADD += @evas_engine_fb_libs@
29endif
30if EVAS_STATIC_BUILD_GL_X11
31SUBDIRS += \
32 ../modules/engines/gl_common \
33 ../modules/engines/gl_x11
34EVAS_STATIC_MODULE += \
35 ../modules/engines/gl_x11/libevas_engine_gl_x11.la
36EVAS_STATIC_LIBADD += @evas_engine_gl_common_libs@ @evas_engine_gl_xlib_libs@
37endif
38if EVAS_STATIC_BUILD_GL_SDL
39SUBDIRS += \
40 ../modules/engines/gl_common \
41 ../modules/engines/gl_sdl
42EVAS_STATIC_MODULE += \
43 ../modules/engines/gl_sdl/libevas_engine_gl_sdl.la
44EVAS_STATIC_LIBADD += @evas_engine_gl_common_libs@ @evas_engine_gl_sdl_libs@
45endif
46if EVAS_STATIC_BUILD_PSL1GHT
47SUBDIRS += ../modules/engines/psl1ght/
48EVAS_STATIC_MODULE += ../modules/engines/psl1ght/libevas_engine_psl1ght.la
49EVAS_STATIC_LIBADD += @evas_engine_psl1ght_libs@
50endif
51if EVAS_STATIC_BUILD_SOFTWARE_16
52SUBDIRS += ../modules/engines/software_16/
53EVAS_STATIC_MODULE += ../modules/engines/software_16/libevas_engine_software_16.la
54endif
55if EVAS_STATIC_BUILD_SOFTWARE_16_DDRAW
56SUBDIRS += ../modules/engines/software_16_ddraw/
57EVAS_STATIC_MODULE += ../modules/engines/software_16_ddraw/libevas_engine_software_16_ddraw.la
58EVAS_STATIC_LIBADD += @evas_engine_software_16_ddraw_libs@
59endif
60if EVAS_STATIC_BUILD_SOFTWARE_16_WINCE
61SUBDIRS += ../modules/engines/software_16_wince/
62EVAS_STATIC_MODULE += ../modules/engines/software_16_wince/libevas_engine_software_16_wince.la
63EVAS_STATIC_LIBADD += @evas_engine_software_16_wince_libs@
64endif
65if EVAS_STATIC_BUILD_SOFTWARE_16_X11
66SUBDIRS += ../modules/engines/software_16_x11/
67EVAS_STATIC_MODULE += ../modules/engines/software_16_x11/libevas_engine_software_16_x11.la
68EVAS_STATIC_LIBADD += @evas_engine_software_16_x11_libs@
69endif
70if EVAS_STATIC_BUILD_SOFTWARE_8
71SUBDIRS += ../modules/engines/software_8/
72EVAS_STATIC_MODULE += ../modules/engines/software_8/libevas_engine_software_8.la
73endif
74if EVAS_STATIC_BUILD_SOFTWARE_8_X11
75SUBDIRS += ../modules/engines/software_8_x11/
76EVAS_STATIC_MODULE += ../modules/engines/software_8_x11/libevas_engine_software_8_x11.la
77EVAS_STATIC_LIBADD += @evas_engine_software_8_x11_libs@
78endif
79if EVAS_STATIC_BUILD_SOFTWARE_SDL
80SUBDIRS += \
81 ../modules/engines/software_16_sdl/ \
82 ../modules/engines/software_sdl/
83EVAS_STATIC_MODULE += \
84 ../modules/engines/software_16_sdl/libevas_engine_software_16_sdl.la \
85 ../modules/engines/software_sdl/libevas_engine_software_sdl.la
86EVAS_STATIC_LIBADD += @SDL_LIBS@
87endif
88if EVAS_STATIC_BUILD_SOFTWARE_DDRAW
89SUBDIRS += ../modules/engines/software_ddraw/
90EVAS_STATIC_MODULE += ../modules/engines/software_ddraw/libevas_engine_software_ddraw.la
91EVAS_STATIC_LIBADD += @evas_engine_software_ddraw_libs@
92endif
93if EVAS_STATIC_BUILD_SOFTWARE_GDI
94SUBDIRS += ../modules/engines/software_gdi/
95EVAS_STATIC_MODULE += ../modules/engines/software_gdi/libevas_engine_software_gdi.la
96EVAS_STATIC_LIBADD += @evas_engine_software_gdi_libs@
97endif
98if EVAS_STATIC_BUILD_SOFTWARE_X11
99SUBDIRS += ../modules/engines/software_x11/
100EVAS_STATIC_MODULE += ../modules/engines/software_x11/libevas_engine_software_x11.la
101EVAS_STATIC_LIBADD += @evas_engine_software_xlib_libs@ @evas_engine_software_xcb_libs@
102endif
103if EVAS_STATIC_BUILD_BMP
104SUBDIRS += ../modules/loaders/bmp
105EVAS_STATIC_MODULE += ../modules/loaders/bmp/libevas_loader_bmp.la
106EVAS_STATIC_LIBADD += @evas_image_loader_bmp_libs@
107endif
108if EVAS_STATIC_BUILD_EDB
109SUBDIRS += ../modules/savers/edb ../modules/loaders/edb
110EVAS_STATIC_MODULE += ../modules/savers/edb/libevas_saver_edb.la ../modules/loaders/edb/libevas_loader_edb.la
111EVAS_STATIC_LIBADD += @evas_image_loader_edb_libs@
112endif
113if EVAS_STATIC_BUILD_EET
114SUBDIRS += ../modules/savers/eet ../modules/loaders/eet
115EVAS_STATIC_MODULE += ../modules/savers/eet/libevas_saver_eet.la ../modules/loaders/eet/libevas_loader_eet.la
116EVAS_STATIC_LIBADD += @evas_image_loader_eet_libs@
117endif
118if EVAS_STATIC_BUILD_GENERIC
119SUBDIRS += ../modules/loaders/generic
120EVAS_STATIC_MODULE += ../modules/loaders/generic/libevas_loader_generic.la
121EVAS_STATIC_LIBADD += @evas_image_loader_generic_libs@
122endif
123if EVAS_STATIC_BUILD_GIF
124SUBDIRS += ../modules/loaders/gif
125EVAS_STATIC_MODULE += ../modules/loaders/gif/libevas_loader_gif.la
126EVAS_STATIC_LIBADD += @evas_image_loader_gif_libs@
127endif
128if EVAS_STATIC_BUILD_ICO
129SUBDIRS += ../modules/loaders/ico
130EVAS_STATIC_MODULE += ../modules/loaders/ico/libevas_loader_ico.la
131EVAS_STATIC_LIBADD += @evas_image_loader_ico_libs@
132endif
133if EVAS_STATIC_BUILD_JPEG
134SUBDIRS += ../modules/loaders/jpeg
135EVAS_STATIC_MODULE += ../modules/loaders/jpeg/libevas_loader_jpeg.la
136if BUILD_SAVER_JPEG
137SUBDIRS += ../modules/savers/jpeg
138EVAS_STATIC_MODULE += ../modules/savers/jpeg/libevas_saver_jpeg.la
139endif
140EVAS_STATIC_LIBADD += @evas_image_loader_jpeg_libs@
141endif
142if EVAS_STATIC_BUILD_PMAPS
143SUBDIRS += ../modules/loaders/pmaps
144EVAS_STATIC_MODULE += ../modules/loaders/pmaps/libevas_loader_pmaps.la
145EVAS_STATIC_LIBADD += @evas_image_loader_pmaps_libs@
146endif
147if EVAS_STATIC_BUILD_PNG
148SUBDIRS += ../modules/savers/png ../modules/loaders/png
149EVAS_STATIC_MODULE += ../modules/savers/png/libevas_saver_png.la ../modules/loaders/png/libevas_loader_png.la
150EVAS_STATIC_LIBADD += @evas_image_loader_png_libs@
151endif
152if EVAS_STATIC_BUILD_PSD
153SUBDIRS += ../modules/loaders/psd
154EVAS_STATIC_MODULE += ../modules/loaders/psd/libevas_loader_psd.la
155EVAS_STATIC_LIBADD += @evas_image_loader_psd_libs@
156endif
157if EVAS_STATIC_BUILD_SVG
158SUBDIRS += ../modules/loaders/svg
159EVAS_STATIC_MODULE += ../modules/loaders/svg/libevas_loader_svg.la
160EVAS_STATIC_LIBADD += @evas_image_loader_svg_libs@
161endif
162if EVAS_STATIC_BUILD_TGA
163SUBDIRS += ../modules/loaders/tga
164EVAS_STATIC_MODULE += ../modules/loaders/tga/libevas_loader_tga.la
165EVAS_STATIC_LIBADD += @evas_image_loader_tga_libs@
166endif
167if EVAS_STATIC_BUILD_TIFF
168SUBDIRS += ../modules/savers/tiff ../modules/loaders/tiff
169EVAS_STATIC_MODULE += ../modules/savers/tiff/libevas_saver_tiff.la ../modules/loaders/tiff/libevas_loader_tiff.la
170EVAS_STATIC_LIBADD += @evas_image_loader_tiff_libs@
171endif
172if EVAS_STATIC_BUILD_WBMP
173SUBDIRS += ../modules/loaders/wbmp
174EVAS_STATIC_MODULE += ../modules/loaders/wbmp/libevas_loader_wbmp.la
175EVAS_STATIC_LIBADD += @evas_image_loader_wbmp_libs@
176endif
177if EVAS_STATIC_BUILD_XPM
178SUBDIRS += ../modules/loaders/xpm
179EVAS_STATIC_MODULE += ../modules/loaders/xpm/libevas_loader_xpm.la
180EVAS_STATIC_LIBADD += @evas_image_loader_xpm_libs@
181endif
182
183AM_CPPFLAGS = \
184-I. \
185-I$(top_srcdir)/src/lib \
186-I$(top_srcdir)/src/lib/include \
187-DPACKAGE_BIN_DIR=\"$(bindir)\" \
188-DPACKAGE_LIB_DIR=\"$(libdir)\" \
189-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
190@EINA_CFLAGS@ \
191@FREETYPE_CFLAGS@ \
192@FRIBIDI_CFLAGS@ \
193@HARFBUZZ_CFLAGS@ \
194@EET_CFLAGS@ \
195@FONTCONFIG_CFLAGS@ \
196@pthread_cflags@ \
197@PIXMAN_CFLAGS@
198
199AM_CFLAGS = @WIN32_CFLAGS@
200
201lib_LTLIBRARIES = libevas.la
202
203### Evas_GL disabled for 1.1
204#includes_HEADERS = Evas.h Evas_GL.h
205includes_HEADERS = Evas.h
206includesdir = $(includedir)/evas-@VMAJ@
207
208libevas_la_SOURCES = main.c
209
210if EVAS_CSERVE
211
212libevas_cserve_la = cserve/libevas_cserve.la
213
214endif
215
216libevas_la_LIBADD = \
217canvas/libevas_canvas.la \
218file/libevas_file.la \
219cache/libevas_cache.la \
220$(libevas_cserve_la) \
221engines/common/libevas_engine_common.la \
222@FREETYPE_LIBS@ \
223@FRIBIDI_LIBS@ \
224@HARFBUZZ_LIBS@ \
225@EET_LIBS@ \
226@FONTCONFIG_LIBS@ \
227@pthread_libs@ \
228@EINA_LIBS@ \
229$(EVAS_STATIC_MODULE) \
230$(EVAS_STATIC_LIBADD) \
231@PIXMAN_LIBS@ \
232-lm
233
234libevas_la_DEPENDENCIES = \
235canvas/libevas_canvas.la \
236file/libevas_file.la \
237cache/libevas_cache.la \
238$(libevas_cserve_la) \
239engines/common/libevas_engine_common.la \
240$(EVAS_STATIC_MODULE)
241
242if BUILD_ENGINE_SOFTWARE_16
243
244libevas_la_LIBADD += engines/common_16/libevas_engine_common_16.la
245libevas_la_DEPENDENCIES += engines/common_16/libevas_engine_common_16.la
246
247endif
248
249if BUILD_ENGINE_SOFTWARE_8
250
251libevas_la_LIBADD += engines/common_8/libevas_engine_common_8.la
252libevas_la_DEPENDENCIES += engines/common_8/libevas_engine_common_8.la
253
254endif
255
256libevas_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -version-info @version_info@ @release_info@
257
258### Evas_GL we are still using it in our code, so just don't install it.
259EXTRA_DIST=Evas_GL.h
260
261DIST_SUBDIRS = canvas cache cserve file engines include
diff --git a/libraries/evas/src/lib/Makefile.in b/libraries/evas/src/lib/Makefile.in
new file mode 100644
index 0000000..87bbaac
--- /dev/null
+++ b/libraries/evas/src/lib/Makefile.in
@@ -0,0 +1,1092 @@
1# Makefile.in generated by automake 1.11.1 from Makefile.am.
2# @configure_input@
3
4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
6# Inc.
7# This Makefile.in is free software; the Free Software Foundation
8# gives unlimited permission to copy and/or distribute it,
9# with or without modifications, as long as this notice is preserved.
10
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
13# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14# PARTICULAR PURPOSE.
15
16@SET_MAKE@
17
18
19VPATH = @srcdir@
20pkgdatadir = $(datadir)/@PACKAGE@
21pkgincludedir = $(includedir)/@PACKAGE@
22pkglibdir = $(libdir)/@PACKAGE@
23pkglibexecdir = $(libexecdir)/@PACKAGE@
24am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
25install_sh_DATA = $(install_sh) -c -m 644
26install_sh_PROGRAM = $(install_sh) -c
27install_sh_SCRIPT = $(install_sh) -c
28INSTALL_HEADER = $(INSTALL_DATA)
29transform = $(program_transform_name)
30NORMAL_INSTALL = :
31PRE_INSTALL = :
32POST_INSTALL = :
33NORMAL_UNINSTALL = :
34PRE_UNINSTALL = :
35POST_UNINSTALL = :
36build_triplet = @build@
37host_triplet = @host@
38@EVAS_STATIC_BUILD_SOFTWARE_GENERIC_TRUE@am__append_1 = ../modules/engines/software_generic/
39@EVAS_STATIC_BUILD_SOFTWARE_GENERIC_TRUE@am__append_2 = ../modules/engines/software_generic/libevas_engine_software_generic.la
40@EVAS_STATIC_BUILD_BUFFER_TRUE@am__append_3 = ../modules/engines/buffer/
41@EVAS_STATIC_BUILD_BUFFER_TRUE@am__append_4 = ../modules/engines/buffer/libevas_engine_buffer.la
42@EVAS_STATIC_BUILD_DIRECT3D_TRUE@am__append_5 = ../modules/engines/direct3d/
43@EVAS_STATIC_BUILD_DIRECT3D_TRUE@am__append_6 = ../modules/engines/direct3d/libevas_engine_direct3d.la
44@EVAS_STATIC_BUILD_DIRECT3D_TRUE@am__append_7 = @evas_engine_direct3d_libs@
45@EVAS_STATIC_BUILD_DIRECTFB_TRUE@am__append_8 = ../modules/engines/directfb/
46@EVAS_STATIC_BUILD_DIRECTFB_TRUE@am__append_9 = ../modules/engines/directfb/libevas_engine_directfb.la
47@EVAS_STATIC_BUILD_DIRECTFB_TRUE@am__append_10 = @evas_engine_directfb_libs@
48@EVAS_STATIC_BUILD_FB_TRUE@am__append_11 = ../modules/engines/fb/
49@EVAS_STATIC_BUILD_FB_TRUE@am__append_12 = ../modules/engines/fb/libevas_engine_fb.la
50@EVAS_STATIC_BUILD_FB_TRUE@am__append_13 = @evas_engine_fb_libs@
51@EVAS_STATIC_BUILD_GL_X11_TRUE@am__append_14 = \
52@EVAS_STATIC_BUILD_GL_X11_TRUE@ ../modules/engines/gl_common \
53@EVAS_STATIC_BUILD_GL_X11_TRUE@ ../modules/engines/gl_x11
54
55@EVAS_STATIC_BUILD_GL_X11_TRUE@am__append_15 = \
56@EVAS_STATIC_BUILD_GL_X11_TRUE@ ../modules/engines/gl_x11/libevas_engine_gl_x11.la
57
58@EVAS_STATIC_BUILD_GL_X11_TRUE@am__append_16 = @evas_engine_gl_common_libs@ @evas_engine_gl_xlib_libs@
59@EVAS_STATIC_BUILD_GL_SDL_TRUE@am__append_17 = \
60@EVAS_STATIC_BUILD_GL_SDL_TRUE@ ../modules/engines/gl_common \
61@EVAS_STATIC_BUILD_GL_SDL_TRUE@ ../modules/engines/gl_sdl
62
63@EVAS_STATIC_BUILD_GL_SDL_TRUE@am__append_18 = \
64@EVAS_STATIC_BUILD_GL_SDL_TRUE@ ../modules/engines/gl_sdl/libevas_engine_gl_sdl.la
65
66@EVAS_STATIC_BUILD_GL_SDL_TRUE@am__append_19 = @evas_engine_gl_common_libs@ @evas_engine_gl_sdl_libs@
67@EVAS_STATIC_BUILD_PSL1GHT_TRUE@am__append_20 = ../modules/engines/psl1ght/
68@EVAS_STATIC_BUILD_PSL1GHT_TRUE@am__append_21 = ../modules/engines/psl1ght/libevas_engine_psl1ght.la
69@EVAS_STATIC_BUILD_PSL1GHT_TRUE@am__append_22 = @evas_engine_psl1ght_libs@
70@EVAS_STATIC_BUILD_SOFTWARE_16_TRUE@am__append_23 = ../modules/engines/software_16/
71@EVAS_STATIC_BUILD_SOFTWARE_16_TRUE@am__append_24 = ../modules/engines/software_16/libevas_engine_software_16.la
72@EVAS_STATIC_BUILD_SOFTWARE_16_DDRAW_TRUE@am__append_25 = ../modules/engines/software_16_ddraw/
73@EVAS_STATIC_BUILD_SOFTWARE_16_DDRAW_TRUE@am__append_26 = ../modules/engines/software_16_ddraw/libevas_engine_software_16_ddraw.la
74@EVAS_STATIC_BUILD_SOFTWARE_16_DDRAW_TRUE@am__append_27 = @evas_engine_software_16_ddraw_libs@
75@EVAS_STATIC_BUILD_SOFTWARE_16_WINCE_TRUE@am__append_28 = ../modules/engines/software_16_wince/
76@EVAS_STATIC_BUILD_SOFTWARE_16_WINCE_TRUE@am__append_29 = ../modules/engines/software_16_wince/libevas_engine_software_16_wince.la
77@EVAS_STATIC_BUILD_SOFTWARE_16_WINCE_TRUE@am__append_30 = @evas_engine_software_16_wince_libs@
78@EVAS_STATIC_BUILD_SOFTWARE_16_X11_TRUE@am__append_31 = ../modules/engines/software_16_x11/
79@EVAS_STATIC_BUILD_SOFTWARE_16_X11_TRUE@am__append_32 = ../modules/engines/software_16_x11/libevas_engine_software_16_x11.la
80@EVAS_STATIC_BUILD_SOFTWARE_16_X11_TRUE@am__append_33 = @evas_engine_software_16_x11_libs@
81@EVAS_STATIC_BUILD_SOFTWARE_8_TRUE@am__append_34 = ../modules/engines/software_8/
82@EVAS_STATIC_BUILD_SOFTWARE_8_TRUE@am__append_35 = ../modules/engines/software_8/libevas_engine_software_8.la
83@EVAS_STATIC_BUILD_SOFTWARE_8_X11_TRUE@am__append_36 = ../modules/engines/software_8_x11/
84@EVAS_STATIC_BUILD_SOFTWARE_8_X11_TRUE@am__append_37 = ../modules/engines/software_8_x11/libevas_engine_software_8_x11.la
85@EVAS_STATIC_BUILD_SOFTWARE_8_X11_TRUE@am__append_38 = @evas_engine_software_8_x11_libs@
86@EVAS_STATIC_BUILD_SOFTWARE_SDL_TRUE@am__append_39 = \
87@EVAS_STATIC_BUILD_SOFTWARE_SDL_TRUE@ ../modules/engines/software_16_sdl/ \
88@EVAS_STATIC_BUILD_SOFTWARE_SDL_TRUE@ ../modules/engines/software_sdl/
89
90@EVAS_STATIC_BUILD_SOFTWARE_SDL_TRUE@am__append_40 = \
91@EVAS_STATIC_BUILD_SOFTWARE_SDL_TRUE@ ../modules/engines/software_16_sdl/libevas_engine_software_16_sdl.la \
92@EVAS_STATIC_BUILD_SOFTWARE_SDL_TRUE@ ../modules/engines/software_sdl/libevas_engine_software_sdl.la
93
94@EVAS_STATIC_BUILD_SOFTWARE_SDL_TRUE@am__append_41 = @SDL_LIBS@
95@EVAS_STATIC_BUILD_SOFTWARE_DDRAW_TRUE@am__append_42 = ../modules/engines/software_ddraw/
96@EVAS_STATIC_BUILD_SOFTWARE_DDRAW_TRUE@am__append_43 = ../modules/engines/software_ddraw/libevas_engine_software_ddraw.la
97@EVAS_STATIC_BUILD_SOFTWARE_DDRAW_TRUE@am__append_44 = @evas_engine_software_ddraw_libs@
98@EVAS_STATIC_BUILD_SOFTWARE_GDI_TRUE@am__append_45 = ../modules/engines/software_gdi/
99@EVAS_STATIC_BUILD_SOFTWARE_GDI_TRUE@am__append_46 = ../modules/engines/software_gdi/libevas_engine_software_gdi.la
100@EVAS_STATIC_BUILD_SOFTWARE_GDI_TRUE@am__append_47 = @evas_engine_software_gdi_libs@
101@EVAS_STATIC_BUILD_SOFTWARE_X11_TRUE@am__append_48 = ../modules/engines/software_x11/
102@EVAS_STATIC_BUILD_SOFTWARE_X11_TRUE@am__append_49 = ../modules/engines/software_x11/libevas_engine_software_x11.la
103@EVAS_STATIC_BUILD_SOFTWARE_X11_TRUE@am__append_50 = @evas_engine_software_xlib_libs@ @evas_engine_software_xcb_libs@
104@EVAS_STATIC_BUILD_BMP_TRUE@am__append_51 = ../modules/loaders/bmp
105@EVAS_STATIC_BUILD_BMP_TRUE@am__append_52 = ../modules/loaders/bmp/libevas_loader_bmp.la
106@EVAS_STATIC_BUILD_BMP_TRUE@am__append_53 = @evas_image_loader_bmp_libs@
107@EVAS_STATIC_BUILD_EDB_TRUE@am__append_54 = ../modules/savers/edb ../modules/loaders/edb
108@EVAS_STATIC_BUILD_EDB_TRUE@am__append_55 = ../modules/savers/edb/libevas_saver_edb.la ../modules/loaders/edb/libevas_loader_edb.la
109@EVAS_STATIC_BUILD_EDB_TRUE@am__append_56 = @evas_image_loader_edb_libs@
110@EVAS_STATIC_BUILD_EET_TRUE@am__append_57 = ../modules/savers/eet ../modules/loaders/eet
111@EVAS_STATIC_BUILD_EET_TRUE@am__append_58 = ../modules/savers/eet/libevas_saver_eet.la ../modules/loaders/eet/libevas_loader_eet.la
112@EVAS_STATIC_BUILD_EET_TRUE@am__append_59 = @evas_image_loader_eet_libs@
113@EVAS_STATIC_BUILD_GENERIC_TRUE@am__append_60 = ../modules/loaders/generic
114@EVAS_STATIC_BUILD_GENERIC_TRUE@am__append_61 = ../modules/loaders/generic/libevas_loader_generic.la
115@EVAS_STATIC_BUILD_GENERIC_TRUE@am__append_62 = @evas_image_loader_generic_libs@
116@EVAS_STATIC_BUILD_GIF_TRUE@am__append_63 = ../modules/loaders/gif
117@EVAS_STATIC_BUILD_GIF_TRUE@am__append_64 = ../modules/loaders/gif/libevas_loader_gif.la
118@EVAS_STATIC_BUILD_GIF_TRUE@am__append_65 = @evas_image_loader_gif_libs@
119@EVAS_STATIC_BUILD_ICO_TRUE@am__append_66 = ../modules/loaders/ico
120@EVAS_STATIC_BUILD_ICO_TRUE@am__append_67 = ../modules/loaders/ico/libevas_loader_ico.la
121@EVAS_STATIC_BUILD_ICO_TRUE@am__append_68 = @evas_image_loader_ico_libs@
122@EVAS_STATIC_BUILD_JPEG_TRUE@am__append_69 = ../modules/loaders/jpeg
123@EVAS_STATIC_BUILD_JPEG_TRUE@am__append_70 = ../modules/loaders/jpeg/libevas_loader_jpeg.la
124@BUILD_SAVER_JPEG_TRUE@@EVAS_STATIC_BUILD_JPEG_TRUE@am__append_71 = ../modules/savers/jpeg
125@BUILD_SAVER_JPEG_TRUE@@EVAS_STATIC_BUILD_JPEG_TRUE@am__append_72 = ../modules/savers/jpeg/libevas_saver_jpeg.la
126@EVAS_STATIC_BUILD_JPEG_TRUE@am__append_73 = @evas_image_loader_jpeg_libs@
127@EVAS_STATIC_BUILD_PMAPS_TRUE@am__append_74 = ../modules/loaders/pmaps
128@EVAS_STATIC_BUILD_PMAPS_TRUE@am__append_75 = ../modules/loaders/pmaps/libevas_loader_pmaps.la
129@EVAS_STATIC_BUILD_PMAPS_TRUE@am__append_76 = @evas_image_loader_pmaps_libs@
130@EVAS_STATIC_BUILD_PNG_TRUE@am__append_77 = ../modules/savers/png ../modules/loaders/png
131@EVAS_STATIC_BUILD_PNG_TRUE@am__append_78 = ../modules/savers/png/libevas_saver_png.la ../modules/loaders/png/libevas_loader_png.la
132@EVAS_STATIC_BUILD_PNG_TRUE@am__append_79 = @evas_image_loader_png_libs@
133@EVAS_STATIC_BUILD_PSD_TRUE@am__append_80 = ../modules/loaders/psd
134@EVAS_STATIC_BUILD_PSD_TRUE@am__append_81 = ../modules/loaders/psd/libevas_loader_psd.la
135@EVAS_STATIC_BUILD_PSD_TRUE@am__append_82 = @evas_image_loader_psd_libs@
136@EVAS_STATIC_BUILD_SVG_TRUE@am__append_83 = ../modules/loaders/svg
137@EVAS_STATIC_BUILD_SVG_TRUE@am__append_84 = ../modules/loaders/svg/libevas_loader_svg.la
138@EVAS_STATIC_BUILD_SVG_TRUE@am__append_85 = @evas_image_loader_svg_libs@
139@EVAS_STATIC_BUILD_TGA_TRUE@am__append_86 = ../modules/loaders/tga
140@EVAS_STATIC_BUILD_TGA_TRUE@am__append_87 = ../modules/loaders/tga/libevas_loader_tga.la
141@EVAS_STATIC_BUILD_TGA_TRUE@am__append_88 = @evas_image_loader_tga_libs@
142@EVAS_STATIC_BUILD_TIFF_TRUE@am__append_89 = ../modules/savers/tiff ../modules/loaders/tiff
143@EVAS_STATIC_BUILD_TIFF_TRUE@am__append_90 = ../modules/savers/tiff/libevas_saver_tiff.la ../modules/loaders/tiff/libevas_loader_tiff.la
144@EVAS_STATIC_BUILD_TIFF_TRUE@am__append_91 = @evas_image_loader_tiff_libs@
145@EVAS_STATIC_BUILD_WBMP_TRUE@am__append_92 = ../modules/loaders/wbmp
146@EVAS_STATIC_BUILD_WBMP_TRUE@am__append_93 = ../modules/loaders/wbmp/libevas_loader_wbmp.la
147@EVAS_STATIC_BUILD_WBMP_TRUE@am__append_94 = @evas_image_loader_wbmp_libs@
148@EVAS_STATIC_BUILD_XPM_TRUE@am__append_95 = ../modules/loaders/xpm
149@EVAS_STATIC_BUILD_XPM_TRUE@am__append_96 = ../modules/loaders/xpm/libevas_loader_xpm.la
150@EVAS_STATIC_BUILD_XPM_TRUE@am__append_97 = @evas_image_loader_xpm_libs@
151@BUILD_ENGINE_SOFTWARE_16_TRUE@am__append_98 = engines/common_16/libevas_engine_common_16.la
152@BUILD_ENGINE_SOFTWARE_16_TRUE@am__append_99 = engines/common_16/libevas_engine_common_16.la
153@BUILD_ENGINE_SOFTWARE_8_TRUE@am__append_100 = engines/common_8/libevas_engine_common_8.la
154@BUILD_ENGINE_SOFTWARE_8_TRUE@am__append_101 = engines/common_8/libevas_engine_common_8.la
155subdir = src/lib
156DIST_COMMON = $(includes_HEADERS) $(srcdir)/Makefile.am \
157 $(srcdir)/Makefile.in
158ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
159am__aclocal_m4_deps = $(top_srcdir)/m4/efl_attribute.m4 \
160 $(top_srcdir)/m4/efl_coverage.m4 \
161 $(top_srcdir)/m4/efl_doxygen.m4 \
162 $(top_srcdir)/m4/efl_fnmatch.m4 \
163 $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \
164 $(top_srcdir)/m4/evas_check_engine.m4 \
165 $(top_srcdir)/m4/evas_check_loader.m4 \
166 $(top_srcdir)/m4/evas_converter.m4 \
167 $(top_srcdir)/m4/evas_dither.m4 \
168 $(top_srcdir)/m4/evas_scaler.m4 $(top_srcdir)/m4/libtool.m4 \
169 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
170 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
171 $(top_srcdir)/configure.ac
172am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
173 $(ACLOCAL_M4)
174mkinstalldirs = $(install_sh) -d
175CONFIG_HEADER = $(top_builddir)/config.h
176CONFIG_CLEAN_FILES =
177CONFIG_CLEAN_VPATH_FILES =
178am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
179am__vpath_adj = case $$p in \
180 $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
181 *) f=$$p;; \
182 esac;
183am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
184am__install_max = 40
185am__nobase_strip_setup = \
186 srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
187am__nobase_strip = \
188 for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
189am__nobase_list = $(am__nobase_strip_setup); \
190 for p in $$list; do echo "$$p $$p"; done | \
191 sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
192 $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
193 if (++n[$$2] == $(am__install_max)) \
194 { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
195 END { for (dir in files) print dir, files[dir] }'
196am__base_list = \
197 sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
198 sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
199am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includesdir)"
200LTLIBRARIES = $(lib_LTLIBRARIES)
201am__DEPENDENCIES_1 =
202am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
203 $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
204 $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
205 $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
206 $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
207 $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
208 $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
209 $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
210 $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
211 $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
212 $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
213 $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
214 $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
215 $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
216 $(am__DEPENDENCIES_1)
217am_libevas_la_OBJECTS = main.lo
218libevas_la_OBJECTS = $(am_libevas_la_OBJECTS)
219AM_V_lt = $(am__v_lt_$(V))
220am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
221am__v_lt_0 = --silent
222libevas_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
223 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
224 $(libevas_la_LDFLAGS) $(LDFLAGS) -o $@
225DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
226depcomp = $(SHELL) $(top_srcdir)/depcomp
227am__depfiles_maybe = depfiles
228am__mv = mv -f
229COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
230 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
231LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
232 $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
233 $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
234 $(AM_CFLAGS) $(CFLAGS)
235AM_V_CC = $(am__v_CC_$(V))
236am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
237am__v_CC_0 = @echo " CC " $@;
238AM_V_at = $(am__v_at_$(V))
239am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
240am__v_at_0 = @
241CCLD = $(CC)
242LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
243 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
244 $(AM_LDFLAGS) $(LDFLAGS) -o $@
245AM_V_CCLD = $(am__v_CCLD_$(V))
246am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
247am__v_CCLD_0 = @echo " CCLD " $@;
248AM_V_GEN = $(am__v_GEN_$(V))
249am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
250am__v_GEN_0 = @echo " GEN " $@;
251SOURCES = $(libevas_la_SOURCES)
252DIST_SOURCES = $(libevas_la_SOURCES)
253RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
254 html-recursive info-recursive install-data-recursive \
255 install-dvi-recursive install-exec-recursive \
256 install-html-recursive install-info-recursive \
257 install-pdf-recursive install-ps-recursive install-recursive \
258 installcheck-recursive installdirs-recursive pdf-recursive \
259 ps-recursive uninstall-recursive
260HEADERS = $(includes_HEADERS)
261RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
262 distclean-recursive maintainer-clean-recursive
263AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
264 $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
265 distdir
266ETAGS = etags
267CTAGS = ctags
268DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
269am__relativize = \
270 dir0=`pwd`; \
271 sed_first='s,^\([^/]*\)/.*$$,\1,'; \
272 sed_rest='s,^[^/]*/*,,'; \
273 sed_last='s,^.*/\([^/]*\)$$,\1,'; \
274 sed_butlast='s,/*[^/]*$$,,'; \
275 while test -n "$$dir1"; do \
276 first=`echo "$$dir1" | sed -e "$$sed_first"`; \
277 if test "$$first" != "."; then \
278 if test "$$first" = ".."; then \
279 dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
280 dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
281 else \
282 first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
283 if test "$$first2" = "$$first"; then \
284 dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
285 else \
286 dir2="../$$dir2"; \
287 fi; \
288 dir0="$$dir0"/"$$first"; \
289 fi; \
290 fi; \
291 dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
292 done; \
293 reldir="$$dir2"
294ACLOCAL = @ACLOCAL@
295ALLOCA = @ALLOCA@
296AMTAR = @AMTAR@
297AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
298AR = @AR@
299AS = @AS@
300AUTOCONF = @AUTOCONF@
301AUTOHEADER = @AUTOHEADER@
302AUTOMAKE = @AUTOMAKE@
303AWK = @AWK@
304CC = @CC@
305CCDEPMODE = @CCDEPMODE@
306CFLAGS = @CFLAGS@
307CHECK_CFLAGS = @CHECK_CFLAGS@
308CHECK_LIBS = @CHECK_LIBS@
309CPP = @CPP@
310CPPFLAGS = @CPPFLAGS@
311CXX = @CXX@
312CXXCPP = @CXXCPP@
313CXXDEPMODE = @CXXDEPMODE@
314CXXFLAGS = @CXXFLAGS@
315CYGPATH_W = @CYGPATH_W@
316DEFS = @DEFS@
317DEPDIR = @DEPDIR@
318DIRECTFB_CFLAGS = @DIRECTFB_CFLAGS@
319DIRECTFB_LIBS = @DIRECTFB_LIBS@
320DLLTOOL = @DLLTOOL@
321DSYMUTIL = @DSYMUTIL@
322DUMPBIN = @DUMPBIN@
323ECHO_C = @ECHO_C@
324ECHO_N = @ECHO_N@
325ECHO_T = @ECHO_T@
326ECORE_EVAS_CFLAGS = @ECORE_EVAS_CFLAGS@
327ECORE_EVAS_LIBS = @ECORE_EVAS_LIBS@
328EDB_CFLAGS = @EDB_CFLAGS@
329EDB_LIBS = @EDB_LIBS@
330EDJE_CFLAGS = @EDJE_CFLAGS@
331EDJE_LIBS = @EDJE_LIBS@
332EET_CFLAGS = @EET_CFLAGS@
333EET_LIBS = @EET_LIBS@
334EFL_COVERAGE_CFLAGS = @EFL_COVERAGE_CFLAGS@
335EFL_COVERAGE_LIBS = @EFL_COVERAGE_LIBS@
336EFL_FNMATCH_LIBS = @EFL_FNMATCH_LIBS@
337EGREP = @EGREP@
338EINA_CFLAGS = @EINA_CFLAGS@
339EINA_LIBS = @EINA_LIBS@
340EVAS_CFLAGS = @EVAS_CFLAGS@
341EVAS_LIBS = @EVAS_LIBS@
342EVAS_SSE3_CFLAGS = @EVAS_SSE3_CFLAGS@
343EVIL_CFLAGS = @EVIL_CFLAGS@
344EVIL_LIBS = @EVIL_LIBS@
345EXEEXT = @EXEEXT@
346FGREP = @FGREP@
347FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@
348FONTCONFIG_LIBS = @FONTCONFIG_LIBS@
349FREETYPE_CFLAGS = @FREETYPE_CFLAGS@
350FREETYPE_LIBS = @FREETYPE_LIBS@
351FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@
352FRIBIDI_LIBS = @FRIBIDI_LIBS@
353GL_EET_CFLAGS = @GL_EET_CFLAGS@
354GL_EET_LIBS = @GL_EET_LIBS@
355GREP = @GREP@
356HARFBUZZ_CFLAGS = @HARFBUZZ_CFLAGS@
357HARFBUZZ_LIBS = @HARFBUZZ_LIBS@
358INSTALL = @INSTALL@
359INSTALL_DATA = @INSTALL_DATA@
360INSTALL_PROGRAM = @INSTALL_PROGRAM@
361INSTALL_SCRIPT = @INSTALL_SCRIPT@
362INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
363LD = @LD@
364LDFLAGS = @LDFLAGS@
365LIBOBJS = @LIBOBJS@
366LIBS = @LIBS@
367LIBTOOL = @LIBTOOL@
368LINEBREAK_CFLAGS = @LINEBREAK_CFLAGS@
369LINEBREAK_LIBS = @LINEBREAK_LIBS@
370LIPO = @LIPO@
371LN_S = @LN_S@
372LTLIBOBJS = @LTLIBOBJS@
373MAKEINFO = @MAKEINFO@
374MKDIR_P = @MKDIR_P@
375MODULE_ARCH = @MODULE_ARCH@
376NM = @NM@
377NMEDIT = @NMEDIT@
378OBJC = @OBJC@
379OBJCDEPMODE = @OBJCDEPMODE@
380OBJCFLAGS = @OBJCFLAGS@
381OBJDUMP = @OBJDUMP@
382OBJEXT = @OBJEXT@
383OTOOL = @OTOOL@
384OTOOL64 = @OTOOL64@
385PACKAGE = @PACKAGE@
386PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
387PACKAGE_NAME = @PACKAGE_NAME@
388PACKAGE_STRING = @PACKAGE_STRING@
389PACKAGE_TARNAME = @PACKAGE_TARNAME@
390PACKAGE_URL = @PACKAGE_URL@
391PACKAGE_VERSION = @PACKAGE_VERSION@
392PATH_SEPARATOR = @PATH_SEPARATOR@
393PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
394PIXMAN_LIBS = @PIXMAN_LIBS@
395PKG_CONFIG = @PKG_CONFIG@
396PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
397PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
398PNG_CFLAGS = @PNG_CFLAGS@
399PNG_LIBS = @PNG_LIBS@
400RANLIB = @RANLIB@
401SDL_CFLAGS = @SDL_CFLAGS@
402SDL_LIBS = @SDL_LIBS@
403SED = @SED@
404SET_MAKE = @SET_MAKE@
405SHELL = @SHELL@
406SHM_OPEN_LINK = @SHM_OPEN_LINK@
407STRIP = @STRIP@
408SVG_CFLAGS = @SVG_CFLAGS@
409SVG_LIBS = @SVG_LIBS@
410VALGRIND_CFLAGS = @VALGRIND_CFLAGS@
411VALGRIND_LIBS = @VALGRIND_LIBS@
412VERSION = @VERSION@
413VMAJ = @VMAJ@
414WIN32_CFLAGS = @WIN32_CFLAGS@
415WIN32_CPPFLAGS = @WIN32_CPPFLAGS@
416XCB_CFLAGS = @XCB_CFLAGS@
417XCB_GL_CFLAGS = @XCB_GL_CFLAGS@
418XCB_GL_LIBS = @XCB_GL_LIBS@
419XCB_LIBS = @XCB_LIBS@
420XEXT_CFLAGS = @XEXT_CFLAGS@
421XEXT_LIBS = @XEXT_LIBS@
422XMKMF = @XMKMF@
423X_CFLAGS = @X_CFLAGS@
424X_EXTRA_LIBS = @X_EXTRA_LIBS@
425X_LIBS = @X_LIBS@
426X_PRE_LIBS = @X_PRE_LIBS@
427abs_builddir = @abs_builddir@
428abs_srcdir = @abs_srcdir@
429abs_top_builddir = @abs_top_builddir@
430abs_top_srcdir = @abs_top_srcdir@
431ac_ct_CC = @ac_ct_CC@
432ac_ct_CXX = @ac_ct_CXX@
433ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
434ac_ct_OBJC = @ac_ct_OBJC@
435altivec_cflags = @altivec_cflags@
436am__include = @am__include@
437am__leading_dot = @am__leading_dot@
438am__quote = @am__quote@
439am__tar = @am__tar@
440am__untar = @am__untar@
441bindir = @bindir@
442build = @build@
443build_alias = @build_alias@
444build_cpu = @build_cpu@
445build_os = @build_os@
446build_vendor = @build_vendor@
447builddir = @builddir@
448datadir = @datadir@
449datarootdir = @datarootdir@
450dlopen_libs = @dlopen_libs@
451docdir = @docdir@
452dvidir = @dvidir@
453edje_cc = @edje_cc@
454efl_doxygen = @efl_doxygen@
455efl_have_doxygen = @efl_have_doxygen@
456evas_engine_buffer_cflags = @evas_engine_buffer_cflags@
457evas_engine_buffer_libs = @evas_engine_buffer_libs@
458evas_engine_direct3d_cflags = @evas_engine_direct3d_cflags@
459evas_engine_direct3d_libs = @evas_engine_direct3d_libs@
460evas_engine_directfb_cflags = @evas_engine_directfb_cflags@
461evas_engine_directfb_libs = @evas_engine_directfb_libs@
462evas_engine_fb_cflags = @evas_engine_fb_cflags@
463evas_engine_fb_libs = @evas_engine_fb_libs@
464evas_engine_gl_cocoa_cflags = @evas_engine_gl_cocoa_cflags@
465evas_engine_gl_cocoa_libs = @evas_engine_gl_cocoa_libs@
466evas_engine_gl_common_libs = @evas_engine_gl_common_libs@
467evas_engine_gl_sdl_cflags = @evas_engine_gl_sdl_cflags@
468evas_engine_gl_sdl_libs = @evas_engine_gl_sdl_libs@
469evas_engine_gl_xcb_cflags = @evas_engine_gl_xcb_cflags@
470evas_engine_gl_xcb_libs = @evas_engine_gl_xcb_libs@
471evas_engine_gl_xlib_cflags = @evas_engine_gl_xlib_cflags@
472evas_engine_gl_xlib_libs = @evas_engine_gl_xlib_libs@
473evas_engine_psl1ght_cflags = @evas_engine_psl1ght_cflags@
474evas_engine_psl1ght_libs = @evas_engine_psl1ght_libs@
475evas_engine_software_16_ddraw_cflags = @evas_engine_software_16_ddraw_cflags@
476evas_engine_software_16_ddraw_libs = @evas_engine_software_16_ddraw_libs@
477evas_engine_software_16_sdl_cflags = @evas_engine_software_16_sdl_cflags@
478evas_engine_software_16_sdl_libs = @evas_engine_software_16_sdl_libs@
479evas_engine_software_16_wince_cflags = @evas_engine_software_16_wince_cflags@
480evas_engine_software_16_wince_libs = @evas_engine_software_16_wince_libs@
481evas_engine_software_16_x11_cflags = @evas_engine_software_16_x11_cflags@
482evas_engine_software_16_x11_libs = @evas_engine_software_16_x11_libs@
483evas_engine_software_8_x11_cflags = @evas_engine_software_8_x11_cflags@
484evas_engine_software_8_x11_libs = @evas_engine_software_8_x11_libs@
485evas_engine_software_ddraw_cflags = @evas_engine_software_ddraw_cflags@
486evas_engine_software_ddraw_libs = @evas_engine_software_ddraw_libs@
487evas_engine_software_gdi_cflags = @evas_engine_software_gdi_cflags@
488evas_engine_software_gdi_libs = @evas_engine_software_gdi_libs@
489evas_engine_software_sdl_cflags = @evas_engine_software_sdl_cflags@
490evas_engine_software_sdl_libs = @evas_engine_software_sdl_libs@
491evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@
492evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@
493evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@
494evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@
495evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@
496evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@
497evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@
498evas_image_loader_edb_libs = @evas_image_loader_edb_libs@
499evas_image_loader_eet_cflags = @evas_image_loader_eet_cflags@
500evas_image_loader_eet_libs = @evas_image_loader_eet_libs@
501evas_image_loader_generic_cflags = @evas_image_loader_generic_cflags@
502evas_image_loader_generic_libs = @evas_image_loader_generic_libs@
503evas_image_loader_gif_cflags = @evas_image_loader_gif_cflags@
504evas_image_loader_gif_libs = @evas_image_loader_gif_libs@
505evas_image_loader_ico_cflags = @evas_image_loader_ico_cflags@
506evas_image_loader_ico_libs = @evas_image_loader_ico_libs@
507evas_image_loader_jpeg_cflags = @evas_image_loader_jpeg_cflags@
508evas_image_loader_jpeg_libs = @evas_image_loader_jpeg_libs@
509evas_image_loader_pmaps_cflags = @evas_image_loader_pmaps_cflags@
510evas_image_loader_pmaps_libs = @evas_image_loader_pmaps_libs@
511evas_image_loader_png_cflags = @evas_image_loader_png_cflags@
512evas_image_loader_png_libs = @evas_image_loader_png_libs@
513evas_image_loader_psd_cflags = @evas_image_loader_psd_cflags@
514evas_image_loader_psd_libs = @evas_image_loader_psd_libs@
515evas_image_loader_svg_cflags = @evas_image_loader_svg_cflags@
516evas_image_loader_svg_libs = @evas_image_loader_svg_libs@
517evas_image_loader_tga_cflags = @evas_image_loader_tga_cflags@
518evas_image_loader_tga_libs = @evas_image_loader_tga_libs@
519evas_image_loader_tiff_cflags = @evas_image_loader_tiff_cflags@
520evas_image_loader_tiff_libs = @evas_image_loader_tiff_libs@
521evas_image_loader_wbmp_cflags = @evas_image_loader_wbmp_cflags@
522evas_image_loader_wbmp_libs = @evas_image_loader_wbmp_libs@
523evas_image_loader_xpm_cflags = @evas_image_loader_xpm_cflags@
524evas_image_loader_xpm_libs = @evas_image_loader_xpm_libs@
525exec_prefix = @exec_prefix@
526have_evas_engine_gl_x11 = @have_evas_engine_gl_x11@
527have_evas_engine_gl_xcb = @have_evas_engine_gl_xcb@
528have_evas_engine_gl_xlib = @have_evas_engine_gl_xlib@
529have_evas_engine_software_x11 = @have_evas_engine_software_x11@
530have_evas_engine_software_xcb = @have_evas_engine_software_xcb@
531have_evas_engine_software_xlib = @have_evas_engine_software_xlib@
532have_lcov = @have_lcov@
533host = @host@
534host_alias = @host_alias@
535host_cpu = @host_cpu@
536host_os = @host_os@
537host_vendor = @host_vendor@
538htmldir = @htmldir@
539includedir = @includedir@
540infodir = @infodir@
541install_sh = @install_sh@
542libdir = @libdir@
543libexecdir = @libexecdir@
544localedir = @localedir@
545localstatedir = @localstatedir@
546lt_ECHO = @lt_ECHO@
547lt_enable_auto_import = @lt_enable_auto_import@
548mandir = @mandir@
549mkdir_p = @mkdir_p@
550oldincludedir = @oldincludedir@
551pdfdir = @pdfdir@
552pkgconfig_requires_private = @pkgconfig_requires_private@
553prefix = @prefix@
554program_transform_name = @program_transform_name@
555psdir = @psdir@
556pthread_cflags = @pthread_cflags@
557pthread_libs = @pthread_libs@
558release_info = @release_info@
559requirement_evas = @requirement_evas@
560sbindir = @sbindir@
561sharedstatedir = @sharedstatedir@
562srcdir = @srcdir@
563sysconfdir = @sysconfdir@
564target_alias = @target_alias@
565top_build_prefix = @top_build_prefix@
566top_builddir = @top_builddir@
567top_srcdir = @top_srcdir@
568version_info = @version_info@
569MAINTAINERCLEANFILES = Makefile.in
570SUBDIRS = canvas cache cserve file engines include $(am__append_1) \
571 $(am__append_3) $(am__append_5) $(am__append_8) \
572 $(am__append_11) $(am__append_14) $(am__append_17) \
573 $(am__append_20) $(am__append_23) $(am__append_25) \
574 $(am__append_28) $(am__append_31) $(am__append_34) \
575 $(am__append_36) $(am__append_39) $(am__append_42) \
576 $(am__append_45) $(am__append_48) $(am__append_51) \
577 $(am__append_54) $(am__append_57) $(am__append_60) \
578 $(am__append_63) $(am__append_66) $(am__append_69) \
579 $(am__append_71) $(am__append_74) $(am__append_77) \
580 $(am__append_80) $(am__append_83) $(am__append_86) \
581 $(am__append_89) $(am__append_92) $(am__append_95)
582EVAS_STATIC_MODULE = $(am__append_2) $(am__append_4) $(am__append_6) \
583 $(am__append_9) $(am__append_12) $(am__append_15) \
584 $(am__append_18) $(am__append_21) $(am__append_24) \
585 $(am__append_26) $(am__append_29) $(am__append_32) \
586 $(am__append_35) $(am__append_37) $(am__append_40) \
587 $(am__append_43) $(am__append_46) $(am__append_49) \
588 $(am__append_52) $(am__append_55) $(am__append_58) \
589 $(am__append_61) $(am__append_64) $(am__append_67) \
590 $(am__append_70) $(am__append_72) $(am__append_75) \
591 $(am__append_78) $(am__append_81) $(am__append_84) \
592 $(am__append_87) $(am__append_90) $(am__append_93) \
593 $(am__append_96)
594EVAS_STATIC_LIBADD = $(am__append_7) $(am__append_10) $(am__append_13) \
595 $(am__append_16) $(am__append_19) $(am__append_22) \
596 $(am__append_27) $(am__append_30) $(am__append_33) \
597 $(am__append_38) $(am__append_41) $(am__append_44) \
598 $(am__append_47) $(am__append_50) $(am__append_53) \
599 $(am__append_56) $(am__append_59) $(am__append_62) \
600 $(am__append_65) $(am__append_68) $(am__append_73) \
601 $(am__append_76) $(am__append_79) $(am__append_82) \
602 $(am__append_85) $(am__append_88) $(am__append_91) \
603 $(am__append_94) $(am__append_97)
604AM_CPPFLAGS = \
605-I. \
606-I$(top_srcdir)/src/lib \
607-I$(top_srcdir)/src/lib/include \
608-DPACKAGE_BIN_DIR=\"$(bindir)\" \
609-DPACKAGE_LIB_DIR=\"$(libdir)\" \
610-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
611@EINA_CFLAGS@ \
612@FREETYPE_CFLAGS@ \
613@FRIBIDI_CFLAGS@ \
614@HARFBUZZ_CFLAGS@ \
615@EET_CFLAGS@ \
616@FONTCONFIG_CFLAGS@ \
617@pthread_cflags@ \
618@PIXMAN_CFLAGS@
619
620AM_CFLAGS = @WIN32_CFLAGS@
621lib_LTLIBRARIES = libevas.la
622
623### Evas_GL disabled for 1.1
624#includes_HEADERS = Evas.h Evas_GL.h
625includes_HEADERS = Evas.h
626includesdir = $(includedir)/evas-@VMAJ@
627libevas_la_SOURCES = main.c
628@EVAS_CSERVE_TRUE@libevas_cserve_la = cserve/libevas_cserve.la
629libevas_la_LIBADD = canvas/libevas_canvas.la file/libevas_file.la \
630 cache/libevas_cache.la $(libevas_cserve_la) \
631 engines/common/libevas_engine_common.la @FREETYPE_LIBS@ \
632 @FRIBIDI_LIBS@ @HARFBUZZ_LIBS@ @EET_LIBS@ @FONTCONFIG_LIBS@ \
633 @pthread_libs@ @EINA_LIBS@ $(EVAS_STATIC_MODULE) \
634 $(EVAS_STATIC_LIBADD) @PIXMAN_LIBS@ -lm $(am__append_98) \
635 $(am__append_100)
636libevas_la_DEPENDENCIES = canvas/libevas_canvas.la \
637 file/libevas_file.la cache/libevas_cache.la \
638 $(libevas_cserve_la) engines/common/libevas_engine_common.la \
639 $(EVAS_STATIC_MODULE) $(am__append_99) $(am__append_101)
640libevas_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -version-info @version_info@ @release_info@
641
642### Evas_GL we are still using it in our code, so just don't install it.
643EXTRA_DIST = Evas_GL.h
644DIST_SUBDIRS = canvas cache cserve file engines include
645all: all-recursive
646
647.SUFFIXES:
648.SUFFIXES: .c .lo .o .obj
649$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
650 @for dep in $?; do \
651 case '$(am__configure_deps)' in \
652 *$$dep*) \
653 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
654 && { if test -f $@; then exit 0; else break; fi; }; \
655 exit 1;; \
656 esac; \
657 done; \
658 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/Makefile'; \
659 $(am__cd) $(top_srcdir) && \
660 $(AUTOMAKE) --gnu src/lib/Makefile
661.PRECIOUS: Makefile
662Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
663 @case '$?' in \
664 *config.status*) \
665 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
666 *) \
667 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
668 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
669 esac;
670
671$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
672 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
673
674$(top_srcdir)/configure: $(am__configure_deps)
675 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
676$(ACLOCAL_M4): $(am__aclocal_m4_deps)
677 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
678$(am__aclocal_m4_deps):
679install-libLTLIBRARIES: $(lib_LTLIBRARIES)
680 @$(NORMAL_INSTALL)
681 test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
682 @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
683 list2=; for p in $$list; do \
684 if test -f $$p; then \
685 list2="$$list2 $$p"; \
686 else :; fi; \
687 done; \
688 test -z "$$list2" || { \
689 echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
690 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
691 }
692
693uninstall-libLTLIBRARIES:
694 @$(NORMAL_UNINSTALL)
695 @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
696 for p in $$list; do \
697 $(am__strip_dir) \
698 echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
699 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
700 done
701
702clean-libLTLIBRARIES:
703 -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
704 @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
705 dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
706 test "$$dir" != "$$p" || dir=.; \
707 echo "rm -f \"$${dir}/so_locations\""; \
708 rm -f "$${dir}/so_locations"; \
709 done
710libevas.la: $(libevas_la_OBJECTS) $(libevas_la_DEPENDENCIES)
711 $(AM_V_CCLD)$(libevas_la_LINK) -rpath $(libdir) $(libevas_la_OBJECTS) $(libevas_la_LIBADD) $(LIBS)
712
713mostlyclean-compile:
714 -rm -f *.$(OBJEXT)
715
716distclean-compile:
717 -rm -f *.tab.c
718
719@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Plo@am__quote@
720
721.c.o:
722@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
723@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
724@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
725@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
726@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
727@am__fastdepCC_FALSE@ $(COMPILE) -c $<
728
729.c.obj:
730@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
731@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
732@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
733@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
734@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
735@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
736
737.c.lo:
738@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
739@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
740@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
741@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
742@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
743@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
744
745mostlyclean-libtool:
746 -rm -f *.lo
747
748clean-libtool:
749 -rm -rf .libs _libs
750install-includesHEADERS: $(includes_HEADERS)
751 @$(NORMAL_INSTALL)
752 test -z "$(includesdir)" || $(MKDIR_P) "$(DESTDIR)$(includesdir)"
753 @list='$(includes_HEADERS)'; test -n "$(includesdir)" || list=; \
754 for p in $$list; do \
755 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
756 echo "$$d$$p"; \
757 done | $(am__base_list) | \
758 while read files; do \
759 echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includesdir)'"; \
760 $(INSTALL_HEADER) $$files "$(DESTDIR)$(includesdir)" || exit $$?; \
761 done
762
763uninstall-includesHEADERS:
764 @$(NORMAL_UNINSTALL)
765 @list='$(includes_HEADERS)'; test -n "$(includesdir)" || list=; \
766 files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
767 test -n "$$files" || exit 0; \
768 echo " ( cd '$(DESTDIR)$(includesdir)' && rm -f" $$files ")"; \
769 cd "$(DESTDIR)$(includesdir)" && rm -f $$files
770
771# This directory's subdirectories are mostly independent; you can cd
772# into them and run `make' without going through this Makefile.
773# To change the values of `make' variables: instead of editing Makefiles,
774# (1) if the variable is set in `config.status', edit `config.status'
775# (which will cause the Makefiles to be regenerated when you run `make');
776# (2) otherwise, pass the desired values on the `make' command line.
777$(RECURSIVE_TARGETS):
778 @fail= failcom='exit 1'; \
779 for f in x $$MAKEFLAGS; do \
780 case $$f in \
781 *=* | --[!k]*);; \
782 *k*) failcom='fail=yes';; \
783 esac; \
784 done; \
785 dot_seen=no; \
786 target=`echo $@ | sed s/-recursive//`; \
787 list='$(SUBDIRS)'; for subdir in $$list; do \
788 echo "Making $$target in $$subdir"; \
789 if test "$$subdir" = "."; then \
790 dot_seen=yes; \
791 local_target="$$target-am"; \
792 else \
793 local_target="$$target"; \
794 fi; \
795 ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
796 || eval $$failcom; \
797 done; \
798 if test "$$dot_seen" = "no"; then \
799 $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
800 fi; test -z "$$fail"
801
802$(RECURSIVE_CLEAN_TARGETS):
803 @fail= failcom='exit 1'; \
804 for f in x $$MAKEFLAGS; do \
805 case $$f in \
806 *=* | --[!k]*);; \
807 *k*) failcom='fail=yes';; \
808 esac; \
809 done; \
810 dot_seen=no; \
811 case "$@" in \
812 distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
813 *) list='$(SUBDIRS)' ;; \
814 esac; \
815 rev=''; for subdir in $$list; do \
816 if test "$$subdir" = "."; then :; else \
817 rev="$$subdir $$rev"; \
818 fi; \
819 done; \
820 rev="$$rev ."; \
821 target=`echo $@ | sed s/-recursive//`; \
822 for subdir in $$rev; do \
823 echo "Making $$target in $$subdir"; \
824 if test "$$subdir" = "."; then \
825 local_target="$$target-am"; \
826 else \
827 local_target="$$target"; \
828 fi; \
829 ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
830 || eval $$failcom; \
831 done && test -z "$$fail"
832tags-recursive:
833 list='$(SUBDIRS)'; for subdir in $$list; do \
834 test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
835 done
836ctags-recursive:
837 list='$(SUBDIRS)'; for subdir in $$list; do \
838 test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
839 done
840
841ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
842 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
843 unique=`for i in $$list; do \
844 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
845 done | \
846 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
847 END { if (nonempty) { for (i in files) print i; }; }'`; \
848 mkid -fID $$unique
849tags: TAGS
850
851TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
852 $(TAGS_FILES) $(LISP)
853 set x; \
854 here=`pwd`; \
855 if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
856 include_option=--etags-include; \
857 empty_fix=.; \
858 else \
859 include_option=--include; \
860 empty_fix=; \
861 fi; \
862 list='$(SUBDIRS)'; for subdir in $$list; do \
863 if test "$$subdir" = .; then :; else \
864 test ! -f $$subdir/TAGS || \
865 set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
866 fi; \
867 done; \
868 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
869 unique=`for i in $$list; do \
870 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
871 done | \
872 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
873 END { if (nonempty) { for (i in files) print i; }; }'`; \
874 shift; \
875 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
876 test -n "$$unique" || unique=$$empty_fix; \
877 if test $$# -gt 0; then \
878 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
879 "$$@" $$unique; \
880 else \
881 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
882 $$unique; \
883 fi; \
884 fi
885ctags: CTAGS
886CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
887 $(TAGS_FILES) $(LISP)
888 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
889 unique=`for i in $$list; do \
890 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
891 done | \
892 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
893 END { if (nonempty) { for (i in files) print i; }; }'`; \
894 test -z "$(CTAGS_ARGS)$$unique" \
895 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
896 $$unique
897
898GTAGS:
899 here=`$(am__cd) $(top_builddir) && pwd` \
900 && $(am__cd) $(top_srcdir) \
901 && gtags -i $(GTAGS_ARGS) "$$here"
902
903distclean-tags:
904 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
905
906distdir: $(DISTFILES)
907 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
908 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
909 list='$(DISTFILES)'; \
910 dist_files=`for file in $$list; do echo $$file; done | \
911 sed -e "s|^$$srcdirstrip/||;t" \
912 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
913 case $$dist_files in \
914 */*) $(MKDIR_P) `echo "$$dist_files" | \
915 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
916 sort -u` ;; \
917 esac; \
918 for file in $$dist_files; do \
919 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
920 if test -d $$d/$$file; then \
921 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
922 if test -d "$(distdir)/$$file"; then \
923 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
924 fi; \
925 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
926 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
927 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
928 fi; \
929 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
930 else \
931 test -f "$(distdir)/$$file" \
932 || cp -p $$d/$$file "$(distdir)/$$file" \
933 || exit 1; \
934 fi; \
935 done
936 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
937 if test "$$subdir" = .; then :; else \
938 test -d "$(distdir)/$$subdir" \
939 || $(MKDIR_P) "$(distdir)/$$subdir" \
940 || exit 1; \
941 fi; \
942 done
943 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
944 if test "$$subdir" = .; then :; else \
945 dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
946 $(am__relativize); \
947 new_distdir=$$reldir; \
948 dir1=$$subdir; dir2="$(top_distdir)"; \
949 $(am__relativize); \
950 new_top_distdir=$$reldir; \
951 echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
952 echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
953 ($(am__cd) $$subdir && \
954 $(MAKE) $(AM_MAKEFLAGS) \
955 top_distdir="$$new_top_distdir" \
956 distdir="$$new_distdir" \
957 am__remove_distdir=: \
958 am__skip_length_check=: \
959 am__skip_mode_fix=: \
960 distdir) \
961 || exit 1; \
962 fi; \
963 done
964check-am: all-am
965check: check-recursive
966all-am: Makefile $(LTLIBRARIES) $(HEADERS)
967installdirs: installdirs-recursive
968installdirs-am:
969 for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includesdir)"; do \
970 test -z "$$dir" || $(MKDIR_P) "$$dir"; \
971 done
972install: install-recursive
973install-exec: install-exec-recursive
974install-data: install-data-recursive
975uninstall: uninstall-recursive
976
977install-am: all-am
978 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
979
980installcheck: installcheck-recursive
981install-strip:
982 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
983 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
984 `test -z '$(STRIP)' || \
985 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
986mostlyclean-generic:
987
988clean-generic:
989
990distclean-generic:
991 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
992 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
993
994maintainer-clean-generic:
995 @echo "This command is intended for maintainers to use"
996 @echo "it deletes files that may require special tools to rebuild."
997 -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
998clean: clean-recursive
999
1000clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
1001 mostlyclean-am
1002
1003distclean: distclean-recursive
1004 -rm -rf ./$(DEPDIR)
1005 -rm -f Makefile
1006distclean-am: clean-am distclean-compile distclean-generic \
1007 distclean-tags
1008
1009dvi: dvi-recursive
1010
1011dvi-am:
1012
1013html: html-recursive
1014
1015html-am:
1016
1017info: info-recursive
1018
1019info-am:
1020
1021install-data-am: install-includesHEADERS
1022
1023install-dvi: install-dvi-recursive
1024
1025install-dvi-am:
1026
1027install-exec-am: install-libLTLIBRARIES
1028
1029install-html: install-html-recursive
1030
1031install-html-am:
1032
1033install-info: install-info-recursive
1034
1035install-info-am:
1036
1037install-man:
1038
1039install-pdf: install-pdf-recursive
1040
1041install-pdf-am:
1042
1043install-ps: install-ps-recursive
1044
1045install-ps-am:
1046
1047installcheck-am:
1048
1049maintainer-clean: maintainer-clean-recursive
1050 -rm -rf ./$(DEPDIR)
1051 -rm -f Makefile
1052maintainer-clean-am: distclean-am maintainer-clean-generic
1053
1054mostlyclean: mostlyclean-recursive
1055
1056mostlyclean-am: mostlyclean-compile mostlyclean-generic \
1057 mostlyclean-libtool
1058
1059pdf: pdf-recursive
1060
1061pdf-am:
1062
1063ps: ps-recursive
1064
1065ps-am:
1066
1067uninstall-am: uninstall-includesHEADERS uninstall-libLTLIBRARIES
1068
1069.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
1070 install-am install-strip tags-recursive
1071
1072.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
1073 all all-am check check-am clean clean-generic \
1074 clean-libLTLIBRARIES clean-libtool ctags ctags-recursive \
1075 distclean distclean-compile distclean-generic \
1076 distclean-libtool distclean-tags distdir dvi dvi-am html \
1077 html-am info info-am install install-am install-data \
1078 install-data-am install-dvi install-dvi-am install-exec \
1079 install-exec-am install-html install-html-am \
1080 install-includesHEADERS install-info install-info-am \
1081 install-libLTLIBRARIES install-man install-pdf install-pdf-am \
1082 install-ps install-ps-am install-strip installcheck \
1083 installcheck-am installdirs installdirs-am maintainer-clean \
1084 maintainer-clean-generic mostlyclean mostlyclean-compile \
1085 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
1086 tags tags-recursive uninstall uninstall-am \
1087 uninstall-includesHEADERS uninstall-libLTLIBRARIES
1088
1089
1090# Tell versions [3.59,3.63) of GNU make to not export all variables.
1091# Otherwise a system limit (for SysV at least) may be exceeded.
1092.NOEXPORT:
diff --git a/libraries/evas/src/lib/cache/Makefile.am b/libraries/evas/src/lib/cache/Makefile.am
new file mode 100644
index 0000000..d417262
--- /dev/null
+++ b/libraries/evas/src/lib/cache/Makefile.am
@@ -0,0 +1,27 @@
1
2MAINTAINERCLEANFILES = Makefile.in
3
4AM_CPPFLAGS = -I. \
5 -I$(top_srcdir)/src/lib \
6 -I$(top_srcdir)/src/lib/include \
7 -DPACKAGE_BIN_DIR=\"$(bindir)\" \
8 -DPACKAGE_LIB_DIR=\"$(libdir)\" \
9 -DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
10 @WIN32_CPPFLAGS@ \
11 @EVIL_CFLAGS@ \
12 @FREETYPE_CFLAGS@ \
13 @PIXMAN_CFLAGS@ \
14 @EINA_CFLAGS@ \
15 @PIXMAN_CFLAGS@
16
17noinst_LTLIBRARIES = libevas_cache.la
18libevas_cache_la_SOURCES = \
19evas_cache_image.c \
20evas_cache_engine_image.c \
21evas_preload.c
22
23libevas_cache_la_LIBAD = @EVIL_LIBS@
24
25libevas_cache_la_DEPENDENCIES = $(top_builddir)/config.h
26
27EXTRA_DIST = evas_cache.h
diff --git a/libraries/evas/src/lib/cache/Makefile.in b/libraries/evas/src/lib/cache/Makefile.in
new file mode 100644
index 0000000..b024731
--- /dev/null
+++ b/libraries/evas/src/lib/cache/Makefile.in
@@ -0,0 +1,683 @@
1# Makefile.in generated by automake 1.11.1 from Makefile.am.
2# @configure_input@
3
4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
6# Inc.
7# This Makefile.in is free software; the Free Software Foundation
8# gives unlimited permission to copy and/or distribute it,
9# with or without modifications, as long as this notice is preserved.
10
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
13# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14# PARTICULAR PURPOSE.
15
16@SET_MAKE@
17
18VPATH = @srcdir@
19pkgdatadir = $(datadir)/@PACKAGE@
20pkgincludedir = $(includedir)/@PACKAGE@
21pkglibdir = $(libdir)/@PACKAGE@
22pkglibexecdir = $(libexecdir)/@PACKAGE@
23am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
24install_sh_DATA = $(install_sh) -c -m 644
25install_sh_PROGRAM = $(install_sh) -c
26install_sh_SCRIPT = $(install_sh) -c
27INSTALL_HEADER = $(INSTALL_DATA)
28transform = $(program_transform_name)
29NORMAL_INSTALL = :
30PRE_INSTALL = :
31POST_INSTALL = :
32NORMAL_UNINSTALL = :
33PRE_UNINSTALL = :
34POST_UNINSTALL = :
35build_triplet = @build@
36host_triplet = @host@
37subdir = src/lib/cache
38DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
39ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
40am__aclocal_m4_deps = $(top_srcdir)/m4/efl_attribute.m4 \
41 $(top_srcdir)/m4/efl_coverage.m4 \
42 $(top_srcdir)/m4/efl_doxygen.m4 \
43 $(top_srcdir)/m4/efl_fnmatch.m4 \
44 $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \
45 $(top_srcdir)/m4/evas_check_engine.m4 \
46 $(top_srcdir)/m4/evas_check_loader.m4 \
47 $(top_srcdir)/m4/evas_converter.m4 \
48 $(top_srcdir)/m4/evas_dither.m4 \
49 $(top_srcdir)/m4/evas_scaler.m4 $(top_srcdir)/m4/libtool.m4 \
50 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
51 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
52 $(top_srcdir)/configure.ac
53am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
54 $(ACLOCAL_M4)
55mkinstalldirs = $(install_sh) -d
56CONFIG_HEADER = $(top_builddir)/config.h
57CONFIG_CLEAN_FILES =
58CONFIG_CLEAN_VPATH_FILES =
59LTLIBRARIES = $(noinst_LTLIBRARIES)
60libevas_cache_la_LIBADD =
61am_libevas_cache_la_OBJECTS = evas_cache_image.lo \
62 evas_cache_engine_image.lo evas_preload.lo
63libevas_cache_la_OBJECTS = $(am_libevas_cache_la_OBJECTS)
64AM_V_lt = $(am__v_lt_$(V))
65am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
66am__v_lt_0 = --silent
67DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
68depcomp = $(SHELL) $(top_srcdir)/depcomp
69am__depfiles_maybe = depfiles
70am__mv = mv -f
71COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
72 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
73LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
74 $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
75 $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
76 $(AM_CFLAGS) $(CFLAGS)
77AM_V_CC = $(am__v_CC_$(V))
78am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
79am__v_CC_0 = @echo " CC " $@;
80AM_V_at = $(am__v_at_$(V))
81am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
82am__v_at_0 = @
83CCLD = $(CC)
84LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
85 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
86 $(AM_LDFLAGS) $(LDFLAGS) -o $@
87AM_V_CCLD = $(am__v_CCLD_$(V))
88am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
89am__v_CCLD_0 = @echo " CCLD " $@;
90AM_V_GEN = $(am__v_GEN_$(V))
91am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
92am__v_GEN_0 = @echo " GEN " $@;
93SOURCES = $(libevas_cache_la_SOURCES)
94DIST_SOURCES = $(libevas_cache_la_SOURCES)
95ETAGS = etags
96CTAGS = ctags
97DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
98ACLOCAL = @ACLOCAL@
99ALLOCA = @ALLOCA@
100AMTAR = @AMTAR@
101AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
102AR = @AR@
103AS = @AS@
104AUTOCONF = @AUTOCONF@
105AUTOHEADER = @AUTOHEADER@
106AUTOMAKE = @AUTOMAKE@
107AWK = @AWK@
108CC = @CC@
109CCDEPMODE = @CCDEPMODE@
110CFLAGS = @CFLAGS@
111CHECK_CFLAGS = @CHECK_CFLAGS@
112CHECK_LIBS = @CHECK_LIBS@
113CPP = @CPP@
114CPPFLAGS = @CPPFLAGS@
115CXX = @CXX@
116CXXCPP = @CXXCPP@
117CXXDEPMODE = @CXXDEPMODE@
118CXXFLAGS = @CXXFLAGS@
119CYGPATH_W = @CYGPATH_W@
120DEFS = @DEFS@
121DEPDIR = @DEPDIR@
122DIRECTFB_CFLAGS = @DIRECTFB_CFLAGS@
123DIRECTFB_LIBS = @DIRECTFB_LIBS@
124DLLTOOL = @DLLTOOL@
125DSYMUTIL = @DSYMUTIL@
126DUMPBIN = @DUMPBIN@
127ECHO_C = @ECHO_C@
128ECHO_N = @ECHO_N@
129ECHO_T = @ECHO_T@
130ECORE_EVAS_CFLAGS = @ECORE_EVAS_CFLAGS@
131ECORE_EVAS_LIBS = @ECORE_EVAS_LIBS@
132EDB_CFLAGS = @EDB_CFLAGS@
133EDB_LIBS = @EDB_LIBS@
134EDJE_CFLAGS = @EDJE_CFLAGS@
135EDJE_LIBS = @EDJE_LIBS@
136EET_CFLAGS = @EET_CFLAGS@
137EET_LIBS = @EET_LIBS@
138EFL_COVERAGE_CFLAGS = @EFL_COVERAGE_CFLAGS@
139EFL_COVERAGE_LIBS = @EFL_COVERAGE_LIBS@
140EFL_FNMATCH_LIBS = @EFL_FNMATCH_LIBS@
141EGREP = @EGREP@
142EINA_CFLAGS = @EINA_CFLAGS@
143EINA_LIBS = @EINA_LIBS@
144EVAS_CFLAGS = @EVAS_CFLAGS@
145EVAS_LIBS = @EVAS_LIBS@
146EVAS_SSE3_CFLAGS = @EVAS_SSE3_CFLAGS@
147EVIL_CFLAGS = @EVIL_CFLAGS@
148EVIL_LIBS = @EVIL_LIBS@
149EXEEXT = @EXEEXT@
150FGREP = @FGREP@
151FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@
152FONTCONFIG_LIBS = @FONTCONFIG_LIBS@
153FREETYPE_CFLAGS = @FREETYPE_CFLAGS@
154FREETYPE_LIBS = @FREETYPE_LIBS@
155FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@
156FRIBIDI_LIBS = @FRIBIDI_LIBS@
157GL_EET_CFLAGS = @GL_EET_CFLAGS@
158GL_EET_LIBS = @GL_EET_LIBS@
159GREP = @GREP@
160HARFBUZZ_CFLAGS = @HARFBUZZ_CFLAGS@
161HARFBUZZ_LIBS = @HARFBUZZ_LIBS@
162INSTALL = @INSTALL@
163INSTALL_DATA = @INSTALL_DATA@
164INSTALL_PROGRAM = @INSTALL_PROGRAM@
165INSTALL_SCRIPT = @INSTALL_SCRIPT@
166INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
167LD = @LD@
168LDFLAGS = @LDFLAGS@
169LIBOBJS = @LIBOBJS@
170LIBS = @LIBS@
171LIBTOOL = @LIBTOOL@
172LINEBREAK_CFLAGS = @LINEBREAK_CFLAGS@
173LINEBREAK_LIBS = @LINEBREAK_LIBS@
174LIPO = @LIPO@
175LN_S = @LN_S@
176LTLIBOBJS = @LTLIBOBJS@
177MAKEINFO = @MAKEINFO@
178MKDIR_P = @MKDIR_P@
179MODULE_ARCH = @MODULE_ARCH@
180NM = @NM@
181NMEDIT = @NMEDIT@
182OBJC = @OBJC@
183OBJCDEPMODE = @OBJCDEPMODE@
184OBJCFLAGS = @OBJCFLAGS@
185OBJDUMP = @OBJDUMP@
186OBJEXT = @OBJEXT@
187OTOOL = @OTOOL@
188OTOOL64 = @OTOOL64@
189PACKAGE = @PACKAGE@
190PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
191PACKAGE_NAME = @PACKAGE_NAME@
192PACKAGE_STRING = @PACKAGE_STRING@
193PACKAGE_TARNAME = @PACKAGE_TARNAME@
194PACKAGE_URL = @PACKAGE_URL@
195PACKAGE_VERSION = @PACKAGE_VERSION@
196PATH_SEPARATOR = @PATH_SEPARATOR@
197PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
198PIXMAN_LIBS = @PIXMAN_LIBS@
199PKG_CONFIG = @PKG_CONFIG@
200PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
201PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
202PNG_CFLAGS = @PNG_CFLAGS@
203PNG_LIBS = @PNG_LIBS@
204RANLIB = @RANLIB@
205SDL_CFLAGS = @SDL_CFLAGS@
206SDL_LIBS = @SDL_LIBS@
207SED = @SED@
208SET_MAKE = @SET_MAKE@
209SHELL = @SHELL@
210SHM_OPEN_LINK = @SHM_OPEN_LINK@
211STRIP = @STRIP@
212SVG_CFLAGS = @SVG_CFLAGS@
213SVG_LIBS = @SVG_LIBS@
214VALGRIND_CFLAGS = @VALGRIND_CFLAGS@
215VALGRIND_LIBS = @VALGRIND_LIBS@
216VERSION = @VERSION@
217VMAJ = @VMAJ@
218WIN32_CFLAGS = @WIN32_CFLAGS@
219WIN32_CPPFLAGS = @WIN32_CPPFLAGS@
220XCB_CFLAGS = @XCB_CFLAGS@
221XCB_GL_CFLAGS = @XCB_GL_CFLAGS@
222XCB_GL_LIBS = @XCB_GL_LIBS@
223XCB_LIBS = @XCB_LIBS@
224XEXT_CFLAGS = @XEXT_CFLAGS@
225XEXT_LIBS = @XEXT_LIBS@
226XMKMF = @XMKMF@
227X_CFLAGS = @X_CFLAGS@
228X_EXTRA_LIBS = @X_EXTRA_LIBS@
229X_LIBS = @X_LIBS@
230X_PRE_LIBS = @X_PRE_LIBS@
231abs_builddir = @abs_builddir@
232abs_srcdir = @abs_srcdir@
233abs_top_builddir = @abs_top_builddir@
234abs_top_srcdir = @abs_top_srcdir@
235ac_ct_CC = @ac_ct_CC@
236ac_ct_CXX = @ac_ct_CXX@
237ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
238ac_ct_OBJC = @ac_ct_OBJC@
239altivec_cflags = @altivec_cflags@
240am__include = @am__include@
241am__leading_dot = @am__leading_dot@
242am__quote = @am__quote@
243am__tar = @am__tar@
244am__untar = @am__untar@
245bindir = @bindir@
246build = @build@
247build_alias = @build_alias@
248build_cpu = @build_cpu@
249build_os = @build_os@
250build_vendor = @build_vendor@
251builddir = @builddir@
252datadir = @datadir@
253datarootdir = @datarootdir@
254dlopen_libs = @dlopen_libs@
255docdir = @docdir@
256dvidir = @dvidir@
257edje_cc = @edje_cc@
258efl_doxygen = @efl_doxygen@
259efl_have_doxygen = @efl_have_doxygen@
260evas_engine_buffer_cflags = @evas_engine_buffer_cflags@
261evas_engine_buffer_libs = @evas_engine_buffer_libs@
262evas_engine_direct3d_cflags = @evas_engine_direct3d_cflags@
263evas_engine_direct3d_libs = @evas_engine_direct3d_libs@
264evas_engine_directfb_cflags = @evas_engine_directfb_cflags@
265evas_engine_directfb_libs = @evas_engine_directfb_libs@
266evas_engine_fb_cflags = @evas_engine_fb_cflags@
267evas_engine_fb_libs = @evas_engine_fb_libs@
268evas_engine_gl_cocoa_cflags = @evas_engine_gl_cocoa_cflags@
269evas_engine_gl_cocoa_libs = @evas_engine_gl_cocoa_libs@
270evas_engine_gl_common_libs = @evas_engine_gl_common_libs@
271evas_engine_gl_sdl_cflags = @evas_engine_gl_sdl_cflags@
272evas_engine_gl_sdl_libs = @evas_engine_gl_sdl_libs@
273evas_engine_gl_xcb_cflags = @evas_engine_gl_xcb_cflags@
274evas_engine_gl_xcb_libs = @evas_engine_gl_xcb_libs@
275evas_engine_gl_xlib_cflags = @evas_engine_gl_xlib_cflags@
276evas_engine_gl_xlib_libs = @evas_engine_gl_xlib_libs@
277evas_engine_psl1ght_cflags = @evas_engine_psl1ght_cflags@
278evas_engine_psl1ght_libs = @evas_engine_psl1ght_libs@
279evas_engine_software_16_ddraw_cflags = @evas_engine_software_16_ddraw_cflags@
280evas_engine_software_16_ddraw_libs = @evas_engine_software_16_ddraw_libs@
281evas_engine_software_16_sdl_cflags = @evas_engine_software_16_sdl_cflags@
282evas_engine_software_16_sdl_libs = @evas_engine_software_16_sdl_libs@
283evas_engine_software_16_wince_cflags = @evas_engine_software_16_wince_cflags@
284evas_engine_software_16_wince_libs = @evas_engine_software_16_wince_libs@
285evas_engine_software_16_x11_cflags = @evas_engine_software_16_x11_cflags@
286evas_engine_software_16_x11_libs = @evas_engine_software_16_x11_libs@
287evas_engine_software_8_x11_cflags = @evas_engine_software_8_x11_cflags@
288evas_engine_software_8_x11_libs = @evas_engine_software_8_x11_libs@
289evas_engine_software_ddraw_cflags = @evas_engine_software_ddraw_cflags@
290evas_engine_software_ddraw_libs = @evas_engine_software_ddraw_libs@
291evas_engine_software_gdi_cflags = @evas_engine_software_gdi_cflags@
292evas_engine_software_gdi_libs = @evas_engine_software_gdi_libs@
293evas_engine_software_sdl_cflags = @evas_engine_software_sdl_cflags@
294evas_engine_software_sdl_libs = @evas_engine_software_sdl_libs@
295evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@
296evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@
297evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@
298evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@
299evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@
300evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@
301evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@
302evas_image_loader_edb_libs = @evas_image_loader_edb_libs@
303evas_image_loader_eet_cflags = @evas_image_loader_eet_cflags@
304evas_image_loader_eet_libs = @evas_image_loader_eet_libs@
305evas_image_loader_generic_cflags = @evas_image_loader_generic_cflags@
306evas_image_loader_generic_libs = @evas_image_loader_generic_libs@
307evas_image_loader_gif_cflags = @evas_image_loader_gif_cflags@
308evas_image_loader_gif_libs = @evas_image_loader_gif_libs@
309evas_image_loader_ico_cflags = @evas_image_loader_ico_cflags@
310evas_image_loader_ico_libs = @evas_image_loader_ico_libs@
311evas_image_loader_jpeg_cflags = @evas_image_loader_jpeg_cflags@
312evas_image_loader_jpeg_libs = @evas_image_loader_jpeg_libs@
313evas_image_loader_pmaps_cflags = @evas_image_loader_pmaps_cflags@
314evas_image_loader_pmaps_libs = @evas_image_loader_pmaps_libs@
315evas_image_loader_png_cflags = @evas_image_loader_png_cflags@
316evas_image_loader_png_libs = @evas_image_loader_png_libs@
317evas_image_loader_psd_cflags = @evas_image_loader_psd_cflags@
318evas_image_loader_psd_libs = @evas_image_loader_psd_libs@
319evas_image_loader_svg_cflags = @evas_image_loader_svg_cflags@
320evas_image_loader_svg_libs = @evas_image_loader_svg_libs@
321evas_image_loader_tga_cflags = @evas_image_loader_tga_cflags@
322evas_image_loader_tga_libs = @evas_image_loader_tga_libs@
323evas_image_loader_tiff_cflags = @evas_image_loader_tiff_cflags@
324evas_image_loader_tiff_libs = @evas_image_loader_tiff_libs@
325evas_image_loader_wbmp_cflags = @evas_image_loader_wbmp_cflags@
326evas_image_loader_wbmp_libs = @evas_image_loader_wbmp_libs@
327evas_image_loader_xpm_cflags = @evas_image_loader_xpm_cflags@
328evas_image_loader_xpm_libs = @evas_image_loader_xpm_libs@
329exec_prefix = @exec_prefix@
330have_evas_engine_gl_x11 = @have_evas_engine_gl_x11@
331have_evas_engine_gl_xcb = @have_evas_engine_gl_xcb@
332have_evas_engine_gl_xlib = @have_evas_engine_gl_xlib@
333have_evas_engine_software_x11 = @have_evas_engine_software_x11@
334have_evas_engine_software_xcb = @have_evas_engine_software_xcb@
335have_evas_engine_software_xlib = @have_evas_engine_software_xlib@
336have_lcov = @have_lcov@
337host = @host@
338host_alias = @host_alias@
339host_cpu = @host_cpu@
340host_os = @host_os@
341host_vendor = @host_vendor@
342htmldir = @htmldir@
343includedir = @includedir@
344infodir = @infodir@
345install_sh = @install_sh@
346libdir = @libdir@
347libexecdir = @libexecdir@
348localedir = @localedir@
349localstatedir = @localstatedir@
350lt_ECHO = @lt_ECHO@
351lt_enable_auto_import = @lt_enable_auto_import@
352mandir = @mandir@
353mkdir_p = @mkdir_p@
354oldincludedir = @oldincludedir@
355pdfdir = @pdfdir@
356pkgconfig_requires_private = @pkgconfig_requires_private@
357prefix = @prefix@
358program_transform_name = @program_transform_name@
359psdir = @psdir@
360pthread_cflags = @pthread_cflags@
361pthread_libs = @pthread_libs@
362release_info = @release_info@
363requirement_evas = @requirement_evas@
364sbindir = @sbindir@
365sharedstatedir = @sharedstatedir@
366srcdir = @srcdir@
367sysconfdir = @sysconfdir@
368target_alias = @target_alias@
369top_build_prefix = @top_build_prefix@
370top_builddir = @top_builddir@
371top_srcdir = @top_srcdir@
372version_info = @version_info@
373MAINTAINERCLEANFILES = Makefile.in
374AM_CPPFLAGS = -I. \
375 -I$(top_srcdir)/src/lib \
376 -I$(top_srcdir)/src/lib/include \
377 -DPACKAGE_BIN_DIR=\"$(bindir)\" \
378 -DPACKAGE_LIB_DIR=\"$(libdir)\" \
379 -DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
380 @WIN32_CPPFLAGS@ \
381 @EVIL_CFLAGS@ \
382 @FREETYPE_CFLAGS@ \
383 @PIXMAN_CFLAGS@ \
384 @EINA_CFLAGS@ \
385 @PIXMAN_CFLAGS@
386
387noinst_LTLIBRARIES = libevas_cache.la
388libevas_cache_la_SOURCES = \
389evas_cache_image.c \
390evas_cache_engine_image.c \
391evas_preload.c
392
393libevas_cache_la_LIBAD = @EVIL_LIBS@
394libevas_cache_la_DEPENDENCIES = $(top_builddir)/config.h
395EXTRA_DIST = evas_cache.h
396all: all-am
397
398.SUFFIXES:
399.SUFFIXES: .c .lo .o .obj
400$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
401 @for dep in $?; do \
402 case '$(am__configure_deps)' in \
403 *$$dep*) \
404 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
405 && { if test -f $@; then exit 0; else break; fi; }; \
406 exit 1;; \
407 esac; \
408 done; \
409 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/cache/Makefile'; \
410 $(am__cd) $(top_srcdir) && \
411 $(AUTOMAKE) --gnu src/lib/cache/Makefile
412.PRECIOUS: Makefile
413Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
414 @case '$?' in \
415 *config.status*) \
416 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
417 *) \
418 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
419 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
420 esac;
421
422$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
423 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
424
425$(top_srcdir)/configure: $(am__configure_deps)
426 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
427$(ACLOCAL_M4): $(am__aclocal_m4_deps)
428 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
429$(am__aclocal_m4_deps):
430
431clean-noinstLTLIBRARIES:
432 -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
433 @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
434 dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
435 test "$$dir" != "$$p" || dir=.; \
436 echo "rm -f \"$${dir}/so_locations\""; \
437 rm -f "$${dir}/so_locations"; \
438 done
439libevas_cache.la: $(libevas_cache_la_OBJECTS) $(libevas_cache_la_DEPENDENCIES)
440 $(AM_V_CCLD)$(LINK) $(libevas_cache_la_OBJECTS) $(libevas_cache_la_LIBADD) $(LIBS)
441
442mostlyclean-compile:
443 -rm -f *.$(OBJEXT)
444
445distclean-compile:
446 -rm -f *.tab.c
447
448@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_cache_engine_image.Plo@am__quote@
449@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_cache_image.Plo@am__quote@
450@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_preload.Plo@am__quote@
451
452.c.o:
453@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
454@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
455@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
456@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
457@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
458@am__fastdepCC_FALSE@ $(COMPILE) -c $<
459
460.c.obj:
461@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
462@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
463@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
464@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
465@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
466@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
467
468.c.lo:
469@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
470@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
471@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
472@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
473@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
474@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
475
476mostlyclean-libtool:
477 -rm -f *.lo
478
479clean-libtool:
480 -rm -rf .libs _libs
481
482ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
483 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
484 unique=`for i in $$list; do \
485 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
486 done | \
487 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
488 END { if (nonempty) { for (i in files) print i; }; }'`; \
489 mkid -fID $$unique
490tags: TAGS
491
492TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
493 $(TAGS_FILES) $(LISP)
494 set x; \
495 here=`pwd`; \
496 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
497 unique=`for i in $$list; do \
498 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
499 done | \
500 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
501 END { if (nonempty) { for (i in files) print i; }; }'`; \
502 shift; \
503 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
504 test -n "$$unique" || unique=$$empty_fix; \
505 if test $$# -gt 0; then \
506 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
507 "$$@" $$unique; \
508 else \
509 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
510 $$unique; \
511 fi; \
512 fi
513ctags: CTAGS
514CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
515 $(TAGS_FILES) $(LISP)
516 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
517 unique=`for i in $$list; do \
518 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
519 done | \
520 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
521 END { if (nonempty) { for (i in files) print i; }; }'`; \
522 test -z "$(CTAGS_ARGS)$$unique" \
523 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
524 $$unique
525
526GTAGS:
527 here=`$(am__cd) $(top_builddir) && pwd` \
528 && $(am__cd) $(top_srcdir) \
529 && gtags -i $(GTAGS_ARGS) "$$here"
530
531distclean-tags:
532 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
533
534distdir: $(DISTFILES)
535 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
536 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
537 list='$(DISTFILES)'; \
538 dist_files=`for file in $$list; do echo $$file; done | \
539 sed -e "s|^$$srcdirstrip/||;t" \
540 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
541 case $$dist_files in \
542 */*) $(MKDIR_P) `echo "$$dist_files" | \
543 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
544 sort -u` ;; \
545 esac; \
546 for file in $$dist_files; do \
547 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
548 if test -d $$d/$$file; then \
549 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
550 if test -d "$(distdir)/$$file"; then \
551 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
552 fi; \
553 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
554 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
555 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
556 fi; \
557 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
558 else \
559 test -f "$(distdir)/$$file" \
560 || cp -p $$d/$$file "$(distdir)/$$file" \
561 || exit 1; \
562 fi; \
563 done
564check-am: all-am
565check: check-am
566all-am: Makefile $(LTLIBRARIES)
567installdirs:
568install: install-am
569install-exec: install-exec-am
570install-data: install-data-am
571uninstall: uninstall-am
572
573install-am: all-am
574 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
575
576installcheck: installcheck-am
577install-strip:
578 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
579 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
580 `test -z '$(STRIP)' || \
581 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
582mostlyclean-generic:
583
584clean-generic:
585
586distclean-generic:
587 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
588 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
589
590maintainer-clean-generic:
591 @echo "This command is intended for maintainers to use"
592 @echo "it deletes files that may require special tools to rebuild."
593 -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
594clean: clean-am
595
596clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
597 mostlyclean-am
598
599distclean: distclean-am
600 -rm -rf ./$(DEPDIR)
601 -rm -f Makefile
602distclean-am: clean-am distclean-compile distclean-generic \
603 distclean-tags
604
605dvi: dvi-am
606
607dvi-am:
608
609html: html-am
610
611html-am:
612
613info: info-am
614
615info-am:
616
617install-data-am:
618
619install-dvi: install-dvi-am
620
621install-dvi-am:
622
623install-exec-am:
624
625install-html: install-html-am
626
627install-html-am:
628
629install-info: install-info-am
630
631install-info-am:
632
633install-man:
634
635install-pdf: install-pdf-am
636
637install-pdf-am:
638
639install-ps: install-ps-am
640
641install-ps-am:
642
643installcheck-am:
644
645maintainer-clean: maintainer-clean-am
646 -rm -rf ./$(DEPDIR)
647 -rm -f Makefile
648maintainer-clean-am: distclean-am maintainer-clean-generic
649
650mostlyclean: mostlyclean-am
651
652mostlyclean-am: mostlyclean-compile mostlyclean-generic \
653 mostlyclean-libtool
654
655pdf: pdf-am
656
657pdf-am:
658
659ps: ps-am
660
661ps-am:
662
663uninstall-am:
664
665.MAKE: install-am install-strip
666
667.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
668 clean-libtool clean-noinstLTLIBRARIES ctags distclean \
669 distclean-compile distclean-generic distclean-libtool \
670 distclean-tags distdir dvi dvi-am html html-am info info-am \
671 install install-am install-data install-data-am install-dvi \
672 install-dvi-am install-exec install-exec-am install-html \
673 install-html-am install-info install-info-am install-man \
674 install-pdf install-pdf-am install-ps install-ps-am \
675 install-strip installcheck installcheck-am installdirs \
676 maintainer-clean maintainer-clean-generic mostlyclean \
677 mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
678 pdf pdf-am ps ps-am tags uninstall uninstall-am
679
680
681# Tell versions [3.59,3.63) of GNU make to not export all variables.
682# Otherwise a system limit (for SysV at least) may be exceeded.
683.NOEXPORT:
diff --git a/libraries/evas/src/lib/cache/evas_cache.h b/libraries/evas/src/lib/cache/evas_cache.h
new file mode 100644
index 0000000..0947a6d
--- /dev/null
+++ b/libraries/evas/src/lib/cache/evas_cache.h
@@ -0,0 +1,175 @@
1#ifndef _EVAS_CACHE_H
2#define _EVAS_CACHE_H
3
4
5typedef struct _Evas_Cache_Image Evas_Cache_Image;
6typedef struct _Evas_Cache_Image_Func Evas_Cache_Image_Func;
7typedef struct _Evas_Cache_Engine_Image Evas_Cache_Engine_Image;
8typedef struct _Evas_Cache_Engine_Image_Func Evas_Cache_Engine_Image_Func;
9
10
11struct _Evas_Cache_Image_Func
12{
13 Image_Entry *(*alloc)(void);
14 void (*dealloc)(Image_Entry *im);
15
16 /* The cache provide some helpers for surface manipulation. */
17 int (*surface_alloc)(Image_Entry *im, unsigned int w, unsigned int h);
18 void (*surface_delete)(Image_Entry *im);
19 DATA32 *(*surface_pixels)(Image_Entry *im);
20
21 /* The cache is doing the allocation and deallocation, you must just do the rest. */
22 int (*constructor)(Image_Entry *im); /**< return is EVAS_LOAD_ERROR_* or EVAS_LOAD_ERROR_NONE! */
23 void (*destructor)(Image_Entry *im);
24
25 void (*dirty_region)(Image_Entry *im, unsigned int x, unsigned int y, unsigned int w, unsigned int h);
26 /* Only called when references > 0. Need to provide a fresh copie of im. */
27 /* The destination surface does have a surface, but no allocated pixel data. */
28 int (*dirty)(Image_Entry *dst, const Image_Entry *src);
29 /* Only called when references == 1. We will call drop on `im'. */
30 /* The destination surface does not have any surface. */
31 int (*size_set)(Image_Entry *dst, const Image_Entry *src, unsigned int w, unsigned int h);
32
33 /* The destination surface does not have any surface. */
34 int (*copied_data)(Image_Entry *dst, unsigned int w, unsigned int h, DATA32 *image_data, int alpha, int cspace);
35 /* The destination surface does not have any surface. */
36 int (*data)(Image_Entry *dst, unsigned int w, unsigned int h, DATA32 *image_data, int alpha, int cspace);
37 int (*color_space)(Image_Entry *dst, int cspace);
38
39 /* This function need to update im->w and im->h. */
40 int (*load)(Image_Entry *im); /**< return is EVAS_LOAD_ERROR_* or EVAS_LOAD_ERROR_NONE! */
41 int (*mem_size_get)(Image_Entry *im);
42 void (*debug)(const char *context, Image_Entry *im);
43};
44
45struct _Evas_Cache_Image
46{
47 Evas_Cache_Image_Func func;
48
49 Eina_List *preload;
50 Eina_List *pending;
51
52 Eina_Inlist *dirty;
53
54 Eina_Inlist *lru;
55 Eina_Inlist *lru_nodata;
56 Eina_Hash *inactiv;
57 Eina_Hash *activ;
58 void *data;
59
60 int usage;
61 unsigned int limit;
62 int references;
63#ifdef EVAS_FRAME_QUEUING
64 LK(lock);
65#endif
66};
67
68struct _Evas_Cache_Engine_Image_Func
69{
70 /* Must return a char* allocated with eina_stringshare_add. */
71 char* (*key)(Image_Entry *im, const char *file, const char *key, RGBA_Image_Loadopts *lo, int *error);
72
73 Engine_Image_Entry* (*alloc)(void);
74 void (*dealloc)(Engine_Image_Entry *eim);
75
76 int (*constructor)(Engine_Image_Entry *eim, void* data);
77 void (*destructor)(Engine_Image_Entry *eim);
78
79 void (*dirty_region)(Engine_Image_Entry *eim, unsigned int x, unsigned int y, unsigned int w, unsigned int h);
80 /* Only called when references > 0. Need to provide a fresh copie of im. */
81 int (*dirty)(Engine_Image_Entry *dst, const Engine_Image_Entry *src);
82 /* Only called when references == 1. We will call drop on `im'. */
83 int (*size_set)(Engine_Image_Entry *dst, const Engine_Image_Entry *src);
84
85 int (*update_data)(Engine_Image_Entry* dst, void* data);
86
87 void (*load)(Engine_Image_Entry *eim, const Image_Entry* im);
88 int (*mem_size_get)(Engine_Image_Entry *eim);
89 void (*debug)(const char* context, Engine_Image_Entry *eim);
90};
91
92struct _Evas_Cache_Engine_Image
93{
94 Evas_Cache_Engine_Image_Func func;
95
96 Eina_Inlist* dirty;
97
98 Eina_Hash* activ;
99 Eina_Hash* inactiv;
100 Eina_Inlist* lru;
101
102 Evas_Cache_Image* parent;
103 Evas_Cache_Engine_Image* brother;
104
105 int usage;
106 int limit;
107
108 int references;
109};
110
111
112#ifdef __cplusplus
113extern "C" {
114#endif
115
116
117EAPI Evas_Cache_Image* evas_cache_image_init(const Evas_Cache_Image_Func *cb);
118EAPI void evas_cache_image_shutdown(Evas_Cache_Image *cache);
119EAPI Image_Entry* evas_cache_image_request(Evas_Cache_Image *cache, const char *file, const char *key, RGBA_Image_Loadopts *lo, int *error);
120EAPI void evas_cache_image_drop(Image_Entry *im);
121EAPI void evas_cache_image_data_not_needed(Image_Entry *im);
122EAPI int evas_cache_image_flush(Evas_Cache_Image *cache);
123EAPI void evas_cache_private_set(Evas_Cache_Image *cache, const void *data);
124EAPI void* evas_cache_private_get(Evas_Cache_Image *cache);
125EAPI void* evas_cache_private_from_image_entry_get(Image_Entry *im);
126
127EAPI int evas_cache_image_usage_get(Evas_Cache_Image *cache);
128EAPI int evas_cache_image_get(Evas_Cache_Image *cache);
129EAPI void evas_cache_image_set(Evas_Cache_Image *cache, unsigned int size);
130
131EAPI Image_Entry* evas_cache_image_alone(Image_Entry *im);
132EAPI Image_Entry* evas_cache_image_dirty(Image_Entry *im, unsigned int x, unsigned int y, unsigned int w, unsigned int h);
133EAPI int evas_cache_image_load_data(Image_Entry *im);
134EAPI void evas_cache_image_unload_data(Image_Entry *im);
135EAPI Eina_Bool evas_cache_image_is_loaded(Image_Entry *im);
136EAPI void evas_cache_image_unload_all(Evas_Cache_Image *cache);
137EAPI void evas_cache_image_surface_alloc(Image_Entry *im, unsigned int w, unsigned int h);
138EAPI DATA32* evas_cache_image_pixels(Image_Entry *im);
139EAPI Image_Entry* evas_cache_image_copied_data(Evas_Cache_Image *cache, unsigned int w, unsigned int h, DATA32 *image_data, int alpha, int cspace);
140EAPI Image_Entry* evas_cache_image_data(Evas_Cache_Image *cache, unsigned int w, unsigned int h, DATA32 *image_data, int alpha, int cspace);
141EAPI void evas_cache_image_colorspace(Image_Entry *im, int cspace);
142EAPI Image_Entry* evas_cache_image_empty(Evas_Cache_Image *cache);
143EAPI Image_Entry* evas_cache_image_size_set(Image_Entry *im, unsigned int w, unsigned int h);
144
145EAPI Evas_Cache_Engine_Image* evas_cache_engine_image_init(const Evas_Cache_Engine_Image_Func *cb, Evas_Cache_Image *parent);
146EAPI void evas_cache_engine_image_shutdown(Evas_Cache_Engine_Image *cache);
147
148EAPI int evas_cache_engine_image_usage_get(Evas_Cache_Engine_Image *cache);
149EAPI int evas_cache_engine_image_get(Evas_Cache_Engine_Image *cache);
150EAPI void evas_cache_engine_image_set(Evas_Cache_Engine_Image *cache, int limit);
151
152EAPI Engine_Image_Entry* evas_cache_engine_image_request(Evas_Cache_Engine_Image *cache, const char *file, const char *key, RGBA_Image_Loadopts *lo, void *engine_data, int *error);
153EAPI void evas_cache_engine_parent_not_needed(Engine_Image_Entry *eim);
154EAPI Engine_Image_Entry* evas_cache_engine_image_engine(Evas_Cache_Engine_Image *cache, void *engine_data);
155EAPI void evas_cache_engine_image_drop(Engine_Image_Entry *eim);
156EAPI Engine_Image_Entry* evas_cache_engine_image_alone(Engine_Image_Entry *eim, void *data);
157EAPI Engine_Image_Entry* evas_cache_engine_image_dirty(Engine_Image_Entry *eim, unsigned int x, unsigned int y, unsigned int w, unsigned int h);
158EAPI Engine_Image_Entry* evas_cache_engine_image_copied_data(Evas_Cache_Engine_Image *cache, unsigned int w, unsigned int h, DATA32 *image_data, int alpha, int cspace, void *engine_data);
159EAPI Engine_Image_Entry* evas_cache_engine_image_data(Evas_Cache_Engine_Image *cache, unsigned int w, unsigned int h, DATA32 *image_data, int alpha, int cspace, void *engine_data);
160EAPI void evas_cache_engine_image_colorspace(Engine_Image_Entry *eim, int cspace, void *engine_data);
161EAPI Engine_Image_Entry* evas_cache_engine_image_size_set(Engine_Image_Entry *eim, unsigned int w, unsigned int h);
162
163EAPI void evas_cache_engine_image_load_data(Engine_Image_Entry *eim);
164
165EAPI void evas_cache_image_preload_data(Image_Entry *im, const void *target);
166EAPI void evas_cache_image_preload_cancel(Image_Entry *im, const void *target);
167
168EAPI void evas_cache_image_wakeup(void);
169
170#ifdef __cplusplus
171}
172#endif
173
174
175#endif /* _EVAS_CACHE_H */
diff --git a/libraries/evas/src/lib/cache/evas_cache_engine_image.c b/libraries/evas/src/lib/cache/evas_cache_engine_image.c
new file mode 100644
index 0000000..8ae4392
--- /dev/null
+++ b/libraries/evas/src/lib/cache/evas_cache_engine_image.c
@@ -0,0 +1,699 @@
1#include <assert.h>
2
3#include "evas_common.h"
4#include "evas_private.h"
5
6static void
7_evas_cache_engine_image_make_dirty(Evas_Cache_Engine_Image *cache,
8 Engine_Image_Entry *eim)
9{
10 eim->flags.cached = 1;
11 eim->flags.dirty = 1;
12 eim->flags.loaded = 1;
13 eim->flags.activ = 0;
14 cache->dirty = eina_inlist_prepend(cache->dirty, EINA_INLIST_GET(eim));
15}
16
17static void
18_evas_cache_engine_image_make_active(Evas_Cache_Engine_Image *cache,
19 Engine_Image_Entry *eim,
20 const char *key)
21{
22 eim->flags.cached = 1;
23 eim->flags.activ = 1;
24 eim->flags.dirty = 0;
25 eina_hash_add(cache->activ, key, eim);
26}
27
28static void
29_evas_cache_engine_image_make_inactive(Evas_Cache_Engine_Image *cache,
30 Engine_Image_Entry *eim,
31 const char *key)
32{
33 eim->flags.cached = 1;
34 eim->flags.dirty = 0;
35 eim->flags.activ = 0;
36 eina_hash_add(cache->inactiv, key, eim);
37 cache->lru = eina_inlist_prepend(cache->lru, EINA_INLIST_GET(eim));
38 cache->usage += cache->func.mem_size_get(eim);
39}
40
41static void
42_evas_cache_engine_image_remove_activ(Evas_Cache_Engine_Image *cache,
43 Engine_Image_Entry *eim)
44{
45 if (eim->flags.cached)
46 {
47 if (eim->flags.dirty)
48 {
49 cache->dirty = eina_inlist_remove(cache->dirty, EINA_INLIST_GET(eim));
50 }
51 else
52 if (eim->flags.activ)
53 {
54 eina_hash_del(cache->activ, eim->cache_key, eim);
55 }
56 else
57 {
58 cache->usage -= cache->func.mem_size_get(eim);
59 eina_hash_del(cache->inactiv, eim->cache_key, eim);
60 cache->lru = eina_inlist_remove(cache->lru, EINA_INLIST_GET(eim));
61 }
62 eim->flags.cached = 0;
63 eim->flags.dirty = 0;
64 eim->flags.activ = 0;
65 }
66}
67
68static Engine_Image_Entry *
69_evas_cache_engine_image_alloc(Evas_Cache_Engine_Image *cache,
70 Image_Entry *ie,
71 const char *hkey)
72{
73 Engine_Image_Entry *eim;
74
75 assert(cache);
76
77 if (cache->func.alloc)
78 eim = cache->func.alloc();
79 else
80 eim = malloc(sizeof (Engine_Image_Entry));
81
82 if (!eim) goto on_error;
83 memset(eim, 0, sizeof (Engine_Image_Entry));
84
85 eim->cache = cache;
86 if (ie)
87 {
88 eim->w = ie->w;
89 eim->h = ie->h;
90 eim->src = ie;
91 eim->flags.need_parent = 1;
92 }
93 else
94 {
95 eim->w = -1;
96 eim->h = -1;
97 eim->flags.need_parent = 0;
98 eim->src = NULL;
99 }
100
101 eim->flags.cached = 0;
102 eim->references = 0;
103 eim->cache_key = hkey;
104
105 if (hkey)
106 _evas_cache_engine_image_make_active(cache, eim, hkey);
107 else
108 _evas_cache_engine_image_make_dirty(cache, eim);
109
110 return eim;
111
112 on_error:
113 if (eim)
114 evas_cache_engine_image_drop(eim);
115 eina_stringshare_del(hkey);
116 evas_cache_image_drop(ie);
117 return NULL;
118}
119
120static void
121_evas_cache_engine_image_dealloc(Evas_Cache_Engine_Image *cache, Engine_Image_Entry *eim)
122{
123 Image_Entry *im;
124
125 if (cache->func.debug) cache->func.debug("delete", eim);
126
127 _evas_cache_engine_image_remove_activ(cache, eim);
128
129 im = eim->src;
130 cache->func.destructor(eim);
131 if (im) evas_cache_image_drop(im);
132
133 if (cache->func.dealloc)
134 {
135 cache->func.dealloc(eim);
136 }
137 else
138 {
139 memset(eim, 0, sizeof (Engine_Image_Entry));
140 free(eim);
141 }
142}
143
144EAPI int
145evas_cache_engine_image_usage_get(Evas_Cache_Engine_Image *cache)
146{
147 assert(cache != NULL);
148
149 return cache->usage;
150}
151
152EAPI int
153evas_cache_engine_image_get(Evas_Cache_Engine_Image *cache)
154{
155 assert(cache != NULL);
156
157 return cache->limit;
158}
159
160EAPI void
161evas_cache_engine_image_set(Evas_Cache_Engine_Image *cache, int limit)
162{
163 assert(cache != NULL);
164
165 cache->limit = limit;
166}
167
168EAPI Evas_Cache_Engine_Image *
169evas_cache_engine_image_init(const Evas_Cache_Engine_Image_Func *cb, Evas_Cache_Image *parent)
170{
171 Evas_Cache_Engine_Image *new;
172
173 new = malloc(sizeof (Evas_Cache_Engine_Image));
174 if (!new)
175 return NULL;
176
177 new->func = *cb;
178
179 new->limit = 0;
180 new->usage = 0;
181
182 new->dirty = NULL;
183 new->lru = NULL;
184 new->activ = eina_hash_string_superfast_new(NULL);
185 new->inactiv = eina_hash_string_superfast_new(NULL);
186
187 new->parent = parent;
188 parent->references++;
189
190 new->brother = NULL;
191
192 return new;
193}
194
195EAPI Evas_Cache_Engine_Image *
196evas_cache_engine_image_dup(const Evas_Cache_Engine_Image_Func *cb, Evas_Cache_Engine_Image *brother)
197{
198 Evas_Cache_Engine_Image *new;
199
200 new = calloc(1, sizeof (Evas_Cache_Engine_Image));
201 if (!new)
202 return NULL;
203
204 new->func = brother->func;
205
206#define ORD(Func) if (cb->Func) new->func.Func = cb->Func;
207
208 ORD(key);
209 ORD(constructor);
210 ORD(destructor);
211 ORD(dirty_region);
212 ORD(dirty);
213 ORD(size_set);
214 ORD(update_data);
215 ORD(load);
216 ORD(mem_size_get);
217 ORD(debug);
218
219#undef ORD
220
221 new->limit = -1;
222 new->usage = 0;
223 new->references = 1;
224
225 new->dirty = NULL;
226 new->activ = NULL;
227
228 new->parent = brother->parent;
229 new->parent->references++;
230
231 new->brother = brother;
232 brother->references++;
233
234 return new;
235}
236
237static Eina_Bool
238_evas_cache_engine_image_free_cb(__UNUSED__ const Eina_Hash *hash, __UNUSED__ const void *key, void *data, void *fdata)
239{
240 Eina_List **delete_list = fdata;
241
242 *delete_list = eina_list_prepend(*delete_list, data);
243
244 return EINA_TRUE;
245}
246
247EAPI void
248evas_cache_engine_image_flush(Evas_Cache_Engine_Image *cache)
249{
250 assert(cache != NULL);
251
252 while ((cache->lru) && (cache->limit < cache->usage))
253 {
254 Engine_Image_Entry *eim;
255
256 eim = (Engine_Image_Entry *) cache->lru->last;
257 _evas_cache_engine_image_dealloc(cache, eim);
258 }
259}
260
261EAPI void
262evas_cache_engine_image_shutdown(Evas_Cache_Engine_Image *cache)
263{
264 Engine_Image_Entry *eim;
265 Eina_List *delete_list = NULL;
266
267 assert(cache != NULL);
268
269 if (cache->func.debug) cache->func.debug("shutdown-engine", NULL);
270
271 eina_hash_foreach(cache->inactiv, _evas_cache_engine_image_free_cb, &delete_list);
272 eina_hash_foreach(cache->activ, _evas_cache_engine_image_free_cb, &delete_list);
273
274 while (delete_list)
275 {
276 _evas_cache_engine_image_dealloc(cache, eina_list_data_get(delete_list));
277 delete_list = eina_list_remove_list(delete_list, delete_list);
278 }
279
280 eina_hash_free(cache->inactiv);
281 eina_hash_free(cache->activ);
282
283 /* This is mad, I am about to destroy image still alive, but we need to prevent leak. */
284 while (cache->dirty)
285 {
286 eim = (Engine_Image_Entry *) cache->dirty;
287 _evas_cache_engine_image_dealloc(cache, eim);
288 }
289
290
291 evas_cache_image_shutdown(cache->parent);
292 if (cache->brother)
293 evas_cache_engine_image_shutdown(cache->brother);
294 free(cache);
295}
296
297EAPI Engine_Image_Entry *
298evas_cache_engine_image_request(Evas_Cache_Engine_Image *cache,
299 const char *file, const char *key,
300 RGBA_Image_Loadopts *lo, void *data, int *error)
301{
302 Engine_Image_Entry *eim;
303 Image_Entry *im;
304 const char *ekey;
305
306 assert(cache != NULL);
307
308 *error = EVAS_LOAD_ERROR_NONE;
309
310 ekey = NULL;
311 eim = NULL;
312
313 im = evas_cache_image_request(cache->parent, file, key, lo, error);
314 if (!im)
315 goto on_error;
316
317 if (cache->func.key)
318 ekey = cache->func.key(im, file, key, lo, data);
319 else
320 ekey = eina_stringshare_add(im->cache_key);
321 if (!ekey)
322 {
323 *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
324 goto on_error;
325 }
326
327 eim = eina_hash_find(cache->activ, ekey);
328 if (eim)
329 {
330 evas_cache_image_drop(im);
331 goto on_ok;
332 }
333
334 eim = eina_hash_find(cache->inactiv, ekey);
335 if (eim)
336 {
337 _evas_cache_engine_image_remove_activ(cache, eim);
338 _evas_cache_engine_image_make_active(cache, eim, ekey);
339 evas_cache_image_drop(im);
340 goto on_ok;
341 }
342
343 eim = _evas_cache_engine_image_alloc(cache, im, ekey);
344 if (!eim)
345 {
346 *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
347 return NULL;
348 }
349
350 *error = cache->func.constructor(eim, data);
351 if (*error != EVAS_LOAD_ERROR_NONE) goto on_error;
352 if (cache->func.debug)
353 cache->func.debug("constructor-engine", eim);
354
355 on_ok:
356 eim->references++;
357 return eim;
358
359 on_error:
360 if (!eim)
361 {
362 if (im) evas_cache_image_drop(im);
363 if (ekey) eina_stringshare_del(ekey);
364 }
365 else
366 {
367 _evas_cache_engine_image_dealloc(cache, eim);
368 }
369
370 return NULL;
371}
372
373EAPI void
374evas_cache_engine_image_drop(Engine_Image_Entry *eim)
375{
376 Evas_Cache_Engine_Image *cache;
377
378 assert(eim);
379 assert(eim->cache);
380
381 eim->references--;
382 cache = eim->cache;
383
384 if (eim->flags.dirty)
385 {
386 _evas_cache_engine_image_dealloc(cache, eim);
387 return ;
388 }
389
390 if (eim->references == 0)
391 {
392 _evas_cache_engine_image_remove_activ(cache, eim);
393 _evas_cache_engine_image_make_inactive(cache, eim, eim->cache_key);
394 evas_cache_engine_image_flush(cache);
395 return ;
396 }
397}
398
399EAPI Engine_Image_Entry *
400evas_cache_engine_image_dirty(Engine_Image_Entry *eim, unsigned int x, unsigned int y, unsigned int w, unsigned int h)
401{
402 Engine_Image_Entry *eim_dirty = eim;
403 Image_Entry *im_dirty = NULL;
404 Image_Entry *im;
405 Evas_Cache_Engine_Image *cache;
406 unsigned char alloc_eim;
407
408 assert(eim);
409 assert(eim->cache);
410
411 cache = eim->cache;
412 if (!(eim->flags.dirty))
413 {
414 alloc_eim = 0;
415
416 if (eim->flags.need_parent == 1)
417 {
418 im = eim->src;
419 im_dirty = evas_cache_image_dirty(im, x, y, w, h);
420
421 /* If im == im_dirty, this meens that we have only one reference to the eim. */
422 if (im != im_dirty)
423 {
424 if (eim->references == 1)
425 {
426 _evas_cache_engine_image_remove_activ(cache, eim);
427 _evas_cache_engine_image_make_dirty(cache, eim);
428
429 eim->src = im_dirty;
430 }
431 else
432 alloc_eim = 1;
433 }
434 }
435 else
436 if (eim->references > 1)
437 {
438 alloc_eim = 1;
439 }
440 else
441 {
442 _evas_cache_engine_image_remove_activ(cache, eim_dirty);
443 _evas_cache_engine_image_make_dirty(cache, eim_dirty);
444 }
445
446 if (alloc_eim == 1)
447 {
448 int error;
449
450 eim_dirty = _evas_cache_engine_image_alloc(cache, im_dirty, NULL);
451 if (!eim_dirty) goto on_error;
452
453 eim_dirty->w = eim->w;
454 eim_dirty->h = eim->h;
455 eim_dirty->references = 1;
456
457 error = cache->func.dirty(eim_dirty, eim);
458 if (cache->func.debug)
459 cache->func.debug("dirty-engine", eim_dirty);
460
461 if (error != 0) goto on_error;
462
463 evas_cache_engine_image_drop(eim);
464 }
465 }
466
467 if (cache->func.dirty_region)
468 cache->func.dirty_region(eim_dirty, x, y, w, h);
469 if (cache->func.debug)
470 cache->func.debug("dirty-region-engine", eim_dirty);
471
472 return eim_dirty;
473
474 on_error:
475 if (eim) evas_cache_engine_image_drop(eim);
476 if (eim_dirty && eim_dirty != eim)
477 evas_cache_engine_image_drop(eim_dirty);
478 else
479 if (im_dirty) evas_cache_image_drop(im_dirty);
480
481 return NULL;
482}
483
484EAPI Engine_Image_Entry *
485evas_cache_engine_image_alone(Engine_Image_Entry *eim, void *data)
486{
487 Evas_Cache_Engine_Image *cache;
488 Image_Entry *im;
489
490
491 assert(eim);
492 assert(eim->cache);
493
494 cache = eim->cache;
495 im = evas_cache_image_alone(eim->src);
496 if (im != eim->src)
497 {
498 eim = _evas_cache_engine_image_alloc(cache, im, NULL);
499 if (!eim) goto on_error;
500
501 eim->references = 1;
502
503 if (cache->func.constructor(eim, data) != EVAS_LOAD_ERROR_NONE)
504 goto on_error;
505 }
506 /* FIXME */
507 return eim;
508
509 on_error:
510 evas_cache_image_drop(im);
511 return NULL;
512}
513
514static Engine_Image_Entry *
515_evas_cache_engine_image_push_dirty(Evas_Cache_Engine_Image *cache, Image_Entry *im, void *engine_data)
516{
517 Engine_Image_Entry *eim;
518 int error;
519
520 eim = _evas_cache_engine_image_alloc(cache, im, NULL);
521 if (!eim) goto on_error;
522 eim->references = 1;
523
524 error = cache->func.update_data(eim, engine_data);
525 if (cache->func.debug)
526 cache->func.debug("dirty-update_data-engine", eim);
527 if (error != 0) goto on_error;
528
529 return eim;
530
531 on_error:
532 if (eim)
533 evas_cache_engine_image_drop(eim);
534 return NULL;
535}
536
537EAPI Engine_Image_Entry *
538evas_cache_engine_image_copied_data(Evas_Cache_Engine_Image *cache, unsigned int w, unsigned int h, DATA32 *image_data, int alpha, int cspace, void *engine_data)
539{
540 Image_Entry *im;
541
542 assert(cache);
543
544 im = evas_cache_image_copied_data(cache->parent, w, h, image_data, alpha, cspace);
545
546 return _evas_cache_engine_image_push_dirty(cache, im, engine_data);
547}
548
549EAPI Engine_Image_Entry *
550evas_cache_engine_image_data(Evas_Cache_Engine_Image *cache, unsigned int w, unsigned int h, DATA32 *image_data, int alpha, int cspace, void *engine_data)
551{
552 Image_Entry *im;
553
554 assert(cache);
555
556 im = evas_cache_image_data(cache->parent, w, h, image_data, alpha, cspace);
557
558 return _evas_cache_engine_image_push_dirty(cache, im, engine_data);
559}
560
561EAPI Engine_Image_Entry *
562evas_cache_engine_image_size_set(Engine_Image_Entry *eim, unsigned int w, unsigned int h)
563{
564 Evas_Cache_Engine_Image *cache;
565 Engine_Image_Entry *new;
566 Image_Entry *im;
567 const char *hkey;
568 int error;
569
570 assert(eim);
571 assert(eim->cache);
572 assert(eim->references > 0);
573
574 im = NULL;
575 cache = eim->cache;
576
577 if (eim->flags.need_parent == 1)
578 {
579 assert(eim->src);
580
581 if (eim->src->w == w
582 && eim->src->h == h)
583 return eim;
584
585 im = evas_cache_image_size_set(eim->src, w, h);
586 /* FIXME: Good idea to call update_data ? */
587 if (im == eim->src) return eim;
588 eim->src = NULL;
589 }
590
591 hkey = (eim->references > 1 ) ? eina_stringshare_add(eim->cache_key) : NULL;
592
593 new = _evas_cache_engine_image_alloc(cache, im, hkey);
594 if (!new) goto on_error;
595
596 new->w = w;
597 new->h = h;
598 new->references = 1;
599
600 error = cache->func.size_set(new, eim);
601 if (error) goto on_error;
602
603 evas_cache_engine_image_drop(eim);
604 return new;
605
606 on_error:
607 if (new)
608 evas_cache_engine_image_drop(new);
609 else
610 if (im)
611 evas_cache_image_drop(im);
612 evas_cache_engine_image_drop(eim);
613
614 return NULL;
615}
616
617EAPI void
618evas_cache_engine_image_load_data(Engine_Image_Entry *eim)
619{
620 Evas_Cache_Engine_Image *cache;
621 int size = 0;
622
623 assert(eim);
624 assert(eim->src);
625 assert(eim->cache);
626
627 if (eim->flags.loaded) return;
628
629 if (eim->src)
630 evas_cache_image_load_data(eim->src);
631
632 cache = eim->cache;
633 if (cache->func.debug)
634 cache->func.debug("load-engine", eim);
635
636 if (eim->flags.dirty)
637 size = cache->func.mem_size_get(eim);
638 cache = eim->cache;
639 cache->func.load(eim, eim->src);
640 if (eim->flags.dirty)
641 cache->usage += cache->func.mem_size_get(eim) - size;
642
643 eim->flags.loaded = 1;
644}
645
646EAPI Engine_Image_Entry *
647evas_cache_engine_image_engine(Evas_Cache_Engine_Image *cache, void *engine_data)
648{
649 Engine_Image_Entry *eim;
650 Image_Entry *ie;
651 int error;
652
653 ie = evas_cache_image_empty(cache->parent);
654 if (!ie) return NULL;
655
656 eim = _evas_cache_engine_image_alloc(cache, ie, NULL);
657 if (!eim) goto on_error;
658 eim->references = 1;
659
660 error = cache->func.update_data(eim, engine_data);
661 if (cache->func.debug)
662 cache->func.debug("update_data-engine", eim);
663
664 if (error != 0) goto on_error;
665
666 return eim;
667
668 on_error:
669 if (!eim)
670 evas_cache_image_drop(ie);
671 else
672 evas_cache_engine_image_drop(eim);
673
674 return NULL;
675}
676
677EAPI void
678evas_cache_engine_image_colorspace(Engine_Image_Entry *eim, int cspace, void *engine_data)
679{
680 Evas_Cache_Engine_Image *cache = eim->cache;
681
682 assert(cache);
683
684 cache->func.destructor(eim);
685 evas_cache_image_colorspace(eim->src, cspace);
686 cache->func.constructor(eim, engine_data);
687 if (cache->func.debug)
688 cache->func.debug("cosntructor-colorspace-engine", eim);
689}
690
691EAPI void
692evas_cache_engine_parent_not_needed(Engine_Image_Entry *eim)
693{
694 assert(eim);
695 assert(eim->cache);
696
697 eim->flags.need_parent = 0;
698 evas_cache_image_data_not_needed(eim->src);
699}
diff --git a/libraries/evas/src/lib/cache/evas_cache_image.c b/libraries/evas/src/lib/cache/evas_cache_image.c
new file mode 100644
index 0000000..d52c64e
--- /dev/null
+++ b/libraries/evas/src/lib/cache/evas_cache_image.c
@@ -0,0 +1,1433 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#include <stdlib.h>
6#include <assert.h>
7#include <sys/types.h>
8#include <sys/stat.h>
9#include <errno.h>
10
11#ifdef HAVE_EVIL
12# include <Evil.h>
13#endif
14
15#include "evas_common.h"
16#include "evas_private.h"
17
18//#define CACHEDUMP 1
19
20#ifdef EVAS_CSERVE
21// FIXME: cache server and threaded preload clash badly atm - disable
22//#undef BUILD_ASYNC_PRELOAD
23#endif
24
25#ifdef BUILD_ASYNC_PRELOAD
26typedef struct _Evas_Cache_Preload Evas_Cache_Preload;
27
28struct _Evas_Cache_Preload
29{
30 EINA_INLIST;
31 Image_Entry *ie;
32};
33
34static LK(engine_lock);
35static LK(wakeup);
36static int _evas_cache_mutex_init = 0;
37
38static Eina_Condition cond_wakeup;
39
40static void _evas_cache_image_entry_preload_remove(Image_Entry *ie, const void *target);
41#endif
42
43#define FREESTRC(Var) \
44 if (Var) \
45 { \
46 eina_stringshare_del(Var); \
47 Var = NULL; \
48 }
49
50static void _evas_cache_image_dirty_add(Image_Entry *im);
51static void _evas_cache_image_dirty_del(Image_Entry *im);
52static void _evas_cache_image_activ_add(Image_Entry *im);
53static void _evas_cache_image_activ_del(Image_Entry *im);
54static void _evas_cache_image_lru_add(Image_Entry *im);
55static void _evas_cache_image_lru_del(Image_Entry *im);
56static void _evas_cache_image_lru_nodata_add(Image_Entry *im);
57static void _evas_cache_image_lru_nodata_del(Image_Entry *im);
58
59static void
60_evas_cache_image_dirty_add(Image_Entry *im)
61{
62 if (im->flags.dirty) return;
63 _evas_cache_image_activ_del(im);
64 _evas_cache_image_lru_del(im);
65 _evas_cache_image_lru_nodata_del(im);
66 im->flags.dirty = 1;
67 im->flags.cached = 1;
68#ifdef EVAS_FRAME_QUEUING
69 LKL(im->cache->lock);
70#endif
71 im->cache->dirty = eina_inlist_prepend(im->cache->dirty, EINA_INLIST_GET(im));
72#ifdef EVAS_FRAME_QUEUING
73 LKU(im->cache->lock);
74#endif
75 if (im->cache_key)
76 {
77 eina_stringshare_del(im->cache_key);
78 im->cache_key = NULL;
79 }
80}
81
82static void
83_evas_cache_image_dirty_del(Image_Entry *im)
84{
85 if (!im->flags.dirty) return;
86 im->flags.dirty = 0;
87 im->flags.cached = 0;
88#ifdef EVAS_FRAME_QUEUING
89 LKL(im->cache->lock);
90#endif
91 im->cache->dirty = eina_inlist_remove(im->cache->dirty, EINA_INLIST_GET(im));
92#ifdef EVAS_FRAME_QUEUING
93 LKU(im->cache->lock);
94#endif
95}
96
97static void
98_evas_cache_image_activ_add(Image_Entry *im)
99{
100 if (im->flags.activ) return;
101 _evas_cache_image_dirty_del(im);
102 _evas_cache_image_lru_del(im);
103 _evas_cache_image_lru_nodata_del(im);
104 if (!im->cache_key) return;
105 im->flags.activ = 1;
106 im->flags.cached = 1;
107#ifdef EVAS_FRAME_QUEUING
108 LKL(im->cache->lock);
109#endif
110 eina_hash_direct_add(im->cache->activ, im->cache_key, im);
111#ifdef EVAS_FRAME_QUEUING
112 LKU(im->cache->lock);
113#endif
114}
115
116static void
117_evas_cache_image_activ_del(Image_Entry *im)
118{
119 if (!im->flags.activ) return;
120 if (!im->cache_key) return;
121 im->flags.activ = 0;
122 im->flags.cached = 0;
123#ifdef EVAS_FRAME_QUEUING
124 LKL(im->cache->lock);
125#endif
126 eina_hash_del(im->cache->activ, im->cache_key, im);
127#ifdef EVAS_FRAME_QUEUING
128 LKU(im->cache->lock);
129#endif
130}
131
132static void
133_evas_cache_image_lru_add(Image_Entry *im)
134{
135 if (im->flags.lru) return;
136 _evas_cache_image_dirty_del(im);
137 _evas_cache_image_activ_del(im);
138 _evas_cache_image_lru_nodata_del(im);
139 if (!im->cache_key) return;
140 im->flags.lru = 1;
141 im->flags.cached = 1;
142#ifdef EVAS_FRAME_QUEUING
143 LKL(im->cache->lock);
144#endif
145 eina_hash_direct_add(im->cache->inactiv, im->cache_key, im);
146 im->cache->lru = eina_inlist_prepend(im->cache->lru, EINA_INLIST_GET(im));
147 im->cache->usage += im->cache->func.mem_size_get(im);
148#ifdef EVAS_FRAME_QUEUING
149 LKU(im->cache->lock);
150#endif
151}
152
153static void
154_evas_cache_image_lru_del(Image_Entry *im)
155{
156 if (!im->flags.lru) return;
157 if (!im->cache_key) return;
158 im->flags.lru = 0;
159 im->flags.cached = 0;
160#ifdef EVAS_FRAME_QUEUING
161 LKL(im->cache->lock);
162#endif
163 eina_hash_del(im->cache->inactiv, im->cache_key, im);
164 im->cache->lru = eina_inlist_remove(im->cache->lru, EINA_INLIST_GET(im));
165 im->cache->usage -= im->cache->func.mem_size_get(im);
166#ifdef EVAS_FRAME_QUEUING
167 LKU(im->cache->lock);
168#endif
169}
170
171static void
172_evas_cache_image_lru_nodata_add(Image_Entry *im)
173{
174 if (im->flags.lru_nodata) return;
175 _evas_cache_image_dirty_del(im);
176 _evas_cache_image_activ_del(im);
177 _evas_cache_image_lru_del(im);
178 im->flags.lru = 1;
179 im->flags.cached = 1;
180#ifdef EVAS_FRAME_QUEUING
181 LKL(im->cache->lock);
182#endif
183 im->cache->lru_nodata = eina_inlist_prepend(im->cache->lru_nodata, EINA_INLIST_GET(im));
184#ifdef EVAS_FRAME_QUEUING
185 LKU(im->cache->lock);
186#endif
187}
188
189static void
190_evas_cache_image_lru_nodata_del(Image_Entry *im)
191{
192 if (!im->flags.lru_nodata) return;
193 im->flags.lru = 0;
194 im->flags.cached = 0;
195#ifdef EVAS_FRAME_QUEUING
196 LKL(im->cache->lock);
197#endif
198 im->cache->lru_nodata = eina_inlist_remove(im->cache->lru_nodata, EINA_INLIST_GET(im));
199#ifdef EVAS_FRAME_QUEUING
200 LKU(im->cache->lock);
201#endif
202}
203
204static void
205_evas_cache_image_entry_delete(Evas_Cache_Image *cache, Image_Entry *ie)
206{
207 if (!ie) return;
208 if (cache->func.debug) cache->func.debug("deleting", ie);
209#ifdef BUILD_ASYNC_PRELOAD
210 if (ie->flags.delete_me == 1) return;
211 if (ie->preload)
212 {
213 ie->flags.delete_me = 1;
214 _evas_cache_image_entry_preload_remove(ie, NULL);
215 return;
216 }
217#endif
218
219 _evas_cache_image_dirty_del(ie);
220 _evas_cache_image_activ_del(ie);
221 _evas_cache_image_lru_del(ie);
222 _evas_cache_image_lru_nodata_del(ie);
223
224 cache->func.destructor(ie);
225 FREESTRC(ie->cache_key);
226 FREESTRC(ie->file);
227 FREESTRC(ie->key);
228 ie->cache = NULL;
229 cache->func.surface_delete(ie);
230
231#ifdef BUILD_ASYNC_PRELOAD
232 LKD(ie->lock);
233 LKD(ie->lock_cancel);
234#endif
235#ifdef EVAS_FRAME_QUEUING
236 LKD(ie->lock_references);
237#endif
238 cache->func.dealloc(ie);
239}
240
241static Eina_Bool
242_timestamp_compare(Image_Timestamp *tstamp, struct stat *st)
243{
244 if (tstamp->mtime != st->st_mtime) return EINA_FALSE;
245 if (tstamp->size != st->st_size) return EINA_FALSE;
246 if (tstamp->ino != st->st_ino) return EINA_FALSE;
247#ifdef _STAT_VER_LINUX
248#if (defined __USE_MISC && defined st_mtime)
249 if (tstamp->mtime_nsec != (unsigned long int)st->st_mtim.tv_nsec)
250 return EINA_FALSE;
251#else
252 if (tstamp->mtime_nsec != (unsigned long int)st->st_mtimensec)
253 return EINA_FALSE;
254#endif
255#endif
256 return EINA_TRUE;
257}
258
259static void
260_timestamp_build(Image_Timestamp *tstamp, struct stat *st)
261{
262 tstamp->mtime = st->st_mtime;
263 tstamp->size = st->st_size;
264 tstamp->ino = st->st_ino;
265#ifdef _STAT_VER_LINUX
266#if (defined __USE_MISC && defined st_mtime)
267 tstamp->mtime_nsec = (unsigned long int)st->st_mtim.tv_nsec;
268#else
269 tstamp->mtime_nsec = (unsigned long int)st->st_mtimensec;
270#endif
271#endif
272}
273
274static Image_Entry *
275_evas_cache_image_entry_new(Evas_Cache_Image *cache,
276 const char *hkey,
277 Image_Timestamp *tstamp,
278 const char *file,
279 const char *key,
280 RGBA_Image_Loadopts *lo,
281 int *error)
282{
283 Image_Entry *ie;
284
285 ie = cache->func.alloc();
286 if (!ie)
287 {
288 *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
289 return NULL;
290 }
291 ie->cache = cache;
292 if (hkey) ie->cache_key = eina_stringshare_add(hkey);
293 ie->flags.need_data = 1;
294 ie->space = EVAS_COLORSPACE_ARGB8888;
295 ie->w = -1;
296 ie->h = -1;
297 ie->scale = 1;
298 if (file) ie->file = eina_stringshare_add(file);
299 if (key) ie->key = eina_stringshare_add(key);
300 if (tstamp) ie->tstamp = *tstamp;
301 else memset(&ie->tstamp, 0, sizeof(Image_Timestamp));
302
303#ifdef EVAS_FRAME_QUEUING
304 LKI(ie->lock_references);
305#endif
306#ifdef BUILD_ASYNC_PRELOAD
307 LKI(ie->lock);
308 LKI(ie->lock_cancel);
309#endif
310
311 if (lo) ie->load_opts = *lo;
312 if (ie->file)
313 {
314 *error = cache->func.constructor(ie);
315 if (*error != EVAS_LOAD_ERROR_NONE)
316 {
317 _evas_cache_image_entry_delete(cache, ie);
318 return NULL;
319 }
320 }
321 if (cache->func.debug) cache->func.debug("build", ie);
322 if (ie->cache_key) _evas_cache_image_activ_add(ie);
323 else _evas_cache_image_dirty_add(ie);
324 return ie;
325}
326
327static void
328_evas_cache_image_entry_surface_alloc__locked(Evas_Cache_Image *cache,
329 Image_Entry *ie,
330 unsigned int wmin,
331 unsigned int hmin)
332{
333 if ((ie->allocated.w == wmin) && (ie->allocated.h == hmin)) return;
334 if (cache->func.surface_alloc(ie, wmin, hmin))
335 {
336 wmin = 0;
337 hmin = 0;
338 }
339 ie->w = wmin;
340 ie->h = hmin;
341 ie->allocated.w = wmin;
342 ie->allocated.h = hmin;
343}
344
345static void
346_evas_cache_image_entry_surface_alloc(Evas_Cache_Image *cache,
347 Image_Entry *ie, int w, int h)
348{
349 int wmin = w > 0 ? w : 1;
350 int hmin = h > 0 ? h : 1;
351#ifdef BUILD_ASYNC_PRELOAD
352 LKL(engine_lock);
353#endif
354 _evas_cache_image_entry_surface_alloc__locked(cache, ie, wmin, hmin);
355#ifdef BUILD_ASYNC_PRELOAD
356 LKU(engine_lock);
357#endif
358}
359
360#ifdef BUILD_ASYNC_PRELOAD
361static void
362_evas_cache_image_async_heavy(void *data)
363{
364 Evas_Cache_Image *cache;
365 Image_Entry *current;
366 int error;
367 int pchannel;
368
369 current = data;
370
371 LKL(current->lock);
372 pchannel = current->channel;
373 current->channel++;
374 cache = current->cache;
375
376 if ((!current->flags.loaded) &&
377 ((Evas_Image_Load_Func*) current->info.module)->threadable)
378 {
379 error = cache->func.load(current);
380 if (cache->func.debug) cache->func.debug("load", current);
381 current->load_error = error;
382 if (error != EVAS_LOAD_ERROR_NONE)
383 {
384 current->flags.loaded = 0;
385 _evas_cache_image_entry_surface_alloc(cache, current,
386 current->w, current->h);
387 }
388 else
389 {
390 current->flags.loaded = 1;
391 }
392 }
393 current->channel = pchannel;
394 // check the unload cancel flag
395 LKL(current->lock_cancel);
396 if (current->unload_cancel)
397 {
398 current->unload_cancel = EINA_FALSE;
399 cache->func.surface_delete(current);
400 current->flags.loaded = 0;
401 current->flags.preload_done = 0;
402 }
403 LKU(current->lock_cancel);
404 LKU(current->lock);
405}
406
407static void
408_evas_cache_image_async_end(void *data)
409{
410 Image_Entry *ie = (Image_Entry *)data;
411 Evas_Cache_Target *tmp;
412
413 ie->cache->preload = eina_list_remove(ie->cache->preload, ie);
414 ie->cache->pending = eina_list_remove(ie->cache->pending, ie);
415 ie->preload = NULL;
416 ie->flags.preload_done = ie->flags.loaded;
417 while ((tmp = ie->targets))
418 {
419 evas_object_inform_call_image_preloaded((Evas_Object*) tmp->target);
420 ie->targets = (Evas_Cache_Target *)
421 eina_inlist_remove(EINA_INLIST_GET(ie->targets),
422 EINA_INLIST_GET(ie->targets));
423 free(tmp);
424 }
425}
426
427static void
428_evas_cache_image_async_cancel(void *data)
429{
430 Evas_Cache_Image *cache = NULL;
431 Image_Entry *ie = (Image_Entry *)data;
432
433 ie->preload = NULL;
434 ie->cache->pending = eina_list_remove(ie->cache->pending, ie);
435 if ((ie->flags.delete_me) || (ie->flags.dirty))
436 {
437 ie->flags.delete_me = 0;
438 _evas_cache_image_entry_delete(ie->cache, ie);
439 return;
440 }
441 if (ie->flags.loaded) _evas_cache_image_async_end(ie);
442#ifdef EVAS_FRAME_QUEUING
443 LKL(ie->lock_references);
444#endif
445 if (ie->references == 0)
446 {
447 _evas_cache_image_lru_add(ie);
448 cache = ie->cache;
449 }
450#ifdef EVAS_FRAME_QUEUING
451 LKU(ie->lock_references);
452#endif
453 if (cache) evas_cache_image_flush(cache);
454}
455
456// note - preload_add assumes a target is ONLY added ONCE to the image
457// entry. make sure you only add once, or remove first, then add
458static int
459_evas_cache_image_entry_preload_add(Image_Entry *ie, const void *target)
460{
461 Evas_Cache_Target *tg;
462
463 if (ie->flags.preload_done) return 0;
464
465 tg = malloc(sizeof (Evas_Cache_Target));
466 if (!tg) return 0;
467
468 tg->target = target;
469 ie->targets = (Evas_Cache_Target *)
470 eina_inlist_append(EINA_INLIST_GET(ie->targets), EINA_INLIST_GET(tg));
471 if (!ie->preload)
472 {
473 ie->cache->preload = eina_list_append(ie->cache->preload, ie);
474 ie->flags.pending = 0;
475 ie->preload = evas_preload_thread_run(_evas_cache_image_async_heavy,
476 _evas_cache_image_async_end,
477 _evas_cache_image_async_cancel,
478 ie);
479 }
480 return 1;
481}
482
483static void
484_evas_cache_image_entry_preload_remove(Image_Entry *ie, const void *target)
485{
486 if (target)
487 {
488 Evas_Cache_Target *tg;
489
490 EINA_INLIST_FOREACH(ie->targets, tg)
491 {
492 if (tg->target == target)
493 {
494 // FIXME: No callback when we cancel only for one target ?
495 ie->targets = (Evas_Cache_Target *)
496 eina_inlist_remove(EINA_INLIST_GET(ie->targets),
497 EINA_INLIST_GET(tg));
498 free(tg);
499 break;
500 }
501 }
502 }
503 else
504 {
505 Evas_Cache_Target *tg;
506
507 while (ie->targets)
508 {
509 tg = ie->targets;
510 ie->targets = (Evas_Cache_Target *)
511 eina_inlist_remove(EINA_INLIST_GET(ie->targets),
512 EINA_INLIST_GET(tg));
513 free(tg);
514 }
515 }
516
517 if ((!ie->targets) && (ie->preload) && (!ie->flags.pending))
518 {
519 ie->cache->preload = eina_list_remove(ie->cache->preload, ie);
520 ie->cache->pending = eina_list_append(ie->cache->pending, ie);
521 ie->flags.pending = 1;
522 evas_preload_thread_cancel(ie->preload);
523 }
524}
525#endif
526
527EAPI int
528evas_cache_image_usage_get(Evas_Cache_Image *cache)
529{
530 return cache->usage;
531}
532
533EAPI int
534evas_cache_image_get(Evas_Cache_Image *cache)
535{
536 return cache->limit;
537}
538
539EAPI void
540evas_cache_image_set(Evas_Cache_Image *cache, unsigned int limit)
541{
542#ifdef EVAS_FRAME_QUEUING
543 LKL(cache->lock);
544#endif
545 if (cache->limit == limit)
546 {
547#ifdef EVAS_FRAME_QUEUING
548 LKU(cache->lock);
549#endif
550 return;
551 }
552 cache->limit = limit;
553#ifdef EVAS_FRAME_QUEUING
554 LKU(cache->lock);
555#endif
556 evas_cache_image_flush(cache);
557}
558
559EAPI Evas_Cache_Image *
560evas_cache_image_init(const Evas_Cache_Image_Func *cb)
561{
562 Evas_Cache_Image *cache;
563
564#ifdef BUILD_ASYNC_PRELOAD
565 if (_evas_cache_mutex_init++ == 0)
566 {
567 LKI(engine_lock);
568 LKI(wakeup);
569 eina_condition_new(&cond_wakeup, &wakeup);
570 }
571#endif
572
573 cache = calloc(1, sizeof(Evas_Cache_Image));
574 if (!cache) return NULL;
575 cache->func = *cb;
576 cache->inactiv = eina_hash_string_superfast_new(NULL);
577 cache->activ = eina_hash_string_superfast_new(NULL);
578 cache->references = 1;
579#ifdef EVAS_FRAME_QUEUING
580 LKI(cache->lock);
581#endif
582 return cache;
583}
584
585static Eina_Bool
586_evas_cache_image_free_cb(__UNUSED__ const Eina_Hash *hash, __UNUSED__ const void *key, void *data, void *fdata)
587{
588 Eina_List **delete_list = fdata;
589 *delete_list = eina_list_prepend(*delete_list, data);
590 return EINA_TRUE;
591}
592
593EAPI void
594evas_cache_image_shutdown(Evas_Cache_Image *cache)
595{
596 Eina_List *delete_list;
597 Image_Entry *im;
598
599#ifdef EVAS_FRAME_QUEUING
600 LKL(cache->lock);
601#endif
602 cache->references--;
603 if (cache->references != 0)
604 {
605#ifdef EVAS_FRAME_QUEUING
606 LKU(cache->lock);
607#endif
608 return;
609 }
610#ifdef EVAS_FRAME_QUEUING
611 /* Release and destroy lock early ! */
612 LKU(cache->lock);
613 LKD(cache->lock);
614#endif
615
616#ifdef BUILD_ASYNC_PRELOAD
617 EINA_LIST_FREE(cache->preload, im)
618 {
619 /* By doing that we are protecting us from destroying image when the cache is no longer available. */
620 im->flags.delete_me = 1;
621 _evas_cache_image_entry_preload_remove(im, NULL);
622 }
623 evas_async_events_process();
624#endif
625 while (cache->lru)
626 {
627 im = (Image_Entry *)cache->lru;
628 _evas_cache_image_entry_delete(cache, im);
629 }
630 while (cache->lru_nodata)
631 {
632 im = (Image_Entry *)cache->lru_nodata;
633 _evas_cache_image_entry_delete(cache, im);
634 }
635 /* This is mad, I am about to destroy image still alive, but we need to prevent leak. */
636 while (cache->dirty)
637 {
638 im = (Image_Entry *)cache->dirty;
639 _evas_cache_image_entry_delete(cache, im);
640 }
641 delete_list = NULL;
642 eina_hash_foreach(cache->activ, _evas_cache_image_free_cb, &delete_list);
643 while (delete_list)
644 {
645 _evas_cache_image_entry_delete(cache, eina_list_data_get(delete_list));
646 delete_list = eina_list_remove_list(delete_list, delete_list);
647 }
648
649#ifdef BUILD_ASYNC_PRELOAD
650 /* Now wait for all pending image to die */
651 while (cache->pending)
652 {
653 evas_async_events_process();
654 LKL(wakeup);
655 // the lazy bum who did eain threads and converted this code
656 // didn't bother to worry about Eina_Lock being a different type
657 // to a pthread mutex.
658 if (cache->pending) eina_condition_wait(&cond_wakeup);
659 LKU(wakeup);
660 }
661#endif
662 eina_hash_free(cache->activ);
663 eina_hash_free(cache->inactiv);
664 free(cache);
665
666#ifdef BUILD_ASYNC_PRELOAD
667 if (--_evas_cache_mutex_init == 0)
668 {
669 eina_condition_free(&cond_wakeup);
670 LKD(engine_lock);
671 LKD(wakeup);
672 }
673#endif
674}
675
676EAPI Image_Entry *
677evas_cache_image_request(Evas_Cache_Image *cache, const char *file,
678 const char *key, RGBA_Image_Loadopts *lo, int *error)
679{
680 const char *ckey = "(null)";
681 char *hkey;
682 Image_Entry *im;
683 Evas_Image_Load_Opts prevent = { 0, 0.0, 0, 0, 0, { 0, 0, 0, 0 }, EINA_FALSE };
684 size_t size;
685 int stat_done = 0, stat_failed = 0;
686 size_t file_length;
687 size_t key_length;
688 struct stat st;
689 Image_Timestamp tstamp;
690
691 if ((!file) || ((!file) && (!key)))
692 {
693 *error = EVAS_LOAD_ERROR_GENERIC;
694 return NULL;
695 }
696
697 /* generate hkey from file+key+load opts */
698 file_length = strlen(file);
699 key_length = key ? strlen(key) : 6;
700 size = file_length + key_length + 132;
701 hkey = alloca(sizeof (char) * size);
702 memcpy(hkey, file, file_length);
703 size = file_length;
704 memcpy(hkey + size, "//://", 5);
705 size += 5;
706 if (key) ckey = key;
707 memcpy(hkey + size, ckey, key_length);
708 size += key_length;
709 if ((!lo) ||
710 (lo &&
711 (lo->scale_down_by == 0) &&
712 (lo->dpi == 0.0) &&
713 ((lo->w == 0) || (lo->h == 0)) &&
714 ((lo->region.w == 0) || (lo->region.h == 0)) &&
715 (lo->orientation == 0)
716 ))
717 {
718 lo = &prevent;
719 }
720 else
721 {
722 memcpy(hkey + size, "//@/", 4);
723 size += 4;
724 size += eina_convert_xtoa(lo->scale_down_by, hkey + size);
725 hkey[size] = '/';
726 size += 1;
727 size += eina_convert_dtoa(lo->dpi, hkey + size);
728 hkey[size] = '/';
729 size += 1;
730 size += eina_convert_xtoa(lo->w, hkey + size);
731 hkey[size] = 'x';
732 size += 1;
733 size += eina_convert_xtoa(lo->h, hkey + size);
734 hkey[size] = '/';
735 size += 1;
736 size += eina_convert_xtoa(lo->region.x, hkey + size);
737 hkey[size] = '+';
738 size += 1;
739 size += eina_convert_xtoa(lo->region.y, hkey + size);
740 hkey[size] = '.';
741 size += 1;
742 size += eina_convert_xtoa(lo->region.w, hkey + size);
743 hkey[size] = 'x';
744 size += 1;
745 size += eina_convert_xtoa(lo->region.h, hkey + size);
746
747 if (lo->orientation)
748 {
749 hkey[size] = '/';
750 size += 1;
751 hkey[size] = 'o';
752 size += 1;
753 }
754 }
755 hkey[size] = '\0';
756
757 /* find image by key in active hash */
758#ifdef EVAS_FRAME_QUEUING
759 LKL(cache->lock);
760#endif
761 im = eina_hash_find(cache->activ, hkey);
762#ifdef EVAS_FRAME_QUEUING
763 LKU(cache->lock);
764#endif
765 if (im)
766 {
767 int ok = 1;
768
769 stat_done = 1;
770 if (stat(file, &st) < 0)
771 {
772 stat_failed = 1;
773 ok = 0;
774 }
775 else if (!_timestamp_compare(&(im->tstamp), &st)) ok = 0;
776 if (ok) goto on_ok;
777 /* image we found doesn't match what's on disk (stat info wise)
778 * so dirty the active cache entry so we never find it again. this
779 * also implicitly guarantees that we only have 1 active copy
780 * of an image at a given key. we wither find it and keep re-reffing
781 * it or we dirty it and get it out */
782 _evas_cache_image_dirty_add(im);
783 im = NULL;
784 }
785
786 /* find image by key in inactive/lru hash */
787#ifdef EVAS_FRAME_QUEUING
788 LKL(cache->lock);
789#endif
790 im = eina_hash_find(cache->inactiv, hkey);
791#ifdef EVAS_FRAME_QUEUING
792 LKU(cache->lock);
793#endif
794 if (im)
795 {
796 int ok = 1;
797
798 if (!stat_done)
799 {
800 stat_done = 1;
801 if (stat(file, &st) < 0)
802 {
803 stat_failed = 1;
804 ok = 0;
805 }
806 else if (!_timestamp_compare(&(im->tstamp), &st)) ok = 0;
807 }
808 else if (!_timestamp_compare(&(im->tstamp), &st)) ok = 0;
809
810 if (ok)
811 {
812 /* remove from lru and make it active again */
813 _evas_cache_image_lru_del(im);
814 _evas_cache_image_activ_add(im);
815 goto on_ok;
816 }
817 /* as avtive cache find - if we match in lru and its invalid, dirty */
818 _evas_cache_image_dirty_add(im);
819 im = NULL;
820 }
821 if (stat_failed) goto on_stat_error;
822
823 if (!stat_done)
824 {
825 if (stat(file, &st) < 0) goto on_stat_error;
826 }
827 _timestamp_build(&tstamp, &st);
828 im = _evas_cache_image_entry_new(cache, hkey, &tstamp, file, key,
829 lo, error);
830 if (!im) goto on_stat_error;
831 if (cache->func.debug) cache->func.debug("request", im);
832
833 on_ok:
834 *error = EVAS_LOAD_ERROR_NONE;
835#ifdef EVAS_FRAME_QUEUING
836 LKL(im->lock_references);
837#endif
838 im->references++;
839#ifdef EVAS_FRAME_QUEUING
840 LKU(im->lock_references);
841#endif
842 return im;
843
844 on_stat_error:
845#ifndef _WIN32
846 if ((errno == ENOENT) || (errno == ENOTDIR) ||
847 (errno == ENAMETOOLONG) || (errno == ELOOP))
848#else
849 if (errno == ENOENT)
850#endif
851 *error = EVAS_LOAD_ERROR_DOES_NOT_EXIST;
852#ifndef _WIN32
853 else if ((errno == ENOMEM) || (errno == EOVERFLOW))
854#else
855 else if (errno == ENOMEM)
856#endif
857 *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
858 else if (errno == EACCES)
859 *error = EVAS_LOAD_ERROR_PERMISSION_DENIED;
860 else
861 *error = EVAS_LOAD_ERROR_GENERIC;
862
863 if (im) _evas_cache_image_entry_delete(cache, im);
864 return NULL;
865}
866
867EAPI void
868evas_cache_image_drop(Image_Entry *im)
869{
870 Evas_Cache_Image *cache;
871 int references;
872
873#ifdef EVAS_FRAME_QUEUING
874 LKL(im->lock_references);
875#endif
876 im->references--;
877 if (im->references < 0) im->references = 0;
878 references = im->references;
879#ifdef EVAS_FRAME_QUEUING
880 LKU(im->lock_references);
881#endif
882
883 cache = im->cache;
884
885 if (references == 0)
886 {
887#ifdef EVAS_FRAME_QUEUING
888 LKL(im->ref_fq_add);
889 LKL(im->ref_fq_del);
890 if (im->ref_fq[0] != im->ref_fq[1])
891 {
892 LKU(im->ref_fq_add);
893 LKU(im->ref_fq_del);
894 return;
895 }
896 LKU(im->ref_fq_add);
897 LKU(im->ref_fq_del);
898#endif
899
900#ifdef BUILD_ASYNC_PRELOAD
901 if (im->preload)
902 {
903 _evas_cache_image_entry_preload_remove(im, NULL);
904 return;
905 }
906#endif
907
908 if (im->flags.dirty)
909 {
910 _evas_cache_image_entry_delete(cache, im);
911 return;
912 }
913 _evas_cache_image_lru_add(im);
914 if (cache) evas_cache_image_flush(cache);
915 }
916}
917
918EAPI void
919evas_cache_image_data_not_needed(Image_Entry *im)
920{
921 Evas_Cache_Image *cache;
922 int references;
923
924 /* FIXME: no one uses this api... well evas_cache_engine_parent_not_needed()
925 * does, but nothing uses that! */
926 cache = im->cache;
927#ifdef EVAS_FRAME_QUEUING
928 LKL(im->lock_references);
929#endif
930 references = im->references;
931#ifdef EVAS_FRAME_QUEUING
932 LKU(im->lock_references);
933#endif
934 if (references > 1) return;
935 if ((im->flags.dirty) || (!im->flags.need_data)) return;
936 _evas_cache_image_lru_nodata_add(im);
937}
938
939EAPI Image_Entry *
940evas_cache_image_dirty(Image_Entry *im, unsigned int x, unsigned int y, unsigned int w, unsigned int h)
941{
942 Image_Entry *im_dirty = im;
943 Evas_Cache_Image *cache;
944 int references;
945
946 cache = im->cache;
947 if (!(im->flags.dirty))
948 {
949#ifdef EVAS_FRAME_QUEUING
950 LKL(im->lock_references);
951#endif
952 references = im->references;
953#ifdef EVAS_FRAME_QUEUING
954 LKU(im->lock_references);
955#endif
956#ifndef EVAS_CSERVE
957 // if ref 1 also copy if using shared cache as its read-only
958 if (references == 1) im_dirty = im;
959 else
960#endif
961 {
962 int error;
963
964 im_dirty =
965 evas_cache_image_copied_data(cache, im->w, im->h,
966 evas_cache_image_pixels(im),
967 im->flags.alpha, im->space);
968 if (!im_dirty) goto on_error;
969 if (cache->func.debug) cache->func.debug("dirty-src", im);
970 error = cache->func.dirty(im_dirty, im);
971 if (cache->func.debug) cache->func.debug("dirty-out", im_dirty);
972#ifdef EVAS_FRAME_QUEUING
973 LKL(im_dirty->lock_references);
974#endif
975 im_dirty->references = 1;
976#ifdef EVAS_FRAME_QUEUING
977 LKU(im_dirty->lock_references);
978#endif
979 evas_cache_image_drop(im);
980 }
981 _evas_cache_image_dirty_add(im_dirty);
982 }
983
984 if (cache->func.debug) cache->func.debug("dirty-region", im_dirty);
985 if (cache->func.dirty_region)
986 cache->func.dirty_region(im_dirty, x, y, w, h);
987 return im_dirty;
988
989on_error:
990 if (im_dirty) _evas_cache_image_entry_delete(cache, im_dirty);
991 evas_cache_image_drop(im);
992 return NULL;
993}
994
995EAPI Image_Entry *
996evas_cache_image_alone(Image_Entry *im)
997{
998 Evas_Cache_Image *cache;
999 Image_Entry *im_dirty = im;
1000 int references;
1001
1002 cache = im->cache;
1003#ifdef EVAS_FRAME_QUEUING
1004 LKL(im->lock_references);
1005#endif
1006 references = im->references;
1007#ifdef EVAS_FRAME_QUEUING
1008 LKU(im->lock_references);
1009#endif
1010
1011 if (references <= 1)
1012 {
1013 if (!im->flags.dirty) _evas_cache_image_dirty_add(im);
1014 }
1015 else
1016 {
1017 int error;
1018
1019 im_dirty = evas_cache_image_copied_data(cache, im->w, im->h,
1020 evas_cache_image_pixels(im),
1021 im->flags.alpha,
1022 im->space);
1023 if (!im_dirty) goto on_error;
1024 if (cache->func.debug) cache->func.debug("dirty-src", im);
1025 error = cache->func.dirty(im_dirty, im);
1026 if (cache->func.debug) cache->func.debug("dirty-out", im_dirty);
1027#ifdef EVAS_FRAME_QUEUING
1028 LKL(im_dirty->lock_references);
1029#endif
1030 im_dirty->references = 1;
1031#ifdef EVAS_FRAME_QUEUING
1032 LKU(im_dirty->lock_references);
1033#endif
1034 evas_cache_image_drop(im);
1035 }
1036 return im_dirty;
1037
1038on_error:
1039 if (im_dirty) _evas_cache_image_entry_delete(cache, im_dirty);
1040 evas_cache_image_drop(im);
1041 return NULL;
1042}
1043
1044EAPI Image_Entry *
1045evas_cache_image_copied_data(Evas_Cache_Image *cache,
1046 unsigned int w, unsigned int h,
1047 DATA32 *image_data, int alpha, int cspace)
1048{
1049 Image_Entry *im;
1050
1051 if ((cspace == EVAS_COLORSPACE_YCBCR422P601_PL) ||
1052 (cspace == EVAS_COLORSPACE_YCBCR422P709_PL) ||
1053 (cspace == EVAS_COLORSPACE_YCBCR422601_PL))
1054 w &= ~0x1;
1055
1056 im = _evas_cache_image_entry_new(cache, NULL, NULL, NULL, NULL, NULL, NULL);
1057 if (!im) return NULL;
1058 im->space = cspace;
1059 im->flags.alpha = alpha;
1060 _evas_cache_image_entry_surface_alloc(cache, im, w, h);
1061 if (cache->func.copied_data(im, w, h, image_data, alpha, cspace) != 0)
1062 {
1063 _evas_cache_image_entry_delete(cache, im);
1064 return NULL;
1065 }
1066#ifdef EVAS_FRAME_QUEUING
1067 LKL(im->lock_references);
1068#endif
1069 im->references = 1;
1070#ifdef EVAS_FRAME_QUEUING
1071 LKU(im->lock_references);
1072#endif
1073 if (cache->func.debug) cache->func.debug("copied-data", im);
1074 return im;
1075}
1076
1077EAPI Image_Entry *
1078evas_cache_image_data(Evas_Cache_Image *cache, unsigned int w, unsigned int h, DATA32 *image_data, int alpha, int cspace)
1079{
1080 Image_Entry *im;
1081
1082 if ((cspace == EVAS_COLORSPACE_YCBCR422P601_PL) ||
1083 (cspace == EVAS_COLORSPACE_YCBCR422P709_PL) ||
1084 (cspace == EVAS_COLORSPACE_YCBCR422601_PL))
1085 w &= ~0x1;
1086
1087 im = _evas_cache_image_entry_new(cache, NULL, NULL, NULL, NULL, NULL, NULL);
1088 if (!im) return NULL;
1089 im->w = w;
1090 im->h = h;
1091 im->flags.alpha = alpha;
1092 if (cache->func.data(im, w, h, image_data, alpha, cspace) != 0)
1093 {
1094 _evas_cache_image_entry_delete(cache, im);
1095 return NULL;
1096 }
1097#ifdef EVAS_FRAME_QUEUING
1098 LKL(im->lock_references);
1099#endif
1100 im->references = 1;
1101#ifdef EVAS_FRAME_QUEUING
1102 LKU(im->lock_references);
1103#endif
1104 if (cache->func.debug) cache->func.debug("data", im);
1105 return im;
1106}
1107
1108EAPI void
1109evas_cache_image_surface_alloc(Image_Entry *im, unsigned int w, unsigned int h)
1110{
1111 Evas_Cache_Image *cache = im->cache;
1112
1113 if ((im->space == EVAS_COLORSPACE_YCBCR422P601_PL) ||
1114 (im->space == EVAS_COLORSPACE_YCBCR422P709_PL) ||
1115 (im->space == EVAS_COLORSPACE_YCBCR422601_PL))
1116 w &= ~0x1;
1117
1118 _evas_cache_image_entry_surface_alloc(cache, im, w, h);
1119 if (cache->func.debug) cache->func.debug("surface-alloc", im);
1120}
1121
1122EAPI Image_Entry *
1123evas_cache_image_size_set(Image_Entry *im, unsigned int w, unsigned int h)
1124{
1125 Evas_Cache_Image *cache;
1126 Image_Entry *im2 = NULL;
1127 int error;
1128
1129 if ((im->space == EVAS_COLORSPACE_YCBCR422P601_PL) ||
1130 (im->space == EVAS_COLORSPACE_YCBCR422P709_PL) ||
1131 (im->space == EVAS_COLORSPACE_YCBCR422601_PL))
1132 w &= ~0x1;
1133 if ((im->w == w) && (im->h == h)) return im;
1134
1135 cache = im->cache;
1136 im2 = _evas_cache_image_entry_new(cache, NULL, NULL, NULL, NULL, NULL, &error);
1137 if (!im2) goto on_error;
1138
1139 im2->flags.alpha = im->flags.alpha;
1140 im2->space = im->space;
1141 im2->load_opts = im->load_opts;
1142 _evas_cache_image_entry_surface_alloc(cache, im2, w, h);
1143 error = cache->func.size_set(im2, im, w, h);
1144 if (error != 0) goto on_error;
1145#ifdef EVAS_FRAME_QUEUING
1146 LKL(im2->lock_references);
1147#endif
1148 im2->references = 1;
1149#ifdef EVAS_FRAME_QUEUING
1150 LKU(im2->lock_references);
1151#endif
1152 evas_cache_image_drop(im);
1153 if (cache->func.debug) cache->func.debug("size_set", im2);
1154 return im2;
1155
1156 on_error:
1157 if (im2) _evas_cache_image_entry_delete(cache, im2);
1158 evas_cache_image_drop(im);
1159 return NULL;
1160}
1161
1162EAPI int
1163evas_cache_image_load_data(Image_Entry *im)
1164{
1165#ifdef BUILD_ASYNC_PRELOAD
1166 Eina_Bool preload = EINA_FALSE;
1167#endif
1168 int error = EVAS_LOAD_ERROR_NONE;
1169
1170 if ((im->flags.loaded) && (!im->flags.animated)) return error;
1171#ifdef BUILD_ASYNC_PRELOAD
1172 if (im->preload)
1173 {
1174 preload = EINA_TRUE;
1175 if (!im->flags.pending)
1176 {
1177 im->cache->preload = eina_list_remove(im->cache->preload, im);
1178 im->cache->pending = eina_list_append(im->cache->pending, im);
1179 im->flags.pending = 1;
1180 evas_preload_thread_cancel(im->preload);
1181 }
1182 evas_async_events_process();
1183 LKL(wakeup);
1184 while (im->preload)
1185 {
1186 eina_condition_wait(&cond_wakeup);
1187 LKU(wakeup);
1188 evas_async_events_process();
1189 LKL(wakeup);
1190 }
1191 LKU(wakeup);
1192 }
1193
1194 if ((im->flags.loaded) && (!im->flags.animated)) return error;
1195 LKL(im->lock);
1196#endif
1197 im->flags.in_progress = EINA_TRUE;
1198 error = im->cache->func.load(im);
1199 im->flags.in_progress = EINA_FALSE;
1200#ifdef BUILD_ASYNC_PRELOAD
1201 LKU(im->lock);
1202#endif
1203 im->flags.loaded = 1;
1204 if (im->cache->func.debug) im->cache->func.debug("load", im);
1205 if (error != EVAS_LOAD_ERROR_NONE)
1206 {
1207 _evas_cache_image_entry_surface_alloc(im->cache, im, im->w, im->h);
1208 im->flags.loaded = 0;
1209 }
1210#ifdef BUILD_ASYNC_PRELOAD
1211 if (preload) _evas_cache_image_async_end(im);
1212#endif
1213 return error;
1214}
1215
1216EAPI void
1217evas_cache_image_unload_data(Image_Entry *im)
1218{
1219 if (im->flags.in_progress) return;
1220 evas_cache_image_preload_cancel(im, NULL);
1221#ifdef BUILD_ASYNC_PRELOAD
1222 LKL(im->lock_cancel);
1223 if (LKT(im->lock) == EINA_FALSE) /* can't get image lock - busy async load */
1224 {
1225 im->unload_cancel = EINA_TRUE;
1226 LKU(im->lock_cancel);
1227 return;
1228 }
1229 LKU(im->lock_cancel);
1230#endif
1231 if ((!im->flags.loaded) || (!im->file) || (!im->info.module) ||
1232 (im->flags.dirty))
1233 {
1234#ifdef BUILD_ASYNC_PRELOAD
1235 LKU(im->lock);
1236#endif
1237 return;
1238 }
1239 im->cache->func.destructor(im);
1240#ifdef BUILD_ASYNC_PRELOAD
1241 LKU(im->lock);
1242#endif
1243 //FIXME: imagedataunload - inform owners
1244}
1245
1246static Eina_Bool
1247_evas_cache_image_unload_cb(__UNUSED__ const Eina_Hash *hash, __UNUSED__ const void *key, void *data, __UNUSED__ void *fdata)
1248{
1249 evas_cache_image_unload_data(data);
1250 return EINA_TRUE;
1251}
1252
1253EAPI void
1254evas_cache_image_unload_all(Evas_Cache_Image *cache)
1255{
1256 Image_Entry *im;
1257
1258 EINA_INLIST_FOREACH(cache->lru, im) evas_cache_image_unload_data(im);
1259 EINA_INLIST_FOREACH(cache->lru_nodata, im) evas_cache_image_unload_data(im);
1260 eina_hash_foreach(cache->activ, _evas_cache_image_unload_cb, NULL);
1261 eina_hash_foreach(cache->inactiv, _evas_cache_image_unload_cb, NULL);
1262}
1263
1264EAPI Eina_Bool
1265evas_cache_image_is_loaded(Image_Entry *im)
1266{
1267 if (im->flags.loaded) return EINA_TRUE;
1268 return EINA_FALSE;
1269}
1270
1271EAPI void
1272evas_cache_image_preload_data(Image_Entry *im, const void *target)
1273{
1274#ifdef BUILD_ASYNC_PRELOAD
1275 RGBA_Image *img = (RGBA_Image *)im;
1276
1277 if ((im->flags.loaded) && (img->image.data))
1278 {
1279 evas_object_inform_call_image_preloaded((Evas_Object *)target);
1280 return;
1281 }
1282 im->flags.loaded = 0;
1283 if (!_evas_cache_image_entry_preload_add(im, target))
1284 evas_object_inform_call_image_preloaded((Evas_Object *)target);
1285#else
1286 evas_cache_image_load_data(im);
1287 evas_object_inform_call_image_preloaded((Evas_Object *)target);
1288#endif
1289}
1290
1291EAPI void
1292evas_cache_image_preload_cancel(Image_Entry *im, const void *target)
1293{
1294#ifdef BUILD_ASYNC_PRELOAD
1295 if (!target) return;
1296 _evas_cache_image_entry_preload_remove(im, target);
1297#else
1298 (void)im;
1299#endif
1300}
1301
1302#ifdef CACHEDUMP
1303static int total = 0;
1304
1305static void
1306_dump_img(Image_Entry *im, const char *type)
1307{
1308 total += im->cache->func.mem_size_get(im);
1309 printf("%s: %4i: %4ib, %4ix%4i alloc[%4ix%4i] [%s] [%s]\n",
1310 type,
1311 im->references,
1312 im->cache->func.mem_size_get(im),
1313 im->w, im->h, im->allocated.w, im->allocated.h,
1314 im->file, im->key);
1315}
1316
1317static Eina_Bool
1318_dump_cache_active(__UNUSED__ const Eina_Hash *hash, __UNUSED__ const void *key, void *data, void *fdata __UNUSED__)
1319{
1320 Image_Entry *im = data;
1321 _dump_img(im, "ACTIVE");
1322 return EINA_TRUE;
1323}
1324
1325static void
1326_dump_cache(Evas_Cache_Image *cache)
1327{
1328 Image_Entry *im;
1329
1330 printf("--CACHE DUMP----------------------------------------------------\n");
1331 printf("cache: %ikb / %ikb\n",
1332 cache->usage / 1024,
1333 cache->limit / 1024);
1334 printf("................................................................\n");
1335 total = 0;
1336 EINA_INLIST_FOREACH(cache->lru_nodata, im)
1337 _dump_img(im, "NODATA");
1338 EINA_INLIST_FOREACH(cache->lru, im)
1339 _dump_img(im, "DATA ");
1340 printf("tot: %i\n"
1341 "usg: %i\n",
1342 total,
1343 cache->usage);
1344 eina_hash_foreach(cache->activ, _dump_cache_active, NULL);
1345}
1346#endif
1347
1348EAPI int
1349evas_cache_image_flush(Evas_Cache_Image *cache)
1350{
1351#ifdef CACHEDUMP
1352 _dump_cache(cache);
1353#endif
1354 if (cache->limit == (unsigned int)-1) return -1;
1355
1356 while ((cache->lru) && (cache->limit < (unsigned int)cache->usage))
1357 {
1358 Image_Entry *im;
1359
1360 im = (Image_Entry *)cache->lru->last;
1361 _evas_cache_image_entry_delete(cache, im);
1362 }
1363
1364 while ((cache->lru_nodata) && (cache->limit < (unsigned int)cache->usage))
1365 {
1366 Image_Entry *im;
1367
1368 im = (Image_Entry *) cache->lru_nodata->last;
1369 _evas_cache_image_lru_nodata_del(im);
1370 cache->func.surface_delete(im);
1371 im->flags.loaded = 0;
1372 }
1373
1374 return cache->usage;
1375}
1376
1377EAPI Image_Entry *
1378evas_cache_image_empty(Evas_Cache_Image *cache)
1379{
1380 Image_Entry *im;
1381
1382 im = _evas_cache_image_entry_new(cache, NULL, NULL, NULL, NULL, NULL, NULL);
1383 if (!im) return NULL;
1384#ifdef EVAS_FRAME_QUEUING
1385 LKL(im->lock_references);
1386#endif
1387 im->references = 1;
1388#ifdef EVAS_FRAME_QUEUING
1389 LKU(im->lock_references);
1390#endif
1391 return im;
1392}
1393
1394EAPI void
1395evas_cache_image_colorspace(Image_Entry *im, int cspace)
1396{
1397 if (im->space == cspace) return;
1398 im->space = cspace;
1399 im->cache->func.color_space(im, cspace);
1400}
1401
1402EAPI void *
1403evas_cache_private_from_image_entry_get(Image_Entry *im)
1404{
1405 return (void *)im->cache->data;
1406}
1407
1408EAPI void *
1409evas_cache_private_get(Evas_Cache_Image *cache)
1410{
1411 return cache->data;
1412}
1413
1414EAPI void
1415evas_cache_private_set(Evas_Cache_Image *cache, const void *data)
1416{
1417 cache->data = (void *)data;
1418}
1419
1420EAPI DATA32 *
1421evas_cache_image_pixels(Image_Entry *im)
1422{
1423 return im->cache->func.surface_pixels(im);
1424}
1425
1426EAPI void
1427evas_cache_image_wakeup(void)
1428{
1429#ifdef BUILD_ASYNC_PRELOAD
1430 if (_evas_cache_mutex_init > 0)
1431 eina_condition_broadcast(&cond_wakeup);
1432#endif
1433}
diff --git a/libraries/evas/src/lib/cache/evas_preload.c b/libraries/evas/src/lib/cache/evas_preload.c
new file mode 100644
index 0000000..6e0412a
--- /dev/null
+++ b/libraries/evas/src/lib/cache/evas_preload.c
@@ -0,0 +1,264 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#ifdef HAVE_EVIL
6# include <Evil.h>
7#endif
8
9#ifdef BUILD_ASYNC_PRELOAD
10# include <pthread.h>
11# ifdef __linux__
12# include <sys/syscall.h>
13# endif
14#endif
15
16#include "evas_common.h"
17#include "evas_private.h"
18#include "Evas.h"
19
20#ifdef BUILD_ASYNC_PRELOAD
21
22static int _threads_max = 0;
23
24typedef struct _Evas_Preload_Pthread_Worker Evas_Preload_Pthread_Worker;
25typedef struct _Evas_Preload_Pthread_Data Evas_Preload_Pthread_Data;
26
27typedef void (*_evas_preload_pthread_func)(void *data);
28
29struct _Evas_Preload_Pthread_Worker
30{
31 EINA_INLIST;
32
33 _evas_preload_pthread_func func_heavy;
34 _evas_preload_pthread_func func_end;
35 _evas_preload_pthread_func func_cancel;
36 void *data;
37 Eina_Bool cancel : 1;
38};
39
40struct _Evas_Preload_Pthread_Data
41{
42 pthread_t thread;
43};
44
45static int _threads_count = 0;
46static Evas_Preload_Pthread_Worker *_workers = NULL;
47
48static LK(_mutex);
49
50static void
51_evas_preload_thread_end(void *data)
52{
53 Evas_Preload_Pthread_Data *pth = data;
54 Evas_Preload_Pthread_Data *p = NULL;
55
56 if (pthread_join(pth->thread, (void **)&p) == 0) free(p);
57 else return;
58 eina_threads_shutdown();
59}
60
61static void
62_evas_preload_thread_done(void *target __UNUSED__, Evas_Callback_Type type __UNUSED__, void *event_info)
63{
64 Evas_Preload_Pthread_Worker *work = event_info;
65 if (work->cancel)
66 {
67 if (work->func_cancel) work->func_cancel(work->data);
68 }
69 else
70 work->func_end(work->data);
71
72 free(work);
73}
74
75static void *
76_evas_preload_thread_worker(void *data)
77{
78 Evas_Preload_Pthread_Data *pth = data;
79 Evas_Preload_Pthread_Worker *work;
80
81 eina_sched_prio_drop();
82 pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
83 pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
84on_error:
85 for (;;)
86 {
87 LKL(_mutex);
88 if (!_workers)
89 {
90 LKU(_mutex);
91 break;
92 }
93
94 work = _workers;
95 _workers = EINA_INLIST_CONTAINER_GET(eina_inlist_remove(EINA_INLIST_GET(_workers),
96 EINA_INLIST_GET(_workers)),
97 Evas_Preload_Pthread_Worker);
98 LKU(_mutex);
99
100 if (work->func_heavy) work->func_heavy(work->data);
101 evas_async_events_put(pth, 0, work, _evas_preload_thread_done);
102 }
103
104 LKL(_mutex);
105 if (_workers)
106 {
107 LKU(_mutex);
108 goto on_error;
109 }
110 _threads_count--;
111 LKU(_mutex);
112
113 // dummy worker to wake things up
114 work = malloc(sizeof(Evas_Preload_Pthread_Worker));
115 if (!work) return NULL;
116
117 work->data = pth;
118 work->func_heavy = NULL;
119 work->func_end = (_evas_preload_pthread_func) _evas_preload_thread_end;
120 work->func_cancel = NULL;
121 work->cancel = EINA_FALSE;
122
123 evas_async_events_put(pth, 0, work, _evas_preload_thread_done);
124 return pth;
125}
126#endif
127
128void
129_evas_preload_thread_init(void)
130{
131#ifdef BUILD_ASYNC_PRELOAD
132 _threads_max = eina_cpu_count();
133 if (_threads_max < 1) _threads_max = 1;
134
135 LKI(_mutex);
136#endif
137}
138
139void
140_evas_preload_thread_shutdown(void)
141{
142 /* FIXME: If function are still running in the background, should we kill them ? */
143#ifdef BUILD_ASYNC_PRELOAD
144 Evas_Preload_Pthread_Worker *work;
145
146 /* Force processing of async events. */
147 evas_async_events_process();
148 LKL(_mutex);
149 while (_workers)
150 {
151 work = _workers;
152 _workers = EINA_INLIST_CONTAINER_GET(eina_inlist_remove(EINA_INLIST_GET(_workers),
153 EINA_INLIST_GET(_workers)),
154 Evas_Preload_Pthread_Worker);
155 if (work->func_cancel) work->func_cancel(work->data);
156 free(work);
157 }
158 LKU(_mutex);
159
160 LKD(_mutex);
161#endif
162}
163
164Evas_Preload_Pthread *
165evas_preload_thread_run(void (*func_heavy) (void *data),
166 void (*func_end) (void *data),
167 void (*func_cancel) (void *data),
168 const void *data)
169{
170#ifdef BUILD_ASYNC_PRELOAD
171 Evas_Preload_Pthread_Worker *work;
172 Evas_Preload_Pthread_Data *pth;
173
174 work = malloc(sizeof(Evas_Preload_Pthread_Worker));
175 if (!work)
176 {
177 func_cancel((void *)data);
178 return NULL;
179 }
180
181 work->func_heavy = func_heavy;
182 work->func_end = func_end;
183 work->func_cancel = func_cancel;
184 work->cancel = EINA_FALSE;
185 work->data = (void *)data;
186
187 LKL(_mutex);
188 _workers = (Evas_Preload_Pthread_Worker *)eina_inlist_append(EINA_INLIST_GET(_workers), EINA_INLIST_GET(work));
189 if (_threads_count == _threads_max)
190 {
191 LKU(_mutex);
192 return (Evas_Preload_Pthread *)work;
193 }
194 LKU(_mutex);
195
196 /* One more thread could be created. */
197 pth = malloc(sizeof(Evas_Preload_Pthread_Data));
198 if (!pth) goto on_error;
199
200 eina_threads_init();
201
202 if (pthread_create(&pth->thread, NULL, _evas_preload_thread_worker, pth) == 0)
203 {
204 LKL(_mutex);
205 _threads_count++;
206 LKU(_mutex);
207 return (Evas_Preload_Pthread*)work;
208 }
209
210 eina_threads_shutdown();
211
212 on_error:
213 LKL(_mutex);
214 if (_threads_count == 0)
215 {
216 LKU(_mutex);
217 if (work->func_cancel) work->func_cancel(work->data);
218 free(work);
219 return NULL;
220 }
221 LKU(_mutex);
222 return NULL;
223#else
224 /*
225 If no thread and as we don't want to break app that rely on this
226 facility, we will lock the interface until we are done.
227 */
228 func_heavy((void *)data);
229 func_end((void *)data);
230 return (void *)1;
231#endif
232}
233
234Eina_Bool
235evas_preload_thread_cancel(Evas_Preload_Pthread *thread)
236{
237#ifdef BUILD_ASYNC_PRELOAD
238 Evas_Preload_Pthread_Worker *work;
239
240 if (!thread) return EINA_TRUE;
241 LKL(_mutex);
242 EINA_INLIST_FOREACH(_workers, work)
243 {
244 if (work == (Evas_Preload_Pthread_Worker *)thread)
245 {
246 _workers = EINA_INLIST_CONTAINER_GET(eina_inlist_remove(EINA_INLIST_GET(_workers),
247 EINA_INLIST_GET(work)),
248 Evas_Preload_Pthread_Worker);
249 LKU(_mutex);
250 if (work->func_cancel) work->func_cancel(work->data);
251 free(work);
252 return EINA_TRUE;
253 }
254 }
255 LKU(_mutex);
256
257 /* Delay the destruction */
258 work = (Evas_Preload_Pthread_Worker *)thread;
259 work->cancel = EINA_TRUE;
260 return EINA_FALSE;
261#else
262 return EINA_TRUE;
263#endif
264}
diff --git a/libraries/evas/src/lib/canvas/Makefile.am b/libraries/evas/src/lib/canvas/Makefile.am
new file mode 100644
index 0000000..79544aa
--- /dev/null
+++ b/libraries/evas/src/lib/canvas/Makefile.am
@@ -0,0 +1,68 @@
1MAINTAINERCLEANFILES = Makefile.in
2
3AM_CPPFLAGS = \
4-I. \
5-I$(top_srcdir)/src/lib \
6-I$(top_srcdir)/src/lib/include \
7-I$(top_srcdir)/src/lib/cserve \
8-DPACKAGE_BIN_DIR=\"$(bindir)\" \
9-DPACKAGE_LIB_DIR=\"$(libdir)\" \
10-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
11@WIN32_CPPFLAGS@ \
12@FREETYPE_CFLAGS@ \
13@EET_CFLAGS@ \
14@FONTCONFIG_CFLAGS@ \
15@EVAS_CFLAGS@ \
16@EINA_CFLAGS@ \
17@EVIL_CFLAGS@ \
18@PIXMAN_CFLAGS@
19
20noinst_LTLIBRARIES = libevas_canvas.la
21libevas_canvas_la_SOURCES = \
22evas_callbacks.c \
23evas_clip.c \
24evas_data.c \
25evas_events.c \
26evas_filter.c \
27evas_focus.c \
28evas_key.c \
29evas_key_grab.c \
30evas_layer.c \
31evas_main.c \
32evas_name.c \
33evas_object_image.c \
34evas_object_main.c \
35evas_object_inform.c \
36evas_object_intercept.c \
37evas_object_line.c \
38evas_object_polygon.c \
39evas_object_rectangle.c \
40evas_object_smart.c \
41evas_object_smart_clipped.c \
42evas_object_box.c \
43evas_object_table.c \
44evas_object_text.c \
45evas_object_textblock.c \
46evas_object_grid.c \
47evas_font_dir.c \
48evas_rectangle.c \
49evas_render.c \
50evas_smart.c \
51evas_stack.c \
52evas_async_events.c \
53evas_stats.c \
54evas_touch_point.c \
55evas_map.c \
56evas_gl.c
57
58#evas_object_textgrid.c
59
60libevas_canvas_la_LIBADD = @EVAS_LIBS@ @EVIL_LIBS@
61
62if EVAS_USE_LINEBREAK
63AM_CPPFLAGS += @LINEBREAK_CFLAGS@
64libevas_canvas_la_LIBADD += @LINEBREAK_LIBS@
65endif
66
67clean-local:
68 rm -rf *.gcno
diff --git a/libraries/evas/src/lib/canvas/Makefile.in b/libraries/evas/src/lib/canvas/Makefile.in
new file mode 100644
index 0000000..0b4e15d
--- /dev/null
+++ b/libraries/evas/src/lib/canvas/Makefile.in
@@ -0,0 +1,760 @@
1# Makefile.in generated by automake 1.11.1 from Makefile.am.
2# @configure_input@
3
4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
6# Inc.
7# This Makefile.in is free software; the Free Software Foundation
8# gives unlimited permission to copy and/or distribute it,
9# with or without modifications, as long as this notice is preserved.
10
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
13# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14# PARTICULAR PURPOSE.
15
16@SET_MAKE@
17
18VPATH = @srcdir@
19pkgdatadir = $(datadir)/@PACKAGE@
20pkgincludedir = $(includedir)/@PACKAGE@
21pkglibdir = $(libdir)/@PACKAGE@
22pkglibexecdir = $(libexecdir)/@PACKAGE@
23am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
24install_sh_DATA = $(install_sh) -c -m 644
25install_sh_PROGRAM = $(install_sh) -c
26install_sh_SCRIPT = $(install_sh) -c
27INSTALL_HEADER = $(INSTALL_DATA)
28transform = $(program_transform_name)
29NORMAL_INSTALL = :
30PRE_INSTALL = :
31POST_INSTALL = :
32NORMAL_UNINSTALL = :
33PRE_UNINSTALL = :
34POST_UNINSTALL = :
35build_triplet = @build@
36host_triplet = @host@
37@EVAS_USE_LINEBREAK_TRUE@am__append_1 = @LINEBREAK_CFLAGS@
38@EVAS_USE_LINEBREAK_TRUE@am__append_2 = @LINEBREAK_LIBS@
39subdir = src/lib/canvas
40DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
41ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
42am__aclocal_m4_deps = $(top_srcdir)/m4/efl_attribute.m4 \
43 $(top_srcdir)/m4/efl_coverage.m4 \
44 $(top_srcdir)/m4/efl_doxygen.m4 \
45 $(top_srcdir)/m4/efl_fnmatch.m4 \
46 $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \
47 $(top_srcdir)/m4/evas_check_engine.m4 \
48 $(top_srcdir)/m4/evas_check_loader.m4 \
49 $(top_srcdir)/m4/evas_converter.m4 \
50 $(top_srcdir)/m4/evas_dither.m4 \
51 $(top_srcdir)/m4/evas_scaler.m4 $(top_srcdir)/m4/libtool.m4 \
52 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
53 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
54 $(top_srcdir)/configure.ac
55am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
56 $(ACLOCAL_M4)
57mkinstalldirs = $(install_sh) -d
58CONFIG_HEADER = $(top_builddir)/config.h
59CONFIG_CLEAN_FILES =
60CONFIG_CLEAN_VPATH_FILES =
61LTLIBRARIES = $(noinst_LTLIBRARIES)
62am__DEPENDENCIES_1 =
63libevas_canvas_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
64am_libevas_canvas_la_OBJECTS = evas_callbacks.lo evas_clip.lo \
65 evas_data.lo evas_events.lo evas_filter.lo evas_focus.lo \
66 evas_key.lo evas_key_grab.lo evas_layer.lo evas_main.lo \
67 evas_name.lo evas_object_image.lo evas_object_main.lo \
68 evas_object_inform.lo evas_object_intercept.lo \
69 evas_object_line.lo evas_object_polygon.lo \
70 evas_object_rectangle.lo evas_object_smart.lo \
71 evas_object_smart_clipped.lo evas_object_box.lo \
72 evas_object_table.lo evas_object_text.lo \
73 evas_object_textblock.lo evas_object_grid.lo evas_font_dir.lo \
74 evas_rectangle.lo evas_render.lo evas_smart.lo evas_stack.lo \
75 evas_async_events.lo evas_stats.lo evas_touch_point.lo \
76 evas_map.lo evas_gl.lo
77libevas_canvas_la_OBJECTS = $(am_libevas_canvas_la_OBJECTS)
78AM_V_lt = $(am__v_lt_$(V))
79am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
80am__v_lt_0 = --silent
81DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
82depcomp = $(SHELL) $(top_srcdir)/depcomp
83am__depfiles_maybe = depfiles
84am__mv = mv -f
85COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
86 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
87LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
88 $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
89 $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
90 $(AM_CFLAGS) $(CFLAGS)
91AM_V_CC = $(am__v_CC_$(V))
92am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
93am__v_CC_0 = @echo " CC " $@;
94AM_V_at = $(am__v_at_$(V))
95am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
96am__v_at_0 = @
97CCLD = $(CC)
98LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
99 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
100 $(AM_LDFLAGS) $(LDFLAGS) -o $@
101AM_V_CCLD = $(am__v_CCLD_$(V))
102am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
103am__v_CCLD_0 = @echo " CCLD " $@;
104AM_V_GEN = $(am__v_GEN_$(V))
105am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
106am__v_GEN_0 = @echo " GEN " $@;
107SOURCES = $(libevas_canvas_la_SOURCES)
108DIST_SOURCES = $(libevas_canvas_la_SOURCES)
109ETAGS = etags
110CTAGS = ctags
111DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
112ACLOCAL = @ACLOCAL@
113ALLOCA = @ALLOCA@
114AMTAR = @AMTAR@
115AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
116AR = @AR@
117AS = @AS@
118AUTOCONF = @AUTOCONF@
119AUTOHEADER = @AUTOHEADER@
120AUTOMAKE = @AUTOMAKE@
121AWK = @AWK@
122CC = @CC@
123CCDEPMODE = @CCDEPMODE@
124CFLAGS = @CFLAGS@
125CHECK_CFLAGS = @CHECK_CFLAGS@
126CHECK_LIBS = @CHECK_LIBS@
127CPP = @CPP@
128CPPFLAGS = @CPPFLAGS@
129CXX = @CXX@
130CXXCPP = @CXXCPP@
131CXXDEPMODE = @CXXDEPMODE@
132CXXFLAGS = @CXXFLAGS@
133CYGPATH_W = @CYGPATH_W@
134DEFS = @DEFS@
135DEPDIR = @DEPDIR@
136DIRECTFB_CFLAGS = @DIRECTFB_CFLAGS@
137DIRECTFB_LIBS = @DIRECTFB_LIBS@
138DLLTOOL = @DLLTOOL@
139DSYMUTIL = @DSYMUTIL@
140DUMPBIN = @DUMPBIN@
141ECHO_C = @ECHO_C@
142ECHO_N = @ECHO_N@
143ECHO_T = @ECHO_T@
144ECORE_EVAS_CFLAGS = @ECORE_EVAS_CFLAGS@
145ECORE_EVAS_LIBS = @ECORE_EVAS_LIBS@
146EDB_CFLAGS = @EDB_CFLAGS@
147EDB_LIBS = @EDB_LIBS@
148EDJE_CFLAGS = @EDJE_CFLAGS@
149EDJE_LIBS = @EDJE_LIBS@
150EET_CFLAGS = @EET_CFLAGS@
151EET_LIBS = @EET_LIBS@
152EFL_COVERAGE_CFLAGS = @EFL_COVERAGE_CFLAGS@
153EFL_COVERAGE_LIBS = @EFL_COVERAGE_LIBS@
154EFL_FNMATCH_LIBS = @EFL_FNMATCH_LIBS@
155EGREP = @EGREP@
156EINA_CFLAGS = @EINA_CFLAGS@
157EINA_LIBS = @EINA_LIBS@
158EVAS_CFLAGS = @EVAS_CFLAGS@
159EVAS_LIBS = @EVAS_LIBS@
160EVAS_SSE3_CFLAGS = @EVAS_SSE3_CFLAGS@
161EVIL_CFLAGS = @EVIL_CFLAGS@
162EVIL_LIBS = @EVIL_LIBS@
163EXEEXT = @EXEEXT@
164FGREP = @FGREP@
165FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@
166FONTCONFIG_LIBS = @FONTCONFIG_LIBS@
167FREETYPE_CFLAGS = @FREETYPE_CFLAGS@
168FREETYPE_LIBS = @FREETYPE_LIBS@
169FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@
170FRIBIDI_LIBS = @FRIBIDI_LIBS@
171GL_EET_CFLAGS = @GL_EET_CFLAGS@
172GL_EET_LIBS = @GL_EET_LIBS@
173GREP = @GREP@
174HARFBUZZ_CFLAGS = @HARFBUZZ_CFLAGS@
175HARFBUZZ_LIBS = @HARFBUZZ_LIBS@
176INSTALL = @INSTALL@
177INSTALL_DATA = @INSTALL_DATA@
178INSTALL_PROGRAM = @INSTALL_PROGRAM@
179INSTALL_SCRIPT = @INSTALL_SCRIPT@
180INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
181LD = @LD@
182LDFLAGS = @LDFLAGS@
183LIBOBJS = @LIBOBJS@
184LIBS = @LIBS@
185LIBTOOL = @LIBTOOL@
186LINEBREAK_CFLAGS = @LINEBREAK_CFLAGS@
187LINEBREAK_LIBS = @LINEBREAK_LIBS@
188LIPO = @LIPO@
189LN_S = @LN_S@
190LTLIBOBJS = @LTLIBOBJS@
191MAKEINFO = @MAKEINFO@
192MKDIR_P = @MKDIR_P@
193MODULE_ARCH = @MODULE_ARCH@
194NM = @NM@
195NMEDIT = @NMEDIT@
196OBJC = @OBJC@
197OBJCDEPMODE = @OBJCDEPMODE@
198OBJCFLAGS = @OBJCFLAGS@
199OBJDUMP = @OBJDUMP@
200OBJEXT = @OBJEXT@
201OTOOL = @OTOOL@
202OTOOL64 = @OTOOL64@
203PACKAGE = @PACKAGE@
204PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
205PACKAGE_NAME = @PACKAGE_NAME@
206PACKAGE_STRING = @PACKAGE_STRING@
207PACKAGE_TARNAME = @PACKAGE_TARNAME@
208PACKAGE_URL = @PACKAGE_URL@
209PACKAGE_VERSION = @PACKAGE_VERSION@
210PATH_SEPARATOR = @PATH_SEPARATOR@
211PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
212PIXMAN_LIBS = @PIXMAN_LIBS@
213PKG_CONFIG = @PKG_CONFIG@
214PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
215PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
216PNG_CFLAGS = @PNG_CFLAGS@
217PNG_LIBS = @PNG_LIBS@
218RANLIB = @RANLIB@
219SDL_CFLAGS = @SDL_CFLAGS@
220SDL_LIBS = @SDL_LIBS@
221SED = @SED@
222SET_MAKE = @SET_MAKE@
223SHELL = @SHELL@
224SHM_OPEN_LINK = @SHM_OPEN_LINK@
225STRIP = @STRIP@
226SVG_CFLAGS = @SVG_CFLAGS@
227SVG_LIBS = @SVG_LIBS@
228VALGRIND_CFLAGS = @VALGRIND_CFLAGS@
229VALGRIND_LIBS = @VALGRIND_LIBS@
230VERSION = @VERSION@
231VMAJ = @VMAJ@
232WIN32_CFLAGS = @WIN32_CFLAGS@
233WIN32_CPPFLAGS = @WIN32_CPPFLAGS@
234XCB_CFLAGS = @XCB_CFLAGS@
235XCB_GL_CFLAGS = @XCB_GL_CFLAGS@
236XCB_GL_LIBS = @XCB_GL_LIBS@
237XCB_LIBS = @XCB_LIBS@
238XEXT_CFLAGS = @XEXT_CFLAGS@
239XEXT_LIBS = @XEXT_LIBS@
240XMKMF = @XMKMF@
241X_CFLAGS = @X_CFLAGS@
242X_EXTRA_LIBS = @X_EXTRA_LIBS@
243X_LIBS = @X_LIBS@
244X_PRE_LIBS = @X_PRE_LIBS@
245abs_builddir = @abs_builddir@
246abs_srcdir = @abs_srcdir@
247abs_top_builddir = @abs_top_builddir@
248abs_top_srcdir = @abs_top_srcdir@
249ac_ct_CC = @ac_ct_CC@
250ac_ct_CXX = @ac_ct_CXX@
251ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
252ac_ct_OBJC = @ac_ct_OBJC@
253altivec_cflags = @altivec_cflags@
254am__include = @am__include@
255am__leading_dot = @am__leading_dot@
256am__quote = @am__quote@
257am__tar = @am__tar@
258am__untar = @am__untar@
259bindir = @bindir@
260build = @build@
261build_alias = @build_alias@
262build_cpu = @build_cpu@
263build_os = @build_os@
264build_vendor = @build_vendor@
265builddir = @builddir@
266datadir = @datadir@
267datarootdir = @datarootdir@
268dlopen_libs = @dlopen_libs@
269docdir = @docdir@
270dvidir = @dvidir@
271edje_cc = @edje_cc@
272efl_doxygen = @efl_doxygen@
273efl_have_doxygen = @efl_have_doxygen@
274evas_engine_buffer_cflags = @evas_engine_buffer_cflags@
275evas_engine_buffer_libs = @evas_engine_buffer_libs@
276evas_engine_direct3d_cflags = @evas_engine_direct3d_cflags@
277evas_engine_direct3d_libs = @evas_engine_direct3d_libs@
278evas_engine_directfb_cflags = @evas_engine_directfb_cflags@
279evas_engine_directfb_libs = @evas_engine_directfb_libs@
280evas_engine_fb_cflags = @evas_engine_fb_cflags@
281evas_engine_fb_libs = @evas_engine_fb_libs@
282evas_engine_gl_cocoa_cflags = @evas_engine_gl_cocoa_cflags@
283evas_engine_gl_cocoa_libs = @evas_engine_gl_cocoa_libs@
284evas_engine_gl_common_libs = @evas_engine_gl_common_libs@
285evas_engine_gl_sdl_cflags = @evas_engine_gl_sdl_cflags@
286evas_engine_gl_sdl_libs = @evas_engine_gl_sdl_libs@
287evas_engine_gl_xcb_cflags = @evas_engine_gl_xcb_cflags@
288evas_engine_gl_xcb_libs = @evas_engine_gl_xcb_libs@
289evas_engine_gl_xlib_cflags = @evas_engine_gl_xlib_cflags@
290evas_engine_gl_xlib_libs = @evas_engine_gl_xlib_libs@
291evas_engine_psl1ght_cflags = @evas_engine_psl1ght_cflags@
292evas_engine_psl1ght_libs = @evas_engine_psl1ght_libs@
293evas_engine_software_16_ddraw_cflags = @evas_engine_software_16_ddraw_cflags@
294evas_engine_software_16_ddraw_libs = @evas_engine_software_16_ddraw_libs@
295evas_engine_software_16_sdl_cflags = @evas_engine_software_16_sdl_cflags@
296evas_engine_software_16_sdl_libs = @evas_engine_software_16_sdl_libs@
297evas_engine_software_16_wince_cflags = @evas_engine_software_16_wince_cflags@
298evas_engine_software_16_wince_libs = @evas_engine_software_16_wince_libs@
299evas_engine_software_16_x11_cflags = @evas_engine_software_16_x11_cflags@
300evas_engine_software_16_x11_libs = @evas_engine_software_16_x11_libs@
301evas_engine_software_8_x11_cflags = @evas_engine_software_8_x11_cflags@
302evas_engine_software_8_x11_libs = @evas_engine_software_8_x11_libs@
303evas_engine_software_ddraw_cflags = @evas_engine_software_ddraw_cflags@
304evas_engine_software_ddraw_libs = @evas_engine_software_ddraw_libs@
305evas_engine_software_gdi_cflags = @evas_engine_software_gdi_cflags@
306evas_engine_software_gdi_libs = @evas_engine_software_gdi_libs@
307evas_engine_software_sdl_cflags = @evas_engine_software_sdl_cflags@
308evas_engine_software_sdl_libs = @evas_engine_software_sdl_libs@
309evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@
310evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@
311evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@
312evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@
313evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@
314evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@
315evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@
316evas_image_loader_edb_libs = @evas_image_loader_edb_libs@
317evas_image_loader_eet_cflags = @evas_image_loader_eet_cflags@
318evas_image_loader_eet_libs = @evas_image_loader_eet_libs@
319evas_image_loader_generic_cflags = @evas_image_loader_generic_cflags@
320evas_image_loader_generic_libs = @evas_image_loader_generic_libs@
321evas_image_loader_gif_cflags = @evas_image_loader_gif_cflags@
322evas_image_loader_gif_libs = @evas_image_loader_gif_libs@
323evas_image_loader_ico_cflags = @evas_image_loader_ico_cflags@
324evas_image_loader_ico_libs = @evas_image_loader_ico_libs@
325evas_image_loader_jpeg_cflags = @evas_image_loader_jpeg_cflags@
326evas_image_loader_jpeg_libs = @evas_image_loader_jpeg_libs@
327evas_image_loader_pmaps_cflags = @evas_image_loader_pmaps_cflags@
328evas_image_loader_pmaps_libs = @evas_image_loader_pmaps_libs@
329evas_image_loader_png_cflags = @evas_image_loader_png_cflags@
330evas_image_loader_png_libs = @evas_image_loader_png_libs@
331evas_image_loader_psd_cflags = @evas_image_loader_psd_cflags@
332evas_image_loader_psd_libs = @evas_image_loader_psd_libs@
333evas_image_loader_svg_cflags = @evas_image_loader_svg_cflags@
334evas_image_loader_svg_libs = @evas_image_loader_svg_libs@
335evas_image_loader_tga_cflags = @evas_image_loader_tga_cflags@
336evas_image_loader_tga_libs = @evas_image_loader_tga_libs@
337evas_image_loader_tiff_cflags = @evas_image_loader_tiff_cflags@
338evas_image_loader_tiff_libs = @evas_image_loader_tiff_libs@
339evas_image_loader_wbmp_cflags = @evas_image_loader_wbmp_cflags@
340evas_image_loader_wbmp_libs = @evas_image_loader_wbmp_libs@
341evas_image_loader_xpm_cflags = @evas_image_loader_xpm_cflags@
342evas_image_loader_xpm_libs = @evas_image_loader_xpm_libs@
343exec_prefix = @exec_prefix@
344have_evas_engine_gl_x11 = @have_evas_engine_gl_x11@
345have_evas_engine_gl_xcb = @have_evas_engine_gl_xcb@
346have_evas_engine_gl_xlib = @have_evas_engine_gl_xlib@
347have_evas_engine_software_x11 = @have_evas_engine_software_x11@
348have_evas_engine_software_xcb = @have_evas_engine_software_xcb@
349have_evas_engine_software_xlib = @have_evas_engine_software_xlib@
350have_lcov = @have_lcov@
351host = @host@
352host_alias = @host_alias@
353host_cpu = @host_cpu@
354host_os = @host_os@
355host_vendor = @host_vendor@
356htmldir = @htmldir@
357includedir = @includedir@
358infodir = @infodir@
359install_sh = @install_sh@
360libdir = @libdir@
361libexecdir = @libexecdir@
362localedir = @localedir@
363localstatedir = @localstatedir@
364lt_ECHO = @lt_ECHO@
365lt_enable_auto_import = @lt_enable_auto_import@
366mandir = @mandir@
367mkdir_p = @mkdir_p@
368oldincludedir = @oldincludedir@
369pdfdir = @pdfdir@
370pkgconfig_requires_private = @pkgconfig_requires_private@
371prefix = @prefix@
372program_transform_name = @program_transform_name@
373psdir = @psdir@
374pthread_cflags = @pthread_cflags@
375pthread_libs = @pthread_libs@
376release_info = @release_info@
377requirement_evas = @requirement_evas@
378sbindir = @sbindir@
379sharedstatedir = @sharedstatedir@
380srcdir = @srcdir@
381sysconfdir = @sysconfdir@
382target_alias = @target_alias@
383top_build_prefix = @top_build_prefix@
384top_builddir = @top_builddir@
385top_srcdir = @top_srcdir@
386version_info = @version_info@
387MAINTAINERCLEANFILES = Makefile.in
388AM_CPPFLAGS = -I. -I$(top_srcdir)/src/lib \
389 -I$(top_srcdir)/src/lib/include -I$(top_srcdir)/src/lib/cserve \
390 -DPACKAGE_BIN_DIR=\"$(bindir)\" \
391 -DPACKAGE_LIB_DIR=\"$(libdir)\" \
392 -DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" @WIN32_CPPFLAGS@ \
393 @FREETYPE_CFLAGS@ @EET_CFLAGS@ @FONTCONFIG_CFLAGS@ \
394 @EVAS_CFLAGS@ @EINA_CFLAGS@ @EVIL_CFLAGS@ @PIXMAN_CFLAGS@ \
395 $(am__append_1)
396noinst_LTLIBRARIES = libevas_canvas.la
397libevas_canvas_la_SOURCES = \
398evas_callbacks.c \
399evas_clip.c \
400evas_data.c \
401evas_events.c \
402evas_filter.c \
403evas_focus.c \
404evas_key.c \
405evas_key_grab.c \
406evas_layer.c \
407evas_main.c \
408evas_name.c \
409evas_object_image.c \
410evas_object_main.c \
411evas_object_inform.c \
412evas_object_intercept.c \
413evas_object_line.c \
414evas_object_polygon.c \
415evas_object_rectangle.c \
416evas_object_smart.c \
417evas_object_smart_clipped.c \
418evas_object_box.c \
419evas_object_table.c \
420evas_object_text.c \
421evas_object_textblock.c \
422evas_object_grid.c \
423evas_font_dir.c \
424evas_rectangle.c \
425evas_render.c \
426evas_smart.c \
427evas_stack.c \
428evas_async_events.c \
429evas_stats.c \
430evas_touch_point.c \
431evas_map.c \
432evas_gl.c
433
434
435#evas_object_textgrid.c
436libevas_canvas_la_LIBADD = @EVAS_LIBS@ @EVIL_LIBS@ $(am__append_2)
437all: all-am
438
439.SUFFIXES:
440.SUFFIXES: .c .lo .o .obj
441$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
442 @for dep in $?; do \
443 case '$(am__configure_deps)' in \
444 *$$dep*) \
445 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
446 && { if test -f $@; then exit 0; else break; fi; }; \
447 exit 1;; \
448 esac; \
449 done; \
450 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/canvas/Makefile'; \
451 $(am__cd) $(top_srcdir) && \
452 $(AUTOMAKE) --gnu src/lib/canvas/Makefile
453.PRECIOUS: Makefile
454Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
455 @case '$?' in \
456 *config.status*) \
457 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
458 *) \
459 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
460 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
461 esac;
462
463$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
464 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
465
466$(top_srcdir)/configure: $(am__configure_deps)
467 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
468$(ACLOCAL_M4): $(am__aclocal_m4_deps)
469 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
470$(am__aclocal_m4_deps):
471
472clean-noinstLTLIBRARIES:
473 -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
474 @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
475 dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
476 test "$$dir" != "$$p" || dir=.; \
477 echo "rm -f \"$${dir}/so_locations\""; \
478 rm -f "$${dir}/so_locations"; \
479 done
480libevas_canvas.la: $(libevas_canvas_la_OBJECTS) $(libevas_canvas_la_DEPENDENCIES)
481 $(AM_V_CCLD)$(LINK) $(libevas_canvas_la_OBJECTS) $(libevas_canvas_la_LIBADD) $(LIBS)
482
483mostlyclean-compile:
484 -rm -f *.$(OBJEXT)
485
486distclean-compile:
487 -rm -f *.tab.c
488
489@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_async_events.Plo@am__quote@
490@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_callbacks.Plo@am__quote@
491@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_clip.Plo@am__quote@
492@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_data.Plo@am__quote@
493@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_events.Plo@am__quote@
494@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_filter.Plo@am__quote@
495@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_focus.Plo@am__quote@
496@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_font_dir.Plo@am__quote@
497@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_gl.Plo@am__quote@
498@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_key.Plo@am__quote@
499@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_key_grab.Plo@am__quote@
500@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_layer.Plo@am__quote@
501@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_main.Plo@am__quote@
502@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_map.Plo@am__quote@
503@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_name.Plo@am__quote@
504@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_object_box.Plo@am__quote@
505@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_object_grid.Plo@am__quote@
506@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_object_image.Plo@am__quote@
507@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_object_inform.Plo@am__quote@
508@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_object_intercept.Plo@am__quote@
509@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_object_line.Plo@am__quote@
510@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_object_main.Plo@am__quote@
511@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_object_polygon.Plo@am__quote@
512@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_object_rectangle.Plo@am__quote@
513@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_object_smart.Plo@am__quote@
514@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_object_smart_clipped.Plo@am__quote@
515@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_object_table.Plo@am__quote@
516@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_object_text.Plo@am__quote@
517@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_object_textblock.Plo@am__quote@
518@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_rectangle.Plo@am__quote@
519@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_render.Plo@am__quote@
520@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_smart.Plo@am__quote@
521@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_stack.Plo@am__quote@
522@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_stats.Plo@am__quote@
523@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_touch_point.Plo@am__quote@
524
525.c.o:
526@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
527@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
528@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
529@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
530@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
531@am__fastdepCC_FALSE@ $(COMPILE) -c $<
532
533.c.obj:
534@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
535@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
536@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
537@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
538@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
539@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
540
541.c.lo:
542@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
543@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
544@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
545@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
546@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
547@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
548
549mostlyclean-libtool:
550 -rm -f *.lo
551
552clean-libtool:
553 -rm -rf .libs _libs
554
555ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
556 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
557 unique=`for i in $$list; do \
558 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
559 done | \
560 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
561 END { if (nonempty) { for (i in files) print i; }; }'`; \
562 mkid -fID $$unique
563tags: TAGS
564
565TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
566 $(TAGS_FILES) $(LISP)
567 set x; \
568 here=`pwd`; \
569 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
570 unique=`for i in $$list; do \
571 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
572 done | \
573 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
574 END { if (nonempty) { for (i in files) print i; }; }'`; \
575 shift; \
576 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
577 test -n "$$unique" || unique=$$empty_fix; \
578 if test $$# -gt 0; then \
579 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
580 "$$@" $$unique; \
581 else \
582 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
583 $$unique; \
584 fi; \
585 fi
586ctags: CTAGS
587CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
588 $(TAGS_FILES) $(LISP)
589 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
590 unique=`for i in $$list; do \
591 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
592 done | \
593 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
594 END { if (nonempty) { for (i in files) print i; }; }'`; \
595 test -z "$(CTAGS_ARGS)$$unique" \
596 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
597 $$unique
598
599GTAGS:
600 here=`$(am__cd) $(top_builddir) && pwd` \
601 && $(am__cd) $(top_srcdir) \
602 && gtags -i $(GTAGS_ARGS) "$$here"
603
604distclean-tags:
605 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
606
607distdir: $(DISTFILES)
608 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
609 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
610 list='$(DISTFILES)'; \
611 dist_files=`for file in $$list; do echo $$file; done | \
612 sed -e "s|^$$srcdirstrip/||;t" \
613 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
614 case $$dist_files in \
615 */*) $(MKDIR_P) `echo "$$dist_files" | \
616 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
617 sort -u` ;; \
618 esac; \
619 for file in $$dist_files; do \
620 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
621 if test -d $$d/$$file; then \
622 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
623 if test -d "$(distdir)/$$file"; then \
624 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
625 fi; \
626 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
627 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
628 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
629 fi; \
630 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
631 else \
632 test -f "$(distdir)/$$file" \
633 || cp -p $$d/$$file "$(distdir)/$$file" \
634 || exit 1; \
635 fi; \
636 done
637check-am: all-am
638check: check-am
639all-am: Makefile $(LTLIBRARIES)
640installdirs:
641install: install-am
642install-exec: install-exec-am
643install-data: install-data-am
644uninstall: uninstall-am
645
646install-am: all-am
647 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
648
649installcheck: installcheck-am
650install-strip:
651 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
652 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
653 `test -z '$(STRIP)' || \
654 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
655mostlyclean-generic:
656
657clean-generic:
658
659distclean-generic:
660 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
661 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
662
663maintainer-clean-generic:
664 @echo "This command is intended for maintainers to use"
665 @echo "it deletes files that may require special tools to rebuild."
666 -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
667clean: clean-am
668
669clean-am: clean-generic clean-libtool clean-local \
670 clean-noinstLTLIBRARIES mostlyclean-am
671
672distclean: distclean-am
673 -rm -rf ./$(DEPDIR)
674 -rm -f Makefile
675distclean-am: clean-am distclean-compile distclean-generic \
676 distclean-tags
677
678dvi: dvi-am
679
680dvi-am:
681
682html: html-am
683
684html-am:
685
686info: info-am
687
688info-am:
689
690install-data-am:
691
692install-dvi: install-dvi-am
693
694install-dvi-am:
695
696install-exec-am:
697
698install-html: install-html-am
699
700install-html-am:
701
702install-info: install-info-am
703
704install-info-am:
705
706install-man:
707
708install-pdf: install-pdf-am
709
710install-pdf-am:
711
712install-ps: install-ps-am
713
714install-ps-am:
715
716installcheck-am:
717
718maintainer-clean: maintainer-clean-am
719 -rm -rf ./$(DEPDIR)
720 -rm -f Makefile
721maintainer-clean-am: distclean-am maintainer-clean-generic
722
723mostlyclean: mostlyclean-am
724
725mostlyclean-am: mostlyclean-compile mostlyclean-generic \
726 mostlyclean-libtool
727
728pdf: pdf-am
729
730pdf-am:
731
732ps: ps-am
733
734ps-am:
735
736uninstall-am:
737
738.MAKE: install-am install-strip
739
740.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
741 clean-libtool clean-local clean-noinstLTLIBRARIES ctags \
742 distclean distclean-compile distclean-generic \
743 distclean-libtool distclean-tags distdir dvi dvi-am html \
744 html-am info info-am install install-am install-data \
745 install-data-am install-dvi install-dvi-am install-exec \
746 install-exec-am install-html install-html-am install-info \
747 install-info-am install-man install-pdf install-pdf-am \
748 install-ps install-ps-am install-strip installcheck \
749 installcheck-am installdirs maintainer-clean \
750 maintainer-clean-generic mostlyclean mostlyclean-compile \
751 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
752 tags uninstall uninstall-am
753
754
755clean-local:
756 rm -rf *.gcno
757
758# Tell versions [3.59,3.63) of GNU make to not export all variables.
759# Otherwise a system limit (for SysV at least) may be exceeded.
760.NOEXPORT:
diff --git a/libraries/evas/src/lib/canvas/evas_async_events.c b/libraries/evas/src/lib/canvas/evas_async_events.c
new file mode 100644
index 0000000..bd2e3a8
--- /dev/null
+++ b/libraries/evas/src/lib/canvas/evas_async_events.c
@@ -0,0 +1,173 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#ifdef BUILD_ASYNC_EVENTS
6
7# ifndef _MSC_VER
8# include <unistd.h>
9# endif
10# include <fcntl.h>
11# include <errno.h>
12
13#endif
14
15#include "evas_common.h"
16#include "evas_private.h"
17
18#ifdef BUILD_ASYNC_EVENTS
19
20static int _fd_write = -1;
21static int _fd_read = -1;
22
23static int _init_evas_event = 0;
24
25typedef struct _Evas_Event_Async Evas_Event_Async;
26
27struct _Evas_Event_Async
28{
29 const void *target;
30 void *event_info;
31 Evas_Async_Events_Put_Cb func;
32 Evas_Callback_Type type;
33};
34
35int
36evas_async_events_init(void)
37{
38 int filedes[2];
39
40 _init_evas_event++;
41 if (_init_evas_event > 1) return _init_evas_event;
42
43 if (pipe(filedes) == -1)
44 {
45 _init_evas_event = 0;
46 return 0;
47 }
48
49 _fd_read = filedes[0];
50 _fd_write = filedes[1];
51
52 fcntl(_fd_read, F_SETFL, O_NONBLOCK);
53
54 return _init_evas_event;
55}
56
57int
58evas_async_events_shutdown(void)
59{
60 _init_evas_event--;
61 if (_init_evas_event > 0) return _init_evas_event;
62
63 close(_fd_read);
64 close(_fd_write);
65 _fd_read = -1;
66 _fd_write = -1;
67
68 return _init_evas_event;
69}
70
71#endif
72
73EAPI int
74evas_async_events_fd_get(void)
75{
76#ifdef BUILD_ASYNC_EVENTS
77 return _fd_read;
78#else
79 return -1;
80#endif
81}
82
83EAPI int
84evas_async_events_process(void)
85{
86#ifdef BUILD_ASYNC_EVENTS
87 Evas_Event_Async *ev;
88 int check;
89 int count = 0;
90
91 if (_fd_read == -1) return 0;
92
93 do
94 {
95 check = read(_fd_read, &ev, sizeof (Evas_Event_Async *));
96
97 if (check == sizeof (Evas_Event_Async *))
98 {
99 if (ev->func) ev->func((void *)ev->target, ev->type, ev->event_info);
100 free(ev);
101 count++;
102 }
103 }
104 while (check > 0);
105
106 evas_cache_image_wakeup();
107
108 if (check < 0)
109 {
110 switch (errno)
111 {
112 case EBADF:
113 case EINVAL:
114 case EIO:
115 case EISDIR:
116 _fd_read = -1;
117 }
118 }
119
120 return count;
121#else
122 return 0;
123#endif
124}
125
126EAPI Eina_Bool
127evas_async_events_put(const void *target, Evas_Callback_Type type, void *event_info, Evas_Async_Events_Put_Cb func)
128{
129#ifdef BUILD_ASYNC_EVENTS
130 Evas_Event_Async *ev;
131 ssize_t check;
132 Eina_Bool result = EINA_FALSE;
133
134 if (!func) return 0;
135 if (_fd_write == -1) return 0;
136
137 ev = calloc(1, sizeof (Evas_Event_Async));
138 if (!ev) return 0;
139
140 ev->func = func;
141 ev->target = target;
142 ev->type = type;
143 ev->event_info = event_info;
144
145 do
146 {
147 check = write(_fd_write, &ev, sizeof (Evas_Event_Async*));
148 }
149 while ((check != sizeof (Evas_Event_Async*)) &&
150 ((errno == EINTR) || (errno == EAGAIN)));
151
152 evas_cache_image_wakeup();
153
154 if (check == sizeof (Evas_Event_Async*))
155 result = EINA_TRUE;
156 else
157 {
158 switch (errno)
159 {
160 case EBADF:
161 case EINVAL:
162 case EIO:
163 case EPIPE:
164 _fd_write = -1;
165 }
166 }
167
168 return result;
169#else
170 func((void*) target, type, event_info);
171 return EINA_TRUE;
172#endif
173}
diff --git a/libraries/evas/src/lib/canvas/evas_callbacks.c b/libraries/evas/src/lib/canvas/evas_callbacks.c
new file mode 100644
index 0000000..33b93bc
--- /dev/null
+++ b/libraries/evas/src/lib/canvas/evas_callbacks.c
@@ -0,0 +1,534 @@
1#include "evas_common.h"
2#include "evas_private.h"
3
4static void evas_object_event_callback_clear(Evas_Object *obj);
5static void evas_event_callback_clear(Evas *e);
6int _evas_event_counter = 0;
7
8EVAS_MEMPOOL(_mp_fn);
9EVAS_MEMPOOL(_mp_cb);
10EVAS_MEMPOOL(_mp_pc);
11
12void
13_evas_post_event_callback_call(Evas *e)
14{
15 Evas_Post_Callback *pc;
16 int skip = 0;
17
18 if (e->delete_me) return;
19 _evas_walk(e);
20 EINA_LIST_FREE(e->post_events, pc)
21 {
22 if ((!skip) && (!e->delete_me) && (!pc->delete_me))
23 {
24 if (!pc->func((void*)pc->data, e)) skip = 1;
25 }
26 EVAS_MEMPOOL_FREE(_mp_pc, pc);
27 }
28 _evas_unwalk(e);
29}
30
31void
32_evas_post_event_callback_free(Evas *e)
33{
34 Evas_Post_Callback *pc;
35
36 EINA_LIST_FREE(e->post_events, pc)
37 {
38 EVAS_MEMPOOL_FREE(_mp_pc, pc);
39 }
40 _evas_unwalk(e);
41}
42
43void
44evas_event_callback_list_post_free(Eina_Inlist **list)
45{
46 Eina_Inlist *l;
47
48 /* MEM OK */
49 for (l = *list; l;)
50 {
51 Evas_Func_Node *fn;
52
53 fn = (Evas_Func_Node *)l;
54 l = l->next;
55 if (fn->delete_me)
56 {
57 *list = eina_inlist_remove(*list, EINA_INLIST_GET(fn));
58 EVAS_MEMPOOL_FREE(_mp_fn, fn);
59 }
60 }
61}
62
63static void
64evas_object_event_callback_clear(Evas_Object *obj)
65{
66 if (!obj->callbacks) return;
67 if (!obj->callbacks->deletions_waiting) return;
68 obj->callbacks->deletions_waiting = 0;
69 evas_event_callback_list_post_free(&obj->callbacks->callbacks);
70 if (!obj->callbacks->callbacks)
71 {
72 EVAS_MEMPOOL_FREE(_mp_cb, obj->callbacks);
73 obj->callbacks = NULL;
74 }
75}
76
77static void
78evas_event_callback_clear(Evas *e)
79{
80 if (!e->callbacks) return;
81 if (!e->callbacks->deletions_waiting) return;
82 e->callbacks->deletions_waiting = 0;
83 evas_event_callback_list_post_free(&e->callbacks->callbacks);
84 if (!e->callbacks->callbacks)
85 {
86 EVAS_MEMPOOL_FREE(_mp_cb, e->callbacks);
87 e->callbacks = NULL;
88 }
89}
90
91void
92evas_object_event_callback_all_del(Evas_Object *obj)
93{
94 Evas_Func_Node *fn;
95
96 if (!obj->callbacks) return;
97 EINA_INLIST_FOREACH(obj->callbacks->callbacks, fn)
98 fn->delete_me = 1;
99}
100
101void
102evas_object_event_callback_cleanup(Evas_Object *obj)
103{
104 /* MEM OK */
105 if (!obj->callbacks) return;
106 evas_event_callback_list_post_free(&obj->callbacks->callbacks);
107 EVAS_MEMPOOL_FREE(_mp_cb, obj->callbacks);
108 obj->callbacks = NULL;
109}
110
111void
112evas_event_callback_all_del(Evas *e)
113{
114 Evas_Func_Node *fn;
115
116 if (!e->callbacks) return;
117 EINA_INLIST_FOREACH(e->callbacks->callbacks, fn)
118 fn->delete_me = 1;
119}
120
121void
122evas_event_callback_cleanup(Evas *e)
123{
124 /* MEM OK */
125 if (!e->callbacks) return;
126 evas_event_callback_list_post_free(&e->callbacks->callbacks);
127 EVAS_MEMPOOL_FREE(_mp_cb, e->callbacks);
128 e->callbacks = NULL;
129}
130
131void
132evas_event_callback_call(Evas *e, Evas_Callback_Type type, void *event_info)
133{
134 Eina_Inlist **l_mod = NULL, *l;
135
136 _evas_walk(e);
137 if (e->callbacks)
138 {
139 l_mod = &e->callbacks->callbacks;
140 e->callbacks->walking_list++;
141 for (l = *l_mod; l; l = l->next)
142 {
143 Evas_Func_Node *fn;
144
145 fn = (Evas_Func_Node *)l;
146 if ((fn->type == type) && (!fn->delete_me))
147 {
148 Evas_Event_Cb func = fn->func;
149 if (func)
150 func(fn->data, e, event_info);
151 }
152 if (e->delete_me) break;
153 }
154 e->callbacks->walking_list--;
155 if (!e->callbacks->walking_list)
156 {
157 evas_event_callback_clear(e);
158 l_mod = NULL;
159 }
160 }
161 _evas_unwalk(e);
162}
163
164void
165evas_object_event_callback_call(Evas_Object *obj, Evas_Callback_Type type, void *event_info)
166{
167 /* MEM OK */
168 Eina_Inlist **l_mod = NULL, *l;
169 Evas_Button_Flags flags = EVAS_BUTTON_NONE;
170 Evas *e;
171
172 if ((obj->delete_me) || (!obj->layer)) return;
173 if ((obj->last_event == _evas_event_counter) &&
174 (obj->last_event_type == type)) return;
175 obj->last_event = _evas_event_counter;
176 obj->last_event_type = type;
177 if (!(e = obj->layer->evas)) return;
178
179 _evas_walk(e);
180 if (obj->callbacks)
181 {
182 l_mod = &obj->callbacks->callbacks;
183 switch (type)
184 {
185 case EVAS_CALLBACK_MOUSE_DOWN:
186 {
187 Evas_Event_Mouse_Down *ev = event_info;
188
189 flags = ev->flags;
190 if (ev->flags & (EVAS_BUTTON_DOUBLE_CLICK | EVAS_BUTTON_TRIPLE_CLICK))
191 {
192 if (obj->last_mouse_down_counter < (e->last_mouse_down_counter - 1))
193 ev->flags &= ~(EVAS_BUTTON_DOUBLE_CLICK | EVAS_BUTTON_TRIPLE_CLICK);
194 }
195 obj->last_mouse_down_counter = e->last_mouse_down_counter;
196 break;
197 }
198 case EVAS_CALLBACK_MOUSE_UP:
199 {
200 Evas_Event_Mouse_Up *ev = event_info;
201
202 flags = ev->flags;
203 if (ev->flags & (EVAS_BUTTON_DOUBLE_CLICK | EVAS_BUTTON_TRIPLE_CLICK))
204 {
205 if (obj->last_mouse_up_counter < (e->last_mouse_up_counter - 1))
206 ev->flags &= ~(EVAS_BUTTON_DOUBLE_CLICK | EVAS_BUTTON_TRIPLE_CLICK);
207 }
208 obj->last_mouse_up_counter = e->last_mouse_up_counter;
209 break;
210 }
211 default:
212 break;
213 }
214 obj->callbacks->walking_list++;
215 for (l = *l_mod; l; l = l->next)
216 {
217 Evas_Func_Node *fn;
218
219 fn = (Evas_Func_Node *)l;
220 if ((fn->type == type) && (!fn->delete_me))
221 {
222 Evas_Object_Event_Cb func = fn->func;
223 if (func)
224 func(fn->data, obj->layer->evas, obj, event_info);
225 }
226 if (obj->delete_me) break;
227 }
228 obj->callbacks->walking_list--;
229 if (!obj->callbacks->walking_list)
230 {
231 evas_object_event_callback_clear(obj);
232 l_mod = NULL;
233 }
234
235 if (type == EVAS_CALLBACK_MOUSE_DOWN)
236 {
237 Evas_Event_Mouse_Down *ev = event_info;
238 ev->flags = flags;
239 }
240 else if (type == EVAS_CALLBACK_MOUSE_UP)
241 {
242 Evas_Event_Mouse_Up *ev = event_info;
243 ev->flags = flags;
244 }
245 }
246
247 if (!((obj->no_propagate) && (l_mod) && (*l_mod)))
248 {
249 if (!obj->no_propagate)
250 {
251 if ((obj->smart.parent) && (type != EVAS_CALLBACK_FREE) &&
252 (type <= EVAS_CALLBACK_KEY_UP))
253 evas_object_event_callback_call(obj->smart.parent, type, event_info);
254 }
255 }
256 _evas_unwalk(e);
257}
258
259static int
260_callback_priority_cmp(const void *_a, const void *_b)
261{
262 const Evas_Func_Node *a, *b;
263 a = EINA_INLIST_CONTAINER_GET(_a, Evas_Func_Node);
264 b = EINA_INLIST_CONTAINER_GET(_b, Evas_Func_Node);
265 if (a->priority < b->priority)
266 return -1;
267 else
268 return 1;
269}
270
271EAPI void
272evas_object_event_callback_add(Evas_Object *obj, Evas_Callback_Type type, Evas_Object_Event_Cb func, const void *data)
273{
274 evas_object_event_callback_priority_add(obj, type,
275 EVAS_CALLBACK_PRIORITY_DEFAULT, func, data);
276}
277
278EAPI void
279evas_object_event_callback_priority_add(Evas_Object *obj, Evas_Callback_Type type, Evas_Callback_Priority priority, Evas_Object_Event_Cb func, const void *data)
280{
281 /* MEM OK */
282 Evas_Func_Node *fn;
283
284 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
285 return;
286 MAGIC_CHECK_END();
287
288 if (!func) return;
289
290 if (!obj->callbacks)
291 {
292 EVAS_MEMPOOL_INIT(_mp_cb, "evas_callbacks", Evas_Callbacks, 512, );
293 obj->callbacks = EVAS_MEMPOOL_ALLOC(_mp_cb, Evas_Callbacks);
294 if (!obj->callbacks) return;
295 EVAS_MEMPOOL_PREP(_mp_cb, obj->callbacks, Evas_Callbacks);
296 }
297
298 EVAS_MEMPOOL_INIT(_mp_fn, "evas_func_node", Evas_Func_Node, 2048, );
299 fn = EVAS_MEMPOOL_ALLOC(_mp_fn, Evas_Func_Node);
300 if (!fn) return;
301 EVAS_MEMPOOL_PREP(_mp_fn, fn, Evas_Func_Node);
302 fn->func = func;
303 fn->data = (void *)data;
304 fn->type = type;
305 fn->priority = priority;
306
307 obj->callbacks->callbacks =
308 eina_inlist_sorted_insert(obj->callbacks->callbacks, EINA_INLIST_GET(fn),
309 _callback_priority_cmp);
310}
311
312EAPI void *
313evas_object_event_callback_del(Evas_Object *obj, Evas_Callback_Type type, Evas_Object_Event_Cb func)
314{
315 /* MEM OK */
316 Evas_Func_Node *fn;
317
318 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
319 return NULL;
320 MAGIC_CHECK_END();
321
322 if (!func) return NULL;
323
324 if (!obj->callbacks) return NULL;
325
326 EINA_INLIST_FOREACH(obj->callbacks->callbacks, fn)
327 {
328 if ((fn->func == func) && (fn->type == type) && (!fn->delete_me))
329 {
330 void *tmp;
331
332 tmp = fn->data;
333 fn->delete_me = 1;
334 obj->callbacks->deletions_waiting = 1;
335 if (!obj->callbacks->walking_list)
336 evas_object_event_callback_clear(obj);
337 return tmp;
338 }
339 }
340 return NULL;
341}
342
343EAPI void *
344evas_object_event_callback_del_full(Evas_Object *obj, Evas_Callback_Type type, Evas_Object_Event_Cb func, const void *data)
345{
346 /* MEM OK */
347 Evas_Func_Node *fn;
348
349 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
350 return NULL;
351 MAGIC_CHECK_END();
352
353 if (!func) return NULL;
354
355 if (!obj->callbacks) return NULL;
356
357 EINA_INLIST_FOREACH(obj->callbacks->callbacks, fn)
358 {
359 if ((fn->func == func) && (fn->type == type) && (fn->data == data) && (!fn->delete_me))
360 {
361 void *tmp;
362
363 tmp = fn->data;
364 fn->delete_me = 1;
365 obj->callbacks->deletions_waiting = 1;
366 if (!obj->callbacks->walking_list)
367 evas_object_event_callback_clear(obj);
368 return tmp;
369 }
370 }
371 return NULL;
372}
373
374EAPI void
375evas_event_callback_add(Evas *e, Evas_Callback_Type type, Evas_Event_Cb func, const void *data)
376{
377 evas_event_callback_priority_add(e, type, EVAS_CALLBACK_PRIORITY_DEFAULT,
378 func, data);
379}
380
381EAPI void
382evas_event_callback_priority_add(Evas *e, Evas_Callback_Type type, Evas_Callback_Priority priority, Evas_Event_Cb func, const void *data)
383{
384 /* MEM OK */
385 Evas_Func_Node *fn;
386
387 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
388 return;
389 MAGIC_CHECK_END();
390
391 if (!func) return;
392
393 if (!e->callbacks)
394 {
395 EVAS_MEMPOOL_INIT(_mp_cb, "evas_callbacks", Evas_Callbacks, 512, );
396 e->callbacks = EVAS_MEMPOOL_ALLOC(_mp_cb, Evas_Callbacks);
397 if (!e->callbacks) return;
398 EVAS_MEMPOOL_PREP(_mp_cb, e->callbacks, Evas_Callbacks);
399 }
400
401 EVAS_MEMPOOL_INIT(_mp_fn, "evas_func_node", Evas_Func_Node, 2048, );
402 fn = EVAS_MEMPOOL_ALLOC(_mp_fn, Evas_Func_Node);
403 if (!fn) return;
404 EVAS_MEMPOOL_PREP(_mp_fn, fn, Evas_Func_Node);
405 fn->func = func;
406 fn->data = (void *)data;
407 fn->type = type;
408 fn->priority = priority;
409
410 e->callbacks->callbacks = eina_inlist_sorted_insert(e->callbacks->callbacks,
411 EINA_INLIST_GET(fn), _callback_priority_cmp);
412}
413
414EAPI void *
415evas_event_callback_del(Evas *e, Evas_Callback_Type type, Evas_Event_Cb func)
416{
417 /* MEM OK */
418 Evas_Func_Node *fn;
419
420 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
421 return NULL;
422 MAGIC_CHECK_END();
423
424 if (!func) return NULL;
425
426 if (!e->callbacks) return NULL;
427
428 EINA_INLIST_FOREACH(e->callbacks->callbacks, fn)
429 {
430 if ((fn->func == func) && (fn->type == type) && (!fn->delete_me))
431 {
432 void *data;
433
434 data = fn->data;
435 fn->delete_me = 1;
436 e->callbacks->deletions_waiting = 1;
437 if (!e->callbacks->walking_list)
438 evas_event_callback_clear(e);
439 return data;
440 }
441 }
442 return NULL;
443}
444
445EAPI void *
446evas_event_callback_del_full(Evas *e, Evas_Callback_Type type, Evas_Event_Cb func, const void *data)
447{
448 /* MEM OK */
449 Evas_Func_Node *fn;
450
451 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
452 return NULL;
453 MAGIC_CHECK_END();
454
455 if (!func) return NULL;
456
457 if (!e->callbacks) return NULL;
458
459 EINA_INLIST_FOREACH(e->callbacks->callbacks, fn)
460 {
461 if ((fn->func == func) && (fn->type == type) && (fn->data == data) && (!fn->delete_me))
462 {
463 void *tmp;
464
465 tmp = fn->data;
466 fn->delete_me = 1;
467 e->callbacks->deletions_waiting = 1;
468 if (!e->callbacks->walking_list)
469 evas_event_callback_clear(e);
470 return tmp;
471 }
472 }
473 return NULL;
474}
475
476EAPI void
477evas_post_event_callback_push(Evas *e, Evas_Object_Event_Post_Cb func, const void *data)
478{
479 Evas_Post_Callback *pc;
480
481 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
482 return;
483 MAGIC_CHECK_END();
484
485 EVAS_MEMPOOL_INIT(_mp_pc, "evas_post_callback", Evas_Post_Callback, 64, );
486 pc = EVAS_MEMPOOL_ALLOC(_mp_pc, Evas_Post_Callback);
487 if (!pc) return;
488 EVAS_MEMPOOL_PREP(_mp_pc, pc, Evas_Post_Callback);
489 if (e->delete_me) return;
490
491 pc->func = func;
492 pc->data = data;
493 e->post_events = eina_list_prepend(e->post_events, pc);
494}
495
496EAPI void
497evas_post_event_callback_remove(Evas *e, Evas_Object_Event_Post_Cb func)
498{
499 Evas_Post_Callback *pc;
500 Eina_List *l;
501
502 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
503 return;
504 MAGIC_CHECK_END();
505
506 EINA_LIST_FOREACH(e->post_events, l, pc)
507 {
508 if (pc->func == func)
509 {
510 pc->delete_me = 1;
511 return;
512 }
513 }
514}
515
516EAPI void
517evas_post_event_callback_remove_full(Evas *e, Evas_Object_Event_Post_Cb func, const void *data)
518{
519 Evas_Post_Callback *pc;
520 Eina_List *l;
521
522 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
523 return;
524 MAGIC_CHECK_END();
525
526 EINA_LIST_FOREACH(e->post_events, l, pc)
527 {
528 if ((pc->func == func) && (pc->data == data))
529 {
530 pc->delete_me = 1;
531 return;
532 }
533 }
534}
diff --git a/libraries/evas/src/lib/canvas/evas_clip.c b/libraries/evas/src/lib/canvas/evas_clip.c
new file mode 100644
index 0000000..1ae2f73
--- /dev/null
+++ b/libraries/evas/src/lib/canvas/evas_clip.c
@@ -0,0 +1,321 @@
1#include "evas_common.h"
2#include "evas_private.h"
3
4void
5evas_object_clip_dirty(Evas_Object *obj)
6{
7 Eina_List *l;
8 Evas_Object *data;
9
10 if (obj->cur.cache.clip.dirty) return ;
11
12 obj->cur.cache.clip.dirty = 1;
13 EINA_LIST_FOREACH(obj->clip.clipees, l, data)
14 evas_object_clip_dirty(data);
15}
16
17void
18evas_object_recalc_clippees(Evas_Object *obj)
19{
20 Eina_List *l;
21 Evas_Object *data;
22
23 if (obj->cur.cache.clip.dirty)
24 {
25 evas_object_clip_recalc(obj);
26 EINA_LIST_FOREACH(obj->clip.clipees, l, data)
27 evas_object_recalc_clippees(data);
28 }
29}
30
31int
32evas_object_clippers_was_visible(Evas_Object *obj)
33{
34 if (obj->prev.visible)
35 {
36 if (obj->prev.clipper)
37 return evas_object_clippers_is_visible(obj->prev.clipper);
38 return 1;
39 }
40 return 0;
41}
42
43/* aaaaargh (pirate voice) ... notes!
44 *
45 * we have a big problem until now that's gone undetected... until yesterday.
46 * that problem involves clips and maps and smart objects. hooray! 3 of the
47 * more complex bits of evas - and maps and smart objects being one of the
48 * nastiest ones.
49 *
50 * what is the problem? when a clip crosses a map boundary. that is to say
51 * that when the clipper and clippee are not within the child tree of the
52 * mapped object. in this case "bad stuff" happens. basically as clips are
53 * then used to render objects, but they no longer apply as you'd expect as
54 * the map transfomr the objects to-be-clipped separately from the objects
55 * that clip them and this whole relationship is broken by maps. it somehow
56 * managed to not break with the advent of smart objects. lucky me... but
57 * maps killed it. now... what do we do? that is a good question. detect
58 * such a broken link and "turn off clipping" in that event - sure. but this
59 * isn't going to be cheap as ANY addition or deletion of a map to an object
60 * or any change in clipper of an object or any change in smart object
61 * membership needs to walk the obj tree both up and down from the changed
62 * object and probably walk entire object trees to find these and mark them.
63 * thats silly-expensive and i was about to fix it that way but it has since
64 * dawned on me that that is just going to kill performance in some critical
65 * areas like during object setup and manipulation, as well as teardown.
66 *
67 * aaaaagh! best for now is to document this as a "don't do it damnit!" thing
68 * and have the apps avoid it. but even then - how to do this? this is not
69 * easy. everywhere i turn so far i come up to either expensive operations,
70 * breaks in logic, or nasty re-work of apps or4 the whole concept of clipping,
71 * smart objects and maps... and that will have to wait for evas 2.0
72 *
73 * the below does clip fixups etc. in the even a clip spans a map boundary.
74 * not pretty, but necessary.
75 */
76
77#define MAP_ACROSS 1
78static void
79evas_object_child_map_across_mark(Evas_Object *obj, Evas_Object *map_obj, Eina_Bool force)
80{
81#ifdef MAP_ACROSS
82 if ((obj->cur.map_parent != map_obj) || force)
83 {
84 obj->cur.map_parent = map_obj;
85 obj->cur.cache.clip.dirty = 1;
86 evas_object_clip_recalc(obj);
87 if (obj->smart.smart)
88 {
89 Evas_Object *obj2;
90
91 EINA_INLIST_FOREACH(evas_object_smart_members_get_direct(obj), obj2)
92 {
93 // if obj has its own map - skip it. already done
94 if ((obj2->cur.map) && (obj2->cur.usemap)) continue;
95 evas_object_child_map_across_mark(obj2, map_obj, force);
96 }
97 }
98 else if (obj->clip.clipees)
99 {
100 Eina_List *l;
101 Evas_Object *obj2;
102
103 EINA_LIST_FOREACH(obj->clip.clipees, l, obj2)
104 evas_object_child_map_across_mark(obj2, map_obj, force);
105 }
106 }
107#endif
108}
109
110void
111evas_object_clip_across_check(Evas_Object *obj)
112{
113#ifdef MAP_ACROSS
114 if (!obj->cur.clipper) return;
115 if (obj->cur.clipper->cur.map_parent != obj->cur.map_parent)
116 evas_object_child_map_across_mark(obj, obj->cur.map_parent, 1);
117#endif
118}
119
120void
121evas_object_clip_across_clippees_check(Evas_Object *obj)
122{
123#ifdef MAP_ACROSS
124 Eina_List *l;
125 Evas_Object *obj2;
126
127 if (!obj->clip.clipees) return;
128// schloooooooooooow:
129// evas_object_child_map_across_mark(obj, obj->cur.map_parent, 1);
130// buggy:
131 evas_object_child_map_across_mark(obj, obj->cur.map_parent, 0);
132 if (obj->cur.cache.clip.dirty)
133 {
134 EINA_LIST_FOREACH(obj->clip.clipees, l, obj2)
135 evas_object_clip_across_clippees_check(obj2);
136 }
137#endif
138}
139
140// this function is called on an object when map is enabled or disabled on it
141// thus creating a "map boundary" at that point.
142//
143// FIXME: flip2 test broken in elm - might be show/hide of clips
144void
145evas_object_mapped_clip_across_mark(Evas_Object *obj)
146{
147#ifdef MAP_ACROSS
148 if ((obj->cur.map) && (obj->cur.usemap))
149 evas_object_child_map_across_mark(obj, obj, 0);
150 else
151 {
152 if (obj->smart.parent)
153 evas_object_child_map_across_mark
154 (obj, obj->smart.parent->cur.map_parent, 0);
155 else
156 evas_object_child_map_across_mark(obj, NULL, 0);
157 }
158#endif
159}
160
161/* public functions */
162extern const char *o_rect_type;
163
164EAPI void
165evas_object_clip_set(Evas_Object *obj, Evas_Object *clip)
166{
167 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
168 return;
169 MAGIC_CHECK_END();
170 if (!clip)
171 {
172 evas_object_clip_unset(obj);
173 return;
174 }
175 MAGIC_CHECK(clip, Evas_Object, MAGIC_OBJ);
176 return;
177 MAGIC_CHECK_END();
178 if (obj->cur.clipper == clip) return;
179 if (obj == clip) return;
180 if (evas_object_intercept_call_clip_set(obj, clip)) return;
181 // illegal to set anything but a rect as a clip
182 if (clip->type != o_rect_type)
183 {
184 ERR("For now a clip on other object than a rectangle is disabled");
185 return;
186 }
187 if (obj->smart.smart)
188 {
189 if (obj->smart.smart->smart_class->clip_set)
190 obj->smart.smart->smart_class->clip_set(obj, clip);
191 }
192 if (obj->cur.clipper)
193 {
194 /* unclip */
195 obj->cur.clipper->clip.clipees = eina_list_remove(obj->cur.clipper->clip.clipees, obj);
196 if (!obj->cur.clipper->clip.clipees)
197 {
198 obj->cur.clipper->cur.have_clipees = 0;
199 if (obj->cur.clipper->cur.visible)
200 evas_damage_rectangle_add(obj->cur.clipper->layer->evas,
201 obj->cur.clipper->cur.geometry.x,
202 obj->cur.clipper->cur.geometry.y,
203 obj->cur.clipper->cur.geometry.w,
204 obj->cur.clipper->cur.geometry.h);
205 }
206 evas_object_change(obj->cur.clipper);
207 evas_object_change(obj);
208 obj->cur.clipper = NULL;
209 }
210 /* clip me */
211 if ((!clip->clip.clipees) && (clip->cur.visible))
212 {
213 /* Basically it just went invisible */
214 clip->changed = 1;
215 clip->layer->evas->changed = 1;
216 evas_damage_rectangle_add(clip->layer->evas,
217 clip->cur.geometry.x, clip->cur.geometry.y,
218 clip->cur.geometry.w, clip->cur.geometry.h);
219 }
220 obj->cur.clipper = clip;
221 clip->clip.clipees = eina_list_append(clip->clip.clipees, obj);
222 if (clip->clip.clipees) clip->cur.have_clipees = 1;
223
224 /* If it's NOT a rectangle set the mask bits too */
225 /* FIXME: Optmz ths chck */
226 if (strcmp(evas_object_type_get(clip),"rectangle") == 0)
227 obj->cur.mask = NULL;
228 else
229 {
230 void *engdata;
231 obj->cur.mask = clip;
232 engdata = clip->func->engine_data_get(clip);
233 /* FIXME: Images only */
234 clip->layer->evas->engine.func->image_mask_create(
235 clip->layer->evas->engine.data.output,
236 engdata);
237 }
238 evas_object_change(clip);
239 evas_object_change(obj);
240 evas_object_clip_dirty(obj);
241 evas_object_recalc_clippees(obj);
242 if ((!obj->smart.smart) &&
243 (!((obj->cur.map) && (obj->cur.usemap))))
244 {
245 if (evas_object_is_in_output_rect(obj,
246 obj->layer->evas->pointer.x,
247 obj->layer->evas->pointer.y, 1, 1))
248 evas_event_feed_mouse_move(obj->layer->evas,
249 obj->layer->evas->pointer.x,
250 obj->layer->evas->pointer.y,
251 obj->layer->evas->last_timestamp,
252 NULL);
253 }
254 evas_object_clip_across_check(obj);
255}
256
257EAPI Evas_Object *
258evas_object_clip_get(const Evas_Object *obj)
259{
260 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
261 return NULL;
262 MAGIC_CHECK_END();
263 return obj->cur.clipper;
264}
265
266EAPI void
267evas_object_clip_unset(Evas_Object *obj)
268{
269 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
270 return;
271 MAGIC_CHECK_END();
272 if (!obj->cur.clipper) return;
273 /* unclip */
274 if (evas_object_intercept_call_clip_unset(obj)) return;
275 if (obj->smart.smart)
276 {
277 if (obj->smart.smart->smart_class->clip_unset)
278 obj->smart.smart->smart_class->clip_unset(obj);
279 }
280 if (obj->cur.clipper)
281 {
282 obj->cur.clipper->clip.clipees = eina_list_remove(obj->cur.clipper->clip.clipees, obj);
283 if (!obj->cur.clipper->clip.clipees)
284 {
285 obj->cur.clipper->cur.have_clipees = 0;
286 if (obj->cur.clipper->cur.visible)
287 evas_damage_rectangle_add(obj->cur.clipper->layer->evas,
288 obj->cur.clipper->cur.geometry.x,
289 obj->cur.clipper->cur.geometry.y,
290 obj->cur.clipper->cur.geometry.w,
291 obj->cur.clipper->cur.geometry.h);
292 }
293 evas_object_change(obj->cur.clipper);
294 }
295 obj->cur.clipper = NULL;
296 evas_object_change(obj);
297 evas_object_clip_dirty(obj);
298 evas_object_recalc_clippees(obj);
299 if ((!obj->smart.smart) &&
300 (!((obj->cur.map) && (obj->cur.usemap))))
301 {
302 if (evas_object_is_in_output_rect(obj,
303 obj->layer->evas->pointer.x,
304 obj->layer->evas->pointer.y, 1, 1))
305 evas_event_feed_mouse_move(obj->layer->evas,
306 obj->layer->evas->pointer.x,
307 obj->layer->evas->pointer.y,
308 obj->layer->evas->last_timestamp,
309 NULL);
310 }
311 evas_object_clip_across_check(obj);
312}
313
314EAPI const Eina_List *
315evas_object_clipees_get(const Evas_Object *obj)
316{
317 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
318 return NULL;
319 MAGIC_CHECK_END();
320 return obj->clip.clipees;
321}
diff --git a/libraries/evas/src/lib/canvas/evas_data.c b/libraries/evas/src/lib/canvas/evas_data.c
new file mode 100644
index 0000000..3ac9d63
--- /dev/null
+++ b/libraries/evas/src/lib/canvas/evas_data.c
@@ -0,0 +1,72 @@
1#include "evas_common.h"
2#include "evas_private.h"
3
4
5EAPI void
6evas_object_data_set(Evas_Object *obj, const char *key, const void *data)
7{
8 Evas_Data_Node *node;
9
10 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
11 return;
12 MAGIC_CHECK_END();
13 if (!key) return;
14
15 evas_object_data_del(obj, key);
16 if (!data) return;
17 node = malloc(sizeof(Evas_Data_Node) + strlen(key) + 1);
18 node->key = (char *)node + sizeof(Evas_Data_Node);
19 strcpy(node->key, key);
20 node->data = (void *)data;
21 obj->data.elements = eina_list_prepend(obj->data.elements, node);
22}
23
24EAPI void *
25evas_object_data_get(const Evas_Object *obj, const char *key)
26{
27 Eina_List *l;
28 Evas_Data_Node *node;
29
30 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
31 return NULL;
32 MAGIC_CHECK_END();
33 if (!key) return NULL;
34
35 EINA_LIST_FOREACH(obj->data.elements, l, node)
36 {
37 if (!strcmp(node->key, key))
38 {
39 Eina_List *lst;
40 lst = obj->data.elements;
41 lst = eina_list_promote_list(lst, l);
42 ((Evas_Object *)obj)->data.elements = lst;
43 return node->data;
44 }
45 }
46 return NULL;
47}
48
49EAPI void *
50evas_object_data_del(Evas_Object *obj, const char *key)
51{
52 Eina_List *l;
53 Evas_Data_Node *node;
54
55 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
56 return NULL;
57 MAGIC_CHECK_END();
58 if (!key) return NULL;
59 EINA_LIST_FOREACH(obj->data.elements, l, node)
60 {
61 if (!strcmp(node->key, key))
62 {
63 void *data;
64
65 data = node->data;
66 obj->data.elements = eina_list_remove_list(obj->data.elements, l);
67 free(node);
68 return data;
69 }
70 }
71 return NULL;
72}
diff --git a/libraries/evas/src/lib/canvas/evas_events.c b/libraries/evas/src/lib/canvas/evas_events.c
new file mode 100644
index 0000000..99ecf8c
--- /dev/null
+++ b/libraries/evas/src/lib/canvas/evas_events.c
@@ -0,0 +1,1602 @@
1#include "evas_common.h"
2#include "evas_private.h"
3
4static void
5_evas_event_havemap_adjust(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Eina_Bool mouse_grabbed)
6{
7 if (obj->smart.parent)
8 _evas_event_havemap_adjust(obj->smart.parent, x, y, mouse_grabbed);
9
10 if ((!obj->cur.usemap) || (!obj->cur.map) || (!obj->cur.map->count == 4))
11 return;
12
13 evas_map_coords_get(obj->cur.map, *x, *y, x, y, mouse_grabbed);
14 *x += obj->cur.geometry.x;
15 *y += obj->cur.geometry.y;
16}
17
18static Eina_List *
19_evas_event_object_list_in_get(Evas *e, Eina_List *in,
20 const Eina_Inlist *list, Evas_Object *stop,
21 int x, int y, int *no_rep)
22{
23 Evas_Object *obj;
24 if (!list) return in;
25 EINA_INLIST_REVERSE_FOREACH(list, obj)
26 {
27 if (obj == stop)
28 {
29 *no_rep = 1;
30 return in;
31 }
32 if (evas_event_passes_through(obj)) continue;
33 if ((obj->cur.visible) && (obj->delete_me == 0) &&
34 (!obj->clip.clipees) &&
35 (evas_object_clippers_is_visible(obj)))
36 {
37 if (obj->smart.smart)
38 {
39 int norep = 0;
40 int inside;
41
42 if (((obj->cur.usemap) && (obj->cur.map) && (obj->cur.map->count == 4)))
43 {
44 inside = evas_object_is_in_output_rect(obj, x, y, 1, 1);
45 if (inside)
46 {
47 if (!evas_map_coords_get(obj->cur.map, x, y,
48 &(obj->cur.map->mx),
49 &(obj->cur.map->my), 0))
50 {
51 inside = 0;
52 }
53 else
54 {
55 in = _evas_event_object_list_in_get
56 (e, in,
57 evas_object_smart_members_get_direct(obj),
58 stop,
59 obj->cur.geometry.x + obj->cur.map->mx,
60 obj->cur.geometry.y + obj->cur.map->my, &norep);
61 }
62 }
63 }
64 else
65 {
66 in = _evas_event_object_list_in_get
67 (e, in, evas_object_smart_members_get_direct(obj),
68 stop, x, y, &norep);
69 }
70 if (norep)
71 {
72 if (!obj->repeat_events) *no_rep = 1;
73 return in;
74 }
75 }
76 else
77 {
78 int inside = evas_object_is_in_output_rect(obj, x, y, 1, 1);
79
80 if (((obj->cur.usemap) && (obj->cur.map) && (obj->cur.map->count == 4)))
81 {
82 if ((inside) && (!evas_map_coords_get(obj->cur.map, x, y,
83 &(obj->cur.map->mx),
84 &(obj->cur.map->my), 0)))
85 {
86 inside = 0;
87 }
88 }
89
90 if (inside && ((!obj->precise_is_inside) ||
91 (evas_object_is_inside(obj, x, y))))
92 {
93 if (!evas_event_freezes_through(obj))
94 in = eina_list_append(in, obj);
95 if (!obj->repeat_events)
96 {
97 *no_rep = 1;
98 return in;
99 }
100 }
101 }
102 }
103 }
104 *no_rep = 0;
105 return in;
106}
107
108Eina_List *
109evas_event_objects_event_list(Evas *e, Evas_Object *stop, int x, int y)
110{
111 Evas_Layer *lay;
112 Eina_List *in = NULL;
113
114 if ((!e->layers) || (e->events_frozen > 0)) return NULL;
115 EINA_INLIST_REVERSE_FOREACH((EINA_INLIST_GET(e->layers)), lay)
116 {
117 int norep = 0;
118 in = _evas_event_object_list_in_get(e, in,
119 EINA_INLIST_GET(lay->objects),
120 stop, x, y, &norep);
121 if (norep) return in;
122 }
123 return in;
124}
125
126static Eina_List *
127evas_event_list_copy(Eina_List *list)
128{
129 Eina_List *l, *new_l = NULL;
130 const void *data;
131
132 EINA_LIST_FOREACH(list, l, data)
133 new_l = eina_list_append(new_l, data);
134 return new_l;
135}
136/* public functions */
137
138EAPI void
139evas_event_freeze(Evas *e)
140{
141 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
142 return;
143 MAGIC_CHECK_END();
144 e->events_frozen++;
145}
146
147EAPI void
148evas_event_thaw(Evas *e)
149{
150 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
151 return;
152 MAGIC_CHECK_END();
153 e->events_frozen--;
154 if (e->events_frozen == 0)
155 {
156 Evas_Layer *lay;
157
158 EINA_INLIST_FOREACH((EINA_INLIST_GET(e->layers)), lay)
159 {
160 Evas_Object *obj;
161
162 EINA_INLIST_FOREACH(lay->objects, obj)
163 {
164 evas_object_clip_recalc(obj);
165 evas_object_recalc_clippees(obj);
166 }
167 }
168 }
169 if (e->events_frozen < 0)
170 evas_debug_generic(" Thaw of events when already thawed!!!\n");
171}
172
173EAPI int
174evas_event_freeze_get(const Evas *e)
175{
176 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
177 return 0;
178 MAGIC_CHECK_END();
179 return e->events_frozen;
180}
181
182EAPI void
183evas_event_thaw_eval(Evas *e)
184{
185 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
186 return;
187 MAGIC_CHECK_END();
188 if (e->events_frozen != 0) return;
189
190 evas_event_feed_mouse_move(e, e->pointer.x, e->pointer.y,
191 e->last_timestamp, NULL);
192}
193
194EAPI void
195evas_event_feed_mouse_down(Evas *e, int b, Evas_Button_Flags flags, unsigned int timestamp, const void *data)
196{
197 Eina_List *l, *copy;
198 Evas_Event_Mouse_Down ev;
199 Evas_Object *obj;
200
201 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
202 return;
203 MAGIC_CHECK_END();
204
205 if ((b < 1) || (b > 32)) return;
206
207 e->pointer.button |= (1 << (b - 1));
208
209 if (e->events_frozen > 0) return;
210 e->last_timestamp = timestamp;
211
212 _evas_object_event_new();
213
214 ev.button = b;
215 ev.output.x = e->pointer.x;
216 ev.output.y = e->pointer.y;
217 ev.canvas.x = e->pointer.x;
218 ev.canvas.y = e->pointer.y;
219 ev.data = (void *)data;
220 ev.modifiers = &(e->modifiers);
221 ev.locks = &(e->locks);
222 ev.flags = flags;
223 ev.timestamp = timestamp;
224 ev.event_flags = EVAS_EVENT_FLAG_NONE;
225
226 _evas_walk(e);
227 /* append new touch point to the touch point list */
228 _evas_touch_point_append(e, 0, e->pointer.x, e->pointer.y);
229 /* If this is the first finger down, i.e no other fingers pressed,
230 * get a new event list, otherwise, keep the current grabbed list. */
231 if (e->pointer.mouse_grabbed == 0)
232 {
233 Eina_List *ins = evas_event_objects_event_list(e,
234 NULL,
235 e->pointer.x,
236 e->pointer.y);
237 /* free our old list of ins */
238 e->pointer.object.in = eina_list_free(e->pointer.object.in);
239 /* and set up the new one */
240 e->pointer.object.in = ins;
241 }
242 copy = evas_event_list_copy(e->pointer.object.in);
243 EINA_LIST_FOREACH(copy, l, obj)
244 {
245 if (obj->pointer_mode != EVAS_OBJECT_POINTER_MODE_NOGRAB)
246 {
247 obj->mouse_grabbed++;
248 e->pointer.mouse_grabbed++;
249 }
250 }
251 EINA_LIST_FOREACH(copy, l, obj)
252 {
253 if (obj->delete_me) continue;
254 ev.canvas.x = e->pointer.x;
255 ev.canvas.y = e->pointer.y;
256 _evas_event_havemap_adjust(obj, &ev.canvas.x, &ev.canvas.y, obj->mouse_grabbed);
257
258 if (e->events_frozen <= 0)
259 evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_DOWN, &ev);
260 if (e->delete_me) break;
261 }
262 if (copy) eina_list_free(copy);
263 e->last_mouse_down_counter++;
264 _evas_post_event_callback_call(e);
265 /* update touch point's state to EVAS_TOUCH_POINT_STILL */
266 _evas_touch_point_update(e, 0, e->pointer.x, e->pointer.y, EVAS_TOUCH_POINT_STILL);
267 _evas_unwalk(e);
268}
269
270static int
271_post_up_handle(Evas *e, unsigned int timestamp, const void *data)
272{
273 Eina_List *l, *copy, *ins, *ll;
274 Evas_Event_Mouse_Out ev;
275 Evas_Object *obj;
276 int post_called = 0;
277
278 _evas_object_event_new();
279
280 ev.buttons = e->pointer.button;
281 ev.output.x = e->pointer.x;
282 ev.output.y = e->pointer.y;
283 ev.canvas.x = e->pointer.x;
284 ev.canvas.y = e->pointer.y;
285 ev.data = (void *)data;
286 ev.modifiers = &(e->modifiers);
287 ev.locks = &(e->locks);
288 ev.timestamp = timestamp;
289 ev.event_flags = EVAS_EVENT_FLAG_NONE;
290
291 /* get new list of ins */
292 ins = evas_event_objects_event_list(e, NULL, e->pointer.x, e->pointer.y);
293 /* go thru old list of in objects */
294 copy = evas_event_list_copy(e->pointer.object.in);
295 EINA_LIST_FOREACH(copy, ll, obj)
296 {
297 ev.canvas.x = e->pointer.x;
298 ev.canvas.y = e->pointer.y;
299 _evas_event_havemap_adjust(obj, &ev.canvas.x, &ev.canvas.y, obj->mouse_grabbed);
300 if ((!eina_list_data_find(ins, obj)) ||
301 (!e->pointer.inside))
302 {
303 if (obj->mouse_in)
304 {
305 obj->mouse_in = 0;
306 if (e->events_frozen <= 0)
307 evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_OUT, &ev);
308 }
309 }
310 if (e->delete_me) break;
311 }
312 _evas_post_event_callback_call(e);
313
314 if (copy) copy = eina_list_free(copy);
315 if (e->pointer.inside)
316 {
317 Evas_Event_Mouse_In ev_in;
318 Evas_Object *obj_itr;
319
320 _evas_object_event_new();
321
322 ev_in.buttons = e->pointer.button;
323 ev_in.output.x = e->pointer.x;
324 ev_in.output.y = e->pointer.y;
325 ev_in.canvas.x = e->pointer.x;
326 ev_in.canvas.y = e->pointer.y;
327 ev_in.data = (void *)data;
328 ev_in.modifiers = &(e->modifiers);
329 ev_in.locks = &(e->locks);
330 ev_in.timestamp = timestamp;
331 ev_in.event_flags = EVAS_EVENT_FLAG_NONE;
332
333 EINA_LIST_FOREACH(ins, l, obj_itr)
334 {
335 ev_in.canvas.x = e->pointer.x;
336 ev_in.canvas.y = e->pointer.y;
337 _evas_event_havemap_adjust(obj_itr, &ev_in.canvas.x, &ev_in.canvas.y, obj_itr->mouse_grabbed);
338 if (!eina_list_data_find(e->pointer.object.in, obj_itr))
339 {
340 if (!obj_itr->mouse_in)
341 {
342 obj_itr->mouse_in = 1;
343 if (e->events_frozen <= 0)
344 evas_object_event_callback_call(obj_itr, EVAS_CALLBACK_MOUSE_IN, &ev_in);
345 }
346 }
347 if (e->delete_me) break;
348 }
349 post_called = 1;
350 _evas_post_event_callback_call(e);
351 }
352 else
353 {
354 ins = eina_list_free(ins);
355 }
356
357 if (e->pointer.mouse_grabbed == 0)
358 {
359 /* free our old list of ins */
360 eina_list_free(e->pointer.object.in);
361 /* and set up the new one */
362 e->pointer.object.in = ins;
363 }
364 else
365 {
366 /* free our cur ins */
367 eina_list_free(ins);
368 }
369 if (e->pointer.inside)
370 evas_event_feed_mouse_move(e, e->pointer.x, e->pointer.y, timestamp, data);
371 return post_called;
372}
373
374EAPI void
375evas_event_feed_mouse_up(Evas *e, int b, Evas_Button_Flags flags, unsigned int timestamp, const void *data)
376{
377 Eina_List *l, *copy;
378
379 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
380 return;
381 MAGIC_CHECK_END();
382
383 if ((b < 1) || (b > 32)) return;
384
385 e->pointer.button &= ~(1 << (b - 1));
386
387 if (e->events_frozen > 0) return;
388 e->last_timestamp = timestamp;
389
390 {
391 Evas_Event_Mouse_Up ev;
392 Evas_Object *obj;
393
394 _evas_object_event_new();
395
396 ev.button = b;
397 ev.output.x = e->pointer.x;
398 ev.output.y = e->pointer.y;
399 ev.canvas.x = e->pointer.x;
400 ev.canvas.y = e->pointer.y;
401 ev.data = (void *)data;
402 ev.modifiers = &(e->modifiers);
403 ev.locks = &(e->locks);
404 ev.flags = flags;
405 ev.timestamp = timestamp;
406 ev.event_flags = EVAS_EVENT_FLAG_NONE;
407
408 _evas_walk(e);
409 /* update released touch point */
410 _evas_touch_point_update(e, 0, e->pointer.x, e->pointer.y, EVAS_TOUCH_POINT_UP);
411 copy = evas_event_list_copy(e->pointer.object.in);
412 EINA_LIST_FOREACH(copy, l, obj)
413 {
414 ev.canvas.x = e->pointer.x;
415 ev.canvas.y = e->pointer.y;
416 _evas_event_havemap_adjust(obj, &ev.canvas.x, &ev.canvas.y, obj->mouse_grabbed);
417 if ((obj->pointer_mode != EVAS_OBJECT_POINTER_MODE_NOGRAB) &&
418 (obj->mouse_grabbed > 0))
419 {
420 obj->mouse_grabbed--;
421 e->pointer.mouse_grabbed--;
422 }
423 if (!obj->delete_me)
424 {
425 if (e->events_frozen <= 0)
426 evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_UP, &ev);
427 }
428 if (e->delete_me) break;
429 }
430 if (copy) copy = eina_list_free(copy);
431 e->last_mouse_up_counter++;
432 _evas_post_event_callback_call(e);
433 }
434
435 if (e->pointer.mouse_grabbed == 0)
436 {
437 _post_up_handle(e, timestamp, data);
438 }
439
440 if (e->pointer.mouse_grabbed < 0)
441 {
442 ERR("BUG? e->pointer.mouse_grabbed (=%d) < 0!",
443 e->pointer.mouse_grabbed);
444 }
445 /* remove released touch point from the touch point list */
446 _evas_touch_point_remove(e, 0);
447
448 _evas_unwalk(e);
449}
450
451EAPI void
452evas_event_feed_mouse_cancel(Evas *e, unsigned int timestamp, const void *data)
453{
454 int i;
455
456 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
457 return;
458 MAGIC_CHECK_END();
459
460 if (e->events_frozen > 0) return;
461
462 _evas_walk(e);
463 for (i = 0; i < 32; i++)
464 {
465 if ((e->pointer.button & (1 << i)))
466 evas_event_feed_mouse_up(e, i + 1, 0, timestamp, data);
467 }
468 _evas_unwalk(e);
469}
470
471EAPI void
472evas_event_feed_mouse_wheel(Evas *e, int direction, int z, unsigned int timestamp, const void *data)
473{
474 Eina_List *l, *copy;
475 Evas_Event_Mouse_Wheel ev;
476 Evas_Object *obj;
477
478 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
479 return;
480 MAGIC_CHECK_END();
481
482 if (e->events_frozen > 0) return;
483 e->last_timestamp = timestamp;
484
485 _evas_object_event_new();
486
487 ev.direction = direction;
488 ev.z = z;
489 ev.output.x = e->pointer.x;
490 ev.output.y = e->pointer.y;
491 ev.canvas.x = e->pointer.x;
492 ev.canvas.y = e->pointer.y;
493 ev.data = (void *) data;
494 ev.modifiers = &(e->modifiers);
495 ev.locks = &(e->locks);
496 ev.timestamp = timestamp;
497 ev.event_flags = EVAS_EVENT_FLAG_NONE;
498
499 _evas_walk(e);
500 copy = evas_event_list_copy(e->pointer.object.in);
501
502 EINA_LIST_FOREACH(copy, l, obj)
503 {
504 ev.canvas.x = e->pointer.x;
505 ev.canvas.y = e->pointer.y;
506 _evas_event_havemap_adjust(obj, &ev.canvas.x, &ev.canvas.y, obj->mouse_grabbed);
507 if ((e->events_frozen <= 0) && !evas_event_freezes_through(obj))
508 evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_WHEEL, &ev);
509 if (e->delete_me) break;
510 }
511 if (copy) copy = eina_list_free(copy);
512 _evas_post_event_callback_call(e);
513
514 _evas_unwalk(e);
515}
516
517EAPI void
518evas_event_feed_mouse_move(Evas *e, int x, int y, unsigned int timestamp, const void *data)
519{
520 int px, py;
521//// Evas_Coord pcx, pcy;
522
523 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
524 return;
525 MAGIC_CHECK_END();
526
527 px = e->pointer.x;
528 py = e->pointer.y;
529//// pcx = e->pointer.canvas_x;
530//// pcy = e->pointer.canvas_y;
531
532 if (e->events_frozen > 0) return;
533 e->last_timestamp = timestamp;
534
535 e->pointer.x = x;
536 e->pointer.y = y;
537//// e->pointer.canvas_x = x;
538//// e->pointer.canvas_y = y;
539//// e->pointer.canvas_x = evas_coord_screen_x_to_world(e, x);
540//// e->pointer.canvas_y = evas_coord_screen_y_to_world(e, y);
541 if ((!e->pointer.inside) && (e->pointer.mouse_grabbed == 0)) return;
542 _evas_walk(e);
543 /* update moved touch point */
544 if ((px != x) || (py != y))
545 _evas_touch_point_update(e, 0, e->pointer.x, e->pointer.y, EVAS_TOUCH_POINT_MOVE);
546 /* if our mouse button is grabbed to any objects */
547 if (e->pointer.mouse_grabbed > 0)
548 {
549 /* go thru old list of in objects */
550 Eina_List *outs = NULL;
551 Eina_List *l, *copy;
552
553 {
554 Evas_Event_Mouse_Move ev;
555 Evas_Object *obj;
556
557 _evas_object_event_new();
558
559 ev.buttons = e->pointer.button;
560 ev.cur.output.x = e->pointer.x;
561 ev.cur.output.y = e->pointer.y;
562 ev.cur.canvas.x = e->pointer.x;
563 ev.cur.canvas.y = e->pointer.y;
564 ev.prev.output.x = px;
565 ev.prev.output.y = py;
566 ev.prev.canvas.x = px;
567 ev.prev.canvas.y = py;
568 ev.data = (void *)data;
569 ev.modifiers = &(e->modifiers);
570 ev.locks = &(e->locks);
571 ev.timestamp = timestamp;
572 ev.event_flags = EVAS_EVENT_FLAG_NONE;
573 copy = evas_event_list_copy(e->pointer.object.in);
574 EINA_LIST_FOREACH(copy, l, obj)
575 {
576 ev.cur.canvas.x = e->pointer.x;
577 ev.cur.canvas.y = e->pointer.y;
578 _evas_event_havemap_adjust(obj, &ev.cur.canvas.x,
579 &ev.cur.canvas.y,
580 obj->mouse_grabbed);
581 if ((e->events_frozen <= 0) &&
582 (evas_object_clippers_is_visible(obj) ||
583 obj->mouse_grabbed) &&
584 (!evas_event_passes_through(obj)) &&
585 (!evas_event_freezes_through(obj)) &&
586 (!obj->clip.clipees))
587 {
588 if ((px != x) || (py != y))
589 evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_MOVE, &ev);
590 }
591 else
592 outs = eina_list_append(outs, obj);
593 if (e->delete_me) break;
594 }
595 _evas_post_event_callback_call(e);
596 }
597 {
598 Evas_Event_Mouse_Out ev;
599
600 _evas_object_event_new();
601
602 ev.buttons = e->pointer.button;
603 ev.output.x = e->pointer.x;
604 ev.output.y = e->pointer.y;
605 ev.canvas.x = e->pointer.x;
606 ev.canvas.y = e->pointer.y;
607 ev.data = (void *)data;
608 ev.modifiers = &(e->modifiers);
609 ev.locks = &(e->locks);
610 ev.timestamp = timestamp;
611 ev.event_flags = EVAS_EVENT_FLAG_NONE;
612
613 if (copy) eina_list_free(copy);
614 while (outs)
615 {
616 Evas_Object *obj;
617
618 obj = outs->data;
619 outs = eina_list_remove(outs, obj);
620 if ((obj->mouse_grabbed == 0) && (!e->delete_me))
621 {
622 ev.canvas.x = e->pointer.x;
623 ev.canvas.y = e->pointer.y;
624 _evas_event_havemap_adjust(obj, &ev.canvas.x, &ev.canvas.y, obj->mouse_grabbed);
625 e->pointer.object.in = eina_list_remove(e->pointer.object.in, obj);
626 if (obj->mouse_in)
627 {
628 obj->mouse_in = 0;
629 if (!obj->delete_me)
630 {
631 if (e->events_frozen <= 0)
632 evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_OUT, &ev);
633 }
634 }
635 }
636 }
637 _evas_post_event_callback_call(e);
638 }
639 }
640 else
641 {
642 Eina_List *ins;
643 Eina_List *l, *copy;
644 Evas_Event_Mouse_Move ev;
645 Evas_Event_Mouse_Out ev2;
646 Evas_Event_Mouse_In ev3;
647 Evas_Object *obj;
648
649 _evas_object_event_new();
650
651 ev.buttons = e->pointer.button;
652 ev.cur.output.x = e->pointer.x;
653 ev.cur.output.y = e->pointer.y;
654 ev.cur.canvas.x = e->pointer.x;
655 ev.cur.canvas.y = e->pointer.y;
656 ev.prev.output.x = px;
657 ev.prev.output.y = py;
658 ev.prev.canvas.x = px;
659 ev.prev.canvas.y = py;
660 ev.data = (void *)data;
661 ev.modifiers = &(e->modifiers);
662 ev.locks = &(e->locks);
663 ev.timestamp = timestamp;
664 ev.event_flags = EVAS_EVENT_FLAG_NONE;
665
666 ev2.buttons = e->pointer.button;
667 ev2.output.x = e->pointer.x;
668 ev2.output.y = e->pointer.y;
669 ev2.canvas.x = e->pointer.x;
670 ev2.canvas.y = e->pointer.y;
671 ev2.data = (void *)data;
672 ev2.modifiers = &(e->modifiers);
673 ev2.locks = &(e->locks);
674 ev2.timestamp = timestamp;
675 ev2.event_flags = EVAS_EVENT_FLAG_NONE;
676
677 ev3.buttons = e->pointer.button;
678 ev3.output.x = e->pointer.x;
679 ev3.output.y = e->pointer.y;
680 ev3.canvas.x = e->pointer.x;
681 ev3.canvas.y = e->pointer.y;
682 ev3.data = (void *)data;
683 ev3.modifiers = &(e->modifiers);
684 ev3.locks = &(e->locks);
685 ev3.timestamp = timestamp;
686 ev3.event_flags = EVAS_EVENT_FLAG_NONE;
687
688 /* get all new in objects */
689 ins = evas_event_objects_event_list(e, NULL, x, y);
690 /* go thru old list of in objects */
691 copy = evas_event_list_copy(e->pointer.object.in);
692 EINA_LIST_FOREACH(copy, l, obj)
693 {
694 /* if its under the pointer and its visible and its in the new */
695 /* in list */
696 // FIXME: i don't think we need this
697 // evas_object_clip_recalc(obj);
698 if ((e->events_frozen <= 0) &&
699 evas_object_is_in_output_rect(obj, x, y, 1, 1) &&
700 (evas_object_clippers_is_visible(obj) ||
701 obj->mouse_grabbed) &&
702 eina_list_data_find(ins, obj) &&
703 (!evas_event_passes_through(obj)) &&
704 (!evas_event_freezes_through(obj)) &&
705 (!obj->clip.clipees) &&
706 ((!obj->precise_is_inside) || evas_object_is_inside(obj, x, y))
707 )
708 {
709 if ((px != x) || (py != y))
710 {
711 ev.cur.canvas.x = e->pointer.x;
712 ev.cur.canvas.y = e->pointer.y;
713 _evas_event_havemap_adjust(obj, &ev.cur.canvas.x, &ev.cur.canvas.y, obj->mouse_grabbed);
714 evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_MOVE, &ev);
715 }
716 }
717 /* otherwise it has left the object */
718 else
719 {
720 if (obj->mouse_in)
721 {
722 obj->mouse_in = 0;
723 ev2.canvas.x = e->pointer.x;
724 ev2.canvas.y = e->pointer.y;
725 _evas_event_havemap_adjust(obj, &ev2.canvas.x, &ev2.canvas.y, obj->mouse_grabbed);
726 if (e->events_frozen <= 0)
727 evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_OUT, &ev2);
728 }
729 }
730 if (e->delete_me) break;
731 }
732 _evas_post_event_callback_call(e);
733
734 _evas_object_event_new();
735
736 if (copy) copy = eina_list_free(copy);
737 /* go thru our current list of ins */
738 EINA_LIST_FOREACH(ins, l, obj)
739 {
740 ev3.canvas.x = e->pointer.x;
741 ev3.canvas.y = e->pointer.y;
742 _evas_event_havemap_adjust(obj, &ev3.canvas.x, &ev3.canvas.y, obj->mouse_grabbed);
743 /* if its not in the old list of ins send an enter event */
744 if (!eina_list_data_find(e->pointer.object.in, obj))
745 {
746 if (!obj->mouse_in)
747 {
748 obj->mouse_in = 1;
749 if (e->events_frozen <= 0)
750 evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_IN, &ev3);
751 }
752 }
753 if (e->delete_me) break;
754 }
755 if (e->pointer.mouse_grabbed == 0)
756 {
757 /* free our old list of ins */
758 eina_list_free(e->pointer.object.in);
759 /* and set up the new one */
760 e->pointer.object.in = ins;
761 }
762 else
763 {
764 /* free our cur ins */
765 eina_list_free(ins);
766 }
767 _evas_post_event_callback_call(e);
768 }
769 _evas_unwalk(e);
770}
771
772EAPI void
773evas_event_feed_mouse_in(Evas *e, unsigned int timestamp, const void *data)
774{
775 Eina_List *ins;
776 Eina_List *l;
777 Evas_Event_Mouse_In ev;
778 Evas_Object *obj;
779
780 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
781 return;
782 MAGIC_CHECK_END();
783 e->pointer.inside = 1;
784
785 if (e->events_frozen > 0) return;
786 e->last_timestamp = timestamp;
787
788 if (e->pointer.mouse_grabbed != 0) return;
789
790 _evas_object_event_new();
791
792 ev.buttons = e->pointer.button;
793 ev.output.x = e->pointer.x;
794 ev.output.y = e->pointer.y;
795 ev.canvas.x = e->pointer.x;
796 ev.canvas.y = e->pointer.y;
797 ev.data = (void *)data;
798 ev.modifiers = &(e->modifiers);
799 ev.locks = &(e->locks);
800 ev.timestamp = timestamp;
801 ev.event_flags = EVAS_EVENT_FLAG_NONE;
802
803 _evas_walk(e);
804 /* get new list of ins */
805 ins = evas_event_objects_event_list(e, NULL, e->pointer.x, e->pointer.y);
806 EINA_LIST_FOREACH(ins, l, obj)
807 {
808 ev.canvas.x = e->pointer.x;
809 ev.canvas.y = e->pointer.y;
810 _evas_event_havemap_adjust(obj, &ev.canvas.x, &ev.canvas.y, obj->mouse_grabbed);
811 if (!eina_list_data_find(e->pointer.object.in, obj))
812 {
813 if (!obj->mouse_in)
814 {
815 obj->mouse_in = 1;
816 if (e->events_frozen <= 0)
817 evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_IN, &ev);
818 }
819 }
820 if (e->delete_me) break;
821 }
822 /* free our old list of ins */
823 e->pointer.object.in = eina_list_free(e->pointer.object.in);
824 /* and set up the new one */
825 e->pointer.object.in = ins;
826 _evas_post_event_callback_call(e);
827 evas_event_feed_mouse_move(e, e->pointer.x, e->pointer.y, timestamp, data);
828 _evas_unwalk(e);
829}
830
831EAPI void
832evas_event_feed_mouse_out(Evas *e, unsigned int timestamp, const void *data)
833{
834 Evas_Event_Mouse_Out ev;
835
836 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
837 return;
838 MAGIC_CHECK_END();
839 e->pointer.inside = 0;
840
841 if (e->events_frozen > 0) return;
842 e->last_timestamp = timestamp;
843
844 _evas_object_event_new();
845
846 ev.buttons = e->pointer.button;
847 ev.output.x = e->pointer.x;
848 ev.output.y = e->pointer.y;
849 ev.canvas.x = e->pointer.x;
850 ev.canvas.y = e->pointer.y;
851 ev.data = (void *)data;
852 ev.modifiers = &(e->modifiers);
853 ev.locks = &(e->locks);
854 ev.timestamp = timestamp;
855 ev.event_flags = EVAS_EVENT_FLAG_NONE;
856
857 _evas_walk(e);
858 /* if our mouse button is grabbed to any objects */
859 if (e->pointer.mouse_grabbed == 0)
860 {
861 /* go thru old list of in objects */
862 Eina_List *l, *copy;
863 Evas_Object *obj;
864
865 copy = evas_event_list_copy(e->pointer.object.in);
866 EINA_LIST_FOREACH(copy, l, obj)
867 {
868 ev.canvas.x = e->pointer.x;
869 ev.canvas.y = e->pointer.y;
870 _evas_event_havemap_adjust(obj, &ev.canvas.x, &ev.canvas.y, obj->mouse_grabbed);
871 if (obj->mouse_in)
872 {
873 obj->mouse_in = 0;
874 if (!obj->delete_me)
875 {
876 if (e->events_frozen <= 0)
877 evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_OUT, &ev);
878 }
879 }
880 if (e->delete_me) break;
881 }
882 if (copy) copy = eina_list_free(copy);
883 /* free our old list of ins */
884 e->pointer.object.in = eina_list_free(e->pointer.object.in);
885 _evas_post_event_callback_call(e);
886 }
887 _evas_unwalk(e);
888}
889
890EAPI void
891evas_event_feed_multi_down(Evas *e,
892 int d, int x, int y,
893 double rad, double radx, double rady,
894 double pres, double ang,
895 double fx, double fy,
896 Evas_Button_Flags flags, unsigned int timestamp,
897 const void *data)
898{
899 Eina_List *l, *copy;
900 Evas_Event_Multi_Down ev;
901 Evas_Object *obj;
902
903 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
904 return;
905 MAGIC_CHECK_END();
906
907 if (e->events_frozen > 0) return;
908 e->last_timestamp = timestamp;
909
910 _evas_object_event_new();
911
912 ev.device = d;
913 ev.output.x = x;
914 ev.output.y = y;
915 ev.canvas.x = x;
916 ev.canvas.y = y;
917 ev.radius = rad;
918 ev.radius_x = radx;
919 ev.radius_y = rady;
920 ev.pressure = pres;
921 ev.angle = ang;
922 ev.canvas.xsub = fx;
923 ev.canvas.ysub = fy;
924 ev.data = (void *)data;
925 ev.modifiers = &(e->modifiers);
926 ev.locks = &(e->locks);
927 ev.flags = flags;
928 ev.timestamp = timestamp;
929 ev.event_flags = EVAS_EVENT_FLAG_NONE;
930
931 _evas_walk(e);
932 /* append new touch point to the touch point list */
933 _evas_touch_point_append(e, d, x, y);
934 copy = evas_event_list_copy(e->pointer.object.in);
935 EINA_LIST_FOREACH(copy, l, obj)
936 {
937 if (obj->pointer_mode != EVAS_OBJECT_POINTER_MODE_NOGRAB)
938 {
939 obj->mouse_grabbed++;
940 e->pointer.mouse_grabbed++;
941 }
942 }
943 EINA_LIST_FOREACH(copy, l, obj)
944 {
945 ev.canvas.x = x;
946 ev.canvas.y = y;
947 ev.canvas.xsub = fx;
948 ev.canvas.ysub = fy;
949 _evas_event_havemap_adjust(obj, &ev.canvas.x, &ev.canvas.y, obj->mouse_grabbed);
950 if (x != ev.canvas.x)
951 ev.canvas.xsub = ev.canvas.x; // fixme - lost precision
952 if (y != ev.canvas.y)
953 ev.canvas.ysub = ev.canvas.y; // fixme - lost precision
954 if (e->events_frozen <= 0)
955 evas_object_event_callback_call(obj, EVAS_CALLBACK_MULTI_DOWN, &ev);
956 if (e->delete_me) break;
957 }
958 if (copy) eina_list_free(copy);
959 _evas_post_event_callback_call(e);
960 /* update touch point's state to EVAS_TOUCH_POINT_STILL */
961 _evas_touch_point_update(e, d, x, y, EVAS_TOUCH_POINT_STILL);
962 _evas_unwalk(e);
963}
964
965EAPI void
966evas_event_feed_multi_up(Evas *e,
967 int d, int x, int y,
968 double rad, double radx, double rady,
969 double pres, double ang,
970 double fx, double fy,
971 Evas_Button_Flags flags, unsigned int timestamp,
972 const void *data)
973{
974 Eina_List *l, *copy;
975 Evas_Event_Multi_Up ev;
976 Evas_Object *obj;
977
978 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
979 return;
980 MAGIC_CHECK_END();
981
982 if (e->events_frozen > 0) return;
983 e->last_timestamp = timestamp;
984
985 _evas_object_event_new();
986
987 ev.device = d;
988 ev.output.x = x;
989 ev.output.y = y;
990 ev.canvas.x = x;
991 ev.canvas.y = y;
992 ev.radius = rad;
993 ev.radius_x = radx;
994 ev.radius_y = rady;
995 ev.pressure = pres;
996 ev.angle = ang;
997 ev.canvas.xsub = fx;
998 ev.canvas.ysub = fy;
999 ev.data = (void *)data;
1000 ev.modifiers = &(e->modifiers);
1001 ev.locks = &(e->locks);
1002 ev.flags = flags;
1003 ev.timestamp = timestamp;
1004 ev.event_flags = EVAS_EVENT_FLAG_NONE;
1005
1006 _evas_walk(e);
1007 /* update released touch point */
1008 _evas_touch_point_update(e, d, x, y, EVAS_TOUCH_POINT_UP);
1009 copy = evas_event_list_copy(e->pointer.object.in);
1010 EINA_LIST_FOREACH(copy, l, obj)
1011 {
1012 ev.canvas.x = x;
1013 ev.canvas.y = y;
1014 ev.canvas.xsub = fx;
1015 ev.canvas.ysub = fy;
1016 _evas_event_havemap_adjust(obj, &ev.canvas.x, &ev.canvas.y, obj->mouse_grabbed);
1017 if (x != ev.canvas.x)
1018 ev.canvas.xsub = ev.canvas.x; // fixme - lost precision
1019 if (y != ev.canvas.y)
1020 ev.canvas.ysub = ev.canvas.y; // fixme - lost precision
1021 if ((obj->pointer_mode != EVAS_OBJECT_POINTER_MODE_NOGRAB) &&
1022 (obj->mouse_grabbed > 0))
1023 {
1024 obj->mouse_grabbed--;
1025 e->pointer.mouse_grabbed--;
1026 }
1027 if (e->events_frozen <= 0)
1028 evas_object_event_callback_call(obj, EVAS_CALLBACK_MULTI_UP, &ev);
1029 if (e->delete_me) break;
1030 }
1031 if (copy) copy = eina_list_free(copy);
1032 if ((e->pointer.mouse_grabbed == 0) && !_post_up_handle(e, timestamp, data))
1033 _evas_post_event_callback_call(e);
1034 /* remove released touch point from the touch point list */
1035 _evas_touch_point_remove(e, d);
1036 _evas_unwalk(e);
1037}
1038
1039EAPI void
1040evas_event_feed_multi_move(Evas *e,
1041 int d, int x, int y,
1042 double rad, double radx, double rady,
1043 double pres, double ang,
1044 double fx, double fy,
1045 unsigned int timestamp, const void *data)
1046{
1047 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
1048 return;
1049 MAGIC_CHECK_END();
1050
1051 if (e->events_frozen > 0) return;
1052 e->last_timestamp = timestamp;
1053
1054 if (!e->pointer.inside) return;
1055
1056 _evas_walk(e);
1057 /* update moved touch point */
1058 _evas_touch_point_update(e, d, x, y, EVAS_TOUCH_POINT_MOVE);
1059 /* if our mouse button is grabbed to any objects */
1060 if (e->pointer.mouse_grabbed > 0)
1061 {
1062 /* go thru old list of in objects */
1063 Eina_List *l, *copy;
1064 Evas_Event_Multi_Move ev;
1065 Evas_Object *obj;
1066
1067 _evas_object_event_new();
1068
1069 ev.device = d;
1070 ev.cur.output.x = x;
1071 ev.cur.output.y = y;
1072 ev.cur.canvas.x = x;
1073 ev.cur.canvas.y = y;
1074 ev.radius = rad;
1075 ev.radius_x = radx;
1076 ev.radius_y = rady;
1077 ev.pressure = pres;
1078 ev.angle = ang;
1079 ev.cur.canvas.xsub = fx;
1080 ev.cur.canvas.ysub = fy;
1081 ev.data = (void *)data;
1082 ev.modifiers = &(e->modifiers);
1083 ev.locks = &(e->locks);
1084 ev.timestamp = timestamp;
1085 ev.event_flags = EVAS_EVENT_FLAG_NONE;
1086
1087 copy = evas_event_list_copy(e->pointer.object.in);
1088 EINA_LIST_FOREACH(copy, l, obj)
1089 {
1090 if ((e->events_frozen <= 0) &&
1091 (evas_object_clippers_is_visible(obj) || obj->mouse_grabbed) &&
1092 (!evas_event_passes_through(obj)) &&
1093 (!evas_event_freezes_through(obj)) &&
1094 (!obj->clip.clipees))
1095 {
1096 ev.cur.canvas.x = x;
1097 ev.cur.canvas.y = y;
1098 ev.cur.canvas.xsub = fx;
1099 ev.cur.canvas.ysub = fy;
1100 _evas_event_havemap_adjust(obj, &ev.cur.canvas.x, &ev.cur.canvas.y, obj->mouse_grabbed);
1101 if (x != ev.cur.canvas.x)
1102 ev.cur.canvas.xsub = ev.cur.canvas.x; // fixme - lost precision
1103 if (y != ev.cur.canvas.y)
1104 ev.cur.canvas.ysub = ev.cur.canvas.y; // fixme - lost precision
1105 evas_object_event_callback_call(obj, EVAS_CALLBACK_MULTI_MOVE, &ev);
1106 }
1107 if (e->delete_me) break;
1108 }
1109 _evas_post_event_callback_call(e);
1110 }
1111 else
1112 {
1113 Eina_List *ins;
1114 Eina_List *l, *copy;
1115 Evas_Event_Multi_Move ev;
1116 Evas_Object *obj;
1117
1118 _evas_object_event_new();
1119
1120 ev.device = d;
1121 ev.cur.output.x = x;
1122 ev.cur.output.y = y;
1123 ev.cur.canvas.x = x;
1124 ev.cur.canvas.y = y;
1125 ev.radius = rad;
1126 ev.radius_x = radx;
1127 ev.radius_y = rady;
1128 ev.pressure = pres;
1129 ev.angle = ang;
1130 ev.cur.canvas.xsub = fx;
1131 ev.cur.canvas.ysub = fy;
1132 ev.data = (void *)data;
1133 ev.modifiers = &(e->modifiers);
1134 ev.locks = &(e->locks);
1135 ev.timestamp = timestamp;
1136 ev.event_flags = EVAS_EVENT_FLAG_NONE;
1137
1138 /* get all new in objects */
1139 ins = evas_event_objects_event_list(e, NULL, x, y);
1140 /* go thru old list of in objects */
1141 copy = evas_event_list_copy(e->pointer.object.in);
1142 EINA_LIST_FOREACH(copy, l, obj)
1143 {
1144 /* if its under the pointer and its visible and its in the new */
1145 /* in list */
1146 // FIXME: i don't think we need this
1147 // evas_object_clip_recalc(obj);
1148 if ((e->events_frozen <= 0) &&
1149 evas_object_is_in_output_rect(obj, x, y, 1, 1) &&
1150 (evas_object_clippers_is_visible(obj) ||
1151 obj->mouse_grabbed) &&
1152 eina_list_data_find(ins, obj) &&
1153 (!evas_event_passes_through(obj)) &&
1154 (!evas_event_freezes_through(obj)) &&
1155 (!obj->clip.clipees) &&
1156 ((!obj->precise_is_inside) || evas_object_is_inside(obj, x, y))
1157 )
1158 {
1159 ev.cur.canvas.x = x;
1160 ev.cur.canvas.y = y;
1161 ev.cur.canvas.xsub = fx;
1162 ev.cur.canvas.ysub = fy;
1163 _evas_event_havemap_adjust(obj, &ev.cur.canvas.x, &ev.cur.canvas.y, obj->mouse_grabbed);
1164 if (x != ev.cur.canvas.x)
1165 ev.cur.canvas.xsub = ev.cur.canvas.x; // fixme - lost precision
1166 if (y != ev.cur.canvas.y)
1167 ev.cur.canvas.ysub = ev.cur.canvas.y; // fixme - lost precision
1168 evas_object_event_callback_call(obj, EVAS_CALLBACK_MULTI_MOVE, &ev);
1169 }
1170 if (e->delete_me) break;
1171 }
1172 if (copy) copy = eina_list_free(copy);
1173 if (e->pointer.mouse_grabbed == 0)
1174 {
1175 /* free our old list of ins */
1176 eina_list_free(e->pointer.object.in);
1177 /* and set up the new one */
1178 e->pointer.object.in = ins;
1179 }
1180 else
1181 {
1182 /* free our cur ins */
1183 eina_list_free(ins);
1184 }
1185 _evas_post_event_callback_call(e);
1186 }
1187 _evas_unwalk(e);
1188}
1189
1190EAPI void
1191evas_event_feed_key_down(Evas *e, const char *keyname, const char *key, const char *string, const char *compose, unsigned int timestamp, const void *data)
1192{
1193 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
1194 return;
1195 MAGIC_CHECK_END();
1196
1197 if (!keyname) return;
1198 if (e->events_frozen > 0) return;
1199 e->last_timestamp = timestamp;
1200 _evas_walk(e);
1201
1202 Evas_Event_Key_Down ev;
1203 Eina_Bool exclusive;
1204
1205 _evas_object_event_new();
1206
1207 exclusive = EINA_FALSE;
1208 ev.keyname = (char *)keyname;
1209 ev.data = (void *)data;
1210 ev.modifiers = &(e->modifiers);
1211 ev.locks = &(e->locks);
1212 ev.key = key;
1213 ev.string = string;
1214 ev.compose = compose;
1215 ev.timestamp = timestamp;
1216 ev.event_flags = EVAS_EVENT_FLAG_NONE;
1217
1218 if (e->grabs)
1219 {
1220 Eina_List *l;
1221 Evas_Key_Grab *g;
1222
1223 e->walking_grabs++;
1224 EINA_LIST_FOREACH(e->grabs, l, g)
1225 {
1226 if (g->just_added)
1227 {
1228 g->just_added = EINA_FALSE;
1229 continue;
1230 }
1231 if (g->delete_me) continue;
1232 if (((e->modifiers.mask & g->modifiers) ||
1233 (g->modifiers == e->modifiers.mask)) &&
1234 (!strcmp(keyname, g->keyname)))
1235 {
1236 if (!(e->modifiers.mask & g->not_modifiers))
1237 {
1238 if (e->events_frozen <= 0 &&
1239 !evas_event_freezes_through(g->object))
1240 evas_object_event_callback_call(g->object,
1241 EVAS_CALLBACK_KEY_DOWN,
1242 &ev);
1243 if (g->exclusive) exclusive = EINA_TRUE;
1244 }
1245 }
1246 if (e->delete_me) break;
1247 }
1248 e->walking_grabs--;
1249 if (e->walking_grabs <= 0)
1250 {
1251 while (e->delete_grabs > 0)
1252 {
1253 e->delete_grabs--;
1254 for (l = e->grabs; l;)
1255 {
1256 g = eina_list_data_get(l);
1257 l = eina_list_next(l);
1258 if (g->delete_me)
1259 evas_key_grab_free(g->object, g->keyname, g->modifiers,
1260 g->not_modifiers);
1261 }
1262 }
1263 }
1264 }
1265 if ((e->focused) && (!exclusive))
1266 {
1267 if (e->events_frozen <= 0 && !evas_event_freezes_through(e->focused))
1268 evas_object_event_callback_call(e->focused, EVAS_CALLBACK_KEY_DOWN,
1269 &ev);
1270 }
1271 _evas_post_event_callback_call(e);
1272 _evas_unwalk(e);
1273}
1274
1275EAPI void
1276evas_event_feed_key_up(Evas *e, const char *keyname, const char *key, const char *string, const char *compose, unsigned int timestamp, const void *data)
1277{
1278 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
1279 return;
1280 MAGIC_CHECK_END();
1281 if (!keyname) return;
1282 if (e->events_frozen > 0) return;
1283 e->last_timestamp = timestamp;
1284 _evas_walk(e);
1285
1286 Evas_Event_Key_Up ev;
1287 Eina_Bool exclusive;
1288
1289 _evas_object_event_new();
1290
1291 exclusive = EINA_FALSE;
1292 ev.keyname = (char *)keyname;
1293 ev.data = (void *)data;
1294 ev.modifiers = &(e->modifiers);
1295 ev.locks = &(e->locks);
1296 ev.key = key;
1297 ev.string = string;
1298 ev.compose = compose;
1299 ev.timestamp = timestamp;
1300 ev.event_flags = EVAS_EVENT_FLAG_NONE;
1301
1302 if (e->grabs)
1303 {
1304 Eina_List *l;
1305 Evas_Key_Grab *g;
1306
1307 e->walking_grabs++;
1308 EINA_LIST_FOREACH(e->grabs, l, g)
1309 {
1310 if (g->just_added)
1311 {
1312 g->just_added = EINA_FALSE;
1313 continue;
1314 }
1315 if (g->delete_me) continue;
1316 if (((e->modifiers.mask & g->modifiers) ||
1317 (g->modifiers == e->modifiers.mask)) &&
1318 (!((e->modifiers.mask & g->not_modifiers) ||
1319 (g->not_modifiers == ~e->modifiers.mask))) &&
1320 (!strcmp(keyname, g->keyname)))
1321 {
1322 if (e->events_frozen <= 0 &&
1323 !evas_event_freezes_through(g->object))
1324 evas_object_event_callback_call(g->object,
1325 EVAS_CALLBACK_KEY_UP, &ev);
1326 if (g->exclusive) exclusive = EINA_TRUE;
1327 }
1328 if (e->delete_me) break;
1329 }
1330 e->walking_grabs--;
1331 if (e->walking_grabs <= 0)
1332 {
1333 while (e->delete_grabs > 0)
1334 {
1335 Eina_List *ll, *l_next;
1336 Evas_Key_Grab *gr;
1337
1338 e->delete_grabs--;
1339 EINA_LIST_FOREACH_SAFE(e->grabs, ll, l_next, gr)
1340 {
1341 if (gr->delete_me)
1342 evas_key_grab_free(gr->object, gr->keyname,
1343 gr->modifiers, gr->not_modifiers);
1344 }
1345 }
1346 }
1347 }
1348 if ((e->focused) && (!exclusive))
1349 {
1350 if (e->events_frozen <= 0 && !evas_event_freezes_through(e->focused))
1351 evas_object_event_callback_call(e->focused, EVAS_CALLBACK_KEY_UP,
1352 &ev);
1353 }
1354 _evas_post_event_callback_call(e);
1355 _evas_unwalk(e);
1356}
1357
1358EAPI void
1359evas_event_feed_hold(Evas *e, int hold, unsigned int timestamp, const void *data)
1360{
1361 Eina_List *l, *copy;
1362 Evas_Event_Hold ev;
1363 Evas_Object *obj;
1364
1365 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
1366 return;
1367 MAGIC_CHECK_END();
1368
1369 if (e->events_frozen > 0) return;
1370 e->last_timestamp = timestamp;
1371
1372 _evas_object_event_new();
1373
1374 ev.hold = hold;
1375 ev.data = (void *)data;
1376 ev.timestamp = timestamp;
1377 ev.event_flags = EVAS_EVENT_FLAG_NONE;
1378
1379 _evas_walk(e);
1380 copy = evas_event_list_copy(e->pointer.object.in);
1381 EINA_LIST_FOREACH(copy, l, obj)
1382 {
1383 if ((e->events_frozen <= 0) && !evas_event_freezes_through(obj))
1384 evas_object_event_callback_call(obj, EVAS_CALLBACK_HOLD, &ev);
1385 if (e->delete_me) break;
1386 }
1387 if (copy) copy = eina_list_free(copy);
1388 _evas_post_event_callback_call(e);
1389 _evas_unwalk(e);
1390 _evas_object_event_new();
1391}
1392
1393EAPI void
1394evas_object_freeze_events_set(Evas_Object *obj, Eina_Bool freeze)
1395{
1396 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1397 return;
1398 MAGIC_CHECK_END();
1399
1400 freeze = !!freeze;
1401 if (obj->freeze_events == freeze) return;
1402 obj->freeze_events = freeze;
1403 evas_object_smart_member_cache_invalidate(obj, EINA_FALSE, EINA_TRUE);
1404 if (evas_object_is_in_output_rect(obj,
1405 obj->layer->evas->pointer.x,
1406 obj->layer->evas->pointer.y, 1, 1) &&
1407 ((!obj->precise_is_inside) ||
1408 (evas_object_is_inside(obj,
1409 obj->layer->evas->pointer.x,
1410 obj->layer->evas->pointer.y))))
1411 evas_event_feed_mouse_move(obj->layer->evas,
1412 obj->layer->evas->pointer.x,
1413 obj->layer->evas->pointer.y,
1414 obj->layer->evas->last_timestamp,
1415 NULL);
1416}
1417
1418EAPI Eina_Bool
1419evas_object_freeze_events_get(const Evas_Object *obj)
1420{
1421 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1422 return EINA_FALSE;
1423 MAGIC_CHECK_END();
1424 return obj->freeze_events;
1425}
1426
1427EAPI void
1428evas_object_pass_events_set(Evas_Object *obj, Eina_Bool pass)
1429{
1430 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1431 return;
1432 MAGIC_CHECK_END();
1433 pass = !!pass;
1434 if (obj->pass_events == pass) return;
1435 obj->pass_events = pass;
1436 evas_object_smart_member_cache_invalidate(obj, EINA_TRUE, EINA_FALSE);
1437 if (evas_object_is_in_output_rect(obj,
1438 obj->layer->evas->pointer.x,
1439 obj->layer->evas->pointer.y, 1, 1) &&
1440 ((!obj->precise_is_inside) ||
1441 (evas_object_is_inside(obj,
1442 obj->layer->evas->pointer.x,
1443 obj->layer->evas->pointer.y))))
1444 evas_event_feed_mouse_move(obj->layer->evas,
1445 obj->layer->evas->pointer.x,
1446 obj->layer->evas->pointer.y,
1447 obj->layer->evas->last_timestamp,
1448 NULL);
1449}
1450
1451EAPI Eina_Bool
1452evas_object_pass_events_get(const Evas_Object *obj)
1453{
1454 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1455 return EINA_FALSE;
1456 MAGIC_CHECK_END();
1457 return obj->pass_events;
1458}
1459
1460EAPI void
1461evas_object_repeat_events_set(Evas_Object *obj, Eina_Bool repeat)
1462{
1463 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1464 return;
1465 MAGIC_CHECK_END();
1466 repeat = !!repeat;
1467 if (obj->repeat_events == repeat) return;
1468 obj->repeat_events = repeat;
1469 if (evas_object_is_in_output_rect(obj,
1470 obj->layer->evas->pointer.x,
1471 obj->layer->evas->pointer.y, 1, 1) &&
1472 ((!obj->precise_is_inside) ||
1473 (evas_object_is_inside(obj,
1474 obj->layer->evas->pointer.x,
1475 obj->layer->evas->pointer.y))))
1476 evas_event_feed_mouse_move(obj->layer->evas,
1477 obj->layer->evas->pointer.x,
1478 obj->layer->evas->pointer.y,
1479 obj->layer->evas->last_timestamp,
1480 NULL);
1481}
1482
1483EAPI Eina_Bool
1484evas_object_repeat_events_get(const Evas_Object *obj)
1485{
1486 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1487 return EINA_FALSE;
1488 MAGIC_CHECK_END();
1489 return obj->repeat_events;
1490}
1491
1492EAPI void
1493evas_object_propagate_events_set(Evas_Object *obj, Eina_Bool prop)
1494{
1495 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1496 return;
1497 MAGIC_CHECK_END();
1498 obj->no_propagate = !prop;
1499}
1500
1501EAPI Eina_Bool
1502evas_object_propagate_events_get(const Evas_Object *obj)
1503{
1504 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1505 return EINA_FALSE;
1506 MAGIC_CHECK_END();
1507 return !(obj->no_propagate);
1508}
1509
1510EAPI void
1511evas_object_pointer_mode_set(Evas_Object *obj, Evas_Object_Pointer_Mode setting)
1512{
1513 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1514 return;
1515 MAGIC_CHECK_END();
1516 obj->pointer_mode = setting;
1517}
1518
1519EAPI Evas_Object_Pointer_Mode
1520evas_object_pointer_mode_get(const Evas_Object *obj)
1521{
1522 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1523 return EVAS_OBJECT_POINTER_MODE_AUTOGRAB;
1524 MAGIC_CHECK_END();
1525 return obj->pointer_mode;
1526}
1527
1528EAPI void
1529evas_event_refeed_event(Evas *e, void *event_copy, Evas_Callback_Type event_type)
1530{
1531 switch(event_type)
1532 {
1533 case EVAS_CALLBACK_MOUSE_IN:
1534 {
1535 Evas_Event_Mouse_In *ev = event_copy;
1536 evas_event_feed_mouse_in(e, ev->timestamp, ev->data);
1537 break;
1538 }
1539 case EVAS_CALLBACK_MOUSE_OUT:
1540 {
1541 Evas_Event_Mouse_Out *ev = event_copy;
1542 evas_event_feed_mouse_out(e, ev->timestamp, ev->data);
1543 break;
1544 }
1545 case EVAS_CALLBACK_MOUSE_DOWN:
1546 {
1547 Evas_Event_Mouse_Down *ev = event_copy;
1548 evas_event_feed_mouse_down(e, ev->button, ev->flags, ev-> timestamp, ev->data);
1549 break;
1550 }
1551 case EVAS_CALLBACK_MOUSE_UP:
1552 {
1553 Evas_Event_Mouse_Up *ev = event_copy;
1554 evas_event_feed_mouse_up(e, ev->button, ev->flags, ev-> timestamp, ev->data);
1555 break;
1556 }
1557 case EVAS_CALLBACK_MOUSE_MOVE:
1558 {
1559 Evas_Event_Mouse_Move *ev = event_copy;
1560 evas_event_feed_mouse_move(e, ev->cur.canvas.x, ev->cur.canvas.y, ev->timestamp, ev->data);
1561 break;
1562 }
1563 case EVAS_CALLBACK_MOUSE_WHEEL:
1564 {
1565 Evas_Event_Mouse_Wheel *ev = event_copy;
1566 evas_event_feed_mouse_wheel(e, ev->direction, ev-> z, ev->timestamp, ev->data);
1567 break;
1568 }
1569 case EVAS_CALLBACK_MULTI_DOWN:
1570 {
1571 Evas_Event_Multi_Down *ev = event_copy;
1572 evas_event_feed_multi_down(e, ev->device, ev->canvas.x, ev->canvas.y, ev->radius, ev->radius_x, ev->radius_y, ev->pressure, ev->angle, ev->canvas.xsub, ev->canvas.ysub, ev->flags, ev->timestamp, ev->data);
1573 break;
1574 }
1575 case EVAS_CALLBACK_MULTI_UP:
1576 {
1577 Evas_Event_Multi_Up *ev = event_copy;
1578 evas_event_feed_multi_up(e, ev->device, ev->canvas.x, ev->canvas.y, ev->radius, ev->radius_x, ev->radius_y, ev->pressure, ev->angle, ev->canvas.xsub, ev->canvas.ysub, ev->flags, ev->timestamp, ev->data);
1579 break;
1580 }
1581 case EVAS_CALLBACK_MULTI_MOVE:
1582 {
1583 Evas_Event_Multi_Move *ev = event_copy;
1584 evas_event_feed_multi_move(e, ev->device, ev->cur.canvas.x, ev->cur.canvas.y, ev->radius, ev->radius_x, ev->radius_y, ev->pressure, ev->angle, ev->cur.canvas.xsub, ev->cur.canvas.ysub, ev->timestamp, ev->data);
1585 break;
1586 }
1587 case EVAS_CALLBACK_KEY_DOWN:
1588 {
1589 Evas_Event_Key_Down *ev = event_copy;
1590 evas_event_feed_key_down(e, ev->keyname, ev->key, ev->string, ev->compose, ev->timestamp, ev->data);
1591 break;
1592 }
1593 case EVAS_CALLBACK_KEY_UP:
1594 {
1595 Evas_Event_Key_Up *ev = event_copy;
1596 evas_event_feed_key_up(e, ev->keyname, ev->key, ev->string, ev->compose, ev->timestamp, ev->data);
1597 break;
1598 }
1599 default: /* All non-input events are not handeled */
1600 break;
1601 }
1602}
diff --git a/libraries/evas/src/lib/canvas/evas_filter.c b/libraries/evas/src/lib/canvas/evas_filter.c
new file mode 100644
index 0000000..6194ec2
--- /dev/null
+++ b/libraries/evas/src/lib/canvas/evas_filter.c
@@ -0,0 +1,1427 @@
1/*
2 * Filter implementation for evas
3 */
4
5#if 0 // filtering disabled
6typedef enum
7{
8 /** Apply any filter effects to this object (Default) */
9 EVAS_FILTER_MODE_OBJECT,
10 /** Filter all objects beneath this object on the canvas */
11 EVAS_FILTER_MODE_BELOW,
12} Evas_Filter_Mode;
13typedef enum
14{
15 /** No filter: Default */
16 EVAS_FILTER_NONE,
17 /** A blur filter. Params are quality (float), and radius (int). */
18 EVAS_FILTER_BLUR,
19 /** Negates the colors of an image. Also called solarize */
20 EVAS_FILTER_INVERT,
21 EVAS_FILTER_SOLARIZE = EVAS_FILTER_INVERT,
22 /** Makes a sepia version of the image. */
23 EVAS_FILTER_SEPIA,
24 /** Makes a greyscale version of the image. Params are 'red',
25 * 'green', 'blue' (all floats) which must add to 1. The defaults are
26 * 0.3, 0.59 and 0.11 which approximates human vision. Setting 'all'
27 * sets rgb to the same value. */
28 EVAS_FILTER_GREYSCALE,
29 EVAS_FILTER_GRAYSCALE = EVAS_FILTER_GREYSCALE,
30 /** Brighten (or darken) image. Param 'adjust' float (-1.0 to 1.0)
31 * amount to adjust. */
32 EVAS_FILTER_BRIGHTNESS,
33 /** Enhance contrast on image. Param 'adjust' float (-1.0 to 1.0)
34 * amount to adjust. */
35 EVAS_FILTER_CONTRAST,
36
37 EVAS_FILTER_LAST = EVAS_FILTER_CONTRAST
38} Evas_Filter;
39
40/**
41 * Set the filter mode for an object.
42 *
43 * There are two valid filtering modes currently:
44 * - EVAS_FILTER_MODE_OBJECT: which applies the filter to the object itself
45 * - EVAS_FILTER_MODE_BELOW: which makes the object invisible and filters
46 * what is below the object.
47 *
48 * The default filter mode is EVAS_FILTER_MODE_OBJECT.
49 *
50 * @param o Object to set filter mode on.
51 * @param mode Mode to set.
52 * @return EINA_TRUE on success, EINA_FALSE otherwise.
53 */
54 EAPI Eina_Bool evas_object_filter_mode_set (Evas_Object *o, Evas_Filter_Mode mode);
55
56/**
57 * Get the current filtering mode for an object.
58 *
59 * By default all objects are in object filtering mode, even if no filter is
60 * set.
61 *
62 * @param o Object to get filter mode of.
63 * @return Filter mode (default EVAS_FILTER_MODE_OBJECT)
64 */
65 EAPI Evas_Filter_Mode evas_object_filter_mode_get (Evas_Object *o);
66
67/**
68 * Set the current filter type.
69 *
70 * This sets the filter type, whether a blur, color filter or some other type
71 * of filter. This is normally the only filter call necessary, although some
72 * filters require additional parameters.
73 *
74 * If the object has a filter already, and existing parameters will be
75 * cleared.
76 *
77 * Setting the blur to EVAS_FILTER_NONE removes any filter.
78 *
79 * @param o Object to set the filter on.
80 * @param filter Filter to set.
81 * @return EINA_TRUE On success
82 */
83 EAPI Eina_Bool evas_object_filter_set (Evas_Object *o, Evas_Filter filter);
84
85/**
86 * Get the current filter.
87 *
88 * @param o Object to get filter of.
89 * @return The filter if set, or EVAS_FILTER_NONE.
90 */
91 EAPI Evas_Filter evas_object_filter_get (Evas_Object *o);
92
93/**
94 * Set an integer parameter of a filter.
95 *
96 * This sets an integer parameter of a filter, if such parameter is known to
97 * the filter. Note that some parameters may actually set multiple fields.
98 * The individual filters define the specific parameters available.
99 *
100 * It should be noted that filter parameters are lost after the filter type
101 * changes, so set the filter type, then the parameters.
102 *
103 * @param o Object to set parameter on.
104 * @param param Name of parameter to set.
105 * @param val Value to set.
106 * @return EINA_TRUE if at least one parameter was set, EINA_FALSE
107 * otherwise.
108 */
109 EAPI Eina_Bool evas_object_filter_param_int_set (Evas_Object *o, const char *param, int val);
110
111/**
112 * Get an integer value parameter from a filter.
113 *
114 * Gets the first matching parameter for a filter. Note there is no way to
115 * later fields if they do not have their own accessor name.
116 *
117 * Also note that there is no way to tell the difference between a -1 as a
118 * value, and the error code. Ask your filter writer to use a different
119 * range.
120 *
121 * @param o The object.
122 * @Param param Name of the parameter to get.
123 * @return The value, or -1 on error.
124 */
125 EAPI int evas_object_filter_param_int_get (Evas_Object *o, const char *param);
126
127/**
128 * Set a string parameter on a filter
129 *
130 * Currently unimplemented as no filters use this yet
131 */
132 EAPI Eina_Bool evas_object_filter_param_str_set (Evas_Object *o, const char *param, const char *val);
133
134/**
135 * Get a string parameter from a filter
136 *
137 * Currently unimplemented as no filters use this yet
138 */
139 EAPI const char *evas_object_filter_param_str_get (Evas_Object *o, const char *param);
140
141/**
142 * Set an object parameter on a filter
143 *
144 * Currently unimplemented as no filters use this yet
145 */
146 EAPI Eina_Bool evas_object_filter_param_obj_set (Evas_Object *o, const char *param, Evas_Object *val);
147
148/**
149 * get an object parameter from a filter
150 *
151 * Currently unimplemented as no filters use this yet
152 */
153 EAPI Evas_Object *evas_object_filter_param_obj_get (Evas_Object *o, const char *param);
154
155/**
156 * Set a float parameter of a filter.
157 *
158 * This is the same as evas_object_filter_param_int_set(), but for floating
159 * point values.
160 *
161 * @param o Object to set value on.
162 * @param param Name of the parameter to set.
163 * @param EINA_TRUE if at least one parameter was set, EINA_FALSE otherwise.
164 */
165 EAPI Eina_Bool evas_object_filter_param_float_set(Evas_Object *o, const char *param, double val);
166
167/**
168 * Get a float parameter of a filter.
169 *
170 * This is the same as evas_object_filter_param_int_get(), but for floating
171 * point values.
172 *
173 * @param o Object to set value on.
174 * @param param Name of the parameter to set.
175 * @return The value, or -1 on error.
176 */
177 EAPI double evas_object_filter_param_float_get(Evas_Object *o, const char *param);
178
179#include <stddef.h> // offsetof
180
181#include "evas_common.h"
182#include "evas_private.h"
183
184#include <assert.h>
185/* disable neon - even after fixes:
186 * Error: ARM register expected -- vdup.u32 q14,$0xff000000'
187 * not going to fix now
188#ifdef BUILD_NEON
189# define BUILD_NEON0 1
190#else
191# define BUILD_NEON0 0
192#endif
193*/
194
195#define BUILD_NEON0 0
196
197typedef struct Evas_Filter_Info_Blur
198{
199 double quality;
200 int radius;
201} Evas_Filter_Info_Blur;
202
203typedef struct Evas_Filter_Info_GreyScale
204{
205 double r,g,b;
206} Evas_Filter_Info_GreyScale;
207
208typedef struct Evas_Filter_Info_Brightness
209{
210 double adjust;
211} Evas_Filter_Info_Brightness;
212
213typedef struct Evas_Filter_Info_Contrast
214{
215 double adjust;
216} Evas_Filter_Info_Contrast;
217
218typedef int (*Filter_Size_FN)(Evas_Filter_Info *,int,int,int*,int*,Eina_Bool);
219typedef uint8_t *(*Key_FN)(const Evas_Filter_Info *, uint32_t *);
220
221struct fieldinfo
222{
223 const char *field;
224 int type;
225 size_t offset;
226};
227
228struct filterinfo
229{
230 Evas_Software_Filter_Fn filter;
231 const size_t datasize;
232 Filter_Size_FN sizefn;
233 Key_FN keyfn;
234 Eina_Bool alwaysalpha;
235};
236
237enum
238{
239 TYPE_INT,
240 TYPE_FLOAT
241};
242
243static int blur_size_get(Evas_Filter_Info*, int, int, int *, int *, Eina_Bool);
244static uint8_t *gaussian_key_get(const Evas_Filter_Info *, uint32_t *);
245
246static Eina_Bool gaussian_filter(Evas_Filter_Info *, RGBA_Image*, RGBA_Image*);
247static Eina_Bool negation_filter(Evas_Filter_Info *, RGBA_Image*, RGBA_Image*);
248static Eina_Bool sepia_filter(Evas_Filter_Info *, RGBA_Image*, RGBA_Image*);
249static Eina_Bool greyscale_filter(Evas_Filter_Info*, RGBA_Image*, RGBA_Image*);
250static Eina_Bool brightness_filter(Evas_Filter_Info*, RGBA_Image*, RGBA_Image*);
251static Eina_Bool contrast_filter(Evas_Filter_Info *, RGBA_Image*, RGBA_Image*);
252
253struct filterinfo filterinfo[] =
254{
255 /* None */
256 { NULL, 0, NULL, NULL, EINA_FALSE},
257 /* Blur */
258 { gaussian_filter, sizeof(Evas_Filter_Info_Blur), blur_size_get, gaussian_key_get, EINA_TRUE },
259 /* Negation */
260 { negation_filter, 0, NULL, NULL, EINA_FALSE },
261 /* Sepia */
262 { sepia_filter, 0, NULL, NULL, EINA_FALSE },
263 /* Greyscale */
264 { greyscale_filter, sizeof(Evas_Filter_Info_GreyScale), NULL, NULL, EINA_FALSE },
265 /* Brightness */
266 { brightness_filter, sizeof(Evas_Filter_Info_Brightness), NULL, NULL, EINA_FALSE },
267 /* Contrast */
268 { contrast_filter, sizeof(Evas_Filter_Info_Contrast), NULL, NULL, EINA_FALSE},
269};
270
271
272static struct fieldinfo blurfields[] =
273{
274 { "quality", TYPE_FLOAT, offsetof(Evas_Filter_Info_Blur, quality) },
275 { "radius", TYPE_INT, offsetof(Evas_Filter_Info_Blur, radius) },
276 { NULL, 0, 0 },
277};
278
279static struct fieldinfo greyfields[] =
280{
281 { "red", TYPE_FLOAT, offsetof(Evas_Filter_Info_GreyScale, r) },
282 { "green", TYPE_FLOAT, offsetof(Evas_Filter_Info_GreyScale, g) },
283 { "blue", TYPE_FLOAT, offsetof(Evas_Filter_Info_GreyScale, b) },
284
285 { "all", TYPE_FLOAT, offsetof(Evas_Filter_Info_GreyScale, r) },
286 { "all", TYPE_FLOAT, offsetof(Evas_Filter_Info_GreyScale, g) },
287 { "all", TYPE_FLOAT, offsetof(Evas_Filter_Info_GreyScale, b) },
288 { NULL, 0, 0 },
289};
290
291static struct fieldinfo brightnessfields[] =
292{
293 { "adjust", TYPE_FLOAT, offsetof(Evas_Filter_Info_Brightness, adjust) },
294 { NULL, 0, 0 },
295};
296
297static struct fieldinfo contrastfields[] =
298{
299 { "adjust", TYPE_FLOAT, offsetof(Evas_Filter_Info_Contrast, adjust) },
300 { NULL, 0, 0 },
301};
302
303static struct fieldinfo *filterfields[] =
304{
305 NULL,
306 blurfields,
307 NULL,
308 NULL,
309 greyfields,
310 brightnessfields,
311 contrastfields,
312};
313
314static Evas_Filter_Info *filter_alloc(Evas_Object *o);
315
316EAPI Eina_Bool
317evas_object_filter_mode_set(Evas_Object *o, Evas_Filter_Mode mode)
318{
319 Evas_Filter_Info *info;
320
321 MAGIC_CHECK(o, Evas_Object, MAGIC_OBJ);
322 return EINA_FALSE;
323 MAGIC_CHECK_END();
324
325 if ((mode != EVAS_FILTER_MODE_OBJECT) && (mode != EVAS_FILTER_MODE_BELOW))
326 return EINA_FALSE;
327
328 if (!o->filter)
329 {
330 filter_alloc(o);
331 }
332 if (!o->filter) return EINA_FALSE;
333 info = o->filter;
334
335 if (info->mode == mode) return EINA_TRUE; /* easy case */
336 info->mode = mode;
337 info->dirty = 1;
338 return EINA_TRUE;
339}
340
341EAPI Evas_Filter_Mode
342evas_object_filter_mode_get(Evas_Object *o)
343{
344 MAGIC_CHECK(o, Evas_Object, MAGIC_OBJ);
345 return EVAS_FILTER_MODE_OBJECT;
346 MAGIC_CHECK_END();
347
348 if (!o->filter) return EVAS_FILTER_MODE_OBJECT;
349 return o->filter->mode;
350}
351
352EAPI Eina_Bool
353evas_object_filter_set(Evas_Object *o, Evas_Filter filter)
354{
355 Evas_Filter_Info *info;
356 struct filterinfo *finfo;
357
358 MAGIC_CHECK(o, Evas_Object, MAGIC_OBJ);
359 return EINA_FALSE;
360 MAGIC_CHECK_END();
361
362 /* force filter to be signed: else gcc complains, but enums may always be
363 * signed */
364 if (((int)filter < (int)EVAS_FILTER_NONE) || (filter > EVAS_FILTER_LAST))
365 return EINA_FALSE;
366
367 /* Don't alloc on no-op */
368 if (!o-filter && filter == EVAS_FILTER_NONE) return EINA_TRUE;
369
370 if (!o->filter) filter_alloc(o);
371 if (!o->filter) return EINA_FALSE;
372
373 info = o->filter;
374
375 if (info->filter == filter) return EINA_TRUE;
376
377 finfo = filterinfo + filter;
378 info->filter = filter;
379 info->dirty = 1;
380 if (info->data)
381 {
382 if (info->data_free)
383 info->data_free(info->data);
384 else
385 free(info->data);
386 }
387 info->datalen = finfo->datasize;
388 if (finfo->datasize)
389 {
390 info->data = calloc(1, finfo->datasize);
391 if (!info->data)
392 {
393 o->filter = EVAS_FILTER_NONE;
394 return EINA_FALSE;
395 }
396 }
397 else
398 info->data = NULL;
399 info->data_free = NULL;
400
401 return EINA_TRUE;
402}
403
404EAPI Evas_Filter
405evas_object_filter_get(Evas_Object *o)
406{
407 MAGIC_CHECK(o, Evas_Object, MAGIC_OBJ);
408 return EVAS_FILTER_NONE;
409 MAGIC_CHECK_END();
410
411 if (!o->filter) return EVAS_FILTER_NONE;
412 return o->filter->filter;
413}
414
415EAPI Eina_Bool
416evas_object_filter_param_int_set(Evas_Object *o, const char *param, int val)
417{
418 char *data;
419 const struct fieldinfo *fields;
420 Eina_Bool found;
421 int i;
422
423 MAGIC_CHECK(o, Evas_Object, MAGIC_OBJ);
424 return EINA_FALSE;
425 MAGIC_CHECK_END();
426
427 if ((!o->filter) || (!o->filter->data)) return EINA_FALSE;
428
429 fields = filterfields[o->filter->filter];
430 data = o->filter->data;
431 found = EINA_FALSE;
432 for (i = 0; fields[i].field; i++)
433 {
434 if (!strcmp(fields[i].field, param))
435 {
436 if (fields[i].type != TYPE_INT) continue;
437 *(int *)(data + fields[i].offset) = val;
438 o->filter->dirty = 1;
439 evas_object_change(o);
440 found = EINA_TRUE;
441 }
442 }
443 return found;
444}
445
446EAPI int
447evas_object_filter_param_int_get(Evas_Object *o, const char *param)
448{
449 char *data;
450 const struct fieldinfo *fields;
451 int val;
452 int i;
453
454 MAGIC_CHECK(o, Evas_Object, MAGIC_OBJ);
455 return -1;
456 MAGIC_CHECK_END();
457
458 if ((!o->filter) || (!o->filter->data)) return -1;
459
460 fields = filterfields[o->filter->filter];
461 if (!fields) return -1;
462 data = o->filter->data;
463
464 for (i = 0; fields[i].field; i++)
465 {
466 if (!strcmp(fields[i].field, param))
467 {
468 if (fields[i].type != TYPE_INT) continue;
469 val = *(int *)(data + fields[i].offset);
470 return val;
471 }
472 }
473 return -1;
474}
475
476EAPI Eina_Bool
477evas_object_filter_param_str_set(Evas_Object *o __UNUSED__,
478 const char *param __UNUSED__,
479 const char *val __UNUSED__)
480{
481 return EINA_FALSE;
482}
483
484EAPI const char *
485evas_object_filter_param_str_get(Evas_Object *o __UNUSED__,
486 const char *param __UNUSED__)
487{
488 return NULL;
489}
490
491EAPI Eina_Bool
492evas_object_filter_param_obj_set(Evas_Object *o __UNUSED__,
493 const char *param __UNUSED__,
494 Evas_Object *val __UNUSED__)
495{
496 return EINA_FALSE;
497}
498
499EAPI Evas_Object *
500evas_object_filter_param_obj_get(Evas_Object *o __UNUSED__,
501 const char *param __UNUSED__)
502{
503 return NULL;
504}
505
506EAPI Eina_Bool
507evas_object_filter_param_float_set(Evas_Object *o, const char *param,
508 double val)
509{
510 char *data;
511 const struct fieldinfo *fields;
512 int i;
513 Eina_Bool rv;
514
515 MAGIC_CHECK(o, Evas_Object, MAGIC_OBJ);
516 return EINA_FALSE;
517 MAGIC_CHECK_END();
518
519 if ((!o->filter) || (!o->filter->data)) return EINA_FALSE;
520
521 rv = EINA_FALSE;
522 fields = filterfields[o->filter->filter];
523 if (!fields) return EINA_FALSE;
524
525 data = o->filter->data;
526
527 for (i = 0; fields[i].field; i++)
528 {
529 if (!strcmp(fields[i].field, param))
530 {
531 if (fields[i].type != TYPE_FLOAT) continue;
532 *(double *)(data + fields[i].offset) = val;
533 o->filter->dirty = 1;
534 o->changed = 1;
535 evas_object_change(o);
536 rv = EINA_TRUE;
537 }
538 }
539 return rv;
540}
541
542EAPI double
543evas_object_filter_param_float_get(Evas_Object *o, const char *param)
544{
545 char *data;
546 const struct fieldinfo *fields;
547 double val;
548 int i;
549
550 MAGIC_CHECK(o, Evas_Object, MAGIC_OBJ);
551 return -1;
552 MAGIC_CHECK_END();
553
554 if ((!o->filter) || (!o->filter->data)) return -1;
555
556 fields = filterfields[o->filter->filter];
557 if (!fields) return -1;
558 data = o->filter->data;
559
560 for (i = 0; fields[i].field; i++)
561 {
562 if (!strcmp(fields[i].field, param))
563 {
564 if (fields[i].type != TYPE_FLOAT) continue;
565 val = *(double *)(data + fields[i].offset);
566 return val;
567 }
568 }
569 return -1;
570}
571
572
573
574
575
576/*
577 * Internal call
578 */
579int
580evas_filter_get_size(Evas_Filter_Info *info, int inw, int inh,
581 int *outw, int *outh, Eina_Bool inv)
582{
583 if (!info) return -1;
584 if ((!outw) && (!outh)) return 0;
585
586 if (filterinfo[info->filter].sizefn)
587 return filterinfo[info->filter].sizefn(info, inw, inh, outw, outh, inv);
588
589 if (outw) *outw = inw;
590 if (outh) *outh = inh;
591 return 0;
592}
593
594Eina_Bool
595evas_filter_always_alpha(Evas_Filter_Info *info)
596{
597 if (!info) return EINA_FALSE;
598 return filterinfo[info->filter].alwaysalpha;
599}
600
601/*
602 * Another internal call:
603 * Given a filterinfo, generate a unique key for it
604 *
605 * For simple filters, it's just the filter type.
606 * for more complex filters, it's the type, with it's params.
607 *
608 * Note management of the key data is up to the caller, that is it should
609 * probably be freed after use.
610 *
611 * Note the automatic fallback generation places the single byte at the end so
612 * the memcpy will be aligned. Micro-optimisations FTW!
613 *
614 * @param info Filter info to generate from
615 * @param len Length of the buffer returned.
616 * @return key Key buffer
617 */
618uint8_t *
619evas_filter_key_get(const Evas_Filter_Info *info, uint32_t *lenp)
620{
621 struct filterinfo *finfo;
622 uint8_t *key;
623 int len;
624
625 if (!info) return NULL;
626
627 finfo = filterinfo + info->filter;
628 if (finfo->keyfn) return finfo->keyfn(info, lenp);
629
630 len = 1 + finfo->datasize;
631 key = malloc(len);
632 if (!key) return NULL;
633 if (finfo->datasize) memcpy(key, info->data, finfo->datasize);
634 key[finfo->datasize] = info->filter;
635 if (lenp) *lenp = len;
636 return key;
637}
638
639Evas_Software_Filter_Fn
640evas_filter_software_get(Evas_Filter_Info *info)
641{
642 return filterinfo[info->filter].filter;
643}
644
645void
646evas_filter_free(Evas_Object *o)
647{
648 if (!o->filter) return;
649 if (o->filter->key) free(o->filter->key);
650 free(o->filter);
651 o->filter = NULL;
652}
653
654
655
656
657/*
658 * Private calls
659 */
660static Evas_Filter_Info *
661filter_alloc(Evas_Object *o)
662{
663 Evas_Filter_Info *info;
664
665 if (!o) return NULL;
666 info = calloc(1,sizeof(struct Evas_Filter_Info));
667 if (!info) return NULL;
668 info->dirty = 1;
669 info->filter = EVAS_FILTER_NONE;
670 info->mode = EVAS_FILTER_MODE_OBJECT;
671 info->datalen = 0;
672
673 o->filter = info;
674
675 return info;
676}
677
678static int
679blur_size_get(Evas_Filter_Info *info, int inw, int inh, int *outw, int *outh,
680 Eina_Bool inv)
681{
682 Evas_Filter_Info_Blur *blur = info->data;
683
684 if (inv)
685 {
686 if (outw) *outw = MAX(inw - (blur->radius * 2), 0);
687 if (outh) *outh = MAX(inh - (blur->radius * 2), 0);
688 }
689 else
690 {
691 if (outw) *outw = inw + (blur->radius * 2);
692 if (outh) *outh = inh + (blur->radius * 2);
693 }
694 return 0;
695}
696
697/*
698 * Generate a key for the Gaussian generator.
699 *
700 * The size is:
701 * - 1 byte for the type (blur)
702 * - 1 byte for the quality (0-1 -> 0-255)
703 * - 2 bytes for radius (max is 508 anyway)
704 *
705 * @param info Filter info
706 * @param len Length of the returned buffer
707 * @return new buffer
708 */
709static uint8_t *
710gaussian_key_get(const Evas_Filter_Info *info, uint32_t *lenp)
711{
712 struct Evas_Filter_Info_Blur *blur;
713 uint8_t *key;
714
715 if ((!info) || (!info->data)) return NULL;
716 blur = info->data;
717
718 if (lenp) *lenp = 4;
719 key = malloc(4);
720 if (!key) return NULL;
721 key[0] = EVAS_FILTER_BLUR;
722 key[1] = blur->quality * 255;
723 key[2] = blur->radius >> 8;
724 key[3] = blur->radius;
725
726 return key;
727}
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747/**
748 * Software implementations
749 */
750#define all(OP, A, R, G, B, W, I) \
751 do { \
752 A OP A_VAL(I) * W; \
753 R OP R_VAL(I) * W; \
754 G OP G_VAL(I) * W; \
755 B OP B_VAL(I) * W; \
756 } while (0)
757#define wavg(x,n) (((x) / (n)) & 0xff)
758#define wavgd(x,n) ((uint32_t)((x) / (n)) & 0xff)
759
760typedef int (*FilterH)(int, uint32_t *, int, uint32_t *);
761typedef int (*FilterV)(int, uint32_t *, int, int, uint32_t *);
762
763static int gaussian_filter_h(int rad, uint32_t *in, int w, uint32_t *out);
764static int gaussian_filter_h64(int rad, uint32_t *in, int w, uint32_t *out);
765static int gaussian_filter_hd(int rad, uint32_t *in, int w, uint32_t *out);
766static int gaussian_filter_v(int rad, uint32_t *in, int h, int skip, uint32_t *out);
767static int gaussian_filter_v64(int rad, uint32_t *in, int h, int skip, uint32_t *out);
768static int gaussian_filter_vd(int rad, uint32_t *in, int h, int skip, uint32_t *out);
769static const uint32_t *gaussian_row_get(int row, int *npoints, uint32_t *weight);
770static const uint64_t *gaussian_row_get64(int row, int *npoints, uint64_t *weight);
771static const double *gaussian_row_getd(int row, int *npoints, double *weight);
772
773static Eina_Bool
774gaussian_filter(Evas_Filter_Info *filter, RGBA_Image *src, RGBA_Image *dst)
775{
776 int i;
777 uint32_t nw, nh;
778 uint32_t *in, *tmp, *out;
779 FilterV filter_v = gaussian_filter_v;
780 FilterH filter_h = gaussian_filter_h;
781 Evas_Filter_Info_Blur *blur;
782 int w, h;
783
784 blur = filter->data;
785
786 /* Use 64 bit version if we are going to overflow */
787 if (blur->radius > 508) /** too big for doubles: Bail out */
788 return EINA_FALSE;
789 else if (blur->radius > 28)
790 {
791 filter_v = gaussian_filter_vd;
792 filter_h = gaussian_filter_hd;
793 }
794 else if (blur->radius > 12)
795 {
796 filter_v = gaussian_filter_v64;
797 filter_h = gaussian_filter_h64;
798 }
799
800 w = src->cache_entry.w;
801 h = src->cache_entry.h;
802 in = src->image.data;
803
804 if (!in) return EINA_FALSE;
805
806 nw = w + (2 * blur->radius);
807 nh = h + (2 * blur->radius);
808
809 out = dst->image.data;
810 if (!out) return EINA_FALSE;
811 tmp = malloc(nw * h * sizeof(uint32_t));
812
813 for (i = 0; i < h; i++)
814 filter_h(blur->radius,in + (i * w), w, tmp + (i * nw));
815
816 for (i = 0; i < (int)nw; i++)
817 filter_v(blur->radius,tmp + i, h, nw, out + i);
818
819 free(tmp);
820 return EINA_TRUE;
821}
822
823/* Blur only horizontally */
824static int
825gaussian_filter_h(int rad, uint32_t *in, int w, uint32_t *out)
826{
827 const uint32_t *points;
828 int npoints = 0;
829 uint32_t weight = 0;
830 int i = 0, k = 0;
831 uint32_t r, g, b, a;
832
833 /* Get twice the radius: even rows have 1 element */
834 points = gaussian_row_get(rad * 2, &npoints, &weight);
835 for (i = -rad; i < (w + rad); i++)
836 {
837 r = g = b = a = 0;
838 for (k = -rad; k <= rad; k++)
839 {
840 if ((k + i) < 0) continue;
841 if ((k + i) >= w) continue;
842 all(+=, a, r, g, b, points[k + rad], in + k + i);
843 }
844 *(out) = ARGB_JOIN(wavg(a, weight),
845 wavg(r, weight),
846 wavg(g, weight),
847 wavg(b, weight));
848 out++;
849 }
850 return 0;
851}
852
853/* Blur only horizontally */
854static int
855gaussian_filter_hd(int rad, uint32_t *in, int w, uint32_t *out)
856{
857 const double *points;
858 int npoints = 0;
859 double weight = 0.0;
860 int i = 0, k = 0;
861 double r, g, b, a;
862
863 /* Get twice the radius: even rows have 1 element */
864 points = gaussian_row_getd(rad * 2, &npoints, &weight);
865 for (i = -rad; i < (w + rad); i++)
866 {
867 r = g = b = a = 0;
868 for (k = -rad; k <= rad; k++)
869 {
870 if ((k + i) < 0) continue;
871 if ((k + i) >= w) continue;
872 all(+=, a, r, g, b, points[k + rad], in + k + i);
873 }
874 *(out) = ARGB_JOIN(wavgd(a, weight),
875 wavgd(r, weight),
876 wavgd(g, weight),
877 wavgd(b, weight));
878 out++;
879 }
880 return 0;
881}
882
883
884/* Blur only horizontally */
885static int
886gaussian_filter_h64(int rad, uint32_t *in, int w, uint32_t *out)
887{
888 const uint64_t *points;
889 int npoints = 0;
890 uint64_t weight = 0;
891 int i = 0, k = 0;
892 uint64_t r, g, b, a;
893
894 /* Get twice the radius: even rows have 1 element */
895 points = gaussian_row_get64(rad * 2, &npoints, &weight);
896 for (i = -rad ; i < w + rad; i ++){
897 r = g = b = a = 0;
898 for (k = -rad ; k <= rad ; k ++){
899 if ((k + i) < 0) continue;
900 if ((k + i) >= w) continue;
901 all(+=, a, r, g, b, points[k + rad], in + k + i);
902 }
903 *(out) = ARGB_JOIN(wavg(a, weight),
904 wavg(r, weight),
905 wavg(g, weight),
906 wavg(b, weight));
907 out++;
908 }
909 return 0;
910}
911
912static int
913gaussian_filter_v(int rad, uint32_t *in, int h, int skip, uint32_t *out)
914{
915 const uint32_t *points;
916 int npoints = 0;
917 uint32_t weight = 0;
918 int i = 0, k = 0;
919 uint32_t r, g, b, a;
920
921 /* Get twice the radius: even rows have 1 element */
922 points = gaussian_row_get(rad * 2, &npoints, &weight);
923 weight = 0;
924 for (i = 0; i < npoints; i++) weight += points[i];
925
926 for (i = -rad; i < (h + rad); i++)
927 {
928 r = g = b = a = 0;
929 for (k = -rad; k <= rad; k++)
930 {
931 if ((k + i) < 0) continue;
932 if ((k + i) >= h) continue;
933 all(+=, a, r, g, b, points[k + rad], in + (skip * (k + i)));
934 }
935 *(out) = ARGB_JOIN(wavg(a, weight),
936 wavg(r, weight),
937 wavg(g, weight),
938 wavg(b, weight));
939 out += skip;
940 }
941 return 0;
942}
943
944static int
945gaussian_filter_v64(int rad, uint32_t *in, int h, int skip, uint32_t *out)
946{
947 const uint64_t *points;
948 int npoints = 0;
949 uint64_t weight;
950 int i = 0, k = 0;
951 uint64_t r, g, b, a;
952
953 /* Get twice the radius: even rows have 1 element */
954 points = gaussian_row_get64(rad * 2, &npoints, &weight);
955 weight = 0;
956 for (i = 0; i < npoints; i++) weight += points[i];
957
958 for (i = -rad; i < (h + rad); i++)
959 {
960 r = g = b = a = 0;
961 for (k = -rad ; k <= rad ; k++)
962 {
963 if ((k + i) < 0) continue;
964 if ((k + i) >= h) continue;
965 all(+=, a, r, g, b, points[k + rad], in + (skip * (k + i)));
966 }
967 *(out) = ARGB_JOIN(wavg(a, weight),
968 wavg(r, weight),
969 wavg(g, weight),
970 wavg(b, weight));
971 out += skip;
972 }
973 return 0;
974}
975
976static int
977gaussian_filter_vd(int rad, uint32_t *in, int h, int skip, uint32_t *out)
978{
979 const double *points;
980 int npoints = 0;
981 double weight = 0.0;
982 int i = 0, k = 0;
983 double r, g, b, a;
984
985 /* Get twice the radius: even rows have 1 element */
986 points = gaussian_row_getd(rad * 2, &npoints, &weight);
987 weight = 0;
988 for (i = 0 ; i < npoints ; i ++) weight += points[i];
989
990 for (i = -rad ; i < h + rad; i ++)
991 {
992 r = g = b = a = 0;
993 for (k = -rad ; k <= rad ; k ++)
994 {
995 if ((k + i) < 0) continue;
996 if ((k + i) >= h) continue;
997 all(+=, a, r, g, b, points[k + rad], in + (skip * (k + i)));
998 }
999 *(out) = ARGB_JOIN(wavgd(a, weight),
1000 wavgd(r, weight),
1001 wavgd(g, weight),
1002 wavgd(b, weight));
1003 out += skip;
1004 }
1005 return 0;
1006}
1007
1008static const uint32_t *
1009gaussian_row_get(int row, int *npoints, uint32_t *weight)
1010{
1011 static uint32_t *points = NULL;
1012 static int last = -1;
1013 static uint32_t lastweight = -1;
1014 int c, k;
1015
1016 if (row < 0) return NULL;
1017
1018 if (npoints) *npoints = row + 1;
1019
1020 if (last == row)
1021 {
1022 if (weight) *weight = lastweight;
1023 return points;
1024 }
1025 if (points) free(points);
1026
1027 points = malloc((row + 1) * sizeof(uint32_t));
1028 if (!points)
1029 {
1030 last = -1;
1031 return NULL;
1032 }
1033 last = row;
1034
1035 c = 1;
1036 for (k = 0; k <= row; k++)
1037 {
1038 points[k] = c;
1039 c = c * (row - k) / (k + 1);
1040 }
1041
1042 for (k = 0, lastweight = 0; k <= row; k++) lastweight += points[k];
1043 if (weight) *weight = lastweight;
1044 return points;
1045}
1046
1047static const uint64_t *
1048gaussian_row_get64(int row, int *npoints, uint64_t *weight)
1049{
1050 static uint64_t *points = NULL;
1051 static int last = -1;
1052 static uint64_t lastweight = -1;
1053 uint64_t c;
1054 int k;
1055
1056 if (row < 0) return NULL;
1057
1058 if (npoints) *npoints = row + 1;
1059 if (last == row)
1060 {
1061 if (weight) *weight = lastweight;
1062 return points;
1063 }
1064 if (points) free(points);
1065
1066 points = malloc((row + 1) * sizeof(uint64_t));
1067 if (!points)
1068 {
1069 last = -1;
1070 return NULL;
1071 }
1072 last = row;
1073
1074 c = 1;
1075 for (k = 0; k <= row; k++)
1076 {
1077 points[k] = c;
1078 c = c * (row - k) / (k + 1);
1079 }
1080
1081 for (k = 0, lastweight = 0; k <= row; k ++) lastweight += points[k];
1082 if (weight) *weight = lastweight;
1083
1084 return points;
1085}
1086
1087static const double *
1088gaussian_row_getd(int row, int *npoints, double *weight)
1089{
1090 static double *points = NULL;
1091 static int last = -1;
1092 static double lastweight = -1;
1093 double c;
1094 int k;
1095
1096 if (row < 0) return NULL;
1097
1098 if (last == row)
1099 {
1100 if (weight) *weight = lastweight;
1101 return points;
1102 }
1103
1104 if (points) free(points);
1105 points = malloc((row + 1) * sizeof(double));
1106 if (!points)
1107 {
1108 last = -1;
1109 return NULL;
1110 }
1111 last = row;
1112
1113 if (npoints) *npoints = row + 1;
1114
1115 c = 1;
1116 for (k = 0; k <= row; k++)
1117 {
1118 points[k] = c;
1119 c = c * (row - k) / (k + 1);
1120 }
1121
1122 for (k = 0, lastweight = 0; k <= row; k++) lastweight += points[k];
1123 if (weight) *weight = lastweight;
1124
1125 return points;
1126}
1127
1128#if BUILD_NEON0
1129static Eina_Bool
1130negation_filter_neon(Evas_Filter_Info *info, RGBA_Image *src, RGBA_Image *dst)
1131{
1132 uint32_t tmp;
1133
1134 if (src->cache_entry.flags.alpha)
1135 {
1136 // FIXME: not implemented
1137 }
1138 else
1139 {
1140 /* No alpha */
1141#define AP "NEG_FILTER_NA"
1142 asm volatile (
1143
1144 ".fpu neon \n\t"
1145 "vdup.u32 q14, $0xff000000 \n\t"
1146 "vmvn.u32 q15, q1 \n\t"
1147
1148 // fixme: do check for small loops
1149 AP"loopinit: \n\t"
1150 "sub %[tmp], %[e], #31 \n\t"
1151
1152 AP"loop: \n\t"
1153 "vldm %[s]!, {d0,d1,d2,d3} \n\t"
1154 "vand q2, q0, q15 \n\t"
1155 "vand q3, q1, q15 \n\t"
1156 "vand q4, q0, q14 \n\t"
1157 "vand q5, q1, q14 \n\t"
1158 // fixme: can i do this with xor
1159 "cmp %[tmp], %[s] \n\t"
1160
1161 "vmvn q6, q2 \n\t"
1162 "vmvn q7, q3 \n\t"
1163
1164 "vorr q0, q6,q4 \n\t"
1165 "vorr q1, q7,q5 \n\t"
1166
1167 "vstm %[d]!, {d0,d1,d2,d3} \n\t"
1168
1169 "bhi "AP"loop \n\t"
1170
1171 : // no out
1172 : // input
1173 [e] "r" (src->image.data+ src->cache_entry.w*src->cache_entry.h),
1174 [s] "r" (src->image.data),
1175 [tmp] "r" (tmp),
1176 [d] "r" (dst->image.data)
1177 : "q0", "q1", "q2", "q3", "q4", "q5", "q6", "q7", "q14", "q15",
1178 "memory"
1179 );
1180#undef AP
1181 }
1182 return EINA_TRUE;
1183}
1184#endif
1185
1186static Eina_Bool
1187negation_filter(Evas_Filter_Info *info, RGBA_Image *src, RGBA_Image *dst)
1188{
1189 uint32_t *in, *out;
1190 int i,j;
1191 int w,h;
1192 uint32_t a;
1193 uint8_t r,g,b;
1194
1195#if BUILD_NEON0
1196 if (evas_common_cpu_has_feature(CPU_FEATURE_NEON) &&
1197 (!src->cache_entry.flags.alpha))
1198 return negation_filter_neon(info, src, dst);
1199#endif
1200
1201 in = src->image.data;
1202 out = dst->image.data;
1203 w = src->cache_entry.w;
1204 h = src->cache_entry.h;
1205
1206 if (src->cache_entry.flags.alpha)
1207 {
1208 for (i = 0; i < h; i++)
1209 {
1210 for (j = 0; j < w; j++)
1211 {
1212 a = A_VAL(in);
1213 r = R_VAL(in);
1214 g = G_VAL(in);
1215 b = B_VAL(in);
1216 *out = ARGB_JOIN(a, a - r, a - g, a - b);
1217 out++;
1218 in++;
1219 }
1220 }
1221 }
1222 else
1223 {
1224 for (i = 0; i < h; i++)
1225 {
1226 for (j = 0; j < w; j++)
1227 {
1228 a = A_VAL(in);
1229 r = R_VAL(in);
1230 g = G_VAL(in);
1231 b = B_VAL(in);
1232 *out = ARGB_JOIN(a, ~r, ~g, ~b);
1233 out++;
1234 in++;
1235 }
1236 }
1237 }
1238 return EINA_TRUE;
1239 info = NULL;
1240}
1241
1242static Eina_Bool
1243sepia_filter(Evas_Filter_Info *info __UNUSED__, RGBA_Image *src, RGBA_Image *dst)
1244{
1245 uint32_t *in, *out;
1246 int i, j;
1247 int w, h;
1248 uint32_t a, r, g, b, nr, ng, nb;
1249
1250 in = src->image.data;
1251 out = dst->image.data;
1252 w = src->cache_entry.w;
1253 h = src->cache_entry.h;
1254
1255 for (i = 0; i < h; i++)
1256 {
1257 for (j = 0; j < w; j++)
1258 {
1259 a = A_VAL(in);
1260 r = R_VAL(in);
1261 g = G_VAL(in);
1262 b = B_VAL(in);
1263 nr = ((uint32_t)((r * 0.393) + (g * 0.769) + (b * 0.189)));
1264 ng = ((uint32_t)((r * 0.349) + (g * 0.686) + (b * 0.168)));
1265 nb = ((uint32_t)((r * 0.272) + (g * 0.534) + (b * 0.131)));
1266 if (nr > 255) nr = 255;
1267 if (ng > 255) ng = 255;
1268 if (nb > 255) nb = 255;
1269 *out = ARGB_JOIN(a, nr, ng, nb);
1270 out++;
1271 in++;
1272 }
1273 }
1274
1275 return EINA_TRUE;
1276
1277}
1278
1279static Eina_Bool
1280greyscale_filter(Evas_Filter_Info *info __UNUSED__, RGBA_Image *src, RGBA_Image *dst)
1281{
1282 uint32_t *in, *out;
1283 int i, j;
1284 int w, h;
1285 uint32_t cur;
1286 uint32_t a, r, g, b;
1287
1288 in = src->image.data;
1289 out = dst->image.data;
1290 w = src->cache_entry.w;
1291 h = src->cache_entry.h;
1292
1293 if (src->cache_entry.flags.alpha)
1294 {
1295 for (i = 0; i < h; i++)
1296 {
1297 for (j = 0; j < w; j++)
1298 {
1299 a = A_VAL(in);
1300 r = R_VAL(in);
1301 g = G_VAL(in);
1302 b = B_VAL(in);
1303 cur = (r * 0.3) + (g * 0.59) + (b * 0.11);
1304 *out = ARGB_JOIN(a, r, g, b);
1305 out++;
1306 in++;
1307 }
1308 }
1309 }
1310 else
1311 {
1312 for (i = 0 ; i < h ; i ++)
1313 {
1314 for (j = 0; j < w ; j ++)
1315 {
1316 r = R_VAL(in);
1317 g = G_VAL(in);
1318 b = B_VAL(in);
1319 cur = r * 0.3 + g * 0.59 + b * 0.11;
1320 *out = ARGB_JOIN(255, r, g, b);
1321 out++;
1322 in++;
1323 }
1324 }
1325 }
1326 return EINA_TRUE;
1327}
1328
1329static Eina_Bool
1330brightness_filter(Evas_Filter_Info *info, RGBA_Image *src, RGBA_Image *dst)
1331{
1332 uint32_t *in, *out;
1333 int i, j;
1334 int w, h;
1335 int a,r,g,b;
1336 int delta;
1337 int adjdelta;
1338 Evas_Filter_Info_Brightness *bness;
1339
1340 in = src->image.data;
1341 out = dst->image.data;
1342 w = src->cache_entry.w;
1343 h = src->cache_entry.h;
1344 bness = info->data;
1345
1346 delta = bness->adjust * 255;
1347 if (delta > 255)
1348 delta = 255;
1349 else if (delta < -255)
1350 delta = -255;
1351
1352 /* Note we could optimise the -255, 0 and 255 cases, but why would people
1353 * be doing that */
1354 if (delta >= 0)
1355 {
1356 for (i = 0; i < h; i++)
1357 {
1358 for (j = 0; j < w; j++)
1359 {
1360 a = A_VAL(in);
1361 r = R_VAL(in);
1362 g = G_VAL(in);
1363 b = B_VAL(in);
1364 adjdelta = (a * delta) >> 8;
1365 r = MIN(r + adjdelta, a);
1366 g = MIN(g + adjdelta, a);
1367 b = MIN(b + adjdelta, a);
1368 *out = ARGB_JOIN(a, r ,g, b);
1369 out++;
1370 in++;
1371 }
1372 }
1373 }
1374 else
1375 {
1376 /* Delta negative */
1377 for (i = 0; i < h; i++)
1378 {
1379 for (j = 0; j < w; j++)
1380 {
1381 a = A_VAL(in);
1382 r = R_VAL(in);
1383 g = G_VAL(in);
1384 b = B_VAL(in);
1385 adjdelta = (a * delta) >> 8;
1386 r = MAX(r + adjdelta, 0);
1387 g = MAX(g + adjdelta, 0);
1388 b = MAX(b + adjdelta, 0);
1389 *out = ARGB_JOIN(a, r ,g, b);
1390 out++;
1391 in++;
1392 }
1393 }
1394 }
1395
1396 return EINA_TRUE;
1397
1398}
1399
1400static Eina_Bool
1401contrast_filter(Evas_Filter_Info *info __UNUSED__, RGBA_Image *src, RGBA_Image *dst)
1402{
1403 uint32_t *in, *out;
1404 int i, j;
1405 int w, h;
1406
1407 in = src->image.data;
1408 out = dst->image.data;
1409 w = src->cache_entry.w;
1410 h = src->cache_entry.h;
1411
1412 for (i = 0; i < h; i++)
1413 {
1414 for (j = 0; j < w; j++)
1415 {
1416 // FIXME: not even implemented
1417 out++;
1418 in++;
1419 }
1420 }
1421
1422 return EINA_TRUE;
1423
1424}
1425#endif
1426
1427/* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/
diff --git a/libraries/evas/src/lib/canvas/evas_focus.c b/libraries/evas/src/lib/canvas/evas_focus.c
new file mode 100644
index 0000000..a1a3bca
--- /dev/null
+++ b/libraries/evas/src/lib/canvas/evas_focus.c
@@ -0,0 +1,59 @@
1#include "evas_common.h"
2#include "evas_private.h"
3
4/* private calls */
5
6/* local calls */
7
8/* public calls */
9
10EAPI void
11evas_object_focus_set(Evas_Object *obj, Eina_Bool focus)
12{
13 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
14 return;
15 MAGIC_CHECK_END();
16
17 _evas_object_event_new();
18
19 if (focus)
20 {
21 if (obj->focused) goto end;
22 if (obj->layer->evas->focused)
23 evas_object_focus_set(obj->layer->evas->focused, 0);
24 obj->focused = 1;
25 obj->layer->evas->focused = obj;
26 evas_object_event_callback_call(obj, EVAS_CALLBACK_FOCUS_IN, NULL);
27 evas_event_callback_call(obj->layer->evas,
28 EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN, obj);
29 }
30 else
31 {
32 if (!obj->focused) goto end;
33 obj->focused = 0;
34 obj->layer->evas->focused = NULL;
35 evas_object_event_callback_call(obj, EVAS_CALLBACK_FOCUS_OUT, NULL);
36 evas_event_callback_call(obj->layer->evas,
37 EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT, obj);
38 }
39 end:
40 _evas_post_event_callback_call(obj->layer->evas);
41}
42
43EAPI Eina_Bool
44evas_object_focus_get(const Evas_Object *obj)
45{
46 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
47 return 0;
48 MAGIC_CHECK_END();
49 return obj->focused;
50}
51
52EAPI Evas_Object *
53evas_focus_get(const Evas *e)
54{
55 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
56 return NULL;
57 MAGIC_CHECK_END();
58 return e->focused;
59}
diff --git a/libraries/evas/src/lib/canvas/evas_font_dir.c b/libraries/evas/src/lib/canvas/evas_font_dir.c
new file mode 100644
index 0000000..e97f7f7
--- /dev/null
+++ b/libraries/evas/src/lib/canvas/evas_font_dir.c
@@ -0,0 +1,1349 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#ifdef HAVE_EVIL
6# include <Evil.h>
7#endif
8
9#ifdef BUILD_FONT_LOADER_EET
10#include <Eet.h>
11#endif
12
13#ifdef HAVE_FONTCONFIG
14#include <fontconfig/fontconfig.h>
15#endif
16
17#include "evas_common.h"
18#include "evas_private.h"
19
20/* font dir cache */
21static Eina_Hash *font_dirs = NULL;
22static Eina_List *fonts_cache = NULL;
23static Eina_List *fonts_zero = NULL;
24
25typedef struct _Fndat Fndat;
26
27struct _Fndat
28{
29 Evas_Font_Description *fdesc;
30 const char *source;
31 Evas_Font_Size size;
32 Evas_Font_Set *font;
33 int ref;
34 Font_Rend_Flags wanted_rend;
35
36#ifdef HAVE_FONTCONFIG
37 FcFontSet *set;
38 FcPattern *p_nm;
39#endif
40};
41
42/* private methods for font dir cache */
43static Eina_Bool font_cache_dir_free(const Eina_Hash *hash, const void *key, void *data, void *fdata);
44static Evas_Font_Dir *object_text_font_cache_dir_update(char *dir, Evas_Font_Dir *fd);
45static Evas_Font *object_text_font_cache_font_find_x(Evas_Font_Dir *fd, char *font);
46static Evas_Font *object_text_font_cache_font_find_file(Evas_Font_Dir *fd, char *font);
47static Evas_Font *object_text_font_cache_font_find_alias(Evas_Font_Dir *fd, char *font);
48static Evas_Font *object_text_font_cache_font_find(Evas_Font_Dir *fd, char *font);
49static Evas_Font_Dir *object_text_font_cache_dir_add(char *dir);
50static void object_text_font_cache_dir_del(char *dir, Evas_Font_Dir *fd);
51static int evas_object_text_font_string_parse(char *buffer, char dest[14][256]);
52
53#ifdef HAVE_FONTCONFIG
54static int fc_init = 0;
55#endif
56
57void
58evas_font_dir_cache_free(void)
59{
60 if (!font_dirs) return;
61
62 eina_hash_foreach(font_dirs, font_cache_dir_free, NULL);
63 eina_hash_free(font_dirs);
64 font_dirs = NULL;
65
66#ifdef HAVE_FONTCONFIG
67/* this is bad i got a:
68 * fccache.c:512: FcCacheFini: Assertion fcCacheChains[i] == ((void *)0)' failed.
69 *
70 * all i can do for now is shut this puppy down. butthat breaks, so disable
71 * it as in reality - there is little reason to care about the memory not
72 * being freed etc.
73 *
74 * fc_init--;
75 * if (fc_init == 0) FcFini();
76 */
77#endif
78}
79
80const char *
81evas_font_dir_cache_find(char *dir, char *font)
82{
83 Evas_Font_Dir *fd = NULL;
84
85 if (!font_dirs) font_dirs = eina_hash_string_superfast_new(NULL);
86 else fd = eina_hash_find(font_dirs, dir);
87 fd = object_text_font_cache_dir_update(dir, fd);
88 if (fd)
89 {
90 Evas_Font *fn;
91
92 fn = object_text_font_cache_font_find(fd, font);
93 if (fn)
94 {
95 return fn->path;
96 }
97 }
98 return NULL;
99}
100
101static Eina_List *
102evas_font_set_get(const char *name)
103{
104 Eina_List *fonts = NULL;
105 char *p;
106
107 p = strchr(name, ',');
108 if (!p)
109 {
110 fonts = eina_list_append(fonts, eina_stringshare_add(name));
111 }
112 else
113 {
114 const char *pp;
115 char *nm;
116
117 pp = name;
118 while (p)
119 {
120 nm = alloca(p - pp + 1);
121 strncpy(nm, pp, p - pp);
122 nm[p - pp] = 0;
123 fonts = eina_list_append(fonts, eina_stringshare_add(nm));
124 pp = p + 1;
125 p = strchr(pp, ',');
126 if (!p) fonts = eina_list_append(fonts, eina_stringshare_add(pp));
127 }
128 }
129 return fonts;
130}
131
132void
133evas_fonts_zero_free(Evas *evas)
134{
135 Fndat *fd;
136
137 EINA_LIST_FREE(fonts_zero, fd)
138 {
139 if (fd->fdesc) evas_font_desc_unref(fd->fdesc);
140 if (fd->source) eina_stringshare_del(fd->source);
141 evas->engine.func->font_free(evas->engine.data.output, fd->font);
142#ifdef HAVE_FONTCONFIG
143 if (fd->set) FcFontSetDestroy(fd->set);
144 if (fd->p_nm) FcPatternDestroy(fd->p_nm);
145#endif
146 free(fd);
147 }
148}
149
150void
151evas_fonts_zero_presure(Evas *evas)
152{
153 Fndat *fd;
154
155 while (fonts_zero
156 && eina_list_count(fonts_zero) > 4) /* 4 is arbitrary */
157 {
158 fd = eina_list_data_get(fonts_zero);
159
160 if (fd->ref != 0) break;
161 fonts_zero = eina_list_remove_list(fonts_zero, fonts_zero);
162
163 if (fd->fdesc) evas_font_desc_unref(fd->fdesc);
164 if (fd->source) eina_stringshare_del(fd->source);
165 evas->engine.func->font_free(evas->engine.data.output, fd->font);
166#ifdef HAVE_FONTCONFIG
167 if (fd->set) FcFontSetDestroy(fd->set);
168 if (fd->p_nm) FcPatternDestroy(fd->p_nm);
169#endif
170 free(fd);
171
172 if (eina_list_count(fonts_zero) < 5) break;
173 }
174}
175
176void
177evas_font_free(Evas *evas, void *font)
178{
179 Eina_List *l;
180 Fndat *fd;
181
182 EINA_LIST_FOREACH(fonts_cache, l, fd)
183 {
184 if (fd->font == font)
185 {
186 fd->ref--;
187 if (fd->ref == 0)
188 {
189 fonts_cache = eina_list_remove_list(fonts_cache, l);
190 fonts_zero = eina_list_append(fonts_zero, fd);
191 }
192 break;
193 }
194 }
195 while (fonts_zero
196 && eina_list_count(fonts_zero) > 42) /* 42 is arbitrary */
197 {
198 fd = eina_list_data_get(fonts_zero);
199
200 if (fd->ref != 0) break;
201 fonts_zero = eina_list_remove_list(fonts_zero, fonts_zero);
202
203 if (fd->fdesc) evas_font_desc_unref(fd->fdesc);
204 if (fd->source) eina_stringshare_del(fd->source);
205 evas->engine.func->font_free(evas->engine.data.output, fd->font);
206#ifdef HAVE_FONTCONFIG
207 if (fd->set) FcFontSetDestroy(fd->set);
208 if (fd->p_nm) FcPatternDestroy(fd->p_nm);
209#endif
210 free(fd);
211
212 if (eina_list_count(fonts_zero) < 43) break;
213 }
214}
215
216static void
217evas_font_init(void)
218{
219 static int done = 0;
220 if (done) return;
221 done = 1;
222#ifdef HAVE_FONTCONFIG
223 fc_init++;
224 if (fc_init == 1)
225 {
226 FcInit();
227 FcConfigEnableHome(1);
228 }
229#endif
230}
231
232#ifdef HAVE_FONTCONFIG
233static Evas_Font_Set *
234evas_load_fontconfig(Evas *evas, FcFontSet *set, int size,
235 Font_Rend_Flags wanted_rend)
236{
237 Evas_Font_Set *font = NULL;
238 int i;
239
240 /* Do loading for all in family */
241 for (i = 0; i < set->nfont; i++)
242 {
243 FcValue filename;
244
245 FcPatternGet(set->fonts[i], FC_FILE, 0, &filename);
246
247 if (font)
248 evas->engine.func->font_add(evas->engine.data.output, font, (char *)filename.u.s, size, wanted_rend);
249 else
250 font = evas->engine.func->font_load(evas->engine.data.output, (char *)filename.u.s, size, wanted_rend);
251 }
252
253 return font;
254}
255#endif
256
257#ifdef HAVE_FONTCONFIG
258/* In sync with Evas_Font_Style, Evas_Font_Weight and Evas_Font_Width */
259static int _fc_slant_map[] =
260{
261 FC_SLANT_ROMAN,
262 FC_SLANT_OBLIQUE,
263 FC_SLANT_ITALIC
264};
265
266static int _fc_weight_map[] =
267{
268 FC_WEIGHT_NORMAL,
269 FC_WEIGHT_THIN,
270 FC_WEIGHT_ULTRALIGHT,
271 FC_WEIGHT_LIGHT,
272 FC_WEIGHT_BOOK,
273 FC_WEIGHT_MEDIUM,
274 FC_WEIGHT_SEMIBOLD,
275 FC_WEIGHT_BOLD,
276 FC_WEIGHT_ULTRABOLD,
277 FC_WEIGHT_BLACK,
278 FC_WEIGHT_EXTRABLACK
279};
280
281# ifdef FC_WIDTH
282static int _fc_width_map[] =
283{
284 FC_WIDTH_NORMAL,
285 FC_WIDTH_ULTRACONDENSED,
286 FC_WIDTH_EXTRACONDENSED,
287 FC_WIDTH_CONDENSED,
288 FC_WIDTH_SEMICONDENSED,
289 FC_WIDTH_SEMIEXPANDED,
290 FC_WIDTH_EXPANDED,
291 FC_WIDTH_EXTRAEXPANDED,
292 FC_WIDTH_ULTRAEXPANDED
293};
294# endif
295
296#endif
297
298struct _Style_Map
299{
300 const char *name;
301 int type;
302};
303typedef struct _Style_Map Style_Map;
304
305static Style_Map _style_width_map[] =
306{
307 {"normal", EVAS_FONT_WIDTH_NORMAL},
308 {"ultracondensed", EVAS_FONT_WIDTH_ULTRACONDENSED},
309 {"extracondensed", EVAS_FONT_WIDTH_EXTRACONDENSED},
310 {"condensed", EVAS_FONT_WIDTH_CONDENSED},
311 {"semicondensed", EVAS_FONT_WIDTH_SEMICONDENSED},
312 {"semiexpanded", EVAS_FONT_WIDTH_SEMIEXPANDED},
313 {"expanded", EVAS_FONT_WIDTH_EXPANDED},
314 {"extraexpanded", EVAS_FONT_WIDTH_EXTRAEXPANDED},
315 {"ultraexpanded", EVAS_FONT_WIDTH_ULTRAEXPANDED},
316};
317
318static Style_Map _style_weight_map[] =
319{
320 {"normal", EVAS_FONT_WEIGHT_NORMAL},
321 {"thin", EVAS_FONT_WEIGHT_THIN},
322 {"ultralight", EVAS_FONT_WEIGHT_ULTRALIGHT},
323 {"light", EVAS_FONT_WEIGHT_LIGHT},
324 {"book", EVAS_FONT_WEIGHT_BOOK},
325 {"medium", EVAS_FONT_WEIGHT_MEDIUM},
326 {"semibold", EVAS_FONT_WEIGHT_SEMIBOLD},
327 {"bold", EVAS_FONT_WEIGHT_BOLD},
328 {"ultrabold", EVAS_FONT_WEIGHT_ULTRABOLD},
329 {"black", EVAS_FONT_WEIGHT_BLACK},
330 {"extrablack", EVAS_FONT_WEIGHT_EXTRABLACK}
331};
332
333static Style_Map _style_slant_map[] =
334{
335 {"normal", EVAS_FONT_SLANT_NORMAL},
336 {"oblique", EVAS_FONT_SLANT_OBLIQUE},
337 {"italic", EVAS_FONT_SLANT_ITALIC}
338};
339
340#define _STYLE_MAP_LEN(x) (sizeof(x) / sizeof(*(x)))
341/**
342 * @internal
343 * Find a certain attribute from the map in the style.
344 * @return the index of the found one.
345 */
346static int
347_evas_font_style_find_internal(const char *style, const char *style_end,
348 Style_Map _map[], size_t map_len)
349{
350 size_t i;
351 while (style < style_end)
352 {
353 for (i = 0 ; i < map_len ; i++)
354 {
355 size_t len;
356 const char *cur = _map[i].name;
357 len = strlen(cur);
358 if (!strncasecmp(style, cur, len) &&
359 (!cur[len] || (cur[len] == ' ')))
360 {
361 return _map[i].type;
362 }
363 }
364 style = strchr(style, ' ');
365 if (!style)
366 break;
367
368 while (*style && (*style == ' '))
369 style++;
370 }
371 return 0;
372}
373
374int
375evas_font_style_find(const char *start, const char *end,
376 Evas_Font_Style style)
377{
378#define _RET_STYLE(x) \
379 return _evas_font_style_find_internal(start, end, \
380 _style_##x##_map, _STYLE_MAP_LEN(_style_##x##_map));
381 switch (style)
382 {
383 case EVAS_FONT_STYLE_SLANT:
384 _RET_STYLE(slant);
385 case EVAS_FONT_STYLE_WEIGHT:
386 _RET_STYLE(weight);
387 case EVAS_FONT_STYLE_WIDTH:
388 _RET_STYLE(width);
389 default:
390 return 0;
391 }
392#undef _RET_STYLE
393}
394
395void
396evas_font_desc_unref(Evas_Font_Description *fdesc)
397{
398 if (--(fdesc->ref) == 0)
399 {
400 eina_stringshare_del(fdesc->name);
401 eina_stringshare_del(fdesc->fallbacks);
402 eina_stringshare_del(fdesc->lang);
403 free(fdesc);
404 }
405}
406
407Evas_Font_Description *
408evas_font_desc_ref(Evas_Font_Description *fdesc)
409{
410 fdesc->ref++;
411 return fdesc;
412}
413
414Evas_Font_Description *
415evas_font_desc_new(void)
416{
417 Evas_Font_Description *fdesc;
418 fdesc = calloc(1, sizeof(*fdesc));
419 fdesc->ref = 1;
420 fdesc->is_new = EINA_TRUE;
421
422 return fdesc;
423}
424
425Evas_Font_Description *
426evas_font_desc_dup(const Evas_Font_Description *fdesc)
427{
428 Evas_Font_Description *new;
429 new = evas_font_desc_new();
430 memcpy(new, fdesc, sizeof(*new));
431 new->ref = 1;
432 new->is_new = EINA_TRUE;
433 new->name = eina_stringshare_ref(new->name);
434
435 return new;
436}
437
438int
439evas_font_desc_cmp(const Evas_Font_Description *a,
440 const Evas_Font_Description *b)
441{
442 /* FIXME: Do actual comparison, i.e less than and bigger than. */
443 return !((a->name == b->name) && (a->weight == b->weight) &&
444 (a->slant == b->slant) && (a->width == b->width) &&
445 (a->lang == b->lang));
446}
447
448void
449evas_font_name_parse(Evas_Font_Description *fdesc, const char *name)
450{
451 const char *end;
452
453 end = strchr(name, ':');
454 if (!end)
455 eina_stringshare_replace(&(fdesc->name), name);
456 else
457 eina_stringshare_replace_length(&(fdesc->name), name, end - name);
458
459 while (end)
460 {
461 const char *tend;
462 name = end;
463 end = strchr(end + 1, ':');
464 if (!end)
465 tend = name + strlen(name);
466 else
467 tend = end;
468
469 if (!strncmp(name, ":style=", 7))
470 {
471#define _SET_STYLE(x) \
472 fdesc->x = _evas_font_style_find_internal(name + 7, tend, \
473 _style_##x##_map, _STYLE_MAP_LEN(_style_##x##_map));
474 _SET_STYLE(slant);
475 _SET_STYLE(weight);
476 _SET_STYLE(width);
477#undef _SET_STYLE
478 }
479 else if (!strncmp(name, ":lang=", 6))
480 {
481 const char *tmp = name + 6;
482 eina_stringshare_replace_length(&(fdesc->lang), tmp, tend - tmp);
483 }
484 }
485}
486
487void *
488evas_font_load(Evas *evas, Evas_Font_Description *fdesc, const char *source, Evas_Font_Size size)
489{
490#ifdef HAVE_FONTCONFIG
491 FcPattern *p_nm = NULL;
492 FcFontSet *set = NULL;
493#endif
494
495 Evas_Font_Set *font = NULL;
496 Eina_List *fonts, *l;
497 Fndat *fd;
498 char *nm;
499 Font_Rend_Flags wanted_rend = 0;
500
501 if (!fdesc) return NULL;
502 fdesc->is_new = EINA_FALSE;
503
504 if (fdesc->slant != EVAS_FONT_SLANT_NORMAL)
505 wanted_rend |= FONT_REND_SLANT;
506 if (fdesc->weight == EVAS_FONT_WEIGHT_BOLD)
507 wanted_rend |= FONT_REND_WEIGHT;
508
509 evas_font_init();
510
511 EINA_LIST_FOREACH(fonts_cache, l, fd)
512 {
513 if (!evas_font_desc_cmp(fdesc, fd->fdesc))
514 {
515 if (((!source) && (!fd->source)) ||
516 ((source) && (fd->source) && (!strcmp(source, fd->source))))
517 {
518 if ((size == fd->size) &&
519 (wanted_rend == fd->wanted_rend))
520 {
521 fonts_cache = eina_list_promote_list(fonts_cache, l);
522 fd->ref++;
523 return fd->font;
524 }
525#ifdef HAVE_FONTCONFIG
526 else if (fd->set && fd->p_nm)
527 {
528 font = evas_load_fontconfig(evas, fd->set, size,
529 wanted_rend);
530 goto on_find;
531 }
532#endif
533 }
534 }
535 }
536
537 EINA_LIST_FOREACH(fonts_zero, l, fd)
538 {
539 if (!evas_font_desc_cmp(fdesc, fd->fdesc))
540 {
541 if (((!source) && (!fd->source)) ||
542 ((source) && (fd->source) && (!strcmp(source, fd->source))))
543 {
544 if ((size == fd->size) &&
545 (wanted_rend == fd->wanted_rend))
546 {
547 fonts_zero = eina_list_remove_list(fonts_zero, l);
548 fonts_cache = eina_list_prepend(fonts_cache, fd);
549 fd->ref++;
550 return fd->font;
551 }
552#ifdef HAVE_FONTCONFIG
553 else if (fd->set && fd->p_nm)
554 {
555 font = evas_load_fontconfig(evas, fd->set, size,
556 wanted_rend);
557 goto on_find;
558 }
559#endif
560 }
561 }
562 }
563
564 fonts = evas_font_set_get(fdesc->name);
565 EINA_LIST_FOREACH(fonts, l, nm) /* Load each font in append */
566 {
567 if (l == fonts || !font) /* First iteration OR no font */
568 {
569#ifdef BUILD_FONT_LOADER_EET
570 if (source) /* Load Font from "eet" source */
571 {
572 Eet_File *ef;
573 char *fake_name;
574
575 fake_name = evas_file_path_join(source, nm);
576 if (fake_name)
577 {
578 font = evas->engine.func->font_load(evas->engine.data.output, fake_name, size, wanted_rend);
579 if (!font) /* Load from fake name failed, probably not cached */
580 {
581 /* read original!!! */
582 ef = eet_open(source, EET_FILE_MODE_READ);
583 if (ef)
584 {
585 void *fdata;
586 int fsize = 0;
587
588 fdata = eet_read(ef, nm, &fsize);
589 if ((fdata) && (fsize > 0))
590 {
591 font = evas->engine.func->font_memory_load(evas->engine.data.output, fake_name, size, fdata, fsize, wanted_rend);
592 free(fdata);
593 }
594 eet_close(ef);
595 }
596 }
597 free(fake_name);
598 }
599 }
600 if (!font) /* Source load failed */
601 {
602#endif
603 if (evas_file_path_is_full_path((char *)nm)) /* Try filename */
604 font = evas->engine.func->font_load(evas->engine.data.output, (char *)nm, size, wanted_rend);
605 else /* search font path */
606 {
607 Eina_List *ll;
608 char *dir;
609
610 EINA_LIST_FOREACH(evas->font_path, ll, dir)
611 {
612 const char *f_file;
613
614 f_file = evas_font_dir_cache_find(dir, (char *)nm);
615 if (f_file)
616 {
617 font = evas->engine.func->font_load(evas->engine.data.output, f_file, size, wanted_rend);
618 if (font) break;
619 }
620 }
621 }
622#ifdef BUILD_FONT_LOADER_EET
623 }
624#endif
625 }
626 else /* Base font loaded, append others */
627 {
628#ifdef BUILD_FONT_LOADER_EET
629 void *ok = NULL;
630
631 if (source)
632 {
633 Eet_File *ef;
634 char *fake_name;
635
636 fake_name = evas_file_path_join(source, nm);
637 if (fake_name)
638 {
639 /* FIXME: make an engine func */
640 if (!evas->engine.func->font_add(evas->engine.data.output, font, fake_name, size, wanted_rend))
641 {
642 /* read original!!! */
643 ef = eet_open(source, EET_FILE_MODE_READ);
644 if (ef)
645 {
646 void *fdata;
647 int fsize = 0;
648
649 fdata = eet_read(ef, nm, &fsize);
650 if ((fdata) && (fsize > 0))
651 {
652 ok = evas->engine.func->font_memory_add(evas->engine.data.output, font, fake_name, size, fdata, fsize, wanted_rend);
653 free(fdata);
654 }
655 eet_close(ef);
656 }
657 }
658 else
659 ok = (void *)1;
660 free(fake_name);
661 }
662 }
663 if (!ok)
664 {
665#endif
666 if (evas_file_path_is_full_path((char *)nm))
667 evas->engine.func->font_add(evas->engine.data.output, font, (char *)nm, size, wanted_rend);
668 else
669 {
670 Eina_List *ll;
671 char *dir;
672
673 EINA_LIST_FOREACH(evas->font_path, ll, dir)
674 {
675 const char *f_file;
676
677 f_file = evas_font_dir_cache_find(dir, (char *)nm);
678 if (f_file)
679 {
680 if (evas->engine.func->font_add(evas->engine.data.output, font, f_file, size, wanted_rend))
681 break;
682 }
683 }
684 }
685#ifdef BUILD_FONT_LOADER_EET
686 }
687#endif
688 }
689 eina_stringshare_del(nm);
690 }
691 fonts = eina_list_free(fonts);
692
693#ifdef HAVE_FONTCONFIG
694 if (!font) /* Search using fontconfig */
695 {
696 FcResult res;
697
698 p_nm = FcPatternBuild (NULL,
699 FC_WEIGHT, FcTypeInteger, _fc_weight_map[fdesc->weight],
700 FC_SLANT, FcTypeInteger, _fc_slant_map[fdesc->slant],
701#ifdef FC_WIDTH
702 FC_WIDTH, FcTypeInteger, _fc_width_map[fdesc->width],
703#endif
704 NULL);
705 FcPatternAddString (p_nm, FC_FAMILY, (FcChar8*) fdesc->name);
706
707 /* Handle font fallbacks */
708 if (fdesc->fallbacks)
709 {
710 while (1)
711 {
712 const char *start, *end;
713 start = fdesc->fallbacks;
714 end = strchr(start, ',');
715 if (end)
716 {
717 char *tmp = alloca((end - start) + 1);
718 strncpy(tmp, start, end - start);
719 tmp[end - start] = 0;
720 FcPatternAddString (p_nm, FC_FAMILY, (FcChar8*) tmp);
721 }
722 else
723 {
724 FcPatternAddString (p_nm, FC_FAMILY, (FcChar8*) start);
725 break;
726 }
727 }
728 }
729
730 if (fdesc->lang)
731 FcPatternAddString (p_nm, FC_LANG, (FcChar8 *) fdesc->lang);
732
733 FcConfigSubstitute(NULL, p_nm, FcMatchPattern);
734 FcDefaultSubstitute(p_nm);
735
736 /* do matching */
737 set = FcFontSort(NULL, p_nm, FcTrue, NULL, &res);
738 if (!set)
739 {
740 ERR("No fontconfig font matches '%s'. It was the last resource, no font found!", fdesc->name);
741 FcPatternDestroy(p_nm);
742 p_nm = NULL;
743 }
744 else
745 {
746 font = evas_load_fontconfig(evas, set, size, wanted_rend);
747 }
748 }
749#endif
750
751#ifdef HAVE_FONTCONFIG
752 on_find:
753#endif
754 fd = calloc(1, sizeof(Fndat));
755 if (fd)
756 {
757 fd->fdesc = evas_font_desc_ref(fdesc);
758 if (source) fd->source = eina_stringshare_add(source);
759 fd->font = font;
760 fd->wanted_rend = wanted_rend;
761 fd->size = size;
762 fd->ref = 1;
763 fonts_cache = eina_list_prepend(fonts_cache, fd);
764#ifdef HAVE_FONTCONFIG
765 fd->set = set;
766 fd->p_nm = p_nm;
767#endif
768 }
769
770 if (font)
771 evas->engine.func->font_hinting_set(evas->engine.data.output, font,
772 evas->hinting);
773 return font;
774}
775
776void
777evas_font_load_hinting_set(Evas *evas, void *font, int hinting)
778{
779 evas->engine.func->font_hinting_set(evas->engine.data.output, font,
780 hinting);
781}
782
783Eina_List *
784evas_font_dir_available_list(const Evas *evas)
785{
786 Eina_List *l;
787 Eina_List *ll;
788 Eina_List *available = NULL;
789 char *dir;
790
791#ifdef HAVE_FONTCONFIG
792 /* Add font config fonts */
793 FcPattern *p;
794 FcFontSet *set = NULL;
795 FcObjectSet *os;
796 int i;
797
798 evas_font_init();
799
800 p = FcPatternCreate();
801 os = FcObjectSetBuild(FC_FAMILY, FC_STYLE, NULL);
802
803 if (p && os) set = FcFontList(NULL, p, os);
804
805 if (p) FcPatternDestroy(p);
806 if (os) FcObjectSetDestroy(os);
807
808 if (set)
809 {
810 for (i = 0; i < set->nfont; i++)
811 {
812 char *font;
813
814 font = (char *)FcNameUnparse(set->fonts[i]);
815 available = eina_list_append(available, eina_stringshare_add(font));
816 free(font);
817 }
818
819 FcFontSetDestroy(set);
820 }
821#endif
822
823 /* Add fonts in evas font_path*/
824 if (!evas->font_path)
825 return available;
826
827 if (!font_dirs) font_dirs = eina_hash_string_superfast_new(NULL);
828
829 EINA_LIST_FOREACH(evas->font_path, l, dir)
830 {
831 Evas_Font_Dir *fd;
832
833 fd = eina_hash_find(font_dirs, dir);
834 fd = object_text_font_cache_dir_update(dir, fd);
835 if (fd && fd->aliases)
836 {
837 Evas_Font_Alias *fa;
838
839 EINA_LIST_FOREACH(fd->aliases, ll, fa)
840 available = eina_list_append(available, eina_stringshare_add((char *)fa->alias));
841 }
842 }
843
844 return available;
845}
846
847void
848evas_font_dir_available_list_free(Eina_List *available)
849{
850 while (available)
851 {
852 eina_stringshare_del(available->data);
853 available = eina_list_remove(available, available->data);
854 }
855}
856
857/* private stuff */
858static Eina_Bool
859font_cache_dir_free(const Eina_Hash *hash __UNUSED__, const void *key, void *data, void *fdata __UNUSED__)
860{
861 object_text_font_cache_dir_del((char *) key, data);
862 return 1;
863}
864
865static Evas_Font_Dir *
866object_text_font_cache_dir_update(char *dir, Evas_Font_Dir *fd)
867{
868 DATA64 mt;
869 char *tmp;
870
871 if (fd)
872 {
873 mt = evas_file_modified_time(dir);
874 if (mt != fd->dir_mod_time)
875 {
876 object_text_font_cache_dir_del(dir, fd);
877 eina_hash_del(font_dirs, dir, fd);
878 }
879 else
880 {
881 tmp = evas_file_path_join(dir, "fonts.dir");
882 if (tmp)
883 {
884 mt = evas_file_modified_time(tmp);
885 free(tmp);
886 if (mt != fd->fonts_dir_mod_time)
887 {
888 object_text_font_cache_dir_del(dir, fd);
889 eina_hash_del(font_dirs, dir, fd);
890 }
891 else
892 {
893 tmp = evas_file_path_join(dir, "fonts.alias");
894 if (tmp)
895 {
896 mt = evas_file_modified_time(tmp);
897 free(tmp);
898 }
899 if (mt != fd->fonts_alias_mod_time)
900 {
901 object_text_font_cache_dir_del(dir, fd);
902 eina_hash_del(font_dirs, dir, fd);
903 }
904 else
905 return fd;
906 }
907 }
908 }
909 }
910 return object_text_font_cache_dir_add(dir);
911}
912
913static Evas_Font *
914object_text_font_cache_font_find_x(Evas_Font_Dir *fd, char *font)
915{
916 Eina_List *l;
917 char font_prop[14][256];
918 int num;
919 Evas_Font *fn;
920
921 num = evas_object_text_font_string_parse(font, font_prop);
922 if (num != 14) return NULL;
923 EINA_LIST_FOREACH(fd->fonts, l, fn)
924 {
925 if (fn->type == 1)
926 {
927 int i;
928 int match = 0;
929
930 for (i = 0; i < 14; i++)
931 {
932 if ((font_prop[i][0] == '*') && (font_prop[i][1] == 0))
933 match++;
934 else
935 {
936 if (!strcasecmp(font_prop[i], fn->x.prop[i])) match++;
937 else break;
938 }
939 }
940 if (match == 14) return fn;
941 }
942 }
943 return NULL;
944}
945
946static Evas_Font *
947object_text_font_cache_font_find_file(Evas_Font_Dir *fd, char *font)
948{
949 Eina_List *l;
950 Evas_Font *fn;
951
952 EINA_LIST_FOREACH(fd->fonts, l, fn)
953 {
954 if (fn->type == 0)
955 {
956 if (!strcasecmp(font, fn->simple.name)) return fn;
957 }
958 }
959 return NULL;
960}
961
962static Evas_Font *
963object_text_font_cache_font_find_alias(Evas_Font_Dir *fd, char *font)
964{
965 Eina_List *l;
966 Evas_Font_Alias *fa;
967
968 EINA_LIST_FOREACH(fd->aliases, l, fa)
969 if (!strcasecmp(fa->alias, font)) return fa->fn;
970 return NULL;
971}
972
973static Evas_Font *
974object_text_font_cache_font_find(Evas_Font_Dir *fd, char *font)
975{
976 Evas_Font *fn;
977
978 fn = eina_hash_find(fd->lookup, font);
979 if (fn) return fn;
980 fn = object_text_font_cache_font_find_alias(fd, font);
981 if (!fn) fn = object_text_font_cache_font_find_x(fd, font);
982 if (!fn) fn = object_text_font_cache_font_find_file(fd, font);
983 if (!fn) return NULL;
984 eina_hash_add(fd->lookup, font, fn);
985 return fn;
986}
987
988static Evas_Font_Dir *
989object_text_font_cache_dir_add(char *dir)
990{
991 Evas_Font_Dir *fd;
992 char *tmp, *tmp2;
993 Eina_List *fdir;
994 Evas_Font *fn;
995
996 fd = calloc(1, sizeof(Evas_Font_Dir));
997 if (!fd) return NULL;
998 fd->lookup = eina_hash_string_superfast_new(NULL);
999
1000 eina_hash_add(font_dirs, dir, fd);
1001
1002 /* READ fonts.alias, fonts.dir and directory listing */
1003
1004 /* fonts.dir */
1005 tmp = evas_file_path_join(dir, "fonts.dir");
1006 if (tmp)
1007 {
1008 FILE *f;
1009
1010 f = fopen(tmp, "rb");
1011 if (f)
1012 {
1013 int num;
1014 char fname[4096], fdef[4096];
1015
1016 if (fscanf(f, "%i\n", &num) != 1) goto cant_read;
1017 /* read font lines */
1018 while (fscanf(f, "%4090s %[^\n]\n", fname, fdef) == 2)
1019 {
1020 char font_prop[14][256];
1021 int i;
1022
1023 /* skip comments */
1024 if ((fdef[0] == '!') || (fdef[0] == '#')) continue;
1025 /* parse font def */
1026 num = evas_object_text_font_string_parse((char *)fdef, font_prop);
1027 if (num == 14)
1028 {
1029 fn = calloc(1, sizeof(Evas_Font));
1030 if (fn)
1031 {
1032 fn->type = 1;
1033 for (i = 0; i < 14; i++)
1034 fn->x.prop[i] = eina_stringshare_add(font_prop[i]);
1035 tmp2 = evas_file_path_join(dir, fname);
1036 if (tmp2)
1037 {
1038 fn->path = eina_stringshare_add(tmp2);
1039 free(tmp2);
1040 }
1041 fd->fonts = eina_list_append(fd->fonts, fn);
1042 }
1043 }
1044 }
1045 cant_read: ;
1046 fclose(f);
1047 }
1048 free(tmp);
1049 }
1050
1051 /* directoy listing */
1052 fdir = evas_file_path_list(dir, "*.ttf", 0);
1053 while (fdir)
1054 {
1055 tmp = evas_file_path_join(dir, fdir->data);
1056 if (tmp)
1057 {
1058 fn = calloc(1, sizeof(Evas_Font));
1059 if (fn)
1060 {
1061 char *p;
1062
1063 fn->type = 0;
1064 tmp2 = alloca(strlen(fdir->data) + 1);
1065 strcpy(tmp2, fdir->data);
1066 p = strrchr(tmp2, '.');
1067 if (p) *p = 0;
1068 fn->simple.name = eina_stringshare_add(tmp2);
1069 tmp2 = evas_file_path_join(dir, fdir->data);
1070 if (tmp2)
1071 {
1072 fn->path = eina_stringshare_add(tmp2);
1073 free(tmp2);
1074 }
1075 fd->fonts = eina_list_append(fd->fonts, fn);
1076 }
1077 free(tmp);
1078 }
1079 free(fdir->data);
1080 fdir = eina_list_remove(fdir, fdir->data);
1081 }
1082
1083 /* fonts.alias */
1084 tmp = evas_file_path_join(dir, "fonts.alias");
1085 if (tmp)
1086 {
1087 FILE *f;
1088
1089 f = fopen(tmp, "rb");
1090 if (f)
1091 {
1092 char fname[4096], fdef[4096];
1093
1094 /* read font alias lines */
1095 while (fscanf(f, "%4090s %[^\n]\n", fname, fdef) == 2)
1096 {
1097 Evas_Font_Alias *fa;
1098
1099 /* skip comments */
1100 if ((fname[0] == '!') || (fname[0] == '#')) continue;
1101 fa = calloc(1, sizeof(Evas_Font_Alias));
1102 if (fa)
1103 {
1104 fa->alias = eina_stringshare_add(fname);
1105 fa->fn = object_text_font_cache_font_find_x(fd, fdef);
1106 if ((!fa->alias) || (!fa->fn))
1107 {
1108 if (fa->alias) eina_stringshare_del(fa->alias);
1109 free(fa);
1110 }
1111 else
1112 fd->aliases = eina_list_append(fd->aliases, fa);
1113 }
1114 }
1115 fclose(f);
1116 }
1117 free(tmp);
1118 }
1119
1120 fd->dir_mod_time = evas_file_modified_time(dir);
1121 tmp = evas_file_path_join(dir, "fonts.dir");
1122 if (tmp)
1123 {
1124 fd->fonts_dir_mod_time = evas_file_modified_time(tmp);
1125 free(tmp);
1126 }
1127 tmp = evas_file_path_join(dir, "fonts.alias");
1128 if (tmp)
1129 {
1130 fd->fonts_alias_mod_time = evas_file_modified_time(tmp);
1131 free(tmp);
1132 }
1133
1134 return fd;
1135}
1136
1137static void
1138object_text_font_cache_dir_del(char *dir __UNUSED__, Evas_Font_Dir *fd)
1139{
1140 if (fd->lookup) eina_hash_free(fd->lookup);
1141 while (fd->fonts)
1142 {
1143 Evas_Font *fn;
1144 int i;
1145
1146 fn = fd->fonts->data;
1147 fd->fonts = eina_list_remove(fd->fonts, fn);
1148 for (i = 0; i < 14; i++)
1149 {
1150 if (fn->x.prop[i]) eina_stringshare_del(fn->x.prop[i]);
1151 }
1152 if (fn->simple.name) eina_stringshare_del(fn->simple.name);
1153 if (fn->path) eina_stringshare_del(fn->path);
1154 free(fn);
1155 }
1156 while (fd->aliases)
1157 {
1158 Evas_Font_Alias *fa;
1159
1160 fa = fd->aliases->data;
1161 fd->aliases = eina_list_remove(fd->aliases, fa);
1162 if (fa->alias) eina_stringshare_del(fa->alias);
1163 free(fa);
1164 }
1165 free(fd);
1166}
1167
1168static int
1169evas_object_text_font_string_parse(char *buffer, char dest[14][256])
1170{
1171 char *p;
1172 int n, m, i;
1173
1174 n = 0;
1175 m = 0;
1176 p = buffer;
1177 if (p[0] != '-') return 0;
1178 i = 1;
1179 while (p[i])
1180 {
1181 dest[n][m] = p[i];
1182 if ((p[i] == '-') || (m == 255))
1183 {
1184 dest[n][m] = 0;
1185 n++;
1186 m = -1;
1187 }
1188 i++;
1189 m++;
1190 if (n == 14) return n;
1191 }
1192 dest[n][m] = 0;
1193 n++;
1194 return n;
1195}
1196
1197EAPI void
1198evas_font_path_clear(Evas *e)
1199{
1200 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
1201 return;
1202 MAGIC_CHECK_END();
1203 while (e->font_path)
1204 {
1205 eina_stringshare_del(e->font_path->data);
1206 e->font_path = eina_list_remove(e->font_path, e->font_path->data);
1207 }
1208}
1209
1210EAPI void
1211evas_font_path_append(Evas *e, const char *path)
1212{
1213 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
1214 return;
1215 MAGIC_CHECK_END();
1216
1217 if (!path) return;
1218 e->font_path = eina_list_append(e->font_path, eina_stringshare_add(path));
1219}
1220
1221EAPI void
1222evas_font_path_prepend(Evas *e, const char *path)
1223{
1224 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
1225 return;
1226 MAGIC_CHECK_END();
1227
1228 if (!path) return;
1229 e->font_path = eina_list_prepend(e->font_path, eina_stringshare_add(path));
1230}
1231
1232EAPI const Eina_List *
1233evas_font_path_list(const Evas *e)
1234{
1235 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
1236 return NULL;
1237 MAGIC_CHECK_END();
1238 return e->font_path;
1239}
1240
1241static void
1242evas_font_object_rehint(Evas_Object *obj)
1243{
1244 if (obj->smart.smart)
1245 {
1246 EINA_INLIST_FOREACH(evas_object_smart_members_get_direct(obj), obj)
1247 evas_font_object_rehint(obj);
1248 }
1249 else
1250 {
1251 if (!strcmp(obj->type, "text"))
1252 _evas_object_text_rehint(obj);
1253 if (!strcmp(obj->type, "textblock"))
1254 _evas_object_textblock_rehint(obj);
1255 }
1256}
1257
1258EAPI void
1259evas_font_hinting_set(Evas *e, Evas_Font_Hinting_Flags hinting)
1260{
1261 Evas_Layer *lay;
1262
1263 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
1264 return;
1265 MAGIC_CHECK_END();
1266 if (e->hinting == hinting) return;
1267 e->hinting = hinting;
1268
1269 EINA_INLIST_FOREACH(e->layers, lay)
1270 {
1271 Evas_Object *obj;
1272
1273 EINA_INLIST_FOREACH(lay->objects, obj)
1274 evas_font_object_rehint(obj);
1275 }
1276}
1277
1278EAPI Evas_Font_Hinting_Flags
1279evas_font_hinting_get(const Evas *e)
1280{
1281 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
1282 return EVAS_FONT_HINTING_BYTECODE;
1283 MAGIC_CHECK_END();
1284 return e->hinting;
1285}
1286
1287EAPI Eina_Bool
1288evas_font_hinting_can_hint(const Evas *e, Evas_Font_Hinting_Flags hinting)
1289{
1290 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
1291 return 0;
1292 MAGIC_CHECK_END();
1293 if (e->engine.func->font_hinting_can_hint)
1294 return e->engine.func->font_hinting_can_hint(e->engine.data.output,
1295 hinting);
1296 return EINA_FALSE;
1297}
1298
1299EAPI void
1300evas_font_cache_flush(Evas *e)
1301{
1302 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
1303 return;
1304 MAGIC_CHECK_END();
1305
1306 e->engine.func->font_cache_flush(e->engine.data.output);
1307}
1308
1309EAPI void
1310evas_font_cache_set(Evas *e, int size)
1311{
1312 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
1313 return;
1314 MAGIC_CHECK_END();
1315
1316 if (size < 0) size = 0;
1317 e->engine.func->font_cache_set(e->engine.data.output, size);
1318}
1319
1320EAPI int
1321evas_font_cache_get(const Evas *e)
1322{
1323 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
1324 return 0;
1325 MAGIC_CHECK_END();
1326
1327 return e->engine.func->font_cache_get(e->engine.data.output);
1328}
1329
1330EAPI Eina_List *
1331evas_font_available_list(const Evas *e)
1332{
1333 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
1334 return NULL;
1335 MAGIC_CHECK_END();
1336
1337 return evas_font_dir_available_list(e);
1338}
1339
1340EAPI void
1341evas_font_available_list_free(Evas *e, Eina_List *available)
1342{
1343 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
1344 return;
1345 MAGIC_CHECK_END();
1346
1347 evas_font_dir_available_list_free(available);
1348}
1349
diff --git a/libraries/evas/src/lib/canvas/evas_gl.c b/libraries/evas/src/lib/canvas/evas_gl.c
new file mode 100644
index 0000000..47bb583
--- /dev/null
+++ b/libraries/evas/src/lib/canvas/evas_gl.c
@@ -0,0 +1,245 @@
1/* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/
2#include "evas_common.h"
3#include "evas_private.h"
4#include "Evas_GL.h"
5
6struct _Evas_GL
7{
8 DATA32 magic;
9 Evas *evas;
10
11 Eina_List *contexts;
12 Eina_List *surfaces;
13};
14
15struct _Evas_GL_Context
16{
17 void *data;
18};
19
20struct _Evas_GL_Surface
21{
22 void *data;
23};
24
25EAPI Evas_GL *
26evas_gl_new(Evas *e)
27{
28 Evas_GL *evas_gl;
29
30 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
31 return NULL;
32 MAGIC_CHECK_END();
33
34 evas_gl = calloc(1, sizeof(Evas_GL));
35 if (!evas_gl) return NULL;
36
37 evas_gl->magic = MAGIC_EVAS_GL;
38 evas_gl->evas = e;
39
40 return evas_gl;
41}
42
43EAPI void
44evas_gl_free(Evas_GL *evas_gl)
45{
46 MAGIC_CHECK(evas_gl, Evas_GL, MAGIC_EVAS_GL);
47 return;
48 MAGIC_CHECK_END();
49
50
51 // Delete undeleted surfaces
52 while (evas_gl->surfaces)
53 evas_gl_surface_destroy(evas_gl, evas_gl->surfaces->data);
54
55 // Delete undeleted contexts
56 while (evas_gl->contexts)
57 evas_gl_context_destroy(evas_gl, evas_gl->contexts->data);
58
59 evas_gl->magic = 0;
60 free(evas_gl);
61}
62
63EAPI Evas_GL_Surface *
64evas_gl_surface_create(Evas_GL *evas_gl, Evas_GL_Config *config, int width, int height)
65{
66 Evas_GL_Surface *surf;
67
68 MAGIC_CHECK(evas_gl, Evas_GL, MAGIC_EVAS_GL);
69 return NULL;
70 MAGIC_CHECK_END();
71
72 if (!config)
73 {
74 ERR("Invalid Config\n");
75 return NULL;
76 }
77
78 surf = calloc(1, sizeof(Evas_GL_Surface));
79
80 surf->data = evas_gl->evas->engine.func->gl_surface_create(evas_gl->evas->engine.data.output, config, width, height);
81
82 if (!surf->data)
83 {
84 ERR("Failed creating a surface from the engine\n");
85 free(surf);
86 return NULL;
87 }
88
89 // Keep track of the surface creations
90 evas_gl->surfaces = eina_list_prepend(evas_gl->surfaces, surf);
91
92 return surf;
93}
94
95EAPI void
96evas_gl_surface_destroy(Evas_GL *evas_gl, Evas_GL_Surface *surf)
97{
98 // Magic
99 MAGIC_CHECK(evas_gl, Evas_GL, MAGIC_EVAS_GL);
100 return;
101 MAGIC_CHECK_END();
102
103 if (!surf)
104 {
105 ERR("Trying to destroy a NULL surface pointer!\n");
106 return;
107 }
108
109 // Call Engine's Surface Destroy
110 evas_gl->evas->engine.func->gl_surface_destroy(evas_gl->evas->engine.data.output, surf->data);
111
112 // Remove it from the list
113 evas_gl->surfaces = eina_list_remove(evas_gl->surfaces, surf);
114
115 // Delete the object
116 free(surf);
117 surf = NULL;
118}
119
120EAPI Evas_GL_Context *
121evas_gl_context_create(Evas_GL *evas_gl, Evas_GL_Context *share_ctx)
122{
123 Evas_GL_Context *ctx;
124
125 // Magic
126 MAGIC_CHECK(evas_gl, Evas_GL, MAGIC_EVAS_GL);
127 return NULL;
128 MAGIC_CHECK_END();
129
130 // Allocate a context object
131 ctx = calloc(1, sizeof(Evas_GL_Context));
132 if (!ctx)
133 {
134 ERR("Unable to create a Evas_GL_Context object\n");
135 return NULL;
136 }
137
138 // Call engine->gl_create_context
139 if (share_ctx)
140 {
141 ctx->data = evas_gl->evas->engine.func->gl_context_create(evas_gl->evas->engine.data.output, share_ctx->data);
142 }
143 else
144 {
145 ctx->data = evas_gl->evas->engine.func->gl_context_create(evas_gl->evas->engine.data.output, NULL);
146 }
147
148 // Set a few variables
149 if (!ctx->data)
150 {
151 ERR("Failed creating a context from the engine\n");
152 free(ctx);
153 return NULL;
154 }
155
156 // Keep track of the context creations
157 evas_gl->contexts = eina_list_prepend(evas_gl->contexts, ctx);
158
159 return ctx;
160
161}
162
163EAPI void
164evas_gl_context_destroy(Evas_GL *evas_gl, Evas_GL_Context *ctx)
165{
166
167 MAGIC_CHECK(evas_gl, Evas_GL, MAGIC_EVAS_GL);
168 return;
169 MAGIC_CHECK_END();
170
171 if (!ctx)
172 {
173 ERR("Trying to destroy a NULL context pointer!\n");
174 return;
175 }
176
177 // Call Engine's destroy
178 evas_gl->evas->engine.func->gl_context_destroy(evas_gl->evas->engine.data.output, ctx->data);
179
180 // Remove it from the list
181 evas_gl->contexts = eina_list_remove(evas_gl->contexts, ctx);
182
183 // Delete the object
184 free(ctx);
185 ctx = NULL;
186}
187
188EAPI Eina_Bool
189evas_gl_make_current(Evas_GL *evas_gl, Evas_GL_Surface *surf, Evas_GL_Context *ctx)
190{
191 Eina_Bool ret;
192
193 MAGIC_CHECK(evas_gl, Evas_GL, MAGIC_EVAS_GL);
194 return EINA_FALSE;
195 MAGIC_CHECK_END();
196
197 if ((!surf) || (!ctx))
198 ret = (Eina_Bool)evas_gl->evas->engine.func->gl_make_current(evas_gl->evas->engine.data.output, NULL, NULL);
199 else
200 ret = (Eina_Bool)evas_gl->evas->engine.func->gl_make_current(evas_gl->evas->engine.data.output, surf->data, ctx->data);
201
202 return ret;
203}
204
205EAPI const char *
206evas_gl_string_query(Evas_GL *evas_gl, int name)
207{
208 MAGIC_CHECK(evas_gl, Evas_GL, MAGIC_EVAS_GL);
209 return EINA_FALSE;
210 MAGIC_CHECK_END();
211
212 return (const char *)evas_gl->evas->engine.func->gl_string_query(evas_gl->evas->engine.data.output, name);
213}
214
215EAPI Evas_GL_Func
216evas_gl_proc_address_get(Evas_GL *evas_gl, const char *name)
217{
218 MAGIC_CHECK(evas_gl, Evas_GL, MAGIC_EVAS_GL);
219 return EINA_FALSE;
220 MAGIC_CHECK_END();
221
222 return (Evas_GL_Func)evas_gl->evas->engine.func->gl_proc_address_get(evas_gl->evas->engine.data.output, name);
223}
224
225EAPI Eina_Bool
226evas_gl_native_surface_get(Evas_GL *evas_gl, Evas_GL_Surface *surf, Evas_Native_Surface *ns)
227{
228 MAGIC_CHECK(evas_gl, Evas_GL, MAGIC_EVAS_GL);
229 return EINA_FALSE;
230 MAGIC_CHECK_END();
231
232 return (Eina_Bool)evas_gl->evas->engine.func->gl_native_surface_get(evas_gl->evas->engine.data.output, surf->data, ns);
233}
234
235
236EAPI Evas_GL_API *
237evas_gl_api_get(Evas_GL *evas_gl)
238{
239 MAGIC_CHECK(evas_gl, Evas_GL, MAGIC_EVAS_GL);
240 return NULL;
241 MAGIC_CHECK_END();
242
243 return (Evas_GL_API*)evas_gl->evas->engine.func->gl_api_get(evas_gl->evas->engine.data.output);
244
245}
diff --git a/libraries/evas/src/lib/canvas/evas_key.c b/libraries/evas/src/lib/canvas/evas_key.c
new file mode 100644
index 0000000..f74ef34
--- /dev/null
+++ b/libraries/evas/src/lib/canvas/evas_key.c
@@ -0,0 +1,245 @@
1#include "evas_common.h"
2#include "evas_private.h"
3
4/* private calls */
5
6static int
7evas_key_modifier_number(const Evas_Modifier *m, const char *keyname)
8{
9 int i;
10
11 for (i = 0; i < m->mod.count; i++)
12 {
13 if (!strcmp(m->mod.list[i], keyname)) return i;
14 }
15 return -1;
16}
17
18static int
19evas_key_lock_number(const Evas_Lock *l, const char *keyname)
20{
21 int i;
22
23 for (i = 0; i < l->lock.count; i++)
24 {
25 if (!strcmp(l->lock.list[i], keyname)) return i;
26 }
27 return -1;
28}
29
30/* local calls */
31
32/* public calls */
33
34EAPI const Evas_Modifier *
35evas_key_modifier_get(const Evas *e)
36{
37 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
38 return NULL;
39 MAGIC_CHECK_END();
40 return &(e->modifiers);
41}
42
43EAPI const Evas_Lock *
44evas_key_lock_get(const Evas *e)
45{
46 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
47 return NULL;
48 MAGIC_CHECK_END();
49 return &(e->locks);
50}
51
52EAPI Eina_Bool
53evas_key_modifier_is_set(const Evas_Modifier *m, const char *keyname)
54{
55 Evas_Modifier_Mask num;
56 int n;
57
58 if (!m) return 0;
59 if (!keyname) return 0;
60 n = evas_key_modifier_number(m, keyname);
61 if (n < 0) return 0;
62 num = (Evas_Modifier_Mask)n;
63 num = 1 << num;
64 if (m->mask & num) return 1;
65 return 0;
66}
67
68EAPI Eina_Bool
69evas_key_lock_is_set(const Evas_Lock *l, const char *keyname)
70{
71 Evas_Modifier_Mask num;
72 int n;
73
74 if (!l) return 0;
75 if (!keyname) return 0;
76 n = evas_key_lock_number(l, keyname);
77 if (n < 0) return 0;
78 num = (Evas_Modifier_Mask)n;
79 num = 1 << num;
80 if (l->mask & num) return 1;
81 return 0;
82}
83
84EAPI void
85evas_key_modifier_add(Evas *e, const char *keyname)
86{
87 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
88 return;
89 MAGIC_CHECK_END();
90 if (!keyname) return;
91 if (e->modifiers.mod.count >= 64) return;
92 evas_key_modifier_del(e, keyname);
93 e->modifiers.mod.count++;
94 e->modifiers.mod.list = realloc(e->modifiers.mod.list, e->modifiers.mod.count * sizeof(char *));
95 e->modifiers.mod.list[e->modifiers.mod.count - 1] = strdup(keyname);
96 e->modifiers.mask = 0;
97}
98
99EAPI void
100evas_key_modifier_del(Evas *e, const char *keyname)
101{
102 int i;
103
104 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
105 return;
106 MAGIC_CHECK_END();
107 if (!keyname) return;
108 for (i = 0; i < e->modifiers.mod.count; i++)
109 {
110 if (!strcmp(e->modifiers.mod.list[i], keyname))
111 {
112 int j;
113
114 free(e->modifiers.mod.list[i]);
115 e->modifiers.mod.count--;
116 for (j = i; j < e->modifiers.mod.count; j++)
117 e->modifiers.mod.list[j] = e->modifiers.mod.list[j + 1];
118 e->modifiers.mask = 0;
119 return;
120 }
121 }
122}
123
124EAPI void
125evas_key_lock_add(Evas *e, const char *keyname)
126{
127 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
128 return;
129 MAGIC_CHECK_END();
130 if (!keyname) return;
131 if (e->locks.lock.count >= 64) return;
132 evas_key_lock_del(e, keyname);
133 e->locks.lock.count++;
134 e->locks.lock.list = realloc(e->locks.lock.list, e->locks.lock.count * sizeof(char *));
135 e->locks.lock.list[e->locks.lock.count - 1] = strdup(keyname);
136 e->locks.mask = 0;
137}
138
139EAPI void
140evas_key_lock_del(Evas *e, const char *keyname)
141{
142 int i;
143
144 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
145 return;
146 MAGIC_CHECK_END();
147 if (!keyname) return;
148 e->locks.mask = 0;
149 for (i = 0; i < e->locks.lock.count; i++)
150 {
151 if (!strcmp(e->locks.lock.list[i], keyname))
152 {
153 int j;
154
155 free(e->locks.lock.list[i]);
156 e->locks.lock.count--;
157 for (j = i; j < e->locks.lock.count; j++)
158 e->locks.lock.list[j] = e->locks.lock.list[j + 1];
159 e->locks.mask = 0;
160 return;
161 }
162 }
163}
164
165EAPI void
166evas_key_modifier_on(Evas *e, const char *keyname)
167{
168 Evas_Modifier_Mask num;
169 int n;
170
171 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
172 return;
173 MAGIC_CHECK_END();
174 n = (Evas_Modifier_Mask)evas_key_modifier_number(&(e->modifiers), keyname);
175 if (n < 0) return;
176 num = (Evas_Modifier_Mask)n;
177 num = 1 << num;
178 e->modifiers.mask |= num;
179}
180
181EAPI void
182evas_key_modifier_off(Evas *e, const char *keyname)
183{
184 Evas_Modifier_Mask num;
185 int n;
186
187 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
188 return;
189 MAGIC_CHECK_END();
190 n = evas_key_modifier_number(&(e->modifiers), keyname);
191 if (n < 0) return;
192 num = (Evas_Modifier_Mask)n;
193 num = 1 << num;
194 e->modifiers.mask &= ~num;
195}
196
197EAPI void
198evas_key_lock_on(Evas *e, const char *keyname)
199{
200 Evas_Modifier_Mask num;
201 int n;
202
203 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
204 return;
205 MAGIC_CHECK_END();
206 n = evas_key_lock_number(&(e->locks), keyname);
207 if (n < 0) return;
208 num = (Evas_Modifier_Mask)n;
209 num = 1 << num;
210 e->locks.mask |= num;
211}
212
213EAPI void
214evas_key_lock_off(Evas *e, const char *keyname)
215{
216 Evas_Modifier_Mask num;
217 int n;
218
219 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
220 return;
221 MAGIC_CHECK_END();
222 n = evas_key_lock_number(&(e->locks), keyname);
223 if (n < 0) return;
224 num = (Evas_Modifier_Mask)n;
225 num = 1 << num;
226 e->locks.mask &= ~num;
227}
228
229/* errr need to add key grabbing/ungrabbing calls - missing modifier stuff. */
230
231EAPI Evas_Modifier_Mask
232evas_key_modifier_mask_get(const Evas *e, const char *keyname)
233{
234 Evas_Modifier_Mask num;
235 int n;
236
237 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
238 return 0;
239 MAGIC_CHECK_END();
240 if (!keyname) return 0;
241 n = evas_key_modifier_number(&(e->modifiers), keyname);
242 if (n < 0) return 0;
243 num = (Evas_Modifier_Mask)n;
244 return 1 << num;
245}
diff --git a/libraries/evas/src/lib/canvas/evas_key_grab.c b/libraries/evas/src/lib/canvas/evas_key_grab.c
new file mode 100644
index 0000000..3fc2172
--- /dev/null
+++ b/libraries/evas/src/lib/canvas/evas_key_grab.c
@@ -0,0 +1,179 @@
1#include "evas_common.h"
2#include "evas_private.h"
3
4/* private calls */
5
6/* FIXME: this is not optimal, but works. i should have a hash of keys per */
7/* Evas and then a linked lists of grabs for that key and what */
8/* modifiers/not_modifers they use */
9
10static Evas_Key_Grab *evas_key_grab_new (Evas_Object *obj, const char *keyname, Evas_Modifier_Mask modifiers, Evas_Modifier_Mask not_modifiers, Eina_Bool exclusive);
11static Evas_Key_Grab *evas_key_grab_find (Evas_Object *obj, const char *keyname, Evas_Modifier_Mask modifiers, Evas_Modifier_Mask not_modifiers, Eina_Bool exclusive);
12
13static Evas_Key_Grab *
14evas_key_grab_new(Evas_Object *obj, const char *keyname, Evas_Modifier_Mask modifiers, Evas_Modifier_Mask not_modifiers, Eina_Bool exclusive)
15{
16 /* MEM OK */
17 Evas_Key_Grab *g;
18
19 g = evas_mem_calloc(sizeof(Evas_Key_Grab));
20 if (!g) return NULL;
21 g->object = obj;
22 g->modifiers = modifiers;
23 g->not_modifiers = not_modifiers;
24 g->exclusive = exclusive;
25 g->keyname = strdup(keyname);
26 if (obj->layer->evas->walking_grabs)
27 g->just_added = EINA_TRUE;
28 if (!g->keyname)
29 {
30 if (!evas_mem_free(strlen(keyname) + 1))
31 {
32 free(g);
33 return NULL;
34 }
35 g->keyname = strdup(keyname);
36 if (!g->keyname)
37 {
38 free(g);
39 return NULL;
40 }
41 }
42 g->object->grabs = eina_list_append(g->object->grabs, g);
43 if (eina_error_get())
44 {
45 MERR_BAD();
46 evas_mem_free(sizeof(Eina_List));
47 g->object->grabs = eina_list_append(g->object->grabs, g);
48 if (eina_error_get())
49 {
50 MERR_FATAL();
51 free(g->keyname);
52 free(g);
53 return NULL;
54 }
55 }
56 obj->layer->evas->grabs = eina_list_append(obj->layer->evas->grabs, g);
57 if (eina_error_get())
58 {
59 MERR_BAD();
60 evas_mem_free(sizeof(Eina_List));
61 obj->layer->evas->grabs = eina_list_append(obj->layer->evas->grabs, g);
62 if (eina_error_get())
63 {
64 MERR_FATAL();
65 g->object->grabs = eina_list_remove(g->object->grabs, g);
66 free(g->keyname);
67 free(g);
68 return NULL;
69 }
70 }
71 return g;
72}
73
74static Evas_Key_Grab *
75evas_key_grab_find(Evas_Object *obj, const char *keyname, Evas_Modifier_Mask modifiers, Evas_Modifier_Mask not_modifiers, Eina_Bool exclusive)
76{
77 /* MEM OK */
78 Eina_List *l;
79 Evas_Key_Grab *g;
80
81 EINA_LIST_FOREACH(obj->layer->evas->grabs, l, g)
82 {
83 if ((g->modifiers == modifiers) &&
84 (g->not_modifiers == not_modifiers) &&
85 (!strcmp(g->keyname, keyname)))
86 {
87 if ((exclusive) || (obj == g->object)) return g;
88 }
89 }
90 return NULL;
91}
92
93/* local calls */
94
95void
96evas_object_grabs_cleanup(Evas_Object *obj)
97{
98 if (obj->layer->evas->walking_grabs)
99 {
100 Eina_List *l;
101 Evas_Key_Grab *g;
102
103 EINA_LIST_FOREACH(obj->grabs, l, g)
104 g->delete_me = EINA_TRUE;
105 }
106 else
107 {
108 while (obj->grabs)
109 {
110 Evas_Key_Grab *g = obj->grabs->data;
111 if (g->keyname) free(g->keyname);
112 free(g);
113 obj->layer->evas->grabs = eina_list_remove(obj->layer->evas->grabs,
114 g);
115 obj->grabs = eina_list_remove(obj->grabs, g);
116 }
117 }
118}
119
120void
121evas_key_grab_free(Evas_Object *obj, const char *keyname, Evas_Modifier_Mask modifiers, Evas_Modifier_Mask not_modifiers)
122{
123 /* MEM OK */
124 Evas_Key_Grab *g;
125
126 g = evas_key_grab_find(obj, keyname, modifiers, not_modifiers, 0);
127 if (!g) return;
128 g->object->grabs = eina_list_remove(g->object->grabs, g);
129 obj->layer->evas->grabs = eina_list_remove(obj->layer->evas->grabs, g);
130 if (g->keyname) free(g->keyname);
131 free(g);
132}
133
134/* public calls */
135
136EAPI Eina_Bool
137evas_object_key_grab(Evas_Object *obj, const char *keyname, Evas_Modifier_Mask modifiers, Evas_Modifier_Mask not_modifiers, Eina_Bool exclusive)
138{
139 /* MEM OK */
140 Evas_Key_Grab *g;
141
142 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
143 return EINA_FALSE;
144 MAGIC_CHECK_END();
145 if (!keyname) return EINA_FALSE;
146 if (exclusive)
147 {
148 g = evas_key_grab_find(obj, keyname, modifiers, not_modifiers,
149 exclusive);
150 if (g) return EINA_FALSE;
151 }
152 g = evas_key_grab_new(obj, keyname, modifiers, not_modifiers, exclusive);
153 if (!g) return EINA_FALSE;
154 return EINA_TRUE;
155}
156
157EAPI void
158evas_object_key_ungrab(Evas_Object *obj, const char *keyname, Evas_Modifier_Mask modifiers, Evas_Modifier_Mask not_modifiers)
159{
160 /* MEM OK */
161 Evas_Key_Grab *g;
162
163 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
164 return;
165 MAGIC_CHECK_END();
166 if (!keyname) return;
167 g = evas_key_grab_find(obj, keyname, modifiers, not_modifiers, 0);
168 if (!g) return;
169 if (g->object->layer->evas->walking_grabs)
170 {
171 if (!g->delete_me)
172 {
173 g->object->layer->evas->delete_grabs++;
174 g->delete_me = EINA_TRUE;
175 }
176 }
177 else
178 evas_key_grab_free(g->object, keyname, modifiers, not_modifiers);
179}
diff --git a/libraries/evas/src/lib/canvas/evas_layer.c b/libraries/evas/src/lib/canvas/evas_layer.c
new file mode 100644
index 0000000..54e9907
--- /dev/null
+++ b/libraries/evas/src/lib/canvas/evas_layer.c
@@ -0,0 +1,193 @@
1#include "evas_common.h"
2#include "evas_private.h"
3
4static void _evas_layer_free(Evas_Layer *lay);
5
6void
7evas_object_inject(Evas_Object *obj, Evas *e)
8{
9 Evas_Layer *lay;
10
11 if (obj->in_layer) return;
12 lay = evas_layer_find(e, obj->cur.layer);
13 if (!lay)
14 {
15 lay = evas_layer_new(e);
16 lay->layer = obj->cur.layer;
17 evas_layer_add(lay);
18 }
19 lay->objects = (Evas_Object *)eina_inlist_append(EINA_INLIST_GET(lay->objects), EINA_INLIST_GET(obj));
20 lay->usage++;
21 obj->layer = lay;
22 obj->in_layer = 1;
23}
24
25void
26evas_object_release(Evas_Object *obj, int clean_layer)
27{
28 if (!obj->in_layer) return;
29 obj->layer->objects = (Evas_Object *)eina_inlist_remove(EINA_INLIST_GET(obj->layer->objects), EINA_INLIST_GET(obj));
30 obj->layer->usage--;
31 if (clean_layer)
32 {
33 if (obj->layer->usage <= 0)
34 {
35 evas_layer_del(obj->layer);
36 _evas_layer_free(obj->layer);
37 }
38 }
39 obj->layer = NULL;
40 obj->in_layer = 0;
41}
42
43Evas_Layer *
44evas_layer_new(Evas *e)
45{
46 Evas_Layer *lay;
47
48 lay = calloc(1, sizeof(Evas_Layer));
49 if (!lay) return NULL;
50 lay->evas = e;
51 return lay;
52}
53
54static void
55_evas_layer_free(Evas_Layer *lay)
56{
57 free(lay);
58}
59
60void
61evas_layer_pre_free(Evas_Layer *lay)
62{
63 Evas_Object *obj;
64
65 EINA_INLIST_FOREACH(lay->objects, obj)
66 {
67 if ((!obj->smart.parent) && (!obj->delete_me))
68 evas_object_del(obj);
69 }
70}
71
72void
73evas_layer_free_objects(Evas_Layer *lay)
74{
75 while (lay->objects)
76 {
77 Evas_Object *obj;
78
79 obj = (Evas_Object *)lay->objects;
80 evas_object_free(obj, 0);
81 }
82}
83
84void
85evas_layer_clean(Evas *e)
86{
87 Evas_Layer *tmp;
88
89 while (e->layers)
90 {
91 tmp = e->layers;
92 evas_layer_del(tmp);
93 _evas_layer_free(tmp);
94 }
95}
96
97Evas_Layer *
98evas_layer_find(Evas *e, short layer_num)
99{
100 Evas_Layer *layer;
101
102 EINA_INLIST_FOREACH(e->layers, layer)
103 {
104 if (layer->layer == layer_num) return layer;
105 }
106 return NULL;
107}
108
109void
110evas_layer_add(Evas_Layer *lay)
111{
112 Evas_Layer *layer;
113
114 EINA_INLIST_FOREACH(lay->evas->layers, layer)
115 {
116 if (layer->layer > lay->layer)
117 {
118 lay->evas->layers = (Evas_Layer *)eina_inlist_prepend_relative(EINA_INLIST_GET(lay->evas->layers),
119 EINA_INLIST_GET(lay),
120 EINA_INLIST_GET(layer));
121 return;
122 }
123 }
124 lay->evas->layers = (Evas_Layer *)eina_inlist_append(EINA_INLIST_GET(lay->evas->layers), EINA_INLIST_GET(lay));
125}
126
127void
128evas_layer_del(Evas_Layer *lay)
129{
130 Evas *e;
131
132 e = lay->evas;
133 e->layers = (Evas_Layer *)eina_inlist_remove(EINA_INLIST_GET(e->layers), EINA_INLIST_GET(lay));
134}
135
136/* public functions */
137
138EAPI void
139evas_object_layer_set(Evas_Object *obj, short l)
140{
141 Evas *e;
142
143 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
144 return;
145 MAGIC_CHECK_END();
146 if (obj->delete_me) return;
147 if (evas_object_intercept_call_layer_set(obj, l)) return;
148 if (obj->smart.parent) return;
149 if (obj->cur.layer == l)
150 {
151 evas_object_raise(obj);
152 return;
153 }
154 e = obj->layer->evas;
155 evas_object_release(obj, 1);
156 obj->cur.layer = l;
157 evas_object_inject(obj, e);
158 obj->restack = 1;
159 evas_object_change(obj);
160 if (obj->clip.clipees)
161 {
162 evas_object_inform_call_restack(obj);
163 return;
164 }
165 evas_object_change(obj);
166 if (!obj->smart.smart)
167 {
168 if (evas_object_is_in_output_rect(obj,
169 obj->layer->evas->pointer.x,
170 obj->layer->evas->pointer.y, 1, 1) &&
171 obj->cur.visible)
172 if (eina_list_data_find(obj->layer->evas->pointer.object.in, obj))
173 evas_event_feed_mouse_move(obj->layer->evas,
174 obj->layer->evas->pointer.x,
175 obj->layer->evas->pointer.y,
176 obj->layer->evas->last_timestamp,
177 NULL);
178 }
179 evas_object_inform_call_restack(obj);
180}
181
182EAPI short
183evas_object_layer_get(const Evas_Object *obj)
184{
185 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
186 return 0;
187 MAGIC_CHECK_END();
188 if (obj->smart.parent)
189 {
190 return obj->smart.parent->cur.layer;
191 }
192 return obj->cur.layer;
193}
diff --git a/libraries/evas/src/lib/canvas/evas_main.c b/libraries/evas/src/lib/canvas/evas_main.c
new file mode 100644
index 0000000..0a37b2c
--- /dev/null
+++ b/libraries/evas/src/lib/canvas/evas_main.c
@@ -0,0 +1,671 @@
1#include "evas_common.h"
2#include "evas_private.h"
3#include "evas_cs.h"
4
5#ifdef LKDEBUG
6EAPI Eina_Bool lockdebug = EINA_FALSE;
7EAPI int lockmax = 0;
8#endif
9
10static int _evas_init_count = 0;
11int _evas_log_dom_global = -1;
12EAPI int
13evas_init(void)
14{
15 if (++_evas_init_count != 1)
16 return _evas_init_count;
17
18#ifdef LKDEBUG
19 if (getenv("EVAS_LOCK_DEBUG"))
20 {
21 lockdebug = EINA_TRUE;
22 lockmax = atoi(getenv("EVAS_LOCK_DEBUG"));
23 }
24#endif
25
26#ifdef HAVE_EVIL
27 if (!evil_init())
28 return --_evas_init_count;
29#endif
30
31 if (!eina_init())
32 goto shutdown_evil;
33
34 _evas_log_dom_global = eina_log_domain_register
35 ("evas_main", EVAS_DEFAULT_LOG_COLOR);
36 if (_evas_log_dom_global < 0)
37 {
38 EINA_LOG_ERR("Can not create a module log domain.");
39 goto shutdown_eina;
40 }
41
42 evas_module_init();
43#ifdef BUILD_ASYNC_EVENTS
44 if (!evas_async_events_init())
45 goto shutdown_module;
46#endif
47#ifdef EVAS_CSERVE
48 if (getenv("EVAS_CSERVE")) evas_cserve_init();
49#endif
50#ifdef BUILD_ASYNC_PRELOAD
51 _evas_preload_thread_init();
52#endif
53#ifdef EVAS_FRAME_QUEUING
54 evas_common_frameq_init();
55#endif
56
57 return _evas_init_count;
58
59#ifdef BUILD_ASYNC_EVENTS
60 shutdown_module:
61 evas_module_shutdown();
62 eina_log_domain_unregister(_evas_log_dom_global);
63#endif
64 shutdown_eina:
65 eina_shutdown();
66 shutdown_evil:
67#ifdef HAVE_EVIL
68 evil_shutdown();
69#endif
70
71 return --_evas_init_count;
72}
73
74EAPI int
75evas_shutdown(void)
76{
77 if (--_evas_init_count != 0)
78 return _evas_init_count;
79
80#ifdef EVAS_FRAME_QUEUING
81 if (evas_common_frameq_enabled())
82 {
83 evas_common_frameq_finish();
84 evas_common_frameq_destroy();
85 }
86#endif
87#ifdef BUILD_ASYNC_EVENTS
88 _evas_preload_thread_shutdown();
89#endif
90#ifdef EVAS_CSERVE
91 if (getenv("EVAS_CSERVE")) evas_cserve_shutdown();
92#endif
93#ifdef BUILD_ASYNC_EVENTS
94 evas_async_events_shutdown();
95#endif
96 evas_font_dir_cache_free();
97 evas_common_shutdown();
98 evas_module_shutdown();
99 eina_log_domain_unregister(_evas_log_dom_global);
100 eina_shutdown();
101#ifdef HAVE_EVIL
102 evil_shutdown();
103#endif
104
105 return _evas_init_count;
106}
107
108
109EAPI Evas *
110evas_new(void)
111{
112 Evas *e;
113
114 e = calloc(1, sizeof(Evas));
115 if (!e) return NULL;
116
117 e->magic = MAGIC_EVAS;
118 e->output.render_method = RENDER_METHOD_INVALID;
119 e->viewport.w = 1;
120 e->viewport.h = 1;
121 e->hinting = EVAS_FONT_HINTING_BYTECODE;
122 e->name_hash = eina_hash_string_superfast_new(NULL);
123 eina_clist_init(&e->calc_list);
124 eina_clist_init(&e->calc_done);
125
126#define EVAS_ARRAY_SET(E, Array) \
127 eina_array_step_set(&E->Array, sizeof (E->Array), 4096);
128
129 EVAS_ARRAY_SET(e, delete_objects);
130 EVAS_ARRAY_SET(e, active_objects);
131 EVAS_ARRAY_SET(e, restack_objects);
132 EVAS_ARRAY_SET(e, render_objects);
133 EVAS_ARRAY_SET(e, pending_objects);
134 EVAS_ARRAY_SET(e, obscuring_objects);
135 EVAS_ARRAY_SET(e, temporary_objects);
136 EVAS_ARRAY_SET(e, calculate_objects);
137 EVAS_ARRAY_SET(e, clip_changes);
138
139#undef EVAS_ARRAY_SET
140
141 return e;
142}
143
144EAPI void
145evas_free(Evas *e)
146{
147 Eina_Rectangle *r;
148 Evas_Coord_Touch_Point *touch_point;
149 Evas_Layer *lay;
150 int i;
151 int del;
152
153 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
154 return;
155 MAGIC_CHECK_END();
156
157#ifdef EVAS_FRAME_QUEUING
158 evas_common_frameq_flush();
159#endif
160
161 if (e->walking_list == 0) evas_render_idle_flush(e);
162
163 if (e->walking_list > 0) return;
164
165 if (e->callbacks)
166 {
167 if (e->callbacks->deletions_waiting) return;
168
169 e->callbacks->deletions_waiting = 0;
170 evas_event_callback_list_post_free(&e->callbacks->callbacks);
171 if (!e->callbacks->callbacks)
172 {
173 free(e->callbacks);
174 e->callbacks = NULL;
175 }
176
177 _evas_post_event_callback_free(e);
178 }
179
180 del = 1;
181 e->walking_list++;
182 e->cleanup = 1;
183 while (del)
184 {
185 del = 0;
186 EINA_INLIST_FOREACH(e->layers, lay)
187 {
188 Evas_Object *o;
189
190 evas_layer_pre_free(lay);
191
192 EINA_INLIST_FOREACH(lay->objects, o)
193 {
194 if ((o->callbacks) && (o->callbacks->walking_list))
195 {
196 /* Defer free */
197 e->delete_me = 1;
198 e->walking_list--;
199 return;
200 }
201 if (!o->delete_me)
202 del = 1;
203 }
204 }
205 }
206 EINA_INLIST_FOREACH(e->layers, lay)
207 evas_layer_free_objects(lay);
208 evas_layer_clean(e);
209
210 e->walking_list--;
211
212 evas_font_path_clear(e);
213 e->pointer.object.in = eina_list_free(e->pointer.object.in);
214
215 if (e->name_hash) eina_hash_free(e->name_hash);
216 e->name_hash = NULL;
217
218 EINA_LIST_FREE(e->damages, r)
219 eina_rectangle_free(r);
220 EINA_LIST_FREE(e->obscures, r)
221 eina_rectangle_free(r);
222
223 evas_fonts_zero_free(e);
224
225 evas_event_callback_all_del(e);
226 evas_event_callback_cleanup(e);
227
228 if (e->engine.func)
229 {
230 e->engine.func->context_free(e->engine.data.output, e->engine.data.context);
231 e->engine.func->output_free(e->engine.data.output);
232 e->engine.func->info_free(e, e->engine.info);
233 }
234
235 for (i = 0; i < e->modifiers.mod.count; i++)
236 free(e->modifiers.mod.list[i]);
237 if (e->modifiers.mod.list) free(e->modifiers.mod.list);
238
239 for (i = 0; i < e->locks.lock.count; i++)
240 free(e->locks.lock.list[i]);
241 if (e->locks.lock.list) free(e->locks.lock.list);
242
243 if (e->engine.module) evas_module_unref(e->engine.module);
244
245 eina_array_flush(&e->delete_objects);
246 eina_array_flush(&e->active_objects);
247 eina_array_flush(&e->restack_objects);
248 eina_array_flush(&e->render_objects);
249 eina_array_flush(&e->pending_objects);
250 eina_array_flush(&e->obscuring_objects);
251 eina_array_flush(&e->temporary_objects);
252 eina_array_flush(&e->calculate_objects);
253 eina_array_flush(&e->clip_changes);
254
255 EINA_LIST_FREE(e->touch_points, touch_point)
256 free(touch_point);
257
258 e->magic = 0;
259 free(e);
260}
261
262EAPI void
263evas_output_method_set(Evas *e, int render_method)
264{
265 Evas_Module *em;
266
267 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
268 return;
269 MAGIC_CHECK_END();
270
271 /* if our engine to set it to is invalid - abort */
272 if (render_method == RENDER_METHOD_INVALID) return;
273 /* if the engine is already set up - abort */
274 if (e->output.render_method != RENDER_METHOD_INVALID) return;
275 /* Request the right engine. */
276 em = evas_module_engine_get(render_method);
277 if (!em) return ;
278 if (em->id_engine != render_method) return;
279 if (!evas_module_load(em)) return;
280
281 /* set the correct render */
282 e->output.render_method = render_method;
283 e->engine.func = (em->functions);
284 evas_module_use(em);
285 if (e->engine.module) evas_module_unref(e->engine.module);
286 e->engine.module = em;
287 evas_module_ref(em);
288 /* get the engine info struct */
289 if (e->engine.func->info) e->engine.info = e->engine.func->info(e);
290 return;
291}
292
293EAPI int
294evas_output_method_get(const Evas *e)
295{
296 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
297 return RENDER_METHOD_INVALID;
298 MAGIC_CHECK_END();
299
300 return e->output.render_method;
301}
302
303EAPI Evas_Engine_Info *
304evas_engine_info_get(const Evas *e)
305{
306 Evas_Engine_Info *info;
307
308 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
309 return NULL;
310 MAGIC_CHECK_END();
311
312 if (!e->engine.info) return NULL;
313
314 info = e->engine.info;
315 ((Evas *)e)->engine.info_magic = info->magic;
316
317 return info;
318}
319
320EAPI Eina_Bool
321evas_engine_info_set(Evas *e, Evas_Engine_Info *info)
322{
323 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
324 return EINA_FALSE;
325 MAGIC_CHECK_END();
326 if (!info) return EINA_FALSE;
327 if (info != e->engine.info) return EINA_FALSE;
328 if (info->magic != e->engine.info_magic) return EINA_FALSE;
329 return (Eina_Bool)e->engine.func->setup(e, info);
330}
331
332EAPI void
333evas_output_size_set(Evas *e, int w, int h)
334{
335 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
336 return;
337 MAGIC_CHECK_END();
338
339 if ((w == e->output.w) && (h == e->output.h)) return;
340 if (w < 1) w = 1;
341 if (h < 1) h = 1;
342
343#ifdef EVAS_FRAME_QUEUING
344 evas_common_frameq_flush();
345#endif
346
347 e->output.w = w;
348 e->output.h = h;
349 e->output.changed = 1;
350 e->output_validity++;
351 e->changed = 1;
352 evas_render_invalidate(e);
353}
354
355EAPI void
356evas_output_size_get(const Evas *e, int *w, int *h)
357{
358 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
359 if (w) *w = 0;
360 if (h) *h = 0;
361 return;
362 MAGIC_CHECK_END();
363
364 if (w) *w = e->output.w;
365 if (h) *h = e->output.h;
366}
367
368EAPI void
369evas_output_viewport_set(Evas *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h)
370{
371 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
372 return;
373 MAGIC_CHECK_END();
374
375 if ((x == e->viewport.x) && (y == e->viewport.y) &&
376 (w == e->viewport.w) && (h == e->viewport.h)) return;
377 if (w <= 0) return;
378 if (h <= 0) return;
379 if ((x != 0) || (y != 0))
380 {
381 ERR("Compat error. viewport x,y != 0,0 not supported");
382 x = 0;
383 y = 0;
384 }
385 e->viewport.x = x;
386 e->viewport.y = y;
387 e->viewport.w = w;
388 e->viewport.h = h;
389 e->viewport.changed = 1;
390 e->output_validity++;
391 e->changed = 1;
392}
393
394EAPI void
395evas_output_viewport_get(const Evas *e, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
396{
397 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
398 if (x) *x = 0;
399 if (y) *y = 0;
400 if (w) *w = 0;
401 if (h) *h = 0;
402 return;
403 MAGIC_CHECK_END();
404
405 if (x) *x = e->viewport.x;
406 if (y) *y = e->viewport.y;
407 if (w) *w = e->viewport.w;
408 if (h) *h = e->viewport.h;
409}
410
411EAPI Evas_Coord
412evas_coord_screen_x_to_world(const Evas *e, int x)
413{
414 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
415 return 0;
416 MAGIC_CHECK_END();
417 if (e->output.w == e->viewport.w) return e->viewport.x + x;
418 return (long long)e->viewport.x + (((long long)x * (long long)e->viewport.w) / (long long)e->output.w);
419}
420
421EAPI Evas_Coord
422evas_coord_screen_y_to_world(const Evas *e, int y)
423{
424 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
425 return 0;
426 MAGIC_CHECK_END();
427 if (e->output.h == e->viewport.h) return e->viewport.y + y;
428 return (long long)e->viewport.y + (((long long)y * (long long)e->viewport.h) / (long long)e->output.h);
429}
430
431EAPI int
432evas_coord_world_x_to_screen(const Evas *e, Evas_Coord x)
433{
434 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
435 return 0;
436 MAGIC_CHECK_END();
437 if (e->output.w == e->viewport.w) return x - e->viewport.x;
438 return (int)((((long long)x - (long long)e->viewport.x) * (long long)e->output.w) / (long long)e->viewport.w);
439}
440
441EAPI int
442evas_coord_world_y_to_screen(const Evas *e, Evas_Coord y)
443{
444 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
445 return 0;
446 MAGIC_CHECK_END();
447 if (e->output.h == e->viewport.h) return y - e->viewport.y;
448 return (int)((((long long)y - (long long)e->viewport.y) * (long long)e->output.h) / (long long)e->viewport.h);
449}
450
451EAPI int
452evas_render_method_lookup(const char *name)
453{
454 Evas_Module *em;
455
456 if (!name) return RENDER_METHOD_INVALID;
457 /* search on the engines list for the name */
458 em = evas_module_find_type(EVAS_MODULE_TYPE_ENGINE, name);
459 if (!em) return RENDER_METHOD_INVALID;
460
461 return em->id_engine;
462}
463
464EAPI Eina_List *
465evas_render_method_list(void)
466{
467 return evas_module_engine_list();
468}
469
470EAPI void
471evas_render_method_list_free(Eina_List *list)
472{
473 eina_list_free(list);
474}
475
476EAPI Eina_Bool
477evas_object_image_extension_can_load_get(const char *file)
478{
479 const char *tmp;
480 Eina_Bool result;
481
482 tmp = eina_stringshare_add(file);
483 result = evas_common_extension_can_load_get(tmp);
484 eina_stringshare_del(tmp);
485
486 return result;
487}
488
489EAPI Eina_Bool
490evas_object_image_extension_can_load_fast_get(const char *file)
491{
492 return evas_common_extension_can_load_get(file);
493}
494
495EAPI void
496evas_pointer_output_xy_get(const Evas *e, int *x, int *y)
497{
498 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
499 if (x) *x = 0;
500 if (y) *y = 0;
501 return;
502 MAGIC_CHECK_END();
503 if (x) *x = e->pointer.x;
504 if (y) *y = e->pointer.y;
505}
506
507EAPI void
508evas_pointer_canvas_xy_get(const Evas *e, Evas_Coord *x, Evas_Coord *y)
509{
510 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
511 if (x) *x = 0;
512 if (y) *y = 0;
513 return;
514 MAGIC_CHECK_END();
515 if (x) *x = e->pointer.x;
516 if (y) *y = e->pointer.y;
517}
518
519EAPI int
520evas_pointer_button_down_mask_get(const Evas *e)
521{
522 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
523 return 0;
524 MAGIC_CHECK_END();
525 return (int)e->pointer.button;
526}
527
528EAPI Eina_Bool
529evas_pointer_inside_get(const Evas *e)
530{
531 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
532 return 0;
533 MAGIC_CHECK_END();
534 return (int)e->pointer.inside;
535}
536
537EAPI void
538evas_data_attach_set(Evas *e, void *data)
539{
540 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
541 return;
542 MAGIC_CHECK_END();
543 e->attach_data = data;
544}
545
546EAPI void *
547evas_data_attach_get(const Evas *e)
548{
549 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
550 return NULL;
551 MAGIC_CHECK_END();
552 return e->attach_data;
553}
554
555EAPI void
556evas_focus_in(Evas *e)
557{
558 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
559 return;
560 MAGIC_CHECK_END();
561 if (e->focus) return;
562 e->focus = 1;
563 evas_event_callback_call(e, EVAS_CALLBACK_CANVAS_FOCUS_IN, NULL);
564}
565
566EAPI void
567evas_focus_out(Evas *e)
568{
569 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
570 return;
571 MAGIC_CHECK_END();
572 if (!e->focus) return;
573 e->focus = 0;
574 evas_event_callback_call(e, EVAS_CALLBACK_CANVAS_FOCUS_OUT, NULL);
575}
576
577EAPI Eina_Bool
578evas_focus_state_get(const Evas *e)
579{
580 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
581 return 0;
582 MAGIC_CHECK_END();
583 return e->focus;
584}
585
586EAPI void
587evas_nochange_push(Evas *e)
588{
589 e->nochange++;
590}
591
592EAPI void
593evas_nochange_pop(Evas *e)
594{
595 e->nochange--;
596}
597
598void
599_evas_walk(Evas *e)
600{
601 e->walking_list++;
602}
603
604void
605_evas_unwalk(Evas *e)
606{
607 e->walking_list--;
608 if ((e->walking_list == 0) && (e->delete_me)) evas_free(e);
609}
610
611EAPI const char *
612evas_load_error_str(Evas_Load_Error error)
613{
614 switch (error)
615 {
616 case EVAS_LOAD_ERROR_NONE:
617 return "No error on load";
618 case EVAS_LOAD_ERROR_GENERIC:
619 return "A non-specific error occurred";
620 case EVAS_LOAD_ERROR_DOES_NOT_EXIST:
621 return "File (or file path) does not exist";
622 case EVAS_LOAD_ERROR_PERMISSION_DENIED:
623 return "Permission deinied to an existing file (or path)";
624 case EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED:
625 return "Allocation of resources failure prevented load";
626 case EVAS_LOAD_ERROR_CORRUPT_FILE:
627 return "File corrupt (but was detected as a known format)";
628 case EVAS_LOAD_ERROR_UNKNOWN_FORMAT:
629 return "File is not a known format";
630 default:
631 return "Unknown error";
632 }
633}
634
635EAPI void
636evas_color_hsv_to_rgb(float h, float s, float v, int *r, int *g, int *b)
637{
638 evas_common_convert_color_hsv_to_rgb(h, s, v, r, g, b);
639}
640
641EAPI void
642evas_color_rgb_to_hsv(int r, int g, int b, float *h, float *s, float *v)
643{
644 evas_common_convert_color_rgb_to_hsv(r, g, b, h, s, v);
645}
646
647EAPI void
648evas_color_argb_premul(int a, int *r, int *g, int *b)
649{
650 evas_common_convert_color_argb_premul(a, r, g, b);
651}
652
653EAPI void
654evas_color_argb_unpremul(int a, int *r, int *g, int *b)
655{
656 evas_common_convert_color_argb_unpremul(a, r, g, b);
657}
658
659EAPI void
660evas_data_argb_premul(unsigned int *data, unsigned int len)
661{
662 if (!data || (len < 1)) return;
663 evas_common_convert_argb_premul(data, len);
664}
665
666EAPI void
667evas_data_argb_unpremul(unsigned int *data, unsigned int len)
668{
669 if (!data || (len < 1)) return;
670 evas_common_convert_argb_unpremul(data, len);
671}
diff --git a/libraries/evas/src/lib/canvas/evas_map.c b/libraries/evas/src/lib/canvas/evas_map.c
new file mode 100644
index 0000000..fca8b3a
--- /dev/null
+++ b/libraries/evas/src/lib/canvas/evas_map.c
@@ -0,0 +1,1031 @@
1#include "evas_common.h"
2#include "evas_private.h"
3#include <math.h>
4
5static void
6_evas_map_calc_geom_change(Evas_Object *obj)
7{
8 int is, was = 0, pass = 0;
9
10 evas_object_change(obj);
11 evas_object_clip_dirty(obj);
12 if (obj->layer->evas->events_frozen <= 0)
13 {
14 evas_object_recalc_clippees(obj);
15 if (!pass)
16 {
17 if (!obj->smart.smart)
18 {
19 is = evas_object_is_in_output_rect(obj,
20 obj->layer->evas->pointer.x,
21 obj->layer->evas->pointer.y, 1, 1);
22 if ((is ^ was) && obj->cur.visible)
23 evas_event_feed_mouse_move(obj->layer->evas,
24 obj->layer->evas->pointer.x,
25 obj->layer->evas->pointer.y,
26 obj->layer->evas->last_timestamp,
27 NULL);
28 }
29 }
30 }
31 evas_object_inform_call_move(obj);
32 evas_object_inform_call_resize(obj);
33}
34
35static void
36_evas_map_calc_map_geometry(Evas_Object *obj)
37{
38 Evas_Coord x1, x2, y1, y2;
39 const Evas_Map_Point *p, *p_end;
40 Eina_Bool ch = EINA_FALSE;
41
42 if (!obj->cur.map) return;
43
44 // WARN: Do not merge below code to SLP until it is fixed.
45 // It has an infinite loop bug.
46 if (obj->prev.map)
47 {
48 // FIXME: this causes an infinite loop somewhere... hard to debug
49 if (obj->prev.map->count == obj->cur.map->count)
50 {
51 const Evas_Map_Point *p2;
52
53 p = obj->cur.map->points;
54 p_end = p + obj->cur.map->count;
55 p2 = obj->prev.map->points;
56
57 for (; p < p_end; p++, p2++)
58 {
59 if ((p->a != p2->a) ||
60 (p->r != p2->r) ||
61 (p->g != p2->g) ||
62 (p->b != p2->b))
63 {
64 ch = 1;
65 break;
66 }
67 if ((p->x != p2->x) ||
68 (p->y != p2->y) ||
69 (p->z != p2->z))
70 {
71 ch = 1;
72 break;
73 }
74 }
75 }
76 else
77 ch = 1;
78 }
79 else
80 ch = 1;
81
82 p = obj->cur.map->points;
83 p_end = p + obj->cur.map->count;
84 x1 = lround(p->x);
85 x2 = lround(p->x);
86 y1 = lround(p->y);
87 y2 = lround(p->y);
88 p++;
89 for (; p < p_end; p++)
90 {
91 if (p->x < x1) x1 = p->x;
92 if (p->x > x2) x2 = p->x;
93 if (p->y < y1) y1 = p->y;
94 if (p->y > y2) y2 = p->y;
95 }
96// this causes clip-out bugs now mapped objs canbe opaque!!!
97// // add 1 pixel of fuzz around the map region to ensure updates are correct
98// x1 -= 1; y1 -= 1;
99// x2 += 1; y2 += 1;
100 if (obj->cur.map->normal_geometry.x != x1) ch = 1;
101 if (obj->cur.map->normal_geometry.y != y1) ch = 1;
102 if (obj->cur.map->normal_geometry.w != (x2 - x1)) ch = 1;
103 if (obj->cur.map->normal_geometry.h != (y2 - y1)) ch = 1;
104 obj->cur.map->normal_geometry.x = x1;
105 obj->cur.map->normal_geometry.y = y1;
106 obj->cur.map->normal_geometry.w = (x2 - x1);
107 obj->cur.map->normal_geometry.h = (y2 - y1);
108 if (ch) _evas_map_calc_geom_change(obj);
109}
110
111static inline Evas_Map *
112_evas_map_new(int count)
113{
114 int i;
115 int alloc;
116 Evas_Map *m;
117
118 /* Adjust allocation such that: at least 4 points, and always an even
119 * number: this allows the software engine to work efficiently */
120 alloc = (count < 4) ? 4 : count;
121 if (alloc & 0x1) alloc ++;
122
123 m = calloc(1, sizeof(Evas_Map) + (alloc * sizeof(Evas_Map_Point)));
124 if (!m) return NULL;
125 m->count = count;
126 m->persp.foc = 0;
127 m->alpha = 1;
128 m->smooth = 1;
129 m->magic = MAGIC_MAP;
130 for (i = 0; i < count; i++)
131 {
132 m->points[i].r = 255;
133 m->points[i].g = 255;
134 m->points[i].b = 255;
135 m->points[i].a = 255;
136 }
137 return m;
138}
139
140static inline Eina_Bool
141_evas_map_copy(Evas_Map *dst, const Evas_Map *src)
142{
143 if (dst->count != src->count)
144 {
145 ERR("cannot copy map of different sizes: dst=%i, src=%i", dst->count, src->count);
146 return EINA_FALSE;
147 }
148 memcpy(dst->points, src->points, src->count * sizeof(Evas_Map_Point));
149 dst->smooth = src->smooth;
150 dst->alpha = src->alpha;
151 dst->persp = src->persp;
152 return EINA_TRUE;
153}
154
155static inline Evas_Map *
156_evas_map_dup(const Evas_Map *orig)
157{
158 Evas_Map *copy = _evas_map_new(orig->count);
159 if (!copy) return NULL;
160 memcpy(copy->points, orig->points, orig->count * sizeof(Evas_Map_Point));
161 copy->smooth = orig->smooth;
162 copy->alpha = orig->alpha;
163 copy->persp = orig->persp;
164 return copy;
165}
166
167static inline void
168_evas_map_free(Evas_Object *obj, Evas_Map *m)
169{
170 if (obj)
171 {
172 if (m->surface)
173 obj->layer->evas->engine.func->image_map_surface_free
174 (obj->layer->evas->engine.data.output, m->surface);
175 }
176 m->magic = 0;
177 free(m);
178}
179
180/****************************************************************************/
181/* util functions for manipulating maps, so you don't need to know the math */
182/****************************************************************************/
183static inline void
184_evas_map_util_points_populate(Evas_Map *m, const Evas_Coord x, const Evas_Coord y, const Evas_Coord w, const Evas_Coord h, const Evas_Coord z)
185{
186 Evas_Map_Point *p = m->points;
187 int i;
188
189 p[0].x = x;
190 p[0].y = y;
191 p[0].z = z;
192 p[0].u = 0.0;
193 p[0].v = 0.0;
194
195 p[1].x = x + w;
196 p[1].y = y;
197 p[1].z = z;
198 p[1].u = w;
199 p[1].v = 0.0;
200
201 p[2].x = x + w;
202 p[2].y = y + h;
203 p[2].z = z;
204 p[2].u = w;
205 p[2].v = h;
206
207 p[3].x = x;
208 p[3].y = y + h;
209 p[3].z = z;
210 p[3].u = 0.0;
211 p[3].v = h;
212
213 for (i = 0; i < 4; i++)
214 {
215 p[i].px = p[i].x;
216 p[i].py = p[i].y;
217 }
218}
219
220Eina_Bool
221evas_map_coords_get(const Evas_Map *m, Evas_Coord x, Evas_Coord y,
222 Evas_Coord *mx, Evas_Coord *my, int grab)
223{
224 MAGIC_CHECK(m, Evas_Map, MAGIC_MAP);
225 return EINA_FALSE;
226 MAGIC_CHECK_END();
227
228 int i, j, edges, edge[m->count][2], douv;
229 Evas_Coord xe[2];
230 double u[2] = { 0.0, 0.0 };
231 double v[2] = { 0.0, 0.0 };
232
233 if (m->count < 4) return 0;
234 // FIXME need to handle grab mode and extrapolte coords outside
235 // map
236 if (grab)
237 {
238 Evas_Coord ymin, ymax;
239
240 ymin = m->points[0].y;
241 ymax = m->points[0].y;
242 for (i = 1; i < m->count; i++)
243 {
244 if (m->points[i].y < ymin) ymin = m->points[i].y;
245 else if (m->points[i].y > ymax) ymax = m->points[i].y;
246 }
247 if (y <= ymin) y = ymin + 1;
248 if (y >= ymax) y = ymax - 1;
249 }
250 edges = 0;
251 for (i = 0; i < m->count; i++)
252 {
253 j = (i + 1) % m->count;
254 if ((m->points[i].y <= y) && (m->points[j].y > y))
255 {
256 edge[edges][0] = i;
257 edge[edges][1] = j;
258 edges++;
259 }
260 else if ((m->points[j].y <= y) && (m->points[i].y > y))
261 {
262 edge[edges][0] = j;
263 edge[edges][1] = i;
264 edges++;
265 }
266 }
267 douv = 0;
268 if ((mx) || (my)) douv = 1;
269 for (i = 0; i < (edges - 1); i+= 2)
270 {
271 Evas_Coord yp, yd;
272
273 j = i + 1;
274 yd = m->points[edge[i][1]].y - m->points[edge[i][0]].y;
275 if (yd > 0)
276 {
277 yp = y - m->points[edge[i][0]].y;
278 xe[0] = m->points[edge[i][1]].x - m->points[edge[i][0]].x;
279 xe[0] = m->points[edge[i][0]].x + ((xe[0] * yp) / yd);
280 if (douv)
281 {
282 u[0] = m->points[edge[i][1]].u - m->points[edge[i][0]].u;
283 u[0] = m->points[edge[i][0]].u + ((u[0] * yp) / yd);
284 v[0] = m->points[edge[i][1]].v - m->points[edge[i][0]].v;
285 v[0] = m->points[edge[i][0]].v + ((v[0] * yp) / yd);
286 }
287 }
288 else
289 {
290 xe[0] = m->points[edge[i][0]].x;
291 if (douv)
292 {
293 u[0] = m->points[edge[i][0]].u;
294 v[0] = m->points[edge[i][0]].v;
295 }
296 }
297 yd = m->points[edge[j][1]].y - m->points[edge[j][0]].y;
298 if (yd > 0)
299 {
300 yp = y - m->points[edge[j][0]].y;
301 xe[1] = m->points[edge[j][1]].x - m->points[edge[j][0]].x;
302 xe[1] = m->points[edge[j][0]].x + ((xe[1] * yp) / yd);
303 if (douv)
304 {
305 u[1] = m->points[edge[j][1]].u - m->points[edge[j][0]].u;
306 u[1] = m->points[edge[j][0]].u + ((u[1] * yp) / yd);
307 v[1] = m->points[edge[j][1]].v - m->points[edge[j][0]].v;
308 v[1] = m->points[edge[j][0]].v + ((v[1] * yp) / yd);
309 }
310 }
311 else
312 {
313 xe[1] = m->points[edge[j][0]].x;
314 if (douv)
315 {
316 u[1] = m->points[edge[j][0]].u;
317 v[1] = m->points[edge[j][0]].v;
318 }
319 }
320 if (xe[0] > xe[1])
321 {
322 int ti;
323
324 ti = xe[0]; xe[0] = xe[1]; xe[1] = ti;
325 if (douv)
326 {
327 double td;
328
329 td = u[0]; u[0] = u[1]; u[1] = td;
330 td = v[0]; v[0] = v[1]; v[1] = td;
331 }
332 }
333 if ((x >= xe[0]) && (x < xe[1]))
334 {
335 if (douv)
336 {
337 if (mx)
338 *mx = u[0] + (((x - xe[0]) * (u[1] - u[0])) /
339 (xe[1] - xe[0]));
340 if (my)
341 *my = v[0] + (((x - xe[0]) * (v[1] - v[0])) /
342 (xe[1] - xe[0]));
343 }
344 return EINA_TRUE;
345 }
346 if (grab)
347 {
348 if (douv)
349 {
350 if (mx)
351 *mx = u[0] + (((x - xe[0]) * (u[1] - u[0])) /
352 (xe[1] - xe[0]));
353 if (my)
354 *my = v[0] + (((x - xe[0]) * (v[1] - v[0])) /
355 (xe[1] - xe[0]));
356 }
357 return EINA_TRUE;
358 }
359 }
360 return EINA_FALSE;
361}
362
363Eina_Bool
364evas_map_inside_get(const Evas_Map *m, Evas_Coord x, Evas_Coord y)
365{
366 return evas_map_coords_get(m, x, y, NULL, NULL, 0);
367}
368
369EAPI void
370evas_object_map_enable_set(Evas_Object *obj, Eina_Bool enabled)
371{
372 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
373 return;
374 MAGIC_CHECK_END();
375
376 enabled = !!enabled;
377 if (obj->cur.usemap == enabled) return;
378 obj->cur.usemap = enabled;
379 if (enabled)
380 {
381 if (!obj->cur.map)
382 obj->cur.map = _evas_map_new(4);
383 evas_object_mapped_clip_across_mark(obj);
384// obj->cur.map->normal_geometry = obj->cur.geometry;
385 }
386 else
387 {
388 if (obj->cur.map)
389 {
390 _evas_map_calc_geom_change(obj);
391 evas_object_mapped_clip_across_mark(obj);
392 //FIXME: Since the last frame is not updated when map is
393 //disabled, afterimage problem is happened in s/w rendering.
394 //Need to find out the fundamental reason then fix it.
395 evas_damage_rectangle_add(obj->layer->evas,
396 0,
397 0,
398 obj->layer->evas->output.w,
399 obj->layer->evas->output.h);
400 }
401 }
402 _evas_map_calc_map_geometry(obj);
403 /* This is a bit heavy handed, but it fixes the case of same geometry, but
404 * changed colour or UV settings. */
405 evas_object_change(obj);
406}
407
408EAPI Eina_Bool
409evas_object_map_enable_get(const Evas_Object *obj)
410{
411 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
412 return EINA_FALSE;
413 MAGIC_CHECK_END();
414 return obj->cur.usemap;
415}
416
417
418EAPI void
419evas_object_map_source_set(Evas_Object *obj, Evas_Object *src)
420{
421 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
422 return;
423 MAGIC_CHECK_END();
424 (void)src; /* method still needs to be implemented. */
425}
426
427EAPI Evas_Object *
428evas_object_map_source_get(const Evas_Object *obj)
429{
430 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
431 return NULL;
432 MAGIC_CHECK_END();
433 return NULL;
434}
435
436EAPI void
437evas_object_map_set(Evas_Object *obj, const Evas_Map *map)
438{
439 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
440 return;
441 MAGIC_CHECK_END();
442
443 if (!map)
444 {
445 if (obj->cur.map)
446 {
447 if (obj->cur.map->surface)
448 {
449 obj->layer->evas->engine.func->image_map_surface_free
450 (obj->layer->evas->engine.data.output,
451 obj->cur.map->surface);
452 obj->cur.map->surface = NULL;
453 }
454 obj->prev.geometry = obj->cur.map->normal_geometry;
455 if (!obj->prev.map)
456 {
457 _evas_map_free(obj, obj->cur.map);
458 obj->cur.map = NULL;
459 evas_object_mapped_clip_across_mark(obj);
460 return;
461 }
462 _evas_map_free(obj, obj->cur.map);
463 obj->cur.map = NULL;
464 if (!obj->cur.usemap) _evas_map_calc_geom_change(obj);
465 else _evas_map_calc_map_geometry(obj);
466 if (obj->cur.usemap)
467 {
468 evas_object_mapped_clip_across_mark(obj);
469 //FIXME: Since the last frame is not updated when map is
470 //disabled, afterimage problem is happened in s/w
471 //rendering. Need to find out the fundamental reason
472 //then fix it.
473 evas_damage_rectangle_add(obj->layer->evas,
474 0,
475 0,
476 obj->layer->evas->output.w,
477 obj->layer->evas->output.h);
478 }
479 }
480 return;
481 }
482
483 if ((obj->cur.map) && (obj->cur.map->count == map->count))
484 {
485 Evas_Map *omap = obj->cur.map;
486 obj->cur.map = _evas_map_new(map->count);
487 memcpy(obj->cur.map, omap, sizeof(Evas_Map) + (map->count * sizeof(Evas_Map_Point)));
488 _evas_map_copy(obj->cur.map, map);
489 if (obj->prev.map == omap) obj->prev.map = NULL;
490 free(omap);
491 }
492 else
493 {
494 if (obj->cur.map) evas_map_free(obj->cur.map);
495 obj->cur.map = _evas_map_dup(map);
496 if (obj->cur.usemap)
497 evas_object_mapped_clip_across_mark(obj);
498 }
499 _evas_map_calc_map_geometry(obj);
500}
501
502EAPI const Evas_Map *
503evas_object_map_get(const Evas_Object *obj)
504{
505 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
506 return NULL;
507 MAGIC_CHECK_END();
508
509 return obj->cur.map;
510}
511
512EAPI Evas_Map *
513evas_map_new(int count)
514{
515 if (count != 4)
516 {
517 ERR("map point count (%i) != 4 is unsupported!", count);
518 return NULL;
519 }
520
521 return _evas_map_new(count);
522}
523
524EAPI void
525evas_map_smooth_set(Evas_Map *m, Eina_Bool enabled)
526{
527 MAGIC_CHECK(m, Evas_Map, MAGIC_MAP);
528 return;
529 MAGIC_CHECK_END();
530
531 m->smooth = enabled;
532}
533
534EAPI Eina_Bool
535evas_map_smooth_get(const Evas_Map *m)
536{
537 MAGIC_CHECK(m, Evas_Map, MAGIC_MAP);
538 return EINA_FALSE;
539 MAGIC_CHECK_END();
540
541 return m->smooth;
542}
543
544EAPI void
545evas_map_alpha_set(Evas_Map *m, Eina_Bool enabled)
546{
547 MAGIC_CHECK(m, Evas_Map, MAGIC_MAP);
548 return;
549 MAGIC_CHECK_END();
550
551 m->alpha = enabled;
552}
553
554EAPI Eina_Bool
555evas_map_alpha_get(const Evas_Map *m)
556{
557 MAGIC_CHECK(m, Evas_Map, MAGIC_MAP);
558 return EINA_FALSE;
559 MAGIC_CHECK_END();
560
561 return m->alpha;
562}
563
564EAPI Evas_Map *
565evas_map_dup(const Evas_Map *m)
566{
567 MAGIC_CHECK(m, Evas_Map, MAGIC_MAP);
568 return NULL;
569 MAGIC_CHECK_END();
570
571 return _evas_map_dup(m);
572}
573
574EAPI void
575evas_map_free(Evas_Map *m)
576{
577 MAGIC_CHECK(m, Evas_Map, MAGIC_MAP);
578 return;
579 MAGIC_CHECK_END();
580
581 _evas_map_free(NULL, m);
582}
583
584EAPI int
585evas_map_count_get(const Evas_Map *m)
586{
587 MAGIC_CHECK(m, Evas_Map, MAGIC_MAP);
588 return -1;
589 MAGIC_CHECK_END();
590
591 return m->count;
592}
593
594EAPI void
595evas_map_point_coord_set(Evas_Map *m, int idx, Evas_Coord x, Evas_Coord y, Evas_Coord z)
596{
597 MAGIC_CHECK(m, Evas_Map, MAGIC_MAP);
598 return;
599 MAGIC_CHECK_END();
600
601 Evas_Map_Point *p;
602
603 if (idx >= m->count) return;
604 p = m->points + idx;
605 p->x = p->px = x;
606 p->y = p->py = y;
607 p->z = z;
608}
609
610EAPI void
611evas_map_point_coord_get(const Evas_Map *m, int idx, Evas_Coord *x, Evas_Coord *y, Evas_Coord *z)
612{
613 MAGIC_CHECK(m, Evas_Map, MAGIC_MAP);
614 goto error;
615 MAGIC_CHECK_END();
616
617 const Evas_Map_Point *p;
618
619 if (idx >= m->count) goto error;
620 p = m->points + idx;
621 if (x) *x = p->x;
622 if (y) *y = p->y;
623 if (z) *z = p->z;
624 return;
625
626 error:
627 if (x) *x = 0;
628 if (y) *y = 0;
629 if (z) *z = 0;
630}
631
632EAPI void
633evas_map_point_image_uv_set(Evas_Map *m, int idx, double u, double v)
634{
635 MAGIC_CHECK(m, Evas_Map, MAGIC_MAP);
636 return;
637 MAGIC_CHECK_END();
638
639 Evas_Map_Point *p;
640
641 if (idx >= m->count) return;
642 p = m->points + idx;
643 p->u = u;
644 p->v = v;
645}
646
647EAPI void
648evas_map_point_image_uv_get(const Evas_Map *m, int idx, double *u, double *v)
649{
650 MAGIC_CHECK(m, Evas_Map, MAGIC_MAP);
651 goto error;
652 MAGIC_CHECK_END();
653
654 const Evas_Map_Point *p;
655
656 if (idx >= m->count) goto error;
657 p = m->points + idx;
658 if (u) *u = p->u;
659 if (v) *v = p->v;
660 return;
661
662 error:
663 if (u) *u = 0.0;
664 if (v) *v = 0.0;
665}
666
667EAPI void
668evas_map_point_color_set(Evas_Map *m, int idx, int r, int g, int b, int a)
669{
670 MAGIC_CHECK(m, Evas_Map, MAGIC_MAP);
671 return;
672 MAGIC_CHECK_END();
673
674 Evas_Map_Point *p;
675
676 if (idx >= m->count) return;
677 p = m->points + idx;
678 p->r = r;
679 p->g = g;
680 p->b = b;
681 p->a = a;
682}
683
684EAPI void
685evas_map_point_color_get(const Evas_Map *m, int idx, int *r, int *g, int *b, int *a)
686{
687 MAGIC_CHECK(m, Evas_Map, MAGIC_MAP);
688 return;
689 MAGIC_CHECK_END();
690
691 const Evas_Map_Point *p;
692
693 if (idx >= m->count) return;
694 p = m->points + idx;
695 if (r) *r = p->r;
696 if (g) *g = p->g;
697 if (b) *b = p->b;
698 if (a) *a = p->a;
699}
700
701EAPI void
702evas_map_util_points_populate_from_object_full(Evas_Map *m, const Evas_Object *obj, Evas_Coord z)
703{
704 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
705 return;
706 MAGIC_CHECK_END();
707
708 if (m->count != 4)
709 {
710 ERR("map has count=%d where 4 was expected.", m->count);
711 return;
712 }
713 _evas_map_util_points_populate(m, obj->cur.geometry.x, obj->cur.geometry.y,
714 obj->cur.geometry.w, obj->cur.geometry.h, z);
715}
716
717EAPI void
718evas_map_util_points_populate_from_object(Evas_Map *m, const Evas_Object *obj)
719{
720 MAGIC_CHECK(m, Evas_Map, MAGIC_MAP);
721 return;
722 MAGIC_CHECK_END();
723
724 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
725 return;
726 MAGIC_CHECK_END();
727
728 if (m->count != 4)
729 {
730 ERR("map has count=%d where 4 was expected.", m->count);
731 return;
732 }
733 _evas_map_util_points_populate(m, obj->cur.geometry.x, obj->cur.geometry.y,
734 obj->cur.geometry.w, obj->cur.geometry.h, 0);
735}
736
737EAPI void
738evas_map_util_points_populate_from_geometry(Evas_Map *m, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Evas_Coord z)
739{
740 MAGIC_CHECK(m, Evas_Map, MAGIC_MAP);
741 return;
742 MAGIC_CHECK_END();
743
744 if (m->count != 4)
745 {
746 ERR("map has count=%d where 4 was expected.", m->count);
747 return;
748 }
749 _evas_map_util_points_populate(m, x, y, w, h, z);
750}
751
752EAPI void
753evas_map_util_points_color_set(Evas_Map *m, int r, int g, int b, int a)
754{
755 MAGIC_CHECK(m, Evas_Map, MAGIC_MAP);
756 return;
757 MAGIC_CHECK_END();
758
759 Evas_Map_Point *p, *p_end;
760
761 p = m->points;
762 p_end = p + m->count;
763 for (; p < p_end; p++)
764 {
765 p->r = r;
766 p->g = g;
767 p->b = b;
768 p->a = a;
769 }
770}
771
772EAPI void
773evas_map_util_rotate(Evas_Map *m, double degrees, Evas_Coord cx, Evas_Coord cy)
774{
775 MAGIC_CHECK(m, Evas_Map, MAGIC_MAP);
776 return;
777 MAGIC_CHECK_END();
778
779 double r = (degrees * M_PI) / 180.0;
780 Evas_Map_Point *p, *p_end;
781
782 p = m->points;
783 p_end = p + m->count;
784
785 for (; p < p_end; p++)
786 {
787 double x, y, xx, yy;
788
789 x = p->x - cx;
790 y = p->y - cy;
791
792 xx = x * cos(r);
793 yy = x * sin(r);
794 x = xx - (y * sin(r));
795 y = yy + (y * cos(r));
796
797 p->px = p->x = x + cx;
798 p->py = p->y = y + cy;
799 }
800}
801
802EAPI void
803evas_map_util_zoom(Evas_Map *m, double zoomx, double zoomy, Evas_Coord cx, Evas_Coord cy)
804{
805 MAGIC_CHECK(m, Evas_Map, MAGIC_MAP);
806 return;
807 MAGIC_CHECK_END();
808
809 Evas_Map_Point *p, *p_end;
810
811 p = m->points;
812 p_end = p + m->count;
813
814 for (; p < p_end; p++)
815 {
816 double x, y;
817
818 x = p->x - cx;
819 y = p->y - cy;
820
821 x = (((double)x) * zoomx);
822 y = (((double)y) * zoomy);
823
824 p->px = p->x = x + cx;
825 p->py = p->y = y + cy;
826 }
827}
828
829EAPI void
830evas_map_util_3d_rotate(Evas_Map *m, double dx, double dy, double dz,
831 Evas_Coord cx, Evas_Coord cy, Evas_Coord cz)
832{
833 MAGIC_CHECK(m, Evas_Map, MAGIC_MAP);
834 return;
835 MAGIC_CHECK_END();
836
837 double rz = (dz * M_PI) / 180.0;
838 double rx = (dx * M_PI) / 180.0;
839 double ry = (dy * M_PI) / 180.0;
840 Evas_Map_Point *p, *p_end;
841
842 p = m->points;
843 p_end = p + m->count;
844
845 for (; p < p_end; p++)
846 {
847 double x, y, z, xx, yy, zz;
848
849 x = p->x - cx;
850 y = p->y - cy;
851 z = p->z - cz;
852
853 if (rz != 0.0)
854 {
855 xx = x * cos(rz);
856 yy = x * sin(rz);
857 x = xx - (y * sin(rz));
858 y = yy + (y * cos(rz));
859 }
860
861 if (ry != 0.0)
862 {
863 xx = x * cos(ry);
864 zz = x * sin(ry);
865 x = xx - (z * sin(ry));
866 z = zz + (z * cos(ry));
867 }
868
869 if (rx != 0.0)
870 {
871 zz = z * cos(rx);
872 yy = z * sin(rx);
873 z = zz - (y * sin(rx));
874 y = yy + (y * cos(rx));
875 }
876
877 p->px = p->x = x + cx;
878 p->py = p->y = y + cy;
879 p->z = z + cz;
880 }
881}
882
883EAPI void
884evas_map_util_3d_lighting(Evas_Map *m,
885 Evas_Coord lx, Evas_Coord ly, Evas_Coord lz,
886 int lr, int lg, int lb, int ar, int ag, int ab)
887{
888 MAGIC_CHECK(m, Evas_Map, MAGIC_MAP);
889 return;
890 MAGIC_CHECK_END();
891
892 int i;
893
894 for (i = 0; i < m->count; i++)
895 {
896 double x, y, z;
897 double nx, ny, nz, x1, y1, z1, x2, y2, z2, ln, br;
898 int h, j, mr, mg, mb;
899
900 x = m->points[i].x;
901 y = m->points[i].y;
902 z = m->points[i].z;
903 // calc normal
904 h = (i - 1 + 4) % 4 + (i & ~0x3); // prev point
905 j = (i + 1) % 4 + (i & ~0x3); // next point
906
907 x1 = m->points[h].x - x;
908 y1 = m->points[h].y - y;
909 z1 = m->points[h].z - z;
910
911 x2 = m->points[j].x - x;
912 y2 = m->points[j].y - y;
913 z2 = m->points[j].z - z;
914 nx = (y1 * z2) - (z1 * y2);
915 ny = (z1 * x2) - (x1 * z2);
916 nz = (x1 * y2) - (y1 * x2);
917
918 ln = (nx * nx) + (ny * ny) + (nz * nz);
919 ln = sqrt(ln);
920
921 if (ln != 0.0)
922 {
923 nx /= ln;
924 ny /= ln;
925 nz /= ln;
926 }
927
928 // calc point -> light vector
929 x = lx - x;
930 y = ly - y;
931 z = lz - z;
932
933 ln = (x * x) + (y * y) + (z * z);
934 ln = sqrt(ln);
935
936 if (ln != 0.0)
937 {
938 x /= ln;
939 y /= ln;
940 z /= ln;
941 }
942
943 // brightness - tan (0.0 -> 1.0 brightness really)
944 br = (nx * x) + (ny * y) + (nz * z);
945 if (br < 0.0) br = 0.0;
946
947 mr = ar + ((lr - ar) * br);
948 mg = ag + ((lg - ag) * br);
949 mb = ab + ((lb - ab) * br);
950 if (m->points[i].a != 255)
951 {
952 mr = (mr * m->points[i].a) / 255;
953 mg = (mg * m->points[i].a) / 255;
954 mb = (mb * m->points[i].a) / 255;
955 }
956 m->points[i].r = (m->points[i].r * mr) / 255;
957 m->points[i].g = (m->points[i].g * mg) / 255;
958 m->points[i].b = (m->points[i].b * mb) / 255;
959 }
960}
961
962EAPI void
963evas_map_util_3d_perspective(Evas_Map *m,
964 Evas_Coord px, Evas_Coord py,
965 Evas_Coord z0, Evas_Coord foc)
966{
967 MAGIC_CHECK(m, Evas_Map, MAGIC_MAP);
968 return;
969 MAGIC_CHECK_END();
970
971 Evas_Map_Point *p, *p_end;
972
973 p = m->points;
974 p_end = p + m->count;
975
976 m->persp.px = px;
977 m->persp.py = py;
978 m->persp.z0 = z0;
979 m->persp.foc = foc;
980
981 if (foc <= 0) return;
982
983 for (; p < p_end; p++)
984 {
985 double x, y, zz;
986
987 x = p->x - px;
988 y = p->y - py;
989
990 zz = ((p->z - z0) + foc);
991
992 if (zz > 0)
993 {
994 x = (x * foc) / zz;
995 y = (y * foc) / zz;
996 }
997
998 p->x = px + x;
999 p->y = py + y;
1000 }
1001}
1002
1003EAPI Eina_Bool
1004evas_map_util_clockwise_get(Evas_Map *m)
1005{
1006 MAGIC_CHECK(m, Evas_Map, MAGIC_MAP);
1007 return EINA_FALSE;
1008 MAGIC_CHECK_END();
1009
1010 int i, j, k, count;
1011 long long c;
1012
1013 if (m->count < 3) return EINA_FALSE;
1014
1015 count = 0;
1016 for (i = 0; i < m->count; i++)
1017 {
1018 j = (i + 1) % m->count;
1019 k = (i + 2) % m->count;
1020 c =
1021 ((m->points[j].x - m->points[i].x) *
1022 (m->points[k].y - m->points[j].y))
1023 -
1024 ((m->points[j].y - m->points[i].y) *
1025 (m->points[k].x - m->points[j].x));
1026 if (c < 0) count--;
1027 else if (c > 0) count++;
1028 }
1029 if (count > 0) return EINA_TRUE;
1030 return EINA_FALSE;
1031}
diff --git a/libraries/evas/src/lib/canvas/evas_name.c b/libraries/evas/src/lib/canvas/evas_name.c
new file mode 100644
index 0000000..c42f941
--- /dev/null
+++ b/libraries/evas/src/lib/canvas/evas_name.c
@@ -0,0 +1,40 @@
1#include "evas_common.h"
2#include "evas_private.h"
3
4EAPI void
5evas_object_name_set(Evas_Object *obj, const char *name)
6{
7 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
8 return;
9 MAGIC_CHECK_END();
10 if (obj->name)
11 {
12 eina_hash_del(obj->layer->evas->name_hash, obj->name, obj);
13 free(obj->name);
14 }
15 if (!name) obj->name = NULL;
16 else
17 {
18 obj->name = strdup(name);
19 eina_hash_add(obj->layer->evas->name_hash, obj->name, obj);
20 }
21}
22
23EAPI const char *
24evas_object_name_get(const Evas_Object *obj)
25{
26 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
27 return NULL;
28 MAGIC_CHECK_END();
29 return obj->name;
30}
31
32EAPI Evas_Object *
33evas_object_name_find(const Evas *e, const char *name)
34{
35 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
36 return NULL;
37 MAGIC_CHECK_END();
38 if (!name) return NULL;
39 return (Evas_Object *)eina_hash_find(e->name_hash, name);
40}
diff --git a/libraries/evas/src/lib/canvas/evas_object_box.c b/libraries/evas/src/lib/canvas/evas_object_box.c
new file mode 100644
index 0000000..ab2f222
--- /dev/null
+++ b/libraries/evas/src/lib/canvas/evas_object_box.c
@@ -0,0 +1,2128 @@
1#include "evas_common.h"
2
3#ifdef _WIN32_WCE
4# undef remove
5#endif
6
7typedef struct _Evas_Object_Box_Iterator Evas_Object_Box_Iterator;
8typedef struct _Evas_Object_Box_Accessor Evas_Object_Box_Accessor;
9
10struct _Evas_Object_Box_Iterator
11{
12 Eina_Iterator iterator;
13
14 Eina_Iterator *real_iterator;
15 const Evas_Object *box;
16};
17
18struct _Evas_Object_Box_Accessor
19{
20 Eina_Accessor accessor;
21
22 Eina_Accessor *real_accessor;
23 const Evas_Object *box;
24};
25
26#define _evas_object_box_type "Evas_Object_Box"
27#define SIG_CHILD_ADDED "child,added"
28#define SIG_CHILD_REMOVED "child,removed"
29
30static const Evas_Smart_Cb_Description _signals[] =
31{
32 {SIG_CHILD_ADDED, ""},
33 {SIG_CHILD_REMOVED, ""},
34 {NULL, NULL}
35};
36
37
38static void _sizing_eval(Evas_Object *obj);
39
40#define EVAS_OBJECT_BOX_DATA_GET(o, ptr) \
41 Evas_Object_Box_Data *ptr = evas_object_smart_data_get(o)
42
43#define EVAS_OBJECT_BOX_DATA_GET_OR_RETURN(o, ptr) \
44 EVAS_OBJECT_BOX_DATA_GET(o, ptr); \
45 if (!ptr) \
46 { \
47 CRIT("no widget data for object %p (%s)", \
48 o, evas_object_type_get(o)); \
49 fflush(stderr); \
50 abort(); \
51 return; \
52}
53
54#define EVAS_OBJECT_BOX_DATA_GET_OR_RETURN_VAL(o, ptr, val) \
55 EVAS_OBJECT_BOX_DATA_GET(o, ptr); \
56 if (!ptr) \
57 { \
58 CRIT("no widget data for object %p (%s)", \
59 o, evas_object_type_get(o)); \
60 fflush(stderr); \
61 abort(); \
62 return val; \
63 }
64
65EVAS_SMART_SUBCLASS_NEW(_evas_object_box_type, _evas_object_box,
66 Evas_Object_Box_Api, Evas_Smart_Class,
67 evas_object_smart_clipped_class_get, NULL)
68
69static Eina_Bool
70_evas_object_box_iterator_next(Evas_Object_Box_Iterator *it, void **data)
71{
72 Evas_Object_Box_Option *opt;
73
74 if (!eina_iterator_next(it->real_iterator, (void **)&opt))
75 return EINA_FALSE;
76 if (data) *data = opt->obj;
77 return EINA_TRUE;
78}
79
80static Evas_Object *
81_evas_object_box_iterator_get_container(Evas_Object_Box_Iterator *it)
82{
83 return (Evas_Object *)it->box;
84}
85
86static void
87_evas_object_box_iterator_free(Evas_Object_Box_Iterator *it)
88{
89 eina_iterator_free(it->real_iterator);
90 free(it);
91}
92
93static Eina_Bool
94_evas_object_box_accessor_get_at(Evas_Object_Box_Accessor *it, unsigned int idx, void **data)
95{
96 Evas_Object_Box_Option *opt = NULL;
97
98 if (!eina_accessor_data_get(it->real_accessor, idx, (void *)&opt))
99 return EINA_FALSE;
100 if (data) *data = opt->obj;
101 return EINA_TRUE;
102}
103
104static Evas_Object *
105_evas_object_box_accessor_get_container(Evas_Object_Box_Accessor *it)
106{
107 return (Evas_Object *)it->box;
108}
109
110static void
111_evas_object_box_accessor_free(Evas_Object_Box_Accessor *it)
112{
113 eina_accessor_free(it->real_accessor);
114 free(it);
115}
116
117static void
118_on_child_resize(void *data, Evas *evas __UNUSED__, Evas_Object *o __UNUSED__, void *einfo __UNUSED__)
119{
120 Evas_Object *box = data;
121 EVAS_OBJECT_BOX_DATA_GET_OR_RETURN(box, priv);
122 if (!priv->layouting) evas_object_smart_changed(box);
123}
124
125static void
126_on_child_del(void *data, Evas *evas __UNUSED__, Evas_Object *o, void *einfo __UNUSED__)
127{
128 const Evas_Object_Box_Api *api;
129 Evas_Object *box = data;
130
131 EVAS_OBJECT_BOX_DATA_GET(box, priv);
132 api = priv->api;
133
134 if ((!api) || (!api->remove))
135 {
136 ERR("no api->remove");
137 return;
138 }
139
140 if (!api->remove(box, priv, o))
141 ERR("child removal failed");
142 evas_object_smart_changed(box);
143}
144
145static void
146_on_child_hints_changed(void *data, Evas *evas __UNUSED__, Evas_Object *o __UNUSED__, void *einfo __UNUSED__)
147{
148 Evas_Object *box = data;
149 EVAS_OBJECT_BOX_DATA_GET_OR_RETURN(box, priv);
150 if (!priv->layouting) evas_object_smart_changed(box);
151}
152
153static void
154_on_hints_changed(void *data __UNUSED__, Evas *evas __UNUSED__, Evas_Object *o , void *einfo __UNUSED__)
155{
156 _sizing_eval(o);
157}
158
159static Evas_Object_Box_Option *
160_evas_object_box_option_new(Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child)
161{
162 Evas_Object_Box_Option *opt;
163 const Evas_Object_Box_Api *api;
164
165 api = priv->api;
166 if ((!api) || (!api->option_new))
167 {
168 ERR("no api->option_new");
169 return NULL;
170 }
171
172 opt = api->option_new(o, priv, child);
173 if (!opt)
174 {
175 ERR("option_new failed");
176 return NULL;
177 }
178
179 return opt;
180}
181
182static void
183_evas_object_box_child_callbacks_unregister(Evas_Object *obj)
184{
185 evas_object_event_callback_del
186 (obj, EVAS_CALLBACK_RESIZE, _on_child_resize);
187 evas_object_event_callback_del
188 (obj, EVAS_CALLBACK_FREE, _on_child_del);
189 evas_object_event_callback_del
190 (obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _on_child_hints_changed);
191}
192
193static Evas_Object_Box_Option *
194_evas_object_box_option_callbacks_register(Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object_Box_Option *opt)
195{
196 const Evas_Object_Box_Api *api;
197 Evas_Object *obj = opt->obj;
198
199 api = priv->api;
200
201 if ((!api) || (!api->option_free))
202 {
203 WRN("api->option_free not set (may cause memory leaks, segfaults)");
204 return NULL;
205 }
206
207 evas_object_event_callback_add
208 (obj, EVAS_CALLBACK_RESIZE, _on_child_resize, o);
209 evas_object_event_callback_add
210 (obj, EVAS_CALLBACK_FREE, _on_child_del, o);
211 evas_object_event_callback_add
212 (obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _on_child_hints_changed, o);
213
214 return opt;
215}
216
217static Evas_Object_Box_Option *
218_evas_object_box_option_new_default(Evas_Object *o __UNUSED__, Evas_Object_Box_Data *priv __UNUSED__, Evas_Object *child)
219{
220 Evas_Object_Box_Option *opt;
221
222 opt = (Evas_Object_Box_Option *)malloc(sizeof(*opt));
223 if (!opt)
224 return NULL;
225
226 opt->obj = child;
227
228 return opt;
229}
230
231static void
232_evas_object_box_option_free_default(Evas_Object *o __UNUSED__, Evas_Object_Box_Data *priv __UNUSED__, Evas_Object_Box_Option *opt)
233{
234 free(opt);
235}
236
237static Evas_Object_Box_Option *
238_evas_object_box_append_default(Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child)
239{
240 Evas_Object_Box_Option *opt;
241
242 opt = _evas_object_box_option_new(o, priv, child);
243 if (!opt)
244 return NULL;
245
246 priv->children = eina_list_append(priv->children, opt);
247 priv->children_changed = EINA_TRUE;
248 evas_object_smart_callback_call(o, SIG_CHILD_ADDED, opt);
249
250 return opt;
251}
252
253static Evas_Object_Box_Option *
254_evas_object_box_prepend_default(Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child)
255{
256 Evas_Object_Box_Option *opt;
257
258 opt = _evas_object_box_option_new(o, priv, child);
259 if (!opt)
260 return NULL;
261
262 priv->children = eina_list_prepend(priv->children, opt);
263 priv->children_changed = EINA_TRUE;
264 evas_object_smart_callback_call(o, SIG_CHILD_ADDED, opt);
265
266 return opt;
267}
268
269static Evas_Object_Box_Option *
270_evas_object_box_insert_before_default(Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child, const Evas_Object *reference)
271{
272 Eina_List *l;
273 Evas_Object_Box_Option *opt;
274
275 EINA_LIST_FOREACH(priv->children, l, opt)
276 {
277 if (opt->obj == reference)
278 {
279 Evas_Object_Box_Option *new_opt;
280
281 new_opt = _evas_object_box_option_new(o, priv, child);
282 if (!new_opt)
283 return NULL;
284
285 priv->children = eina_list_prepend_relative
286 (priv->children, new_opt, opt);
287 priv->children_changed = EINA_TRUE;
288 evas_object_smart_callback_call(o, SIG_CHILD_ADDED, new_opt);
289 return new_opt;
290 }
291 }
292
293 return NULL;
294}
295
296static Evas_Object_Box_Option *
297_evas_object_box_insert_after_default(Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child, const Evas_Object *reference)
298{
299 Eina_List *l;
300 Evas_Object_Box_Option *opt;
301
302 EINA_LIST_FOREACH(priv->children, l, opt)
303 {
304 if (opt->obj == reference)
305 {
306 Evas_Object_Box_Option *new_opt;
307
308 new_opt = _evas_object_box_option_new(o, priv, child);
309 if (!new_opt)
310 return NULL;
311
312 priv->children = eina_list_append_relative
313 (priv->children, new_opt, opt);
314 priv->children_changed = EINA_TRUE;
315 evas_object_smart_callback_call(o, SIG_CHILD_ADDED, new_opt);
316 return new_opt;
317 }
318 }
319
320 return NULL;
321}
322
323static Evas_Object_Box_Option *
324_evas_object_box_insert_at_default(Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child, unsigned int pos)
325{
326 Eina_List *l;
327 unsigned int i;
328
329 if ((pos == 0) && (eina_list_count(priv->children) == 0))
330 {
331 Evas_Object_Box_Option *new_opt;
332
333 new_opt = _evas_object_box_option_new(o, priv, child);
334 if (!new_opt)
335 return NULL;
336
337 priv->children = eina_list_prepend(priv->children, new_opt);
338 priv->children_changed = EINA_TRUE;
339 evas_object_smart_callback_call(o, SIG_CHILD_ADDED, new_opt);
340 return new_opt;
341 }
342
343 for (l = priv->children, i = 0; l; l = l->next, i++)
344 {
345 Evas_Object_Box_Option *opt = l->data;
346
347 if (i == pos)
348 {
349 Evas_Object_Box_Option *new_opt;
350
351 new_opt = _evas_object_box_option_new(o, priv, child);
352 if (!new_opt)
353 return NULL;
354
355 priv->children = eina_list_prepend_relative
356 (priv->children, new_opt, opt);
357 priv->children_changed = EINA_TRUE;
358 evas_object_smart_callback_call(o, SIG_CHILD_ADDED, new_opt);
359 return new_opt;
360 }
361 }
362
363 return NULL;
364}
365
366static Evas_Object *
367_evas_object_box_remove_default(Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object *child)
368{
369 const Evas_Object_Box_Api *api;
370 Evas_Object_Box_Option *opt;
371 Eina_List *l;
372
373 api = priv->api;
374
375 if ((!api) || (!api->option_free))
376 {
377 ERR("api->option_free not set (may cause memory leaks, segfaults)");
378 return NULL;
379 }
380
381 EINA_LIST_FOREACH(priv->children, l, opt)
382 {
383 Evas_Object *obj = opt->obj;
384
385 if (obj == child)
386 {
387 priv->children = eina_list_remove(priv->children, opt);
388 api->option_free(o, priv, opt);
389 priv->children_changed = EINA_TRUE;
390 evas_object_smart_callback_call(o, SIG_CHILD_REMOVED, obj);
391
392 return obj;
393 }
394 }
395
396 return NULL;
397}
398
399static Evas_Object *
400_evas_object_box_remove_at_default(Evas_Object *o, Evas_Object_Box_Data *priv, unsigned int pos)
401{
402 const Evas_Object_Box_Api *api;
403 Eina_List *node;
404 Evas_Object_Box_Option *opt;
405 Evas_Object *obj;
406
407 api = priv->api;
408
409 if ((!api) || (!api->option_free))
410 {
411 WRN("api->option_free not set (may cause memory leaks, segfaults)");
412 return NULL;
413 }
414
415 node = eina_list_nth_list(priv->children, pos);
416 if (!node)
417 {
418 ERR("No item to be removed at position %d", pos);
419 return NULL;
420 }
421
422 opt = node->data;
423 obj = opt->obj;
424
425 priv->children = eina_list_remove_list(priv->children, node);
426 api->option_free(o, priv, opt);
427 priv->children_changed = EINA_TRUE;
428 evas_object_smart_callback_call(o, SIG_CHILD_REMOVED, obj);
429 return obj;
430}
431
432static void
433_evas_object_box_smart_add(Evas_Object *o)
434{
435 Evas_Object_Box_Data *priv;
436
437 priv = evas_object_smart_data_get(o);
438 if (!priv)
439 {
440 const Evas_Smart *smart;
441 const Evas_Smart_Class *sc;
442
443 priv = (Evas_Object_Box_Data *)calloc(1, sizeof(*priv));
444 if (!priv)
445 {
446 ERR("Could not allocate object private data.");
447 return;
448 }
449
450 smart = evas_object_smart_smart_get(o);
451 sc = evas_smart_class_get(smart);
452 priv->api = (const Evas_Object_Box_Api *)sc;
453
454 evas_object_smart_data_set(o, priv);
455 }
456 _evas_object_box_parent_sc->add(o);
457
458
459 evas_object_event_callback_add
460 (o, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _on_hints_changed, o);
461 priv->children = NULL;
462 priv->align.h = 0.5;
463 priv->align.v = 0.5;
464 priv->pad.h = 0;
465 priv->pad.v = 0;
466 priv->layout.cb = evas_object_box_layout_horizontal;
467 priv->layout.data = NULL;
468 priv->layout.free_data = NULL;
469}
470
471static void
472_evas_object_box_smart_del(Evas_Object *o)
473{
474 const Evas_Object_Box_Api *api;
475 Eina_List *l;
476
477 EVAS_OBJECT_BOX_DATA_GET(o, priv);
478
479 api = priv->api;
480 if ((!api) || (!api->option_free))
481 {
482 WRN("api->option_free not set (may cause memory leaks, segfaults)");
483 return;
484 }
485
486 l = priv->children;
487 while (l)
488 {
489 Evas_Object_Box_Option *opt = l->data;
490
491 _evas_object_box_child_callbacks_unregister(opt->obj);
492 api->option_free(o, priv, opt);
493 l = eina_list_remove_list(l, l);
494 }
495
496 if (priv->layout.data && priv->layout.free_data)
497 priv->layout.free_data(priv->layout.data);
498
499 _evas_object_box_parent_sc->del(o);
500}
501
502static void
503_evas_object_box_smart_resize(Evas_Object *o, Evas_Coord w, Evas_Coord h)
504{
505 Evas_Coord ow, oh;
506 evas_object_geometry_get(o, NULL, NULL, &ow, &oh);
507 if ((ow == w) && (oh == h)) return;
508 evas_object_smart_changed(o);
509}
510
511static void
512_evas_object_box_smart_calculate(Evas_Object *o)
513{
514 EVAS_OBJECT_BOX_DATA_GET_OR_RETURN(o, priv);
515 if (priv->layout.cb)
516 {
517 priv->layouting = 1;
518 priv->layout.cb(o, priv, priv->layout.data);
519 priv->layouting = 0;
520 priv->children_changed = EINA_FALSE;
521 }
522 else
523 ERR("No layout function set for %p box.", o);
524}
525
526static void
527_evas_object_box_smart_set_user(Evas_Object_Box_Api *api)
528{
529 api->base.add = _evas_object_box_smart_add;
530 api->base.del = _evas_object_box_smart_del;
531 api->base.resize = _evas_object_box_smart_resize;
532 api->base.calculate = _evas_object_box_smart_calculate;
533 api->base.callbacks = _signals;
534
535 api->append = _evas_object_box_append_default;
536 api->prepend = _evas_object_box_prepend_default;
537 api->insert_before = _evas_object_box_insert_before_default;
538 api->insert_after = _evas_object_box_insert_after_default;
539 api->insert_at = _evas_object_box_insert_at_default;
540 api->remove = _evas_object_box_remove_default;
541 api->remove_at = _evas_object_box_remove_at_default;
542 api->option_new = _evas_object_box_option_new_default;
543 api->option_free = _evas_object_box_option_free_default;
544}
545
546EAPI Evas_Object *
547evas_object_box_add(Evas *evas)
548{
549 return evas_object_smart_add(evas, _evas_object_box_smart_class_new());
550}
551
552EAPI Evas_Object *
553evas_object_box_add_to(Evas_Object *parent)
554{
555 Evas *evas;
556 Evas_Object *o;
557
558 evas = evas_object_evas_get(parent);
559 o = evas_object_box_add(evas);
560 evas_object_smart_member_add(o, parent);
561 return o;
562}
563
564EAPI void
565evas_object_box_smart_set(Evas_Object_Box_Api *api)
566{
567 if (!api)
568 return;
569 _evas_object_box_smart_set(api);
570}
571
572EAPI const Evas_Object_Box_Api *
573evas_object_box_smart_class_get(void)
574{
575 static Evas_Object_Box_Api _sc =
576 EVAS_OBJECT_BOX_API_INIT_NAME_VERSION(_evas_object_box_type);
577 static const Evas_Object_Box_Api *class = NULL;
578
579 if (class)
580 return class;
581
582 evas_object_box_smart_set(&_sc);
583 class = &_sc;
584
585 return class;
586}
587
588EAPI void
589evas_object_box_layout_set(Evas_Object *o, Evas_Object_Box_Layout cb, const void *data, void (*free_data)(void *data))
590{
591 EVAS_OBJECT_BOX_DATA_GET_OR_RETURN(o, priv);
592
593 if ((priv->layout.cb == cb) && (priv->layout.data == data) &&
594 (priv->layout.free_data == free_data))
595 return;
596
597 if (priv->layout.data && priv->layout.free_data)
598 priv->layout.free_data(priv->layout.data);
599
600 priv->layout.cb = cb;
601 priv->layout.data = (void *)data;
602 priv->layout.free_data = free_data;
603 evas_object_smart_changed(o);
604}
605
606static void
607_fixed_point_divide_and_decompose_integer(int dividend, int divisor, int *int_part, int *frac_part)
608{
609 int quotient = (long long)(dividend << 16) / divisor;
610 *frac_part = quotient & 0xffff;
611 *int_part = quotient >> 16;
612}
613
614static void
615_layout_dimension_change_min_max_cell_bound(int dim, int *new_dim, int min_d, int max_d, int cell_sz)
616{
617 if (dim > cell_sz)
618 {
619 if ((min_d != 0) && (cell_sz < min_d))
620 *new_dim = min_d;
621 else
622 *new_dim = cell_sz;
623 }
624 else
625 {
626 if ((max_d != -1) && (cell_sz > max_d))
627 *new_dim = max_d;
628 else
629 *new_dim = cell_sz;
630 }
631}
632
633static void
634_layout_set_offset_and_expand_dimension_space_max_bounded(int dim, int *new_dim, int space_sz, int max_dim, int *offset, double align, int pad_before, int pad_after)
635{
636 if (align >= 0.0)
637 {
638 *new_dim = dim;
639 *offset = (space_sz - (dim + pad_before + pad_after)) * align
640 + pad_before;
641 }
642 else
643 {
644 if ((max_dim != -1) && (space_sz > max_dim))
645 {
646 *new_dim = max_dim;
647 *offset = (space_sz - (max_dim + pad_before + pad_after)) * 0.5
648 + pad_before;
649 }
650 else
651 {
652 *new_dim = space_sz;
653 *offset = 0;
654 }
655 }
656}
657
658static void
659_layout_set_offset_and_change_dimension_min_max_cell_bounded(int dim, int *new_dim, int min_dim, int max_dim, int cell_sz, int *offset, double align, int pad_before, int pad_after)
660{
661 if (align >= 0.0)
662 {
663 *new_dim = dim;
664 *offset =
665 (cell_sz - (dim + pad_before + pad_after)) * align + pad_before;
666 }
667 else
668 {
669 *offset = pad_before;
670 _layout_dimension_change_min_max_cell_bound
671 (dim, new_dim, min_dim, max_dim, cell_sz - pad_before - pad_after);
672 }
673}
674
675static void
676_sizing_eval(Evas_Object *obj)
677{
678 Evas_Coord minw, minh, maxw, maxh;
679 Evas_Coord w, h;
680
681 evas_object_size_hint_min_get(obj, &minw, &minh);
682 evas_object_size_hint_max_get(obj, &maxw, &maxh);
683 evas_object_geometry_get(obj, NULL, NULL, &w, &h);
684
685 if (w < minw) w = minw;
686 if (h < minh) h = minh;
687 if ((maxw >= 0) && (w > maxw)) w = maxw;
688 if ((maxh >= 0) && (h > maxh)) h = maxh;
689
690 evas_object_resize(obj, w, h);
691}
692
693static int
694_evas_object_box_layout_horizontal_weight_apply(Evas_Object_Box_Data *priv, Evas_Object_Box_Option **objects, int n_objects, int remaining, int weight_total)
695{
696 int rem_diff = 0;
697 int i;
698
699 for (i = 0; i < n_objects; i++)
700 {
701 Evas_Object_Box_Option *opt = objects[i];
702 Evas_Object *o = opt->obj;
703 int h;
704
705 evas_object_geometry_get(o, NULL, NULL, NULL, &h);
706
707 if (remaining <= 0)
708 {
709 int min_w;
710
711 evas_object_size_hint_min_get(o, &min_w, NULL);
712 evas_object_resize(o, min_w, h);
713 }
714 else
715 {
716 double normal_weight, weight_x;
717 int target_size;
718 int max_w;
719
720 evas_object_size_hint_weight_get(o, &weight_x, NULL);
721 normal_weight = weight_x / weight_total;
722 target_size = (int)((double)remaining * normal_weight);
723
724 evas_object_size_hint_max_get(o, &max_w, NULL);
725 if ((max_w != -1) && (target_size > max_w))
726 {
727 evas_object_resize(o, max_w, h);
728 rem_diff += max_w;
729 objects[i] = objects[n_objects - 1];
730 weight_total -= weight_x;
731 n_objects--;
732 return _evas_object_box_layout_horizontal_weight_apply
733 (priv, objects, n_objects, remaining - rem_diff,
734 weight_total);
735 }
736 else
737 {
738 evas_object_resize(o, target_size, h);
739 rem_diff += target_size;
740 }
741 }
742 }
743
744 return remaining - rem_diff;
745}
746
747EAPI void
748evas_object_box_layout_horizontal(Evas_Object *o, Evas_Object_Box_Data *priv, void *data __UNUSED__)
749{
750 int pad_inc = 0, sub_pixel = 0;
751 int req_w, global_pad, remaining, top_h = 0;
752 double weight_total = 0.0;
753 int weight_use = 0;
754 int x, y, w, h;
755 int n_children;
756 Evas_Object_Box_Option *opt;
757 Evas_Object_Box_Option **objects;
758 Eina_List *l;
759
760 n_children = eina_list_count(priv->children);
761 if (!n_children)
762 return;
763
764 objects = (Evas_Object_Box_Option **)alloca(sizeof(Evas_Object_Box_Option *) * n_children);
765 if (!objects)
766 return;
767
768 evas_object_geometry_get(o, &x, &y, &w, &h);
769 global_pad = priv->pad.h;
770 req_w = global_pad * (n_children - 1);
771
772 EINA_LIST_FOREACH(priv->children, l, opt)
773 {
774 int padding_l, padding_r;
775 double weight_x;
776
777 _sizing_eval(opt->obj);
778 evas_object_size_hint_weight_get(opt->obj, &weight_x, NULL);
779 evas_object_size_hint_padding_get
780 (opt->obj, &padding_l, &padding_r, NULL, NULL);
781 req_w += padding_l + padding_r;
782
783 if (!weight_x)
784 {
785 int child_w;
786
787 evas_object_geometry_get(opt->obj, NULL, NULL, &child_w, NULL);
788 req_w += child_w;
789 }
790 else
791 {
792 objects[weight_use] = opt;
793 weight_use++;
794 weight_total += weight_x;
795 }
796 }
797
798 remaining = w - req_w;
799
800 if (weight_use)
801 remaining = _evas_object_box_layout_horizontal_weight_apply
802 (priv, objects, weight_use, remaining, weight_total);
803
804 if (priv->align.h >= 0.0)
805 x += remaining * priv->align.h;
806 else if (n_children == 1)
807 x += remaining / 2;
808 else
809 { /* justified */
810 _fixed_point_divide_and_decompose_integer
811 (remaining, n_children - 1, &global_pad, &pad_inc);
812 global_pad += priv->pad.h;
813 }
814
815 EINA_LIST_FOREACH(priv->children, l, opt)
816 {
817 int child_w, child_h, max_h, new_h, off_x, off_y;
818 int padding_l, padding_r, padding_t, padding_b;
819 double align_y;
820
821 evas_object_size_hint_align_get(opt->obj, NULL, &align_y);
822 evas_object_size_hint_padding_get
823 (opt->obj, &padding_l, &padding_r, &padding_t, &padding_b);
824 evas_object_size_hint_max_get(opt->obj, NULL, &max_h);
825
826 evas_object_geometry_get(opt->obj, NULL, NULL, &child_w, &child_h);
827
828 off_x = padding_l;
829 new_h = child_h;
830 if (new_h > top_h) top_h = new_h;
831
832 _layout_set_offset_and_expand_dimension_space_max_bounded
833 (child_h, &new_h, h, max_h, &off_y, align_y, padding_t, padding_b);
834
835 if (new_h != child_h)
836 evas_object_resize(opt->obj, child_w, new_h);
837 evas_object_move(opt->obj, x + off_x, y + off_y);
838
839 x += child_w + padding_l + padding_r + global_pad;
840 sub_pixel += pad_inc;
841 if (sub_pixel >= 1 << 16)
842 {
843 x++;
844 sub_pixel -= 1 << 16;
845 }
846 }
847
848 evas_object_size_hint_min_set(o, req_w, top_h);
849}
850
851static int
852_evas_object_box_layout_vertical_weight_apply(Evas_Object_Box_Data *priv, Evas_Object_Box_Option **objects, int n_objects, int remaining, int weight_total)
853{
854 int rem_diff = 0;
855 int i;
856
857 for (i = 0; i < n_objects; i++)
858 {
859 Evas_Object_Box_Option *opt = objects[i];
860 Evas_Object *o = opt->obj;
861 int w;
862
863 evas_object_geometry_get(o, NULL, NULL, &w, NULL);
864
865 if (remaining <= 0)
866 {
867 int min_h;
868
869 evas_object_size_hint_min_get(o, NULL, &min_h);
870 evas_object_resize(o, w, min_h);
871 }
872 else
873 {
874 double normal_weight, weight_y;
875 int target_size;
876 int max_h;
877
878 evas_object_size_hint_weight_get(o, NULL, &weight_y);
879 normal_weight = weight_y / weight_total;
880 target_size = (int)((double)remaining * normal_weight);
881
882 evas_object_size_hint_max_get(o, NULL, &max_h);
883 if ((max_h != -1) && (target_size > max_h))
884 {
885 evas_object_resize(o, w, max_h);
886 rem_diff += max_h;
887 objects[i] = objects[n_objects - 1];
888 weight_total -= weight_y;
889 n_objects--;
890 return _evas_object_box_layout_vertical_weight_apply
891 (priv, objects, n_objects, remaining - rem_diff,
892 weight_total);
893 }
894 else
895 {
896 evas_object_resize(o, w, target_size);
897 rem_diff += target_size;
898 }
899 }
900 }
901
902 return remaining - rem_diff;
903}
904
905EAPI void
906evas_object_box_layout_vertical(Evas_Object *o, Evas_Object_Box_Data *priv, void *data __UNUSED__)
907{
908 int pad_inc = 0, sub_pixel = 0;
909 int req_h, global_pad, remaining, top_w = 0;
910 double weight_total = 0.0;
911 int weight_use = 0;
912 int x, y, w, h;
913 int n_children;
914 Evas_Object_Box_Option *opt;
915 Evas_Object_Box_Option **objects;
916 Eina_List *l;
917
918 n_children = eina_list_count(priv->children);
919 if (!n_children)
920 return;
921
922 objects = (Evas_Object_Box_Option **)alloca(sizeof(Evas_Object_Box_Option *) * n_children);
923 if (!objects)
924 return;
925
926 evas_object_geometry_get(o, &x, &y, &w, &h);
927 global_pad = priv->pad.v;
928 req_h = global_pad * (n_children - 1);
929
930 EINA_LIST_FOREACH(priv->children, l, opt)
931 {
932 int padding_t, padding_b;
933 double weight_y;
934
935 _sizing_eval(opt->obj);
936 evas_object_size_hint_weight_get(opt->obj, NULL, &weight_y);
937 evas_object_size_hint_padding_get
938 (opt->obj, NULL, NULL, &padding_t, &padding_b);
939 req_h += padding_t + padding_b;
940
941 if (!weight_y)
942 {
943 int child_h;
944
945 evas_object_geometry_get(opt->obj, NULL, NULL, NULL, &child_h);
946 req_h += child_h;
947 }
948 else
949 {
950 objects[weight_use] = opt;
951 weight_use++;
952 weight_total += weight_y;
953 }
954 }
955
956 remaining = h - req_h;
957
958 if (weight_use)
959 remaining = _evas_object_box_layout_vertical_weight_apply
960 (priv, objects, weight_use, remaining, weight_total);
961
962 if (priv->align.v >= 0.0)
963 y += remaining * priv->align.v;
964 else if (n_children == 1)
965 y += remaining / 2;
966 else
967 { /* justified */
968 _fixed_point_divide_and_decompose_integer
969 (remaining, n_children - 1, &global_pad, &pad_inc);
970 global_pad += priv->pad.v;
971 }
972
973 EINA_LIST_FOREACH(priv->children, l, opt)
974 {
975 int child_w, child_h, max_w, new_w, off_x, off_y;
976 int padding_l, padding_r, padding_t, padding_b;
977 double align_x;
978
979 evas_object_size_hint_align_get(opt->obj, &align_x, NULL);
980 evas_object_size_hint_padding_get
981 (opt->obj, &padding_l, &padding_r, &padding_t, &padding_b);
982 evas_object_size_hint_max_get(opt->obj, &max_w, NULL);
983
984 evas_object_geometry_get(opt->obj, NULL, NULL, &child_w, &child_h);
985
986 off_y = padding_t;
987 new_w = child_w;
988
989 _layout_set_offset_and_expand_dimension_space_max_bounded
990 (child_w, &new_w, w, max_w, &off_x, align_x, padding_l, padding_r);
991
992 if (new_w > top_w) top_w = new_w;
993
994 if (new_w != child_w)
995 evas_object_resize(opt->obj, new_w, child_h);
996 evas_object_move(opt->obj, x + off_x, y + off_y);
997
998 y += child_h + padding_t + padding_b + global_pad;
999 sub_pixel += pad_inc;
1000 if (sub_pixel >= 1 << 16)
1001 {
1002 y++;
1003 sub_pixel -= 1 << 16;
1004 }
1005 }
1006
1007 evas_object_size_hint_min_set(o, top_w, req_h);
1008}
1009
1010EAPI void
1011evas_object_box_layout_homogeneous_horizontal(Evas_Object *o, Evas_Object_Box_Data *priv, void *data __UNUSED__)
1012{
1013 int cell_sz, share, inc;
1014 int sub_pixel = 0;
1015 int x, y, w, h;
1016 int n_children;
1017 Evas_Object_Box_Option *opt;
1018 Eina_List *l;
1019
1020 n_children = eina_list_count(priv->children);
1021 if (!n_children)
1022 return;
1023
1024 evas_object_geometry_get(o, &x, &y, &w, &h);
1025
1026 share = w - priv->pad.h * (n_children - 1);
1027 _fixed_point_divide_and_decompose_integer
1028 (share, n_children, &cell_sz, &inc);
1029
1030 EINA_LIST_FOREACH(priv->children, l, opt)
1031 {
1032 int child_w, child_h, max_h, min_w, max_w, new_w, new_h, off_x, off_y;
1033 int padding_l, padding_r, padding_t, padding_b;
1034 double align_x, align_y;
1035
1036 evas_object_size_hint_align_get(opt->obj, &align_x, &align_y);
1037 evas_object_size_hint_padding_get
1038 (opt->obj, &padding_l, &padding_r, &padding_t, &padding_b);
1039 evas_object_size_hint_max_get(opt->obj, &max_w, &max_h);
1040 evas_object_size_hint_min_get(opt->obj, &min_w, NULL);
1041
1042 _sizing_eval(opt->obj);
1043 evas_object_geometry_get(opt->obj, NULL, NULL, &child_w, &child_h);
1044
1045 new_w = child_w;
1046 new_h = child_h;
1047
1048 _layout_set_offset_and_expand_dimension_space_max_bounded
1049 (child_h, &new_h, h, max_h, &off_y, align_y, padding_t, padding_b);
1050
1051 _layout_set_offset_and_change_dimension_min_max_cell_bounded
1052 (child_w, &new_w, min_w, max_w, cell_sz, &off_x, align_x,
1053 padding_l, padding_r);
1054
1055 if ((new_w != child_w) || (new_h != child_h))
1056 evas_object_resize(opt->obj, new_w, new_h);
1057 evas_object_move(opt->obj, x + off_x, y + off_y);
1058
1059 x += cell_sz + priv->pad.h;
1060 sub_pixel += inc;
1061 if (sub_pixel >= 1 << 16)
1062 {
1063 x++;
1064 sub_pixel -= 1 << 16;
1065 }
1066 }
1067
1068 evas_object_size_hint_min_set(o, w, h);
1069}
1070
1071EAPI void
1072evas_object_box_layout_homogeneous_vertical(Evas_Object *o, Evas_Object_Box_Data *priv, void *data __UNUSED__)
1073{
1074 int cell_sz, share, inc;
1075 int sub_pixel = 0;
1076 int x, y, w, h;
1077 int n_children;
1078 Evas_Object_Box_Option *opt;
1079 Eina_List *l;
1080
1081 n_children = eina_list_count(priv->children);
1082 if (!n_children)
1083 return;
1084
1085 evas_object_geometry_get(o, &x, &y, &w, &h);
1086
1087 share = h - priv->pad.v * (n_children - 1);
1088 _fixed_point_divide_and_decompose_integer
1089 (share, n_children, &cell_sz, &inc);
1090
1091 EINA_LIST_FOREACH(priv->children, l, opt)
1092 {
1093 int child_w, child_h, max_w, min_h, max_h, new_w, new_h, off_x, off_y;
1094 int padding_l, padding_r, padding_t, padding_b;
1095 double align_x, align_y;
1096
1097 evas_object_size_hint_align_get(opt->obj, &align_x, &align_y);
1098 evas_object_size_hint_padding_get
1099 (opt->obj, &padding_l, &padding_r, &padding_t, &padding_b);
1100 evas_object_size_hint_max_get(opt->obj, &max_w, &max_h);
1101 evas_object_size_hint_min_get(opt->obj, NULL, &min_h);
1102
1103 _sizing_eval(opt->obj);
1104 evas_object_geometry_get(opt->obj, NULL, NULL, &child_w, &child_h);
1105 new_w = child_w;
1106 new_h = child_h;
1107
1108 _layout_set_offset_and_expand_dimension_space_max_bounded
1109 (child_w, &new_w, w, max_w, &off_x, align_x, padding_l, padding_r);
1110
1111 _layout_set_offset_and_change_dimension_min_max_cell_bounded
1112 (child_h, &new_h, min_h, max_h, cell_sz, &off_y, align_y,
1113 padding_t, padding_b);
1114
1115 if ((new_w != child_w) || (new_h != child_h))
1116 evas_object_resize(opt->obj, new_w, new_h);
1117 evas_object_move(opt->obj, x + off_x, y + off_y);
1118
1119 y += cell_sz + priv->pad.v;
1120 sub_pixel += inc;
1121 if (sub_pixel >= 1 << 16)
1122 {
1123 y++;
1124 sub_pixel -= 1 << 16;
1125 }
1126 }
1127
1128 evas_object_size_hint_min_set(o, w, h);
1129}
1130
1131EAPI void
1132evas_object_box_layout_homogeneous_max_size_horizontal(Evas_Object *o, Evas_Object_Box_Data *priv, void *data __UNUSED__)
1133{
1134 int remaining, global_pad, pad_inc = 0, sub_pixel = 0;
1135 int cell_sz = 0;
1136 int x, y, w, h;
1137 int top_h = 0;
1138 int n_children;
1139 Evas_Object_Box_Option *opt;
1140 Eina_List *l;
1141
1142 n_children = eina_list_count(priv->children);
1143 if (!n_children)
1144 return;
1145
1146 evas_object_geometry_get(o, &x, &y, &w, &h);
1147
1148 EINA_LIST_FOREACH(priv->children, l, opt)
1149 {
1150 int child_w, padding_l, padding_r;
1151
1152 _sizing_eval(opt->obj);
1153 evas_object_size_hint_padding_get
1154 (opt->obj, &padding_l, &padding_r, NULL, NULL);
1155 evas_object_geometry_get(opt->obj, NULL, NULL, &child_w, NULL);
1156 if (child_w + padding_l + padding_r > cell_sz)
1157 cell_sz = child_w + padding_l + padding_r;
1158 }
1159
1160 global_pad = priv->pad.h;
1161 remaining = w - n_children * cell_sz - global_pad * (n_children - 1);
1162
1163 if (priv->align.h >= 0.0)
1164 x += remaining * priv->align.h;
1165 else if (n_children == 1)
1166 x += remaining / 2;
1167 else
1168 { /* justified */
1169 _fixed_point_divide_and_decompose_integer
1170 (remaining, n_children - 1, &global_pad, &pad_inc);
1171 global_pad += priv->pad.h;
1172 }
1173
1174 EINA_LIST_FOREACH(priv->children, l, opt)
1175 {
1176 int child_w, child_h, min_w, max_w, max_h, new_w, new_h, off_x, off_y;
1177 int padding_l, padding_r, padding_t, padding_b;
1178 double align_x, align_y;
1179
1180 evas_object_size_hint_align_get(opt->obj, &align_x, &align_y);
1181 evas_object_size_hint_padding_get
1182 (opt->obj, &padding_l, &padding_r, &padding_t, &padding_b);
1183 evas_object_size_hint_max_get(opt->obj, &max_w, &max_h);
1184 evas_object_size_hint_min_get(opt->obj, &min_w, NULL);
1185
1186 evas_object_geometry_get(opt->obj, NULL, NULL, &child_w, &child_h);
1187
1188 new_w = child_w;
1189 new_h = child_h;
1190 if (new_h > top_h) top_h = new_h;
1191
1192 _layout_set_offset_and_expand_dimension_space_max_bounded
1193 (child_h, &new_h, h, max_h, &off_y, align_y, padding_t, padding_b);
1194
1195 _layout_set_offset_and_change_dimension_min_max_cell_bounded
1196 (child_w, &new_w, min_w, max_w, cell_sz, &off_x, align_x,
1197 padding_l, padding_r);
1198
1199 if ((new_w != child_w) || (new_h != child_h))
1200 evas_object_resize(opt->obj, new_w, new_h);
1201 evas_object_move(opt->obj, x + off_x, y + off_y);
1202
1203 x += cell_sz + global_pad;
1204 sub_pixel += pad_inc;
1205 if (sub_pixel >= 1 << 16)
1206 {
1207 x++;
1208 sub_pixel -= 1 << 16;
1209 }
1210 }
1211
1212 evas_object_size_hint_min_set(o, x, top_h);
1213}
1214
1215EAPI void
1216evas_object_box_layout_homogeneous_max_size_vertical(Evas_Object *o, Evas_Object_Box_Data *priv, void *data __UNUSED__)
1217{
1218 int remaining, global_pad, pad_inc = 0, sub_pixel = 0;
1219 int cell_sz = 0;
1220 int x, y, w, h;
1221 int top_w = 0;
1222 int n_children;
1223 Evas_Object_Box_Option *opt;
1224 Eina_List *l;
1225
1226 n_children = eina_list_count(priv->children);
1227 if (!n_children)
1228 return;
1229
1230 evas_object_geometry_get(o, &x, &y, &w, &h);
1231
1232 EINA_LIST_FOREACH(priv->children, l, opt)
1233 {
1234 int child_h, padding_t, padding_b;
1235
1236 _sizing_eval(opt->obj);
1237 evas_object_size_hint_padding_get
1238 (opt->obj, NULL, NULL, &padding_t, &padding_b);
1239 evas_object_geometry_get(opt->obj, NULL, NULL, NULL, &child_h);
1240 if (child_h + padding_t + padding_b > cell_sz)
1241 cell_sz = child_h + padding_t + padding_b;
1242 }
1243
1244 global_pad = priv->pad.v;
1245 remaining = h - n_children * cell_sz - global_pad * (n_children - 1);
1246
1247 if (priv->align.v >= 0.0)
1248 y += remaining * priv->align.v;
1249 else if (n_children == 1)
1250 y += remaining / 2;
1251 else
1252 { /* justified */
1253 _fixed_point_divide_and_decompose_integer
1254 (remaining, n_children - 1, &global_pad, &pad_inc);
1255 global_pad += priv->pad.v;
1256 }
1257
1258 EINA_LIST_FOREACH(priv->children, l, opt)
1259 {
1260 int child_w, child_h, max_h, min_h, max_w, new_w, new_h, off_x, off_y;
1261 int padding_l, padding_r, padding_t, padding_b;
1262 double align_x, align_y;
1263
1264 evas_object_size_hint_align_get(opt->obj, &align_x, &align_y);
1265 evas_object_size_hint_padding_get
1266 (opt->obj, &padding_l, &padding_r, &padding_t, &padding_b);
1267 evas_object_size_hint_max_get(opt->obj, &max_w, &max_h);
1268 evas_object_size_hint_min_get(opt->obj, NULL, &min_h);
1269
1270 evas_object_geometry_get(opt->obj, NULL, NULL, &child_w, &child_h);
1271
1272 new_w = child_w;
1273 new_h = child_h;
1274 if (new_w > top_w) top_w = new_w;
1275
1276 _layout_set_offset_and_expand_dimension_space_max_bounded
1277 (child_w, &new_w, w, max_w, &off_x, align_x, padding_l, padding_r);
1278
1279 _layout_set_offset_and_change_dimension_min_max_cell_bounded
1280 (child_h, &new_h, min_h, max_h, cell_sz, &off_y, align_y,
1281 padding_t, padding_b);
1282
1283 if ((new_w != child_w) || (new_h != child_h))
1284 evas_object_resize(opt->obj, new_w, new_h);
1285 evas_object_move(opt->obj, x + off_x, y + off_y);
1286
1287 y += cell_sz + global_pad;
1288 sub_pixel += pad_inc;
1289 if (sub_pixel >= 1 << 16)
1290 {
1291 y++;
1292 sub_pixel -= 1 << 16;
1293 }
1294 }
1295
1296 evas_object_size_hint_min_set(o, top_w, y);
1297}
1298
1299static void
1300_evas_object_box_layout_flow_horizontal_row_info_collect(Evas_Object_Box_Data *priv, int box_w, int *row_count, int *row_max_h, int *row_break, int *row_width, int *off_y_ret, int *max_h_ret)
1301{
1302 int i, remain_w = box_w, start_i = 0;
1303 int off_y = 0, max_h = 0, n_rows = 0;
1304 Eina_List *l;
1305
1306 for (i = 0, l = priv->children; l; i++, l = l->next)
1307 {
1308 Evas_Object_Box_Option *opt = l->data;
1309 int padding_l, padding_r, padding_t, padding_b;
1310 int child_w, child_h, off_x = 0;
1311
1312 evas_object_size_hint_padding_get
1313 (opt->obj, &padding_l, &padding_r, &padding_t, &padding_b);
1314
1315 _sizing_eval(opt->obj);
1316 evas_object_geometry_get(opt->obj, NULL, NULL, &child_w, &child_h);
1317
1318 child_w += padding_l + padding_r + priv->pad.h;
1319 child_h += padding_t + padding_b;
1320
1321 remain_w -= child_w;
1322 if (remain_w + priv->pad.h >= 0)
1323 { /* continue "line" */
1324 if (child_h > max_h)
1325 max_h = child_h;
1326
1327 off_x += child_w;
1328 row_width[n_rows] += child_w;
1329 }
1330 else
1331 { /* break line */
1332 if (i == start_i)
1333 { /* obj goes to actual line */
1334 max_h = child_h;
1335 row_width[n_rows] = child_w;
1336 }
1337 else
1338 { /* obj goes to next line */
1339 row_max_h[n_rows] = max_h;
1340 row_break[n_rows] = i - 1;
1341 n_rows++;
1342
1343 off_x = child_w;
1344 off_y += max_h;
1345 max_h = child_h;
1346
1347 row_width[n_rows] = child_w;
1348 start_i = i;
1349
1350 remain_w = box_w - off_x;
1351 }
1352 }
1353 }
1354
1355 row_break[n_rows] = i - 1;
1356 row_max_h[n_rows] = max_h;
1357
1358 *row_count = n_rows;
1359 *off_y_ret = off_y;
1360 *max_h_ret = max_h;
1361}
1362
1363EAPI void
1364evas_object_box_layout_flow_horizontal(Evas_Object *o, Evas_Object_Box_Data *priv, void *data __UNUSED__)
1365{
1366 int n_children, v_justify;
1367 int r, row_count = 0;
1368 int min_w = 0, min_h = 0;
1369 int max_h, inc_y;
1370 int remain_y, i;
1371 int x, y, w, h;
1372 Eina_List *l;
1373 int *row_max_h;
1374 int *row_break;
1375 int *row_width;
1376 int offset_y;
1377
1378 n_children = eina_list_count(priv->children);
1379 if (!n_children)
1380 return;
1381
1382 /* *per row* arrays */
1383 row_max_h = (int *)alloca(sizeof(int) * n_children);
1384 if (!row_max_h)
1385 return;
1386 row_break = (int *)alloca(sizeof(int) * n_children);
1387 if (!row_break)
1388 return;
1389 row_width = (int *)alloca(sizeof(int) * n_children);
1390 if (!row_width)
1391 return;
1392
1393 memset(row_width, 0, sizeof(row_width));
1394
1395 evas_object_geometry_get(o, &x, &y, &w, &h);
1396
1397 _evas_object_box_layout_flow_horizontal_row_info_collect
1398 (priv, w, &row_count, row_max_h, row_break, row_width, &offset_y, &max_h);
1399
1400 inc_y = 0;
1401 v_justify = 0;
1402 remain_y = h - (offset_y + max_h);
1403
1404 if (remain_y > 0)
1405 {
1406 if (priv->align.v >= 0.0)
1407 inc_y = priv->align.v * remain_y;
1408 else if (row_count == 0)
1409 y += remain_y / 2;
1410 else /* y-justified */
1411 inc_y = remain_y / row_count;
1412 }
1413
1414 inc_y += priv->pad.v;
1415
1416 for (i = 0, r = 0, l = priv->children; r <= row_count; r++)
1417 {
1418 int row_justify = 0, just_inc = 0, sub_pixel = 0;
1419 int row_size, remain_x;
1420
1421 row_size = row_break[r] - i;
1422 remain_x = (w - row_width[r]);
1423
1424 if (priv->align.h < 0.0)
1425 {
1426 if (row_size == 0)
1427 x += remain_x / 2;
1428 else
1429 _fixed_point_divide_and_decompose_integer
1430 (remain_x, row_size, &row_justify, &just_inc);
1431 }
1432
1433 row_justify += priv->pad.h;
1434
1435 for (; i <= row_break[r]; i++, l = l->next)
1436 {
1437 Evas_Object_Box_Option *opt = l->data;
1438 int off_x, off_y, y_remain;
1439 int padding_l, padding_r;
1440 int child_w, child_h;
1441 double align_y;
1442
1443 evas_object_size_hint_align_get(opt->obj, NULL, &align_y);
1444 evas_object_size_hint_padding_get
1445 (opt->obj, &padding_l, &padding_r, NULL, NULL);
1446
1447 evas_object_geometry_get
1448 (opt->obj, NULL, NULL, &child_w, &child_h);
1449
1450 y_remain = row_max_h[r] - child_h;
1451
1452 off_x = padding_l;
1453 if (priv->align.h >= 0.0)
1454 off_x += remain_x * priv->align.h;
1455 off_y = y_remain * align_y;
1456
1457 evas_object_move(opt->obj, x + off_x, y + off_y);
1458
1459 x += child_w + padding_l + padding_r + row_justify;
1460
1461 sub_pixel += just_inc;
1462 if (sub_pixel >= 1 << 16)
1463 {
1464 x++;
1465 sub_pixel -= 1 << 16;
1466 }
1467 }
1468
1469 evas_object_geometry_get(o, &x, NULL, NULL, NULL);
1470 if (min_w < row_width[r])
1471 min_w = row_width[r];
1472 min_h += row_max_h[r];
1473 y += row_max_h[r] + inc_y;
1474 }
1475
1476 evas_object_size_hint_min_set(o, min_w, min_h);
1477}
1478
1479static void
1480_evas_object_box_layout_flow_vertical_col_info_collect(Evas_Object_Box_Data *priv, int box_h, int *col_count, int *col_max_w, int *col_break, int *col_height, int *off_x_ret, int *max_w_ret)
1481{
1482 int i, remain_h = box_h, start_i = 0;
1483 int off_x = 0, max_w = 0, n_cols = 0;
1484 Eina_List *l;
1485
1486 for (i = 0, l = priv->children; l; i++, l = l->next)
1487 {
1488 Evas_Object_Box_Option *opt = l->data;
1489 int padding_l, padding_r, padding_t, padding_b;
1490 int child_w, child_h, off_y = 0;
1491
1492 evas_object_size_hint_padding_get
1493 (opt->obj, &padding_l, &padding_r, &padding_t, &padding_b);
1494
1495 _sizing_eval(opt->obj);
1496 evas_object_geometry_get(opt->obj, NULL, NULL, &child_w, &child_h);
1497
1498 child_w += padding_l + padding_r;
1499 child_h += padding_t + padding_b + priv->pad.v;
1500
1501 remain_h -= child_h;
1502 if (remain_h + priv->pad.v >= 0)
1503 { /* continue "col" */
1504 if (child_w > max_w)
1505 max_w = child_w;
1506
1507 off_y += child_h;
1508 col_height[n_cols] += child_h;
1509 }
1510 else
1511 {
1512 /* break col */
1513 if (i == start_i)
1514 { /* obj goes to actual col */
1515 max_w = child_w;
1516 col_height[n_cols] = child_h;
1517 }
1518 else
1519 { /* obj goes to next col */
1520 col_max_w[n_cols] = max_w;
1521 col_break[n_cols] = i - 1;
1522 n_cols++;
1523
1524 off_x += max_w;
1525 off_y = child_h;
1526 max_w = child_w;
1527
1528 col_height[n_cols] = child_h;
1529 start_i = i;
1530
1531 remain_h = box_h - off_y;
1532 }
1533 }
1534 }
1535
1536 col_break[n_cols] = i - 1;
1537 col_max_w[n_cols] = max_w;
1538
1539 *col_count = n_cols;
1540 *off_x_ret = off_x;
1541 *max_w_ret = max_w;
1542}
1543
1544EAPI void
1545evas_object_box_layout_flow_vertical(Evas_Object *o, Evas_Object_Box_Data *priv, void *data __UNUSED__)
1546{
1547 int n_children;
1548 int c, col_count;
1549 int min_w = 0, min_h = 0;
1550 int max_w, inc_x;
1551 int remain_x, i;
1552 int x, y, w, h;
1553 Eina_List *l;
1554 int *col_max_w;
1555 int *col_break;
1556 int *col_height;
1557 int offset_x;
1558
1559 n_children = eina_list_count(priv->children);
1560 if (!n_children)
1561 return;
1562
1563 /* *per col* arrays */
1564 col_max_w = (int *)alloca(sizeof(int) * n_children);
1565 if (!col_max_w)
1566 return;
1567 col_break = (int *)alloca(sizeof(int) * n_children);
1568 if (!col_break)
1569 return;
1570 col_height = (int *)alloca(sizeof(int) * n_children);
1571 if (!col_height)
1572 return;
1573
1574 memset(col_height, 0, sizeof(col_height));
1575
1576 evas_object_geometry_get(o, &x, &y, &w, &h);
1577
1578 _evas_object_box_layout_flow_vertical_col_info_collect
1579 (priv, h, &col_count, col_max_w, col_break, col_height, &offset_x, &max_w);
1580
1581 inc_x = 0;
1582 remain_x = w - (offset_x + max_w);
1583
1584 if (remain_x > 0)
1585 {
1586 if (priv->align.h >= 0)
1587 inc_x = priv->align.h * remain_x;
1588 else if (col_count == 0)
1589 x += remain_x / 2;
1590 else /* x-justified */
1591 inc_x = remain_x / col_count;
1592 }
1593
1594 inc_x += priv->pad.h;
1595
1596 for (i = 0, c = 0, l = priv->children; c <= col_count; c++)
1597 {
1598 int col_justify = 0, just_inc = 0, sub_pixel = 0;
1599 int col_size, remain_y;
1600
1601 col_size = col_break[c] - i;
1602 remain_y = (h - col_height[c]);
1603
1604 if (priv->align.v < 0.0)
1605 {
1606 if (col_size == 0)
1607 y += remain_y / 2;
1608 else
1609 _fixed_point_divide_and_decompose_integer
1610 (remain_y, col_size, &col_justify, &just_inc);
1611 }
1612
1613 col_justify += priv->pad.v;
1614
1615 for (; i <= col_break[c]; i++, l = l->next)
1616 {
1617 Evas_Object_Box_Option *opt = l->data;
1618 int off_x, off_y, x_remain;
1619 int padding_t, padding_b;
1620 int child_w, child_h;
1621 double align_x;
1622
1623 evas_object_size_hint_align_get(opt->obj, &align_x, NULL);
1624 evas_object_size_hint_padding_get
1625 (opt->obj, NULL, NULL, &padding_t, &padding_b);
1626
1627 evas_object_geometry_get
1628 (opt->obj, NULL, NULL, &child_w, &child_h);
1629
1630 x_remain = col_max_w[c] - child_w;
1631
1632 off_x = x_remain * align_x;
1633 off_y = padding_t;
1634 if (priv->align.v >= 0.0)
1635 off_y += remain_y * priv->align.v;
1636
1637 evas_object_move(opt->obj, x + off_x, y + off_y);
1638
1639 y += child_h + padding_t + padding_b + col_justify;
1640
1641 sub_pixel += just_inc;
1642 if (sub_pixel >= 1 << 16)
1643 {
1644 y++;
1645 sub_pixel -= 1 << 16;
1646 }
1647 }
1648
1649 evas_object_geometry_get(o, NULL, &y, NULL, NULL);
1650 min_w += col_max_w[c];
1651 if (min_h < col_height[c])
1652 min_h = col_height[c];
1653 x += col_max_w[c] + inc_x;
1654 }
1655
1656 evas_object_size_hint_min_set(o, min_w, min_h);
1657}
1658
1659EAPI void
1660evas_object_box_layout_stack(Evas_Object *o, Evas_Object_Box_Data *priv, void *data __UNUSED__)
1661{
1662 Eina_List *l;
1663 Evas_Coord ox, oy, ow, oh;
1664 Evas_Coord top_w = 0, top_h = 0;
1665 Evas_Object_Box_Option *opt;
1666 Evas_Object *old_child = NULL;
1667
1668 evas_object_geometry_get(o, &ox, &oy, &ow, &oh);
1669
1670 EINA_LIST_FOREACH(priv->children, l, opt)
1671 {
1672 Evas_Object *child = opt->obj;
1673 Evas_Coord max_w, max_h, min_w, min_h, pad_l, pad_r, pad_t, pad_b,
1674 child_w, child_h, new_w, new_h, off_x, off_y;
1675 double align_x, align_y;
1676
1677 evas_object_size_hint_align_get(child, &align_x, &align_y);
1678 evas_object_size_hint_padding_get
1679 (child, &pad_l, &pad_r, &pad_t, &pad_b);
1680 evas_object_size_hint_max_get(child, &max_w, &max_h);
1681 evas_object_size_hint_min_get(child, &min_w, &min_h);
1682
1683 _sizing_eval(opt->obj);
1684 evas_object_geometry_get(child, NULL, NULL, &child_w, &child_h);
1685 new_w = child_w;
1686 new_h = child_h;
1687 if (new_w > top_w) top_w = new_w;
1688 if (new_h > top_h) top_h = new_h;
1689
1690 _layout_set_offset_and_change_dimension_min_max_cell_bounded
1691 (child_w, &new_w, min_w, max_w, ow, &off_x, align_x, pad_l, pad_r);
1692 _layout_set_offset_and_change_dimension_min_max_cell_bounded
1693 (child_h, &new_h, min_h, max_h, oh, &off_y, align_y, pad_t, pad_b);
1694
1695 if ((new_w != child_w) || (new_h != child_h))
1696 evas_object_resize(child, new_w, new_h);
1697 evas_object_move(child, ox + off_x, oy + off_y);
1698
1699 if (old_child)
1700 evas_object_stack_above(child, old_child);
1701 old_child = child;
1702 }
1703
1704 evas_object_size_hint_min_set(o, top_w, top_h);
1705}
1706
1707EAPI void
1708evas_object_box_align_set(Evas_Object *o, double horizontal, double vertical)
1709{
1710 EVAS_OBJECT_BOX_DATA_GET_OR_RETURN(o, priv);
1711 if (priv->align.h == horizontal && priv->align.v == vertical)
1712 return;
1713 priv->align.h = horizontal;
1714 priv->align.v = vertical;
1715 evas_object_smart_changed(o);
1716}
1717
1718EAPI void
1719evas_object_box_align_get(const Evas_Object *o, double *horizontal, double *vertical)
1720{
1721 EVAS_OBJECT_BOX_DATA_GET(o, priv);
1722 if (priv)
1723 {
1724 if (horizontal) *horizontal = priv->align.h;
1725 if (vertical) *vertical = priv->align.v;
1726 }
1727 else
1728 {
1729 if (horizontal) *horizontal = 0.5;
1730 if (vertical) *vertical = 0.5;
1731 }
1732}
1733
1734EAPI void
1735evas_object_box_padding_set(Evas_Object *o, Evas_Coord horizontal, Evas_Coord vertical)
1736{
1737 EVAS_OBJECT_BOX_DATA_GET_OR_RETURN(o, priv);
1738 if (priv->pad.h == horizontal && priv->pad.v == vertical)
1739 return;
1740 priv->pad.h = horizontal;
1741 priv->pad.v = vertical;
1742 evas_object_smart_changed(o);
1743}
1744
1745EAPI void
1746evas_object_box_padding_get(const Evas_Object *o, Evas_Coord *horizontal, Evas_Coord *vertical)
1747{
1748 EVAS_OBJECT_BOX_DATA_GET(o, priv);
1749 if (priv)
1750 {
1751 if (horizontal) *horizontal = priv->pad.h;
1752 if (vertical) *vertical = priv->pad.v;
1753 }
1754 else
1755 {
1756 if (horizontal) *horizontal = 0;
1757 if (vertical) *vertical = 0;
1758 }
1759}
1760
1761EAPI Evas_Object_Box_Option *
1762evas_object_box_append(Evas_Object *o, Evas_Object *child)
1763{
1764 Evas_Object_Box_Option *opt;
1765 const Evas_Object_Box_Api *api;
1766
1767 EVAS_OBJECT_BOX_DATA_GET_OR_RETURN_VAL(o, priv, 0);
1768 if (!child)
1769 return NULL;
1770
1771 api = priv->api;
1772 if ((!api) || (!api->append))
1773 return NULL;
1774
1775 opt = api->append(o, priv, child);
1776
1777 if (opt)
1778 {
1779 evas_object_smart_member_add(child, o);
1780 evas_object_smart_changed(o);
1781 return _evas_object_box_option_callbacks_register(o, priv, opt);
1782 }
1783
1784 return NULL;
1785}
1786
1787EAPI Evas_Object_Box_Option *
1788evas_object_box_prepend(Evas_Object *o, Evas_Object *child)
1789{
1790 Evas_Object_Box_Option *opt;
1791 const Evas_Object_Box_Api *api;
1792
1793 EVAS_OBJECT_BOX_DATA_GET_OR_RETURN_VAL(o, priv, 0);
1794 if (!child)
1795 return NULL;
1796
1797 api = priv->api;
1798 if ((!api) || (!api->prepend))
1799 return NULL;
1800
1801 opt = api->prepend(o, priv, child);
1802
1803 if (opt)
1804 {
1805 evas_object_smart_member_add(child, o);
1806 evas_object_smart_changed(o);
1807 return _evas_object_box_option_callbacks_register(o, priv, opt);
1808 }
1809
1810 return NULL;
1811}
1812
1813EAPI Evas_Object_Box_Option *
1814evas_object_box_insert_before(Evas_Object *o, Evas_Object *child, const Evas_Object *reference)
1815{
1816 Evas_Object_Box_Option *opt;
1817 const Evas_Object_Box_Api *api;
1818
1819 EVAS_OBJECT_BOX_DATA_GET_OR_RETURN_VAL(o, priv, 0);
1820 if (!child)
1821 return NULL;
1822
1823 api = priv->api;
1824 if ((!api) || (!api->insert_before))
1825 return NULL;
1826
1827 opt = api->insert_before(o, priv, child, reference);
1828
1829 if (opt)
1830 {
1831 evas_object_smart_member_add(child, o);
1832 evas_object_smart_changed(o);
1833 return _evas_object_box_option_callbacks_register(o, priv, opt);
1834 }
1835
1836 return NULL;
1837}
1838
1839EAPI Evas_Object_Box_Option *
1840evas_object_box_insert_after(Evas_Object *o, Evas_Object *child, const Evas_Object *reference)
1841{
1842 Evas_Object_Box_Option *opt;
1843 const Evas_Object_Box_Api *api;
1844
1845 EVAS_OBJECT_BOX_DATA_GET_OR_RETURN_VAL(o, priv, NULL);
1846 if (!child)
1847 return NULL;
1848
1849 api = priv->api;
1850 if ((!api) || (!api->insert_after))
1851 return NULL;
1852
1853 opt = api->insert_after(o, priv, child, reference);
1854
1855 if (opt)
1856 {
1857 evas_object_smart_member_add(child, o);
1858 evas_object_smart_changed(o);
1859 return _evas_object_box_option_callbacks_register(o, priv, opt);
1860 }
1861
1862 return NULL;
1863}
1864
1865EAPI Evas_Object_Box_Option *
1866evas_object_box_insert_at(Evas_Object *o, Evas_Object *child, unsigned int pos)
1867{
1868 Evas_Object_Box_Option *opt;
1869 const Evas_Object_Box_Api *api;
1870
1871 EVAS_OBJECT_BOX_DATA_GET_OR_RETURN_VAL(o, priv, 0);
1872 if (!child)
1873 return NULL;
1874
1875 api = priv->api;
1876 if ((!api) || (!api->insert_at))
1877 return NULL;
1878
1879 opt = api->insert_at(o, priv, child, pos);
1880
1881 if (opt)
1882 {
1883 evas_object_smart_member_add(child, o);
1884 evas_object_smart_changed(o);
1885 return _evas_object_box_option_callbacks_register(o, priv, opt);
1886 }
1887
1888 return NULL;
1889}
1890
1891EAPI Eina_Bool
1892evas_object_box_remove(Evas_Object *o, Evas_Object *child)
1893{
1894 const Evas_Object_Box_Api *api;
1895 Evas_Object *obj;
1896
1897 EVAS_OBJECT_BOX_DATA_GET_OR_RETURN_VAL(o, priv, 0);
1898 if (!child) return EINA_FALSE;
1899
1900 api = priv->api;
1901 if ((!api) || (!api->remove))
1902 return 0;
1903
1904 obj = api->remove(o, priv, child);
1905
1906 if (obj)
1907 {
1908 _evas_object_box_child_callbacks_unregister(obj);
1909 evas_object_smart_member_del(obj);
1910 evas_object_smart_changed(o);
1911 return EINA_TRUE;
1912 }
1913
1914 return EINA_FALSE;
1915}
1916
1917EAPI Eina_Bool
1918evas_object_box_remove_at(Evas_Object *o, unsigned int pos)
1919{
1920 const Evas_Object_Box_Api *api;
1921 Evas_Object *obj;
1922
1923 EVAS_OBJECT_BOX_DATA_GET_OR_RETURN_VAL(o, priv, 0);
1924 api = priv->api;
1925 if ((!api) || (!api->remove_at)) return EINA_FALSE;
1926
1927 obj = api->remove_at(o, priv, pos);
1928
1929 if (obj)
1930 {
1931 _evas_object_box_child_callbacks_unregister(obj);
1932 evas_object_smart_member_del(obj);
1933 evas_object_smart_changed(o);
1934 return EINA_TRUE;
1935 }
1936
1937 return EINA_FALSE;
1938}
1939
1940EAPI Eina_Bool
1941evas_object_box_remove_all(Evas_Object *o, Eina_Bool clear)
1942{
1943 const Evas_Object_Box_Api *api;
1944
1945 EVAS_OBJECT_BOX_DATA_GET_OR_RETURN_VAL(o, priv, 0);
1946
1947 api = priv->api;
1948 if ((!api) || (!api->remove)) return EINA_FALSE;
1949
1950 evas_object_smart_changed(o);
1951
1952 while (priv->children)
1953 {
1954 Evas_Object_Box_Option *opt = priv->children->data;
1955 Evas_Object *obj;
1956
1957 obj = api->remove(o, priv, opt->obj);
1958 if (obj)
1959 {
1960 _evas_object_box_child_callbacks_unregister(obj);
1961 evas_object_smart_member_del(obj);
1962 if (clear)
1963 evas_object_del(obj);
1964 }
1965 else return EINA_FALSE;
1966 }
1967
1968 return EINA_TRUE;
1969}
1970
1971EAPI Eina_Iterator *
1972evas_object_box_iterator_new(const Evas_Object *o)
1973{
1974 Evas_Object_Box_Iterator *it;
1975
1976 EVAS_OBJECT_BOX_DATA_GET_OR_RETURN_VAL(o, priv, NULL);
1977
1978 if (!priv->children) return NULL;
1979
1980 it = calloc(1, sizeof(Evas_Object_Box_Iterator));
1981 if (!it) return NULL;
1982
1983 EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR);
1984
1985 it->real_iterator = eina_list_iterator_new(priv->children);
1986 it->box = o;
1987
1988 it->iterator.next = FUNC_ITERATOR_NEXT(_evas_object_box_iterator_next);
1989 it->iterator.get_container = FUNC_ITERATOR_GET_CONTAINER(_evas_object_box_iterator_get_container);
1990 it->iterator.free = FUNC_ITERATOR_FREE(_evas_object_box_iterator_free);
1991
1992 return &it->iterator;
1993}
1994
1995EAPI Eina_Accessor *
1996evas_object_box_accessor_new(const Evas_Object *o)
1997{
1998 Evas_Object_Box_Accessor *it;
1999
2000 EVAS_OBJECT_BOX_DATA_GET_OR_RETURN_VAL(o, priv, NULL);
2001
2002 if (!priv->children) return NULL;
2003
2004 it = calloc(1, sizeof(Evas_Object_Box_Accessor));
2005 if (!it) return NULL;
2006
2007 EINA_MAGIC_SET(&it->accessor, EINA_MAGIC_ACCESSOR);
2008
2009 it->real_accessor = eina_list_accessor_new(priv->children);
2010 it->box = o;
2011
2012 it->accessor.get_at = FUNC_ACCESSOR_GET_AT(_evas_object_box_accessor_get_at);
2013 it->accessor.get_container = FUNC_ACCESSOR_GET_CONTAINER(_evas_object_box_accessor_get_container);
2014 it->accessor.free = FUNC_ACCESSOR_FREE(_evas_object_box_accessor_free);
2015
2016 return &it->accessor;
2017}
2018
2019EAPI Eina_List *
2020evas_object_box_children_get(const Evas_Object *o)
2021{
2022 Eina_List *new_list = NULL, *l;
2023 Evas_Object_Box_Option *opt;
2024
2025 EVAS_OBJECT_BOX_DATA_GET_OR_RETURN_VAL(o, priv, NULL);
2026
2027 EINA_LIST_FOREACH(priv->children, l, opt)
2028 new_list = eina_list_append(new_list, opt->obj);
2029
2030 return new_list;
2031}
2032
2033EAPI const char *
2034evas_object_box_option_property_name_get(Evas_Object *o, int property)
2035{
2036 const Evas_Object_Box_Api *api;
2037
2038 EVAS_OBJECT_BOX_DATA_GET_OR_RETURN_VAL(o, priv, NULL);
2039
2040 if (property < 0)
2041 return NULL;
2042
2043 api = priv->api;
2044 if ((!api) || (!api->property_name_get))
2045 return NULL;
2046
2047 return api->property_name_get(o, property);
2048}
2049
2050EAPI int
2051evas_object_box_option_property_id_get(Evas_Object *o, const char *name)
2052{
2053 const Evas_Object_Box_Api *api;
2054
2055 EVAS_OBJECT_BOX_DATA_GET_OR_RETURN_VAL(o, priv, -1);
2056
2057 if (!name)
2058 return -1;
2059
2060 api = priv->api;
2061 if ((!api) || (!api->property_id_get))
2062 return -1;
2063
2064 return api->property_id_get(o, name);
2065}
2066
2067EAPI Eina_Bool
2068evas_object_box_option_property_set(Evas_Object *o, Evas_Object_Box_Option *opt, int property, ...)
2069{
2070 Eina_Bool ret;
2071 va_list args;
2072
2073 va_start(args, property);
2074 ret = evas_object_box_option_property_vset(o, opt, property, args);
2075 va_end(args);
2076
2077 return ret;
2078}
2079
2080
2081EAPI Eina_Bool
2082evas_object_box_option_property_vset(Evas_Object *o, Evas_Object_Box_Option *opt, int property, va_list args)
2083{
2084 const Evas_Object_Box_Api *api;
2085
2086 EVAS_OBJECT_BOX_DATA_GET_OR_RETURN_VAL(o, priv, 0);
2087
2088 if (!opt) return EINA_FALSE;
2089
2090 api = priv->api;
2091 if ((!api) || (!api->property_set))
2092 return EINA_FALSE;
2093
2094 if (!api->property_set(o, opt, property, args))
2095 return EINA_FALSE;
2096
2097 evas_object_smart_changed(o);
2098 return EINA_TRUE;
2099}
2100
2101EAPI Eina_Bool
2102evas_object_box_option_property_get(Evas_Object *o, Evas_Object_Box_Option *opt, int property, ...)
2103{
2104 Eina_Bool ret;
2105 va_list args;
2106
2107 va_start(args, property);
2108 ret = evas_object_box_option_property_vget(o, opt, property, args);
2109 va_end(args);
2110
2111 return ret;
2112}
2113
2114EAPI Eina_Bool
2115evas_object_box_option_property_vget(Evas_Object *o, Evas_Object_Box_Option *opt, int property, va_list args)
2116{
2117 const Evas_Object_Box_Api *api;
2118
2119 EVAS_OBJECT_BOX_DATA_GET_OR_RETURN_VAL(o, priv, 0);
2120
2121 if (!opt) return EINA_FALSE;
2122
2123 api = priv->api;
2124 if ((!api) || (!api->property_get))
2125 return EINA_FALSE;
2126
2127 return api->property_get(o, opt, property, args);
2128}
diff --git a/libraries/evas/src/lib/canvas/evas_object_grid.c b/libraries/evas/src/lib/canvas/evas_object_grid.c
new file mode 100644
index 0000000..ac96f04
--- /dev/null
+++ b/libraries/evas/src/lib/canvas/evas_object_grid.c
@@ -0,0 +1,465 @@
1#include <errno.h>
2#include "evas_common.h"
3
4typedef struct _Evas_Object_Grid_Data Evas_Object_Grid_Data;
5typedef struct _Evas_Object_Grid_Option Evas_Object_Grid_Option;
6typedef struct _Evas_Object_Grid_Iterator Evas_Object_Grid_Iterator;
7typedef struct _Evas_Object_Grid_Accessor Evas_Object_Grid_Accessor;
8
9struct _Evas_Object_Grid_Option
10{
11 Evas_Object *obj;
12 Eina_List *l;
13 int x, y, w, h;
14};
15
16struct _Evas_Object_Grid_Data
17{
18 Evas_Object_Smart_Clipped_Data base;
19 Eina_List *children;
20 struct {
21 int w, h;
22 } size;
23 Eina_Bool is_mirrored : 1;
24};
25
26struct _Evas_Object_Grid_Iterator
27{
28 Eina_Iterator iterator;
29
30 Eina_Iterator *real_iterator;
31 const Evas_Object *grid;
32};
33
34struct _Evas_Object_Grid_Accessor
35{
36 Eina_Accessor accessor;
37
38 Eina_Accessor *real_accessor;
39 const Evas_Object *grid;
40};
41
42#define EVAS_OBJECT_GRID_DATA_GET(o, ptr) \
43 Evas_Object_Grid_Data *ptr = evas_object_smart_data_get(o)
44
45#define EVAS_OBJECT_GRID_DATA_GET_OR_RETURN(o, ptr) \
46 EVAS_OBJECT_GRID_DATA_GET(o, ptr); \
47 if (!ptr) \
48 { \
49 CRIT("no widget data for object %p (%s)", \
50 o, evas_object_type_get(o)); \
51 abort(); \
52 return; \
53 }
54
55#define EVAS_OBJECT_GRID_DATA_GET_OR_RETURN_VAL(o, ptr, val) \
56 EVAS_OBJECT_GRID_DATA_GET(o, ptr); \
57 if (!ptr) \
58 { \
59 CRIT("No widget data for object %p (%s)", \
60 o, evas_object_type_get(o)); \
61 abort(); \
62 return val; \
63 }
64
65static const char EVAS_OBJECT_GRID_OPTION_KEY[] = "|EvGd";
66
67static Eina_Bool
68_evas_object_grid_iterator_next(Evas_Object_Grid_Iterator *it, void **data)
69{
70 Evas_Object_Grid_Option *opt;
71
72 if (!eina_iterator_next(it->real_iterator, (void **)&opt))
73 return EINA_FALSE;
74 if (data) *data = opt->obj;
75 return EINA_TRUE;
76}
77
78static Evas_Object *
79_evas_object_grid_iterator_get_container(Evas_Object_Grid_Iterator *it)
80{
81 return (Evas_Object *)it->grid;
82}
83
84static void
85_evas_object_grid_iterator_free(Evas_Object_Grid_Iterator *it)
86{
87 eina_iterator_free(it->real_iterator);
88 free(it);
89}
90
91static Eina_Bool
92_evas_object_grid_accessor_get_at(Evas_Object_Grid_Accessor *it, unsigned int idx, void **data)
93{
94 Evas_Object_Grid_Option *opt = NULL;
95
96 if (!eina_accessor_data_get(it->real_accessor, idx, (void **)&opt))
97 return EINA_FALSE;
98 if (data) *data = opt->obj;
99 return EINA_TRUE;
100}
101
102static Evas_Object *
103_evas_object_grid_accessor_get_container(Evas_Object_Grid_Accessor *it)
104{
105 return (Evas_Object *)it->grid;
106}
107
108static void
109_evas_object_grid_accessor_free(Evas_Object_Grid_Accessor *it)
110{
111 eina_accessor_free(it->real_accessor);
112 free(it);
113}
114
115static Evas_Object_Grid_Option *
116_evas_object_grid_option_get(Evas_Object *o)
117{
118 return evas_object_data_get(o, EVAS_OBJECT_GRID_OPTION_KEY);
119}
120
121static void
122_evas_object_grid_option_set(Evas_Object *o, const Evas_Object_Grid_Option *opt)
123{
124 evas_object_data_set(o, EVAS_OBJECT_GRID_OPTION_KEY, opt);
125}
126
127static Evas_Object_Grid_Option *
128_evas_object_grid_option_del(Evas_Object *o)
129{
130 return evas_object_data_del(o, EVAS_OBJECT_GRID_OPTION_KEY);
131}
132
133static void
134_on_child_del(void *data, Evas *evas __UNUSED__, Evas_Object *child, void *einfo __UNUSED__)
135{
136 Evas_Object *grid = data;
137 evas_object_grid_unpack(grid, child);
138}
139
140static void
141_evas_object_grid_child_connect(Evas_Object *o, Evas_Object *child)
142{
143 evas_object_event_callback_add
144 (child, EVAS_CALLBACK_DEL, _on_child_del, o);
145}
146
147static void
148_evas_object_grid_child_disconnect(Evas_Object *o, Evas_Object *child)
149{
150 evas_object_event_callback_del_full
151 (child, EVAS_CALLBACK_DEL, _on_child_del, o);
152}
153
154EVAS_SMART_SUBCLASS_NEW("Evas_Object_Grid", _evas_object_grid,
155 Evas_Smart_Class, Evas_Smart_Class,
156 evas_object_smart_clipped_class_get, NULL)
157
158static void
159_evas_object_grid_smart_add(Evas_Object *o)
160{
161 EVAS_SMART_DATA_ALLOC(o, Evas_Object_Grid_Data)
162
163 priv->size.w = 100;
164 priv->size.h = 100;
165
166 _evas_object_grid_parent_sc->add(o);
167}
168
169static void
170_evas_object_grid_smart_del(Evas_Object *o)
171{
172 EVAS_OBJECT_GRID_DATA_GET(o, priv);
173 Eina_List *l;
174
175 l = priv->children;
176 while (l)
177 {
178 Evas_Object_Grid_Option *opt = l->data;
179 _evas_object_grid_child_disconnect(o, opt->obj);
180 _evas_object_grid_option_del(opt->obj);
181 free(opt);
182 l = eina_list_remove_list(l, l);
183 }
184 _evas_object_grid_parent_sc->del(o);
185}
186
187static void
188_evas_object_grid_smart_resize(Evas_Object *o, Evas_Coord w, Evas_Coord h)
189{
190 Evas_Coord ow, oh;
191 evas_object_geometry_get(o, NULL, NULL, &ow, &oh);
192 if ((ow == w) && (oh == h)) return;
193 evas_object_smart_changed(o);
194}
195
196static void
197_evas_object_grid_smart_calculate(Evas_Object *o)
198{
199 Eina_List *l;
200 Evas_Object_Grid_Option *opt;
201 Evas_Coord x, y, w, h, vw, vh, t;
202 Eina_Bool mirror;
203
204 EVAS_OBJECT_GRID_DATA_GET_OR_RETURN(o, priv);
205 if (!priv) return;
206 if (!priv->children) return;
207 evas_object_geometry_get(o, &x, &y, &w, &h);
208 mirror = priv->is_mirrored;
209 vw = priv->size.w;
210 vh = priv->size.h;
211 EINA_LIST_FOREACH(priv->children, l, opt)
212 {
213 Evas_Coord x1, y1, x2, y2;
214
215 x1 = x + ((w * opt->x) / vw);
216 y1 = y + ((h * opt->y) / vh);
217 x2 = x + ((w * (opt->x + opt->w)) / vw);
218 y2 = y + ((h * (opt->y + opt->h)) / vh);
219 if (mirror)
220 {
221 t = x1; x1 = x2; x2 = t;
222 t = y1; y1 = y2; y2 = t;
223 }
224 evas_object_move(opt->obj, x1, y1);
225 evas_object_resize(opt->obj, x2 - x1, y2 - y1);
226 }
227}
228
229static void
230_evas_object_grid_smart_set_user(Evas_Smart_Class *sc)
231{
232 sc->add = _evas_object_grid_smart_add;
233 sc->del = _evas_object_grid_smart_del;
234 sc->resize = _evas_object_grid_smart_resize;
235 sc->calculate = _evas_object_grid_smart_calculate;
236}
237
238EAPI Evas_Object *
239evas_object_grid_add(Evas *evas)
240{
241 return evas_object_smart_add(evas, _evas_object_grid_smart_class_new());
242}
243
244EAPI Evas_Object *
245evas_object_grid_add_to(Evas_Object *parent)
246{
247 Evas *evas;
248 Evas_Object *o;
249
250 evas = evas_object_evas_get(parent);
251 o = evas_object_grid_add(evas);
252 evas_object_smart_member_add(o, parent);
253 return o;
254}
255
256EAPI void
257evas_object_grid_size_set(Evas_Object *o, int w, int h)
258{
259 EVAS_OBJECT_GRID_DATA_GET_OR_RETURN(o, priv);
260 if ((priv->size.w == w) && (priv->size.h == h)) return;
261 priv->size.w = w;
262 priv->size.h = h;
263 evas_object_smart_changed(o);
264}
265
266EAPI void
267evas_object_grid_size_get(const Evas_Object *o, int *w, int *h)
268{
269 if (w) *w = 0;
270 if (h) *h = 0;
271 EVAS_OBJECT_GRID_DATA_GET_OR_RETURN(o, priv);
272 if (w) *w = priv->size.w;
273 if (h) *h = priv->size.h;
274}
275
276EAPI Eina_Bool
277evas_object_grid_pack(Evas_Object *o, Evas_Object *child, int x, int y, int w, int h)
278{
279 Evas_Object_Grid_Option *opt;
280 Eina_Bool newobj = EINA_FALSE;
281
282 EVAS_OBJECT_GRID_DATA_GET_OR_RETURN_VAL(o, priv, 0);
283
284 opt = _evas_object_grid_option_get(child);
285 if (!opt)
286 {
287 opt = malloc(sizeof(*opt));
288 if (!opt)
289 {
290 ERR("could not allocate grid option data.");
291 return EINA_FALSE;
292 }
293 newobj = EINA_TRUE;
294 }
295
296 opt->x = x;
297 opt->y = y;
298 opt->w = w;
299 opt->h = h;
300
301 if (newobj)
302 {
303 opt->obj = child;
304 priv->children = eina_list_append(priv->children, opt);
305 opt->l = eina_list_last(priv->children);
306 _evas_object_grid_option_set(child, opt);
307 evas_object_smart_member_add(child, o);
308 _evas_object_grid_child_connect(o, child);
309 }
310 // FIXME: we could keep a changed list
311 evas_object_smart_changed(o);
312 return EINA_TRUE;
313}
314
315static void
316_evas_object_grid_remove_opt(Evas_Object_Grid_Data *priv, Evas_Object_Grid_Option *opt)
317{
318 priv->children = eina_list_remove_list(priv->children, opt->l);
319 opt->l = NULL;
320}
321
322EAPI Eina_Bool
323evas_object_grid_unpack(Evas_Object *o, Evas_Object *child)
324{
325 Evas_Object_Grid_Option *opt;
326
327 EVAS_OBJECT_GRID_DATA_GET_OR_RETURN_VAL(o, priv, 0);
328
329 if (o != evas_object_smart_parent_get(child))
330 {
331 ERR("cannot unpack child from incorrect grid!");
332 return EINA_FALSE;
333 }
334
335 opt = _evas_object_grid_option_del(child);
336 if (!opt)
337 {
338 ERR("cannot unpack child with no packing option!");
339 return EINA_FALSE;
340 }
341
342 _evas_object_grid_child_disconnect(o, child);
343 _evas_object_grid_remove_opt(priv, opt);
344 evas_object_smart_member_del(child);
345 free(opt);
346 return EINA_TRUE;
347}
348
349EAPI void
350evas_object_grid_clear(Evas_Object *o, Eina_Bool clear)
351{
352 Evas_Object_Grid_Option *opt;
353
354 EVAS_OBJECT_GRID_DATA_GET_OR_RETURN(o, priv);
355
356 EINA_LIST_FREE(priv->children, opt)
357 {
358 _evas_object_grid_child_disconnect(o, opt->obj);
359 _evas_object_grid_option_del(opt->obj);
360 evas_object_smart_member_del(opt->obj);
361 if (clear)
362 evas_object_del(opt->obj);
363 free(opt);
364 }
365}
366
367EAPI Eina_Bool
368evas_object_grid_pack_get(Evas_Object *o, Evas_Object *child, int *x, int *y, int *w, int *h)
369{
370 Evas_Object_Grid_Option *opt;
371
372 if (x) *x = 0;
373 if (y) *y = 0;
374 if (w) *w = 0;
375 if (h) *h = 0;
376 EVAS_OBJECT_GRID_DATA_GET_OR_RETURN_VAL(o, priv, 0);
377 opt = _evas_object_grid_option_get(child);
378 if (!opt) return 0;
379 if (x) *x = opt->x;
380 if (y) *y = opt->y;
381 if (w) *w = opt->w;
382 if (h) *h = opt->h;
383 return 1;
384}
385
386EAPI Eina_Iterator *
387evas_object_grid_iterator_new(const Evas_Object *o)
388{
389 Evas_Object_Grid_Iterator *it;
390
391 EVAS_OBJECT_GRID_DATA_GET_OR_RETURN_VAL(o, priv, NULL);
392
393 if (!priv->children) return NULL;
394
395 it = calloc(1, sizeof(Evas_Object_Grid_Iterator));
396 if (!it) return NULL;
397
398 EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR);
399
400 it->real_iterator = eina_list_iterator_new(priv->children);
401 it->grid = o;
402
403 it->iterator.next = FUNC_ITERATOR_NEXT(_evas_object_grid_iterator_next);
404 it->iterator.get_container = FUNC_ITERATOR_GET_CONTAINER(_evas_object_grid_iterator_get_container);
405 it->iterator.free = FUNC_ITERATOR_FREE(_evas_object_grid_iterator_free);
406
407 return &it->iterator;
408}
409
410EAPI Eina_Accessor *
411evas_object_grid_accessor_new(const Evas_Object *o)
412{
413 Evas_Object_Grid_Accessor *it;
414
415 EVAS_OBJECT_GRID_DATA_GET_OR_RETURN_VAL(o, priv, NULL);
416
417 if (!priv->children) return NULL;
418
419 it = calloc(1, sizeof(Evas_Object_Grid_Accessor));
420 if (!it) return NULL;
421
422 EINA_MAGIC_SET(&it->accessor, EINA_MAGIC_ACCESSOR);
423
424 it->real_accessor = eina_list_accessor_new(priv->children);
425 it->grid = o;
426
427 it->accessor.get_at = FUNC_ACCESSOR_GET_AT(_evas_object_grid_accessor_get_at);
428 it->accessor.get_container = FUNC_ACCESSOR_GET_CONTAINER(_evas_object_grid_accessor_get_container);
429 it->accessor.free = FUNC_ACCESSOR_FREE(_evas_object_grid_accessor_free);
430
431 return &it->accessor;
432}
433
434EAPI Eina_List *
435evas_object_grid_children_get(const Evas_Object *o)
436{
437 Eina_List *new_list = NULL, *l;
438 Evas_Object_Grid_Option *opt;
439
440 EVAS_OBJECT_GRID_DATA_GET_OR_RETURN_VAL(o, priv, NULL);
441
442 EINA_LIST_FOREACH(priv->children, l, opt)
443 new_list = eina_list_append(new_list, opt->obj);
444
445 return new_list;
446}
447
448EAPI Eina_Bool
449evas_object_grid_mirrored_get(const Evas_Object *obj)
450{
451 EVAS_OBJECT_GRID_DATA_GET_OR_RETURN_VAL(obj, priv, EINA_FALSE);
452 return priv->is_mirrored;
453}
454
455EAPI void
456evas_object_grid_mirrored_set(Evas_Object *obj, Eina_Bool mirrored)
457{
458 EVAS_OBJECT_GRID_DATA_GET_OR_RETURN(obj, priv);
459 mirrored = !!mirrored;
460 if (priv->is_mirrored != mirrored)
461 {
462 priv->is_mirrored = mirrored;
463 _evas_object_grid_smart_calculate(obj);
464 }
465}
diff --git a/libraries/evas/src/lib/canvas/evas_object_image.c b/libraries/evas/src/lib/canvas/evas_object_image.c
new file mode 100644
index 0000000..7f757a6
--- /dev/null
+++ b/libraries/evas/src/lib/canvas/evas_object_image.c
@@ -0,0 +1,3895 @@
1#include <sys/types.h>
2#include <unistd.h>
3#include <stdlib.h>
4#include <sys/mman.h>
5#include <math.h>
6
7#include "evas_common.h"
8#include "evas_private.h"
9#include "../engines/common/evas_convert_color.h"
10#include "../engines/common/evas_convert_colorspace.h"
11#include "../engines/common/evas_convert_yuv.h"
12
13#define VERBOSE_PROXY_ERROR 1
14
15/* private magic number for image objects */
16static const char o_type[] = "image";
17
18/* private struct for rectangle object internal data */
19typedef struct _Evas_Object_Image Evas_Object_Image;
20
21struct _Evas_Object_Image
22{
23 DATA32 magic;
24
25 struct {
26 int spread;
27 Evas_Coord_Rectangle fill;
28 struct {
29 short w, h, stride;
30 } image;
31 struct {
32 short l, r, t, b;
33 unsigned char fill;
34 double scale;
35 } border;
36
37 Evas_Object *source;
38 Evas_Map *defmap;
39 const char *file;
40 const char *key;
41 int frame;
42 Evas_Colorspace cspace;
43
44 unsigned char smooth_scale : 1;
45 unsigned char has_alpha :1;
46 unsigned char opaque :1;
47 unsigned char opaque_valid :1;
48 } cur, prev;
49
50 int pixels_checked_out;
51 int load_error;
52 Eina_List *pixel_updates;
53
54 struct {
55 unsigned char scale_down_by;
56 double dpi;
57 short w, h;
58 struct {
59 short x, y, w, h;
60 } region;
61 Eina_Bool orientation : 1;
62 } load_opts;
63
64 struct {
65 Evas_Object_Image_Pixels_Get_Cb get_pixels;
66 void *get_pixels_data;
67 } func;
68
69 Evas_Video_Surface video;
70
71 const char *tmpf;
72 int tmpf_fd;
73
74 Evas_Image_Scale_Hint scale_hint;
75 Evas_Image_Content_Hint content_hint;
76
77 void *engine_data;
78
79 unsigned char changed : 1;
80 unsigned char dirty_pixels : 1;
81 unsigned char filled : 1;
82 unsigned char proxyrendering : 1;
83 unsigned char preloading : 1;
84 unsigned char video_rendering : 1;
85 unsigned char video_surface : 1;
86 unsigned char video_visible : 1;
87 unsigned char created : 1;
88};
89
90/* private methods for image objects */
91static void evas_object_image_unload(Evas_Object *obj, Eina_Bool dirty);
92static void evas_object_image_load(Evas_Object *obj);
93static Evas_Coord evas_object_image_figure_x_fill(Evas_Object *obj, Evas_Coord start, Evas_Coord size, Evas_Coord *size_ret);
94static Evas_Coord evas_object_image_figure_y_fill(Evas_Object *obj, Evas_Coord start, Evas_Coord size, Evas_Coord *size_ret);
95
96static void evas_object_image_init(Evas_Object *obj);
97static void *evas_object_image_new(void);
98static void evas_object_image_render(Evas_Object *obj, void *output, void *context, void *surface, int x, int y);
99static void evas_object_image_free(Evas_Object *obj);
100static void evas_object_image_render_pre(Evas_Object *obj);
101static void evas_object_image_render_post(Evas_Object *obj);
102
103static unsigned int evas_object_image_id_get(Evas_Object *obj);
104static unsigned int evas_object_image_visual_id_get(Evas_Object *obj);
105static void *evas_object_image_engine_data_get(Evas_Object *obj);
106
107static int evas_object_image_is_opaque(Evas_Object *obj);
108static int evas_object_image_was_opaque(Evas_Object *obj);
109static int evas_object_image_is_inside(Evas_Object *obj, Evas_Coord x, Evas_Coord y);
110static int evas_object_image_has_opaque_rect(Evas_Object *obj);
111static int evas_object_image_get_opaque_rect(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h);
112static int evas_object_image_can_map(Evas_Object *obj);
113
114static void *evas_object_image_data_convert_internal(Evas_Object_Image *o, void *data, Evas_Colorspace to_cspace);
115static void evas_object_image_filled_resize_listener(void *data, Evas *e, Evas_Object *obj, void *einfo);
116
117static void _proxy_unset(Evas_Object *proxy);
118static void _proxy_set(Evas_Object *proxy, Evas_Object *src);
119static void _proxy_error(Evas_Object *proxy, void *context, void *output, void *surface, int x, int y);
120
121static void _cleanup_tmpf(Evas_Object *obj);
122
123static const Evas_Object_Func object_func =
124{
125 /* methods (compulsory) */
126 evas_object_image_free,
127 evas_object_image_render,
128 evas_object_image_render_pre,
129 evas_object_image_render_post,
130 evas_object_image_id_get,
131 evas_object_image_visual_id_get,
132 evas_object_image_engine_data_get,
133 /* these are optional. NULL = nothing */
134 NULL,
135 NULL,
136 NULL,
137 NULL,
138 evas_object_image_is_opaque,
139 evas_object_image_was_opaque,
140 evas_object_image_is_inside,
141 NULL,
142 NULL,
143 NULL,
144 evas_object_image_has_opaque_rect,
145 evas_object_image_get_opaque_rect,
146 evas_object_image_can_map
147};
148
149EVAS_MEMPOOL(_mp_obj);
150
151static void
152_evas_object_image_cleanup(Evas_Object *obj, Evas_Object_Image *o)
153{
154 if ((o->preloading) && (o->engine_data))
155 {
156 o->preloading = 0;
157 obj->layer->evas->engine.func->image_data_preload_cancel(obj->layer->evas->engine.data.output,
158 o->engine_data,
159 obj);
160 }
161 if (o->tmpf) _cleanup_tmpf(obj);
162 if (o->cur.source) _proxy_unset(obj);
163}
164
165EAPI Evas_Object *
166evas_object_image_add(Evas *e)
167{
168 Evas_Object *obj;
169 Evas_Object_Image *o;
170
171 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
172 return NULL;
173 MAGIC_CHECK_END();
174 obj = evas_object_new(e);
175 evas_object_image_init(obj);
176 evas_object_inject(obj, e);
177 o = (Evas_Object_Image *)(obj->object_data);
178 o->cur.cspace = obj->layer->evas->engine.func->image_colorspace_get(obj->layer->evas->engine.data.output,
179 o->engine_data);
180 return obj;
181}
182
183EAPI Evas_Object *
184evas_object_image_filled_add(Evas *e)
185{
186 Evas_Object *obj;
187 obj = evas_object_image_add(e);
188 evas_object_image_filled_set(obj, 1);
189 return obj;
190}
191
192static void
193_cleanup_tmpf(Evas_Object *obj)
194{
195 Evas_Object_Image *o;
196
197 o = (Evas_Object_Image *)(obj->object_data);
198 if (!o->tmpf) return;
199#ifdef __linux__
200#else
201 unlink(o->tmpf);
202#endif
203 if (o->tmpf_fd >= 0) close(o->tmpf_fd);
204 eina_stringshare_del(o->tmpf);
205 o->tmpf_fd = -1;
206 o->tmpf = NULL;
207}
208
209static void
210_create_tmpf(Evas_Object *obj, void *data, int size, char *format __UNUSED__)
211{
212 Evas_Object_Image *o;
213 char buf[4096];
214 void *dst;
215 int fd = -1;
216
217 o = (Evas_Object_Image *)(obj->object_data);
218#ifdef __linux__
219 snprintf(buf, sizeof(buf), "/dev/shm/.evas-tmpf-%i-%p-%i-XXXXXX",
220 (int)getpid(), data, (int)size);
221 fd = mkstemp(buf);
222#endif
223 if (fd < 0)
224 {
225 snprintf(buf, sizeof(buf), "/tmp/.evas-tmpf-%i-%p-%i-XXXXXX",
226 (int)getpid(), data, (int)size);
227 fd = mkstemp(buf);
228 }
229 if (fd < 0) return;
230 if (ftruncate(fd, size) < 0)
231 {
232 unlink(buf);
233 close(fd);
234 return;
235 }
236 unlink(buf);
237
238 eina_mmap_safety_enabled_set(EINA_TRUE);
239
240 dst = mmap(NULL, size,
241 PROT_READ | PROT_WRITE,
242 MAP_SHARED,
243 fd, 0);
244 if (dst == MAP_FAILED)
245 {
246 close(fd);
247 return;
248 }
249 o->tmpf_fd = fd;
250#ifdef __linux__
251 snprintf(buf, sizeof(buf), "/proc/%li/fd/%i", (long)getpid(), fd);
252#endif
253 o->tmpf = eina_stringshare_add(buf);
254 memcpy(dst, data, size);
255 munmap(dst, size);
256}
257
258EAPI void
259evas_object_image_memfile_set(Evas_Object *obj, void *data, int size, char *format, char *key)
260{
261 Evas_Object_Image *o;
262
263 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
264 return;
265 MAGIC_CHECK_END();
266 o = (Evas_Object_Image *)(obj->object_data);
267 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
268 return;
269 MAGIC_CHECK_END();
270 _cleanup_tmpf(obj);
271 evas_object_image_file_set(obj, NULL, NULL);
272 // invalidate the cache effectively
273 evas_object_image_alpha_set(obj, !o->cur.has_alpha);
274 evas_object_image_alpha_set(obj, !o->cur.has_alpha);
275
276 if ((size < 1) || (!data)) return;
277
278 _create_tmpf(obj, data, size, format);
279 evas_object_image_file_set(obj, o->tmpf, key);
280 if (!o->engine_data)
281 {
282 ERR("unable to load '%s' from memory", o->tmpf);
283 _cleanup_tmpf(obj);
284 return;
285 }
286}
287
288EAPI void
289evas_object_image_file_set(Evas_Object *obj, const char *file, const char *key)
290{
291 Evas_Object_Image *o;
292 Evas_Image_Load_Opts lo;
293
294 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
295 return;
296 MAGIC_CHECK_END();
297 o = (Evas_Object_Image *)(obj->object_data);
298 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
299 return;
300 MAGIC_CHECK_END();
301 if ((o->tmpf) && (file != o->tmpf)) _cleanup_tmpf(obj);
302 if ((o->cur.file) && (file) && (!strcmp(o->cur.file, file)))
303 {
304 if ((!o->cur.key) && (!key))
305 return;
306 if ((o->cur.key) && (key) && (!strcmp(o->cur.key, key)))
307 return;
308 }
309/*
310 * WTF? why cancel a null image preload? this is just silly (tm)
311 if (!o->engine_data)
312 obj->layer->evas->engine.func->image_data_preload_cancel(obj->layer->evas->engine.data.output,
313 o->engine_data,
314 obj);
315 */
316 if (o->cur.source) _proxy_unset(obj);
317 if (o->cur.file) eina_stringshare_del(o->cur.file);
318 if (o->cur.key) eina_stringshare_del(o->cur.key);
319 if (file) o->cur.file = eina_stringshare_add(file);
320 else o->cur.file = NULL;
321 if (key) o->cur.key = eina_stringshare_add(key);
322 else o->cur.key = NULL;
323 o->prev.file = NULL;
324 o->prev.key = NULL;
325 if (o->engine_data)
326 {
327 if (o->preloading)
328 {
329 o->preloading = 0;
330 obj->layer->evas->engine.func->image_data_preload_cancel(obj->layer->evas->engine.data.output,
331 o->engine_data,
332 obj);
333 }
334 obj->layer->evas->engine.func->image_free(obj->layer->evas->engine.data.output,
335 o->engine_data);
336 }
337 o->load_error = EVAS_LOAD_ERROR_NONE;
338 lo.scale_down_by = o->load_opts.scale_down_by;
339 lo.dpi = o->load_opts.dpi;
340 lo.w = o->load_opts.w;
341 lo.h = o->load_opts.h;
342 lo.region.x = o->load_opts.region.x;
343 lo.region.y = o->load_opts.region.y;
344 lo.region.w = o->load_opts.region.w;
345 lo.region.h = o->load_opts.region.h;
346 lo.orientation = o->load_opts.orientation;
347 o->engine_data = obj->layer->evas->engine.func->image_load(obj->layer->evas->engine.data.output,
348 o->cur.file,
349 o->cur.key,
350 &o->load_error,
351 &lo);
352 if (o->engine_data)
353 {
354 int w, h;
355 int stride;
356
357 obj->layer->evas->engine.func->image_size_get(obj->layer->evas->engine.data.output,
358 o->engine_data, &w, &h);
359 if (obj->layer->evas->engine.func->image_stride_get)
360 obj->layer->evas->engine.func->image_stride_get(obj->layer->evas->engine.data.output,
361 o->engine_data, &stride);
362 else
363 stride = w * 4;
364 o->cur.has_alpha = obj->layer->evas->engine.func->image_alpha_get(obj->layer->evas->engine.data.output,
365 o->engine_data);
366 o->cur.cspace = obj->layer->evas->engine.func->image_colorspace_get(obj->layer->evas->engine.data.output,
367 o->engine_data);
368 o->cur.image.w = w;
369 o->cur.image.h = h;
370 o->cur.image.stride = stride;
371 }
372 else
373 {
374 if (o->load_error == EVAS_LOAD_ERROR_NONE)
375 o->load_error = EVAS_LOAD_ERROR_GENERIC;
376 o->cur.has_alpha = 1;
377 o->cur.cspace = EVAS_COLORSPACE_ARGB8888;
378 o->cur.image.w = 0;
379 o->cur.image.h = 0;
380 o->cur.image.stride = 0;
381 }
382 o->changed = 1;
383 evas_object_change(obj);
384}
385
386EAPI void
387evas_object_image_file_get(const Evas_Object *obj, const char **file, const char **key)
388{
389 Evas_Object_Image *o;
390
391 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
392 if (file) *file = NULL;
393 if (key) *key = NULL;
394 return;
395 MAGIC_CHECK_END();
396 o = (Evas_Object_Image *)(obj->object_data);
397 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
398 if (file) *file = NULL;
399 if (key) *key = NULL;
400 return;
401 MAGIC_CHECK_END();
402 if (file) *file = o->cur.file;
403 if (key) *key = o->cur.key;
404}
405
406EAPI Eina_Bool
407evas_object_image_source_set(Evas_Object *obj, Evas_Object *src)
408{
409 Evas_Object_Image *o;
410
411 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
412 return EINA_FALSE;
413 MAGIC_CHECK_END();
414 o = obj->object_data;
415 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
416 return EINA_FALSE;
417 MAGIC_CHECK_END();
418
419 if (src == obj) return EINA_FALSE;
420 if (o->cur.source == src) return EINA_TRUE;
421
422 _evas_object_image_cleanup(obj, o);
423 /* Kill the image if any */
424 if (o->cur.file || o->cur.key)
425 evas_object_image_file_set(obj, NULL, NULL);
426
427 if (src)
428 {
429 _proxy_set(obj, src);
430 }
431
432 return EINA_TRUE;
433}
434
435
436EAPI Evas_Object *
437evas_object_image_source_get(Evas_Object *obj)
438{
439 Evas_Object_Image *o;
440
441 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
442 return NULL;
443 MAGIC_CHECK_END();
444 o = obj->object_data;
445 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
446 return NULL;
447 MAGIC_CHECK_END();
448
449 return o->cur.source;
450}
451
452EAPI Eina_Bool
453evas_object_image_source_unset(Evas_Object *obj)
454{
455 return evas_object_image_source_set(obj, NULL);
456}
457
458EAPI void
459evas_object_image_border_set(Evas_Object *obj, int l, int r, int t, int b)
460{
461 Evas_Object_Image *o;
462
463 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
464 return;
465 MAGIC_CHECK_END();
466 o = (Evas_Object_Image *)(obj->object_data);
467 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
468 return;
469 MAGIC_CHECK_END();
470 if (l < 0) l = 0;
471 if (r < 0) r = 0;
472 if (t < 0) t = 0;
473 if (b < 0) b = 0;
474 if ((o->cur.border.l == l) &&
475 (o->cur.border.r == r) &&
476 (o->cur.border.t == t) &&
477 (o->cur.border.b == b)) return;
478 o->cur.border.l = l;
479 o->cur.border.r = r;
480 o->cur.border.t = t;
481 o->cur.border.b = b;
482 o->cur.opaque_valid = 0;
483 o->changed = 1;
484 evas_object_change(obj);
485}
486
487EAPI void
488evas_object_image_border_get(const Evas_Object *obj, int *l, int *r, int *t, int *b)
489{
490 Evas_Object_Image *o;
491
492 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
493 if (l) *l = 0;
494 if (r) *r = 0;
495 if (t) *t = 0;
496 if (b) *b = 0;
497 return;
498 MAGIC_CHECK_END();
499 o = (Evas_Object_Image *)(obj->object_data);
500 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
501 if (l) *l = 0;
502 if (r) *r = 0;
503 if (t) *t = 0;
504 if (b) *b = 0;
505 return;
506 MAGIC_CHECK_END();
507 if (l) *l = o->cur.border.l;
508 if (r) *r = o->cur.border.r;
509 if (t) *t = o->cur.border.t;
510 if (b) *b = o->cur.border.b;
511}
512
513EAPI void
514evas_object_image_border_center_fill_set(Evas_Object *obj, Evas_Border_Fill_Mode fill)
515{
516 Evas_Object_Image *o;
517
518 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
519 return;
520 MAGIC_CHECK_END();
521 o = (Evas_Object_Image *)(obj->object_data);
522 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
523 return;
524 MAGIC_CHECK_END();
525 if (fill == o->cur.border.fill) return;
526 o->cur.border.fill = fill;
527 o->changed = 1;
528 evas_object_change(obj);
529}
530
531EAPI Evas_Border_Fill_Mode
532evas_object_image_border_center_fill_get(const Evas_Object *obj)
533{
534 Evas_Object_Image *o;
535
536 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
537 return 0;
538 MAGIC_CHECK_END();
539 o = (Evas_Object_Image *)(obj->object_data);
540 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
541 return 0;
542 MAGIC_CHECK_END();
543 return o->cur.border.fill;
544}
545
546EAPI void
547evas_object_image_filled_set(Evas_Object *obj, Eina_Bool setting)
548{
549 Evas_Object_Image *o;
550
551 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
552 return;
553 MAGIC_CHECK_END();
554 o = (Evas_Object_Image *)(obj->object_data);
555 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
556 return;
557 MAGIC_CHECK_END();
558
559 setting = !!setting;
560 if (o->filled == setting) return;
561
562 o->filled = setting;
563 if (!o->filled)
564 evas_object_event_callback_del(obj, EVAS_CALLBACK_RESIZE, evas_object_image_filled_resize_listener);
565 else
566 {
567 Evas_Coord w, h;
568
569 evas_object_geometry_get(obj, NULL, NULL, &w, &h);
570 evas_object_image_fill_set(obj, 0, 0, w, h);
571
572 evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, evas_object_image_filled_resize_listener, NULL);
573 }
574}
575
576EAPI Eina_Bool
577evas_object_image_filled_get(const Evas_Object *obj)
578{
579 Evas_Object_Image *o;
580
581 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
582 return 0;
583 MAGIC_CHECK_END();
584 o = (Evas_Object_Image *)(obj->object_data);
585 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
586 return 0;
587 MAGIC_CHECK_END();
588
589 return o->filled;
590}
591
592EAPI void
593evas_object_image_border_scale_set(Evas_Object *obj, double scale)
594{
595 Evas_Object_Image *o;
596
597 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
598 return;
599 MAGIC_CHECK_END();
600 o = (Evas_Object_Image *)(obj->object_data);
601 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
602 return;
603 MAGIC_CHECK_END();
604 if (scale == o->cur.border.scale) return;
605 o->cur.border.scale = scale;
606 o->changed = 1;
607 evas_object_change(obj);
608}
609
610EAPI double
611evas_object_image_border_scale_get(const Evas_Object *obj)
612{
613 Evas_Object_Image *o;
614
615 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
616 return 1.0;
617 MAGIC_CHECK_END();
618 o = (Evas_Object_Image *)(obj->object_data);
619 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
620 return 1.0;
621 MAGIC_CHECK_END();
622 return o->cur.border.scale;
623}
624
625EAPI void
626evas_object_image_fill_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h)
627{
628 Evas_Object_Image *o;
629
630 if (w < 0) w = -w;
631 if (h < 0) h = -h;
632 if (w == 0) return;
633 if (h == 0) return;
634 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
635 return;
636 MAGIC_CHECK_END();
637 o = (Evas_Object_Image *)(obj->object_data);
638 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
639 return;
640 MAGIC_CHECK_END();
641 if ((o->cur.fill.x == x) &&
642 (o->cur.fill.y == y) &&
643 (o->cur.fill.w == w) &&
644 (o->cur.fill.h == h)) return;
645 o->cur.fill.x = x;
646 o->cur.fill.y = y;
647 o->cur.fill.w = w;
648 o->cur.fill.h = h;
649 o->cur.opaque_valid = 0;
650 o->changed = 1;
651 evas_object_change(obj);
652}
653
654EAPI void
655evas_object_image_fill_get(const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
656{
657 Evas_Object_Image *o;
658
659 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
660 if (x) *x = 0;
661 if (y) *y = 0;
662 if (w) *w = 0;
663 if (h) *h = 0;
664 return;
665 MAGIC_CHECK_END();
666 o = (Evas_Object_Image *)(obj->object_data);
667 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
668 if (x) *x = 0;
669 if (y) *y = 0;
670 if (w) *w = 0;
671 if (h) *h = 0;
672 return;
673 MAGIC_CHECK_END();
674 if (x) *x = o->cur.fill.x;
675 if (y) *y = o->cur.fill.y;
676 if (w) *w = o->cur.fill.w;
677 if (h) *h = o->cur.fill.h;
678}
679
680
681EAPI void
682evas_object_image_fill_spread_set(Evas_Object *obj, Evas_Fill_Spread spread)
683{
684 Evas_Object_Image *o;
685
686 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
687 return;
688 MAGIC_CHECK_END();
689 o = (Evas_Object_Image *)(obj->object_data);
690 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
691 return;
692 MAGIC_CHECK_END();
693 if (spread == (Evas_Fill_Spread)o->cur.spread) return;
694 o->cur.spread = spread;
695 o->changed = 1;
696 evas_object_change(obj);
697}
698
699EAPI Evas_Fill_Spread
700evas_object_image_fill_spread_get(const Evas_Object *obj)
701{
702 Evas_Object_Image *o;
703
704 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
705 return EVAS_TEXTURE_REPEAT;
706 MAGIC_CHECK_END();
707 o = (Evas_Object_Image *)(obj->object_data);
708 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
709 return EVAS_TEXTURE_REPEAT;
710 MAGIC_CHECK_END();
711 return (Evas_Fill_Spread)o->cur.spread;
712}
713
714EAPI void
715evas_object_image_size_set(Evas_Object *obj, int w, int h)
716{
717 Evas_Object_Image *o;
718 int stride = 0;
719
720 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
721 return;
722 MAGIC_CHECK_END();
723 o = (Evas_Object_Image *)(obj->object_data);
724 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
725 return;
726 MAGIC_CHECK_END();
727 _evas_object_image_cleanup(obj, o);
728 if (w < 1) w = 1;
729 if (h < 1) h = 1;
730 if (w > 32768) return;
731 if (h > 32768) return;
732 if ((w == o->cur.image.w) &&
733 (h == o->cur.image.h)) return;
734 o->cur.image.w = w;
735 o->cur.image.h = h;
736 if (o->engine_data)
737 o->engine_data = obj->layer->evas->engine.func->image_size_set(obj->layer->evas->engine.data.output,
738 o->engine_data,
739 w, h);
740 else
741 o->engine_data = obj->layer->evas->engine.func->image_new_from_copied_data
742 (obj->layer->evas->engine.data.output, w, h, NULL, o->cur.has_alpha,
743 o->cur.cspace);
744
745 if (o->engine_data)
746 {
747 if (obj->layer->evas->engine.func->image_scale_hint_set)
748 obj->layer->evas->engine.func->image_scale_hint_set
749 (obj->layer->evas->engine.data.output,
750 o->engine_data, o->scale_hint);
751 if (obj->layer->evas->engine.func->image_content_hint_set)
752 obj->layer->evas->engine.func->image_content_hint_set
753 (obj->layer->evas->engine.data.output,
754 o->engine_data, o->content_hint);
755 if (obj->layer->evas->engine.func->image_stride_get)
756 obj->layer->evas->engine.func->image_stride_get
757 (obj->layer->evas->engine.data.output,
758 o->engine_data, &stride);
759 else
760 stride = w * 4;
761 }
762 else
763 stride = w * 4;
764 o->cur.image.stride = stride;
765
766/* FIXME - in engine call above
767 if (o->engine_data)
768 o->engine_data = obj->layer->evas->engine.func->image_alpha_set(obj->layer->evas->engine.data.output,
769 o->engine_data,
770 o->cur.has_alpha);
771*/
772 EVAS_OBJECT_IMAGE_FREE_FILE_AND_KEY(o);
773 o->changed = 1;
774 evas_object_change(obj);
775}
776
777EAPI void
778evas_object_image_size_get(const Evas_Object *obj, int *w, int *h)
779{
780 Evas_Object_Image *o;
781
782 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
783 if (w) *w = 0;
784 if (h) *h = 0;
785 return;
786 MAGIC_CHECK_END();
787 o = (Evas_Object_Image *)(obj->object_data);
788 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
789 if (w) *w = 0;
790 if (h) *h = 0;
791 return;
792 MAGIC_CHECK_END();
793 if (w) *w = o->cur.image.w;
794 if (h) *h = o->cur.image.h;
795}
796
797EAPI int
798evas_object_image_stride_get(const Evas_Object *obj)
799{
800 Evas_Object_Image *o;
801
802 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
803 return 0;
804 MAGIC_CHECK_END();
805 o = (Evas_Object_Image *)(obj->object_data);
806 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
807 return 0;
808 MAGIC_CHECK_END();
809 return o->cur.image.stride;
810}
811
812EAPI Evas_Load_Error
813evas_object_image_load_error_get(const Evas_Object *obj)
814{
815 Evas_Object_Image *o;
816
817 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
818 return 0;
819 MAGIC_CHECK_END();
820 o = (Evas_Object_Image *)(obj->object_data);
821 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
822 return 0;
823 MAGIC_CHECK_END();
824 return o->load_error;
825}
826
827EAPI void *
828evas_object_image_data_convert(Evas_Object *obj, Evas_Colorspace to_cspace)
829{
830 Evas_Object_Image *o;
831 DATA32 *data;
832
833 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
834 return NULL;
835 MAGIC_CHECK_END();
836 o = (Evas_Object_Image *)(obj->object_data);
837 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
838 return NULL;
839 MAGIC_CHECK_END();
840 if ((o->preloading) && (o->engine_data))
841 {
842 o->preloading = 0;
843 obj->layer->evas->engine.func->image_data_preload_cancel(obj->layer->evas->engine.data.output,
844 o->engine_data,
845 obj);
846 }
847 if (!o->engine_data) return NULL;
848 if (o->video_surface)
849 o->video.update_pixels(o->video.data, obj, &o->video);
850 if (o->cur.cspace == to_cspace) return NULL;
851 data = NULL;
852 o->engine_data = obj->layer->evas->engine.func->image_data_get(obj->layer->evas->engine.data.output,
853 o->engine_data,
854 0,
855 &data,
856 &o->load_error);
857 return evas_object_image_data_convert_internal(o, data, to_cspace);
858}
859
860EAPI void
861evas_object_image_data_set(Evas_Object *obj, void *data)
862{
863 Evas_Object_Image *o;
864 void *p_data;
865
866 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
867 return;
868 MAGIC_CHECK_END();
869 o = (Evas_Object_Image *)(obj->object_data);
870 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
871 return;
872 MAGIC_CHECK_END();
873 _evas_object_image_cleanup(obj, o);
874#ifdef EVAS_FRAME_QUEUING
875 if (o->engine_data)
876 evas_common_pipe_op_image_flush(o->engine_data);
877#endif
878 p_data = o->engine_data;
879 if (data)
880 {
881 if (o->engine_data)
882 o->engine_data = obj->layer->evas->engine.func->image_data_put(obj->layer->evas->engine.data.output,
883 o->engine_data,
884 data);
885 else
886 o->engine_data = obj->layer->evas->engine.func->image_new_from_data(obj->layer->evas->engine.data.output,
887 o->cur.image.w,
888 o->cur.image.h,
889 data,
890 o->cur.has_alpha,
891 o->cur.cspace);
892 if (o->engine_data)
893 {
894 int stride = 0;
895
896 if (obj->layer->evas->engine.func->image_scale_hint_set)
897 obj->layer->evas->engine.func->image_scale_hint_set
898 (obj->layer->evas->engine.data.output,
899 o->engine_data, o->scale_hint);
900 if (obj->layer->evas->engine.func->image_content_hint_set)
901 obj->layer->evas->engine.func->image_content_hint_set
902 (obj->layer->evas->engine.data.output,
903 o->engine_data, o->content_hint);
904 if (obj->layer->evas->engine.func->image_stride_get)
905 obj->layer->evas->engine.func->image_stride_get
906 (obj->layer->evas->engine.data.output,
907 o->engine_data, &stride);
908 else
909 stride = o->cur.image.w * 4;
910 o->cur.image.stride = stride;
911 }
912 }
913 else
914 {
915 if (o->engine_data)
916 obj->layer->evas->engine.func->image_free(obj->layer->evas->engine.data.output,
917 o->engine_data);
918 o->load_error = EVAS_LOAD_ERROR_NONE;
919 o->cur.image.w = 0;
920 o->cur.image.h = 0;
921 o->cur.image.stride = 0;
922 o->engine_data = NULL;
923 }
924/* FIXME - in engine call above
925 if (o->engine_data)
926 o->engine_data = obj->layer->evas->engine.func->image_alpha_set(obj->layer->evas->engine.data.output,
927 o->engine_data,
928 o->cur.has_alpha);
929*/
930 if (o->pixels_checked_out > 0) o->pixels_checked_out--;
931 if (p_data != o->engine_data)
932 {
933 EVAS_OBJECT_IMAGE_FREE_FILE_AND_KEY(o);
934 o->pixels_checked_out = 0;
935 }
936 o->changed = 1;
937 evas_object_change(obj);
938}
939
940EAPI void *
941evas_object_image_data_get(const Evas_Object *obj, Eina_Bool for_writing)
942{
943 Evas_Object_Image *o;
944 DATA32 *data;
945
946 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
947 return NULL;
948 MAGIC_CHECK_END();
949 o = (Evas_Object_Image *)(obj->object_data);
950 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
951 return NULL;
952 MAGIC_CHECK_END();
953 if (!o->engine_data) return NULL;
954#ifdef EVAS_FRAME_QUEUING
955 evas_common_pipe_op_image_flush(o->engine_data);
956#endif
957
958 data = NULL;
959 if (obj->layer->evas->engine.func->image_scale_hint_set)
960 obj->layer->evas->engine.func->image_scale_hint_set
961 (obj->layer->evas->engine.data.output,
962 o->engine_data, o->scale_hint);
963 if (obj->layer->evas->engine.func->image_content_hint_set)
964 obj->layer->evas->engine.func->image_content_hint_set
965 (obj->layer->evas->engine.data.output,
966 o->engine_data, o->content_hint);
967 o->engine_data = obj->layer->evas->engine.func->image_data_get(obj->layer->evas->engine.data.output,
968 o->engine_data,
969 for_writing,
970 &data,
971 &o->load_error);
972
973 /* if we fail to get engine_data, we have to return NULL */
974 if (!o->engine_data) return NULL;
975
976 if (o->engine_data)
977 {
978 int stride = 0;
979
980 if (obj->layer->evas->engine.func->image_stride_get)
981 obj->layer->evas->engine.func->image_stride_get
982 (obj->layer->evas->engine.data.output,
983 o->engine_data, &stride);
984 else
985 stride = o->cur.image.w * 4;
986 o->cur.image.stride = stride;
987 }
988 o->pixels_checked_out++;
989 if (for_writing)
990 {
991 EVAS_OBJECT_IMAGE_FREE_FILE_AND_KEY(o);
992 }
993
994 return data;
995}
996
997EAPI void
998evas_object_image_preload(Evas_Object *obj, Eina_Bool cancel)
999{
1000 Evas_Object_Image *o;
1001
1002 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1003 return ;
1004 MAGIC_CHECK_END();
1005 o = (Evas_Object_Image *)(obj->object_data);
1006 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
1007 return ;
1008 MAGIC_CHECK_END();
1009 if (!o->engine_data)
1010 {
1011 o->preloading = 1;
1012 evas_object_inform_call_image_preloaded(obj);
1013 return;
1014 }
1015 // FIXME: if already busy preloading, then dont request again until
1016 // preload done
1017 if (cancel)
1018 {
1019 if (o->preloading)
1020 {
1021 o->preloading = 0;
1022 obj->layer->evas->engine.func->image_data_preload_cancel(obj->layer->evas->engine.data.output,
1023 o->engine_data,
1024 obj);
1025 }
1026 }
1027 else
1028 {
1029 if (!o->preloading)
1030 {
1031 o->preloading = 1;
1032 obj->layer->evas->engine.func->image_data_preload_request(obj->layer->evas->engine.data.output,
1033 o->engine_data,
1034 obj);
1035 }
1036 }
1037}
1038
1039EAPI void
1040evas_object_image_data_copy_set(Evas_Object *obj, void *data)
1041{
1042 Evas_Object_Image *o;
1043
1044 if (!data) return;
1045 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1046 return;
1047 MAGIC_CHECK_END();
1048 o = (Evas_Object_Image *)(obj->object_data);
1049 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
1050 return;
1051 MAGIC_CHECK_END();
1052 _evas_object_image_cleanup(obj, o);
1053 if ((o->cur.image.w <= 0) ||
1054 (o->cur.image.h <= 0)) return;
1055 if (o->engine_data)
1056 obj->layer->evas->engine.func->image_free(obj->layer->evas->engine.data.output,
1057 o->engine_data);
1058 o->engine_data = obj->layer->evas->engine.func->image_new_from_copied_data(obj->layer->evas->engine.data.output,
1059 o->cur.image.w,
1060 o->cur.image.h,
1061 data,
1062 o->cur.has_alpha,
1063 o->cur.cspace);
1064 if (o->engine_data)
1065 {
1066 int stride = 0;
1067
1068 o->engine_data = obj->layer->evas->engine.func->image_alpha_set(obj->layer->evas->engine.data.output,
1069 o->engine_data,
1070 o->cur.has_alpha);
1071 if (obj->layer->evas->engine.func->image_scale_hint_set)
1072 obj->layer->evas->engine.func->image_scale_hint_set
1073 (obj->layer->evas->engine.data.output,
1074 o->engine_data, o->scale_hint);
1075 if (obj->layer->evas->engine.func->image_content_hint_set)
1076 obj->layer->evas->engine.func->image_content_hint_set
1077 (obj->layer->evas->engine.data.output,
1078 o->engine_data, o->content_hint);
1079 if (obj->layer->evas->engine.func->image_stride_get)
1080 obj->layer->evas->engine.func->image_stride_get
1081 (obj->layer->evas->engine.data.output,
1082 o->engine_data, &stride);
1083 else
1084 stride = o->cur.image.w * 4;
1085 o->cur.image.stride = stride;
1086 }
1087 o->pixels_checked_out = 0;
1088 EVAS_OBJECT_IMAGE_FREE_FILE_AND_KEY(o);
1089}
1090
1091EAPI void
1092evas_object_image_data_update_add(Evas_Object *obj, int x, int y, int w, int h)
1093{
1094 Evas_Object_Image *o;
1095 Eina_Rectangle *r;
1096
1097 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1098 return;
1099 MAGIC_CHECK_END();
1100 o = (Evas_Object_Image *)(obj->object_data);
1101 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
1102 return;
1103 MAGIC_CHECK_END();
1104 RECTS_CLIP_TO_RECT(x, y, w, h, 0, 0, o->cur.image.w, o->cur.image.h);
1105 if ((w <= 0) || (h <= 0)) return;
1106 NEW_RECT(r, x, y, w, h);
1107 if (r) o->pixel_updates = eina_list_append(o->pixel_updates, r);
1108 o->changed = 1;
1109 evas_object_change(obj);
1110}
1111
1112EAPI void
1113evas_object_image_alpha_set(Evas_Object *obj, Eina_Bool has_alpha)
1114{
1115 Evas_Object_Image *o;
1116
1117 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1118 return;
1119 MAGIC_CHECK_END();
1120 o = (Evas_Object_Image *)(obj->object_data);
1121 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
1122 return;
1123 MAGIC_CHECK_END();
1124 if ((o->preloading) && (o->engine_data))
1125 {
1126 o->preloading = 0;
1127 obj->layer->evas->engine.func->image_data_preload_cancel(obj->layer->evas->engine.data.output,
1128 o->engine_data,
1129 obj);
1130 }
1131 if (((has_alpha) && (o->cur.has_alpha)) ||
1132 ((!has_alpha) && (!o->cur.has_alpha)))
1133 return;
1134 o->cur.has_alpha = has_alpha;
1135 if (o->engine_data)
1136 {
1137 int stride = 0;
1138
1139#ifdef EVAS_FRAME_QUEUING
1140 evas_common_pipe_op_image_flush(o->engine_data);
1141#endif
1142 o->engine_data = obj->layer->evas->engine.func->image_alpha_set(obj->layer->evas->engine.data.output,
1143 o->engine_data,
1144 o->cur.has_alpha);
1145 if (obj->layer->evas->engine.func->image_scale_hint_set)
1146 obj->layer->evas->engine.func->image_scale_hint_set
1147 (obj->layer->evas->engine.data.output,
1148 o->engine_data, o->scale_hint);
1149 if (obj->layer->evas->engine.func->image_content_hint_set)
1150 obj->layer->evas->engine.func->image_content_hint_set
1151 (obj->layer->evas->engine.data.output,
1152 o->engine_data, o->content_hint);
1153 if (obj->layer->evas->engine.func->image_stride_get)
1154 obj->layer->evas->engine.func->image_stride_get
1155 (obj->layer->evas->engine.data.output,
1156 o->engine_data, &stride);
1157 else
1158 stride = o->cur.image.w * 4;
1159 o->cur.image.stride = stride;
1160 }
1161 evas_object_image_data_update_add(obj, 0, 0, o->cur.image.w, o->cur.image.h);
1162 EVAS_OBJECT_IMAGE_FREE_FILE_AND_KEY(o);
1163}
1164
1165
1166EAPI Eina_Bool
1167evas_object_image_alpha_get(const Evas_Object *obj)
1168{
1169 Evas_Object_Image *o;
1170
1171 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1172 return 0;
1173 MAGIC_CHECK_END();
1174 o = (Evas_Object_Image *)(obj->object_data);
1175 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
1176 return 0;
1177 MAGIC_CHECK_END();
1178 return o->cur.has_alpha;
1179}
1180
1181EAPI void
1182evas_object_image_smooth_scale_set(Evas_Object *obj, Eina_Bool smooth_scale)
1183{
1184 Evas_Object_Image *o;
1185
1186 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1187 return;
1188 MAGIC_CHECK_END();
1189 o = (Evas_Object_Image *)(obj->object_data);
1190 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
1191 return;
1192 MAGIC_CHECK_END();
1193 if (((smooth_scale) && (o->cur.smooth_scale)) ||
1194 ((!smooth_scale) && (!o->cur.smooth_scale)))
1195 return;
1196 o->cur.smooth_scale = smooth_scale;
1197 o->changed = 1;
1198 evas_object_change(obj);
1199}
1200
1201EAPI Eina_Bool
1202evas_object_image_smooth_scale_get(const Evas_Object *obj)
1203{
1204 Evas_Object_Image *o;
1205
1206 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1207 return 0;
1208 MAGIC_CHECK_END();
1209 o = (Evas_Object_Image *)(obj->object_data);
1210 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
1211 return 0;
1212 MAGIC_CHECK_END();
1213 return o->cur.smooth_scale;
1214}
1215
1216EAPI void
1217evas_object_image_reload(Evas_Object *obj)
1218{
1219 Evas_Object_Image *o;
1220
1221 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1222 return;
1223 MAGIC_CHECK_END();
1224 o = (Evas_Object_Image *)(obj->object_data);
1225 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
1226 return;
1227 MAGIC_CHECK_END();
1228 if ((o->preloading) && (o->engine_data))
1229 {
1230 o->preloading = 0;
1231 obj->layer->evas->engine.func->image_data_preload_cancel(obj->layer->evas->engine.data.output,
1232 o->engine_data,
1233 obj);
1234 }
1235 if ((!o->cur.file) ||
1236 (o->pixels_checked_out > 0)) return;
1237 if (o->engine_data)
1238 o->engine_data = obj->layer->evas->engine.func->image_dirty_region(obj->layer->evas->engine.data.output, o->engine_data, 0, 0, o->cur.image.w, o->cur.image.h);
1239 evas_object_image_unload(obj, 1);
1240 evas_object_inform_call_image_unloaded(obj);
1241 evas_object_image_load(obj);
1242 o->prev.file = NULL;
1243 o->prev.key = NULL;
1244 o->changed = 1;
1245 evas_object_change(obj);
1246}
1247
1248EAPI Eina_Bool
1249evas_object_image_save(const Evas_Object *obj, const char *file, const char *key, const char *flags)
1250{
1251 Evas_Object_Image *o;
1252 DATA32 *data = NULL;
1253 int quality = 80, compress = 9, ok = 0;
1254 RGBA_Image *im;
1255
1256 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1257 return 0;
1258 MAGIC_CHECK_END();
1259 o = (Evas_Object_Image *)(obj->object_data);
1260 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
1261 return 0;
1262 MAGIC_CHECK_END();
1263
1264 if (!o->engine_data) return 0;
1265 o->engine_data = obj->layer->evas->engine.func->image_data_get(obj->layer->evas->engine.data.output,
1266 o->engine_data,
1267 0,
1268 &data,
1269 &o->load_error);
1270 if (flags)
1271 {
1272 char *p, *pp;
1273 char *tflags;
1274
1275 tflags = alloca(strlen(flags) + 1);
1276 strcpy(tflags, flags);
1277 p = tflags;
1278 while (p)
1279 {
1280 pp = strchr(p, ' ');
1281 if (pp) *pp = 0;
1282 sscanf(p, "quality=%i", &quality);
1283 sscanf(p, "compress=%i", &compress);
1284 if (pp) p = pp + 1;
1285 else break;
1286 }
1287 }
1288 im = (RGBA_Image*) evas_cache_image_data(evas_common_image_cache_get(),
1289 o->cur.image.w,
1290 o->cur.image.h,
1291 data,
1292 o->cur.has_alpha,
1293 EVAS_COLORSPACE_ARGB8888);
1294 if (im)
1295 {
1296 if (o->cur.cspace == EVAS_COLORSPACE_ARGB8888)
1297 im->image.data = data;
1298 else
1299 im->image.data = evas_object_image_data_convert_internal(o,
1300 data,
1301 EVAS_COLORSPACE_ARGB8888);
1302 if (im->image.data)
1303 {
1304 ok = evas_common_save_image_to_file(im, file, key, quality, compress);
1305
1306 if (o->cur.cspace != EVAS_COLORSPACE_ARGB8888)
1307 free(im->image.data);
1308 }
1309
1310 evas_cache_image_drop(&im->cache_entry);
1311 }
1312 return ok;
1313}
1314
1315EAPI Eina_Bool
1316evas_object_image_pixels_import(Evas_Object *obj, Evas_Pixel_Import_Source *pixels)
1317{
1318 Evas_Object_Image *o;
1319
1320 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1321 return 0;
1322 MAGIC_CHECK_END();
1323 o = (Evas_Object_Image *)(obj->object_data);
1324 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
1325 return 0;
1326 MAGIC_CHECK_END();
1327 _evas_object_image_cleanup(obj, o);
1328 if ((pixels->w != o->cur.image.w) || (pixels->h != o->cur.image.h)) return 0;
1329 switch (pixels->format)
1330 {
1331#if 0
1332 case EVAS_PIXEL_FORMAT_ARGB32:
1333 {
1334 if (o->engine_data)
1335 {
1336 DATA32 *image_pixels = NULL;
1337
1338 o->engine_data =
1339 obj->layer->evas->engine.func->image_data_get(obj->layer->evas->engine.data.output,
1340 o->engine_data,
1341 1,
1342 &image_pixels,
1343 &o->load_error);
1344/* FIXME: need to actualyl support this */
1345/* memcpy(image_pixels, pixels->rows, o->cur.image.w * o->cur.image.h * 4);*/
1346 if (o->engine_data)
1347 o->engine_data =
1348 obj->layer->evas->engine.func->image_data_put(obj->layer->evas->engine.data.output,
1349 o->engine_data,
1350 image_pixels);
1351 if (o->engine_data)
1352 o->engine_data =
1353 obj->layer->evas->engine.func->image_alpha_set(obj->layer->evas->engine.data.output,
1354 o->engine_data,
1355 o->cur.has_alpha);
1356 o->changed = 1;
1357 evas_object_change(obj);
1358 }
1359 }
1360 break;
1361#endif
1362#ifdef BUILD_CONVERT_YUV
1363 case EVAS_PIXEL_FORMAT_YUV420P_601:
1364 {
1365 if (o->engine_data)
1366 {
1367 DATA32 *image_pixels = NULL;
1368
1369 o->engine_data =
1370 obj->layer->evas->engine.func->image_data_get(obj->layer->evas->engine.data.output,
1371 o->engine_data,
1372 1,
1373 &image_pixels,
1374 &o->load_error);
1375 if (image_pixels)
1376 evas_common_convert_yuv_420p_601_rgba((DATA8 **) pixels->rows,
1377 (DATA8 *) image_pixels,
1378 o->cur.image.w,
1379 o->cur.image.h);
1380 if (o->engine_data)
1381 o->engine_data =
1382 obj->layer->evas->engine.func->image_data_put(obj->layer->evas->engine.data.output,
1383 o->engine_data,
1384 image_pixels);
1385 if (o->engine_data)
1386 o->engine_data =
1387 obj->layer->evas->engine.func->image_alpha_set(obj->layer->evas->engine.data.output,
1388 o->engine_data,
1389 o->cur.has_alpha);
1390 o->changed = 1;
1391 evas_object_change(obj);
1392 }
1393 }
1394 break;
1395#endif
1396 default:
1397 return 0;
1398 break;
1399 }
1400 return 1;
1401}
1402
1403EAPI void
1404evas_object_image_pixels_get_callback_set(Evas_Object *obj, Evas_Object_Image_Pixels_Get_Cb func, void *data)
1405{
1406 Evas_Object_Image *o;
1407
1408 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1409 return;
1410 MAGIC_CHECK_END();
1411 o = (Evas_Object_Image *)(obj->object_data);
1412 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
1413 return;
1414 MAGIC_CHECK_END();
1415 o->func.get_pixels = func;
1416 o->func.get_pixels_data = data;
1417}
1418
1419EAPI void
1420evas_object_image_pixels_dirty_set(Evas_Object *obj, Eina_Bool dirty)
1421{
1422 Evas_Object_Image *o;
1423
1424 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1425 return;
1426 MAGIC_CHECK_END();
1427 o = (Evas_Object_Image *)(obj->object_data);
1428 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
1429 return;
1430 MAGIC_CHECK_END();
1431 if (dirty) o->dirty_pixels = 1;
1432 else o->dirty_pixels = 0;
1433 o->changed = 1;
1434 evas_object_change(obj);
1435}
1436
1437EAPI Eina_Bool
1438evas_object_image_pixels_dirty_get(const Evas_Object *obj)
1439{
1440 Evas_Object_Image *o;
1441
1442 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1443 return 0;
1444 MAGIC_CHECK_END();
1445 o = (Evas_Object_Image *)(obj->object_data);
1446 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
1447 return 0;
1448 MAGIC_CHECK_END();
1449 if (o->dirty_pixels) return 1;
1450 return 0;
1451}
1452
1453EAPI void
1454evas_object_image_load_dpi_set(Evas_Object *obj, double dpi)
1455{
1456 Evas_Object_Image *o;
1457
1458 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1459 return;
1460 MAGIC_CHECK_END();
1461 o = (Evas_Object_Image *)(obj->object_data);
1462 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
1463 return;
1464 MAGIC_CHECK_END();
1465 if (dpi == o->load_opts.dpi) return;
1466 o->load_opts.dpi = dpi;
1467 if (o->cur.file)
1468 {
1469 evas_object_image_unload(obj, 0);
1470 evas_object_inform_call_image_unloaded(obj);
1471 evas_object_image_load(obj);
1472 o->changed = 1;
1473 evas_object_change(obj);
1474 }
1475}
1476
1477EAPI double
1478evas_object_image_load_dpi_get(const Evas_Object *obj)
1479{
1480 Evas_Object_Image *o;
1481
1482 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1483 return 0.0;
1484 MAGIC_CHECK_END();
1485 o = (Evas_Object_Image *)(obj->object_data);
1486 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
1487 return 0.0;
1488 MAGIC_CHECK_END();
1489 return o->load_opts.dpi;
1490}
1491
1492EAPI void
1493evas_object_image_load_size_set(Evas_Object *obj, int w, int h)
1494{
1495 Evas_Object_Image *o;
1496
1497 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1498 return;
1499 MAGIC_CHECK_END();
1500 o = (Evas_Object_Image *)(obj->object_data);
1501 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
1502 return;
1503 MAGIC_CHECK_END();
1504 if ((o->load_opts.w == w) && (o->load_opts.h == h)) return;
1505 o->load_opts.w = w;
1506 o->load_opts.h = h;
1507 if (o->cur.file)
1508 {
1509 evas_object_image_unload(obj, 0);
1510 evas_object_inform_call_image_unloaded(obj);
1511 evas_object_image_load(obj);
1512 o->changed = 1;
1513 evas_object_change(obj);
1514 }
1515}
1516
1517EAPI void
1518evas_object_image_load_size_get(const Evas_Object *obj, int *w, int *h)
1519{
1520 Evas_Object_Image *o;
1521
1522 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1523 return;
1524 MAGIC_CHECK_END();
1525 o = (Evas_Object_Image *)(obj->object_data);
1526 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
1527 return;
1528 MAGIC_CHECK_END();
1529 if (w) *w = o->load_opts.w;
1530 if (h) *h = o->load_opts.h;
1531}
1532
1533EAPI void
1534evas_object_image_load_scale_down_set(Evas_Object *obj, int scale_down)
1535{
1536 Evas_Object_Image *o;
1537
1538 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1539 return;
1540 MAGIC_CHECK_END();
1541 o = (Evas_Object_Image *)(obj->object_data);
1542 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
1543 return;
1544 MAGIC_CHECK_END();
1545 if (o->load_opts.scale_down_by == scale_down) return;
1546 o->load_opts.scale_down_by = scale_down;
1547 if (o->cur.file)
1548 {
1549 evas_object_image_unload(obj, 0);
1550 evas_object_inform_call_image_unloaded(obj);
1551 evas_object_image_load(obj);
1552 o->changed = 1;
1553 evas_object_change(obj);
1554 }
1555}
1556
1557EAPI int
1558evas_object_image_load_scale_down_get(const Evas_Object *obj)
1559{
1560 Evas_Object_Image *o;
1561
1562 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1563 return 0;
1564 MAGIC_CHECK_END();
1565 o = (Evas_Object_Image *)(obj->object_data);
1566 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
1567 return 0;
1568 MAGIC_CHECK_END();
1569 return o->load_opts.scale_down_by;
1570}
1571
1572EAPI void
1573evas_object_image_load_region_set(Evas_Object *obj, int x, int y, int w, int h)
1574{
1575 Evas_Object_Image *o;
1576
1577 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1578 return;
1579 MAGIC_CHECK_END();
1580 o = (Evas_Object_Image *)(obj->object_data);
1581 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
1582 return;
1583 MAGIC_CHECK_END();
1584 if ((o->load_opts.region.x == x) && (o->load_opts.region.y == y) &&
1585 (o->load_opts.region.w == w) && (o->load_opts.region.h == h)) return;
1586 o->load_opts.region.x = x;
1587 o->load_opts.region.y = y;
1588 o->load_opts.region.w = w;
1589 o->load_opts.region.h = h;
1590 if (o->cur.file)
1591 {
1592 evas_object_image_unload(obj, 0);
1593 evas_object_inform_call_image_unloaded(obj);
1594 evas_object_image_load(obj);
1595 o->changed = 1;
1596 evas_object_change(obj);
1597 }
1598}
1599
1600EAPI void
1601evas_object_image_load_region_get(const Evas_Object *obj, int *x, int *y, int *w, int *h)
1602{
1603 Evas_Object_Image *o;
1604
1605 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1606 return;
1607 MAGIC_CHECK_END();
1608 o = (Evas_Object_Image *)(obj->object_data);
1609 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
1610 return;
1611 MAGIC_CHECK_END();
1612 if (x) *x = o->load_opts.region.x;
1613 if (y) *y = o->load_opts.region.y;
1614 if (w) *w = o->load_opts.region.w;
1615 if (h) *h = o->load_opts.region.h;
1616}
1617
1618EAPI void
1619evas_object_image_load_orientation_set(Evas_Object *obj, Eina_Bool enable)
1620{
1621 Evas_Object_Image *o;
1622
1623 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1624 return;
1625 MAGIC_CHECK_END();
1626 o = (Evas_Object_Image *)(obj->object_data);
1627 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
1628 return;
1629 MAGIC_CHECK_END();
1630 o->load_opts.orientation = !!enable;
1631}
1632
1633EAPI Eina_Bool
1634evas_object_image_load_orientation_get(const Evas_Object *obj)
1635{
1636 Evas_Object_Image *o;
1637
1638 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1639 return EINA_FALSE;
1640 MAGIC_CHECK_END();
1641 o = (Evas_Object_Image *)(obj->object_data);
1642 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
1643 return EINA_FALSE;
1644 MAGIC_CHECK_END();
1645 return o->load_opts.orientation;
1646}
1647
1648EAPI void
1649evas_object_image_colorspace_set(Evas_Object *obj, Evas_Colorspace cspace)
1650{
1651 Evas_Object_Image *o;
1652
1653 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1654 return;
1655 MAGIC_CHECK_END();
1656 o = (Evas_Object_Image *)(obj->object_data);
1657 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
1658 return;
1659 MAGIC_CHECK_END();
1660
1661 _evas_object_image_cleanup(obj, o);
1662#ifdef EVAS_FRAME_QUEUING
1663 if ((Evas_Colorspace)o->cur.cspace != cspace)
1664 {
1665 if (o->engine_data)
1666 evas_common_pipe_op_image_flush(o->engine_data);
1667 }
1668#endif
1669
1670 o->cur.cspace = cspace;
1671 if (o->engine_data)
1672 obj->layer->evas->engine.func->image_colorspace_set(obj->layer->evas->engine.data.output,
1673 o->engine_data,
1674 cspace);
1675}
1676
1677EAPI Evas_Colorspace
1678evas_object_image_colorspace_get(const Evas_Object *obj)
1679{
1680 Evas_Object_Image *o;
1681
1682 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1683 return EVAS_COLORSPACE_ARGB8888;
1684 MAGIC_CHECK_END();
1685 o = (Evas_Object_Image *)(obj->object_data);
1686 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
1687 return EVAS_COLORSPACE_ARGB8888;
1688 MAGIC_CHECK_END();
1689 return o->cur.cspace;
1690}
1691
1692EAPI void
1693evas_object_image_video_surface_set(Evas_Object *obj, Evas_Video_Surface *surf)
1694{
1695 Evas_Object_Image *o;
1696
1697 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1698 return;
1699 MAGIC_CHECK_END();
1700 o = (Evas_Object_Image *)(obj->object_data);
1701 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
1702 return;
1703 MAGIC_CHECK_END();
1704 _evas_object_image_cleanup(obj, o);
1705 if (o->video_surface)
1706 {
1707 o->video_surface = 0;
1708 obj->layer->evas->video_objects = eina_list_remove(obj->layer->evas->video_objects, obj);
1709 }
1710
1711 if (surf)
1712 {
1713 if (surf->version != EVAS_VIDEO_SURFACE_VERSION) return ;
1714
1715 if (!surf->update_pixels ||
1716 !surf->move ||
1717 !surf->resize ||
1718 !surf->hide ||
1719 !surf->show)
1720 return ;
1721
1722 o->created = EINA_TRUE;
1723 o->video_surface = 1;
1724 o->video = *surf;
1725
1726 obj->layer->evas->video_objects = eina_list_append(obj->layer->evas->video_objects, obj);
1727 }
1728 else
1729 {
1730 o->video_surface = 0;
1731 o->video.update_pixels = NULL;
1732 o->video.move = NULL;
1733 o->video.resize = NULL;
1734 o->video.hide = NULL;
1735 o->video.show = NULL;
1736 o->video.data = NULL;
1737 }
1738}
1739
1740EAPI const Evas_Video_Surface *
1741evas_object_image_video_surface_get(const Evas_Object *obj)
1742{
1743 Evas_Object_Image *o;
1744
1745 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1746 return NULL;
1747 MAGIC_CHECK_END();
1748 o = (Evas_Object_Image *)(obj->object_data);
1749 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
1750 return NULL;
1751 MAGIC_CHECK_END();
1752 if (!o->video_surface) return NULL;
1753 return &o->video;
1754}
1755
1756EAPI void
1757evas_object_image_native_surface_set(Evas_Object *obj, Evas_Native_Surface *surf)
1758{
1759 Evas_Object_Image *o;
1760
1761 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1762 return;
1763 MAGIC_CHECK_END();
1764 o = (Evas_Object_Image *)(obj->object_data);
1765 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
1766 return;
1767 MAGIC_CHECK_END();
1768 _evas_object_image_cleanup(obj, o);
1769 if (!obj->layer->evas->engine.func->image_native_set) return;
1770 if ((surf) &&
1771 ((surf->version < 2) ||
1772 (surf->version > EVAS_NATIVE_SURFACE_VERSION))) return;
1773 o->engine_data =
1774 obj->layer->evas->engine.func->image_native_set(obj->layer->evas->engine.data.output,
1775 o->engine_data,
1776 surf);
1777}
1778
1779EAPI Evas_Native_Surface *
1780evas_object_image_native_surface_get(const Evas_Object *obj)
1781{
1782 Evas_Object_Image *o;
1783
1784 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1785 return NULL;
1786 MAGIC_CHECK_END();
1787 o = (Evas_Object_Image *)(obj->object_data);
1788 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
1789 return NULL;
1790 MAGIC_CHECK_END();
1791 if (!obj->layer->evas->engine.func->image_native_get) return NULL;
1792 return obj->layer->evas->engine.func->image_native_get(obj->layer->evas->engine.data.output,
1793 o->engine_data);
1794}
1795
1796EAPI void
1797evas_object_image_scale_hint_set(Evas_Object *obj, Evas_Image_Scale_Hint hint)
1798{
1799 Evas_Object_Image *o;
1800
1801 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1802 return;
1803 MAGIC_CHECK_END();
1804 o = (Evas_Object_Image *)(obj->object_data);
1805 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
1806 return;
1807 MAGIC_CHECK_END();
1808 if (o->scale_hint == hint) return;
1809#ifdef EVAS_FRAME_QUEUING
1810 if (o->engine_data)
1811 evas_common_pipe_op_image_flush(o->engine_data);
1812#endif
1813 o->scale_hint = hint;
1814 if (o->engine_data)
1815 {
1816 int stride = 0;
1817
1818 if (obj->layer->evas->engine.func->image_scale_hint_set)
1819 obj->layer->evas->engine.func->image_scale_hint_set
1820 (obj->layer->evas->engine.data.output,
1821 o->engine_data, o->scale_hint);
1822 if (obj->layer->evas->engine.func->image_stride_get)
1823 obj->layer->evas->engine.func->image_stride_get
1824 (obj->layer->evas->engine.data.output,
1825 o->engine_data, &stride);
1826 else
1827 stride = o->cur.image.w * 4;
1828 o->cur.image.stride = stride;
1829 }
1830}
1831
1832EAPI Evas_Image_Scale_Hint
1833evas_object_image_scale_hint_get(const Evas_Object *obj)
1834{
1835 Evas_Object_Image *o;
1836
1837 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1838 return EVAS_IMAGE_SCALE_HINT_NONE;
1839 MAGIC_CHECK_END();
1840 o = (Evas_Object_Image *)(obj->object_data);
1841 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
1842 return EVAS_IMAGE_SCALE_HINT_NONE;
1843 MAGIC_CHECK_END();
1844 return o->scale_hint;
1845}
1846
1847EAPI void
1848evas_object_image_content_hint_set(Evas_Object *obj, Evas_Image_Content_Hint hint)
1849{
1850 Evas_Object_Image *o;
1851
1852 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1853 return;
1854 MAGIC_CHECK_END();
1855 o = (Evas_Object_Image *)(obj->object_data);
1856 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
1857 return;
1858 MAGIC_CHECK_END();
1859 if (o->content_hint == hint) return;
1860#ifdef EVAS_FRAME_QUEUING
1861 if (o->engine_data)
1862 evas_common_pipe_op_image_flush(o->engine_data);
1863#endif
1864 o->content_hint = hint;
1865 if (o->engine_data)
1866 {
1867 int stride = 0;
1868
1869 if (obj->layer->evas->engine.func->image_content_hint_set)
1870 obj->layer->evas->engine.func->image_content_hint_set
1871 (obj->layer->evas->engine.data.output,
1872 o->engine_data, o->content_hint);
1873 if (obj->layer->evas->engine.func->image_stride_get)
1874 obj->layer->evas->engine.func->image_stride_get
1875 (obj->layer->evas->engine.data.output,
1876 o->engine_data, &stride);
1877 else
1878 stride = o->cur.image.w * 4;
1879 o->cur.image.stride = stride;
1880 }
1881}
1882
1883EAPI void
1884evas_object_image_alpha_mask_set(Evas_Object *obj, Eina_Bool ismask)
1885{
1886 Evas_Object_Image *o;
1887
1888 if (!ismask) return;
1889
1890 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1891 return;
1892 MAGIC_CHECK_END();
1893 o = (Evas_Object_Image *)(obj->object_data);
1894 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
1895 return;
1896 MAGIC_CHECK_END();
1897
1898 /* Convert to A8 if not already */
1899
1900 /* done */
1901
1902}
1903
1904#define FRAME_MAX 1024
1905EAPI Evas_Image_Content_Hint
1906evas_object_image_content_hint_get(const Evas_Object *obj)
1907{
1908 Evas_Object_Image *o;
1909
1910 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1911 return EVAS_IMAGE_CONTENT_HINT_NONE;
1912 MAGIC_CHECK_END();
1913 o = (Evas_Object_Image *)(obj->object_data);
1914 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
1915 return EVAS_IMAGE_CONTENT_HINT_NONE;
1916 MAGIC_CHECK_END();
1917 return o->content_hint;
1918}
1919
1920/* animated feature */
1921EAPI Eina_Bool
1922evas_object_image_animated_get(const Evas_Object *obj)
1923{
1924 Evas_Object_Image *o;
1925
1926 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1927 return EINA_FALSE;
1928 MAGIC_CHECK_END();
1929 o = (Evas_Object_Image *)(obj->object_data);
1930 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
1931 return EINA_FALSE;
1932 MAGIC_CHECK_END();
1933
1934 if (obj->layer->evas->engine.func->image_animated_get)
1935 return obj->layer->evas->engine.func->image_animated_get(obj->layer->evas->engine.data.output, o->engine_data);
1936 return EINA_FALSE;
1937}
1938
1939EAPI int
1940evas_object_image_animated_frame_count_get(const Evas_Object *obj)
1941{
1942 Evas_Object_Image *o;
1943
1944 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1945 return -1;
1946 MAGIC_CHECK_END();
1947 o = (Evas_Object_Image *)(obj->object_data);
1948 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
1949 return -1;
1950 MAGIC_CHECK_END();
1951
1952 if (!evas_object_image_animated_get(obj)) return -1;
1953 if (obj->layer->evas->engine.func->image_animated_frame_count_get)
1954 return obj->layer->evas->engine.func->image_animated_frame_count_get(obj->layer->evas->engine.data.output, o->engine_data);
1955 return -1;
1956}
1957
1958EAPI Evas_Image_Animated_Loop_Hint
1959evas_object_image_animated_loop_type_get(const Evas_Object *obj)
1960{
1961 Evas_Object_Image *o;
1962
1963 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1964 return EVAS_IMAGE_ANIMATED_HINT_NONE;
1965 MAGIC_CHECK_END();
1966 o = (Evas_Object_Image *)(obj->object_data);
1967 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
1968 return EVAS_IMAGE_ANIMATED_HINT_NONE;
1969 MAGIC_CHECK_END();
1970
1971 if (!evas_object_image_animated_get(obj)) return EVAS_IMAGE_ANIMATED_HINT_NONE;
1972
1973 if (obj->layer->evas->engine.func->image_animated_loop_type_get)
1974 return obj->layer->evas->engine.func->image_animated_loop_type_get(obj->layer->evas->engine.data.output, o->engine_data);
1975 return EVAS_IMAGE_ANIMATED_HINT_NONE;
1976}
1977
1978EAPI int
1979evas_object_image_animated_loop_count_get(const Evas_Object *obj)
1980{
1981 Evas_Object_Image *o;
1982
1983 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1984 return -1;
1985 MAGIC_CHECK_END();
1986 o = (Evas_Object_Image *)(obj->object_data);
1987 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
1988 return -1;
1989 MAGIC_CHECK_END();
1990
1991 if (!evas_object_image_animated_get(obj)) return -1;
1992
1993 if (obj->layer->evas->engine.func->image_animated_loop_count_get)
1994 return obj->layer->evas->engine.func->image_animated_loop_count_get(obj->layer->evas->engine.data.output, o->engine_data);
1995 return -1;
1996}
1997
1998EAPI double
1999evas_object_image_animated_frame_duration_get(const Evas_Object *obj, int start_frame, int frame_num)
2000{
2001 Evas_Object_Image *o;
2002 int frame_count = 0;
2003
2004 if (start_frame < 1) return -1;
2005 if (frame_num < 0) return -1;
2006
2007 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
2008 return -1;
2009 MAGIC_CHECK_END();
2010 o = (Evas_Object_Image *)(obj->object_data);
2011 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
2012 return -1;
2013 MAGIC_CHECK_END();
2014
2015 if (!evas_object_image_animated_get(obj)) return -1;
2016
2017 if (!obj->layer->evas->engine.func->image_animated_frame_count_get) return -1;
2018
2019 frame_count = obj->layer->evas->engine.func->image_animated_frame_count_get(obj->layer->evas->engine.data.output, o->engine_data);
2020
2021 if ((start_frame + frame_num) > frame_count) return -1;
2022 if (obj->layer->evas->engine.func->image_animated_frame_duration_get)
2023 return obj->layer->evas->engine.func->image_animated_frame_duration_get(obj->layer->evas->engine.data.output, o->engine_data, start_frame, frame_num);
2024 return -1;
2025}
2026
2027EAPI void
2028evas_object_image_animated_frame_set(Evas_Object *obj, int frame_index)
2029{
2030 Evas_Object_Image *o;
2031 int frame_count = 0;
2032
2033 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
2034 return;
2035 MAGIC_CHECK_END();
2036 o = (Evas_Object_Image *)(obj->object_data);
2037 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
2038 return;
2039 MAGIC_CHECK_END();
2040
2041 if (!o->cur.file) return;
2042 if (o->cur.frame == frame_index) return;
2043
2044 if (!evas_object_image_animated_get(obj)) return;
2045
2046 frame_count = evas_object_image_animated_frame_count_get(obj);
2047
2048 /* limit the size of frame to FRAME_MAX */
2049 if ((frame_count > FRAME_MAX) || (frame_count < 0) || (frame_index > frame_count))
2050 return;
2051
2052 if (!obj->layer->evas->engine.func->image_animated_frame_set) return;
2053 if (!obj->layer->evas->engine.func->image_animated_frame_set(obj->layer->evas->engine.data.output, o->engine_data, frame_index))
2054 return;
2055
2056 o->prev.frame = o->cur.frame;
2057 o->cur.frame = frame_index;
2058
2059 o->changed = 1;
2060 evas_object_change(obj);
2061
2062}
2063
2064EAPI void
2065evas_image_cache_flush(Evas *e)
2066{
2067 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
2068 return;
2069 MAGIC_CHECK_END();
2070
2071 e->engine.func->image_cache_flush(e->engine.data.output);
2072}
2073
2074EAPI void
2075evas_image_cache_reload(Evas *e)
2076{
2077 Evas_Layer *layer;
2078
2079 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
2080 return;
2081 MAGIC_CHECK_END();
2082
2083 evas_image_cache_flush(e);
2084 EINA_INLIST_FOREACH(e->layers, layer)
2085 {
2086 Evas_Object *obj;
2087
2088 EINA_INLIST_FOREACH(layer->objects, obj)
2089 {
2090 Evas_Object_Image *o;
2091
2092 o = (Evas_Object_Image *)(obj->object_data);
2093 if (o->magic == MAGIC_OBJ_IMAGE)
2094 {
2095 evas_object_image_unload(obj, 1);
2096 evas_object_inform_call_image_unloaded(obj);
2097 }
2098 }
2099 }
2100 evas_image_cache_flush(e);
2101 EINA_INLIST_FOREACH(e->layers, layer)
2102 {
2103 Evas_Object *obj;
2104
2105 EINA_INLIST_FOREACH(layer->objects, obj)
2106 {
2107 Evas_Object_Image *o;
2108
2109 o = (Evas_Object_Image *)(obj->object_data);
2110 if (o->magic == MAGIC_OBJ_IMAGE)
2111 {
2112 evas_object_image_load(obj);
2113 o->changed = 1;
2114 evas_object_change(obj);
2115 }
2116 }
2117 }
2118 evas_image_cache_flush(e);
2119}
2120
2121EAPI void
2122evas_image_cache_set(Evas *e, int size)
2123{
2124 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
2125 return;
2126 MAGIC_CHECK_END();
2127
2128 if (size < 0) size = 0;
2129 e->engine.func->image_cache_set(e->engine.data.output, size);
2130}
2131
2132EAPI int
2133evas_image_cache_get(const Evas *e)
2134{
2135 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
2136 return 0;
2137 MAGIC_CHECK_END();
2138
2139 return e->engine.func->image_cache_get(e->engine.data.output);
2140}
2141
2142EAPI Eina_Bool
2143evas_image_max_size_get(const Evas *e, int *maxw, int *maxh)
2144{
2145 int w = 0, h = 0;
2146 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
2147 return EINA_FALSE;
2148 MAGIC_CHECK_END();
2149
2150 if (maxw) *maxw = 0xffff;
2151 if (maxh) *maxh = 0xffff;
2152 if (!e->engine.func->image_max_size_get) return EINA_FALSE;
2153 e->engine.func->image_max_size_get(e->engine.data.output, &w, &h);
2154 if (maxw) *maxw = w;
2155 if (maxh) *maxh = h;
2156 return EINA_TRUE;
2157}
2158
2159/* all nice and private */
2160static void
2161_proxy_unset(Evas_Object *proxy)
2162{
2163 Evas_Object_Image *o;
2164
2165 o = proxy->object_data;
2166 if (!o->cur.source) return;
2167
2168 o->cur.source->proxy.proxies = eina_list_remove(o->cur.source->proxy.proxies, proxy);
2169
2170 o->cur.source = NULL;
2171 if (o->cur.defmap)
2172 {
2173 evas_map_free(o->cur.defmap);
2174 o->cur.defmap = NULL;
2175 }
2176}
2177
2178
2179static void
2180_proxy_set(Evas_Object *proxy, Evas_Object *src)
2181{
2182 Evas_Object_Image *o;
2183
2184 o = proxy->object_data;
2185
2186 evas_object_image_file_set(proxy, NULL, NULL);
2187
2188 o->cur.source = src;
2189
2190 src->proxy.proxies = eina_list_append(src->proxy.proxies, proxy);
2191 src->proxy.redraw = EINA_TRUE;
2192}
2193
2194/* Some moron just set a proxy on a proxy.
2195 * Give them some pixels. A random color
2196 */
2197static void
2198_proxy_error(Evas_Object *proxy, void *context, void *output, void *surface,
2199 int x, int y)
2200{
2201 Evas_Func *func;
2202 int r = rand() % 255;
2203 int g = rand() % 255;
2204 int b = rand() % 255;
2205
2206 /* XXX: Eina log error or something I'm sure
2207 * If it bugs you, just fix it. Don't tell me */
2208 if (VERBOSE_PROXY_ERROR) printf("Err: Argh! Recursive proxies.\n");
2209
2210 func = proxy->layer->evas->engine.func;
2211 func->context_color_set(output, context, r, g, b, 255);
2212 func->context_multiplier_unset(output, context);
2213 func->context_render_op_set(output, context, proxy->cur.render_op);
2214 func->rectangle_draw(output, context, surface, proxy->cur.geometry.x + x,
2215 proxy->cur.geometry.y + y,
2216 proxy->cur.geometry.w,
2217 proxy->cur.geometry.h);
2218 return;
2219}
2220
2221/*
2222static void
2223_proxy_subrender_recurse(Evas_Object *obj, Evas_Object *clip, void *output, void *surface, void *ctx, int x, int y)
2224{
2225 Evas_Object *obj2;
2226 Evas *e = obj->layer->evas;
2227
2228 if (obj->clip.clipees) return;
2229 if (!obj->cur.visible) return;
2230 if ((!clip) || (clip != obj->cur.clipper))
2231 {
2232 if (!obj->cur.cache.clip.visible) return;
2233 if ((obj->cur.cache.clip.a == 0) &&
2234 (obj->cur.render_op == EVAS_RENDER_BLEND)) return;
2235 }
2236 if ((obj->func->is_visible) && (!obj->func->is_visible(obj))) return;
2237
2238 if (!obj->pre_render_done)
2239 obj->func->render_pre(obj);
2240 ctx = e->engine.func->context_new(output);
2241 if (obj->smart.smart)
2242 {
2243 EINA_INLIST_FOREACH(evas_object_smart_members_get_direct(obj), obj2)
2244 {
2245 _proxy_subrender_recurse(obj2, clip, output, surface, ctx, x, y);
2246 }
2247 }
2248 else
2249 {
2250 obj->func->render(obj, output, ctx, surface, x, y);
2251 }
2252 e->engine.func->context_free(output, ctx);
2253}
2254*/
2255
2256/**
2257 * Render the source object when a proxy is set.
2258 *
2259 * Used to force a draw if necessary, else just makes sures it's available.
2260 */
2261static void
2262_proxy_subrender(Evas *e, Evas_Object *source)
2263{
2264 void *ctx;
2265/* Evas_Object *obj2, *clip;*/
2266 int w, h;
2267
2268 if (!source) return;
2269
2270 w = source->cur.geometry.w;
2271 h = source->cur.geometry.h;
2272
2273 source->proxy.redraw = EINA_FALSE;
2274
2275 /* We need to redraw surface then */
2276 if ((source->proxy.surface) &&
2277 ((source->proxy.w != w) || (source->proxy.h != h)))
2278 {
2279 e->engine.func->image_map_surface_free(e->engine.data.output,
2280 source->proxy.surface);
2281 source->proxy.surface = NULL;
2282 }
2283
2284 /* FIXME: Hardcoded alpha 'on' */
2285 /* FIXME (cont): Should see if the object has alpha */
2286 if (!source->proxy.surface)
2287 {
2288 source->proxy.surface = e->engine.func->image_map_surface_new
2289 (e->engine.data.output, w, h, 1);
2290 source->proxy.w = w;
2291 source->proxy.h = h;
2292 }
2293
2294 ctx = e->engine.func->context_new(e->engine.data.output);
2295 e->engine.func->context_color_set(e->engine.data.output, ctx, 0, 0, 0, 0);
2296 e->engine.func->context_render_op_set(e->engine.data.output, ctx, EVAS_RENDER_COPY);
2297 e->engine.func->rectangle_draw(e->engine.data.output, ctx,
2298 source->proxy.surface, 0, 0, w, h);
2299 e->engine.func->context_free(e->engine.data.output, ctx);
2300
2301 ctx = e->engine.func->context_new(e->engine.data.output);
2302 evas_render_mapped(e, source, ctx, source->proxy.surface,
2303 -source->cur.geometry.x,
2304 -source->cur.geometry.y,
2305 1, 0, 0, e->output.w, e->output.h);
2306 e->engine.func->context_free(e->engine.data.output, ctx);
2307 source->proxy.surface = e->engine.func->image_dirty_region
2308 (e->engine.data.output, source->proxy.surface, 0, 0, w, h);
2309/*
2310 ctx = e->engine.func->context_new(e->engine.data.output);
2311 if (source->smart.smart)
2312 {
2313 clip = evas_object_smart_clipped_clipper_get(source);
2314 EINA_INLIST_FOREACH(evas_object_smart_members_get_direct(source), obj2)
2315 {
2316 _proxy_subrender_recurse(obj2, clip, e->engine.data.output,
2317 source->proxy.surface,
2318 ctx,
2319 -source->cur.geometry.x,
2320 -source->cur.geometry.y);
2321 }
2322 }
2323 else
2324 {
2325 if (!source->pre_render_done)
2326 source->func->render_pre(source);
2327 source->func->render(source, e->engine.data.output, ctx,
2328 source->proxy.surface,
2329 -source->cur.geometry.x,
2330 -source->cur.geometry.y);
2331 }
2332
2333 e->engine.func->context_free(e->engine.data.output, ctx);
2334 source->proxy.surface = e->engine.func->image_dirty_region
2335 (e->engine.data.output, source->proxy.surface, 0, 0, w, h);
2336 */
2337}
2338
2339#if 0 // filtering disabled
2340/*
2341 *
2342 * Note that this is similar to proxy_subrender_recurse. It should be
2343 * possible to merge I guess
2344 */
2345static void
2346image_filter_draw_under_recurse(Evas *e, Evas_Object *obj, Evas_Object *stop,
2347 void *output, void *ctx, void *surface,
2348 int x, int y)
2349{
2350 Evas_Object *obj2;
2351
2352 if (obj->clip.clipees) return;
2353 /* FIXME: Doing bounding box test */
2354 if (!evas_object_is_in_output_rect(obj, stop->cur.geometry.x,
2355 stop->cur.geometry.y,
2356 stop->cur.geometry.w,
2357 stop->cur.geometry.h))
2358 return;
2359
2360 if (!evas_object_is_visible(obj)) return;
2361 obj->pre_render_done = 1;
2362 ctx = e->engine.func->context_new(output);
2363
2364 if (obj->smart.smart)
2365 {
2366 EINA_INLIST_FOREACH(evas_object_smart_members_get_direct(obj), obj2)
2367 {
2368 if (obj2 == stop) return;
2369 image_filter_draw_under_recurse(e, obj2, stop, output, surface,
2370 ctx, x, y);
2371 }
2372 }
2373 else
2374 obj->func->render(obj, output, ctx, surface, x ,y);
2375 e->engine.func->context_free(output, ctx);
2376}
2377
2378/*
2379 * Draw all visible objects intersecting an object which are _beneath_ it.
2380 */
2381static void
2382image_filter_draw_under(Evas *e, Evas_Object *stop, void *output, void *ctx, void *surface, int dx, int dy)
2383{
2384 Evas_Layer *lay;
2385 int x, y;
2386
2387 x = stop->cur.geometry.x - dx;
2388 y = stop->cur.geometry.y - dy;
2389
2390 EINA_INLIST_FOREACH(e->layers, lay)
2391 {
2392 Evas_Object *obj;
2393 EINA_INLIST_FOREACH(lay->objects, obj)
2394 {
2395 if (obj->delete_me) continue;
2396 if (obj == stop) return;
2397 /* FIXME: Do bounding box check */
2398 image_filter_draw_under_recurse(e, obj, stop, output, ctx,
2399 surface, -x, -y);
2400 }
2401 }
2402 e->engine.func->image_dirty_region(output, surface, 0, 0, 300, 300);
2403 e->engine.func->output_flush(output);
2404}
2405
2406/*
2407 * Update the filtered object.
2408 *
2409 * Creates a new context, and renders stuff (filtered) onto that.
2410 */
2411Filtered_Image *
2412image_filter_update(Evas *e, Evas_Object *obj, void *src, int imagew, int imageh, int *outw, int *outh)
2413{
2414 int w, h;
2415 void *ctx;
2416 Evas_Filter_Info *info;
2417 void *surface;
2418 Eina_Bool alpha;
2419
2420 info = obj->filter;
2421
2422 if (info->mode == EVAS_FILTER_MODE_BELOW)
2423 {
2424 w = obj->cur.geometry.w;
2425 h = obj->cur.geometry.h;
2426 evas_filter_get_size(info, w, h, &imagew, &imageh, EINA_TRUE);
2427 alpha = EINA_FALSE;
2428 }
2429 else
2430 {
2431 evas_filter_get_size(info, imagew, imageh, &w, &h, EINA_FALSE);
2432 alpha = e->engine.func->image_alpha_get(e->engine.data.output, src);
2433 }
2434
2435 /* Certain filters may make alpha images anyway */
2436 if (alpha == EINA_FALSE) alpha = evas_filter_always_alpha(info);
2437
2438 surface = e->engine.func->image_map_surface_new(e->engine.data.output, w, h,
2439 alpha);
2440
2441 if (info->mode == EVAS_FILTER_MODE_BELOW)
2442 {
2443 void *subsurface;
2444 int disw, dish;
2445 int dx, dy;
2446 disw = obj->cur.geometry.w;
2447 dish = obj->cur.geometry.h;
2448 dx = (imagew - w) >> 1;
2449 dy = (imageh - h) >> 1;
2450 subsurface = e->engine.func->image_map_surface_new
2451 (e->engine.data.output, imagew, imageh, 1);
2452 ctx = e->engine.func->context_new(e->engine.data.output);
2453 e->engine.func->context_color_set(e->engine.data.output, ctx, 0, 255, 0, 255);
2454 e->engine.func->context_render_op_set(e->engine.data.output, ctx, EVAS_RENDER_COPY);
2455 e->engine.func->rectangle_draw(e->engine.data.output, ctx,
2456 subsurface, 0, 0, imagew, imageh);
2457
2458 image_filter_draw_under(e, obj, e->engine.data.output, ctx,
2459 subsurface, dx, dy);
2460
2461 e->engine.func->context_free(e->engine.data.output, ctx);
2462
2463 ctx = e->engine.func->context_new(e->engine.data.output);
2464
2465 e->engine.func->image_draw_filtered(e->engine.data.output,
2466 ctx, surface, subsurface, info);
2467
2468 e->engine.func->context_free(e->engine.data.output, ctx);
2469
2470 e->engine.func->image_map_surface_free(e->engine.data.output,
2471 subsurface);
2472 }
2473 else
2474 {
2475 ctx = e->engine.func->context_new(e->engine.data.output);
2476 e->engine.func->image_draw_filtered(e->engine.data.output,
2477 ctx, surface, src, info);
2478 e->engine.func->context_free(e->engine.data.output, ctx);
2479 }
2480
2481 e->engine.func->image_dirty_region(e->engine.data.output, surface,
2482 0, 0, w, h);
2483 if (outw) *outw = w;
2484 if (outh) *outh = h;
2485 return e->engine.func->image_filtered_save(src, surface,
2486 obj->filter->key,
2487 obj->filter->len);
2488}
2489#endif
2490
2491static void
2492evas_object_image_unload(Evas_Object *obj, Eina_Bool dirty)
2493{
2494 Evas_Object_Image *o;
2495
2496 o = (Evas_Object_Image *)(obj->object_data);
2497
2498 if ((!o->cur.file) ||
2499 (o->pixels_checked_out > 0)) return;
2500 if (dirty)
2501 {
2502 if (o->engine_data)
2503 o->engine_data = obj->layer->evas->engine.func->image_dirty_region
2504 (obj->layer->evas->engine.data.output,
2505 o->engine_data,
2506 0, 0,
2507 o->cur.image.w, o->cur.image.h);
2508 }
2509 if (o->engine_data)
2510 {
2511 if (o->preloading)
2512 {
2513 o->preloading = 0;
2514 obj->layer->evas->engine.func->image_data_preload_cancel(obj->layer->evas->engine.data.output,
2515 o->engine_data,
2516 obj);
2517 }
2518 obj->layer->evas->engine.func->image_free(obj->layer->evas->engine.data.output,
2519 o->engine_data);
2520 }
2521 o->engine_data = NULL;
2522 o->load_error = EVAS_LOAD_ERROR_NONE;
2523 o->cur.has_alpha = 1;
2524 o->cur.cspace = EVAS_COLORSPACE_ARGB8888;
2525 o->cur.image.w = 0;
2526 o->cur.image.h = 0;
2527 o->cur.image.stride = 0;
2528}
2529
2530static void
2531evas_object_image_load(Evas_Object *obj)
2532{
2533 Evas_Object_Image *o;
2534 Evas_Image_Load_Opts lo;
2535
2536 o = (Evas_Object_Image *)(obj->object_data);
2537 if (o->engine_data) return;
2538
2539 lo.scale_down_by = o->load_opts.scale_down_by;
2540 lo.dpi = o->load_opts.dpi;
2541 lo.w = o->load_opts.w;
2542 lo.h = o->load_opts.h;
2543 lo.region.x = o->load_opts.region.x;
2544 lo.region.y = o->load_opts.region.y;
2545 lo.region.w = o->load_opts.region.w;
2546 lo.region.h = o->load_opts.region.h;
2547 lo.orientation = o->load_opts.orientation;
2548 o->engine_data = obj->layer->evas->engine.func->image_load
2549 (obj->layer->evas->engine.data.output,
2550 o->cur.file,
2551 o->cur.key,
2552 &o->load_error,
2553 &lo);
2554 if (o->engine_data)
2555 {
2556 int w, h;
2557 int stride = 0;
2558
2559 obj->layer->evas->engine.func->image_size_get
2560 (obj->layer->evas->engine.data.output,
2561 o->engine_data, &w, &h);
2562 if (obj->layer->evas->engine.func->image_stride_get)
2563 obj->layer->evas->engine.func->image_stride_get
2564 (obj->layer->evas->engine.data.output,
2565 o->engine_data, &stride);
2566 else
2567 stride = w * 4;
2568 o->cur.has_alpha = obj->layer->evas->engine.func->image_alpha_get
2569 (obj->layer->evas->engine.data.output,
2570 o->engine_data);
2571 o->cur.cspace = obj->layer->evas->engine.func->image_colorspace_get
2572 (obj->layer->evas->engine.data.output,
2573 o->engine_data);
2574 o->cur.image.w = w;
2575 o->cur.image.h = h;
2576 o->cur.image.stride = stride;
2577 }
2578 else
2579 {
2580 o->load_error = EVAS_LOAD_ERROR_GENERIC;
2581 }
2582}
2583
2584static Evas_Coord
2585evas_object_image_figure_x_fill(Evas_Object *obj, Evas_Coord start, Evas_Coord size, Evas_Coord *size_ret)
2586{
2587 Evas_Coord w;
2588
2589 w = ((size * obj->layer->evas->output.w) /
2590 (Evas_Coord)obj->layer->evas->viewport.w);
2591 if (size <= 0) size = 1;
2592 if (start > 0)
2593 {
2594 while (start - size > 0) start -= size;
2595 }
2596 else if (start < 0)
2597 {
2598 while (start < 0) start += size;
2599 }
2600 start = ((start * obj->layer->evas->output.w) /
2601 (Evas_Coord)obj->layer->evas->viewport.w);
2602 *size_ret = w;
2603 return start;
2604}
2605
2606static Evas_Coord
2607evas_object_image_figure_y_fill(Evas_Object *obj, Evas_Coord start, Evas_Coord size, Evas_Coord *size_ret)
2608{
2609 Evas_Coord h;
2610
2611 h = ((size * obj->layer->evas->output.h) /
2612 (Evas_Coord)obj->layer->evas->viewport.h);
2613 if (size <= 0) size = 1;
2614 if (start > 0)
2615 {
2616 while (start - size > 0) start -= size;
2617 }
2618 else if (start < 0)
2619 {
2620 while (start < 0) start += size;
2621 }
2622 start = ((start * obj->layer->evas->output.h) /
2623 (Evas_Coord)obj->layer->evas->viewport.h);
2624 *size_ret = h;
2625 return start;
2626}
2627
2628static void
2629evas_object_image_init(Evas_Object *obj)
2630{
2631 /* alloc image ob, setup methods and default values */
2632 obj->object_data = evas_object_image_new();
2633 /* set up default settings for this kind of object */
2634 obj->cur.color.r = 255;
2635 obj->cur.color.g = 255;
2636 obj->cur.color.b = 255;
2637 obj->cur.color.a = 255;
2638 obj->cur.geometry.x = 0;
2639 obj->cur.geometry.y = 0;
2640 obj->cur.geometry.w = 0;
2641 obj->cur.geometry.h = 0;
2642 obj->cur.layer = 0;
2643 obj->cur.anti_alias = 0;
2644 obj->cur.render_op = EVAS_RENDER_BLEND;
2645 /* set up object-specific settings */
2646 obj->prev = obj->cur;
2647 /* set up methods (compulsory) */
2648 obj->func = &object_func;
2649 obj->type = o_type;
2650}
2651
2652static void *
2653evas_object_image_new(void)
2654{
2655 Evas_Object_Image *o;
2656
2657 /* alloc obj private data */
2658 EVAS_MEMPOOL_INIT(_mp_obj, "evas_object_image", Evas_Object_Image, 256, NULL);
2659 o = EVAS_MEMPOOL_ALLOC(_mp_obj, Evas_Object_Image);
2660 if (!o) return NULL;
2661 EVAS_MEMPOOL_PREP(_mp_obj, o, Evas_Object_Image);
2662 o->magic = MAGIC_OBJ_IMAGE;
2663 o->cur.fill.w = 0;
2664 o->cur.fill.h = 0;
2665 o->cur.smooth_scale = 1;
2666 o->cur.border.fill = 1;
2667 o->cur.border.scale = 1.0;
2668 o->cur.cspace = EVAS_COLORSPACE_ARGB8888;
2669 o->cur.spread = EVAS_TEXTURE_REPEAT;
2670 o->cur.opaque_valid = 0;
2671 o->cur.source = NULL;
2672 o->prev = o->cur;
2673 o->tmpf_fd = -1;
2674 return o;
2675}
2676
2677static void
2678evas_object_image_free(Evas_Object *obj)
2679{
2680 Evas_Object_Image *o;
2681 Eina_Rectangle *r;
2682
2683 /* frees private object data. very simple here */
2684 o = (Evas_Object_Image *)(obj->object_data);
2685 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
2686 return;
2687 MAGIC_CHECK_END();
2688 /* free obj */
2689 _cleanup_tmpf(obj);
2690 if (o->cur.file) eina_stringshare_del(o->cur.file);
2691 if (o->cur.key) eina_stringshare_del(o->cur.key);
2692 if (o->cur.source) _proxy_unset(obj);
2693 if (o->engine_data)
2694 {
2695 if (o->preloading)
2696 {
2697 o->preloading = 0;
2698 obj->layer->evas->engine.func->image_data_preload_cancel(obj->layer->evas->engine.data.output,
2699 o->engine_data,
2700 obj);
2701 }
2702 obj->layer->evas->engine.func->image_free(obj->layer->evas->engine.data.output,
2703 o->engine_data);
2704 }
2705 if (o->video_surface)
2706 {
2707 o->video_surface = 0;
2708 obj->layer->evas->video_objects = eina_list_remove(obj->layer->evas->video_objects, obj);
2709 }
2710 o->engine_data = NULL;
2711 o->magic = 0;
2712 EINA_LIST_FREE(o->pixel_updates, r)
2713 eina_rectangle_free(r);
2714 EVAS_MEMPOOL_FREE(_mp_obj, o);
2715}
2716
2717static void
2718evas_object_image_render(Evas_Object *obj, void *output, void *context, void *surface, int x, int y)
2719{
2720 Evas_Object_Image *o;
2721 int imagew, imageh, uvw, uvh;
2722 void *pixels;
2723
2724 /* render object to surface with context, and offset by x,y */
2725 o = (Evas_Object_Image *)(obj->object_data);
2726
2727 if ((o->cur.fill.w < 1) || (o->cur.fill.h < 1))
2728 return; /* no error message, already printed in pre_render */
2729
2730 /* Proxy sanity */
2731 if (o->proxyrendering)
2732 {
2733 _proxy_error(obj, context, output, surface, x, y);
2734 return;
2735 }
2736
2737 /* We are displaying the overlay */
2738 if (o->video_visible)
2739 {
2740 /* Create a transparent rectangle */
2741 obj->layer->evas->engine.func->context_color_set(output,
2742 context,
2743 0, 0, 0, 0);
2744 obj->layer->evas->engine.func->context_multiplier_unset(output,
2745 context);
2746 obj->layer->evas->engine.func->context_render_op_set(output, context,
2747 EVAS_RENDER_COPY);
2748 obj->layer->evas->engine.func->rectangle_draw(output,
2749 context,
2750 surface,
2751 obj->cur.geometry.x + x,
2752 obj->cur.geometry.y + y,
2753 obj->cur.geometry.w,
2754 obj->cur.geometry.h);
2755
2756 return ;
2757 }
2758
2759 obj->layer->evas->engine.func->context_color_set(output,
2760 context,
2761 255, 255, 255, 255);
2762
2763 if ((obj->cur.cache.clip.r == 255) &&
2764 (obj->cur.cache.clip.g == 255) &&
2765 (obj->cur.cache.clip.b == 255) &&
2766 (obj->cur.cache.clip.a == 255))
2767 {
2768 obj->layer->evas->engine.func->context_multiplier_unset(output,
2769 context);
2770 }
2771 else
2772 obj->layer->evas->engine.func->context_multiplier_set(output,
2773 context,
2774 obj->cur.cache.clip.r,
2775 obj->cur.cache.clip.g,
2776 obj->cur.cache.clip.b,
2777 obj->cur.cache.clip.a);
2778
2779 obj->layer->evas->engine.func->context_render_op_set(output, context,
2780 obj->cur.render_op);
2781
2782 if (!o->cur.source)
2783 {
2784 pixels = o->engine_data;
2785 imagew = o->cur.image.w;
2786 imageh = o->cur.image.h;
2787 uvw = imagew;
2788 uvh = imageh;
2789 }
2790 else if (o->cur.source->proxy.surface && !o->cur.source->proxy.redraw)
2791 {
2792 pixels = o->cur.source->proxy.surface;
2793 imagew = o->cur.source->proxy.w;
2794 imageh = o->cur.source->proxy.h;
2795 uvw = imagew;
2796 uvh = imageh;
2797 }
2798 else if (o->cur.source->type == o_type &&
2799 ((Evas_Object_Image *)o->cur.source->object_data)->engine_data)
2800 {
2801 Evas_Object_Image *oi;
2802 oi = o->cur.source->object_data;
2803 pixels = oi->engine_data;
2804 imagew = oi->cur.image.w;
2805 imageh = oi->cur.image.h;
2806 uvw = o->cur.source->cur.geometry.w;
2807 uvh = o->cur.source->cur.geometry.h;
2808 }
2809 else
2810 {
2811 o->proxyrendering = 1;
2812 _proxy_subrender(obj->layer->evas, o->cur.source);
2813 pixels = o->cur.source->proxy.surface;
2814 imagew = o->cur.source->proxy.w;
2815 imageh = o->cur.source->proxy.h;
2816 uvw = imagew;
2817 uvh = imageh;
2818 o->proxyrendering = 0;
2819 }
2820
2821#if 0 // filtering disabled
2822 /* Now check/update filter */
2823 if (obj->filter && obj->filter->filter)
2824 {
2825 Filtered_Image *fi = NULL;
2826 //printf("%p has filter: %s\n", obj,obj->filter->dirty?"dirty":"clean");
2827 if (obj->filter->dirty)
2828 {
2829 if (obj->filter->mode != EVAS_FILTER_MODE_BELOW)
2830 {
2831 uint32_t len;
2832 uint8_t *key;
2833
2834 if (obj->filter->key) free(obj->filter->key);
2835 obj->filter->key = NULL;
2836 obj->filter->len = 0;
2837 key = evas_filter_key_get(obj->filter, &len);
2838 if (key)
2839 {
2840 obj->filter->key = key;
2841 obj->filter->len = len;
2842 fi = obj->layer->evas->engine.func->image_filtered_get
2843 (o->engine_data, key, len);
2844 if (obj->filter->cached && fi != obj->filter->cached)
2845 {
2846 obj->layer->evas->engine.func->image_filtered_free
2847 (o->engine_data, obj->filter->cached);
2848 obj->filter->cached = NULL;
2849 }
2850 }
2851 }
2852 else if (obj->filter->cached)
2853 {
2854 obj->layer->evas->engine.func->image_filtered_free
2855 (o->engine_data, obj->filter->cached);
2856 }
2857 if (!fi)
2858 fi = image_filter_update(obj->layer->evas, obj, pixels,
2859 imagew, imageh, &imagew, &imageh);
2860 pixels = fi->image;
2861 obj->filter->dirty = 0;
2862 obj->filter->cached = fi;
2863 }
2864 else
2865 {
2866 fi = obj->filter->cached;
2867 pixels = fi->image;
2868 }
2869 }
2870#endif
2871
2872 if (pixels)
2873 {
2874 Evas_Coord idw, idh, idx, idy;
2875 int ix, iy, iw, ih;
2876
2877 if (o->dirty_pixels)
2878 {
2879 if (o->func.get_pixels)
2880 {
2881 o->func.get_pixels(o->func.get_pixels_data, obj);
2882 if (o->engine_data != pixels)
2883 pixels = o->engine_data;
2884 o->engine_data = obj->layer->evas->engine.func->image_dirty_region
2885 (obj->layer->evas->engine.data.output, o->engine_data,
2886 0, 0, o->cur.image.w, o->cur.image.h);
2887 }
2888 o->dirty_pixels = 0;
2889 }
2890 if ((obj->cur.map) && (obj->cur.map->count > 3) && (obj->cur.usemap))
2891 {
2892 const Evas_Map_Point *p, *p_end;
2893 RGBA_Map_Point pts[obj->cur.map->count], *pt;
2894
2895 p = obj->cur.map->points;
2896 p_end = p + obj->cur.map->count;
2897 pt = pts;
2898
2899 pts[0].px = obj->cur.map->persp.px << FP;
2900 pts[0].py = obj->cur.map->persp.py << FP;
2901 pts[0].foc = obj->cur.map->persp.foc << FP;
2902 pts[0].z0 = obj->cur.map->persp.z0 << FP;
2903 // draw geom +x +y
2904 for (; p < p_end; p++, pt++)
2905 {
2906 pt->x = (lround(p->x) + x) * FP1;
2907 pt->y = (lround(p->y) + y) * FP1;
2908 pt->z = (lround(p->z) ) * FP1;
2909 pt->fx = p->px;
2910 pt->fy = p->py;
2911 pt->fz = p->z;
2912 pt->u = ((lround(p->u) * imagew) / uvw) * FP1;
2913 pt->v = ((lround(p->v) * imageh) / uvh) * FP1;
2914 if (pt->u < 0) pt->u = 0;
2915 else if (pt->u > (imagew * FP1)) pt->u = (imagew * FP1);
2916 if (pt->v < 0) pt->v = 0;
2917 else if (pt->v > (imageh * FP1)) pt->v = (imageh * FP1);
2918 pt->col = ARGB_JOIN(p->a, p->r, p->g, p->b);
2919 }
2920 if (obj->cur.map->count & 0x1)
2921 {
2922 pts[obj->cur.map->count] = pts[obj->cur.map->count -1];
2923 }
2924
2925 obj->layer->evas->engine.func->image_map_draw
2926 (output, context, surface, pixels, obj->cur.map->count,
2927 pts, o->cur.smooth_scale | obj->cur.map->smooth, 0);
2928 }
2929 else
2930 {
2931 obj->layer->evas->engine.func->image_scale_hint_set(output,
2932 pixels,
2933 o->scale_hint);
2934 /* This is technically a bug here: If the value is recreated
2935 * (which is returned)it may be a new object, however exactly 0
2936 * of all the evas engines do this. */
2937 obj->layer->evas->engine.func->image_border_set(output, pixels,
2938 o->cur.border.l, o->cur.border.r,
2939 o->cur.border.t, o->cur.border.b);
2940 idx = evas_object_image_figure_x_fill(obj, o->cur.fill.x, o->cur.fill.w, &idw);
2941 idy = evas_object_image_figure_y_fill(obj, o->cur.fill.y, o->cur.fill.h, &idh);
2942 if (idw < 1) idw = 1;
2943 if (idh < 1) idh = 1;
2944 if (idx > 0) idx -= idw;
2945 if (idy > 0) idy -= idh;
2946 while ((int)idx < obj->cur.geometry.w)
2947 {
2948 Evas_Coord ydy;
2949 int dobreak_w = 0;
2950
2951 ydy = idy;
2952 ix = idx;
2953 if ((o->cur.fill.w == obj->cur.geometry.w) &&
2954 (o->cur.fill.x == 0))
2955 {
2956 dobreak_w = 1;
2957 iw = obj->cur.geometry.w;
2958 }
2959 else
2960 iw = ((int)(idx + idw)) - ix;
2961 while ((int)idy < obj->cur.geometry.h)
2962 {
2963 int dobreak_h = 0;
2964
2965 iy = idy;
2966 if ((o->cur.fill.h == obj->cur.geometry.h) &&
2967 (o->cur.fill.y == 0))
2968 {
2969 ih = obj->cur.geometry.h;
2970 dobreak_h = 1;
2971 }
2972 else
2973 ih = ((int)(idy + idh)) - iy;
2974 if ((o->cur.border.l == 0) &&
2975 (o->cur.border.r == 0) &&
2976 (o->cur.border.t == 0) &&
2977 (o->cur.border.b == 0) &&
2978 (o->cur.border.fill != 0))
2979 obj->layer->evas->engine.func->image_draw(output,
2980 context,
2981 surface,
2982 pixels,
2983 0, 0,
2984 imagew,
2985 imageh,
2986 obj->cur.geometry.x + ix + x,
2987 obj->cur.geometry.y + iy + y,
2988 iw, ih,
2989 o->cur.smooth_scale);
2990 else
2991 {
2992 int inx, iny, inw, inh, outx, outy, outw, outh;
2993 int bl, br, bt, bb, bsl, bsr, bst, bsb;
2994 int imw, imh, ox, oy;
2995
2996 ox = obj->cur.geometry.x + ix + x;
2997 oy = obj->cur.geometry.y + iy + y;
2998 imw = imagew;
2999 imh = imageh;
3000 bl = o->cur.border.l;
3001 br = o->cur.border.r;
3002 bt = o->cur.border.t;
3003 bb = o->cur.border.b;
3004 if ((bl + br) > iw)
3005 {
3006 bl = iw / 2;
3007 br = iw - bl;
3008 }
3009 if ((bl + br) > imw)
3010 {
3011 bl = imw / 2;
3012 br = imw - bl;
3013 }
3014 if ((bt + bb) > ih)
3015 {
3016 bt = ih / 2;
3017 bb = ih - bt;
3018 }
3019 if ((bt + bb) > imh)
3020 {
3021 bt = imh / 2;
3022 bb = imh - bt;
3023 }
3024 if (o->cur.border.scale != 1.0)
3025 {
3026 bsl = ((double)bl * o->cur.border.scale);
3027 bsr = ((double)br * o->cur.border.scale);
3028 bst = ((double)bt * o->cur.border.scale);
3029 bsb = ((double)bb * o->cur.border.scale);
3030 }
3031 else
3032 {
3033 bsl = bl; bsr = br; bst = bt; bsb = bb;
3034 }
3035 // #--
3036 // |
3037 inx = 0; iny = 0;
3038 inw = bl; inh = bt;
3039 outx = ox; outy = oy;
3040 outw = bsl; outh = bst;
3041 obj->layer->evas->engine.func->image_draw(output, context, surface, pixels, inx, iny, inw, inh, outx, outy, outw, outh, o->cur.smooth_scale);
3042 // .##
3043 // |
3044 inx = bl; iny = 0;
3045 inw = imw - bl - br; inh = bt;
3046 outx = ox + bsl; outy = oy;
3047 outw = iw - bsl - bsr; outh = bst;
3048 obj->layer->evas->engine.func->image_draw(output, context, surface, pixels, inx, iny, inw, inh, outx, outy, outw, outh, o->cur.smooth_scale);
3049 // --#
3050 // |
3051 inx = imw - br; iny = 0;
3052 inw = br; inh = bt;
3053 outx = ox + iw - bsr; outy = oy;
3054 outw = bsr; outh = bst;
3055 obj->layer->evas->engine.func->image_draw(output, context, surface, pixels, inx, iny, inw, inh, outx, outy, outw, outh, o->cur.smooth_scale);
3056 // .--
3057 // #
3058 inx = 0; iny = bt;
3059 inw = bl; inh = imh - bt - bb;
3060 outx = ox; outy = oy + bst;
3061 outw = bsl; outh = ih - bst - bsb;
3062 obj->layer->evas->engine.func->image_draw(output, context, surface, pixels, inx, iny, inw, inh, outx, outy, outw, outh, o->cur.smooth_scale);
3063 // .--.
3064 // |##|
3065 if (o->cur.border.fill > EVAS_BORDER_FILL_NONE)
3066 {
3067 inx = bl; iny = bt;
3068 inw = imw - bl - br; inh = imh - bt - bb;
3069 outx = ox + bsl; outy = oy + bst;
3070 outw = iw - bsl - bsr; outh = ih - bst - bsb;
3071 if ((o->cur.border.fill == EVAS_BORDER_FILL_SOLID) &&
3072 (obj->cur.cache.clip.a == 255) &&
3073 (obj->cur.render_op == EVAS_RENDER_BLEND))
3074 {
3075 obj->layer->evas->engine.func->context_render_op_set(output, context,
3076 EVAS_RENDER_COPY);
3077 obj->layer->evas->engine.func->image_draw(output, context, surface, pixels, inx, iny, inw, inh, outx, outy, outw, outh, o->cur.smooth_scale);
3078 obj->layer->evas->engine.func->context_render_op_set(output, context,
3079 obj->cur.render_op);
3080 }
3081 else
3082 obj->layer->evas->engine.func->image_draw(output, context, surface, pixels, inx, iny, inw, inh, outx, outy, outw, outh, o->cur.smooth_scale);
3083 }
3084 // --.
3085 // #
3086 inx = imw - br; iny = bt;
3087 inw = br; inh = imh - bt - bb;
3088 outx = ox + iw - bsr; outy = oy + bst;
3089 outw = bsr; outh = ih - bst - bsb;
3090 obj->layer->evas->engine.func->image_draw(output, context, surface, pixels, inx, iny, inw, inh, outx, outy, outw, outh, o->cur.smooth_scale);
3091 // |
3092 // #--
3093 inx = 0; iny = imh - bb;
3094 inw = bl; inh = bb;
3095 outx = ox; outy = oy + ih - bsb;
3096 outw = bsl; outh = bsb;
3097 obj->layer->evas->engine.func->image_draw(output, context, surface, pixels, inx, iny, inw, inh, outx, outy, outw, outh, o->cur.smooth_scale);
3098 // |
3099 // .##
3100 inx = bl; iny = imh - bb;
3101 inw = imw - bl - br; inh = bb;
3102 outx = ox + bsl; outy = oy + ih - bsb;
3103 outw = iw - bsl - bsr; outh = bsb;
3104 obj->layer->evas->engine.func->image_draw(output, context, surface, pixels, inx, iny, inw, inh, outx, outy, outw, outh, o->cur.smooth_scale);
3105 // |
3106 // --#
3107 inx = imw - br; iny = imh - bb;
3108 inw = br; inh = bb;
3109 outx = ox + iw - bsr; outy = oy + ih - bsb;
3110 outw = bsr; outh = bsb;
3111 obj->layer->evas->engine.func->image_draw(output, context, surface, pixels, inx, iny, inw, inh, outx, outy, outw, outh, o->cur.smooth_scale);
3112 }
3113 idy += idh;
3114 if (dobreak_h) break;
3115 }
3116 idx += idw;
3117 idy = ydy;
3118 if (dobreak_w) break;
3119 }
3120 }
3121 }
3122}
3123
3124static void
3125evas_object_image_render_pre(Evas_Object *obj)
3126{
3127 Evas_Object_Image *o;
3128 int is_v = 0, was_v = 0;
3129 Evas *e;
3130
3131 /* dont pre-render the obj twice! */
3132 if (obj->pre_render_done) return;
3133 obj->pre_render_done = 1;
3134 /* pre-render phase. this does anything an object needs to do just before */
3135 /* rendering. this could mean loading the image data, retrieving it from */
3136 /* elsewhere, decoding video etc. */
3137 /* then when this is done the object needs to figure if it changed and */
3138 /* if so what and where and add the appropriate redraw rectangles */
3139 o = (Evas_Object_Image *)(obj->object_data);
3140 e = obj->layer->evas;
3141
3142 if ((o->cur.fill.w < 1) || (o->cur.fill.h < 1))
3143 {
3144 ERR("%p has invalid fill size: %dx%d. Ignored",
3145 obj, o->cur.fill.w, o->cur.fill.h);
3146 return;
3147 }
3148
3149 /* if someone is clipping this obj - go calculate the clipper */
3150 if (obj->cur.clipper)
3151 {
3152 if (obj->cur.cache.clip.dirty)
3153 evas_object_clip_recalc(obj->cur.clipper);
3154 obj->cur.clipper->func->render_pre(obj->cur.clipper);
3155 }
3156 /* Proxy: Do it early */
3157 if (o->cur.source &&
3158 (o->cur.source->proxy.redraw || o->cur.source->changed))
3159 {
3160 /* XXX: Do I need to sort out the map here? */
3161 evas_object_render_pre_prev_cur_add(&e->clip_changes, obj);
3162 goto done;
3163 }
3164
3165 /* now figure what changed and add draw rects */
3166 /* if it just became visible or invisible */
3167 is_v = evas_object_is_visible(obj);
3168 was_v = evas_object_was_visible(obj);
3169 if (is_v != was_v)
3170 {
3171 evas_object_render_pre_visible_change(&e->clip_changes, obj, is_v, was_v);
3172 if (!o->pixel_updates) goto done;
3173 }
3174 if ((obj->cur.map != obj->prev.map) ||
3175 (obj->cur.usemap != obj->prev.usemap))
3176 {
3177 evas_object_render_pre_prev_cur_add(&e->clip_changes, obj);
3178 goto done;
3179 }
3180 /* it's not visible - we accounted for it appearing or not so just abort */
3181 if (!is_v) goto done;
3182 /* clipper changed this is in addition to anything else for obj */
3183 evas_object_render_pre_clipper_change(&e->clip_changes, obj);
3184 /* if we restacked (layer or just within a layer) and don't clip anyone */
3185 if (obj->restack)
3186 {
3187 evas_object_render_pre_prev_cur_add(&e->clip_changes, obj);
3188 if (!o->pixel_updates) goto done;
3189 }
3190 /* if it changed color */
3191 if ((obj->cur.color.r != obj->prev.color.r) ||
3192 (obj->cur.color.g != obj->prev.color.g) ||
3193 (obj->cur.color.b != obj->prev.color.b) ||
3194 (obj->cur.color.a != obj->prev.color.a))
3195 {
3196 evas_object_render_pre_prev_cur_add(&e->clip_changes, obj);
3197 if (!o->pixel_updates) goto done;
3198 }
3199 /* if it changed render op */
3200 if (obj->cur.render_op != obj->prev.render_op)
3201 {
3202 evas_object_render_pre_prev_cur_add(&e->clip_changes, obj);
3203 if (!o->pixel_updates) goto done;
3204 }
3205 /* if it changed anti_alias */
3206 if (obj->cur.anti_alias != obj->prev.anti_alias)
3207 {
3208 evas_object_render_pre_prev_cur_add(&e->clip_changes, obj);
3209 if (!o->pixel_updates) goto done;
3210 }
3211 if (o->changed)
3212 {
3213 if (((o->cur.file) && (!o->prev.file)) ||
3214 ((!o->cur.file) && (o->prev.file)) ||
3215 ((o->cur.key) && (!o->prev.key)) ||
3216 ((!o->cur.key) && (o->prev.key))
3217 )
3218 {
3219 evas_object_render_pre_prev_cur_add(&e->clip_changes, obj);
3220 if (!o->pixel_updates) goto done;
3221 }
3222 if ((o->cur.image.w != o->prev.image.w) ||
3223 (o->cur.image.h != o->prev.image.h) ||
3224 (o->cur.has_alpha != o->prev.has_alpha) ||
3225 (o->cur.cspace != o->prev.cspace) ||
3226 (o->cur.smooth_scale != o->prev.smooth_scale))
3227 {
3228 evas_object_render_pre_prev_cur_add(&e->clip_changes, obj);
3229 if (!o->pixel_updates) goto done;
3230 }
3231 if ((o->cur.border.l != o->prev.border.l) ||
3232 (o->cur.border.r != o->prev.border.r) ||
3233 (o->cur.border.t != o->prev.border.t) ||
3234 (o->cur.border.b != o->prev.border.b) ||
3235 (o->cur.border.fill != o->prev.border.fill) ||
3236 (o->cur.border.scale != o->prev.border.scale))
3237 {
3238 evas_object_render_pre_prev_cur_add(&e->clip_changes, obj);
3239 if (!o->pixel_updates) goto done;
3240 }
3241 if (o->dirty_pixels)
3242 {
3243 evas_object_render_pre_prev_cur_add(&e->clip_changes, obj);
3244 if (!o->pixel_updates) goto done;
3245 }
3246 if (o->cur.frame != o->prev.frame)
3247 {
3248 evas_object_render_pre_prev_cur_add(&e->clip_changes, obj);
3249 if (!o->pixel_updates) goto done;
3250 }
3251
3252 }
3253 /* if it changed geometry - and obviously not visibility or color */
3254 /* calculate differences since we have a constant color fill */
3255 /* we really only need to update the differences */
3256#if 0 // XXX: maybe buggy?
3257 if (((obj->cur.geometry.x != obj->prev.geometry.x) ||
3258 (obj->cur.geometry.y != obj->prev.geometry.y) ||
3259 (obj->cur.geometry.w != obj->prev.geometry.w) ||
3260 (obj->cur.geometry.h != obj->prev.geometry.h)) &&
3261 (o->cur.fill.w == o->prev.fill.w) &&
3262 (o->cur.fill.h == o->prev.fill.h) &&
3263 ((o->cur.fill.x + obj->cur.geometry.x) == (o->prev.fill.x + obj->prev.geometry.x)) &&
3264 ((o->cur.fill.y + obj->cur.geometry.y) == (o->prev.fill.y + obj->prev.geometry.y)) &&
3265 (!o->pixel_updates)
3266 )
3267 {
3268 evas_rects_return_difference_rects(&e->clip_changes,
3269 obj->cur.geometry.x,
3270 obj->cur.geometry.y,
3271 obj->cur.geometry.w,
3272 obj->cur.geometry.h,
3273 obj->prev.geometry.x,
3274 obj->prev.geometry.y,
3275 obj->prev.geometry.w,
3276 obj->prev.geometry.h);
3277 if (!o->pixel_updates) goto done;
3278 }
3279#endif
3280 if (((obj->cur.geometry.x != obj->prev.geometry.x) ||
3281 (obj->cur.geometry.y != obj->prev.geometry.y) ||
3282 (obj->cur.geometry.w != obj->prev.geometry.w) ||
3283 (obj->cur.geometry.h != obj->prev.geometry.h))
3284 )
3285 {
3286 evas_object_render_pre_prev_cur_add(&e->clip_changes, obj);
3287 if (!o->pixel_updates) goto done;
3288 }
3289 if (o->changed)
3290 {
3291 if ((o->cur.fill.x != o->prev.fill.x) ||
3292 (o->cur.fill.y != o->prev.fill.y) ||
3293 (o->cur.fill.w != o->prev.fill.w) ||
3294 (o->cur.fill.h != o->prev.fill.h))
3295 {
3296 evas_object_render_pre_prev_cur_add(&e->clip_changes, obj);
3297 if (!o->pixel_updates) goto done;
3298 }
3299 if (o->pixel_updates)
3300 {
3301 if ((o->cur.border.l == 0) &&
3302 (o->cur.border.r == 0) &&
3303 (o->cur.border.t == 0) &&
3304 (o->cur.border.b == 0) &&
3305 (o->cur.image.w > 0) &&
3306 (o->cur.image.h > 0) &&
3307 (!((obj->cur.map) && (obj->cur.usemap))))
3308 {
3309 Eina_Rectangle *rr;
3310
3311 EINA_LIST_FREE(o->pixel_updates, rr)
3312 {
3313 Evas_Coord idw, idh, idx, idy;
3314 int x, y, w, h;
3315
3316 e->engine.func->image_dirty_region(e->engine.data.output, o->engine_data, rr->x, rr->y, rr->w, rr->h);
3317
3318 idx = evas_object_image_figure_x_fill(obj, o->cur.fill.x, o->cur.fill.w, &idw);
3319 idy = evas_object_image_figure_y_fill(obj, o->cur.fill.y, o->cur.fill.h, &idh);
3320
3321 if (idw < 1) idw = 1;
3322 if (idh < 1) idh = 1;
3323 if (idx > 0) idx -= idw;
3324 if (idy > 0) idy -= idh;
3325 while (idx < obj->cur.geometry.w)
3326 {
3327 Evas_Coord ydy;
3328
3329 ydy = idy;
3330 x = idx;
3331 w = ((int)(idx + idw)) - x;
3332 while (idy < obj->cur.geometry.h)
3333 {
3334 Eina_Rectangle r;
3335
3336 y = idy;
3337 h = ((int)(idy + idh)) - y;
3338
3339 r.x = ((rr->x - 1) * w) / o->cur.image.w;
3340 r.y = ((rr->y - 1) * h) / o->cur.image.h;
3341 r.w = ((rr->w + 2) * w) / o->cur.image.w;
3342 r.h = ((rr->h + 2) * h) / o->cur.image.h;
3343 r.x += obj->cur.geometry.x + x;
3344 r.y += obj->cur.geometry.y + y;
3345 RECTS_CLIP_TO_RECT(r.x, r.y, r.w, r.h,
3346 obj->cur.cache.clip.x, obj->cur.cache.clip.y,
3347 obj->cur.cache.clip.w, obj->cur.cache.clip.h);
3348 evas_add_rect(&e->clip_changes, r.x, r.y, r.w, r.h);
3349 idy += h;
3350 }
3351 idx += idw;
3352 idy = ydy;
3353 }
3354 eina_rectangle_free(rr);
3355 }
3356 goto done;
3357 }
3358 else
3359 {
3360 Eina_Rectangle *r;
3361
3362 EINA_LIST_FREE(o->pixel_updates, r)
3363 eina_rectangle_free(r);
3364 e->engine.func->image_dirty_region(e->engine.data.output, o->engine_data, 0, 0, o->cur.image.w, o->cur.image.h);
3365 evas_object_render_pre_prev_cur_add(&e->clip_changes, obj);
3366 goto done;
3367 }
3368 }
3369 }
3370#if 0 // filtering disabled
3371 if (obj->filter && obj->filter->dirty)
3372 {
3373 evas_object_render_pre_prev_cur_add(&e->clip_changes, obj);
3374 }
3375#endif
3376 /* it obviously didn't change - add a NO obscure - this "unupdates" this */
3377 /* area so if there were updates for it they get wiped. don't do it if we */
3378 /* aren't fully opaque and we are visible */
3379 if (evas_object_is_visible(obj) &&
3380 evas_object_is_opaque(obj))
3381 {
3382 Evas_Coord x, y, w, h;
3383
3384 x = obj->cur.cache.clip.x;
3385 y = obj->cur.cache.clip.y;
3386 w = obj->cur.cache.clip.w;
3387 h = obj->cur.cache.clip.h;
3388 if (obj->cur.clipper)
3389 {
3390 RECTS_CLIP_TO_RECT(x, y, w, h,
3391 obj->cur.clipper->cur.cache.clip.x,
3392 obj->cur.clipper->cur.cache.clip.y,
3393 obj->cur.clipper->cur.cache.clip.w,
3394 obj->cur.clipper->cur.cache.clip.h);
3395 }
3396 e->engine.func->output_redraws_rect_del(e->engine.data.output,
3397 x, y, w, h);
3398 }
3399 done:
3400 evas_object_render_pre_effect_updates(&e->clip_changes, obj, is_v, was_v);
3401}
3402
3403static void
3404evas_object_image_render_post(Evas_Object *obj)
3405{
3406 Evas_Object_Image *o;
3407 Eina_Rectangle *r;
3408
3409 /* this moves the current data to the previous state parts of the object */
3410 /* in whatever way is safest for the object. also if we don't need object */
3411 /* data anymore we can free it if the object deems this is a good idea */
3412 o = (Evas_Object_Image *)(obj->object_data);
3413 /* remove those pesky changes */
3414 evas_object_clip_changes_clean(obj);
3415 EINA_LIST_FREE(o->pixel_updates, r)
3416 eina_rectangle_free(r);
3417 /* move cur to prev safely for object data */
3418 obj->prev = obj->cur;
3419 o->prev = o->cur;
3420 o->changed = 0;
3421 /* FIXME: copy strings across */
3422}
3423
3424static unsigned int evas_object_image_id_get(Evas_Object *obj)
3425{
3426 Evas_Object_Image *o;
3427
3428 o = (Evas_Object_Image *)(obj->object_data);
3429 if (!o) return 0;
3430 return MAGIC_OBJ_IMAGE;
3431}
3432
3433static unsigned int evas_object_image_visual_id_get(Evas_Object *obj)
3434{
3435 Evas_Object_Image *o;
3436
3437 o = (Evas_Object_Image *)(obj->object_data);
3438 if (!o) return 0;
3439 return MAGIC_OBJ_IMAGE;
3440}
3441
3442static void *evas_object_image_engine_data_get(Evas_Object *obj)
3443{
3444 Evas_Object_Image *o;
3445
3446 o = (Evas_Object_Image *)(obj->object_data);
3447 if (!o) return NULL;
3448 return o->engine_data;
3449}
3450
3451static int
3452evas_object_image_is_opaque(Evas_Object *obj)
3453{
3454 Evas_Object_Image *o;
3455
3456 /* this returns 1 if the internal object data implies that the object is */
3457 /* currently fully opaque over the entire rectangle it occupies */
3458 o = (Evas_Object_Image *)(obj->object_data);
3459/* disable caching due tyo maps screwing with this
3460 o->cur.opaque_valid = 0;
3461 if (o->cur.opaque_valid)
3462 {
3463 if (!o->cur.opaque) return 0;
3464 }
3465 else
3466*/
3467 {
3468 o->cur.opaque = 0;
3469/* disable caching */
3470/* o->cur.opaque_valid = 1; */
3471 if ((o->cur.fill.w < 1) || (o->cur.fill.h < 1))
3472 return o->cur.opaque;
3473 if (((o->cur.border.l != 0) ||
3474 (o->cur.border.r != 0) ||
3475 (o->cur.border.t != 0) ||
3476 (o->cur.border.b != 0)) &&
3477 (!o->cur.border.fill)) return o->cur.opaque;
3478 if (!o->engine_data) return o->cur.opaque;
3479 o->cur.opaque = 1;
3480 }
3481 // FIXME: use proxy
3482 if (o->cur.source)
3483 {
3484 o->cur.opaque = evas_object_is_opaque(o->cur.source);
3485 return o->cur.opaque; /* FIXME: Should go poke at the object */
3486 }
3487 if (o->cur.has_alpha)
3488 {
3489 o->cur.opaque = 0;
3490 return o->cur.opaque;
3491 }
3492 if ((obj->cur.map) && (obj->cur.usemap))
3493 {
3494 Evas_Map *m = obj->cur.map;
3495
3496 if ((m->points[0].a == 255) &&
3497 (m->points[1].a == 255) &&
3498 (m->points[2].a == 255) &&
3499 (m->points[3].a == 255))
3500 {
3501 if (
3502 ((m->points[0].x == m->points[3].x) &&
3503 (m->points[1].x == m->points[2].x) &&
3504 (m->points[0].y == m->points[1].y) &&
3505 (m->points[2].y == m->points[3].y))
3506 ||
3507 ((m->points[0].x == m->points[1].x) &&
3508 (m->points[2].x == m->points[3].x) &&
3509 (m->points[0].y == m->points[3].y) &&
3510 (m->points[1].y == m->points[2].y))
3511 )
3512 {
3513 if ((m->points[0].x == obj->cur.geometry.x) &&
3514 (m->points[0].y == obj->cur.geometry.y) &&
3515 (m->points[2].x == (obj->cur.geometry.x + obj->cur.geometry.w)) &&
3516 (m->points[2].y == (obj->cur.geometry.y + obj->cur.geometry.h)))
3517 return o->cur.opaque;
3518 }
3519 }
3520 o->cur.opaque = 0;
3521 return o->cur.opaque;
3522 }
3523 if (obj->cur.render_op == EVAS_RENDER_COPY) return o->cur.opaque;
3524 return o->cur.opaque;
3525}
3526
3527static int
3528evas_object_image_was_opaque(Evas_Object *obj)
3529{
3530 Evas_Object_Image *o;
3531
3532 /* this returns 1 if the internal object data implies that the object was */
3533 /* previously fully opaque over the entire rectangle it occupies */
3534 o = (Evas_Object_Image *)(obj->object_data);
3535 if (o->prev.opaque_valid)
3536 {
3537 if (!o->prev.opaque) return 0;
3538 }
3539 else
3540 {
3541 o->prev.opaque = 0;
3542 o->prev.opaque_valid = 1;
3543 if ((o->prev.fill.w < 1) || (o->prev.fill.h < 1))
3544 return 0;
3545 if (((o->prev.border.l != 0) ||
3546 (o->prev.border.r != 0) ||
3547 (o->prev.border.t != 0) ||
3548 (o->prev.border.b != 0)) &&
3549 (!o->prev.border.fill)) return 0;
3550 if (!o->engine_data) return 0;
3551 o->prev.opaque = 1;
3552 }
3553 // FIXME: use proxy
3554 if (o->prev.source) return 0; /* FIXME: Should go poke at the object */
3555 if (obj->prev.usemap) return 0;
3556 if (obj->prev.render_op == EVAS_RENDER_COPY) return 1;
3557 if (o->prev.has_alpha) return 0;
3558 if (obj->prev.render_op != EVAS_RENDER_BLEND) return 0;
3559 return 1;
3560}
3561
3562static int
3563evas_object_image_is_inside(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
3564{
3565 Evas_Object_Image *o;
3566 DATA32 *data;
3567 int w, h, stride, iw, ih;
3568 int a;
3569
3570 o = (Evas_Object_Image *)(obj->object_data);
3571
3572 x -= obj->cur.cache.clip.x;
3573 y -= obj->cur.cache.clip.y;
3574 w = obj->cur.cache.clip.w;
3575 h = obj->cur.cache.clip.h;
3576 iw = o->cur.image.w;
3577 ih = o->cur.image.h;
3578
3579 if ((x < 0) || (y < 0) || (x >= w) || (y >= h)) return 0;
3580 if (!o->cur.has_alpha) return 1;
3581
3582 // FIXME: proxy needs to be honored
3583 if (obj->cur.map)
3584 {
3585 x = obj->cur.map->mx;
3586 y = obj->cur.map->my;
3587 }
3588 else
3589 {
3590 int bl, br, bt, bb, bsl, bsr, bst, bsb;
3591
3592 bl = o->cur.border.l;
3593 br = o->cur.border.r;
3594 bt = o->cur.border.t;
3595 bb = o->cur.border.b;
3596 if ((bl + br) > iw)
3597 {
3598 bl = iw / 2;
3599 br = iw - bl;
3600 }
3601 if ((bl + br) > iw)
3602 {
3603 bl = iw / 2;
3604 br = iw - bl;
3605 }
3606 if ((bt + bb) > ih)
3607 {
3608 bt = ih / 2;
3609 bb = ih - bt;
3610 }
3611 if ((bt + bb) > ih)
3612 {
3613 bt = ih / 2;
3614 bb = ih - bt;
3615 }
3616 if (o->cur.border.scale != 1.0)
3617 {
3618 bsl = ((double)bl * o->cur.border.scale);
3619 bsr = ((double)br * o->cur.border.scale);
3620 bst = ((double)bt * o->cur.border.scale);
3621 bsb = ((double)bb * o->cur.border.scale);
3622 }
3623 else
3624 {
3625 bsl = bl; bsr = br; bst = bt; bsb = bb;
3626 }
3627
3628 w = o->cur.fill.w;
3629 h = o->cur.fill.h;
3630 x -= o->cur.fill.x;
3631 y -= o->cur.fill.y;
3632 x %= w;
3633 y %= h;
3634
3635 if (x < 0) x += w;
3636 if (y < 0) y += h;
3637
3638 if (o->cur.border.fill != EVAS_BORDER_FILL_DEFAULT)
3639 {
3640 if ((x > bsl) && (x < (w - bsr)) &&
3641 (y > bst) && (y < (h - bsb)))
3642 {
3643 if (o->cur.border.fill == EVAS_BORDER_FILL_SOLID) return 1;
3644 return 0;
3645 }
3646 }
3647
3648 if (x < bsl) x = (x * bl) / bsl;
3649 else if (x > (w - bsr)) x = iw - (((w - x) * br) / bsr);
3650 else if ((bsl + bsr) < w) x = bl + (((x - bsl) * (iw - bl - br)) / (w - bsl - bsr));
3651 else return 1;
3652
3653 if (y < bst) y = (y * bt) / bst;
3654 else if (y > (h - bsb)) y = ih - (((h - y) * bb) / bsb);
3655 else if ((bst + bsb) < h) y = bt + (((y - bst) * (ih - bt - bb)) / (h - bst - bsb));
3656 else return 1;
3657 }
3658
3659 if (x < 0) x = 0;
3660 if (y < 0) y = 0;
3661 if (x >= iw) x = iw - 1;
3662 if (y >= ih) y = ih - 1;
3663
3664 stride = o->cur.image.stride;
3665
3666 o->engine_data = obj->layer->evas->engine.func->image_data_get
3667 (obj->layer->evas->engine.data.output,
3668 o->engine_data,
3669 0,
3670 &data,
3671 &o->load_error);
3672 if (!data)
3673 return 0;
3674
3675 switch (o->cur.cspace)
3676 {
3677 case EVAS_COLORSPACE_ARGB8888:
3678 data = ((DATA32*)(data) + ((y * (stride >> 2)) + x));
3679 a = (*((DATA32*)(data)) >> 24) & 0xff;
3680 break;
3681 case EVAS_COLORSPACE_RGB565_A5P:
3682 data = (void*) ((DATA16*)(data) + (h * (stride >> 1)));
3683 data = (void*) ((DATA8*)(data) + ((y * (stride >> 1)) + x));
3684 a = (*((DATA8*)(data))) & 0x1f;
3685 break;
3686 default:
3687 return 1;
3688 break;
3689 }
3690
3691 return (a != 0);
3692}
3693
3694static int
3695evas_object_image_has_opaque_rect(Evas_Object *obj)
3696{
3697 Evas_Object_Image *o;
3698
3699 o = (Evas_Object_Image *)(obj->object_data);
3700 if ((obj->cur.map) && (obj->cur.usemap)) return 0;
3701 if (((o->cur.border.l | o->cur.border.r | o->cur.border.t | o->cur.border.b) != 0) &&
3702 (o->cur.border.fill == EVAS_BORDER_FILL_SOLID) &&
3703 (obj->cur.render_op == EVAS_RENDER_BLEND) &&
3704 (obj->cur.cache.clip.a == 255) &&
3705 (o->cur.fill.x == 0) &&
3706 (o->cur.fill.y == 0) &&
3707 (o->cur.fill.w == obj->cur.geometry.w) &&
3708 (o->cur.fill.h == obj->cur.geometry.h)
3709 ) return 1;
3710 return 0;
3711}
3712
3713static int
3714evas_object_image_get_opaque_rect(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
3715{
3716 Evas_Object_Image *o;
3717
3718 o = (Evas_Object_Image *)(obj->object_data);
3719 if (o->cur.border.scale == 1.0)
3720 {
3721 *x = obj->cur.geometry.x + o->cur.border.l;
3722 *y = obj->cur.geometry.y + o->cur.border.t;
3723 *w = obj->cur.geometry.w - (o->cur.border.l + o->cur.border.r);
3724 if (*w < 0) *w = 0;
3725 *h = obj->cur.geometry.h - (o->cur.border.t + o->cur.border.b);
3726 if (*h < 0) *h = 0;
3727 }
3728 else
3729 {
3730 *x = obj->cur.geometry.x + (o->cur.border.l * o->cur.border.scale);
3731 *y = obj->cur.geometry.y + (o->cur.border.t * o->cur.border.scale);
3732 *w = obj->cur.geometry.w - ((o->cur.border.l * o->cur.border.scale) + (o->cur.border.r * o->cur.border.scale));
3733 if (*w < 0) *w = 0;
3734 *h = obj->cur.geometry.h - ((o->cur.border.t * o->cur.border.scale) + (o->cur.border.b * o->cur.border.scale));
3735 if (*h < 0) *h = 0;
3736 }
3737 return 1;
3738}
3739
3740static int
3741evas_object_image_can_map(Evas_Object *obj __UNUSED__)
3742{
3743 return 1;
3744}
3745
3746static void *
3747evas_object_image_data_convert_internal(Evas_Object_Image *o, void *data, Evas_Colorspace to_cspace)
3748{
3749 void *out = NULL;
3750
3751 if (!data)
3752 return NULL;
3753
3754 switch (o->cur.cspace)
3755 {
3756 case EVAS_COLORSPACE_ARGB8888:
3757 out = evas_common_convert_argb8888_to(data,
3758 o->cur.image.w,
3759 o->cur.image.h,
3760 o->cur.image.stride >> 2,
3761 o->cur.has_alpha,
3762 to_cspace);
3763 break;
3764 case EVAS_COLORSPACE_RGB565_A5P:
3765 out = evas_common_convert_rgb565_a5p_to(data,
3766 o->cur.image.w,
3767 o->cur.image.h,
3768 o->cur.image.stride >> 1,
3769 o->cur.has_alpha,
3770 to_cspace);
3771 break;
3772 case EVAS_COLORSPACE_YCBCR422601_PL:
3773 fprintf(stderr, "EVAS_COLORSPACE_YCBCR422601_PL:\n");
3774 out = evas_common_convert_yuv_422_601_to(data,
3775 o->cur.image.w,
3776 o->cur.image.h,
3777 to_cspace);
3778 break;
3779 case EVAS_COLORSPACE_YCBCR422P601_PL:
3780 out = evas_common_convert_yuv_422P_601_to(data,
3781 o->cur.image.w,
3782 o->cur.image.h,
3783 to_cspace);
3784 break;
3785 case EVAS_COLORSPACE_YCBCR420NV12601_PL:
3786 out = evas_common_convert_yuv_420_601_to(data,
3787 o->cur.image.w,
3788 o->cur.image.h,
3789 to_cspace);
3790 break;
3791 case EVAS_COLORSPACE_YCBCR420TM12601_PL:
3792 out = evas_common_convert_yuv_420T_601_to(data,
3793 o->cur.image.w,
3794 o->cur.image.h,
3795 to_cspace);
3796 break;
3797 default:
3798 fprintf(stderr, "unknow colorspace: %i\n", o->cur.cspace);
3799 break;
3800 }
3801
3802 return out;
3803}
3804
3805static void
3806evas_object_image_filled_resize_listener(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *einfo __UNUSED__)
3807{
3808 Evas_Coord w, h;
3809 Evas_Object_Image *o;
3810
3811 o = obj->object_data;
3812 evas_object_geometry_get(obj, NULL, NULL, &w, &h);
3813 evas_object_image_fill_set(obj, 0, 0, w, h);
3814}
3815
3816
3817Eina_Bool
3818_evas_object_image_preloading_get(const Evas_Object *obj)
3819{
3820 Evas_Object_Image *o = (Evas_Object_Image *)(obj->object_data);
3821 if (!o) return EINA_FALSE;
3822 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
3823 return EINA_FALSE;
3824 MAGIC_CHECK_END();
3825 return o->preloading;
3826}
3827
3828void
3829_evas_object_image_preloading_set(Evas_Object *obj, Eina_Bool preloading)
3830{
3831 Evas_Object_Image *o = (Evas_Object_Image *)(obj->object_data);
3832 o->preloading = preloading;
3833}
3834
3835void
3836_evas_object_image_preloading_check(Evas_Object *obj)
3837{
3838 Evas_Object_Image *o = (Evas_Object_Image *)(obj->object_data);
3839 if (obj->layer->evas->engine.func->image_load_error_get)
3840 o->load_error = obj->layer->evas->engine.func->image_load_error_get
3841 (obj->layer->evas->engine.data.output, o->engine_data);
3842}
3843
3844Evas_Object *
3845_evas_object_image_video_parent_get(Evas_Object *obj)
3846{
3847 Evas_Object_Image *o = (Evas_Object_Image *)(obj->object_data);
3848
3849 return o->video_surface ? o->video.parent : NULL;
3850}
3851
3852void
3853_evas_object_image_video_overlay_show(Evas_Object *obj)
3854{
3855 Evas_Object_Image *o = (Evas_Object_Image *)(obj->object_data);
3856
3857 if (obj->cur.cache.clip.x != obj->prev.cache.clip.x ||
3858 obj->cur.cache.clip.y != obj->prev.cache.clip.y ||
3859 o->created || !o->video_visible)
3860 o->video.move(o->video.data, obj, &o->video, obj->cur.cache.clip.x, obj->cur.cache.clip.y);
3861 if (obj->cur.cache.clip.w != obj->prev.cache.clip.w ||
3862 obj->cur.cache.clip.h != obj->prev.cache.clip.h ||
3863 o->created || !o->video_visible)
3864 o->video.resize(o->video.data, obj, &o->video, obj->cur.cache.clip.w, obj->cur.cache.clip.h);
3865 if (!o->video_visible || o->created)
3866 {
3867 o->video.show(o->video.data, obj, &o->video);
3868 }
3869 else
3870 {
3871 /* Cancel dirty on the image */
3872 Eina_Rectangle *r;
3873
3874 o->dirty_pixels = 0;
3875 EINA_LIST_FREE(o->pixel_updates, r)
3876 eina_rectangle_free(r);
3877 }
3878 o->video_visible = EINA_TRUE;
3879 o->created = EINA_FALSE;
3880}
3881
3882void
3883_evas_object_image_video_overlay_hide(Evas_Object *obj)
3884{
3885 Evas_Object_Image *o = (Evas_Object_Image *)(obj->object_data);
3886
3887 if (o->video_visible || o->created)
3888 o->video.hide(o->video.data, obj, &o->video);
3889 if (evas_object_is_visible(obj))
3890 o->video.update_pixels(o->video.data, obj, &o->video);
3891 o->video_visible = EINA_FALSE;
3892 o->created = EINA_FALSE;
3893}
3894
3895/* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/
diff --git a/libraries/evas/src/lib/canvas/evas_object_inform.c b/libraries/evas/src/lib/canvas/evas_object_inform.c
new file mode 100644
index 0000000..bc09eb9
--- /dev/null
+++ b/libraries/evas/src/lib/canvas/evas_object_inform.c
@@ -0,0 +1,79 @@
1#include "evas_common.h"
2#include "evas_private.h"
3
4/* local calls */
5
6void
7evas_object_inform_call_show(Evas_Object *obj)
8{
9 _evas_object_event_new();
10
11 evas_object_event_callback_call(obj, EVAS_CALLBACK_SHOW, NULL);
12 _evas_post_event_callback_call(obj->layer->evas);
13}
14
15void
16evas_object_inform_call_hide(Evas_Object *obj)
17{
18 _evas_object_event_new();
19
20 evas_object_event_callback_call(obj, EVAS_CALLBACK_HIDE, NULL);
21 _evas_post_event_callback_call(obj->layer->evas);
22}
23
24void
25evas_object_inform_call_move(Evas_Object *obj)
26{
27 _evas_object_event_new();
28
29 evas_object_event_callback_call(obj, EVAS_CALLBACK_MOVE, NULL);
30 _evas_post_event_callback_call(obj->layer->evas);
31}
32
33void
34evas_object_inform_call_resize(Evas_Object *obj)
35{
36 _evas_object_event_new();
37
38 evas_object_event_callback_call(obj, EVAS_CALLBACK_RESIZE, NULL);
39 _evas_post_event_callback_call(obj->layer->evas);
40}
41
42void
43evas_object_inform_call_restack(Evas_Object *obj)
44{
45 _evas_object_event_new();
46
47 evas_object_event_callback_call(obj, EVAS_CALLBACK_RESTACK, NULL);
48 _evas_post_event_callback_call(obj->layer->evas);
49}
50
51void
52evas_object_inform_call_changed_size_hints(Evas_Object *obj)
53{
54 _evas_object_event_new();
55
56 evas_object_event_callback_call(obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, NULL);
57 _evas_post_event_callback_call(obj->layer->evas);
58}
59
60void
61evas_object_inform_call_image_preloaded(Evas_Object *obj)
62{
63 if (!_evas_object_image_preloading_get(obj)) return;
64 _evas_object_image_preloading_check(obj);
65 _evas_object_image_preloading_set(obj, 0);
66 _evas_object_event_new();
67
68 evas_object_event_callback_call(obj, EVAS_CALLBACK_IMAGE_PRELOADED, NULL);
69 _evas_post_event_callback_call(obj->layer->evas);
70}
71
72void
73evas_object_inform_call_image_unloaded(Evas_Object *obj)
74{
75 _evas_object_event_new();
76
77 evas_object_event_callback_call(obj, EVAS_CALLBACK_IMAGE_UNLOADED, NULL);
78 _evas_post_event_callback_call(obj->layer->evas);
79}
diff --git a/libraries/evas/src/lib/canvas/evas_object_intercept.c b/libraries/evas/src/lib/canvas/evas_object_intercept.c
new file mode 100644
index 0000000..c3e5e24
--- /dev/null
+++ b/libraries/evas/src/lib/canvas/evas_object_intercept.c
@@ -0,0 +1,625 @@
1#include "evas_common.h"
2#include "evas_private.h"
3
4/* local calls */
5
6static void evas_object_intercept_init(Evas_Object *obj);
7static void evas_object_intercept_deinit(Evas_Object *obj);
8
9static void
10evas_object_intercept_init(Evas_Object *obj)
11{
12 /* MEM OK */
13 if (!obj->interceptors)
14 obj->interceptors = evas_mem_calloc(sizeof(Evas_Intercept_Func));
15}
16
17static void
18evas_object_intercept_deinit(Evas_Object *obj)
19{
20 /* MEM OK */
21 if (!obj->interceptors) return;
22 if ((obj->interceptors->show.func) ||
23 (obj->interceptors->hide.func) ||
24 (obj->interceptors->move.func) ||
25 (obj->interceptors->resize.func) ||
26 (obj->interceptors->raise.func) ||
27 (obj->interceptors->lower.func) ||
28 (obj->interceptors->stack_above.func) ||
29 (obj->interceptors->stack_below.func) ||
30 (obj->interceptors->layer_set.func) ||
31 (obj->interceptors->color_set.func) ||
32 (obj->interceptors->clip_set.func) ||
33 (obj->interceptors->clip_unset.func))
34 return;
35 free(obj->interceptors);
36 obj->interceptors = NULL;
37}
38
39/* private calls */
40
41void
42evas_object_intercept_cleanup(Evas_Object *obj)
43{
44 /* MEM OK */
45 if (obj->interceptors) free(obj->interceptors);
46}
47
48int
49evas_object_intercept_call_show(Evas_Object *obj)
50{
51 /* MEM OK */
52 int ret;
53
54 if (!obj->interceptors) return 0;
55 if (obj->intercepted) return 0;
56 obj->intercepted = 1;
57 ret = !!(obj->interceptors->show.func);
58 if (obj->interceptors->show.func)
59 obj->interceptors->show.func(obj->interceptors->show.data, obj);
60 obj->intercepted = 0;
61 return ret;
62}
63
64int
65evas_object_intercept_call_hide(Evas_Object *obj)
66{
67 /* MEM OK */
68 int ret;
69
70 if (!obj->interceptors) return 0;
71 if (obj->intercepted) return 0;
72 obj->intercepted = 1;
73 ret = !!(obj->interceptors->hide.func);
74 if (obj->interceptors->hide.func)
75 obj->interceptors->hide.func(obj->interceptors->hide.data, obj);
76 obj->intercepted = 0;
77 return ret;
78}
79
80int
81evas_object_intercept_call_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
82{
83 /* MEM OK */
84 int ret;
85
86 if (!obj->interceptors) return 0;
87 if (obj->intercepted) return 0;
88 obj->intercepted = 1;
89 ret = !!(obj->interceptors->move.func);
90 if (obj->interceptors->move.func)
91 obj->interceptors->move.func(obj->interceptors->move.data, obj, x, y);
92 obj->intercepted = 0;
93 return ret;
94}
95
96int
97evas_object_intercept_call_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
98{
99 /* MEM OK */
100 int ret;
101
102 if (!obj->interceptors) return 0;
103 if (obj->intercepted) return 0;
104 obj->intercepted = 1;
105 ret = !!(obj->interceptors->resize.func);
106 if (obj->interceptors->resize.func)
107 obj->interceptors->resize.func(obj->interceptors->resize.data, obj, w, h);
108 obj->intercepted = 0;
109 return ret;
110}
111
112int
113evas_object_intercept_call_raise(Evas_Object *obj)
114{
115 /* MEM OK */
116 int ret;
117
118 if (!obj->interceptors) return 0;
119 if (obj->intercepted) return 0;
120 obj->intercepted = 1;
121 ret = !!(obj->interceptors->raise.func);
122 if (obj->interceptors->raise.func)
123 obj->interceptors->raise.func(obj->interceptors->raise.data, obj);
124 obj->intercepted = 0;
125 return ret;
126}
127
128int
129evas_object_intercept_call_lower(Evas_Object *obj)
130{
131 /* MEM OK */
132 int ret;
133
134 if (!obj->interceptors) return 0;
135 if (obj->intercepted) return 0;
136 obj->intercepted = 1;
137 ret = !!(obj->interceptors->lower.func);
138 if (obj->interceptors->lower.func)
139 obj->interceptors->lower.func(obj->interceptors->lower.data, obj);
140 obj->intercepted = 0;
141 return ret;
142}
143
144int
145evas_object_intercept_call_stack_above(Evas_Object *obj, Evas_Object *above)
146{
147 /* MEM OK */
148 int ret;
149
150 if (!obj->interceptors) return 0;
151 if (obj->intercepted) return 0;
152 obj->intercepted = 1;
153 ret = !!(obj->interceptors->stack_above.func);
154 if (obj->interceptors->stack_above.func)
155 obj->interceptors->stack_above.func(obj->interceptors->stack_above.data, obj, above);
156 obj->intercepted = 0;
157 return ret;
158}
159
160int
161evas_object_intercept_call_stack_below(Evas_Object *obj, Evas_Object *below)
162{
163 /* MEM OK */
164 int ret;
165
166 if (!obj->interceptors) return 0;
167 if (obj->intercepted) return 0;
168 obj->intercepted = 1;
169 ret = !!(obj->interceptors->stack_below.func);
170 if (obj->interceptors->stack_below.func)
171 obj->interceptors->stack_below.func(obj->interceptors->stack_below.data, obj, below);
172 obj->intercepted = 0;
173 return ret;
174}
175
176int
177evas_object_intercept_call_layer_set(Evas_Object *obj, int l)
178{
179 /* MEM OK */
180 int ret;
181
182 if (!obj->interceptors) return 0;
183 if (obj->intercepted) return 0;
184 obj->intercepted = 1;
185 ret = !!(obj->interceptors->layer_set.func);
186 if (obj->interceptors->layer_set.func)
187 obj->interceptors->layer_set.func(obj->interceptors->layer_set.data, obj, l);
188 obj->intercepted = 0;
189 return ret;
190}
191
192int
193evas_object_intercept_call_color_set(Evas_Object *obj, int r, int g, int b, int a)
194{
195 /* MEM OK */
196 int ret;
197
198 if (!obj->interceptors) return 0;
199 if (obj->intercepted) return 0;
200 obj->intercepted = 1;
201 ret = !!(obj->interceptors->color_set.func);
202 if (obj->interceptors->color_set.func)
203 obj->interceptors->color_set.func(obj->interceptors->color_set.data, obj, r, g, b, a);
204 obj->intercepted = 0;
205 return ret;
206}
207
208int
209evas_object_intercept_call_clip_set(Evas_Object *obj, Evas_Object *clip)
210{
211 /* MEM OK */
212 int ret;
213
214 if (!obj->interceptors) return 0;
215 if (obj->intercepted) return 0;
216 obj->intercepted = 1;
217 ret = !!(obj->interceptors->clip_set.func);
218 if (obj->interceptors->clip_set.func)
219 obj->interceptors->clip_set.func(obj->interceptors->clip_set.data, obj, clip);
220 obj->intercepted = 0;
221 return ret;
222}
223
224int
225evas_object_intercept_call_clip_unset(Evas_Object *obj)
226{
227 /* MEM OK */
228 int ret;
229
230 if (!obj->interceptors) return 0;
231 if (obj->intercepted) return 0;
232 obj->intercepted = 1;
233 ret = !!(obj->interceptors->clip_unset.func);
234 if (obj->interceptors->clip_unset.func)
235 obj->interceptors->clip_unset.func(obj->interceptors->clip_unset.data, obj);
236 obj->intercepted = 0;
237 return ret;
238}
239
240/* public calls */
241
242EAPI void
243evas_object_intercept_show_callback_add(Evas_Object *obj, Evas_Object_Intercept_Show_Cb func, const void *data)
244{
245 /* MEM OK */
246
247 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
248 return;
249 MAGIC_CHECK_END();
250 if (!func) return;
251 evas_object_intercept_init(obj);
252 if (!obj->interceptors) return;
253 obj->interceptors->show.func = func;
254 obj->interceptors->show.data = (void *)data;
255}
256
257EAPI void *
258evas_object_intercept_show_callback_del(Evas_Object *obj, Evas_Object_Intercept_Show_Cb func)
259{
260 /* MEM OK */
261 void *data;
262
263 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
264 return NULL;
265 MAGIC_CHECK_END();
266 if (!func) return NULL;
267 if (!obj->interceptors) return NULL;
268 obj->interceptors->show.func = NULL;
269 data = obj->interceptors->show.data;
270 obj->interceptors->show.data = NULL;
271 evas_object_intercept_deinit(obj);
272 return data;
273}
274
275EAPI void
276evas_object_intercept_hide_callback_add(Evas_Object *obj, Evas_Object_Intercept_Hide_Cb func, const void *data)
277{
278 /* MEM OK */
279 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
280 return;
281 MAGIC_CHECK_END();
282 if (!func) return;
283 evas_object_intercept_init(obj);
284 if (!obj->interceptors) return;
285 obj->interceptors->hide.func = func;
286 obj->interceptors->hide.data = (void *)data;
287}
288
289EAPI void *
290evas_object_intercept_hide_callback_del(Evas_Object *obj, Evas_Object_Intercept_Hide_Cb func)
291{
292 /* MEM OK */
293 void *data;
294
295 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
296 return NULL;
297 MAGIC_CHECK_END();
298 if (!func) return NULL;
299 if (!obj->interceptors) return NULL;
300 obj->interceptors->hide.func = NULL;
301 data = obj->interceptors->hide.data;
302 obj->interceptors->hide.data = NULL;
303 evas_object_intercept_deinit(obj);
304 return data;
305}
306
307EAPI void
308evas_object_intercept_move_callback_add(Evas_Object *obj, Evas_Object_Intercept_Move_Cb func, const void *data)
309{
310 /* MEM OK */
311 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
312 return;
313 MAGIC_CHECK_END();
314 if (!func) return;
315 evas_object_intercept_init(obj);
316 if (!obj->interceptors) return;
317 obj->interceptors->move.func = func;
318 obj->interceptors->move.data = (void *)data;
319}
320
321EAPI void *
322evas_object_intercept_move_callback_del(Evas_Object *obj, Evas_Object_Intercept_Move_Cb func)
323{
324 /* MEM OK */
325 void *data;
326
327 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
328 return NULL;
329 MAGIC_CHECK_END();
330 if (!func) return NULL;
331 if (!obj->interceptors) return NULL;
332 obj->interceptors->move.func = NULL;
333 data = obj->interceptors->move.data;
334 obj->interceptors->move.data = NULL;
335 evas_object_intercept_deinit(obj);
336 return data;
337}
338
339EAPI void
340evas_object_intercept_resize_callback_add(Evas_Object *obj, Evas_Object_Intercept_Resize_Cb func, const void *data)
341{
342 /* MEM OK */
343 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
344 return;
345 MAGIC_CHECK_END();
346 if (!func) return;
347 evas_object_intercept_init(obj);
348 if (!obj->interceptors) return;
349 obj->interceptors->resize.func = func;
350 obj->interceptors->resize.data = (void *)data;
351}
352
353EAPI void *
354evas_object_intercept_resize_callback_del(Evas_Object *obj, Evas_Object_Intercept_Resize_Cb func)
355{
356 /* MEM OK */
357 void *data;
358
359 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
360 return NULL;
361 MAGIC_CHECK_END();
362 if (!func) return NULL;
363 if (!obj->interceptors) return NULL;
364 obj->interceptors->resize.func = NULL;
365 data = obj->interceptors->resize.data;
366 obj->interceptors->resize.data = NULL;
367 evas_object_intercept_deinit(obj);
368 return data;
369}
370
371EAPI void
372evas_object_intercept_raise_callback_add(Evas_Object *obj, Evas_Object_Intercept_Raise_Cb func, const void *data)
373{
374 /* MEM OK */
375 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
376 return;
377 MAGIC_CHECK_END();
378 if (!func) return;
379 evas_object_intercept_init(obj);
380 if (!obj->interceptors) return;
381 obj->interceptors->raise.func = func;
382 obj->interceptors->raise.data = (void *)data;
383}
384
385EAPI void *
386evas_object_intercept_raise_callback_del(Evas_Object *obj, Evas_Object_Intercept_Raise_Cb func)
387{
388 /* MEM OK */
389 void *data;
390
391 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
392 return NULL;
393 MAGIC_CHECK_END();
394 if (!func) return NULL;
395 if (!obj->interceptors) return NULL;
396 obj->interceptors->raise.func = NULL;
397 data = obj->interceptors->raise.data;
398 obj->interceptors->raise.data = NULL;
399 evas_object_intercept_deinit(obj);
400 return data;
401}
402
403EAPI void
404evas_object_intercept_lower_callback_add(Evas_Object *obj, Evas_Object_Intercept_Lower_Cb func, const void *data)
405{
406 /* MEM OK */
407 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
408 return;
409 MAGIC_CHECK_END();
410 if (!func) return;
411 evas_object_intercept_init(obj);
412 if (!obj->interceptors) return;
413 obj->interceptors->lower.func = func;
414 obj->interceptors->lower.data = (void *)data;
415}
416
417EAPI void *
418evas_object_intercept_lower_callback_del(Evas_Object *obj, Evas_Object_Intercept_Lower_Cb func)
419{
420 /* MEM OK */
421 void *data;
422
423 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
424 return NULL;
425 MAGIC_CHECK_END();
426 if (!func) return NULL;
427 if (!obj->interceptors) return NULL;
428 obj->interceptors->lower.func = NULL;
429 data = obj->interceptors->lower.data;
430 obj->interceptors->lower.data = NULL;
431 evas_object_intercept_deinit(obj);
432 return data;
433}
434
435EAPI void
436evas_object_intercept_stack_above_callback_add(Evas_Object *obj, Evas_Object_Intercept_Stack_Above_Cb func, const void *data)
437{
438 /* MEM OK */
439 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
440 return;
441 MAGIC_CHECK_END();
442 if (!func) return;
443 evas_object_intercept_init(obj);
444 if (!obj->interceptors) return;
445 obj->interceptors->stack_above.func = func;
446 obj->interceptors->stack_above.data = (void *)data;
447}
448
449EAPI void *
450evas_object_intercept_stack_above_callback_del(Evas_Object *obj, Evas_Object_Intercept_Stack_Above_Cb func)
451{
452 /* MEM OK */
453 void *data;
454
455 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
456 return NULL;
457 MAGIC_CHECK_END();
458 if (!func) return NULL;
459 if (!obj->interceptors) return NULL;
460 obj->interceptors->stack_above.func = NULL;
461 data = obj->interceptors->stack_above.data;
462 obj->interceptors->stack_above.data = NULL;
463 evas_object_intercept_deinit(obj);
464 return data;
465}
466
467EAPI void
468evas_object_intercept_stack_below_callback_add(Evas_Object *obj, Evas_Object_Intercept_Stack_Below_Cb func, const void *data)
469{
470 /* MEM OK */
471 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
472 return;
473 MAGIC_CHECK_END();
474 if (!func) return;
475 evas_object_intercept_init(obj);
476 if (!obj->interceptors) return;
477 obj->interceptors->stack_below.func = func;
478 obj->interceptors->stack_below.data = (void *)data;
479}
480
481EAPI void *
482evas_object_intercept_stack_below_callback_del(Evas_Object *obj, Evas_Object_Intercept_Stack_Below_Cb func)
483{
484 /* MEM OK */
485 void *data;
486
487 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
488 return NULL;
489 MAGIC_CHECK_END();
490 if (!func) return NULL;
491 if (!obj->interceptors) return NULL;
492 obj->interceptors->stack_below.func = NULL;
493 data = obj->interceptors->stack_below.data;
494 obj->interceptors->stack_below.data = NULL;
495 evas_object_intercept_deinit(obj);
496 return data;
497}
498
499EAPI void
500evas_object_intercept_layer_set_callback_add(Evas_Object *obj, Evas_Object_Intercept_Layer_Set_Cb func, const void *data)
501{
502 /* MEM OK */
503 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
504 return;
505 MAGIC_CHECK_END();
506 if (!func) return;
507 evas_object_intercept_init(obj);
508 if (!obj->interceptors) return;
509 obj->interceptors->layer_set.func = func;
510 obj->interceptors->layer_set.data = (void *)data;
511}
512
513EAPI void *
514evas_object_intercept_layer_set_callback_del(Evas_Object *obj, Evas_Object_Intercept_Layer_Set_Cb func)
515{
516 /* MEM OK */
517 void *data;
518
519 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
520 return NULL;
521 MAGIC_CHECK_END();
522 if (!func) return NULL;
523 if (!obj->interceptors) return NULL;
524 obj->interceptors->layer_set.func = NULL;
525 data = obj->interceptors->layer_set.data;
526 obj->interceptors->layer_set.data = NULL;
527 evas_object_intercept_deinit(obj);
528 return data;
529}
530
531EAPI void
532evas_object_intercept_color_set_callback_add(Evas_Object *obj, Evas_Object_Intercept_Color_Set_Cb func, const void *data)
533{
534 /* MEM OK */
535 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
536 return;
537 MAGIC_CHECK_END();
538 if (!func) return;
539 evas_object_intercept_init(obj);
540 if (!obj->interceptors) return;
541 obj->interceptors->color_set.func = func;
542 obj->interceptors->color_set.data = (void *)data;
543}
544
545EAPI void *
546evas_object_intercept_color_set_callback_del(Evas_Object *obj, Evas_Object_Intercept_Color_Set_Cb func)
547{
548 /* MEM OK */
549 void *data;
550
551 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
552 return NULL;
553 MAGIC_CHECK_END();
554 if (!func) return NULL;
555 if (!obj->interceptors) return NULL;
556 obj->interceptors->color_set.func = NULL;
557 data = obj->interceptors->color_set.data;
558 obj->interceptors->color_set.data = NULL;
559 evas_object_intercept_deinit(obj);
560 return data;
561}
562
563EAPI void
564evas_object_intercept_clip_set_callback_add(Evas_Object *obj, Evas_Object_Intercept_Clip_Set_Cb func, const void *data)
565{
566 /* MEM OK */
567 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
568 return;
569 MAGIC_CHECK_END();
570 if (!func) return;
571 evas_object_intercept_init(obj);
572 if (!obj->interceptors) return;
573 obj->interceptors->clip_set.func = func;
574 obj->interceptors->clip_set.data = (void *)data;
575}
576
577EAPI void *
578evas_object_intercept_clip_set_callback_del(Evas_Object *obj, Evas_Object_Intercept_Clip_Set_Cb func)
579{
580 /* MEM OK */
581 void *data;
582
583 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
584 return NULL;
585 MAGIC_CHECK_END();
586 if (!func) return NULL;
587 if (!obj->interceptors) return NULL;
588 obj->interceptors->clip_set.func = NULL;
589 data = obj->interceptors->clip_set.data;
590 obj->interceptors->clip_set.data = NULL;
591 evas_object_intercept_deinit(obj);
592 return data;
593}
594
595EAPI void
596evas_object_intercept_clip_unset_callback_add(Evas_Object *obj, Evas_Object_Intercept_Clip_Unset_Cb func, const void *data)
597{
598 /* MEM OK */
599 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
600 return;
601 MAGIC_CHECK_END();
602 if (!func) return;
603 evas_object_intercept_init(obj);
604 if (!obj->interceptors) return;
605 obj->interceptors->clip_unset.func = func;
606 obj->interceptors->clip_unset.data = (void *)data;
607}
608
609EAPI void *
610evas_object_intercept_clip_unset_callback_del(Evas_Object *obj, Evas_Object_Intercept_Clip_Unset_Cb func)
611{
612 /* MEM OK */
613 void *data;
614
615 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
616 return NULL;
617 MAGIC_CHECK_END();
618 if (!func) return NULL;
619 if (!obj->interceptors) return NULL;
620 obj->interceptors->clip_unset.func = NULL;
621 data = obj->interceptors->clip_unset.data;
622 obj->interceptors->clip_unset.data = NULL;
623 evas_object_intercept_deinit(obj);
624 return data;
625}
diff --git a/libraries/evas/src/lib/canvas/evas_object_line.c b/libraries/evas/src/lib/canvas/evas_object_line.c
new file mode 100644
index 0000000..b09a6e2
--- /dev/null
+++ b/libraries/evas/src/lib/canvas/evas_object_line.c
@@ -0,0 +1,461 @@
1#include "evas_common.h"
2#include "evas_private.h"
3
4/* private magic number for line objects */
5static const char o_type[] = "line";
6
7/* private struct for line object internal data */
8typedef struct _Evas_Object_Line Evas_Object_Line;
9
10struct _Evas_Object_Line
11{
12 DATA32 magic;
13 struct {
14 struct {
15 int x1, y1, x2, y2;
16 struct {
17 Evas_Coord w, h;
18 } object;
19 } cache;
20 Evas_Coord x1, y1, x2, y2;
21 } cur, prev;
22
23 void *engine_data;
24
25 char changed : 1;
26};
27
28/* private methods for line objects */
29static void evas_object_line_init(Evas_Object *obj);
30static void *evas_object_line_new(void);
31static void evas_object_line_render(Evas_Object *obj, void *output, void *context, void *surface, int x, int y);
32static void evas_object_line_free(Evas_Object *obj);
33static void evas_object_line_render_pre(Evas_Object *obj);
34static void evas_object_line_render_post(Evas_Object *obj);
35
36static unsigned int evas_object_line_id_get(Evas_Object *obj);
37static unsigned int evas_object_line_visual_id_get(Evas_Object *obj);
38static void *evas_object_line_engine_data_get(Evas_Object *obj);
39
40static int evas_object_line_is_opaque(Evas_Object *obj);
41static int evas_object_line_was_opaque(Evas_Object *obj);
42static int evas_object_line_is_inside(Evas_Object *obj, Evas_Coord x, Evas_Coord y);
43static int evas_object_line_was_inside(Evas_Object *obj, Evas_Coord x, Evas_Coord y);
44static void evas_object_line_coords_recalc(Evas_Object *obj);
45
46static const Evas_Object_Func object_func =
47{
48 /* methods (compulsory) */
49 evas_object_line_free,
50 evas_object_line_render,
51 evas_object_line_render_pre,
52 evas_object_line_render_post,
53 evas_object_line_id_get,
54 evas_object_line_visual_id_get,
55 evas_object_line_engine_data_get,
56 /* these are optional. NULL = nothing */
57 NULL,
58 NULL,
59 NULL,
60 NULL,
61 evas_object_line_is_opaque,
62 evas_object_line_was_opaque,
63 evas_object_line_is_inside,
64 evas_object_line_was_inside,
65 evas_object_line_coords_recalc,
66 NULL,
67 NULL,
68 NULL,
69 NULL
70};
71
72/* the actual api call to add a rect */
73/* it has no other api calls as all properties are standard */
74
75EVAS_MEMPOOL(_mp_obj);
76
77EAPI Evas_Object *
78evas_object_line_add(Evas *e)
79{
80 Evas_Object *obj;
81
82 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
83 return NULL;
84 MAGIC_CHECK_END();
85 obj = evas_object_new(e);
86 evas_object_line_init(obj);
87 evas_object_inject(obj, e);
88 return obj;
89}
90
91EAPI void
92evas_object_line_xy_set(Evas_Object *obj, Evas_Coord x1, Evas_Coord y1, Evas_Coord x2, Evas_Coord y2)
93{
94 Evas_Object_Line *o;
95 Evas_Coord min_x, max_x, min_y, max_y;
96 int is, was = 0;
97
98 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
99 return;
100 MAGIC_CHECK_END();
101 o = (Evas_Object_Line *)(obj->object_data);
102 MAGIC_CHECK(o, Evas_Object_Line, MAGIC_OBJ_LINE);
103 return;
104 MAGIC_CHECK_END();
105 if ((x1 == o->cur.x1) && (y1 == o->cur.y1) &&
106 (x2 == o->cur.x2) && (y2 == o->cur.y2)) return;
107 if (obj->layer->evas->events_frozen <= 0)
108 {
109 if (!evas_event_passes_through(obj) &&
110 !evas_event_freezes_through(obj))
111 was = evas_object_is_in_output_rect(obj,
112 obj->layer->evas->pointer.x,
113 obj->layer->evas->pointer.y,
114 1, 1);
115 }
116 if (x1 < x2)
117 {
118 min_x = x1;
119 max_x = x2;
120 }
121 else
122 {
123 min_x = x2;
124 max_x = x1;
125 }
126 if (y1 < y2)
127 {
128 min_y = y1;
129 max_y = y2;
130 }
131 else
132 {
133 min_y = y2;
134 max_y = y1;
135 }
136 obj->cur.geometry.x = min_x;
137 obj->cur.geometry.y = min_y;
138 obj->cur.geometry.w = max_x - min_x + 2;
139 obj->cur.geometry.h = max_y - min_y + 2;
140//// obj->cur.cache.geometry.validity = 0;
141 o->cur.x1 = x1 - min_x;
142 o->cur.y1 = y1 - min_y;
143 o->cur.x2 = x2 - min_x;
144 o->cur.y2 = y2 - min_y;
145 o->changed = 1;
146 evas_object_change(obj);
147 evas_object_coords_recalc(obj);
148 evas_object_clip_dirty(obj);
149 if (obj->layer->evas->events_frozen <= 0)
150 {
151 is = evas_object_is_in_output_rect(obj,
152 obj->layer->evas->pointer.x,
153 obj->layer->evas->pointer.y, 1, 1);
154 if (!evas_event_passes_through(obj) &&
155 !evas_event_freezes_through(obj))
156 {
157 if ((is ^ was) && obj->cur.visible)
158 evas_event_feed_mouse_move(obj->layer->evas,
159 obj->layer->evas->pointer.x,
160 obj->layer->evas->pointer.y,
161 obj->layer->evas->last_timestamp,
162 NULL);
163 }
164 }
165 evas_object_inform_call_move(obj);
166 evas_object_inform_call_resize(obj);
167}
168
169EAPI void
170evas_object_line_xy_get(const Evas_Object *obj, Evas_Coord *x1, Evas_Coord *y1, Evas_Coord *x2, Evas_Coord *y2)
171{
172 Evas_Object_Line *o;
173
174 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
175 if (x1) *x1 = 0;
176 if (y1) *y1 = 0;
177 if (x2) *x2 = 0;
178 if (y2) *y2 = 0;
179 return;
180 MAGIC_CHECK_END();
181 o = (Evas_Object_Line *)(obj->object_data);
182 MAGIC_CHECK(o, Evas_Object_Line, MAGIC_OBJ_LINE);
183 if (x1) *x1 = 0;
184 if (y1) *y1 = 0;
185 if (x2) *x2 = 0;
186 if (y2) *y2 = 0;
187 return;
188 MAGIC_CHECK_END();
189 if (x1) *x1 = obj->cur.geometry.x + o->cur.x1;
190 if (y1) *y1 = obj->cur.geometry.y + o->cur.y1;
191 if (x2) *x2 = obj->cur.geometry.x + o->cur.x2;
192 if (y2) *y2 = obj->cur.geometry.y + o->cur.y2;
193}
194
195/* all nice and private */
196static void
197evas_object_line_init(Evas_Object *obj)
198{
199 /* alloc image ob, setup methods and default values */
200 obj->object_data = evas_object_line_new();
201 /* set up default settings for this kind of object */
202 obj->cur.color.r = 255;
203 obj->cur.color.g = 255;
204 obj->cur.color.b = 255;
205 obj->cur.color.a = 255;
206 obj->cur.geometry.x = 0;
207 obj->cur.geometry.y = 0;
208 obj->cur.geometry.w = 0;
209 obj->cur.geometry.h = 0;
210 obj->cur.layer = 0;
211 obj->cur.anti_alias = 1;
212 obj->cur.render_op = EVAS_RENDER_BLEND;
213 /* set up object-specific settings */
214 obj->prev = obj->cur;
215 /* set up methods (compulsory) */
216 obj->func = &object_func;
217 obj->type = o_type;
218}
219
220static void *
221evas_object_line_new(void)
222{
223 Evas_Object_Line *o;
224
225 /* alloc obj private data */
226 EVAS_MEMPOOL_INIT(_mp_obj, "evas_object_line", Evas_Object_Line, 16, NULL);
227 o = EVAS_MEMPOOL_ALLOC(_mp_obj, Evas_Object_Line);
228 if (!o) return NULL;
229 EVAS_MEMPOOL_PREP(_mp_obj, o, Evas_Object_Line);
230 o->magic = MAGIC_OBJ_LINE;
231 o->cur.x1 = 0;
232 o->cur.y1 = 0;
233 o->cur.x2 = 31;
234 o->cur.y2 = 31;
235 o->prev = o->cur;
236 return o;
237}
238
239static void
240evas_object_line_free(Evas_Object *obj)
241{
242 Evas_Object_Line *o;
243
244 /* frees private object data. very simple here */
245 o = (Evas_Object_Line *)(obj->object_data);
246 MAGIC_CHECK(o, Evas_Object_Line, MAGIC_OBJ_LINE);
247 return;
248 MAGIC_CHECK_END();
249 /* free obj */
250 o->magic = 0;
251 EVAS_MEMPOOL_FREE(_mp_obj, o);
252}
253
254static void
255evas_object_line_render(Evas_Object *obj, void *output, void *context, void *surface, int x, int y)
256{
257 Evas_Object_Line *o;
258
259 /* render object to surface with context, and offxet by x,y */
260 o = (Evas_Object_Line *)(obj->object_data);
261 obj->layer->evas->engine.func->context_color_set(output,
262 context,
263 obj->cur.cache.clip.r,
264 obj->cur.cache.clip.g,
265 obj->cur.cache.clip.b,
266 obj->cur.cache.clip.a);
267 obj->layer->evas->engine.func->context_multiplier_unset(output,
268 context);
269 obj->layer->evas->engine.func->context_anti_alias_set(output, context,
270 obj->cur.anti_alias);
271 obj->layer->evas->engine.func->context_render_op_set(output, context,
272 obj->cur.render_op);
273 obj->layer->evas->engine.func->line_draw(output,
274 context,
275 surface,
276 o->cur.cache.x1 + x,
277 o->cur.cache.y1 + y,
278 o->cur.cache.x2 + x,
279 o->cur.cache.y2 + y);
280}
281
282static void
283evas_object_line_render_pre(Evas_Object *obj)
284{
285 Evas_Object_Line *o;
286 int is_v, was_v;
287
288 /* dont pre-render the obj twice! */
289 if (obj->pre_render_done) return;
290 obj->pre_render_done = 1;
291 /* pre-render phase. this does anything an object needs to do just before */
292 /* rendering. this could mean loading the image data, retrieving it from */
293 /* elsewhere, decoding video etc. */
294 /* then when this is done the object needs to figure if it changed and */
295 /* if so what and where and add the appropriate redraw lines */
296 o = (Evas_Object_Line *)(obj->object_data);
297 /* if someone is clipping this obj - go calculate the clipper */
298 if (obj->cur.clipper)
299 {
300 if (obj->cur.cache.clip.dirty)
301 evas_object_clip_recalc(obj->cur.clipper);
302 obj->cur.clipper->func->render_pre(obj->cur.clipper);
303 }
304 /* now figure what changed and add draw rects */
305 /* if it just became visible or invisible */
306 is_v = evas_object_is_visible(obj);
307 was_v = evas_object_was_visible(obj);
308 if (is_v != was_v)
309 {
310 evas_object_render_pre_visible_change(&obj->layer->evas->clip_changes, obj, is_v, was_v);
311 goto done;
312 }
313 if ((obj->cur.map != obj->prev.map) ||
314 (obj->cur.usemap != obj->prev.usemap))
315 {
316 evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, obj);
317 goto done;
318 }
319 /* it's not visible - we accounted for it appearing or not so just abort */
320 if (!is_v) goto done;
321 /* clipper changed this is in addition to anything else for obj */
322 evas_object_render_pre_clipper_change(&obj->layer->evas->clip_changes, obj);
323 /* if we restacked (layer or just within a layer) */
324 if (obj->restack)
325 {
326 evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, obj);
327 goto done;
328 }
329 /* if it changed anti_alias */
330 if (obj->cur.anti_alias != obj->prev.anti_alias)
331 {
332 evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, obj);
333 goto done;
334 }
335 /* if it changed render op */
336 if (obj->cur.render_op != obj->prev.render_op)
337 {
338 evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, obj);
339 goto done;
340 }
341 /* if it changed color */
342 if ((obj->cur.color.r != obj->prev.color.r) ||
343 (obj->cur.color.g != obj->prev.color.g) ||
344 (obj->cur.color.b != obj->prev.color.b) ||
345 (obj->cur.color.a != obj->prev.color.a))
346 {
347 evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, obj);
348 goto done;
349 }
350 /* if it changed geometry - and obviously not visibility or color */
351 /* calculate differences since we have a constant color fill */
352 /* we really only need to update the differences */
353 if ((obj->cur.geometry.x != obj->prev.geometry.x) ||
354 (obj->cur.geometry.y != obj->prev.geometry.y) ||
355 (obj->cur.geometry.w != obj->prev.geometry.w) ||
356 (obj->cur.geometry.h != obj->prev.geometry.h) ||
357 ((o->changed) &&
358 ((o->cur.x1 != o->prev.x1) ||
359 (o->cur.y1 != o->prev.y1) ||
360 (o->cur.x2 != o->prev.x2) ||
361 (o->cur.y2 != o->prev.y2)))
362 )
363 {
364 evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, obj);
365 goto done;
366 }
367 done:
368 evas_object_render_pre_effect_updates(&obj->layer->evas->clip_changes, obj, is_v, was_v);
369}
370
371static void
372evas_object_line_render_post(Evas_Object *obj)
373{
374 Evas_Object_Line *o;
375
376 /* this moves the current data to the previous state parts of the object */
377 /* in whatever way is safest for the object. also if we don't need object */
378 /* data anymore we can free it if the object deems this is a good idea */
379 o = (Evas_Object_Line *)(obj->object_data);
380 /* remove those pesky changes */
381 evas_object_clip_changes_clean(obj);
382 /* move cur to prev safely for object data */
383 obj->prev = obj->cur;
384 o->prev = o->cur;
385 o->changed = 0;
386}
387
388static unsigned int evas_object_line_id_get(Evas_Object *obj)
389{
390 Evas_Object_Line *o;
391
392 o = (Evas_Object_Line *)(obj->object_data);
393 if (!o) return 0;
394 return MAGIC_OBJ_LINE;
395}
396
397static unsigned int evas_object_line_visual_id_get(Evas_Object *obj)
398{
399 Evas_Object_Line *o;
400
401 o = (Evas_Object_Line *)(obj->object_data);
402 if (!o) return 0;
403 return MAGIC_OBJ_SHAPE;
404}
405
406static void *evas_object_line_engine_data_get(Evas_Object *obj)
407{
408 Evas_Object_Line *o;
409
410 o = (Evas_Object_Line *)(obj->object_data);
411 if (!o) return NULL;
412 return o->engine_data;
413}
414
415static int
416evas_object_line_is_opaque(Evas_Object *obj __UNUSED__)
417{
418 /* this returns 1 if the internal object data implies that the object is */
419 /* currently fully opaque over the entire line it occupies */
420 return 0;
421}
422
423static int
424evas_object_line_was_opaque(Evas_Object *obj __UNUSED__)
425{
426 /* this returns 1 if the internal object data implies that the object was */
427 /* previously fully opaque over the entire line it occupies */
428 return 0;
429}
430
431static int
432evas_object_line_is_inside(Evas_Object *obj __UNUSED__, Evas_Coord x __UNUSED__, Evas_Coord y __UNUSED__)
433{
434 /* this returns 1 if the canvas co-ordinates are inside the object based */
435 /* on object private data. not much use for rects, but for polys, images */
436 /* and other complex objects it might be */
437 return 1;
438}
439
440static int
441evas_object_line_was_inside(Evas_Object *obj __UNUSED__, Evas_Coord x __UNUSED__, Evas_Coord y __UNUSED__)
442{
443 /* this returns 1 if the canvas co-ordinates were inside the object based */
444 /* on object private data. not much use for rects, but for polys, images */
445 /* and other complex objects it might be */
446 return 1;
447}
448
449static void
450evas_object_line_coords_recalc(Evas_Object *obj)
451{
452 Evas_Object_Line *o;
453
454 o = (Evas_Object_Line *)(obj->object_data);
455 o->cur.cache.x1 = obj->cur.geometry.x + o->cur.x1;
456 o->cur.cache.y1 = obj->cur.geometry.y + o->cur.y1;
457 o->cur.cache.x2 = obj->cur.geometry.x + o->cur.x2;
458 o->cur.cache.y2 = obj->cur.geometry.y + o->cur.y2;
459 o->cur.cache.object.w = obj->cur.geometry.w;
460 o->cur.cache.object.h = obj->cur.geometry.h;
461}
diff --git a/libraries/evas/src/lib/canvas/evas_object_main.c b/libraries/evas/src/lib/canvas/evas_object_main.c
new file mode 100644
index 0000000..3eaded9
--- /dev/null
+++ b/libraries/evas/src/lib/canvas/evas_object_main.c
@@ -0,0 +1,1319 @@
1#include "evas_common.h"
2#include "evas_private.h"
3
4EVAS_MEMPOOL(_mp_obj);
5EVAS_MEMPOOL(_mp_sh);
6
7static Eina_Inlist *
8get_layer_objects(Evas_Layer *l)
9{
10 if ((!l) || (!l->objects)) return NULL;
11 return (EINA_INLIST_GET(l->objects));
12}
13
14/* evas internal stuff */
15Evas_Object *
16evas_object_new(Evas *e __UNUSED__)
17{
18 Evas_Object *obj;
19
20 EVAS_MEMPOOL_INIT(_mp_obj, "evas_object", Evas_Object, 512, NULL);
21 obj = EVAS_MEMPOOL_ALLOC(_mp_obj, Evas_Object);
22 if (!obj) return NULL;
23 EVAS_MEMPOOL_PREP(_mp_obj, obj, Evas_Object);
24
25 obj->magic = MAGIC_OBJ;
26 obj->cur.scale = 1.0;
27 obj->prev.scale = 1.0;
28
29 return obj;
30}
31
32void
33evas_object_free(Evas_Object *obj, int clean_layer)
34{
35 int was_smart_child = 0;
36
37#if 0 // filtering disabled
38 evas_filter_free(obj);
39#endif
40 if (!strcmp(obj->type, "image")) evas_object_image_video_surface_set(obj, NULL);
41 evas_object_map_set(obj, NULL);
42 evas_object_grabs_cleanup(obj);
43 evas_object_intercept_cleanup(obj);
44 if (obj->smart.parent) was_smart_child = 1;
45 evas_object_smart_cleanup(obj);
46 obj->func->free(obj);
47 if (!was_smart_child) evas_object_release(obj, clean_layer);
48 if (obj->clip.clipees)
49 eina_list_free(obj->clip.clipees);
50 evas_object_clip_changes_clean(obj);
51 evas_object_event_callback_all_del(obj);
52 evas_object_event_callback_cleanup(obj);
53 while (obj->data.elements)
54 {
55 Evas_Data_Node *node;
56
57 node = obj->data.elements->data;
58 obj->data.elements = eina_list_remove(obj->data.elements, node);
59 free(node);
60 }
61 obj->magic = 0;
62 if (obj->size_hints)
63 {
64 EVAS_MEMPOOL_FREE(_mp_sh, obj->size_hints);
65 }
66 EVAS_MEMPOOL_FREE(_mp_obj, obj);
67}
68
69void
70evas_object_change(Evas_Object *obj)
71{
72 Eina_List *l;
73 Evas_Object *obj2;
74 Eina_Bool movch = 0;
75
76 if (obj->layer->evas->nochange)
77 {
78// printf("nochange %p\n", obj);
79 return;
80 }
81// else
82// printf("ch %p\n", obj);
83 obj->layer->evas->changed = 1;
84 if (obj->changed_move)
85 {
86 movch = 1;
87 obj->changed_move = 0;
88 if (!obj->changed_nomove) obj->changed_move_only = 1;
89 if (obj->changed) return;
90 }
91 else
92 {
93 obj->changed_move_only = 0;
94 obj->changed_nomove = 1;
95 if (obj->changed) return;
96 }
97// obj->changed = 1;
98 evas_render_object_recalc(obj);
99 /* set changed flag on all objects this one clips too */
100 if (!((movch) && (obj->is_static_clip)))
101 {
102 EINA_LIST_FOREACH(obj->clip.clipees, l, obj2) evas_object_change(obj2);
103 }
104 EINA_LIST_FOREACH(obj->proxy.proxies, l, obj2)
105 {
106 evas_object_change(obj2);
107 }
108 if (obj->smart.parent) evas_object_change(obj->smart.parent);
109}
110
111void
112evas_object_render_pre_visible_change(Eina_Array *rects, Evas_Object *obj, int is_v, int was_v)
113{
114 if (obj->smart.smart) return ;
115 if (is_v == was_v) return ;
116 if (is_v)
117 {
118 evas_add_rect(rects,
119 obj->cur.cache.clip.x,
120 obj->cur.cache.clip.y,
121 obj->cur.cache.clip.w,
122 obj->cur.cache.clip.h);
123 }
124 else
125 {
126 evas_add_rect(rects,
127 obj->prev.cache.clip.x,
128 obj->prev.cache.clip.y,
129 obj->prev.cache.clip.w,
130 obj->prev.cache.clip.h);
131 }
132}
133
134void
135evas_object_render_pre_clipper_change(Eina_Array *rects, Evas_Object *obj)
136{
137 if (obj->smart.smart) return ;
138 if (obj->cur.clipper == obj->prev.clipper) return ;
139 if ((obj->cur.clipper) && (obj->prev.clipper))
140 {
141 /* get difference rects between clippers */
142 evas_rects_return_difference_rects(rects,
143 obj->cur.clipper->cur.cache.clip.x,
144 obj->cur.clipper->cur.cache.clip.y,
145 obj->cur.clipper->cur.cache.clip.w,
146 obj->cur.clipper->cur.cache.clip.h,
147 obj->prev.clipper->prev.cache.clip.x,
148 obj->prev.clipper->prev.cache.clip.y,
149 obj->prev.clipper->prev.cache.clip.w,
150 obj->prev.clipper->prev.cache.clip.h);
151 }
152 else if (obj->cur.clipper)
153 {
154 evas_rects_return_difference_rects(rects,
155 obj->cur.geometry.x,
156 obj->cur.geometry.y,
157 obj->cur.geometry.w,
158 obj->cur.geometry.h,
159//// rl = evas_rects_return_difference_rects(obj->cur.cache.geometry.x,
160//// obj->cur.cache.geometry.y,
161//// obj->cur.cache.geometry.w,
162//// obj->cur.cache.geometry.h,
163 obj->cur.clipper->cur.cache.clip.x,
164 obj->cur.clipper->cur.cache.clip.y,
165 obj->cur.clipper->cur.cache.clip.w,
166 obj->cur.clipper->cur.cache.clip.h);
167 }
168 else if (obj->prev.clipper)
169 {
170 evas_rects_return_difference_rects(rects,
171 obj->prev.geometry.x,
172 obj->prev.geometry.y,
173 obj->prev.geometry.w,
174 obj->prev.geometry.h,
175//// rl = evas_rects_return_difference_rects(obj->prev.cache.geometry.x,
176//// obj->prev.cache.geometry.y,
177//// obj->prev.cache.geometry.w,
178//// obj->prev.cache.geometry.h,
179 obj->prev.clipper->prev.cache.clip.x,
180 obj->prev.clipper->prev.cache.clip.y,
181 obj->prev.clipper->prev.cache.clip.w,
182 obj->prev.clipper->prev.cache.clip.h);
183 }
184}
185
186void
187evas_object_render_pre_prev_cur_add(Eina_Array *rects, Evas_Object *obj)
188{
189 evas_add_rect(rects,
190 obj->cur.cache.clip.x,
191 obj->cur.cache.clip.y,
192 obj->cur.cache.clip.w,
193 obj->cur.cache.clip.h);
194 evas_add_rect(rects,
195 obj->prev.cache.clip.x,
196 obj->prev.cache.clip.y,
197 obj->prev.cache.clip.w,
198 obj->prev.cache.clip.h);
199/*
200 evas_add_rect(rects,
201 obj->cur.geometry.x,
202 obj->cur.geometry.y,
203 obj->cur.geometry.w,
204 obj->cur.geometry.h);
205//// obj->cur.cache.geometry.x,
206//// obj->cur.cache.geometry.y,
207//// obj->cur.cache.geometry.w,
208//// obj->cur.cache.geometry.h);
209 evas_add_rect(rects,
210 obj->prev.geometry.x,
211 obj->prev.geometry.y,
212 obj->prev.geometry.w,
213 obj->prev.geometry.h);
214//// obj->prev.cache.geometry.x,
215//// obj->prev.cache.geometry.y,
216//// obj->prev.cache.geometry.w,
217//// obj->prev.cache.geometry.h);
218*/
219}
220
221void
222evas_object_clip_changes_clean(Evas_Object *obj)
223{
224 Eina_Rectangle *r;
225
226 EINA_LIST_FREE(obj->clip.changes, r) eina_rectangle_free(r);
227}
228
229void
230evas_object_render_pre_effect_updates(Eina_Array *rects, Evas_Object *obj, int is_v, int was_v)
231{
232 Eina_Rectangle *r;
233 Evas_Object *clipper;
234 Eina_List *l;
235 unsigned int i;
236 Eina_Array_Iterator it;
237 int x, y, w, h;
238
239 if (obj->smart.smart) goto end;
240 /* FIXME: was_v isn't used... why? */
241 was_v = 0;
242 if (!obj->clip.clipees)
243 {
244 EINA_ARRAY_ITER_NEXT(rects, i, r, it)
245 {
246 /* get updates and clip to current clip */
247 x = r->x;
248 y = r->y;
249 w = r->w;
250 h = r->h;
251 RECTS_CLIP_TO_RECT(x, y, w, h,
252 obj->cur.cache.clip.x,
253 obj->cur.cache.clip.y,
254 obj->cur.cache.clip.w,
255 obj->cur.cache.clip.h);
256 if ((w > 0) && (h > 0))
257 obj->layer->evas->engine.func->output_redraws_rect_add(obj->layer->evas->engine.data.output,
258 x, y, w, h);
259 /* get updates and clip to previous clip */
260 x = r->x;
261 y = r->y;
262 w = r->w;
263 h = r->h;
264 RECTS_CLIP_TO_RECT(x, y, w, h,
265 obj->prev.cache.clip.x,
266 obj->prev.cache.clip.y,
267 obj->prev.cache.clip.w,
268 obj->prev.cache.clip.h);
269 if ((w > 0) && (h > 0))
270 obj->layer->evas->engine.func->output_redraws_rect_add(obj->layer->evas->engine.data.output,
271 x, y, w, h);
272 }
273 /* if the object is actually visible, take any parent clip changes */
274 if (is_v)
275 {
276 clipper = obj->cur.clipper;
277 while (clipper)
278 {
279 EINA_LIST_FOREACH(clipper->clip.changes, l, r)
280 {
281 /* get updates and clip to current clip */
282 x = r->x; y = r->y; w = r->w; h = r->h;
283 RECTS_CLIP_TO_RECT(x, y, w, h,
284 obj->cur.cache.clip.x,
285 obj->cur.cache.clip.y,
286 obj->cur.cache.clip.w,
287 obj->cur.cache.clip.h);
288 if ((w > 0) && (h > 0))
289 obj->layer->evas->engine.func->output_redraws_rect_add(obj->layer->evas->engine.data.output,
290 x, y, w, h);
291 /* get updates and clip to previous clip */
292 x = r->x; y = r->y; w = r->w; h = r->h;
293 RECTS_CLIP_TO_RECT(x, y, w, h,
294 obj->prev.cache.clip.x,
295 obj->prev.cache.clip.y,
296 obj->prev.cache.clip.w,
297 obj->prev.cache.clip.h);
298 if ((w > 0) && (h > 0))
299 obj->layer->evas->engine.func->output_redraws_rect_add(obj->layer->evas->engine.data.output,
300 x, y, w, h);
301 }
302 clipper = clipper->cur.clipper;
303 }
304 }
305 }
306 else
307 {
308 evas_object_clip_changes_clean(obj);
309 EINA_ARRAY_ITER_NEXT(rects, i, r, it)
310 obj->clip.changes = eina_list_append(obj->clip.changes, r);
311 eina_array_clean(rects);
312 }
313
314 end:
315 EINA_ARRAY_ITER_NEXT(rects, i, r, it)
316 eina_rectangle_free(r);
317 eina_array_clean(rects);
318}
319
320int
321evas_object_was_in_output_rect(Evas_Object *obj, int x, int y, int w, int h)
322{
323 if (obj->smart.smart) return 0;
324 /* assumes coords have been recalced */
325 if ((RECTS_INTERSECT(x, y, w, h,
326 obj->prev.cache.clip.x,
327 obj->prev.cache.clip.y,
328 obj->prev.cache.clip.w,
329 obj->prev.cache.clip.h)))
330 return 1;
331 return 0;
332}
333
334int
335evas_object_was_opaque(Evas_Object *obj)
336{
337 if (obj->smart.smart) return 0;
338 if (obj->prev.cache.clip.a == 255)
339 {
340 if (obj->func->was_opaque)
341 return obj->func->was_opaque(obj);
342 return 1;
343 }
344 return 0;
345}
346
347int
348evas_object_is_inside(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
349{
350 if (obj->smart.smart) return 0;
351 if (obj->func->is_inside)
352 return obj->func->is_inside(obj, x, y);
353 return 0;
354}
355
356int
357evas_object_was_inside(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
358{
359 if (obj->smart.smart) return 0;
360 if (obj->func->was_inside)
361 return obj->func->was_inside(obj, x, y);
362 return 0;
363}
364/* routines apps will call */
365
366EAPI void
367evas_object_ref(Evas_Object *obj)
368{
369 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
370 return;
371 MAGIC_CHECK_END();
372 obj->ref++;
373 if (obj->ref == 0) obj->ref--;
374}
375
376EAPI void
377evas_object_unref(Evas_Object *obj)
378{
379 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
380 return;
381 MAGIC_CHECK_END();
382 if (obj->ref == 0) return;
383 obj->ref--;
384 if ((obj->del_ref) && (obj->ref == 0)) evas_object_del(obj);
385}
386
387EAPI void
388evas_object_del(Evas_Object *obj)
389{
390 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
391 return;
392 MAGIC_CHECK_END();
393
394 if (obj->delete_me) return;
395
396 if (obj->ref > 0)
397 {
398 obj->del_ref = 1;
399 return;
400 }
401#ifdef EVAS_FRAME_QUEUING
402 evas_common_frameq_flush();
403#endif
404
405 evas_object_hide(obj);
406 if (obj->focused)
407 {
408 obj->focused = 0;
409 obj->layer->evas->focused = NULL;
410 _evas_object_event_new();
411 evas_object_event_callback_call(obj, EVAS_CALLBACK_FOCUS_OUT, NULL);
412 _evas_post_event_callback_call(obj->layer->evas);
413 }
414 _evas_object_event_new();
415 evas_object_event_callback_call(obj, EVAS_CALLBACK_DEL, NULL);
416 _evas_post_event_callback_call(obj->layer->evas);
417 if (obj->mouse_grabbed > 0)
418 obj->layer->evas->pointer.mouse_grabbed -= obj->mouse_grabbed;
419 if ((obj->mouse_in) || (obj->mouse_grabbed > 0))
420 obj->layer->evas->pointer.object.in = eina_list_remove(obj->layer->evas->pointer.object.in, obj);
421 obj->mouse_grabbed = 0;
422 obj->mouse_in = 0;
423 if (obj->name) evas_object_name_set(obj, NULL);
424 if (!obj->layer)
425 {
426 evas_object_free(obj, 1);
427 return;
428 }
429 obj->layer->evas->pointer.mouse_grabbed -= obj->mouse_grabbed;
430 obj->mouse_grabbed = 0;
431 obj->mouse_in = 0;
432 evas_object_grabs_cleanup(obj);
433 while (obj->clip.clipees)
434 evas_object_clip_unset(obj->clip.clipees->data);
435 while (obj->proxy.proxies)
436 evas_object_image_source_unset(obj->proxy.proxies->data);
437 if (obj->cur.clipper) evas_object_clip_unset(obj);
438 if (obj->smart.smart) evas_object_smart_del(obj);
439 evas_object_map_set(obj, NULL);
440 _evas_object_event_new();
441 evas_object_event_callback_call(obj, EVAS_CALLBACK_FREE, NULL);
442 _evas_post_event_callback_call(obj->layer->evas);
443 evas_object_smart_cleanup(obj);
444 obj->delete_me = 1;
445 evas_object_change(obj);
446}
447
448EAPI void
449evas_object_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
450{
451 int is, was = 0, pass = 0, freeze = 0;
452
453 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
454 return;
455 MAGIC_CHECK_END();
456 if (obj->delete_me) return;
457 if (evas_object_intercept_call_move(obj, x, y)) return;
458 if (obj->doing.in_move > 0)
459 {
460 WRN("evas_object_move() called on object %p when in the middle of moving the same object", obj);
461 return;
462 }
463 if ((obj->cur.geometry.x == x) && (obj->cur.geometry.y == y)) return;
464 if (obj->layer->evas->events_frozen <= 0)
465 {
466 pass = evas_event_passes_through(obj);
467 freeze = evas_event_freezes_through(obj);
468 if ((!pass) && (!freeze))
469 was = evas_object_is_in_output_rect(obj,
470 obj->layer->evas->pointer.x,
471 obj->layer->evas->pointer.y, 1, 1);
472 }
473 obj->doing.in_move++;
474 if (obj->smart.smart)
475 {
476 if (obj->smart.smart->smart_class->move)
477 obj->smart.smart->smart_class->move(obj, x, y);
478 }
479 obj->cur.geometry.x = x;
480 obj->cur.geometry.y = y;
481//// obj->cur.cache.geometry.validity = 0;
482 obj->changed_move = 1;
483 evas_object_change(obj);
484 evas_object_clip_dirty(obj);
485 obj->doing.in_move--;
486 if (obj->layer->evas->events_frozen <= 0)
487 {
488 evas_object_recalc_clippees(obj);
489 if (!pass)
490 {
491 if (!obj->smart.smart)
492 {
493 is = evas_object_is_in_output_rect(obj,
494 obj->layer->evas->pointer.x,
495 obj->layer->evas->pointer.y, 1, 1);
496 if ((is ^ was) && obj->cur.visible)
497 evas_event_feed_mouse_move(obj->layer->evas,
498 obj->layer->evas->pointer.x,
499 obj->layer->evas->pointer.y,
500 obj->layer->evas->last_timestamp,
501 NULL);
502 }
503 }
504 }
505 evas_object_inform_call_move(obj);
506}
507
508EAPI void
509evas_object_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
510{
511 int is, was = 0, pass = 0, freeze =0;
512
513 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
514 return;
515 MAGIC_CHECK_END();
516 if (obj->delete_me) return;
517 if (w < 0) w = 0; if (h < 0) h = 0;
518 if (evas_object_intercept_call_resize(obj, w, h)) return;
519 if (obj->doing.in_resize > 0)
520 {
521 WRN("evas_object_resize() called on object %p when in the middle of resizing the same object", obj);
522 return;
523 }
524 if ((obj->cur.geometry.w == w) && (obj->cur.geometry.h == h)) return;
525 if (obj->layer->evas->events_frozen <= 0)
526 {
527 pass = evas_event_passes_through(obj);
528 freeze = evas_event_freezes_through(obj);
529 if ((!pass) && (!freeze))
530 was = evas_object_is_in_output_rect(obj,
531 obj->layer->evas->pointer.x,
532 obj->layer->evas->pointer.y, 1, 1);
533 }
534 obj->doing.in_resize++;
535 if (obj->smart.smart)
536 {
537 if (obj->smart.smart->smart_class->resize)
538 obj->smart.smart->smart_class->resize(obj, w, h);
539 }
540 obj->cur.geometry.w = w;
541 obj->cur.geometry.h = h;
542//// obj->cur.cache.geometry.validity = 0;
543 evas_object_change(obj);
544 evas_object_clip_dirty(obj);
545 obj->doing.in_resize--;
546 /* NB: evas_object_recalc_clippees was here previously ( < 08/07/2009) */
547 if (obj->layer->evas->events_frozen <= 0)
548 {
549 /* NB: If this creates glitches on screen then move to above position */
550 evas_object_recalc_clippees(obj);
551
552 // if (obj->func->coords_recalc) obj->func->coords_recalc(obj);
553 if (!pass)
554 {
555 if (!obj->smart.smart)
556 {
557 is = evas_object_is_in_output_rect(obj,
558 obj->layer->evas->pointer.x,
559 obj->layer->evas->pointer.y, 1, 1);
560 if ((is ^ was) && (obj->cur.visible))
561 evas_event_feed_mouse_move(obj->layer->evas,
562 obj->layer->evas->pointer.x,
563 obj->layer->evas->pointer.y,
564 obj->layer->evas->last_timestamp,
565 NULL);
566 }
567 }
568 }
569 evas_object_inform_call_resize(obj);
570}
571
572EAPI void
573evas_object_geometry_get(const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
574{
575 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
576 if (x) *x = 0; if (y) *y = 0; if (w) *w = 0; if (h) *h = 0;
577 return;
578 MAGIC_CHECK_END();
579 if (obj->delete_me)
580 {
581 if (x) *x = 0; if (y) *y = 0; if (w) *w = 0; if (h) *h = 0;
582 return;
583 }
584 if (x) *x = obj->cur.geometry.x;
585 if (y) *y = obj->cur.geometry.y;
586 if (w) *w = obj->cur.geometry.w;
587 if (h) *h = obj->cur.geometry.h;
588}
589
590static void
591_evas_object_size_hint_alloc(Evas_Object *obj)
592{
593 if (obj->size_hints) return;
594
595 EVAS_MEMPOOL_INIT(_mp_sh, "evas_size_hints", Evas_Size_Hints, 512, );
596 obj->size_hints = EVAS_MEMPOOL_ALLOC(_mp_sh, Evas_Size_Hints);
597 if (!obj->size_hints) return;
598 EVAS_MEMPOOL_PREP(_mp_sh, obj->size_hints, Evas_Size_Hints);
599 obj->size_hints->max.w = -1;
600 obj->size_hints->max.h = -1;
601 obj->size_hints->align.x = 0.5;
602 obj->size_hints->align.y = 0.5;
603}
604
605EAPI void
606evas_object_size_hint_min_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h)
607{
608 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
609 if (w) *w = 0; if (h) *h = 0;
610 return;
611 MAGIC_CHECK_END();
612 if ((!obj->size_hints) || obj->delete_me)
613 {
614 if (w) *w = 0; if (h) *h = 0;
615 return;
616 }
617 if (w) *w = obj->size_hints->min.w;
618 if (h) *h = obj->size_hints->min.h;
619}
620
621EAPI void
622evas_object_size_hint_min_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
623{
624 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
625 return;
626 MAGIC_CHECK_END();
627 if (obj->delete_me)
628 return;
629 _evas_object_size_hint_alloc(obj);
630 if ((obj->size_hints->min.w == w) && (obj->size_hints->min.h == h)) return;
631 obj->size_hints->min.w = w;
632 obj->size_hints->min.h = h;
633
634 evas_object_inform_call_changed_size_hints(obj);
635}
636
637EAPI void
638evas_object_size_hint_max_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h)
639{
640 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
641 if (w) *w = -1; if (h) *h = -1;
642 return;
643 MAGIC_CHECK_END();
644 if ((!obj->size_hints) || obj->delete_me)
645 {
646 if (w) *w = -1; if (h) *h = -1;
647 return;
648 }
649 if (w) *w = obj->size_hints->max.w;
650 if (h) *h = obj->size_hints->max.h;
651}
652
653EAPI void
654evas_object_size_hint_max_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
655{
656 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
657 return;
658 MAGIC_CHECK_END();
659 if (obj->delete_me)
660 return;
661 _evas_object_size_hint_alloc(obj);
662 if ((obj->size_hints->max.w == w) && (obj->size_hints->max.h == h)) return;
663 obj->size_hints->max.w = w;
664 obj->size_hints->max.h = h;
665
666 evas_object_inform_call_changed_size_hints(obj);
667}
668
669EAPI void
670evas_object_size_hint_request_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h)
671{
672 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
673 if (w) *w = 0; if (h) *h = 0;
674 return;
675 MAGIC_CHECK_END();
676 if ((!obj->size_hints) || obj->delete_me)
677 {
678 if (w) *w = 0; if (h) *h = 0;
679 return;
680 }
681 if (w) *w = obj->size_hints->request.w;
682 if (h) *h = obj->size_hints->request.h;
683}
684
685EAPI void
686evas_object_size_hint_request_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
687{
688 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
689 return;
690 MAGIC_CHECK_END();
691 if (obj->delete_me)
692 return;
693 _evas_object_size_hint_alloc(obj);
694 if ((obj->size_hints->request.w == w) && (obj->size_hints->request.h == h)) return;
695 obj->size_hints->request.w = w;
696 obj->size_hints->request.h = h;
697
698 evas_object_inform_call_changed_size_hints(obj);
699}
700
701EAPI void
702evas_object_size_hint_aspect_get(const Evas_Object *obj, Evas_Aspect_Control *aspect, Evas_Coord *w, Evas_Coord *h)
703{
704 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
705 if (aspect) *aspect = EVAS_ASPECT_CONTROL_NONE;
706 if (w) *w = 0; if (h) *h = 0;
707 return;
708 MAGIC_CHECK_END();
709 if ((!obj->size_hints) || obj->delete_me)
710 {
711 if (aspect) *aspect = EVAS_ASPECT_CONTROL_NONE;
712 if (w) *w = 0; if (h) *h = 0;
713 return;
714 }
715 if (aspect) *aspect = obj->size_hints->aspect.mode;
716 if (w) *w = obj->size_hints->aspect.size.w;
717 if (h) *h = obj->size_hints->aspect.size.h;
718}
719
720EAPI void
721evas_object_size_hint_aspect_set(Evas_Object *obj, Evas_Aspect_Control aspect, Evas_Coord w, Evas_Coord h)
722{
723 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
724 return;
725 MAGIC_CHECK_END();
726 if (obj->delete_me)
727 return;
728 _evas_object_size_hint_alloc(obj);
729 if ((obj->size_hints->aspect.mode == aspect) && (obj->size_hints->aspect.size.w == w) && (obj->size_hints->aspect.size.h == h)) return;
730 obj->size_hints->aspect.mode = aspect;
731 obj->size_hints->aspect.size.w = w;
732 obj->size_hints->aspect.size.h = h;
733
734 evas_object_inform_call_changed_size_hints(obj);
735}
736
737EAPI void
738evas_object_size_hint_align_get(const Evas_Object *obj, double *x, double *y)
739{
740 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
741 if (x) *x = 0.5; if (y) *y = 0.5;
742 return;
743 MAGIC_CHECK_END();
744 if ((!obj->size_hints) || obj->delete_me)
745 {
746 if (x) *x = 0.5; if (y) *y = 0.5;
747 return;
748 }
749 if (x) *x = obj->size_hints->align.x;
750 if (y) *y = obj->size_hints->align.y;
751}
752
753EAPI void
754evas_object_size_hint_align_set(Evas_Object *obj, double x, double y)
755{
756 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
757 return;
758 MAGIC_CHECK_END();
759 if (obj->delete_me)
760 return;
761 _evas_object_size_hint_alloc(obj);
762 if ((obj->size_hints->align.x == x) && (obj->size_hints->align.y == y)) return;
763 obj->size_hints->align.x = x;
764 obj->size_hints->align.y = y;
765
766 evas_object_inform_call_changed_size_hints(obj);
767}
768
769EAPI void
770evas_object_size_hint_weight_get(const Evas_Object *obj, double *x, double *y)
771{
772 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
773 if (x) *x = 0.0; if (y) *y = 0.0;
774 return;
775 MAGIC_CHECK_END();
776 if ((!obj->size_hints) || obj->delete_me)
777 {
778 if (x) *x = 0.0; if (y) *y = 0.0;
779 return;
780 }
781 if (x) *x = obj->size_hints->weight.x;
782 if (y) *y = obj->size_hints->weight.y;
783}
784
785EAPI void
786evas_object_size_hint_weight_set(Evas_Object *obj, double x, double y)
787{
788 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
789 return;
790 MAGIC_CHECK_END();
791 if (obj->delete_me)
792 return;
793 _evas_object_size_hint_alloc(obj);
794 if ((obj->size_hints->weight.x == x) && (obj->size_hints->weight.y == y)) return;
795 obj->size_hints->weight.x = x;
796 obj->size_hints->weight.y = y;
797
798 evas_object_inform_call_changed_size_hints(obj);
799}
800
801EAPI void
802evas_object_size_hint_padding_get(const Evas_Object *obj, Evas_Coord *l, Evas_Coord *r, Evas_Coord *t, Evas_Coord *b)
803{
804 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
805 if (l) *l = 0; if (r) *r = 0;
806 if (t) *t = 0; if (b) *b = 0;
807 return;
808 MAGIC_CHECK_END();
809 if ((!obj->size_hints) || obj->delete_me)
810 {
811 if (l) *l = 0; if (r) *r = 0;
812 if (t) *t = 0; if (b) *b = 0;
813 return;
814 }
815 if (l) *l = obj->size_hints->padding.l;
816 if (r) *r = obj->size_hints->padding.r;
817 if (t) *t = obj->size_hints->padding.t;
818 if (b) *b = obj->size_hints->padding.b;
819}
820
821EAPI void
822evas_object_size_hint_padding_set(Evas_Object *obj, Evas_Coord l, Evas_Coord r, Evas_Coord t, Evas_Coord b)
823{
824 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
825 return;
826 MAGIC_CHECK_END();
827 if (obj->delete_me)
828 return;
829 _evas_object_size_hint_alloc(obj);
830 if ((obj->size_hints->padding.l == l) && (obj->size_hints->padding.r == r) && (obj->size_hints->padding.t == t) && (obj->size_hints->padding.b == b)) return;
831 obj->size_hints->padding.l = l;
832 obj->size_hints->padding.r = r;
833 obj->size_hints->padding.t = t;
834 obj->size_hints->padding.b = b;
835
836 evas_object_inform_call_changed_size_hints(obj);
837}
838
839EAPI void
840evas_object_show(Evas_Object *obj)
841{
842 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
843 return;
844 MAGIC_CHECK_END();
845 if (obj->delete_me) return;
846 if (evas_object_intercept_call_show(obj)) return;
847 if (obj->smart.smart)
848 {
849 if (obj->smart.smart->smart_class->show)
850 obj->smart.smart->smart_class->show(obj);
851 }
852 if (obj->cur.visible)
853 {
854 return;
855 }
856 obj->cur.visible = 1;
857 evas_object_change(obj);
858 evas_object_clip_dirty(obj);
859 if (obj->layer->evas->events_frozen <= 0)
860 {
861 evas_object_clip_across_clippees_check(obj);
862 evas_object_recalc_clippees(obj);
863 if ((!evas_event_passes_through(obj)) &&
864 (!evas_event_freezes_through(obj)))
865 {
866 if (!obj->smart.smart)
867 {
868 if (evas_object_is_in_output_rect(obj,
869 obj->layer->evas->pointer.x,
870 obj->layer->evas->pointer.y, 1, 1))
871 evas_event_feed_mouse_move(obj->layer->evas,
872 obj->layer->evas->pointer.x,
873 obj->layer->evas->pointer.y,
874 obj->layer->evas->last_timestamp,
875 NULL);
876 }
877 }
878 }
879 evas_object_inform_call_show(obj);
880}
881
882EAPI void
883evas_object_hide(Evas_Object *obj)
884{
885 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
886 return;
887 MAGIC_CHECK_END();
888 if (obj->delete_me) return;
889 if (evas_object_intercept_call_hide(obj)) return;
890 if (obj->smart.smart)
891 {
892 if (obj->smart.smart->smart_class->hide)
893 obj->smart.smart->smart_class->hide(obj);
894 }
895 if (!obj->cur.visible)
896 {
897 return;
898 }
899 obj->cur.visible = 0;
900 evas_object_change(obj);
901 evas_object_clip_dirty(obj);
902 if (obj->layer->evas->events_frozen <= 0)
903 {
904 evas_object_clip_across_clippees_check(obj);
905 evas_object_recalc_clippees(obj);
906 if ((!evas_event_passes_through(obj)) &&
907 (!evas_event_freezes_through(obj)))
908 {
909 if ((!obj->smart.smart) ||
910 ((obj->cur.map) && (obj->cur.map->count == 4) && (obj->cur.usemap)))
911 {
912 if (!obj->mouse_grabbed)
913 {
914 if (evas_object_is_in_output_rect(obj,
915 obj->layer->evas->pointer.x,
916 obj->layer->evas->pointer.y, 1, 1))
917 evas_event_feed_mouse_move(obj->layer->evas,
918 obj->layer->evas->pointer.x,
919 obj->layer->evas->pointer.y,
920 obj->layer->evas->last_timestamp,
921 NULL);
922 }
923/* this is at odds to handling events when an obj is moved out of the mouse
924 * ore resized out or clipped out. if mouse is grabbed - regardless of
925 * visibility, mouse move events should keep happening and mouse up.
926 * for better or worse it's at least consistent.
927 if (obj->delete_me) return;
928 if (obj->mouse_grabbed > 0)
929 obj->layer->evas->pointer.mouse_grabbed -= obj->mouse_grabbed;
930 if ((obj->mouse_in) || (obj->mouse_grabbed > 0))
931 obj->layer->evas->pointer.object.in = eina_list_remove(obj->layer->evas->pointer.object.in, obj);
932 obj->mouse_grabbed = 0;
933 if (obj->layer->evas->events_frozen > 0)
934 {
935 obj->mouse_in = 0;
936 return;
937 }
938 if (obj->mouse_in)
939 {
940 Evas_Event_Mouse_Out ev;
941
942 _evas_object_event_new();
943
944 obj->mouse_in = 0;
945 ev.buttons = obj->layer->evas->pointer.button;
946 ev.output.x = obj->layer->evas->pointer.x;
947 ev.output.y = obj->layer->evas->pointer.y;
948 ev.canvas.x = obj->layer->evas->pointer.x;
949 ev.canvas.y = obj->layer->evas->pointer.y;
950 ev.data = NULL;
951 ev.modifiers = &(obj->layer->evas->modifiers);
952 ev.locks = &(obj->layer->evas->locks);
953 ev.timestamp = obj->layer->evas->last_timestamp;
954 ev.event_flags = EVAS_EVENT_FLAG_NONE;
955 evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_OUT, &ev);
956 _evas_post_event_callback_call(obj->layer->evas);
957 }
958 */
959 }
960 }
961 }
962 else
963 {
964/*
965 if (obj->mouse_grabbed > 0)
966 obj->layer->evas->pointer.mouse_grabbed -= obj->mouse_grabbed;
967 if ((obj->mouse_in) || (obj->mouse_grabbed > 0))
968 obj->layer->evas->pointer.object.in = eina_list_remove(obj->layer->evas->pointer.object.in, obj);
969 obj->mouse_grabbed = 0;
970 obj->mouse_in = 0;
971 */
972 }
973 evas_object_inform_call_hide(obj);
974}
975
976EAPI Eina_Bool
977evas_object_visible_get(const Evas_Object *obj)
978{
979 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
980 return 0;
981 MAGIC_CHECK_END();
982 if (obj->delete_me) return 0;
983 return obj->cur.visible;
984}
985
986EAPI void
987evas_object_color_set(Evas_Object *obj, int r, int g, int b, int a)
988{
989 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
990 return;
991 MAGIC_CHECK_END();
992 if (obj->delete_me) return;
993 if (r > 255) r = 255; if (r < 0) r = 0;
994 if (g > 255) g = 255; if (g < 0) g = 0;
995 if (b > 255) b = 255; if (b < 0) b = 0;
996 if (a > 255) a = 255; if (a < 0) a = 0;
997 if (evas_object_intercept_call_color_set(obj, r, g, b, a)) return;
998 if (obj->smart.smart)
999 {
1000 if (obj->smart.smart->smart_class->color_set)
1001 obj->smart.smart->smart_class->color_set(obj, r, g, b, a);
1002 }
1003 if ((obj->cur.color.r == r) &&
1004 (obj->cur.color.g == g) &&
1005 (obj->cur.color.b == b) &&
1006 (obj->cur.color.a == a)) return;
1007 obj->cur.color.r = r;
1008 obj->cur.color.g = g;
1009 obj->cur.color.b = b;
1010 evas_object_clip_dirty(obj);
1011 if ((obj->cur.color.a == 0) && (a == 0) && (obj->cur.render_op == EVAS_RENDER_BLEND)) return;
1012 obj->cur.color.a = a;
1013 evas_object_change(obj);
1014}
1015
1016EAPI void
1017evas_object_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a)
1018{
1019 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1020 if (r) *r = 0; if (g) *g = 0; if (b) *b = 0; if (a) *a = 0;
1021 return;
1022 MAGIC_CHECK_END();
1023 if (obj->delete_me)
1024 {
1025 if (r) *r = 0; if (g) *g = 0; if (b) *b = 0; if (a) *a = 0;
1026 return;
1027 }
1028 if (r) *r = obj->cur.color.r;
1029 if (g) *g = obj->cur.color.g;
1030 if (b) *b = obj->cur.color.b;
1031 if (a) *a = obj->cur.color.a;
1032}
1033
1034EAPI void
1035evas_object_anti_alias_set(Evas_Object *obj, Eina_Bool anti_alias)
1036{
1037 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1038 return;
1039 MAGIC_CHECK_END();
1040 if (obj->delete_me) return;
1041 anti_alias = !!anti_alias;
1042 if (obj->cur.anti_alias == anti_alias)return;
1043 obj->cur.anti_alias = anti_alias;
1044 evas_object_change(obj);
1045}
1046
1047EAPI Eina_Bool
1048evas_object_anti_alias_get(const Evas_Object *obj)
1049{
1050 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1051 return 0;
1052 MAGIC_CHECK_END();
1053 if (obj->delete_me) return 0;
1054 return obj->cur.anti_alias;
1055}
1056
1057EAPI void
1058evas_object_scale_set(Evas_Object *obj, double scale)
1059{
1060 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1061 return;
1062 MAGIC_CHECK_END();
1063 if (obj->delete_me) return;
1064 if (obj->cur.scale == scale) return;
1065 obj->cur.scale = scale;
1066 evas_object_change(obj);
1067 if (obj->func->scale_update) obj->func->scale_update(obj);
1068}
1069
1070EAPI double
1071evas_object_scale_get(const Evas_Object *obj)
1072{
1073 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1074 return 0;
1075 MAGIC_CHECK_END();
1076 if (obj->delete_me) return 1.0;
1077 return obj->cur.scale;
1078}
1079
1080EAPI void
1081evas_object_render_op_set(Evas_Object *obj, Evas_Render_Op render_op)
1082{
1083 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1084 return;
1085 MAGIC_CHECK_END();
1086 if (obj->delete_me) return;
1087 if ((Evas_Render_Op)obj->cur.render_op == render_op)
1088 return;
1089 obj->cur.render_op = render_op;
1090 evas_object_change(obj);
1091}
1092
1093EAPI Evas_Render_Op
1094evas_object_render_op_get(const Evas_Object *obj)
1095{
1096 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1097 return 0;
1098 MAGIC_CHECK_END();
1099 if (obj->delete_me) return EVAS_RENDER_BLEND;
1100 return obj->cur.render_op;
1101}
1102
1103EAPI Evas *
1104evas_object_evas_get(const Evas_Object *obj)
1105{
1106 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1107 return NULL;
1108 MAGIC_CHECK_END();
1109 if (obj->delete_me) return NULL;
1110 return obj->layer->evas;
1111}
1112
1113EAPI Evas_Object *
1114evas_object_top_at_xy_get(const Evas *e, Evas_Coord x, Evas_Coord y, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
1115{
1116 Evas_Layer *lay;
1117 int xx, yy;
1118
1119 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
1120 return NULL;
1121 MAGIC_CHECK_END();
1122 xx = x;
1123 yy = y;
1124//// xx = evas_coord_world_x_to_screen(e, x);
1125//// yy = evas_coord_world_y_to_screen(e, y);
1126 EINA_INLIST_REVERSE_FOREACH((EINA_INLIST_GET(e->layers)), lay)
1127 {
1128 Evas_Object *obj;
1129
1130 EINA_INLIST_REVERSE_FOREACH(get_layer_objects(lay), obj)
1131 {
1132 if (obj->delete_me) continue;
1133 if ((!include_pass_events_objects) &&
1134 (evas_event_passes_through(obj))) continue;
1135 if ((!include_hidden_objects) && (!obj->cur.visible)) continue;
1136 evas_object_clip_recalc(obj);
1137 if ((evas_object_is_in_output_rect(obj, xx, yy, 1, 1)) &&
1138 (!obj->clip.clipees))
1139 return obj;
1140 }
1141 }
1142 return NULL;
1143}
1144
1145EAPI Evas_Object *
1146evas_object_top_at_pointer_get(const Evas *e)
1147{
1148 return evas_object_top_at_xy_get(e, e->pointer.x, e->pointer.y, EINA_TRUE,
1149 EINA_TRUE);
1150}
1151
1152EAPI Evas_Object *
1153evas_object_top_in_rectangle_get(const Evas *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
1154{
1155 Evas_Layer *lay;
1156 int xx, yy, ww, hh;
1157
1158 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
1159 return NULL;
1160 MAGIC_CHECK_END();
1161 xx = x;
1162 yy = y;
1163 ww = w;
1164 hh = h;
1165//// xx = evas_coord_world_x_to_screen(e, x);
1166//// yy = evas_coord_world_y_to_screen(e, y);
1167//// ww = evas_coord_world_x_to_screen(e, w);
1168//// hh = evas_coord_world_y_to_screen(e, h);
1169 if (ww < 1) ww = 1;
1170 if (hh < 1) hh = 1;
1171 EINA_INLIST_REVERSE_FOREACH((EINA_INLIST_GET(e->layers)), lay)
1172 {
1173 Evas_Object *obj;
1174
1175 EINA_INLIST_REVERSE_FOREACH(get_layer_objects(lay), obj)
1176 {
1177 if (obj->delete_me) continue;
1178 if ((!include_pass_events_objects) &&
1179 (evas_event_passes_through(obj))) continue;
1180 if ((!include_hidden_objects) && (!obj->cur.visible)) continue;
1181 evas_object_clip_recalc(obj);
1182 if ((evas_object_is_in_output_rect(obj, xx, yy, ww, hh)) &&
1183 (!obj->clip.clipees))
1184 return obj;
1185 }
1186 }
1187 return NULL;
1188}
1189
1190EAPI Eina_List *
1191evas_objects_at_xy_get(const Evas *e, Evas_Coord x, Evas_Coord y, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
1192{
1193 Eina_List *in = NULL;
1194 Evas_Layer *lay;
1195 int xx, yy;
1196
1197 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
1198 return NULL;
1199 MAGIC_CHECK_END();
1200 xx = x;
1201 yy = y;
1202//// xx = evas_coord_world_x_to_screen(e, x);
1203//// yy = evas_coord_world_y_to_screen(e, y);
1204 EINA_INLIST_REVERSE_FOREACH((EINA_INLIST_GET(e->layers)), lay)
1205 {
1206 Evas_Object *obj;
1207
1208 EINA_INLIST_REVERSE_FOREACH(get_layer_objects(lay), obj)
1209 {
1210 if (obj->delete_me) continue;
1211 if ((!include_pass_events_objects) &&
1212 (evas_event_passes_through(obj))) continue;
1213 if ((!include_hidden_objects) && (!obj->cur.visible)) continue;
1214 evas_object_clip_recalc(obj);
1215 if ((evas_object_is_in_output_rect(obj, xx, yy, 1, 1)) &&
1216 (!obj->clip.clipees))
1217 in = eina_list_prepend(in, obj);
1218 }
1219 }
1220 return in;
1221}
1222
1223/**
1224 * Retrieves the objects in the given rectangle region
1225 * @param e The given evas object.
1226 * @param x The horizontal coordinate.
1227 * @param y The vertical coordinate.
1228 * @param w The width size.
1229 * @param h The height size.
1230 * @param include_pass_events_objects Boolean Flag to include or not pass events objects
1231 * @param include_hidden_objects Boolean Flag to include or not hidden objects
1232 * @return The list of evas object in the rectangle region.
1233 *
1234 */
1235EAPI Eina_List *
1236evas_objects_in_rectangle_get(const Evas *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
1237{
1238 Eina_List *in = NULL;
1239 Evas_Layer *lay;
1240 int xx, yy, ww, hh;
1241
1242 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
1243 return NULL;
1244 MAGIC_CHECK_END();
1245 xx = x;
1246 yy = y;
1247 ww = w;
1248 hh = h;
1249//// xx = evas_coord_world_x_to_screen(e, x);
1250//// yy = evas_coord_world_y_to_screen(e, y);
1251//// ww = evas_coord_world_x_to_screen(e, w);
1252//// hh = evas_coord_world_y_to_screen(e, h);
1253 if (ww < 1) ww = 1;
1254 if (hh < 1) hh = 1;
1255 EINA_INLIST_REVERSE_FOREACH((EINA_INLIST_GET(e->layers)), lay)
1256 {
1257 Evas_Object *obj;
1258
1259 EINA_INLIST_REVERSE_FOREACH(get_layer_objects(lay), obj)
1260 {
1261 if (obj->delete_me) continue;
1262 if ((!include_pass_events_objects) &&
1263 (evas_event_passes_through(obj))) continue;
1264 if ((!include_hidden_objects) && (!obj->cur.visible)) continue;
1265 evas_object_clip_recalc(obj);
1266 if ((evas_object_is_in_output_rect(obj, xx, yy, ww, hh)) &&
1267 (!obj->clip.clipees))
1268 in = eina_list_prepend(in, obj);
1269 }
1270 }
1271 return in;
1272}
1273
1274EAPI const char *
1275evas_object_type_get(const Evas_Object *obj)
1276{
1277 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1278 return NULL;
1279 MAGIC_CHECK_END();
1280 if (obj->delete_me) return "";
1281 return obj->type;
1282}
1283
1284EAPI void
1285evas_object_precise_is_inside_set(Evas_Object *obj, Eina_Bool precise)
1286{
1287 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1288 return;
1289 MAGIC_CHECK_END();
1290 obj->precise_is_inside = precise;
1291}
1292
1293EAPI Eina_Bool
1294evas_object_precise_is_inside_get(const Evas_Object *obj)
1295{
1296 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1297 return 0;
1298 MAGIC_CHECK_END();
1299 return obj->precise_is_inside;
1300}
1301
1302EAPI void
1303evas_object_static_clip_set(Evas_Object *obj, Eina_Bool is_static_clip)
1304{
1305 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1306 return;
1307 MAGIC_CHECK_END();
1308 obj->is_static_clip = is_static_clip;
1309}
1310
1311EAPI Eina_Bool
1312evas_object_static_clip_get(const Evas_Object *obj)
1313{
1314 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1315 return 0;
1316 MAGIC_CHECK_END();
1317 return obj->is_static_clip;
1318}
1319
diff --git a/libraries/evas/src/lib/canvas/evas_object_polygon.c b/libraries/evas/src/lib/canvas/evas_object_polygon.c
new file mode 100644
index 0000000..cbc1802
--- /dev/null
+++ b/libraries/evas/src/lib/canvas/evas_object_polygon.c
@@ -0,0 +1,554 @@
1#include "evas_common.h"
2#include "evas_private.h"
3
4/* private magic number for polygon objects */
5static const char o_type[] = "polygon";
6
7/* private struct for line object internal data */
8typedef struct _Evas_Object_Polygon Evas_Object_Polygon;
9typedef struct _Evas_Polygon_Point Evas_Polygon_Point;
10
11struct _Evas_Object_Polygon
12{
13 DATA32 magic;
14 Eina_List *points;
15 void *engine_data;
16 struct {
17 int x, y;
18 } offset;
19 Evas_Coord_Rectangle geometry;
20 char changed : 1;
21};
22
23struct _Evas_Polygon_Point
24{
25 Evas_Coord x, y;
26};
27
28/* private methods for polygon objects */
29static void evas_object_polygon_init(Evas_Object *obj);
30static void *evas_object_polygon_new(void);
31static void evas_object_polygon_render(Evas_Object *obj, void *output, void *context, void *surface, int x, int y);
32static void evas_object_polygon_free(Evas_Object *obj);
33static void evas_object_polygon_render_pre(Evas_Object *obj);
34static void evas_object_polygon_render_post(Evas_Object *obj);
35
36static unsigned int evas_object_polygon_id_get(Evas_Object *obj);
37static unsigned int evas_object_polygon_visual_id_get(Evas_Object *obj);
38static void *evas_object_polygon_engine_data_get(Evas_Object *obj);
39
40static int evas_object_polygon_is_opaque(Evas_Object *obj);
41static int evas_object_polygon_was_opaque(Evas_Object *obj);
42static int evas_object_polygon_is_inside(Evas_Object *obj, Evas_Coord x, Evas_Coord y);
43static int evas_object_polygon_was_inside(Evas_Object *obj, Evas_Coord x, Evas_Coord y);
44
45static const Evas_Object_Func object_func =
46{
47 /* methods (compulsory) */
48 evas_object_polygon_free,
49 evas_object_polygon_render,
50 evas_object_polygon_render_pre,
51 evas_object_polygon_render_post,
52 evas_object_polygon_id_get,
53 evas_object_polygon_visual_id_get,
54 evas_object_polygon_engine_data_get,
55 /* these are optional. NULL = nothing */
56 NULL,
57 NULL,
58 NULL,
59 NULL,
60 evas_object_polygon_is_opaque,
61 evas_object_polygon_was_opaque,
62 evas_object_polygon_is_inside,
63 evas_object_polygon_was_inside,
64 NULL,
65 NULL,
66 NULL,
67 NULL,
68 NULL
69};
70
71/* the actual api call to add a rect */
72/* it has no other api calls as all properties are standard */
73
74EVAS_MEMPOOL(_mp_obj);
75
76EAPI Evas_Object *
77evas_object_polygon_add(Evas *e)
78{
79 Evas_Object *obj;
80
81 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
82 return NULL;
83 MAGIC_CHECK_END();
84 obj = evas_object_new(e);
85 evas_object_polygon_init(obj);
86 evas_object_inject(obj, e);
87 return obj;
88}
89
90EAPI void
91evas_object_polygon_point_add(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
92{
93 Evas_Object_Polygon *o;
94 Evas_Polygon_Point *p;
95 Evas_Coord min_x, max_x, min_y, max_y;
96 int is, was = 0;
97
98 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
99 return;
100 MAGIC_CHECK_END();
101 o = (Evas_Object_Polygon *)(obj->object_data);
102 MAGIC_CHECK(o, Evas_Object_Polygon, MAGIC_OBJ_POLYGON);
103 return;
104 MAGIC_CHECK_END();
105
106 if (obj->layer->evas->events_frozen <= 0)
107 {
108 if (!evas_event_passes_through(obj) &&
109 !evas_event_freezes_through(obj))
110 was = evas_object_is_in_output_rect(obj,
111 obj->layer->evas->pointer.x,
112 obj->layer->evas->pointer.y,
113 1, 1);
114 }
115 if (!o->points)
116 {
117 o->offset.x = obj->cur.geometry.x;
118 o->offset.y = obj->cur.geometry.y;
119 }
120 else
121 {
122 /* Update all points and take offset into account. */
123 Eina_List *over;
124
125 EINA_LIST_FOREACH(o->points, over, p)
126 {
127 p->x += o->offset.x;
128 p->y += o->offset.y;
129 }
130 }
131
132 p = malloc(sizeof(Evas_Polygon_Point));
133 if (!p) return;
134 p->x = x + o->offset.x;
135 p->y = y + o->offset.y;
136
137 if (!o->points)
138 {
139 obj->cur.geometry.x = p->x;
140 obj->cur.geometry.y = p->y;
141 obj->cur.geometry.w = 2;
142 obj->cur.geometry.h = 2;
143 }
144 else
145 {
146 if (p->x < obj->cur.geometry.x) min_x = p->x;
147 else min_x = obj->cur.geometry.x;
148 if (p->x > (obj->cur.geometry.x + obj->cur.geometry.w - 2))
149 max_x = p->x;
150 else max_x = obj->cur.geometry.x + obj->cur.geometry.w - 2;
151 if (p->y < obj->cur.geometry.y) min_y = p->y;
152 else min_y = obj->cur.geometry.y;
153 if (p->y > (obj->cur.geometry.y + obj->cur.geometry.h - 2))
154 max_y = p->y;
155 else max_y = obj->cur.geometry.y + obj->cur.geometry.h - 2;
156 obj->cur.geometry.x = min_x;
157 obj->cur.geometry.y = min_y;
158 obj->cur.geometry.w = max_x - min_x + 2;
159 obj->cur.geometry.h = max_y - min_y + 2;
160 }
161 o->points = eina_list_append(o->points, p);
162
163 o->geometry = obj->cur.geometry;
164 o->offset.x = 0;
165 o->offset.y = 0;
166
167 //// obj->cur.cache.geometry.validity = 0;
168 o->changed = EINA_TRUE;
169 evas_object_change(obj);
170 evas_object_clip_dirty(obj);
171 evas_object_coords_recalc(obj);
172 if (obj->layer->evas->events_frozen <= 0)
173 {
174 is = evas_object_is_in_output_rect(obj,
175 obj->layer->evas->pointer.x,
176 obj->layer->evas->pointer.y, 1, 1);
177 if (!evas_event_passes_through(obj) &&
178 !evas_event_freezes_through(obj) )
179 {
180 if ((is ^ was) && obj->cur.visible)
181 evas_event_feed_mouse_move(obj->layer->evas,
182 obj->layer->evas->pointer.x,
183 obj->layer->evas->pointer.y,
184 obj->layer->evas->last_timestamp,
185 NULL);
186 }
187 }
188 evas_object_inform_call_move(obj);
189 evas_object_inform_call_resize(obj);
190}
191
192EAPI void
193evas_object_polygon_points_clear(Evas_Object *obj)
194{
195 Evas_Object_Polygon *o;
196 int is, was;
197
198 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
199 return;
200 MAGIC_CHECK_END();
201 o = (Evas_Object_Polygon *)(obj->object_data);
202 MAGIC_CHECK(o, Evas_Object_Polygon, MAGIC_OBJ_POLYGON);
203 return;
204 MAGIC_CHECK_END();
205 was = evas_object_is_in_output_rect(obj,
206 obj->layer->evas->pointer.x,
207 obj->layer->evas->pointer.y, 1, 1);
208 while (o->points)
209 {
210 free(o->points->data);
211 o->points = eina_list_remove(o->points, o->points->data);
212 }
213 obj->cur.geometry.x = 0;
214 obj->cur.geometry.y = 0;
215 obj->cur.geometry.w = 0;
216 obj->cur.geometry.h = 0;
217 //// obj->cur.cache.geometry.validity = 0;
218 o->changed = EINA_TRUE;
219 evas_object_change(obj);
220 evas_object_clip_dirty(obj);
221 evas_object_coords_recalc(obj);
222 is = evas_object_is_in_output_rect(obj,
223 obj->layer->evas->pointer.x,
224 obj->layer->evas->pointer.y, 1, 1);
225 if ((is || was) && obj->cur.visible)
226 evas_event_feed_mouse_move(obj->layer->evas,
227 obj->layer->evas->pointer.x,
228 obj->layer->evas->pointer.y,
229 obj->layer->evas->last_timestamp,
230 NULL);
231 evas_object_inform_call_move(obj);
232 evas_object_inform_call_resize(obj);
233}
234
235/* all nice and private */
236static void
237evas_object_polygon_init(Evas_Object *obj)
238{
239 /* alloc image ob, setup methods and default values */
240 obj->object_data = evas_object_polygon_new();
241 /* set up default settings for this kind of object */
242 obj->cur.color.r = 255;
243 obj->cur.color.g = 255;
244 obj->cur.color.b = 255;
245 obj->cur.color.a = 255;
246 obj->cur.geometry.x = 0;
247 obj->cur.geometry.y = 0;
248 obj->cur.geometry.w = 0;
249 obj->cur.geometry.h = 0;
250 obj->cur.layer = 0;
251 /* set up object-specific settings */
252 obj->prev = obj->cur;
253 /* set up methods (compulsory) */
254 obj->func = &object_func;
255 obj->type = o_type;
256}
257
258static void *
259evas_object_polygon_new(void)
260{
261 Evas_Object_Polygon *o;
262
263 /* alloc obj private data */
264 EVAS_MEMPOOL_INIT(_mp_obj, "evas_object_polygon", Evas_Object_Polygon, 32, NULL);
265 o = EVAS_MEMPOOL_ALLOC(_mp_obj, Evas_Object_Polygon);
266 if (!o) return NULL;
267 EVAS_MEMPOOL_PREP(_mp_obj, o, Evas_Object_Polygon);
268 o->magic = MAGIC_OBJ_POLYGON;
269 return o;
270}
271
272static void
273evas_object_polygon_free(Evas_Object *obj)
274{
275 Evas_Object_Polygon *o;
276
277 /* frees private object data. very simple here */
278 o = (Evas_Object_Polygon *)(obj->object_data);
279 MAGIC_CHECK(o, Evas_Object_Polygon, MAGIC_OBJ_POLYGON);
280 return;
281 MAGIC_CHECK_END();
282 /* free obj */
283 while (o->points)
284 {
285 free(o->points->data);
286 o->points = eina_list_remove(o->points, o->points->data);
287 }
288 o->engine_data = obj->layer->evas->engine.func->polygon_points_clear(obj->layer->evas->engine.data.output,
289 obj->layer->evas->engine.data.context,
290 o->engine_data);
291 o->magic = 0;
292 EVAS_MEMPOOL_FREE(_mp_obj, o);
293}
294
295static void
296evas_object_polygon_render(Evas_Object *obj, void *output, void *context, void *surface, int x, int y)
297{
298 Evas_Object_Polygon *o;
299 Eina_List *l;
300 Evas_Polygon_Point *p;
301
302 /* render object to surface with context, and offxet by x,y */
303 o = (Evas_Object_Polygon *)(obj->object_data);
304 obj->layer->evas->engine.func->context_color_set(output,
305 context,
306 obj->cur.cache.clip.r,
307 obj->cur.cache.clip.g,
308 obj->cur.cache.clip.b,
309 obj->cur.cache.clip.a);
310 obj->layer->evas->engine.func->context_multiplier_unset(output,
311 context);
312 obj->layer->evas->engine.func->context_render_op_set(output, context,
313 obj->cur.render_op);
314 if (o->changed)
315 {
316 o->engine_data = obj->layer->evas->engine.func->polygon_points_clear(obj->layer->evas->engine.data.output,
317 obj->layer->evas->engine.data.context,
318 o->engine_data);
319 EINA_LIST_FOREACH(o->points, l, p)
320 {
321 //px = evas_coord_world_x_to_screen(obj->layer->evas, p->x);
322 //py = evas_coord_world_y_to_screen(obj->layer->evas, p->y);
323 o->engine_data = obj->layer->evas->engine.func->polygon_point_add(obj->layer->evas->engine.data.output,
324 obj->layer->evas->engine.data.context,
325 o->engine_data,
326 p->x, p->y);
327 }
328 }
329
330 if (o->engine_data)
331 obj->layer->evas->engine.func->polygon_draw(output,
332 context,
333 surface,
334 o->engine_data,
335 o->offset.x + x, o->offset.y + y);
336}
337
338static void
339evas_object_polygon_render_pre(Evas_Object *obj)
340{
341 Evas_Object_Polygon *o;
342 int is_v, was_v;
343
344 /* dont pre-render the obj twice! */
345 if (obj->pre_render_done) return;
346 obj->pre_render_done = 1;
347 /* pre-render phase. this does anything an object needs to do just before */
348 /* rendering. this could mean loading the image data, retrieving it from */
349 /* elsewhere, decoding video etc. */
350 /* then when this is done the object needs to figure if it changed and */
351 /* if so what and where and add the appropriate redraw lines */
352 o = (Evas_Object_Polygon *)(obj->object_data);
353 /* if someone is clipping this obj - go calculate the clipper */
354 if (obj->cur.clipper)
355 {
356 if (obj->cur.cache.clip.dirty)
357 evas_object_clip_recalc(obj->cur.clipper);
358 obj->cur.clipper->func->render_pre(obj->cur.clipper);
359 }
360 /* now figure what changed and add draw rects */
361 /* if it just became visible or invisible */
362 is_v = evas_object_is_visible(obj);
363 was_v = evas_object_was_visible(obj);
364 if (is_v != was_v)
365 {
366 evas_object_render_pre_visible_change(&obj->layer->evas->clip_changes, obj, is_v, was_v);
367 goto done;
368 }
369 if ((obj->cur.map != obj->prev.map) ||
370 (obj->cur.usemap != obj->prev.usemap))
371 {
372 evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, obj);
373 goto done;
374 }
375 /* it's not visible - we accounted for it appearing or not so just abort */
376 if (!is_v) goto done;
377 /* clipper changed this is in addition to anything else for obj */
378 evas_object_render_pre_clipper_change(&obj->layer->evas->clip_changes, obj);
379 /* if we restacked (layer or just within a layer) */
380 if (obj->restack)
381 {
382 evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, obj);
383 goto done;
384 }
385 /* if it changed render op */
386 if (obj->cur.render_op != obj->prev.render_op)
387 {
388 evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, obj);
389 goto done;
390 }
391 /* if it changed color */
392 if ((obj->cur.color.r != obj->prev.color.r) ||
393 (obj->cur.color.g != obj->prev.color.g) ||
394 (obj->cur.color.b != obj->prev.color.b) ||
395 (obj->cur.color.a != obj->prev.color.a))
396 {
397 evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, obj);
398 goto done;
399 }
400 /* if it changed geometry - and obviously not visibility or color */
401 /* calculate differences since we have a constant color fill */
402 /* we really only need to update the differences */
403 if ((obj->cur.geometry.x != obj->prev.geometry.x) ||
404 (obj->cur.geometry.y != obj->prev.geometry.y) ||
405 (obj->cur.geometry.w != obj->prev.geometry.w) ||
406 (obj->cur.geometry.h != obj->prev.geometry.h) ||
407 (o->changed))
408 {
409 evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, obj);
410 goto done;
411 }
412 done:
413 if ((obj->cur.geometry.x != obj->prev.geometry.x) ||
414 (obj->cur.geometry.y != obj->prev.geometry.y))
415 {
416 if (!o->changed)
417 {
418 o->offset.x += obj->cur.geometry.x - obj->prev.geometry.x;
419 o->offset.y += obj->cur.geometry.y - obj->prev.geometry.y;
420 }
421 else
422 {
423 o->offset.x += obj->cur.geometry.x - o->geometry.x;
424 o->offset.y += obj->cur.geometry.y - o->geometry.y;
425 }
426 }
427 evas_object_render_pre_effect_updates(&obj->layer->evas->clip_changes, obj, is_v, was_v);
428}
429
430static void
431evas_object_polygon_render_post(Evas_Object *obj)
432{
433 Evas_Object_Polygon *o;
434
435 /* this moves the current data to the previous state parts of the object */
436 /* in whatever way is safest for the object. also if we don't need object */
437 /* data anymore we can free it if the object deems this is a good idea */
438 o = (Evas_Object_Polygon *)(obj->object_data);
439 /* remove those pesky changes */
440 evas_object_clip_changes_clean(obj);
441 /* move cur to prev safely for object data */
442 obj->prev = obj->cur;
443 o->changed = 0;
444}
445
446static unsigned int evas_object_polygon_id_get(Evas_Object *obj)
447{
448 Evas_Object_Polygon *o;
449
450 o = (Evas_Object_Polygon *)(obj->object_data);
451 if (!o) return 0;
452 return MAGIC_OBJ_POLYGON;
453}
454
455static unsigned int evas_object_polygon_visual_id_get(Evas_Object *obj)
456{
457 Evas_Object_Polygon *o;
458
459 o = (Evas_Object_Polygon *)(obj->object_data);
460 if (!o) return 0;
461 return MAGIC_OBJ_SHAPE;
462}
463
464static void *evas_object_polygon_engine_data_get(Evas_Object *obj)
465{
466 Evas_Object_Polygon *o;
467
468 o = (Evas_Object_Polygon *)(obj->object_data);
469 if (!o) return NULL;
470 return o->engine_data;
471}
472
473static int
474evas_object_polygon_is_opaque(Evas_Object *obj __UNUSED__)
475{
476 /* this returns 1 if the internal object data implies that the object is */
477 /* currently fully opaque over the entire line it occupies */
478 return 0;
479}
480
481static int
482evas_object_polygon_was_opaque(Evas_Object *obj __UNUSED__)
483{
484 /* this returns 1 if the internal object data implies that the object was */
485 /* previously fully opaque over the entire line it occupies */
486 return 0;
487}
488
489/* We count the number of edges a "ray" 90 degs upwards from our point
490 * intersects with. If it's even, we are outside of the polygon, if it's odd,
491 * we are inside of it. */
492static int
493evas_object_polygon_is_inside(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
494{
495 Evas_Object_Polygon *o;
496 int num_edges = 0; /* Number of edges we crossed */
497 Eina_List *itr;
498 Evas_Polygon_Point *p;
499
500 o = (Evas_Object_Polygon *)(obj->object_data);
501 if (!o) return 0;
502 if (!o->points) return 0;
503
504 /* Adjust X and Y according to current geometry */
505 x -= o->offset.x;
506 y -= o->offset.y;
507
508 if (eina_list_count(o->points) == 1)
509 {
510 p = eina_list_data_get(o->points);
511 return ((p->x == x) && (p->y == y));
512 }
513
514 EINA_LIST_FOREACH(o->points, itr, p)
515 {
516 Evas_Coord line_y;
517 Eina_List *next = eina_list_next(itr);
518 Evas_Polygon_Point *p_next;
519 /* Get the next, or if there's no next, take the first */
520 if (next)
521 {
522 p_next = eina_list_data_get(next);
523 }
524 else
525 {
526 p_next = eina_list_data_get(o->points);
527 }
528
529 /* Make sure that we are directly below the edge,
530 * and that p->x != p_next->x */
531 if (((p->x < p_next->x) && (p->x <= x) && (x < p_next->x)) ||
532 ((p->x > p_next->x) && (p_next->x < x) && (x <= p->x)))
533 {
534 line_y = ((double) (p->y - p_next->y) /
535 (double) (p->x - p_next->x)) *
536 (x - p_next->x) + p_next->y;
537 /* We crossed that edge if the line is directly above us */
538 if (line_y < y)
539 num_edges++;
540 }
541 }
542
543 /* Return true if num_edges is odd */
544 return ((num_edges % 2) == 1);
545}
546
547static int
548evas_object_polygon_was_inside(Evas_Object *obj __UNUSED__, Evas_Coord x __UNUSED__, Evas_Coord y __UNUSED__)
549{
550 /* this returns 1 if the canvas co-ordinates were inside the object based */
551 /* on object private data. not much use for rects, but for polys, images */
552 /* and other complex objects it might be */
553 return 1;
554}
diff --git a/libraries/evas/src/lib/canvas/evas_object_rectangle.c b/libraries/evas/src/lib/canvas/evas_object_rectangle.c
new file mode 100644
index 0000000..36678e7
--- /dev/null
+++ b/libraries/evas/src/lib/canvas/evas_object_rectangle.c
@@ -0,0 +1,387 @@
1#include "evas_common.h"
2#include "evas_private.h"
3
4/* private magic number for rectangle objects */
5static const char o_type[] = "rectangle";
6
7const char *o_rect_type = o_type;
8
9/* private struct for rectangle object internal data */
10typedef struct _Evas_Object_Rectangle Evas_Object_Rectangle;
11
12struct _Evas_Object_Rectangle
13{
14 DATA32 magic;
15 void *engine_data;
16};
17
18/* private methods for rectangle objects */
19static void evas_object_rectangle_init(Evas_Object *obj);
20static void *evas_object_rectangle_new(void);
21static void evas_object_rectangle_render(Evas_Object *obj, void *output, void *context, void *surface, int x, int y);
22static void evas_object_rectangle_free(Evas_Object *obj);
23static void evas_object_rectangle_render_pre(Evas_Object *obj);
24static void evas_object_rectangle_render_post(Evas_Object *obj);
25
26static unsigned int evas_object_rectangle_id_get(Evas_Object *obj);
27static unsigned int evas_object_rectangle_visual_id_get(Evas_Object *obj);
28static void *evas_object_rectangle_engine_data_get(Evas_Object *obj);
29
30static int evas_object_rectangle_is_opaque(Evas_Object *obj);
31static int evas_object_rectangle_was_opaque(Evas_Object *obj);
32
33#if 0 /* usless calls for a rect object. much more useful for images etc. */
34static void evas_object_rectangle_store(Evas_Object *obj);
35static void evas_object_rectangle_unstore(Evas_Object *obj);
36static int evas_object_rectangle_is_visible(Evas_Object *obj);
37static int evas_object_rectangle_was_visible(Evas_Object *obj);
38static int evas_object_rectangle_is_inside(Evas_Object *obj, double x, double y);
39static int evas_object_rectangle_was_inside(Evas_Object *obj, double x, double y);
40#endif
41
42static const Evas_Object_Func object_func =
43{
44 /* methods (compulsory) */
45 evas_object_rectangle_free,
46 evas_object_rectangle_render,
47 evas_object_rectangle_render_pre,
48 evas_object_rectangle_render_post,
49 evas_object_rectangle_id_get,
50 evas_object_rectangle_visual_id_get,
51 evas_object_rectangle_engine_data_get,
52 /* these are optional. NULL = nothing */
53 NULL,
54 NULL,
55 NULL,
56 NULL,
57 evas_object_rectangle_is_opaque,
58 evas_object_rectangle_was_opaque,
59 NULL,
60 NULL,
61 NULL,
62 NULL,
63 NULL,
64 NULL,
65 NULL
66};
67
68/* the actual api call to add a rect */
69/* it has no other api calls as all properties are standard */
70
71EVAS_MEMPOOL(_mp_obj);
72
73EAPI Evas_Object *
74evas_object_rectangle_add(Evas *e)
75{
76 Evas_Object *obj;
77
78 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
79 return NULL;
80 MAGIC_CHECK_END();
81 obj = evas_object_new(e);
82 evas_object_rectangle_init(obj);
83 evas_object_inject(obj, e);
84 return obj;
85}
86
87/* all nice and private */
88static void
89evas_object_rectangle_init(Evas_Object *obj)
90{
91 /* alloc image ob, setup methods and default values */
92 obj->object_data = evas_object_rectangle_new();
93 /* set up default settings for this kind of object */
94 obj->cur.color.r = 255;
95 obj->cur.color.g = 255;
96 obj->cur.color.b = 255;
97 obj->cur.color.a = 255;
98 obj->cur.geometry.x = 0;
99 obj->cur.geometry.y = 0;
100 obj->cur.geometry.w = 0;
101 obj->cur.geometry.h = 0;
102 obj->cur.layer = 0;
103 obj->cur.render_op = EVAS_RENDER_BLEND;
104 /* set up object-specific settings */
105 obj->prev = obj->cur;
106 /* set up methods (compulsory) */
107 obj->func = &object_func;
108 obj->type = o_type;
109}
110
111static void *
112evas_object_rectangle_new(void)
113{
114 Evas_Object_Rectangle *o;
115
116 /* alloc obj private data */
117 EVAS_MEMPOOL_INIT(_mp_obj, "evas_object_rectangle", Evas_Object_Rectangle, 256, NULL);
118 o = EVAS_MEMPOOL_ALLOC(_mp_obj, Evas_Object_Rectangle);
119 if (!o) return NULL;
120 EVAS_MEMPOOL_PREP(_mp_obj, o, Evas_Object_Rectangle);
121 o->magic = MAGIC_OBJ_RECTANGLE;
122 return o;
123}
124
125static void
126evas_object_rectangle_free(Evas_Object *obj)
127{
128 Evas_Object_Rectangle *o;
129
130 /* frees private object data. very simple here */
131 o = (Evas_Object_Rectangle *)(obj->object_data);
132 MAGIC_CHECK(o, Evas_Object_Rectangle, MAGIC_OBJ_RECTANGLE);
133 return;
134 MAGIC_CHECK_END();
135 /* free obj */
136 o->magic = 0;
137 EVAS_MEMPOOL_FREE(_mp_obj, o);
138}
139
140static void
141evas_object_rectangle_render(Evas_Object *obj, void *output, void *context, void *surface, int x, int y)
142{
143 /* render object to surface with context, and offxet by x,y */
144 obj->layer->evas->engine.func->context_color_set(output,
145 context,
146 obj->cur.cache.clip.r,
147 obj->cur.cache.clip.g,
148 obj->cur.cache.clip.b,
149 obj->cur.cache.clip.a);
150 obj->layer->evas->engine.func->context_multiplier_unset(output,
151 context);
152 obj->layer->evas->engine.func->context_render_op_set(output, context,
153 obj->cur.render_op);
154 obj->layer->evas->engine.func->rectangle_draw(output,
155 context,
156 surface,
157 obj->cur.geometry.x + x,
158 obj->cur.geometry.y + y,
159 obj->cur.geometry.w,
160 obj->cur.geometry.h);
161//// obj->cur.cache.geometry.x + x,
162//// obj->cur.cache.geometry.y + y,
163//// obj->cur.cache.geometry.w,
164//// obj->cur.cache.geometry.h);
165}
166
167static void
168evas_object_rectangle_render_pre(Evas_Object *obj)
169{
170 int is_v, was_v;
171
172 /* dont pre-render the obj twice! */
173 if (obj->pre_render_done) return;
174 obj->pre_render_done = 1;
175 /* pre-render phase. this does anything an object needs to do just before */
176 /* rendering. this could mean loading the image data, retrieving it from */
177 /* elsewhere, decoding video etc. */
178 /* then when this is done the object needs to figure if it changed and */
179 /* if so what and where and add the appropriate redraw rectangles */
180 /* if someone is clipping this obj - go calculate the clipper */
181 if (obj->cur.clipper)
182 {
183 if (obj->cur.cache.clip.dirty)
184 evas_object_clip_recalc(obj->cur.clipper);
185 obj->cur.clipper->func->render_pre(obj->cur.clipper);
186 }
187 /* now figure what changed and add draw rects */
188 /* if it just became visible or invisible */
189 is_v = evas_object_is_visible(obj);
190 was_v = evas_object_was_visible(obj);
191 if (!(is_v | was_v)) goto done;
192 if (is_v != was_v)
193 {
194 evas_object_render_pre_visible_change(&obj->layer->evas->clip_changes, obj, is_v, was_v);
195 goto done;
196 }
197 if ((obj->cur.map != obj->prev.map) ||
198 (obj->cur.usemap != obj->prev.usemap))
199 {
200 evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, obj);
201 goto done;
202 }
203 /* it's not visible - we accounted for it appearing or not so just abort */
204 if (!is_v) goto done;
205 /* clipper changed this is in addition to anything else for obj */
206 evas_object_render_pre_clipper_change(&obj->layer->evas->clip_changes, obj);
207 /* if we restacked (layer or just within a layer) and don't clip anyone */
208 if ((obj->restack) && (!obj->clip.clipees))
209 {
210 evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, obj);
211 goto done;
212 }
213 /* if it changed render op */
214 if (obj->cur.render_op != obj->prev.render_op)
215 {
216 evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, obj);
217 goto done;
218 }
219 /* if it changed color */
220 if ((obj->cur.color.r != obj->prev.color.r) ||
221 (obj->cur.color.g != obj->prev.color.g) ||
222 (obj->cur.color.b != obj->prev.color.b) ||
223 (obj->cur.color.a != obj->prev.color.a))
224 {
225 evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, obj);
226 goto done;
227 }
228 /* if it changed geometry - and obviously not visibility or color */
229 /* calculate differences since we have a constant color fill */
230 /* we really only need to update the differences */
231 if ((obj->cur.geometry.x != obj->prev.geometry.x) ||
232 (obj->cur.geometry.y != obj->prev.geometry.y) ||
233 (obj->cur.geometry.w != obj->prev.geometry.w) ||
234 (obj->cur.geometry.h != obj->prev.geometry.h))
235 {
236 evas_rects_return_difference_rects(&obj->layer->evas->clip_changes,
237 obj->cur.geometry.x,
238 obj->cur.geometry.y,
239 obj->cur.geometry.w,
240 obj->cur.geometry.h,
241 obj->prev.geometry.x,
242 obj->prev.geometry.y,
243 obj->prev.geometry.w,
244 obj->prev.geometry.h);
245//// rl = evas_rects_return_difference_rects(obj->cur.cache.geometry.x,
246//// obj->cur.cache.geometry.y,
247//// obj->cur.cache.geometry.w,
248//// obj->cur.cache.geometry.h,
249//// obj->prev.cache.geometry.x,
250//// obj->prev.cache.geometry.y,
251//// obj->prev.cache.geometry.w,
252//// obj->prev.cache.geometry.h);
253 goto done;
254 }
255 /* it obviously didn't change - add a NO obscure - this "unupdates" this */
256 /* area so if there were updates for it they get wiped. don't do it if we */
257 /* arent fully opaque and we are visible */
258 /*
259 if (evas_object_is_visible(obj) &&
260 evas_object_is_opaque(obj) &&
261 (!obj->clip.clipees))
262 obj->layer->evas->engine.func->output_redraws_rect_del(obj->layer->evas->engine.data.output,
263 obj->cur.cache.clip.x,
264 obj->cur.cache.clip.y,
265 obj->cur.cache.clip.w,
266 obj->cur.cache.clip.h);
267 */
268 done:
269 evas_object_render_pre_effect_updates(&obj->layer->evas->clip_changes, obj, is_v, was_v);
270}
271
272static void
273evas_object_rectangle_render_post(Evas_Object *obj)
274{
275
276 /* this moves the current data to the previous state parts of the object */
277 /* in whatever way is safest for the object. also if we don't need object */
278 /* data anymore we can free it if the object deems this is a good idea */
279 /* remove those pesky changes */
280 evas_object_clip_changes_clean(obj);
281 /* move cur to prev safely for object data */
282 obj->prev = obj->cur;
283}
284
285static int
286evas_object_rectangle_is_opaque(Evas_Object *obj)
287{
288 /* this returns 1 if the internal object data implies that the object is */
289 /* currently fully opaque over the entire rectangle it occupies */
290 if ((obj->cur.map) && (obj->cur.usemap)) return 0;
291 if (obj->cur.render_op == EVAS_RENDER_COPY)
292 return 1;
293 if (obj->cur.render_op != EVAS_RENDER_BLEND)
294 return 0;
295 return 1;
296}
297
298static int
299evas_object_rectangle_was_opaque(Evas_Object *obj)
300{
301 /* this returns 1 if the internal object data implies that the object was */
302 /* previously fully opaque over the entire rectangle it occupies */
303 if (obj->prev.render_op == EVAS_RENDER_COPY)
304 return 1;
305 if (obj->prev.render_op != EVAS_RENDER_BLEND)
306 return 0;
307 return 1;
308}
309
310static unsigned int evas_object_rectangle_id_get(Evas_Object *obj)
311{
312 Evas_Object_Rectangle *o;
313
314 o = (Evas_Object_Rectangle *)(obj->object_data);
315 if (!o) return 0;
316 return MAGIC_OBJ_RECTANGLE;
317}
318
319static unsigned int evas_object_rectangle_visual_id_get(Evas_Object *obj)
320{
321 Evas_Object_Rectangle *o;
322
323 o = (Evas_Object_Rectangle *)(obj->object_data);
324 if (!o) return 0;
325 return MAGIC_OBJ_SHAPE;
326}
327
328static void *evas_object_rectangle_engine_data_get(Evas_Object *obj)
329{
330 Evas_Object_Rectangle *o;
331
332 o = (Evas_Object_Rectangle *)(obj->object_data);
333 if (!o) return NULL;
334 return o->engine_data;
335}
336
337
338#if 0 /* usless calls for a rect object. much more useful for images etc. */
339static void
340evas_object_rectangle_store(Evas_Object *obj)
341{
342 /* store... nothing for rectangle objects... it's a bit silly */
343 /* but for others that may have expensive caluclations to do to */
344 /* generate the object data, hint that they might want to be pre-calced */
345 /* once and stored */
346}
347
348static void
349evas_object_rectangle_unstore(Evas_Object *obj)
350{
351 /* store... nothing for rectangle objects... it's a bit silly */
352}
353
354static int
355evas_object_rectangle_is_visible(Evas_Object *obj)
356{
357 /* this returns 1 if the internal object data would imply that it is */
358 /* visible (ie drawing it draws something. this is not to do with events */
359 return 1;
360}
361
362static int
363evas_object_rectangle_was_visible(Evas_Object *obj)
364{
365 /* this returns 1 if the internal object data would imply that it was */
366 /* visible (ie drawing it draws something. this is not to do with events */
367 return 1;
368}
369
370static int
371evas_object_rectangle_is_inside(Evas_Object *obj, double x, double y)
372{
373 /* this returns 1 if the canvas co-ordinates are inside the object based */
374 /* on object private data. not much use for rects, but for polys, images */
375 /* and other complex objects it might be */
376 return 1;
377}
378
379static int
380evas_object_rectangle_was_inside(Evas_Object *obj, double x, double y)
381{
382 /* this returns 1 if the canvas co-ordinates were inside the object based */
383 /* on object private data. not much use for rects, but for polys, images */
384 /* and other complex objects it might be */
385 return 1;
386}
387#endif
diff --git a/libraries/evas/src/lib/canvas/evas_object_smart.c b/libraries/evas/src/lib/canvas/evas_object_smart.c
new file mode 100644
index 0000000..a7dfcdf
--- /dev/null
+++ b/libraries/evas/src/lib/canvas/evas_object_smart.c
@@ -0,0 +1,920 @@
1#include "evas_common.h"
2#include "evas_private.h"
3
4typedef struct _Evas_Object_Smart Evas_Object_Smart;
5typedef struct _Evas_Smart_Callback Evas_Smart_Callback;
6
7struct _Evas_Object_Smart
8{
9 DATA32 magic;
10 void *engine_data;
11 void *data;
12 Eina_List *callbacks;
13 Eina_Inlist *contained;
14 Evas_Smart_Cb_Description_Array callbacks_descriptions;
15 int walking_list;
16 Eina_Bool deletions_waiting : 1;
17 Eina_Bool need_recalculate : 1;
18};
19
20struct _Evas_Smart_Callback
21{
22 const char *event;
23 Evas_Smart_Cb func;
24 void *func_data;
25 Evas_Callback_Priority priority;
26 char delete_me : 1;
27};
28
29/* private methods for smart objects */
30static void evas_object_smart_callbacks_clear(Evas_Object *obj);
31static void evas_object_smart_init(Evas_Object *obj);
32static void *evas_object_smart_new(void);
33static void evas_object_smart_render(Evas_Object *obj, void *output, void *context, void *surface, int x, int y);
34static void evas_object_smart_free(Evas_Object *obj);
35static void evas_object_smart_render_pre(Evas_Object *obj);
36static void evas_object_smart_render_post(Evas_Object *obj);
37
38static unsigned int evas_object_smart_id_get(Evas_Object *obj);
39static unsigned int evas_object_smart_visual_id_get(Evas_Object *obj);
40static void *evas_object_smart_engine_data_get(Evas_Object *obj);
41
42static const Evas_Object_Func object_func =
43{
44 /* methods (compulsory) */
45 evas_object_smart_free,
46 evas_object_smart_render,
47 evas_object_smart_render_pre,
48 evas_object_smart_render_post,
49 evas_object_smart_id_get,
50 evas_object_smart_visual_id_get,
51 evas_object_smart_engine_data_get,
52 /* these are optional. NULL = nothing */
53 NULL,
54 NULL,
55 NULL,
56 NULL,
57 NULL,
58 NULL,
59 NULL,
60 NULL,
61 NULL,
62 NULL,
63 NULL,
64 NULL,
65 NULL
66};
67
68EVAS_MEMPOOL(_mp_obj);
69EVAS_MEMPOOL(_mp_cb);
70
71/* public funcs */
72EAPI void
73evas_object_smart_data_set(Evas_Object *obj, void *data)
74{
75 Evas_Object_Smart *o;
76
77 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
78 return;
79 MAGIC_CHECK_END();
80 o = (Evas_Object_Smart *)(obj->object_data);
81 MAGIC_CHECK(o, Evas_Object_Smart, MAGIC_OBJ_SMART);
82 return;
83 MAGIC_CHECK_END();
84 o->data = data;
85}
86
87EAPI void *
88evas_object_smart_data_get(const Evas_Object *obj)
89{
90 Evas_Object_Smart *o;
91
92 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
93 return NULL;
94 MAGIC_CHECK_END();
95 o = (Evas_Object_Smart *)(obj->object_data);
96 if (!o) return NULL;
97 return o->data;
98}
99
100EAPI Evas_Smart *
101evas_object_smart_smart_get(const Evas_Object *obj)
102{
103 Evas_Object_Smart *o;
104
105 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
106 return NULL;
107 MAGIC_CHECK_END();
108 o = (Evas_Object_Smart *)(obj->object_data);
109 MAGIC_CHECK(o, Evas_Object_Smart, MAGIC_OBJ_SMART);
110 return NULL;
111 MAGIC_CHECK_END();
112 return obj->smart.smart;
113}
114
115EAPI void
116evas_object_smart_member_add(Evas_Object *obj, Evas_Object *smart_obj)
117{
118 Evas_Object_Smart *o;
119
120 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
121 return;
122 MAGIC_CHECK_END();
123 MAGIC_CHECK(smart_obj, Evas_Object, MAGIC_OBJ);
124 return;
125 MAGIC_CHECK_END();
126 o = (Evas_Object_Smart *)(smart_obj->object_data);
127 MAGIC_CHECK(o, Evas_Object_Smart, MAGIC_OBJ_SMART);
128 return;
129 MAGIC_CHECK_END();
130
131 if (obj->delete_me)
132 {
133 CRIT("Adding deleted object %p to smart obj %p", obj, smart_obj);
134 abort();
135 return;
136 }
137 if (smart_obj->delete_me)
138 {
139 CRIT("Adding object %p to deleted smart obj %p", obj, smart_obj);
140 abort();
141 return;
142 }
143 if (!smart_obj->layer)
144 {
145 CRIT("No evas surface associated with smart object (%p)", smart_obj);
146 abort();
147 return;
148 }
149 if ((obj->layer && smart_obj->layer) &&
150 (obj->layer->evas != smart_obj->layer->evas))
151 {
152 CRIT("Adding object %p from Evas (%p) from another Evas (%p)", obj, obj->layer->evas, smart_obj->layer->evas);
153 abort();
154 return;
155 }
156
157 if (obj->smart.parent == smart_obj) return;
158
159 if (obj->smart.parent) evas_object_smart_member_del(obj);
160
161 evas_object_release(obj, 1);
162 obj->layer = smart_obj->layer;
163 obj->cur.layer = obj->layer->layer;
164 obj->layer->usage++;
165 obj->smart.parent = smart_obj;
166 o->contained = eina_inlist_append(o->contained, EINA_INLIST_GET(obj));
167 evas_object_smart_member_cache_invalidate(obj, EINA_TRUE, EINA_TRUE);
168 obj->restack = 1;
169 evas_object_change(obj);
170 evas_object_mapped_clip_across_mark(obj);
171 if (smart_obj->smart.smart->smart_class->member_add)
172 smart_obj->smart.smart->smart_class->member_add(smart_obj, obj);
173}
174
175EAPI void
176evas_object_smart_member_del(Evas_Object *obj)
177{
178 Evas_Object_Smart *o;
179 Evas_Object *smart_obj;
180
181 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
182 return;
183 MAGIC_CHECK_END();
184
185 if (!obj->smart.parent) return;
186
187 smart_obj = obj->smart.parent;
188 if (smart_obj->smart.smart->smart_class->member_del)
189 smart_obj->smart.smart->smart_class->member_del(smart_obj, obj);
190
191 o = (Evas_Object_Smart *)(obj->smart.parent->object_data);
192 o->contained = eina_inlist_remove(o->contained, EINA_INLIST_GET(obj));
193 obj->smart.parent = NULL;
194 evas_object_smart_member_cache_invalidate(obj, EINA_TRUE, EINA_TRUE);
195 obj->layer->usage--;
196 obj->cur.layer = obj->layer->layer;
197 evas_object_inject(obj, obj->layer->evas);
198 obj->restack = 1;
199 evas_object_change(obj);
200 evas_object_mapped_clip_across_mark(obj);
201}
202
203EAPI Evas_Object *
204evas_object_smart_parent_get(const Evas_Object *obj)
205{
206 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
207 return NULL;
208 MAGIC_CHECK_END();
209
210 return obj->smart.parent;
211}
212
213EAPI Eina_Bool
214evas_object_smart_type_check(const Evas_Object *obj, const char *type)
215{
216 const Evas_Smart_Class *sc;
217
218 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
219 return EINA_FALSE;
220 MAGIC_CHECK_END();
221
222 if (!obj->smart.smart)
223 return EINA_FALSE;
224 sc = obj->smart.smart->smart_class;
225 while (sc)
226 {
227 if (!strcmp(sc->name, type))
228 return EINA_TRUE;
229 sc = sc->parent;
230 }
231
232 return EINA_FALSE;
233}
234
235EAPI Eina_Bool
236evas_object_smart_type_check_ptr(const Evas_Object *obj, const char *type)
237{
238 const Evas_Smart_Class *sc;
239
240 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
241 return EINA_FALSE;
242 MAGIC_CHECK_END();
243
244 if (!obj->smart.smart)
245 return EINA_FALSE;
246 sc = obj->smart.smart->smart_class;
247 while (sc)
248 {
249 if (sc->name == type)
250 return EINA_TRUE;
251 sc = sc->parent;
252 }
253
254 return EINA_FALSE;
255}
256
257EAPI Eina_List *
258evas_object_smart_members_get(const Evas_Object *obj)
259{
260 Evas_Object_Smart *o;
261 Eina_List *members;
262 Eina_Inlist *member;
263
264 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
265 return NULL;
266 MAGIC_CHECK_END();
267 o = (Evas_Object_Smart *)(obj->object_data);
268 MAGIC_CHECK(o, Evas_Object_Smart, MAGIC_OBJ_SMART);
269 return NULL;
270 MAGIC_CHECK_END();
271
272 members = NULL;
273 for (member = o->contained; member; member = member->next)
274 members = eina_list_append(members, member);
275
276 return members;
277}
278
279const Eina_Inlist *
280evas_object_smart_members_get_direct(const Evas_Object *obj)
281{
282 Evas_Object_Smart *o;
283
284 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
285 return NULL;
286 MAGIC_CHECK_END();
287 o = (Evas_Object_Smart *)(obj->object_data);
288 MAGIC_CHECK(o, Evas_Object_Smart, MAGIC_OBJ_SMART);
289 return NULL;
290 MAGIC_CHECK_END();
291 return o->contained;
292}
293
294void
295_evas_object_smart_members_all_del(Evas_Object *obj)
296{
297 Evas_Object_Smart *o = (Evas_Object_Smart *)(obj->object_data);
298 while (o->contained)
299 evas_object_del((Evas_Object *)(o->contained));
300}
301
302EAPI Evas_Object *
303evas_object_smart_add(Evas *e, Evas_Smart *s)
304{
305 Evas_Object *obj;
306
307 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
308 return NULL;
309 MAGIC_CHECK_END();
310 MAGIC_CHECK(s, Evas_Smart, MAGIC_SMART);
311 return NULL;
312 MAGIC_CHECK_END();
313
314 obj = evas_object_new(e);
315 if (!obj) return NULL;
316 obj->smart.smart = s;
317 obj->type = s->smart_class->name;
318 evas_object_smart_init(obj);
319 evas_object_inject(obj, e);
320
321 evas_object_smart_use(s);
322
323 if (s->smart_class->add) s->smart_class->add(obj);
324
325 return obj;
326}
327
328static int
329_callback_priority_cmp(const void *_a, const void *_b)
330{
331 const Evas_Smart_Callback *a, *b;
332 a = (const Evas_Smart_Callback *) _a;
333 b = (const Evas_Smart_Callback *) _b;
334 if (a->priority < b->priority)
335 return -1;
336 else
337 return 1;
338}
339
340EAPI void
341evas_object_smart_callback_add(Evas_Object *obj, const char *event, Evas_Smart_Cb func, const void *data)
342{
343 evas_object_smart_callback_priority_add(obj, event,
344 EVAS_CALLBACK_PRIORITY_DEFAULT, func, data);
345}
346
347EAPI void
348evas_object_smart_callback_priority_add(Evas_Object *obj, const char *event, Evas_Callback_Priority priority, Evas_Smart_Cb func, const void *data)
349{
350 Evas_Object_Smart *o;
351 Evas_Smart_Callback *cb;
352
353 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
354 return;
355 MAGIC_CHECK_END();
356 o = (Evas_Object_Smart *)(obj->object_data);
357 MAGIC_CHECK(o, Evas_Object_Smart, MAGIC_OBJ_SMART);
358 return;
359 MAGIC_CHECK_END();
360 if (!event) return;
361 if (!func) return;
362 EVAS_MEMPOOL_INIT(_mp_cb, "evas_smart_callback", Evas_Smart_Callback, 512, );
363 cb = EVAS_MEMPOOL_ALLOC(_mp_cb, Evas_Smart_Callback);
364 if (!cb) return;
365 EVAS_MEMPOOL_PREP(_mp_cb, cb, Evas_Smart_Callback);
366 cb->event = eina_stringshare_add(event);
367 cb->func = func;
368 cb->func_data = (void *)data;
369 cb->priority = priority;
370 o->callbacks = eina_list_sorted_insert(o->callbacks, _callback_priority_cmp,
371 cb);
372}
373
374EAPI void *
375evas_object_smart_callback_del(Evas_Object *obj, const char *event, Evas_Smart_Cb func)
376{
377 Evas_Object_Smart *o;
378 Eina_List *l;
379 Evas_Smart_Callback *cb;
380
381 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
382 return NULL;
383 MAGIC_CHECK_END();
384 o = (Evas_Object_Smart *)(obj->object_data);
385 MAGIC_CHECK(o, Evas_Object_Smart, MAGIC_OBJ_SMART);
386 return NULL;
387 MAGIC_CHECK_END();
388 if (!event) return NULL;
389 EINA_LIST_FOREACH(o->callbacks, l, cb)
390 {
391 if ((!strcmp(cb->event, event)) && (cb->func == func))
392 {
393 void *data;
394
395 data = cb->func_data;
396 cb->delete_me = 1;
397 o->deletions_waiting = 1;
398 evas_object_smart_callbacks_clear(obj);
399 return data;
400 }
401 }
402 return NULL;
403}
404
405EAPI void
406evas_object_smart_callback_call(Evas_Object *obj, const char *event, void *event_info)
407{
408 Evas_Object_Smart *o;
409 Eina_List *l;
410 Evas_Smart_Callback *cb;
411 const char *strshare;
412
413 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
414 return;
415 MAGIC_CHECK_END();
416 o = (Evas_Object_Smart *)(obj->object_data);
417 MAGIC_CHECK(o, Evas_Object_Smart, MAGIC_OBJ_SMART);
418 return;
419 MAGIC_CHECK_END();
420 if (!event) return;
421 if (obj->delete_me) return;
422 o->walking_list++;
423 strshare = eina_stringshare_add(event);
424 EINA_LIST_FOREACH(o->callbacks, l, cb)
425 {
426 if (!cb->delete_me)
427 {
428 if (cb->event == strshare)
429 cb->func(cb->func_data, obj, event_info);
430 }
431 if (obj->delete_me)
432 break;
433 }
434 eina_stringshare_del(strshare);
435 o->walking_list--;
436 evas_object_smart_callbacks_clear(obj);
437}
438
439EAPI Eina_Bool
440evas_object_smart_callbacks_descriptions_set(Evas_Object *obj, const Evas_Smart_Cb_Description *descriptions)
441{
442 const Evas_Smart_Cb_Description *d;
443 Evas_Object_Smart *o;
444 unsigned int i, count = 0;
445
446 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
447 return EINA_FALSE;
448 MAGIC_CHECK_END();
449 o = (Evas_Object_Smart *)(obj->object_data);
450 MAGIC_CHECK(o, Evas_Object_Smart, MAGIC_OBJ_SMART);
451 return EINA_FALSE;
452 MAGIC_CHECK_END();
453
454 if ((!descriptions) || (!descriptions->name))
455 {
456 evas_smart_cb_descriptions_resize(&o->callbacks_descriptions, 0);
457 return EINA_TRUE;
458 }
459
460 for (count = 0, d = descriptions; d->name; d++)
461 count++;
462
463 evas_smart_cb_descriptions_resize(&o->callbacks_descriptions, count);
464 if (count == 0) return EINA_TRUE;
465
466 for (i = 0, d = descriptions; i < count; d++, i++)
467 o->callbacks_descriptions.array[i] = d;
468
469 evas_smart_cb_descriptions_fix(&o->callbacks_descriptions);
470
471 return EINA_TRUE;
472}
473
474EAPI void
475evas_object_smart_callbacks_descriptions_get(const Evas_Object *obj, const Evas_Smart_Cb_Description ***class_descriptions, unsigned int *class_count, const Evas_Smart_Cb_Description ***instance_descriptions, unsigned int *instance_count)
476{
477 Evas_Object_Smart *o;
478
479 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
480 if (class_descriptions) *class_descriptions = NULL;
481 if (class_count) *class_count = 0;
482 if (instance_descriptions) *instance_descriptions = NULL;
483 if (instance_count) *instance_count = 0;
484 return;
485 MAGIC_CHECK_END();
486 o = (Evas_Object_Smart *)(obj->object_data);
487 MAGIC_CHECK(o, Evas_Object_Smart, MAGIC_OBJ_SMART);
488 if (class_descriptions) *class_descriptions = NULL;
489 if (class_count) *class_count = 0;
490 if (instance_descriptions) *instance_descriptions = NULL;
491 if (instance_count) *instance_count = 0;
492 return;
493 MAGIC_CHECK_END();
494
495 if (class_descriptions)
496 *class_descriptions = obj->smart.smart->callbacks.array;
497 if (class_count)
498 *class_count = obj->smart.smart->callbacks.size;
499
500 if (instance_descriptions)
501 *instance_descriptions = o->callbacks_descriptions.array;
502 if (instance_count)
503 *instance_count = o->callbacks_descriptions.size;
504}
505
506EAPI void
507evas_object_smart_callback_description_find(const Evas_Object *obj, const char *name, const Evas_Smart_Cb_Description **class_description, const Evas_Smart_Cb_Description **instance_description)
508{
509 Evas_Object_Smart *o;
510
511 if (!name)
512 {
513 if (class_description) *class_description = NULL;
514 if (instance_description) *instance_description = NULL;
515 return;
516 }
517
518 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
519 if (class_description) *class_description = NULL;
520 if (instance_description) *instance_description = NULL;
521 return;
522 MAGIC_CHECK_END();
523 o = (Evas_Object_Smart *)(obj->object_data);
524 MAGIC_CHECK(o, Evas_Object_Smart, MAGIC_OBJ_SMART);
525 if (class_description) *class_description = NULL;
526 if (instance_description) *instance_description = NULL;
527 return;
528 MAGIC_CHECK_END();
529
530 if (class_description)
531 *class_description = evas_smart_cb_description_find
532 (&obj->smart.smart->callbacks, name);
533
534 if (instance_description)
535 *instance_description = evas_smart_cb_description_find
536 (&o->callbacks_descriptions, name);
537}
538
539EAPI void
540evas_object_smart_need_recalculate_set(Evas_Object *obj, Eina_Bool value)
541{
542 Evas_Object_Smart *o;
543 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
544 return;
545 MAGIC_CHECK_END();
546 o = obj->object_data;
547 MAGIC_CHECK(o, Evas_Object_Smart, MAGIC_OBJ_SMART);
548 return;
549 MAGIC_CHECK_END();
550
551 // XXX: do i need this?
552 if (obj->delete_me) return;
553
554 /* remove this entry from calc_list or processed list */
555 if (eina_clist_element_is_linked(&obj->calc_entry))
556 eina_clist_remove(&obj->calc_entry);
557
558 value = !!value;
559 if (value)
560 eina_clist_add_tail(&obj->layer->evas->calc_list, &obj->calc_entry);
561 else
562 eina_clist_add_tail(&obj->layer->evas->calc_done, &obj->calc_entry);
563
564 if (o->need_recalculate == value) return;
565
566 if (obj->recalculate_cycle > 254)
567 {
568 ERR("Object %p is not stable during recalc loop", obj);
569 return;
570 }
571 if (obj->layer->evas->in_smart_calc) obj->recalculate_cycle++;
572 o->need_recalculate = value;
573}
574
575EAPI Eina_Bool
576evas_object_smart_need_recalculate_get(const Evas_Object *obj)
577{
578 Evas_Object_Smart *o;
579 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
580 return EINA_FALSE;
581 MAGIC_CHECK_END();
582 o = obj->object_data;
583 MAGIC_CHECK(o, Evas_Object_Smart, MAGIC_OBJ_SMART);
584 return EINA_FALSE;
585 MAGIC_CHECK_END();
586
587 return o->need_recalculate;
588}
589
590EAPI void
591evas_object_smart_calculate(Evas_Object *obj)
592{
593 Evas_Object_Smart *o;
594 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
595 return;
596 MAGIC_CHECK_END();
597 o = obj->object_data;
598 MAGIC_CHECK(o, Evas_Object_Smart, MAGIC_OBJ_SMART);
599 return;
600 MAGIC_CHECK_END();
601
602 if (!obj->smart.smart->smart_class->calculate)
603 return;
604
605 o->need_recalculate = 0;
606 obj->smart.smart->smart_class->calculate(obj);
607}
608
609EAPI void
610evas_smart_objects_calculate(Evas *e)
611{
612 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
613 return;
614 MAGIC_CHECK_END();
615 evas_call_smarts_calculate(e);
616}
617
618EAPI int
619evas_smart_objects_calculate_count_get(const Evas *e)
620{
621 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
622 return 0;
623 MAGIC_CHECK_END();
624 return e->smart_calc_count;
625}
626
627/**
628 * Call calculate() on all smart objects that need_recalculate.
629 *
630 * @internal
631 */
632void
633evas_call_smarts_calculate(Evas *e)
634{
635 Eina_Clist *elem;
636 Evas_Object *obj;
637
638// printf("+CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALC-----------v\n");
639 evas_event_freeze(e);
640 e->in_smart_calc++;
641
642 while (NULL != (elem = eina_clist_head(&e->calc_list)))
643 {
644 Evas_Object_Smart *o;
645
646 /* move the item to the processed list */
647 obj = EINA_CLIST_ENTRY(elem, Evas_Object, calc_entry);
648 eina_clist_remove(&obj->calc_entry);
649 if (obj->delete_me) continue;
650 eina_clist_add_tail(&e->calc_done, &obj->calc_entry);
651
652 o = obj->object_data;
653
654 if (o->need_recalculate)
655 {
656 o->need_recalculate = 0;
657 obj->smart.smart->smart_class->calculate(obj);
658 }
659 }
660
661 while (NULL != (elem = eina_clist_head(&e->calc_done)))
662 {
663 obj = EINA_CLIST_ENTRY(elem, Evas_Object, calc_entry);
664 obj->recalculate_cycle = 0;
665 eina_clist_remove(&obj->calc_entry);
666 }
667
668 e->in_smart_calc--;
669 if (e->in_smart_calc == 0) e->smart_calc_count++;
670 evas_event_thaw(e);
671 evas_event_thaw_eval(e);
672}
673
674EAPI void
675evas_object_smart_changed(Evas_Object *obj)
676{
677 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
678 return;
679 MAGIC_CHECK_END();
680 evas_object_change(obj);
681 evas_object_smart_need_recalculate_set(obj, 1);
682}
683
684/* internal calls */
685static void
686evas_object_smart_callbacks_clear(Evas_Object *obj)
687{
688 Evas_Object_Smart *o;
689 Eina_List *l;
690 Evas_Smart_Callback *cb;
691
692 o = (Evas_Object_Smart *)(obj->object_data);
693
694 if (o->walking_list) return;
695 if (!o->deletions_waiting) return;
696 for (l = o->callbacks; l;)
697 {
698 cb = eina_list_data_get(l);
699 l = eina_list_next(l);
700 if (cb->delete_me)
701 {
702 o->callbacks = eina_list_remove(o->callbacks, cb);
703 if (cb->event) eina_stringshare_del(cb->event);
704 EVAS_MEMPOOL_FREE(_mp_cb, cb);
705 }
706 }
707}
708
709void
710evas_object_smart_del(Evas_Object *obj)
711{
712 Evas_Smart *s;
713
714 if (obj->delete_me) return;
715 s = obj->smart.smart;
716 if ((s) && (s->smart_class->del)) s->smart_class->del(obj);
717 if (obj->smart.parent) evas_object_smart_member_del(obj);
718 if (s) evas_object_smart_unuse(s);
719}
720
721void
722evas_object_smart_cleanup(Evas_Object *obj)
723{
724 Evas_Object_Smart *o;
725
726 if (obj->smart.parent)
727 evas_object_smart_member_del(obj);
728
729 o = (Evas_Object_Smart *)(obj->object_data);
730 if (o->magic == MAGIC_OBJ_SMART)
731 {
732 if (obj->calc_entry.next)
733 eina_clist_remove(&obj->calc_entry);
734
735 while (o->contained)
736 evas_object_smart_member_del((Evas_Object *)o->contained);
737
738 while (o->callbacks)
739 {
740 Evas_Smart_Callback *cb = o->callbacks->data;
741 o->callbacks = eina_list_remove(o->callbacks, cb);
742 if (cb->event) eina_stringshare_del(cb->event);
743 EVAS_MEMPOOL_FREE(_mp_cb, cb);
744 }
745
746 evas_smart_cb_descriptions_resize(&o->callbacks_descriptions, 0);
747 o->data = NULL;
748 }
749
750 obj->smart.parent = NULL;
751 obj->smart.smart = NULL;
752}
753
754void
755evas_object_smart_member_cache_invalidate(Evas_Object *obj,
756 Eina_Bool pass_events,
757 Eina_Bool freeze_events)
758{
759 Evas_Object_Smart *o;
760 Evas_Object *member;
761
762 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
763 return;
764 MAGIC_CHECK_END();
765
766 if (pass_events)
767 obj->parent_cache.pass_events_valid = EINA_FALSE;
768 if (freeze_events)
769 obj->parent_cache.freeze_events_valid = EINA_FALSE;
770
771 o = obj->object_data;
772 if (o->magic != MAGIC_OBJ_SMART) return;
773
774 EINA_INLIST_FOREACH(o->contained, member)
775 evas_object_smart_member_cache_invalidate(member,
776 pass_events,
777 freeze_events);
778}
779
780void
781evas_object_smart_member_raise(Evas_Object *member)
782{
783 Evas_Object_Smart *o;
784
785 o = (Evas_Object_Smart *)(member->smart.parent->object_data);
786 o->contained = eina_inlist_demote(o->contained, EINA_INLIST_GET(member));
787}
788
789void
790evas_object_smart_member_lower(Evas_Object *member)
791{
792 Evas_Object_Smart *o;
793
794 o = (Evas_Object_Smart *)(member->smart.parent->object_data);
795 o->contained = eina_inlist_promote(o->contained, EINA_INLIST_GET(member));
796}
797
798void
799evas_object_smart_member_stack_above(Evas_Object *member, Evas_Object *other)
800{
801 Evas_Object_Smart *o;
802
803 o = (Evas_Object_Smart *)(member->smart.parent->object_data);
804 o->contained = eina_inlist_remove(o->contained, EINA_INLIST_GET(member));
805 o->contained = eina_inlist_append_relative(o->contained, EINA_INLIST_GET(member), EINA_INLIST_GET(other));
806}
807
808void
809evas_object_smart_member_stack_below(Evas_Object *member, Evas_Object *other)
810{
811 Evas_Object_Smart *o;
812
813 o = (Evas_Object_Smart *)(member->smart.parent->object_data);
814 o->contained = eina_inlist_remove(o->contained, EINA_INLIST_GET(member));
815 o->contained = eina_inlist_prepend_relative(o->contained, EINA_INLIST_GET(member), EINA_INLIST_GET(other));
816}
817
818/* all nice and private */
819static void
820evas_object_smart_init(Evas_Object *obj)
821{
822 /* alloc smart obj, setup methods and default values */
823 obj->object_data = evas_object_smart_new();
824 /* set up default settings for this kind of object */
825 obj->cur.color.r = 255;
826 obj->cur.color.g = 255;
827 obj->cur.color.b = 255;
828 obj->cur.color.a = 255;
829 obj->cur.geometry.x = 0;
830 obj->cur.geometry.y = 0;
831 obj->cur.geometry.w = 0;
832 obj->cur.geometry.h = 0;
833 obj->cur.layer = 0;
834 /* set up object-specific settings */
835 obj->prev = obj->cur;
836 /* set up methods (compulsory) */
837 obj->func = &object_func;
838}
839
840static void *
841evas_object_smart_new(void)
842{
843 Evas_Object_Smart *o;
844
845 /* alloc obj private data */
846 EVAS_MEMPOOL_INIT(_mp_obj, "evas_object_smart", Evas_Object_Smart, 256, NULL);
847 o = EVAS_MEMPOOL_ALLOC(_mp_obj, Evas_Object_Smart);
848 if (!o) return NULL;
849 EVAS_MEMPOOL_PREP(_mp_obj, o, Evas_Object_Smart);
850 o->magic = MAGIC_OBJ_SMART;
851 return o;
852}
853
854static void
855evas_object_smart_free(Evas_Object *obj)
856{
857 Evas_Object_Smart *o;
858
859 /* frees private object data. very simple here */
860 o = (Evas_Object_Smart *)(obj->object_data);
861 MAGIC_CHECK(o, Evas_Object_Smart, MAGIC_OBJ_SMART);
862 return;
863 MAGIC_CHECK_END();
864 /* free obj */
865 o->magic = 0;
866 EVAS_MEMPOOL_FREE(_mp_obj, o);
867}
868
869static void
870evas_object_smart_render(Evas_Object *obj __UNUSED__, void *output __UNUSED__, void *context __UNUSED__, void *surface __UNUSED__, int x __UNUSED__, int y __UNUSED__)
871{
872 return;
873}
874
875static void
876evas_object_smart_render_pre(Evas_Object *obj)
877{
878 if (obj->pre_render_done) return;
879 if ((obj->cur.map != obj->prev.map) ||
880 (obj->cur.usemap != obj->prev.usemap))
881 {
882 evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, obj);
883 goto done;
884 }
885done:
886 obj->pre_render_done = 1;
887}
888
889static void
890evas_object_smart_render_post(Evas_Object *obj)
891{
892 obj->prev = obj->cur;
893}
894
895static unsigned int evas_object_smart_id_get(Evas_Object *obj)
896{
897 Evas_Object_Smart *o;
898
899 o = (Evas_Object_Smart *)(obj->object_data);
900 if (!o) return 0;
901 return MAGIC_OBJ_SMART;
902}
903
904static unsigned int evas_object_smart_visual_id_get(Evas_Object *obj)
905{
906 Evas_Object_Smart *o;
907
908 o = (Evas_Object_Smart *)(obj->object_data);
909 if (!o) return 0;
910 return MAGIC_OBJ_CONTAINER;
911}
912
913static void *evas_object_smart_engine_data_get(Evas_Object *obj)
914{
915 Evas_Object_Smart *o;
916
917 o = (Evas_Object_Smart *)(obj->object_data);
918 if (!o) return NULL;
919 return o->engine_data;
920}
diff --git a/libraries/evas/src/lib/canvas/evas_object_smart_clipped.c b/libraries/evas/src/lib/canvas/evas_object_smart_clipped.c
new file mode 100644
index 0000000..9b9fa6d
--- /dev/null
+++ b/libraries/evas/src/lib/canvas/evas_object_smart_clipped.c
@@ -0,0 +1,183 @@
1#include "evas_common.h"
2#include "evas_private.h"
3
4#define CSO_DATA_GET_OR_RETURN(obj, ptr) \
5 Evas_Object_Smart_Clipped_Data *ptr = evas_object_smart_data_get(obj); \
6 if (!ptr) return;
7
8EAPI void
9evas_object_smart_move_children_relative(Evas_Object *obj, Evas_Coord dx, Evas_Coord dy)
10{
11 const Eina_Inlist *lst;
12 Evas_Object *child;
13
14 if ((dx == 0) && (dy == 0))
15 return;
16
17 lst = evas_object_smart_members_get_direct(obj);
18 EINA_INLIST_FOREACH(lst, child)
19 {
20 Evas_Coord orig_x, orig_y;
21
22// shortcut as we are in evas
23// evas_object_geometry_get(child, &orig_x, &orig_y, NULL, NULL);
24 if (child->delete_me) continue;
25 if (child->is_static_clip) continue;
26 orig_x = child->cur.geometry.x;
27 orig_y = child->cur.geometry.y;
28 evas_object_move(child, orig_x + dx, orig_y + dy);
29 }
30}
31
32EAPI Evas_Object *
33evas_object_smart_clipped_clipper_get(Evas_Object *obj)
34{
35 Evas_Object_Smart_Clipped_Data *cso = evas_object_smart_data_get(obj);
36 if (!cso)
37 return NULL;
38
39 return cso->clipper;
40}
41
42static void
43evas_object_smart_clipped_smart_add(Evas_Object *obj)
44{
45 Evas_Object_Smart_Clipped_Data *cso;
46 Evas_Object *clipper;
47
48 cso = evas_object_smart_data_get(obj);
49 if (!cso)
50 cso = calloc(1, sizeof(*cso)); /* users can provide it or realloc() later */
51
52 cso->evas = evas_object_evas_get(obj);
53 clipper = evas_object_rectangle_add(cso->evas);
54 evas_object_static_clip_set(clipper, 1);
55 cso->clipper = NULL;
56 evas_object_smart_member_add(clipper, obj);
57 cso->clipper = clipper;
58 evas_object_color_set(cso->clipper, 255, 255, 255, 255);
59 evas_object_move(cso->clipper, -100000, -100000);
60 evas_object_resize(cso->clipper, 200000, 200000);
61 evas_object_pass_events_set(cso->clipper, 1);
62 evas_object_hide(cso->clipper); /* show when have something clipped to it */
63
64 evas_object_smart_data_set(obj, cso);
65}
66
67static void
68evas_object_smart_clipped_smart_del(Evas_Object *obj)
69{
70 CSO_DATA_GET_OR_RETURN(obj, cso);
71
72 if (cso->clipper)
73 {
74 Evas_Object *clipper = cso->clipper;
75 cso->clipper = NULL;
76 evas_object_del(clipper);
77 }
78
79 _evas_object_smart_members_all_del(obj);
80
81 free(cso);
82 evas_object_smart_data_set(obj, NULL);
83}
84
85static void
86evas_object_smart_clipped_smart_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
87{
88 Evas_Coord orig_x, orig_y;
89
90 evas_object_geometry_get(obj, &orig_x, &orig_y, NULL, NULL);
91 evas_object_smart_move_children_relative(obj, x - orig_x, y - orig_y);
92}
93
94static void
95evas_object_smart_clipped_smart_show(Evas_Object *obj)
96{
97 CSO_DATA_GET_OR_RETURN(obj, cso);
98 if (evas_object_clipees_get(cso->clipper))
99 evas_object_show(cso->clipper); /* just show if clipper being used */
100}
101
102static void
103evas_object_smart_clipped_smart_hide(Evas_Object *obj)
104{
105 CSO_DATA_GET_OR_RETURN(obj, cso);
106 evas_object_hide(cso->clipper);
107}
108
109static void
110evas_object_smart_clipped_smart_color_set(Evas_Object *obj, int r, int g, int b, int a)
111{
112 CSO_DATA_GET_OR_RETURN(obj, cso);
113 evas_object_color_set(cso->clipper, r, g, b, a);
114}
115
116static void
117evas_object_smart_clipped_smart_clip_set(Evas_Object *obj, Evas_Object *clip)
118{
119 CSO_DATA_GET_OR_RETURN(obj, cso);
120 evas_object_clip_set(cso->clipper, clip);
121}
122
123static void
124evas_object_smart_clipped_smart_clip_unset(Evas_Object *obj)
125{
126 CSO_DATA_GET_OR_RETURN(obj, cso);
127 evas_object_clip_unset(cso->clipper);
128}
129
130static void
131evas_object_smart_clipped_smart_member_add(Evas_Object *obj, Evas_Object *member)
132{
133 CSO_DATA_GET_OR_RETURN(obj, cso);
134 if (!cso->clipper)
135 return;
136 evas_object_clip_set(member, cso->clipper);
137 if (evas_object_visible_get(obj))
138 evas_object_show(cso->clipper);
139}
140
141static void
142evas_object_smart_clipped_smart_member_del(Evas_Object *obj, Evas_Object *member)
143{
144 CSO_DATA_GET_OR_RETURN(obj, cso);
145 if (!cso->clipper)
146 return;
147 evas_object_clip_unset(member);
148 if (!evas_object_clipees_get(cso->clipper))
149 evas_object_hide(cso->clipper);
150}
151
152EAPI void
153evas_object_smart_clipped_smart_set(Evas_Smart_Class *sc)
154{
155 if (!sc)
156 return;
157
158 sc->add = evas_object_smart_clipped_smart_add;
159 sc->del = evas_object_smart_clipped_smart_del;
160 sc->move = evas_object_smart_clipped_smart_move;
161 sc->show = evas_object_smart_clipped_smart_show;
162 sc->hide = evas_object_smart_clipped_smart_hide;
163 sc->color_set = evas_object_smart_clipped_smart_color_set;
164 sc->clip_set = evas_object_smart_clipped_smart_clip_set;
165 sc->clip_unset = evas_object_smart_clipped_smart_clip_unset;
166 sc->calculate = NULL;
167 sc->member_add = evas_object_smart_clipped_smart_member_add;
168 sc->member_del = evas_object_smart_clipped_smart_member_del;
169}
170
171EAPI const Evas_Smart_Class *
172evas_object_smart_clipped_class_get(void)
173{
174 static Evas_Smart_Class _sc = EVAS_SMART_CLASS_INIT_NAME_VERSION("EvasObjectSmartClipped");
175 static const Evas_Smart_Class *class = NULL;
176
177 if (class)
178 return class;
179
180 evas_object_smart_clipped_smart_set(&_sc);
181 class = &_sc;
182 return class;
183}
diff --git a/libraries/evas/src/lib/canvas/evas_object_table.c b/libraries/evas/src/lib/canvas/evas_object_table.c
new file mode 100644
index 0000000..6e28fce
--- /dev/null
+++ b/libraries/evas/src/lib/canvas/evas_object_table.c
@@ -0,0 +1,1373 @@
1#include <errno.h>
2#include "evas_common.h"
3
4typedef struct _Evas_Object_Table_Data Evas_Object_Table_Data;
5typedef struct _Evas_Object_Table_Option Evas_Object_Table_Option;
6typedef struct _Evas_Object_Table_Cache Evas_Object_Table_Cache;
7typedef struct _Evas_Object_Table_Iterator Evas_Object_Table_Iterator;
8typedef struct _Evas_Object_Table_Accessor Evas_Object_Table_Accessor;
9
10struct _Evas_Object_Table_Option
11{
12 Evas_Object *obj;
13 unsigned short col, row, colspan, rowspan, end_col, end_row;
14 struct {
15 Evas_Coord w, h;
16 } min, max;
17 struct {
18 double h, v;
19 } align;
20 struct {
21 Evas_Coord l, r, t, b;
22 } pad;
23 Eina_Bool expand_h : 1; /* XXX required? */
24 Eina_Bool expand_v : 1; /* XXX required? */
25 Eina_Bool fill_h : 1;
26 Eina_Bool fill_v : 1;
27};
28
29struct _Evas_Object_Table_Cache
30{
31 struct {
32 struct {
33 double h, v;
34 } weights;
35 struct {
36 int h, v;
37 } expands;
38 struct {
39 Evas_Coord w, h;
40 } min;
41 } total;
42 struct {
43 double *h, *v;
44 } weights;
45 struct {
46 Evas_Coord *h, *v;
47 } sizes;
48 struct {
49 Eina_Bool *h, *v;
50 } expands;
51 double ___pad; // padding to make sure doubles at end can be aligned
52};
53
54struct _Evas_Object_Table_Data
55{
56 Evas_Object_Smart_Clipped_Data base;
57 Eina_List *children;
58 struct {
59 Evas_Coord h, v;
60 } pad;
61 struct {
62 double h, v;
63 } align;
64 struct {
65 int cols, rows;
66 } size;
67 Evas_Object_Table_Cache *cache;
68 Evas_Object_Table_Homogeneous_Mode homogeneous;
69 Eina_Bool hints_changed : 1;
70 Eina_Bool expand_h : 1;
71 Eina_Bool expand_v : 1;
72 Eina_Bool is_mirrored : 1;
73};
74
75struct _Evas_Object_Table_Iterator
76{
77 Eina_Iterator iterator;
78
79 Eina_Iterator *real_iterator;
80 const Evas_Object *table;
81};
82
83struct _Evas_Object_Table_Accessor
84{
85 Eina_Accessor accessor;
86
87 Eina_Accessor *real_accessor;
88 const Evas_Object *table;
89};
90
91#define EVAS_OBJECT_TABLE_DATA_GET(o, ptr) \
92 Evas_Object_Table_Data *ptr = evas_object_smart_data_get(o)
93
94#define EVAS_OBJECT_TABLE_DATA_GET_OR_RETURN(o, ptr) \
95 EVAS_OBJECT_TABLE_DATA_GET(o, ptr); \
96 if (!ptr) \
97 { \
98 CRIT("no widget data for object %p (%s)", \
99 o, evas_object_type_get(o)); \
100 abort(); \
101 return; \
102}
103
104#define EVAS_OBJECT_TABLE_DATA_GET_OR_RETURN_VAL(o, ptr, val) \
105 EVAS_OBJECT_TABLE_DATA_GET(o, ptr); \
106 if (!ptr) \
107 { \
108 CRIT("No widget data for object %p (%s)", \
109 o, evas_object_type_get(o)); \
110 abort(); \
111 return val; \
112 }
113
114static const char EVAS_OBJECT_TABLE_OPTION_KEY[] = "|EvTb";
115
116static Eina_Bool
117_evas_object_table_iterator_next(Evas_Object_Table_Iterator *it, void **data)
118{
119 Evas_Object_Table_Option *opt;
120
121 if (!eina_iterator_next(it->real_iterator, (void **)&opt))
122 return EINA_FALSE;
123 if (data) *data = opt->obj;
124 return EINA_TRUE;
125}
126
127static Evas_Object *
128_evas_object_table_iterator_get_container(Evas_Object_Table_Iterator *it)
129{
130 return (Evas_Object *)it->table;
131}
132
133static void
134_evas_object_table_iterator_free(Evas_Object_Table_Iterator *it)
135{
136 eina_iterator_free(it->real_iterator);
137 free(it);
138}
139
140static Eina_Bool
141_evas_object_table_accessor_get_at(Evas_Object_Table_Accessor *it, unsigned int idx, void **data)
142{
143 Evas_Object_Table_Option *opt = NULL;
144
145 if (!eina_accessor_data_get(it->real_accessor, idx, (void **)&opt))
146 return EINA_FALSE;
147 if (data) *data = opt->obj;
148 return EINA_TRUE;
149}
150
151static Evas_Object *
152_evas_object_table_accessor_get_container(Evas_Object_Table_Accessor *it)
153{
154 return (Evas_Object *)it->table;
155}
156
157static void
158_evas_object_table_accessor_free(Evas_Object_Table_Accessor *it)
159{
160 eina_accessor_free(it->real_accessor);
161 free(it);
162}
163
164static Evas_Object_Table_Cache *
165_evas_object_table_cache_alloc(int cols, int rows)
166{
167 Evas_Object_Table_Cache *cache;
168 int size;
169
170 size = sizeof(Evas_Object_Table_Cache) +
171 ((cols + rows) *
172 (sizeof(double) + sizeof(Evas_Coord) + sizeof(Eina_Bool)));
173 cache = malloc(size);
174 if (!cache)
175 {
176 ERR("Could not allocate table cache %dx%d (%d bytes): %s",
177 cols, rows, size, strerror(errno));
178 return NULL;
179 }
180
181 cache->weights.h = (double *)(cache + 1);
182 cache->weights.v = (double *)(cache->weights.h + cols);
183 cache->sizes.h = (Evas_Coord *)(cache->weights.v + rows);
184 cache->sizes.v = (Evas_Coord *)(cache->sizes.h + cols);
185 cache->expands.h = (Eina_Bool *)(cache->sizes.v + rows);
186 cache->expands.v = (Eina_Bool *)(cache->expands.h + cols);
187
188 return cache;
189}
190
191static void
192_evas_object_table_cache_free(Evas_Object_Table_Cache *cache)
193{
194 free(cache);
195}
196
197static void
198_evas_object_table_cache_reset(Evas_Object_Table_Data *priv)
199{
200 Evas_Object_Table_Cache *c = priv->cache;
201 int size;
202
203 c->total.expands.v = 0;
204 c->total.expands.h = 0;
205 c->total.min.w = 0;
206 c->total.min.h = 0;
207
208 size = ((priv->size.rows + priv->size.cols) *
209 (sizeof(double) + sizeof(Evas_Coord) + sizeof(Eina_Bool)));
210 memset(c + 1, 0, size);
211}
212
213static void
214_evas_object_table_cache_invalidate(Evas_Object_Table_Data *priv)
215{
216 priv->hints_changed = 1;
217 if (priv->cache)
218 {
219 _evas_object_table_cache_free(priv->cache);
220 priv->cache = NULL;
221 }
222}
223
224static Evas_Object_Table_Option *
225_evas_object_table_option_get(Evas_Object *o)
226{
227 return evas_object_data_get(o, EVAS_OBJECT_TABLE_OPTION_KEY);
228}
229
230static void
231_evas_object_table_option_set(Evas_Object *o, const Evas_Object_Table_Option *opt)
232{
233 evas_object_data_set(o, EVAS_OBJECT_TABLE_OPTION_KEY, opt);
234}
235
236static Evas_Object_Table_Option *
237_evas_object_table_option_del(Evas_Object *o)
238{
239 return evas_object_data_del(o, EVAS_OBJECT_TABLE_OPTION_KEY);
240}
241
242static void
243_on_child_del(void *data, Evas *evas __UNUSED__, Evas_Object *child, void *einfo __UNUSED__)
244{
245 Evas_Object *table = data;
246 evas_object_table_unpack(table, child);
247}
248
249static void
250_on_child_hints_changed(void *data, Evas *evas __UNUSED__, Evas_Object *child __UNUSED__, void *einfo __UNUSED__)
251{
252 Evas_Object *table = data;
253 EVAS_OBJECT_TABLE_DATA_GET_OR_RETURN(table, priv);
254 _evas_object_table_cache_invalidate(priv);
255 evas_object_smart_changed(table);
256}
257
258static void
259_evas_object_table_child_connect(Evas_Object *o, Evas_Object *child)
260{
261 evas_object_event_callback_add
262 (child, EVAS_CALLBACK_DEL, _on_child_del, o);
263 evas_object_event_callback_add
264 (child, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _on_child_hints_changed, o);
265}
266
267static void
268_evas_object_table_child_disconnect(Evas_Object *o, Evas_Object *child)
269{
270 evas_object_event_callback_del_full
271 (child, EVAS_CALLBACK_DEL, _on_child_del, o);
272 evas_object_event_callback_del_full
273 (child, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _on_child_hints_changed, o);
274}
275
276static void
277_evas_object_table_calculate_cell(const Evas_Object_Table_Option *opt, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
278{
279 Evas_Coord cw, ch;
280
281 *w -= opt->pad.l + opt->pad.r;
282 if (*w < opt->min.w)
283 cw = opt->min.w;
284 else if ((opt->max.w > -1) && (*w > opt->max.w))
285 cw = opt->max.w;
286 else if (opt->fill_h)
287 cw = *w;
288 else
289 cw = opt->min.w;
290
291 *h -= opt->pad.t + opt->pad.b;
292 if (*h < opt->min.h)
293 ch = opt->min.h;
294 else if ((opt->max.h > -1) && (*h > opt->max.h))
295 ch = opt->max.h;
296 else if (opt->fill_v)
297 ch = *h;
298 else
299 ch = opt->min.h;
300
301 *x += opt->pad.l;
302 if (cw != *w)
303 {
304 *x += (*w - cw) * opt->align.h;
305 *w = cw;
306 }
307
308 *y += opt->pad.t;
309 if (ch != *h)
310 {
311 *y += (*h - ch) * opt->align.v;
312 *h = ch;
313 }
314}
315
316static void
317_evas_object_table_calculate_hints_homogeneous(Evas_Object *o, Evas_Object_Table_Data *priv)
318{
319 Eina_List *l;
320 Evas_Object_Table_Option *opt;
321 Evas_Coord minw, minh, o_minw, o_minh;
322 Eina_Bool expand_h, expand_v;
323
324 o_minw = 0;
325 o_minh = 0;
326 minw = 0;
327 minh = 0;
328 expand_h = 0;
329 expand_v = 0;
330
331 EINA_LIST_FOREACH(priv->children, l, opt)
332 {
333 Evas_Object *child = opt->obj;
334 Evas_Coord child_minw, child_minh, cell_minw, cell_minh;
335 double weightw, weighth;
336
337 evas_object_size_hint_min_get(child, &opt->min.w, &opt->min.h);
338 evas_object_size_hint_max_get(child, &opt->max.w, &opt->max.h);
339 evas_object_size_hint_padding_get
340 (child, &opt->pad.l, &opt->pad.r, &opt->pad.t, &opt->pad.b);
341 evas_object_size_hint_align_get(child, &opt->align.h, &opt->align.v);
342 evas_object_size_hint_weight_get(child, &weightw, &weighth);
343
344 child_minw = opt->min.w + opt->pad.l + opt->pad.r;
345 child_minh = opt->min.h + opt->pad.t + opt->pad.b;
346
347 cell_minw = (child_minw + opt->colspan - 1) / opt->colspan;
348 cell_minh = (child_minh + opt->rowspan - 1) / opt->rowspan;
349
350 opt->expand_h = 0;
351 if ((weightw > 0.0) &&
352 ((opt->max.w < 0) ||
353 ((opt->max.w > -1) && (opt->min.w < opt->max.w))))
354 {
355 opt->expand_h = 1;
356 expand_h = 1;
357 }
358
359 opt->expand_v = 0;
360 if ((weighth > 0.0) &&
361 ((opt->max.h < 0) ||
362 ((opt->max.h > -1) && (opt->min.h < opt->max.h))))
363 {
364 opt->expand_v = 1;
365 expand_v = 1;
366 }
367
368 opt->fill_h = 0;
369 if (opt->align.h < 0.0)
370 {
371 opt->align.h = 0.5;
372 opt->fill_h = 1;
373 }
374 opt->fill_v = 0;
375 if (opt->align.v < 0.0)
376 {
377 opt->align.v = 0.5;
378 opt->fill_v = 1;
379 }
380
381 /* greatest mininum values, with paddings */
382 if (minw < cell_minw)
383 minw = cell_minw;
384 if (minh < cell_minh)
385 minh = cell_minh;
386 /* greatest mininum values, without paddings */
387 if (o_minw < opt->min.w)
388 o_minw = opt->min.w;
389 if (o_minh < opt->min.h)
390 o_minh = opt->min.h;
391 }
392
393 if (priv->homogeneous == EVAS_OBJECT_TABLE_HOMOGENEOUS_ITEM)
394 {
395 if (o_minw < 1)
396 {
397 ERR("homogeneous table based on item size but no "
398 "horizontal mininum size specified! Using expand.");
399 expand_h = 1;
400 }
401 if (o_minh < 1)
402 {
403 ERR("homogeneous table based on item size but no "
404 "vertical mininum size specified! Using expand.");
405 expand_v = 1;
406 }
407 }
408
409 minw = priv->size.cols * (minw + priv->pad.h) - priv->pad.h;
410 minh = priv->size.rows * (minh + priv->pad.v) - priv->pad.v;
411
412 priv->hints_changed = 0;
413 priv->expand_h = expand_h;
414 priv->expand_v = expand_v;
415
416 if ((minw > 0 ) || (minh > 0))
417 evas_object_size_hint_min_set(o, minw, minh);
418
419 // XXX hint max?
420}
421
422static void
423_evas_object_table_calculate_layout_homogeneous_sizes_item(const Evas_Object *o, const Evas_Object_Table_Data *priv, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
424{
425 Evas_Coord minw, minh;
426 Eina_Bool expand_h, expand_v;
427
428 evas_object_size_hint_min_get(o, &minw, &minh);
429 expand_h = priv->expand_h;
430 expand_v = priv->expand_v;
431
432 if (*w < minw)
433 expand_h = 0;
434 if (!expand_h)
435 {
436 *x += (*w - minw) * priv->align.h;
437 *w = minw;
438 }
439
440 if (*h < minh)
441 expand_v = 0;
442 if (!expand_v)
443 {
444 *y += (*h - minh) * priv->align.v;
445 *h = minh;
446 }
447}
448
449static void
450_evas_object_table_calculate_layout_homogeneous_sizes(const Evas_Object *o, const Evas_Object_Table_Data *priv, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h, Evas_Coord *cellw, Evas_Coord *cellh)
451{
452 evas_object_geometry_get(o, x, y, w, h);
453 if (priv->homogeneous == EVAS_OBJECT_TABLE_HOMOGENEOUS_ITEM)
454 _evas_object_table_calculate_layout_homogeneous_sizes_item
455 (o, priv, x, y, w, h);
456
457 *cellw = (*w + priv->size.cols - 1) / priv->size.cols;
458 *cellh = (*h + priv->size.rows - 1) / priv->size.rows;
459}
460
461static void
462_evas_object_table_calculate_layout_homogeneous(Evas_Object *o, Evas_Object_Table_Data *priv)
463{
464 Evas_Coord x = 0, y = 0, w = 0, h = 0, ww, hh, cellw = 0, cellh = 0;
465 Eina_List *l;
466 Evas_Object_Table_Option *opt;
467
468 _evas_object_table_calculate_layout_homogeneous_sizes
469 (o, priv, &x, &y, &w, &h, &cellw, &cellh);
470
471 ww = w - ((priv->size.cols - 1) * priv->pad.h);
472 hh = h - ((priv->size.rows - 1) * priv->pad.v);
473
474 if (ww < 0) ww = 0;
475 if (ww < 0) ww = 0;
476
477 EINA_LIST_FOREACH(priv->children, l, opt)
478 {
479 Evas_Object *child = opt->obj;
480 Evas_Coord cx, cy, cw, ch, cox, coy, cow, coh;
481
482 cx = x + ((opt->col * ww) / priv->size.cols);
483 cw = x + (((opt->col + opt->colspan) * ww) / priv->size.cols) - cx;
484 cy = y + ((opt->row * hh) / priv->size.rows);
485 ch = y + (((opt->row + opt->rowspan) * hh) / priv->size.rows) - cy;
486
487 cx += (opt->col) * priv->pad.h;
488 cy += (opt->row) * priv->pad.v;
489
490 cox = cx;
491 coy = cy;
492 cow = cw;
493 coh = ch;
494
495 _evas_object_table_calculate_cell(opt, &cx, &cy, &cw, &ch);
496 if (cw > cow)
497 {
498 cx = cox;
499 cw = cow;
500 }
501 if (ch > coh)
502 {
503 cy = coy;
504 ch = coh;
505 }
506
507 if (priv->is_mirrored)
508 {
509 evas_object_move(opt->obj, x + w - (cx - x + cw), cy);
510 }
511 else
512 {
513 evas_object_move(child, cx, cy);
514 }
515 evas_object_resize(child, cw, ch);
516 }
517}
518
519static void
520_evas_object_table_smart_calculate_homogeneous(Evas_Object *o, Evas_Object_Table_Data *priv)
521{
522 if (priv->hints_changed)
523 _evas_object_table_calculate_hints_homogeneous(o, priv);
524 _evas_object_table_calculate_layout_homogeneous(o, priv);
525}
526
527static int
528_evas_object_table_count_expands(const Eina_Bool *expands, int start, int end)
529{
530 const Eina_Bool *itr = expands + start, *itr_end = expands + end;
531 int count = 0;
532
533 for (; itr < itr_end; itr++)
534 {
535 if (*itr)
536 count++;
537 }
538
539 return count;
540}
541
542static Evas_Coord
543_evas_object_table_sum_sizes(const Evas_Coord *sizes, int start, int end)
544{
545 const Evas_Coord *itr = sizes + start, *itr_end = sizes + end;
546 Evas_Coord sum = 0;
547
548 for (; itr < itr_end; itr++)
549 sum += *itr;
550
551 return sum;
552}
553
554static void
555_evas_object_table_sizes_calc_noexpand(Evas_Coord *sizes, int start, int end, Evas_Coord space)
556{
557 Evas_Coord *itr = sizes + start, *itr_end = sizes + end - 1;
558 Evas_Coord step;
559 int units;
560
561 /* XXX move to fixed point math and spread errors among cells */
562 units = end - start;
563 step = space / units;
564 for (; itr < itr_end; itr++)
565 *itr += step;
566
567 *itr += space - step * (units - 1);
568}
569
570static void
571_evas_object_table_sizes_calc_expand(Evas_Coord *sizes, int start, int end, Evas_Coord space, const Eina_Bool *expands, int expand_count, double *weights, double weighttot)
572{
573 Evas_Coord *itr = sizes + start, *itr_end = sizes + end;
574 const Eina_Bool *itr_expand = expands + start;
575 Evas_Coord step = 0, last_space = 0;
576 int total = 0, i = start;
577
578 /* XXX move to fixed point math and spread errors among cells */
579 if (weighttot > 0.0)
580 {
581 step = space / expand_count;
582 last_space = space - step * (expand_count - 1);
583 }
584
585 for (; itr < itr_end; itr++, itr_expand++, i++)
586 {
587 if (weighttot <= 0.0)
588 {
589 if (*itr_expand)
590 {
591 expand_count--;
592 if (expand_count > 0)
593 *itr += step;
594 else
595 {
596 *itr += last_space;
597 break;
598 }
599 }
600 }
601 else
602 {
603 if (*itr_expand)
604 {
605 expand_count--;
606 if (expand_count > 0)
607 {
608 step = (weights[i] / weighttot) * space;
609 *itr += step;
610 total += step;
611 }
612 else
613 {
614 *itr += space - total;
615 break;
616 }
617 }
618 }
619 }
620}
621
622static void
623_evas_object_table_calculate_hints_regular(Evas_Object *o, Evas_Object_Table_Data *priv)
624{
625 Evas_Object_Table_Option *opt;
626 Evas_Object_Table_Cache *c;
627 Eina_List *l;
628 double totweightw = 0.0, totweighth = 0.0;
629 int i;
630
631 if (!priv->cache)
632 {
633 priv->cache = _evas_object_table_cache_alloc
634 (priv->size.cols, priv->size.rows);
635 if (!priv->cache)
636 return;
637 }
638 c = priv->cache;
639 _evas_object_table_cache_reset(priv);
640
641 /* cache interesting data */
642 memset(c->expands.h, 1, priv->size.cols);
643 memset(c->expands.v, 1, priv->size.rows);
644 memset(c->weights.h, 0, priv->size.cols);
645 memset(c->weights.v, 0, priv->size.rows);
646 EINA_LIST_FOREACH(priv->children, l, opt)
647 {
648 Evas_Object *child = opt->obj;
649 double weightw, weighth;
650
651 evas_object_size_hint_min_get(child, &opt->min.w, &opt->min.h);
652 evas_object_size_hint_max_get(child, &opt->max.w, &opt->max.h);
653 evas_object_size_hint_padding_get
654 (child, &opt->pad.l, &opt->pad.r, &opt->pad.t, &opt->pad.b);
655 evas_object_size_hint_align_get(child, &opt->align.h, &opt->align.v);
656 evas_object_size_hint_weight_get(child, &weightw, &weighth);
657
658 opt->expand_h = 0;
659 if ((weightw > 0.0) &&
660 ((opt->max.w < 0) ||
661 ((opt->max.w > -1) && (opt->min.w < opt->max.w))))
662 opt->expand_h = 1;
663
664 opt->expand_v = 0;
665 if ((weighth > 0.0) &&
666 ((opt->max.h < 0) ||
667 ((opt->max.h > -1) && (opt->min.h < opt->max.h))))
668 opt->expand_v = 1;
669
670 opt->fill_h = 0;
671 if (opt->align.h < 0.0)
672 {
673 opt->align.h = 0.5;
674 opt->fill_h = 1;
675 }
676 opt->fill_v = 0;
677 if (opt->align.v < 0.0)
678 {
679 opt->align.v = 0.5;
680 opt->fill_v = 1;
681 }
682
683 if (!opt->expand_h)
684 memset(c->expands.h + opt->col, 0, opt->colspan);
685 else
686 {
687 for (i = opt->col; i < opt->col + opt->colspan; i++)
688 c->weights.h[i] += (weightw / (double)opt->colspan);
689 }
690 if (!opt->expand_v)
691 memset(c->expands.v + opt->row, 0, opt->rowspan);
692 else
693 {
694 for (i = opt->row; i < opt->row + opt->rowspan; i++)
695 c->weights.v[i] += (weighth / (double)opt->rowspan);
696 }
697 }
698 for (i = 0; i < priv->size.cols; i++) totweightw += c->weights.h[i];
699 for (i = 0; i < priv->size.rows; i++) totweighth += c->weights.v[i];
700
701 /* calculate sizes for each row and column */
702 EINA_LIST_FOREACH(priv->children, l, opt)
703 {
704 Evas_Coord tot, need;
705
706 /* handle horizontal */
707 tot = _evas_object_table_sum_sizes(c->sizes.h, opt->col, opt->end_col);
708 need = opt->min.w + opt->pad.l + opt->pad.r;
709 if (tot < need)
710 {
711 Evas_Coord space = need - tot;
712 int count;
713
714 count = _evas_object_table_count_expands
715 (c->expands.h, opt->col, opt->end_col);
716
717 if (count > 0)
718 _evas_object_table_sizes_calc_expand
719 (c->sizes.h, opt->col, opt->end_col, space,
720 c->expands.h, count, c->weights.h, totweightw);
721 else
722 _evas_object_table_sizes_calc_noexpand
723 (c->sizes.h, opt->col, opt->end_col, space);
724 }
725
726 /* handle vertical */
727 tot = _evas_object_table_sum_sizes(c->sizes.v, opt->row, opt->end_row);
728 need = opt->min.h + opt->pad.t + opt->pad.b;
729 if (tot < opt->min.h)
730 {
731 Evas_Coord space = need - tot;
732 int count;
733
734 count = _evas_object_table_count_expands
735 (c->expands.v, opt->row, opt->end_row);
736
737 if (count > 0)
738 _evas_object_table_sizes_calc_expand
739 (c->sizes.v, opt->row, opt->end_row, space,
740 c->expands.v, count, c->weights.v, totweighth);
741 else
742 _evas_object_table_sizes_calc_noexpand
743 (c->sizes.v, opt->row, opt->end_row, space);
744 }
745 }
746
747 c->total.weights.h = totweightw;
748 c->total.weights.v = totweighth;
749
750 c->total.expands.h = _evas_object_table_count_expands
751 (c->expands.h, 0, priv->size.cols);
752 c->total.expands.v = _evas_object_table_count_expands
753 (c->expands.v, 0, priv->size.rows);
754
755 c->total.min.w = _evas_object_table_sum_sizes
756 (c->sizes.h, 0, priv->size.cols);
757 c->total.min.h = _evas_object_table_sum_sizes
758 (c->sizes.v, 0, priv->size.rows);
759
760 c->total.min.w += priv->pad.h * (priv->size.cols - 1);
761 c->total.min.h += priv->pad.v * (priv->size.rows - 1);
762
763 if ((c->total.min.w > 0) || (c->total.min.h > 0))
764 evas_object_size_hint_min_set(o, c->total.min.w, c->total.min.h);
765
766 // XXX hint max?
767}
768
769static void
770_evas_object_table_calculate_layout_regular(Evas_Object *o, Evas_Object_Table_Data *priv)
771{
772 Evas_Object_Table_Option *opt;
773 Evas_Object_Table_Cache *c;
774 Eina_List *l;
775 Evas_Coord *cols = NULL, *rows = NULL;
776 Evas_Coord x, y, w, h;
777
778 evas_object_geometry_get(o, &x, &y, &w, &h);
779 c = priv->cache;
780
781 /* handle horizontal */
782 if ((c->total.expands.h <= 0) || (c->total.min.w >= w))
783 {
784 x += (w - c->total.min.w) * priv->align.h;
785 w = c->total.min.w;
786 cols = c->sizes.h;
787 }
788 else
789 {
790 int size = priv->size.cols * sizeof(Evas_Coord);
791 cols = malloc(size);
792 if (!cols)
793 {
794 ERR("Could not allocate temp columns (%d bytes): %s",
795 size, strerror(errno));
796 goto end;
797 }
798 memcpy(cols, c->sizes.h, size);
799 _evas_object_table_sizes_calc_expand
800 (cols, 0, priv->size.cols, w - c->total.min.w,
801 c->expands.h, c->total.expands.h, c->weights.h, c->total.weights.h);
802 }
803
804 /* handle vertical */
805 if ((c->total.expands.v <= 0) || (c->total.min.h >= h))
806 {
807 y += (h - c->total.min.h) * priv->align.v;
808 h = c->total.min.h;
809 rows = c->sizes.v;
810 }
811 else
812 {
813 int size = priv->size.rows * sizeof(Evas_Coord);
814 rows = malloc(size);
815 if (!rows)
816 {
817 ERR("could not allocate temp rows (%d bytes): %s",
818 size, strerror(errno));
819 goto end;
820 }
821 memcpy(rows, c->sizes.v, size);
822 _evas_object_table_sizes_calc_expand
823 (rows, 0, priv->size.rows, h - c->total.min.h,
824 c->expands.v, c->total.expands.v, c->weights.v, c->total.weights.v);
825 }
826
827 EINA_LIST_FOREACH(priv->children, l, opt)
828 {
829 Evas_Object *child = opt->obj;
830 Evas_Coord cx, cy, cw, ch;
831
832 cx = x + opt->col * (priv->pad.h);
833 cx += _evas_object_table_sum_sizes(cols, 0, opt->col);
834 cw = _evas_object_table_sum_sizes(cols, opt->col, opt->end_col);
835
836 cy = y + opt->row * (priv->pad.v);
837 cy += _evas_object_table_sum_sizes(rows, 0, opt->row);
838 ch = _evas_object_table_sum_sizes(rows, opt->row, opt->end_row);
839
840 _evas_object_table_calculate_cell(opt, &cx, &cy, &cw, &ch);
841
842 if (priv->is_mirrored)
843 {
844 evas_object_move(opt->obj, x + w - (cx - x + cw), cy);
845 }
846 else
847 {
848 evas_object_move(child, cx, cy);
849 }
850 evas_object_resize(child, cw, ch);
851 }
852
853 end:
854 if (cols != c->sizes.h)
855 {
856 if (cols) free(cols);
857 }
858 if (rows != c->sizes.v)
859 {
860 if (rows) free(rows);
861 }
862}
863
864static void
865_evas_object_table_smart_calculate_regular(Evas_Object *o, Evas_Object_Table_Data *priv)
866{
867 if (priv->hints_changed)
868 _evas_object_table_calculate_hints_regular(o, priv);
869 _evas_object_table_calculate_layout_regular(o, priv);
870}
871
872EVAS_SMART_SUBCLASS_NEW("Evas_Object_Table", _evas_object_table,
873 Evas_Smart_Class, Evas_Smart_Class,
874 evas_object_smart_clipped_class_get, NULL)
875
876static void
877_evas_object_table_smart_add(Evas_Object *o)
878{
879 EVAS_SMART_DATA_ALLOC(o, Evas_Object_Table_Data)
880
881 priv->pad.h = 0;
882 priv->pad.v = 0;
883 priv->align.h = 0.5;
884 priv->align.v = 0.5;
885 priv->size.cols = 0;
886 priv->size.rows = 0;
887 priv->cache = NULL;
888 priv->homogeneous = EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE;
889 priv->hints_changed = 1;
890 priv->expand_h = 0;
891 priv->expand_v = 0;
892
893 _evas_object_table_parent_sc->add(o);
894}
895
896static void
897_evas_object_table_smart_del(Evas_Object *o)
898{
899 EVAS_OBJECT_TABLE_DATA_GET(o, priv);
900 Eina_List *l;
901
902 l = priv->children;
903 while (l)
904 {
905 Evas_Object_Table_Option *opt = l->data;
906 _evas_object_table_child_disconnect(o, opt->obj);
907 _evas_object_table_option_del(opt->obj);
908 free(opt);
909 l = eina_list_remove_list(l, l);
910 }
911
912 if (priv->cache)
913 {
914 _evas_object_table_cache_free(priv->cache);
915 priv->cache = NULL;
916 }
917
918 _evas_object_table_parent_sc->del(o);
919}
920
921static void
922_evas_object_table_smart_resize(Evas_Object *o, Evas_Coord w, Evas_Coord h)
923{
924 Evas_Coord ow, oh;
925 evas_object_geometry_get(o, NULL, NULL, &ow, &oh);
926 if ((ow == w) && (oh == h)) return;
927 evas_object_smart_changed(o);
928}
929
930static void
931_evas_object_table_smart_calculate(Evas_Object *o)
932{
933 EVAS_OBJECT_TABLE_DATA_GET_OR_RETURN(o, priv);
934
935 if ((priv->size.cols < 1) || (priv->size.rows < 1))
936 {
937 DBG("Nothing to do: cols=%d, rows=%d",
938 priv->size.cols, priv->size.rows);
939 return;
940 }
941
942 if (priv->homogeneous)
943 _evas_object_table_smart_calculate_homogeneous(o, priv);
944 else
945 _evas_object_table_smart_calculate_regular(o, priv);
946}
947
948static void
949_evas_object_table_smart_set_user(Evas_Smart_Class *sc)
950{
951 sc->add = _evas_object_table_smart_add;
952 sc->del = _evas_object_table_smart_del;
953 sc->resize = _evas_object_table_smart_resize;
954 sc->calculate = _evas_object_table_smart_calculate;
955}
956
957EAPI Evas_Object *
958evas_object_table_add(Evas *evas)
959{
960 return evas_object_smart_add(evas, _evas_object_table_smart_class_new());
961}
962
963EAPI Evas_Object *
964evas_object_table_add_to(Evas_Object *parent)
965{
966 Evas *evas;
967 Evas_Object *o;
968
969 evas = evas_object_evas_get(parent);
970 o = evas_object_table_add(evas);
971 evas_object_smart_member_add(o, parent);
972 return o;
973}
974
975EAPI void
976evas_object_table_homogeneous_set(Evas_Object *o, Evas_Object_Table_Homogeneous_Mode homogeneous)
977{
978 EVAS_OBJECT_TABLE_DATA_GET_OR_RETURN(o, priv);
979 if (priv->homogeneous == homogeneous)
980 return;
981 priv->homogeneous = homogeneous;
982 _evas_object_table_cache_invalidate(priv);
983 evas_object_smart_changed(o);
984}
985
986EAPI Evas_Object_Table_Homogeneous_Mode
987evas_object_table_homogeneous_get(const Evas_Object *o)
988{
989 EVAS_OBJECT_TABLE_DATA_GET_OR_RETURN_VAL(o, priv, 0);
990 return priv->homogeneous;
991}
992
993EAPI void
994evas_object_table_align_set(Evas_Object *o, double horizontal, double vertical)
995{
996 EVAS_OBJECT_TABLE_DATA_GET_OR_RETURN(o, priv);
997 if (priv->align.h == horizontal && priv->align.v == vertical)
998 return;
999 priv->align.h = horizontal;
1000 priv->align.v = vertical;
1001 evas_object_smart_changed(o);
1002}
1003
1004EAPI void
1005evas_object_table_align_get(const Evas_Object *o, double *horizontal, double *vertical)
1006{
1007 EVAS_OBJECT_TABLE_DATA_GET(o, priv);
1008 if (priv)
1009 {
1010 if (horizontal) *horizontal = priv->align.h;
1011 if (vertical) *vertical = priv->align.v;
1012 }
1013 else
1014 {
1015 if (horizontal) *horizontal = 0.5;
1016 if (vertical) *vertical = 0.5;
1017 }
1018}
1019
1020EAPI void
1021evas_object_table_padding_set(Evas_Object *o, Evas_Coord horizontal, Evas_Coord vertical)
1022{
1023 EVAS_OBJECT_TABLE_DATA_GET_OR_RETURN(o, priv);
1024 if (priv->pad.h == horizontal && priv->pad.v == vertical)
1025 return;
1026 priv->pad.h = horizontal;
1027 priv->pad.v = vertical;
1028 _evas_object_table_cache_invalidate(priv);
1029 evas_object_smart_changed(o);
1030}
1031
1032EAPI void
1033evas_object_table_padding_get(const Evas_Object *o, Evas_Coord *horizontal, Evas_Coord *vertical)
1034{
1035 EVAS_OBJECT_TABLE_DATA_GET(o, priv);
1036 if (priv)
1037 {
1038 if (horizontal) *horizontal = priv->pad.h;
1039 if (vertical) *vertical = priv->pad.v;
1040 }
1041 else
1042 {
1043 if (horizontal) *horizontal = 0;
1044 if (vertical) *vertical = 0;
1045 }
1046}
1047
1048EAPI Eina_Bool
1049evas_object_table_pack_get(Evas_Object *o, Evas_Object *child, unsigned short *col, unsigned short *row, unsigned short *colspan, unsigned short *rowspan)
1050{
1051 Evas_Object_Table_Option *opt;
1052
1053 EVAS_OBJECT_TABLE_DATA_GET_OR_RETURN_VAL(o, priv, 0);
1054 opt = _evas_object_table_option_get(child);
1055 if (!opt)
1056 {
1057 if (col) *col = 0;
1058 if (row) *row = 0;
1059 if (colspan) *colspan = 0;
1060 if (rowspan) *rowspan = 0;
1061 return EINA_FALSE;
1062 }
1063 if (col) *col = opt->col;
1064 if (row) *row = opt->row;
1065 if (colspan) *colspan = opt->colspan;
1066 if (rowspan) *rowspan = opt->rowspan;
1067 return EINA_TRUE;
1068}
1069
1070EAPI Eina_Bool
1071evas_object_table_pack(Evas_Object *o, Evas_Object *child, unsigned short col, unsigned short row, unsigned short colspan, unsigned short rowspan)
1072{
1073 Evas_Object_Table_Option *opt;
1074
1075 EVAS_OBJECT_TABLE_DATA_GET_OR_RETURN_VAL(o, priv, 0);
1076
1077 if (rowspan < 1)
1078 {
1079 ERR("rowspan < 1");
1080 return EINA_FALSE;
1081 }
1082 if (colspan < 1)
1083 {
1084 ERR("colspan < 1");
1085 return EINA_FALSE;
1086 }
1087
1088 opt = _evas_object_table_option_get(child);
1089 if (!opt)
1090 {
1091 opt = malloc(sizeof(*opt));
1092 if (!opt)
1093 {
1094 ERR("could not allocate table option data.");
1095 return EINA_FALSE;
1096 }
1097 }
1098
1099 opt->obj = child;
1100 opt->col = col;
1101 opt->row = row;
1102 opt->colspan = colspan;
1103 opt->rowspan = rowspan;
1104 opt->end_col = col + colspan;
1105 opt->end_row = row + rowspan;
1106
1107 if (evas_object_smart_parent_get(child) == o)
1108 {
1109 Eina_Bool need_shrink = EINA_FALSE;
1110
1111 if (priv->size.cols < opt->end_col)
1112 priv->size.cols = opt->end_col;
1113 else
1114 need_shrink = EINA_TRUE;
1115 if (priv->size.rows < opt->end_row)
1116 priv->size.rows = opt->end_row;
1117 else
1118 need_shrink = EINA_TRUE;
1119
1120 if (need_shrink)
1121 {
1122 Eina_List *l;
1123 Evas_Object_Table_Option *opt2;
1124 int max_row = 0, max_col = 0;
1125
1126 EINA_LIST_FOREACH(priv->children, l, opt2)
1127 {
1128 if (max_col < opt2->end_col) max_col = opt2->end_col;
1129 if (max_row < opt2->end_row) max_row = opt2->end_row;
1130 }
1131 priv->size.cols = max_col;
1132 priv->size.rows = max_row;
1133 }
1134 }
1135 else
1136 {
1137 opt->min.w = 0;
1138 opt->min.h = 0;
1139 opt->max.w = 0;
1140 opt->max.h = 0;
1141 opt->align.h = 0.5;
1142 opt->align.v = 0.5;
1143 opt->pad.l = 0;
1144 opt->pad.r = 0;
1145 opt->pad.t = 0;
1146 opt->pad.b = 0;
1147 opt->expand_h = 0;
1148 opt->expand_v = 0;
1149
1150 priv->children = eina_list_append(priv->children, opt);
1151
1152 if (priv->size.cols < opt->end_col)
1153 priv->size.cols = opt->end_col;
1154 if (priv->size.rows < opt->end_row)
1155 priv->size.rows = opt->end_row;
1156
1157 _evas_object_table_option_set(child, opt);
1158 evas_object_smart_member_add(child, o);
1159 _evas_object_table_child_connect(o, child);
1160 }
1161 _evas_object_table_cache_invalidate(priv);
1162 evas_object_smart_changed(o);
1163 return EINA_TRUE;
1164}
1165
1166static void
1167_evas_object_table_remove_opt(Evas_Object_Table_Data *priv, Evas_Object_Table_Option *opt)
1168{
1169 Eina_List *l;
1170 int max_row, max_col, was_greatest;
1171
1172 max_row = 0;
1173 max_col = 0;
1174 was_greatest = 0;
1175 l = priv->children;
1176 while (l)
1177 {
1178 Evas_Object_Table_Option *cur_opt = l->data;
1179
1180 if (cur_opt != opt)
1181 {
1182 if (max_col < cur_opt->end_col)
1183 max_col = cur_opt->end_col;
1184 if (max_row < cur_opt->end_row)
1185 max_row = cur_opt->end_row;
1186
1187 l = l->next;
1188 }
1189 else
1190 {
1191 Eina_List *tmp = l->next;
1192 priv->children = eina_list_remove_list(priv->children, l);
1193
1194 if ((priv->size.cols > opt->end_col) &&
1195 (priv->size.rows > opt->end_row))
1196 break;
1197 else
1198 {
1199 was_greatest = 1;
1200 l = tmp;
1201 }
1202 }
1203 }
1204
1205 if (was_greatest)
1206 {
1207 priv->size.cols = max_col;
1208 priv->size.rows = max_row;
1209 }
1210}
1211
1212EAPI Eina_Bool
1213evas_object_table_unpack(Evas_Object *o, Evas_Object *child)
1214{
1215 Evas_Object_Table_Option *opt;
1216
1217 EVAS_OBJECT_TABLE_DATA_GET_OR_RETURN_VAL(o, priv, 0);
1218
1219 if (o != evas_object_smart_parent_get(child))
1220 {
1221 ERR("cannot unpack child from incorrect table!");
1222 return EINA_FALSE;
1223 }
1224
1225 opt = _evas_object_table_option_del(child);
1226 if (!opt)
1227 {
1228 ERR("cannot unpack child with no packing option!");
1229 return EINA_FALSE;
1230 }
1231
1232 _evas_object_table_child_disconnect(o, child);
1233 _evas_object_table_remove_opt(priv, opt);
1234 evas_object_smart_member_del(child);
1235 free(opt);
1236 _evas_object_table_cache_invalidate(priv);
1237 evas_object_smart_changed(o);
1238
1239 return EINA_TRUE;
1240}
1241
1242EAPI void
1243evas_object_table_clear(Evas_Object *o, Eina_Bool clear)
1244{
1245 Evas_Object_Table_Option *opt;
1246
1247 EVAS_OBJECT_TABLE_DATA_GET_OR_RETURN(o, priv);
1248
1249 EINA_LIST_FREE(priv->children, opt)
1250 {
1251 _evas_object_table_child_disconnect(o, opt->obj);
1252 _evas_object_table_option_del(opt->obj);
1253 evas_object_smart_member_del(opt->obj);
1254 if (clear)
1255 evas_object_del(opt->obj);
1256 free(opt);
1257 }
1258 priv->size.cols = 0;
1259 priv->size.rows = 0;
1260 _evas_object_table_cache_invalidate(priv);
1261 evas_object_smart_changed(o);
1262}
1263
1264EAPI void
1265evas_object_table_col_row_size_get(const Evas_Object *o, int *cols, int *rows)
1266{
1267 EVAS_OBJECT_TABLE_DATA_GET(o, priv);
1268 if (priv)
1269 {
1270 if (cols) *cols = priv->size.cols;
1271 if (rows) *rows = priv->size.rows;
1272 }
1273 else
1274 {
1275 if (cols) *cols = -1;
1276 if (rows) *rows = -1;
1277 }
1278}
1279
1280EAPI Eina_Iterator *
1281evas_object_table_iterator_new(const Evas_Object *o)
1282{
1283 Evas_Object_Table_Iterator *it;
1284
1285 EVAS_OBJECT_TABLE_DATA_GET_OR_RETURN_VAL(o, priv, NULL);
1286
1287 if (!priv->children) return NULL;
1288
1289 it = calloc(1, sizeof(Evas_Object_Table_Iterator));
1290 if (!it) return NULL;
1291
1292 EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR);
1293
1294 it->real_iterator = eina_list_iterator_new(priv->children);
1295 it->table = o;
1296
1297 it->iterator.next = FUNC_ITERATOR_NEXT(_evas_object_table_iterator_next);
1298 it->iterator.get_container = FUNC_ITERATOR_GET_CONTAINER(_evas_object_table_iterator_get_container);
1299 it->iterator.free = FUNC_ITERATOR_FREE(_evas_object_table_iterator_free);
1300
1301 return &it->iterator;
1302}
1303
1304EAPI Eina_Accessor *
1305evas_object_table_accessor_new(const Evas_Object *o)
1306{
1307 Evas_Object_Table_Accessor *it;
1308
1309 EVAS_OBJECT_TABLE_DATA_GET_OR_RETURN_VAL(o, priv, NULL);
1310
1311 if (!priv->children) return NULL;
1312
1313 it = calloc(1, sizeof(Evas_Object_Table_Accessor));
1314 if (!it) return NULL;
1315
1316 EINA_MAGIC_SET(&it->accessor, EINA_MAGIC_ACCESSOR);
1317
1318 it->real_accessor = eina_list_accessor_new(priv->children);
1319 it->table = o;
1320
1321 it->accessor.get_at = FUNC_ACCESSOR_GET_AT(_evas_object_table_accessor_get_at);
1322 it->accessor.get_container = FUNC_ACCESSOR_GET_CONTAINER(_evas_object_table_accessor_get_container);
1323 it->accessor.free = FUNC_ACCESSOR_FREE(_evas_object_table_accessor_free);
1324
1325 return &it->accessor;
1326}
1327
1328EAPI Eina_List *
1329evas_object_table_children_get(const Evas_Object *o)
1330{
1331 Eina_List *new_list = NULL, *l;
1332 Evas_Object_Table_Option *opt;
1333
1334 EVAS_OBJECT_TABLE_DATA_GET_OR_RETURN_VAL(o, priv, NULL);
1335
1336 EINA_LIST_FOREACH(priv->children, l, opt)
1337 new_list = eina_list_append(new_list, opt->obj);
1338
1339 return new_list;
1340}
1341
1342Evas_Object *
1343evas_object_table_child_get(const Evas_Object *o, unsigned short col, unsigned short row)
1344{
1345 Eina_List *l;
1346 Evas_Object_Table_Option *opt;
1347
1348 EVAS_OBJECT_TABLE_DATA_GET_OR_RETURN_VAL(o, priv, NULL);
1349
1350 EINA_LIST_FOREACH(priv->children, l, opt)
1351 if (opt->col == col && opt->row == row)
1352 return opt->obj;
1353 return NULL;
1354}
1355
1356EAPI Eina_Bool
1357evas_object_table_mirrored_get(const Evas_Object *obj)
1358{
1359 EVAS_OBJECT_TABLE_DATA_GET_OR_RETURN_VAL(obj, priv, EINA_FALSE);
1360
1361 return priv->is_mirrored;
1362}
1363
1364EAPI void
1365evas_object_table_mirrored_set(Evas_Object *obj, Eina_Bool mirrored)
1366{
1367 EVAS_OBJECT_TABLE_DATA_GET_OR_RETURN(obj, priv);
1368 if (priv->is_mirrored != mirrored)
1369 {
1370 priv->is_mirrored = mirrored;
1371 _evas_object_table_smart_calculate(obj);
1372 }
1373}
diff --git a/libraries/evas/src/lib/canvas/evas_object_text.c b/libraries/evas/src/lib/canvas/evas_object_text.c
new file mode 100644
index 0000000..6c30fcc
--- /dev/null
+++ b/libraries/evas/src/lib/canvas/evas_object_text.c
@@ -0,0 +1,1943 @@
1#include "evas_common.h" /* Includes evas_bidi_utils stuff. */
2#include "evas_private.h"
3
4/* save typing */
5#define ENFN obj->layer->evas->engine.func
6#define ENDT obj->layer->evas->engine.data.output
7
8/* private magic number for text objects */
9static const char o_type[] = "text";
10
11/* private struct for text object internal data */
12typedef struct _Evas_Object_Text Evas_Object_Text;
13typedef struct _Evas_Object_Text_Item Evas_Object_Text_Item;
14
15struct _Evas_Object_Text
16{
17 DATA32 magic;
18
19 struct {
20 const char *utf8_text; /* The text exposed to the API */
21 const char *font;
22 Evas_Font_Description *fdesc;
23 const char *source;
24 Evas_Font_Size size;
25 struct {
26 unsigned char r, g, b, a;
27 } outline, shadow, glow, glow2;
28
29 unsigned char style;
30 } cur, prev;
31
32 float ascent, descent;
33 float max_ascent, max_descent;
34 Evas_BiDi_Paragraph_Props *bidi_par_props;
35 const char *bidi_delimiters;
36 Evas_Object_Text_Item *items;
37
38 Evas_Font_Set *font;
39
40 char changed : 1;
41};
42
43struct _Evas_Object_Text_Item
44{
45 EINA_INLIST;
46
47 size_t text_pos;
48 size_t visual_pos;
49 Evas_Text_Props text_props;
50 Evas_Coord x, w, h, adv;
51};
52
53/* private methods for text objects */
54static void evas_object_text_init(Evas_Object *obj);
55static void *evas_object_text_new(void);
56static void evas_object_text_render(Evas_Object *obj, void *output, void *context, void *surface, int x, int y);
57static void evas_object_text_free(Evas_Object *obj);
58static void evas_object_text_render_pre(Evas_Object *obj);
59static void evas_object_text_render_post(Evas_Object *obj);
60
61static unsigned int evas_object_text_id_get(Evas_Object *obj);
62static unsigned int evas_object_text_visual_id_get(Evas_Object *obj);
63static void *evas_object_text_engine_data_get(Evas_Object *obj);
64
65static int evas_object_text_is_opaque(Evas_Object *obj);
66static int evas_object_text_was_opaque(Evas_Object *obj);
67
68static void evas_object_text_scale_update(Evas_Object *obj);
69static void _evas_object_text_recalc(Evas_Object *obj);
70
71static const Evas_Object_Func object_func =
72{
73 /* methods (compulsory) */
74 evas_object_text_free,
75 evas_object_text_render,
76 evas_object_text_render_pre,
77 evas_object_text_render_post,
78 evas_object_text_id_get,
79 evas_object_text_visual_id_get,
80 evas_object_text_engine_data_get,
81 /* these are optional. NULL = nothing */
82 NULL,
83 NULL,
84 NULL,
85 NULL,
86 evas_object_text_is_opaque,
87 evas_object_text_was_opaque,
88 NULL,
89 NULL,
90 NULL,
91 evas_object_text_scale_update,
92 NULL,
93 NULL,
94 NULL
95};
96
97/* the actual api call to add a rect */
98/* it has no other api calls as all properties are standard */
99
100EVAS_MEMPOOL(_mp_obj);
101
102static int
103_evas_object_text_char_coords_get(const Evas_Object *obj,
104 const Evas_Object_Text *o,
105 size_t pos, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
106{
107 Evas_Object_Text_Item *it;
108
109 EINA_INLIST_FOREACH(EINA_INLIST_GET(o->items), it)
110 {
111 if ((it->text_pos <= pos) &&
112 (pos < (it->text_pos + it->text_props.text_len)))
113 {
114 int ret;
115 ret = ENFN->font_char_coords_get(ENDT, o->font,
116 &it->text_props, pos - it->text_pos, x, y, w, h);
117 if (x) *x += it->x;
118 return ret;
119 }
120 }
121 return 0;
122}
123
124static void
125_evas_object_text_item_clean(Evas_Object_Text_Item *it)
126{
127 evas_common_text_props_content_unref(&it->text_props);
128}
129
130static void
131_evas_object_text_items_clear(Evas_Object_Text *o)
132{
133 Evas_Object_Text_Item *it;
134
135 while (o->items)
136 {
137 it = o->items;
138 o->items = (Evas_Object_Text_Item *) eina_inlist_remove(
139 EINA_INLIST_GET(o->items),
140 EINA_INLIST_GET(it));
141 _evas_object_text_item_clean(it);
142 free(it);
143 }
144}
145
146#ifdef BIDI_SUPPORT
147static int
148_evas_object_text_it_compare_logical(const void *_it1, const void *_it2)
149{
150 const Evas_Object_Text_Item *it1 = _it1, *it2 = _it2;
151 if (it1->text_pos < it2->text_pos)
152 return -1;
153 else if (it1->text_pos == it2->text_pos)
154 return 0;
155 else
156 return 1;
157
158}
159#endif
160
161static int
162_evas_object_text_last_up_to_pos(const Evas_Object *obj,
163 const Evas_Object_Text *o, Evas_Coord cx, Evas_Coord cy)
164{
165 Evas_Object_Text_Item *it;
166
167#ifdef BIDI_SUPPORT
168 /*FIXME: not very efficient, sort the items arrays. */
169 /* Reorder if it's a bidi text */
170 if (o->bidi_par_props)
171 {
172 Eina_List *logical_it = NULL;
173 Evas_Object_Text_Item *i;
174 Eina_List *itr;
175 Evas_Coord x = 0;
176 /* Insert all to the logical list */
177 EINA_INLIST_FOREACH(o->items, i)
178 {
179 logical_it = eina_list_sorted_insert(logical_it,
180 _evas_object_text_it_compare_logical, i);
181 }
182 EINA_LIST_FOREACH(logical_it, itr, it)
183 {
184 if ((x <= cx) && (cx < x + it->adv))
185 {
186 return it->text_pos + ENFN->font_last_up_to_pos(ENDT,
187 o->font,
188 &it->text_props,
189 cx - x,
190 cy);
191 }
192 x += it->adv;
193 }
194 eina_list_free(logical_it);
195 }
196 else
197#endif
198 {
199 EINA_INLIST_FOREACH(EINA_INLIST_GET(o->items), it)
200 {
201 if ((it->x <= cx) && (cx < it->x + it->adv))
202 {
203 return it->text_pos + ENFN->font_last_up_to_pos(ENDT,
204 o->font,
205 &it->text_props,
206 cx - it->x,
207 cy);
208 }
209 }
210 }
211 return -1;
212}
213
214static int
215_evas_object_text_char_at_coords(const Evas_Object *obj,
216 const Evas_Object_Text *o, Evas_Coord cx, Evas_Coord cy,
217 Evas_Coord *rx, Evas_Coord *ry, Evas_Coord *rw, Evas_Coord *rh)
218{
219 Evas_Object_Text_Item *it;
220
221 EINA_INLIST_FOREACH(EINA_INLIST_GET(o->items), it)
222 {
223 if ((it->x <= cx) && (cx < it->x + it->adv))
224 {
225 return it->text_pos + ENFN->font_char_at_coords_get(ENDT,
226 o->font,
227 &it->text_props,
228 cx - it->x,
229 cy,
230 rx, ry,
231 rw, rh);
232 }
233 }
234 return -1;
235}
236
237static Evas_Coord
238_evas_object_text_horiz_advance_get(const Evas_Object *obj,
239 const Evas_Object_Text *o)
240{
241 Evas_Object_Text_Item *it;
242 Evas_Coord adv;
243 (void) obj;
244
245 adv = 0;
246 EINA_INLIST_FOREACH(EINA_INLIST_GET(o->items), it)
247 {
248 adv += it->adv;
249 }
250 return adv;
251}
252
253static Evas_Coord
254_evas_object_text_vert_advance_get(const Evas_Object *obj __UNUSED__,
255 const Evas_Object_Text *o)
256{
257 return o->max_ascent + o->max_descent;
258}
259
260EAPI Evas_Object *
261evas_object_text_add(Evas *e)
262{
263 Evas_Object *obj;
264
265 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
266 return NULL;
267 MAGIC_CHECK_END();
268 obj = evas_object_new(e);
269 evas_object_text_init(obj);
270 evas_object_inject(obj, e);
271 return obj;
272}
273
274EAPI void
275evas_object_text_font_source_set(Evas_Object *obj, const char *font_source)
276{
277 Evas_Object_Text *o;
278
279 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
280 return;
281 MAGIC_CHECK_END();
282 o = (Evas_Object_Text *)(obj->object_data);
283 MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
284 return;
285 MAGIC_CHECK_END();
286
287 if ((o->cur.source) && (font_source) &&
288 (!strcmp(o->cur.source, font_source)))
289 return;
290 /*
291 if (o->cur.source) eina_stringshare_del(o->cur.source);
292 if (font_source) o->cur.source = eina_stringshare_add(font_source);
293 else o->cur.source = NULL;
294 */
295 eina_stringshare_replace(&o->cur.source, font_source);
296}
297
298EAPI const char *
299evas_object_text_font_source_get(const Evas_Object *obj)
300{
301 Evas_Object_Text *o;
302
303 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
304 return NULL;
305 MAGIC_CHECK_END();
306 o = (Evas_Object_Text *)(obj->object_data);
307 MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
308 return NULL;
309 MAGIC_CHECK_END();
310 return o->cur.source;
311}
312
313EAPI void
314evas_object_text_font_set(Evas_Object *obj, const char *font, Evas_Font_Size size)
315{
316 Evas_Object_Text *o;
317 int is, was = 0, pass = 0, freeze = 0;
318 Evas_Font_Description *fdesc;
319
320 if ((!font) || (size <= 0)) return;
321 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
322 return;
323 MAGIC_CHECK_END();
324 o = (Evas_Object_Text *)(obj->object_data);
325 MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
326 return;
327 MAGIC_CHECK_END();
328
329 fdesc = evas_font_desc_new();
330 evas_font_name_parse(fdesc, font);
331 if (o->cur.fdesc && !evas_font_desc_cmp(fdesc, o->cur.fdesc) &&
332 (size == o->cur.size))
333 {
334 evas_font_desc_unref(fdesc);
335 return;
336 }
337
338 if (o->cur.fdesc) evas_font_desc_unref(o->cur.fdesc);
339 o->cur.fdesc = fdesc;
340
341 o->cur.size = size;
342 eina_stringshare_replace(&o->cur.font, font);
343 o->prev.font = NULL;
344
345 if (obj->layer->evas->events_frozen <= 0)
346 {
347 pass = evas_event_passes_through(obj);
348 freeze = evas_event_freezes_through(obj);
349 if ((!pass) && (!freeze))
350 was = evas_object_is_in_output_rect(obj,
351 obj->layer->evas->pointer.x,
352 obj->layer->evas->pointer.y, 1, 1);
353 }
354
355#ifdef EVAS_FRAME_QUEUING
356 if (o->font)
357 evas_common_pipe_op_text_flush((RGBA_Font *) o->font);
358#endif
359
360 /* DO IT */
361 if (o->font)
362 {
363 evas_font_free(obj->layer->evas, o->font);
364 o->font = NULL;
365 }
366
367 o->font = evas_font_load(obj->layer->evas, o->cur.fdesc, o->cur.source,
368 (int)(((double) o->cur.size) * obj->cur.scale));
369 if (o->font)
370 {
371 o->ascent = ENFN->font_ascent_get(ENDT, o->font);
372 o->descent = ENFN->font_descent_get(ENDT, o->font);
373 o->max_ascent = ENFN->font_max_ascent_get(ENDT, o->font);
374 o->max_descent = ENFN->font_max_descent_get(ENDT, o->font);
375 }
376 else
377 {
378 o->ascent = 0;
379 o->descent = 0;
380 o->max_ascent = 0;
381 o->max_descent = 0;
382 }
383 _evas_object_text_recalc(obj);
384 o->changed = 1;
385 evas_object_change(obj);
386 evas_object_clip_dirty(obj);
387 evas_object_coords_recalc(obj);
388 if (obj->layer->evas->events_frozen <= 0)
389 {
390 if ((!pass) && (!freeze))
391 {
392 is = evas_object_is_in_output_rect(obj,
393 obj->layer->evas->pointer.x,
394 obj->layer->evas->pointer.y,
395 1, 1);
396 if ((is ^ was) && obj->cur.visible)
397 evas_event_feed_mouse_move(obj->layer->evas,
398 obj->layer->evas->pointer.x,
399 obj->layer->evas->pointer.y,
400 obj->layer->evas->last_timestamp,
401 NULL);
402 }
403 }
404 evas_object_inform_call_resize(obj);
405}
406
407EAPI void
408evas_object_text_font_get(const Evas_Object *obj, const char **font, Evas_Font_Size *size)
409{
410 Evas_Object_Text *o;
411
412 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
413 if (font) *font = "";
414 if (size) *size = 0;
415 return;
416 MAGIC_CHECK_END();
417 o = (Evas_Object_Text *)(obj->object_data);
418 MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
419 if (font) *font = "";
420 if (size) *size = 0;
421 return;
422 MAGIC_CHECK_END();
423 if (font) *font = o->cur.font;
424 if (size) *size = o->cur.size;
425}
426
427
428/**
429 * @internal
430 * Create a new text layout item from the string and the format.
431 *
432 * @param c the context to work on - Not NULL.
433 * @param fmt the format to use.
434 * @param str the string to use.
435 */
436static Evas_Object_Text_Item *
437_evas_object_text_item_new(Evas_Object *obj, Evas_Object_Text *o,
438 Evas_Font_Instance *fi, const Eina_Unicode *str, Evas_Script_Type script,
439 size_t pos, size_t visual_pos, size_t len)
440{
441 Evas_Object_Text_Item *it;
442
443 it = calloc(1, sizeof(Evas_Object_Text_Item));
444 it->text_pos = pos;
445 it->visual_pos = visual_pos;
446 evas_common_text_props_bidi_set(&it->text_props, o->bidi_par_props,
447 it->text_pos);
448 evas_common_text_props_script_set(&it->text_props, script);
449
450 if (fi)
451 {
452 ENFN->font_text_props_info_create(ENDT,
453 fi, str + pos, &it->text_props,
454 o->bidi_par_props, it->text_pos, len);
455
456 ENFN->font_string_size_get(ENDT,
457 o->font,
458 &it->text_props,
459 &it->w, &it->h);
460 it->adv = ENFN->font_h_advance_get(ENDT, o->font,
461 &it->text_props);
462 }
463 o->items = (Evas_Object_Text_Item *)
464 eina_inlist_append(EINA_INLIST_GET(o->items), EINA_INLIST_GET(it));
465 return it;
466}
467
468/**
469 * @internal
470 * Orders o->items according to the visual position.
471 *
472 * @param obj the evas object
473 * @param o the text object
474 */
475static void
476_evas_object_text_item_order(Evas_Object *obj, Evas_Object_Text *o)
477{
478 (void) obj;
479#ifdef BIDI_SUPPORT
480 /*FIXME: not very efficient, sort the items arrays. */
481 /* Reorder if it's a bidi text */
482 if (o->bidi_par_props)
483 {
484 Evas_Object_Text_Item *i, *j, *min;
485 i = o->items;
486 while (i)
487 {
488 min = i;
489 EINA_INLIST_FOREACH(i, j)
490 {
491 if (j->visual_pos < min->visual_pos)
492 {
493 min = j;
494 }
495 }
496 if (min != i)
497 {
498 o->items = (Evas_Object_Text_Item *) eina_inlist_remove(EINA_INLIST_GET(o->items), EINA_INLIST_GET(min));
499 o->items = (Evas_Object_Text_Item *) eina_inlist_prepend_relative(EINA_INLIST_GET(o->items), EINA_INLIST_GET(min), EINA_INLIST_GET(i));
500 }
501
502 i = (Evas_Object_Text_Item *) EINA_INLIST_GET(min)->next;
503 }
504 }
505#endif
506
507 /* calculate the positions according to the order. */
508 {
509 Evas_Object_Text_Item *it = o->items;
510 Evas_Coord x = 0;
511
512 while (it)
513 {
514 it->x = x;
515 x += it->adv;
516 it = (Evas_Object_Text_Item *) EINA_INLIST_GET(it)->next;
517 }
518 }
519}
520
521/**
522 * @internal
523 * Populates o->items with the items of the text according to text
524 *
525 * @param obj the evas object
526 * @param o the text object
527 * @param text the text to layout
528 */
529static void
530_evas_object_text_layout(Evas_Object *obj, Evas_Object_Text *o, const Eina_Unicode *text)
531{
532 EvasBiDiStrIndex *v_to_l = NULL;
533 size_t pos, visual_pos;
534 int len = eina_unicode_strlen(text), par_len;
535#ifdef BIDI_SUPPORT
536 int *segment_idxs = NULL;
537 if (o->bidi_delimiters)
538 segment_idxs = evas_bidi_segment_idxs_get(text, o->bidi_delimiters);
539 evas_bidi_paragraph_props_unref(o->bidi_par_props);
540 o->bidi_par_props = evas_bidi_paragraph_props_get(text, len, segment_idxs);
541 evas_bidi_props_reorder_line(NULL, 0, len, o->bidi_par_props, &v_to_l);
542 if (segment_idxs) free(segment_idxs);
543#endif
544 visual_pos = pos = 0;
545
546 par_len = len;
547 while (len > 0)
548 {
549 Evas_Font_Instance *script_fi = NULL;
550 int script_len = len, tmp_cut;
551 Evas_Script_Type script;
552 tmp_cut = evas_common_language_script_end_of_run_get(
553 text + pos,
554 o->bidi_par_props,
555 pos, len);
556 if (tmp_cut > 0)
557 script_len = tmp_cut;
558
559 script = evas_common_language_script_type_get(text, script_len);
560
561 while (script_len > 0)
562 {
563 Evas_Font_Instance *cur_fi = NULL;
564 int run_len = script_len;
565 if (o->font)
566 {
567 run_len = ENFN->font_run_end_get(ENDT,
568 o->font, &script_fi, &cur_fi,
569 script, text + pos, script_len);
570 }
571#ifdef BIDI_SUPPORT
572 visual_pos = evas_bidi_position_logical_to_visual(
573 v_to_l, par_len, pos);
574#else
575 visual_pos = pos;
576#endif
577 _evas_object_text_item_new(obj, o, cur_fi, text, script,
578 pos, visual_pos, run_len);
579
580 pos += run_len;
581 script_len -= run_len;
582 len -= run_len;
583 }
584 }
585
586 _evas_object_text_item_order(obj, o);
587
588 if (v_to_l) free(v_to_l);
589}
590
591
592EAPI void
593evas_object_text_text_set(Evas_Object *obj, const char *_text)
594{
595 Evas_Object_Text *o;
596 int is, was, len;
597 Eina_Unicode *text;
598
599 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
600 return;
601 MAGIC_CHECK_END();
602 o = (Evas_Object_Text *)(obj->object_data);
603 MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
604 return;
605 MAGIC_CHECK_END();
606
607 if ((o->cur.utf8_text) && (_text) && (!strcmp(o->cur.utf8_text, _text)))
608 return;
609 text = eina_unicode_utf8_to_unicode(_text, &len);
610
611 if (!text) text = eina_unicode_strdup(EINA_UNICODE_EMPTY_STRING);
612 was = evas_object_is_in_output_rect(obj,
613 obj->layer->evas->pointer.x,
614 obj->layer->evas->pointer.y, 1, 1);
615 /* DO II */
616 /*Update bidi_props*/
617
618 if (o->items) _evas_object_text_items_clear(o);
619
620 if ((text) && (*text))
621 {
622 _evas_object_text_layout(obj, o, text);
623 eina_stringshare_replace(&o->cur.utf8_text, _text);
624 o->prev.utf8_text = NULL;
625 }
626 else
627 {
628 eina_stringshare_replace(&o->cur.utf8_text, NULL);
629 }
630 if (text)
631 {
632 free(text);
633 text = NULL;
634 }
635 _evas_object_text_recalc(obj);
636 o->changed = 1;
637 evas_object_change(obj);
638 evas_object_clip_dirty(obj);
639 evas_object_coords_recalc(obj);
640 is = evas_object_is_in_output_rect(obj,
641 obj->layer->evas->pointer.x,
642 obj->layer->evas->pointer.y, 1, 1);
643 if ((is || was) && obj->cur.visible)
644 evas_event_feed_mouse_move(obj->layer->evas,
645 obj->layer->evas->pointer.x,
646 obj->layer->evas->pointer.y,
647 obj->layer->evas->last_timestamp,
648 NULL);
649 evas_object_inform_call_resize(obj);
650 if (text) free(text);
651}
652
653EAPI void
654evas_object_text_bidi_delimiters_set(Evas_Object *obj, const char *delim)
655{
656 Evas_Object_Text *o;
657
658 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
659 return;
660 MAGIC_CHECK_END();
661 o = (Evas_Object_Text *)(obj->object_data);
662 MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
663 return;
664 MAGIC_CHECK_END();
665
666 eina_stringshare_replace(&o->bidi_delimiters, delim);
667}
668
669EAPI const char *
670evas_object_text_bidi_delimiters_get(const Evas_Object *obj)
671{
672 Evas_Object_Text *o;
673
674 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
675 return NULL;
676 MAGIC_CHECK_END();
677 o = (Evas_Object_Text *)(obj->object_data);
678 MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
679 return NULL;
680 MAGIC_CHECK_END();
681
682 return o->bidi_delimiters;
683}
684
685
686EAPI const char *
687evas_object_text_text_get(const Evas_Object *obj)
688{
689 Evas_Object_Text *o;
690
691 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
692 return NULL;
693 MAGIC_CHECK_END();
694 o = (Evas_Object_Text *)(obj->object_data);
695 MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
696 return NULL;
697 MAGIC_CHECK_END();
698 return o->cur.utf8_text;
699}
700
701EAPI Evas_BiDi_Direction
702evas_object_text_direction_get(const Evas_Object *obj)
703{
704 Evas_Object_Text *o;
705
706 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
707 return EVAS_BIDI_DIRECTION_NEUTRAL;
708 MAGIC_CHECK_END();
709 o = (Evas_Object_Text *)(obj->object_data);
710 MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
711 return EVAS_BIDI_DIRECTION_NEUTRAL;
712 MAGIC_CHECK_END();
713 if (o->items)
714 {
715 return o->items->text_props.bidi.dir;
716 }
717 return EVAS_BIDI_DIRECTION_NEUTRAL;
718}
719
720EAPI Evas_Coord
721evas_object_text_ascent_get(const Evas_Object *obj)
722{
723 Evas_Object_Text *o;
724
725 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
726 return 0;
727 MAGIC_CHECK_END();
728 o = (Evas_Object_Text *)(obj->object_data);
729 MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
730 return 0;
731 MAGIC_CHECK_END();
732 return o->ascent;
733}
734
735EAPI Evas_Coord
736evas_object_text_descent_get(const Evas_Object *obj)
737{
738 Evas_Object_Text *o;
739
740 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
741 return 0;
742 MAGIC_CHECK_END();
743 o = (Evas_Object_Text *)(obj->object_data);
744 MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
745 return 0;
746 MAGIC_CHECK_END();
747 return o->descent;
748}
749
750EAPI Evas_Coord
751evas_object_text_max_ascent_get(const Evas_Object *obj)
752{
753 Evas_Object_Text *o;
754
755 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
756 return 0;
757 MAGIC_CHECK_END();
758 o = (Evas_Object_Text *)(obj->object_data);
759 MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
760 return 0;
761 MAGIC_CHECK_END();
762 return o->max_ascent;
763}
764
765EAPI Evas_Coord
766evas_object_text_max_descent_get(const Evas_Object *obj)
767{
768 Evas_Object_Text *o;
769
770 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
771 return 0;
772 MAGIC_CHECK_END();
773 o = (Evas_Object_Text *)(obj->object_data);
774 MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
775 return 0;
776 MAGIC_CHECK_END();
777 return o->max_descent;
778}
779
780EAPI Evas_Coord
781evas_object_text_inset_get(const Evas_Object *obj)
782{
783 Evas_Object_Text *o;
784
785 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
786 return 0;
787 MAGIC_CHECK_END();
788 o = (Evas_Object_Text *)(obj->object_data);
789 MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
790 return 0;
791 MAGIC_CHECK_END();
792 if (!o->font) return 0;
793 if (!o->items) return 0;
794 return ENFN->font_inset_get(ENDT, o->font, &o->items->text_props);
795}
796
797EAPI Evas_Coord
798evas_object_text_horiz_advance_get(const Evas_Object *obj)
799{
800 Evas_Object_Text *o;
801
802 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
803 return 0;
804 MAGIC_CHECK_END();
805 o = (Evas_Object_Text *)(obj->object_data);
806 MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
807 return 0;
808 MAGIC_CHECK_END();
809 if (!o->font) return 0;
810 if (!o->items) return 0;
811 return _evas_object_text_horiz_advance_get(obj, o);
812}
813
814EAPI Evas_Coord
815evas_object_text_vert_advance_get(const Evas_Object *obj)
816{
817 Evas_Object_Text *o;
818
819 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
820 return 0;
821 MAGIC_CHECK_END();
822 o = (Evas_Object_Text *)(obj->object_data);
823 MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
824 return 0;
825 MAGIC_CHECK_END();
826 if (!o->font) return 0;
827 if (!o->items) return o->ascent + o->descent;
828 return _evas_object_text_vert_advance_get(obj, o);
829}
830
831EAPI Eina_Bool
832evas_object_text_char_pos_get(const Evas_Object *obj, int pos, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch)
833{
834 Evas_Object_Text *o;
835 int l = 0, r = 0, t = 0, b = 0;
836 int ret, x = 0, y = 0, w = 0, h = 0;
837
838 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
839 return EINA_FALSE;
840 MAGIC_CHECK_END();
841 o = (Evas_Object_Text *)(obj->object_data);
842 MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
843 return EINA_FALSE;
844 MAGIC_CHECK_END();
845 if (!o->font) return EINA_FALSE;
846 if (!o->items || (pos < 0)) return EINA_FALSE;
847 ret = _evas_object_text_char_coords_get(obj, o, (size_t) pos,
848 &x, &y, &w, &h);
849 evas_text_style_pad_get(o->cur.style, &l, &r, &t, &b);
850 y += o->max_ascent - t;
851 x -= l;
852 if (x < 0)
853 {
854 w += x;
855 x = 0;
856 }
857 if ((x + w) > obj->cur.geometry.w) w = obj->cur.geometry.w - x;
858 if (w < 0) w = 0;
859 if (y < 0)
860 {
861 h += y;
862 y = 0;
863 }
864 if ((y + h) > obj->cur.geometry.h) h = obj->cur.geometry.h - y;
865 if (h < 0) h = 0;
866 if (cx) *cx = x;
867 if (cy) *cy = y;
868 if (cw) *cw = w + l + r;
869 if (ch) *ch = h + t + b;
870 return ret;
871}
872
873
874EAPI int
875evas_object_text_last_up_to_pos(const Evas_Object *obj, Evas_Coord x, Evas_Coord y)
876{
877 Evas_Object_Text *o;
878
879 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
880 return -1;
881 MAGIC_CHECK_END();
882 o = (Evas_Object_Text *)(obj->object_data);
883 MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
884 return -1;
885 MAGIC_CHECK_END();
886 if (!o->font) return -1;
887 if (!o->items) return -1;
888 return _evas_object_text_last_up_to_pos(obj, o, x, y - o->max_ascent);
889}
890
891EAPI int
892evas_object_text_char_coords_get(const Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch)
893{
894 Evas_Object_Text *o;
895 int l = 0, r = 0, t = 0, b = 0;
896 int ret, rx = 0, ry = 0, rw = 0, rh = 0;
897
898 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
899 return -1;
900 MAGIC_CHECK_END();
901 o = (Evas_Object_Text *)(obj->object_data);
902 MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
903 return -1;
904 MAGIC_CHECK_END();
905 if (!o->font) return -1;
906 if (!o->items) return -1;
907 ret = _evas_object_text_char_at_coords(obj, o, x, y - o->max_ascent,
908 &rx, &ry, &rw, &rh);
909 evas_text_style_pad_get(o->cur.style, &l, &r, &t, &b);
910 ry += o->max_ascent - t;
911 rx -= l;
912 if (rx < 0)
913 {
914 rw += rx;
915 rx = 0;
916 }
917 if ((rx + rw) > obj->cur.geometry.w) rw = obj->cur.geometry.w - rx;
918 if (rw < 0) rw = 0;
919 if (ry < 0)
920 {
921 rh += ry;
922 ry = 0;
923 }
924 if ((ry + rh) > obj->cur.geometry.h) rh = obj->cur.geometry.h - ry;
925 if (rh < 0) rh = 0;
926 if (cx) *cx = rx;
927 if (cy) *cy = ry;
928 if (cw) *cw = rw + l + r;
929 if (ch) *ch = rh + t + b;
930 return ret;
931}
932
933EAPI void
934evas_object_text_style_set(Evas_Object *obj, Evas_Text_Style_Type style)
935{
936 Evas_Object_Text *o;
937 int pl = 0, pr = 0, pt = 0, pb = 0, l = 0, r = 0, t = 0, b = 0;
938
939 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
940 return;
941 MAGIC_CHECK_END();
942 o = (Evas_Object_Text *)(obj->object_data);
943 MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
944 return;
945 MAGIC_CHECK_END();
946 if (o->cur.style == style) return;
947 evas_text_style_pad_get(o->cur.style, &pl, &pr, &pt, &pb);
948 o->cur.style = style;
949 evas_text_style_pad_get(o->cur.style, &l, &r, &t, &b);
950 if (o->items)
951 obj->cur.geometry.w += (l - pl) + (r - pr);
952 else
953 obj->cur.geometry.w = 0;
954 obj->cur.geometry.h += (t - pt) + (b - pb);
955 evas_object_change(obj);
956 evas_object_clip_dirty(obj);
957}
958
959EAPI Evas_Text_Style_Type
960evas_object_text_style_get(const Evas_Object *obj)
961{
962 Evas_Object_Text *o;
963
964 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
965 return EVAS_TEXT_STYLE_PLAIN;
966 MAGIC_CHECK_END();
967 o = (Evas_Object_Text *)(obj->object_data);
968 MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
969 return EVAS_TEXT_STYLE_PLAIN;
970 MAGIC_CHECK_END();
971 return o->cur.style;
972}
973
974EAPI void
975evas_object_text_shadow_color_set(Evas_Object *obj, int r, int g, int b, int a)
976{
977 Evas_Object_Text *o;
978
979 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
980 return;
981 MAGIC_CHECK_END();
982 o = (Evas_Object_Text *)(obj->object_data);
983 MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
984 return;
985 MAGIC_CHECK_END();
986 if ((o->cur.shadow.r == r) && (o->cur.shadow.g == g) &&
987 (o->cur.shadow.b == b) && (o->cur.shadow.a == a))
988 return;
989 o->cur.shadow.r = r;
990 o->cur.shadow.g = g;
991 o->cur.shadow.b = b;
992 o->cur.shadow.a = a;
993 o->changed = 1;
994 evas_object_change(obj);
995}
996
997EAPI void
998evas_object_text_shadow_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a)
999{
1000 Evas_Object_Text *o;
1001
1002 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1003 if (r) *r = 0;
1004 if (g) *g = 0;
1005 if (b) *b = 0;
1006 if (a) *a = 0;
1007 return;
1008 MAGIC_CHECK_END();
1009 o = (Evas_Object_Text *)(obj->object_data);
1010 MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
1011 if (r) *r = 0;
1012 if (g) *g = 0;
1013 if (b) *b = 0;
1014 if (a) *a = 0;
1015 return;
1016 MAGIC_CHECK_END();
1017 if (r) *r = o->cur.shadow.r;
1018 if (g) *g = o->cur.shadow.g;
1019 if (b) *b = o->cur.shadow.b;
1020 if (a) *a = o->cur.shadow.a;
1021}
1022
1023EAPI void
1024evas_object_text_glow_color_set(Evas_Object *obj, int r, int g, int b, int a)
1025{
1026 Evas_Object_Text *o;
1027
1028 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1029 return;
1030 MAGIC_CHECK_END();
1031 o = (Evas_Object_Text *)(obj->object_data);
1032 MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
1033 return;
1034 MAGIC_CHECK_END();
1035 if ((o->cur.glow.r == r) && (o->cur.glow.g == g) &&
1036 (o->cur.glow.b == b) && (o->cur.glow.a == a))
1037 return;
1038 o->cur.glow.r = r;
1039 o->cur.glow.g = g;
1040 o->cur.glow.b = b;
1041 o->cur.glow.a = a;
1042 o->changed = 1;
1043 evas_object_change(obj);
1044}
1045
1046EAPI void
1047evas_object_text_glow_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a)
1048{
1049 Evas_Object_Text *o;
1050
1051 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1052 if (r) *r = 0;
1053 if (g) *g = 0;
1054 if (b) *b = 0;
1055 if (a) *a = 0;
1056 return;
1057 MAGIC_CHECK_END();
1058 o = (Evas_Object_Text *)(obj->object_data);
1059 MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
1060 if (r) *r = 0;
1061 if (g) *g = 0;
1062 if (b) *b = 0;
1063 if (a) *a = 0;
1064 return;
1065 MAGIC_CHECK_END();
1066 if (r) *r = o->cur.glow.r;
1067 if (g) *g = o->cur.glow.g;
1068 if (b) *b = o->cur.glow.b;
1069 if (a) *a = o->cur.glow.a;
1070}
1071
1072EAPI void
1073evas_object_text_glow2_color_set(Evas_Object *obj, int r, int g, int b, int a)
1074{
1075 Evas_Object_Text *o;
1076
1077 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1078 return;
1079 MAGIC_CHECK_END();
1080 o = (Evas_Object_Text *)(obj->object_data);
1081 MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
1082 return;
1083 MAGIC_CHECK_END();
1084 if ((o->cur.glow2.r == r) && (o->cur.glow2.g == g) &&
1085 (o->cur.glow2.b == b) && (o->cur.glow2.a == a))
1086 return;
1087 o->cur.glow2.r = r;
1088 o->cur.glow2.g = g;
1089 o->cur.glow2.b = b;
1090 o->cur.glow2.a = a;
1091 o->changed = 1;
1092 evas_object_change(obj);
1093}
1094
1095EAPI void
1096evas_object_text_glow2_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a)
1097{
1098 Evas_Object_Text *o;
1099
1100 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1101 if (r) *r = 0;
1102 if (g) *g = 0;
1103 if (b) *b = 0;
1104 if (a) *a = 0;
1105 return;
1106 MAGIC_CHECK_END();
1107 o = (Evas_Object_Text *)(obj->object_data);
1108 MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
1109 if (r) *r = 0;
1110 if (g) *g = 0;
1111 if (b) *b = 0;
1112 if (a) *a = 0;
1113 return;
1114 MAGIC_CHECK_END();
1115 if (r) *r = o->cur.glow2.r;
1116 if (g) *g = o->cur.glow2.g;
1117 if (b) *b = o->cur.glow2.b;
1118 if (a) *a = o->cur.glow2.a;
1119}
1120
1121EAPI void
1122evas_object_text_outline_color_set(Evas_Object *obj, int r, int g, int b, int a)
1123{
1124 Evas_Object_Text *o;
1125
1126 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1127 return;
1128 MAGIC_CHECK_END();
1129 o = (Evas_Object_Text *)(obj->object_data);
1130 MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
1131 return;
1132 MAGIC_CHECK_END();
1133 if ((o->cur.outline.r == r) && (o->cur.outline.g == g) &&
1134 (o->cur.outline.b == b) && (o->cur.outline.a == a))
1135 return;
1136 o->cur.outline.r = r;
1137 o->cur.outline.g = g;
1138 o->cur.outline.b = b;
1139 o->cur.outline.a = a;
1140 o->changed = 1;
1141 evas_object_change(obj);
1142}
1143
1144EAPI void
1145evas_object_text_outline_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a)
1146{
1147 Evas_Object_Text *o;
1148
1149 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1150 if (r) *r = 0;
1151 if (g) *g = 0;
1152 if (b) *b = 0;
1153 if (a) *a = 0;
1154 return;
1155 MAGIC_CHECK_END();
1156 o = (Evas_Object_Text *)(obj->object_data);
1157 MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
1158 if (r) *r = 0;
1159 if (g) *g = 0;
1160 if (b) *b = 0;
1161 if (a) *a = 0;
1162 return;
1163 MAGIC_CHECK_END();
1164 if (r) *r = o->cur.outline.r;
1165 if (g) *g = o->cur.outline.g;
1166 if (b) *b = o->cur.outline.b;
1167 if (a) *a = o->cur.outline.a;
1168}
1169
1170EAPI void
1171evas_object_text_style_pad_get(const Evas_Object *obj, int *l, int *r, int *t, int *b)
1172{
1173 int sl = 0, sr = 0, st = 0, sb = 0;
1174 Evas_Object_Text *o;
1175
1176 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1177 if (l) *l = 0;
1178 if (r) *r = 0;
1179 if (t) *t = 0;
1180 if (b) *b = 0;
1181 return;
1182 MAGIC_CHECK_END();
1183 o = (Evas_Object_Text *)(obj->object_data);
1184 MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
1185 if (l) *l = 0;
1186 if (r) *r = 0;
1187 if (t) *t = 0;
1188 if (b) *b = 0;
1189 return;
1190 MAGIC_CHECK_END();
1191 /* use temps to be certain we have initialized values */
1192 evas_text_style_pad_get(o->cur.style, &sl, &sr, &st, &sb);
1193 if (l) *l = sl;
1194 if (r) *r = sr;
1195 if (t) *t = st;
1196 if (b) *b = sb;
1197}
1198
1199
1200
1201
1202EAPI int
1203evas_string_char_next_get(const char *str, int pos, int *decoded)
1204{
1205 int p, d;
1206
1207 if (decoded) *decoded = 0;
1208 if ((!str) || (pos < 0)) return 0;
1209 p = pos;
1210 d = eina_unicode_utf8_get_next(str, &p);
1211 if (decoded) *decoded = d;
1212 return p;
1213}
1214
1215EAPI int
1216evas_string_char_prev_get(const char *str, int pos, int *decoded)
1217{
1218 int p, d;
1219
1220 if (decoded) *decoded = 0;
1221 if ((!str) || (pos < 1)) return 0;
1222 p = pos;
1223 d = eina_unicode_utf8_get_prev(str, &p);
1224 if (decoded) *decoded = d;
1225 return p;
1226}
1227
1228EAPI int
1229evas_string_char_len_get(const char *str)
1230{
1231 if (!str) return 0;
1232 return eina_unicode_utf8_get_len(str);
1233}
1234
1235void
1236evas_text_style_pad_get(Evas_Text_Style_Type style, int *l, int *r, int *t, int *b)
1237{
1238 int sl = 0, sr = 0, st = 0, sb = 0;
1239
1240 /* Don't calc anything if there's no style. */
1241 if (style != EVAS_TEXT_STYLE_PLAIN)
1242 {
1243 int shad_sz = 0, shad_dst = 0, out_sz = 0;
1244 int dx = 0, minx = 0, maxx = 0;
1245 int dy = 0, miny = 0, maxy = 0;
1246 Eina_Bool have_shadow = EINA_FALSE;
1247
1248 switch (style & EVAS_TEXT_STYLE_MASK_BASIC)
1249 {
1250 case EVAS_TEXT_STYLE_SHADOW:
1251 shad_dst = 1;
1252 have_shadow = EINA_TRUE;
1253 break;
1254 case EVAS_TEXT_STYLE_OUTLINE_SHADOW:
1255 case EVAS_TEXT_STYLE_FAR_SHADOW:
1256 shad_dst = 2;
1257 out_sz = 1;
1258 have_shadow = EINA_TRUE;
1259 break;
1260 case EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW:
1261 shad_dst = 1;
1262 shad_sz = 2;
1263 out_sz = 1;
1264 have_shadow = EINA_TRUE;
1265 break;
1266 case EVAS_TEXT_STYLE_FAR_SOFT_SHADOW:
1267 shad_dst = 2;
1268 shad_sz = 2;
1269 have_shadow = EINA_TRUE;
1270 break;
1271 case EVAS_TEXT_STYLE_SOFT_SHADOW:
1272 shad_dst = 1;
1273 shad_sz = 2;
1274 have_shadow = EINA_TRUE;
1275 break;
1276 case EVAS_TEXT_STYLE_GLOW:
1277 case EVAS_TEXT_STYLE_SOFT_OUTLINE:
1278 out_sz = 2;
1279 break;
1280 case EVAS_TEXT_STYLE_OUTLINE:
1281 out_sz = 1;
1282 break;
1283 default:
1284 break;
1285 }
1286
1287 minx = -out_sz;
1288 maxx = out_sz;
1289 miny = -out_sz;
1290 maxy = out_sz;
1291 if (have_shadow)
1292 {
1293 int shx1, shx2, shy1, shy2;
1294 switch (style & EVAS_TEXT_STYLE_MASK_SHADOW_DIRECTION)
1295 {
1296 case EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_RIGHT:
1297 dx = 1;
1298 dy = 1;
1299 break;
1300 case EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM:
1301 dx = 0;
1302 dy = 1;
1303 break;
1304 case EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_LEFT:
1305 dx = -1;
1306 dy = 1;
1307 break;
1308 case EVAS_TEXT_STYLE_SHADOW_DIRECTION_LEFT:
1309 dx = -1;
1310 dy = 0;
1311 break;
1312 case EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP_LEFT:
1313 dx = -1;
1314 dy = -1;
1315 break;
1316 case EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP:
1317 dx = 0;
1318 dy = -1;
1319 break;
1320 case EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP_RIGHT:
1321 dx = 1;
1322 dy = -1;
1323 break;
1324 case EVAS_TEXT_STYLE_SHADOW_DIRECTION_RIGHT:
1325 dx = 1;
1326 dy = 0;
1327 default:
1328 break;
1329 }
1330 shx1 = dx * shad_dst;
1331 shx1 -= shad_sz;
1332 shx2 = dx * shad_dst;
1333 shx2 += shad_sz;
1334 if (shx1 < minx) minx = shx1;
1335 if (shx2 > maxx) maxx = shx2;
1336
1337 shy1 = dy * shad_dst;
1338 shy1 -= shad_sz;
1339 shy2 = dy * shad_dst;
1340 shy2 += shad_sz;
1341 if (shy1 < miny) miny = shy1;
1342 if (shy2 > maxy) maxy = shy2;
1343 }
1344
1345 if (l) sl = *l;
1346 if (r) sr = *r;
1347 if (t) st = *t;
1348 if (b) sb = *b;
1349
1350 if (sr < maxx) sr = maxx;
1351 if (sl < -minx) sl = -minx;
1352 if (sb < maxy) sb = maxy;
1353 if (st < -miny) st = -miny;
1354 }
1355
1356 if (l) *l = sl;
1357 if (r) *r = sr;
1358 if (t) *t = st;
1359 if (b) *b = sb;
1360}
1361
1362/* all nice and private */
1363static void
1364evas_object_text_init(Evas_Object *obj)
1365{
1366 /* alloc text ob, setup methods and default values */
1367 obj->object_data = evas_object_text_new();
1368 /* set up default settings for this kind of object */
1369 obj->cur.color.r = 255;
1370 obj->cur.color.g = 255;
1371 obj->cur.color.b = 255;
1372 obj->cur.color.a = 255;
1373 obj->cur.geometry.x = 0;
1374 obj->cur.geometry.y = 0;
1375 obj->cur.geometry.w = 0;
1376 obj->cur.geometry.h = 0;
1377 obj->cur.layer = 0;
1378 /* set up object-specific settings */
1379 obj->prev = obj->cur;
1380 /* set up methods (compulsory) */
1381 obj->func = &object_func;
1382 obj->type = o_type;
1383}
1384
1385static void *
1386evas_object_text_new(void)
1387{
1388 Evas_Object_Text *o;
1389
1390 /* alloc obj private data */
1391 EVAS_MEMPOOL_INIT(_mp_obj, "evas_object_text", Evas_Object_Text, 128, NULL);
1392 o = EVAS_MEMPOOL_ALLOC(_mp_obj, Evas_Object_Text);
1393 if (!o) return NULL;
1394 EVAS_MEMPOOL_PREP(_mp_obj, o, Evas_Object_Text);
1395 o->magic = MAGIC_OBJ_TEXT;
1396 o->prev = o->cur;
1397#ifdef BIDI_SUPPORT
1398 o->bidi_par_props = evas_bidi_paragraph_props_new();
1399#endif
1400 return o;
1401}
1402
1403static void
1404evas_object_text_free(Evas_Object *obj)
1405{
1406 Evas_Object_Text *o;
1407
1408 /* frees private object data. very simple here */
1409 o = (Evas_Object_Text *)(obj->object_data);
1410 MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
1411 return;
1412 MAGIC_CHECK_END();
1413 /* free obj */
1414 if (o->items) _evas_object_text_items_clear(o);
1415 if (o->cur.utf8_text) eina_stringshare_del(o->cur.utf8_text);
1416 if (o->cur.font) eina_stringshare_del(o->cur.font);
1417 if (o->cur.fdesc) evas_font_desc_unref(o->cur.fdesc);
1418 if (o->cur.source) eina_stringshare_del(o->cur.source);
1419 if (o->font) evas_font_free(obj->layer->evas, o->font);
1420#ifdef BIDI_SUPPORT
1421 evas_bidi_paragraph_props_unref(o->bidi_par_props);
1422#endif
1423 o->magic = 0;
1424 EVAS_MEMPOOL_FREE(_mp_obj, o);
1425}
1426
1427static void
1428evas_object_text_render(Evas_Object *obj, void *output, void *context, void *surface, int x, int y)
1429{
1430 int i, j;
1431 Evas_Object_Text *o;
1432 Evas_Object_Text_Item *it;
1433 const char vals[5][5] =
1434 {
1435 {0, 1, 2, 1, 0},
1436 {1, 3, 4, 3, 1},
1437 {2, 4, 5, 4, 2},
1438 {1, 3, 4, 3, 1},
1439 {0, 1, 2, 1, 0}
1440 };
1441 int sl = 0, st = 0;
1442 int shad_dst, shad_sz, dx, dy, haveshad;
1443
1444 /* render object to surface with context, and offxet by x,y */
1445 o = (Evas_Object_Text *)(obj->object_data);
1446 evas_text_style_pad_get(o->cur.style, &sl, NULL, &st, NULL);
1447 ENFN->context_multiplier_unset(output, context);
1448 ENFN->context_render_op_set(output, context, obj->cur.render_op);
1449 /* FIXME: This clipping is just until we fix inset handling correctly. */
1450 ENFN->context_clip_clip(output, context,
1451 obj->cur.geometry.x + x,
1452 obj->cur.geometry.y + y,
1453 obj->cur.geometry.w,
1454 obj->cur.geometry.h);
1455/*
1456 ENFN->context_color_set(output,
1457 context,
1458 230, 160, 30, 100);
1459 ENFN->rectangle_draw(output,
1460 context,
1461 surface,
1462 obj->cur.geometry.x + x,
1463 obj->cur.geometry.y + y,
1464 obj->cur.geometry.w,
1465 obj->cur.geometry.h);
1466 */
1467#define COLOR_ONLY_SET(object, sub, col) \
1468 ENFN->context_color_set(output, context, \
1469 object->sub.col.r, \
1470 object->sub.col.g, \
1471 object->sub.col.b, \
1472 object->sub.col.a);
1473
1474#define COLOR_SET(object, sub, col) \
1475 if (obj->cur.clipper)\
1476 ENFN->context_color_set(output, context, \
1477 ((int)object->sub.col.r * ((int)obj->cur.clipper->cur.cache.clip.r + 1)) >> 8, \
1478 ((int)object->sub.col.g * ((int)obj->cur.clipper->cur.cache.clip.g + 1)) >> 8, \
1479 ((int)object->sub.col.b * ((int)obj->cur.clipper->cur.cache.clip.b + 1)) >> 8, \
1480 ((int)object->sub.col.a * ((int)obj->cur.clipper->cur.cache.clip.a + 1)) >> 8); \
1481 else\
1482 ENFN->context_color_set(output, context, \
1483 object->sub.col.r, \
1484 object->sub.col.g, \
1485 object->sub.col.b, \
1486 object->sub.col.a);
1487
1488#define COLOR_SET_AMUL(object, sub, col, amul) \
1489 if (obj->cur.clipper) \
1490 ENFN->context_color_set(output, context, \
1491 (((int)object->sub.col.r) * ((int)obj->cur.clipper->cur.cache.clip.r) * (amul)) / 65025, \
1492 (((int)object->sub.col.g) * ((int)obj->cur.clipper->cur.cache.clip.g) * (amul)) / 65025, \
1493 (((int)object->sub.col.b) * ((int)obj->cur.clipper->cur.cache.clip.b) * (amul)) / 65025, \
1494 (((int)object->sub.col.a) * ((int)obj->cur.clipper->cur.cache.clip.a) * (amul)) / 65025); \
1495 else \
1496 ENFN->context_color_set(output, context, \
1497 (((int)object->sub.col.r) * (amul)) / 255, \
1498 (((int)object->sub.col.g) * (amul)) / 255, \
1499 (((int)object->sub.col.b) * (amul)) / 255, \
1500 (((int)object->sub.col.a) * (amul)) / 255);
1501
1502#define DRAW_TEXT(ox, oy) \
1503 if ((o->font) && (it->text_props.len > 0)) \
1504 ENFN->font_draw(output, \
1505 context, \
1506 surface, \
1507 o->font, \
1508 obj->cur.geometry.x + x + sl + ox + it->x, \
1509 obj->cur.geometry.y + y + st + oy + \
1510 (int) \
1511 (((o->max_ascent * obj->cur.geometry.h) / obj->cur.geometry.h) - 0.5), \
1512 obj->cur.geometry.w, \
1513 obj->cur.geometry.h, \
1514 obj->cur.geometry.w, \
1515 obj->cur.geometry.h, \
1516 &it->text_props);
1517
1518 /* shadows */
1519 shad_dst = shad_sz = dx = dy = haveshad = 0;
1520 switch (o->cur.style & EVAS_TEXT_STYLE_MASK_BASIC)
1521 {
1522 case EVAS_TEXT_STYLE_SHADOW:
1523 case EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW:
1524 shad_dst = 1;
1525 haveshad = 1;
1526 break;
1527 case EVAS_TEXT_STYLE_OUTLINE_SHADOW:
1528 case EVAS_TEXT_STYLE_FAR_SHADOW:
1529 shad_dst = 2;
1530 haveshad = 1;
1531 break;
1532 case EVAS_TEXT_STYLE_FAR_SOFT_SHADOW:
1533 shad_dst = 2;
1534 shad_sz = 2;
1535 haveshad = 1;
1536 break;
1537 case EVAS_TEXT_STYLE_SOFT_SHADOW:
1538 shad_dst = 1;
1539 shad_sz = 2;
1540 haveshad = 1;
1541 break;
1542 default:
1543 break;
1544 }
1545 if (haveshad)
1546 {
1547 if (shad_dst > 0)
1548 {
1549 switch (o->cur.style & EVAS_TEXT_STYLE_MASK_SHADOW_DIRECTION)
1550 {
1551 case EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_RIGHT:
1552 dx = 1;
1553 dy = 1;
1554 break;
1555 case EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM:
1556 dx = 0;
1557 dy = 1;
1558 break;
1559 case EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_LEFT:
1560 dx = -1;
1561 dy = 1;
1562 break;
1563 case EVAS_TEXT_STYLE_SHADOW_DIRECTION_LEFT:
1564 dx = -1;
1565 dy = 0;
1566 break;
1567 case EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP_LEFT:
1568 dx = -1;
1569 dy = -1;
1570 break;
1571 case EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP:
1572 dx = 0;
1573 dy = -1;
1574 break;
1575 case EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP_RIGHT:
1576 dx = 1;
1577 dy = -1;
1578 break;
1579 case EVAS_TEXT_STYLE_SHADOW_DIRECTION_RIGHT:
1580 dx = 1;
1581 dy = 0;
1582 default:
1583 break;
1584 }
1585 dx *= shad_dst;
1586 dy *= shad_dst;
1587 }
1588 }
1589 EINA_INLIST_FOREACH(EINA_INLIST_GET(o->items), it)
1590 {
1591 /* Shadows */
1592 if (haveshad)
1593 {
1594 switch (shad_sz)
1595 {
1596 case 0:
1597 COLOR_SET(o, cur, shadow);
1598 DRAW_TEXT(dx, dy);
1599 break;
1600 case 2:
1601 for (j = 0; j < 5; j++)
1602 {
1603 for (i = 0; i < 5; i++)
1604 {
1605 if (vals[i][j] != 0)
1606 {
1607 COLOR_SET_AMUL(o, cur, shadow, vals[i][j] * 50);
1608 DRAW_TEXT(i - 2 + dx, j - 2 + dy);
1609 }
1610 }
1611 }
1612 break;
1613 default:
1614 break;
1615 }
1616 }
1617
1618 /* glows */
1619 if (o->cur.style == EVAS_TEXT_STYLE_GLOW)
1620 {
1621 for (j = 0; j < 5; j++)
1622 {
1623 for (i = 0; i < 5; i++)
1624 {
1625 if (vals[i][j] != 0)
1626 {
1627 COLOR_SET_AMUL(o, cur, glow, vals[i][j] * 50);
1628 DRAW_TEXT(i - 2, j - 2);
1629 }
1630 }
1631 }
1632 COLOR_SET(o, cur, glow2);
1633 DRAW_TEXT(-1, 0);
1634 DRAW_TEXT(1, 0);
1635 DRAW_TEXT(0, -1);
1636 DRAW_TEXT(0, 1);
1637 }
1638
1639 /* outlines */
1640 if ((o->cur.style == EVAS_TEXT_STYLE_OUTLINE) ||
1641 (o->cur.style == EVAS_TEXT_STYLE_OUTLINE_SHADOW) ||
1642 (o->cur.style == EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW))
1643 {
1644 COLOR_SET(o, cur, outline);
1645 DRAW_TEXT(-1, 0);
1646 DRAW_TEXT(1, 0);
1647 DRAW_TEXT(0, -1);
1648 DRAW_TEXT(0, 1);
1649 }
1650 else if (o->cur.style == EVAS_TEXT_STYLE_SOFT_OUTLINE)
1651 {
1652 for (j = 0; j < 5; j++)
1653 {
1654 for (i = 0; i < 5; i++)
1655 {
1656 if (((i != 2) || (j != 2)) && (vals[i][j] != 0))
1657 {
1658 COLOR_SET_AMUL(o, cur, outline, vals[i][j] * 50);
1659 DRAW_TEXT(i - 2, j - 2);
1660 }
1661 }
1662 }
1663 }
1664
1665 /* normal text */
1666 COLOR_ONLY_SET(obj, cur.cache, clip);
1667 DRAW_TEXT(0, 0);
1668 }
1669}
1670
1671static void
1672evas_object_text_render_pre(Evas_Object *obj)
1673{
1674 Evas_Object_Text *o;
1675 int is_v, was_v;
1676
1677 /* dont pre-render the obj twice! */
1678 if (obj->pre_render_done) return;
1679 obj->pre_render_done = 1;
1680 /* pre-render phase. this does anything an object needs to do just before
1681 rendering. This could mean loading the image data, retrieving it from
1682 elsewhere, decoding video etc.
1683 Then when this is done the object needs to figure if it changed and
1684 if so what and where and add the appropriate redraw rectangles */
1685 o = (Evas_Object_Text *)(obj->object_data);
1686 /* if someone is clipping this obj - go calculate the clipper */
1687 if (obj->cur.clipper)
1688 {
1689 if (obj->cur.cache.clip.dirty)
1690 evas_object_clip_recalc(obj->cur.clipper);
1691 obj->cur.clipper->func->render_pre(obj->cur.clipper);
1692 }
1693 /* now figure what changed and add draw rects
1694 if it just became visible or invisible */
1695 is_v = evas_object_is_visible(obj);
1696 was_v = evas_object_was_visible(obj);
1697 if (is_v != was_v)
1698 {
1699 evas_object_render_pre_visible_change(&obj->layer->evas->clip_changes,
1700 obj, is_v, was_v);
1701 goto done;
1702 }
1703 if ((obj->cur.map != obj->prev.map) ||
1704 (obj->cur.usemap != obj->prev.usemap))
1705 {
1706 evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes,
1707 obj);
1708 goto done;
1709 }
1710 /* its not visible - we accounted for it appearing or not so just abort */
1711 if (!is_v) goto done;
1712 /* clipper changed this is in addition to anything else for obj */
1713 evas_object_render_pre_clipper_change(&obj->layer->evas->clip_changes, obj);
1714 /* if we restacked (layer or just within a layer) and dont clip anyone */
1715 if (obj->restack)
1716 {
1717 evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes,
1718 obj);
1719 goto done;
1720 }
1721 /* if it changed color */
1722 if ((obj->cur.color.r != obj->prev.color.r) ||
1723 (obj->cur.color.g != obj->prev.color.g) ||
1724 (obj->cur.color.b != obj->prev.color.b) ||
1725 (obj->cur.color.a != obj->prev.color.a))
1726 {
1727 evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes,
1728 obj);
1729 goto done;
1730 }
1731 /* if it changed geometry - and obviously not visibility or color
1732 calculate differences since we have a constant color fill
1733 we really only need to update the differences */
1734 if ((obj->cur.geometry.x != obj->prev.geometry.x) ||
1735 (obj->cur.geometry.y != obj->prev.geometry.y) ||
1736 (obj->cur.geometry.w != obj->prev.geometry.w) ||
1737 (obj->cur.geometry.h != obj->prev.geometry.h))
1738 {
1739 evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes,
1740 obj);
1741 goto done;
1742 }
1743 if (obj->cur.render_op != obj->prev.render_op)
1744 {
1745 evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes,
1746 obj);
1747 goto done;
1748 }
1749 if (obj->cur.scale != obj->prev.scale)
1750 {
1751 evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes,
1752 obj);
1753 goto done;
1754 }
1755 if (o->changed)
1756 {
1757 if ((o->cur.size != o->prev.size) ||
1758 ((o->cur.font != o->prev.font)) ||
1759 ((o->cur.utf8_text != o->prev.utf8_text)) ||
1760 ((o->cur.style != o->prev.style)) ||
1761 ((o->cur.shadow.r != o->prev.shadow.r)) ||
1762 ((o->cur.shadow.g != o->prev.shadow.g)) ||
1763 ((o->cur.shadow.b != o->prev.shadow.b)) ||
1764 ((o->cur.shadow.a != o->prev.shadow.a)) ||
1765 ((o->cur.outline.r != o->prev.outline.r)) ||
1766 ((o->cur.outline.g != o->prev.outline.g)) ||
1767 ((o->cur.outline.b != o->prev.outline.b)) ||
1768 ((o->cur.outline.a != o->prev.outline.a)) ||
1769 ((o->cur.glow.r != o->prev.glow.r)) ||
1770 ((o->cur.glow.g != o->prev.glow.g)) ||
1771 ((o->cur.glow.b != o->prev.glow.b)) ||
1772 ((o->cur.glow.a != o->prev.glow.a)) ||
1773 ((o->cur.glow2.r != o->prev.glow2.r)) ||
1774 ((o->cur.glow2.g != o->prev.glow2.g)) ||
1775 ((o->cur.glow2.b != o->prev.glow2.b)) ||
1776 ((o->cur.glow2.a != o->prev.glow2.a)))
1777 {
1778 evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes,
1779 obj);
1780 goto done;
1781 }
1782 }
1783 done:
1784 evas_object_render_pre_effect_updates(&obj->layer->evas->clip_changes,
1785 obj, is_v, was_v);
1786}
1787
1788static void
1789evas_object_text_render_post(Evas_Object *obj)
1790{
1791 Evas_Object_Text *o;
1792
1793 /* this moves the current data to the previous state parts of the object
1794 in whatever way is safest for the object. also if we don't need object
1795 data anymore we can free it if the object deems this is a good idea */
1796 o = (Evas_Object_Text *)(obj->object_data);
1797 /* remove those pesky changes */
1798 evas_object_clip_changes_clean(obj);
1799 /* move cur to prev safely for object data */
1800 obj->prev = obj->cur;
1801 o->prev = o->cur;
1802 o->changed = 0;
1803}
1804
1805static unsigned int
1806evas_object_text_id_get(Evas_Object *obj)
1807{
1808 Evas_Object_Text *o;
1809
1810 o = (Evas_Object_Text *)(obj->object_data);
1811 if (!o) return 0;
1812 return MAGIC_OBJ_TEXT;
1813}
1814
1815static unsigned int
1816evas_object_text_visual_id_get(Evas_Object *obj)
1817{
1818 Evas_Object_Text *o;
1819
1820 o = (Evas_Object_Text *)(obj->object_data);
1821 if (!o) return 0;
1822 return MAGIC_OBJ_SHAPE;
1823}
1824
1825static void *
1826evas_object_text_engine_data_get(Evas_Object *obj)
1827{
1828 Evas_Object_Text *o;
1829
1830 o = (Evas_Object_Text *)(obj->object_data);
1831 if (!o) return NULL;
1832 return o->font;
1833}
1834
1835static int
1836evas_object_text_is_opaque(Evas_Object *obj __UNUSED__)
1837{
1838 /* this returns 1 if the internal object data implies that the object is
1839 currently fully opaque over the entire gradient it occupies */
1840 return 0;
1841}
1842
1843static int
1844evas_object_text_was_opaque(Evas_Object *obj __UNUSED__)
1845{
1846 /* this returns 1 if the internal object data implies that the object was
1847 currently fully opaque over the entire gradient it occupies */
1848 return 0;
1849}
1850
1851static void
1852evas_object_text_scale_update(Evas_Object *obj)
1853{
1854 Evas_Object_Text *o;
1855 int size;
1856 const char *font;
1857
1858 o = (Evas_Object_Text *)(obj->object_data);
1859 font = eina_stringshare_add(o->cur.font);
1860 size = o->cur.size;
1861 if (o->cur.font) eina_stringshare_del(o->cur.font);
1862 o->cur.font = NULL;
1863 o->prev.font = NULL;
1864 o->cur.size = 0;
1865 o->prev.size = 0;
1866 evas_object_text_font_set(obj, font, size);
1867}
1868
1869void
1870_evas_object_text_rehint(Evas_Object *obj)
1871{
1872 Evas_Object_Text *o;
1873 int is, was;
1874
1875 o = (Evas_Object_Text *)(obj->object_data);
1876 if (!o->font) return;
1877#ifdef EVAS_FRAME_QUEUING
1878 evas_common_pipe_op_text_flush((RGBA_Font *) o->font);
1879#endif
1880 evas_font_load_hinting_set(obj->layer->evas, o->font,
1881 obj->layer->evas->hinting);
1882 was = evas_object_is_in_output_rect(obj,
1883 obj->layer->evas->pointer.x,
1884 obj->layer->evas->pointer.y, 1, 1);
1885 /* DO II */
1886 _evas_object_text_recalc(obj);
1887 o->changed = 1;
1888 evas_object_change(obj);
1889 evas_object_clip_dirty(obj);
1890 evas_object_coords_recalc(obj);
1891 is = evas_object_is_in_output_rect(obj,
1892 obj->layer->evas->pointer.x,
1893 obj->layer->evas->pointer.y, 1, 1);
1894 if ((is || was) && obj->cur.visible)
1895 evas_event_feed_mouse_move(obj->layer->evas,
1896 obj->layer->evas->pointer.x,
1897 obj->layer->evas->pointer.y,
1898 obj->layer->evas->last_timestamp,
1899 NULL);
1900 evas_object_inform_call_resize(obj);
1901}
1902
1903static void
1904_evas_object_text_recalc(Evas_Object *obj)
1905{
1906 Evas_Object_Text *o;
1907 Eina_Unicode *text = NULL;
1908 o = (Evas_Object_Text *)(obj->object_data);
1909
1910 if (o->items) _evas_object_text_items_clear(o);
1911 if (o->cur.utf8_text)
1912 text = eina_unicode_utf8_to_unicode(o->cur.utf8_text,
1913 NULL);
1914
1915 if (!text) text = eina_unicode_strdup(EINA_UNICODE_EMPTY_STRING);
1916
1917 _evas_object_text_layout(obj, o, text);
1918
1919 if (text) free(text);
1920
1921 if ((o->font) && (o->items))
1922 {
1923 int w, h;
1924 int l = 0, r = 0, t = 0, b = 0;
1925
1926 w = _evas_object_text_horiz_advance_get(obj, o);
1927 h = _evas_object_text_vert_advance_get(obj, o);
1928 evas_text_style_pad_get(o->cur.style, &l, &r, &t, &b);
1929 obj->cur.geometry.w = w + l + r;
1930 obj->cur.geometry.h = h + t + b;
1931//// obj->cur.cache.geometry.validity = 0;
1932 }
1933 else
1934 {
1935 int t = 0, b = 0;
1936
1937 evas_text_style_pad_get(o->cur.style, NULL, NULL, &t, &b);
1938 obj->cur.geometry.w = 0;
1939 obj->cur.geometry.h = o->max_ascent + o->max_descent + t + b;
1940//// obj->cur.cache.geometry.validity = 0;
1941 }
1942}
1943
diff --git a/libraries/evas/src/lib/canvas/evas_object_textblock.c b/libraries/evas/src/lib/canvas/evas_object_textblock.c
new file mode 100644
index 0000000..7941a45
--- /dev/null
+++ b/libraries/evas/src/lib/canvas/evas_object_textblock.c
@@ -0,0 +1,9569 @@
1/**
2 * @internal
3 * @section Evas_Object_Textblock_Internal Internal Textblock Object Tutorial
4 *
5 * This explains the internal design of the Evas Textblock Object, it's assumed
6 * that the reader of this section has already read @ref Evas_Object_Textblock_Tutorial "Textblock's usage docs.".
7 *
8 * @subsection textblock_internal_intro Introduction
9 * There are two main parts to the textblock object, the first being the node
10 * system, and the second being the layout system. The former is just an
11 * internal representation of the markup text, while the latter is the internal
12 * visual representation of the text (i.e positioning, sizing, fonts and etc).
13 *
14 * @subsection textblock_nodes The Nodes system
15 * The nodes mechanism consists of two main data types:
16 * ::Evas_Object_Textblock_Node_Text and ::Evas_Object_Textblock_Node_Format
17 * the former is for Text nodes and the latter is for format nodes.
18 * There's always at least one text node, even if there are only formats.
19 *
20 * @subsection textblock_nodes_text Text nodes
21 * Each text node is essentially a paragraph, it includes an @ref Eina_UStrbuf
22 * that stores the actual paragraph text, a utf8 string to store the paragraph
23 * text in utf8 (which is not used internally at all), A pointer to it's
24 * main @ref textblock_nodes_format_internal "Format Node" and the paragraph's
25 * @ref evas_bidi_props "BiDi properties". The pointer to the format node may be
26 * NULL if there's no format node anywhere before the end of the text node,
27 * not even in previous text nodes. If not NULL, it points to the first format
28 * node pointing to text inside of the text node, or if there is none, it points
29 * to the previous's text nodes format node. Each paragraph has a format node
30 * representing a paragraph separator pointing to it's last position except
31 * for the last paragraph, which has no such constraint. This constraint
32 * happens because text nodes are paragraphs and paragraphs are delimited by
33 * paragraph separators.
34 *
35 * @subsection textblock_nodes_format_internal Format Nodes - Internal
36 * Each format node stores a group of format information, for example the
37 * markup: \<font=Vera,Kochi font_size=10 align=left\> will all be inserted
38 * inside the same format node, altohugh it consists of different formatting
39 * commands.
40 * Each node has a pointer to it's text node, this pointer is NEVER NULL, even
41 * if there's only one format, and no text, a text node is created. Each format
42 * node includes an offset from the last format node of the same text node. For
43 * example, the markup "0<b>12</b>" will create two format nodes, the first
44 * having an offset of 1 and the second an offset of 2. Each format node also
45 * includes a @ref Eina_Strbuf that includes the textual representation of the
46 * format, and a boolean stating if the format is a visible format or not, see
47 * @ref textblock_nodes_format_visible
48 *
49 * @subsection textblock_nodes_format_visible Visible Format Nodes
50 * There are two types of format nodes, visible and invisible. They are the same
51 * in every way, except for the representation in the text node. While invisible
52 * format nodes have no representation in the text node, the visible ones do.
53 * The Uniceode object replacement character (0xFFFC) is inserted to every place
54 * a visible format node points to. This makes it very easy to treat visible
55 * formats as items in the text, both for BiDi purposes and cursor handling
56 * purposes.
57 * Here are a few example visible an invisible formats:
58 * Visible: newline char, tab, paragraph separator and an embedded item.
59 * Invisible: setting the color, font or alignment of the text.
60 *
61 * @subsection textblock_layout The layout system
62 * @todo write @ref textblock_layout
63 */
64#include <stdlib.h>
65
66#include "evas_common.h"
67#include "evas_private.h"
68
69#ifdef HAVE_LINEBREAK
70#include "linebreak.h"
71#endif
72
73/* save typing */
74#define ENFN obj->layer->evas->engine.func
75#define ENDT obj->layer->evas->engine.data.output
76
77/* private magic number for textblock objects */
78static const char o_type[] = "textblock";
79
80/* The char to be inserted instead of visible formats */
81#define EVAS_TEXTBLOCK_REPLACEMENT_CHAR 0xFFFC
82#define _PARAGRAPH_SEPARATOR 0x2029
83#define EVAS_TEXTBLOCK_IS_VISIBLE_FORMAT_CHAR(ch) \
84 (((ch) == EVAS_TEXTBLOCK_REPLACEMENT_CHAR) || \
85 ((ch) == '\n') || \
86 ((ch) == '\t') || \
87 ((ch) == _PARAGRAPH_SEPARATOR))
88
89/* private struct for textblock object internal data */
90/**
91 * @internal
92 * @typedef Evas_Object_Textblock
93 * The actual textblock object.
94 */
95typedef struct _Evas_Object_Textblock Evas_Object_Textblock;
96/**
97 * @internal
98 * @typedef Evas_Object_Style_Tag
99 * The structure used for finding style tags.
100 */
101typedef struct _Evas_Object_Style_Tag Evas_Object_Style_Tag;
102/**
103 * @internal
104 * @typedef Evas_Object_Textblock_Node_Text
105 * A text node.
106 */
107typedef struct _Evas_Object_Textblock_Node_Text Evas_Object_Textblock_Node_Text;
108/*
109 * Defined in Evas.h
110typedef struct _Evas_Object_Textblock_Node_Format Evas_Object_Textblock_Node_Format;
111*/
112
113/**
114 * @internal
115 * @typedef Evas_Object_Textblock_Paragraph
116 * A layouting paragraph.
117 */
118typedef struct _Evas_Object_Textblock_Paragraph Evas_Object_Textblock_Paragraph;
119/**
120 * @internal
121 * @typedef Evas_Object_Textblock_Line
122 * A layouting line.
123 */
124typedef struct _Evas_Object_Textblock_Line Evas_Object_Textblock_Line;
125/**
126 * @internal
127 * @typedef Evas_Object_Textblock_Item
128 * A layouting item.
129 */
130typedef struct _Evas_Object_Textblock_Item Evas_Object_Textblock_Item;
131/**
132 * @internal
133 * @typedef Evas_Object_Textblock_Item
134 * A layouting text item.
135 */
136typedef struct _Evas_Object_Textblock_Text_Item Evas_Object_Textblock_Text_Item;
137/**
138 * @internal
139 * @typedef Evas_Object_Textblock_Format_Item
140 * A layouting format item.
141 */
142typedef struct _Evas_Object_Textblock_Format_Item Evas_Object_Textblock_Format_Item;
143/**
144 * @internal
145 * @typedef Evas_Object_Textblock_Format
146 * A textblock format.
147 */
148typedef struct _Evas_Object_Textblock_Format Evas_Object_Textblock_Format;
149
150/**
151 * @internal
152 * @def IS_AT_END(ti, ind)
153 * Return true if ind is at the end of the text item, false otherwise.
154 */
155#define IS_AT_END(ti, ind) (ind == ti->text_props.text_len)
156
157/**
158 * @internal
159 * @def MOVE_PREV_UNTIL(limit, ind)
160 * This decrements ind as long as ind > limit.
161 */
162#define MOVE_PREV_UNTIL(limit, ind) \
163 do \
164 { \
165 if ((limit) < (ind)) \
166 (ind)--; \
167 } \
168 while (0)
169
170/**
171 * @internal
172 * @def MOVE_NEXT_UNTIL(limit, ind)
173 * This increments ind as long as ind < limit
174 */
175#define MOVE_NEXT_UNTIL(limit, ind) \
176 do \
177 { \
178 if ((ind) < (limit)) \
179 (ind)++; \
180 } \
181 while (0)
182
183/**
184 * @internal
185 * @def GET_ITEM_TEXT(ti)
186 * Returns a const reference to the text of the ti (not null terminated).
187 */
188#define GET_ITEM_TEXT(ti) \
189 (((ti)->parent.text_node) ? \
190 (eina_ustrbuf_string_get((ti)->parent.text_node->unicode) + \
191 (ti)->parent.text_pos) : EINA_UNICODE_EMPTY_STRING)
192/**
193 * @internal
194 * @def _FORMAT_IS_CLOSER_OF(base, closer, closer_len)
195 * Returns true if closer is the closer of base.
196 */
197#define _FORMAT_IS_CLOSER_OF(base, closer, closer_len) \
198 (!strncmp(base + 1, closer, closer_len) && \
199 (!base[closer_len + 1] || \
200 (base[closer_len + 1] == '=') || \
201 _is_white(base[closer_len + 1])))
202
203/*FIXME: document the structs and struct items. */
204struct _Evas_Object_Style_Tag
205{
206 EINA_INLIST;
207 char *tag;
208 char *replace;
209 size_t tag_len;
210 size_t replace_len;
211};
212
213struct _Evas_Object_Textblock_Node_Text
214{
215 EINA_INLIST;
216 Eina_UStrbuf *unicode;
217 char *utf8;
218 Evas_Object_Textblock_Node_Format *format_node;
219 Evas_Object_Textblock_Paragraph *par;
220 Eina_Bool dirty : 1;
221 Eina_Bool is_new : 1;
222};
223
224struct _Evas_Object_Textblock_Node_Format
225{
226 EINA_INLIST;
227 const char *format;
228 const char *orig_format;
229 Evas_Object_Textblock_Node_Text *text_node;
230 size_t offset;
231 unsigned char anchor : 2;
232 Eina_Bool visible : 1;
233 Eina_Bool format_change : 1;
234 Eina_Bool is_new : 1;
235};
236
237#define ANCHOR_NONE 0
238#define ANCHOR_A 1
239#define ANCHOR_ITEM 2
240
241/**
242 * @internal
243 * @def _NODE_TEXT(x)
244 * A convinience macro for casting to a text node.
245 */
246#define _NODE_TEXT(x) ((Evas_Object_Textblock_Node_Text *) (x))
247/**
248 * @internal
249 * @def _NODE_FORMAT(x)
250 * A convinience macro for casting to a format node.
251 */
252#define _NODE_FORMAT(x) ((Evas_Object_Textblock_Node_Format *) (x))
253/**
254 * @internal
255 * @def _ITEM(x)
256 * A convinience macro for casting to a generic item.
257 */
258#define _ITEM(x) ((Evas_Object_Textblock_Item *) (x))
259/**
260 * @internal
261 * @def _ITEM_TEXT(x)
262 * A convinience macro for casting to a text item.
263 */
264#define _ITEM_TEXT(x) ((Evas_Object_Textblock_Text_Item *) (x))
265/**
266 * @internal
267 * @def _ITEM_FORMAT(x)
268 * A convinience macro for casting to a format item.
269 */
270#define _ITEM_FORMAT(x) ((Evas_Object_Textblock_Format_Item *) (x))
271
272struct _Evas_Object_Textblock_Paragraph
273{
274 EINA_INLIST;
275 Evas_Object_Textblock_Line *lines;
276 Evas_Object_Textblock_Node_Text *text_node;
277 Eina_List *logical_items;
278 Evas_BiDi_Paragraph_Props *bidi_props; /* Only valid during layout */
279 Evas_BiDi_Direction direction;
280 Evas_Coord y, w, h;
281 int line_no;
282 Eina_Bool is_bidi : 1;
283 Eina_Bool visible : 1;
284 Eina_Bool rendered : 1;
285};
286
287struct _Evas_Object_Textblock_Line
288{
289 EINA_INLIST;
290 Evas_Object_Textblock_Item *items;
291 Evas_Object_Textblock_Paragraph *par;
292 Evas_Coord x, y, w, h;
293 int baseline;
294 int line_no;
295};
296
297typedef enum _Evas_Textblock_Item_Type
298{
299 EVAS_TEXTBLOCK_ITEM_TEXT,
300 EVAS_TEXTBLOCK_ITEM_FORMAT,
301} Evas_Textblock_Item_Type;
302
303struct _Evas_Object_Textblock_Item
304{
305 EINA_INLIST;
306 Evas_Textblock_Item_Type type;
307 Evas_Object_Textblock_Node_Text *text_node;
308 Evas_Object_Textblock_Format *format;
309 size_t text_pos;
310#ifdef BIDI_SUPPORT
311 size_t visual_pos;
312#endif
313 Evas_Coord adv, x, w, h;
314 Eina_Bool merge : 1; /* Indicates whether this
315 item should merge to the
316 previous item or not */
317 Eina_Bool visually_deleted : 1;
318 /* Indicates whether this
319 item is used in the visual
320 layout or not. */
321};
322
323struct _Evas_Object_Textblock_Text_Item
324{
325 Evas_Object_Textblock_Item parent;
326 Evas_Text_Props text_props;
327 Evas_Coord inset;
328 Evas_Coord x_adjustment; /* Used to indicate by how
329 much we adjusted sizes */
330};
331
332struct _Evas_Object_Textblock_Format_Item
333{
334 Evas_Object_Textblock_Item parent;
335 Evas_BiDi_Direction bidi_dir;
336 const char *item;
337 int y;
338 unsigned char vsize : 2;
339 unsigned char size : 2;
340 Eina_Bool formatme : 1;
341};
342
343struct _Evas_Object_Textblock_Format
344{
345 Evas_Object_Textblock_Node_Format *fnode;
346 double halign;
347 double valign;
348 struct {
349 Evas_Font_Description *fdesc;
350 const char *source;
351 Evas_Font_Set *font;
352 Evas_Font_Size size;
353 } font;
354 struct {
355 struct {
356 unsigned char r, g, b, a;
357 } normal, underline, underline2, underline_dash, outline, shadow, glow, glow2, backing,
358 strikethrough;
359 } color;
360 struct {
361 int l, r;
362 } margin;
363 int ref;
364 int tabstops;
365 int linesize;
366 int linegap;
367 int underline_dash_width;
368 int underline_dash_gap;
369 double linerelsize;
370 double linerelgap;
371 double linefill;
372 double ellipsis;
373 unsigned char style;
374 Eina_Bool wrap_word : 1;
375 Eina_Bool wrap_char : 1;
376 Eina_Bool wrap_mixed : 1;
377 Eina_Bool underline : 1;
378 Eina_Bool underline2 : 1;
379 Eina_Bool underline_dash : 1;
380 Eina_Bool strikethrough : 1;
381 Eina_Bool backing : 1;
382 Eina_Bool password : 1;
383 Eina_Bool halign_auto : 1;
384};
385
386struct _Evas_Textblock_Style
387{
388 const char *style_text;
389 char *default_tag;
390 Evas_Object_Style_Tag *tags;
391 Eina_List *objects;
392 Eina_Bool delete_me : 1;
393};
394
395struct _Evas_Textblock_Cursor
396{
397 Evas_Object *obj;
398 size_t pos;
399 Evas_Object_Textblock_Node_Text *node;
400};
401
402/* Size of the index array */
403#define TEXTBLOCK_PAR_INDEX_SIZE 10
404struct _Evas_Object_Textblock
405{
406 DATA32 magic;
407 Evas_Textblock_Style *style;
408 Evas_Textblock_Cursor *cursor;
409 Eina_List *cursors;
410 Evas_Object_Textblock_Node_Text *text_nodes;
411 Evas_Object_Textblock_Node_Format *format_nodes;
412
413 int num_paragraphs;
414 Evas_Object_Textblock_Paragraph *paragraphs;
415 Evas_Object_Textblock_Paragraph *par_index[TEXTBLOCK_PAR_INDEX_SIZE];
416
417 Evas_Object_Textblock_Text_Item *ellip_ti;
418 Eina_List *anchors_a;
419 Eina_List *anchors_item;
420 int last_w, last_h;
421 struct {
422 int l, r, t, b;
423 } style_pad;
424 double valign;
425 char *markup_text;
426 void *engine_data;
427 const char *repch;
428 const char *bidi_delimiters;
429 struct {
430 int w, h;
431 Eina_Bool valid : 1;
432 } formatted, native;
433 Eina_Bool redraw : 1;
434 Eina_Bool changed : 1;
435 Eina_Bool content_changed : 1;
436 Eina_Bool format_changed : 1;
437 Eina_Bool have_ellipsis : 1;
438 Eina_Bool legacy_newline : 1;
439};
440
441/* private methods for textblock objects */
442static void evas_object_textblock_init(Evas_Object *obj);
443static void *evas_object_textblock_new(void);
444static void evas_object_textblock_render(Evas_Object *obj, void *output, void *context, void *surface, int x, int y);
445static void evas_object_textblock_free(Evas_Object *obj);
446static void evas_object_textblock_render_pre(Evas_Object *obj);
447static void evas_object_textblock_render_post(Evas_Object *obj);
448
449static unsigned int evas_object_textblock_id_get(Evas_Object *obj);
450static unsigned int evas_object_textblock_visual_id_get(Evas_Object *obj);
451static void *evas_object_textblock_engine_data_get(Evas_Object *obj);
452
453static int evas_object_textblock_is_opaque(Evas_Object *obj);
454static int evas_object_textblock_was_opaque(Evas_Object *obj);
455
456static void evas_object_textblock_coords_recalc(Evas_Object *obj);
457
458static void evas_object_textblock_scale_update(Evas_Object *obj);
459
460static const Evas_Object_Func object_func =
461{
462 /* methods (compulsory) */
463 evas_object_textblock_free,
464 evas_object_textblock_render,
465 evas_object_textblock_render_pre,
466 evas_object_textblock_render_post,
467 evas_object_textblock_id_get,
468 evas_object_textblock_visual_id_get,
469 evas_object_textblock_engine_data_get,
470 /* these are optional. NULL = nothing */
471 NULL,
472 NULL,
473 NULL,
474 NULL,
475 evas_object_textblock_is_opaque,
476 evas_object_textblock_was_opaque,
477 NULL,
478 NULL,
479 evas_object_textblock_coords_recalc,
480 evas_object_textblock_scale_update,
481 NULL,
482 NULL,
483 NULL
484};
485
486/* the actual api call to add a textblock */
487
488#define TB_HEAD() \
489 Evas_Object_Textblock *o; \
490 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); \
491 return; \
492 MAGIC_CHECK_END(); \
493 o = (Evas_Object_Textblock *)(obj->object_data); \
494 MAGIC_CHECK(o, Evas_Object_Textblock, MAGIC_OBJ_TEXTBLOCK); \
495 return; \
496 MAGIC_CHECK_END();
497
498#define TB_HEAD_RETURN(x) \
499 Evas_Object_Textblock *o; \
500 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); \
501 return (x); \
502 MAGIC_CHECK_END(); \
503 o = (Evas_Object_Textblock *)(obj->object_data); \
504 MAGIC_CHECK(o, Evas_Object_Textblock, MAGIC_OBJ_TEXTBLOCK); \
505 return (x); \
506 MAGIC_CHECK_END();
507
508
509
510static Eina_Bool _evas_textblock_cursor_is_at_the_end(const Evas_Textblock_Cursor *cur);
511static void _evas_textblock_node_text_remove(Evas_Object_Textblock *o, Evas_Object_Textblock_Node_Text *n);
512static void _evas_textblock_node_text_remove_formats_between(Evas_Object_Textblock *o, Evas_Object_Textblock_Node_Text *n, int start, int end);
513static Evas_Object_Textblock_Node_Format *_evas_textblock_cursor_node_format_before_or_at_pos_get(const Evas_Textblock_Cursor *cur);
514static size_t _evas_textblock_node_format_pos_get(const Evas_Object_Textblock_Node_Format *fmt);
515static void _evas_textblock_node_format_remove(Evas_Object_Textblock *o, Evas_Object_Textblock_Node_Format *n, int visual_adjustment);
516static void _evas_textblock_node_format_free(Evas_Object_Textblock *o, Evas_Object_Textblock_Node_Format *n);
517static void _evas_textblock_node_text_free(Evas_Object_Textblock_Node_Text *n);
518static void _evas_textblock_changed(Evas_Object_Textblock *o, Evas_Object *obj);
519static void _evas_textblock_invalidate_all(Evas_Object_Textblock *o);
520static void _evas_textblock_cursors_update_offset(const Evas_Textblock_Cursor *cur, const Evas_Object_Textblock_Node_Text *n, size_t start, int offset);
521static void _evas_textblock_cursors_set_node(Evas_Object_Textblock *o, const Evas_Object_Textblock_Node_Text *n, Evas_Object_Textblock_Node_Text *new_node);
522
523/* styles */
524/**
525 * @internal
526 * Clears the textblock style passed except for the style_text which is replaced.
527 * @param ts The ts to be cleared. Must not be NULL.
528 * @param style_text the style's text.
529 */
530static void
531_style_replace(Evas_Textblock_Style *ts, const char *style_text)
532{
533 eina_stringshare_replace(&ts->style_text, style_text);
534 if (ts->default_tag) free(ts->default_tag);
535 while (ts->tags)
536 {
537 Evas_Object_Style_Tag *tag;
538
539 tag = (Evas_Object_Style_Tag *)ts->tags;
540 ts->tags = (Evas_Object_Style_Tag *)eina_inlist_remove(EINA_INLIST_GET(ts->tags), EINA_INLIST_GET(tag));
541 free(tag->tag);
542 free(tag->replace);
543 free(tag);
544 }
545 ts->default_tag = NULL;
546 ts->tags = NULL;
547}
548
549/**
550 * @internal
551 * Clears the textblock style passed.
552 * @param ts The ts to be cleared. Must not be NULL.
553 */
554static void
555_style_clear(Evas_Textblock_Style *ts)
556{
557 _style_replace(ts, NULL);
558}
559
560/**
561 * @internal
562 * Searches inside the tags stored in the style for the tag matching s.
563 * @param ts The ts to be cleared. Must not be NULL.
564 * @param s The tag to be matched.
565 * @param tag_len the length of the tag string.
566 * @param[out] replace_len The length of the replcaement found. - Must not be NULL.
567 * @return The replacement string found.
568 */
569static inline const char *
570_style_match_tag(Evas_Textblock_Style *ts, const char *s, size_t tag_len, size_t *replace_len)
571{
572 Evas_Object_Style_Tag *tag;
573
574 EINA_INLIST_FOREACH(ts->tags, tag)
575 {
576 if (tag->tag_len != tag_len) continue;
577 if (!strncmp(tag->tag, s, tag_len))
578 {
579 *replace_len = tag->replace_len;
580 return tag->replace;
581 }
582 }
583 *replace_len = 0;
584 return NULL;
585}
586
587/**
588 * @internal
589 * Clears all the nodes (text and format) of the textblock object.
590 * @param obj The evas object, must not be NULL.
591 */
592static void
593_nodes_clear(const Evas_Object *obj)
594{
595 Evas_Object_Textblock *o;
596
597 o = (Evas_Object_Textblock *)(obj->object_data);
598 while (o->text_nodes)
599 {
600 Evas_Object_Textblock_Node_Text *n;
601
602 n = o->text_nodes;
603 o->text_nodes = _NODE_TEXT(eina_inlist_remove(
604 EINA_INLIST_GET(o->text_nodes), EINA_INLIST_GET(n)));
605 _evas_textblock_node_text_free(n);
606 }
607 while (o->format_nodes)
608 {
609 Evas_Object_Textblock_Node_Format *n;
610
611 n = o->format_nodes;
612 o->format_nodes = _NODE_FORMAT(eina_inlist_remove(EINA_INLIST_GET(o->format_nodes), EINA_INLIST_GET(n)));
613 _evas_textblock_node_format_free(o, n);
614 }
615}
616
617/**
618 * @internal
619 * Unrefs and frees (if needed) a textblock format.
620 * @param obj The Evas_Object, Must not be NULL.
621 * @param fmt the format to be cleaned, must not be NULL.
622 */
623static void
624_format_unref_free(const Evas_Object *obj, Evas_Object_Textblock_Format *fmt)
625{
626 fmt->ref--;
627 if (fmt->ref > 0) return;
628 if (fmt->font.fdesc) evas_font_desc_unref(fmt->font.fdesc);
629 if (fmt->font.source) eina_stringshare_del(fmt->font.source);
630 evas_font_free(obj->layer->evas, fmt->font.font);
631 free(fmt);
632}
633
634/**
635 * @internal
636 * Free a layout item
637 * @param obj The evas object, must not be NULL.
638 * @param ln the layout line on which the item is in, must not be NULL.
639 * @param it the layout item to be freed
640 */
641static void
642_item_free(const Evas_Object *obj, Evas_Object_Textblock_Line *ln, Evas_Object_Textblock_Item *it)
643{
644 if (it->type == EVAS_TEXTBLOCK_ITEM_TEXT)
645 {
646 Evas_Object_Textblock_Text_Item *ti = _ITEM_TEXT(it);
647
648 evas_common_text_props_content_unref(&ti->text_props);
649 }
650 else
651 {
652 Evas_Object_Textblock_Format_Item *fi = _ITEM_FORMAT(it);
653
654 if (fi->item) eina_stringshare_del(fi->item);
655 }
656 _format_unref_free(obj, it->format);
657 if (ln)
658 {
659 ln->items = (Evas_Object_Textblock_Item *) eina_inlist_remove(
660 EINA_INLIST_GET(ln->items), EINA_INLIST_GET(ln->items));
661 }
662 free(it);
663}
664
665/**
666 * @internal
667 * Free a layout line.
668 * @param obj The evas object, must not be NULL.
669 * @param ln the layout line to be freed, must not be NULL.
670 */
671static void
672_line_free(Evas_Object_Textblock_Line *ln)
673{
674 /* Items are freed from the logical list, except for the ellip item */
675 if (ln) free(ln);
676}
677
678/* table of html escapes (that i can find) this should be ordered with the
679 * most common first as it's a linear search to match - no hash for this.
680 *
681 * these are stored as one large string and one additional array that
682 * contains the offsets to the tokens for space efficiency.
683 */
684/**
685 * @internal
686 * @var escape_strings[]
687 * This string consists of NULL terminated pairs of strings, the first of
688 * every pair is an escape and the second is the value of the escape.
689 */
690static const char escape_strings[] =
691/* most common escaped stuff */
692"&quot;\0" "\x22\0"
693"&amp;\0" "\x26\0"
694"&lt;\0" "\x3c\0"
695"&gt;\0" "\x3e\0"
696/* all the rest */
697"&nbsp;\0" "\xc2\xa0\0"
698"&iexcl;\0" "\xc2\xa1\0"
699"&cent;\0" "\xc2\xa2\0"
700"&pound;\0" "\xc2\xa3\0"
701"&curren;\0" "\xc2\xa4\0"
702"&yen;\0" "\xc2\xa5\0"
703"&brvbar;\0" "\xc2\xa6\0"
704"&sect;\0" "\xc2\xa7\0"
705"&uml;\0" "\xc2\xa8\0"
706"&copy;\0" "\xc2\xa9\0"
707"&ordf;\0" "\xc2\xaa\0"
708"&laquo;\0" "\xc2\xab\0"
709"&not;\0" "\xc2\xac\0"
710"&reg;\0" "\xc2\xae\0"
711"&macr;\0" "\xc2\xaf\0"
712"&deg;\0" "\xc2\xb0\0"
713"&plusmn;\0" "\xc2\xb1\0"
714"&sup2;\0" "\xc2\xb2\0"
715"&sup3;\0" "\xc2\xb3\0"
716"&acute;\0" "\xc2\xb4\0"
717"&micro;\0" "\xc2\xb5\0"
718"&para;\0" "\xc2\xb6\0"
719"&middot;\0" "\xc2\xb7\0"
720"&cedil;\0" "\xc2\xb8\0"
721"&sup1;\0" "\xc2\xb9\0"
722"&ordm;\0" "\xc2\xba\0"
723"&raquo;\0" "\xc2\xbb\0"
724"&frac14;\0" "\xc2\xbc\0"
725"&frac12;\0" "\xc2\xbd\0"
726"&frac34;\0" "\xc2\xbe\0"
727"&iquest;\0" "\xc2\xbf\0"
728"&Agrave;\0" "\xc3\x80\0"
729"&Aacute;\0" "\xc3\x81\0"
730"&Acirc;\0" "\xc3\x82\0"
731"&Atilde;\0" "\xc3\x83\0"
732"&Auml;\0" "\xc3\x84\0"
733"&Aring;\0" "\xc3\x85\0"
734"&Aelig;\0" "\xc3\x86\0"
735"&Ccedil;\0" "\xc3\x87\0"
736"&Egrave;\0" "\xc3\x88\0"
737"&Eacute;\0" "\xc3\x89\0"
738"&Ecirc;\0" "\xc3\x8a\0"
739"&Euml;\0" "\xc3\x8b\0"
740"&Igrave;\0" "\xc3\x8c\0"
741"&Iacute;\0" "\xc3\x8d\0"
742"&Icirc;\0" "\xc3\x8e\0"
743"&Iuml;\0" "\xc3\x8f\0"
744"&Eth;\0" "\xc3\x90\0"
745"&Ntilde;\0" "\xc3\x91\0"
746"&Ograve;\0" "\xc3\x92\0"
747"&Oacute;\0" "\xc3\x93\0"
748"&Ocirc;\0" "\xc3\x94\0"
749"&Otilde;\0" "\xc3\x95\0"
750"&Ouml;\0" "\xc3\x96\0"
751"&times;\0" "\xc3\x97\0"
752"&Oslash;\0" "\xc3\x98\0"
753"&Ugrave;\0" "\xc3\x99\0"
754"&Uacute;\0" "\xc3\x9a\0"
755"&Ucirc;\0" "\xc3\x9b\0"
756"&Yacute;\0" "\xc3\x9d\0"
757"&Thorn;\0" "\xc3\x9e\0"
758"&szlig;\0" "\xc3\x9f\0"
759"&agrave;\0" "\xc3\xa0\0"
760"&aacute;\0" "\xc3\xa1\0"
761"&acirc;\0" "\xc3\xa2\0"
762"&atilde;\0" "\xc3\xa3\0"
763"&auml;\0" "\xc3\xa4\0"
764"&aring;\0" "\xc3\xa5\0"
765"&aelig;\0" "\xc3\xa6\0"
766"&ccedil;\0" "\xc3\xa7\0"
767"&egrave;\0" "\xc3\xa8\0"
768"&eacute;\0" "\xc3\xa9\0"
769"&ecirc;\0" "\xc3\xaa\0"
770"&euml;\0" "\xc3\xab\0"
771"&igrave;\0" "\xc3\xac\0"
772"&iacute;\0" "\xc3\xad\0"
773"&icirc;\0" "\xc3\xae\0"
774"&iuml;\0" "\xc3\xaf\0"
775"&eth;\0" "\xc3\xb0\0"
776"&ntilde;\0" "\xc3\xb1\0"
777"&ograve;\0" "\xc3\xb2\0"
778"&oacute;\0" "\xc3\xb3\0"
779"&ocirc;\0" "\xc3\xb4\0"
780"&otilde;\0" "\xc3\xb5\0"
781"&ouml;\0" "\xc3\xb6\0"
782"&divide;\0" "\xc3\xb7\0"
783"&oslash;\0" "\xc3\xb8\0"
784"&ugrave;\0" "\xc3\xb9\0"
785"&uacute;\0" "\xc3\xba\0"
786"&ucirc;\0" "\xc3\xbb\0"
787"&uuml;\0" "\xc3\xbc\0"
788"&yacute;\0" "\xc3\xbd\0"
789"&thorn;\0" "\xc3\xbe\0"
790"&yuml;\0" "\xc3\xbf\0"
791"&alpha;\0" "\xce\x91\0"
792"&beta;\0" "\xce\x92\0"
793"&gamma;\0" "\xce\x93\0"
794"&delta;\0" "\xce\x94\0"
795"&epsilon;\0" "\xce\x95\0"
796"&zeta;\0" "\xce\x96\0"
797"&eta;\0" "\xce\x97\0"
798"&theta;\0" "\xce\x98\0"
799"&iota;\0" "\xce\x99\0"
800"&kappa;\0" "\xce\x9a\0"
801"&lambda;\0" "\xce\x9b\0"
802"&mu;\0" "\xce\x9c\0"
803"&nu;\0" "\xce\x9d\0"
804"&xi;\0" "\xce\x9e\0"
805"&omicron;\0" "\xce\x9f\0"
806"&pi;\0" "\xce\xa0\0"
807"&rho;\0" "\xce\xa1\0"
808"&sigma;\0" "\xce\xa3\0"
809"&tau;\0" "\xce\xa4\0"
810"&upsilon;\0" "\xce\xa5\0"
811"&phi;\0" "\xce\xa6\0"
812"&chi;\0" "\xce\xa7\0"
813"&psi;\0" "\xce\xa8\0"
814"&omega;\0" "\xce\xa9\0"
815"&hellip;\0" "\xe2\x80\xa6\0"
816"&euro;\0" "\xe2\x82\xac\0"
817"&larr;\0" "\xe2\x86\x90\0"
818"&uarr;\0" "\xe2\x86\x91\0"
819"&rarr;\0" "\xe2\x86\x92\0"
820"&darr;\0" "\xe2\x86\x93\0"
821"&harr;\0" "\xe2\x86\x94\0"
822"&larr;\0" "\xe2\x87\x90\0"
823"&rarr;\0" "\xe2\x87\x92\0"
824"&forall;\0" "\xe2\x88\x80\0"
825"&exist;\0" "\xe2\x88\x83\0"
826"&nabla;\0" "\xe2\x88\x87\0"
827"&prod;\0" "\xe2\x88\x8f\0"
828"&sum;\0" "\xe2\x88\x91\0"
829"&and;\0" "\xe2\x88\xa7\0"
830"&or;\0" "\xe2\x88\xa8\0"
831"&int;\0" "\xe2\x88\xab\0"
832"&ne;\0" "\xe2\x89\xa0\0"
833"&equiv;\0" "\xe2\x89\xa1\0"
834"&oplus;\0" "\xe2\x8a\x95\0"
835"&perp;\0" "\xe2\x8a\xa5\0"
836"&dagger;\0" "\xe2\x80\xa0\0"
837"&Dagger;\0" "\xe2\x80\xa1\0"
838"&bull;\0" "\xe2\x80\xa2\0"
839;
840
841EVAS_MEMPOOL(_mp_obj);
842
843/**
844 * @internal
845 * Checks if a char is a whitespace.
846 * @param c the unicode codepoint.
847 * @return EINA_TRUE if the unicode codepoint is a whitespace, EINA_FALSE otherwise.
848 */
849static Eina_Bool
850_is_white(Eina_Unicode c)
851{
852 /*
853 * unicode list of whitespace chars
854 *
855 * 0009..000D <control-0009>..<control-000D>
856 * 0020 SPACE
857 * 0085 <control-0085>
858 * 00A0 NO-BREAK SPACE
859 * 1680 OGHAM SPACE MARK
860 * 180E MONGOLIAN VOWEL SEPARATOR
861 * 2000..200A EN QUAD..HAIR SPACE
862 * 2028 LINE SEPARATOR
863 * 2029 PARAGRAPH SEPARATOR
864 * 202F NARROW NO-BREAK SPACE
865 * 205F MEDIUM MATHEMATICAL SPACE
866 * 3000 IDEOGRAPHIC SPACE
867 */
868 if (
869 (c == 0x20) ||
870 ((c >= 0x9) && (c <= 0xd)) ||
871 (c == 0x85) ||
872 (c == 0xa0) ||
873 (c == 0x1680) ||
874 (c == 0x180e) ||
875 ((c >= 0x2000) && (c <= 0x200a)) ||
876 (c == 0x2028) ||
877 (c == 0x2029) ||
878 (c == 0x202f) ||
879 (c == 0x205f) ||
880 (c == 0x3000)
881 )
882 return EINA_TRUE;
883 return EINA_FALSE;
884}
885
886/**
887 * @internal
888 * Prepends the text between s and p to the main cursor of the object.
889 *
890 * @param cur the cursor to prepend to.
891 * @param[in] s start of the string
892 * @param[in] p end of the string
893 */
894static void
895_prepend_text_run(Evas_Textblock_Cursor *cur, const char *s, const char *p)
896{
897 if ((s) && (p > s))
898 {
899 char *ts;
900
901 ts = alloca(p - s + 1);
902 strncpy(ts, s, p - s);
903 ts[p - s] = 0;
904 evas_textblock_cursor_text_prepend(cur, ts);
905 }
906}
907
908
909/**
910 * @internal
911 * Returns the numeric value of HEX chars for example for ch = 'A'
912 * the function will return 10.
913 *
914 * @param ch The HEX char.
915 * @return numeric value of HEX.
916 */
917static int
918_hex_string_get(char ch)
919{
920 if ((ch >= '0') && (ch <= '9')) return (ch - '0');
921 else if ((ch >= 'A') && (ch <= 'F')) return (ch - 'A' + 10);
922 else if ((ch >= 'a') && (ch <= 'f')) return (ch - 'a' + 10);
923 return 0;
924}
925
926/**
927 * @internal
928 * Parses a string of one of the formas:
929 * 1. "#RRGGBB"
930 * 2. "#RRGGBBAA"
931 * 3. "#RGB"
932 * 4. "#RGBA"
933 * To the rgba values.
934 *
935 * @param[in] str The string to parse - NOT NULL.
936 * @param[out] r The Red value - NOT NULL.
937 * @param[out] g The Green value - NOT NULL.
938 * @param[out] b The Blue value - NOT NULL.
939 * @param[out] a The Alpha value - NOT NULL.
940 */
941static void
942_format_color_parse(const char *str, unsigned char *r, unsigned char *g, unsigned char *b, unsigned char *a)
943{
944 int slen;
945
946 slen = strlen(str);
947 *r = *g = *b = *a = 0;
948
949 if (slen == 7) /* #RRGGBB */
950 {
951 *r = (_hex_string_get(str[1]) << 4) | (_hex_string_get(str[2]));
952 *g = (_hex_string_get(str[3]) << 4) | (_hex_string_get(str[4]));
953 *b = (_hex_string_get(str[5]) << 4) | (_hex_string_get(str[6]));
954 *a = 0xff;
955 }
956 else if (slen == 9) /* #RRGGBBAA */
957 {
958 *r = (_hex_string_get(str[1]) << 4) | (_hex_string_get(str[2]));
959 *g = (_hex_string_get(str[3]) << 4) | (_hex_string_get(str[4]));
960 *b = (_hex_string_get(str[5]) << 4) | (_hex_string_get(str[6]));
961 *a = (_hex_string_get(str[7]) << 4) | (_hex_string_get(str[8]));
962 }
963 else if (slen == 4) /* #RGB */
964 {
965 *r = _hex_string_get(str[1]);
966 *r = (*r << 4) | *r;
967 *g = _hex_string_get(str[2]);
968 *g = (*g << 4) | *g;
969 *b = _hex_string_get(str[3]);
970 *b = (*b << 4) | *b;
971 *a = 0xff;
972 }
973 else if (slen == 5) /* #RGBA */
974 {
975 *r = _hex_string_get(str[1]);
976 *r = (*r << 4) | *r;
977 *g = _hex_string_get(str[2]);
978 *g = (*g << 4) | *g;
979 *b = _hex_string_get(str[3]);
980 *b = (*b << 4) | *b;
981 *a = _hex_string_get(str[4]);
982 *a = (*a << 4) | *a;
983 }
984 *r = (*r * *a) / 255;
985 *g = (*g * *a) / 255;
986 *b = (*b * *a) / 255;
987}
988
989/* The refcount for the formats. */
990static int format_refcount = 0;
991/* Holders for the stringshares */
992static const char *fontstr = NULL;
993static const char *font_fallbacksstr = NULL;
994static const char *font_sizestr = NULL;
995static const char *font_sourcestr = NULL;
996static const char *font_weightstr = NULL;
997static const char *font_stylestr = NULL;
998static const char *font_widthstr = NULL;
999static const char *langstr = NULL;
1000static const char *colorstr = NULL;
1001static const char *underline_colorstr = NULL;
1002static const char *underline2_colorstr = NULL;
1003static const char *underline_dash_colorstr = NULL;
1004static const char *outline_colorstr = NULL;
1005static const char *shadow_colorstr = NULL;
1006static const char *glow_colorstr = NULL;
1007static const char *glow2_colorstr = NULL;
1008static const char *backing_colorstr = NULL;
1009static const char *strikethrough_colorstr = NULL;
1010static const char *alignstr = NULL;
1011static const char *valignstr = NULL;
1012static const char *wrapstr = NULL;
1013static const char *left_marginstr = NULL;
1014static const char *right_marginstr = NULL;
1015static const char *underlinestr = NULL;
1016static const char *strikethroughstr = NULL;
1017static const char *backingstr = NULL;
1018static const char *stylestr = NULL;
1019static const char *tabstopsstr = NULL;
1020static const char *linesizestr = NULL;
1021static const char *linerelsizestr = NULL;
1022static const char *linegapstr = NULL;
1023static const char *linerelgapstr = NULL;
1024static const char *itemstr = NULL;
1025static const char *linefillstr = NULL;
1026static const char *ellipsisstr = NULL;
1027static const char *passwordstr = NULL;
1028static const char *underline_dash_widthstr = NULL;
1029static const char *underline_dash_gapstr = NULL;
1030
1031/**
1032 * @internal
1033 * Init the format strings.
1034 */
1035static void
1036_format_command_init(void)
1037{
1038 if (format_refcount == 0)
1039 {
1040 fontstr = eina_stringshare_add("font");
1041 font_fallbacksstr = eina_stringshare_add("font_fallbacks");
1042 font_sizestr = eina_stringshare_add("font_size");
1043 font_sourcestr = eina_stringshare_add("font_source");
1044 font_weightstr = eina_stringshare_add("font_weight");
1045 font_stylestr = eina_stringshare_add("font_style");
1046 font_widthstr = eina_stringshare_add("font_width");
1047 langstr = eina_stringshare_add("lang");
1048 colorstr = eina_stringshare_add("color");
1049 underline_colorstr = eina_stringshare_add("underline_color");
1050 underline2_colorstr = eina_stringshare_add("underline2_color");
1051 underline_dash_colorstr = eina_stringshare_add("underline_dash_color");
1052 outline_colorstr = eina_stringshare_add("outline_color");
1053 shadow_colorstr = eina_stringshare_add("shadow_color");
1054 glow_colorstr = eina_stringshare_add("glow_color");
1055 glow2_colorstr = eina_stringshare_add("glow2_color");
1056 backing_colorstr = eina_stringshare_add("backing_color");
1057 strikethrough_colorstr = eina_stringshare_add("strikethrough_color");
1058 alignstr = eina_stringshare_add("align");
1059 valignstr = eina_stringshare_add("valign");
1060 wrapstr = eina_stringshare_add("wrap");
1061 left_marginstr = eina_stringshare_add("left_margin");
1062 right_marginstr = eina_stringshare_add("right_margin");
1063 underlinestr = eina_stringshare_add("underline");
1064 strikethroughstr = eina_stringshare_add("strikethrough");
1065 backingstr = eina_stringshare_add("backing");
1066 stylestr = eina_stringshare_add("style");
1067 tabstopsstr = eina_stringshare_add("tabstops");
1068 linesizestr = eina_stringshare_add("linesize");
1069 linerelsizestr = eina_stringshare_add("linerelsize");
1070 linegapstr = eina_stringshare_add("linegap");
1071 linerelgapstr = eina_stringshare_add("linerelgap");
1072 itemstr = eina_stringshare_add("item");
1073 linefillstr = eina_stringshare_add("linefill");
1074 ellipsisstr = eina_stringshare_add("ellipsis");
1075 passwordstr = eina_stringshare_add("password");
1076 underline_dash_widthstr = eina_stringshare_add("underline_dash_width");
1077 underline_dash_gapstr = eina_stringshare_add("underline_dash_gap");
1078 }
1079 format_refcount++;
1080}
1081
1082/**
1083 * @internal
1084 * Shutdown the format strings.
1085 */
1086static void
1087_format_command_shutdown(void)
1088{
1089 if (--format_refcount > 0) return;
1090
1091 eina_stringshare_del(fontstr);
1092 eina_stringshare_del(font_fallbacksstr);
1093 eina_stringshare_del(font_sizestr);
1094 eina_stringshare_del(font_sourcestr);
1095 eina_stringshare_del(font_weightstr);
1096 eina_stringshare_del(font_stylestr);
1097 eina_stringshare_del(font_widthstr);
1098 eina_stringshare_del(langstr);
1099 eina_stringshare_del(colorstr);
1100 eina_stringshare_del(underline_colorstr);
1101 eina_stringshare_del(underline2_colorstr);
1102 eina_stringshare_del(underline_dash_colorstr);
1103 eina_stringshare_del(outline_colorstr);
1104 eina_stringshare_del(shadow_colorstr);
1105 eina_stringshare_del(glow_colorstr);
1106 eina_stringshare_del(glow2_colorstr);
1107 eina_stringshare_del(backing_colorstr);
1108 eina_stringshare_del(strikethrough_colorstr);
1109 eina_stringshare_del(alignstr);
1110 eina_stringshare_del(valignstr);
1111 eina_stringshare_del(wrapstr);
1112 eina_stringshare_del(left_marginstr);
1113 eina_stringshare_del(right_marginstr);
1114 eina_stringshare_del(underlinestr);
1115 eina_stringshare_del(strikethroughstr);
1116 eina_stringshare_del(backingstr);
1117 eina_stringshare_del(stylestr);
1118 eina_stringshare_del(tabstopsstr);
1119 eina_stringshare_del(linesizestr);
1120 eina_stringshare_del(linerelsizestr);
1121 eina_stringshare_del(linegapstr);
1122 eina_stringshare_del(linerelgapstr);
1123 eina_stringshare_del(itemstr);
1124 eina_stringshare_del(linefillstr);
1125 eina_stringshare_del(ellipsisstr);
1126 eina_stringshare_del(passwordstr);
1127 eina_stringshare_del(underline_dash_widthstr);
1128 eina_stringshare_del(underline_dash_gapstr);
1129}
1130
1131/**
1132 * @internal
1133 * Copies str to dst while removing the \\ char, i.e unescape the escape sequences.
1134 *
1135 * @param[out] dst the destination string - Should not be NULL.
1136 * @param[in] src the source string - Should not be NULL.
1137 */
1138static void
1139_format_clean_param(char *dst, const char *src)
1140{
1141 const char *ss;
1142 char *ds;
1143
1144 ds = dst;
1145 for (ss = src; *ss; ss++, ds++)
1146 {
1147 if ((*ss == '\\') && *(ss + 1)) ss++;
1148 *ds = *ss;
1149 }
1150 *ds = 0;
1151}
1152
1153/**
1154 * @internal
1155 * Parses the cmd and parameter and adds the parsed format to fmt.
1156 *
1157 * @param obj the evas object - should not be NULL.
1158 * @param fmt The format to populate - should not be NULL.
1159 * @param[in] cmd the command to process, should be stringshared.
1160 * @param[in] param the parameter of the command.
1161 */
1162static void
1163_format_command(Evas_Object *obj, Evas_Object_Textblock_Format *fmt, const char *cmd, const char *param)
1164{
1165 int len;
1166 char *tmp_param;
1167
1168 len = strlen(param);
1169 tmp_param = alloca(len + 1);
1170
1171 _format_clean_param(tmp_param, param);
1172
1173 /* If we are changing the font, create the fdesc. */
1174 if ((cmd == font_weightstr) || (cmd == font_widthstr) ||
1175 (cmd == font_stylestr) || (cmd == langstr) ||
1176 (cmd == fontstr) || (cmd == font_fallbacksstr))
1177 {
1178 if (!fmt->font.fdesc)
1179 {
1180 fmt->font.fdesc = evas_font_desc_new();
1181 }
1182 else if (!fmt->font.fdesc->is_new)
1183 {
1184 Evas_Font_Description *old = fmt->font.fdesc;
1185 fmt->font.fdesc = evas_font_desc_dup(fmt->font.fdesc);
1186 if (old) evas_font_desc_unref(old);
1187 }
1188 }
1189
1190
1191 if (cmd == fontstr)
1192 {
1193 evas_font_name_parse(fmt->font.fdesc, tmp_param);
1194 }
1195 else if (cmd == font_fallbacksstr)
1196 {
1197 eina_stringshare_replace(&(fmt->font.fdesc->fallbacks), tmp_param);
1198 }
1199 else if (cmd == font_sizestr)
1200 {
1201 int v;
1202
1203 v = atoi(tmp_param);
1204 if (v != fmt->font.size)
1205 {
1206 fmt->font.size = v;
1207 }
1208 }
1209 else if (cmd == font_sourcestr)
1210 {
1211 if ((!fmt->font.source) ||
1212 ((fmt->font.source) && (strcmp(fmt->font.source, tmp_param))))
1213 {
1214 if (fmt->font.source) eina_stringshare_del(fmt->font.source);
1215 fmt->font.source = eina_stringshare_add(tmp_param);
1216 }
1217 }
1218 else if (cmd == font_weightstr)
1219 {
1220 fmt->font.fdesc->weight = evas_font_style_find(tmp_param,
1221 tmp_param + strlen(tmp_param), EVAS_FONT_STYLE_WEIGHT);
1222 }
1223 else if (cmd == font_stylestr)
1224 {
1225 fmt->font.fdesc->slant = evas_font_style_find(tmp_param,
1226 tmp_param + strlen(tmp_param), EVAS_FONT_STYLE_SLANT);
1227 }
1228 else if (cmd == font_widthstr)
1229 {
1230 fmt->font.fdesc->width = evas_font_style_find(tmp_param,
1231 tmp_param + strlen(tmp_param), EVAS_FONT_STYLE_WIDTH);
1232 }
1233 else if (cmd == langstr)
1234 {
1235 eina_stringshare_replace(&(fmt->font.fdesc->lang), tmp_param);
1236 }
1237 else if (cmd == colorstr)
1238 _format_color_parse(tmp_param,
1239 &(fmt->color.normal.r), &(fmt->color.normal.g),
1240 &(fmt->color.normal.b), &(fmt->color.normal.a));
1241 else if (cmd == underline_colorstr)
1242 _format_color_parse(tmp_param,
1243 &(fmt->color.underline.r), &(fmt->color.underline.g),
1244 &(fmt->color.underline.b), &(fmt->color.underline.a));
1245 else if (cmd == underline2_colorstr)
1246 _format_color_parse(tmp_param,
1247 &(fmt->color.underline2.r), &(fmt->color.underline2.g),
1248 &(fmt->color.underline2.b), &(fmt->color.underline2.a));
1249 else if (cmd == underline_dash_colorstr)
1250 _format_color_parse(tmp_param,
1251 &(fmt->color.underline_dash.r), &(fmt->color.underline_dash.g),
1252 &(fmt->color.underline_dash.b), &(fmt->color.underline_dash.a));
1253 else if (cmd == outline_colorstr)
1254 _format_color_parse(tmp_param,
1255 &(fmt->color.outline.r), &(fmt->color.outline.g),
1256 &(fmt->color.outline.b), &(fmt->color.outline.a));
1257 else if (cmd == shadow_colorstr)
1258 _format_color_parse(tmp_param,
1259 &(fmt->color.shadow.r), &(fmt->color.shadow.g),
1260 &(fmt->color.shadow.b), &(fmt->color.shadow.a));
1261 else if (cmd == glow_colorstr)
1262 _format_color_parse(tmp_param,
1263 &(fmt->color.glow.r), &(fmt->color.glow.g),
1264 &(fmt->color.glow.b), &(fmt->color.glow.a));
1265 else if (cmd == glow2_colorstr)
1266 _format_color_parse(tmp_param,
1267 &(fmt->color.glow2.r), &(fmt->color.glow2.g),
1268 &(fmt->color.glow2.b), &(fmt->color.glow2.a));
1269 else if (cmd == backing_colorstr)
1270 _format_color_parse(tmp_param,
1271 &(fmt->color.backing.r), &(fmt->color.backing.g),
1272 &(fmt->color.backing.b), &(fmt->color.backing.a));
1273 else if (cmd == strikethrough_colorstr)
1274 _format_color_parse(tmp_param,
1275 &(fmt->color.strikethrough.r), &(fmt->color.strikethrough.g),
1276 &(fmt->color.strikethrough.b), &(fmt->color.strikethrough.a));
1277 else if (cmd == alignstr)
1278 {
1279 if (!strcmp(tmp_param, "auto"))
1280 {
1281 fmt->halign_auto = EINA_TRUE;
1282 }
1283 else
1284 {
1285 if (!strcmp(tmp_param, "middle")) fmt->halign = 0.5;
1286 else if (!strcmp(tmp_param, "center")) fmt->halign = 0.5;
1287 else if (!strcmp(tmp_param, "left")) fmt->halign = 0.0;
1288 else if (!strcmp(tmp_param, "right")) fmt->halign = 1.0;
1289 else
1290 {
1291 char *endptr = NULL;
1292 double val = strtod(tmp_param, &endptr);
1293 if (endptr)
1294 {
1295 while (*endptr && _is_white(*endptr))
1296 endptr++;
1297 if (*endptr == '%')
1298 val /= 100.0;
1299 }
1300 fmt->halign = val;
1301 if (fmt->halign < 0.0) fmt->halign = 0.0;
1302 else if (fmt->halign > 1.0) fmt->halign = 1.0;
1303 }
1304 fmt->halign_auto = EINA_FALSE;
1305 }
1306 }
1307 else if (cmd == valignstr)
1308 {
1309 if (!strcmp(tmp_param, "top")) fmt->valign = 0.0;
1310 else if (!strcmp(tmp_param, "middle")) fmt->valign = 0.5;
1311 else if (!strcmp(tmp_param, "center")) fmt->valign = 0.5;
1312 else if (!strcmp(tmp_param, "bottom")) fmt->valign = 1.0;
1313 else if (!strcmp(tmp_param, "baseline")) fmt->valign = -1.0;
1314 else if (!strcmp(tmp_param, "base")) fmt->valign = -1.0;
1315 else
1316 {
1317 char *endptr = NULL;
1318 double val = strtod(tmp_param, &endptr);
1319 if (endptr)
1320 {
1321 while (*endptr && _is_white(*endptr))
1322 endptr++;
1323 if (*endptr == '%')
1324 val /= 100.0;
1325 }
1326 fmt->valign = val;
1327 if (fmt->valign < 0.0) fmt->valign = 0.0;
1328 else if (fmt->valign > 1.0) fmt->valign = 1.0;
1329 }
1330 }
1331 else if (cmd == wrapstr)
1332 {
1333 if (!strcmp(tmp_param, "word"))
1334 {
1335 fmt->wrap_word = 1;
1336 fmt->wrap_char = fmt->wrap_mixed = 0;
1337 }
1338 else if (!strcmp(tmp_param, "char"))
1339 {
1340 fmt->wrap_word = fmt->wrap_mixed = 0;
1341 fmt->wrap_char = 1;
1342 }
1343 else if (!strcmp(tmp_param, "mixed"))
1344 {
1345 fmt->wrap_word = fmt->wrap_char = 0;
1346 fmt->wrap_mixed = 1;
1347 }
1348 else
1349 {
1350 fmt->wrap_word = fmt->wrap_mixed = fmt->wrap_char = 0;
1351 }
1352 }
1353 else if (cmd == left_marginstr)
1354 {
1355 if (!strcmp(tmp_param, "reset"))
1356 fmt->margin.l = 0;
1357 else
1358 {
1359 if (tmp_param[0] == '+')
1360 fmt->margin.l += atoi(&(tmp_param[1]));
1361 else if (tmp_param[0] == '-')
1362 fmt->margin.l -= atoi(&(tmp_param[1]));
1363 else
1364 fmt->margin.l = atoi(tmp_param);
1365 if (fmt->margin.l < 0) fmt->margin.l = 0;
1366 }
1367 }
1368 else if (cmd == right_marginstr)
1369 {
1370 if (!strcmp(tmp_param, "reset"))
1371 fmt->margin.r = 0;
1372 else
1373 {
1374 if (tmp_param[0] == '+')
1375 fmt->margin.r += atoi(&(tmp_param[1]));
1376 else if (tmp_param[0] == '-')
1377 fmt->margin.r -= atoi(&(tmp_param[1]));
1378 else
1379 fmt->margin.r = atoi(tmp_param);
1380 if (fmt->margin.r < 0) fmt->margin.r = 0;
1381 }
1382 }
1383 else if (cmd == underlinestr)
1384 {
1385 if (!strcmp(tmp_param, "off"))
1386 {
1387 fmt->underline = 0;
1388 fmt->underline2 = 0;
1389 }
1390 else if ((!strcmp(tmp_param, "on")) ||
1391 (!strcmp(tmp_param, "single")))
1392 {
1393 fmt->underline = 1;
1394 fmt->underline2 = 0;
1395 }
1396 else if (!strcmp(tmp_param, "double"))
1397 {
1398 fmt->underline = 1;
1399 fmt->underline2 = 1;
1400 }
1401 else if (!strcmp(tmp_param, "dashed"))
1402 fmt->underline_dash = 1;
1403 }
1404 else if (cmd == strikethroughstr)
1405 {
1406 if (!strcmp(tmp_param, "off"))
1407 fmt->strikethrough = 0;
1408 else if (!strcmp(tmp_param, "on"))
1409 fmt->strikethrough = 1;
1410 }
1411 else if (cmd == backingstr)
1412 {
1413 if (!strcmp(tmp_param, "off"))
1414 fmt->backing = 0;
1415 else if (!strcmp(tmp_param, "on"))
1416 fmt->backing = 1;
1417 }
1418 else if (cmd == stylestr)
1419 {
1420 char *p1, *p2, *p, *pp;
1421
1422 p1 = alloca(len + 1);
1423 *p1 = 0;
1424 p2 = alloca(len + 1);
1425 *p2 = 0;
1426 /* no comma */
1427 if (!strstr(tmp_param, ",")) p1 = tmp_param;
1428 else
1429 {
1430 /* split string "str1,str2" into p1 and p2 (if we have more than
1431 * 1 str2 eg "str1,str2,str3,str4" then we don't care. p2 just
1432 * ends up being the last one as right now it's only valid to have
1433 * 1 comma and 2 strings */
1434 pp = p1;
1435 for (p = tmp_param; *p; p++)
1436 {
1437 if (*p == ',')
1438 {
1439 *pp = 0;
1440 pp = p2;
1441 continue;
1442 }
1443 *pp = *p;
1444 pp++;
1445 }
1446 *pp = 0;
1447 }
1448 if (!strcmp(p1, "off")) fmt->style = EVAS_TEXT_STYLE_PLAIN;
1449 else if (!strcmp(p1, "none")) fmt->style = EVAS_TEXT_STYLE_PLAIN;
1450 else if (!strcmp(p1, "plain")) fmt->style = EVAS_TEXT_STYLE_PLAIN;
1451 else if (!strcmp(p1, "shadow")) fmt->style = EVAS_TEXT_STYLE_SHADOW;
1452 else if (!strcmp(p1, "outline")) fmt->style = EVAS_TEXT_STYLE_OUTLINE;
1453 else if (!strcmp(p1, "soft_outline")) fmt->style = EVAS_TEXT_STYLE_SOFT_OUTLINE;
1454 else if (!strcmp(p1, "outline_shadow")) fmt->style = EVAS_TEXT_STYLE_OUTLINE_SHADOW;
1455 else if (!strcmp(p1, "outline_soft_shadow")) fmt->style = EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW;
1456 else if (!strcmp(p1, "glow")) fmt->style = EVAS_TEXT_STYLE_GLOW;
1457 else if (!strcmp(p1, "far_shadow")) fmt->style = EVAS_TEXT_STYLE_FAR_SHADOW;
1458 else if (!strcmp(p1, "soft_shadow")) fmt->style = EVAS_TEXT_STYLE_SOFT_SHADOW;
1459 else if (!strcmp(p1, "far_soft_shadow")) fmt->style = EVAS_TEXT_STYLE_FAR_SOFT_SHADOW;
1460 else fmt->style = EVAS_TEXT_STYLE_PLAIN;
1461
1462 if (*p2)
1463 {
1464 if (!strcmp(p2, "bottom_right")) EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET(fmt->style, EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_RIGHT);
1465 else if (!strcmp(p2, "bottom")) EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET(fmt->style, EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM);
1466 else if (!strcmp(p2, "bottom_left")) EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET(fmt->style, EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_LEFT);
1467 else if (!strcmp(p2, "left")) EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET(fmt->style, EVAS_TEXT_STYLE_SHADOW_DIRECTION_LEFT);
1468 else if (!strcmp(p2, "top_left")) EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET(fmt->style, EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP_LEFT);
1469 else if (!strcmp(p2, "top")) EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET(fmt->style, EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP);
1470 else if (!strcmp(p2, "top_right")) EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET(fmt->style, EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP_RIGHT);
1471 else if (!strcmp(p2, "right")) EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET(fmt->style, EVAS_TEXT_STYLE_SHADOW_DIRECTION_RIGHT);
1472 else EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET(fmt->style, EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_RIGHT);
1473 }
1474 }
1475 else if (cmd == tabstopsstr)
1476 {
1477 fmt->tabstops = atoi(tmp_param);
1478 if (fmt->tabstops < 1) fmt->tabstops = 1;
1479 }
1480 else if (cmd == linesizestr)
1481 {
1482 fmt->linesize = atoi(tmp_param);
1483 fmt->linerelsize = 0.0;
1484 }
1485 else if (cmd == linerelsizestr)
1486 {
1487 char *endptr = NULL;
1488 double val = strtod(tmp_param, &endptr);
1489 if (endptr)
1490 {
1491 while (*endptr && _is_white(*endptr))
1492 endptr++;
1493 if (*endptr == '%')
1494 {
1495 fmt->linerelsize = val / 100.0;
1496 fmt->linesize = 0;
1497 if (fmt->linerelsize < 0.0) fmt->linerelsize = 0.0;
1498 }
1499 }
1500 }
1501 else if (cmd == linegapstr)
1502 {
1503 fmt->linegap = atoi(tmp_param);
1504 fmt->linerelgap = 0.0;
1505 }
1506 else if (cmd == linerelgapstr)
1507 {
1508 char *endptr = NULL;
1509 double val = strtod(tmp_param, &endptr);
1510 if (endptr)
1511 {
1512 while (*endptr && _is_white(*endptr))
1513 endptr++;
1514 if (*endptr == '%')
1515 {
1516 fmt->linerelgap = val / 100.0;
1517 fmt->linegap = 0;
1518 if (fmt->linerelgap < 0.0) fmt->linerelgap = 0.0;
1519 }
1520 }
1521 }
1522 else if (cmd == itemstr)
1523 {
1524 // itemstr == replacement object items in textblock - inline imges
1525 // for example
1526 }
1527 else if (cmd == linefillstr)
1528 {
1529 char *endptr = NULL;
1530 double val = strtod(tmp_param, &endptr);
1531 if (endptr)
1532 {
1533 while (*endptr && _is_white(*endptr))
1534 endptr++;
1535 if (*endptr == '%')
1536 {
1537 fmt->linefill = val / 100.0;
1538 if (fmt->linefill < 0.0) fmt->linefill = 0.0;
1539 }
1540 }
1541 }
1542 else if (cmd == ellipsisstr)
1543 {
1544 char *endptr = NULL;
1545 fmt->ellipsis = strtod(tmp_param, &endptr);
1546 if ((fmt->ellipsis < 0.0) || (fmt->ellipsis > 1.0))
1547 fmt->ellipsis = -1.0;
1548 else
1549 {
1550 Evas_Object_Textblock *o;
1551
1552 o = (Evas_Object_Textblock *)(obj->object_data);
1553 o->have_ellipsis = 1;
1554 }
1555 }
1556 else if (cmd == passwordstr)
1557 {
1558 if (!strcmp(tmp_param, "off"))
1559 fmt->password = 0;
1560 else if (!strcmp(tmp_param, "on"))
1561 fmt->password = 1;
1562 }
1563 else if (cmd == underline_dash_widthstr)
1564 {
1565 fmt->underline_dash_width = atoi(tmp_param);
1566 if (fmt->underline_dash_width <= 0) fmt->underline_dash_width = 1;
1567 }
1568 else if (cmd == underline_dash_gapstr)
1569 {
1570 fmt->underline_dash_gap = atoi(tmp_param);
1571 if (fmt->underline_dash_gap <= 0) fmt->underline_dash_gap = 1;
1572 }
1573}
1574
1575/**
1576 * @internal
1577 * Returns #EINA_TRUE if the item is a format parameter, #EINA_FALSE otherwise.
1578 *
1579 * @param[in] item the item to check - Not NULL.
1580 */
1581static Eina_Bool
1582_format_is_param(const char *item)
1583{
1584 if (strchr(item, '=')) return EINA_TRUE;
1585 return EINA_FALSE;
1586}
1587
1588/**
1589 * @internal
1590 * Parse the format item and populate key and val with the stringshares that
1591 * corrospond to the formats parsed.
1592 * It expects item to be of the structure:
1593 * "key=val"
1594 *
1595 * @param[in] item the item to parse - Not NULL.
1596 * @param[out] key where to store the key at - Not NULL.
1597 * @param[out] val where to store the value at - Not NULL.
1598 */
1599static void
1600_format_param_parse(const char *item, const char **key, const char **val)
1601{
1602 const char *start, *end, *quote;
1603
1604 start = strchr(item, '=');
1605 *key = eina_stringshare_add_length(item, start - item);
1606 start++; /* Advance after the '=' */
1607 /* If we can find a quote, our new delimiter is a quote, not a space. */
1608 if ((quote = strchr(start, '\'')))
1609 {
1610 start = quote + 1;
1611 end = strchr(start, '\'');
1612 }
1613 else
1614 {
1615 end = strchr(start, ' ');
1616 }
1617
1618 /* Null terminate before the spaces */
1619 if (end)
1620 {
1621 *val = eina_stringshare_add_length(start, end - start);
1622 }
1623 else
1624 {
1625 *val = eina_stringshare_add(start);
1626 }
1627}
1628
1629/**
1630 * @internal
1631 * This function parses the format passed in *s and advances s to point to the
1632 * next format item, while returning the current one as the return value.
1633 * @param s The current and returned position in the format string.
1634 * @return the current item parsed from the string.
1635 */
1636static const char *
1637_format_parse(const char **s)
1638{
1639 const char *p;
1640 const char *s1 = NULL, *s2 = NULL;
1641 Eina_Bool quote = EINA_FALSE;;
1642
1643 p = *s;
1644 if (*p == 0) return NULL;
1645 for (;;)
1646 {
1647 if (!s1)
1648 {
1649 if (*p != ' ') s1 = p;
1650 if (*p == 0) break;
1651 }
1652 else if (!s2)
1653 {
1654 if (*p == '\'')
1655 {
1656 quote = !quote;
1657 }
1658
1659 if ((p > *s) && (p[-1] != '\\') && (!quote))
1660 {
1661 if (*p == ' ') s2 = p;
1662 }
1663 if (*p == 0) s2 = p;
1664 }
1665 p++;
1666 if (s1 && s2)
1667 {
1668 *s = s2;
1669 return s1;
1670 }
1671 }
1672 *s = p;
1673 return NULL;
1674}
1675
1676/**
1677 * @internal
1678 * Parse the format str and populate fmt with the formats found.
1679 *
1680 * @param obj The evas object - Not NULL.
1681 * @param[out] fmt The format to populate - Not NULL.
1682 * @param[in] str the string to parse.- Not NULL.
1683 */
1684static void
1685_format_fill(Evas_Object *obj, Evas_Object_Textblock_Format *fmt, const char *str)
1686{
1687 const char *s;
1688 const char *item;
1689
1690 s = str;
1691
1692 /* get rid of anything +s or -s off the start of the string */
1693 while ((*s == ' ') || (*s == '+') || (*s == '-')) s++;
1694
1695 while ((item = _format_parse(&s)))
1696 {
1697 if (_format_is_param(item))
1698 {
1699 const char *key = NULL, *val = NULL;
1700
1701 _format_param_parse(item, &key, &val);
1702 _format_command(obj, fmt, key, val);
1703 eina_stringshare_del(key);
1704 eina_stringshare_del(val);
1705 }
1706 else
1707 {
1708 /* immediate - not handled here */
1709 }
1710 }
1711}
1712
1713/**
1714 * @internal
1715 * Duplicate a format and return the duplicate.
1716 *
1717 * @param obj The evas object - Not NULL.
1718 * @param[in] fmt The format to duplicate - Not NULL.
1719 * @return the copy of the format.
1720 */
1721static Evas_Object_Textblock_Format *
1722_format_dup(Evas_Object *obj, const Evas_Object_Textblock_Format *fmt)
1723{
1724 Evas_Object_Textblock_Format *fmt2;
1725
1726 fmt2 = calloc(1, sizeof(Evas_Object_Textblock_Format));
1727 memcpy(fmt2, fmt, sizeof(Evas_Object_Textblock_Format));
1728 fmt2->ref = 1;
1729 fmt2->font.fdesc = evas_font_desc_ref(fmt->font.fdesc);
1730
1731 if (fmt->font.source) fmt2->font.source = eina_stringshare_add(fmt->font.source);
1732
1733 /* FIXME: just ref the font here... */
1734 fmt2->font.font = evas_font_load(obj->layer->evas, fmt2->font.fdesc,
1735 fmt2->font.source, (int)(((double) fmt2->font.size) * obj->cur.scale));
1736 return fmt2;
1737}
1738
1739
1740
1741
1742/**
1743 * @internal
1744 * @typedef Ctxt
1745 *
1746 * A pack of information that needed to be passed around in the layout engine,
1747 * packed for easier access.
1748 */
1749typedef struct _Ctxt Ctxt;
1750
1751struct _Ctxt
1752{
1753 Evas_Object *obj;
1754 Evas_Object_Textblock *o;
1755
1756 Evas_Object_Textblock_Paragraph *paragraphs;
1757 Evas_Object_Textblock_Paragraph *par;
1758 Evas_Object_Textblock_Line *ln;
1759
1760
1761 Eina_List *format_stack;
1762 Evas_Object_Textblock_Format *fmt;
1763
1764 int x, y;
1765 int w, h;
1766 int wmax, hmax;
1767 int maxascent, maxdescent;
1768 int marginl, marginr;
1769 int line_no;
1770 int underline_extend;
1771 int have_underline, have_underline2;
1772 double align, valign;
1773 Eina_Bool align_auto : 1;
1774 Eina_Bool width_changed : 1;
1775};
1776
1777static void _layout_text_add_logical_item(Ctxt *c, Evas_Object_Textblock_Text_Item *ti, Eina_List *rel);
1778static void _text_item_update_sizes(Ctxt *c, Evas_Object_Textblock_Text_Item *ti);
1779static void _layout_do_format(const Evas_Object *obj, Ctxt *c, Evas_Object_Textblock_Format **_fmt, Evas_Object_Textblock_Node_Format *n, int *style_pad_l, int *style_pad_r, int *style_pad_t, int *style_pad_b, Eina_Bool create_item);
1780/**
1781 * @internal
1782 * Adjust the ascent/descent of the format and context.
1783 *
1784 * @param maxascent The ascent to update - Not NUL.
1785 * @param maxdescent The descent to update - Not NUL.
1786 * @param fmt The format to adjust - NOT NULL.
1787 */
1788static void
1789_layout_format_ascent_descent_adjust(const Evas_Object *obj,
1790 Evas_Coord *maxascent, Evas_Coord *maxdescent,
1791 Evas_Object_Textblock_Format *fmt)
1792{
1793 int ascent, descent;
1794
1795 if (fmt->font.font)
1796 {
1797 // ascent = c->ENFN->font_max_ascent_get(c->ENDT, fmt->font.font);
1798 // descent = c->ENFN->font_max_descent_get(c->ENDT, fmt->font.font);
1799 ascent = ENFN->font_ascent_get(ENDT, fmt->font.font);
1800 descent = ENFN->font_descent_get(ENDT, fmt->font.font);
1801 if (fmt->linesize > 0)
1802 {
1803 if ((ascent + descent) < fmt->linesize)
1804 {
1805 ascent = ((fmt->linesize * ascent) / (ascent + descent));
1806 descent = fmt->linesize - ascent;
1807 }
1808 }
1809 else if (fmt->linerelsize > 0.0)
1810 {
1811 descent = descent * fmt->linerelsize;
1812 ascent = ascent * fmt->linerelsize;
1813 }
1814 descent += fmt->linegap;
1815 descent += ((ascent + descent) * fmt->linerelgap);
1816 if (*maxascent < ascent) *maxascent = ascent;
1817 if (*maxdescent < descent) *maxdescent = descent;
1818 if (fmt->linefill > 0.0)
1819 {
1820 int dh;
1821
1822 dh = obj->cur.geometry.h - (*maxascent + *maxdescent);
1823 if (dh < 0) dh = 0;
1824 dh = fmt->linefill * dh;
1825 *maxdescent += dh / 2;
1826 *maxascent += dh - (dh / 2);
1827 // FIXME: set flag that says "if heigh changes - reformat"
1828 }
1829 }
1830}
1831
1832/**
1833 * @internal
1834 * Create a new line using the info from the format and update the format
1835 * and context.
1836 *
1837 * @param c The context to work on - Not NULL.
1838 * @param fmt The format to use info from - NOT NULL.
1839 */
1840static void
1841_layout_line_new(Ctxt *c, Evas_Object_Textblock_Format *fmt)
1842{
1843 c->ln = calloc(1, sizeof(Evas_Object_Textblock_Line));
1844 c->align = fmt->halign;
1845 c->align_auto = fmt->halign_auto;
1846 c->marginl = fmt->margin.l;
1847 c->marginr = fmt->margin.r;
1848 c->par->lines = (Evas_Object_Textblock_Line *)eina_inlist_append(EINA_INLIST_GET(c->par->lines), EINA_INLIST_GET(c->ln));
1849 c->x = 0;
1850 c->maxascent = c->maxdescent = 0;
1851 c->ln->line_no = -1;
1852 c->ln->par = c->par;
1853}
1854
1855static inline Evas_Object_Textblock_Paragraph *
1856_layout_find_paragraph_by_y(Evas_Object_Textblock *o, Evas_Coord y)
1857{
1858 Evas_Object_Textblock_Paragraph *start, *par;
1859 int i;
1860
1861 start = o->paragraphs;
1862
1863 for (i = 0 ; i < TEXTBLOCK_PAR_INDEX_SIZE ; i++)
1864 {
1865 if (!o->par_index[i] || (o->par_index[i]->y > y))
1866 {
1867 break;
1868 }
1869 start = o->par_index[i];
1870 }
1871
1872 EINA_INLIST_FOREACH(start, par)
1873 {
1874 if ((par->y <= y) && (y < par->y + par->h))
1875 return par;
1876 }
1877
1878 return NULL;
1879}
1880
1881static inline Evas_Object_Textblock_Paragraph *
1882_layout_find_paragraph_by_line_no(Evas_Object_Textblock *o, int line_no)
1883{
1884 Evas_Object_Textblock_Paragraph *start, *par;
1885 int i;
1886
1887 start = o->paragraphs;
1888
1889 for (i = 0 ; i < TEXTBLOCK_PAR_INDEX_SIZE ; i++)
1890 {
1891 if (!o->par_index[i] || (o->par_index[i]->line_no > line_no))
1892 {
1893 break;
1894 }
1895 start = o->par_index[i];
1896 }
1897
1898 EINA_INLIST_FOREACH(start, par)
1899 {
1900 Evas_Object_Textblock_Paragraph *npar =
1901 (Evas_Object_Textblock_Paragraph *) EINA_INLIST_GET(par)->next;
1902 if ((par->line_no <= line_no) &&
1903 (!npar || (line_no < npar->line_no)))
1904 return par;
1905 }
1906
1907 return NULL;
1908}
1909/* End of rbtree index functios */
1910
1911/**
1912 * @internal
1913 * Create a new layout paragraph.
1914 * If c->par is not NULL, the paragraph is appended/prepended according
1915 * to the append parameter. If it is NULL, the paragraph is appended at
1916 * the end of the list.
1917 *
1918 * @param c The context to work on - Not NULL.
1919 * @param n the associated text node
1920 * @param append true to append, false to prpend.
1921 */
1922static void
1923_layout_paragraph_new(Ctxt *c, Evas_Object_Textblock_Node_Text *n,
1924 Eina_Bool append)
1925{
1926 Evas_Object_Textblock_Paragraph *rel_par = c->par;
1927 c->par = calloc(1, sizeof(Evas_Object_Textblock_Paragraph));
1928 if (append || !rel_par)
1929 c->paragraphs = (Evas_Object_Textblock_Paragraph *)
1930 eina_inlist_append_relative(EINA_INLIST_GET(c->paragraphs),
1931 EINA_INLIST_GET(c->par),
1932 EINA_INLIST_GET(rel_par));
1933 else
1934 c->paragraphs = (Evas_Object_Textblock_Paragraph *)
1935 eina_inlist_prepend_relative(EINA_INLIST_GET(c->paragraphs),
1936 EINA_INLIST_GET(c->par),
1937 EINA_INLIST_GET(rel_par));
1938
1939 c->ln = NULL;
1940 c->par->text_node = n;
1941 if (n)
1942 n->par = c->par;
1943 c->par->line_no = -1;
1944 c->par->visible = 1;
1945 c->o->num_paragraphs++;
1946}
1947
1948#ifdef BIDI_SUPPORT
1949/**
1950 * @internal
1951 * Update bidi paragraph props.
1952 *
1953 * @param par The paragraph to update
1954 */
1955static inline void
1956_layout_update_bidi_props(const Evas_Object_Textblock *o,
1957 Evas_Object_Textblock_Paragraph *par)
1958{
1959 if (par->text_node)
1960 {
1961 const Eina_Unicode *text;
1962 int *segment_idxs = NULL;
1963 text = eina_ustrbuf_string_get(par->text_node->unicode);
1964
1965 if (o->bidi_delimiters)
1966 segment_idxs = evas_bidi_segment_idxs_get(text, o->bidi_delimiters);
1967
1968 evas_bidi_paragraph_props_unref(par->bidi_props);
1969 par->bidi_props = evas_bidi_paragraph_props_get(text,
1970 eina_ustrbuf_length_get(par->text_node->unicode),
1971 segment_idxs);
1972 par->direction = EVAS_BIDI_PARAGRAPH_DIRECTION_IS_RTL(par->bidi_props) ?
1973 EVAS_BIDI_DIRECTION_RTL : EVAS_BIDI_DIRECTION_LTR;
1974 par->is_bidi = !!par->bidi_props;
1975 if (segment_idxs) free(segment_idxs);
1976 }
1977}
1978#endif
1979
1980
1981/**
1982 * @internal
1983 * Free the visual lines in the paragraph (logical items are kept)
1984 */
1985static void
1986_paragraph_clear(const Evas_Object *obj __UNUSED__,
1987 Evas_Object_Textblock_Paragraph *par)
1988{
1989 while (par->lines)
1990 {
1991 Evas_Object_Textblock_Line *ln;
1992
1993 ln = (Evas_Object_Textblock_Line *) par->lines;
1994 par->lines = (Evas_Object_Textblock_Line *)eina_inlist_remove(EINA_INLIST_GET(par->lines), EINA_INLIST_GET(par->lines));
1995 _line_free(ln);
1996 }
1997}
1998
1999/**
2000 * @internal
2001 * Free the layout paragraph and all of it's lines and logical items.
2002 */
2003static void
2004_paragraph_free(const Evas_Object *obj, Evas_Object_Textblock_Paragraph *par)
2005{
2006 Evas_Object_Textblock *o;
2007 o = (Evas_Object_Textblock *)(obj->object_data);
2008 _paragraph_clear(obj, par);
2009
2010 {
2011 Eina_List *i, *i_prev;
2012 Evas_Object_Textblock_Item *it;
2013 EINA_LIST_FOREACH_SAFE(par->logical_items, i, i_prev, it)
2014 {
2015 _item_free(obj, NULL, it);
2016 }
2017 eina_list_free(par->logical_items);
2018 }
2019#ifdef BIDI_SUPPORT
2020 if (par->bidi_props)
2021 evas_bidi_paragraph_props_unref(par->bidi_props);
2022#endif
2023 /* If we are the active par of the text node, set to NULL */
2024 if (par->text_node && (par->text_node->par == par))
2025 par->text_node->par = NULL;
2026
2027 o->num_paragraphs--;
2028
2029 free(par);
2030}
2031
2032/**
2033 * @internal
2034 * Clear all the paragraphs from the inlist pars.
2035 *
2036 * @param obj the evas object - Not NULL.
2037 * @param pars the paragraphs to clean - Not NULL.
2038 */
2039static void
2040_paragraphs_clear(const Evas_Object *obj, Evas_Object_Textblock_Paragraph *pars)
2041{
2042 Evas_Object_Textblock_Paragraph *par;
2043
2044 EINA_INLIST_FOREACH(EINA_INLIST_GET(pars), par)
2045 {
2046 _paragraph_clear(obj, par);
2047 }
2048}
2049
2050/**
2051 * @internal
2052 * Free the paragraphs from the inlist pars, the difference between this and
2053 * _paragraphs_clear is that the latter keeps the logical items and the par
2054 * items, while the former frees them as well.
2055 *
2056 * @param obj the evas object - Not NULL.
2057 * @param pars the paragraphs to clean - Not NULL.
2058 */
2059static void
2060_paragraphs_free(const Evas_Object *obj, Evas_Object_Textblock_Paragraph *pars)
2061{
2062 Evas_Object_Textblock *o;
2063 o = (Evas_Object_Textblock *)(obj->object_data);
2064
2065 o->num_paragraphs = 0;
2066
2067 while (pars)
2068 {
2069 Evas_Object_Textblock_Paragraph *par;
2070
2071 par = (Evas_Object_Textblock_Paragraph *) pars;
2072 pars = (Evas_Object_Textblock_Paragraph *)eina_inlist_remove(EINA_INLIST_GET(pars), EINA_INLIST_GET(par));
2073 _paragraph_free(obj, par);
2074 }
2075}
2076
2077/**
2078 * @internal
2079 * Push fmt to the format stack, if fmt is NULL, will fush a default item.
2080 *
2081 * @param c the context to work on - Not NULL.
2082 * @param fmt the format to push.
2083 * @see _layout_format_pop()
2084 */
2085static Evas_Object_Textblock_Format *
2086_layout_format_push(Ctxt *c, Evas_Object_Textblock_Format *fmt,
2087 Evas_Object_Textblock_Node_Format *fnode)
2088{
2089 if (fmt)
2090 {
2091 fmt = _format_dup(c->obj, fmt);
2092 c->format_stack = eina_list_prepend(c->format_stack, fmt);
2093 fmt->fnode = fnode;
2094 }
2095 else
2096 {
2097 fmt = calloc(1, sizeof(Evas_Object_Textblock_Format));
2098 c->format_stack = eina_list_prepend(c->format_stack, fmt);
2099 fmt->ref = 1;
2100 fmt->halign = 0.0;
2101 fmt->halign_auto = EINA_TRUE;
2102 fmt->valign = -1.0;
2103 fmt->style = EVAS_TEXT_STYLE_PLAIN;
2104 fmt->tabstops = 32;
2105 fmt->linesize = 0;
2106 fmt->linerelsize = 0.0;
2107 fmt->linegap = 0;
2108 fmt->underline_dash_width = 6;
2109 fmt->underline_dash_gap = 2;
2110 fmt->linerelgap = 0.0;
2111 fmt->password = 1;
2112 }
2113 return fmt;
2114}
2115
2116/**
2117 * @internal
2118 * Pop fmt to the format stack, if there's something in the stack free fmt
2119 * and set it to point to the next item instead, else return fmt.
2120 *
2121 * @param c the context to work on - Not NULL.
2122 * @param format - the text of the format to free (assured to start with '-').
2123 * @return the next format in the stack, or format if there's none.
2124 * @see _layout_format_push()
2125 */
2126static Evas_Object_Textblock_Format *
2127_layout_format_pop(Ctxt *c, const char *format)
2128{
2129 Evas_Object_Textblock_Format *fmt = eina_list_data_get(c->format_stack);
2130
2131 if ((c->format_stack) && (c->format_stack->next))
2132 {
2133 Eina_List *redo_nodes = NULL;
2134 format++; /* Skip the '-' */
2135
2136 /* Generic pop, should just pop. */
2137 if (((format[0] == ' ') && !format[1]) ||
2138 !format[0])
2139 {
2140 _format_unref_free(c->obj, fmt);
2141 c->format_stack =
2142 eina_list_remove_list(c->format_stack, c->format_stack);
2143 }
2144 else
2145 {
2146 size_t len = strlen(format);
2147 Eina_List *i, *i_next;
2148 /* Remove only the matching format. */
2149 EINA_LIST_FOREACH_SAFE(c->format_stack, i, i_next, fmt)
2150 {
2151 /* Stop when we reach the base item */
2152 if (!i_next)
2153 break;
2154
2155 c->format_stack =
2156 eina_list_remove_list(c->format_stack, c->format_stack);
2157
2158 /* Make sure the ending tag matches the starting tag.
2159 * I.e whole of the ending tag matches the start of the
2160 * starting tag, and the starting tag's next char is either
2161 * NULL or white. Skip the starting '+'. */
2162 if (_FORMAT_IS_CLOSER_OF(
2163 fmt->fnode->orig_format, format, len))
2164 {
2165 _format_unref_free(c->obj, fmt);
2166 break;
2167 }
2168 else
2169 {
2170 redo_nodes = eina_list_prepend(redo_nodes, fmt->fnode);
2171 _format_unref_free(c->obj, fmt);
2172 }
2173 }
2174 }
2175
2176 /* Redo all the nodes needed to be redone */
2177 {
2178 Evas_Object_Textblock_Node_Format *fnode;
2179 Eina_List *i, *i_next;
2180
2181 EINA_LIST_FOREACH_SAFE(redo_nodes, i, i_next, fnode)
2182 {
2183 /* FIXME: Actually do something with the new acquired padding,
2184 * the can be different and affect our padding! */
2185 Evas_Coord style_pad_l, style_pad_r, style_pad_t, style_pad_b;
2186 style_pad_l = style_pad_r = style_pad_t = style_pad_b = 0;
2187 redo_nodes = eina_list_remove_list(redo_nodes, i);
2188 fmt = eina_list_data_get(c->format_stack);
2189 _layout_do_format(c->obj, c, &fmt, fnode,
2190 &style_pad_l, &style_pad_r,
2191 &style_pad_t, &style_pad_b, EINA_FALSE);
2192 }
2193 }
2194
2195 fmt = eina_list_data_get(c->format_stack);
2196 }
2197 return fmt;
2198}
2199
2200/**
2201 * @internal
2202 * Parse item and fill fmt with the item.
2203 *
2204 * @param c the context to work on - Not NULL.
2205 * @param fmt the format to fill - not null.
2206 */
2207static void
2208_layout_format_value_handle(Ctxt *c, Evas_Object_Textblock_Format *fmt, const char *item)
2209{
2210 const char *key = NULL, *val = NULL;
2211
2212 _format_param_parse(item, &key, &val);
2213 if ((key) && (val)) _format_command(c->obj, fmt, key, val);
2214 if (key) eina_stringshare_del(key);
2215 if (val) eina_stringshare_del(val);
2216 c->align = fmt->halign;
2217 c->align_auto = fmt->halign_auto;
2218 c->marginl = fmt->margin.l;
2219 c->marginr = fmt->margin.r;
2220}
2221
2222#define VSIZE_FULL 0
2223#define VSIZE_ASCENT 1
2224
2225#define SIZE 0
2226#define SIZE_ABS 1
2227#define SIZE_REL 2
2228
2229/**
2230 * @internal
2231 * Get the current line's alignment from the context.
2232 *
2233 * @param c the context to work on - Not NULL.
2234 */
2235static inline double
2236_layout_line_align_get(Ctxt *c)
2237{
2238#ifdef BIDI_SUPPORT
2239 if (c->align_auto && c->ln)
2240 {
2241 if (c->ln->items && c->ln->items->text_node &&
2242 (c->ln->par->direction == EVAS_BIDI_DIRECTION_RTL))
2243 {
2244 /* Align right*/
2245 return 1.0;
2246 }
2247 else
2248 {
2249 /* Align left */
2250 return 0.0;
2251 }
2252 }
2253#endif
2254 return c->align;
2255}
2256
2257#ifdef BIDI_SUPPORT
2258/**
2259 * @internal
2260 * Reorder the items in visual order
2261 *
2262 * @param line the line to reorder
2263 */
2264static void
2265_layout_line_reorder(Evas_Object_Textblock_Line *line)
2266{
2267 /*FIXME: do it a bit more efficient - not very efficient ATM. */
2268 Evas_Object_Textblock_Item *it;
2269 EvasBiDiStrIndex *v_to_l = NULL;
2270 Evas_Coord x;
2271 size_t start, end;
2272 size_t len;
2273
2274 if (line->items && line->items->text_node &&
2275 line->par->bidi_props)
2276 {
2277 Evas_BiDi_Paragraph_Props *props;
2278 props = line->par->bidi_props;
2279 start = end = line->items->text_pos;
2280
2281 /* Find the first and last positions in the line */
2282
2283 EINA_INLIST_FOREACH(line->items, it)
2284 {
2285 if (it->text_pos < start)
2286 {
2287 start = it->text_pos;
2288 }
2289 else
2290 {
2291 int tlen;
2292 tlen = (it->type == EVAS_TEXTBLOCK_ITEM_TEXT) ?
2293 _ITEM_TEXT(it)->text_props.text_len : 1;
2294 if (it->text_pos + tlen > end)
2295 {
2296 end = it->text_pos + tlen;
2297 }
2298 }
2299 }
2300
2301 len = end - start;
2302 evas_bidi_props_reorder_line(NULL, start, len, props, &v_to_l);
2303
2304 /* Update visual pos */
2305 {
2306 Evas_Object_Textblock_Item *i;
2307 i = line->items;
2308 while (i)
2309 {
2310 i->visual_pos = evas_bidi_position_logical_to_visual(
2311 v_to_l, len, i->text_pos - start);
2312 i = (Evas_Object_Textblock_Item *) EINA_INLIST_GET(i)->next;
2313 }
2314 }
2315
2316 /*FIXME: not very efficient, sort the items arrays. Anyhow, should only
2317 * reorder if it's a bidi paragraph */
2318 {
2319 Evas_Object_Textblock_Item *i, *j, *min;
2320 i = line->items;
2321 while (i)
2322 {
2323 min = i;
2324 EINA_INLIST_FOREACH(i, j)
2325 {
2326 if (j->visual_pos < min->visual_pos)
2327 {
2328 min = j;
2329 }
2330 }
2331 if (min != i)
2332 {
2333 line->items = (Evas_Object_Textblock_Item *) eina_inlist_remove(EINA_INLIST_GET(line->items), EINA_INLIST_GET(min));
2334 line->items = (Evas_Object_Textblock_Item *) eina_inlist_prepend_relative(EINA_INLIST_GET(line->items), EINA_INLIST_GET(min), EINA_INLIST_GET(i));
2335 }
2336
2337 i = (Evas_Object_Textblock_Item *) EINA_INLIST_GET(min)->next;
2338 }
2339 }
2340 }
2341
2342 if (v_to_l) free(v_to_l);
2343 x = 0;
2344 EINA_INLIST_FOREACH(line->items, it)
2345 {
2346 it->x = x;
2347 x += it->adv;
2348 }
2349}
2350#endif
2351
2352/* FIXME: doc */
2353static void
2354_layout_calculate_format_item_size(const Evas_Object *obj,
2355 const Evas_Object_Textblock_Format_Item *fi,
2356 Evas_Coord *maxascent, Evas_Coord *maxdescent,
2357 Evas_Coord *_y, Evas_Coord *_w, Evas_Coord *_h)
2358{
2359 /* Adjust sizes according to current line height/scale */
2360 Evas_Coord w, h;
2361 const char *p, *s;
2362
2363 s = fi->item;
2364 w = fi->parent.w;
2365 h = fi->parent.h;
2366 switch (fi->size)
2367 {
2368 case SIZE:
2369 p = strstr(s, " size=");
2370 if (p)
2371 {
2372 p += 6;
2373 if (sscanf(p, "%ix%i", &w, &h) == 2)
2374 {
2375 w = w * obj->cur.scale;
2376 h = h * obj->cur.scale;
2377 }
2378 }
2379 break;
2380 case SIZE_REL:
2381 p = strstr((char *) s, " relsize=");
2382 p += 9;
2383 if (sscanf(p, "%ix%i", &w, &h) == 2)
2384 {
2385 int sz = 1;
2386 if (fi->vsize == VSIZE_FULL)
2387 {
2388 sz = *maxdescent + *maxascent;
2389 }
2390 else if (fi->vsize == VSIZE_ASCENT)
2391 {
2392 sz = *maxascent;
2393 }
2394 w = (w * sz) / h;
2395 h = sz;
2396 }
2397 break;
2398 case SIZE_ABS:
2399 /* Nothing to do */
2400 default:
2401 break;
2402 }
2403
2404 switch (fi->size)
2405 {
2406 case SIZE:
2407 case SIZE_ABS:
2408 switch (fi->vsize)
2409 {
2410 case VSIZE_FULL:
2411 if (h > (*maxdescent + *maxascent))
2412 {
2413 *maxascent += h - (*maxdescent + *maxascent);
2414 *_y = -*maxascent;
2415 }
2416 else
2417 *_y = -(h - *maxdescent);
2418 break;
2419 case VSIZE_ASCENT:
2420 if (h > *maxascent)
2421 {
2422 *maxascent = h;
2423 *_y = -h;
2424 }
2425 else
2426 *_y = -h;
2427 break;
2428 default:
2429 break;
2430 }
2431 break;
2432 case SIZE_REL:
2433 switch (fi->vsize)
2434 {
2435 case VSIZE_FULL:
2436 case VSIZE_ASCENT:
2437 *_y = -*maxascent;
2438 break;
2439 default:
2440 break;
2441 }
2442 break;
2443 default:
2444 break;
2445 }
2446
2447 *_w = w;
2448 *_h = h;
2449}
2450
2451/**
2452 * @internal
2453 * Order the items in the line, update it's properties and update it's
2454 * corresponding paragraph.
2455 *
2456 * @param c the context to work on - Not NULL.
2457 * @param fmt the format to use.
2458 * @param add_line true if we should create a line, false otherwise.
2459 */
2460static void
2461_layout_line_finalize(Ctxt *c, Evas_Object_Textblock_Format *fmt)
2462{
2463 Evas_Object_Textblock_Item *it;
2464 Evas_Coord x = 0;
2465
2466 /* If there are no text items yet, calc ascent/descent
2467 * according to the current format. */
2468 if (c->maxascent + c->maxdescent == 0)
2469 _layout_format_ascent_descent_adjust(c->obj, &c->maxascent,
2470 &c->maxdescent, fmt);
2471
2472 /* Adjust all the item sizes according to the final line size,
2473 * and update the x positions of all the items of the line. */
2474 EINA_INLIST_FOREACH(c->ln->items, it)
2475 {
2476 if (it->type == EVAS_TEXTBLOCK_ITEM_FORMAT)
2477 {
2478 Evas_Object_Textblock_Format_Item *fi = _ITEM_FORMAT(it);
2479 if (!fi->formatme) goto loop_advance;
2480 _layout_calculate_format_item_size(c->obj, fi, &c->maxascent,
2481 &c->maxdescent, &fi->y, &fi->parent.w, &fi->parent.h);
2482 fi->parent.adv = fi->parent.w;
2483 }
2484
2485loop_advance:
2486 it->x = x;
2487 x += it->adv;
2488
2489 if ((it->x + it->adv) > c->ln->w) c->ln->w = it->x + it->adv;
2490 }
2491
2492 c->ln->y = (c->y - c->par->y) + c->o->style_pad.t;
2493 c->ln->h = c->maxascent + c->maxdescent;
2494 c->ln->baseline = c->maxascent;
2495 if (c->have_underline2)
2496 {
2497 if (c->maxdescent < 4) c->underline_extend = 4 - c->maxdescent;
2498 }
2499 else if (c->have_underline)
2500 {
2501 if (c->maxdescent < 2) c->underline_extend = 2 - c->maxdescent;
2502 }
2503 c->ln->line_no = c->line_no - c->ln->par->line_no;
2504 c->line_no++;
2505 c->y += c->maxascent + c->maxdescent;
2506 if (c->w >= 0)
2507 {
2508 c->ln->x = c->marginl + c->o->style_pad.l +
2509 ((c->w - c->ln->w -
2510 c->o->style_pad.l - c->o->style_pad.r -
2511 c->marginl - c->marginr) * _layout_line_align_get(c));
2512 }
2513 else
2514 {
2515 c->ln->x = c->marginl + c->o->style_pad.l;
2516 }
2517
2518 c->par->h = c->ln->y + c->ln->h;
2519 if (c->ln->w > c->par->w)
2520 c->par->w = c->ln->w;
2521
2522 {
2523 Evas_Coord new_wmax = c->ln->w +
2524 c->marginl + c->marginr - (c->o->style_pad.l + c->o->style_pad.r);
2525 if (new_wmax > c->wmax)
2526 c->wmax = new_wmax;
2527 }
2528}
2529
2530/**
2531 * @internal
2532 * Create a new line and append it to the lines in the context.
2533 *
2534 * @param c the context to work on - Not NULL.
2535 * @param fmt the format to use.
2536 * @param add_line true if we should create a line, false otherwise.
2537 */
2538static void
2539_layout_line_advance(Ctxt *c, Evas_Object_Textblock_Format *fmt)
2540{
2541 _layout_line_finalize(c, fmt);
2542 _layout_line_new(c, fmt);
2543}
2544
2545/**
2546 * @internal
2547 * Create a new text layout item from the string and the format.
2548 *
2549 * @param c the context to work on - Not NULL.
2550 * @param fmt the format to use.
2551 * @param str the string to use.
2552 * @param len the length of the string.
2553 */
2554static Evas_Object_Textblock_Text_Item *
2555_layout_text_item_new(Ctxt *c __UNUSED__, Evas_Object_Textblock_Format *fmt)
2556{
2557 Evas_Object_Textblock_Text_Item *ti;
2558
2559 ti = calloc(1, sizeof(Evas_Object_Textblock_Text_Item));
2560 ti->parent.format = fmt;
2561 ti->parent.format->ref++;
2562 ti->parent.type = EVAS_TEXTBLOCK_ITEM_TEXT;
2563 return ti;
2564}
2565
2566/**
2567 * @internal
2568 * Return the cutoff of the text in the text item.
2569 *
2570 * @param c the context to work on - Not NULL.
2571 * @param fmt the format to use. - Not NULL.
2572 * @param it the item to check - Not null.
2573 * @return -1 if there is no cutoff (either because there is really none,
2574 * or because of an error), cutoff index on success.
2575 */
2576static int
2577_layout_text_cutoff_get(Ctxt *c, Evas_Object_Textblock_Format *fmt,
2578 const Evas_Object_Textblock_Text_Item *ti)
2579{
2580 if (fmt->font.font)
2581 {
2582 Evas_Coord x;
2583 x = c->w - c->o->style_pad.l - c->o->style_pad.r - c->marginl -
2584 c->marginr - c->x - ti->x_adjustment;
2585 if (x < 0)
2586 x = 0;
2587 return c->ENFN->font_last_up_to_pos(c->ENDT, fmt->font.font,
2588 &ti->text_props, x, 0);
2589 }
2590 return -1;
2591}
2592
2593/**
2594 * @internal
2595 * Split before cut, and strip if str[cut - 1] is a whitespace.
2596 *
2597 * @param c the context to work on - Not NULL.
2598 * @param ti the item to cut - not null.
2599 * @param lti the logical list item of the item.
2600 * @param cut the cut index.
2601 * @return the second (newly created) item.
2602 */
2603static Evas_Object_Textblock_Text_Item *
2604_layout_item_text_split_strip_white(Ctxt *c,
2605 Evas_Object_Textblock_Text_Item *ti, Eina_List *lti, size_t cut)
2606{
2607 const Eina_Unicode *ts;
2608 Evas_Object_Textblock_Text_Item *new_ti = NULL, *white_ti = NULL;
2609
2610 ts = GET_ITEM_TEXT(ti);
2611
2612 if (!IS_AT_END(ti, cut) && (ti->text_props.text_len > 0))
2613 {
2614 new_ti = _layout_text_item_new(c, ti->parent.format);
2615 new_ti->parent.text_node = ti->parent.text_node;
2616 new_ti->parent.text_pos = ti->parent.text_pos + cut;
2617 new_ti->parent.merge = EINA_TRUE;
2618
2619 evas_common_text_props_split(&ti->text_props,
2620 &new_ti->text_props, cut);
2621 _layout_text_add_logical_item(c, new_ti, lti);
2622 }
2623
2624 /* Strip the previous white if needed */
2625 if ((cut >= 1) && _is_white(ts[cut - 1]) && (ti->text_props.text_len > 0))
2626 {
2627 if (cut - 1 > 0)
2628 {
2629 size_t white_cut = cut - 1;
2630 white_ti = _layout_text_item_new(c, ti->parent.format);
2631 white_ti->parent.text_node = ti->parent.text_node;
2632 white_ti->parent.text_pos = ti->parent.text_pos + white_cut;
2633 white_ti->parent.merge = EINA_TRUE;
2634 white_ti->parent.visually_deleted = EINA_TRUE;
2635
2636 evas_common_text_props_split(&ti->text_props,
2637 &white_ti->text_props, white_cut);
2638 _layout_text_add_logical_item(c, white_ti, lti);
2639 }
2640 else
2641 {
2642 /* Mark this one as the visually deleted. */
2643 ti->parent.visually_deleted = EINA_TRUE;
2644 }
2645 }
2646
2647 if (new_ti || white_ti)
2648 {
2649 _text_item_update_sizes(c, ti);
2650 }
2651 return new_ti;
2652}
2653
2654/**
2655 * @internal
2656 * Merge item2 into item1 and free item2.
2657 *
2658 * @param c the context to work on - Not NULL.
2659 * @param item1 the item to copy to
2660 * @param item2 the item to copy from
2661 */
2662static void
2663_layout_item_merge_and_free(Ctxt *c,
2664 Evas_Object_Textblock_Text_Item *item1,
2665 Evas_Object_Textblock_Text_Item *item2)
2666{
2667 evas_common_text_props_merge(&item1->text_props,
2668 &item2->text_props);
2669
2670 _text_item_update_sizes(c, item1);
2671
2672 item1->parent.merge = EINA_FALSE;
2673 item1->parent.visually_deleted = EINA_FALSE;
2674
2675 _item_free(c->obj, NULL, _ITEM(item2));
2676}
2677
2678/**
2679 * @internal
2680 * Calculates an item's size.
2681 *
2682 * @param c the context
2683 * @param it the item itself.
2684 */
2685static void
2686_text_item_update_sizes(Ctxt *c, Evas_Object_Textblock_Text_Item *ti)
2687{
2688 int tw, th, inset, advw;
2689 const Evas_Object_Textblock_Format *fmt = ti->parent.format;
2690 int shad_sz = 0, shad_dst = 0, out_sz = 0;
2691 int dx = 0, minx = 0, maxx = 0, shx1, shx2;
2692
2693 tw = th = 0;
2694 if (fmt->font.font)
2695 c->ENFN->font_string_size_get(c->ENDT, fmt->font.font,
2696 &ti->text_props, &tw, &th);
2697 inset = 0;
2698 if (fmt->font.font)
2699 inset = c->ENFN->font_inset_get(c->ENDT, fmt->font.font,
2700 &ti->text_props);
2701 advw = 0;
2702 if (fmt->font.font)
2703 advw = c->ENFN->font_h_advance_get(c->ENDT, fmt->font.font,
2704 &ti->text_props);
2705
2706
2707 /* These adjustments are calculated and thus heavily linked to those in
2708 * textblock_render!!! Don't change one without the other. */
2709
2710 switch (ti->parent.format->style & EVAS_TEXT_STYLE_MASK_BASIC)
2711 {
2712 case EVAS_TEXT_STYLE_SHADOW:
2713 shad_dst = 1;
2714 break;
2715 case EVAS_TEXT_STYLE_OUTLINE_SHADOW:
2716 case EVAS_TEXT_STYLE_FAR_SHADOW:
2717 shad_dst = 2;
2718 out_sz = 1;
2719 break;
2720 case EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW:
2721 shad_dst = 1;
2722 shad_sz = 2;
2723 out_sz = 1;
2724 break;
2725 case EVAS_TEXT_STYLE_FAR_SOFT_SHADOW:
2726 shad_dst = 2;
2727 shad_sz = 2;
2728 break;
2729 case EVAS_TEXT_STYLE_SOFT_SHADOW:
2730 shad_dst = 1;
2731 shad_sz = 2;
2732 break;
2733 case EVAS_TEXT_STYLE_GLOW:
2734 case EVAS_TEXT_STYLE_SOFT_OUTLINE:
2735 out_sz = 2;
2736 break;
2737 case EVAS_TEXT_STYLE_OUTLINE:
2738 out_sz = 1;
2739 break;
2740 default:
2741 break;
2742 }
2743 switch (ti->parent.format->style & EVAS_TEXT_STYLE_MASK_SHADOW_DIRECTION)
2744 {
2745 case EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_LEFT:
2746 case EVAS_TEXT_STYLE_SHADOW_DIRECTION_LEFT:
2747 case EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP_LEFT:
2748 dx = -1;
2749 break;
2750 case EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_RIGHT:
2751 case EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP_RIGHT:
2752 case EVAS_TEXT_STYLE_SHADOW_DIRECTION_RIGHT:
2753 dx = 1;
2754 case EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP:
2755 case EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM:
2756 default:
2757 dx = 0;
2758 break;
2759 }
2760 minx = -out_sz;
2761 maxx = out_sz;
2762 shx1 = dx * shad_dst;
2763 shx1 -= shad_sz;
2764 shx2 = dx * shad_dst;
2765 shx2 += shad_sz;
2766 if (shx1 < minx) minx = shx1;
2767 if (shx2 > maxx) maxx = shx2;
2768 inset += -minx;
2769 ti->x_adjustment = maxx - minx;
2770
2771 ti->inset = inset;
2772 ti->parent.w = tw + ti->x_adjustment;
2773 ti->parent.h = th;
2774 ti->parent.adv = advw;
2775 ti->parent.x = 0;
2776}
2777
2778/**
2779 * @internal
2780 * Adds the item to the list, updates the item's properties (e.g, x,w,h)
2781 *
2782 * @param c the context
2783 * @param it the item itself.
2784 * @param rel item ti will be appened after, NULL = last.
2785 */
2786static void
2787_layout_text_add_logical_item(Ctxt *c, Evas_Object_Textblock_Text_Item *ti,
2788 Eina_List *rel)
2789{
2790 _text_item_update_sizes(c, ti);
2791
2792 c->par->logical_items = eina_list_append_relative_list(
2793 c->par->logical_items, ti, rel);
2794}
2795
2796/**
2797 * @internal
2798 * Appends the text from node n starting at start ending at off to the layout.
2799 * It uses the fmt for the formatting.
2800 *
2801 * @param c the current context- NOT NULL.
2802 * @param fmt the format to use.
2803 * @param n the text node. - Not null.
2804 * @param start the start position. - in range.
2805 * @param off the offset - start + offset in range. if offset is -1, it'll add everything to the end of the string if offset = 0 it'll return with doing nothing.
2806 * @param repch a replacement char to print instead of the original string, for example, * when working with passwords.
2807 */
2808static void
2809_layout_text_append(Ctxt *c, Evas_Object_Textblock_Format *fmt, Evas_Object_Textblock_Node_Text *n, int start, int off, const char *repch)
2810{
2811 const Eina_Unicode *str = EINA_UNICODE_EMPTY_STRING;
2812 const Eina_Unicode *tbase;
2813 Evas_Object_Textblock_Text_Item *ti;
2814 size_t cur_len = 0;
2815 Eina_Unicode urepch = 0;
2816
2817 /* prepare a working copy of the string, either filled by the repch or
2818 * filled with the true values */
2819 if (n)
2820 {
2821 int len;
2822 int orig_off = off;
2823
2824 /* Figure out if we want to bail, work with an empty string,
2825 * or continue with a slice of the passed string */
2826 len = eina_ustrbuf_length_get(n->unicode);
2827 if (off == 0) return;
2828 else if (off < 0) off = len - start;
2829
2830 if (start < 0)
2831 {
2832 start = 0;
2833 }
2834 else if ((start == 0) && (off == 0) && (orig_off == -1))
2835 {
2836 /* Special case that means that we need to add an empty
2837 * item */
2838 str = EINA_UNICODE_EMPTY_STRING;
2839 goto skip;
2840 }
2841 else if ((start >= len) || (start + off > len))
2842 {
2843 return;
2844 }
2845
2846 /* If we work with a replacement char, create a string which is the same
2847 * but with replacement chars instead of regular chars. */
2848 if ((fmt->password) && (repch) && (eina_ustrbuf_length_get(n->unicode)))
2849 {
2850 int i, ind;
2851 Eina_Unicode *ptr;
2852
2853 tbase = str = ptr = alloca((off + 1) * sizeof(Eina_Unicode));
2854 ind = 0;
2855 urepch = eina_unicode_utf8_get_next(repch, &ind);
2856 for (i = 0 ; i < off; ptr++, i++)
2857 *ptr = urepch;
2858 *ptr = 0;
2859 }
2860 /* Use the string, just cut the relevant parts */
2861 else
2862 {
2863 str = eina_ustrbuf_string_get(n->unicode) + start;
2864 }
2865
2866 cur_len = off;
2867 }
2868
2869skip:
2870 tbase = str;
2871
2872 /* If there's no parent text node, only create an empty item */
2873 if (!n)
2874 {
2875 ti = _layout_text_item_new(c, fmt);
2876 ti->parent.text_node = NULL;
2877 ti->parent.text_pos = 0;
2878 _layout_text_add_logical_item(c, ti, NULL);
2879
2880 return;
2881 }
2882
2883 while (cur_len > 0)
2884 {
2885 Evas_Font_Instance *script_fi = NULL;
2886 int script_len, tmp_cut;
2887 Evas_Script_Type script;
2888
2889 script_len = cur_len;
2890
2891 tmp_cut = evas_common_language_script_end_of_run_get(str,
2892 c->par->bidi_props, start + str - tbase, script_len);
2893 if (tmp_cut > 0)
2894 {
2895 script_len = tmp_cut;
2896 }
2897 cur_len -= script_len;
2898
2899 script = evas_common_language_script_type_get(str, script_len);
2900
2901
2902 while (script_len > 0)
2903 {
2904 Evas_Font_Instance *cur_fi = NULL;
2905 int run_len = script_len;
2906 ti = _layout_text_item_new(c, fmt);
2907 ti->parent.text_node = n;
2908 ti->parent.text_pos = start + str - tbase;
2909
2910 if (ti->parent.format->font.font)
2911 {
2912 run_len = c->ENFN->font_run_end_get(c->ENDT,
2913 ti->parent.format->font.font, &script_fi, &cur_fi,
2914 script, str, script_len);
2915 }
2916
2917 evas_common_text_props_bidi_set(&ti->text_props,
2918 c->par->bidi_props, ti->parent.text_pos);
2919 evas_common_text_props_script_set(&ti->text_props, script);
2920
2921 if (cur_fi)
2922 {
2923 c->ENFN->font_text_props_info_create(c->ENDT,
2924 cur_fi, str, &ti->text_props, c->par->bidi_props,
2925 ti->parent.text_pos, run_len);
2926 }
2927 str += run_len;
2928 script_len -= run_len;
2929
2930 _layout_text_add_logical_item(c, ti, NULL);
2931 }
2932 }
2933}
2934
2935/**
2936 * @internal
2937 * Add a format item from the format node n and the item item.
2938 *
2939 * @param c the current context- NOT NULL.
2940 * @param n the source format node - not null.
2941 * @param item the format text.
2942 *
2943 * @return the new format item.
2944 */
2945static Evas_Object_Textblock_Format_Item *
2946_layout_format_item_add(Ctxt *c, Evas_Object_Textblock_Node_Format *n, const char *item, Evas_Object_Textblock_Format *fmt)
2947{
2948 Evas_Object_Textblock_Format_Item *fi;
2949
2950 fi = calloc(1, sizeof(Evas_Object_Textblock_Format_Item));
2951 fi->item = eina_stringshare_add(item);
2952 fi->parent.type = EVAS_TEXTBLOCK_ITEM_FORMAT;
2953 fi->parent.format = fmt;
2954 fi->parent.format->ref++;
2955 c->par->logical_items = eina_list_append(c->par->logical_items, fi);
2956 if (n)
2957 {
2958 fi->parent.text_node = n->text_node;
2959 /* FIXME: make it more efficient */
2960 fi->parent.text_pos = _evas_textblock_node_format_pos_get(n);
2961#ifdef BIDI_SUPPORT
2962 fi->bidi_dir = (evas_bidi_is_rtl_char(
2963 c->par->bidi_props,
2964 0,
2965 fi->parent.text_pos)) ?
2966 EVAS_BIDI_DIRECTION_RTL : EVAS_BIDI_DIRECTION_LTR;
2967#else
2968 fi->bidi_dir = EVAS_BIDI_DIRECTION_LTR;
2969#endif
2970 }
2971 return fi;
2972}
2973
2974/**
2975 * @internal
2976 * Should be call after we finish filling a format.
2977 * FIXME: doc.
2978 */
2979static void
2980_format_finalize(Evas_Object *obj, Evas_Object_Textblock_Format *fmt)
2981{
2982 void *of;
2983
2984 of = fmt->font.font;
2985
2986 fmt->font.font = evas_font_load(obj->layer->evas, fmt->font.fdesc,
2987 fmt->font.source, (int)(((double) fmt->font.size) * obj->cur.scale));
2988 if (of) evas_font_free(obj->layer->evas, of);
2989}
2990
2991/**
2992 * @internal
2993 * Returns true if the item is a tab
2994 * @def _IS_TAB(item)
2995 */
2996#define _IS_TAB(item) \
2997 (!strcmp(item, "\t") || !strcmp(item, "\\t"))
2998/**
2999 * @internal
3000 * Returns true if the item is a line spearator, false otherwise
3001 * @def _IS_LINE_SEPARATOR(item)
3002 */
3003#define _IS_LINE_SEPARATOR(item) \
3004 (!strcmp(item, "\n") || !strcmp(item, "\\n"))
3005/**
3006 * @internal
3007 * Returns true if the item is a paragraph separator, false otherwise
3008 * @def _IS_PARAGRAPH_SEPARATOR(item)
3009 */
3010#define _IS_PARAGRAPH_SEPARATOR(o, item) \
3011 (!strcmp(item, "ps") || \
3012 (o->legacy_newline && _IS_LINE_SEPARATOR(item))) /* Paragraph separator */
3013
3014/**
3015 * @internal
3016 * Handles a format by processing a format node. It returns the relevant format
3017 * through _fmt and updates the padding through style_pad_*. If needed,
3018 * it creates a format item.
3019 *
3020 * @param obj the evas object - NOT NULL.
3021 * @param c the current context- NOT NULL.
3022 * @param _fmt the format that holds the result.
3023 * @param n the source format node - not null.
3024 * @param style_pad_l the pad to update.
3025 * @param style_pad_r the pad to update.
3026 * @param style_pad_t the pad to update.
3027 * @param style_pad_b the pad to update.
3028 * @param create_item Create a new format item if true, only process otherwise.
3029 */
3030static void
3031_layout_do_format(const Evas_Object *obj __UNUSED__, Ctxt *c,
3032 Evas_Object_Textblock_Format **_fmt, Evas_Object_Textblock_Node_Format *n,
3033 int *style_pad_l, int *style_pad_r, int *style_pad_t, int *style_pad_b,
3034 Eina_Bool create_item)
3035{
3036 Evas_Object_Textblock_Format *fmt = *_fmt;
3037 /* FIXME: comment the algo */
3038
3039 const char *s;
3040 const char *item;
3041 int handled = 0;
3042
3043 s = n->format;
3044 if (!strncmp(s, "+ item ", 7))
3045 {
3046 // one of:
3047 // item size=20x10 href=name
3048 // item relsize=20x10 href=name
3049 // item abssize=20x10 href=name
3050 //
3051 // optional arguments:
3052 // vsize=full
3053 // vsize=ascent
3054 //
3055 // size == item size (modifies line size) - can be multiplied by
3056 // scale factor
3057 // relsize == relative size (height is current font height, width
3058 // modified accordingly keeping aspect)
3059 // abssize == absolute size (modifies line size) - never mulitplied by
3060 // scale factor
3061 // href == name of item - to be found and matched later and used for
3062 // positioning
3063 Evas_Object_Textblock_Format_Item *fi;
3064 int w = 1, h = 1;
3065 int vsize = 0, size = 0;
3066 char *p;
3067
3068 // don't care
3069 //href = strstr(s, " href=");
3070 p = strstr(s, " vsize=");
3071 if (p)
3072 {
3073 p += 7;
3074 if (!strncmp(p, "full", 4)) vsize = VSIZE_FULL;
3075 else if (!strncmp(p, "ascent", 6)) vsize = VSIZE_ASCENT;
3076 }
3077 p = strstr(s, " size=");
3078 if (p)
3079 {
3080 p += 6;
3081 if (sscanf(p, "%ix%i", &w, &h) == 2)
3082 {
3083 /* this is handled somewhere else because it depends
3084 * on the current scaling factor of the object which
3085 * may change and break because the results of this
3086 * function are cached */
3087 size = SIZE;
3088 }
3089 }
3090 else
3091 {
3092 p = strstr(s, " absize=");
3093 if (p)
3094 {
3095 p += 8;
3096 if (sscanf(p, "%ix%i", &w, &h) == 2)
3097 {
3098 size = SIZE_ABS;
3099 }
3100 }
3101 else
3102 {
3103 p = strstr(s, " relsize=");
3104 if (p)
3105 {
3106 /* this is handled somewhere else because it depends
3107 * on the line it resides in, which is not defined
3108 * at this point and will change anyway, which will
3109 * break because the results of this function are
3110 * cached */
3111 size = SIZE_REL;
3112 }
3113 }
3114 }
3115
3116 if (create_item)
3117 {
3118 fi = _layout_format_item_add(c, n, s, fmt);
3119 fi->vsize = vsize;
3120 fi->size = size;
3121 fi->formatme = 1;
3122 /* For formats items it's usually
3123 the same, we don't handle the
3124 special cases yet. */
3125 fi->parent.w = fi->parent.adv = w;
3126 fi->parent.h = h;
3127 }
3128 /* Not sure if it's the best handling, but will do it for now. */
3129 fmt = _layout_format_push(c, fmt, n);
3130 handled = 1;
3131 }
3132
3133 if (!handled)
3134 {
3135 Eina_Bool push_fmt = EINA_FALSE;
3136 if (s[0] == '+')
3137 {
3138 fmt = _layout_format_push(c, fmt, n);
3139 s++;
3140 push_fmt = EINA_TRUE;
3141 }
3142 else if (s[0] == '-')
3143 {
3144 fmt = _layout_format_pop(c, n->orig_format);
3145 s++;
3146 }
3147 while ((item = _format_parse(&s)))
3148 {
3149 if (_format_is_param(item))
3150 {
3151 /* Only handle it if it's a push format, otherwise,
3152 * don't let overwrite the format stack.. */
3153 if (push_fmt)
3154 {
3155 _layout_format_value_handle(c, fmt, item);
3156 }
3157 }
3158 else if (create_item)
3159 {
3160 if ((_IS_PARAGRAPH_SEPARATOR(c->o, item)) ||
3161 (_IS_LINE_SEPARATOR(item)))
3162 {
3163 Evas_Object_Textblock_Format_Item *fi;
3164
3165 fi = _layout_format_item_add(c, n, item, fmt);
3166
3167 fi->parent.w = fi->parent.adv = 0;
3168 }
3169 else if ((!strcmp(item, "\t")) || (!strcmp(item, "\\t")))
3170 {
3171 Evas_Object_Textblock_Format_Item *fi;
3172
3173 fi = _layout_format_item_add(c, n, item, fmt);
3174 fi->parent.w = fi->parent.adv = fmt->tabstops;
3175 fi->formatme = 1;
3176 }
3177 }
3178 }
3179 _format_finalize(c->obj, fmt);
3180 }
3181
3182 {
3183 Evas_Coord pad_l, pad_r, pad_t, pad_b;
3184 pad_l = pad_r = pad_t = pad_b = 0;
3185 evas_text_style_pad_get(fmt->style, &pad_l, &pad_r, &pad_t, &pad_b);
3186 if (pad_l > *style_pad_l) *style_pad_l = pad_l;
3187 if (pad_r > *style_pad_r) *style_pad_r = pad_r;
3188 if (pad_t > *style_pad_t) *style_pad_t = pad_t;
3189 if (pad_b > *style_pad_b) *style_pad_b = pad_b;
3190 }
3191
3192 if (fmt->underline2)
3193 c->have_underline2 = 1;
3194 else if (fmt->underline || fmt->underline_dash)
3195 c->have_underline = 1;
3196 *_fmt = fmt;
3197}
3198
3199static void
3200_layout_update_par(Ctxt *c)
3201{
3202 Evas_Object_Textblock_Paragraph *last_par;
3203 last_par = (Evas_Object_Textblock_Paragraph *)
3204 EINA_INLIST_GET(c->par)->prev;
3205 if (last_par)
3206 {
3207 c->par->y = last_par->y + last_par->h;
3208 }
3209 else
3210 {
3211 c->par->y = 0;
3212 }
3213}
3214
3215/* -1 means no wrap */
3216static int
3217_layout_get_charwrap(Ctxt *c, Evas_Object_Textblock_Format *fmt,
3218 const Evas_Object_Textblock_Text_Item *ti, size_t line_start,
3219 const char *breaks)
3220{
3221 int wrap;
3222 size_t uwrap;
3223 size_t len = eina_ustrbuf_length_get(ti->parent.text_node->unicode);
3224 /* Currently not being used, because it doesn't contain relevant
3225 * information */
3226 (void) breaks;
3227
3228 {
3229 wrap = _layout_text_cutoff_get(c, fmt, ti);
3230 if (wrap < 0)
3231 return -1;
3232 uwrap = (size_t) wrap + ti->parent.text_pos;
3233 }
3234
3235
3236 if (uwrap == line_start)
3237 {
3238 uwrap = ti->parent.text_pos +
3239 (size_t) evas_common_text_props_cluster_next(&ti->text_props, wrap);
3240 }
3241 if ((uwrap <= line_start) || (uwrap > len))
3242 return -1;
3243
3244 return uwrap;
3245}
3246
3247/* -1 means no wrap */
3248#ifdef HAVE_LINEBREAK
3249
3250/* Allow break means: if we can break after the current char */
3251#define ALLOW_BREAK(i) \
3252 (breaks[i] <= LINEBREAK_ALLOWBREAK)
3253
3254#else
3255
3256#define ALLOW_BREAK(i) \
3257 (_is_white(str[i]))
3258
3259#endif
3260static int
3261_layout_get_word_mixwrap_common(Ctxt *c, Evas_Object_Textblock_Format *fmt,
3262 const Evas_Object_Textblock_Text_Item *ti, Eina_Bool mixed_wrap,
3263 size_t line_start, const char *breaks)
3264{
3265 Eina_Bool wrap_after = EINA_FALSE;
3266 size_t wrap;
3267 size_t orig_wrap;
3268 const Eina_Unicode *str = eina_ustrbuf_string_get(
3269 ti->parent.text_node->unicode);
3270 int item_start = ti->parent.text_pos;
3271 size_t len = eina_ustrbuf_length_get(ti->parent.text_node->unicode);
3272#ifndef HAVE_LINEBREAK
3273 /* Not used without liblinebreak ATM. */
3274 (void) breaks;
3275#endif
3276
3277 {
3278 int swrap = -1;
3279 swrap = _layout_text_cutoff_get(c, fmt, ti);
3280 /* Avoiding too small textblocks to even contain one char.
3281 * FIXME: This can cause breaking inside ligatures. */
3282
3283 if (swrap < 0)
3284 return -1;
3285
3286 orig_wrap = wrap = swrap + item_start;
3287 }
3288
3289 if (wrap > line_start)
3290 {
3291 /* The wrapping point found is the first char of the next string
3292 the rest works on the last char of the previous string.
3293 If it's a whitespace, then it's ok, and no need to go back
3294 because we'll remove it anyway. */
3295 if (!_is_white(str[wrap]))
3296 MOVE_PREV_UNTIL(line_start, wrap);
3297 /* If there's a breakable point inside the text, scan backwards until
3298 * we find it */
3299 while (wrap > line_start)
3300 {
3301 if (ALLOW_BREAK(wrap))
3302 break;
3303 wrap--;
3304 }
3305
3306 if ((wrap > line_start) ||
3307 ((wrap == line_start) && (ALLOW_BREAK(wrap)) && (wrap < len)))
3308 {
3309 /* We found a suitable wrapping point, break here. */
3310 MOVE_NEXT_UNTIL(len, wrap);
3311 return wrap;
3312 }
3313 else
3314 {
3315 if (mixed_wrap)
3316 {
3317 return ((orig_wrap >= line_start) && (orig_wrap < len)) ?
3318 ((int) orig_wrap) : -1;
3319 }
3320 else
3321 {
3322 /* Scan forward to find the next wrapping point */
3323 wrap = orig_wrap;
3324 wrap_after = EINA_TRUE;
3325 }
3326 }
3327 }
3328
3329 /* If we need to find the position after the cutting point */
3330 if ((wrap == line_start) || (wrap_after))
3331 {
3332 if (mixed_wrap)
3333 {
3334 return _layout_get_charwrap(c, fmt, ti,
3335 line_start, breaks);
3336 }
3337 else
3338 {
3339 while (wrap < len)
3340 {
3341 if (ALLOW_BREAK(wrap))
3342 break;
3343 wrap++;
3344 }
3345
3346
3347 if ((wrap < len) && (wrap > line_start))
3348 {
3349 MOVE_NEXT_UNTIL(len, wrap);
3350 return wrap;
3351 }
3352 else
3353 {
3354 return -1;
3355 }
3356 }
3357 }
3358
3359 return -1;
3360}
3361
3362/* -1 means no wrap */
3363static int
3364_layout_get_wordwrap(Ctxt *c, Evas_Object_Textblock_Format *fmt,
3365 const Evas_Object_Textblock_Text_Item *ti, size_t line_start,
3366 const char *breaks)
3367{
3368 return _layout_get_word_mixwrap_common(c, fmt, ti, EINA_FALSE, line_start,
3369 breaks);
3370}
3371
3372/* -1 means no wrap */
3373static int
3374_layout_get_mixedwrap(Ctxt *c, Evas_Object_Textblock_Format *fmt,
3375 const Evas_Object_Textblock_Text_Item *ti, size_t line_start,
3376 const char *breaks)
3377{
3378 return _layout_get_word_mixwrap_common(c, fmt, ti, EINA_TRUE, line_start,
3379 breaks);
3380}
3381
3382/* Should be moved inside _layout_ellipsis_item_new once we fix the hack in
3383 * textblock render */
3384static const Eina_Unicode _ellip_str[2] = { 0x2026, '\0' };
3385
3386static Evas_Object_Textblock_Text_Item *
3387_layout_ellipsis_item_new(Ctxt *c, const Evas_Object_Textblock_Item *cur_it)
3388{
3389 Evas_Object_Textblock_Text_Item *ellip_ti;
3390 Evas_Script_Type script;
3391 Evas_Font_Instance *script_fi = NULL, *cur_fi;
3392 size_t len = 1; /* The length of _ellip_str */
3393
3394 /* We can free it here, cause there's only one ellipsis item per tb. */
3395 if (c->o->ellip_ti) _item_free(c->obj, NULL, _ITEM(c->o->ellip_ti));
3396 c->o->ellip_ti = ellip_ti = _layout_text_item_new(c,
3397 eina_list_data_get(eina_list_last(c->format_stack)));
3398 ellip_ti->parent.text_node = cur_it->text_node;
3399 ellip_ti->parent.text_pos = cur_it->text_pos;
3400 script = evas_common_language_script_type_get(_ellip_str, len);
3401
3402 evas_common_text_props_bidi_set(&ellip_ti->text_props,
3403 c->par->bidi_props, ellip_ti->parent.text_pos);
3404 evas_common_text_props_script_set (&ellip_ti->text_props, script);
3405
3406 if (ellip_ti->parent.format->font.font)
3407 {
3408 /* It's only 1 char anyway, we don't need the run end. */
3409 (void) c->ENFN->font_run_end_get(c->ENDT,
3410 ellip_ti->parent.format->font.font, &script_fi, &cur_fi,
3411 script, _ellip_str, len);
3412
3413 c->ENFN->font_text_props_info_create(c->ENDT,
3414 cur_fi, _ellip_str, &ellip_ti->text_props,
3415 c->par->bidi_props, ellip_ti->parent.text_pos, len);
3416 }
3417
3418 _text_item_update_sizes(c, ellip_ti);
3419
3420 if (cur_it->type == EVAS_TEXTBLOCK_ITEM_TEXT)
3421 {
3422 ellip_ti->parent.text_pos += _ITEM_TEXT(cur_it)->text_props.text_len
3423 - 1;
3424 }
3425 else
3426 {
3427 ellip_ti->parent.text_pos++;
3428 }
3429
3430 return ellip_ti;
3431}
3432
3433/**
3434 * @internel
3435 * Handle ellipsis
3436 */
3437static inline void
3438_layout_handle_ellipsis(Ctxt *c, Evas_Object_Textblock_Item *it, Eina_List *i)
3439{
3440 Evas_Object_Textblock_Text_Item *ellip_ti;
3441 Evas_Object_Textblock_Item *last_it;
3442 Evas_Coord save_cx;
3443 int wrap;
3444 ellip_ti = _layout_ellipsis_item_new(c, it);
3445 last_it = it;
3446
3447 save_cx = c->x;
3448 c->w -= ellip_ti->parent.w;
3449
3450 if (it->type == EVAS_TEXTBLOCK_ITEM_TEXT)
3451 {
3452 Evas_Object_Textblock_Text_Item *ti = _ITEM_TEXT(it);
3453
3454 wrap = _layout_text_cutoff_get(c, last_it->format, ti);
3455 if ((wrap > 0) && !IS_AT_END(ti, (size_t) wrap))
3456 {
3457 _layout_item_text_split_strip_white(c, ti, i, wrap);
3458 }
3459 else if ((wrap == 0) && (c->ln->items))
3460 {
3461 last_it = _ITEM(EINA_INLIST_GET(c->ln->items)->last);
3462 }
3463 }
3464 else if (it->type == EVAS_TEXTBLOCK_ITEM_FORMAT)
3465 {
3466 /* We don't want to add this format item. */
3467 last_it = NULL;
3468 }
3469
3470 c->x = save_cx;
3471 c->w += ellip_ti->parent.w;
3472 /* If we should add this item, do it */
3473 if (last_it == it)
3474 {
3475 c->ln->items = (Evas_Object_Textblock_Item *)
3476 eina_inlist_append(EINA_INLIST_GET(c->ln->items),
3477 EINA_INLIST_GET(it));
3478 if (it->type == EVAS_TEXTBLOCK_ITEM_FORMAT)
3479 {
3480 Evas_Object_Textblock_Format_Item *fi;
3481 fi = _ITEM_FORMAT(it);
3482 fi->y = c->y;
3483 }
3484 }
3485 c->ln->items = (Evas_Object_Textblock_Item *)
3486 eina_inlist_append(EINA_INLIST_GET(c->ln->items),
3487 EINA_INLIST_GET(_ITEM(ellip_ti)));
3488 _layout_line_finalize(c, ellip_ti->parent.format);
3489}
3490
3491#ifdef BIDI_SUPPORT
3492static void
3493_layout_paragraph_reorder_lines(Evas_Object_Textblock_Paragraph *par)
3494{
3495 Evas_Object_Textblock_Line *ln;
3496
3497 EINA_INLIST_FOREACH(EINA_INLIST_GET(par->lines), ln)
3498 {
3499 _layout_line_reorder(ln);
3500 }
3501}
3502#endif
3503
3504static void
3505_layout_paragraph_render(Evas_Object_Textblock *o,
3506 Evas_Object_Textblock_Paragraph *par)
3507{
3508 if (par->rendered)
3509 return;
3510 par->rendered = EINA_TRUE;
3511
3512#ifdef BIDI_SUPPORT
3513 if (par->is_bidi)
3514 {
3515 _layout_update_bidi_props(o, par);
3516 _layout_paragraph_reorder_lines(par);
3517 /* Clear the bidi props because we don't need them anymore. */
3518 if (par->bidi_props)
3519 {
3520 evas_bidi_paragraph_props_unref(par->bidi_props);
3521 par->bidi_props = NULL;
3522 }
3523 }
3524#endif
3525}
3526
3527/* 0 means go ahead, 1 means break without an error, 2 means
3528 * break with an error, should probably clean this a bit (enum/macro)
3529 * FIXME ^ */
3530static int
3531_layout_par(Ctxt *c)
3532{
3533 Evas_Object_Textblock_Item *it;
3534 Eina_List *i;
3535 int ret = 0;
3536 int wrap = -1;
3537 char *line_breaks = NULL;
3538
3539 if (!c->par->logical_items)
3540 return 2;
3541
3542 /* We want to show it. */
3543 c->par->visible = 1;
3544
3545 /* Check if we need to skip this paragraph because it's already layouted
3546 * correctly, and mark handled nodes as dirty. */
3547 c->par->line_no = c->line_no;
3548
3549 if (c->par->text_node)
3550 {
3551 /* Skip this paragraph if width is the same, there is no ellipsis
3552 * and we aren't just calculating. */
3553 if (!c->par->text_node->is_new && !c->par->text_node->dirty &&
3554 !c->width_changed && c->par->lines &&
3555 !c->o->have_ellipsis)
3556 {
3557 Evas_Object_Textblock_Line *ln;
3558 /* Update c->line_no */
3559 ln = (Evas_Object_Textblock_Line *)
3560 EINA_INLIST_GET(c->par->lines)->last;
3561 if (ln)
3562 c->line_no = c->par->line_no + ln->line_no + 1;
3563 return 0;
3564 }
3565 c->par->text_node->dirty = EINA_FALSE;
3566 c->par->text_node->is_new = EINA_FALSE;
3567 c->par->rendered = EINA_FALSE;
3568
3569 /* Merge back and clear the paragraph */
3570 {
3571 Eina_List *itr, *itr_next;
3572 Evas_Object_Textblock_Item *ititr, *prev_it = NULL;
3573 _paragraph_clear(c->obj, c->par);
3574 EINA_LIST_FOREACH_SAFE(c->par->logical_items, itr, itr_next, ititr)
3575 {
3576 if (ititr->merge && prev_it &&
3577 (prev_it->type == EVAS_TEXTBLOCK_ITEM_TEXT) &&
3578 (ititr->type == EVAS_TEXTBLOCK_ITEM_TEXT))
3579 {
3580 _layout_item_merge_and_free(c, _ITEM_TEXT(prev_it),
3581 _ITEM_TEXT(ititr));
3582 c->par->logical_items =
3583 eina_list_remove_list(c->par->logical_items, itr);
3584 }
3585 else
3586 {
3587 prev_it = ititr;
3588 }
3589 }
3590 }
3591 }
3592
3593 c->y = c->par->y;
3594
3595 it = _ITEM(eina_list_data_get(c->par->logical_items));
3596 _layout_line_new(c, it->format);
3597 /* We walk on our own because we want to be able to add items from
3598 * inside the list and then walk them on the next iteration. */
3599 for (i = c->par->logical_items ; i ; )
3600 {
3601 int adv_line = 0;
3602 int redo_item = 0;
3603 it = _ITEM(eina_list_data_get(i));
3604 /* Skip visually deleted items */
3605 if (it->visually_deleted)
3606 {
3607 i = eina_list_next(i);
3608 continue;
3609 }
3610
3611 if (it->type == EVAS_TEXTBLOCK_ITEM_TEXT)
3612 {
3613 Evas_Object_Textblock_Text_Item *ti = _ITEM_TEXT(it);
3614 _layout_format_ascent_descent_adjust(c->obj, &c->maxascent,
3615 &c->maxdescent, ti->parent.format);
3616 }
3617 else
3618 {
3619 Evas_Object_Textblock_Format_Item *fi = _ITEM_FORMAT(it);
3620 if (fi->formatme)
3621 {
3622 /* If there are no text items yet, calc ascent/descent
3623 * according to the current format. */
3624 if (c->maxascent + c->maxdescent == 0)
3625 _layout_format_ascent_descent_adjust(c->obj, &c->maxascent,
3626 &c->maxdescent, it->format);
3627
3628 _layout_calculate_format_item_size(c->obj, fi, &c->maxascent,
3629 &c->maxdescent, &fi->y, &fi->parent.w, &fi->parent.h);
3630 fi->parent.adv = fi->parent.w;
3631 }
3632 }
3633
3634
3635 /* Check if we need to wrap, i.e the text is bigger than the width,
3636 or we already found a wrap point. */
3637 if ((c->w >= 0) &&
3638 (((c->x + it->adv) >
3639 (c->w - c->o->style_pad.l - c->o->style_pad.r -
3640 c->marginl - c->marginr)) || (wrap > 0)))
3641 {
3642 /* Handle ellipsis here. If we don't have more width left
3643 * and no height left, or no more width left and no wrapping. */
3644 if ((it->format->ellipsis == 1.0) && (c->h >= 0) &&
3645 ((2 * it->h + c->y >
3646 c->h - c->o->style_pad.t - c->o->style_pad.b) ||
3647 (!it->format->wrap_word && !it->format->wrap_char &&
3648 !it->format->wrap_mixed)))
3649 {
3650 _layout_handle_ellipsis(c, it, i);
3651 ret = 1;
3652 goto end;
3653 }
3654 /* If we want to wrap and it's worth checking for wrapping
3655 * (i.e there's actually text). */
3656 else if ((it->format->wrap_word || it->format->wrap_char ||
3657 it->format->wrap_mixed) && it->text_node)
3658 {
3659 if (it->type == EVAS_TEXTBLOCK_ITEM_FORMAT)
3660 {
3661 /* Don't wrap if it's the only item */
3662 if (c->ln->items)
3663 {
3664 /*FIXME: I should handle format correctly,
3665 i.e verify we are allowed to break here */
3666 _layout_line_advance(c, it->format);
3667 wrap = -1;
3668 }
3669 }
3670 else
3671 {
3672 Evas_Object_Textblock_Text_Item *ti = _ITEM_TEXT(it);
3673 size_t line_start;
3674
3675#ifdef HAVE_LINEBREAK
3676 /* If we haven't calculated the linebreaks yet,
3677 * do */
3678 if (!line_breaks)
3679 {
3680 /* Only relevant in those cases */
3681 if (it->format->wrap_word || it->format->wrap_mixed)
3682 {
3683 const char *lang;
3684 lang = (it->format->font.fdesc) ?
3685 it->format->font.fdesc->lang : "";
3686 size_t len =
3687 eina_ustrbuf_length_get(
3688 it->text_node->unicode);
3689 line_breaks = malloc(len);
3690 set_linebreaks_utf32((const utf32_t *)
3691 eina_ustrbuf_string_get(
3692 it->text_node->unicode),
3693 len, lang, line_breaks);
3694 }
3695 }
3696#endif
3697 if (c->ln->items)
3698 line_start = c->ln->items->text_pos;
3699 else
3700 line_start = ti->parent.text_pos;
3701
3702 adv_line = 1;
3703 /* If we don't already have a wrap point from before */
3704 if (wrap < 0)
3705 {
3706 if (it->format->wrap_word)
3707 wrap = _layout_get_wordwrap(c, it->format, ti,
3708 line_start, line_breaks);
3709 else if (it->format->wrap_char)
3710 wrap = _layout_get_charwrap(c, it->format, ti,
3711 line_start, line_breaks);
3712 else if (it->format->wrap_mixed)
3713 wrap = _layout_get_mixedwrap(c, it->format, ti,
3714 line_start, line_breaks);
3715 else
3716 wrap = -1;
3717 }
3718
3719 /* If it's before the item, rollback and apply.
3720 if it's in the item, cut.
3721 If it's after the item, delay the cut */
3722 if (wrap > 0)
3723 {
3724 size_t uwrap = (size_t) wrap;
3725 if (uwrap < ti->parent.text_pos)
3726 {
3727 /* Rollback latest additions, and cut that
3728 item */
3729 i = eina_list_prev(i);
3730 it = eina_list_data_get(i);
3731 while (uwrap < it->text_pos)
3732 {
3733 c->ln->items = _ITEM(
3734 eina_inlist_remove(
3735 EINA_INLIST_GET(c->ln->items),
3736 EINA_INLIST_GET(it)));
3737 i = eina_list_prev(i);
3738 it = eina_list_data_get(i);
3739 }
3740 c->x = it->x;
3741 c->ln->items = _ITEM(
3742 eina_inlist_remove(
3743 EINA_INLIST_GET(c->ln->items),
3744 EINA_INLIST_GET(it)));
3745 continue;
3746 }
3747 /* If it points to the end, it means the previous
3748 * char is a whitespace we should remove, so this
3749 * is a wanted cutting point. */
3750 else if (uwrap > ti->parent.text_pos +
3751 ti->text_props.text_len)
3752 wrap = -1; /* Delay the cut in a smart way
3753 i.e use the item_pos as the line_start, because
3754 there's already no cut before*/
3755 else
3756 wrap -= ti->parent.text_pos; /* Cut here */
3757 }
3758
3759 if (wrap > 0)
3760 {
3761 _layout_item_text_split_strip_white(c, ti, i, wrap);
3762 }
3763 else if (wrap == 0)
3764 {
3765 /* Should wrap before the item */
3766 adv_line = 0;
3767 redo_item = 1;
3768 _layout_line_advance(c, it->format);
3769 }
3770 /* Reset wrap */
3771 wrap = -1;
3772 }
3773 }
3774 }
3775
3776 if (!redo_item && !it->visually_deleted)
3777 {
3778 c->ln->items = (Evas_Object_Textblock_Item *)
3779 eina_inlist_append(EINA_INLIST_GET(c->ln->items),
3780 EINA_INLIST_GET(it));
3781 if (it->type == EVAS_TEXTBLOCK_ITEM_FORMAT)
3782 {
3783 Evas_Object_Textblock_Format_Item *fi;
3784 fi = _ITEM_FORMAT(it);
3785 fi->y = c->y;
3786 /* If it's a newline, and we are not in newline compat
3787 * mode, or we are in newline compat mode, and this is
3788 * not used as a paragraph separator, advance */
3789 if (fi->item && _IS_LINE_SEPARATOR(fi->item) &&
3790 (!c->o->legacy_newline ||
3791 eina_list_next(i)))
3792 {
3793 adv_line = 1;
3794 }
3795 }
3796 c->x += it->adv;
3797 i = eina_list_next(i);
3798 }
3799 if (adv_line)
3800 {
3801 /* Each line is according to the first item in it, and here
3802 * i is already the next item (or the current if we redo it) */
3803 if (i)
3804 {
3805 it = _ITEM(eina_list_data_get(i));
3806 }
3807 _layout_line_advance(c, it->format);
3808 }
3809 }
3810 if (c->ln->items)
3811 {
3812 /* Here 'it' is the last format used */
3813 _layout_line_finalize(c, it->format);
3814 }
3815
3816end:
3817#ifdef HAVE_LINEBREAK
3818 if (line_breaks)
3819 free(line_breaks);
3820#endif
3821
3822 return ret;
3823}
3824
3825/**
3826 * @internal
3827 * Invalidate text nodes according to format changes
3828 * This goes through all the new format changes and marks the text nodes
3829 * that should be invalidated because of format changes.
3830 *
3831 * @param c the working context.
3832 */
3833static inline void
3834_format_changes_invalidate_text_nodes(Ctxt *c)
3835{
3836 Evas_Object_Textblock_Node_Format *fnode = c->o->format_nodes;
3837 Evas_Object_Textblock_Node_Text *start_n = NULL;
3838 Eina_List *fstack = NULL;
3839 int balance = 0;
3840 while (fnode)
3841 {
3842 if (fnode->is_new)
3843 {
3844 const char *fstr = fnode->orig_format;
3845 /* balance < 0 means we gave up and everything should be
3846 * invalidated */
3847 if (*fstr == '+')
3848 {
3849 balance++;
3850 if (!fstack)
3851 start_n = fnode->text_node;
3852 fstack = eina_list_prepend(fstack, fnode);
3853 }
3854 else if (*fstr == '-')
3855 {
3856 size_t fstr_len;
3857 /* Skip the '-' */
3858 fstr++;
3859 fstr_len = strlen(fstr);
3860 /* Generic popper, just pop */
3861 if (((fstr[0] == ' ') && !fstr[1]) || !fstr[0])
3862 {
3863 fstack = eina_list_remove_list(fstack, fstack);
3864 balance--;
3865 }
3866 /* Find the matching format and pop it, if the matching format
3867 * is out format, i.e the last one, pop and break. */
3868 else
3869 {
3870 Eina_List *i;
3871 Evas_Object_Textblock_Node_Format *fnode2;
3872 EINA_LIST_FOREACH(fstack, i, fnode2)
3873 {
3874 if (_FORMAT_IS_CLOSER_OF(
3875 fnode2->orig_format, fstr, fstr_len))
3876 {
3877 fstack = eina_list_remove_list(fstack, i);
3878 break;
3879 }
3880 }
3881 balance--;
3882 }
3883
3884 if (!fstack)
3885 {
3886 Evas_Object_Textblock_Node_Text *f_tnode =
3887 fnode->text_node;
3888 while (start_n)
3889 {
3890 start_n->dirty = EINA_TRUE;
3891 if (start_n == f_tnode)
3892 break;
3893 start_n =
3894 _NODE_TEXT(EINA_INLIST_GET(start_n)->next);
3895 }
3896 start_n = NULL;
3897 }
3898 }
3899 else if (!fnode->visible)
3900 balance = -1;
3901
3902 if (balance < 0)
3903 {
3904 /* if we don't already have a starting point, use the
3905 * current paragraph. */
3906 if (!start_n)
3907 start_n = fnode->text_node;
3908 break;
3909 }
3910 }
3911 fnode = _NODE_FORMAT(EINA_INLIST_GET(fnode)->next);
3912 }
3913
3914 if (balance != 0)
3915 {
3916 while (start_n)
3917 {
3918 start_n->dirty = EINA_TRUE;
3919 start_n = _NODE_TEXT(EINA_INLIST_GET(start_n)->next);
3920 }
3921 }
3922}
3923
3924
3925/** FIXME: Document */
3926static void
3927_layout_pre(Ctxt *c, int *style_pad_l, int *style_pad_r, int *style_pad_t,
3928 int *style_pad_b)
3929{
3930 Evas_Object *obj = c->obj;
3931 Evas_Object_Textblock *o = c->o;
3932 /* Mark text nodes as dirty if format have changed. */
3933 if (c->o->format_changed)
3934 {
3935 _format_changes_invalidate_text_nodes(c);
3936 }
3937
3938 if (o->content_changed)
3939 {
3940 Evas_Object_Textblock_Node_Text *n;
3941 c->o->have_ellipsis = 0;
3942 c->par = c->paragraphs = o->paragraphs;
3943 /* Go through all the text nodes to create the logical layout */
3944 EINA_INLIST_FOREACH(c->o->text_nodes, n)
3945 {
3946 Evas_Object_Textblock_Node_Format *fnode;
3947 size_t start;
3948 int off;
3949
3950 /* If it's not a new paragraph, either update it or skip it.
3951 * Remove all the paragraphs that were deleted */
3952 if (!n->is_new)
3953 {
3954 /* Remove all the deleted paragraphs at this point */
3955 while (c->par->text_node != n)
3956 {
3957 Evas_Object_Textblock_Paragraph *tmp_par =
3958 (Evas_Object_Textblock_Paragraph *)
3959 EINA_INLIST_GET(c->par)->next;
3960
3961 c->paragraphs = (Evas_Object_Textblock_Paragraph *)
3962 eina_inlist_remove(EINA_INLIST_GET(c->paragraphs),
3963 EINA_INLIST_GET(c->par));
3964 _paragraph_free(obj, c->par);
3965
3966 c->par = tmp_par;
3967 }
3968
3969 /* If it's dirty, remove and recreate, if it's clean,
3970 * skip to the next. */
3971 if (n->dirty)
3972 {
3973 Evas_Object_Textblock_Paragraph *prev_par = c->par;
3974
3975 _layout_paragraph_new(c, n, EINA_TRUE);
3976
3977 c->paragraphs = (Evas_Object_Textblock_Paragraph *)
3978 eina_inlist_remove(EINA_INLIST_GET(c->paragraphs),
3979 EINA_INLIST_GET(prev_par));
3980 _paragraph_free(obj, prev_par);
3981 }
3982 else
3983 {
3984 c->par = (Evas_Object_Textblock_Paragraph *)
3985 EINA_INLIST_GET(c->par)->next;
3986
3987 /* Update the format stack according to the node's
3988 * formats */
3989 fnode = n->format_node;
3990 while (fnode && (fnode->text_node == n))
3991 {
3992 /* Only do this if this actually changes format */
3993 if (fnode->format_change)
3994 _layout_do_format(obj, c, &c->fmt, fnode,
3995 style_pad_l, style_pad_r,
3996 style_pad_t, style_pad_b, EINA_FALSE);
3997 fnode = _NODE_FORMAT(EINA_INLIST_GET(fnode)->next);
3998 }
3999 continue;
4000 }
4001 }
4002 else
4003 {
4004 /* If it's a new paragraph, just add it. */
4005 _layout_paragraph_new(c, n, EINA_FALSE);
4006 }
4007
4008#ifdef BIDI_SUPPORT
4009 _layout_update_bidi_props(c->o, c->par);
4010#endif
4011
4012 /* For each text node to thorugh all of it's format nodes
4013 * append text from the start to the offset of the next format
4014 * using the last format got. if needed it also creates format
4015 * items this is the core algorithm of the layout mechanism.
4016 * Skip the unicode replacement chars when there are because
4017 * we don't want to print them. */
4018 fnode = n->format_node;
4019 start = off = 0;
4020 while (fnode && (fnode->text_node == n))
4021 {
4022 off += fnode->offset;
4023 /* No need to skip on the first run, or a non-visible one */
4024 _layout_text_append(c, c->fmt, n, start, off, o->repch);
4025 _layout_do_format(obj, c, &c->fmt, fnode, style_pad_l,
4026 style_pad_r, style_pad_t, style_pad_b, EINA_TRUE);
4027 if ((c->have_underline2) || (c->have_underline))
4028 {
4029 if (*style_pad_b < c->underline_extend)
4030 *style_pad_b = c->underline_extend;
4031 c->have_underline = 0;
4032 c->have_underline2 = 0;
4033 c->underline_extend = 0;
4034 }
4035 start += off;
4036 if (fnode->visible)
4037 {
4038 off = -1;
4039 start++;
4040 }
4041 else
4042 {
4043 off = 0;
4044 }
4045 fnode->is_new = EINA_FALSE;
4046 fnode = _NODE_FORMAT(EINA_INLIST_GET(fnode)->next);
4047 }
4048 _layout_text_append(c, c->fmt, n, start, -1, o->repch);
4049#ifdef BIDI_SUPPORT
4050 /* Clear the bidi props because we don't need them anymore. */
4051 if (c->par->bidi_props)
4052 {
4053 evas_bidi_paragraph_props_unref(c->par->bidi_props);
4054 c->par->bidi_props = NULL;
4055 }
4056#endif
4057 c->par = (Evas_Object_Textblock_Paragraph *)
4058 EINA_INLIST_GET(c->par)->next;
4059 }
4060
4061 /* Delete the rest of the layout paragraphs */
4062 while (c->par)
4063 {
4064 Evas_Object_Textblock_Paragraph *tmp_par =
4065 (Evas_Object_Textblock_Paragraph *)
4066 EINA_INLIST_GET(c->par)->next;
4067
4068 c->paragraphs = (Evas_Object_Textblock_Paragraph *)
4069 eina_inlist_remove(EINA_INLIST_GET(c->paragraphs),
4070 EINA_INLIST_GET(c->par));
4071 _paragraph_free(obj, c->par);
4072
4073 c->par = tmp_par;
4074 }
4075 o->paragraphs = c->paragraphs;
4076 c->par = NULL;
4077 }
4078
4079}
4080
4081/**
4082 * @internal
4083 * Create the layout from the nodes.
4084 *
4085 * @param obj the evas object - NOT NULL.
4086 * @param calc_only true if should only calc sizes false if should also create the layout.. It assumes native size is being calculated, doesn't support formatted size atm.
4087 * @param w the object's w, -1 means no wrapping (i.e infinite size)
4088 * @param h the object's h, -1 means inifinte size.
4089 * @param w_ret the object's calculated w.
4090 * @param h_ret the object's calculated h.
4091 */
4092static void
4093_layout(const Evas_Object *obj, int w, int h, int *w_ret, int *h_ret)
4094{
4095 Evas_Object_Textblock *o;
4096 Ctxt ctxt, *c;
4097 int style_pad_l = 0, style_pad_r = 0, style_pad_t = 0, style_pad_b = 0;
4098
4099 /* setup context */
4100 o = (Evas_Object_Textblock *)(obj->object_data);
4101 c = &ctxt;
4102 c->obj = (Evas_Object *)obj;
4103 c->o = o;
4104 c->paragraphs = c->par = NULL;
4105 c->format_stack = NULL;
4106 c->fmt = NULL;
4107 c->x = c->y = 0;
4108 c->w = w;
4109 c->h = h;
4110 c->wmax = c->hmax = 0;
4111 c->maxascent = c->maxdescent = 0;
4112 c->marginl = c->marginr = 0;
4113 c->have_underline = 0;
4114 c->have_underline2 = 0;
4115 c->underline_extend = 0;
4116 c->line_no = 0;
4117 c->align = 0.0;
4118 c->align_auto = EINA_TRUE;
4119 c->ln = NULL;
4120 c->width_changed = (obj->cur.geometry.w != o->last_w);
4121
4122 /* Start of logical layout creation */
4123 /* setup default base style */
4124 if ((c->o->style) && (c->o->style->default_tag))
4125 {
4126 c->fmt = _layout_format_push(c, NULL, NULL);
4127 _format_fill(c->obj, c->fmt, c->o->style->default_tag);
4128 _format_finalize(c->obj, c->fmt);
4129 }
4130 if (!c->fmt)
4131 {
4132 if (w_ret) *w_ret = 0;
4133 if (h_ret) *h_ret = 0;
4134 return;
4135 }
4136
4137 _layout_pre(c, &style_pad_l, &style_pad_r, &style_pad_t, &style_pad_b);
4138 c->paragraphs = o->paragraphs;
4139
4140 /* If there are no paragraphs, create the minimum needed,
4141 * if the last paragraph has no lines/text, create that as well */
4142 if (!c->paragraphs)
4143 {
4144 _layout_paragraph_new(c, NULL, EINA_TRUE);
4145 o->paragraphs = c->paragraphs;
4146 }
4147 c->par = (Evas_Object_Textblock_Paragraph *)
4148 EINA_INLIST_GET(c->paragraphs)->last;
4149 if (!c->par->logical_items)
4150 {
4151 Evas_Object_Textblock_Text_Item *ti;
4152 ti = _layout_text_item_new(c, c->fmt);
4153 ti->parent.text_node = c->par->text_node;
4154 ti->parent.text_pos = 0;
4155 _layout_text_add_logical_item(c, ti, NULL);
4156 }
4157
4158 /* End of logical layout creation */
4159
4160 /* Start of visual layout creation */
4161 {
4162 Evas_Object_Textblock_Paragraph *last_vis_par = NULL;
4163 int par_index_step = o->num_paragraphs / TEXTBLOCK_PAR_INDEX_SIZE;
4164 int par_count = 1; /* Force it to take the first one */
4165 int par_index_pos = 0;
4166
4167 if (par_index_step == 0) par_index_step = 1;
4168
4169 /* Clear all of the index */
4170 memset(o->par_index, 0, sizeof(o->par_index));
4171
4172 EINA_INLIST_FOREACH(c->paragraphs, c->par)
4173 {
4174 _layout_update_par(c);
4175
4176 /* Break if we should stop here. */
4177 if (_layout_par(c))
4178 {
4179 last_vis_par = c->par;
4180 break;
4181 }
4182
4183 if ((par_index_pos < TEXTBLOCK_PAR_INDEX_SIZE) && (--par_count == 0))
4184 {
4185 par_count = par_index_step;
4186
4187 o->par_index[par_index_pos++] = c->par;
4188 }
4189 }
4190
4191 /* Mark all the rest of the paragraphs as invisible */
4192 if (c->par)
4193 {
4194 c->par = (Evas_Object_Textblock_Paragraph *)
4195 EINA_INLIST_GET(c->par)->next;
4196 while (c->par)
4197 {
4198 c->par->visible = 0;
4199 c->par = (Evas_Object_Textblock_Paragraph *)
4200 EINA_INLIST_GET(c->par)->next;
4201 }
4202 }
4203
4204 /* Get the last visible paragraph in the layout */
4205 if (!last_vis_par && c->paragraphs)
4206 last_vis_par = (Evas_Object_Textblock_Paragraph *)
4207 EINA_INLIST_GET(c->paragraphs)->last;
4208
4209 if (last_vis_par)
4210 c->hmax = last_vis_par->y + last_vis_par->h;
4211 }
4212
4213 /* Clean the rest of the format stack */
4214 while (c->format_stack)
4215 {
4216 c->fmt = c->format_stack->data;
4217 c->format_stack = eina_list_remove_list(c->format_stack, c->format_stack);
4218 _format_unref_free(c->obj, c->fmt);
4219 }
4220
4221 if (w_ret) *w_ret = c->wmax;
4222 if (h_ret) *h_ret = c->hmax;
4223
4224 /* Vertically align the textblock */
4225 if ((o->valign > 0.0) && (c->h > c->hmax))
4226 {
4227 Evas_Coord adjustment = (c->h - c->hmax) * o->valign;
4228 Evas_Object_Textblock_Paragraph *par;
4229 EINA_INLIST_FOREACH(c->paragraphs, par)
4230 {
4231 par->y += adjustment;
4232 }
4233 }
4234
4235 if ((o->style_pad.l != style_pad_l) || (o->style_pad.r != style_pad_r) ||
4236 (o->style_pad.t != style_pad_t) || (o->style_pad.b != style_pad_b))
4237 {
4238 o->style_pad.l = style_pad_l;
4239 o->style_pad.r = style_pad_r;
4240 o->style_pad.t = style_pad_t;
4241 o->style_pad.b = style_pad_b;
4242 _paragraphs_clear(obj, c->paragraphs);
4243 _layout(obj, w, h, w_ret, h_ret);
4244 }
4245}
4246
4247/*
4248 * @internal
4249 * Relayout the object according to current object size.
4250 *
4251 * @param obj the evas object - NOT NULL.
4252 */
4253static void
4254_relayout(const Evas_Object *obj)
4255{
4256 Evas_Object_Textblock *o;
4257
4258 o = (Evas_Object_Textblock *)(obj->object_data);
4259 _layout(obj, obj->cur.geometry.w, obj->cur.geometry.h,
4260 &o->formatted.w, &o->formatted.h);
4261 o->formatted.valid = 1;
4262 o->last_w = obj->cur.geometry.w;
4263 o->last_h = obj->cur.geometry.h;
4264 o->changed = 0;
4265 o->content_changed = 0;
4266 o->format_changed = EINA_FALSE;
4267 o->redraw = 1;
4268}
4269
4270/**
4271 * @internal
4272 * Find the layout item and line that match the text node and position passed.
4273 *
4274 * @param obj the evas object - NOT NULL.
4275 * @param n the text node - Not null.
4276 * @param pos the position to look for - valid.
4277 * @param[out] lnr the line found - not null.
4278 * @param[out] tir the item found - not null.
4279 * @see _find_layout_format_item_line_match()
4280 */
4281static void
4282_find_layout_item_line_match(Evas_Object *obj, Evas_Object_Textblock_Node_Text *n, int pos, Evas_Object_Textblock_Line **lnr, Evas_Object_Textblock_Item **itr)
4283{
4284 Evas_Object_Textblock_Paragraph *found_par;
4285 Evas_Object_Textblock_Line *ln;
4286 Evas_Object_Textblock *o;
4287
4288 o = (Evas_Object_Textblock *)(obj->object_data);
4289 if (!o->formatted.valid) _relayout(obj);
4290
4291 found_par = n->par;
4292 if (found_par)
4293 {
4294 _layout_paragraph_render(o, found_par);
4295 EINA_INLIST_FOREACH(found_par->lines, ln)
4296 {
4297 Evas_Object_Textblock_Item *it;
4298
4299 EINA_INLIST_FOREACH(ln->items, it)
4300 {
4301 /* FIXME: p should be size_t, same goes for pos */
4302 int p = (int) it->text_pos;
4303
4304 if (it->type == EVAS_TEXTBLOCK_ITEM_TEXT)
4305 {
4306 Evas_Object_Textblock_Text_Item *ti =
4307 _ITEM_TEXT(it);
4308
4309 p += (int) ti->text_props.text_len;
4310 }
4311 else
4312 {
4313 p++;
4314 }
4315
4316 if (((pos >= (int) it->text_pos) && (pos < p)))
4317 {
4318 *lnr = ln;
4319 *itr = it;
4320 return;
4321 }
4322 else if (p == pos)
4323 {
4324 *lnr = ln;
4325 *itr = it;
4326 }
4327 }
4328 }
4329 }
4330}
4331
4332/**
4333 * @internal
4334 * Return the line number 'line'.
4335 *
4336 * @param obj the evas object - NOT NULL.
4337 * @param line the line to find
4338 * @return the line of line number or NULL if no line found.
4339 */
4340static Evas_Object_Textblock_Line *
4341_find_layout_line_num(const Evas_Object *obj, int line)
4342{
4343 Evas_Object_Textblock_Paragraph *par;
4344 Evas_Object_Textblock_Line *ln;
4345 Evas_Object_Textblock *o;
4346
4347 o = (Evas_Object_Textblock *)(obj->object_data);
4348
4349 par = _layout_find_paragraph_by_line_no(o, line);
4350 if (par)
4351 {
4352 _layout_paragraph_render(o, par);
4353 EINA_INLIST_FOREACH(par->lines, ln)
4354 {
4355 if (par->line_no + ln->line_no == line) return ln;
4356 }
4357 }
4358 return NULL;
4359}
4360
4361EAPI Evas_Object *
4362evas_object_textblock_add(Evas *e)
4363{
4364 Evas_Object *obj;
4365
4366 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
4367 return NULL;
4368 MAGIC_CHECK_END();
4369 obj = evas_object_new(e);
4370 evas_object_textblock_init(obj);
4371 evas_object_inject(obj, e);
4372 return obj;
4373}
4374
4375EAPI Evas_Textblock_Style *
4376evas_textblock_style_new(void)
4377{
4378 Evas_Textblock_Style *ts;
4379
4380 ts = calloc(1, sizeof(Evas_Textblock_Style));
4381 return ts;
4382}
4383
4384EAPI void
4385evas_textblock_style_free(Evas_Textblock_Style *ts)
4386{
4387 if (!ts) return;
4388 if (ts->objects)
4389 {
4390 ts->delete_me = 1;
4391 return;
4392 }
4393 _style_clear(ts);
4394 free(ts);
4395}
4396
4397EAPI void
4398evas_textblock_style_set(Evas_Textblock_Style *ts, const char *text)
4399{
4400 Eina_List *l;
4401 Evas_Object *obj;
4402
4403 if (!ts) return;
4404 /* If the style wasn't really changed, abort. */
4405 if ((!ts->style_text && !text) ||
4406 (ts->style_text && text && !strcmp(text, ts->style_text)))
4407 return;
4408
4409 EINA_LIST_FOREACH(ts->objects, l, obj)
4410 {
4411 Evas_Object_Textblock *o;
4412
4413 o = (Evas_Object_Textblock *)(obj->object_data);
4414 _evas_textblock_invalidate_all(o);
4415 _evas_textblock_changed(o, obj);
4416 }
4417
4418 _style_replace(ts, text);
4419
4420 if (ts->style_text)
4421 {
4422 // format MUST be KEY='VALUE'[KEY='VALUE']...
4423 const char *p;
4424 const char *key_start, *key_stop, *val_start, *val_stop;
4425
4426 key_start = key_stop = val_start = val_stop = NULL;
4427 p = ts->style_text;
4428 while (*p)
4429 {
4430 if (!key_start)
4431 {
4432 if (!isspace(*p))
4433 key_start = p;
4434 }
4435 else if (!key_stop)
4436 {
4437 if ((*p == '=') || (isspace(*p)))
4438 key_stop = p;
4439 }
4440 else if (!val_start)
4441 {
4442 if (((*p) == '\'') && (*(p + 1)))
4443 val_start = p + 1;
4444 }
4445 else if (!val_stop)
4446 {
4447 if (((*p) == '\'') && (p > ts->style_text) && (p[-1] != '\\'))
4448 val_stop = p;
4449 }
4450 if ((key_start) && (key_stop) && (val_start) && (val_stop))
4451 {
4452 char *tags, *replaces;
4453 Evas_Object_Style_Tag *tag;
4454 size_t tag_len = key_stop - key_start;
4455 size_t replace_len = val_stop - val_start;
4456
4457 tags = malloc(tag_len + 1);
4458 if (tags)
4459 {
4460 memcpy(tags, key_start, tag_len);
4461 tags[tag_len] = 0;
4462 }
4463
4464 replaces = malloc(replace_len + 1);
4465 if (replaces)
4466 {
4467 memcpy(replaces, val_start, replace_len);
4468 replaces[replace_len] = 0;
4469 }
4470 if ((tags) && (replaces))
4471 {
4472 if (!strcmp(tags, "DEFAULT"))
4473 {
4474 ts->default_tag = replaces;
4475 free(tags);
4476 }
4477 else
4478 {
4479 tag = calloc(1, sizeof(Evas_Object_Style_Tag));
4480 if (tag)
4481 {
4482 tag->tag = tags;
4483 tag->replace = replaces;
4484 tag->tag_len = tag_len;
4485 tag->replace_len = replace_len;
4486 ts->tags = (Evas_Object_Style_Tag *)eina_inlist_append(EINA_INLIST_GET(ts->tags), EINA_INLIST_GET(tag));
4487 }
4488 else
4489 {
4490 free(tags);
4491 free(replaces);
4492 }
4493 }
4494 }
4495 else
4496 {
4497 if (tags) free(tags);
4498 if (replaces) free(replaces);
4499 }
4500 key_start = key_stop = val_start = val_stop = NULL;
4501 }
4502 p++;
4503 }
4504 }
4505}
4506
4507EAPI const char *
4508evas_textblock_style_get(const Evas_Textblock_Style *ts)
4509{
4510 if (!ts) return NULL;
4511 return ts->style_text;
4512}
4513
4514/* textblock styles */
4515EAPI void
4516evas_object_textblock_style_set(Evas_Object *obj, Evas_Textblock_Style *ts)
4517{
4518 TB_HEAD();
4519 if (ts == o->style) return;
4520 if ((ts) && (ts->delete_me)) return;
4521 if (o->style)
4522 {
4523 Evas_Textblock_Style *old_ts;
4524 if (o->markup_text)
4525 {
4526 free(o->markup_text);
4527 o->markup_text = NULL;
4528 }
4529
4530 old_ts = o->style;
4531 old_ts->objects = eina_list_remove(old_ts->objects, obj);
4532 if ((old_ts->delete_me) && (!old_ts->objects))
4533 evas_textblock_style_free(old_ts);
4534 }
4535 if (ts)
4536 {
4537 ts->objects = eina_list_append(ts->objects, obj);
4538 }
4539 o->style = ts;
4540
4541 _evas_textblock_invalidate_all(o);
4542 _evas_textblock_changed(o, obj);
4543}
4544
4545EAPI const Evas_Textblock_Style *
4546evas_object_textblock_style_get(const Evas_Object *obj)
4547{
4548 TB_HEAD_RETURN(NULL);
4549 return o->style;
4550}
4551
4552EAPI void
4553evas_object_textblock_replace_char_set(Evas_Object *obj, const char *ch)
4554{
4555 TB_HEAD();
4556 if (o->repch) eina_stringshare_del(o->repch);
4557 if (ch) o->repch = eina_stringshare_add(ch);
4558 else o->repch = NULL;
4559 _evas_textblock_invalidate_all(o);
4560 _evas_textblock_changed(o, obj);
4561}
4562
4563EAPI void
4564evas_object_textblock_legacy_newline_set(Evas_Object *obj, Eina_Bool mode)
4565{
4566 TB_HEAD();
4567 if (o->legacy_newline == mode)
4568 return;
4569
4570 o->legacy_newline = mode;
4571 /* FIXME: Should recreate all the textnodes... For now, it's just
4572 * for new text inserted. */
4573}
4574
4575EAPI Eina_Bool
4576evas_object_textblock_legacy_newline_get(const Evas_Object *obj)
4577{
4578 TB_HEAD_RETURN(EINA_FALSE);
4579 return o->legacy_newline;
4580}
4581
4582EAPI void
4583evas_object_textblock_valign_set(Evas_Object *obj, double align)
4584{
4585 TB_HEAD();
4586 if (align < 0.0) align = 0.0;
4587 else if (align > 1.0) align = 1.0;
4588 if (o->valign == align) return;
4589 o->valign = align;
4590 _evas_textblock_changed(o, obj);
4591}
4592
4593EAPI double
4594evas_object_textblock_valign_get(const Evas_Object *obj)
4595{
4596 TB_HEAD_RETURN(0.0);
4597 return o->valign;
4598}
4599
4600EAPI void
4601evas_object_textblock_bidi_delimiters_set(Evas_Object *obj, const char *delim)
4602{
4603 TB_HEAD();
4604 eina_stringshare_replace(&o->bidi_delimiters, delim);
4605}
4606
4607EAPI const char *
4608evas_object_textblock_bidi_delimiters_get(const Evas_Object *obj)
4609{
4610 TB_HEAD_RETURN(NULL);
4611 return o->bidi_delimiters;
4612}
4613
4614EAPI const char *
4615evas_object_textblock_replace_char_get(Evas_Object *obj)
4616{
4617 TB_HEAD_RETURN(NULL);
4618 return o->repch;
4619}
4620
4621/**
4622 * @internal
4623 * Advance p_buff to point after the end of the string. It's used with the
4624 * @ref escaped_strings[] variable.
4625 *
4626 * @param p_buff the pointer to the current string.
4627 */
4628static inline void
4629_escaped_advance_after_end_of_string(const char **p_buf)
4630{
4631 while (**p_buf != 0) (*p_buf)++;
4632 (*p_buf)++;
4633}
4634
4635/**
4636 * @internal
4637 * Advance p_buff to point after the end of the string. It's used with the
4638 * @ref escaped_strings[] variable. Also chec if matches.
4639 * FIXME: doc.
4640 *
4641 * @param p_buff the pointer to the current string.
4642 */
4643static inline int
4644_escaped_is_eq_and_advance(const char *s, const char *s_end,
4645 const char **p_m, const char *m_end)
4646{
4647 Eina_Bool reached_end;
4648 for (;((s < s_end) && (*p_m < m_end)); s++, (*p_m)++)
4649 {
4650 if (*s != **p_m)
4651 {
4652 _escaped_advance_after_end_of_string(p_m);
4653 return 0;
4654 }
4655 }
4656
4657 reached_end = !**p_m;
4658 if (*p_m < m_end)
4659 _escaped_advance_after_end_of_string(p_m);
4660
4661 return ((s == s_end) && reached_end);
4662}
4663
4664/**
4665 * @internal
4666 *
4667 * @param s the string to match
4668 */
4669static inline const char *
4670_escaped_char_match(const char *s, int *adv)
4671{
4672 const char *map_itr, *map_end, *mc, *sc;
4673
4674 map_itr = escape_strings;
4675 map_end = map_itr + sizeof(escape_strings);
4676
4677 while (map_itr < map_end)
4678 {
4679 const char *escape;
4680 int match;
4681
4682 escape = map_itr;
4683 _escaped_advance_after_end_of_string(&map_itr);
4684 if (map_itr >= map_end) break;
4685
4686 mc = map_itr;
4687 sc = s;
4688 match = 1;
4689 while ((*mc) && (*sc))
4690 {
4691 if ((unsigned char)*sc < (unsigned char)*mc) return NULL;
4692 if (*sc != *mc) match = 0;
4693 mc++;
4694 sc++;
4695 }
4696 if (match)
4697 {
4698 *adv = mc - map_itr;
4699 return escape;
4700 }
4701 _escaped_advance_after_end_of_string(&map_itr);
4702 }
4703 return NULL;
4704}
4705
4706/**
4707 * @internal
4708 * FIXME: TBD.
4709 *
4710 * @param s the string to match
4711 */
4712static inline const char *
4713_escaped_char_get(const char *s, const char *s_end)
4714{
4715 /* Handle numeric escape codes. */
4716 if (s[1] == '#')
4717 {
4718 static char utf8_escape[7]; /* Support up to 6 bytes utf8 */
4719 char ustr[10];
4720 Eina_Unicode uchar[2] = { 0, 0 };
4721 char *utf8_char;
4722 size_t len = 0;
4723 int base = 10;
4724 s += 2; /* Skip "&#" */
4725
4726 if (tolower(*s) == 'x')
4727 {
4728 s++;
4729 base = 16;
4730 }
4731
4732 len = s_end - s;
4733 if (len >= sizeof(ustr) + 1)
4734 len = sizeof(ustr);
4735
4736 memcpy(ustr, s, len);
4737 ustr[len] = '\0';
4738 uchar[0] = strtol(ustr, NULL, base);
4739
4740 if (uchar[0] == 0)
4741 return NULL;
4742
4743 utf8_char = eina_unicode_unicode_to_utf8(uchar, NULL);
4744 strcpy(utf8_escape, utf8_char);
4745 free(utf8_char);
4746
4747 return utf8_escape;
4748 }
4749 else
4750 {
4751 const char *map_itr, *map_end;
4752
4753 map_itr = escape_strings;
4754 map_end = map_itr + sizeof(escape_strings);
4755
4756 while (map_itr < map_end)
4757 {
4758 if (_escaped_is_eq_and_advance(s, s_end, &map_itr, map_end))
4759 return map_itr;
4760 if (map_itr < map_end)
4761 _escaped_advance_after_end_of_string(&map_itr);
4762 }
4763 }
4764
4765 return NULL;
4766}
4767
4768EAPI const char *
4769evas_textblock_escape_string_get(const char *escape)
4770{
4771 /* &amp; -> & */
4772 return _escaped_char_get(escape, escape + strlen(escape));
4773}
4774
4775EAPI const char *
4776evas_textblock_escape_string_range_get(const char *escape_start, const char *escape_end)
4777{
4778 return _escaped_char_get(escape_start, escape_end);
4779}
4780
4781EAPI const char *
4782evas_textblock_string_escape_get(const char *string, int *len_ret)
4783{
4784 /* & -> &amp; */
4785 return _escaped_char_match(string, len_ret);
4786}
4787
4788/**
4789 * @internal
4790 * Appends the escaped char beteewn s and s_end to the curosr
4791 *
4792 *
4793 * @param s the start of the string
4794 * @param s_end the end of the string.
4795 */
4796static inline void
4797_append_escaped_char(Evas_Textblock_Cursor *cur, const char *s,
4798 const char *s_end)
4799{
4800 const char *escape;
4801
4802 escape = _escaped_char_get(s, s_end);
4803 if (escape)
4804 evas_textblock_cursor_text_append(cur, escape);
4805}
4806
4807/**
4808 * @internal
4809 * prepends the escaped char beteewn s and s_end to the curosr
4810 *
4811 *
4812 * @param s the start of the string
4813 * @param s_end the end of the string.
4814 */
4815static inline void
4816_prepend_escaped_char(Evas_Textblock_Cursor *cur, const char *s,
4817 const char *s_end)
4818{
4819 const char *escape;
4820
4821 escape = _escaped_char_get(s, s_end);
4822 if (escape)
4823 evas_textblock_cursor_text_prepend(cur, escape);
4824}
4825
4826
4827EAPI void
4828evas_object_textblock_text_markup_set(Evas_Object *obj, const char *text)
4829{
4830 TB_HEAD();
4831 if ((text != o->markup_text) && (o->markup_text))
4832 {
4833 free(o->markup_text);
4834 o->markup_text = NULL;
4835 }
4836 _nodes_clear(obj);
4837 if (!o->style)
4838 {
4839 if (text != o->markup_text)
4840 {
4841 if (text) o->markup_text = strdup(text);
4842 }
4843 return;
4844 }
4845 evas_textblock_cursor_paragraph_first(o->cursor);
4846
4847 evas_object_textblock_text_markup_prepend(o->cursor, text);
4848 /* Point all the cursors to the starrt */
4849 {
4850 Eina_List *l;
4851 Evas_Textblock_Cursor *data;
4852
4853 evas_textblock_cursor_paragraph_first(o->cursor);
4854 EINA_LIST_FOREACH(o->cursors, l, data)
4855 evas_textblock_cursor_paragraph_first(data);
4856 }
4857}
4858
4859EAPI void
4860evas_object_textblock_text_markup_prepend(Evas_Textblock_Cursor *cur, const char *text)
4861{
4862 Evas_Object *obj = cur->obj;
4863 TB_HEAD();
4864 if (text)
4865 {
4866 char *s, *p;
4867 char *tag_start, *tag_end, *esc_start, *esc_end;
4868
4869 tag_start = tag_end = esc_start = esc_end = NULL;
4870 p = (char *)text;
4871 s = p;
4872 /* This loop goes through all of the mark up text until it finds format
4873 * tags, escape sequences or the terminating NULL. When it finds either
4874 * of those, it appends the text found up until that point to the textblock
4875 * proccesses whatever found. It repeats itself until the termainating
4876 * NULL is reached. */
4877 for (;;)
4878 {
4879 /* If we got to the end of string or just finished/started tag
4880 * or escape sequence handling. */
4881 if ((*p == 0) ||
4882 (tag_end) || (esc_end) ||
4883 (tag_start) || (esc_start))
4884 {
4885 if (tag_end)
4886 {
4887 /* If we reached to a tag ending, analyze the tag */
4888 char *ttag;
4889 size_t ttag_len = tag_end - tag_start;
4890
4891
4892 ttag = malloc(ttag_len + 1);
4893 if (ttag)
4894 {
4895 memcpy(ttag, tag_start, ttag_len);
4896 ttag[ttag_len] = 0;
4897 evas_textblock_cursor_format_prepend(cur, ttag);
4898 free(ttag);
4899 }
4900 tag_start = tag_end = NULL;
4901 }
4902 else if (esc_end)
4903 {
4904 _prepend_escaped_char(cur, esc_start, esc_end + 1);
4905 esc_start = esc_end = NULL;
4906 }
4907 else if (*p == 0)
4908 {
4909 _prepend_text_run(cur, s, p);
4910 s = NULL;
4911 }
4912 if (*p == 0)
4913 break;
4914 }
4915 if (*p == '<')
4916 {
4917 if (!esc_start)
4918 {
4919 /* Append the text prior to this to the textblock and mark
4920 * the start of the tag */
4921 tag_start = p;
4922 tag_end = NULL;
4923 _prepend_text_run(cur, s, p);
4924 s = NULL;
4925 }
4926 }
4927 else if (*p == '>')
4928 {
4929 if (tag_start)
4930 {
4931 tag_end = p + 1;
4932 s = p + 1;
4933 }
4934 }
4935 else if (*p == '&')
4936 {
4937 if (!tag_start)
4938 {
4939 /* Append the text prior to this to the textblock and mark
4940 * the start of the escape sequence */
4941 esc_start = p;
4942 esc_end = NULL;
4943 _prepend_text_run(cur, s, p);
4944 s = NULL;
4945 }
4946 }
4947 else if (*p == ';')
4948 {
4949 if (esc_start)
4950 {
4951 esc_end = p;
4952 s = p + 1;
4953 }
4954 }
4955 /* Unicode object replcament char */
4956 else if (!strncmp("\xEF\xBF\xBC", p, 3))
4957 {
4958 /*FIXME: currently just remove them, maybe do something
4959 * fancier in the future, atm it breaks if this char
4960 * is inside <> */
4961 _prepend_text_run(cur, s, p);
4962 p += 2; /* it's also advanced later in this loop need +3
4963 * in total*/
4964 s = p + 1; /* One after the end of the replacement char */
4965 }
4966 p++;
4967 }
4968 }
4969 _evas_textblock_changed(o, obj);
4970}
4971
4972
4973/**
4974 * @internal
4975 * An helper function to markup get. Appends the format from fnode to the strbugf txt.
4976 *
4977 * @param o the textblock object.
4978 * @param txt the strbuf to append to.
4979 * @param fnode the format node to process.
4980 */
4981static void
4982_markup_get_format_append(Evas_Object_Textblock *o __UNUSED__, Eina_Strbuf *txt, Evas_Object_Textblock_Node_Format *fnode)
4983{
4984 eina_strbuf_append_char(txt, '<');
4985 {
4986 const char *s;
4987 int pop = 0;
4988
4989 // FIXME: need to escape
4990 s = fnode->orig_format;
4991 if (*s == '-') pop = 1;
4992 while ((*s == ' ') || (*s == '+') || (*s == '-')) s++;
4993 if (pop) eina_strbuf_append_char(txt, '/');
4994 eina_strbuf_append(txt, s);
4995 }
4996 eina_strbuf_append_char(txt, '>');
4997}
4998
4999/**
5000 * @internal
5001 * An helper function to markup get. Appends the text in text.
5002 *
5003 * @param txt the strbuf to append to.
5004 * @param text the text to process.
5005 */
5006static void
5007_markup_get_text_append(Eina_Strbuf *txt, const Eina_Unicode *text)
5008{
5009 char *p = eina_unicode_unicode_to_utf8(text, NULL);
5010 char *base = p;
5011 while (*p)
5012 {
5013 const char *escape;
5014 int adv;
5015
5016 escape = _escaped_char_match(p, &adv);
5017 if (escape)
5018 {
5019 p += adv;
5020 eina_strbuf_append(txt, escape);
5021 }
5022 else
5023 {
5024 eina_strbuf_append_char(txt, *p);
5025 p++;
5026 }
5027 }
5028 free(base);
5029}
5030EAPI const char *
5031evas_object_textblock_text_markup_get(const Evas_Object *obj)
5032{
5033 Evas_Object_Textblock_Node_Text *n;
5034 Eina_Strbuf *txt = NULL;
5035
5036 TB_HEAD_RETURN(NULL);
5037 if (o->markup_text) return(o->markup_text);
5038 txt = eina_strbuf_new();
5039 EINA_INLIST_FOREACH(o->text_nodes, n)
5040 {
5041 Evas_Object_Textblock_Node_Format *fnode;
5042 Eina_Unicode *text_base, *text;
5043 int off;
5044
5045 /* For each text node to thorugh all of it's format nodes
5046 * append text from the start to the offset of the next format
5047 * using the last format got. if needed it also creates format items
5048 * this is the core algorithm of the layout mechanism.
5049 * Skip the unicode replacement chars when there are because
5050 * we don't want to print them. */
5051 text_base = text =
5052 eina_unicode_strndup(eina_ustrbuf_string_get(n->unicode),
5053 eina_ustrbuf_length_get(n->unicode));
5054 fnode = n->format_node;
5055 off = 0;
5056 while (fnode && (fnode->text_node == n))
5057 {
5058 Eina_Unicode tmp_ch;
5059 off += fnode->offset;
5060 /* No need to skip on the first run */
5061 tmp_ch = text[off];
5062 text[off] = 0; /* Null terminate the part of the string */
5063 _markup_get_text_append(txt, text);
5064 _markup_get_format_append(o, txt, fnode);
5065 text[off] = tmp_ch; /* Restore the char */
5066 text += off;
5067 if (fnode->visible)
5068 {
5069 off = -1;
5070 text++;
5071 }
5072 else
5073 {
5074 off = 0;
5075 }
5076 fnode = _NODE_FORMAT(EINA_INLIST_GET(fnode)->next);
5077 }
5078 /* Add the rest, skip replacement */
5079 _markup_get_text_append(txt, text);
5080 free(text_base);
5081 }
5082
5083
5084 o->markup_text = eina_strbuf_string_steal(txt);
5085 eina_strbuf_free(txt);
5086 return o->markup_text;
5087}
5088
5089/* cursors */
5090
5091/**
5092 * @internal
5093 * Merge the current node with the next, no need to remove PS, already
5094 * not there.
5095 *
5096 * @param o the text block object.
5097 * @param to merge into to.
5098 */
5099static void
5100_evas_textblock_nodes_merge(Evas_Object_Textblock *o, Evas_Object_Textblock_Node_Text *to)
5101{
5102 Evas_Object_Textblock_Node_Format *itr;
5103 Evas_Object_Textblock_Node_Format *pnode;
5104 Evas_Object_Textblock_Node_Text *from;
5105 const Eina_Unicode *text;
5106 int to_len, len;
5107
5108 if (!to) return;
5109 from = _NODE_TEXT(EINA_INLIST_GET(to)->next);
5110
5111 to_len = eina_ustrbuf_length_get(to->unicode);
5112 text = eina_ustrbuf_string_get(from->unicode);
5113 len = eina_ustrbuf_length_get(from->unicode);
5114 eina_ustrbuf_append_length(to->unicode, text, len);
5115
5116 itr = from->format_node;
5117 if (itr && (itr->text_node == from))
5118 {
5119 pnode = _NODE_FORMAT(EINA_INLIST_GET(itr)->prev);
5120 if (pnode && (pnode->text_node == to))
5121 {
5122 itr->offset += to_len - _evas_textblock_node_format_pos_get(pnode);
5123 }
5124 else
5125 {
5126 itr->offset += to_len;
5127 }
5128 }
5129
5130 while (itr && (itr->text_node == from))
5131 {
5132 itr->text_node = to;
5133 itr = _NODE_FORMAT(EINA_INLIST_GET(itr)->next);
5134 }
5135 if (!to->format_node || (to->format_node->text_node != to))
5136 {
5137 to->format_node = from->format_node;
5138 }
5139
5140 /* When it comes to how we handle it, merging is like removing both nodes
5141 * and creating a new one, se we need to do the needed cleanups. */
5142 if (to->par)
5143 to->par->text_node = NULL;
5144 to->par = NULL;
5145
5146 to->is_new = EINA_TRUE;
5147
5148 _evas_textblock_cursors_set_node(o, from, to);
5149 _evas_textblock_node_text_remove(o, from);
5150}
5151
5152/**
5153 * @internal
5154 * Merge the current node with the next, no need to remove PS, already
5155 * not there.
5156 *
5157 * @param cur the cursor that points to the current node
5158 */
5159static void
5160_evas_textblock_cursor_nodes_merge(Evas_Textblock_Cursor *cur)
5161{
5162 Evas_Object_Textblock_Node_Text *nnode;
5163 Evas_Object_Textblock *o;
5164 int len;
5165 if (!cur) return;
5166
5167 len = eina_ustrbuf_length_get(cur->node->unicode);
5168
5169 o = (Evas_Object_Textblock *)(cur->obj->object_data);
5170 nnode = _NODE_TEXT(EINA_INLIST_GET(cur->node)->next);
5171 _evas_textblock_nodes_merge(o, cur->node);
5172 _evas_textblock_cursors_update_offset(cur, nnode, 0, len);
5173 _evas_textblock_cursors_set_node(o, nnode, cur->node);
5174 if (nnode == o->cursor->node)
5175 {
5176 o->cursor->node = cur->node;
5177 o->cursor->pos += len;
5178 }
5179}
5180
5181/**
5182 * @internal
5183 * Return the format at a specific position.
5184 *
5185 * @param cur the cursor to the position.
5186 * @return the format node at the specific position or NULL if not found.
5187 */
5188static Evas_Object_Textblock_Node_Format *
5189_evas_textblock_cursor_node_format_at_pos_get(const Evas_Textblock_Cursor *cur)
5190{
5191 Evas_Object_Textblock_Node_Format *node;
5192 Evas_Object_Textblock_Node_Format *itr;
5193 int position = 0;
5194
5195 if (!cur->node) return NULL;
5196
5197 node = cur->node->format_node;
5198 if (!node) return NULL;
5199 /* If there is no exclusive format node to this paragraph return the
5200 * previous's node */
5201 /* Find the main format node */
5202 EINA_INLIST_FOREACH(node, itr)
5203 {
5204 if (itr->text_node != cur->node)
5205 {
5206 return NULL;
5207 }
5208 if ((position + itr->offset) == cur->pos)
5209 {
5210 return itr;
5211 }
5212 position += itr->offset;
5213 }
5214 return NULL;
5215}
5216
5217/**
5218 * @internal
5219 * Return the last format node at the position of the format node n.
5220 *
5221 * @param n a format node at the position.
5222 * @return the last format node at the position of n.
5223 */
5224static Evas_Object_Textblock_Node_Format *
5225_evas_textblock_node_format_last_at_off(const Evas_Object_Textblock_Node_Format *n)
5226{
5227 const Evas_Object_Textblock_Node_Format *nnode;
5228 const Evas_Object_Textblock_Node_Text *tnode;
5229 if (!n) return NULL;
5230 nnode = n;
5231 tnode = n->text_node;
5232 do
5233 {
5234 n = nnode;
5235 nnode = _NODE_FORMAT(EINA_INLIST_GET(nnode)->next);
5236 }
5237 while (nnode && (nnode->text_node == tnode) && (nnode->offset == 0));
5238
5239 return (Evas_Object_Textblock_Node_Format *) n;
5240}
5241
5242/**
5243 * @internal
5244 * Returns the visible format at a specific location.
5245 *
5246 * @param n a format at the specific position.
5247 * @return the format node at the specific position or NULL if not found.
5248 */
5249static Evas_Object_Textblock_Node_Format *
5250_evas_textblock_node_visible_at_pos_get(const Evas_Object_Textblock_Node_Format *n)
5251{
5252 const Evas_Object_Textblock_Node_Format *nnode;
5253 if (!n) return NULL;
5254 /* The visible format is the last one, because it inserts a replacement
5255 * char that advances the next formats. */
5256
5257 nnode = n;
5258 do
5259 {
5260 n = nnode;
5261 if (n->visible) return (Evas_Object_Textblock_Node_Format *) n;
5262 nnode = _NODE_FORMAT(EINA_INLIST_GET(nnode)->next);
5263 }
5264 while (nnode && (nnode->offset == 0));
5265
5266 return NULL;
5267}
5268
5269/**
5270 * @internal
5271 * Return the last format that applies to a specific cursor or at the specific
5272 * position the cursor points to. This means either a cursor at or before the
5273 * position of the cursor in the text node is returned or the previous's text
5274 * node's format node.
5275 *
5276 * @param cur the position to look at.
5277 * @return the format node found.
5278 */
5279static Evas_Object_Textblock_Node_Format *
5280_evas_textblock_cursor_node_format_before_or_at_pos_get(const Evas_Textblock_Cursor *cur)
5281{
5282 Evas_Object_Textblock_Node_Format *node, *pitr = NULL;
5283 Evas_Object_Textblock_Node_Format *itr;
5284 size_t position = 0;
5285
5286 if (!cur->node) return NULL;
5287
5288 node = cur->node->format_node;
5289 if (!node) return NULL;
5290 /* If there is no exclusive format node to this paragraph return the
5291 * previous's node */
5292 if (node->text_node != cur->node)
5293 {
5294 return node;
5295 }
5296 else if (node->offset > cur->pos)
5297 {
5298 return _NODE_FORMAT(EINA_INLIST_GET(node)->prev);
5299 }
5300 /* Find the main format node */
5301 pitr = _NODE_FORMAT(EINA_INLIST_GET(node)->prev);
5302 EINA_INLIST_FOREACH(node, itr)
5303 {
5304 if ((itr->text_node != cur->node) ||
5305 ((position + itr->offset) > cur->pos))
5306 {
5307 return pitr;
5308 }
5309 else if ((position + itr->offset) == cur->pos)
5310 {
5311 return itr;
5312 }
5313 pitr = itr;
5314 position += itr->offset;
5315 }
5316 return pitr;
5317}
5318
5319/**
5320 * @internal
5321 * Find the layout item and line that match the cursor.
5322 *
5323 * @param cur the cursor we are currently at. - NOT NULL.
5324 * @param[out] lnr the line found - not null.
5325 * @param[out] itr the item found - not null.
5326 * @return EINA_TRUE if we matched the previous format, EINA_FALSE otherwise.
5327 */
5328static Eina_Bool
5329_find_layout_item_match(const Evas_Textblock_Cursor *cur, Evas_Object_Textblock_Line **lnr, Evas_Object_Textblock_Item **itr)
5330{
5331 Evas_Textblock_Cursor cur2;
5332 Eina_Bool previous_format = EINA_FALSE;
5333
5334 cur2.obj = cur->obj;
5335 evas_textblock_cursor_copy(cur, &cur2);
5336 if (cur2.pos > 0)
5337 {
5338 cur2.pos--;
5339 }
5340
5341 if (_evas_textblock_cursor_is_at_the_end(cur) &&
5342 evas_textblock_cursor_format_is_visible_get(&cur2))
5343 {
5344 _find_layout_item_line_match(cur2.obj, cur2.node, cur2.pos, lnr, itr);
5345 previous_format = EINA_TRUE;
5346 }
5347 else
5348 {
5349 _find_layout_item_line_match(cur->obj, cur->node, cur->pos, lnr, itr);
5350 }
5351 return previous_format;
5352}
5353
5354EAPI Evas_Textblock_Cursor *
5355evas_object_textblock_cursor_get(const Evas_Object *obj)
5356{
5357 TB_HEAD_RETURN(NULL);
5358 return o->cursor;
5359}
5360
5361EAPI Evas_Textblock_Cursor *
5362evas_object_textblock_cursor_new(const Evas_Object *obj)
5363{
5364 Evas_Textblock_Cursor *cur;
5365
5366 TB_HEAD_RETURN(NULL);
5367 cur = calloc(1, sizeof(Evas_Textblock_Cursor));
5368 cur->obj = (Evas_Object *) obj;
5369 cur->node = o->text_nodes;
5370 cur->pos = 0;
5371
5372 o->cursors = eina_list_append(o->cursors, cur);
5373 return cur;
5374}
5375
5376EAPI void
5377evas_textblock_cursor_free(Evas_Textblock_Cursor *cur)
5378{
5379 Evas_Object_Textblock *o;
5380
5381 if (!cur) return;
5382 o = (Evas_Object_Textblock *)(cur->obj->object_data);
5383 if (cur == o->cursor) return;
5384 o->cursors = eina_list_remove(o->cursors, cur);
5385 free(cur);
5386}
5387
5388EAPI Eina_Bool
5389evas_textblock_cursor_is_format(const Evas_Textblock_Cursor *cur)
5390{
5391 if (!cur || !cur->node) return EINA_FALSE;
5392 if (evas_textblock_cursor_format_is_visible_get(cur)) return EINA_TRUE;
5393 return (_evas_textblock_cursor_node_format_at_pos_get(cur)) ?
5394 EINA_TRUE : EINA_FALSE;
5395}
5396
5397EAPI const Eina_List *
5398evas_textblock_node_format_list_get(const Evas_Object *obj, const char *anchor)
5399{
5400 TB_HEAD_RETURN(NULL);
5401 if (!strcmp(anchor, "a"))
5402 return o->anchors_a;
5403 else if (!strcmp(anchor, "item"))
5404 return o->anchors_item;
5405
5406 return NULL;
5407}
5408
5409EAPI const Evas_Object_Textblock_Node_Format *
5410evas_textblock_node_format_first_get(const Evas_Object *obj)
5411{
5412 TB_HEAD_RETURN(NULL);
5413 return o->format_nodes;
5414}
5415
5416EAPI const Evas_Object_Textblock_Node_Format *
5417evas_textblock_node_format_last_get(const Evas_Object *obj)
5418{
5419 TB_HEAD_RETURN(NULL);
5420 if (o->format_nodes)
5421 {
5422 return _NODE_FORMAT(EINA_INLIST_GET(o->format_nodes)->last);
5423 }
5424 return NULL;
5425}
5426
5427EAPI const Evas_Object_Textblock_Node_Format *
5428evas_textblock_node_format_next_get(const Evas_Object_Textblock_Node_Format *n)
5429{
5430 return _NODE_FORMAT(EINA_INLIST_GET(n)->next);
5431}
5432
5433EAPI const Evas_Object_Textblock_Node_Format *
5434evas_textblock_node_format_prev_get(const Evas_Object_Textblock_Node_Format *n)
5435{
5436 return _NODE_FORMAT(EINA_INLIST_GET(n)->prev);
5437}
5438
5439EAPI void
5440evas_textblock_node_format_remove_pair(Evas_Object *obj,
5441 Evas_Object_Textblock_Node_Format *n)
5442{
5443 Evas_Object_Textblock_Node_Text *tnode1;
5444 Evas_Object_Textblock_Node_Format *fmt, *found_node = NULL;
5445 Eina_List *fstack = NULL;
5446 TB_HEAD();
5447
5448 if (!n) return;
5449
5450 fmt = n;
5451
5452 do
5453 {
5454 const char *fstr = fmt->orig_format;
5455
5456 if (fstr && (*fstr == '+'))
5457 {
5458 fstack = eina_list_prepend(fstack, fmt);
5459 }
5460 else if (fstr && (*fstr == '-'))
5461 {
5462 size_t fstr_len;
5463 /* Skip the '-' */
5464 fstr++;
5465 fstr_len = strlen(fstr);
5466 /* Generic popper, just pop */
5467 if (((fstr[0] == ' ') && !fstr[1]) || !fstr[0])
5468 {
5469 fstack = eina_list_remove_list(fstack, fstack);
5470 if (!fstack)
5471 {
5472 found_node = fmt;
5473 goto found;
5474 }
5475 }
5476 /* Find the matching format and pop it, if the matching format
5477 * is out format, i.e the last one, pop and break. */
5478 else
5479 {
5480 Eina_List *i;
5481 Evas_Object_Textblock_Node_Format *fnode;
5482 EINA_LIST_FOREACH(fstack, i, fnode)
5483 {
5484 if (_FORMAT_IS_CLOSER_OF(
5485 fnode->orig_format, fstr, fstr_len))
5486 {
5487 /* Last one, this is our item! */
5488 if (!eina_list_next(i))
5489 {
5490 found_node = fmt;
5491 goto found;
5492 }
5493 fstack = eina_list_remove_list(fstack, i);
5494 break;
5495 }
5496 }
5497 }
5498 }
5499
5500 fmt = _NODE_FORMAT(EINA_INLIST_GET(fmt)->next);
5501 }
5502 while (fmt && fstack);
5503
5504found:
5505
5506 fstack = eina_list_free(fstack);
5507
5508 if (n->visible)
5509 {
5510 size_t ind = _evas_textblock_node_format_pos_get(n);
5511 const char *format = n->format;
5512 Evas_Textblock_Cursor cur;
5513 cur.obj = obj;
5514
5515 eina_ustrbuf_remove(n->text_node->unicode, ind, ind + 1);
5516 if (format && _IS_PARAGRAPH_SEPARATOR(o, format))
5517 {
5518 evas_textblock_cursor_at_format_set(&cur, n);
5519 _evas_textblock_cursor_nodes_merge(&cur);
5520 }
5521 _evas_textblock_cursors_update_offset(&cur, n->text_node, ind, -1);
5522 }
5523 tnode1 = n->text_node;
5524 _evas_textblock_node_format_remove(o, n, 0);
5525 if (found_node && (found_node != n))
5526 {
5527 Evas_Object_Textblock_Node_Text *tnode2;
5528 tnode2 = found_node->text_node;
5529 /* found_node can never be visible! (it's the closing format) */
5530 _evas_textblock_node_format_remove(o, found_node, 0);
5531
5532 /* FIXME: Should be unified in the layout, for example, added to a list
5533 * that checks this kind of removals. But until then, this is very fast
5534 * and works. */
5535 /* Mark all the text nodes in between the removed formats as dirty. */
5536 while (tnode1)
5537 {
5538 tnode1->dirty = EINA_TRUE;
5539 if (tnode1 == tnode2)
5540 break;
5541 tnode1 =
5542 _NODE_TEXT(EINA_INLIST_GET(tnode1)->next);
5543 }
5544 }
5545
5546 _evas_textblock_changed(o, obj);
5547}
5548
5549EAPI void
5550evas_textblock_cursor_paragraph_first(Evas_Textblock_Cursor *cur)
5551{
5552 Evas_Object_Textblock *o;
5553 if (!cur) return;
5554 o = (Evas_Object_Textblock *)(cur->obj->object_data);
5555 cur->node = o->text_nodes;
5556 cur->pos = 0;
5557
5558}
5559
5560EAPI void
5561evas_textblock_cursor_paragraph_last(Evas_Textblock_Cursor *cur)
5562{
5563 Evas_Object_Textblock *o;
5564 Evas_Object_Textblock_Node_Text *node;
5565
5566 if (!cur) return;
5567 o = (Evas_Object_Textblock *)(cur->obj->object_data);
5568 node = o->text_nodes;
5569 if (node)
5570 {
5571 node = _NODE_TEXT(EINA_INLIST_GET(node)->last);
5572 cur->node = node;
5573 cur->pos = 0;
5574
5575 evas_textblock_cursor_paragraph_char_last(cur);
5576 }
5577 else
5578 {
5579 cur->node = NULL;
5580 cur->pos = 0;
5581
5582 }
5583}
5584
5585EAPI Eina_Bool
5586evas_textblock_cursor_paragraph_next(Evas_Textblock_Cursor *cur)
5587{
5588 if (!cur) return EINA_FALSE;
5589 if (!cur->node) return EINA_FALSE;
5590 /* If there is a current text node, return the next text node (if exists)
5591 * otherwise, just return False. */
5592 if (cur->node)
5593 {
5594 Evas_Object_Textblock_Node_Text *nnode;
5595 nnode = _NODE_TEXT(EINA_INLIST_GET(cur->node)->next);
5596 if (nnode)
5597 {
5598 cur->node = nnode;
5599 cur->pos = 0;
5600
5601 return EINA_TRUE;
5602 }
5603 }
5604 return EINA_FALSE;
5605}
5606
5607EAPI Eina_Bool
5608evas_textblock_cursor_paragraph_prev(Evas_Textblock_Cursor *cur)
5609{
5610 Evas_Object_Textblock_Node_Text *node;
5611 if (!cur) return EINA_FALSE;
5612 if (!cur->node) return EINA_FALSE;
5613 /* If the current node is a text node, just get the prev if any,
5614 * if it's a format, get the current text node out of the format and return
5615 * the prev text node if any. */
5616 node = cur->node;
5617 /* If there is a current text node, return the prev text node
5618 * (if exists) otherwise, just return False. */
5619 if (node)
5620 {
5621 Evas_Object_Textblock_Node_Text *pnode;
5622 pnode = _NODE_TEXT(EINA_INLIST_GET(cur->node)->prev);
5623 if (pnode)
5624 {
5625 cur->node = pnode;
5626 evas_textblock_cursor_paragraph_char_last(cur);
5627 return EINA_TRUE;
5628 }
5629 }
5630 return EINA_FALSE;
5631}
5632
5633EAPI void
5634evas_textblock_cursor_set_at_format(Evas_Textblock_Cursor *cur, const Evas_Object_Textblock_Node_Format *n)
5635{
5636 evas_textblock_cursor_at_format_set(cur, n);
5637}
5638
5639EAPI Eina_Bool
5640evas_textblock_cursor_format_next(Evas_Textblock_Cursor *cur)
5641{
5642 Evas_Object_Textblock_Node_Format *node;
5643
5644 if (!cur) return EINA_FALSE;
5645 if (!cur->node) return EINA_FALSE;
5646 /* If the current node is a format node, just get the next if any,
5647 * if it's a text, get the current format node out of the text and return
5648 * the next format node if any. */
5649 node = _evas_textblock_cursor_node_format_before_or_at_pos_get(cur);
5650 node = _evas_textblock_node_format_last_at_off(node);
5651 if (!node)
5652 {
5653 if (cur->node->format_node)
5654 {
5655 cur->pos = _evas_textblock_node_format_pos_get(node);
5656 return EINA_TRUE;
5657 }
5658 }
5659 /* If there is a current text node, return the next format node (if exists)
5660 * otherwise, just return False. */
5661 else
5662 {
5663 Evas_Object_Textblock_Node_Format *nnode;
5664 nnode = _NODE_FORMAT(EINA_INLIST_GET(node)->next);
5665 if (nnode)
5666 {
5667 cur->node = nnode->text_node;
5668 cur->pos = _evas_textblock_node_format_pos_get(nnode);
5669
5670 return EINA_TRUE;
5671 }
5672 }
5673 return EINA_FALSE;
5674}
5675
5676EAPI Eina_Bool
5677evas_textblock_cursor_format_prev(Evas_Textblock_Cursor *cur)
5678{
5679 const Evas_Object_Textblock_Node_Format *node;
5680 if (!cur) return EINA_FALSE;
5681 if (!cur->node) return EINA_FALSE;
5682 node = evas_textblock_cursor_format_get(cur);
5683 if (!node)
5684 {
5685 node = _evas_textblock_cursor_node_format_before_or_at_pos_get(cur);
5686 if (node)
5687 {
5688 cur->node = node->text_node;
5689 cur->pos = _evas_textblock_node_format_pos_get(node);
5690
5691 return EINA_TRUE;
5692 }
5693 }
5694 /* If there is a current text node, return the next text node (if exists)
5695 * otherwise, just return False. */
5696 if (node)
5697 {
5698 Evas_Object_Textblock_Node_Format *pnode;
5699 pnode = _NODE_FORMAT(EINA_INLIST_GET(node)->prev);
5700 if (pnode)
5701 {
5702 cur->node = pnode->text_node;
5703 cur->pos = _evas_textblock_node_format_pos_get(pnode);
5704
5705 return EINA_TRUE;
5706 }
5707 }
5708 return EINA_FALSE;
5709}
5710
5711EAPI Eina_Bool
5712evas_textblock_cursor_char_next(Evas_Textblock_Cursor *cur)
5713{
5714 int ind;
5715 const Eina_Unicode *text;
5716
5717 if (!cur) return EINA_FALSE;
5718 if (!cur->node) return EINA_FALSE;
5719
5720 ind = cur->pos;
5721 text = eina_ustrbuf_string_get(cur->node->unicode);
5722 if (text[ind]) ind++;
5723 /* Only allow pointing a null if it's the last paragraph.
5724 * because we don't have a PS there. */
5725 if (text[ind])
5726 {
5727 cur->pos = ind;
5728 return EINA_TRUE;
5729 }
5730 else
5731 {
5732 if (!evas_textblock_cursor_paragraph_next(cur))
5733 {
5734 /* If we already were at the end, that means we don't have
5735 * where to go next we should return FALSE */
5736 if (cur->pos == (size_t) ind)
5737 return EINA_FALSE;
5738
5739 cur->pos = ind;
5740 return EINA_TRUE;
5741 }
5742 else
5743 {
5744 return EINA_TRUE;
5745 }
5746 }
5747}
5748
5749EAPI Eina_Bool
5750evas_textblock_cursor_char_prev(Evas_Textblock_Cursor *cur)
5751{
5752 if (!cur) return EINA_FALSE;
5753 if (!cur->node) return EINA_FALSE;
5754
5755 if (cur->pos != 0)
5756 {
5757 cur->pos--;
5758 return EINA_TRUE;
5759 }
5760 return evas_textblock_cursor_paragraph_prev(cur);
5761}
5762
5763EAPI void
5764evas_textblock_cursor_paragraph_char_first(Evas_Textblock_Cursor *cur)
5765{
5766 if (!cur) return;
5767 cur->pos = 0;
5768
5769}
5770
5771EAPI void
5772evas_textblock_cursor_paragraph_char_last(Evas_Textblock_Cursor *cur)
5773{
5774 int ind;
5775
5776 if (!cur) return;
5777 if (!cur->node) return;
5778 ind = eina_ustrbuf_length_get(cur->node->unicode);
5779 /* If it's not the last paragraph, go back one, because we want to point
5780 * to the PS, not the NULL */
5781 if (EINA_INLIST_GET(cur->node)->next)
5782 ind--;
5783
5784 if (ind >= 0)
5785 cur->pos = ind;
5786 else
5787 cur->pos = 0;
5788
5789}
5790
5791EAPI void
5792evas_textblock_cursor_line_char_first(Evas_Textblock_Cursor *cur)
5793{
5794 Evas_Object_Textblock *o;
5795 Evas_Object_Textblock_Line *ln = NULL;
5796 Evas_Object_Textblock_Item *it = NULL;
5797
5798 if (!cur) return;
5799 if (!cur->node) return;
5800 o = (Evas_Object_Textblock *)(cur->obj->object_data);
5801 if (!o->formatted.valid) _relayout(cur->obj);
5802
5803 _find_layout_item_match(cur, &ln, &it);
5804
5805 if (!ln) return;
5806 if (ln->items)
5807 {
5808 Evas_Object_Textblock_Item *i;
5809 it = ln->items;
5810 EINA_INLIST_FOREACH(ln->items, i)
5811 {
5812 if (it->text_pos > i->text_pos)
5813 {
5814 it = i;
5815 }
5816 }
5817 }
5818 if (it)
5819 {
5820 cur->pos = it->text_pos;
5821 cur->node = it->text_node;
5822 }
5823}
5824
5825EAPI void
5826evas_textblock_cursor_line_char_last(Evas_Textblock_Cursor *cur)
5827{
5828 Evas_Object_Textblock *o;
5829 Evas_Object_Textblock_Line *ln = NULL;
5830 Evas_Object_Textblock_Item *it = NULL;
5831
5832 if (!cur) return;
5833 if (!cur->node) return;
5834 o = (Evas_Object_Textblock *)(cur->obj->object_data);
5835 if (!o->formatted.valid) _relayout(cur->obj);
5836
5837 _find_layout_item_match(cur, &ln, &it);
5838
5839 if (!ln) return;
5840 if (ln->items)
5841 {
5842 Evas_Object_Textblock_Item *i;
5843 it = ln->items;
5844 EINA_INLIST_FOREACH(ln->items, i)
5845 {
5846 if (it->text_pos < i->text_pos)
5847 {
5848 it = i;
5849 }
5850 }
5851 }
5852 if (it)
5853 {
5854 size_t ind;
5855
5856 cur->node = it->text_node;
5857 cur->pos = it->text_pos;
5858 if (it->type == EVAS_TEXTBLOCK_ITEM_TEXT)
5859 {
5860 ind = _ITEM_TEXT(it)->text_props.text_len - 1;
5861 if (!IS_AT_END(_ITEM_TEXT(it), ind)) ind++;
5862 cur->pos += ind;
5863 }
5864 else if (!EINA_INLIST_GET(ln)->next && !EINA_INLIST_GET(ln->par)->next)
5865 {
5866 cur->pos++;
5867 }
5868 }
5869}
5870
5871/**
5872 * @internal
5873 * checks if a format (as a string) is visible/changes format and sets the
5874 * fnode properties accordingly.
5875 *
5876 * @param fnode the format node
5877 * @param s the string.
5878 */
5879static void
5880_evas_textblock_format_is_visible(Evas_Object_Textblock_Node_Format *fnode,
5881 const char *s)
5882{
5883 const char *item;
5884 Eina_Bool is_opener = EINA_TRUE;
5885
5886 fnode->visible = fnode->format_change = EINA_FALSE;
5887 fnode->anchor = ANCHOR_NONE;
5888 if (!s) return;
5889
5890 if (s[0] == '+' || s[0] == '-')
5891 {
5892 is_opener = (s[0] == '+');
5893 s++;
5894 fnode->format_change = EINA_TRUE;
5895 }
5896
5897 while ((item = _format_parse(&s)))
5898 {
5899 int itlen = s - item;
5900 /* We care about all of the formats even after a - except for
5901 * item which we don't care after a - because it's just a standard
5902 * closing */
5903 if ((!strncmp(item, "\n", itlen) || !strncmp(item, "\\n", itlen)) ||
5904 (!strncmp(item, "\t", itlen) || !strncmp(item, "\\t", itlen)) ||
5905 (!strncmp(item, "ps", itlen) && (itlen >= 2)) ||
5906 (!strncmp(item, "item", itlen) && (itlen >= 4) && is_opener))
5907 {
5908 fnode->visible = EINA_TRUE;
5909 }
5910
5911 if (is_opener && !strncmp(item, "a", itlen))
5912 {
5913 fnode->anchor = ANCHOR_A;
5914 }
5915 else if (is_opener && !strncmp(item, "item", itlen) && (itlen >= 4))
5916 {
5917 fnode->anchor = ANCHOR_ITEM;
5918 }
5919 }
5920}
5921
5922/**
5923 * Sets the cursor to the position of where the fmt points to.
5924 *
5925 * @param cur the cursor to update.
5926 * @param fmt the format to set according to.
5927 * @return nothing.
5928 */
5929static void __UNUSED__
5930_evas_textblock_cursor_node_text_at_format(Evas_Textblock_Cursor *cur, Evas_Object_Textblock_Node_Format *fmt)
5931{
5932 Evas_Object_Textblock_Node_Text *text;
5933 Evas_Object_Textblock_Node_Format *base_format;
5934 Evas_Object_Textblock_Node_Format *itr;
5935 size_t position = 0;
5936
5937 if (!cur || !fmt) return;
5938 /* Find the main format node */
5939 text = fmt->text_node;
5940 cur->node = text;
5941 base_format = text->format_node;
5942 EINA_INLIST_FOREACH(base_format, itr)
5943 {
5944 if (itr == fmt)
5945 {
5946 break;
5947 }
5948 position += itr->offset;
5949 }
5950 cur->pos = position;
5951
5952}
5953
5954
5955/**
5956 * @internal
5957 * Remove pairs of + and - formats and also remove formats without + or -
5958 * i.e formats that pair to themselves. Only removes invisible formats
5959 * that pair themselves, if you want to remove invisible formats that pair
5960 * themselves, please first change fmt->visible to EINA_FALSE.
5961 *
5962 * @param o the textblock object.
5963 * @param fmt the current format.
5964 */
5965static void
5966_evas_textblock_node_format_remove_matching(Evas_Object_Textblock *o,
5967 Evas_Object_Textblock_Node_Format *fmt)
5968{
5969 Evas_Object_Textblock_Node_Text *tnode;
5970 Eina_List *formats = NULL;
5971 size_t offset = 0;
5972
5973 if (!fmt) return;
5974
5975 tnode = fmt->text_node;
5976
5977 do
5978 {
5979 Evas_Object_Textblock_Node_Format *nnode;
5980 const char *fstr = fmt->orig_format;
5981
5982 nnode = _NODE_FORMAT(EINA_INLIST_GET(fmt)->next);
5983 if (nnode)
5984 {
5985 offset = nnode->offset;
5986 }
5987
5988
5989 if (fstr && (*fstr == '+'))
5990 {
5991 formats = eina_list_prepend(formats, fmt);
5992 }
5993 else if (fstr && (*fstr == '-'))
5994 {
5995 Evas_Object_Textblock_Node_Format *fnode;
5996 size_t fstr_len;
5997 /* Skip the '-' */
5998 fstr++;
5999 fstr_len = strlen(fstr);
6000 /* Generic popper, just pop */
6001 if (((fstr[0] == ' ') && !fstr[1]) || !fstr[0])
6002 {
6003 fnode = eina_list_data_get(formats);
6004 formats = eina_list_remove_list(formats, formats);
6005 _evas_textblock_node_format_remove(o, fnode, 0);
6006 _evas_textblock_node_format_remove(o, fmt, 0);
6007 }
6008 /* Find the matching format and pop it, if the matching format
6009 * is our format, i.e the last one, pop and break. */
6010 else
6011 {
6012 Eina_List *i, *next;
6013 EINA_LIST_FOREACH_SAFE(formats, i, next, fnode)
6014 {
6015 if (_FORMAT_IS_CLOSER_OF(
6016 fnode->orig_format, fstr, fstr_len))
6017 {
6018 fnode = eina_list_data_get(i);
6019 formats = eina_list_remove_list(formats, i);
6020 _evas_textblock_node_format_remove(o, fnode, 0);
6021 _evas_textblock_node_format_remove(o, fmt, 0);
6022 break;
6023 }
6024 }
6025 }
6026 }
6027 else if (!fmt->visible)
6028 {
6029 _evas_textblock_node_format_remove(o, fmt, 0);
6030 }
6031 fmt = nnode;
6032 }
6033 while (fmt && (offset == 0) && (fmt->text_node == tnode));
6034 eina_list_free(formats);
6035}
6036/**
6037 * @internal
6038 * Add the offset (may be negative) to the first node after fmt which is
6039 * pointing to the text node tnode or to o->format_nodes if fmt is null
6040 * and it points to tnode.
6041 *
6042 * @param o the textblock object.
6043 * @param tnode the text node the format should point to.
6044 * @param fmt the current format.
6045 * @param offset the offest to add (may be negative).
6046 */
6047static void
6048_evas_textblock_node_format_adjust_offset(Evas_Object_Textblock *o,
6049 Evas_Object_Textblock_Node_Text *tnode,
6050 Evas_Object_Textblock_Node_Format *fmt, int offset)
6051{
6052 if (fmt)
6053 {
6054 fmt = _NODE_FORMAT(EINA_INLIST_GET(fmt)->next);
6055 }
6056 else
6057 {
6058 fmt = o->format_nodes;
6059 }
6060 if (fmt && (tnode == fmt->text_node))
6061 {
6062 fmt->offset += offset;
6063 }
6064}
6065
6066/**
6067 * @internal
6068 * Removes a format node updating the offset of the next format node and the
6069 * text nodes pointing to this node.
6070 *
6071 * @param o the textblock object.
6072 * @param n the fromat node to remove
6073 */
6074static void
6075_evas_textblock_node_format_remove(Evas_Object_Textblock *o, Evas_Object_Textblock_Node_Format *n, int visible_adjustment)
6076{
6077 /* Update the text nodes about the change */
6078 {
6079 Evas_Object_Textblock_Node_Format *nnode;
6080 nnode = _NODE_FORMAT(EINA_INLIST_GET(n)->next);
6081 /* If there's a next node that belongs to the same text node
6082 * and the curret node was the main one, advance the format node */
6083 if (nnode && (nnode->text_node == n->text_node))
6084 {
6085 if (nnode->text_node->format_node == n)
6086 {
6087 nnode->text_node->format_node = nnode;
6088 }
6089 }
6090 else
6091 {
6092 Evas_Object_Textblock_Node_Text *tnode;
6093 /* If there's no next one update the text nodes */
6094 nnode = _NODE_FORMAT(EINA_INLIST_GET(n)->prev);
6095 tnode = n->text_node;
6096 /* Even if it's not the current text_node's main node
6097 * it can still be the next's. */
6098 if (tnode && (tnode->format_node != n))
6099 {
6100 tnode = _NODE_TEXT(EINA_INLIST_GET(tnode)->next);
6101 }
6102 while (tnode && (tnode->format_node == n))
6103 {
6104 tnode->format_node = nnode;
6105 tnode = _NODE_TEXT(EINA_INLIST_GET(tnode)->next);
6106 }
6107 }
6108 }
6109 _evas_textblock_node_format_adjust_offset(o, n->text_node, n,
6110 n->offset - visible_adjustment);
6111
6112 o->format_nodes = _NODE_FORMAT(eina_inlist_remove(
6113 EINA_INLIST_GET(o->format_nodes), EINA_INLIST_GET(n)));
6114 _evas_textblock_node_format_free(o, n);
6115}
6116
6117/**
6118 * @internal
6119 * Sets all the offsets of the format nodes between start and end in the text
6120 * node n to 0 and sets visibility to EINA_FALSE.
6121 * If end == -1 end means the end of the string.
6122 * Assumes there is a prev node or the current node will be preserved.
6123 *
6124 * @param n the text node the positinos refer to.
6125 * @param start the start of where to delete from.
6126 * @param end the end of the section to delete, if end == -1 it means the end of the string.
6127 * @returns #EINA_TRUE if removed a PS, false otherwise.
6128 */
6129static Eina_Bool
6130_evas_textblock_node_text_adjust_offsets_to_start(Evas_Object_Textblock *o,
6131 Evas_Object_Textblock_Node_Text *n, size_t start, int end)
6132{
6133 Evas_Object_Textblock_Node_Format *last_node, *itr;
6134 Evas_Object_Textblock_Node_Text *new_node;
6135 int use_end = 1;
6136 int delta = 0;
6137 int first = 1;
6138 int update_format_node;
6139 size_t pos = 0;
6140 int orig_end;
6141
6142 itr = n->format_node;
6143 if (!itr || (itr->text_node != n)) return EINA_FALSE;
6144
6145 orig_end = end;
6146 if ((end < 0) || ((size_t) end == eina_ustrbuf_length_get(n->unicode)))
6147 {
6148 use_end = 0;
6149 }
6150 else if (end > 0)
6151 {
6152 /* We don't want the last one */
6153 end--;
6154 }
6155
6156 /* If we are not removing the text node, all should stay in this text
6157 * node, otherwise, everything should move to the previous node */
6158 if ((start == 0) && !use_end)
6159 {
6160 new_node = _NODE_TEXT(EINA_INLIST_GET(n)->prev);
6161 if (!new_node)
6162 {
6163 new_node = n;
6164 }
6165 }
6166 else
6167 {
6168 new_node = n;
6169 }
6170
6171 /* Find the first node after start */
6172 while (itr && (itr->text_node == n))
6173 {
6174 pos += itr->offset;
6175 if (pos >= start)
6176 {
6177 break;
6178 }
6179 itr = _NODE_FORMAT(EINA_INLIST_GET(itr)->next);
6180 }
6181
6182 if (!itr || (itr->text_node != n))
6183 {
6184 return EINA_FALSE;
6185 }
6186
6187 update_format_node = ((itr == n->format_node) && (new_node != n));
6188 delta = orig_end - pos;
6189 itr->offset -= pos - start;
6190
6191 while (itr && (itr->text_node == n))
6192 {
6193 last_node = itr;
6194 itr = _NODE_FORMAT(EINA_INLIST_GET(itr)->next);
6195
6196 if (!first)
6197 {
6198 pos += last_node->offset;
6199 }
6200
6201 /* start is negative when this gets relevant */
6202 if (use_end && (pos > (size_t) end))
6203 {
6204 last_node->offset -= delta;
6205 break;
6206 }
6207
6208 delta = orig_end - pos;
6209 if (!first)
6210 {
6211 last_node->offset = 0;
6212 }
6213 else
6214 {
6215 first = 0;
6216 }
6217 last_node->visible = EINA_FALSE;
6218
6219 if (!itr || (itr && (itr->text_node != n)))
6220 {
6221 /* Remove the PS, and return since it's the end of the node */
6222 if (_IS_PARAGRAPH_SEPARATOR(o, last_node->format))
6223 {
6224 _evas_textblock_node_format_remove(o, last_node, 0);
6225 return EINA_TRUE;
6226 }
6227
6228 }
6229 last_node->text_node = new_node;
6230 if (update_format_node)
6231 {
6232 n->format_node = last_node;
6233 }
6234 }
6235
6236 return EINA_FALSE;
6237}
6238
6239/**
6240 * @internal
6241 * Removes all the format nodes between start and end in the text node n.
6242 * This function updates the offset of the next format node and the
6243 * text nodes pointing to it. if end == -1 end means the end of the string.
6244 *
6245 * @param o the textblock object.
6246 * @param n the text node the positinos refer to.
6247 * @param start the start of where to delete from.
6248 * @param end the end of the section to delete, if end == -1 it means the end of the string.
6249 */
6250static void
6251_evas_textblock_node_text_remove_formats_between(Evas_Object_Textblock *o,
6252 Evas_Object_Textblock_Node_Text *n, int start, int end)
6253{
6254 Evas_Object_Textblock_Node_Format *itr;
6255 int use_end = 1;
6256 int offset = end - start;
6257 itr = n->format_node;
6258
6259 if (itr)
6260 start -= itr->offset;
6261 if (offset < 0) offset = 0;
6262 if (end < 0) use_end = 0;
6263 while (itr && (itr->text_node == n))
6264 {
6265 Evas_Object_Textblock_Node_Format *nnode;
6266 int tmp_offset = 0;
6267
6268 /* start is negative when this gets relevant */
6269 if ((offset + start < 0) && use_end)
6270 {
6271 break;
6272 }
6273 nnode = _NODE_FORMAT(EINA_INLIST_GET(itr)->next);
6274 if (nnode)
6275 {
6276 tmp_offset = nnode->offset;
6277 }
6278 if (start <= 0)
6279 {
6280 /* Don't do visible adjustments because we are removing the visual
6281 * chars anyway and taking those into account */
6282 _evas_textblock_node_format_remove(o, itr, 0);
6283 }
6284 start -= tmp_offset;
6285 itr = nnode;
6286 }
6287}
6288
6289/**
6290 * @internal
6291 * Returns the first format in the range between start and end in the textblock
6292 * n.
6293 *
6294 * @param o the textblock object.
6295 * @param n the text node the positinos refer to.
6296 * @param start the start of where to delete from.
6297 * @param end the end of the section to delete, if end == -1 it means the end of the string.
6298 */
6299static Evas_Object_Textblock_Node_Format *
6300_evas_textblock_node_text_get_first_format_between(
6301 Evas_Object_Textblock_Node_Text *n, int start, int end)
6302{
6303 Evas_Object_Textblock_Node_Format *itr;
6304 int use_end = 1;
6305 itr = n->format_node;
6306 if (end < 0) use_end = 0;
6307 while (itr && (itr->text_node == n))
6308 {
6309 start -= itr->offset;
6310 end -= itr->offset;
6311 if ((end <= 0) && use_end)
6312 {
6313 break;
6314 }
6315 if (start <= 0)
6316 {
6317 return itr;
6318 }
6319 itr = _NODE_FORMAT(EINA_INLIST_GET(itr)->next);
6320 }
6321 return NULL;
6322}
6323
6324/**
6325 * Removes a text node and the corresponding format nodes.
6326 *
6327 * @param o the textblock objec.t
6328 * @param n the node to remove.
6329 */
6330static void
6331_evas_textblock_node_text_remove(Evas_Object_Textblock *o, Evas_Object_Textblock_Node_Text *n)
6332{
6333 _evas_textblock_node_text_adjust_offsets_to_start(o, n, 0, -1);
6334
6335 o->text_nodes = _NODE_TEXT(eina_inlist_remove(
6336 EINA_INLIST_GET(o->text_nodes), EINA_INLIST_GET(n)));
6337 _evas_textblock_node_text_free(n);
6338}
6339
6340/**
6341 * @internal
6342 * Return the position where the formats starts at.
6343 *
6344 * @param fmt the format to return the position of.
6345 * @return the position of the format in the text node it points to.
6346 */
6347static size_t
6348_evas_textblock_node_format_pos_get(const Evas_Object_Textblock_Node_Format *fmt)
6349{
6350 Evas_Object_Textblock_Node_Text *text;
6351 Evas_Object_Textblock_Node_Format *base_format;
6352 Evas_Object_Textblock_Node_Format *itr;
6353 size_t position = 0;
6354
6355 if (!fmt) return 0;
6356 /* Find the main format node */
6357 text = fmt->text_node;
6358 base_format = text->format_node;
6359 EINA_INLIST_FOREACH(base_format, itr)
6360 {
6361 if (itr == fmt)
6362 {
6363 break;
6364 }
6365 position += itr->offset;
6366 }
6367 return position + fmt->offset;
6368}
6369
6370EAPI int
6371evas_textblock_cursor_pos_get(const Evas_Textblock_Cursor *cur)
6372{
6373 Evas_Object_Textblock *o;
6374 Evas_Object_Textblock_Node_Text *n;
6375 size_t npos = 0;
6376
6377 if (!cur) return -1;
6378 if (!cur->node) return 0;
6379 o = (Evas_Object_Textblock *)(cur->obj->object_data);
6380 n = o->text_nodes;
6381 while (n != cur->node)
6382 {
6383 npos += eina_ustrbuf_length_get(n->unicode);
6384 n = _NODE_TEXT(EINA_INLIST_GET(n)->next);
6385 }
6386 return npos + cur->pos;
6387}
6388
6389EAPI void
6390evas_textblock_cursor_pos_set(Evas_Textblock_Cursor *cur, int _pos)
6391{
6392 Evas_Object_Textblock *o;
6393 Evas_Object_Textblock_Node_Text *n;
6394 size_t pos;
6395
6396 if (!cur) return;
6397 o = (Evas_Object_Textblock *)(cur->obj->object_data);
6398
6399 if (_pos < 0)
6400 {
6401 pos = 0;
6402 }
6403 else
6404 {
6405 pos = (size_t) _pos;
6406 }
6407
6408 n = o->text_nodes;
6409 while (n && (pos >= eina_ustrbuf_length_get(n->unicode)))
6410 {
6411 pos -= eina_ustrbuf_length_get(n->unicode);
6412 n = _NODE_TEXT(EINA_INLIST_GET(n)->next);
6413 }
6414
6415 if (n)
6416 {
6417 cur->node = n;
6418 cur->pos = pos;
6419 }
6420 else if (o->text_nodes)
6421 {
6422 /* In case we went pass the last node, we need to put the cursor
6423 * at the absolute end. */
6424 Evas_Object_Textblock_Node_Text *last_n;
6425
6426 last_n = _NODE_TEXT(EINA_INLIST_GET(o->text_nodes)->last);
6427 pos = eina_ustrbuf_length_get(last_n->unicode);
6428
6429 cur->node = last_n;
6430 cur->pos = pos;
6431 }
6432
6433}
6434
6435EAPI Eina_Bool
6436evas_textblock_cursor_line_set(Evas_Textblock_Cursor *cur, int line)
6437{
6438 Evas_Object_Textblock *o;
6439 Evas_Object_Textblock_Line *ln;
6440 Evas_Object_Textblock_Item *it;
6441
6442 if (!cur) return EINA_FALSE;
6443 o = (Evas_Object_Textblock *)(cur->obj->object_data);
6444 if (!o->formatted.valid) _relayout(cur->obj);
6445
6446 ln = _find_layout_line_num(cur->obj, line);
6447 if (!ln) return EINA_FALSE;
6448 it = (Evas_Object_Textblock_Item *)ln->items;
6449 if (it)
6450 {
6451 cur->pos = it->text_pos;
6452 cur->node = it->text_node;
6453 }
6454 else
6455 {
6456 cur->pos = 0;
6457
6458 cur->node = o->text_nodes;
6459 }
6460 return EINA_TRUE;
6461}
6462
6463EAPI int
6464evas_textblock_cursor_compare(const Evas_Textblock_Cursor *cur1, const Evas_Textblock_Cursor *cur2)
6465{
6466 Eina_Inlist *l1, *l2;
6467
6468 if (!cur1) return 0;
6469 if (!cur2) return 0;
6470 if (cur1->obj != cur2->obj) return 0;
6471 if ((!cur1->node) || (!cur2->node)) return 0;
6472 if (cur1->node == cur2->node)
6473 {
6474 if (cur1->pos < cur2->pos) return -1; /* cur1 < cur2 */
6475 else if (cur1->pos > cur2->pos) return 1; /* cur2 < cur1 */
6476 return 0;
6477 }
6478 for (l1 = EINA_INLIST_GET(cur1->node),
6479 l2 = EINA_INLIST_GET(cur1->node); (l1) || (l2);)
6480 {
6481 if (l1 == EINA_INLIST_GET(cur2->node)) return 1; /* cur2 < cur 1 */
6482 else if (l2 == EINA_INLIST_GET(cur2->node)) return -1; /* cur1 < cur 2 */
6483 else if (!l1) return -1; /* cur1 < cur 2 */
6484 else if (!l2) return 1; /* cur2 < cur 1 */
6485 l1 = l1->prev;
6486 l2 = l2->next;
6487 }
6488 return 0;
6489}
6490
6491EAPI void
6492evas_textblock_cursor_copy(const Evas_Textblock_Cursor *cur, Evas_Textblock_Cursor *cur_dest)
6493{
6494 if (!cur) return;
6495 if (!cur_dest) return;
6496 if (cur->obj != cur_dest->obj) return;
6497 cur_dest->pos = cur->pos;
6498 cur_dest->node = cur->node;
6499
6500}
6501
6502
6503/* text controls */
6504/**
6505 * @internal
6506 * Free a text node. Shouldn't be used usually, it's better to use
6507 * @ref _evas_textblock_node_text_remove for most cases .
6508 *
6509 * @param n the text node to free
6510 * @see _evas_textblock_node_text_remove
6511 */
6512static void
6513_evas_textblock_node_text_free(Evas_Object_Textblock_Node_Text *n)
6514{
6515 if (!n) return;
6516 eina_ustrbuf_free(n->unicode);
6517 if (n->utf8)
6518 free(n->utf8);
6519 if (n->par)
6520 n->par->text_node = NULL;
6521 free(n);
6522}
6523
6524/**
6525 * @internal
6526 * Create a new text node
6527 *
6528 * @return the new text node.
6529 */
6530static Evas_Object_Textblock_Node_Text *
6531_evas_textblock_node_text_new(void)
6532{
6533 Evas_Object_Textblock_Node_Text *n;
6534
6535 n = calloc(1, sizeof(Evas_Object_Textblock_Node_Text));
6536 n->unicode = eina_ustrbuf_new();
6537 /* We want to layout each paragraph at least once. */
6538 n->dirty = EINA_TRUE;
6539 n->is_new = EINA_TRUE;
6540
6541 return n;
6542}
6543
6544/**
6545 * @internal
6546 * Break a paragraph. This does not add a PS but only splits the paragraph
6547 * where a ps was just added!
6548 *
6549 * @param cur the cursor to break at.
6550 * @param fnode the format node of the PS just added.
6551 * @return Returns no value.
6552 */
6553static void
6554_evas_textblock_cursor_break_paragraph(Evas_Textblock_Cursor *cur,
6555 Evas_Object_Textblock_Node_Format *fnode)
6556{
6557 Evas_Object_Textblock *o;
6558 Evas_Object_Textblock_Node_Text *n;
6559
6560 if (!cur) return;
6561 o = (Evas_Object_Textblock *)(cur->obj->object_data);
6562
6563 n = _evas_textblock_node_text_new();
6564 o->text_nodes = _NODE_TEXT(eina_inlist_append_relative(
6565 EINA_INLIST_GET(o->text_nodes),
6566 EINA_INLIST_GET(n),
6567 EINA_INLIST_GET(cur->node)));
6568 /* Handle text and format changes. */
6569 if (cur->node)
6570 {
6571 Evas_Object_Textblock_Node_Format *nnode;
6572 size_t len, start;
6573 const Eina_Unicode *text;
6574
6575 /* If there was a format node in the delete range,
6576 * make it our format and update the text_node fields,
6577 * otherwise, use the paragraph separator
6578 * of the previous paragraph. */
6579 nnode = _NODE_FORMAT(EINA_INLIST_GET(fnode)->next);
6580 if (nnode && (nnode->text_node == cur->node))
6581 {
6582 n->format_node = nnode;
6583 nnode->offset--; /* We don't have to take the replacement char
6584 into account anymore */
6585 while (nnode && (nnode->text_node == cur->node))
6586 {
6587 nnode->text_node = n;
6588 nnode = _NODE_FORMAT(EINA_INLIST_GET(nnode)->next);
6589 }
6590 }
6591 else
6592 {
6593 n->format_node = fnode;
6594 }
6595
6596 /* cur->pos now points to the PS, move after. */
6597 start = cur->pos + 1;
6598 len = eina_ustrbuf_length_get(cur->node->unicode) - start;
6599 if (len > 0)
6600 {
6601 text = eina_ustrbuf_string_get(cur->node->unicode);
6602 eina_ustrbuf_append_length(n->unicode, text + start, len);
6603 eina_ustrbuf_remove(cur->node->unicode, start, start + len);
6604 cur->node->dirty = EINA_TRUE;
6605 }
6606 }
6607 else
6608 {
6609 fnode = o->format_nodes;
6610 if (fnode)
6611 {
6612 fnode = _NODE_FORMAT(EINA_INLIST_GET(fnode)->last);
6613 }
6614 n->format_node = fnode;
6615 }
6616}
6617
6618/**
6619 * @internal
6620 * Set the node and offset of all the curs after cur.
6621 *
6622 * @param cur the cursor.
6623 * @param n the current textblock node.
6624 * @param new_node the new node to set.
6625 */
6626static void
6627_evas_textblock_cursors_set_node(Evas_Object_Textblock *o,
6628 const Evas_Object_Textblock_Node_Text *n,
6629 Evas_Object_Textblock_Node_Text *new_node)
6630{
6631 Eina_List *l;
6632 Evas_Textblock_Cursor *data;
6633
6634 if (n == o->cursor->node)
6635 {
6636 o->cursor->pos = 0;
6637 o->cursor->node = new_node;
6638 }
6639 EINA_LIST_FOREACH(o->cursors, l, data)
6640 {
6641 if (n == data->node)
6642 {
6643 data->pos = 0;
6644 data->node = new_node;
6645 }
6646 }
6647}
6648
6649/**
6650 * @internal
6651 * Update the offset of all the cursors after cur.
6652 *
6653 * @param cur the cursor.
6654 * @param n the current textblock node.
6655 * @param start the starting pos.
6656 * @param offset how much to adjust (can be negative).
6657 */
6658static void
6659_evas_textblock_cursors_update_offset(const Evas_Textblock_Cursor *cur,
6660 const Evas_Object_Textblock_Node_Text *n,
6661 size_t start, int offset)
6662{
6663 Eina_List *l;
6664 Evas_Textblock_Cursor *data;
6665 Evas_Object_Textblock *o;
6666 o = (Evas_Object_Textblock *)(cur->obj->object_data);
6667
6668 if (cur != o->cursor)
6669 {
6670 if ((n == o->cursor->node) &&
6671 (o->cursor->pos > start))
6672 {
6673 if ((offset < 0) && (o->cursor->pos <= (size_t) (-1 * offset)))
6674 {
6675 o->cursor->pos = 0;
6676 }
6677 else
6678 {
6679 o->cursor->pos += offset;
6680 }
6681 }
6682 }
6683 EINA_LIST_FOREACH(o->cursors, l, data)
6684 {
6685 if (data != cur)
6686 {
6687 if ((n == data->node) &&
6688 (data->pos > start))
6689 {
6690 if ((offset < 0) && (data->pos <= (size_t) (-1 * offset)))
6691 {
6692 data->pos = 0;
6693 }
6694 else
6695 {
6696 data->pos += offset;
6697 }
6698 }
6699 else if (!data->node)
6700 {
6701 data->node = o->text_nodes;
6702 data->pos = 0;
6703 }
6704 }
6705 }
6706}
6707
6708/**
6709 * @internal
6710 * Mark that the textblock has changed.
6711 *
6712 * @param o the textblock object.
6713 * @param obj the evas object.
6714 */
6715static void
6716_evas_textblock_changed(Evas_Object_Textblock *o, Evas_Object *obj)
6717{
6718 o->formatted.valid = 0;
6719 o->native.valid = 0;
6720 o->content_changed = 1;
6721 if (o->markup_text)
6722 {
6723 free(o->markup_text);
6724 o->markup_text = NULL;
6725 }
6726
6727 evas_object_change(obj);
6728}
6729
6730static void
6731_evas_textblock_invalidate_all(Evas_Object_Textblock *o)
6732{
6733 Evas_Object_Textblock_Node_Text *n;
6734
6735 EINA_INLIST_FOREACH(o->text_nodes, n)
6736 {
6737 n->dirty = EINA_TRUE;
6738 }
6739}
6740
6741EAPI int
6742evas_textblock_cursor_text_append(Evas_Textblock_Cursor *cur, const char *_text)
6743{
6744 Evas_Object_Textblock *o;
6745 Evas_Object_Textblock_Node_Text *n;
6746 Evas_Object_Textblock_Node_Format *fnode = NULL;
6747 Eina_Unicode *text;
6748 int len = 0;
6749
6750 if (!cur) return 0;
6751 text = eina_unicode_utf8_to_unicode(_text, &len);
6752 o = (Evas_Object_Textblock *)(cur->obj->object_data);
6753
6754 n = cur->node;
6755 if (n)
6756 {
6757 Evas_Object_Textblock_Node_Format *nnode;
6758 fnode = _evas_textblock_cursor_node_format_before_or_at_pos_get(cur);
6759 fnode = _evas_textblock_node_format_last_at_off(fnode);
6760 /* find the node after the current in the same paragraph
6761 * either we find one and then take the next, or we try to get
6762 * the first for the paragraph which must be after our position */
6763 if (fnode)
6764 {
6765 if (!evas_textblock_cursor_format_is_visible_get(cur))
6766 {
6767 nnode = _NODE_FORMAT(EINA_INLIST_GET(fnode)->next);
6768 if (nnode && (nnode->text_node == n))
6769 {
6770 fnode = nnode;
6771 }
6772 else
6773 {
6774 fnode = NULL;
6775 }
6776 }
6777 }
6778 else
6779 {
6780 fnode = n->format_node;
6781 }
6782 }
6783 else if (o->text_nodes)
6784 {
6785 n = cur->node = o->text_nodes;
6786 cur->pos = 0;
6787 }
6788 else
6789 {
6790 n = _evas_textblock_node_text_new();
6791 o->text_nodes = _NODE_TEXT(eina_inlist_append(
6792 EINA_INLIST_GET(o->text_nodes),
6793 EINA_INLIST_GET(n)));
6794 cur->node = n;
6795 }
6796
6797 eina_ustrbuf_insert_length(n->unicode, text, len, cur->pos);
6798 /* Advance the formats */
6799 if (fnode && (fnode->text_node == cur->node))
6800 fnode->offset += len;
6801
6802 /* Update all the cursors after our position. */
6803 _evas_textblock_cursors_update_offset(cur, cur->node, cur->pos, len);
6804
6805 _evas_textblock_changed(o, cur->obj);
6806 n->dirty = EINA_TRUE;
6807 free(text);
6808
6809 if (!o->cursor->node)
6810 o->cursor->node = o->text_nodes;
6811 return len;
6812}
6813
6814EAPI int
6815evas_textblock_cursor_text_prepend(Evas_Textblock_Cursor *cur, const char *_text)
6816{
6817 int len;
6818 /*append is essentially prepend without advancing */
6819 len = evas_textblock_cursor_text_append(cur, _text);
6820 cur->pos += len; /*Advance */
6821 return len;
6822}
6823
6824/**
6825 * @internal
6826 * Free a format node
6827 *
6828 * @param o the textblock object
6829 * @param n the format node to free
6830 */
6831static void
6832_evas_textblock_node_format_free(Evas_Object_Textblock *o,
6833 Evas_Object_Textblock_Node_Format *n)
6834{
6835 if (!n) return;
6836 eina_stringshare_del(n->format);
6837 eina_stringshare_del(n->orig_format);
6838 if (n->anchor == ANCHOR_ITEM)
6839 o->anchors_item = eina_list_remove(o->anchors_item, n);
6840 else if (n->anchor == ANCHOR_A)
6841 o->anchors_a = eina_list_remove(o->anchors_a, n);
6842 free(n);
6843}
6844
6845/**
6846 * @internal
6847 * Create a new format node.
6848 *
6849 * @param format the text to create the format node from.
6850 * @param o the textblock object.
6851 * @return Returns the new format node
6852 */
6853static Evas_Object_Textblock_Node_Format *
6854_evas_textblock_node_format_new(Evas_Object_Textblock *o, const char *_format)
6855{
6856 Evas_Object_Textblock_Node_Format *n;
6857 const char *format = _format;
6858
6859 n = calloc(1, sizeof(Evas_Object_Textblock_Node_Format));
6860 /* Create orig_format and format */
6861 if (format[0] == '<')
6862 {
6863 const char *match;
6864 size_t format_len;
6865 size_t replace_len;
6866
6867 format++; /* Advance after '<' */
6868 format_len = strlen(format);
6869 if (format[format_len - 1] == '>')
6870 format_len--; /* We don't care about '>' */
6871
6872 match = _style_match_tag(o->style, format, format_len, &replace_len);
6873 if (match)
6874 {
6875 if ((match[0] == '+') || (match[0] == '-'))
6876 {
6877 char *norm_format;
6878 norm_format = malloc(format_len + 2 + 1);
6879 memcpy(norm_format, match, 2);
6880 memcpy(norm_format + 2, format, format_len);
6881 norm_format[format_len + 2] = '\0';
6882 n->orig_format =
6883 eina_stringshare_add_length(norm_format, format_len + 2);
6884 free(norm_format);
6885 }
6886 else
6887 {
6888 n->orig_format =
6889 eina_stringshare_add_length(format, format_len);
6890 }
6891 n->format = eina_stringshare_add(match);
6892 }
6893 else
6894 {
6895 char *norm_format;
6896
6897 norm_format = malloc(format_len + 2 + 1);
6898 if (norm_format)
6899 {
6900 if (format[0] == '/')
6901 {
6902 memcpy(norm_format, "- ", 2);
6903 memcpy(norm_format + 2, format + 1, format_len - 1);
6904 norm_format[format_len + 2 - 1] = '\0';
6905 }
6906 else
6907 {
6908 memcpy(norm_format, "+ ", 2);
6909 memcpy(norm_format + 2, format, format_len);
6910 norm_format[format_len + 2] = '\0';
6911 }
6912 n->orig_format = eina_stringshare_add(norm_format);
6913 free(norm_format);
6914 }
6915 n->format = eina_stringshare_ref(n->orig_format);
6916 }
6917 }
6918 /* Just use as is, it's a special format. */
6919 else
6920 {
6921 n->orig_format = eina_stringshare_add(format);
6922 n->format = eina_stringshare_ref(n->orig_format);
6923 }
6924
6925 format = n->format;
6926
6927 _evas_textblock_format_is_visible(n, format);
6928 if (n->anchor == ANCHOR_A)
6929 {
6930 o->anchors_a = eina_list_append(o->anchors_a, n);
6931 }
6932 else if (n->anchor == ANCHOR_ITEM)
6933 {
6934 o->anchors_item = eina_list_append(o->anchors_item, n);
6935 }
6936 n->is_new = EINA_TRUE;
6937
6938 return n;
6939}
6940
6941static Eina_Bool
6942_evas_textblock_cursor_is_at_the_end(const Evas_Textblock_Cursor *cur)
6943{
6944 const Eina_Unicode *text;
6945
6946 if (!cur) return EINA_FALSE;
6947 if (!cur->node) return EINA_FALSE;
6948 text = eina_ustrbuf_string_get(cur->node->unicode);
6949 return ((text[cur->pos] == 0) && (!EINA_INLIST_GET(cur->node)->next)) ?
6950 EINA_TRUE : EINA_FALSE;
6951}
6952
6953EAPI Eina_Bool
6954evas_textblock_cursor_format_append(Evas_Textblock_Cursor *cur, const char *format)
6955{
6956 Evas_Object_Textblock *o;
6957 Evas_Object_Textblock_Node_Format *n;
6958 Eina_Bool is_visible;
6959
6960 if (!cur) return EINA_FALSE;
6961 if ((!format) || (format[0] == 0)) return EINA_FALSE;
6962 o = (Evas_Object_Textblock *)(cur->obj->object_data);
6963 /* We should always have at least one text node */
6964 if (!o->text_nodes)
6965 {
6966 evas_textblock_cursor_text_prepend(cur, "");
6967 }
6968
6969 n = _evas_textblock_node_format_new(o, format);
6970 is_visible = n->visible;
6971 format = n->format;
6972 if (!cur->node)
6973 {
6974 o->format_nodes = _NODE_FORMAT(eina_inlist_append(
6975 EINA_INLIST_GET(o->format_nodes),
6976 EINA_INLIST_GET(n)));
6977 cur->pos = 0;
6978 n->text_node = (EINA_INLIST_GET(n)->prev) ?
6979 _NODE_FORMAT(EINA_INLIST_GET(n)->prev)->text_node :
6980 o->text_nodes;
6981 cur->node = n->text_node;
6982 }
6983 else
6984 {
6985 Evas_Object_Textblock_Node_Format *fmt;
6986 fmt = _evas_textblock_cursor_node_format_before_or_at_pos_get(cur);
6987 n->text_node = cur->node;
6988 if (!fmt)
6989 {
6990 o->format_nodes = _NODE_FORMAT(eina_inlist_prepend(
6991 EINA_INLIST_GET(o->format_nodes),
6992 EINA_INLIST_GET(n)));
6993 n->offset = cur->pos;
6994 }
6995 else
6996 {
6997 if (evas_textblock_cursor_format_is_visible_get(cur))
6998 {
6999 o->format_nodes = _NODE_FORMAT(eina_inlist_prepend_relative(
7000 EINA_INLIST_GET(o->format_nodes),
7001 EINA_INLIST_GET(n),
7002 EINA_INLIST_GET(fmt)
7003 ));
7004 n->offset = fmt->offset;
7005 if (fmt->text_node->format_node == fmt)
7006 {
7007 fmt->text_node->format_node = n;
7008 }
7009 }
7010 else
7011 {
7012 fmt = _evas_textblock_node_format_last_at_off(fmt);
7013 o->format_nodes = _NODE_FORMAT(eina_inlist_append_relative(
7014 EINA_INLIST_GET(o->format_nodes),
7015 EINA_INLIST_GET(n),
7016 EINA_INLIST_GET(fmt)
7017 ));
7018 if (fmt->text_node != cur->node)
7019 {
7020 n->offset = cur->pos;
7021 }
7022 else
7023 {
7024 n->offset = cur->pos -
7025 _evas_textblock_node_format_pos_get(fmt);
7026 }
7027 }
7028 }
7029 /* Adjust differently if we insert a format char */
7030 if (is_visible)
7031 {
7032 _evas_textblock_node_format_adjust_offset(o, cur->node, n,
7033 -(n->offset - 1));
7034 }
7035 else
7036 {
7037 _evas_textblock_node_format_adjust_offset(o, cur->node, n,
7038 -n->offset);
7039 }
7040
7041 if (!fmt || (fmt->text_node != cur->node))
7042 {
7043 cur->node->format_node = n;
7044 }
7045 }
7046 if (is_visible && cur->node)
7047 {
7048 Eina_Unicode insert_char;
7049 /* Insert a visual representation according to the type of the
7050 format */
7051 if (_IS_PARAGRAPH_SEPARATOR(o, format))
7052 insert_char = _PARAGRAPH_SEPARATOR;
7053 else if (_IS_LINE_SEPARATOR(format))
7054 insert_char = '\n';
7055 else if (_IS_TAB(format))
7056 insert_char = '\t';
7057 else
7058 insert_char = EVAS_TEXTBLOCK_REPLACEMENT_CHAR;
7059
7060 eina_ustrbuf_insert_char(cur->node->unicode, insert_char, cur->pos);
7061
7062 /* Advance all the cursors after our cursor */
7063 _evas_textblock_cursors_update_offset(cur, cur->node, cur->pos, 1);
7064 if (_IS_PARAGRAPH_SEPARATOR(o, format))
7065 {
7066 _evas_textblock_cursor_break_paragraph(cur, n);
7067 }
7068 else
7069 {
7070 /* Handle visible format nodes here */
7071 cur->node->dirty = EINA_TRUE;
7072 n->is_new = EINA_FALSE;
7073 }
7074 }
7075 else
7076 {
7077 o->format_changed = EINA_TRUE;
7078 }
7079
7080 _evas_textblock_changed(o, cur->obj);
7081
7082 if (!o->cursor->node)
7083 o->cursor->node = o->text_nodes;
7084 return is_visible;
7085}
7086
7087EAPI Eina_Bool
7088evas_textblock_cursor_format_prepend(Evas_Textblock_Cursor *cur, const char *format)
7089{
7090 Eina_Bool is_visible;
7091 /* append is essentially prepend without advancing */
7092 is_visible = evas_textblock_cursor_format_append(cur, format);
7093 if (is_visible)
7094 {
7095 /* Advance after the replacement char */
7096 evas_textblock_cursor_char_next(cur);
7097 }
7098
7099 return is_visible;
7100}
7101
7102
7103EAPI void
7104evas_textblock_cursor_char_delete(Evas_Textblock_Cursor *cur)
7105{
7106 Evas_Object_Textblock *o;
7107 Evas_Object_Textblock_Node_Text *n, *n2;
7108 const Eina_Unicode *text;
7109 int chr, ind, ppos;
7110
7111 if (!cur || !cur->node) return;
7112 o = (Evas_Object_Textblock *)(cur->obj->object_data);
7113 n = cur->node;
7114
7115 text = eina_ustrbuf_string_get(n->unicode);
7116 ind = cur->pos;
7117 if (text[ind])
7118 chr = text[ind++];
7119 else
7120 chr = 0;
7121
7122 if (chr == 0) return;
7123 ppos = cur->pos;
7124 eina_ustrbuf_remove(n->unicode, cur->pos, ind);
7125 /* Remove a format node if needed, and remove the char only if the
7126 * fmt node is not visible */
7127 {
7128 Eina_Bool should_merge = EINA_FALSE;
7129 Evas_Object_Textblock_Node_Format *fmt, *fmt2;
7130 fmt = _evas_textblock_cursor_node_format_at_pos_get(cur);
7131 if (fmt)
7132 {
7133 const char *format = NULL;
7134 Evas_Object_Textblock_Node_Format *last_fmt;
7135 /* If there's a PS it must be the last become it delimits paragraphs */
7136 last_fmt = _evas_textblock_node_format_last_at_off(fmt);
7137 format = last_fmt->format;
7138 if (format && _IS_PARAGRAPH_SEPARATOR(o, format))
7139 {
7140 /* If it was a paragraph separator, we should merge the
7141 * current with the next, there must be a next. */
7142 should_merge = EINA_TRUE;
7143 }
7144 /* If a singnular, mark as invisible, so we'll delete it. */
7145 if (!format || ((*format != '+') && (*format != '-')))
7146 {
7147 last_fmt->visible = EINA_FALSE;
7148 }
7149 }
7150
7151 fmt2 = _evas_textblock_cursor_node_format_before_or_at_pos_get(cur);
7152 fmt2 = _evas_textblock_node_format_last_at_off(fmt2);
7153 _evas_textblock_node_format_adjust_offset(o, cur->node, fmt2,
7154 -(ind - cur->pos));
7155
7156 if (should_merge)
7157 {
7158 _evas_textblock_cursor_nodes_merge(cur);
7159 }
7160
7161 _evas_textblock_node_format_remove_matching(o, fmt);
7162 }
7163
7164 if (cur->pos == eina_ustrbuf_length_get(n->unicode))
7165 {
7166 n2 = _NODE_TEXT(EINA_INLIST_GET(n)->next);
7167 if (n2)
7168 {
7169 cur->node = n2;
7170 cur->pos = 0;
7171 }
7172 }
7173
7174 _evas_textblock_cursors_update_offset(cur, n, ppos, -(ind - ppos));
7175 _evas_textblock_changed(o, cur->obj);
7176 cur->node->dirty = EINA_TRUE;
7177}
7178
7179EAPI void
7180evas_textblock_cursor_range_delete(Evas_Textblock_Cursor *cur1, Evas_Textblock_Cursor *cur2)
7181{
7182 Evas_Object_Textblock_Node_Format *fnode = NULL;
7183 Evas_Object_Textblock *o;
7184 Evas_Object_Textblock_Node_Text *n1, *n2;
7185 Eina_Bool should_merge = EINA_FALSE, reset_cursor = EINA_FALSE;
7186
7187 if (!cur1 || !cur1->node) return;
7188 if (!cur2 || !cur2->node) return;
7189 if (cur1->obj != cur2->obj) return;
7190 o = (Evas_Object_Textblock *)(cur1->obj->object_data);
7191 if (evas_textblock_cursor_compare(cur1, cur2) > 0)
7192 {
7193 Evas_Textblock_Cursor *tc;
7194
7195 tc = cur1;
7196 cur1 = cur2;
7197 cur2 = tc;
7198 }
7199 n1 = cur1->node;
7200 n2 = cur2->node;
7201 if ((evas_textblock_cursor_compare(o->cursor, cur1) >= 0) &&
7202 (evas_textblock_cursor_compare(cur2, o->cursor) >= 0))
7203 {
7204 reset_cursor = EINA_TRUE;
7205 }
7206
7207
7208 if (n1 == n2)
7209 {
7210 if ((cur1->pos == 0) &&
7211 (cur2->pos == eina_ustrbuf_length_get(n1->unicode)))
7212 {
7213 _evas_textblock_node_text_remove_formats_between(o, n1, 0, -1);
7214 }
7215 else
7216 {
7217 should_merge = _evas_textblock_node_text_adjust_offsets_to_start(o,
7218 n1, cur1->pos, cur2->pos);
7219 }
7220 eina_ustrbuf_remove(n1->unicode, cur1->pos, cur2->pos);
7221 _evas_textblock_cursors_update_offset(cur1, cur1->node, cur1->pos, - (cur2->pos - cur1->pos));
7222 }
7223 else
7224 {
7225 Evas_Object_Textblock_Node_Text *n;
7226 int len;
7227 _evas_textblock_node_text_adjust_offsets_to_start(o, n1, cur1->pos, -1);
7228 n = _NODE_TEXT(EINA_INLIST_GET(n1)->next);
7229 /* Remove all the text nodes between */
7230 while (n && (n != n2))
7231 {
7232 Evas_Object_Textblock_Node_Text *nnode;
7233
7234 nnode = _NODE_TEXT(EINA_INLIST_GET(n)->next);
7235 _evas_textblock_cursors_set_node(o, n, n1);
7236 _evas_textblock_node_text_remove(o, n);
7237 n = nnode;
7238 }
7239 should_merge = _evas_textblock_node_text_adjust_offsets_to_start(o, n2,
7240 0, cur2->pos);
7241
7242 /* Remove the formats and the strings in the first and last nodes */
7243 len = eina_ustrbuf_length_get(n1->unicode);
7244 eina_ustrbuf_remove(n1->unicode, cur1->pos, len);
7245 eina_ustrbuf_remove(n2->unicode, 0, cur2->pos);
7246 /* Merge the nodes because we removed the PS */
7247 _evas_textblock_cursors_update_offset(cur1, cur1->node, cur1->pos,
7248 - cur1->pos);
7249 _evas_textblock_cursors_update_offset(cur2, cur2->node, 0, - cur2->pos);
7250 _evas_textblock_nodes_merge(o, n1);
7251 }
7252 fnode = _evas_textblock_cursor_node_format_at_pos_get(cur1);
7253
7254 if (should_merge)
7255 {
7256 /* We call this function instead of the cursor one because we already
7257 * updated the cursors */
7258 _evas_textblock_nodes_merge(o, n1);
7259 }
7260 _evas_textblock_node_format_remove_matching(o, fnode);
7261
7262 evas_textblock_cursor_copy(cur1, cur2);
7263 if (reset_cursor)
7264 evas_textblock_cursor_copy(cur1, o->cursor);
7265
7266 _evas_textblock_changed(o, cur1->obj);
7267 n1->dirty = n2->dirty = EINA_TRUE;
7268}
7269
7270
7271EAPI char *
7272evas_textblock_cursor_content_get(const Evas_Textblock_Cursor *cur)
7273{
7274 const Eina_Unicode *ustr;
7275 Eina_Unicode buf[2];
7276 char *s;
7277 if (!cur || !cur->node) return NULL;
7278 if (evas_textblock_cursor_format_is_visible_get(cur))
7279 {
7280 size_t len;
7281 const char *fstr;
7282 char *ret;
7283 int pop = 0;
7284 fstr = evas_textblock_node_format_text_get(
7285 _evas_textblock_node_visible_at_pos_get(
7286 evas_textblock_cursor_format_get(cur)));
7287
7288 if (!fstr)
7289 return NULL;
7290
7291 if (*fstr == '-') pop = 1;
7292 while ((*fstr == ' ') || (*fstr == '+') || (*fstr == '-')) fstr++;
7293 len = strlen(fstr);
7294
7295 {
7296 char *tmp;
7297 if (pop)
7298 {
7299 ret = tmp = malloc(len + 3 + 1); /* </> and the null */
7300 memcpy(tmp, "</", 2);
7301 tmp += 2;
7302 }
7303 else
7304 {
7305 ret = tmp = malloc(len + 2 + 1); /* <> and the null */
7306 *tmp = '<';
7307 tmp++;
7308 }
7309 memcpy(tmp, fstr, len);
7310 memcpy(tmp + len, ">", 2); /* Including the null */
7311 }
7312
7313 return ret;
7314 }
7315
7316 ustr = eina_ustrbuf_string_get(cur->node->unicode);
7317 buf[0] = ustr[cur->pos];
7318 buf[1] = 0;
7319 s = eina_unicode_unicode_to_utf8(buf, NULL);
7320
7321 return s;
7322}
7323
7324static char *
7325_evas_textblock_cursor_range_text_markup_get(const Evas_Textblock_Cursor *cur1, const Evas_Textblock_Cursor *_cur2)
7326{
7327 Evas_Object_Textblock *o;
7328 Evas_Object_Textblock_Node_Text *tnode;
7329 Eina_Strbuf *buf;
7330 Evas_Textblock_Cursor *cur2;
7331 buf = eina_strbuf_new();
7332
7333 if (!cur1 || !cur1->node) return NULL;
7334 if (!_cur2 || !_cur2->node) return NULL;
7335 if (cur1->obj != _cur2->obj) return NULL;
7336 o = (Evas_Object_Textblock *)(cur1->obj->object_data);
7337 if (evas_textblock_cursor_compare(cur1, _cur2) > 0)
7338 {
7339 const Evas_Textblock_Cursor *tc;
7340
7341 tc = cur1;
7342 cur1 = _cur2;
7343 _cur2 = tc;
7344 }
7345 /* Work on a local copy of the cur */
7346 cur2 = alloca(sizeof(Evas_Textblock_Cursor));
7347 cur2->obj = _cur2->obj;
7348 evas_textblock_cursor_copy(_cur2, cur2);
7349
7350 /* Parse the text between the cursors. */
7351 for (tnode = cur1->node ; tnode ;
7352 tnode = _NODE_TEXT(EINA_INLIST_GET(tnode)->next))
7353 {
7354 Evas_Object_Textblock_Node_Format *fnode;
7355 Eina_Unicode *text_base, *text;
7356 int off = 0;
7357
7358 text_base = text =
7359 eina_unicode_strndup(eina_ustrbuf_string_get(tnode->unicode),
7360 eina_ustrbuf_length_get(tnode->unicode));
7361 if (tnode == cur2->node)
7362 {
7363 fnode = _evas_textblock_node_text_get_first_format_between(tnode,
7364 cur1->pos, cur2->pos);
7365 }
7366 else if (tnode == cur1->node)
7367 {
7368 fnode = _evas_textblock_node_text_get_first_format_between(tnode,
7369 cur1->pos, -1);
7370 }
7371 else
7372 {
7373 fnode = _evas_textblock_node_text_get_first_format_between(tnode,
7374 0, -1);
7375 }
7376 /* Init the offset so the first one will count starting from cur1->pos
7377 * and not the previous format node */
7378 if (tnode == cur1->node)
7379 {
7380 if (fnode)
7381 {
7382 off = _evas_textblock_node_format_pos_get(fnode) -
7383 cur1->pos - fnode->offset;
7384 }
7385 text += cur1->pos;
7386 }
7387 else
7388 {
7389 off = 0;
7390 }
7391 while (fnode && (fnode->text_node == tnode))
7392 {
7393 Eina_Unicode tmp_ch;
7394 off += fnode->offset;
7395 if ((tnode == cur2->node) &&
7396 ((size_t) (text - text_base + off) >= cur2->pos))
7397 {
7398 break;
7399 }
7400 /* No need to skip on the first run */
7401 tmp_ch = text[off];
7402 text[off] = 0; /* Null terminate the part of the string */
7403 _markup_get_text_append(buf, text);
7404 _markup_get_format_append(o, buf, fnode);
7405 text[off] = tmp_ch; /* Restore the char */
7406 text += off;
7407 if (fnode->visible)
7408 {
7409 off = -1;
7410 text++;
7411 }
7412 else
7413 {
7414 off = 0;
7415 }
7416 fnode = _NODE_FORMAT(EINA_INLIST_GET(fnode)->next);
7417 }
7418 /* If we got to the last node, stop and add the rest outside */
7419 if (cur2->node == tnode)
7420 {
7421 /* Add the rest, skip replacement */
7422 /* Don't go past the second cursor pos */
7423 text_base[cur2->pos] = '\0';
7424 _markup_get_text_append(buf, text);
7425 free(text_base);
7426 break;
7427 }
7428 else
7429 {
7430 /* Add the rest, skip replacement */
7431 _markup_get_text_append(buf, text);
7432 free(text_base);
7433 }
7434 }
7435 /* return the string */
7436 {
7437 char *ret;
7438 ret = eina_strbuf_string_steal(buf);
7439 eina_strbuf_free(buf);
7440 return ret;
7441 }
7442}
7443
7444static char *
7445_evas_textblock_cursor_range_text_plain_get(const Evas_Textblock_Cursor *cur1, const Evas_Textblock_Cursor *_cur2)
7446{
7447 Eina_UStrbuf *buf;
7448 Evas_Object_Textblock_Node_Text *n1, *n2;
7449 Evas_Textblock_Cursor *cur2;
7450
7451 buf = eina_ustrbuf_new();
7452
7453 if (!cur1 || !cur1->node) return NULL;
7454 if (!_cur2 || !_cur2->node) return NULL;
7455 if (cur1->obj != _cur2->obj) return NULL;
7456 if (evas_textblock_cursor_compare(cur1, _cur2) > 0)
7457 {
7458 const Evas_Textblock_Cursor *tc;
7459
7460 tc = cur1;
7461 cur1 = _cur2;
7462 _cur2 = tc;
7463 }
7464 n1 = cur1->node;
7465 n2 = _cur2->node;
7466 /* Work on a local copy of the cur */
7467 cur2 = alloca(sizeof(Evas_Textblock_Cursor));
7468 cur2->obj = _cur2->obj;
7469 evas_textblock_cursor_copy(_cur2, cur2);
7470
7471
7472 if (n1 == n2)
7473 {
7474 const Eina_Unicode *tmp;
7475 tmp = eina_ustrbuf_string_get(n1->unicode);
7476 eina_ustrbuf_append_length(buf, tmp + cur1->pos, cur2->pos - cur1->pos);
7477 }
7478 else
7479 {
7480 const Eina_Unicode *tmp;
7481 tmp = eina_ustrbuf_string_get(n1->unicode);
7482 eina_ustrbuf_append(buf, tmp + cur1->pos);
7483 n1 = _NODE_TEXT(EINA_INLIST_GET(n1)->next);
7484 while (n1 != n2)
7485 {
7486 tmp = eina_ustrbuf_string_get(n1->unicode);
7487 eina_ustrbuf_append_length(buf, tmp,
7488 eina_ustrbuf_length_get(n1->unicode));
7489 n1 = _NODE_TEXT(EINA_INLIST_GET(n1)->next);
7490 }
7491 tmp = eina_ustrbuf_string_get(n2->unicode);
7492 eina_ustrbuf_append_length(buf, tmp, cur2->pos);
7493 }
7494
7495 /* Free and return */
7496 {
7497 char *ret;
7498 ret = eina_unicode_unicode_to_utf8(eina_ustrbuf_string_get(buf), NULL);
7499 eina_ustrbuf_free(buf);
7500 return ret;
7501 }
7502}
7503
7504EAPI Eina_List *
7505evas_textblock_cursor_range_formats_get(const Evas_Textblock_Cursor *cur1, const Evas_Textblock_Cursor *cur2)
7506{
7507 Evas_Object *obj = cur1->obj;
7508 Eina_List *ret = NULL;
7509 Evas_Object_Textblock_Node_Text *n1, *n2;
7510 Evas_Object_Textblock_Node_Format *first, *last;
7511 TB_HEAD_RETURN(NULL);
7512 if (!cur1 || !cur1->node) return NULL;
7513 if (!cur2 || !cur2->node) return NULL;
7514 if (cur1->obj != cur2->obj) return NULL;
7515 if (evas_textblock_cursor_compare(cur1, cur2) > 0)
7516 {
7517 const Evas_Textblock_Cursor *tc;
7518
7519 tc = cur1;
7520 cur1 = cur2;
7521 cur2 = tc;
7522 }
7523 n1 = cur1->node;
7524 n2 = cur2->node;
7525
7526 /* FIXME: Change first and last getting to format_before_or_at_pos_get */
7527
7528 last = n2->format_node;
7529
7530 /* If n2->format_node is NULL, we don't have formats in the tb/range. */
7531 if (!last)
7532 return NULL;
7533 /* If the found format is on our text node, we should go to the last
7534 * one, otherwise, the one we found is good enough. */
7535 if (last->text_node == n2)
7536 {
7537 Evas_Object_Textblock_Node_Format *fnode = last;
7538 while (fnode && (fnode->text_node == n2))
7539 {
7540 last = fnode;
7541 fnode = _NODE_FORMAT(EINA_INLIST_GET(fnode)->next);
7542 }
7543 }
7544
7545 /* If the first format node is within the range (i.e points to n1) or if
7546 * we have other formats in the range, go through them */
7547 first = n1->format_node;
7548 if ((first->text_node == n1) || (first != last))
7549 {
7550 Evas_Object_Textblock_Node_Format *fnode = first;
7551 /* Go to the first one in the range */
7552 if (first->text_node != n1)
7553 {
7554 first = _NODE_FORMAT(EINA_INLIST_GET(first)->next);
7555 }
7556
7557 while (fnode)
7558 {
7559 ret = eina_list_append(ret, fnode);
7560 if (fnode == last)
7561 break;
7562 fnode = _NODE_FORMAT(EINA_INLIST_GET(fnode)->next);
7563 }
7564 }
7565
7566 return ret;
7567
7568}
7569
7570EAPI char *
7571evas_textblock_cursor_range_text_get(const Evas_Textblock_Cursor *cur1, const Evas_Textblock_Cursor *cur2, Evas_Textblock_Text_Type format)
7572{
7573 if (format == EVAS_TEXTBLOCK_TEXT_MARKUP)
7574 return _evas_textblock_cursor_range_text_markup_get(cur1, cur2);
7575 else if (format == EVAS_TEXTBLOCK_TEXT_PLAIN)
7576 return _evas_textblock_cursor_range_text_plain_get(cur1, cur2);
7577 else
7578 return NULL; /* Not yet supported */
7579}
7580
7581EAPI const char *
7582evas_textblock_cursor_paragraph_text_get(const Evas_Textblock_Cursor *cur)
7583{
7584 Evas_Textblock_Cursor cur1, cur2;
7585 if (!cur) return NULL;
7586 if (!cur->node) return NULL;
7587 if (cur->node->utf8)
7588 {
7589 free(cur->node->utf8);
7590 }
7591 cur1.obj = cur2.obj = cur->obj;
7592 cur1.node = cur2.node = cur->node;
7593 evas_textblock_cursor_paragraph_char_first(&cur1);
7594 evas_textblock_cursor_paragraph_char_last(&cur2);
7595
7596 cur->node->utf8 = evas_textblock_cursor_range_text_get(&cur1, &cur2,
7597 EVAS_TEXTBLOCK_TEXT_MARKUP);
7598 return cur->node->utf8;
7599}
7600
7601EAPI int
7602evas_textblock_cursor_paragraph_text_length_get(const Evas_Textblock_Cursor *cur)
7603{
7604 int len;
7605 if (!cur) return -1;
7606 if (!cur->node) return -1;
7607 len = eina_ustrbuf_length_get(cur->node->unicode);
7608
7609 if (EINA_INLIST_GET(cur->node)->next)
7610 return len - 1; /* Remove the paragraph separator */
7611 else
7612 return len;
7613}
7614
7615EAPI const Evas_Object_Textblock_Node_Format *
7616evas_textblock_cursor_format_get(const Evas_Textblock_Cursor *cur)
7617{
7618 if (!cur) return NULL;
7619 if (!cur->node) return NULL;
7620 return _evas_textblock_cursor_node_format_at_pos_get(cur);
7621}
7622
7623EAPI const char *
7624evas_textblock_node_format_text_get(const Evas_Object_Textblock_Node_Format *fmt)
7625{
7626 if (!fmt) return NULL;
7627 return fmt->orig_format;
7628}
7629
7630EAPI void
7631evas_textblock_cursor_at_format_set(Evas_Textblock_Cursor *cur, const Evas_Object_Textblock_Node_Format *fmt)
7632{
7633 if (!fmt || !cur) return;
7634 cur->node = fmt->text_node;
7635 cur->pos = _evas_textblock_node_format_pos_get(fmt);
7636}
7637
7638EAPI Eina_Bool
7639evas_textblock_cursor_format_is_visible_get(const Evas_Textblock_Cursor *cur)
7640{
7641 const Eina_Unicode *text;
7642
7643 if (!cur) return EINA_FALSE;
7644 if (!cur->node) return EINA_FALSE;
7645 text = eina_ustrbuf_string_get(cur->node->unicode);
7646 return EVAS_TEXTBLOCK_IS_VISIBLE_FORMAT_CHAR(text[cur->pos]);
7647}
7648
7649EAPI int
7650evas_textblock_cursor_geometry_get(const Evas_Textblock_Cursor *cur, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch, Evas_BiDi_Direction *dir, Evas_Textblock_Cursor_Type ctype)
7651{
7652 int ret = -1;
7653 const Evas_Textblock_Cursor *dir_cur;
7654 Evas_Textblock_Cursor cur2;
7655 Evas_Object_Textblock *o;
7656 o = (Evas_Object_Textblock *)(cur->obj->object_data);
7657 if (!o->formatted.valid) _relayout(cur->obj);
7658
7659 dir_cur = cur;
7660 if (ctype == EVAS_TEXTBLOCK_CURSOR_UNDER)
7661 {
7662 ret = evas_textblock_cursor_pen_geometry_get(cur, cx, cy, cw, ch);
7663 }
7664 else if (ctype == EVAS_TEXTBLOCK_CURSOR_BEFORE)
7665 {
7666 /* In the case of a "before cursor", we should get the coordinates
7667 * of just after the previous char (which in bidi text may not be
7668 * just before the current char). */
7669 Evas_Coord x, y, h, w;
7670 Evas_Object_Textblock_Node_Format *fmt;
7671
7672 /* If it's at the end of the line, we want to get the position, not
7673 * the position of the previous */
7674 if ((cur->pos > 0) && !_evas_textblock_cursor_is_at_the_end(cur))
7675 {
7676 Eina_Bool before_char = EINA_FALSE;
7677 cur2.obj = cur->obj;
7678 evas_textblock_cursor_copy(cur, &cur2);
7679 evas_textblock_cursor_char_prev(&cur2);
7680
7681 fmt = _evas_textblock_cursor_node_format_at_pos_get(&cur2);
7682
7683 if (!fmt || !_IS_LINE_SEPARATOR(fmt->format))
7684 {
7685 dir_cur = &cur2;
7686 before_char = EINA_FALSE;
7687 }
7688 else
7689 {
7690 before_char = EINA_TRUE;
7691 }
7692 ret = evas_textblock_cursor_pen_geometry_get(
7693 dir_cur, &x, &y, &w, &h);
7694#ifdef BIDI_SUPPORT
7695 /* Adjust if the char is an rtl char */
7696 if (ret >= 0)
7697 {
7698 Eina_Bool is_rtl = EINA_FALSE;
7699 if (dir_cur->node->par->is_bidi)
7700 {
7701 Evas_Object_Textblock_Line *ln;
7702 Evas_Object_Textblock_Item *it;
7703 _find_layout_item_match(dir_cur, &ln, &it);
7704 if ((it->type == EVAS_TEXTBLOCK_ITEM_TEXT) &&
7705 (_ITEM_TEXT(it)->text_props.bidi.dir ==
7706 EVAS_BIDI_DIRECTION_RTL))
7707 is_rtl = EINA_TRUE;
7708 else if ((it->type == EVAS_TEXTBLOCK_ITEM_FORMAT) &&
7709 (_ITEM_FORMAT(it)->bidi_dir ==
7710 EVAS_BIDI_DIRECTION_RTL))
7711 is_rtl = EINA_TRUE;
7712 }
7713
7714 if ((!before_char && is_rtl) ||
7715 (before_char && !is_rtl))
7716 {
7717 /* Just don't advance the width */
7718 w = 0;
7719 }
7720 }
7721#endif
7722 }
7723 else if (cur->pos == 0)
7724 {
7725 ret = evas_textblock_cursor_pen_geometry_get(
7726 dir_cur, &x, &y, &w, &h);
7727#ifdef BIDI_SUPPORT
7728 Eina_Bool is_rtl = EINA_FALSE;
7729 if (dir_cur->node && dir_cur->node->par->is_bidi)
7730 {
7731 Evas_Object_Textblock_Line *ln;
7732 Evas_Object_Textblock_Item *it;
7733 _find_layout_item_match(dir_cur, &ln, &it);
7734 if ((it->type == EVAS_TEXTBLOCK_ITEM_TEXT) &&
7735 (_ITEM_TEXT(it)->text_props.bidi.dir ==
7736 EVAS_BIDI_DIRECTION_RTL))
7737 is_rtl = EINA_TRUE;
7738 else if ((it->type == EVAS_TEXTBLOCK_ITEM_FORMAT) &&
7739 (_ITEM_FORMAT(it)->bidi_dir ==
7740 EVAS_BIDI_DIRECTION_RTL))
7741 is_rtl = EINA_TRUE;
7742 }
7743
7744 /* Adjust if the char is an rtl char */
7745 if ((ret >= 0) && (!is_rtl))
7746 {
7747 /* Just don't advance the width */
7748 w = 0;
7749 }
7750#endif
7751 }
7752 else
7753 {
7754 ret = evas_textblock_cursor_pen_geometry_get(
7755 dir_cur, &x, &y, &w, &h);
7756 }
7757 if (ret >= 0)
7758 {
7759 if (cx) *cx = x + w;
7760 if (cy) *cy = y;
7761 if (cw) *cw = 0;
7762 if (ch) *ch = h;
7763 }
7764 }
7765
7766 if (dir && dir_cur && dir_cur->node)
7767 {
7768#ifdef BIDI_SUPPORT
7769 Eina_Bool is_rtl = EINA_FALSE;
7770 if (dir_cur->node->par->is_bidi)
7771 {
7772 Evas_Object_Textblock_Line *ln;
7773 Evas_Object_Textblock_Item *it;
7774 _find_layout_item_match(dir_cur, &ln, &it);
7775 if ((it->type == EVAS_TEXTBLOCK_ITEM_TEXT) &&
7776 (_ITEM_TEXT(it)->text_props.bidi.dir ==
7777 EVAS_BIDI_DIRECTION_RTL))
7778 is_rtl = EINA_TRUE;
7779 else if ((it->type == EVAS_TEXTBLOCK_ITEM_FORMAT) &&
7780 (_ITEM_FORMAT(it)->bidi_dir ==
7781 EVAS_BIDI_DIRECTION_RTL))
7782 is_rtl = EINA_TRUE;
7783 }
7784
7785 if (_evas_textblock_cursor_is_at_the_end(dir_cur) && (dir_cur->pos > 0))
7786 {
7787 *dir = (is_rtl) ?
7788 EVAS_BIDI_DIRECTION_RTL : EVAS_BIDI_DIRECTION_LTR;
7789 }
7790 else if (dir_cur->pos > 0)
7791 {
7792 *dir = (is_rtl) ?
7793 EVAS_BIDI_DIRECTION_RTL : EVAS_BIDI_DIRECTION_LTR;
7794 }
7795 else
7796#endif
7797 {
7798 *dir = EVAS_BIDI_DIRECTION_LTR;
7799 }
7800 }
7801 return ret;
7802}
7803
7804/**
7805 * @internal
7806 * Returns the geometry/pen position (depending on query_func) of the char
7807 * at pos.
7808 *
7809 * @param cur the position of the char.
7810 * @param query_func the query function to use.
7811 * @param cx the x of the char (or pen_x in the case of pen position).
7812 * @param cy the y of the char.
7813 * @param cw the w of the char (or advance in the case pen position).
7814 * @param ch the h of the char.
7815 * @return line number of the char on success, -1 on error.
7816 */
7817static int
7818_evas_textblock_cursor_char_pen_geometry_common_get(int (*query_func) (void *data, Evas_Font_Set *font, const Evas_Text_Props *intl_props, int pos, int *cx, int *cy, int *cw, int *ch), const Evas_Textblock_Cursor *cur, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch)
7819{
7820 Evas_Object_Textblock *o;
7821 Evas_Object_Textblock_Line *ln = NULL;
7822 Evas_Object_Textblock_Item *it = NULL;
7823 Evas_Object_Textblock_Text_Item *ti = NULL;
7824 Evas_Object_Textblock_Format_Item *fi = NULL;
7825 int x = 0, y = 0, w = 0, h = 0;
7826 int pos;
7827 Eina_Bool previous_format;
7828
7829 if (!cur) return -1;
7830 o = (Evas_Object_Textblock *)(cur->obj->object_data);
7831 if (!o->formatted.valid) _relayout(cur->obj);
7832
7833 if (!cur->node)
7834 {
7835 if (!o->text_nodes)
7836 {
7837 if (!o->paragraphs) return -1;
7838 ln = o->paragraphs->lines;
7839 if (!ln) return -1;
7840 if (cx) *cx = ln->x;
7841 if (cy) *cy = ln->par->y + ln->y;
7842 if (cw) *cw = ln->w;
7843 if (ch) *ch = ln->h;
7844 return ln->par->line_no + ln->line_no;
7845 }
7846 else
7847 return -1;
7848 }
7849
7850 previous_format = _find_layout_item_match(cur, &ln, &it);
7851 if (!it)
7852 {
7853 return -1;
7854 }
7855 if (it->type == EVAS_TEXTBLOCK_ITEM_TEXT)
7856 {
7857 ti = _ITEM_TEXT(it);
7858 }
7859 else
7860 {
7861 fi = _ITEM_FORMAT(it);
7862 }
7863
7864 if (ln && ti)
7865 {
7866 pos = cur->pos - ti->parent.text_pos;
7867
7868 if (pos < 0) pos = 0;
7869 if (ti->parent.format->font.font)
7870 {
7871 query_func(cur->ENDT,
7872 ti->parent.format->font.font,
7873 &ti->text_props,
7874 pos,
7875 &x, &y, &w, &h);
7876 }
7877
7878 x += ln->x + _ITEM(ti)->x;
7879
7880 if (x < ln->x)
7881 {
7882 x = ln->x;
7883 }
7884 y = ln->par->y + ln->y;
7885 h = ln->h;
7886 }
7887 else if (ln && fi)
7888 {
7889 if (previous_format)
7890 {
7891 if (_IS_LINE_SEPARATOR(fi->item))
7892 {
7893 x = 0;
7894 y = ln->par->y + ln->y + ln->h;
7895 }
7896 else
7897 {
7898#ifdef BIDI_SUPPORT
7899 if (ln->par->direction == EVAS_BIDI_DIRECTION_RTL)
7900 {
7901 x = ln->x;
7902 }
7903 else
7904#endif
7905 {
7906 x = ln->x + ln->w;
7907 }
7908 y = ln->par->y + ln->y;
7909 }
7910 w = 0;
7911 h = ln->h;
7912 }
7913 else
7914 {
7915 x = ln->x + _ITEM(fi)->x;
7916 y = ln->par->y + ln->y;
7917 w = _ITEM(fi)->w;
7918 h = ln->h;
7919 }
7920 }
7921 else
7922 {
7923 return -1;
7924 }
7925 if (cx) *cx = x;
7926 if (cy) *cy = y;
7927 if (cw) *cw = w;
7928 if (ch) *ch = h;
7929 return ln->par->line_no + ln->line_no;
7930}
7931
7932EAPI int
7933evas_textblock_cursor_char_geometry_get(const Evas_Textblock_Cursor *cur, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch)
7934{
7935 return _evas_textblock_cursor_char_pen_geometry_common_get(
7936 cur->ENFN->font_char_coords_get, cur, cx, cy, cw, ch);
7937}
7938
7939EAPI int
7940evas_textblock_cursor_pen_geometry_get(const Evas_Textblock_Cursor *cur, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch)
7941{
7942 return _evas_textblock_cursor_char_pen_geometry_common_get(
7943 cur->ENFN->font_pen_coords_get, cur, cx, cy, cw, ch);
7944}
7945
7946EAPI int
7947evas_textblock_cursor_line_geometry_get(const Evas_Textblock_Cursor *cur, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch)
7948{
7949 Evas_Object_Textblock *o;
7950 Evas_Object_Textblock_Line *ln = NULL;
7951 Evas_Object_Textblock_Item *it = NULL;
7952 int x, y, w, h;
7953
7954 if (!cur) return -1;
7955 o = (Evas_Object_Textblock *)(cur->obj->object_data);
7956 if (!o->formatted.valid) _relayout(cur->obj);
7957 if (!cur->node)
7958 {
7959 ln = o->paragraphs->lines;
7960 }
7961 else
7962 {
7963 _find_layout_item_match(cur, &ln, &it);
7964 }
7965 if (!ln) return -1;
7966 x = ln->x;
7967 y = ln->par->y + ln->y;
7968 w = ln->w;
7969 h = ln->h;
7970 if (cx) *cx = x;
7971 if (cy) *cy = y;
7972 if (cw) *cw = w;
7973 if (ch) *ch = h;
7974 return ln->par->line_no + ln->line_no;
7975}
7976
7977EAPI Eina_Bool
7978evas_textblock_cursor_visible_range_get(Evas_Textblock_Cursor *start, Evas_Textblock_Cursor *end)
7979{
7980 Evas *e;
7981 Evas_Coord cy, ch;
7982 Evas_Object *obj = start->obj;
7983 TB_HEAD_RETURN(EINA_FALSE);
7984 e = evas_object_evas_get(obj);
7985 cy = 0 - obj->cur.geometry.y;
7986 ch = e->viewport.h;
7987 evas_textblock_cursor_line_coord_set(start, cy);
7988 evas_textblock_cursor_line_coord_set(end, cy + ch);
7989 evas_textblock_cursor_line_char_last(end);
7990
7991 return EINA_TRUE;
7992}
7993
7994EAPI Eina_Bool
7995evas_textblock_cursor_char_coord_set(Evas_Textblock_Cursor *cur, Evas_Coord x, Evas_Coord y)
7996{
7997 Evas_Object_Textblock *o;
7998 Evas_Object_Textblock_Paragraph *found_par;
7999 Evas_Object_Textblock_Line *ln;
8000 Evas_Object_Textblock_Item *it = NULL;
8001
8002 if (!cur) return EINA_FALSE;
8003 o = (Evas_Object_Textblock *)(cur->obj->object_data);
8004 if (!o->formatted.valid) _relayout(cur->obj);
8005 x += o->style_pad.l;
8006 y += o->style_pad.t;
8007
8008 found_par = _layout_find_paragraph_by_y(o, y);
8009 if (found_par)
8010 {
8011 _layout_paragraph_render(o, found_par);
8012 EINA_INLIST_FOREACH(found_par->lines, ln)
8013 {
8014 if (ln->par->y + ln->y > y) break;
8015 if ((ln->par->y + ln->y <= y) && ((ln->par->y + ln->y + ln->h) > y))
8016 {
8017 /* If before or after the line, go to start/end according
8018 * to paragraph direction. */
8019 if (x < ln->x)
8020 {
8021 cur->pos = ln->items->text_pos;
8022 cur->node = found_par->text_node;
8023 if (found_par->direction == EVAS_BIDI_DIRECTION_RTL)
8024 {
8025 evas_textblock_cursor_line_char_last(cur);
8026 }
8027 else
8028 {
8029 evas_textblock_cursor_line_char_first(cur);
8030 }
8031 return EINA_TRUE;
8032 }
8033 else if (x >= ln->x + ln->w)
8034 {
8035 cur->pos = ln->items->text_pos;
8036 cur->node = found_par->text_node;
8037 if (found_par->direction == EVAS_BIDI_DIRECTION_RTL)
8038 {
8039 evas_textblock_cursor_line_char_first(cur);
8040 }
8041 else
8042 {
8043 evas_textblock_cursor_line_char_last(cur);
8044 }
8045 return EINA_TRUE;
8046 }
8047
8048 EINA_INLIST_FOREACH(ln->items, it)
8049 {
8050 if (((it->x + ln->x) <= x) && (((it->x + ln->x) + it->adv) > x))
8051 {
8052 if (it->type == EVAS_TEXTBLOCK_ITEM_TEXT)
8053 {
8054 int pos;
8055 int cx, cy, cw, ch;
8056 Evas_Object_Textblock_Text_Item *ti;
8057 ti = _ITEM_TEXT(it);
8058
8059 pos = -1;
8060 if (ti->parent.format->font.font)
8061 pos = cur->ENFN->font_char_at_coords_get(
8062 cur->ENDT,
8063 ti->parent.format->font.font,
8064 &ti->text_props,
8065 x - it->x - ln->x, 0,
8066 &cx, &cy, &cw, &ch);
8067 if (pos < 0)
8068 return EINA_FALSE;
8069 cur->pos = pos + it->text_pos;
8070 cur->node = it->text_node;
8071 return EINA_TRUE;
8072 }
8073 else
8074 {
8075 Evas_Object_Textblock_Format_Item *fi;
8076 fi = _ITEM_FORMAT(it);
8077 cur->pos = fi->parent.text_pos;
8078 cur->node = found_par->text_node;
8079 return EINA_TRUE;
8080 }
8081 }
8082 }
8083 }
8084 }
8085 }
8086 else if (o->paragraphs && (y >= o->paragraphs->y + o->formatted.h))
8087 {
8088 /* If we are after the last paragraph, use the last position in the
8089 * text. */
8090 evas_textblock_cursor_paragraph_last(cur);
8091 return EINA_TRUE;
8092 }
8093 else if (o->paragraphs && (y < o->paragraphs->y))
8094 {
8095 evas_textblock_cursor_paragraph_first(cur);
8096 return EINA_TRUE;
8097 }
8098
8099 return EINA_FALSE;
8100}
8101
8102EAPI int
8103evas_textblock_cursor_line_coord_set(Evas_Textblock_Cursor *cur, Evas_Coord y)
8104{
8105 Evas_Object_Textblock *o;
8106 Evas_Object_Textblock_Paragraph *found_par;
8107 Evas_Object_Textblock_Line *ln;
8108
8109 if (!cur) return -1;
8110 o = (Evas_Object_Textblock *)(cur->obj->object_data);
8111 if (!o->formatted.valid) _relayout(cur->obj);
8112 y += o->style_pad.t;
8113
8114 found_par = _layout_find_paragraph_by_y(o, y);
8115
8116 if (found_par)
8117 {
8118 _layout_paragraph_render(o, found_par);
8119 EINA_INLIST_FOREACH(found_par->lines, ln)
8120 {
8121 if (ln->par->y + ln->y > y) break;
8122 if ((ln->par->y + ln->y <= y) && ((ln->par->y + ln->y + ln->h) > y))
8123 {
8124 evas_textblock_cursor_line_set(cur, ln->par->line_no +
8125 ln->line_no);
8126 return ln->par->line_no + ln->line_no;
8127 }
8128 }
8129 }
8130 else if (o->paragraphs && (y >= o->paragraphs->y + o->formatted.h))
8131 {
8132 int line_no = 0;
8133 /* If we are after the last paragraph, use the last position in the
8134 * text. */
8135 evas_textblock_cursor_paragraph_last(cur);
8136 if (cur->node && cur->node->par)
8137 {
8138 line_no = cur->node->par->line_no;
8139 if (cur->node->par->lines)
8140 {
8141 line_no += ((Evas_Object_Textblock_Line *)
8142 EINA_INLIST_GET(cur->node->par->lines)->last)->line_no;
8143 }
8144 }
8145 return line_no;
8146 }
8147 else if (o->paragraphs && (y < o->paragraphs->y))
8148 {
8149 int line_no = 0;
8150 evas_textblock_cursor_paragraph_first(cur);
8151 if (cur->node && cur->node->par)
8152 {
8153 line_no = cur->node->par->line_no;
8154 }
8155 return line_no;
8156 }
8157 return -1;
8158}
8159
8160/**
8161 * @internal
8162 * Updates x and w according to the text direction, position in text and
8163 * if it's a special case switch
8164 *
8165 * @param ti the text item we are working on
8166 * @param x the current x (we get) and the x we return
8167 * @param w the current w (we get) and the w we return
8168 * @param start if this is the first item or not
8169 * @param switch_items toogles item switching (rtl cases)
8170 */
8171static void
8172_evas_textblock_range_calc_x_w(const Evas_Object_Textblock_Item *it,
8173 Evas_Coord *x, Evas_Coord *w, Eina_Bool start, Eina_Bool switch_items)
8174{
8175 if ((start && !switch_items) || (!start && switch_items))
8176 {
8177#ifdef BIDI_SUPPORT
8178 if (((it->type == EVAS_TEXTBLOCK_ITEM_TEXT) &&
8179 _ITEM_TEXT(it)->text_props.bidi.dir == EVAS_BIDI_DIRECTION_RTL)
8180 ||
8181 ((it->type == EVAS_TEXTBLOCK_ITEM_FORMAT) &&
8182 _ITEM_FORMAT(it)->bidi_dir == EVAS_BIDI_DIRECTION_RTL))
8183 {
8184 *w = *x + *w;
8185 *x = 0;
8186 }
8187 else
8188#endif
8189 {
8190 *w = it->adv - *x;
8191 }
8192 }
8193 else
8194 {
8195#ifdef BIDI_SUPPORT
8196 if (((it->type == EVAS_TEXTBLOCK_ITEM_TEXT) &&
8197 _ITEM_TEXT(it)->text_props.bidi.dir == EVAS_BIDI_DIRECTION_RTL)
8198 ||
8199 ((it->type == EVAS_TEXTBLOCK_ITEM_FORMAT) &&
8200 _ITEM_FORMAT(it)->bidi_dir == EVAS_BIDI_DIRECTION_RTL))
8201 {
8202 *x = *x + *w;
8203 *w = it->adv - *x;
8204 }
8205 else
8206#endif
8207 {
8208 *w = *x;
8209 *x = 0;
8210 }
8211 }
8212
8213}
8214
8215/**
8216 * @internal
8217 * Returns the geometry of the range in line ln. Cur1 is the start cursor,
8218 * cur2 is the end cursor, NULL means from the start or to the end accordingly.
8219 * Assumes that ln is valid, and that at least one of cur1 and cur2 is not NULL.
8220 *
8221 * @param ln the line to work on.
8222 * @param cur1 the start cursor
8223 * @param cur2 the end cursor
8224 * @return Returns the geometry of the range
8225 */
8226static Eina_List *
8227_evas_textblock_cursor_range_in_line_geometry_get(
8228 const Evas_Object_Textblock_Line *ln, const Evas_Textblock_Cursor *cur1,
8229 const Evas_Textblock_Cursor *cur2)
8230{
8231 Evas_Object_Textblock_Item *it;
8232 Evas_Object_Textblock_Item *it1, *it2;
8233 Eina_List *rects = NULL;
8234 Evas_Textblock_Rectangle *tr;
8235 size_t start, end;
8236 Eina_Bool switch_items;
8237 const Evas_Textblock_Cursor *cur;
8238
8239 cur = (cur1) ? cur1 : cur2;
8240
8241 if (!cur) return NULL;
8242
8243 /* Find the first and last items */
8244 it1 = it2 = NULL;
8245 start = end = 0;
8246 EINA_INLIST_FOREACH(ln->items, it)
8247 {
8248 size_t item_len;
8249 item_len = (it->type == EVAS_TEXTBLOCK_ITEM_TEXT) ?
8250 _ITEM_TEXT(it)->text_props.text_len
8251 : 1;
8252 if ((!cur1 || (cur1->pos < it->text_pos + item_len)) &&
8253 (!cur2 || (cur2->pos >= it->text_pos)))
8254 {
8255 if (!it1)
8256 {
8257 it1 = it;
8258 start = item_len; /* start stores the first item_len */
8259 }
8260 it2 = it;
8261 end = item_len; /* end stores the last item_len */
8262 }
8263 }
8264
8265 /* If we couldn't find even one item, return */
8266 if (!it1) return NULL;
8267
8268 /* If the first item is logically before or equal the second item
8269 * we have to set start and end differently than in the other case */
8270 if (it1->text_pos <= it2->text_pos)
8271 {
8272 start = (cur1) ? (cur1->pos - it1->text_pos) : 0;
8273 end = (cur2) ? (cur2->pos - it2->text_pos) : end;
8274 switch_items = EINA_FALSE;
8275 }
8276 else
8277 {
8278 start = (cur2) ? (cur2->pos - it1->text_pos) : start;
8279 end = (cur1) ? (cur1->pos - it2->text_pos) : 0;
8280 switch_items = EINA_TRUE;
8281 }
8282
8283 /* IMPORTANT: Don't use cur1/cur2 past this point (because they probably
8284 * don't make sense anymore. That's why there are start and end),
8285 * unless you know what you are doing */
8286
8287 /* Special case when they share the same item and it's a text item */
8288 if ((it1 == it2) && (it1->type == EVAS_TEXTBLOCK_ITEM_TEXT))
8289 {
8290 Evas_Coord x1, w1, x2, w2;
8291 Evas_Coord x, w, y, h;
8292 Evas_Object_Textblock_Text_Item *ti;
8293 int ret = 0;
8294
8295 ti = _ITEM_TEXT(it1);
8296 if (ti->parent.format->font.font)
8297 {
8298 ret = cur->ENFN->font_pen_coords_get(cur->ENDT,
8299 ti->parent.format->font.font,
8300 &ti->text_props,
8301 start,
8302 &x1, &y, &w1, &h);
8303 }
8304 if (!ret)
8305 {
8306 return NULL;
8307 }
8308 ret = cur->ENFN->font_pen_coords_get(cur->ENDT,
8309 ti->parent.format->font.font,
8310 &ti->text_props,
8311 end,
8312 &x2, &y, &w2, &h);
8313 if (!ret)
8314 {
8315 return NULL;
8316 }
8317
8318 /* Make x2 the one on the right */
8319 if (x2 < x1)
8320 {
8321 Evas_Coord tmp;
8322 tmp = x1;
8323 x1 = x2;
8324 x2 = tmp;
8325
8326 tmp = w1;
8327 w1 = w2;
8328 w2 = tmp;
8329 }
8330
8331#ifdef BIDI_SUPPORT
8332 if (ti->text_props.bidi.dir == EVAS_BIDI_DIRECTION_RTL)
8333 {
8334 x = x1 + w1;
8335 w = x2 + w2 - x;
8336 }
8337 else
8338#endif
8339 {
8340 x = x1;
8341 w = x2 - x1;
8342 }
8343 if (w > 0)
8344 {
8345 tr = calloc(1, sizeof(Evas_Textblock_Rectangle));
8346 rects = eina_list_append(rects, tr);
8347 tr->x = ln->x + it1->x + x;
8348 tr->y = ln->par->y + ln->y;
8349 tr->h = ln->h;
8350 tr->w = w;
8351 }
8352 }
8353 else if (it1 != it2)
8354 {
8355 /* Get the middle items */
8356 Evas_Coord min_x, max_x;
8357 Evas_Coord x, w;
8358 it = _ITEM(EINA_INLIST_GET(it1)->next);
8359 min_x = max_x = it->x;
8360
8361 if (it1->type == EVAS_TEXTBLOCK_ITEM_TEXT)
8362 {
8363 Evas_Coord y, h;
8364 Evas_Object_Textblock_Text_Item *ti;
8365 int ret;
8366 ti = _ITEM_TEXT(it1);
8367
8368 ret = cur->ENFN->font_pen_coords_get(cur->ENDT,
8369 ti->parent.format->font.font,
8370 &ti->text_props,
8371 start,
8372 &x, &y, &w, &h);
8373 if (!ret)
8374 {
8375 /* BUG! Skip the first item */
8376 x = w = 0;
8377 }
8378 else
8379 {
8380 _evas_textblock_range_calc_x_w(it1, &x, &w, EINA_TRUE,
8381 switch_items);
8382 }
8383 }
8384 else
8385 {
8386 x = 0;
8387 w = it1->w;
8388 _evas_textblock_range_calc_x_w(it1, &x, &w, EINA_TRUE,
8389 switch_items);
8390 }
8391 if (w > 0)
8392 {
8393 tr = calloc(1, sizeof(Evas_Textblock_Rectangle));
8394 rects = eina_list_append(rects, tr);
8395 tr->x = ln->x + it1->x + x;
8396 tr->y = ln->par->y + ln->y;
8397 tr->h = ln->h;
8398 tr->w = w;
8399 }
8400
8401 while (it && (it != it2))
8402 {
8403 max_x = it->x + it->adv;
8404 it = (Evas_Object_Textblock_Item *) EINA_INLIST_GET(it)->next;
8405 }
8406 if (min_x != max_x)
8407 {
8408 tr = calloc(1, sizeof(Evas_Textblock_Rectangle));
8409 rects = eina_list_append(rects, tr);
8410 tr->x = ln->x + min_x;
8411 tr->y = ln->par->y + ln->y;
8412 tr->h = ln->h;
8413 tr->w = max_x - min_x;
8414 }
8415 if (it2->type == EVAS_TEXTBLOCK_ITEM_TEXT)
8416 {
8417 Evas_Coord y, h;
8418 Evas_Object_Textblock_Text_Item *ti;
8419 int ret;
8420 ti = _ITEM_TEXT(it2);
8421
8422 ret = cur->ENFN->font_pen_coords_get(cur->ENDT,
8423 ti->parent.format->font.font,
8424 &ti->text_props,
8425 end,
8426 &x, &y, &w, &h);
8427 if (!ret)
8428 {
8429 /* BUG! skip the last item */
8430 x = w = 0;
8431 }
8432 else
8433 {
8434 _evas_textblock_range_calc_x_w(it2, &x, &w, EINA_FALSE,
8435 switch_items);
8436 }
8437 }
8438 else
8439 {
8440 x = 0;
8441 w = it2->w;
8442 _evas_textblock_range_calc_x_w(it2, &x, &w, EINA_FALSE,
8443 switch_items);
8444 }
8445 if (w > 0)
8446 {
8447 tr = calloc(1, sizeof(Evas_Textblock_Rectangle));
8448 rects = eina_list_append(rects, tr);
8449 tr->x = ln->x + it2->x + x;
8450 tr->y = ln->par->y + ln->y;
8451 tr->h = ln->h;
8452 tr->w = w;
8453 }
8454 }
8455 return rects;
8456}
8457
8458EAPI Eina_List *
8459evas_textblock_cursor_range_geometry_get(const Evas_Textblock_Cursor *cur1, const Evas_Textblock_Cursor *cur2)
8460{
8461 Evas_Object_Textblock *o;
8462 Evas_Object_Textblock_Line *ln1, *ln2;
8463 Evas_Object_Textblock_Item *it1, *it2;
8464 Eina_List *rects = NULL;
8465 Evas_Textblock_Rectangle *tr;
8466
8467 if (!cur1 || !cur1->node) return NULL;
8468 if (!cur2 || !cur2->node) return NULL;
8469 if (cur1->obj != cur2->obj) return NULL;
8470 o = (Evas_Object_Textblock *)(cur1->obj->object_data);
8471 if (!o->formatted.valid) _relayout(cur1->obj);
8472 if (evas_textblock_cursor_compare(cur1, cur2) > 0)
8473 {
8474 const Evas_Textblock_Cursor *tc;
8475
8476 tc = cur1;
8477 cur1 = cur2;
8478 cur2 = tc;
8479 }
8480
8481 ln1 = ln2 = NULL;
8482 it1 = it2 = NULL;
8483 _find_layout_item_match(cur1, &ln1, &it1);
8484 if (!ln1 || !it1) return NULL;
8485 _find_layout_item_match(cur2, &ln2, &it2);
8486 if (!ln2 || !it2) return NULL;
8487
8488 if (ln1 == ln2)
8489 {
8490 rects = _evas_textblock_cursor_range_in_line_geometry_get(ln1,
8491 cur1, cur2);
8492 }
8493 else
8494 {
8495 Evas_Object_Textblock_Line *plni, *lni;
8496 Eina_List *rects2 = NULL;
8497 /* Handle the first line */
8498 rects = _evas_textblock_cursor_range_in_line_geometry_get(ln1,
8499 cur1, NULL);
8500
8501 /* Handle the lines between the first and the last line */
8502 lni = (Evas_Object_Textblock_Line *) EINA_INLIST_GET(ln1)->next;
8503 if (!lni && (ln1->par != ln2->par))
8504 {
8505 lni = ((Evas_Object_Textblock_Paragraph *)
8506 EINA_INLIST_GET(ln1->par)->next)->lines;
8507 }
8508 while (lni && (lni != ln2))
8509 {
8510 tr = calloc(1, sizeof(Evas_Textblock_Rectangle));
8511 rects = eina_list_append(rects, tr);
8512 tr->x = lni->x;
8513 tr->y = lni->par->y + lni->y;
8514 tr->h = lni->h;
8515 tr->w = lni->w;
8516 plni = lni;
8517 lni = (Evas_Object_Textblock_Line *) EINA_INLIST_GET(lni)->next;
8518 if (!lni && (plni->par != ln2->par))
8519 {
8520 lni = ((Evas_Object_Textblock_Paragraph *)
8521 EINA_INLIST_GET(plni->par)->next)->lines;
8522 }
8523 }
8524 rects2 = _evas_textblock_cursor_range_in_line_geometry_get(ln2,
8525 NULL, cur2);
8526 rects = eina_list_merge(rects, rects2);
8527 }
8528 return rects;
8529}
8530
8531EAPI Eina_Bool
8532evas_textblock_cursor_format_item_geometry_get(const Evas_Textblock_Cursor *cur, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch)
8533{
8534 Evas_Object_Textblock *o;
8535 Evas_Object_Textblock_Line *ln = NULL;
8536 Evas_Object_Textblock_Format_Item *fi;
8537 Evas_Object_Textblock_Item *it = NULL;
8538 Evas_Coord x, y, w, h;
8539
8540 if (!cur || !evas_textblock_cursor_format_is_visible_get(cur)) return EINA_FALSE;
8541 o = (Evas_Object_Textblock *)(cur->obj->object_data);
8542 if (!o->formatted.valid) _relayout(cur->obj);
8543 if (!evas_textblock_cursor_format_is_visible_get(cur)) return EINA_FALSE;
8544 _find_layout_item_line_match(cur->obj, cur->node, cur->pos, &ln, &it);
8545 fi = _ITEM_FORMAT(it);
8546 if ((!ln) || (!fi)) return EINA_FALSE;
8547 x = ln->x + fi->parent.x;
8548 y = ln->par->y + ln->y + ln->baseline + fi->y;
8549 w = fi->parent.w;
8550 h = fi->parent.h;
8551 if (cx) *cx = x;
8552 if (cy) *cy = y;
8553 if (cw) *cw = w;
8554 if (ch) *ch = h;
8555 return EINA_TRUE;
8556}
8557
8558EAPI Eina_Bool
8559evas_textblock_cursor_eol_get(const Evas_Textblock_Cursor *cur)
8560{
8561 Eina_Bool ret = EINA_FALSE;
8562 Evas_Textblock_Cursor cur2;
8563 if (!cur) return EINA_FALSE;
8564
8565 cur2.obj = cur->obj;
8566 evas_textblock_cursor_copy(cur, &cur2);
8567 evas_textblock_cursor_line_char_last(&cur2);
8568 if (cur2.pos == cur->pos)
8569 {
8570 ret = EINA_TRUE;
8571 }
8572 return ret;
8573}
8574
8575/* general controls */
8576EAPI Eina_Bool
8577evas_object_textblock_line_number_geometry_get(const Evas_Object *obj, int line, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch)
8578{
8579 Evas_Object_Textblock_Line *ln;
8580
8581 TB_HEAD_RETURN(0);
8582 ln = _find_layout_line_num(obj, line);
8583 if (!ln) return EINA_FALSE;
8584 if (cx) *cx = ln->x;
8585 if (cy) *cy = ln->par->y + ln->y;
8586 if (cw) *cw = ln->w;
8587 if (ch) *ch = ln->h;
8588 return EINA_TRUE;
8589}
8590
8591EAPI void
8592evas_object_textblock_clear(Evas_Object *obj)
8593{
8594 Eina_List *l;
8595 Evas_Textblock_Cursor *cur;
8596
8597 TB_HEAD();
8598 if (o->paragraphs)
8599 {
8600 _paragraphs_free(obj, o->paragraphs);
8601 o->paragraphs = NULL;
8602 }
8603
8604 _nodes_clear(obj);
8605 o->cursor->node = NULL;
8606 o->cursor->pos = 0;
8607 EINA_LIST_FOREACH(o->cursors, l, cur)
8608 {
8609 cur->node = NULL;
8610 cur->pos = 0;
8611
8612 }
8613 _evas_textblock_changed(o, obj);
8614}
8615
8616EAPI void
8617evas_object_textblock_size_formatted_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h)
8618{
8619 TB_HEAD();
8620 if (!o->formatted.valid) _relayout(obj);
8621 if (w) *w = o->formatted.w;
8622 if (h) *h = o->formatted.h;
8623}
8624
8625static void
8626_size_native_calc_line_finalize(const Evas_Object *obj, Eina_List *items,
8627 Evas_Coord *ascent, Evas_Coord *descent, Evas_Coord *w)
8628{
8629 Evas_Object_Textblock_Item *it;
8630 Eina_List *i;
8631
8632 it = eina_list_data_get(items);
8633 /* If there are no text items yet, calc ascent/descent
8634 * according to the current format. */
8635 if (it && (*ascent + *descent == 0))
8636 _layout_format_ascent_descent_adjust(obj, ascent, descent, it->format);
8637
8638 *w = 0;
8639 /* Adjust all the item sizes according to the final line size,
8640 * and update the x positions of all the items of the line. */
8641 EINA_LIST_FOREACH(items, i, it)
8642 {
8643 if (it->type == EVAS_TEXTBLOCK_ITEM_FORMAT)
8644 {
8645 Evas_Coord fw, fh, fy;
8646
8647 Evas_Object_Textblock_Format_Item *fi = _ITEM_FORMAT(it);
8648 if (!fi->formatme) goto loop_advance;
8649 _layout_calculate_format_item_size(obj, fi, ascent,
8650 descent, &fy, &fw, &fh);
8651 }
8652
8653loop_advance:
8654 *w += it->adv;
8655 }
8656}
8657
8658/* FIXME: doc */
8659static void
8660_size_native_calc_paragraph_size(const Evas_Object *obj,
8661 const Evas_Object_Textblock *o,
8662 const Evas_Object_Textblock_Paragraph *par,
8663 Evas_Coord *_w, Evas_Coord *_h)
8664{
8665 Eina_List *i;
8666 Evas_Object_Textblock_Item *it;
8667 Eina_List *line_items = NULL;
8668 Evas_Coord w = 0, y = 0, wmax = 0, h = 0, ascent = 0, descent = 0;
8669
8670 EINA_LIST_FOREACH(par->logical_items, i, it)
8671 {
8672 line_items = eina_list_append(line_items, it);
8673 if (it->type == EVAS_TEXTBLOCK_ITEM_FORMAT)
8674 {
8675 Evas_Object_Textblock_Format_Item *fi = _ITEM_FORMAT(it);
8676 if (fi->item && (_IS_LINE_SEPARATOR(fi->item) ||
8677 _IS_PARAGRAPH_SEPARATOR(o, fi->item)))
8678 {
8679 _size_native_calc_line_finalize(obj, line_items, &ascent,
8680 &descent, &w);
8681
8682 if (ascent + descent > h)
8683 h = ascent + descent;
8684
8685 y += h;
8686 if (w > wmax)
8687 wmax = w;
8688 h = 0;
8689 ascent = descent = 0;
8690 line_items = eina_list_free(line_items);
8691 }
8692 else
8693 {
8694 Evas_Coord fw, fh, fy;
8695 /* If there are no text items yet, calc ascent/descent
8696 * according to the current format. */
8697 if (it && (ascent + descent == 0))
8698 _layout_format_ascent_descent_adjust(obj, &ascent,
8699 &descent, it->format);
8700
8701 _layout_calculate_format_item_size(obj, fi, &ascent,
8702 &descent, &fy, &fw, &fh);
8703 }
8704 }
8705 else
8706 {
8707 _layout_format_ascent_descent_adjust(obj, &ascent,
8708 &descent, it->format);
8709 }
8710 }
8711
8712 _size_native_calc_line_finalize(obj, line_items, &ascent, &descent, &w);
8713
8714 line_items = eina_list_free(line_items);
8715
8716 /* Do the last addition */
8717 if (ascent + descent > h)
8718 h = ascent + descent;
8719
8720 if (w > wmax)
8721 wmax = w;
8722
8723 *_h = y + h;
8724 *_w = wmax;
8725}
8726
8727EAPI void
8728evas_object_textblock_size_native_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h)
8729{
8730 TB_HEAD();
8731 if (!o->native.valid)
8732 {
8733 Evas_Coord wmax = 0, hmax = 0;
8734 Evas_Object_Textblock_Paragraph *par;
8735 /* We just want the layout objects to update, should probably
8736 * split that. */
8737 if (!o->formatted.valid) _relayout(obj);
8738 EINA_INLIST_FOREACH(o->paragraphs, par)
8739 {
8740 Evas_Coord tw, th;
8741 _size_native_calc_paragraph_size(obj, o, par, &tw, &th);
8742 if (tw > wmax)
8743 wmax = tw;
8744 hmax += th;
8745 }
8746
8747 o->native.w = wmax;
8748 o->native.h = hmax;
8749
8750 o->native.valid = 1;
8751 o->content_changed = 0;
8752 o->format_changed = EINA_FALSE;
8753 }
8754 if (w) *w = o->native.w;
8755 if (h) *h = o->native.h;
8756}
8757
8758EAPI void
8759evas_object_textblock_style_insets_get(const Evas_Object *obj, Evas_Coord *l, Evas_Coord *r, Evas_Coord *t, Evas_Coord *b)
8760{
8761 TB_HEAD();
8762 if (!o->formatted.valid) _relayout(obj);
8763 if (l) *l = o->style_pad.l;
8764 if (r) *r = o->style_pad.r;
8765 if (t) *t = o->style_pad.t;
8766 if (b) *b = o->style_pad.b;
8767}
8768
8769/** @internal
8770 * FIXME: DELETE ME! DELETE ME!
8771 * This is an ugly workaround to get around the fact that
8772 * evas_object_textblock_coords_recalc isn't really called when it's supposed
8773 * to. When that bug is fixed please remove this. */
8774static void
8775_workaround_object_coords_recalc(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
8776{
8777 evas_object_textblock_coords_recalc(obj);
8778}
8779
8780/* all nice and private */
8781static void
8782evas_object_textblock_init(Evas_Object *obj)
8783{
8784 Evas_Object_Textblock *o;
8785#ifdef HAVE_LINEBREAK
8786 static Eina_Bool linebreak_init = EINA_FALSE;
8787 if (!linebreak_init)
8788 {
8789 linebreak_init = EINA_TRUE;
8790 init_linebreak();
8791 }
8792#endif
8793
8794 /* alloc image ob, setup methods and default values */
8795 obj->object_data = evas_object_textblock_new();
8796 /* set up default settings for this kind of object */
8797 obj->cur.color.r = 255;
8798 obj->cur.color.g = 255;
8799 obj->cur.color.b = 255;
8800 obj->cur.color.a = 255;
8801 obj->cur.geometry.x = 0.0;
8802 obj->cur.geometry.y = 0.0;
8803 obj->cur.geometry.w = 0.0;
8804 obj->cur.geometry.h = 0.0;
8805 obj->cur.layer = 0;
8806 /* set up object-specific settings */
8807 obj->prev = obj->cur;
8808 /* set up methods (compulsory) */
8809 obj->func = &object_func;
8810 obj->type = o_type;
8811
8812 o = (Evas_Object_Textblock *)(obj->object_data);
8813 o->cursor->obj = obj;
8814 o->legacy_newline = EINA_TRUE;
8815 evas_object_event_callback_priority_add(obj, EVAS_CALLBACK_RESIZE, -1000,
8816 _workaround_object_coords_recalc, NULL);
8817}
8818
8819static void *
8820evas_object_textblock_new(void)
8821{
8822 Evas_Object_Textblock *o;
8823
8824 /* alloc obj private data */
8825 EVAS_MEMPOOL_INIT(_mp_obj, "evas_object_textblock", Evas_Object_Textblock, 64, NULL);
8826 o = EVAS_MEMPOOL_ALLOC(_mp_obj, Evas_Object_Textblock);
8827 if (!o) return NULL;
8828 EVAS_MEMPOOL_PREP(_mp_obj, o, Evas_Object_Textblock);
8829 o->magic = MAGIC_OBJ_TEXTBLOCK;
8830 o->cursor = calloc(1, sizeof(Evas_Textblock_Cursor));
8831 _format_command_init();
8832 return o;
8833}
8834
8835static void
8836evas_object_textblock_free(Evas_Object *obj)
8837{
8838 Evas_Object_Textblock *o;
8839
8840 evas_object_textblock_clear(obj);
8841 evas_object_textblock_style_set(obj, NULL);
8842 o = (Evas_Object_Textblock *)(obj->object_data);
8843 free(o->cursor);
8844 while (o->cursors)
8845 {
8846 Evas_Textblock_Cursor *cur;
8847
8848 cur = (Evas_Textblock_Cursor *)o->cursors->data;
8849 o->cursors = eina_list_remove_list(o->cursors, o->cursors);
8850 free(cur);
8851 }
8852 if (o->repch) eina_stringshare_del(o->repch);
8853 if (o->ellip_ti) _item_free(obj, NULL, _ITEM(o->ellip_ti));
8854 o->magic = 0;
8855 EVAS_MEMPOOL_FREE(_mp_obj, o);
8856 _format_command_shutdown();
8857}
8858
8859
8860static void
8861evas_object_textblock_render(Evas_Object *obj, void *output, void *context, void *surface, int x, int y)
8862{
8863 Evas_Object_Textblock_Paragraph *par, *start = NULL;
8864 Evas_Object_Textblock_Line *ln;
8865 Evas_Object_Textblock *o;
8866 int i, j;
8867 int cx, cy, cw, ch, clip;
8868 const char vals[5][5] =
8869 {
8870 {0, 1, 2, 1, 0},
8871 {1, 3, 4, 3, 1},
8872 {2, 4, 5, 4, 2},
8873 {1, 3, 4, 3, 1},
8874 {0, 1, 2, 1, 0}
8875 };
8876
8877 /* render object to surface with context, and offxet by x,y */
8878 o = (Evas_Object_Textblock *)(obj->object_data);
8879 obj->layer->evas->engine.func->context_multiplier_unset(output,
8880 context);
8881 /* FIXME: This clipping is just until we fix inset handling correctly. */
8882 ENFN->context_clip_clip(output, context,
8883 obj->cur.geometry.x + x,
8884 obj->cur.geometry.y + y,
8885 obj->cur.geometry.w,
8886 obj->cur.geometry.h);
8887 clip = ENFN->context_clip_get(output, context, &cx, &cy, &cw, &ch);
8888 /* If there are no paragraphs and thus there are no lines,
8889 * there's nothing left to do. */
8890 if (!o->paragraphs) return;
8891
8892#define ITEM_WALK() \
8893 EINA_INLIST_FOREACH(start, par) \
8894 { \
8895 if (!par->visible) continue; \
8896 if (clip) \
8897 { \
8898 if ((obj->cur.geometry.y + y + par->y + par->h) < (cy - 20)) \
8899 continue; \
8900 if ((obj->cur.geometry.y + y + par->y) > (cy + ch + 20)) \
8901 break; \
8902 } \
8903 _layout_paragraph_render(o, par); \
8904 EINA_INLIST_FOREACH(par->lines, ln) \
8905 { \
8906 Evas_Object_Textblock_Item *itr; \
8907 \
8908 if (clip) \
8909 { \
8910 if ((obj->cur.geometry.y + y + par->y + ln->y + ln->h) < (cy - 20)) \
8911 continue; \
8912 if ((obj->cur.geometry.y + y + par->y + ln->y) > (cy + ch + 20)) \
8913 break; \
8914 } \
8915 EINA_INLIST_FOREACH(ln->items, itr) \
8916 { \
8917 Evas_Coord yoff; \
8918 yoff = ln->baseline; \
8919 if (itr->format->valign != -1.0) \
8920 { \
8921 yoff += itr->format->valign * (ln->h - itr->h); \
8922 } \
8923 if (clip) \
8924 { \
8925 if ((obj->cur.geometry.x + x + ln->x + itr->x + itr->w) < (cx - 20)) \
8926 continue; \
8927 if ((obj->cur.geometry.x + x + ln->x + itr->x) > (cx + cw + 20)) \
8928 break; \
8929 } \
8930 if ((ln->x + itr->x + itr->w) <= 0) continue; \
8931 if (ln->x + itr->x > obj->cur.geometry.w) break; \
8932 do
8933
8934#define ITEM_WALK_END() \
8935 while (0); \
8936 } \
8937 } \
8938 } \
8939 do {} while(0)
8940#define COLOR_SET(col) \
8941 ENFN->context_color_set(output, context, \
8942 (obj->cur.cache.clip.r * ti->parent.format->color.col.r) / 255, \
8943 (obj->cur.cache.clip.g * ti->parent.format->color.col.g) / 255, \
8944 (obj->cur.cache.clip.b * ti->parent.format->color.col.b) / 255, \
8945 (obj->cur.cache.clip.a * ti->parent.format->color.col.a) / 255);
8946#define COLOR_SET_AMUL(col, amul) \
8947 ENFN->context_color_set(output, context, \
8948 (obj->cur.cache.clip.r * ti->parent.format->color.col.r * (amul)) / 65025, \
8949 (obj->cur.cache.clip.g * ti->parent.format->color.col.g * (amul)) / 65025, \
8950 (obj->cur.cache.clip.b * ti->parent.format->color.col.b * (amul)) / 65025, \
8951 (obj->cur.cache.clip.a * ti->parent.format->color.col.a * (amul)) / 65025);
8952#define DRAW_TEXT(ox, oy) \
8953 if (ti->parent.format->font.font) ENFN->font_draw(output, context, surface, ti->parent.format->font.font, \
8954 obj->cur.geometry.x + ln->x + ti->parent.x + x + (ox), \
8955 obj->cur.geometry.y + ln->par->y + ln->y + yoff + y + (oy), \
8956 ti->parent.w, ti->parent.h, ti->parent.w, ti->parent.h, \
8957 &ti->text_props);
8958
8959 /* backing */
8960#define DRAW_RECT(ox, oy, ow, oh, or, og, ob, oa) \
8961 do \
8962 { \
8963 ENFN->context_color_set(output, \
8964 context, \
8965 (obj->cur.cache.clip.r * or) / 255, \
8966 (obj->cur.cache.clip.g * og) / 255, \
8967 (obj->cur.cache.clip.b * ob) / 255, \
8968 (obj->cur.cache.clip.a * oa) / 255); \
8969 ENFN->rectangle_draw(output, \
8970 context, \
8971 surface, \
8972 obj->cur.geometry.x + ln->x + x + (ox), \
8973 obj->cur.geometry.y + ln->par->y + ln->y + y + (oy), \
8974 (ow), \
8975 (oh)); \
8976 } \
8977 while (0)
8978
8979#define DRAW_FORMAT_DASHED(oname, oy, oh, dw, dp) \
8980 do \
8981 { \
8982 if (itr->format->oname) \
8983 { \
8984 unsigned char _or, _og, _ob, _oa; \
8985 int _ind, _dx = 0, _dn, _dr; \
8986 _or = itr->format->color.oname.r; \
8987 _og = itr->format->color.oname.g; \
8988 _ob = itr->format->color.oname.b; \
8989 _oa = itr->format->color.oname.a; \
8990 if (!EINA_INLIST_GET(itr)->next) \
8991 { \
8992 _dn = itr->w / (dw + dp); \
8993 _dr = itr->w % (dw + dp); \
8994 } \
8995 else \
8996 { \
8997 _dn = itr->adv / (dw + dp); \
8998 _dr = itr->adv % (dw + dp); \
8999 } \
9000 if (_dr > dw) _dr = dw; \
9001 for (_ind = 0 ; _ind < _dn ; _ind++) \
9002 { \
9003 DRAW_RECT(itr->x + _dx, oy, dw, oh, _or, _og, _ob, _oa); \
9004 _dx += dw + dp; \
9005 } \
9006 DRAW_RECT(itr->x + _dx, oy, _dr, oh, _or, _og, _ob, _oa); \
9007 } \
9008 } \
9009 while (0)
9010
9011#define DRAW_FORMAT(oname, oy, oh) \
9012 do \
9013 { \
9014 if (itr->format->oname) \
9015 { \
9016 unsigned char _or, _og, _ob, _oa; \
9017 _or = itr->format->color.oname.r; \
9018 _og = itr->format->color.oname.g; \
9019 _ob = itr->format->color.oname.b; \
9020 _oa = itr->format->color.oname.a; \
9021 if (!EINA_INLIST_GET(itr)->next) \
9022 { \
9023 DRAW_RECT(itr->x, oy, itr->w, oh, _or, _og, _ob, _oa); \
9024 } \
9025 else \
9026 { \
9027 DRAW_RECT(itr->x, oy, itr->adv, oh, _or, _og, _ob, _oa); \
9028 } \
9029 } \
9030 } \
9031 while (0)
9032
9033 {
9034 Evas_Coord look_for_y = 0 - (obj->cur.geometry.y + y);
9035 if (clip)
9036 {
9037 Evas_Coord tmp_lfy = cy - (obj->cur.geometry.y + y);
9038 if (tmp_lfy > look_for_y)
9039 look_for_y = tmp_lfy;
9040 }
9041
9042 if (look_for_y >= 0)
9043 start = _layout_find_paragraph_by_y(o, look_for_y);
9044
9045 if (!start)
9046 start = o->paragraphs;
9047 }
9048
9049 ITEM_WALK()
9050 {
9051 DRAW_FORMAT(backing, 0, ln->h);
9052 }
9053 ITEM_WALK_END();
9054
9055 /* There are size adjustments that depend on the styles drawn here back
9056 * in "_text_item_update_sizes" should not modify one without the other. */
9057
9058 /* prepare everything for text draw */
9059
9060 /* shadows */
9061 ITEM_WALK()
9062 {
9063 int shad_dst, shad_sz, dx, dy, haveshad;
9064 Evas_Object_Textblock_Text_Item *ti;
9065 ti = (itr->type == EVAS_TEXTBLOCK_ITEM_TEXT) ? _ITEM_TEXT(itr) : NULL;
9066 if (!ti) continue;
9067
9068 shad_dst = shad_sz = dx = dy = haveshad = 0;
9069 switch (ti->parent.format->style & EVAS_TEXT_STYLE_MASK_BASIC)
9070 {
9071 case EVAS_TEXT_STYLE_SHADOW:
9072 case EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW:
9073 shad_dst = 1;
9074 haveshad = 1;
9075 break;
9076 case EVAS_TEXT_STYLE_OUTLINE_SHADOW:
9077 case EVAS_TEXT_STYLE_FAR_SHADOW:
9078 shad_dst = 2;
9079 haveshad = 1;
9080 break;
9081 case EVAS_TEXT_STYLE_FAR_SOFT_SHADOW:
9082 shad_dst = 2;
9083 shad_sz = 2;
9084 haveshad = 1;
9085 break;
9086 case EVAS_TEXT_STYLE_SOFT_SHADOW:
9087 shad_dst = 1;
9088 shad_sz = 2;
9089 haveshad = 1;
9090 break;
9091 default:
9092 break;
9093 }
9094 if (haveshad)
9095 {
9096 if (shad_dst > 0)
9097 {
9098 switch (ti->parent.format->style & EVAS_TEXT_STYLE_MASK_SHADOW_DIRECTION)
9099 {
9100 case EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_RIGHT:
9101 dx = 1;
9102 dy = 1;
9103 break;
9104 case EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM:
9105 dx = 0;
9106 dy = 1;
9107 break;
9108 case EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_LEFT:
9109 dx = -1;
9110 dy = 1;
9111 break;
9112 case EVAS_TEXT_STYLE_SHADOW_DIRECTION_LEFT:
9113 dx = -1;
9114 dy = 0;
9115 break;
9116 case EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP_LEFT:
9117 dx = -1;
9118 dy = -1;
9119 break;
9120 case EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP:
9121 dx = 0;
9122 dy = -1;
9123 break;
9124 case EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP_RIGHT:
9125 dx = 1;
9126 dy = -1;
9127 break;
9128 case EVAS_TEXT_STYLE_SHADOW_DIRECTION_RIGHT:
9129 dx = 1;
9130 dy = 0;
9131 default:
9132 break;
9133 }
9134 dx *= shad_dst;
9135 dy *= shad_dst;
9136 }
9137 switch (shad_sz)
9138 {
9139 case 0:
9140 COLOR_SET(shadow);
9141 DRAW_TEXT(dx, dy);
9142 break;
9143 case 2:
9144 for (j = 0; j < 5; j++)
9145 {
9146 for (i = 0; i < 5; i++)
9147 {
9148 if (vals[i][j] != 0)
9149 {
9150 COLOR_SET_AMUL(shadow, vals[i][j] * 50);
9151 DRAW_TEXT(i - 2 + dx, j - 2 + dy);
9152 }
9153 }
9154 }
9155 break;
9156 default:
9157 break;
9158 }
9159 }
9160 }
9161 ITEM_WALK_END();
9162
9163 /* glows */
9164 ITEM_WALK()
9165 {
9166 Evas_Object_Textblock_Text_Item *ti;
9167 ti = (itr->type == EVAS_TEXTBLOCK_ITEM_TEXT) ? _ITEM_TEXT(itr) : NULL;
9168 if (!ti) continue;
9169
9170 if (ti->parent.format->style == EVAS_TEXT_STYLE_GLOW)
9171 {
9172 for (j = 0; j < 5; j++)
9173 {
9174 for (i = 0; i < 5; i++)
9175 {
9176 if (vals[i][j] != 0)
9177 {
9178 COLOR_SET_AMUL(glow, vals[i][j] * 50);
9179 DRAW_TEXT(i - 2, j - 2);
9180 }
9181 }
9182 }
9183 COLOR_SET(glow2);
9184 DRAW_TEXT(-1, 0);
9185 DRAW_TEXT(1, 0);
9186 DRAW_TEXT(0, -1);
9187 DRAW_TEXT(0, 1);
9188 }
9189 }
9190 ITEM_WALK_END();
9191
9192 /* outlines */
9193 ITEM_WALK()
9194 {
9195 Evas_Object_Textblock_Text_Item *ti;
9196 ti = (itr->type == EVAS_TEXTBLOCK_ITEM_TEXT) ? _ITEM_TEXT(itr) : NULL;
9197 if (!ti) continue;
9198
9199 if ((ti->parent.format->style == EVAS_TEXT_STYLE_OUTLINE) ||
9200 (ti->parent.format->style == EVAS_TEXT_STYLE_OUTLINE_SHADOW) ||
9201 (ti->parent.format->style == EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW))
9202 {
9203 COLOR_SET(outline);
9204 DRAW_TEXT(-1, 0);
9205 DRAW_TEXT(1, 0);
9206 DRAW_TEXT(0, -1);
9207 DRAW_TEXT(0, 1);
9208 }
9209 else if (ti->parent.format->style == EVAS_TEXT_STYLE_SOFT_OUTLINE)
9210 {
9211 for (j = 0; j < 5; j++)
9212 {
9213 for (i = 0; i < 5; i++)
9214 {
9215 if (((i != 2) || (j != 2)) && (vals[i][j] != 0))
9216 {
9217 COLOR_SET_AMUL(outline, vals[i][j] * 50);
9218 DRAW_TEXT(i - 2, j - 2);
9219 }
9220 }
9221 }
9222 }
9223 }
9224 ITEM_WALK_END();
9225
9226 /* normal text and lines */
9227 ITEM_WALK()
9228 {
9229 Evas_Object_Textblock_Text_Item *ti;
9230 ti = (itr->type == EVAS_TEXTBLOCK_ITEM_TEXT) ? _ITEM_TEXT(itr) : NULL;
9231 /* NORMAL TEXT */
9232 if (ti)
9233 {
9234 COLOR_SET(normal);
9235 DRAW_TEXT(0, 0);
9236 }
9237
9238 /* STRIKETHROUGH */
9239 DRAW_FORMAT(strikethrough, (ln->h / 2), 1);
9240
9241 /* UNDERLINE */
9242 DRAW_FORMAT(underline, ln->baseline + 1, 1);
9243
9244 /* UNDERLINE DASHED */
9245 DRAW_FORMAT_DASHED(underline_dash, ln->baseline + 1, 1,
9246 ti->parent.format->underline_dash_width,
9247 ti->parent.format->underline_dash_gap);
9248
9249 /* UNDERLINE2 */
9250 DRAW_FORMAT(underline2, ln->baseline + 3, 1);
9251 }
9252 ITEM_WALK_END();
9253}
9254
9255static void
9256evas_object_textblock_render_pre(Evas_Object *obj)
9257{
9258 Evas_Object_Textblock *o;
9259 int is_v, was_v;
9260
9261 /* dont pre-render the obj twice! */
9262 if (obj->pre_render_done) return;
9263 obj->pre_render_done = 1;
9264 /* pre-render phase. this does anything an object needs to do just before */
9265 /* rendering. this could mean loading the image data, retrieving it from */
9266 /* elsewhere, decoding video etc. */
9267 /* then when this is done the object needs to figure if it changed and */
9268 /* if so what and where and add the appropriate redraw textblocks */
9269 o = (Evas_Object_Textblock *)(obj->object_data);
9270 if ((o->changed) || (o->content_changed) || (o->format_changed) ||
9271 ((obj->cur.geometry.w != o->last_w) ||
9272 (((o->valign != 0.0) || (o->have_ellipsis)) &&
9273 (obj->cur.geometry.h != o->last_h))))
9274 {
9275 _relayout(obj);
9276 o->redraw = 0;
9277 evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, obj);
9278 is_v = evas_object_is_visible(obj);
9279 was_v = evas_object_was_visible(obj);
9280 goto done;
9281 }
9282 if (o->redraw)
9283 {
9284 o->redraw = 0;
9285 evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, obj);
9286 is_v = evas_object_is_visible(obj);
9287 was_v = evas_object_was_visible(obj);
9288 goto done;
9289 }
9290 /* if someone is clipping this obj - go calculate the clipper */
9291 if (obj->cur.clipper)
9292 {
9293 if (obj->cur.cache.clip.dirty)
9294 evas_object_clip_recalc(obj->cur.clipper);
9295 obj->cur.clipper->func->render_pre(obj->cur.clipper);
9296 }
9297 /* now figure what changed and add draw rects */
9298 /* if it just became visible or invisible */
9299 is_v = evas_object_is_visible(obj);
9300 was_v = evas_object_was_visible(obj);
9301 if (is_v != was_v)
9302 {
9303 evas_object_render_pre_visible_change(&obj->layer->evas->clip_changes, obj, is_v, was_v);
9304 goto done;
9305 }
9306 if ((obj->cur.map != obj->prev.map) ||
9307 (obj->cur.usemap != obj->prev.usemap))
9308 {
9309 evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, obj);
9310 goto done;
9311 }
9312 /* it's not visible - we accounted for it appearing or not so just abort */
9313 if (!is_v) goto done;
9314 /* clipper changed this is in addition to anything else for obj */
9315 evas_object_render_pre_clipper_change(&obj->layer->evas->clip_changes, obj);
9316 /* if we restacked (layer or just within a layer) and don't clip anyone */
9317 if (obj->restack)
9318 {
9319 evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, obj);
9320 goto done;
9321 }
9322 /* if it changed color */
9323 if ((obj->cur.color.r != obj->prev.color.r) ||
9324 (obj->cur.color.g != obj->prev.color.g) ||
9325 (obj->cur.color.b != obj->prev.color.b) ||
9326 (obj->cur.color.a != obj->prev.color.a))
9327 {
9328 evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, obj);
9329 goto done;
9330 }
9331 /* if it changed geometry - and obviously not visibility or color */
9332 /* calculate differences since we have a constant color fill */
9333 /* we really only need to update the differences */
9334 if ((obj->cur.geometry.x != obj->prev.geometry.x) ||
9335 (obj->cur.geometry.y != obj->prev.geometry.y) ||
9336 (obj->cur.geometry.w != obj->prev.geometry.w) ||
9337 (obj->cur.geometry.h != obj->prev.geometry.h))
9338 {
9339 evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, obj);
9340 goto done;
9341 }
9342 done:
9343 evas_object_render_pre_effect_updates(&obj->layer->evas->clip_changes, obj, is_v, was_v);
9344}
9345
9346static void
9347evas_object_textblock_render_post(Evas_Object *obj)
9348{
9349/* Evas_Object_Textblock *o; */
9350
9351 /* this moves the current data to the previous state parts of the object */
9352 /* in whatever way is safest for the object. also if we don't need object */
9353 /* data anymore we can free it if the object deems this is a good idea */
9354/* o = (Evas_Object_Textblock *)(obj->object_data); */
9355 /* remove those pesky changes */
9356 evas_object_clip_changes_clean(obj);
9357 /* move cur to prev safely for object data */
9358 obj->prev = obj->cur;
9359/* o->prev = o->cur; */
9360/* o->changed = 0; */
9361}
9362
9363static unsigned int evas_object_textblock_id_get(Evas_Object *obj)
9364{
9365 Evas_Object_Textblock *o;
9366
9367 o = (Evas_Object_Textblock *)(obj->object_data);
9368 if (!o) return 0;
9369 return MAGIC_OBJ_TEXTBLOCK;
9370}
9371
9372static unsigned int evas_object_textblock_visual_id_get(Evas_Object *obj)
9373{
9374 Evas_Object_Textblock *o;
9375
9376 o = (Evas_Object_Textblock *)(obj->object_data);
9377 if (!o) return 0;
9378 return MAGIC_OBJ_CUSTOM;
9379}
9380
9381static void *evas_object_textblock_engine_data_get(Evas_Object *obj)
9382{
9383 Evas_Object_Textblock *o;
9384
9385 o = (Evas_Object_Textblock *)(obj->object_data);
9386 if (!o) return NULL;
9387 return o->engine_data;
9388}
9389
9390static int
9391evas_object_textblock_is_opaque(Evas_Object *obj __UNUSED__)
9392{
9393 /* this returns 1 if the internal object data implies that the object is */
9394 /* currently fulyl opque over the entire gradient it occupies */
9395 return 0;
9396}
9397
9398static int
9399evas_object_textblock_was_opaque(Evas_Object *obj __UNUSED__)
9400{
9401 /* this returns 1 if the internal object data implies that the object was */
9402 /* currently fulyl opque over the entire gradient it occupies */
9403 return 0;
9404}
9405
9406static void
9407evas_object_textblock_coords_recalc(Evas_Object *obj)
9408{
9409 Evas_Object_Textblock *o;
9410
9411 o = (Evas_Object_Textblock *)(obj->object_data);
9412 if ((obj->cur.geometry.w != o->last_w) ||
9413 (((o->valign != 0.0) || (o->have_ellipsis)) &&
9414 (obj->cur.geometry.h != o->last_h)))
9415 {
9416 o->formatted.valid = 0;
9417 o->changed = 1;
9418 }
9419}
9420
9421static void
9422evas_object_textblock_scale_update(Evas_Object *obj)
9423{
9424 Evas_Object_Textblock *o;
9425
9426 o = (Evas_Object_Textblock *)(obj->object_data);
9427 _evas_textblock_invalidate_all(o);
9428 _evas_textblock_changed(o, obj);
9429}
9430
9431void
9432_evas_object_textblock_rehint(Evas_Object *obj)
9433{
9434 Evas_Object_Textblock *o;
9435 Evas_Object_Textblock_Paragraph *par;
9436 Evas_Object_Textblock_Line *ln;
9437
9438 o = (Evas_Object_Textblock *)(obj->object_data);
9439 EINA_INLIST_FOREACH(o->paragraphs, par)
9440 {
9441 EINA_INLIST_FOREACH(par->lines, ln)
9442 {
9443 Evas_Object_Textblock_Item *it;
9444
9445 EINA_INLIST_FOREACH(ln->items, it)
9446 {
9447 if (it->type == EVAS_TEXTBLOCK_ITEM_TEXT)
9448 {
9449 Evas_Object_Textblock_Text_Item *ti = _ITEM_TEXT(it);
9450 if (ti->parent.format->font.font)
9451 {
9452#ifdef EVAS_FRAME_QUEUING
9453 evas_common_pipe_op_text_flush((RGBA_Font *) ti->parent.format->font.font);
9454#endif
9455 evas_font_load_hinting_set(obj->layer->evas,
9456 ti->parent.format->font.font,
9457 obj->layer->evas->hinting);
9458 }
9459 }
9460 }
9461 }
9462 }
9463 _evas_textblock_invalidate_all(o);
9464 _evas_textblock_changed(o, obj);
9465}
9466
9467/**
9468 * @}
9469 */
9470
9471#ifdef HAVE_TESTS
9472/* return EINA_FALSE on error, used in unit_testing */
9473EAPI Eina_Bool
9474_evas_textblock_check_item_node_link(Evas_Object *obj)
9475{
9476 Evas_Object_Textblock *o;
9477 Evas_Object_Textblock_Paragraph *par;
9478 Evas_Object_Textblock_Line *ln;
9479 Evas_Object_Textblock_Item *it;
9480
9481 o = (Evas_Object_Textblock *)(obj->object_data);
9482 if (!o) return EINA_FALSE;
9483
9484 if (!o->formatted.valid) _relayout(obj);
9485
9486 EINA_INLIST_FOREACH(o->paragraphs, par)
9487 {
9488 EINA_INLIST_FOREACH(par->lines, ln)
9489 {
9490 EINA_INLIST_FOREACH(ln->items, it)
9491 {
9492 if (it->text_node != par->text_node)
9493 return EINA_FALSE;
9494 }
9495 }
9496 }
9497 return EINA_TRUE;
9498}
9499
9500EAPI int
9501_evas_textblock_format_offset_get(const Evas_Object_Textblock_Node_Format *n)
9502{
9503 return n->offset;
9504}
9505#endif
9506
9507#if 0
9508/* Good for debugging */
9509void
9510pfnode(Evas_Object_Textblock_Node_Format *n)
9511{
9512 printf("Format Node: %p\n", n);
9513 printf("next = %p, prev = %p, last = %p\n", EINA_INLIST_GET(n)->next, EINA_INLIST_GET(n)->prev, EINA_INLIST_GET(n)->last);
9514 printf("text_node = %p, offset = %u, visible = %d\n", n->text_node, n->offset, n->visible);
9515 printf("'%s'\n", eina_strbuf_string_get(n->format));
9516}
9517
9518void
9519ptnode(Evas_Object_Textblock_Node_Text *n)
9520{
9521 printf("Text Node: %p\n", n);
9522 printf("next = %p, prev = %p, last = %p\n", EINA_INLIST_GET(n)->next, EINA_INLIST_GET(n)->prev, EINA_INLIST_GET(n)->last);
9523 printf("format_node = %p\n", n->format_node);
9524 printf("'%ls'\n", eina_ustrbuf_string_get(n->unicode));
9525}
9526
9527void
9528pitem(Evas_Object_Textblock_Item *it)
9529{
9530 Evas_Object_Textblock_Text_Item *ti;
9531 Evas_Object_Textblock_Format_Item *fi;
9532 printf("Item: %p\n", it);
9533 printf("Type: %s (%d)\n", (it->type == EVAS_TEXTBLOCK_ITEM_TEXT) ?
9534 "TEXT" : "FORMAT", it->type);
9535 printf("Text pos: %d Visual pos: %d\n", it->text_pos,
9536#ifdef BIDI_SUPPORT
9537 it->visual_pos
9538#else
9539 it->text_pos
9540#endif
9541 );
9542 printf("Coords: x = %d w = %d adv = %d\n", (int) it->x, (int) it->w,
9543 (int) it->adv);
9544 if (it->type == EVAS_TEXTBLOCK_ITEM_TEXT)
9545 {
9546 ti = _ITEM_TEXT(it);
9547 printf("Text: '%*ls'\n", ti->text_props.text_len, GET_ITEM_TEXT(ti));
9548 }
9549 else
9550 {
9551 fi = _ITEM_FORMAT(it);
9552 printf("Format: '%s'\n", fi->item);
9553 }
9554}
9555
9556void
9557ppar(Evas_Object_Textblock_Paragraph *par)
9558{
9559 Evas_Object_Textblock_Item *it;
9560 Eina_List *i;
9561 EINA_LIST_FOREACH(par->logical_items, i, it)
9562 {
9563 printf("***********************\n");
9564 pitem(it);
9565 }
9566}
9567
9568#endif
9569
diff --git a/libraries/evas/src/lib/canvas/evas_rectangle.c b/libraries/evas/src/lib/canvas/evas_rectangle.c
new file mode 100644
index 0000000..da6b701
--- /dev/null
+++ b/libraries/evas/src/lib/canvas/evas_rectangle.c
@@ -0,0 +1,98 @@
1#include "evas_common.h"
2#include "evas_private.h"
3
4void
5evas_rects_return_difference_rects(Eina_Array *rects, int x, int y, int w, int h, int xx, int yy, int ww, int hh)
6{
7 if (!RECTS_INTERSECT(x, y, w, h, xx, yy, ww, hh))
8 {
9 evas_add_rect(rects, x, y, w, h);
10 evas_add_rect(rects, xx, yy, ww, hh);
11 }
12 else
13 {
14 int pt_x[4], pt_y[4], i, j;
15
16 if (x < xx)
17 {
18 pt_x[0] = x;
19 pt_x[1] = xx;
20 }
21 else
22 {
23 pt_x[0] = xx;
24 pt_x[1] = x;
25 }
26 if ((x + w) < (xx + ww))
27 {
28 pt_x[2] = x + w;
29 pt_x[3] = xx + ww;
30 }
31 else
32 {
33 pt_x[2] = xx + ww;
34 pt_x[3] = x + w;
35 }
36 if (y < yy)
37 {
38 pt_y[0] = y;
39 pt_y[1] = yy;
40 }
41 else
42 {
43 pt_y[0] = yy;
44 pt_y[1] = y;
45 }
46 if ((y + h) < (yy + hh))
47 {
48 pt_y[2] = y + h;
49 pt_y[3] = yy + hh;
50 }
51 else
52 {
53 pt_y[2] = yy + hh;
54 pt_y[3] = y + h;
55 }
56 for (j = 0; j < 3; j++)
57 {
58 for (i = 0; i < 3; i++)
59 {
60 int intsec1, intsec2;
61 int tx, ty, tw, th;
62
63 tx = pt_x[i];
64 ty = pt_y[j];
65 tw = pt_x[i + 1] - pt_x[i];
66 th = pt_y[j + 1] - pt_y[j];
67
68 intsec1 = (RECTS_INTERSECT(tx, ty, tw, th, x, y, w, h));
69 intsec2 = (RECTS_INTERSECT(tx, ty, tw, th, xx, yy, ww, hh));
70 if (intsec1 ^ intsec2)
71 {
72 evas_add_rect(rects, tx, ty, tw, th);
73 }
74 }
75 }
76/* if (tmp.count > 0) */
77/* { */
78/* unsigned int i; */
79
80/* for (i = 0; i < tmp.count; ++i) */
81/* { */
82/* if ((tmp.array[i].w > 0) && (tmp.array[i].h > 0)) */
83/* { */
84/* int intsec1, intsec2; */
85
86/* intsec1 = (RECTS_INTERSECT(tmp.array[i].x, tmp.array[i].y, tmp.array[i].w, tmp.array[i].h, x, y, w, h)); */
87/* intsec2 = (RECTS_INTERSECT(tmp.array[i].x, tmp.array[i].y, tmp.array[i].w, tmp.array[i].h, xx, yy, ww, hh)); */
88/* if (intsec1 ^ intsec2) */
89/* { */
90/* evas_add_rect(rects, tmp.array[i].x, tmp.array[i].y, tmp.array[i].w, tmp.array[i].h); */
91/* } */
92/* } */
93/* } */
94/* free(tmp.array); */
95/* } */
96
97 }
98}
diff --git a/libraries/evas/src/lib/canvas/evas_render.c b/libraries/evas/src/lib/canvas/evas_render.c
new file mode 100644
index 0000000..0abee97
--- /dev/null
+++ b/libraries/evas/src/lib/canvas/evas_render.c
@@ -0,0 +1,1866 @@
1#include "evas_common.h"
2#include "evas_private.h"
3#include <math.h>
4
5// debug rendering
6/* #define REND_DGB 1 */
7/* #define STDOUT_DBG 1 */
8
9#ifdef REND_DGB
10static FILE *dbf = NULL;
11
12static void
13rend_dbg(const char *txt)
14{
15 if (!dbf)
16 {
17#ifdef STDOUT_DBG
18 dbf = stdout;
19#else
20 dbf = fopen("EVAS-RENDER-DEBUG.log", "w");
21#endif
22 if (!dbf) return;
23 }
24 fputs(txt, dbf);
25 fflush(dbf);
26}
27#define RD(args...) \
28 { \
29 char __tmpbuf[4096]; \
30 \
31 snprintf(__tmpbuf, sizeof(__tmpbuf), ##args); \
32 rend_dbg(__tmpbuf); \
33 }
34#define RDI(xxxx) \
35 { \
36 char __tmpbuf[4096]; int __tmpi; \
37 for (__tmpi = 0; __tmpi < xxxx; __tmpi++) \
38 __tmpbuf[__tmpi] = ' '; \
39 __tmpbuf[__tmpi] = 0; \
40 rend_dbg(__tmpbuf); \
41 }
42#else
43#define RD(args...)
44#define RDI(x)
45#endif
46
47static Eina_List *
48evas_render_updates_internal(Evas *e, unsigned char make_updates, unsigned char do_draw);
49
50EAPI void
51evas_damage_rectangle_add(Evas *e, int x, int y, int w, int h)
52{
53 Eina_Rectangle *r;
54
55 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
56 return;
57 MAGIC_CHECK_END();
58 NEW_RECT(r, x, y, w, h);
59 if (!r) return;
60 e->damages = eina_list_append(e->damages, r);
61 e->changed = 1;
62}
63
64EAPI void
65evas_obscured_rectangle_add(Evas *e, int x, int y, int w, int h)
66{
67 Eina_Rectangle *r;
68
69 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
70 return;
71 MAGIC_CHECK_END();
72 NEW_RECT(r, x, y, w, h);
73 if (!r) return;
74 e->obscures = eina_list_append(e->obscures, r);
75}
76
77EAPI void
78evas_obscured_clear(Evas *e)
79{
80 Eina_Rectangle *r;
81
82 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
83 return;
84 MAGIC_CHECK_END();
85 EINA_LIST_FREE(e->obscures, r)
86 {
87 eina_rectangle_free(r);
88 }
89}
90
91static Eina_Bool
92_evas_render_has_map(Evas_Object *obj)
93{
94 return ((!((obj->func->can_map) && (obj->func->can_map(obj)))) &&
95 ((obj->cur.map) && (obj->cur.usemap)));
96 // return ((obj->cur.map) && (obj->cur.usemap));
97}
98
99static Eina_Bool
100_evas_render_had_map(Evas_Object *obj)
101{
102 return ((obj->prev.map) && (obj->prev.usemap));
103 // return ((!obj->cur.map) && (obj->prev.usemap));
104}
105
106static Eina_Bool
107_evas_render_is_relevant(Evas_Object *obj)
108{
109 return ((evas_object_is_visible(obj) && (!obj->cur.have_clipees)) ||
110 (evas_object_was_visible(obj) && (!obj->prev.have_clipees)));
111}
112
113static Eina_Bool
114_evas_render_can_render(Evas_Object *obj)
115{
116 return (evas_object_is_visible(obj) && (!obj->cur.have_clipees));
117}
118
119static void
120_evas_render_prev_cur_clip_cache_add(Evas *e, Evas_Object *obj)
121{
122 e->engine.func->output_redraws_rect_add(e->engine.data.output,
123 obj->prev.cache.clip.x,
124 obj->prev.cache.clip.y,
125 obj->prev.cache.clip.w,
126 obj->prev.cache.clip.h);
127 e->engine.func->output_redraws_rect_add(e->engine.data.output,
128 obj->cur.cache.clip.x,
129 obj->cur.cache.clip.y,
130 obj->cur.cache.clip.w,
131 obj->cur.cache.clip.h);
132}
133
134static void
135_evas_render_cur_clip_cache_del(Evas *e, Evas_Object *obj)
136{
137 Evas_Coord x, y, w, h;
138
139 x = obj->cur.cache.clip.x;
140 y = obj->cur.cache.clip.y;
141 w = obj->cur.cache.clip.w;
142 h = obj->cur.cache.clip.h;
143 if (obj->cur.clipper)
144 {
145 RECTS_CLIP_TO_RECT(x, y, w, h,
146 obj->cur.clipper->cur.cache.clip.x,
147 obj->cur.clipper->cur.cache.clip.y,
148 obj->cur.clipper->cur.cache.clip.w,
149 obj->cur.clipper->cur.cache.clip.h);
150 }
151 e->engine.func->output_redraws_rect_del(e->engine.data.output,
152 x, y, w, h);
153}
154
155static void
156_evas_render_phase1_direct(Evas *e,
157 Eina_Array *active_objects,
158 Eina_Array *restack_objects __UNUSED__,
159 Eina_Array *delete_objects __UNUSED__,
160 Eina_Array *render_objects)
161{
162 unsigned int i;
163 Eina_List *l;
164 Evas_Object *proxy;
165
166 RD(" [--- PHASE 1 DIRECT\n");
167 for (i = 0; i < active_objects->count; i++)
168 {
169 Evas_Object *obj;
170
171 obj = eina_array_data_get(active_objects, i);
172 if (obj->changed)
173 {
174 /* Flag need redraw on proxy too */
175 evas_object_clip_recalc(obj);
176 if (obj->proxy.proxies)
177 {
178 EINA_LIST_FOREACH(obj->proxy.proxies, l, proxy)
179 proxy->proxy.redraw = 1;
180 }
181 }
182 }
183 for (i = 0; i < render_objects->count; i++)
184 {
185 Evas_Object *obj;
186
187 obj = eina_array_data_get(render_objects, i);
188 RD(" OBJ [%p] changed %i\n", obj, obj->changed);
189 if (obj->changed)
190 {
191 /* Flag need redraw on proxy too */
192 evas_object_clip_recalc(obj);
193 obj->func->render_pre(obj);
194 if (obj->proxy.proxies)
195 {
196 obj->proxy.redraw = 1;
197 EINA_LIST_FOREACH(obj->proxy.proxies, l, proxy)
198 {
199 proxy->func->render_pre(proxy);
200 _evas_render_prev_cur_clip_cache_add(e, proxy);
201 }
202 }
203 else if (obj->proxy.redraw)
204 {
205 _evas_render_prev_cur_clip_cache_add(e, obj);
206 }
207 if (obj->pre_render_done)
208 {
209 RD(" pre-render-done smart:%p|%p [%p, %i] | [%p, %i] has_map:%i had_map:%i\n",
210 obj->smart.smart,
211 evas_object_smart_members_get_direct(obj),
212 obj->cur.map, obj->cur.usemap,
213 obj->prev.map, obj->prev.usemap,
214 _evas_render_has_map(obj),
215 _evas_render_had_map(obj));
216 if ((obj->smart.smart) &&
217 (_evas_render_has_map(obj)))
218 {
219 RD(" has map + smart\n");
220 _evas_render_prev_cur_clip_cache_add(e, obj);
221 }
222 }
223 else if (_evas_render_had_map(obj))
224 {
225 RD(" no pre-render done\n");
226 _evas_render_prev_cur_clip_cache_add(e, obj);
227 }
228 }
229 else
230 {
231 if (obj->smart.smart)
232 {
233 // obj->func->render_pre(obj);
234 }
235 else if ((obj->rect_del) ||
236 (evas_object_is_opaque(obj) && evas_object_is_visible(obj)))
237 {
238 RD(" rect del\n");
239 _evas_render_cur_clip_cache_del(e, obj);
240 }
241 }
242 }
243 RD(" ---]\n");
244}
245
246static Eina_Bool
247_evas_render_phase1_object_process(Evas *e, Evas_Object *obj,
248 Eina_Array *active_objects,
249 Eina_Array *restack_objects,
250 Eina_Array *delete_objects,
251 Eina_Array *render_objects,
252 int restack, int map,
253 int *redraw_all
254#ifdef REND_DGB
255 , int level
256#endif
257 )
258{
259 Eina_Bool clean_them = EINA_FALSE;
260 Evas_Object *obj2;
261 int is_active;
262 Eina_Bool hmap;
263
264 obj->rect_del = 0;
265 obj->render_pre = 0;
266
267#ifndef EVAS_FRAME_QUEUING
268 /* because of clip objects - delete 2 cycles later */
269 if (obj->delete_me == 2)
270#else
271 if (obj->delete_me == evas_common_frameq_get_frameq_sz() + 2)
272#endif
273 eina_array_push(delete_objects, obj);
274 else if (obj->delete_me != 0) obj->delete_me++;
275 /* If the object will be removed, we should not cache anything during this run. */
276 if (obj->delete_me != 0) clean_them = EINA_TRUE;
277
278 /* build active object list */
279 evas_object_clip_recalc(obj);
280 is_active = evas_object_is_active(obj);
281 obj->is_active = is_active;
282
283 RDI(level);
284 RD(" [--- PROCESS [%p] '%s' active = %i, del = %i | %i %i %ix%i\n", obj, obj->type, is_active, obj->delete_me, obj->cur.geometry.x, obj->cur.geometry.y, obj->cur.geometry.w, obj->cur.geometry.h);
285 if ((is_active) || (obj->delete_me != 0))
286 eina_array_push(active_objects, obj);
287
288#ifdef REND_DGB
289 if (!is_active)
290 {
291 RDI(level);
292 RD(" [%p] vis: %i, cache.clip.vis: %i cache.clip.a: %i [%p]\n", obj, obj->cur.visible, obj->cur.cache.clip.visible, obj->cur.cache.clip.a, obj->func->is_visible);
293 }
294#endif
295
296 map = _evas_render_has_map(obj);
297 hmap = _evas_render_had_map(obj);
298
299 if ((restack) && (!map))
300 {
301 if (!obj->changed)
302 {
303 eina_array_push(&e->pending_objects, obj);
304 obj->changed = 1;
305 }
306 obj->restack = 1;
307 clean_them = EINA_TRUE;
308 }
309
310 if (map)
311 {
312 RDI(level);
313 RD(" obj mapped\n");
314 if (obj->changed)
315 {
316 if (map != hmap)
317 {
318 *redraw_all = 1;
319 }
320 evas_object_clip_recalc(obj);
321 if ((obj->restack) &&
322 (is_active) && (!obj->clip.clipees) &&
323 ((evas_object_is_visible(obj) && (!obj->cur.have_clipees)) ||
324 (evas_object_was_visible(obj) && (!obj->prev.have_clipees))))
325 {
326 eina_array_push(render_objects, obj);
327 _evas_render_prev_cur_clip_cache_add(e, obj);
328 obj->render_pre = 1;
329 }
330 else if ((is_active) && (!obj->clip.clipees) &&
331 ((evas_object_is_visible(obj) && (!obj->cur.have_clipees)) ||
332 (evas_object_was_visible(obj) && (!obj->prev.have_clipees))))
333 {
334 eina_array_push(render_objects, obj);
335 _evas_render_prev_cur_clip_cache_add(e, obj);
336 obj->render_pre = 1;
337 }
338 }
339 return clean_them;
340 }
341 else if (_evas_render_had_map(obj))
342 {
343 RDI(level);
344 RD(" had map - restack objs\n");
345 // eina_array_push(restack_objects, obj);
346 _evas_render_prev_cur_clip_cache_add(e, obj);
347 if (obj->changed)
348 {
349 if (hmap)
350 {
351 if (!map)
352 {
353 if ((obj->cur.map) && (obj->cur.usemap)) map = 1;
354 }
355 }
356 if (map != hmap)
357 {
358 *redraw_all = 1;
359 }
360 }
361 }
362
363 /* handle normal rendering. this object knows how to handle maps */
364 if (obj->changed)
365 {
366 if (obj->smart.smart)
367 {
368 RDI(level);
369 RD(" changed + smart - render ok\n");
370 eina_array_push(render_objects, obj);
371 obj->render_pre = 1;
372 EINA_INLIST_FOREACH(evas_object_smart_members_get_direct(obj), obj2)
373 {
374 _evas_render_phase1_object_process(e, obj2,
375 active_objects,
376 restack_objects,
377 delete_objects,
378 render_objects,
379 obj->restack,
380 map,
381 redraw_all
382#ifdef REND_DGB
383 , level + 1
384#endif
385 );
386 }
387 }
388 else
389 {
390 if ((is_active) && (!obj->clip.clipees) &&
391 _evas_render_is_relevant(obj))
392 {
393 RDI(level);
394 RD(" relevant + active\n");
395 if (obj->restack)
396 eina_array_push(restack_objects, obj);
397 else
398 {
399 eina_array_push(render_objects, obj);
400 obj->render_pre = 1;
401 }
402 }
403 else
404 {
405 RDI(level);
406 RD(" skip - not smart, not active or clippees or not relevant\n");
407 }
408 }
409 }
410 else
411 {
412 RD(" not changed... [%i] -> (%i %i %p %i) [%i]\n",
413 evas_object_is_visible(obj),
414 obj->cur.visible, obj->cur.cache.clip.visible, obj->smart.smart, obj->cur.cache.clip.a,
415 evas_object_was_visible(obj));
416 if ((!obj->clip.clipees) && (obj->delete_me == 0) &&
417 (_evas_render_can_render(obj) ||
418 (evas_object_was_visible(obj) && (!obj->prev.have_clipees))))
419 {
420 if (obj->smart.smart)
421 {
422 RDI(level);
423 RD(" smart + visible/was visible + not clip\n");
424 eina_array_push(render_objects, obj);
425 obj->render_pre = 1;
426 EINA_INLIST_FOREACH
427 (evas_object_smart_members_get_direct(obj), obj2)
428 {
429 _evas_render_phase1_object_process(e, obj2,
430 active_objects,
431 restack_objects,
432 delete_objects,
433 render_objects,
434 restack, map,
435 redraw_all
436#ifdef REND_DGB
437 , level + 1
438#endif
439 );
440 }
441 }
442 else
443 {
444 if (evas_object_is_opaque(obj) &&
445 evas_object_is_visible(obj))
446 {
447 RDI(level);
448 RD(" opaque + visible\n");
449 eina_array_push(render_objects, obj);
450 obj->rect_del = 1;
451 }
452 else if (evas_object_is_visible(obj))
453 {
454 RDI(level);
455 RD(" visible\n");
456 eina_array_push(render_objects, obj);
457 obj->render_pre = 1;
458 }
459 else
460 {
461 RDI(level);
462 RD(" skip\n");
463 }
464 }
465 }
466 /*
467 else if (obj->smart.smart)
468 {
469 RDI(level);
470 RD(" smart + mot visible/was visible\n");
471 eina_array_push(render_objects, obj);
472 obj->render_pre = 1;
473 EINA_INLIST_FOREACH
474 (evas_object_smart_members_get_direct(obj), obj2)
475 {
476 _evas_render_phase1_object_process(e, obj2,
477 active_objects,
478 restack_objects,
479 delete_objects,
480 render_objects,
481 restack, map,
482 redraw_all
483#ifdef REND_DGB
484, level + 1
485#endif
486);
487}
488}
489 */
490}
491if (!is_active) obj->restack = 0;
492RDI(level);
493RD(" ---]\n");
494return clean_them;
495}
496
497static Eina_Bool
498_evas_render_phase1_process(Evas *e,
499 Eina_Array *active_objects,
500 Eina_Array *restack_objects,
501 Eina_Array *delete_objects,
502 Eina_Array *render_objects,
503 int *redraw_all)
504{
505 Evas_Layer *lay;
506 Eina_Bool clean_them = EINA_FALSE;
507
508 RD(" [--- PHASE 1\n");
509 EINA_INLIST_FOREACH(e->layers, lay)
510 {
511 Evas_Object *obj;
512
513 EINA_INLIST_FOREACH(lay->objects, obj)
514 {
515 clean_them |= _evas_render_phase1_object_process
516 (e, obj, active_objects, restack_objects, delete_objects,
517 render_objects, 0, 0, redraw_all
518#ifdef REND_DGB
519 , 1
520#endif
521 );
522 }
523 }
524 RD(" ---]\n");
525 return clean_them;
526}
527
528static void
529_evas_render_check_pending_objects(Eina_Array *pending_objects, Evas *e)
530{
531 unsigned int i;
532
533 for (i = 0; i < pending_objects->count; ++i)
534 {
535 Evas_Object *obj;
536 int is_active, ok = 0;
537
538 obj = eina_array_data_get(pending_objects, i);
539
540 if (!obj->layer) goto clean_stuff;
541
542 evas_object_clip_recalc(obj);
543 is_active = evas_object_is_active(obj);
544
545 if ((!is_active) && (!obj->is_active) && (!obj->render_pre) &&
546 (!obj->rect_del))
547 {
548 ok = 1;
549 goto clean_stuff;
550 }
551
552 if (obj->is_active == is_active)
553 {
554 if (obj->changed)
555 {
556 if (obj->smart.smart)
557 {
558 if (obj->render_pre || obj->rect_del) ok = 1;
559 }
560 else
561 if ((is_active) && (obj->restack) && (!obj->clip.clipees) &&
562 (_evas_render_can_render(obj) ||
563 (evas_object_was_visible(obj) && (!obj->prev.have_clipees))))
564 {
565 if (!(obj->render_pre || obj->rect_del)) ok = 1;
566 }
567 else
568 if (is_active && (!obj->clip.clipees) &&
569 (_evas_render_can_render(obj) ||
570 (evas_object_was_visible(obj) && (!obj->prev.have_clipees))))
571 {
572 if (obj->render_pre || obj->rect_del) ok = 1;
573 }
574 }
575 else
576 {
577 if ((!obj->clip.clipees) && (obj->delete_me == 0) &&
578 (!obj->cur.have_clipees || (evas_object_was_visible(obj) && (!obj->prev.have_clipees)))
579 && evas_object_is_opaque(obj) && evas_object_is_visible(obj))
580 {
581 if (obj->rect_del || obj->smart.smart) ok = 1;
582 }
583 }
584 }
585
586clean_stuff:
587 if (!ok)
588 {
589 eina_array_clean(&e->active_objects);
590 eina_array_clean(&e->render_objects);
591 eina_array_clean(&e->restack_objects);
592 eina_array_clean(&e->delete_objects);
593 e->invalidate = 1;
594 return ;
595 }
596 }
597}
598
599Eina_Bool
600pending_change(void *data, void *gdata __UNUSED__)
601{
602 Evas_Object *obj;
603
604 obj = data;
605 if (obj->delete_me) return EINA_FALSE;
606 if (obj->pre_render_done)
607 {
608 RD(" OBJ [%p] pending change %i -> 0, pre %i\n", obj, obj->changed, obj->pre_render_done);
609 obj->pre_render_done = 0;
610 //// FIXME: this wipes out changes
611 obj->changed = 0;
612 obj->changed_move_only = 0;
613 obj->changed_nomove = 0;
614 obj->changed_move = 0;
615 }
616 return obj->changed ? EINA_TRUE : EINA_FALSE;
617}
618/*
619 static void
620 unchange(Evas_Object *obj)
621 {
622 Evas_Object *obj2;
623
624 if (!obj->changed) return;
625 obj->changed = 0;
626 obj->changed_move_only = 0;
627 obj->changed_nomove = 0;
628 obj->changed_move = 0;
629 EINA_INLIST_FOREACH(evas_object_smart_members_get_direct(obj), obj2)
630 {
631 unchange(obj2);
632 }
633 }
634
635 static int
636 chlist(Evas_Object *obj, int i)
637 {
638 Evas_Object *obj2;
639 int j;
640 int ret = 0;
641
642 if (!obj->changed) return 0;
643 for (j = 0; j < i; j++) printf(" ");
644 printf("ch2 %p %s %i [%i %i %ix%i] v %i/%i [r%i] %p\n", obj,
645 obj->type,
646 obj->changed_move_only,
647 obj->cur.geometry.x,
648 obj->cur.geometry.y,
649 obj->cur.geometry.w,
650 obj->cur.geometry.h,
651 obj->cur.visible,
652 obj->prev.visible,
653 obj->restack,
654 obj->clip.clipees);
655 EINA_INLIST_FOREACH(evas_object_smart_members_get_direct(obj), obj2)
656 {
657 if (obj2->changed)
658 ret |= chlist(obj2, i + 1);
659 }
660 }
661 */
662static Eina_Bool
663_evas_render_can_use_overlay(Evas *e, Evas_Object *obj)
664{
665 Eina_Rectangle *r;
666 Evas_Object *tmp;
667 Eina_List *alphas = NULL;
668 Eina_List *opaques = NULL;
669 Evas_Object *video_parent = NULL;
670 Eina_Rectangle zone;
671 Evas_Coord xc1, yc1, xc2, yc2;
672 unsigned int i;
673 Eina_Bool nooverlay;
674
675 video_parent = _evas_object_image_video_parent_get(obj);
676
677 /* Check if any one is the stack make this object mapped */
678 tmp = obj;
679 while (tmp && !_evas_render_has_map(tmp))
680 tmp = tmp->smart.parent;
681
682 if (tmp && _evas_render_has_map(tmp)) return EINA_FALSE; /* we are mapped, we can't be an overlay */
683
684 if (!evas_object_is_visible(obj)) return EINA_FALSE; /* no need to update the overlay if it's not visible */
685
686 /* If any recoloring of the surface is needed, n overlay to */
687 if ((obj->cur.cache.clip.r != 255) ||
688 (obj->cur.cache.clip.g != 255) ||
689 (obj->cur.cache.clip.b != 255) ||
690 (obj->cur.cache.clip.a != 255))
691 return EINA_FALSE;
692
693 /* Check presence of transparent object on top of the video object */
694 EINA_RECTANGLE_SET(&zone,
695 obj->cur.cache.clip.x,
696 obj->cur.cache.clip.y,
697 obj->cur.cache.clip.w,
698 obj->cur.cache.clip.h);
699
700 for (i = e->active_objects.count - 1; i > 0; i--)
701 {
702 Eina_Rectangle self;
703 Eina_Rectangle *match;
704 Evas_Object *current;
705 Eina_List *l;
706 int xm1, ym1, xm2, ym2;
707
708 current = eina_array_data_get(&e->active_objects, i);
709
710 /* Did we find the video object in the stack ? */
711 if (current == video_parent || current == obj)
712 break;
713
714 EINA_RECTANGLE_SET(&self,
715 current->cur.cache.clip.x,
716 current->cur.cache.clip.y,
717 current->cur.cache.clip.w,
718 current->cur.cache.clip.h);
719
720 /* This doesn't cover the area of the video object, so don't bother with that object */
721 if (!eina_rectangles_intersect(&zone, &self))
722 continue ;
723
724 xc1 = current->cur.cache.clip.x;
725 yc1 = current->cur.cache.clip.y;
726 xc2 = current->cur.cache.clip.x + current->cur.cache.clip.w;
727 yc2 = current->cur.cache.clip.y + current->cur.cache.clip.h;
728
729 if (evas_object_is_visible(current) &&
730 (!current->clip.clipees) &&
731 (current->cur.visible) &&
732 (!current->delete_me) &&
733 (current->cur.cache.clip.visible) &&
734 (!current->smart.smart))
735 {
736 Eina_Bool included = EINA_FALSE;
737
738 if (evas_object_is_opaque(current) ||
739 ((current->func->has_opaque_rect) &&
740 (current->func->has_opaque_rect(current))))
741 {
742 /* The object is opaque */
743
744 /* Check if the opaque object is inside another opaque object */
745 EINA_LIST_FOREACH(opaques, l, match)
746 {
747 xm1 = match->x;
748 ym1 = match->y;
749 xm2 = match->x + match->w;
750 ym2 = match->y + match->h;
751
752 /* Both object are included */
753 if (xc1 >= xm1 && yc1 >= ym1 && xc2 <= xm2 && yc2 <= ym2)
754 {
755 included = EINA_TRUE;
756 break;
757 }
758 }
759
760 /* Not included yet */
761 if (!included)
762 {
763 Eina_List *ln;
764 Evas_Coord xn2, yn2;
765
766 r = eina_rectangle_new(current->cur.cache.clip.x, current->cur.cache.clip.y,
767 current->cur.cache.clip.w, current->cur.cache.clip.h);
768
769 opaques = eina_list_append(opaques, r);
770
771 xn2 = r->x + r->w;
772 yn2 = r->y + r->h;
773
774 /* Remove all the transparent object that are covered by the new opaque object */
775 EINA_LIST_FOREACH_SAFE(alphas, l, ln, match)
776 {
777 xm1 = match->x;
778 ym1 = match->y;
779 xm2 = match->x + match->w;
780 ym2 = match->y + match->h;
781
782 if (xm1 >= r->x && ym1 >= r->y && xm2 <= xn2 && ym2 <= yn2)
783 {
784 /* The new rectangle is over some transparent object,
785 so remove the transparent object */
786 alphas = eina_list_remove_list(alphas, l);
787 }
788 }
789 }
790 }
791 else
792 {
793 /* The object has some transparency */
794
795 /* Check if the transparent object is inside any other transparent object */
796 EINA_LIST_FOREACH(alphas, l, match)
797 {
798 xm1 = match->x;
799 ym1 = match->y;
800 xm2 = match->x + match->w;
801 ym2 = match->y + match->h;
802
803 /* Both object are included */
804 if (xc1 >= xm1 && yc1 >= ym1 && xc2 <= xm2 && yc2 <= ym2)
805 {
806 included = EINA_TRUE;
807 break;
808 }
809 }
810
811 /* If not check if it is inside any opaque one */
812 if (!included)
813 {
814 EINA_LIST_FOREACH(opaques, l, match)
815 {
816 xm1 = match->x;
817 ym1 = match->y;
818 xm2 = match->x + match->w;
819 ym2 = match->y + match->h;
820
821 /* Both object are included */
822 if (xc1 >= xm1 && yc1 >= ym1 && xc2 <= xm2 && yc2 <= ym2)
823 {
824 included = EINA_TRUE;
825 break;
826 }
827 }
828 }
829
830 /* No inclusion at all, so add it */
831 if (!included)
832 {
833 r = eina_rectangle_new(current->cur.cache.clip.x, current->cur.cache.clip.y,
834 current->cur.cache.clip.w, current->cur.cache.clip.h);
835
836 alphas = eina_list_append(alphas, r);
837 }
838 }
839 }
840 }
841
842 /* If there is any pending transparent object, then no overlay */
843 nooverlay = !!eina_list_count(alphas);
844
845 EINA_LIST_FREE(alphas, r)
846 eina_rectangle_free(r);
847 EINA_LIST_FREE(opaques, r)
848 eina_rectangle_free(r);
849
850 if (nooverlay)
851 return EINA_FALSE;
852
853 return EINA_TRUE;
854}
855
856Eina_Bool
857evas_render_mapped(Evas *e, Evas_Object *obj, void *context, void *surface,
858 int off_x, int off_y, int mapped,
859 int ecx, int ecy, int ecw, int ech
860#ifdef REND_DGB
861 , int level
862#endif
863 )
864{
865 void *ctx;
866 Evas_Object *obj2;
867 Eina_Bool clean_them = EINA_FALSE;
868
869 evas_object_clip_recalc(obj);
870 RDI(level);
871 RD(" { evas_render_mapped(%p, %p, %p, %p, %i, %i, %i, %i)\n", e, obj, context, surface, off_x, off_y, mapped, level);
872 if (mapped)
873 {
874 if ((!evas_object_is_visible(obj)) || (obj->clip.clipees) ||
875 (obj->cur.have_clipees))
876 {
877 RDI(level);
878 RD(" }\n");
879 return clean_them;
880 }
881 }
882 else if (!(((evas_object_is_active(obj) && (!obj->clip.clipees) &&
883 (_evas_render_can_render(obj))))
884 ))
885 {
886 RDI(level);
887 RD(" }\n");
888 return clean_them;
889 }
890
891 // set render_pre - for child objs that may not have gotten it.
892 obj->pre_render_done = 1;
893 RD(" Hasmap: %p (%d) %p %d -> %d\n",obj->func->can_map,
894 obj->func->can_map ? obj->func->can_map(obj): -1,
895 obj->cur.map, obj->cur.usemap,
896 _evas_render_has_map(obj));
897 if (_evas_render_has_map(obj))
898 {
899 const Evas_Map_Point *p, *p_end;
900 RGBA_Map_Point pts[4], *pt;
901 int sw, sh;
902 int changed = 0, rendered = 0;
903
904 clean_them = EINA_TRUE;
905
906 sw = obj->cur.geometry.w;
907 sh = obj->cur.geometry.h;
908 RDI(level);
909 RD(" mapped obj: %ix%i\n", sw, sh);
910 if ((sw <= 0) || (sh <= 0))
911 {
912 RDI(level);
913 RD(" }\n");
914 return clean_them;
915 }
916
917 pts[0].px = obj->cur.map->persp.px << FP;
918 pts[0].py = obj->cur.map->persp.py << FP;
919 pts[0].foc = obj->cur.map->persp.foc << FP;
920 pts[0].z0 = obj->cur.map->persp.z0 << FP;
921
922 p = obj->cur.map->points;
923 p_end = p + obj->cur.map->count;
924 pt = pts;
925 for (; p < p_end; p++, pt++)
926 {
927 pt->x = (lround(p->x) + off_x) * FP1;
928 pt->y = (lround(p->y) + off_y) * FP1;
929 pt->z = (lround(p->z) ) * FP1;
930 pt->fx = p->px;
931 pt->fy = p->py;
932 pt->fz = p->z;
933 pt->u = lround(p->u) * FP1;
934 pt->v = lround(p->v) * FP1;
935 if (pt->u < 0) pt->u = 0;
936 else if (pt->u > (sw * FP1)) pt->u = (sw * FP1);
937 if (pt->v < 0) pt->v = 0;
938 else if (pt->v > (sh * FP1)) pt->v = (sh * FP1);
939 pt->col = ARGB_JOIN(p->a, p->r, p->g, p->b);
940 }
941 /* Copy last for software engine */
942 if (obj->cur.map->count & 0x1)
943 {
944 pts[obj->cur.map->count] = pts[obj->cur.map->count - 1];
945 }
946
947
948 if (obj->cur.map->surface)
949 {
950 if ((obj->cur.map->surface_w != sw) ||
951 (obj->cur.map->surface_h != sh))
952 {
953 RDI(level);
954 RD(" new surf: %ix%i\n", sw, sh);
955 obj->layer->evas->engine.func->image_map_surface_free
956 (e->engine.data.output, obj->cur.map->surface);
957 obj->cur.map->surface = NULL;
958 }
959 }
960 if (!obj->cur.map->surface)
961 {
962 obj->cur.map->surface_w = sw;
963 obj->cur.map->surface_h = sh;
964
965 obj->cur.map->surface =
966 obj->layer->evas->engine.func->image_map_surface_new
967 (e->engine.data.output, obj->cur.map->surface_w,
968 obj->cur.map->surface_h,
969 obj->cur.map->alpha);
970 RDI(level);
971 RD(" fisrt surf: %ix%i\n", sw, sh);
972 changed = 1;
973 }
974 if (obj->smart.smart)
975 {
976 Evas_Object *o2;
977
978 EINA_INLIST_FOREACH(evas_object_smart_members_get_direct(obj), o2)
979 {
980 if (!evas_object_is_visible(o2) &&
981 !evas_object_was_visible(o2))
982 {
983 o2->changed = 0;
984 o2->changed_move_only = 0;
985 o2->changed_nomove = 0;
986 o2->changed_move = 0;
987 continue;
988 }
989 if (o2->changed)
990 {
991 // chlist(o2, 0);
992 changed = 1;
993 o2->changed = 0;
994 o2->changed_move_only = 0;
995 o2->changed_nomove = 0;
996 o2->changed_move = 0;
997 break;
998 }
999 }
1000 // unchange(obj);
1001 obj->changed = 0;
1002 obj->changed_move_only = 0;
1003 obj->changed_nomove = 0;
1004 obj->changed_move = 0;
1005 }
1006 else
1007 {
1008 if (obj->changed)
1009 {
1010 changed = 1;
1011 obj->changed = 0;
1012 obj->changed_move_only = 0;
1013 obj->changed_nomove = 0;
1014 obj->changed_move = 0;
1015 }
1016 }
1017
1018 // clear surface before re-render
1019 if ((changed) && (obj->cur.map->surface))
1020 {
1021 int off_x2, off_y2;
1022
1023 RDI(level);
1024 RD(" children redraw\n");
1025 // FIXME: calculate "changes" within map surface and only clear
1026 // and re-render those
1027 if (obj->cur.map->alpha)
1028 {
1029 ctx = e->engine.func->context_new(e->engine.data.output);
1030 e->engine.func->context_color_set
1031 (e->engine.data.output, ctx, 0, 0, 0, 0);
1032 e->engine.func->context_render_op_set
1033 (e->engine.data.output, ctx, EVAS_RENDER_COPY);
1034 e->engine.func->rectangle_draw(e->engine.data.output,
1035 ctx,
1036 obj->cur.map->surface,
1037 0, 0,
1038 obj->cur.map->surface_w,
1039 obj->cur.map->surface_h);
1040 e->engine.func->context_free(e->engine.data.output, ctx);
1041 }
1042 ctx = e->engine.func->context_new(e->engine.data.output);
1043 off_x2 = -obj->cur.geometry.x;
1044 off_y2 = -obj->cur.geometry.y;
1045 if (obj->smart.smart)
1046 {
1047 EINA_INLIST_FOREACH
1048 (evas_object_smart_members_get_direct(obj), obj2)
1049 {
1050 clean_them |= evas_render_mapped(e, obj2, ctx,
1051 obj->cur.map->surface,
1052 off_x2, off_y2, 1,
1053 ecx, ecy, ecw, ech
1054#ifdef REND_DGB
1055 , level + 1
1056#endif
1057 );
1058 }
1059 }
1060 else
1061 {
1062 int x = 0, y = 0, w = 0, h = 0;
1063
1064 w = obj->cur.map->surface_w;
1065 h = obj->cur.map->surface_h;
1066 RECTS_CLIP_TO_RECT(x, y, w, h,
1067 obj->cur.geometry.x + off_x2,
1068 obj->cur.geometry.y + off_y2,
1069 obj->cur.geometry.w,
1070 obj->cur.geometry.h);
1071
1072 e->engine.func->context_clip_set(e->engine.data.output,
1073 ctx, x, y, w, h);
1074 obj->func->render(obj, e->engine.data.output, ctx,
1075 obj->cur.map->surface, off_x2, off_y2);
1076 }
1077 e->engine.func->context_free(e->engine.data.output, ctx);
1078 rendered = 1;
1079 }
1080
1081 RDI(level);
1082 RD(" draw map\n");
1083
1084 if (rendered)
1085 {
1086 obj->cur.map->surface = e->engine.func->image_dirty_region
1087 (e->engine.data.output, obj->cur.map->surface,
1088 0, 0, obj->cur.map->surface_w, obj->cur.map->surface_h);
1089 }
1090 e->engine.func->context_clip_unset(e->engine.data.output,
1091 e->engine.data.context);
1092 if (obj->cur.map->surface)
1093 {
1094 if (obj->smart.smart)
1095 {
1096 if (obj->cur.clipper)
1097 {
1098 int x, y, w, h;
1099 Evas_Object *tobj;
1100
1101 obj->cur.cache.clip.dirty = 1;
1102 tobj = obj->cur.map_parent;
1103 obj->cur.map_parent = obj->cur.clipper->cur.map_parent;
1104 evas_object_clip_recalc(obj);
1105 obj->cur.map_parent = tobj;
1106 x = obj->cur.cache.clip.x;
1107 y = obj->cur.cache.clip.y;
1108 w = obj->cur.cache.clip.w;
1109 h = obj->cur.cache.clip.h;
1110 RECTS_CLIP_TO_RECT(x, y, w, h,
1111 obj->cur.clipper->cur.cache.clip.x,
1112 obj->cur.clipper->cur.cache.clip.y,
1113 obj->cur.clipper->cur.cache.clip.w,
1114 obj->cur.clipper->cur.cache.clip.h);
1115 e->engine.func->context_clip_set(e->engine.data.output,
1116 e->engine.data.context,
1117 x + off_x, y + off_y, w, h);
1118 }
1119 }
1120 else
1121 {
1122 if (obj->cur.clipper)
1123 {
1124 int x, y, w, h;
1125
1126 evas_object_clip_recalc(obj);
1127 x = obj->cur.cache.clip.x;
1128 y = obj->cur.cache.clip.y;
1129 w = obj->cur.cache.clip.w;
1130 h = obj->cur.cache.clip.h;
1131 RECTS_CLIP_TO_RECT(x, y, w, h,
1132 obj->cur.clipper->cur.cache.clip.x,
1133 obj->cur.clipper->cur.cache.clip.y,
1134 obj->cur.clipper->cur.cache.clip.w,
1135 obj->cur.clipper->cur.cache.clip.h);
1136 e->engine.func->context_clip_set(e->engine.data.output,
1137 e->engine.data.context,
1138 x + off_x, y + off_y, w, h);
1139 }
1140 }
1141 }
1142 if (surface == e->engine.data.output)
1143 e->engine.func->context_clip_clip(e->engine.data.output,
1144 e->engine.data.context,
1145 ecx, ecy, ecw, ech);
1146 if (obj->cur.cache.clip.visible)
1147 obj->layer->evas->engine.func->image_map_draw
1148 (e->engine.data.output, e->engine.data.context, surface,
1149 obj->cur.map->surface, obj->cur.map->count, pts,
1150 obj->cur.map->smooth, 0);
1151 // FIXME: needs to cache these maps and
1152 // keep them only rendering updates
1153 // obj->layer->evas->engine.func->image_map_surface_free
1154 // (e->engine.data.output, obj->cur.map->surface);
1155 // obj->cur.map->surface = NULL;
1156 }
1157 else
1158 {
1159 if (mapped)
1160 {
1161 RDI(level);
1162 RD(" draw child of mapped obj\n");
1163 ctx = e->engine.func->context_new(e->engine.data.output);
1164 if (obj->smart.smart)
1165 {
1166 EINA_INLIST_FOREACH
1167 (evas_object_smart_members_get_direct(obj), obj2)
1168 {
1169 clean_them |= evas_render_mapped(e, obj2, ctx,
1170 surface,
1171 off_x, off_y, 1,
1172 ecx, ecy, ecw, ech
1173#ifdef REND_DGB
1174 , level + 1
1175#endif
1176 );
1177 }
1178 }
1179 else
1180 {
1181 if (!obj->cur.map)
1182 {
1183 int x, y, w, h;
1184
1185 RDI(level);
1186
1187 x = obj->cur.cache.clip.x + off_x;
1188 y = obj->cur.cache.clip.y + off_y;
1189 w = obj->cur.cache.clip.w;
1190 h = obj->cur.cache.clip.h;
1191
1192 if (obj->cur.clipper)
1193 {
1194 if (_evas_render_has_map(obj))
1195 evas_object_clip_recalc(obj);
1196
1197 RD(" clipper: %i %i %ix%i\n",
1198 obj->cur.clipper->cur.cache.clip.x + off_x,
1199 obj->cur.clipper->cur.cache.clip.y + off_y,
1200 obj->cur.clipper->cur.cache.clip.w,
1201 obj->cur.clipper->cur.cache.clip.h);
1202
1203 RECTS_CLIP_TO_RECT(x, y, w, h,
1204 obj->cur.clipper->cur.cache.clip.x + off_x,
1205 obj->cur.clipper->cur.cache.clip.y + off_y,
1206 obj->cur.clipper->cur.cache.clip.w,
1207 obj->cur.clipper->cur.cache.clip.h);
1208 }
1209
1210 RD(" clip: %i %i %ix%i [%i %i %ix%i]\n",
1211 obj->cur.cache.clip.x + off_x,
1212 obj->cur.cache.clip.y + off_y,
1213 obj->cur.cache.clip.w,
1214 obj->cur.cache.clip.h,
1215 obj->cur.geometry.x + off_x,
1216 obj->cur.geometry.y + off_y,
1217 obj->cur.geometry.w,
1218 obj->cur.geometry.h);
1219 e->engine.func->context_clip_set(e->engine.data.output,
1220 ctx, x, y, w, h);
1221 }
1222 else
1223 {
1224 RDI(level);
1225 RD(" noclip\n");
1226 }
1227 obj->func->render(obj, e->engine.data.output, ctx,
1228 surface, off_x, off_y);
1229 /*
1230 obj->layer->evas->engine.func->context_color_set(e->engine.data.output,
1231 ctx,
1232 0, 30, 0, 30);
1233 obj->layer->evas->engine.func->rectangle_draw(e->engine.data.output,
1234 ctx,
1235 surface,
1236 0, 0, 9999, 9999);
1237 */
1238 }
1239 e->engine.func->context_free(e->engine.data.output, ctx);
1240 }
1241 else
1242 {
1243 if (obj->cur.clipper)
1244 {
1245 int x, y, w, h;
1246
1247 if (_evas_render_has_map(obj))
1248 evas_object_clip_recalc(obj);
1249 x = obj->cur.cache.clip.x;
1250 y = obj->cur.cache.clip.y;
1251 w = obj->cur.cache.clip.w;
1252 h = obj->cur.cache.clip.h;
1253 RECTS_CLIP_TO_RECT(x, y, w, h,
1254 obj->cur.clipper->cur.cache.clip.x,
1255 obj->cur.clipper->cur.cache.clip.y,
1256 obj->cur.clipper->cur.cache.clip.w,
1257 obj->cur.clipper->cur.cache.clip.h);
1258 e->engine.func->context_clip_set(e->engine.data.output,
1259 e->engine.data.context,
1260 x + off_x, y + off_y, w, h);
1261 e->engine.func->context_clip_clip(e->engine.data.output,
1262 e->engine.data.context,
1263 ecx, ecy, ecw, ech);
1264 }
1265
1266 RDI(level);
1267 RD(" draw normal obj\n");
1268 obj->func->render(obj, e->engine.data.output, context, surface,
1269 off_x, off_y);
1270 }
1271 }
1272 RDI(level);
1273 RD(" }\n");
1274
1275 return clean_them;
1276}
1277
1278static void
1279_evas_render_cutout_add(Evas *e, Evas_Object *obj, int off_x, int off_y)
1280{
1281 if (evas_object_is_opaque(obj))
1282 {
1283 Evas_Coord cox, coy, cow, coh;
1284
1285 cox = obj->cur.cache.clip.x;
1286 coy = obj->cur.cache.clip.y;
1287 cow = obj->cur.cache.clip.w;
1288 coh = obj->cur.cache.clip.h;
1289 if ((obj->cur.map) && (obj->cur.usemap))
1290 {
1291 Evas_Object *oo;
1292
1293 oo = obj;
1294 while (oo->cur.clipper)
1295 {
1296 if ((oo->cur.clipper->cur.map_parent
1297 != oo->cur.map_parent) &&
1298 (!((oo->cur.map) && (oo->cur.usemap))))
1299 break;
1300 RECTS_CLIP_TO_RECT(cox, coy, cow, coh,
1301 oo->cur.geometry.x,
1302 oo->cur.geometry.y,
1303 oo->cur.geometry.w,
1304 oo->cur.geometry.h);
1305 oo = oo->cur.clipper;
1306 }
1307 }
1308 e->engine.func->context_cutout_add
1309 (e->engine.data.output, e->engine.data.context,
1310 cox + off_x, coy + off_y, cow, coh);
1311 }
1312 else
1313 {
1314 if (obj->func->get_opaque_rect)
1315 {
1316 Evas_Coord obx, oby, obw, obh;
1317
1318 obj->func->get_opaque_rect(obj, &obx, &oby, &obw, &obh);
1319 if ((obw > 0) && (obh > 0))
1320 {
1321 obx += off_x;
1322 oby += off_y;
1323 RECTS_CLIP_TO_RECT(obx, oby, obw, obh,
1324 obj->cur.cache.clip.x + off_x,
1325 obj->cur.cache.clip.y + off_y,
1326 obj->cur.cache.clip.w,
1327 obj->cur.cache.clip.h);
1328 e->engine.func->context_cutout_add
1329 (e->engine.data.output, e->engine.data.context,
1330 obx, oby, obw, obh);
1331 }
1332 }
1333 }
1334}
1335
1336static Eina_List *
1337evas_render_updates_internal(Evas *e,
1338 unsigned char make_updates,
1339 unsigned char do_draw)
1340{
1341 Evas_Object *obj;
1342 Eina_List *updates = NULL;
1343 Eina_List *ll;
1344 void *surface;
1345 Eina_Bool clean_them = EINA_FALSE;
1346 Eina_Bool alpha;
1347 Eina_Rectangle *r;
1348 int ux, uy, uw, uh;
1349 int cx, cy, cw, ch;
1350 unsigned int i, j;
1351 int haveup = 0;
1352 int redraw_all = 0;
1353
1354 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
1355 return NULL;
1356 MAGIC_CHECK_END();
1357 if (!e->changed) return NULL;
1358
1359 evas_call_smarts_calculate(e);
1360
1361 RD("[--- RENDER EVAS (size: %ix%i)\n", e->viewport.w, e->viewport.h);
1362
1363 /* Check if the modified object mean recalculating every thing */
1364 if (!e->invalidate)
1365 _evas_render_check_pending_objects(&e->pending_objects, e);
1366
1367 /* phase 1. add extra updates for changed objects */
1368 if (e->invalidate || e->render_objects.count <= 0)
1369 clean_them = _evas_render_phase1_process(e,
1370 &e->active_objects,
1371 &e->restack_objects,
1372 &e->delete_objects,
1373 &e->render_objects,
1374 &redraw_all);
1375
1376 /* phase 1.5. check if the video should be inlined or stay in their overlay */
1377 alpha = e->engine.func->canvas_alpha_get(e->engine.data.output,
1378 e->engine.data.context);
1379
1380 EINA_LIST_FOREACH(e->video_objects, ll, obj)
1381 {
1382 /* we need the surface to be transparent to display the underlying overlay */
1383 if (alpha && _evas_render_can_use_overlay(e, obj))
1384 _evas_object_image_video_overlay_show(obj);
1385 else
1386 _evas_object_image_video_overlay_hide(obj);
1387 }
1388
1389
1390 /* phase 1.8. pre render for proxy */
1391 _evas_render_phase1_direct(e, &e->active_objects, &e->restack_objects,
1392 &e->delete_objects, &e->render_objects);
1393
1394 /* phase 2. force updates for restacks */
1395 for (i = 0; i < e->restack_objects.count; ++i)
1396 {
1397 obj = eina_array_data_get(&e->restack_objects, i);
1398 obj->func->render_pre(obj);
1399 _evas_render_prev_cur_clip_cache_add(e, obj);
1400 }
1401 eina_array_clean(&e->restack_objects);
1402 /* phase 3. add exposes */
1403 EINA_LIST_FREE(e->damages, r)
1404 {
1405 e->engine.func->output_redraws_rect_add(e->engine.data.output,
1406 r->x, r->y, r->w, r->h);
1407 eina_rectangle_free(r);
1408 }
1409 /* phase 4. output & viewport changes */
1410 if (e->viewport.changed)
1411 {
1412 e->engine.func->output_redraws_rect_add(e->engine.data.output,
1413 0, 0,
1414 e->output.w, e->output.h);
1415 }
1416 if (e->output.changed)
1417 {
1418 e->engine.func->output_resize(e->engine.data.output,
1419 e->output.w, e->output.h);
1420 e->engine.func->output_redraws_rect_add(e->engine.data.output,
1421 0, 0,
1422 e->output.w, e->output.h);
1423 }
1424 if ((e->output.w != e->viewport.w) || (e->output.h != e->viewport.h))
1425 {
1426 ERR("viewport size != output size!");
1427 }
1428 if (redraw_all)
1429 {
1430 e->engine.func->output_redraws_rect_add(e->engine.data.output,
1431 0, 0,
1432 e->output.w, e->output.h);
1433 }
1434 /* phase 5. add obscures */
1435 EINA_LIST_FOREACH(e->obscures, ll, r)
1436 {
1437 e->engine.func->output_redraws_rect_del(e->engine.data.output,
1438 r->x, r->y, r->w, r->h);
1439 }
1440 /* build obscure objects list of active objects that obscure */
1441 for (i = 0; i < e->active_objects.count; ++i)
1442 {
1443 obj = eina_array_data_get(&e->active_objects, i);
1444 if (UNLIKELY((evas_object_is_opaque(obj) ||
1445 ((obj->func->has_opaque_rect) &&
1446 (obj->func->has_opaque_rect(obj)))) &&
1447 evas_object_is_visible(obj) &&
1448 (!obj->clip.clipees) &&
1449 (obj->cur.visible) &&
1450 (!obj->delete_me) &&
1451 (obj->cur.cache.clip.visible) &&
1452 (!obj->smart.smart)))
1453 /* obscuring_objects = eina_list_append(obscuring_objects, obj); */
1454 eina_array_push(&e->obscuring_objects, obj);
1455 }
1456
1457 /* save this list */
1458 /* obscuring_objects_orig = obscuring_objects; */
1459 /* obscuring_objects = NULL; */
1460 /* phase 6. go thru each update rect and render objects in it*/
1461 if (do_draw)
1462 {
1463 unsigned int offset = 0;
1464
1465 while ((surface =
1466 e->engine.func->output_redraws_next_update_get
1467 (e->engine.data.output,
1468 &ux, &uy, &uw, &uh,
1469 &cx, &cy, &cw, &ch)))
1470 {
1471 int off_x, off_y;
1472
1473 RD(" [--- UPDATE %i %i %ix%i\n", ux, uy, uw, uh);
1474 if (make_updates)
1475 {
1476 Eina_Rectangle *rect;
1477
1478 NEW_RECT(rect, ux, uy, uw, uh);
1479 if (rect)
1480 updates = eina_list_append(updates, rect);
1481 }
1482 haveup = 1;
1483 off_x = cx - ux;
1484 off_y = cy - uy;
1485 /* build obscuring objects list (in order from bottom to top) */
1486 for (i = 0; i < e->obscuring_objects.count; ++i)
1487 {
1488 obj = (Evas_Object *)eina_array_data_get
1489 (&e->obscuring_objects, i);
1490 if (evas_object_is_in_output_rect(obj, ux, uy, uw, uh))
1491 {
1492 eina_array_push(&e->temporary_objects, obj);
1493
1494 /* reset the background of the area if needed (using cutout and engine alpha flag to help) */
1495 if (alpha)
1496 _evas_render_cutout_add(e, obj, off_x, off_y);
1497 }
1498 }
1499 if (alpha)
1500 {
1501 e->engine.func->context_clip_set(e->engine.data.output,
1502 e->engine.data.context,
1503 ux + off_x, uy + off_y, uw, uh);
1504 e->engine.func->context_color_set(e->engine.data.output,
1505 e->engine.data.context,
1506 0, 0, 0, 0);
1507 e->engine.func->context_multiplier_unset
1508 (e->engine.data.output, e->engine.data.context);
1509 e->engine.func->context_render_op_set(e->engine.data.output,
1510 e->engine.data.context,
1511 EVAS_RENDER_COPY);
1512 e->engine.func->rectangle_draw(e->engine.data.output,
1513 e->engine.data.context,
1514 surface,
1515 cx, cy, cw, ch);
1516 e->engine.func->context_cutout_clear(e->engine.data.output,
1517 e->engine.data.context);
1518 e->engine.func->context_clip_unset(e->engine.data.output,
1519 e->engine.data.context);
1520 }
1521 /* render all object that intersect with rect */
1522 for (i = 0; i < e->active_objects.count; ++i)
1523 {
1524 obj = eina_array_data_get(&e->active_objects, i);
1525
1526 /* if it's in our outpout rect and it doesn't clip anything */
1527 RD(" OBJ: [%p] '%s' %i %i %ix%i\n", obj, obj->type, obj->cur.geometry.x, obj->cur.geometry.y, obj->cur.geometry.w, obj->cur.geometry.h);
1528 if ((evas_object_is_in_output_rect(obj, ux, uy, uw, uh) ||
1529 (obj->smart.smart)) &&
1530 (!obj->clip.clipees) &&
1531 (obj->cur.visible) &&
1532 (!obj->delete_me) &&
1533 (obj->cur.cache.clip.visible) &&
1534 // (!obj->smart.smart) &&
1535 ((obj->cur.color.a > 0 || obj->cur.render_op != EVAS_RENDER_BLEND)))
1536 {
1537 int x, y, w, h;
1538
1539 RD(" DRAW (vis: %i, a: %i, clipees: %p\n", obj->cur.visible, obj->cur.color.a, obj->clip.clipees);
1540 if ((e->temporary_objects.count > offset) &&
1541 (eina_array_data_get(&e->temporary_objects, offset) == obj))
1542 offset++;
1543 x = cx; y = cy; w = cw; h = ch;
1544 if (((w > 0) && (h > 0)) || (obj->smart.smart))
1545 {
1546 if (!obj->smart.smart)
1547 {
1548 RECTS_CLIP_TO_RECT(x, y, w, h,
1549 obj->cur.cache.clip.x + off_x,
1550 obj->cur.cache.clip.y + off_y,
1551 obj->cur.cache.clip.w,
1552 obj->cur.cache.clip.h);
1553 }
1554 if (obj->cur.mask)
1555 e->engine.func->context_mask_set(e->engine.data.output,
1556 e->engine.data.context,
1557 obj->cur.mask->func->engine_data_get(obj->cur.mask),
1558 obj->cur.mask->cur.geometry.x + off_x,
1559 obj->cur.mask->cur.geometry.y + off_y,
1560 obj->cur.mask->cur.geometry.w,
1561 obj->cur.mask->cur.geometry.h);
1562 else
1563 e->engine.func->context_mask_unset(e->engine.data.output,
1564 e->engine.data.context);
1565 if (obj->cur.clipper)
1566 e->engine.func->context_clip_set(e->engine.data.output,
1567 e->engine.data.context,
1568 x, y, w, h);
1569 else
1570 e->engine.func->context_clip_unset(e->engine.data.output,
1571 e->engine.data.context);
1572#if 1 /* FIXME: this can slow things down... figure out optimum... coverage */
1573 for (j = offset; j < e->temporary_objects.count; ++j)
1574 {
1575 Evas_Object *obj2;
1576
1577 obj2 = (Evas_Object *)eina_array_data_get
1578 (&e->temporary_objects, j);
1579 _evas_render_cutout_add(e, obj2, off_x, off_y);
1580 }
1581#endif
1582 e->engine.func->context_clip_set(e->engine.data.output,
1583 e->engine.data.context,
1584 x, y, w, h);
1585 clean_them |= evas_render_mapped(e, obj, e->engine.data.context,
1586 surface, off_x, off_y, 0,
1587 cx, cy, cw, ch
1588#ifdef REND_DGB
1589 , 1
1590#endif
1591 );
1592 e->engine.func->context_cutout_clear(e->engine.data.output,
1593 e->engine.data.context);
1594 }
1595 }
1596 }
1597 /* punch rect out */
1598 e->engine.func->output_redraws_next_update_push(e->engine.data.output,
1599 surface,
1600 ux, uy, uw, uh);
1601 /* free obscuring objects list */
1602 eina_array_clean(&e->temporary_objects);
1603 RD(" ---]\n");
1604 }
1605 /* flush redraws */
1606 if (haveup)
1607 {
1608 evas_event_callback_call(e, EVAS_CALLBACK_RENDER_FLUSH_PRE, NULL);
1609 e->engine.func->output_flush(e->engine.data.output);
1610 evas_event_callback_call(e, EVAS_CALLBACK_RENDER_FLUSH_POST, NULL);
1611 }
1612 }
1613 /* clear redraws */
1614 e->engine.func->output_redraws_clear(e->engine.data.output);
1615 /* and do a post render pass */
1616 for (i = 0; i < e->active_objects.count; ++i)
1617 {
1618 obj = eina_array_data_get(&e->active_objects, i);
1619 obj->pre_render_done = 0;
1620 RD(" OBJ [%p] post... %i %i\n", obj, obj->changed, do_draw);
1621 if ((obj->changed) && (do_draw))
1622 {
1623 RD(" OBJ [%p] post... func1\n", obj);
1624 obj->func->render_post(obj);
1625 obj->restack = 0;
1626 obj->changed = 0;
1627 obj->changed_move_only = 0;
1628 obj->changed_nomove = 0;
1629 obj->changed_move = 0;
1630 }
1631 else if ((obj->cur.map != obj->prev.map) ||
1632 (obj->cur.usemap != obj->prev.usemap))
1633 {
1634 RD(" OBJ [%p] post... func2\n", obj);
1635 obj->func->render_post(obj);
1636 obj->restack = 0;
1637 obj->changed = 0;
1638 obj->changed_move_only = 0;
1639 obj->changed_nomove = 0;
1640 obj->changed_move = 0;
1641 }
1642 /* moved to other pre-process phase 1
1643 if (obj->delete_me == 2)
1644 {
1645 delete_objects = eina_list_append(delete_objects, obj);
1646 }
1647 else if (obj->delete_me != 0) obj->delete_me++;
1648 */
1649 }
1650 /* free our obscuring object list */
1651 eina_array_clean(&e->obscuring_objects);
1652
1653 /* If some object are still marked as changed, do not remove
1654 them from the pending list. */
1655 eina_array_remove(&e->pending_objects, pending_change, NULL);
1656
1657 for (i = 0; i < e->render_objects.count; ++i)
1658 {
1659 obj = eina_array_data_get(&e->render_objects, i);
1660 obj->pre_render_done = 0;
1661 }
1662
1663 /* delete all objects flagged for deletion now */
1664 for (i = 0; i < e->delete_objects.count; ++i)
1665 {
1666 obj = eina_array_data_get(&e->delete_objects, i);
1667 evas_object_free(obj, 1);
1668 }
1669 eina_array_clean(&e->delete_objects);
1670
1671 e->changed = 0;
1672 e->viewport.changed = 0;
1673 e->output.changed = 0;
1674 e->invalidate = 0;
1675
1676 /* If their are some object to restack or some object to delete,
1677 * it's useless to keep the render object list around. */
1678 if (clean_them)
1679 {
1680 eina_array_clean(&e->active_objects);
1681 eina_array_clean(&e->render_objects);
1682 eina_array_clean(&e->restack_objects);
1683 eina_array_clean(&e->delete_objects);
1684 eina_array_clean(&e->obscuring_objects);
1685 e->invalidate = 1;
1686 }
1687
1688 evas_module_clean();
1689
1690 RD("---]\n");
1691
1692 return updates;
1693}
1694
1695EAPI void
1696evas_render_updates_free(Eina_List *updates)
1697{
1698 Eina_Rectangle *r;
1699
1700 EINA_LIST_FREE(updates, r)
1701 eina_rectangle_free(r);
1702}
1703
1704EAPI Eina_List *
1705evas_render_updates(Evas *e)
1706{
1707 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
1708 return NULL;
1709 MAGIC_CHECK_END();
1710
1711#ifdef EVAS_FRAME_QUEUING
1712 evas_common_frameq_flush_ready ();
1713#endif
1714
1715 if (!e->changed) return NULL;
1716 return evas_render_updates_internal(e, 1, 1);
1717}
1718
1719EAPI void
1720evas_render(Evas *e)
1721{
1722 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
1723 return;
1724 MAGIC_CHECK_END();
1725
1726#ifdef EVAS_FRAME_QUEUING
1727 evas_common_frameq_flush_ready ();
1728#endif
1729
1730 if (!e->changed) return;
1731 evas_render_updates_internal(e, 0, 1);
1732}
1733
1734EAPI void
1735evas_norender(Evas *e)
1736{
1737 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
1738 return;
1739 MAGIC_CHECK_END();
1740
1741 // if (!e->changed) return;
1742 evas_render_updates_internal(e, 0, 0);
1743}
1744
1745EAPI void
1746evas_render_idle_flush(Evas *e)
1747{
1748 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
1749 return;
1750 MAGIC_CHECK_END();
1751
1752 evas_fonts_zero_presure(e);
1753
1754 if ((e->engine.func) && (e->engine.func->output_idle_flush) &&
1755 (e->engine.data.output))
1756 e->engine.func->output_idle_flush(e->engine.data.output);
1757
1758 eina_array_flush(&e->delete_objects);
1759 eina_array_flush(&e->active_objects);
1760 eina_array_flush(&e->restack_objects);
1761 eina_array_flush(&e->render_objects);
1762 eina_array_flush(&e->clip_changes);
1763
1764 e->invalidate = 1;
1765}
1766
1767EAPI void
1768evas_sync(Evas *e)
1769{
1770#ifdef EVAS_FRAME_QUEUING
1771 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
1772 return;
1773 MAGIC_CHECK_END();
1774
1775 evas_common_frameq_flush();
1776#else
1777 (void) e;
1778#endif
1779}
1780
1781static void
1782_evas_render_dump_map_surfaces(Evas_Object *obj)
1783{
1784 if ((obj->cur.map) && obj->cur.map->surface)
1785 {
1786 obj->layer->evas->engine.func->image_map_surface_free
1787 (obj->layer->evas->engine.data.output, obj->cur.map->surface);
1788 obj->cur.map->surface = NULL;
1789 }
1790
1791 if (obj->smart.smart)
1792 {
1793 Evas_Object *obj2;
1794
1795 EINA_INLIST_FOREACH(evas_object_smart_members_get_direct(obj), obj2)
1796 _evas_render_dump_map_surfaces(obj2);
1797 }
1798}
1799
1800EAPI void
1801evas_render_dump(Evas *e)
1802{
1803 Evas_Layer *lay;
1804
1805 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
1806 return;
1807 MAGIC_CHECK_END();
1808
1809 EINA_INLIST_FOREACH(e->layers, lay)
1810 {
1811 Evas_Object *obj;
1812
1813 EINA_INLIST_FOREACH(lay->objects, obj)
1814 {
1815 if ((obj->type) && (!strcmp(obj->type, "image")))
1816 evas_object_inform_call_image_unloaded(obj);
1817 _evas_render_dump_map_surfaces(obj);
1818 }
1819 }
1820 if ((e->engine.func) && (e->engine.func->output_dump) &&
1821 (e->engine.data.output))
1822 e->engine.func->output_dump(e->engine.data.output);
1823}
1824
1825void
1826evas_render_invalidate(Evas *e)
1827{
1828 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
1829 return;
1830 MAGIC_CHECK_END();
1831
1832 eina_array_clean(&e->active_objects);
1833 eina_array_clean(&e->render_objects);
1834
1835 eina_array_flush(&e->restack_objects);
1836 eina_array_flush(&e->delete_objects);
1837
1838 e->invalidate = 1;
1839}
1840
1841void
1842evas_render_object_recalc(Evas_Object *obj)
1843{
1844 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1845 return;
1846 MAGIC_CHECK_END();
1847
1848#ifndef EVAS_FRAME_QUEUING
1849 if ((!obj->changed) && (obj->delete_me < 2))
1850#else
1851 if ((!obj->changed))
1852#endif
1853 {
1854 Evas *e;
1855
1856 e = obj->layer->evas;
1857 if ((!e) || (e->cleanup)) return;
1858#ifdef EVAS_FRAME_QUEUING
1859 if (obj->delete_me >= evas_common_frameq_get_frameq_sz() + 2) return;
1860#endif
1861 eina_array_push(&e->pending_objects, obj);
1862 obj->changed = 1;
1863 }
1864}
1865
1866/* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/
diff --git a/libraries/evas/src/lib/canvas/evas_smart.c b/libraries/evas/src/lib/canvas/evas_smart.c
new file mode 100644
index 0000000..0cfba05
--- /dev/null
+++ b/libraries/evas/src/lib/canvas/evas_smart.c
@@ -0,0 +1,266 @@
1#include "evas_common.h"
2#include "evas_private.h"
3
4
5static void _evas_smart_class_callbacks_create(Evas_Smart *s);
6
7/* all public */
8
9EAPI void
10evas_smart_free(Evas_Smart *s)
11{
12 MAGIC_CHECK(s, Evas_Smart, MAGIC_SMART);
13 return;
14 MAGIC_CHECK_END();
15 s->delete_me = 1;
16 if (s->usage > 0) return;
17 if (s->class_allocated) free((void *)s->smart_class);
18 free(s->callbacks.array);
19 free(s);
20}
21
22EAPI Evas_Smart *
23evas_smart_class_new(const Evas_Smart_Class *sc)
24{
25 Evas_Smart *s;
26
27 if (!sc) return NULL;
28
29 /* api does not match abi! for now refuse as we only have 1 version */
30 if (sc->version != EVAS_SMART_CLASS_VERSION) return NULL;
31
32 s = evas_mem_calloc(sizeof(Evas_Smart));
33 if (!s) return NULL;
34
35 s->magic = MAGIC_SMART;
36
37 s->smart_class = sc;
38 _evas_smart_class_callbacks_create(s);
39
40 return s;
41}
42
43EAPI const Evas_Smart_Class *
44evas_smart_class_get(const Evas_Smart *s)
45{
46 MAGIC_CHECK(s, Evas_Smart, MAGIC_SMART);
47 return NULL;
48 MAGIC_CHECK_END();
49 return s->smart_class;
50}
51
52EAPI void *
53evas_smart_data_get(const Evas_Smart *s)
54{
55 MAGIC_CHECK(s, Evas_Smart, MAGIC_SMART);
56 return NULL;
57 MAGIC_CHECK_END();
58 return (void *)s->smart_class->data;
59}
60
61EAPI const Evas_Smart_Cb_Description **
62evas_smart_callbacks_descriptions_get(const Evas_Smart *s, unsigned int *count)
63{
64 MAGIC_CHECK(s, Evas_Smart, MAGIC_SMART);
65 if (count) *count = 0;
66 return NULL;
67 MAGIC_CHECK_END();
68
69 if (count) *count = s->callbacks.size;
70 return s->callbacks.array;
71}
72
73EAPI const Evas_Smart_Cb_Description *
74evas_smart_callback_description_find(const Evas_Smart *s, const char *name)
75{
76 if (!name) return NULL;
77 MAGIC_CHECK(s, Evas_Smart, MAGIC_SMART);
78 return NULL;
79 MAGIC_CHECK_END();
80 return evas_smart_cb_description_find(&s->callbacks, name);
81}
82
83EAPI Eina_Bool
84evas_smart_class_inherit_full(Evas_Smart_Class *sc, const Evas_Smart_Class *parent_sc, unsigned int parent_sc_size)
85{
86 unsigned int off;
87
88 /* api does not match abi! for now refuse as we only have 1 version */
89 if (parent_sc->version != EVAS_SMART_CLASS_VERSION) return EINA_FALSE;
90
91#define _CP(m) sc->m = parent_sc->m
92 _CP(add);
93 _CP(del);
94 _CP(move);
95 _CP(resize);
96 _CP(show);
97 _CP(hide);
98 _CP(color_set);
99 _CP(clip_set);
100 _CP(clip_unset);
101 _CP(calculate);
102 _CP(member_add);
103 _CP(member_del);
104#undef _CP
105
106 sc->parent = parent_sc;
107
108 off = sizeof(Evas_Smart_Class);
109 if (parent_sc_size == off) return EINA_TRUE;
110
111 memcpy(((char *)sc) + off, ((char *)parent_sc) + off, parent_sc_size - off);
112 return EINA_TRUE;
113}
114
115EAPI int
116evas_smart_usage_get(const Evas_Smart *s)
117{
118 MAGIC_CHECK(s, Evas_Smart, MAGIC_SMART);
119 return 0;
120 MAGIC_CHECK_END();
121 return s->usage;
122}
123
124
125/* internal funcs */
126void
127evas_object_smart_use(Evas_Smart *s)
128{
129 s->usage++;
130}
131
132void
133evas_object_smart_unuse(Evas_Smart *s)
134{
135 s->usage--;
136 if ((s->usage <= 0) && (s->delete_me)) evas_smart_free(s);
137}
138
139Eina_Bool
140evas_smart_cb_descriptions_resize(Evas_Smart_Cb_Description_Array *a, unsigned int size)
141{
142 void *tmp;
143
144 if (size == a->size)
145 return EINA_TRUE;
146
147 if (size == EINA_FALSE)
148 {
149 free(a->array);
150 a->array = NULL;
151 a->size = 0;
152 return EINA_TRUE;
153 }
154
155 tmp = realloc(a->array, (size + 1) * sizeof(Evas_Smart_Cb_Description *));
156 if (tmp)
157 {
158 a->array = tmp;
159 a->size = size;
160 a->array[size] = NULL;
161 return EINA_TRUE;
162 }
163 else
164 {
165 ERR("realloc failed!");
166 return EINA_FALSE;
167 }
168}
169
170static int
171_evas_smart_cb_description_cmp_sort(const void *p1, const void *p2)
172{
173 const Evas_Smart_Cb_Description **a = (const Evas_Smart_Cb_Description **)p1;
174 const Evas_Smart_Cb_Description **b = (const Evas_Smart_Cb_Description **)p2;
175 return strcmp((*a)->name, (*b)->name);
176}
177
178void
179evas_smart_cb_descriptions_fix(Evas_Smart_Cb_Description_Array *a)
180{
181 unsigned int i, j;
182
183 if (!a)
184 {
185 ERR("no array to fix!");
186 return;
187 }
188
189 qsort(a->array, a->size, sizeof(Evas_Smart_Cb_Description *),
190 _evas_smart_cb_description_cmp_sort);
191
192 DBG("%u callbacks", a->size);
193 if (a->size)
194 DBG("%s [type=%s]", a->array[0]->name, a->array[0]->type);
195
196 for (i = 0, j = 1; j < a->size; j++)
197 {
198 const Evas_Smart_Cb_Description *cur, *prev;
199
200 cur = a->array[j];
201 prev = a->array[i];
202
203 DBG("%s [type=%s]", cur->name, cur->type);
204
205 if (strcmp(cur->name, prev->name) != 0)
206 {
207 i++;
208 if (i != j)
209 a->array[i] = a->array[j];
210 }
211 else
212 {
213 if (strcmp(cur->type, prev->type) == 0)
214 WRN("duplicated smart callback description"
215 " with name '%s' and type '%s'", cur->name, cur->type);
216 else
217 ERR("callback descriptions named '%s' differ"
218 " in type, keeping '%s', ignoring '%s'",
219 cur->name, prev->type, cur->type);
220 }
221 }
222
223 evas_smart_cb_descriptions_resize(a, i + 1);
224}
225
226static void
227_evas_smart_class_callbacks_create(Evas_Smart *s)
228{
229 const Evas_Smart_Class *sc;
230 unsigned int n = 0;
231
232 for (sc = s->smart_class; sc; sc = sc->parent)
233 {
234 const Evas_Smart_Cb_Description *d;
235 for (d = sc->callbacks; d && d->name; d++)
236 n++;
237 }
238
239 if (n == 0) return;
240 if (!evas_smart_cb_descriptions_resize(&s->callbacks, n)) return;
241 for (n = 0, sc = s->smart_class; sc; sc = sc->parent)
242 {
243 const Evas_Smart_Cb_Description *d;
244 for (d = sc->callbacks; d && d->name; d++)
245 s->callbacks.array[n++] = d;
246 }
247 evas_smart_cb_descriptions_fix(&s->callbacks);
248}
249
250static int
251_evas_smart_cb_description_cmp_search(const void *p1, const void *p2)
252{
253 const char *name = p1;
254 const Evas_Smart_Cb_Description **v = (const Evas_Smart_Cb_Description **)p2;
255 /* speed up string shares searches (same pointers) */
256 if (name == (*v)->name) return 0;
257 return strcmp(name, (*v)->name);
258}
259
260const Evas_Smart_Cb_Description *
261evas_smart_cb_description_find(const Evas_Smart_Cb_Description_Array *a, const char *name)
262{
263 if (!a->array) return NULL;
264 return bsearch(name, a->array, a->size, sizeof(Evas_Smart_Cb_Description *),
265 _evas_smart_cb_description_cmp_search);
266}
diff --git a/libraries/evas/src/lib/canvas/evas_stack.c b/libraries/evas/src/lib/canvas/evas_stack.c
new file mode 100644
index 0000000..a8dec0d
--- /dev/null
+++ b/libraries/evas/src/lib/canvas/evas_stack.c
@@ -0,0 +1,391 @@
1#include "evas_common.h"
2#include "evas_private.h"
3
4static Evas_Object *
5evas_object_above_get_internal(const Evas_Object *obj)
6{
7 if ((EINA_INLIST_GET(obj))->next)
8 return (Evas_Object *)((EINA_INLIST_GET(obj))->next);
9 else
10 {
11 if ((EINA_INLIST_GET(((Evas_Object*)(obj))->layer))->next)
12 {
13 Evas_Layer *l;
14
15 l = (Evas_Layer *)((EINA_INLIST_GET((((Evas_Object *)obj)->layer)))->next);
16 return l->objects;
17 }
18 }
19 return NULL;
20}
21
22static Evas_Object *
23evas_object_below_get_internal(const Evas_Object *obj)
24{
25 if ((EINA_INLIST_GET(obj))->prev)
26 return (Evas_Object *)((EINA_INLIST_GET(obj))->prev);
27 else
28 {
29 if ((EINA_INLIST_GET((((Evas_Object *)obj)->layer)))->prev)
30 {
31 Evas_Layer *l;
32
33 l = (Evas_Layer *)((EINA_INLIST_GET((((Evas_Object *)obj)->layer)))->prev);
34 return (Evas_Object *)((EINA_INLIST_GET((l->objects)))->last);
35 }
36 }
37 return NULL;
38}
39
40EAPI void
41evas_object_raise(Evas_Object *obj)
42{
43 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
44 return;
45 MAGIC_CHECK_END();
46 if (evas_object_intercept_call_raise(obj)) return;
47 if (!((EINA_INLIST_GET(obj))->next))
48 {
49 evas_object_inform_call_restack(obj);
50 return;
51 }
52 if (obj->smart.parent)
53 evas_object_smart_member_raise(obj);
54 else
55 {
56 if (obj->in_layer)
57 obj->layer->objects = (Evas_Object *)eina_inlist_demote(EINA_INLIST_GET(obj->layer->objects), EINA_INLIST_GET(obj));
58 }
59 if (obj->clip.clipees)
60 {
61 evas_object_inform_call_restack(obj);
62 return;
63 }
64 if (obj->layer) evas_render_invalidate(obj->layer->evas);
65 obj->restack = EINA_TRUE;
66 evas_object_change(obj);
67 evas_object_inform_call_restack(obj);
68 if (obj->layer->evas->events_frozen > 0) return;
69 if ((!evas_event_passes_through(obj)) && (!evas_event_freezes_through(obj)))
70 {
71 if (!obj->smart.smart)
72 {
73 if (evas_object_is_in_output_rect(obj,
74 obj->layer->evas->pointer.x,
75 obj->layer->evas->pointer.y,
76 1, 1) && obj->cur.visible)
77 evas_event_feed_mouse_move(obj->layer->evas,
78 obj->layer->evas->pointer.x,
79 obj->layer->evas->pointer.y,
80 obj->layer->evas->last_timestamp,
81 NULL);
82 }
83 }
84}
85
86EAPI void
87evas_object_lower(Evas_Object *obj)
88{
89 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
90 return;
91 MAGIC_CHECK_END();
92 if (evas_object_intercept_call_lower(obj)) return;
93 if (!((EINA_INLIST_GET(obj))->prev))
94 {
95 evas_object_inform_call_restack(obj);
96 return;
97 }
98 if (obj->smart.parent)
99 evas_object_smart_member_lower(obj);
100 else
101 {
102 if (obj->in_layer)
103 obj->layer->objects = (Evas_Object *)eina_inlist_promote(EINA_INLIST_GET(obj->layer->objects),
104 EINA_INLIST_GET(obj));
105 }
106 if (obj->clip.clipees)
107 {
108 evas_object_inform_call_restack(obj);
109 return;
110 }
111 if (obj->layer) evas_render_invalidate(obj->layer->evas);
112 obj->restack = EINA_TRUE;
113 evas_object_change(obj);
114 evas_object_inform_call_restack(obj);
115 if (obj->layer->evas->events_frozen > 0) return;
116 if ((!evas_event_passes_through(obj)) && (!evas_event_freezes_through(obj)))
117 {
118 if (!obj->smart.smart)
119 {
120 if (evas_object_is_in_output_rect(obj,
121 obj->layer->evas->pointer.x,
122 obj->layer->evas->pointer.y,
123 1, 1) && obj->cur.visible)
124 evas_event_feed_mouse_move(obj->layer->evas,
125 obj->layer->evas->pointer.x,
126 obj->layer->evas->pointer.y,
127 obj->layer->evas->last_timestamp,
128 NULL);
129 }
130 }
131}
132
133EAPI void
134evas_object_stack_above(Evas_Object *obj, Evas_Object *above)
135{
136 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
137 return;
138 MAGIC_CHECK_END();
139 MAGIC_CHECK(above, Evas_Object, MAGIC_OBJ);
140 return;
141 MAGIC_CHECK_END();
142 if (obj == above) return;
143 if (evas_object_intercept_call_stack_above(obj, above)) return;
144 if (!above)
145 {
146 evas_object_raise(obj);
147 return;
148 }
149 if ((EINA_INLIST_GET(obj))->prev == EINA_INLIST_GET(above))
150 {
151 evas_object_inform_call_restack(obj);
152 return;
153 }
154 if (obj->smart.parent)
155 {
156 if (obj->smart.parent != above->smart.parent)
157 {
158 ERR("BITCH! evas_object_stack_above(), %p not inside same smart as %p!", obj, above);
159 return;
160 }
161 evas_object_smart_member_stack_above(obj, above);
162 }
163 else
164 {
165 if (above->smart.parent)
166 {
167 ERR("BITCH! evas_object_stack_above(), %p stack above %p, but above has smart parent, obj does not", obj, above);
168 return;
169 }
170 if (obj->layer != above->layer)
171 {
172 ERR("BITCH! evas_object_stack_above(), %p stack above %p, not matching layers", obj, above);
173 return;
174 }
175 if (obj->in_layer)
176 {
177 obj->layer->objects = (Evas_Object *)eina_inlist_remove(EINA_INLIST_GET(obj->layer->objects),
178 EINA_INLIST_GET(obj));
179 obj->layer->objects = (Evas_Object *)eina_inlist_append_relative(EINA_INLIST_GET(obj->layer->objects),
180 EINA_INLIST_GET(obj),
181 EINA_INLIST_GET(above));
182 }
183 }
184 if (obj->clip.clipees)
185 {
186 evas_object_inform_call_restack(obj);
187 return;
188 }
189 if (obj->layer) evas_render_invalidate(obj->layer->evas);
190 obj->restack = EINA_TRUE;
191 evas_object_change(obj);
192 evas_object_inform_call_restack(obj);
193 if (obj->layer->evas->events_frozen > 0) return;
194 if ((!evas_event_passes_through(obj)) && (!evas_event_freezes_through(obj)))
195 {
196 if (!obj->smart.smart)
197 {
198 if (evas_object_is_in_output_rect(obj,
199 obj->layer->evas->pointer.x,
200 obj->layer->evas->pointer.y,
201 1, 1) && obj->cur.visible)
202 evas_event_feed_mouse_move(obj->layer->evas,
203 obj->layer->evas->pointer.x,
204 obj->layer->evas->pointer.y,
205 obj->layer->evas->last_timestamp,
206 NULL);
207 }
208 }
209}
210
211EAPI void
212evas_object_stack_below(Evas_Object *obj, Evas_Object *below)
213{
214 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
215 return;
216 MAGIC_CHECK_END();
217 MAGIC_CHECK(below, Evas_Object, MAGIC_OBJ);
218 return;
219 MAGIC_CHECK_END();
220 if (obj == below) return;
221 if (evas_object_intercept_call_stack_below(obj, below)) return;
222 if (!below)
223 {
224 evas_object_lower(obj);
225 return;
226 }
227 if ((EINA_INLIST_GET(obj))->next == EINA_INLIST_GET(below))
228 {
229 evas_object_inform_call_restack(obj);
230 return;
231 }
232 if (obj->smart.parent)
233 {
234 if (obj->smart.parent != below->smart.parent)
235 {
236 ERR("BITCH! evas_object_stack_below(), %p not inside same smart as %p!", obj, below);
237 return;
238 }
239 evas_object_smart_member_stack_below(obj, below);
240 }
241 else
242 {
243 if (below->smart.parent)
244 {
245 ERR("BITCH! evas_object_stack_below(), %p stack below %p, but below has smart parent, obj does not", obj, below);
246 return;
247 }
248 if (obj->layer != below->layer)
249 {
250 ERR("BITCH! evas_object_stack_below(), %p stack below %p, not matching layers", obj, below);
251 return;
252 }
253 if (obj->in_layer)
254 {
255 obj->layer->objects = (Evas_Object *)eina_inlist_remove(EINA_INLIST_GET(obj->layer->objects),
256 EINA_INLIST_GET(obj));
257 obj->layer->objects = (Evas_Object *)eina_inlist_prepend_relative(EINA_INLIST_GET(obj->layer->objects),
258 EINA_INLIST_GET(obj),
259 EINA_INLIST_GET(below));
260 }
261 }
262 if (obj->clip.clipees)
263 {
264 evas_object_inform_call_restack(obj);
265 return;
266 }
267 if (obj->layer) evas_render_invalidate(obj->layer->evas);
268 obj->restack = EINA_TRUE;
269 evas_object_change(obj);
270 evas_object_inform_call_restack(obj);
271 if (obj->layer->evas->events_frozen > 0) return;
272 if ((!evas_event_passes_through(obj)) && (!evas_event_freezes_through(obj)))
273 {
274 if (!obj->smart.smart)
275 {
276 if (evas_object_is_in_output_rect(obj,
277 obj->layer->evas->pointer.x,
278 obj->layer->evas->pointer.y,
279 1, 1) && obj->cur.visible)
280 evas_event_feed_mouse_move(obj->layer->evas,
281 obj->layer->evas->pointer.x,
282 obj->layer->evas->pointer.y,
283 obj->layer->evas->last_timestamp,
284 NULL);
285 }
286 }
287}
288
289EAPI Evas_Object *
290evas_object_above_get(const Evas_Object *obj)
291{
292 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
293 return NULL;
294 MAGIC_CHECK_END();
295 if (obj->smart.parent)
296 {
297 do
298 {
299 obj = (Evas_Object *)((EINA_INLIST_GET(obj))->next);
300 if ((obj) && (!obj->delete_me)) return (Evas_Object *)obj;
301 }
302 while (obj);
303 return NULL;
304 }
305 obj = evas_object_above_get_internal(obj);
306 while (obj)
307 {
308 if (!obj->delete_me) return (Evas_Object *)obj;
309 obj = evas_object_above_get_internal(obj);
310 }
311 return NULL;
312}
313
314EAPI Evas_Object *
315evas_object_below_get(const Evas_Object *obj)
316{
317 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
318 return NULL;
319 MAGIC_CHECK_END();
320 if (obj->smart.parent)
321 {
322 do
323 {
324 obj = (Evas_Object *)((EINA_INLIST_GET(obj))->prev);
325 if ((obj) && (!obj->delete_me)) return (Evas_Object *)obj;
326 }
327 while (obj);
328 return NULL;
329 }
330 obj = evas_object_below_get_internal(obj);
331 while (obj)
332 {
333 if (!obj->delete_me) return (Evas_Object *)obj;
334 obj = evas_object_below_get_internal(obj);
335 }
336 return NULL;
337}
338
339
340
341EAPI Evas_Object *
342evas_object_bottom_get(const Evas *e)
343{
344 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
345 return NULL;
346 MAGIC_CHECK_END();
347 if (e->layers)
348 {
349 Evas_Object *obj;
350
351 obj = e->layers->objects;
352 while (obj)
353 {
354 if (!obj->delete_me) return obj;
355 obj = evas_object_above_get_internal(obj);
356 }
357 }
358 return NULL;
359}
360
361EAPI Evas_Object *
362evas_object_top_get(const Evas *e)
363{
364 Evas_Object *obj = NULL;
365 Eina_Inlist *list;
366 Evas_Layer *layer;
367
368 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
369 return NULL;
370 MAGIC_CHECK_END();
371
372 list = EINA_INLIST_GET(e->layers);
373 if (!list) return NULL;
374
375 layer = (Evas_Layer *) list->last;
376 if (!layer) return NULL;
377
378 list = EINA_INLIST_GET(layer->objects);
379 if (!list) return NULL;
380
381 obj = (Evas_Object *) list->last;
382 if (!obj) return NULL;
383
384 while (obj)
385 {
386 if (!obj->delete_me) return obj;
387 obj = evas_object_below_get_internal(obj);
388 }
389
390 return obj;
391}
diff --git a/libraries/evas/src/lib/canvas/evas_stats.c b/libraries/evas/src/lib/canvas/evas_stats.c
new file mode 100644
index 0000000..cfb1a84
--- /dev/null
+++ b/libraries/evas/src/lib/canvas/evas_stats.c
@@ -0,0 +1,185 @@
1#include "evas_common.h"
2#include "evas_private.h"
3#include "evas_cs.h"
4
5EAPI Eina_Bool
6evas_cserve_want_get(void)
7{
8#ifdef EVAS_CSERVE
9 return evas_cserve_use_get();
10#endif
11 return 0;
12}
13
14EAPI Eina_Bool
15evas_cserve_connected_get(void)
16{
17#ifdef EVAS_CSERVE
18 return evas_cserve_have_get();
19#endif
20 return 0;
21}
22
23EAPI Eina_Bool
24evas_cserve_stats_get(Evas_Cserve_Stats *stats)
25{
26#ifdef EVAS_CSERVE
27 Op_Getstats_Reply st;
28
29 if (!evas_cserve_raw_stats_get(&st)) return 0;
30 if (!stats) return 1;
31 stats->saved_memory = st.saved_memory;
32 stats->wasted_memory = st.wasted_memory;
33 stats->saved_memory_peak = st.saved_memory_peak;
34 stats->wasted_memory_peak = st.wasted_memory_peak;
35 stats->saved_time_image_header_load = st.saved_time_image_header_load;
36 stats->saved_time_image_data_load = st.saved_time_image_data_load;
37 // may expand this in future
38 return 1;
39#else
40 (void) stats;
41 return 0;
42#endif
43}
44
45EAPI Eina_Bool
46evas_cserve_image_cache_contents_get(Evas_Cserve_Image_Cache *cache)
47{
48#ifdef EVAS_CSERVE
49 Op_Getinfo_Reply *info;
50 unsigned char *p;
51 int i, j;
52
53 if (!(info = evas_cserve_raw_info_get())) return 0;
54 if (!cache)
55 {
56 free(info);
57 return 1;
58 }
59 cache->active.mem_total = info->active.mem_total;
60 cache->active.count = info->active.count;
61 cache->cached.mem_total = info->cached.mem_total;
62 cache->cached.count = info->cached.count;
63 cache->images = NULL;
64 j = info->active.count + info->cached.count;
65 p = (unsigned char *)info;
66 p += sizeof(Op_Getinfo_Reply);
67 for (i = 0; i < j; i++)
68 {
69 Evas_Cserve_Image *im;
70 Op_Getinfo_Item it;
71 char *file, *key;
72
73 memcpy(&it, p, sizeof(Op_Getinfo_Item));
74 file = (char*) (p + sizeof(Op_Getinfo_Item));
75 key = file + strlen(file) + 1;
76 im = calloc(1, sizeof(Evas_Cserve_Image));
77 if (!im) continue;
78 if (file[0] != 0)
79 {
80 file = (char *)eina_stringshare_add(file);
81 if (!file)
82 {
83 free(im);
84 continue;
85 }
86 }
87 else
88 file = NULL;
89 if (key[0] != 0)
90 {
91 key = (char *)eina_stringshare_add(key);
92 if (!key)
93 {
94 if (file) eina_stringshare_del(file);
95 free(im);
96 continue;
97 }
98 }
99 else key = NULL;
100 cache->images = eina_list_append(cache->images, im);
101 im->file = file;
102 im->key = key;
103 im->w = it.w;
104 im->h = it.h;
105 im->cached_time = it.cached_time;
106 im->file_mod_time = it.file_mod_time;
107 im->file_checked_time = it.file_checked_time;
108 im->refcount = it.refcount;
109 im->data_refcount = it.data_refcount;
110 im->memory_footprint = it.memory_footprint;
111 im->head_load_time = it.head_load_time;
112 im->data_load_time = it.data_load_time;
113 im->active = it.active;
114 im->alpha = it.alpha;
115 im->data_loaded = it.data_loaded;
116 im->dead = it.dead;
117 im->useless = it.useless;
118 }
119 free(info);
120 return 1;
121#else
122 (void) cache;
123 return 0;
124#endif
125}
126
127EAPI void
128evas_cserve_image_cache_contents_clean(Evas_Cserve_Image_Cache *cache)
129{
130#ifdef EVAS_CSERVE
131 Evas_Cserve_Image *im;
132
133 EINA_LIST_FREE(cache->images, im)
134 {
135 if (im->file) eina_stringshare_del(im->file);
136 if (im->key) eina_stringshare_del(im->key);
137 free(im);
138 }
139#else
140 (void) cache;
141#endif
142}
143
144EAPI Eina_Bool
145evas_cserve_config_get(Evas_Cserve_Config *config)
146{
147#ifdef EVAS_CSERVE
148 Op_Getconfig_Reply conf;
149
150 if (!evas_cserve_raw_config_get(&conf)) return 0;
151 if (!config) return 1;
152 config->cache_max_usage = conf.cache_max_usage;
153 config->cache_item_timeout = conf.cache_item_timeout;
154 config->cache_item_timeout_check = conf.cache_item_timeout_check;
155 return 1;
156#else
157 (void) config;
158 return 0;
159#endif
160}
161
162EAPI Eina_Bool
163evas_cserve_config_set(const Evas_Cserve_Config *config)
164{
165#ifdef EVAS_CSERVE
166 Op_Setconfig conf;
167
168 if (!config) return 1;
169 conf.cache_max_usage = config->cache_max_usage;
170 conf.cache_item_timeout = config->cache_item_timeout;
171 conf.cache_item_timeout_check = config->cache_item_timeout_check;
172 return evas_cserve_raw_config_set(&conf);
173#else
174 (void) config;
175 return 0;
176#endif
177}
178
179EAPI void
180evas_cserve_disconnect(void)
181{
182#ifdef EVAS_CSERVE
183 evas_cserve_discon();
184#endif
185}
diff --git a/libraries/evas/src/lib/canvas/evas_touch_point.c b/libraries/evas/src/lib/canvas/evas_touch_point.c
new file mode 100644
index 0000000..bdea73f
--- /dev/null
+++ b/libraries/evas/src/lib/canvas/evas_touch_point.c
@@ -0,0 +1,110 @@
1#include "evas_common.h"
2#include "evas_private.h"
3
4void
5_evas_touch_point_append(Evas *e, int id, Evas_Coord x, Evas_Coord y)
6{
7 Evas_Coord_Touch_Point *point;
8
9 /* create new Evas_Coord_Touch_Point */
10 point = (Evas_Coord_Touch_Point *)calloc(1, sizeof(Evas_Coord_Touch_Point));
11 point->x = x;
12 point->y = y;
13 point->id = id;
14 point->state = EVAS_TOUCH_POINT_DOWN;
15 e->touch_points = eina_list_append(e->touch_points, point);
16}
17
18void
19_evas_touch_point_update(Evas *e, int id, Evas_Coord x, Evas_Coord y, Evas_Touch_Point_State state)
20{
21 Eina_List *l;
22 Evas_Coord_Touch_Point *point = NULL;
23
24 EINA_LIST_FOREACH(e->touch_points, l, point)
25 {
26 if (point->id == id)
27 {
28 point->x = x;
29 point->y = y;
30 point->state = state;
31 break;
32 }
33 }
34}
35
36void
37_evas_touch_point_remove(Evas *e, int id)
38{
39 Eina_List *l;
40 Evas_Coord_Touch_Point *point = NULL;
41
42 EINA_LIST_FOREACH(e->touch_points, l, point)
43 {
44 if (point->id == id)
45 {
46 e->touch_points = eina_list_remove(e->touch_points, point);
47 free(point);
48 break;
49 }
50 }
51}
52
53EAPI unsigned int
54evas_touch_point_list_count(Evas *e)
55{
56 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
57 return 0;
58 MAGIC_CHECK_END();
59 return eina_list_count(e->touch_points);
60}
61
62EAPI void
63evas_touch_point_list_nth_xy_get(Evas *e, unsigned int n, Evas_Coord *x, Evas_Coord *y)
64{
65 Evas_Coord_Touch_Point *point = NULL;
66
67 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
68 if (x) *x = 0;
69 if (y) *y = 0;
70 return;
71 MAGIC_CHECK_END();
72
73 point = (Evas_Coord_Touch_Point *)eina_list_nth(e->touch_points, n);
74 if (!point)
75 {
76 if (x) *x = 0;
77 if (y) *y = 0;
78 return;
79 }
80 if (x) *x = point->x;
81 if (y) *y = point->y;
82}
83
84EAPI int
85evas_touch_point_list_nth_id_get(Evas *e, unsigned int n)
86{
87 Evas_Coord_Touch_Point *point = NULL;
88
89 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
90 return -1;
91 MAGIC_CHECK_END();
92
93 point = (Evas_Coord_Touch_Point *)eina_list_nth(e->touch_points, n);
94 if (!point) return -1;
95 return point->id;
96}
97
98EAPI Evas_Touch_Point_State
99evas_touch_point_list_nth_state_get(Evas *e, unsigned int n)
100{
101 Evas_Coord_Touch_Point *point = NULL;
102
103 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
104 return EVAS_TOUCH_POINT_CANCEL;
105 MAGIC_CHECK_END();
106
107 point = (Evas_Coord_Touch_Point *)eina_list_nth(e->touch_points, n);
108 if (!point) return EVAS_TOUCH_POINT_CANCEL;
109 return point->state;
110}
diff --git a/libraries/evas/src/lib/cserve/Makefile.am b/libraries/evas/src/lib/cserve/Makefile.am
new file mode 100644
index 0000000..6ff6e2a
--- /dev/null
+++ b/libraries/evas/src/lib/cserve/Makefile.am
@@ -0,0 +1,32 @@
1MAINTAINERCLEANFILES = Makefile.in
2
3AM_CPPFLAGS = \
4-I. \
5-I$(top_srcdir)/src/lib \
6-I$(top_srcdir)/src/lib/include \
7-I$(top_srcdir)/src/lib/cserve \
8-DPACKAGE_BIN_DIR=\"$(bindir)\" \
9-DPACKAGE_LIB_DIR=\"$(libdir)\" \
10-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
11@EINA_CFLAGS@ \
12@FREETYPE_CFLAGS@ \
13@FRIBIDI_CFLAGS@ \
14@EET_CFLAGS@ \
15@FONTCONFIG_CFLAGS@ \
16@pthread_cflags@ \
17@PIXMAN_CFLAGS@
18
19if EVAS_CSERVE
20
21noinst_LTLIBRARIES = libevas_cserve.la
22
23endif
24
25libevas_cserve_la_SOURCES = \
26evas_cs.h \
27evas_cs_main.c \
28evas_cs_server.c \
29evas_cs_client.c \
30evas_cs_mem.c
31
32libevas_cserve_la_LIBADD = @EINA_LIBS@ -lrt
diff --git a/libraries/evas/src/lib/cserve/Makefile.in b/libraries/evas/src/lib/cserve/Makefile.in
new file mode 100644
index 0000000..74b5ff9
--- /dev/null
+++ b/libraries/evas/src/lib/cserve/Makefile.in
@@ -0,0 +1,688 @@
1# Makefile.in generated by automake 1.11.1 from Makefile.am.
2# @configure_input@
3
4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
6# Inc.
7# This Makefile.in is free software; the Free Software Foundation
8# gives unlimited permission to copy and/or distribute it,
9# with or without modifications, as long as this notice is preserved.
10
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
13# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14# PARTICULAR PURPOSE.
15
16@SET_MAKE@
17
18VPATH = @srcdir@
19pkgdatadir = $(datadir)/@PACKAGE@
20pkgincludedir = $(includedir)/@PACKAGE@
21pkglibdir = $(libdir)/@PACKAGE@
22pkglibexecdir = $(libexecdir)/@PACKAGE@
23am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
24install_sh_DATA = $(install_sh) -c -m 644
25install_sh_PROGRAM = $(install_sh) -c
26install_sh_SCRIPT = $(install_sh) -c
27INSTALL_HEADER = $(INSTALL_DATA)
28transform = $(program_transform_name)
29NORMAL_INSTALL = :
30PRE_INSTALL = :
31POST_INSTALL = :
32NORMAL_UNINSTALL = :
33PRE_UNINSTALL = :
34POST_UNINSTALL = :
35build_triplet = @build@
36host_triplet = @host@
37subdir = src/lib/cserve
38DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
39ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
40am__aclocal_m4_deps = $(top_srcdir)/m4/efl_attribute.m4 \
41 $(top_srcdir)/m4/efl_coverage.m4 \
42 $(top_srcdir)/m4/efl_doxygen.m4 \
43 $(top_srcdir)/m4/efl_fnmatch.m4 \
44 $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \
45 $(top_srcdir)/m4/evas_check_engine.m4 \
46 $(top_srcdir)/m4/evas_check_loader.m4 \
47 $(top_srcdir)/m4/evas_converter.m4 \
48 $(top_srcdir)/m4/evas_dither.m4 \
49 $(top_srcdir)/m4/evas_scaler.m4 $(top_srcdir)/m4/libtool.m4 \
50 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
51 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
52 $(top_srcdir)/configure.ac
53am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
54 $(ACLOCAL_M4)
55mkinstalldirs = $(install_sh) -d
56CONFIG_HEADER = $(top_builddir)/config.h
57CONFIG_CLEAN_FILES =
58CONFIG_CLEAN_VPATH_FILES =
59LTLIBRARIES = $(noinst_LTLIBRARIES)
60libevas_cserve_la_DEPENDENCIES =
61am_libevas_cserve_la_OBJECTS = evas_cs_main.lo evas_cs_server.lo \
62 evas_cs_client.lo evas_cs_mem.lo
63libevas_cserve_la_OBJECTS = $(am_libevas_cserve_la_OBJECTS)
64AM_V_lt = $(am__v_lt_$(V))
65am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
66am__v_lt_0 = --silent
67@EVAS_CSERVE_TRUE@am_libevas_cserve_la_rpath =
68DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
69depcomp = $(SHELL) $(top_srcdir)/depcomp
70am__depfiles_maybe = depfiles
71am__mv = mv -f
72COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
73 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
74LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
75 $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
76 $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
77 $(AM_CFLAGS) $(CFLAGS)
78AM_V_CC = $(am__v_CC_$(V))
79am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
80am__v_CC_0 = @echo " CC " $@;
81AM_V_at = $(am__v_at_$(V))
82am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
83am__v_at_0 = @
84CCLD = $(CC)
85LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
86 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
87 $(AM_LDFLAGS) $(LDFLAGS) -o $@
88AM_V_CCLD = $(am__v_CCLD_$(V))
89am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
90am__v_CCLD_0 = @echo " CCLD " $@;
91AM_V_GEN = $(am__v_GEN_$(V))
92am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
93am__v_GEN_0 = @echo " GEN " $@;
94SOURCES = $(libevas_cserve_la_SOURCES)
95DIST_SOURCES = $(libevas_cserve_la_SOURCES)
96ETAGS = etags
97CTAGS = ctags
98DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
99ACLOCAL = @ACLOCAL@
100ALLOCA = @ALLOCA@
101AMTAR = @AMTAR@
102AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
103AR = @AR@
104AS = @AS@
105AUTOCONF = @AUTOCONF@
106AUTOHEADER = @AUTOHEADER@
107AUTOMAKE = @AUTOMAKE@
108AWK = @AWK@
109CC = @CC@
110CCDEPMODE = @CCDEPMODE@
111CFLAGS = @CFLAGS@
112CHECK_CFLAGS = @CHECK_CFLAGS@
113CHECK_LIBS = @CHECK_LIBS@
114CPP = @CPP@
115CPPFLAGS = @CPPFLAGS@
116CXX = @CXX@
117CXXCPP = @CXXCPP@
118CXXDEPMODE = @CXXDEPMODE@
119CXXFLAGS = @CXXFLAGS@
120CYGPATH_W = @CYGPATH_W@
121DEFS = @DEFS@
122DEPDIR = @DEPDIR@
123DIRECTFB_CFLAGS = @DIRECTFB_CFLAGS@
124DIRECTFB_LIBS = @DIRECTFB_LIBS@
125DLLTOOL = @DLLTOOL@
126DSYMUTIL = @DSYMUTIL@
127DUMPBIN = @DUMPBIN@
128ECHO_C = @ECHO_C@
129ECHO_N = @ECHO_N@
130ECHO_T = @ECHO_T@
131ECORE_EVAS_CFLAGS = @ECORE_EVAS_CFLAGS@
132ECORE_EVAS_LIBS = @ECORE_EVAS_LIBS@
133EDB_CFLAGS = @EDB_CFLAGS@
134EDB_LIBS = @EDB_LIBS@
135EDJE_CFLAGS = @EDJE_CFLAGS@
136EDJE_LIBS = @EDJE_LIBS@
137EET_CFLAGS = @EET_CFLAGS@
138EET_LIBS = @EET_LIBS@
139EFL_COVERAGE_CFLAGS = @EFL_COVERAGE_CFLAGS@
140EFL_COVERAGE_LIBS = @EFL_COVERAGE_LIBS@
141EFL_FNMATCH_LIBS = @EFL_FNMATCH_LIBS@
142EGREP = @EGREP@
143EINA_CFLAGS = @EINA_CFLAGS@
144EINA_LIBS = @EINA_LIBS@
145EVAS_CFLAGS = @EVAS_CFLAGS@
146EVAS_LIBS = @EVAS_LIBS@
147EVAS_SSE3_CFLAGS = @EVAS_SSE3_CFLAGS@
148EVIL_CFLAGS = @EVIL_CFLAGS@
149EVIL_LIBS = @EVIL_LIBS@
150EXEEXT = @EXEEXT@
151FGREP = @FGREP@
152FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@
153FONTCONFIG_LIBS = @FONTCONFIG_LIBS@
154FREETYPE_CFLAGS = @FREETYPE_CFLAGS@
155FREETYPE_LIBS = @FREETYPE_LIBS@
156FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@
157FRIBIDI_LIBS = @FRIBIDI_LIBS@
158GL_EET_CFLAGS = @GL_EET_CFLAGS@
159GL_EET_LIBS = @GL_EET_LIBS@
160GREP = @GREP@
161HARFBUZZ_CFLAGS = @HARFBUZZ_CFLAGS@
162HARFBUZZ_LIBS = @HARFBUZZ_LIBS@
163INSTALL = @INSTALL@
164INSTALL_DATA = @INSTALL_DATA@
165INSTALL_PROGRAM = @INSTALL_PROGRAM@
166INSTALL_SCRIPT = @INSTALL_SCRIPT@
167INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
168LD = @LD@
169LDFLAGS = @LDFLAGS@
170LIBOBJS = @LIBOBJS@
171LIBS = @LIBS@
172LIBTOOL = @LIBTOOL@
173LINEBREAK_CFLAGS = @LINEBREAK_CFLAGS@
174LINEBREAK_LIBS = @LINEBREAK_LIBS@
175LIPO = @LIPO@
176LN_S = @LN_S@
177LTLIBOBJS = @LTLIBOBJS@
178MAKEINFO = @MAKEINFO@
179MKDIR_P = @MKDIR_P@
180MODULE_ARCH = @MODULE_ARCH@
181NM = @NM@
182NMEDIT = @NMEDIT@
183OBJC = @OBJC@
184OBJCDEPMODE = @OBJCDEPMODE@
185OBJCFLAGS = @OBJCFLAGS@
186OBJDUMP = @OBJDUMP@
187OBJEXT = @OBJEXT@
188OTOOL = @OTOOL@
189OTOOL64 = @OTOOL64@
190PACKAGE = @PACKAGE@
191PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
192PACKAGE_NAME = @PACKAGE_NAME@
193PACKAGE_STRING = @PACKAGE_STRING@
194PACKAGE_TARNAME = @PACKAGE_TARNAME@
195PACKAGE_URL = @PACKAGE_URL@
196PACKAGE_VERSION = @PACKAGE_VERSION@
197PATH_SEPARATOR = @PATH_SEPARATOR@
198PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
199PIXMAN_LIBS = @PIXMAN_LIBS@
200PKG_CONFIG = @PKG_CONFIG@
201PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
202PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
203PNG_CFLAGS = @PNG_CFLAGS@
204PNG_LIBS = @PNG_LIBS@
205RANLIB = @RANLIB@
206SDL_CFLAGS = @SDL_CFLAGS@
207SDL_LIBS = @SDL_LIBS@
208SED = @SED@
209SET_MAKE = @SET_MAKE@
210SHELL = @SHELL@
211SHM_OPEN_LINK = @SHM_OPEN_LINK@
212STRIP = @STRIP@
213SVG_CFLAGS = @SVG_CFLAGS@
214SVG_LIBS = @SVG_LIBS@
215VALGRIND_CFLAGS = @VALGRIND_CFLAGS@
216VALGRIND_LIBS = @VALGRIND_LIBS@
217VERSION = @VERSION@
218VMAJ = @VMAJ@
219WIN32_CFLAGS = @WIN32_CFLAGS@
220WIN32_CPPFLAGS = @WIN32_CPPFLAGS@
221XCB_CFLAGS = @XCB_CFLAGS@
222XCB_GL_CFLAGS = @XCB_GL_CFLAGS@
223XCB_GL_LIBS = @XCB_GL_LIBS@
224XCB_LIBS = @XCB_LIBS@
225XEXT_CFLAGS = @XEXT_CFLAGS@
226XEXT_LIBS = @XEXT_LIBS@
227XMKMF = @XMKMF@
228X_CFLAGS = @X_CFLAGS@
229X_EXTRA_LIBS = @X_EXTRA_LIBS@
230X_LIBS = @X_LIBS@
231X_PRE_LIBS = @X_PRE_LIBS@
232abs_builddir = @abs_builddir@
233abs_srcdir = @abs_srcdir@
234abs_top_builddir = @abs_top_builddir@
235abs_top_srcdir = @abs_top_srcdir@
236ac_ct_CC = @ac_ct_CC@
237ac_ct_CXX = @ac_ct_CXX@
238ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
239ac_ct_OBJC = @ac_ct_OBJC@
240altivec_cflags = @altivec_cflags@
241am__include = @am__include@
242am__leading_dot = @am__leading_dot@
243am__quote = @am__quote@
244am__tar = @am__tar@
245am__untar = @am__untar@
246bindir = @bindir@
247build = @build@
248build_alias = @build_alias@
249build_cpu = @build_cpu@
250build_os = @build_os@
251build_vendor = @build_vendor@
252builddir = @builddir@
253datadir = @datadir@
254datarootdir = @datarootdir@
255dlopen_libs = @dlopen_libs@
256docdir = @docdir@
257dvidir = @dvidir@
258edje_cc = @edje_cc@
259efl_doxygen = @efl_doxygen@
260efl_have_doxygen = @efl_have_doxygen@
261evas_engine_buffer_cflags = @evas_engine_buffer_cflags@
262evas_engine_buffer_libs = @evas_engine_buffer_libs@
263evas_engine_direct3d_cflags = @evas_engine_direct3d_cflags@
264evas_engine_direct3d_libs = @evas_engine_direct3d_libs@
265evas_engine_directfb_cflags = @evas_engine_directfb_cflags@
266evas_engine_directfb_libs = @evas_engine_directfb_libs@
267evas_engine_fb_cflags = @evas_engine_fb_cflags@
268evas_engine_fb_libs = @evas_engine_fb_libs@
269evas_engine_gl_cocoa_cflags = @evas_engine_gl_cocoa_cflags@
270evas_engine_gl_cocoa_libs = @evas_engine_gl_cocoa_libs@
271evas_engine_gl_common_libs = @evas_engine_gl_common_libs@
272evas_engine_gl_sdl_cflags = @evas_engine_gl_sdl_cflags@
273evas_engine_gl_sdl_libs = @evas_engine_gl_sdl_libs@
274evas_engine_gl_xcb_cflags = @evas_engine_gl_xcb_cflags@
275evas_engine_gl_xcb_libs = @evas_engine_gl_xcb_libs@
276evas_engine_gl_xlib_cflags = @evas_engine_gl_xlib_cflags@
277evas_engine_gl_xlib_libs = @evas_engine_gl_xlib_libs@
278evas_engine_psl1ght_cflags = @evas_engine_psl1ght_cflags@
279evas_engine_psl1ght_libs = @evas_engine_psl1ght_libs@
280evas_engine_software_16_ddraw_cflags = @evas_engine_software_16_ddraw_cflags@
281evas_engine_software_16_ddraw_libs = @evas_engine_software_16_ddraw_libs@
282evas_engine_software_16_sdl_cflags = @evas_engine_software_16_sdl_cflags@
283evas_engine_software_16_sdl_libs = @evas_engine_software_16_sdl_libs@
284evas_engine_software_16_wince_cflags = @evas_engine_software_16_wince_cflags@
285evas_engine_software_16_wince_libs = @evas_engine_software_16_wince_libs@
286evas_engine_software_16_x11_cflags = @evas_engine_software_16_x11_cflags@
287evas_engine_software_16_x11_libs = @evas_engine_software_16_x11_libs@
288evas_engine_software_8_x11_cflags = @evas_engine_software_8_x11_cflags@
289evas_engine_software_8_x11_libs = @evas_engine_software_8_x11_libs@
290evas_engine_software_ddraw_cflags = @evas_engine_software_ddraw_cflags@
291evas_engine_software_ddraw_libs = @evas_engine_software_ddraw_libs@
292evas_engine_software_gdi_cflags = @evas_engine_software_gdi_cflags@
293evas_engine_software_gdi_libs = @evas_engine_software_gdi_libs@
294evas_engine_software_sdl_cflags = @evas_engine_software_sdl_cflags@
295evas_engine_software_sdl_libs = @evas_engine_software_sdl_libs@
296evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@
297evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@
298evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@
299evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@
300evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@
301evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@
302evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@
303evas_image_loader_edb_libs = @evas_image_loader_edb_libs@
304evas_image_loader_eet_cflags = @evas_image_loader_eet_cflags@
305evas_image_loader_eet_libs = @evas_image_loader_eet_libs@
306evas_image_loader_generic_cflags = @evas_image_loader_generic_cflags@
307evas_image_loader_generic_libs = @evas_image_loader_generic_libs@
308evas_image_loader_gif_cflags = @evas_image_loader_gif_cflags@
309evas_image_loader_gif_libs = @evas_image_loader_gif_libs@
310evas_image_loader_ico_cflags = @evas_image_loader_ico_cflags@
311evas_image_loader_ico_libs = @evas_image_loader_ico_libs@
312evas_image_loader_jpeg_cflags = @evas_image_loader_jpeg_cflags@
313evas_image_loader_jpeg_libs = @evas_image_loader_jpeg_libs@
314evas_image_loader_pmaps_cflags = @evas_image_loader_pmaps_cflags@
315evas_image_loader_pmaps_libs = @evas_image_loader_pmaps_libs@
316evas_image_loader_png_cflags = @evas_image_loader_png_cflags@
317evas_image_loader_png_libs = @evas_image_loader_png_libs@
318evas_image_loader_psd_cflags = @evas_image_loader_psd_cflags@
319evas_image_loader_psd_libs = @evas_image_loader_psd_libs@
320evas_image_loader_svg_cflags = @evas_image_loader_svg_cflags@
321evas_image_loader_svg_libs = @evas_image_loader_svg_libs@
322evas_image_loader_tga_cflags = @evas_image_loader_tga_cflags@
323evas_image_loader_tga_libs = @evas_image_loader_tga_libs@
324evas_image_loader_tiff_cflags = @evas_image_loader_tiff_cflags@
325evas_image_loader_tiff_libs = @evas_image_loader_tiff_libs@
326evas_image_loader_wbmp_cflags = @evas_image_loader_wbmp_cflags@
327evas_image_loader_wbmp_libs = @evas_image_loader_wbmp_libs@
328evas_image_loader_xpm_cflags = @evas_image_loader_xpm_cflags@
329evas_image_loader_xpm_libs = @evas_image_loader_xpm_libs@
330exec_prefix = @exec_prefix@
331have_evas_engine_gl_x11 = @have_evas_engine_gl_x11@
332have_evas_engine_gl_xcb = @have_evas_engine_gl_xcb@
333have_evas_engine_gl_xlib = @have_evas_engine_gl_xlib@
334have_evas_engine_software_x11 = @have_evas_engine_software_x11@
335have_evas_engine_software_xcb = @have_evas_engine_software_xcb@
336have_evas_engine_software_xlib = @have_evas_engine_software_xlib@
337have_lcov = @have_lcov@
338host = @host@
339host_alias = @host_alias@
340host_cpu = @host_cpu@
341host_os = @host_os@
342host_vendor = @host_vendor@
343htmldir = @htmldir@
344includedir = @includedir@
345infodir = @infodir@
346install_sh = @install_sh@
347libdir = @libdir@
348libexecdir = @libexecdir@
349localedir = @localedir@
350localstatedir = @localstatedir@
351lt_ECHO = @lt_ECHO@
352lt_enable_auto_import = @lt_enable_auto_import@
353mandir = @mandir@
354mkdir_p = @mkdir_p@
355oldincludedir = @oldincludedir@
356pdfdir = @pdfdir@
357pkgconfig_requires_private = @pkgconfig_requires_private@
358prefix = @prefix@
359program_transform_name = @program_transform_name@
360psdir = @psdir@
361pthread_cflags = @pthread_cflags@
362pthread_libs = @pthread_libs@
363release_info = @release_info@
364requirement_evas = @requirement_evas@
365sbindir = @sbindir@
366sharedstatedir = @sharedstatedir@
367srcdir = @srcdir@
368sysconfdir = @sysconfdir@
369target_alias = @target_alias@
370top_build_prefix = @top_build_prefix@
371top_builddir = @top_builddir@
372top_srcdir = @top_srcdir@
373version_info = @version_info@
374MAINTAINERCLEANFILES = Makefile.in
375AM_CPPFLAGS = \
376-I. \
377-I$(top_srcdir)/src/lib \
378-I$(top_srcdir)/src/lib/include \
379-I$(top_srcdir)/src/lib/cserve \
380-DPACKAGE_BIN_DIR=\"$(bindir)\" \
381-DPACKAGE_LIB_DIR=\"$(libdir)\" \
382-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
383@EINA_CFLAGS@ \
384@FREETYPE_CFLAGS@ \
385@FRIBIDI_CFLAGS@ \
386@EET_CFLAGS@ \
387@FONTCONFIG_CFLAGS@ \
388@pthread_cflags@ \
389@PIXMAN_CFLAGS@
390
391@EVAS_CSERVE_TRUE@noinst_LTLIBRARIES = libevas_cserve.la
392libevas_cserve_la_SOURCES = \
393evas_cs.h \
394evas_cs_main.c \
395evas_cs_server.c \
396evas_cs_client.c \
397evas_cs_mem.c
398
399libevas_cserve_la_LIBADD = @EINA_LIBS@ -lrt
400all: all-am
401
402.SUFFIXES:
403.SUFFIXES: .c .lo .o .obj
404$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
405 @for dep in $?; do \
406 case '$(am__configure_deps)' in \
407 *$$dep*) \
408 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
409 && { if test -f $@; then exit 0; else break; fi; }; \
410 exit 1;; \
411 esac; \
412 done; \
413 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/cserve/Makefile'; \
414 $(am__cd) $(top_srcdir) && \
415 $(AUTOMAKE) --gnu src/lib/cserve/Makefile
416.PRECIOUS: Makefile
417Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
418 @case '$?' in \
419 *config.status*) \
420 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
421 *) \
422 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
423 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
424 esac;
425
426$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
427 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
428
429$(top_srcdir)/configure: $(am__configure_deps)
430 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
431$(ACLOCAL_M4): $(am__aclocal_m4_deps)
432 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
433$(am__aclocal_m4_deps):
434
435clean-noinstLTLIBRARIES:
436 -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
437 @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
438 dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
439 test "$$dir" != "$$p" || dir=.; \
440 echo "rm -f \"$${dir}/so_locations\""; \
441 rm -f "$${dir}/so_locations"; \
442 done
443libevas_cserve.la: $(libevas_cserve_la_OBJECTS) $(libevas_cserve_la_DEPENDENCIES)
444 $(AM_V_CCLD)$(LINK) $(am_libevas_cserve_la_rpath) $(libevas_cserve_la_OBJECTS) $(libevas_cserve_la_LIBADD) $(LIBS)
445
446mostlyclean-compile:
447 -rm -f *.$(OBJEXT)
448
449distclean-compile:
450 -rm -f *.tab.c
451
452@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_cs_client.Plo@am__quote@
453@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_cs_main.Plo@am__quote@
454@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_cs_mem.Plo@am__quote@
455@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_cs_server.Plo@am__quote@
456
457.c.o:
458@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
459@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
460@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
461@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
462@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
463@am__fastdepCC_FALSE@ $(COMPILE) -c $<
464
465.c.obj:
466@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
467@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
468@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
469@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
470@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
471@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
472
473.c.lo:
474@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
475@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
476@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
477@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
478@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
479@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
480
481mostlyclean-libtool:
482 -rm -f *.lo
483
484clean-libtool:
485 -rm -rf .libs _libs
486
487ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
488 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
489 unique=`for i in $$list; do \
490 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
491 done | \
492 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
493 END { if (nonempty) { for (i in files) print i; }; }'`; \
494 mkid -fID $$unique
495tags: TAGS
496
497TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
498 $(TAGS_FILES) $(LISP)
499 set x; \
500 here=`pwd`; \
501 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
502 unique=`for i in $$list; do \
503 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
504 done | \
505 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
506 END { if (nonempty) { for (i in files) print i; }; }'`; \
507 shift; \
508 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
509 test -n "$$unique" || unique=$$empty_fix; \
510 if test $$# -gt 0; then \
511 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
512 "$$@" $$unique; \
513 else \
514 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
515 $$unique; \
516 fi; \
517 fi
518ctags: CTAGS
519CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
520 $(TAGS_FILES) $(LISP)
521 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
522 unique=`for i in $$list; do \
523 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
524 done | \
525 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
526 END { if (nonempty) { for (i in files) print i; }; }'`; \
527 test -z "$(CTAGS_ARGS)$$unique" \
528 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
529 $$unique
530
531GTAGS:
532 here=`$(am__cd) $(top_builddir) && pwd` \
533 && $(am__cd) $(top_srcdir) \
534 && gtags -i $(GTAGS_ARGS) "$$here"
535
536distclean-tags:
537 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
538
539distdir: $(DISTFILES)
540 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
541 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
542 list='$(DISTFILES)'; \
543 dist_files=`for file in $$list; do echo $$file; done | \
544 sed -e "s|^$$srcdirstrip/||;t" \
545 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
546 case $$dist_files in \
547 */*) $(MKDIR_P) `echo "$$dist_files" | \
548 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
549 sort -u` ;; \
550 esac; \
551 for file in $$dist_files; do \
552 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
553 if test -d $$d/$$file; then \
554 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
555 if test -d "$(distdir)/$$file"; then \
556 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
557 fi; \
558 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
559 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
560 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
561 fi; \
562 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
563 else \
564 test -f "$(distdir)/$$file" \
565 || cp -p $$d/$$file "$(distdir)/$$file" \
566 || exit 1; \
567 fi; \
568 done
569check-am: all-am
570check: check-am
571all-am: Makefile $(LTLIBRARIES)
572installdirs:
573install: install-am
574install-exec: install-exec-am
575install-data: install-data-am
576uninstall: uninstall-am
577
578install-am: all-am
579 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
580
581installcheck: installcheck-am
582install-strip:
583 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
584 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
585 `test -z '$(STRIP)' || \
586 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
587mostlyclean-generic:
588
589clean-generic:
590
591distclean-generic:
592 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
593 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
594
595maintainer-clean-generic:
596 @echo "This command is intended for maintainers to use"
597 @echo "it deletes files that may require special tools to rebuild."
598 -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
599clean: clean-am
600
601clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
602 mostlyclean-am
603
604distclean: distclean-am
605 -rm -rf ./$(DEPDIR)
606 -rm -f Makefile
607distclean-am: clean-am distclean-compile distclean-generic \
608 distclean-tags
609
610dvi: dvi-am
611
612dvi-am:
613
614html: html-am
615
616html-am:
617
618info: info-am
619
620info-am:
621
622install-data-am:
623
624install-dvi: install-dvi-am
625
626install-dvi-am:
627
628install-exec-am:
629
630install-html: install-html-am
631
632install-html-am:
633
634install-info: install-info-am
635
636install-info-am:
637
638install-man:
639
640install-pdf: install-pdf-am
641
642install-pdf-am:
643
644install-ps: install-ps-am
645
646install-ps-am:
647
648installcheck-am:
649
650maintainer-clean: maintainer-clean-am
651 -rm -rf ./$(DEPDIR)
652 -rm -f Makefile
653maintainer-clean-am: distclean-am maintainer-clean-generic
654
655mostlyclean: mostlyclean-am
656
657mostlyclean-am: mostlyclean-compile mostlyclean-generic \
658 mostlyclean-libtool
659
660pdf: pdf-am
661
662pdf-am:
663
664ps: ps-am
665
666ps-am:
667
668uninstall-am:
669
670.MAKE: install-am install-strip
671
672.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
673 clean-libtool clean-noinstLTLIBRARIES ctags distclean \
674 distclean-compile distclean-generic distclean-libtool \
675 distclean-tags distdir dvi dvi-am html html-am info info-am \
676 install install-am install-data install-data-am install-dvi \
677 install-dvi-am install-exec install-exec-am install-html \
678 install-html-am install-info install-info-am install-man \
679 install-pdf install-pdf-am install-ps install-ps-am \
680 install-strip installcheck installcheck-am installdirs \
681 maintainer-clean maintainer-clean-generic mostlyclean \
682 mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
683 pdf pdf-am ps ps-am tags uninstall uninstall-am
684
685
686# Tell versions [3.59,3.63) of GNU make to not export all variables.
687# Otherwise a system limit (for SysV at least) may be exceeded.
688.NOEXPORT:
diff --git a/libraries/evas/src/lib/cserve/evas_cs.h b/libraries/evas/src/lib/cserve/evas_cs.h
new file mode 100644
index 0000000..73bbaed
--- /dev/null
+++ b/libraries/evas/src/lib/cserve/evas_cs.h
@@ -0,0 +1,285 @@
1#ifndef EVAS_CS_H
2#define EVAS_CS_H 1
3
4#ifdef EVAS_CSERVE
5
6#include <sys/select.h>
7#include <sys/time.h>
8#include <sys/types.h>
9#include <sys/socket.h>
10#include <sys/mman.h>
11#include <sys/stat.h>
12#include <sys/param.h>
13#include <fcntl.h>
14#include <stdio.h>
15#include <stdlib.h>
16#include <unistd.h>
17#include <string.h>
18#include <netinet/in.h>
19#include <sys/un.h>
20#include <arpa/inet.h>
21#include <errno.h>
22
23#include "evas_common.h"
24#include "evas_private.h"
25
26#ifdef EAPI
27# undef EAPI
28#endif
29
30#ifdef _WIN32
31# ifdef EFL_EVAS_BUILD
32# ifdef DLL_EXPORT
33# define EAPI __declspec(dllexport)
34# else
35# define EAPI
36# endif /* ! DLL_EXPORT */
37# else
38# define EAPI __declspec(dllimport)
39# endif /* ! EFL_EVAS_BUILD */
40#else
41# ifdef __GNUC__
42# if __GNUC__ >= 4
43# define EAPI __attribute__ ((visibility("default")))
44# else
45# define EAPI
46# endif
47# else
48# define EAPI
49# endif
50#endif /* ! _WIN32 */
51
52#define LENGTH_OF_SOCKADDR_UN(s) (strlen((s)->sun_path) + (size_t)(((struct sockaddr_un *)NULL)->sun_path))
53
54typedef struct _Server Server;
55typedef struct _Client Client;
56typedef struct _Mem Mem;
57
58struct _Server
59{
60 char *socket_path;
61 Eina_List *clients;
62 int (*func) (void *fdata, Server *s, Client *c, int opcode, int size, unsigned char *data);
63 void *data;
64 pid_t pid;
65 int server_id;
66 // for channel 2;
67 struct {
68 int fd;
69 int req_from, req_to;
70 } ch[2];
71 void *main_handle;
72};
73
74struct _Client
75{
76 Server *server;
77 unsigned char *buf;
78 Client *client_main;
79 int bufsize, bufalloc;
80 int fd;
81 unsigned char *inbuf;
82 int inbufsize, inbufalloc;
83 unsigned char dead : 1;
84 void (*func) (void *fdata, Client *c);
85 void *data;
86 pid_t pid;
87 int req_from, req_to;
88 LK(lock);
89};
90
91struct _Mem
92{
93 unsigned char *data;
94 char *name;
95 int fd;
96 int id;
97 int offset;
98 int size;
99 int ref;
100 Eina_Bool write : 1;
101};
102
103//// for comms
104enum
105{
106 OP_NOP, // 0
107
108 OP_INIT, // 1
109 OP_LOAD, // 2
110 OP_UNLOAD, // 3
111 OP_LOADDATA, // 4
112 OP_UNLOADDATA, // 5
113 OP_USELESSDATA, // 6
114 OP_PRELOAD, // 7
115 OP_FORCEDUNLOAD, // 8
116
117 OP_GETCONFIG, // 9
118 OP_SETCONFIG, // 10
119 OP_GETSTATS, // 11
120 OP_GETINFO, // 12
121
122 OP_INVALID // 13
123};
124
125typedef struct
126{
127 pid_t pid;
128 int server_id;
129 void *handle;
130} Op_Init;
131typedef struct
132{
133 struct {
134 int scale_down_by;
135 double dpi;
136 int w, h;
137 struct {
138 int x, y, w, h;
139 } region;
140 Eina_Bool orientation;
141 } lopt;
142} Op_Load; // +"file""key"
143typedef struct
144{
145 void *handle;
146 int server_id;
147 struct {
148 int id;
149 int offset;
150 int size;
151 } mem;
152 struct {
153 int w, h;
154 Eina_Bool alpha : 1;
155 } image;
156} Op_Load_Reply;
157typedef struct
158{
159 void *handle;
160 int server_id;
161} Op_Unload;
162typedef struct
163{
164 void *handle;
165 int server_id;
166} Op_Unloaddata;
167typedef struct
168{
169 void *handle;
170 int server_id;
171} Op_Loaddata;
172typedef struct
173{
174 struct {
175 int id;
176 int offset;
177 int size;
178 } mem;
179} Op_Loaddata_Reply;
180typedef struct
181{
182 void *handle;
183 int server_id;
184} Op_Preload;
185typedef struct
186{
187 void *handle;
188 struct {
189 int id;
190 int offset;
191 int size;
192 } mem;
193} Op_Preload_Reply;
194typedef struct
195{
196 void *handle;
197 int server_id;
198} Op_Forcedunload;
199typedef struct
200{
201 int cache_max_usage;
202 int cache_item_timeout;
203 int cache_item_timeout_check;
204} Op_Getconfig_Reply;
205typedef struct
206{
207 int cache_max_usage;
208 int cache_item_timeout;
209 int cache_item_timeout_check;
210} Op_Setconfig;
211typedef struct
212{
213 int saved_memory;
214 int wasted_memory;
215 int saved_memory_peak;
216 int wasted_memory_peak;
217 double saved_time_image_header_load;
218 double saved_time_image_data_load;
219} Op_Getstats_Reply;
220typedef struct
221{
222 struct {
223 int mem_total;
224 int count;
225 } active, cached;
226} Op_Getinfo_Reply; // + N active Info Items + N cached items
227typedef struct
228{
229 int file_key_size;
230 int w, h;
231 time_t file_mod_time;
232 time_t file_checked_time;
233 time_t cached_time;
234 int refcount;
235 int data_refcount;
236 int memory_footprint;
237 double head_load_time;
238 double data_load_time;
239 Eina_Bool alpha : 1;
240 Eina_Bool data_loaded : 1;
241 Eina_Bool active : 1;
242 Eina_Bool dead : 1;
243 Eina_Bool useless : 1;
244} Op_Getinfo_Item; // + "file""key"
245
246
247// for clients to connect to cserve
248EAPI Eina_Bool evas_cserve_init(void);
249EAPI int evas_cserve_use_get(void);
250EAPI Eina_Bool evas_cserve_have_get(void);
251EAPI void evas_cserve_shutdown(void);
252EAPI void evas_cserve_discon(void);
253EAPI Eina_Bool evas_cserve_image_load(Image_Entry *ie, const char *file, const char *key, RGBA_Image_Loadopts *lopt);
254EAPI Eina_Bool evas_cserve_image_data_load(Image_Entry *ie);
255EAPI void evas_cserve_image_unload(Image_Entry *ie);
256EAPI void evas_cserve_image_useless(Image_Entry *ie);
257EAPI void evas_cserve_image_free(Image_Entry *ie);
258EAPI Eina_Bool evas_cserve_raw_config_get(Op_Getconfig_Reply *config);
259EAPI Eina_Bool evas_cserve_raw_config_set(Op_Setconfig *config);
260EAPI Eina_Bool evas_cserve_raw_stats_get(Op_Getstats_Reply *stats);
261EAPI Op_Getinfo_Reply *evas_cserve_raw_info_get(void);
262
263// for the server
264EAPI Server *evas_cserve_server_add(void);
265EAPI void evas_cserve_server_del(Server *s);
266EAPI void evas_cserve_client_send(Client *c, int opcode, int size, unsigned char *data);
267EAPI void evas_cserve_server_message_handler_set(Server *s, int (*func) (void *fdata, Server *s, Client *c, int opcode, int size, unsigned char *data), void *data);
268EAPI void evas_cserve_server_wait(Server *s, int timeout);
269
270//// for memory
271// for server
272EAPI Mem *evas_cserve_mem_new(int size, const char *name);
273EAPI void evas_cserve_mem_free(Mem *m);
274
275// for client
276EAPI Mem *evas_cserve_mem_open(int pid, int id, const char *name, int size, int do_write);
277EAPI void evas_cserve_mem_close(Mem *m);
278
279// for both
280EAPI Eina_Bool evas_cserve_mem_resize(Mem *m, int size);
281EAPI void evas_cserve_mem_del(int pid, int id);
282
283#endif
284
285#endif
diff --git a/libraries/evas/src/lib/cserve/evas_cs_client.c b/libraries/evas/src/lib/cserve/evas_cs_client.c
new file mode 100644
index 0000000..b24848d
--- /dev/null
+++ b/libraries/evas/src/lib/cserve/evas_cs_client.c
@@ -0,0 +1,528 @@
1#ifdef HAVE_CONFIG_H
2# include "config.h"
3#endif
4
5#include <signal.h>
6
7#include "evas_cs.h"
8
9#ifdef EVAS_CSERVE
10
11static Server *cserve = NULL;
12static int csrve_init = 0;
13static int connect_num = 0;
14static int cserve_discon = 0;
15
16static void
17pipe_handler(int x __UNUSED__, siginfo_t *info __UNUSED__, void *data __UNUSED__)
18{
19}
20
21static void
22pipe_handle(int push)
23{
24 static struct sigaction old_action;
25 struct sigaction action;
26
27 if (push)
28 {
29 action.sa_handler = NULL;
30 action.sa_sigaction = pipe_handler;
31 action.sa_flags = SA_RESTART | SA_SIGINFO;
32 sigemptyset(&action.sa_mask);
33 sigaction(SIGPIPE, &action, &old_action);
34 }
35 else
36 {
37 sigaction(SIGPIPE, &old_action, &action);
38 }
39}
40
41static Server *
42server_connect(void)
43{
44 Server *s;
45 char buf[PATH_MAX];
46 int curstate = 0;
47 struct sockaddr_un socket_unix;
48 int socket_unix_len;
49
50 s = calloc(1, sizeof(Server));
51 if (!s) return NULL;
52 s->ch[0].fd = -1;
53 s->ch[1].fd = -1;
54 snprintf(buf, sizeof(buf), "/tmp/.evas-cserve-%x", getuid());
55 s->socket_path = strdup(buf);
56 if (!s->socket_path)
57 {
58 free(s);
59 return NULL;
60 }
61 s->ch[0].fd = socket(AF_UNIX, SOCK_STREAM, 0);
62 if (s->ch[0].fd < 0) goto error;
63 if (fcntl(s->ch[0].fd, F_SETFD, FD_CLOEXEC) < 0) goto error;
64 if (setsockopt(s->ch[0].fd, SOL_SOCKET, SO_REUSEADDR, &curstate, sizeof(curstate)) < 0)
65 goto error;
66 socket_unix.sun_family = AF_UNIX;
67 strncpy(socket_unix.sun_path, buf, sizeof(socket_unix.sun_path));
68 socket_unix_len = LENGTH_OF_SOCKADDR_UN(&socket_unix);
69 if (connect(s->ch[0].fd, (struct sockaddr *)&socket_unix, socket_unix_len) < 0) goto error;
70
71 s->ch[1].fd = socket(AF_UNIX, SOCK_STREAM, 0);
72 if (s->ch[1].fd < 0) goto error;
73 if (fcntl(s->ch[1].fd, F_SETFD, FD_CLOEXEC) < 0) goto error;
74 if (setsockopt(s->ch[1].fd, SOL_SOCKET, SO_REUSEADDR, &curstate, sizeof(curstate)) < 0)
75 goto error;
76 socket_unix.sun_family = AF_UNIX;
77 strncpy(socket_unix.sun_path, buf, sizeof(socket_unix.sun_path));
78 socket_unix_len = LENGTH_OF_SOCKADDR_UN(&socket_unix);
79 if (connect(s->ch[1].fd, (struct sockaddr *)&socket_unix, socket_unix_len) < 0) goto error;
80
81 return s;
82 error:
83 if (s->ch[0].fd >= 0) close(s->ch[0].fd);
84 if (s->ch[1].fd >= 0) close(s->ch[1].fd);
85 free(s->socket_path);
86 free(s);
87 return NULL;
88}
89
90static void
91server_disconnect(Server *s)
92{
93 close(s->ch[0].fd);
94 close(s->ch[1].fd);
95 free(s->socket_path);
96 free(s);
97}
98
99static int
100server_send(Server *s, int channel, int opcode, int size, unsigned char *data)
101{
102 int ints[3];
103 int num;
104
105 pipe_handle(1);
106 ints[0] = size;
107 ints[1] = opcode;
108 s->ch[channel].req_to++;
109 ints[2] = s->ch[channel].req_to;
110 num = write(s->ch[channel].fd, ints, (sizeof(int) * 3));
111 if (num < 0)
112 {
113 pipe_handle(0);
114 if (cserve) server_disconnect(cserve);
115 cserve = NULL;
116 return 0;
117 }
118 num = write(s->ch[channel].fd, data, size);
119 if (num < 0)
120 {
121 pipe_handle(0);
122 if (cserve) server_disconnect(cserve);
123 cserve = NULL;
124 return 0;
125 }
126 pipe_handle(0);
127 return 1;
128}
129
130static unsigned char *
131server_read(Server *s, int channel, int *opcode, int *size)
132{
133 int ints[3], num, left;
134 unsigned char *data;
135
136 num = read(s->ch[channel].fd, ints, sizeof(int) * 3);
137 if (num != (sizeof(int) * 3))
138 {
139 if (cserve) server_disconnect(cserve);
140 cserve = NULL;
141 return NULL;
142 }
143 *size = ints[0];
144 *opcode = ints[1];
145 if ((*size < 0) || (*size > (1024 * 1024))) return NULL;
146 if (ints[2] != (s->ch[channel].req_from + 1))
147 {
148 ERR("EEK! sequence number mismatch from serer with pid: %i. "
149 "---- num %i is not 1 more than %i"
150 ,
151 s->pid, ints[2], s->ch[channel].req_from);
152 return NULL;
153 }
154 s->ch[channel].req_from++;
155 data = malloc(*size);
156 if (!data) return NULL;
157 num = read(s->ch[channel].fd, data, *size);
158 if (num < 0)
159 {
160 free(data);
161 return NULL;
162 }
163 left = *size - num;
164 while (left > 0)
165 {
166 num = read(s->ch[channel].fd, data + (*size - left), left);
167 if (num < 0)
168 {
169 free(data);
170 return NULL;
171 }
172 left -= num;
173 }
174 return data;
175}
176
177static int
178server_init(Server *s)
179{
180 Op_Init msg, *rep;
181 int opcode;
182 int size;
183
184 msg.pid = getpid();
185 msg.server_id = 0;
186 msg.handle = NULL;
187 if (!server_send(s, 0, OP_INIT, sizeof(msg), (unsigned char *)(&msg)))
188 return 0;
189 rep = (Op_Init *)server_read(s, 0, &opcode, &size);
190 if ((rep) && (opcode == OP_INIT) && (size == sizeof(Op_Init)))
191 {
192 s->pid = rep->pid;
193 s->server_id = rep->server_id;
194 s->main_handle = rep->handle;
195 connect_num++;
196 msg.pid = getpid();
197 msg.server_id = 1;
198 msg.handle = rep->handle;
199 free(rep);
200 if (!server_send(s, 1, OP_INIT, sizeof(msg), (unsigned char *)(&msg)))
201 return 0;
202 rep = (Op_Init *)server_read(s, 1, &opcode, &size);
203 if ((rep) && (opcode == OP_INIT) && (size == sizeof(Op_Init)))
204 {
205 free(rep);
206 return 1;
207 }
208 if (rep) free(rep);
209 return 0;
210 }
211 if (rep) free(rep);
212 return 0;
213}
214
215EAPI Eina_Bool
216evas_cserve_init(void)
217{
218 csrve_init++;
219 if (cserve) return 1;
220 cserve = server_connect();
221 if (!cserve) return 0;
222 if (!server_init(cserve))
223 {
224 if (cserve) server_disconnect(cserve);
225 cserve = NULL;
226 return 0;
227 }
228 return 1;
229}
230
231EAPI int
232evas_cserve_use_get(void)
233{
234 return csrve_init;
235}
236
237EAPI Eina_Bool
238evas_cserve_have_get(void)
239{
240 if (cserve) return 1;
241 return 0;
242}
243
244EAPI void
245evas_cserve_shutdown(void)
246{
247 csrve_init--;
248 if (csrve_init > 0) return;
249 if (!cserve) return;
250 server_disconnect(cserve);
251 cserve = NULL;
252}
253
254EAPI void
255evas_cserve_discon(void)
256{
257 if (cserve)
258 {
259 server_disconnect(cserve);
260 cserve = NULL;
261 cserve_discon = 1;
262 }
263}
264
265static void
266server_reinit(void)
267{
268 if (cserve) return;
269 if (cserve_discon) return;
270 cserve = server_connect();
271 if (cserve)
272 {
273 if (!server_init(cserve))
274 {
275 if (cserve) server_disconnect(cserve);
276 cserve = NULL;
277 }
278 }
279}
280
281EAPI Eina_Bool
282evas_cserve_image_load(Image_Entry *ie, const char *file, const char *key, RGBA_Image_Loadopts *lopt)
283{
284 Op_Load msg;
285 Op_Load_Reply *rep;
286 unsigned char *buf;
287 char fbuf[PATH_MAX], wdb[PATH_MAX];
288 int flen, klen;
289 int opcode;
290 int size;
291
292 if (csrve_init > 0) server_reinit();
293 else return 0;
294 if (!cserve) return 0;
295 if (!key) key = "";
296 memset(&msg, 0, sizeof(msg));
297 msg.lopt.scale_down_by = lopt->scale_down_by;
298 msg.lopt.dpi = lopt->dpi;
299 msg.lopt.w = lopt->w;
300 msg.lopt.h = lopt->h;
301 msg.lopt.region.x = lopt->region.x;
302 msg.lopt.region.y = lopt->region.y;
303 msg.lopt.region.w = lopt->region.w;
304 msg.lopt.region.h = lopt->region.h;
305 msg.lopt.orientation = lopt->orientation;
306 if (file[0] != '/')
307 {
308 if (getcwd(wdb, sizeof(wdb)))
309 {
310 snprintf(fbuf, sizeof(buf), "%s/%s", wdb, file);
311 file = fbuf;
312 }
313 }
314 if (!realpath(file, wdb)) file = wdb;
315 flen = strlen(file) + 1;
316 klen = strlen(key) + 1;
317 buf = malloc(sizeof(msg) + flen + klen);
318 if (!buf) return 0;
319 memcpy(buf, &msg, sizeof(msg));
320 memcpy(buf + sizeof(msg), file, flen);
321 memcpy(buf + sizeof(msg) + flen, key, klen);
322 if (!server_send(cserve, ie->channel, OP_LOAD,
323 sizeof(msg) + flen + klen,
324 buf))
325 {
326 free(buf);
327 return 0;
328 }
329 free(buf);
330 if (!cserve) return 0;
331 rep = (Op_Load_Reply *)server_read(cserve, ie->channel, &opcode, &size);
332 if ((rep) && (opcode == OP_LOAD) && (size == sizeof(Op_Load_Reply)))
333 {
334 ie->w = rep->image.w;
335 ie->h = rep->image.h;
336 ie->flags.alpha = rep->image.alpha;
337 ie->data1 = rep->handle;
338 }
339 if (rep) free(rep);
340 if (!ie->data1) return 0;
341 ie->connect_num = connect_num;
342 if (cserve)
343 ie->server_id = cserve->server_id;
344 return 1;
345}
346
347EAPI Eina_Bool
348evas_cserve_image_data_load(Image_Entry *ie)
349{
350 Op_Loaddata msg;
351 Op_Loaddata_Reply *rep;
352 int opcode;
353 int size;
354 if (csrve_init > 0) server_reinit();
355 else return 0;
356 if (!cserve) return 0;
357 if (!ie->data1) return 0;
358 if (cserve->server_id != ie->server_id)
359 {
360 ie->data1 = NULL;
361 if (!evas_cserve_image_load(ie, ie->file, ie->key, &(ie->load_opts)))
362 return 0;
363 }
364 if (ie->connect_num != connect_num) return 0;
365 memset(&msg, 0, sizeof(msg));
366 msg.handle = ie->data1;
367 msg.server_id = cserve->server_id;
368 if (!server_send(cserve, ie->channel, OP_LOADDATA, sizeof(msg), (unsigned char *)(&msg)))
369 return 0;
370 if (!cserve) return 0;
371 rep = (Op_Loaddata_Reply *)server_read(cserve, ie->channel, &opcode, &size);
372 if ((rep) && (opcode == OP_LOADDATA) && (size == sizeof(Op_Loaddata_Reply)))
373 {
374 if (rep->mem.size <= 0)
375 {
376 free(rep);
377 return 0;
378 }
379 ie->data2 = evas_cserve_mem_open(cserve->pid, rep->mem.id, NULL, rep->mem.size, 0);
380 free(rep);
381 return 1;
382 }
383 if (rep) free(rep);
384 return 0;
385}
386
387EAPI void
388evas_cserve_image_free(Image_Entry *ie)
389{
390 Op_Unload msg;
391
392 if (csrve_init > 0) server_reinit();
393 else return;
394 if (!cserve) return;
395 if (!ie->data1) return;
396 memset(&msg, 0, sizeof(msg));
397 msg.handle = ie->data1;
398 msg.server_id = cserve->server_id;
399 if (ie->data2) evas_cserve_image_unload(ie);
400 if (cserve)
401 {
402 if (ie->connect_num == connect_num)
403 {
404 if (ie->server_id == cserve->server_id)
405 server_send(cserve, ie->channel, OP_UNLOAD, sizeof(msg), (unsigned char *)(&msg));
406 }
407 }
408 ie->data1 = NULL;
409 ie->data2 = NULL;
410}
411
412EAPI void
413evas_cserve_image_unload(Image_Entry *ie)
414{
415 Op_Unloaddata msg;
416
417 if (csrve_init > 0) server_reinit();
418 else return;
419 if (!cserve) return;
420 if (!ie->data1) return;
421 if (ie->connect_num != connect_num) return;
422 memset(&msg, 0, sizeof(msg));
423 msg.handle = ie->data1;
424 msg.server_id = cserve->server_id;
425 if (ie->data2) evas_cserve_mem_close(ie->data2);
426 ie->data2 = NULL;
427 if (ie->connect_num == connect_num)
428 {
429 if (ie->server_id == cserve->server_id)
430 server_send(cserve, ie->channel, OP_UNLOADDATA, sizeof(msg), (unsigned char *)(&msg));
431 }
432}
433
434EAPI void
435evas_cserve_image_useless(Image_Entry *ie)
436{
437 Op_Unloaddata msg;
438
439 if (csrve_init > 0) server_reinit();
440 else return;
441 if (!cserve) return;
442 if (!ie->data1) return;
443 if (ie->connect_num != connect_num) return;
444 memset(&msg, 0, sizeof(msg));
445 msg.handle = ie->data1;
446 msg.server_id = cserve->server_id;
447 if (ie->data2) evas_cserve_mem_close(ie->data2);
448 ie->data2 = NULL;
449 if (ie->connect_num == connect_num)
450 {
451 if (ie->server_id == cserve->server_id)
452 server_send(cserve, ie->channel, OP_USELESSDATA, sizeof(msg), (unsigned char *)(&msg));
453 }
454}
455
456EAPI Eina_Bool
457evas_cserve_raw_config_get(Op_Getconfig_Reply *config)
458{
459 Op_Getconfig_Reply *rep;
460 int opcode;
461 int size;
462 if (csrve_init > 0) server_reinit();
463 else return 0;
464 if (!cserve) return 0;
465 if (!server_send(cserve, 0, OP_GETCONFIG, 0, NULL)) return 0;
466 rep = (Op_Getconfig_Reply *)server_read(cserve, 0, &opcode, &size);
467 if ((rep) && (opcode == OP_GETCONFIG) && (size == sizeof(Op_Getconfig_Reply)))
468 {
469 memcpy(config, rep, sizeof(Op_Getconfig_Reply));
470 free(rep);
471 return 1;
472 }
473 if (rep) free(rep);
474 return 0;
475}
476
477EAPI Eina_Bool
478evas_cserve_raw_config_set(Op_Setconfig *config)
479{
480 if (csrve_init > 0) server_reinit();
481 else return 0;
482 if (!cserve) return 0;
483 if (!server_send(cserve, 0, OP_SETCONFIG, sizeof(Op_Setconfig), (unsigned char *)config)) return 0;
484 return 1;
485}
486
487EAPI Eina_Bool
488evas_cserve_raw_stats_get(Op_Getstats_Reply *stats)
489{
490 Op_Getstats_Reply *rep;
491 int opcode;
492 int size;
493 if (csrve_init > 0) server_reinit();
494 else return 0;
495 if (!cserve) return 0;
496 if (!server_send(cserve, 0, OP_GETSTATS, 0, NULL)) return 0;
497 rep = (Op_Getstats_Reply *)server_read(cserve, 0, &opcode, &size);
498 if ((rep) && (opcode == OP_GETSTATS) && (size == sizeof(Op_Getstats_Reply)))
499 {
500 memcpy(stats, rep, sizeof(Op_Getstats_Reply));
501 free(rep);
502 return 1;
503 }
504 if (rep) free(rep);
505 return 0;
506}
507
508EAPI Op_Getinfo_Reply *
509evas_cserve_raw_info_get(void)
510{
511 Op_Getinfo_Reply *rep;
512 int opcode;
513 int size;
514 if (csrve_init > 0) server_reinit();
515 else return NULL;
516 if (!cserve) return NULL;
517 if (!server_send(cserve, 0, OP_GETINFO, 0, NULL)) return NULL;
518 rep = (Op_Getinfo_Reply *)server_read(cserve, 0, &opcode, &size);
519 if ((rep) && (opcode == OP_GETINFO) &&
520 (size >= (int)sizeof(Op_Getinfo_Reply)))
521 {
522 return rep;
523 }
524 if (rep) free(rep);
525 return NULL;
526}
527
528#endif
diff --git a/libraries/evas/src/lib/cserve/evas_cs_main.c b/libraries/evas/src/lib/cserve/evas_cs_main.c
new file mode 100644
index 0000000..e8282aa
--- /dev/null
+++ b/libraries/evas/src/lib/cserve/evas_cs_main.c
@@ -0,0 +1,9 @@
1#ifdef HAVE_CONFIG_H
2# include "config.h"
3#endif
4
5#include "evas_cs.h"
6
7#ifdef EVAS_CSERVE
8
9#endif
diff --git a/libraries/evas/src/lib/cserve/evas_cs_mem.c b/libraries/evas/src/lib/cserve/evas_cs_mem.c
new file mode 100644
index 0000000..15edf93
--- /dev/null
+++ b/libraries/evas/src/lib/cserve/evas_cs_mem.c
@@ -0,0 +1,168 @@
1#ifdef HAVE_CONFIG_H
2# include "config.h"
3#endif
4
5#include "evas_cs.h"
6
7#ifdef EVAS_CSERVE
8
9EAPI Mem *
10evas_cserve_mem_new(int size, const char *name)
11{
12 Mem *m;
13 static int id = 0;
14 char buf[PATH_MAX];
15
16 m = calloc(1, sizeof(Mem));
17 if (!m) return NULL;
18 if (name)
19 snprintf(buf, sizeof(buf), "/evas-shm-%x.%s", getuid(), name);
20 else
21 {
22 id++;
23 snprintf(buf, sizeof(buf), "/evas-shm-%x.%x.%x", getuid(), getpid(), id);
24 }
25 m->id = id;
26 m->offset = 0;
27 m->name = strdup(buf);
28 if (!m->name)
29 {
30 free(m);
31 return NULL;
32 }
33 m->size = size;
34 m->fd = shm_open(m->name, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
35 if (m->fd < 0)
36 {
37 free(m->name);
38 free(m);
39 return NULL;
40 }
41 if (ftruncate(m->fd, m->size) < 0)
42 {
43 shm_unlink(m->name);
44 close(m->fd);
45 free(m->name);
46 free(m);
47 return NULL;
48 }
49
50 eina_mmap_safety_enabled_set(EINA_TRUE);
51
52 m->data = mmap(NULL, m->size, PROT_READ | PROT_WRITE, MAP_SHARED, m->fd, 0);
53 if (m->data == MAP_FAILED)
54 {
55 shm_unlink(m->name);
56 close(m->fd);
57 free(m->name);
58 free(m);
59 return NULL;
60 }
61 m->ref = 1;
62 m->write = 1;
63 return m;
64}
65
66EAPI void
67evas_cserve_mem_free(Mem *m)
68{
69 shm_unlink(m->name);
70 munmap(m->data, m->size);
71 close(m->fd);
72 free(m->name);
73 free(m);
74}
75
76EAPI Mem *
77evas_cserve_mem_open(int pid, int id, const char *name, int size, int do_write)
78{
79 Mem *m;
80 char buf[PATH_MAX];
81
82 m = calloc(1, sizeof(Mem));
83 if (!m) return NULL;
84 if (name)
85 snprintf(buf, sizeof(buf), "/evas-shm-%x.%s", getuid(), name);
86 else
87 snprintf(buf, sizeof(buf), "/evas-shm-%x.%x.%x", getuid(), pid, id);
88 m->name = strdup(buf);
89 if (!m->name)
90 {
91 free(m);
92 return NULL;
93 }
94 m->size = size;
95 if (do_write)
96 m->fd = shm_open(m->name, O_RDWR, S_IRUSR | S_IWUSR);
97 else
98 m->fd = shm_open(m->name, O_RDONLY, S_IRUSR);
99 if (m->fd < 0)
100 {
101 free(m->name);
102 free(m);
103 return NULL;
104 }
105 m->write = do_write;
106
107 eina_mmap_safety_enabled_set(EINA_TRUE);
108
109 if (do_write)
110 m->data = mmap(NULL, m->size, PROT_READ | PROT_WRITE, MAP_SHARED, m->fd, 0);
111 else
112 m->data = mmap(NULL, m->size, PROT_READ, MAP_SHARED, m->fd, 0);
113 if (m->data == MAP_FAILED)
114 {
115 close(m->fd);
116 free(m->name);
117 free(m);
118 return NULL;
119 }
120 m->ref = 1;
121 return m;
122}
123
124EAPI void
125evas_cserve_mem_close(Mem *m)
126{
127 munmap(m->data, m->size);
128 close(m->fd);
129 free(m->name);
130 free(m);
131}
132
133EAPI Eina_Bool
134evas_cserve_mem_resize(Mem *m, int size)
135{
136 if (m->size == size) return 1;
137 if (m->write)
138 {
139 if (ftruncate(m->fd, size) < 0) return 0;
140 munmap(m->data, m->size);
141 eina_mmap_safety_enabled_set(EINA_TRUE);
142 m->data = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, m->fd, 0);
143 }
144 else
145 {
146 munmap(m->data, m->size);
147 eina_mmap_safety_enabled_set(EINA_TRUE);
148 m->data = mmap(NULL, size, PROT_READ, MAP_SHARED, m->fd, 0);
149 }
150 if (m->data == MAP_FAILED)
151 {
152 m->data = NULL;
153 return 0;
154 }
155 m->size = size;
156 return 1;
157}
158
159EAPI void
160evas_cserve_mem_del(int pid, int id)
161{
162 char buf[PATH_MAX];
163
164 snprintf(buf, sizeof(buf), "/evas-shm-%x.%x.%x", getuid(), pid, id);
165 shm_unlink(buf);
166}
167
168#endif
diff --git a/libraries/evas/src/lib/cserve/evas_cs_server.c b/libraries/evas/src/lib/cserve/evas_cs_server.c
new file mode 100644
index 0000000..3b5d8b9
--- /dev/null
+++ b/libraries/evas/src/lib/cserve/evas_cs_server.c
@@ -0,0 +1,380 @@
1#ifdef HAVE_CONFIG_H
2# include "config.h"
3#endif
4
5#include "evas_cs.h"
6
7#ifdef EVAS_CSERVE
8
9EAPI Server *
10evas_cserve_server_add(void)
11{
12 Server *s;
13 char buf[PATH_MAX];
14 struct sockaddr_un socket_unix;
15 struct linger lin;
16 mode_t pmode;
17 int socket_unix_len;
18
19 s = calloc(1, sizeof(Server));
20 if (!s) return NULL;
21 s->ch[0].fd = -1;
22 snprintf(buf, sizeof(buf), "/tmp/.evas-cserve-%x", getuid());
23 s->socket_path = strdup(buf);
24 if (!s->socket_path)
25 {
26 free(s);
27 return NULL;
28 }
29 pmode = umask(~(S_IRUSR | S_IWUSR));
30 start:
31 s->ch[0].fd = socket(AF_UNIX, SOCK_STREAM, 0);
32 if (s->ch[0].fd < 0) goto error;
33 if (fcntl(s->ch[0].fd, F_SETFL, O_NONBLOCK) < 0) goto error;
34 if (fcntl(s->ch[0].fd, F_SETFD, FD_CLOEXEC) < 0) goto error;
35 lin.l_onoff = 1;
36 lin.l_linger = 0;
37 if (setsockopt(s->ch[0].fd, SOL_SOCKET, SO_LINGER, &lin, sizeof(struct linger)) < 0)
38 goto error;
39 socket_unix.sun_family = AF_UNIX;
40 strncpy(socket_unix.sun_path, buf, sizeof(socket_unix.sun_path));
41 socket_unix_len = LENGTH_OF_SOCKADDR_UN(&socket_unix);
42 if (bind(s->ch[0].fd, (struct sockaddr *)&socket_unix, socket_unix_len) < 0)
43 {
44 if ((connect(s->ch[0].fd, (struct sockaddr *)&socket_unix, socket_unix_len) < 0) &&
45 (unlink(s->socket_path) >= 0))
46 {
47 close(s->ch[0].fd);
48 goto start;
49 }
50 else
51 goto error;
52 }
53 if (listen(s->ch[0].fd, 4096) < 0) goto error;
54 umask(pmode);
55 return s;
56 error:
57 umask(pmode);
58 if (s->ch[0].fd >= 0) close(s->ch[0].fd);
59 free(s->socket_path);
60 free(s);
61 return NULL;
62}
63
64EAPI void
65evas_cserve_server_del(Server *s)
66{
67 Client *c;
68
69 EINA_LIST_FREE(s->clients, c)
70 {
71 LKL(c->lock);
72 close(c->fd);
73 if (c->buf) free(c->buf);
74 if (c->inbuf) free(c->inbuf);
75 LKD(c->lock);
76 free(c);
77 }
78 close(s->ch[0].fd);
79 unlink(s->socket_path);
80 free(s->socket_path);
81 free(s);
82}
83
84static void
85server_accept(Server *s)
86{
87 Client *c;
88 int new_fd;
89 struct sockaddr_in incoming;
90 size_t size_in;
91
92 size_in = sizeof(struct sockaddr_in);
93 new_fd = accept(s->ch[0].fd, (struct sockaddr *)&incoming, (socklen_t *)&size_in);
94 if (new_fd < 0) return;
95 fcntl(new_fd, F_SETFL, O_NONBLOCK);
96 fcntl(new_fd, F_SETFD, FD_CLOEXEC);
97 c = calloc(1, sizeof(Client));
98 if (!c)
99 {
100 close(new_fd);
101 return;
102 }
103 c->server = s;
104 c->fd = new_fd;
105 LKI(c->lock);
106 s->clients = eina_list_append(s->clients, c);
107}
108
109static void
110client_flush(Client *c)
111{
112 int num;
113
114 num = write(c->fd, c->buf, c->bufsize);
115 if (num < 0)
116 {
117 c->dead = 1;
118 return;
119 }
120 if (num < c->bufsize)
121 {
122 unsigned char *buf;
123
124 buf = malloc(c->bufsize - num);
125 if (buf)
126 {
127 memcpy(buf, c->buf + num, c->bufsize - num);
128 free(c->buf);
129 c->bufsize = c->bufsize - num;
130 c->bufalloc = c->bufsize;
131 c->buf = buf;
132 }
133 }
134 else
135 {
136 free(c->buf);
137 c->buf = NULL;
138 c->bufsize = 0;
139 c->bufalloc = 0;
140 }
141}
142
143static void
144client_buf_add(Client *c, unsigned char *data, int size)
145{
146 int newsize;
147 unsigned char *buf;
148
149 newsize = c->bufsize + size;
150 if (newsize > c->bufalloc)
151 {
152 c->bufalloc = newsize + 16384;
153 buf = realloc(c->buf, c->bufalloc);
154 if (buf) c->buf = buf;
155 else return;
156 }
157 memcpy(c->buf + c->bufsize, data, size);
158 c->bufsize += size;
159}
160
161static void
162client_write(Client *c, unsigned char *data, int size)
163{
164 int num;
165
166 if (!c->buf)
167 {
168 num = write(c->fd, data, size);
169 if (num != size)
170 client_buf_add(c, data + num, size - num);
171 }
172 else
173 {
174 client_buf_add(c, data, size);
175 }
176}
177
178EAPI void
179evas_cserve_client_send(Client *c, int opcode, int size, unsigned char *data)
180{
181 unsigned char *data2;
182 int *ints;
183
184 data2 = malloc(size + (sizeof(int) * 3));
185 if (!data2) return;
186 ints = (int *)data2;
187 ints[0] = size;
188 ints[1] = opcode;
189// LKL(c->lock);
190 c->req_to++;
191 ints[2] = c->req_to;
192 memcpy(data2 + (sizeof(int) * 3), data, size);
193 client_write(c, data2, size + (sizeof(int) * 3));
194// LKU(c->lock);
195 free(data2);
196}
197
198static void
199server_message_handle(Server *s, Client *c, int opcode, int size, unsigned char *data)
200{
201 if (s->func) s->func(s->data, s, c, opcode, size, data);
202}
203
204EAPI void
205evas_cserve_server_message_handler_set(Server *s, int (*func) (void *fdata, Server *s, Client *c, int opcode, int size, unsigned char *data), void *data)
206{
207 s->func = func;
208 s->data = data;
209}
210
211static int
212server_parse(Server *s, Client *c)
213{
214 int *ints;
215 unsigned char *data, *newbuf;
216
217 if (c->inbufsize < (int)sizeof(int)) return 0;
218 ints = (int *)((c->inbuf));
219 if ((ints[0] < 0) || (ints[0] > (1024 * 1024)))
220 return 0;
221 if (c->inbufsize < (ints[0] + ((int)sizeof(int) * 3)))
222 {
223 return 0;
224 }
225 data = c->inbuf + (sizeof(int) * 3);
226 if (ints[2] != (c->req_from + 1))
227 {
228 ERR("EEK! sequence number mismatch from client with pid: %i."
229 "---- num %i is not 1 more than %i"
230 ,
231 c->pid, ints[2], c->req_from);
232 return 0;
233 }
234 c->req_from++;
235 server_message_handle(s, c, ints[1], ints[0], data);
236 c->inbufalloc -= ints[0] + (sizeof(int) * 3);
237 if (c->inbufalloc == 0)
238 {
239 free(c->inbuf);
240 c->inbuf = NULL;
241 c->inbufsize = 0;
242 return 0;
243 }
244 newbuf = malloc(c->inbufalloc);
245 if (!newbuf)
246 {
247 c->inbufalloc += ints[0] + (sizeof(int) * 3);
248 /* fixme - bad situation */
249 return 0;
250 }
251 memcpy(newbuf, c->inbuf + ints[0] + (sizeof(int) * 3), c->inbufalloc);
252 c->inbufsize -= ints[0] + (sizeof(int) * 3);
253 free(c->inbuf);
254 c->inbuf = newbuf;
255 return 1;
256}
257
258static void
259server_data(Server *s, Client *c, unsigned char *data, int size)
260{
261 if (!c->inbuf)
262 {
263 c->inbuf = malloc(size);
264 if (c->inbuf)
265 {
266 memcpy(c->inbuf, data, size);
267 c->inbufalloc = size;
268 c->inbufsize = size;
269 }
270 else
271 {
272 /* fixme - bad situation */
273 return;
274 }
275 }
276 else
277 {
278 int size2;
279
280 size2 = c->inbufsize + size;
281 if (size2 > c->inbufalloc)
282 {
283 unsigned char *newbuf;
284
285 c->inbufalloc = size2;
286 newbuf = realloc(c->inbuf, c->inbufalloc);
287 if (newbuf) c->inbuf = newbuf;
288 else size2 = 0;
289 }
290 if (size2 > 0)
291 {
292 memcpy(c->inbuf + c->inbufsize, data, size);
293 c->inbufsize = size2;
294 }
295 else
296 {
297 /* fixme - bad situation */
298 return;
299 }
300 }
301 while (server_parse(s, c));
302}
303
304EAPI void
305evas_cserve_server_wait(Server *s, int timeout)
306{
307 fd_set rset, wset, xset;
308 int maxfd;
309 int ret;
310 struct timeval to;
311 Eina_List *l, *dead = NULL;
312 Client *c;
313
314 maxfd = 0;
315 FD_ZERO(&rset);
316 FD_ZERO(&wset);
317 FD_ZERO(&xset);
318 FD_SET(s->ch[0].fd, &rset);
319 if (s->ch[0].fd > maxfd) maxfd = s->ch[0].fd;
320 EINA_LIST_FOREACH(s->clients, l, c)
321 {
322 FD_SET(c->fd, &rset);
323 if (c->buf)
324 FD_SET(c->fd, &wset);
325 if (c->fd > maxfd) maxfd = c->fd;
326 }
327 if (timeout > 0)
328 {
329 to.tv_sec = timeout / 1000000;
330 to.tv_usec = timeout % 1000000;
331 ret = select(maxfd + 1, &rset, &wset, &xset, &to);
332 }
333 else
334 ret = select(maxfd + 1, &rset, &wset, &xset, NULL);
335 if (ret < 1) return;
336
337 EINA_LIST_FOREACH(s->clients, l, c)
338 {
339 if (c->dead) continue;
340 if (FD_ISSET(c->fd, &rset))
341 {
342 unsigned char buf[16384];
343 int num;
344
345 errno = 0;
346 num = read(c->fd, buf, sizeof(buf));
347 if (num <= 0)
348 {
349 c->dead = 1;
350 dead = eina_list_append(dead, c);
351 }
352 else if (num > 0)
353 {
354 server_data(s, c, buf, num);
355 }
356 }
357 else if (FD_ISSET(c->fd, &wset))
358 {
359 client_flush(c);
360 if (c->dead) dead = eina_list_append(dead, c);
361 }
362 }
363 if (FD_ISSET(s->ch[0].fd, &rset))
364 {
365 server_accept(s);
366 }
367 EINA_LIST_FREE(dead, c)
368 {
369 LKL(c->lock);
370 if (c->func) c->func(c->data, c);
371 s->clients = eina_list_remove(s->clients, c);
372 close(c->fd);
373 if (c->buf) free(c->buf);
374 if (c->inbuf) free(c->inbuf);
375 LKD(c->lock);
376 free(c);
377 }
378}
379
380#endif
diff --git a/libraries/evas/src/lib/engines/Makefile.am b/libraries/evas/src/lib/engines/Makefile.am
new file mode 100644
index 0000000..0e7706c
--- /dev/null
+++ b/libraries/evas/src/lib/engines/Makefile.am
@@ -0,0 +1,16 @@
1
2MAINTAINERCLEANFILES = Makefile.in
3
4SUBDIRS = common
5
6if BUILD_ENGINE_SOFTWARE_16
7
8SUBDIRS += common_16
9
10endif
11
12if BUILD_ENGINE_SOFTWARE_8
13
14SUBDIRS += common_8
15
16endif
diff --git a/libraries/evas/src/lib/engines/Makefile.in b/libraries/evas/src/lib/engines/Makefile.in
new file mode 100644
index 0000000..12e28c1
--- /dev/null
+++ b/libraries/evas/src/lib/engines/Makefile.in
@@ -0,0 +1,736 @@
1# Makefile.in generated by automake 1.11.1 from Makefile.am.
2# @configure_input@
3
4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
6# Inc.
7# This Makefile.in is free software; the Free Software Foundation
8# gives unlimited permission to copy and/or distribute it,
9# with or without modifications, as long as this notice is preserved.
10
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
13# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14# PARTICULAR PURPOSE.
15
16@SET_MAKE@
17VPATH = @srcdir@
18pkgdatadir = $(datadir)/@PACKAGE@
19pkgincludedir = $(includedir)/@PACKAGE@
20pkglibdir = $(libdir)/@PACKAGE@
21pkglibexecdir = $(libexecdir)/@PACKAGE@
22am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
23install_sh_DATA = $(install_sh) -c -m 644
24install_sh_PROGRAM = $(install_sh) -c
25install_sh_SCRIPT = $(install_sh) -c
26INSTALL_HEADER = $(INSTALL_DATA)
27transform = $(program_transform_name)
28NORMAL_INSTALL = :
29PRE_INSTALL = :
30POST_INSTALL = :
31NORMAL_UNINSTALL = :
32PRE_UNINSTALL = :
33POST_UNINSTALL = :
34build_triplet = @build@
35host_triplet = @host@
36@BUILD_ENGINE_SOFTWARE_16_TRUE@am__append_1 = common_16
37@BUILD_ENGINE_SOFTWARE_8_TRUE@am__append_2 = common_8
38subdir = src/lib/engines
39DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
40ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
41am__aclocal_m4_deps = $(top_srcdir)/m4/efl_attribute.m4 \
42 $(top_srcdir)/m4/efl_coverage.m4 \
43 $(top_srcdir)/m4/efl_doxygen.m4 \
44 $(top_srcdir)/m4/efl_fnmatch.m4 \
45 $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \
46 $(top_srcdir)/m4/evas_check_engine.m4 \
47 $(top_srcdir)/m4/evas_check_loader.m4 \
48 $(top_srcdir)/m4/evas_converter.m4 \
49 $(top_srcdir)/m4/evas_dither.m4 \
50 $(top_srcdir)/m4/evas_scaler.m4 $(top_srcdir)/m4/libtool.m4 \
51 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
52 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
53 $(top_srcdir)/configure.ac
54am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
55 $(ACLOCAL_M4)
56mkinstalldirs = $(install_sh) -d
57CONFIG_HEADER = $(top_builddir)/config.h
58CONFIG_CLEAN_FILES =
59CONFIG_CLEAN_VPATH_FILES =
60AM_V_GEN = $(am__v_GEN_$(V))
61am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
62am__v_GEN_0 = @echo " GEN " $@;
63AM_V_at = $(am__v_at_$(V))
64am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
65am__v_at_0 = @
66SOURCES =
67DIST_SOURCES =
68RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
69 html-recursive info-recursive install-data-recursive \
70 install-dvi-recursive install-exec-recursive \
71 install-html-recursive install-info-recursive \
72 install-pdf-recursive install-ps-recursive install-recursive \
73 installcheck-recursive installdirs-recursive pdf-recursive \
74 ps-recursive uninstall-recursive
75RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
76 distclean-recursive maintainer-clean-recursive
77AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
78 $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
79 distdir
80ETAGS = etags
81CTAGS = ctags
82DIST_SUBDIRS = common common_16 common_8
83DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
84am__relativize = \
85 dir0=`pwd`; \
86 sed_first='s,^\([^/]*\)/.*$$,\1,'; \
87 sed_rest='s,^[^/]*/*,,'; \
88 sed_last='s,^.*/\([^/]*\)$$,\1,'; \
89 sed_butlast='s,/*[^/]*$$,,'; \
90 while test -n "$$dir1"; do \
91 first=`echo "$$dir1" | sed -e "$$sed_first"`; \
92 if test "$$first" != "."; then \
93 if test "$$first" = ".."; then \
94 dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
95 dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
96 else \
97 first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
98 if test "$$first2" = "$$first"; then \
99 dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
100 else \
101 dir2="../$$dir2"; \
102 fi; \
103 dir0="$$dir0"/"$$first"; \
104 fi; \
105 fi; \
106 dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
107 done; \
108 reldir="$$dir2"
109ACLOCAL = @ACLOCAL@
110ALLOCA = @ALLOCA@
111AMTAR = @AMTAR@
112AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
113AR = @AR@
114AS = @AS@
115AUTOCONF = @AUTOCONF@
116AUTOHEADER = @AUTOHEADER@
117AUTOMAKE = @AUTOMAKE@
118AWK = @AWK@
119CC = @CC@
120CCDEPMODE = @CCDEPMODE@
121CFLAGS = @CFLAGS@
122CHECK_CFLAGS = @CHECK_CFLAGS@
123CHECK_LIBS = @CHECK_LIBS@
124CPP = @CPP@
125CPPFLAGS = @CPPFLAGS@
126CXX = @CXX@
127CXXCPP = @CXXCPP@
128CXXDEPMODE = @CXXDEPMODE@
129CXXFLAGS = @CXXFLAGS@
130CYGPATH_W = @CYGPATH_W@
131DEFS = @DEFS@
132DEPDIR = @DEPDIR@
133DIRECTFB_CFLAGS = @DIRECTFB_CFLAGS@
134DIRECTFB_LIBS = @DIRECTFB_LIBS@
135DLLTOOL = @DLLTOOL@
136DSYMUTIL = @DSYMUTIL@
137DUMPBIN = @DUMPBIN@
138ECHO_C = @ECHO_C@
139ECHO_N = @ECHO_N@
140ECHO_T = @ECHO_T@
141ECORE_EVAS_CFLAGS = @ECORE_EVAS_CFLAGS@
142ECORE_EVAS_LIBS = @ECORE_EVAS_LIBS@
143EDB_CFLAGS = @EDB_CFLAGS@
144EDB_LIBS = @EDB_LIBS@
145EDJE_CFLAGS = @EDJE_CFLAGS@
146EDJE_LIBS = @EDJE_LIBS@
147EET_CFLAGS = @EET_CFLAGS@
148EET_LIBS = @EET_LIBS@
149EFL_COVERAGE_CFLAGS = @EFL_COVERAGE_CFLAGS@
150EFL_COVERAGE_LIBS = @EFL_COVERAGE_LIBS@
151EFL_FNMATCH_LIBS = @EFL_FNMATCH_LIBS@
152EGREP = @EGREP@
153EINA_CFLAGS = @EINA_CFLAGS@
154EINA_LIBS = @EINA_LIBS@
155EVAS_CFLAGS = @EVAS_CFLAGS@
156EVAS_LIBS = @EVAS_LIBS@
157EVAS_SSE3_CFLAGS = @EVAS_SSE3_CFLAGS@
158EVIL_CFLAGS = @EVIL_CFLAGS@
159EVIL_LIBS = @EVIL_LIBS@
160EXEEXT = @EXEEXT@
161FGREP = @FGREP@
162FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@
163FONTCONFIG_LIBS = @FONTCONFIG_LIBS@
164FREETYPE_CFLAGS = @FREETYPE_CFLAGS@
165FREETYPE_LIBS = @FREETYPE_LIBS@
166FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@
167FRIBIDI_LIBS = @FRIBIDI_LIBS@
168GL_EET_CFLAGS = @GL_EET_CFLAGS@
169GL_EET_LIBS = @GL_EET_LIBS@
170GREP = @GREP@
171HARFBUZZ_CFLAGS = @HARFBUZZ_CFLAGS@
172HARFBUZZ_LIBS = @HARFBUZZ_LIBS@
173INSTALL = @INSTALL@
174INSTALL_DATA = @INSTALL_DATA@
175INSTALL_PROGRAM = @INSTALL_PROGRAM@
176INSTALL_SCRIPT = @INSTALL_SCRIPT@
177INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
178LD = @LD@
179LDFLAGS = @LDFLAGS@
180LIBOBJS = @LIBOBJS@
181LIBS = @LIBS@
182LIBTOOL = @LIBTOOL@
183LINEBREAK_CFLAGS = @LINEBREAK_CFLAGS@
184LINEBREAK_LIBS = @LINEBREAK_LIBS@
185LIPO = @LIPO@
186LN_S = @LN_S@
187LTLIBOBJS = @LTLIBOBJS@
188MAKEINFO = @MAKEINFO@
189MKDIR_P = @MKDIR_P@
190MODULE_ARCH = @MODULE_ARCH@
191NM = @NM@
192NMEDIT = @NMEDIT@
193OBJC = @OBJC@
194OBJCDEPMODE = @OBJCDEPMODE@
195OBJCFLAGS = @OBJCFLAGS@
196OBJDUMP = @OBJDUMP@
197OBJEXT = @OBJEXT@
198OTOOL = @OTOOL@
199OTOOL64 = @OTOOL64@
200PACKAGE = @PACKAGE@
201PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
202PACKAGE_NAME = @PACKAGE_NAME@
203PACKAGE_STRING = @PACKAGE_STRING@
204PACKAGE_TARNAME = @PACKAGE_TARNAME@
205PACKAGE_URL = @PACKAGE_URL@
206PACKAGE_VERSION = @PACKAGE_VERSION@
207PATH_SEPARATOR = @PATH_SEPARATOR@
208PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
209PIXMAN_LIBS = @PIXMAN_LIBS@
210PKG_CONFIG = @PKG_CONFIG@
211PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
212PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
213PNG_CFLAGS = @PNG_CFLAGS@
214PNG_LIBS = @PNG_LIBS@
215RANLIB = @RANLIB@
216SDL_CFLAGS = @SDL_CFLAGS@
217SDL_LIBS = @SDL_LIBS@
218SED = @SED@
219SET_MAKE = @SET_MAKE@
220SHELL = @SHELL@
221SHM_OPEN_LINK = @SHM_OPEN_LINK@
222STRIP = @STRIP@
223SVG_CFLAGS = @SVG_CFLAGS@
224SVG_LIBS = @SVG_LIBS@
225VALGRIND_CFLAGS = @VALGRIND_CFLAGS@
226VALGRIND_LIBS = @VALGRIND_LIBS@
227VERSION = @VERSION@
228VMAJ = @VMAJ@
229WIN32_CFLAGS = @WIN32_CFLAGS@
230WIN32_CPPFLAGS = @WIN32_CPPFLAGS@
231XCB_CFLAGS = @XCB_CFLAGS@
232XCB_GL_CFLAGS = @XCB_GL_CFLAGS@
233XCB_GL_LIBS = @XCB_GL_LIBS@
234XCB_LIBS = @XCB_LIBS@
235XEXT_CFLAGS = @XEXT_CFLAGS@
236XEXT_LIBS = @XEXT_LIBS@
237XMKMF = @XMKMF@
238X_CFLAGS = @X_CFLAGS@
239X_EXTRA_LIBS = @X_EXTRA_LIBS@
240X_LIBS = @X_LIBS@
241X_PRE_LIBS = @X_PRE_LIBS@
242abs_builddir = @abs_builddir@
243abs_srcdir = @abs_srcdir@
244abs_top_builddir = @abs_top_builddir@
245abs_top_srcdir = @abs_top_srcdir@
246ac_ct_CC = @ac_ct_CC@
247ac_ct_CXX = @ac_ct_CXX@
248ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
249ac_ct_OBJC = @ac_ct_OBJC@
250altivec_cflags = @altivec_cflags@
251am__include = @am__include@
252am__leading_dot = @am__leading_dot@
253am__quote = @am__quote@
254am__tar = @am__tar@
255am__untar = @am__untar@
256bindir = @bindir@
257build = @build@
258build_alias = @build_alias@
259build_cpu = @build_cpu@
260build_os = @build_os@
261build_vendor = @build_vendor@
262builddir = @builddir@
263datadir = @datadir@
264datarootdir = @datarootdir@
265dlopen_libs = @dlopen_libs@
266docdir = @docdir@
267dvidir = @dvidir@
268edje_cc = @edje_cc@
269efl_doxygen = @efl_doxygen@
270efl_have_doxygen = @efl_have_doxygen@
271evas_engine_buffer_cflags = @evas_engine_buffer_cflags@
272evas_engine_buffer_libs = @evas_engine_buffer_libs@
273evas_engine_direct3d_cflags = @evas_engine_direct3d_cflags@
274evas_engine_direct3d_libs = @evas_engine_direct3d_libs@
275evas_engine_directfb_cflags = @evas_engine_directfb_cflags@
276evas_engine_directfb_libs = @evas_engine_directfb_libs@
277evas_engine_fb_cflags = @evas_engine_fb_cflags@
278evas_engine_fb_libs = @evas_engine_fb_libs@
279evas_engine_gl_cocoa_cflags = @evas_engine_gl_cocoa_cflags@
280evas_engine_gl_cocoa_libs = @evas_engine_gl_cocoa_libs@
281evas_engine_gl_common_libs = @evas_engine_gl_common_libs@
282evas_engine_gl_sdl_cflags = @evas_engine_gl_sdl_cflags@
283evas_engine_gl_sdl_libs = @evas_engine_gl_sdl_libs@
284evas_engine_gl_xcb_cflags = @evas_engine_gl_xcb_cflags@
285evas_engine_gl_xcb_libs = @evas_engine_gl_xcb_libs@
286evas_engine_gl_xlib_cflags = @evas_engine_gl_xlib_cflags@
287evas_engine_gl_xlib_libs = @evas_engine_gl_xlib_libs@
288evas_engine_psl1ght_cflags = @evas_engine_psl1ght_cflags@
289evas_engine_psl1ght_libs = @evas_engine_psl1ght_libs@
290evas_engine_software_16_ddraw_cflags = @evas_engine_software_16_ddraw_cflags@
291evas_engine_software_16_ddraw_libs = @evas_engine_software_16_ddraw_libs@
292evas_engine_software_16_sdl_cflags = @evas_engine_software_16_sdl_cflags@
293evas_engine_software_16_sdl_libs = @evas_engine_software_16_sdl_libs@
294evas_engine_software_16_wince_cflags = @evas_engine_software_16_wince_cflags@
295evas_engine_software_16_wince_libs = @evas_engine_software_16_wince_libs@
296evas_engine_software_16_x11_cflags = @evas_engine_software_16_x11_cflags@
297evas_engine_software_16_x11_libs = @evas_engine_software_16_x11_libs@
298evas_engine_software_8_x11_cflags = @evas_engine_software_8_x11_cflags@
299evas_engine_software_8_x11_libs = @evas_engine_software_8_x11_libs@
300evas_engine_software_ddraw_cflags = @evas_engine_software_ddraw_cflags@
301evas_engine_software_ddraw_libs = @evas_engine_software_ddraw_libs@
302evas_engine_software_gdi_cflags = @evas_engine_software_gdi_cflags@
303evas_engine_software_gdi_libs = @evas_engine_software_gdi_libs@
304evas_engine_software_sdl_cflags = @evas_engine_software_sdl_cflags@
305evas_engine_software_sdl_libs = @evas_engine_software_sdl_libs@
306evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@
307evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@
308evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@
309evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@
310evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@
311evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@
312evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@
313evas_image_loader_edb_libs = @evas_image_loader_edb_libs@
314evas_image_loader_eet_cflags = @evas_image_loader_eet_cflags@
315evas_image_loader_eet_libs = @evas_image_loader_eet_libs@
316evas_image_loader_generic_cflags = @evas_image_loader_generic_cflags@
317evas_image_loader_generic_libs = @evas_image_loader_generic_libs@
318evas_image_loader_gif_cflags = @evas_image_loader_gif_cflags@
319evas_image_loader_gif_libs = @evas_image_loader_gif_libs@
320evas_image_loader_ico_cflags = @evas_image_loader_ico_cflags@
321evas_image_loader_ico_libs = @evas_image_loader_ico_libs@
322evas_image_loader_jpeg_cflags = @evas_image_loader_jpeg_cflags@
323evas_image_loader_jpeg_libs = @evas_image_loader_jpeg_libs@
324evas_image_loader_pmaps_cflags = @evas_image_loader_pmaps_cflags@
325evas_image_loader_pmaps_libs = @evas_image_loader_pmaps_libs@
326evas_image_loader_png_cflags = @evas_image_loader_png_cflags@
327evas_image_loader_png_libs = @evas_image_loader_png_libs@
328evas_image_loader_psd_cflags = @evas_image_loader_psd_cflags@
329evas_image_loader_psd_libs = @evas_image_loader_psd_libs@
330evas_image_loader_svg_cflags = @evas_image_loader_svg_cflags@
331evas_image_loader_svg_libs = @evas_image_loader_svg_libs@
332evas_image_loader_tga_cflags = @evas_image_loader_tga_cflags@
333evas_image_loader_tga_libs = @evas_image_loader_tga_libs@
334evas_image_loader_tiff_cflags = @evas_image_loader_tiff_cflags@
335evas_image_loader_tiff_libs = @evas_image_loader_tiff_libs@
336evas_image_loader_wbmp_cflags = @evas_image_loader_wbmp_cflags@
337evas_image_loader_wbmp_libs = @evas_image_loader_wbmp_libs@
338evas_image_loader_xpm_cflags = @evas_image_loader_xpm_cflags@
339evas_image_loader_xpm_libs = @evas_image_loader_xpm_libs@
340exec_prefix = @exec_prefix@
341have_evas_engine_gl_x11 = @have_evas_engine_gl_x11@
342have_evas_engine_gl_xcb = @have_evas_engine_gl_xcb@
343have_evas_engine_gl_xlib = @have_evas_engine_gl_xlib@
344have_evas_engine_software_x11 = @have_evas_engine_software_x11@
345have_evas_engine_software_xcb = @have_evas_engine_software_xcb@
346have_evas_engine_software_xlib = @have_evas_engine_software_xlib@
347have_lcov = @have_lcov@
348host = @host@
349host_alias = @host_alias@
350host_cpu = @host_cpu@
351host_os = @host_os@
352host_vendor = @host_vendor@
353htmldir = @htmldir@
354includedir = @includedir@
355infodir = @infodir@
356install_sh = @install_sh@
357libdir = @libdir@
358libexecdir = @libexecdir@
359localedir = @localedir@
360localstatedir = @localstatedir@
361lt_ECHO = @lt_ECHO@
362lt_enable_auto_import = @lt_enable_auto_import@
363mandir = @mandir@
364mkdir_p = @mkdir_p@
365oldincludedir = @oldincludedir@
366pdfdir = @pdfdir@
367pkgconfig_requires_private = @pkgconfig_requires_private@
368prefix = @prefix@
369program_transform_name = @program_transform_name@
370psdir = @psdir@
371pthread_cflags = @pthread_cflags@
372pthread_libs = @pthread_libs@
373release_info = @release_info@
374requirement_evas = @requirement_evas@
375sbindir = @sbindir@
376sharedstatedir = @sharedstatedir@
377srcdir = @srcdir@
378sysconfdir = @sysconfdir@
379target_alias = @target_alias@
380top_build_prefix = @top_build_prefix@
381top_builddir = @top_builddir@
382top_srcdir = @top_srcdir@
383version_info = @version_info@
384MAINTAINERCLEANFILES = Makefile.in
385SUBDIRS = common $(am__append_1) $(am__append_2)
386all: all-recursive
387
388.SUFFIXES:
389$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
390 @for dep in $?; do \
391 case '$(am__configure_deps)' in \
392 *$$dep*) \
393 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
394 && { if test -f $@; then exit 0; else break; fi; }; \
395 exit 1;; \
396 esac; \
397 done; \
398 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/engines/Makefile'; \
399 $(am__cd) $(top_srcdir) && \
400 $(AUTOMAKE) --gnu src/lib/engines/Makefile
401.PRECIOUS: Makefile
402Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
403 @case '$?' in \
404 *config.status*) \
405 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
406 *) \
407 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
408 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
409 esac;
410
411$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
412 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
413
414$(top_srcdir)/configure: $(am__configure_deps)
415 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
416$(ACLOCAL_M4): $(am__aclocal_m4_deps)
417 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
418$(am__aclocal_m4_deps):
419
420mostlyclean-libtool:
421 -rm -f *.lo
422
423clean-libtool:
424 -rm -rf .libs _libs
425
426# This directory's subdirectories are mostly independent; you can cd
427# into them and run `make' without going through this Makefile.
428# To change the values of `make' variables: instead of editing Makefiles,
429# (1) if the variable is set in `config.status', edit `config.status'
430# (which will cause the Makefiles to be regenerated when you run `make');
431# (2) otherwise, pass the desired values on the `make' command line.
432$(RECURSIVE_TARGETS):
433 @fail= failcom='exit 1'; \
434 for f in x $$MAKEFLAGS; do \
435 case $$f in \
436 *=* | --[!k]*);; \
437 *k*) failcom='fail=yes';; \
438 esac; \
439 done; \
440 dot_seen=no; \
441 target=`echo $@ | sed s/-recursive//`; \
442 list='$(SUBDIRS)'; for subdir in $$list; do \
443 echo "Making $$target in $$subdir"; \
444 if test "$$subdir" = "."; then \
445 dot_seen=yes; \
446 local_target="$$target-am"; \
447 else \
448 local_target="$$target"; \
449 fi; \
450 ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
451 || eval $$failcom; \
452 done; \
453 if test "$$dot_seen" = "no"; then \
454 $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
455 fi; test -z "$$fail"
456
457$(RECURSIVE_CLEAN_TARGETS):
458 @fail= failcom='exit 1'; \
459 for f in x $$MAKEFLAGS; do \
460 case $$f in \
461 *=* | --[!k]*);; \
462 *k*) failcom='fail=yes';; \
463 esac; \
464 done; \
465 dot_seen=no; \
466 case "$@" in \
467 distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
468 *) list='$(SUBDIRS)' ;; \
469 esac; \
470 rev=''; for subdir in $$list; do \
471 if test "$$subdir" = "."; then :; else \
472 rev="$$subdir $$rev"; \
473 fi; \
474 done; \
475 rev="$$rev ."; \
476 target=`echo $@ | sed s/-recursive//`; \
477 for subdir in $$rev; do \
478 echo "Making $$target in $$subdir"; \
479 if test "$$subdir" = "."; then \
480 local_target="$$target-am"; \
481 else \
482 local_target="$$target"; \
483 fi; \
484 ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
485 || eval $$failcom; \
486 done && test -z "$$fail"
487tags-recursive:
488 list='$(SUBDIRS)'; for subdir in $$list; do \
489 test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
490 done
491ctags-recursive:
492 list='$(SUBDIRS)'; for subdir in $$list; do \
493 test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
494 done
495
496ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
497 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
498 unique=`for i in $$list; do \
499 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
500 done | \
501 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
502 END { if (nonempty) { for (i in files) print i; }; }'`; \
503 mkid -fID $$unique
504tags: TAGS
505
506TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
507 $(TAGS_FILES) $(LISP)
508 set x; \
509 here=`pwd`; \
510 if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
511 include_option=--etags-include; \
512 empty_fix=.; \
513 else \
514 include_option=--include; \
515 empty_fix=; \
516 fi; \
517 list='$(SUBDIRS)'; for subdir in $$list; do \
518 if test "$$subdir" = .; then :; else \
519 test ! -f $$subdir/TAGS || \
520 set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
521 fi; \
522 done; \
523 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
524 unique=`for i in $$list; do \
525 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
526 done | \
527 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
528 END { if (nonempty) { for (i in files) print i; }; }'`; \
529 shift; \
530 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
531 test -n "$$unique" || unique=$$empty_fix; \
532 if test $$# -gt 0; then \
533 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
534 "$$@" $$unique; \
535 else \
536 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
537 $$unique; \
538 fi; \
539 fi
540ctags: CTAGS
541CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
542 $(TAGS_FILES) $(LISP)
543 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
544 unique=`for i in $$list; do \
545 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
546 done | \
547 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
548 END { if (nonempty) { for (i in files) print i; }; }'`; \
549 test -z "$(CTAGS_ARGS)$$unique" \
550 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
551 $$unique
552
553GTAGS:
554 here=`$(am__cd) $(top_builddir) && pwd` \
555 && $(am__cd) $(top_srcdir) \
556 && gtags -i $(GTAGS_ARGS) "$$here"
557
558distclean-tags:
559 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
560
561distdir: $(DISTFILES)
562 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
563 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
564 list='$(DISTFILES)'; \
565 dist_files=`for file in $$list; do echo $$file; done | \
566 sed -e "s|^$$srcdirstrip/||;t" \
567 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
568 case $$dist_files in \
569 */*) $(MKDIR_P) `echo "$$dist_files" | \
570 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
571 sort -u` ;; \
572 esac; \
573 for file in $$dist_files; do \
574 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
575 if test -d $$d/$$file; then \
576 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
577 if test -d "$(distdir)/$$file"; then \
578 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
579 fi; \
580 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
581 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
582 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
583 fi; \
584 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
585 else \
586 test -f "$(distdir)/$$file" \
587 || cp -p $$d/$$file "$(distdir)/$$file" \
588 || exit 1; \
589 fi; \
590 done
591 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
592 if test "$$subdir" = .; then :; else \
593 test -d "$(distdir)/$$subdir" \
594 || $(MKDIR_P) "$(distdir)/$$subdir" \
595 || exit 1; \
596 fi; \
597 done
598 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
599 if test "$$subdir" = .; then :; else \
600 dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
601 $(am__relativize); \
602 new_distdir=$$reldir; \
603 dir1=$$subdir; dir2="$(top_distdir)"; \
604 $(am__relativize); \
605 new_top_distdir=$$reldir; \
606 echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
607 echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
608 ($(am__cd) $$subdir && \
609 $(MAKE) $(AM_MAKEFLAGS) \
610 top_distdir="$$new_top_distdir" \
611 distdir="$$new_distdir" \
612 am__remove_distdir=: \
613 am__skip_length_check=: \
614 am__skip_mode_fix=: \
615 distdir) \
616 || exit 1; \
617 fi; \
618 done
619check-am: all-am
620check: check-recursive
621all-am: Makefile
622installdirs: installdirs-recursive
623installdirs-am:
624install: install-recursive
625install-exec: install-exec-recursive
626install-data: install-data-recursive
627uninstall: uninstall-recursive
628
629install-am: all-am
630 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
631
632installcheck: installcheck-recursive
633install-strip:
634 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
635 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
636 `test -z '$(STRIP)' || \
637 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
638mostlyclean-generic:
639
640clean-generic:
641
642distclean-generic:
643 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
644 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
645
646maintainer-clean-generic:
647 @echo "This command is intended for maintainers to use"
648 @echo "it deletes files that may require special tools to rebuild."
649 -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
650clean: clean-recursive
651
652clean-am: clean-generic clean-libtool mostlyclean-am
653
654distclean: distclean-recursive
655 -rm -f Makefile
656distclean-am: clean-am distclean-generic distclean-tags
657
658dvi: dvi-recursive
659
660dvi-am:
661
662html: html-recursive
663
664html-am:
665
666info: info-recursive
667
668info-am:
669
670install-data-am:
671
672install-dvi: install-dvi-recursive
673
674install-dvi-am:
675
676install-exec-am:
677
678install-html: install-html-recursive
679
680install-html-am:
681
682install-info: install-info-recursive
683
684install-info-am:
685
686install-man:
687
688install-pdf: install-pdf-recursive
689
690install-pdf-am:
691
692install-ps: install-ps-recursive
693
694install-ps-am:
695
696installcheck-am:
697
698maintainer-clean: maintainer-clean-recursive
699 -rm -f Makefile
700maintainer-clean-am: distclean-am maintainer-clean-generic
701
702mostlyclean: mostlyclean-recursive
703
704mostlyclean-am: mostlyclean-generic mostlyclean-libtool
705
706pdf: pdf-recursive
707
708pdf-am:
709
710ps: ps-recursive
711
712ps-am:
713
714uninstall-am:
715
716.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
717 install-am install-strip tags-recursive
718
719.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
720 all all-am check check-am clean clean-generic clean-libtool \
721 ctags ctags-recursive distclean distclean-generic \
722 distclean-libtool distclean-tags distdir dvi dvi-am html \
723 html-am info info-am install install-am install-data \
724 install-data-am install-dvi install-dvi-am install-exec \
725 install-exec-am install-html install-html-am install-info \
726 install-info-am install-man install-pdf install-pdf-am \
727 install-ps install-ps-am install-strip installcheck \
728 installcheck-am installdirs installdirs-am maintainer-clean \
729 maintainer-clean-generic mostlyclean mostlyclean-generic \
730 mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
731 uninstall uninstall-am
732
733
734# Tell versions [3.59,3.63) of GNU make to not export all variables.
735# Otherwise a system limit (for SysV at least) may be exceeded.
736.NOEXPORT:
diff --git a/libraries/evas/src/lib/engines/common/Makefile.am b/libraries/evas/src/lib/engines/common/Makefile.am
new file mode 100644
index 0000000..9c9918d
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/Makefile.am
@@ -0,0 +1,118 @@
1
2SUBDIRS = evas_op_add evas_op_blend evas_op_copy evas_op_mask evas_op_mul evas_op_sub
3
4MAINTAINERCLEANFILES = Makefile.in
5
6AM_CPPFLAGS = -I. \
7 -I$(top_srcdir)/src/lib \
8 -I$(top_srcdir)/src/lib/cserve \
9 -I$(top_srcdir)/src/lib/include \
10 -DPACKAGE_BIN_DIR=\"$(bindir)\" \
11 -DPACKAGE_LIB_DIR=\"$(libdir)\" \
12 -DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
13 @FREETYPE_CFLAGS@ @VALGRIND_CFLAGS@ \
14 @PIXMAN_CFLAGS@ \
15 @EET_CFLAGS@ @pthread_cflags@ \
16 @WIN32_CFLAGS@ @EINA_CFLAGS@ \
17 @FRIBIDI_CFLAGS@ @HARFBUZZ_CFLAGS@ \
18 @PIXMAN_CFLAGS@
19
20noinst_LTLIBRARIES = libevas_engine_common.la
21libevas_engine_common_la_SOURCES = \
22evas_op_copy_main_.c \
23evas_op_blend_main_.c \
24evas_op_add_main_.c \
25evas_op_sub_main_.c \
26evas_op_mask_main_.c \
27evas_op_mul_main_.c \
28evas_blend_main.c \
29evas_blit_main.c \
30evas_convert_color.c \
31evas_convert_colorspace.c \
32evas_convert_gry_1.c \
33evas_convert_gry_4.c \
34evas_convert_gry_8.c \
35evas_convert_main.c \
36evas_convert_rgb_16.c \
37evas_convert_rgb_24.c \
38evas_convert_rgb_32.c \
39evas_convert_rgb_8.c \
40evas_convert_grypal_6.c \
41evas_convert_yuv.c \
42evas_cpu.c \
43evas_draw_main.c \
44evas_font_draw.c \
45evas_font_load.c \
46evas_font_main.c \
47evas_font_query.c \
48evas_image_load.c \
49evas_image_save.c \
50evas_image_main.c \
51evas_image_data.c \
52evas_image_scalecache.c \
53evas_line_main.c \
54evas_polygon_main.c \
55evas_rectangle_main.c \
56evas_scale_main.c \
57evas_scale_sample.c \
58evas_scale_smooth.c \
59evas_scale_span.c \
60evas_tiler.c \
61evas_regionbuf.c \
62evas_pipe.c \
63language/evas_bidi_utils.c \
64language/evas_language_utils.c \
65evas_text_utils.c \
66evas_font_ot.c \
67evas_map_image.c \
68evas_map_image.h
69
70EXTRA_DIST = \
71evas_blend.h \
72evas_blend_private.h \
73evas_convert_color.h \
74evas_convert_colorspace.h \
75evas_convert_gry_1.h \
76evas_convert_gry_4.h \
77evas_convert_gry_8.h \
78evas_convert_grypal_6.h \
79evas_convert_main.h \
80evas_convert_rgb_16.h \
81evas_convert_rgb_24.h \
82evas_convert_rgb_32.h \
83evas_convert_rgb_8.h \
84evas_convert_yuv.h \
85evas_draw.h \
86evas_font.h \
87evas_font_default_walk.x \
88evas_font_private.h \
89evas_image.h \
90evas_image_private.h \
91evas_line.h \
92evas_polygon.h \
93evas_rectangle.h \
94evas_scale_main.h \
95evas_scale_smooth.h \
96evas_scale_smooth_scaler.c \
97evas_scale_smooth_scaler_down.c \
98evas_scale_smooth_scaler_downx.c \
99evas_scale_smooth_scaler_downx_downy.c \
100evas_scale_smooth_scaler_downy.c \
101evas_scale_smooth_scaler_noscale.c \
102evas_scale_smooth_scaler_up.c \
103evas_scale_span.h \
104evas_pipe.h \
105language/evas_bidi_utils.h \
106language/evas_language_utils.h \
107language/evas_script_table.h \
108evas_text_utils.h \
109evas_font_ot.h \
110evas_map_image_internal.c \
111evas_map_image_core.c \
112evas_map_image_loop.c
113
114libevas_engine_common_la_DEPENDENCIES = \
115$(top_builddir)/config.h
116
117libevas_engine_common_la_LIBADD = \
118evas_op_blend/libevas_engine_common_op_blend_master_sse3.la
diff --git a/libraries/evas/src/lib/engines/common/Makefile.in b/libraries/evas/src/lib/engines/common/Makefile.in
new file mode 100644
index 0000000..b0162df
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/Makefile.in
@@ -0,0 +1,1005 @@
1# Makefile.in generated by automake 1.11.1 from Makefile.am.
2# @configure_input@
3
4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
6# Inc.
7# This Makefile.in is free software; the Free Software Foundation
8# gives unlimited permission to copy and/or distribute it,
9# with or without modifications, as long as this notice is preserved.
10
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
13# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14# PARTICULAR PURPOSE.
15
16@SET_MAKE@
17
18VPATH = @srcdir@
19pkgdatadir = $(datadir)/@PACKAGE@
20pkgincludedir = $(includedir)/@PACKAGE@
21pkglibdir = $(libdir)/@PACKAGE@
22pkglibexecdir = $(libexecdir)/@PACKAGE@
23am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
24install_sh_DATA = $(install_sh) -c -m 644
25install_sh_PROGRAM = $(install_sh) -c
26install_sh_SCRIPT = $(install_sh) -c
27INSTALL_HEADER = $(INSTALL_DATA)
28transform = $(program_transform_name)
29NORMAL_INSTALL = :
30PRE_INSTALL = :
31POST_INSTALL = :
32NORMAL_UNINSTALL = :
33PRE_UNINSTALL = :
34POST_UNINSTALL = :
35build_triplet = @build@
36host_triplet = @host@
37subdir = src/lib/engines/common
38DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
39ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
40am__aclocal_m4_deps = $(top_srcdir)/m4/efl_attribute.m4 \
41 $(top_srcdir)/m4/efl_coverage.m4 \
42 $(top_srcdir)/m4/efl_doxygen.m4 \
43 $(top_srcdir)/m4/efl_fnmatch.m4 \
44 $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \
45 $(top_srcdir)/m4/evas_check_engine.m4 \
46 $(top_srcdir)/m4/evas_check_loader.m4 \
47 $(top_srcdir)/m4/evas_converter.m4 \
48 $(top_srcdir)/m4/evas_dither.m4 \
49 $(top_srcdir)/m4/evas_scaler.m4 $(top_srcdir)/m4/libtool.m4 \
50 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
51 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
52 $(top_srcdir)/configure.ac
53am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
54 $(ACLOCAL_M4)
55mkinstalldirs = $(install_sh) -d
56CONFIG_HEADER = $(top_builddir)/config.h
57CONFIG_CLEAN_FILES =
58CONFIG_CLEAN_VPATH_FILES =
59LTLIBRARIES = $(noinst_LTLIBRARIES)
60am_libevas_engine_common_la_OBJECTS = evas_op_copy_main_.lo \
61 evas_op_blend_main_.lo evas_op_add_main_.lo \
62 evas_op_sub_main_.lo evas_op_mask_main_.lo \
63 evas_op_mul_main_.lo evas_blend_main.lo evas_blit_main.lo \
64 evas_convert_color.lo evas_convert_colorspace.lo \
65 evas_convert_gry_1.lo evas_convert_gry_4.lo \
66 evas_convert_gry_8.lo evas_convert_main.lo \
67 evas_convert_rgb_16.lo evas_convert_rgb_24.lo \
68 evas_convert_rgb_32.lo evas_convert_rgb_8.lo \
69 evas_convert_grypal_6.lo evas_convert_yuv.lo evas_cpu.lo \
70 evas_draw_main.lo evas_font_draw.lo evas_font_load.lo \
71 evas_font_main.lo evas_font_query.lo evas_image_load.lo \
72 evas_image_save.lo evas_image_main.lo evas_image_data.lo \
73 evas_image_scalecache.lo evas_line_main.lo \
74 evas_polygon_main.lo evas_rectangle_main.lo evas_scale_main.lo \
75 evas_scale_sample.lo evas_scale_smooth.lo evas_scale_span.lo \
76 evas_tiler.lo evas_regionbuf.lo evas_pipe.lo \
77 evas_bidi_utils.lo evas_language_utils.lo evas_text_utils.lo \
78 evas_font_ot.lo evas_map_image.lo
79libevas_engine_common_la_OBJECTS = \
80 $(am_libevas_engine_common_la_OBJECTS)
81AM_V_lt = $(am__v_lt_$(V))
82am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
83am__v_lt_0 = --silent
84DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
85depcomp = $(SHELL) $(top_srcdir)/depcomp
86am__depfiles_maybe = depfiles
87am__mv = mv -f
88COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
89 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
90LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
91 $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
92 $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
93 $(AM_CFLAGS) $(CFLAGS)
94AM_V_CC = $(am__v_CC_$(V))
95am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
96am__v_CC_0 = @echo " CC " $@;
97AM_V_at = $(am__v_at_$(V))
98am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
99am__v_at_0 = @
100CCLD = $(CC)
101LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
102 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
103 $(AM_LDFLAGS) $(LDFLAGS) -o $@
104AM_V_CCLD = $(am__v_CCLD_$(V))
105am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
106am__v_CCLD_0 = @echo " CCLD " $@;
107AM_V_GEN = $(am__v_GEN_$(V))
108am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
109am__v_GEN_0 = @echo " GEN " $@;
110SOURCES = $(libevas_engine_common_la_SOURCES)
111DIST_SOURCES = $(libevas_engine_common_la_SOURCES)
112RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
113 html-recursive info-recursive install-data-recursive \
114 install-dvi-recursive install-exec-recursive \
115 install-html-recursive install-info-recursive \
116 install-pdf-recursive install-ps-recursive install-recursive \
117 installcheck-recursive installdirs-recursive pdf-recursive \
118 ps-recursive uninstall-recursive
119RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
120 distclean-recursive maintainer-clean-recursive
121AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
122 $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
123 distdir
124ETAGS = etags
125CTAGS = ctags
126DIST_SUBDIRS = $(SUBDIRS)
127DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
128am__relativize = \
129 dir0=`pwd`; \
130 sed_first='s,^\([^/]*\)/.*$$,\1,'; \
131 sed_rest='s,^[^/]*/*,,'; \
132 sed_last='s,^.*/\([^/]*\)$$,\1,'; \
133 sed_butlast='s,/*[^/]*$$,,'; \
134 while test -n "$$dir1"; do \
135 first=`echo "$$dir1" | sed -e "$$sed_first"`; \
136 if test "$$first" != "."; then \
137 if test "$$first" = ".."; then \
138 dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
139 dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
140 else \
141 first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
142 if test "$$first2" = "$$first"; then \
143 dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
144 else \
145 dir2="../$$dir2"; \
146 fi; \
147 dir0="$$dir0"/"$$first"; \
148 fi; \
149 fi; \
150 dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
151 done; \
152 reldir="$$dir2"
153ACLOCAL = @ACLOCAL@
154ALLOCA = @ALLOCA@
155AMTAR = @AMTAR@
156AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
157AR = @AR@
158AS = @AS@
159AUTOCONF = @AUTOCONF@
160AUTOHEADER = @AUTOHEADER@
161AUTOMAKE = @AUTOMAKE@
162AWK = @AWK@
163CC = @CC@
164CCDEPMODE = @CCDEPMODE@
165CFLAGS = @CFLAGS@
166CHECK_CFLAGS = @CHECK_CFLAGS@
167CHECK_LIBS = @CHECK_LIBS@
168CPP = @CPP@
169CPPFLAGS = @CPPFLAGS@
170CXX = @CXX@
171CXXCPP = @CXXCPP@
172CXXDEPMODE = @CXXDEPMODE@
173CXXFLAGS = @CXXFLAGS@
174CYGPATH_W = @CYGPATH_W@
175DEFS = @DEFS@
176DEPDIR = @DEPDIR@
177DIRECTFB_CFLAGS = @DIRECTFB_CFLAGS@
178DIRECTFB_LIBS = @DIRECTFB_LIBS@
179DLLTOOL = @DLLTOOL@
180DSYMUTIL = @DSYMUTIL@
181DUMPBIN = @DUMPBIN@
182ECHO_C = @ECHO_C@
183ECHO_N = @ECHO_N@
184ECHO_T = @ECHO_T@
185ECORE_EVAS_CFLAGS = @ECORE_EVAS_CFLAGS@
186ECORE_EVAS_LIBS = @ECORE_EVAS_LIBS@
187EDB_CFLAGS = @EDB_CFLAGS@
188EDB_LIBS = @EDB_LIBS@
189EDJE_CFLAGS = @EDJE_CFLAGS@
190EDJE_LIBS = @EDJE_LIBS@
191EET_CFLAGS = @EET_CFLAGS@
192EET_LIBS = @EET_LIBS@
193EFL_COVERAGE_CFLAGS = @EFL_COVERAGE_CFLAGS@
194EFL_COVERAGE_LIBS = @EFL_COVERAGE_LIBS@
195EFL_FNMATCH_LIBS = @EFL_FNMATCH_LIBS@
196EGREP = @EGREP@
197EINA_CFLAGS = @EINA_CFLAGS@
198EINA_LIBS = @EINA_LIBS@
199EVAS_CFLAGS = @EVAS_CFLAGS@
200EVAS_LIBS = @EVAS_LIBS@
201EVAS_SSE3_CFLAGS = @EVAS_SSE3_CFLAGS@
202EVIL_CFLAGS = @EVIL_CFLAGS@
203EVIL_LIBS = @EVIL_LIBS@
204EXEEXT = @EXEEXT@
205FGREP = @FGREP@
206FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@
207FONTCONFIG_LIBS = @FONTCONFIG_LIBS@
208FREETYPE_CFLAGS = @FREETYPE_CFLAGS@
209FREETYPE_LIBS = @FREETYPE_LIBS@
210FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@
211FRIBIDI_LIBS = @FRIBIDI_LIBS@
212GL_EET_CFLAGS = @GL_EET_CFLAGS@
213GL_EET_LIBS = @GL_EET_LIBS@
214GREP = @GREP@
215HARFBUZZ_CFLAGS = @HARFBUZZ_CFLAGS@
216HARFBUZZ_LIBS = @HARFBUZZ_LIBS@
217INSTALL = @INSTALL@
218INSTALL_DATA = @INSTALL_DATA@
219INSTALL_PROGRAM = @INSTALL_PROGRAM@
220INSTALL_SCRIPT = @INSTALL_SCRIPT@
221INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
222LD = @LD@
223LDFLAGS = @LDFLAGS@
224LIBOBJS = @LIBOBJS@
225LIBS = @LIBS@
226LIBTOOL = @LIBTOOL@
227LINEBREAK_CFLAGS = @LINEBREAK_CFLAGS@
228LINEBREAK_LIBS = @LINEBREAK_LIBS@
229LIPO = @LIPO@
230LN_S = @LN_S@
231LTLIBOBJS = @LTLIBOBJS@
232MAKEINFO = @MAKEINFO@
233MKDIR_P = @MKDIR_P@
234MODULE_ARCH = @MODULE_ARCH@
235NM = @NM@
236NMEDIT = @NMEDIT@
237OBJC = @OBJC@
238OBJCDEPMODE = @OBJCDEPMODE@
239OBJCFLAGS = @OBJCFLAGS@
240OBJDUMP = @OBJDUMP@
241OBJEXT = @OBJEXT@
242OTOOL = @OTOOL@
243OTOOL64 = @OTOOL64@
244PACKAGE = @PACKAGE@
245PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
246PACKAGE_NAME = @PACKAGE_NAME@
247PACKAGE_STRING = @PACKAGE_STRING@
248PACKAGE_TARNAME = @PACKAGE_TARNAME@
249PACKAGE_URL = @PACKAGE_URL@
250PACKAGE_VERSION = @PACKAGE_VERSION@
251PATH_SEPARATOR = @PATH_SEPARATOR@
252PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
253PIXMAN_LIBS = @PIXMAN_LIBS@
254PKG_CONFIG = @PKG_CONFIG@
255PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
256PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
257PNG_CFLAGS = @PNG_CFLAGS@
258PNG_LIBS = @PNG_LIBS@
259RANLIB = @RANLIB@
260SDL_CFLAGS = @SDL_CFLAGS@
261SDL_LIBS = @SDL_LIBS@
262SED = @SED@
263SET_MAKE = @SET_MAKE@
264SHELL = @SHELL@
265SHM_OPEN_LINK = @SHM_OPEN_LINK@
266STRIP = @STRIP@
267SVG_CFLAGS = @SVG_CFLAGS@
268SVG_LIBS = @SVG_LIBS@
269VALGRIND_CFLAGS = @VALGRIND_CFLAGS@
270VALGRIND_LIBS = @VALGRIND_LIBS@
271VERSION = @VERSION@
272VMAJ = @VMAJ@
273WIN32_CFLAGS = @WIN32_CFLAGS@
274WIN32_CPPFLAGS = @WIN32_CPPFLAGS@
275XCB_CFLAGS = @XCB_CFLAGS@
276XCB_GL_CFLAGS = @XCB_GL_CFLAGS@
277XCB_GL_LIBS = @XCB_GL_LIBS@
278XCB_LIBS = @XCB_LIBS@
279XEXT_CFLAGS = @XEXT_CFLAGS@
280XEXT_LIBS = @XEXT_LIBS@
281XMKMF = @XMKMF@
282X_CFLAGS = @X_CFLAGS@
283X_EXTRA_LIBS = @X_EXTRA_LIBS@
284X_LIBS = @X_LIBS@
285X_PRE_LIBS = @X_PRE_LIBS@
286abs_builddir = @abs_builddir@
287abs_srcdir = @abs_srcdir@
288abs_top_builddir = @abs_top_builddir@
289abs_top_srcdir = @abs_top_srcdir@
290ac_ct_CC = @ac_ct_CC@
291ac_ct_CXX = @ac_ct_CXX@
292ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
293ac_ct_OBJC = @ac_ct_OBJC@
294altivec_cflags = @altivec_cflags@
295am__include = @am__include@
296am__leading_dot = @am__leading_dot@
297am__quote = @am__quote@
298am__tar = @am__tar@
299am__untar = @am__untar@
300bindir = @bindir@
301build = @build@
302build_alias = @build_alias@
303build_cpu = @build_cpu@
304build_os = @build_os@
305build_vendor = @build_vendor@
306builddir = @builddir@
307datadir = @datadir@
308datarootdir = @datarootdir@
309dlopen_libs = @dlopen_libs@
310docdir = @docdir@
311dvidir = @dvidir@
312edje_cc = @edje_cc@
313efl_doxygen = @efl_doxygen@
314efl_have_doxygen = @efl_have_doxygen@
315evas_engine_buffer_cflags = @evas_engine_buffer_cflags@
316evas_engine_buffer_libs = @evas_engine_buffer_libs@
317evas_engine_direct3d_cflags = @evas_engine_direct3d_cflags@
318evas_engine_direct3d_libs = @evas_engine_direct3d_libs@
319evas_engine_directfb_cflags = @evas_engine_directfb_cflags@
320evas_engine_directfb_libs = @evas_engine_directfb_libs@
321evas_engine_fb_cflags = @evas_engine_fb_cflags@
322evas_engine_fb_libs = @evas_engine_fb_libs@
323evas_engine_gl_cocoa_cflags = @evas_engine_gl_cocoa_cflags@
324evas_engine_gl_cocoa_libs = @evas_engine_gl_cocoa_libs@
325evas_engine_gl_common_libs = @evas_engine_gl_common_libs@
326evas_engine_gl_sdl_cflags = @evas_engine_gl_sdl_cflags@
327evas_engine_gl_sdl_libs = @evas_engine_gl_sdl_libs@
328evas_engine_gl_xcb_cflags = @evas_engine_gl_xcb_cflags@
329evas_engine_gl_xcb_libs = @evas_engine_gl_xcb_libs@
330evas_engine_gl_xlib_cflags = @evas_engine_gl_xlib_cflags@
331evas_engine_gl_xlib_libs = @evas_engine_gl_xlib_libs@
332evas_engine_psl1ght_cflags = @evas_engine_psl1ght_cflags@
333evas_engine_psl1ght_libs = @evas_engine_psl1ght_libs@
334evas_engine_software_16_ddraw_cflags = @evas_engine_software_16_ddraw_cflags@
335evas_engine_software_16_ddraw_libs = @evas_engine_software_16_ddraw_libs@
336evas_engine_software_16_sdl_cflags = @evas_engine_software_16_sdl_cflags@
337evas_engine_software_16_sdl_libs = @evas_engine_software_16_sdl_libs@
338evas_engine_software_16_wince_cflags = @evas_engine_software_16_wince_cflags@
339evas_engine_software_16_wince_libs = @evas_engine_software_16_wince_libs@
340evas_engine_software_16_x11_cflags = @evas_engine_software_16_x11_cflags@
341evas_engine_software_16_x11_libs = @evas_engine_software_16_x11_libs@
342evas_engine_software_8_x11_cflags = @evas_engine_software_8_x11_cflags@
343evas_engine_software_8_x11_libs = @evas_engine_software_8_x11_libs@
344evas_engine_software_ddraw_cflags = @evas_engine_software_ddraw_cflags@
345evas_engine_software_ddraw_libs = @evas_engine_software_ddraw_libs@
346evas_engine_software_gdi_cflags = @evas_engine_software_gdi_cflags@
347evas_engine_software_gdi_libs = @evas_engine_software_gdi_libs@
348evas_engine_software_sdl_cflags = @evas_engine_software_sdl_cflags@
349evas_engine_software_sdl_libs = @evas_engine_software_sdl_libs@
350evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@
351evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@
352evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@
353evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@
354evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@
355evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@
356evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@
357evas_image_loader_edb_libs = @evas_image_loader_edb_libs@
358evas_image_loader_eet_cflags = @evas_image_loader_eet_cflags@
359evas_image_loader_eet_libs = @evas_image_loader_eet_libs@
360evas_image_loader_generic_cflags = @evas_image_loader_generic_cflags@
361evas_image_loader_generic_libs = @evas_image_loader_generic_libs@
362evas_image_loader_gif_cflags = @evas_image_loader_gif_cflags@
363evas_image_loader_gif_libs = @evas_image_loader_gif_libs@
364evas_image_loader_ico_cflags = @evas_image_loader_ico_cflags@
365evas_image_loader_ico_libs = @evas_image_loader_ico_libs@
366evas_image_loader_jpeg_cflags = @evas_image_loader_jpeg_cflags@
367evas_image_loader_jpeg_libs = @evas_image_loader_jpeg_libs@
368evas_image_loader_pmaps_cflags = @evas_image_loader_pmaps_cflags@
369evas_image_loader_pmaps_libs = @evas_image_loader_pmaps_libs@
370evas_image_loader_png_cflags = @evas_image_loader_png_cflags@
371evas_image_loader_png_libs = @evas_image_loader_png_libs@
372evas_image_loader_psd_cflags = @evas_image_loader_psd_cflags@
373evas_image_loader_psd_libs = @evas_image_loader_psd_libs@
374evas_image_loader_svg_cflags = @evas_image_loader_svg_cflags@
375evas_image_loader_svg_libs = @evas_image_loader_svg_libs@
376evas_image_loader_tga_cflags = @evas_image_loader_tga_cflags@
377evas_image_loader_tga_libs = @evas_image_loader_tga_libs@
378evas_image_loader_tiff_cflags = @evas_image_loader_tiff_cflags@
379evas_image_loader_tiff_libs = @evas_image_loader_tiff_libs@
380evas_image_loader_wbmp_cflags = @evas_image_loader_wbmp_cflags@
381evas_image_loader_wbmp_libs = @evas_image_loader_wbmp_libs@
382evas_image_loader_xpm_cflags = @evas_image_loader_xpm_cflags@
383evas_image_loader_xpm_libs = @evas_image_loader_xpm_libs@
384exec_prefix = @exec_prefix@
385have_evas_engine_gl_x11 = @have_evas_engine_gl_x11@
386have_evas_engine_gl_xcb = @have_evas_engine_gl_xcb@
387have_evas_engine_gl_xlib = @have_evas_engine_gl_xlib@
388have_evas_engine_software_x11 = @have_evas_engine_software_x11@
389have_evas_engine_software_xcb = @have_evas_engine_software_xcb@
390have_evas_engine_software_xlib = @have_evas_engine_software_xlib@
391have_lcov = @have_lcov@
392host = @host@
393host_alias = @host_alias@
394host_cpu = @host_cpu@
395host_os = @host_os@
396host_vendor = @host_vendor@
397htmldir = @htmldir@
398includedir = @includedir@
399infodir = @infodir@
400install_sh = @install_sh@
401libdir = @libdir@
402libexecdir = @libexecdir@
403localedir = @localedir@
404localstatedir = @localstatedir@
405lt_ECHO = @lt_ECHO@
406lt_enable_auto_import = @lt_enable_auto_import@
407mandir = @mandir@
408mkdir_p = @mkdir_p@
409oldincludedir = @oldincludedir@
410pdfdir = @pdfdir@
411pkgconfig_requires_private = @pkgconfig_requires_private@
412prefix = @prefix@
413program_transform_name = @program_transform_name@
414psdir = @psdir@
415pthread_cflags = @pthread_cflags@
416pthread_libs = @pthread_libs@
417release_info = @release_info@
418requirement_evas = @requirement_evas@
419sbindir = @sbindir@
420sharedstatedir = @sharedstatedir@
421srcdir = @srcdir@
422sysconfdir = @sysconfdir@
423target_alias = @target_alias@
424top_build_prefix = @top_build_prefix@
425top_builddir = @top_builddir@
426top_srcdir = @top_srcdir@
427version_info = @version_info@
428SUBDIRS = evas_op_add evas_op_blend evas_op_copy evas_op_mask evas_op_mul evas_op_sub
429MAINTAINERCLEANFILES = Makefile.in
430AM_CPPFLAGS = -I. \
431 -I$(top_srcdir)/src/lib \
432 -I$(top_srcdir)/src/lib/cserve \
433 -I$(top_srcdir)/src/lib/include \
434 -DPACKAGE_BIN_DIR=\"$(bindir)\" \
435 -DPACKAGE_LIB_DIR=\"$(libdir)\" \
436 -DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
437 @FREETYPE_CFLAGS@ @VALGRIND_CFLAGS@ \
438 @PIXMAN_CFLAGS@ \
439 @EET_CFLAGS@ @pthread_cflags@ \
440 @WIN32_CFLAGS@ @EINA_CFLAGS@ \
441 @FRIBIDI_CFLAGS@ @HARFBUZZ_CFLAGS@ \
442 @PIXMAN_CFLAGS@
443
444noinst_LTLIBRARIES = libevas_engine_common.la
445libevas_engine_common_la_SOURCES = \
446evas_op_copy_main_.c \
447evas_op_blend_main_.c \
448evas_op_add_main_.c \
449evas_op_sub_main_.c \
450evas_op_mask_main_.c \
451evas_op_mul_main_.c \
452evas_blend_main.c \
453evas_blit_main.c \
454evas_convert_color.c \
455evas_convert_colorspace.c \
456evas_convert_gry_1.c \
457evas_convert_gry_4.c \
458evas_convert_gry_8.c \
459evas_convert_main.c \
460evas_convert_rgb_16.c \
461evas_convert_rgb_24.c \
462evas_convert_rgb_32.c \
463evas_convert_rgb_8.c \
464evas_convert_grypal_6.c \
465evas_convert_yuv.c \
466evas_cpu.c \
467evas_draw_main.c \
468evas_font_draw.c \
469evas_font_load.c \
470evas_font_main.c \
471evas_font_query.c \
472evas_image_load.c \
473evas_image_save.c \
474evas_image_main.c \
475evas_image_data.c \
476evas_image_scalecache.c \
477evas_line_main.c \
478evas_polygon_main.c \
479evas_rectangle_main.c \
480evas_scale_main.c \
481evas_scale_sample.c \
482evas_scale_smooth.c \
483evas_scale_span.c \
484evas_tiler.c \
485evas_regionbuf.c \
486evas_pipe.c \
487language/evas_bidi_utils.c \
488language/evas_language_utils.c \
489evas_text_utils.c \
490evas_font_ot.c \
491evas_map_image.c \
492evas_map_image.h
493
494EXTRA_DIST = \
495evas_blend.h \
496evas_blend_private.h \
497evas_convert_color.h \
498evas_convert_colorspace.h \
499evas_convert_gry_1.h \
500evas_convert_gry_4.h \
501evas_convert_gry_8.h \
502evas_convert_grypal_6.h \
503evas_convert_main.h \
504evas_convert_rgb_16.h \
505evas_convert_rgb_24.h \
506evas_convert_rgb_32.h \
507evas_convert_rgb_8.h \
508evas_convert_yuv.h \
509evas_draw.h \
510evas_font.h \
511evas_font_default_walk.x \
512evas_font_private.h \
513evas_image.h \
514evas_image_private.h \
515evas_line.h \
516evas_polygon.h \
517evas_rectangle.h \
518evas_scale_main.h \
519evas_scale_smooth.h \
520evas_scale_smooth_scaler.c \
521evas_scale_smooth_scaler_down.c \
522evas_scale_smooth_scaler_downx.c \
523evas_scale_smooth_scaler_downx_downy.c \
524evas_scale_smooth_scaler_downy.c \
525evas_scale_smooth_scaler_noscale.c \
526evas_scale_smooth_scaler_up.c \
527evas_scale_span.h \
528evas_pipe.h \
529language/evas_bidi_utils.h \
530language/evas_language_utils.h \
531language/evas_script_table.h \
532evas_text_utils.h \
533evas_font_ot.h \
534evas_map_image_internal.c \
535evas_map_image_core.c \
536evas_map_image_loop.c
537
538libevas_engine_common_la_DEPENDENCIES = \
539$(top_builddir)/config.h
540
541libevas_engine_common_la_LIBADD = \
542evas_op_blend/libevas_engine_common_op_blend_master_sse3.la
543
544all: all-recursive
545
546.SUFFIXES:
547.SUFFIXES: .c .lo .o .obj
548$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
549 @for dep in $?; do \
550 case '$(am__configure_deps)' in \
551 *$$dep*) \
552 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
553 && { if test -f $@; then exit 0; else break; fi; }; \
554 exit 1;; \
555 esac; \
556 done; \
557 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/engines/common/Makefile'; \
558 $(am__cd) $(top_srcdir) && \
559 $(AUTOMAKE) --gnu src/lib/engines/common/Makefile
560.PRECIOUS: Makefile
561Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
562 @case '$?' in \
563 *config.status*) \
564 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
565 *) \
566 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
567 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
568 esac;
569
570$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
571 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
572
573$(top_srcdir)/configure: $(am__configure_deps)
574 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
575$(ACLOCAL_M4): $(am__aclocal_m4_deps)
576 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
577$(am__aclocal_m4_deps):
578
579clean-noinstLTLIBRARIES:
580 -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
581 @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
582 dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
583 test "$$dir" != "$$p" || dir=.; \
584 echo "rm -f \"$${dir}/so_locations\""; \
585 rm -f "$${dir}/so_locations"; \
586 done
587libevas_engine_common.la: $(libevas_engine_common_la_OBJECTS) $(libevas_engine_common_la_DEPENDENCIES)
588 $(AM_V_CCLD)$(LINK) $(libevas_engine_common_la_OBJECTS) $(libevas_engine_common_la_LIBADD) $(LIBS)
589
590mostlyclean-compile:
591 -rm -f *.$(OBJEXT)
592
593distclean-compile:
594 -rm -f *.tab.c
595
596@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_bidi_utils.Plo@am__quote@
597@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_blend_main.Plo@am__quote@
598@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_blit_main.Plo@am__quote@
599@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_convert_color.Plo@am__quote@
600@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_convert_colorspace.Plo@am__quote@
601@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_convert_gry_1.Plo@am__quote@
602@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_convert_gry_4.Plo@am__quote@
603@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_convert_gry_8.Plo@am__quote@
604@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_convert_grypal_6.Plo@am__quote@
605@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_convert_main.Plo@am__quote@
606@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_convert_rgb_16.Plo@am__quote@
607@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_convert_rgb_24.Plo@am__quote@
608@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_convert_rgb_32.Plo@am__quote@
609@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_convert_rgb_8.Plo@am__quote@
610@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_convert_yuv.Plo@am__quote@
611@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_cpu.Plo@am__quote@
612@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_draw_main.Plo@am__quote@
613@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_font_draw.Plo@am__quote@
614@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_font_load.Plo@am__quote@
615@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_font_main.Plo@am__quote@
616@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_font_ot.Plo@am__quote@
617@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_font_query.Plo@am__quote@
618@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_image_data.Plo@am__quote@
619@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_image_load.Plo@am__quote@
620@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_image_main.Plo@am__quote@
621@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_image_save.Plo@am__quote@
622@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_image_scalecache.Plo@am__quote@
623@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_language_utils.Plo@am__quote@
624@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_line_main.Plo@am__quote@
625@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_map_image.Plo@am__quote@
626@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_op_add_main_.Plo@am__quote@
627@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_op_blend_main_.Plo@am__quote@
628@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_op_copy_main_.Plo@am__quote@
629@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_op_mask_main_.Plo@am__quote@
630@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_op_mul_main_.Plo@am__quote@
631@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_op_sub_main_.Plo@am__quote@
632@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_pipe.Plo@am__quote@
633@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_polygon_main.Plo@am__quote@
634@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_rectangle_main.Plo@am__quote@
635@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_regionbuf.Plo@am__quote@
636@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_scale_main.Plo@am__quote@
637@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_scale_sample.Plo@am__quote@
638@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_scale_smooth.Plo@am__quote@
639@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_scale_span.Plo@am__quote@
640@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_text_utils.Plo@am__quote@
641@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_tiler.Plo@am__quote@
642
643.c.o:
644@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
645@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
646@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
647@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
648@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
649@am__fastdepCC_FALSE@ $(COMPILE) -c $<
650
651.c.obj:
652@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
653@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
654@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
655@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
656@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
657@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
658
659.c.lo:
660@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
661@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
662@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
663@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
664@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
665@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
666
667evas_bidi_utils.lo: language/evas_bidi_utils.c
668@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT evas_bidi_utils.lo -MD -MP -MF $(DEPDIR)/evas_bidi_utils.Tpo -c -o evas_bidi_utils.lo `test -f 'language/evas_bidi_utils.c' || echo '$(srcdir)/'`language/evas_bidi_utils.c
669@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/evas_bidi_utils.Tpo $(DEPDIR)/evas_bidi_utils.Plo
670@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
671@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='language/evas_bidi_utils.c' object='evas_bidi_utils.lo' libtool=yes @AMDEPBACKSLASH@
672@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
673@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o evas_bidi_utils.lo `test -f 'language/evas_bidi_utils.c' || echo '$(srcdir)/'`language/evas_bidi_utils.c
674
675evas_language_utils.lo: language/evas_language_utils.c
676@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT evas_language_utils.lo -MD -MP -MF $(DEPDIR)/evas_language_utils.Tpo -c -o evas_language_utils.lo `test -f 'language/evas_language_utils.c' || echo '$(srcdir)/'`language/evas_language_utils.c
677@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/evas_language_utils.Tpo $(DEPDIR)/evas_language_utils.Plo
678@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
679@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='language/evas_language_utils.c' object='evas_language_utils.lo' libtool=yes @AMDEPBACKSLASH@
680@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
681@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o evas_language_utils.lo `test -f 'language/evas_language_utils.c' || echo '$(srcdir)/'`language/evas_language_utils.c
682
683mostlyclean-libtool:
684 -rm -f *.lo
685
686clean-libtool:
687 -rm -rf .libs _libs
688
689# This directory's subdirectories are mostly independent; you can cd
690# into them and run `make' without going through this Makefile.
691# To change the values of `make' variables: instead of editing Makefiles,
692# (1) if the variable is set in `config.status', edit `config.status'
693# (which will cause the Makefiles to be regenerated when you run `make');
694# (2) otherwise, pass the desired values on the `make' command line.
695$(RECURSIVE_TARGETS):
696 @fail= failcom='exit 1'; \
697 for f in x $$MAKEFLAGS; do \
698 case $$f in \
699 *=* | --[!k]*);; \
700 *k*) failcom='fail=yes';; \
701 esac; \
702 done; \
703 dot_seen=no; \
704 target=`echo $@ | sed s/-recursive//`; \
705 list='$(SUBDIRS)'; for subdir in $$list; do \
706 echo "Making $$target in $$subdir"; \
707 if test "$$subdir" = "."; then \
708 dot_seen=yes; \
709 local_target="$$target-am"; \
710 else \
711 local_target="$$target"; \
712 fi; \
713 ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
714 || eval $$failcom; \
715 done; \
716 if test "$$dot_seen" = "no"; then \
717 $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
718 fi; test -z "$$fail"
719
720$(RECURSIVE_CLEAN_TARGETS):
721 @fail= failcom='exit 1'; \
722 for f in x $$MAKEFLAGS; do \
723 case $$f in \
724 *=* | --[!k]*);; \
725 *k*) failcom='fail=yes';; \
726 esac; \
727 done; \
728 dot_seen=no; \
729 case "$@" in \
730 distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
731 *) list='$(SUBDIRS)' ;; \
732 esac; \
733 rev=''; for subdir in $$list; do \
734 if test "$$subdir" = "."; then :; else \
735 rev="$$subdir $$rev"; \
736 fi; \
737 done; \
738 rev="$$rev ."; \
739 target=`echo $@ | sed s/-recursive//`; \
740 for subdir in $$rev; do \
741 echo "Making $$target in $$subdir"; \
742 if test "$$subdir" = "."; then \
743 local_target="$$target-am"; \
744 else \
745 local_target="$$target"; \
746 fi; \
747 ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
748 || eval $$failcom; \
749 done && test -z "$$fail"
750tags-recursive:
751 list='$(SUBDIRS)'; for subdir in $$list; do \
752 test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
753 done
754ctags-recursive:
755 list='$(SUBDIRS)'; for subdir in $$list; do \
756 test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
757 done
758
759ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
760 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
761 unique=`for i in $$list; do \
762 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
763 done | \
764 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
765 END { if (nonempty) { for (i in files) print i; }; }'`; \
766 mkid -fID $$unique
767tags: TAGS
768
769TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
770 $(TAGS_FILES) $(LISP)
771 set x; \
772 here=`pwd`; \
773 if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
774 include_option=--etags-include; \
775 empty_fix=.; \
776 else \
777 include_option=--include; \
778 empty_fix=; \
779 fi; \
780 list='$(SUBDIRS)'; for subdir in $$list; do \
781 if test "$$subdir" = .; then :; else \
782 test ! -f $$subdir/TAGS || \
783 set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
784 fi; \
785 done; \
786 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
787 unique=`for i in $$list; do \
788 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
789 done | \
790 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
791 END { if (nonempty) { for (i in files) print i; }; }'`; \
792 shift; \
793 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
794 test -n "$$unique" || unique=$$empty_fix; \
795 if test $$# -gt 0; then \
796 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
797 "$$@" $$unique; \
798 else \
799 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
800 $$unique; \
801 fi; \
802 fi
803ctags: CTAGS
804CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
805 $(TAGS_FILES) $(LISP)
806 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
807 unique=`for i in $$list; do \
808 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
809 done | \
810 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
811 END { if (nonempty) { for (i in files) print i; }; }'`; \
812 test -z "$(CTAGS_ARGS)$$unique" \
813 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
814 $$unique
815
816GTAGS:
817 here=`$(am__cd) $(top_builddir) && pwd` \
818 && $(am__cd) $(top_srcdir) \
819 && gtags -i $(GTAGS_ARGS) "$$here"
820
821distclean-tags:
822 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
823
824distdir: $(DISTFILES)
825 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
826 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
827 list='$(DISTFILES)'; \
828 dist_files=`for file in $$list; do echo $$file; done | \
829 sed -e "s|^$$srcdirstrip/||;t" \
830 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
831 case $$dist_files in \
832 */*) $(MKDIR_P) `echo "$$dist_files" | \
833 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
834 sort -u` ;; \
835 esac; \
836 for file in $$dist_files; do \
837 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
838 if test -d $$d/$$file; then \
839 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
840 if test -d "$(distdir)/$$file"; then \
841 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
842 fi; \
843 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
844 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
845 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
846 fi; \
847 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
848 else \
849 test -f "$(distdir)/$$file" \
850 || cp -p $$d/$$file "$(distdir)/$$file" \
851 || exit 1; \
852 fi; \
853 done
854 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
855 if test "$$subdir" = .; then :; else \
856 test -d "$(distdir)/$$subdir" \
857 || $(MKDIR_P) "$(distdir)/$$subdir" \
858 || exit 1; \
859 fi; \
860 done
861 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
862 if test "$$subdir" = .; then :; else \
863 dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
864 $(am__relativize); \
865 new_distdir=$$reldir; \
866 dir1=$$subdir; dir2="$(top_distdir)"; \
867 $(am__relativize); \
868 new_top_distdir=$$reldir; \
869 echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
870 echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
871 ($(am__cd) $$subdir && \
872 $(MAKE) $(AM_MAKEFLAGS) \
873 top_distdir="$$new_top_distdir" \
874 distdir="$$new_distdir" \
875 am__remove_distdir=: \
876 am__skip_length_check=: \
877 am__skip_mode_fix=: \
878 distdir) \
879 || exit 1; \
880 fi; \
881 done
882check-am: all-am
883check: check-recursive
884all-am: Makefile $(LTLIBRARIES)
885installdirs: installdirs-recursive
886installdirs-am:
887install: install-recursive
888install-exec: install-exec-recursive
889install-data: install-data-recursive
890uninstall: uninstall-recursive
891
892install-am: all-am
893 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
894
895installcheck: installcheck-recursive
896install-strip:
897 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
898 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
899 `test -z '$(STRIP)' || \
900 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
901mostlyclean-generic:
902
903clean-generic:
904
905distclean-generic:
906 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
907 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
908
909maintainer-clean-generic:
910 @echo "This command is intended for maintainers to use"
911 @echo "it deletes files that may require special tools to rebuild."
912 -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
913clean: clean-recursive
914
915clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
916 mostlyclean-am
917
918distclean: distclean-recursive
919 -rm -rf ./$(DEPDIR)
920 -rm -f Makefile
921distclean-am: clean-am distclean-compile distclean-generic \
922 distclean-tags
923
924dvi: dvi-recursive
925
926dvi-am:
927
928html: html-recursive
929
930html-am:
931
932info: info-recursive
933
934info-am:
935
936install-data-am:
937
938install-dvi: install-dvi-recursive
939
940install-dvi-am:
941
942install-exec-am:
943
944install-html: install-html-recursive
945
946install-html-am:
947
948install-info: install-info-recursive
949
950install-info-am:
951
952install-man:
953
954install-pdf: install-pdf-recursive
955
956install-pdf-am:
957
958install-ps: install-ps-recursive
959
960install-ps-am:
961
962installcheck-am:
963
964maintainer-clean: maintainer-clean-recursive
965 -rm -rf ./$(DEPDIR)
966 -rm -f Makefile
967maintainer-clean-am: distclean-am maintainer-clean-generic
968
969mostlyclean: mostlyclean-recursive
970
971mostlyclean-am: mostlyclean-compile mostlyclean-generic \
972 mostlyclean-libtool
973
974pdf: pdf-recursive
975
976pdf-am:
977
978ps: ps-recursive
979
980ps-am:
981
982uninstall-am:
983
984.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
985 install-am install-strip tags-recursive
986
987.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
988 all all-am check check-am clean clean-generic clean-libtool \
989 clean-noinstLTLIBRARIES ctags ctags-recursive distclean \
990 distclean-compile distclean-generic distclean-libtool \
991 distclean-tags distdir dvi dvi-am html html-am info info-am \
992 install install-am install-data install-data-am install-dvi \
993 install-dvi-am install-exec install-exec-am install-html \
994 install-html-am install-info install-info-am install-man \
995 install-pdf install-pdf-am install-ps install-ps-am \
996 install-strip installcheck installcheck-am installdirs \
997 installdirs-am maintainer-clean maintainer-clean-generic \
998 mostlyclean mostlyclean-compile mostlyclean-generic \
999 mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
1000 uninstall uninstall-am
1001
1002
1003# Tell versions [3.59,3.63) of GNU make to not export all variables.
1004# Otherwise a system limit (for SysV at least) may be exceeded.
1005.NOEXPORT:
diff --git a/libraries/evas/src/lib/engines/common/evas_blend.h b/libraries/evas/src/lib/engines/common/evas_blend.h
new file mode 100644
index 0000000..1a98f3f
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_blend.h
@@ -0,0 +1,8 @@
1#ifndef _EVAS_BLEND_H
2#define _EVAS_BLEND_H
3
4
5EAPI void evas_common_blend_init (void);
6
7
8#endif /* _EVAS_BLEND_H */
diff --git a/libraries/evas/src/lib/engines/common/evas_blend_main.c b/libraries/evas/src/lib/engines/common/evas_blend_main.c
new file mode 100644
index 0000000..4aadd02
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_blend_main.c
@@ -0,0 +1,325 @@
1#include "evas_common.h"
2#include "evas_blend_private.h"
3
4#if defined BUILD_MMX || defined BUILD_SSE
5#include "evas_mmx.h"
6#endif
7
8const DATA32 ALPHA_255 = 255;
9const DATA32 ALPHA_256 = 256;
10
11static void
12_composite_span_nothing(DATA32 *s __UNUSED__, DATA8 *m __UNUSED__, DATA32 c __UNUSED__, DATA32 *d __UNUSED__, int l __UNUSED__)
13{
14}
15
16static void
17_composite_pt_nothing(DATA32 s __UNUSED__, DATA8 m __UNUSED__, DATA32 c __UNUSED__, DATA32 *d __UNUSED__)
18{
19}
20
21static RGBA_Gfx_Compositor *
22evas_gfx_compositor_get(unsigned char op)
23{
24 RGBA_Gfx_Compositor *comp;
25
26 switch (op)
27 {
28 case _EVAS_RENDER_BLEND:
29 comp = evas_common_gfx_compositor_blend_get();
30 break;
31 case _EVAS_RENDER_BLEND_REL:
32 comp = evas_common_gfx_compositor_blend_rel_get();
33 break;
34 case _EVAS_RENDER_COPY:
35 comp = evas_common_gfx_compositor_copy_get();
36 break;
37 case _EVAS_RENDER_COPY_REL:
38 comp = evas_common_gfx_compositor_copy_rel_get();
39 break;
40/*
41 case _EVAS_RENDER_ADD:
42 comp = evas_common_gfx_compositor_add_get();
43 break;
44 case _EVAS_RENDER_ADD_REL:
45 comp = evas_common_gfx_compositor_add_rel_get();
46 break;
47 case _EVAS_RENDER_SUB:
48 comp = evas_common_gfx_compositor_sub_get();
49 break;
50 case _EVAS_RENDER_SUB_REL:
51 comp = evas_common_gfx_compositor_sub_rel_get();
52 break;
53*/
54 case _EVAS_RENDER_MASK:
55 comp = evas_common_gfx_compositor_mask_get();
56 break;
57 case _EVAS_RENDER_MUL:
58 comp = evas_common_gfx_compositor_mul_get();
59 break;
60 default:
61 comp = evas_common_gfx_compositor_blend_get();
62 break;
63 }
64 return comp;
65}
66
67EAPI void
68evas_common_blend_init(void)
69{
70 static int gfx_initialised = 0;
71 static int mmx = 0;
72 static int sse = 0;
73 static int sse2 = 0;
74 RGBA_Gfx_Compositor *comp;
75
76 if (gfx_initialised) return;
77 gfx_initialised = 1;
78
79 evas_common_cpu_can_do(&mmx, &sse, &sse2);
80
81 comp = evas_common_gfx_compositor_copy_get();
82 if (comp) comp->init();
83 comp = evas_common_gfx_compositor_copy_rel_get();
84 if (comp) comp->init();
85
86 comp = evas_common_gfx_compositor_blend_get();
87 if (comp) comp->init();
88 comp = evas_common_gfx_compositor_blend_rel_get();
89 if (comp) comp->init();
90
91/*
92 comp = evas_common_gfx_compositor_add_get();
93 if (comp) comp->init();
94 comp = evas_common_gfx_compositor_add_rel_get();
95 if (comp) comp->init();
96 comp = evas_common_gfx_compositor_sub_get();
97 if (comp) comp->init();
98 comp = evas_common_gfx_compositor_sub_rel_get();
99 if (comp) comp->init();
100*/
101 comp = evas_common_gfx_compositor_mask_get();
102 if (comp) comp->init();
103
104 comp = evas_common_gfx_compositor_mul_get();
105 if (comp) comp->init();
106}
107
108void
109evas_common_blend_shutdown(void)
110{
111 RGBA_Gfx_Compositor *comp;
112
113 comp = evas_common_gfx_compositor_copy_get();
114 if (comp) comp->shutdown();
115 comp = evas_common_gfx_compositor_copy_rel_get();
116 if (comp) comp->shutdown();
117
118 comp = evas_common_gfx_compositor_blend_get();
119 if (comp) comp->shutdown();
120 comp = evas_common_gfx_compositor_blend_rel_get();
121 if (comp) comp->shutdown();
122
123/*
124 comp = evas_common_gfx_compositor_add_get();
125 if (comp) comp->shutdown();
126 comp = evas_common_gfx_compositor_add_rel_get();
127 if (comp) comp->shutdown();
128 comp = evas_common_gfx_compositor_sub_get();
129 if (comp) comp->shutdown();
130 comp = evas_common_gfx_compositor_sub_rel_get();
131 if (comp) comp->shutdown();
132*/
133 comp = evas_common_gfx_compositor_mask_get();
134 if (comp) comp->shutdown();
135
136 comp = evas_common_gfx_compositor_mul_get();
137 if (comp) comp->shutdown();
138}
139
140
141RGBA_Gfx_Func
142evas_common_gfx_func_composite_pixel_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels, int op)
143{
144 RGBA_Gfx_Compositor *comp;
145 RGBA_Gfx_Func func = NULL;
146
147 if (src && (!src->cache_entry.flags.alpha))
148 {
149 if (op == _EVAS_RENDER_BLEND)
150 op = _EVAS_RENDER_COPY;
151 if (op == _EVAS_RENDER_BLEND_REL)
152 op = _EVAS_RENDER_COPY_REL;
153 }
154 comp = evas_gfx_compositor_get(op);
155 if (comp)
156 func = comp->composite_pixel_span_get(src, dst, pixels);
157 if (func)
158 return func;
159 return _composite_span_nothing;
160}
161
162RGBA_Gfx_Func
163evas_common_gfx_func_composite_color_span_get(DATA32 col, RGBA_Image *dst, int pixels, int op)
164{
165 RGBA_Gfx_Compositor *comp;
166 RGBA_Gfx_Func func = NULL;
167
168 if ((col & 0xff000000) == 0xff000000)
169 {
170 if (op == _EVAS_RENDER_BLEND)
171 op = _EVAS_RENDER_COPY;
172 if (op == EVAS_RENDER_BLEND_REL)
173 op = _EVAS_RENDER_COPY_REL;
174 }
175
176 comp = evas_gfx_compositor_get(op);
177 if (comp)
178 func = comp->composite_color_span_get(col, dst, pixels);
179 if (func)
180 return func;
181 return _composite_span_nothing;
182}
183
184RGBA_Gfx_Func
185evas_common_gfx_func_composite_pixel_color_span_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels, int op)
186{
187 RGBA_Gfx_Compositor *comp;
188 RGBA_Gfx_Func func = NULL;
189
190 if ((src && (!src->cache_entry.flags.alpha)) && ((col & 0xff000000) == 0xff000000))
191 {
192 if (op == _EVAS_RENDER_BLEND)
193 op = _EVAS_RENDER_COPY;
194 if (op == _EVAS_RENDER_BLEND_REL)
195 op = _EVAS_RENDER_COPY_REL;
196 }
197
198 comp = evas_gfx_compositor_get(op);
199 if (comp)
200 func = comp->composite_pixel_color_span_get(src, col, dst, pixels);
201 if (func)
202 return func;
203 return _composite_span_nothing;
204}
205
206RGBA_Gfx_Func
207evas_common_gfx_func_composite_mask_color_span_get(DATA32 col, RGBA_Image *dst, int pixels, int op)
208{
209 RGBA_Gfx_Compositor *comp;
210 RGBA_Gfx_Func func = NULL;
211
212 comp = evas_gfx_compositor_get(op);
213 if (comp)
214 func = comp->composite_mask_color_span_get(col, dst, pixels);
215 if (func)
216 return func;
217 return _composite_span_nothing;
218}
219
220RGBA_Gfx_Func
221evas_common_gfx_func_composite_pixel_mask_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels, int op)
222{
223 RGBA_Gfx_Compositor *comp;
224 RGBA_Gfx_Func func = NULL;
225
226 comp = evas_gfx_compositor_get(op);
227 if (comp)
228 func = comp->composite_pixel_mask_span_get(src, dst, pixels);
229 if (func)
230 return func;
231 return _composite_span_nothing;
232}
233
234RGBA_Gfx_Pt_Func
235evas_common_gfx_func_composite_pixel_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst, int op)
236{
237 RGBA_Gfx_Compositor *comp;
238 RGBA_Gfx_Pt_Func func = NULL;
239
240 if (!src_flags.alpha)
241 {
242 if (op == _EVAS_RENDER_BLEND)
243 op = _EVAS_RENDER_COPY;
244 if (op == _EVAS_RENDER_BLEND_REL)
245 op = _EVAS_RENDER_COPY_REL;
246 }
247 comp = evas_gfx_compositor_get(op);
248 if (comp)
249 func = comp->composite_pixel_pt_get(src_flags, dst);
250 if (func)
251 return func;
252 return _composite_pt_nothing;
253}
254
255RGBA_Gfx_Pt_Func
256evas_common_gfx_func_composite_color_pt_get(DATA32 col, RGBA_Image *dst, int op)
257{
258 RGBA_Gfx_Compositor *comp;
259 RGBA_Gfx_Pt_Func func = NULL;
260
261 if ((col & 0xff000000) == 0xff000000)
262 {
263 if (op == _EVAS_RENDER_BLEND)
264 op = _EVAS_RENDER_COPY;
265 if (op == EVAS_RENDER_BLEND_REL)
266 op = _EVAS_RENDER_COPY_REL;
267 }
268
269 comp = evas_gfx_compositor_get(op);
270 if (comp)
271 func = comp->composite_color_pt_get(col, dst);
272 if (func)
273 return func;
274 return _composite_pt_nothing;
275}
276
277RGBA_Gfx_Pt_Func
278evas_common_gfx_func_composite_pixel_color_pt_get(Image_Entry_Flags src_flags, DATA32 col, RGBA_Image *dst, int op)
279{
280 RGBA_Gfx_Compositor *comp;
281 RGBA_Gfx_Pt_Func func = NULL;
282
283 if ((!src_flags.alpha) && ((col & 0xff000000) == 0xff000000))
284 {
285 if (op == _EVAS_RENDER_BLEND)
286 op = _EVAS_RENDER_COPY;
287 if (op == _EVAS_RENDER_BLEND_REL)
288 op = _EVAS_RENDER_COPY_REL;
289 }
290
291 comp = evas_gfx_compositor_get(op);
292 if (comp)
293 func = comp->composite_pixel_color_pt_get(src_flags, col, dst);
294 if (func)
295 return func;
296 return _composite_pt_nothing;
297}
298
299RGBA_Gfx_Pt_Func
300evas_common_gfx_func_composite_mask_color_pt_get(DATA32 col, RGBA_Image *dst, int op)
301{
302 RGBA_Gfx_Compositor *comp;
303 RGBA_Gfx_Pt_Func func = NULL;
304
305 comp = evas_gfx_compositor_get(op);
306 if (comp)
307 func = comp->composite_mask_color_pt_get(col, dst);
308 if (func)
309 return func;
310 return _composite_pt_nothing;
311}
312
313RGBA_Gfx_Pt_Func
314evas_common_gfx_func_composite_pixel_mask_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst, int op)
315{
316 RGBA_Gfx_Compositor *comp;
317 RGBA_Gfx_Pt_Func func = NULL;
318
319 comp = evas_gfx_compositor_get(op);
320 if (comp)
321 func = comp->composite_pixel_mask_pt_get(src_flags, dst);
322 if (func)
323 return func;
324 return _composite_pt_nothing;
325}
diff --git a/libraries/evas/src/lib/engines/common/evas_blend_private.h b/libraries/evas/src/lib/engines/common/evas_blend_private.h
new file mode 100644
index 0000000..1d14951
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_blend_private.h
@@ -0,0 +1,31 @@
1#ifndef _EVAS_BLEND_PRIVATE_H
2#define _EVAS_BLEND_PRIVATE_H
3
4
5RGBA_Gfx_Compositor *evas_common_gfx_compositor_blend_get (void);
6RGBA_Gfx_Compositor *evas_common_gfx_compositor_blend_rel_get (void);
7RGBA_Gfx_Compositor *evas_common_gfx_compositor_copy_get (void);
8RGBA_Gfx_Compositor *evas_common_gfx_compositor_copy_rel_get (void);
9RGBA_Gfx_Compositor *evas_common_gfx_compositor_add_get (void);
10RGBA_Gfx_Compositor *evas_common_gfx_compositor_add_rel_get (void);
11/*
12RGBA_Gfx_Compositor *evas_common_gfx_compositor_sub_get(void);
13RGBA_Gfx_Compositor *evas_common_gfx_compositor_sub_rel_get(void);
14*/
15RGBA_Gfx_Compositor *evas_common_gfx_compositor_mask_get (void);
16RGBA_Gfx_Compositor *evas_common_gfx_compositor_mul_get (void);
17
18RGBA_Gfx_Func evas_common_gfx_func_composite_pixel_span_get (RGBA_Image *src, RGBA_Image *dst, int pixels, int op);
19RGBA_Gfx_Func evas_common_gfx_func_composite_color_span_get (DATA32 col, RGBA_Image *dst, int pixels, int op);
20RGBA_Gfx_Func evas_common_gfx_func_composite_pixel_color_span_get (RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels, int op);
21RGBA_Gfx_Func evas_common_gfx_func_composite_mask_color_span_get (DATA32 col, RGBA_Image *dst, int pixels, int op);
22RGBA_Gfx_Func evas_common_gfx_func_composite_pixel_mask_span_get (RGBA_Image *src, RGBA_Image *dst, int pixels, int op);
23
24RGBA_Gfx_Pt_Func evas_common_gfx_func_composite_pixel_pt_get (Image_Entry_Flags src_flags, RGBA_Image *dst, int op);
25RGBA_Gfx_Pt_Func evas_common_gfx_func_composite_color_pt_get (DATA32 col, RGBA_Image *dst, int op);
26RGBA_Gfx_Pt_Func evas_common_gfx_func_composite_pixel_color_pt_get (Image_Entry_Flags src_flags, DATA32 col, RGBA_Image *dst, int op);
27RGBA_Gfx_Pt_Func evas_common_gfx_func_composite_mask_color_pt_get (DATA32 col, RGBA_Image *dst, int op);
28RGBA_Gfx_Pt_Func evas_common_gfx_func_composite_pixel_mask_pt_get (Image_Entry_Flags src_flags, RGBA_Image *dst, int op);
29
30
31#endif /* _EVAS_BLEND_PRIVATE_H */
diff --git a/libraries/evas/src/lib/engines/common/evas_blit_main.c b/libraries/evas/src/lib/engines/common/evas_blit_main.c
new file mode 100644
index 0000000..4c077b3
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_blit_main.c
@@ -0,0 +1,700 @@
1#include "evas_common.h"
2
3#if defined BUILD_MMX || defined BUILD_SSE
4#include "evas_mmx.h"
5#endif
6
7#define ALIGN_FIX
8
9static void evas_common_copy_pixels_c (DATA32 *src, DATA32 *dst, int len);
10static void evas_common_copy_pixels_mmx (DATA32 *src, DATA32 *dst, int len);
11static void evas_common_copy_pixels_mmx2 (DATA32 *src, DATA32 *dst, int len);
12static void evas_common_copy_pixels_sse/*NB*/ (DATA32 *src, DATA32 *dst, int len);
13
14#ifdef BUILD_NEON
15static void evas_common_copy_pixels_neon (DATA32 *src, DATA32 *dst, int len);
16static void evas_common_copy_pixels_rev_neon (DATA32 *src, DATA32 *dst, int len);
17#endif
18
19static void evas_common_copy_pixels_rev_c (DATA32 *src, DATA32 *dst, int len);
20static void evas_common_copy_pixels_rev_mmx (DATA32 *src, DATA32 *dst, int len);
21static void evas_common_copy_pixels_rev_sse/*NB*/ (DATA32 *src, DATA32 *dst, int len);
22
23static void evas_common_copy_rev_pixels_c (DATA32 *src, DATA32 *dst, int len);
24
25
26EAPI void
27evas_common_blit_init(void)
28{
29}
30
31EAPI void
32evas_common_blit_rectangle(const RGBA_Image *src, RGBA_Image *dst, int src_x, int src_y, int w, int h, int dst_x, int dst_y)
33{
34 int y;
35 Gfx_Func_Copy func;
36 DATA32 *src_ptr, *dst_ptr;
37
38 /* clip clip clip */
39 if (w <= 0) return;
40 if (src_x + w > (int)src->cache_entry.w) w = src->cache_entry.w - src_x;
41 if (w <= 0) return;
42 if (src_x < 0)
43 {
44 dst_x -= src_x;
45 w += src_x;
46 src_x = 0;
47 }
48 if (w <= 0) return;
49
50 if (h <= 0) return;
51 if (src_y + h > (int)src->cache_entry.h) h = src->cache_entry.h - src_y;
52 if (h <= 0) return;
53 if (src_y < 0)
54 {
55 dst_y -= src_y;
56 h += src_y;
57 src_y = 0;
58 }
59 if (h <= 0) return;
60
61 if (w <= 0) return;
62 if (dst_x + w > (int)dst->cache_entry.w) w = dst->cache_entry.w - dst_x;
63 if (w <= 0) return;
64 if (dst_x < 0)
65 {
66 src_x -= dst_x;
67 w += dst_x;
68 dst_x = 0;
69 }
70 if (w <= 0) return;
71
72 if (h <= 0) return;
73 if (dst_y + h > (int)dst->cache_entry.h) h = dst->cache_entry.h - dst_y;
74 if (h <= 0) return;
75 if (dst_y < 0)
76 {
77 src_y -= dst_y;
78 h += dst_y;
79 dst_y = 0;
80 }
81 if (h <= 0) return;
82
83 if (dst == src)
84 {
85 /* src after dst - go forward */
86 if (((src_y * src->cache_entry.w) + src_x) > ((dst_y * dst->cache_entry.w) + dst_x))
87 {
88 func = evas_common_draw_func_copy_get(w, 0);
89 for (y = 0; y < h; y++)
90 {
91 src_ptr = src->image.data + ((y + src_y) * src->cache_entry.w) + src_x;
92 dst_ptr = dst->image.data + ((y + dst_y) * dst->cache_entry.w) + dst_x;
93 func(src_ptr, dst_ptr, w);
94 }
95 }
96 /* reverse */
97 else
98 {
99 func = evas_common_draw_func_copy_get(w, 1);
100 for (y = h - 1; y >= 0; y--)
101 {
102 src_ptr = src->image.data + ((y + src_y) * src->cache_entry.w) + src_x;
103 dst_ptr = dst->image.data + ((y + dst_y) * dst->cache_entry.w) + dst_x;
104 func(src_ptr, dst_ptr, w);
105 }
106 }
107 }
108 else
109 {
110 func = evas_common_draw_func_copy_get(w, 0);
111 for (y = 0; y < h; y++)
112 {
113 src_ptr = src->image.data + ((y + src_y) * src->cache_entry.w) + src_x;
114 dst_ptr = dst->image.data + ((y + dst_y) * dst->cache_entry.w) + dst_x;
115 func(src_ptr, dst_ptr, w);
116 }
117 }
118}
119
120/****************************************************************************/
121
122static void
123evas_common_copy_rev_pixels_c(DATA32 *src, DATA32 *dst, int len)
124{
125 DATA32 *dst_end = dst + len;
126
127 src += len - 1;
128 while (dst < dst_end) *dst++ = *src--;
129}
130
131
132#ifdef BUILD_NEON
133static void
134evas_common_copy_pixels_rev_neon(DATA32 *src, DATA32 *dst, int len)
135{
136 uint32_t *tmp = (void *)37;
137#define AP "evas_common_copy_rev_pixels_neon_"
138 asm volatile (
139 ".fpu neon \n\t"
140 // Can we do 32 byte?
141 "andS %[tmp], %[d], $0x1f \n\t"
142 "beq "AP"quadstart \n\t"
143
144 // Can we do at least 16 byte?
145 "andS %[tmp], %[d], $0x4 \n\t"
146 "beq "AP"dualstart \n\t"
147
148 // Only once
149 AP"singleloop: \n\t"
150 "sub %[s], #4 \n\t"
151 "vld1.32 d0[0], [%[s]] \n\t"
152 "vst1.32 d0[0], [%[d]]! \n\t"
153
154 // Up to 3 times
155 AP"dualstart: \n\t"
156 "sub %[tmp], %[e], %[d] \n\t"
157 "cmp %[tmp], #31 \n\t"
158 "blt "AP"loopout \n\t"
159
160 "andS %[tmp], %[d], $0x1f \n\t"
161 "beq "AP"quadstart \n\t"
162
163 AP"dualloop: \n\t"
164 "sub %[s], #8 \n\t"
165 "vldm %[s], {d0} \n\t"
166 "vrev64.32 d1, d0 \n\t"
167 "vstm %[d]!, {d1} \n\t"
168
169 "andS %[tmp], %[d], $0x1f \n\t"
170 "bne "AP"dualloop \n\t"
171
172
173 AP"quadstart: \n\t"
174 "sub %[tmp], %[e], %[d] \n\t"
175 "cmp %[tmp], #32 \n\t"
176 "blt "AP"loopout \n\t"
177
178 "sub %[tmp],%[e],#32 \n\t"
179
180 AP "quadloop: \n\t"
181 "sub %[s], #32 \n\t"
182 "vldm %[s], {d0,d1,d2,d3} \n\t"
183
184 "vrev64.32 d7,d0 \n\t"
185 "vrev64.32 d6,d1 \n\t"
186 "vrev64.32 d5,d2 \n\t"
187 "vrev64.32 d4,d3 \n\t"
188
189 "vstm %[d]!, {d4,d5,d6,d7} \n\t"
190
191 "cmp %[tmp], %[d] \n\t"
192 "bhi "AP"quadloop \n\t"
193
194
195 AP "loopout: \n\t"
196 "cmp %[d], %[e] \n\t"
197 "beq "AP"done \n\t"
198 "sub %[tmp],%[e], %[d] \n\t"
199 "cmp %[tmp],$0x04 \n\t"
200 "beq "AP"singleloop2 \n\t"
201
202 AP "dualloop2: \n\t"
203 "sub %[tmp],%[e],$0x7 \n\t"
204 AP "dualloop2int: \n\t"
205 "sub %[s], #8 \n\t"
206 "vldm %[s], {d0} \n\t"
207 "vrev64.32 d1,d0 \n\t"
208 "vstm %[d]!, {d1} \n\t"
209
210 "cmp %[tmp], %[d] \n\t"
211 "bhi "AP"dualloop2int \n\t"
212
213 // Single ??
214 "cmp %[e], %[d] \n\t"
215 "beq "AP"done \n\t"
216
217 AP "singleloop2: \n\t"
218 "sub %[s], #4 \n\t"
219 "vld1.32 d0[0], [%[s]] \n\t"
220 "vst1.32 d0[0], [%[d]] \n\t"
221
222 AP "done:\n\t"
223
224 : // No output regs
225 // Input
226 : [s] "r" (src + len), [e] "r" (dst + len), [d] "r" (dst),[tmp] "r" (tmp)
227 // Clobbered
228 : "q0","q1","q2","q3","0","1","memory"
229 );
230#undef AP
231
232}
233#endif
234
235
236#ifdef BUILD_C
237static void
238evas_common_copy_pixels_c(DATA32 *src, DATA32 *dst, int len)
239{
240 DATA32 *dst_end = dst + len;
241
242 while (dst < dst_end) *dst++ = *src++;
243}
244#endif
245
246#ifdef BUILD_MMX
247static void
248evas_common_copy_pixels_mmx(DATA32 *src, DATA32 *dst, int len)
249{ // XXX cppcheck: [./src/lib/engines/common/evas_blit_main.c:248]: (error) Invalid number of character ({). Can't process file.
250 // so... wtf? what's wrong with this { ? or anytrhing surrounding it?
251 DATA32 *dst_end, *dst_end_pre;
252#ifdef ALIGN_FIX
253 intptr_t src_align;
254 intptr_t dst_align;
255
256 src_align = (intptr_t)src & 0x3f; /* 64 byte alignment */
257 dst_align = (intptr_t)dst & 0x3f; /* 64 byte alignment */
258
259 if ((src_align != dst_align) ||
260 ((src_align & 0x3) != 0))
261 {
262#ifdef BUILD_C
263 evas_common_copy_pixels_c(src, dst, len);
264 return;
265 }
266#endif
267
268 while ((src_align > 0) && (len > 0))
269 {
270 *dst++ = *src++;
271 len--;
272 src_align -= sizeof(DATA32);
273 }
274#endif /* ALIGN_FIX */
275
276 dst_end = dst + len;
277 dst_end_pre = dst + ((len / 16) * 16);
278
279 while (dst < dst_end_pre)
280 {
281 MOVE_16DWORDS_MMX(src, dst);
282 src += 16;
283 dst += 16;
284 }
285 while (dst < dst_end) *dst++ = *src++;
286}
287#endif
288
289#ifdef BUILD_MMX
290static void
291evas_common_copy_pixels_mmx2(DATA32 *src, DATA32 *dst, int len)
292{
293 DATA32 *dst_end, *dst_end_pre;
294#ifdef ALIGN_FIX
295 intptr_t src_align;
296 intptr_t dst_align;
297
298 src_align = (intptr_t)src & 0x3f; /* 64 byte alignment */
299 dst_align = (intptr_t)dst & 0x3f; /* 64 byte alignment */
300
301 if ((src_align != dst_align) ||
302 ((src_align & 0x3) != 0))
303 {
304#ifdef BUILD_C
305 evas_common_copy_pixels_c(src, dst, len);
306#endif
307 return;
308 }
309
310 while ((src_align > 0) && (len > 0))
311 {
312 *dst++ = *src++;
313 len--;
314 src_align -= sizeof(DATA32);
315 }
316#endif
317
318 dst_end = dst + len;
319 dst_end_pre = dst + ((len / 16) * 16);
320
321 while (dst < dst_end_pre)
322 {
323 MOVE_16DWORDS_MMX(src, dst);
324 src += 16;
325 dst += 16;
326 }
327 while (dst < dst_end) *dst++ = *src++;
328}
329#endif
330
331#ifdef BUILD_NEON
332static void
333evas_common_copy_pixels_neon(DATA32 *src, DATA32 *dst, int len){
334 uint32_t *e,*tmp = (void *)37;
335 e = dst + len;
336#define AP "evas_common_copy_pixels_neon_"
337 asm volatile (
338 ".fpu neon \n\t"
339 // Can we do 32 byte?
340 "andS %[tmp], %[d], $0x1f \n\t"
341 "beq "AP"quadstart \n\t"
342
343 // Can we do at least 16 byte?
344 "andS %[tmp], %[d], $0x4 \n\t"
345 "beq "AP"dualstart \n\t"
346
347 // Only once
348 AP"singleloop: \n\t"
349 "vld1.32 d0[0], [%[s]]! \n\t"
350 "vst1.32 d0[0], [%[d]]! \n\t"
351
352 // Up to 3 times
353 AP"dualstart: \n\t"
354 "sub %[tmp], %[e], %[d] \n\t"
355 "cmp %[tmp], #31 \n\t"
356 "blt "AP"loopout \n\t"
357
358 "andS %[tmp], %[d], $0x1f \n\t"
359 "beq "AP"quadstart \n\t"
360
361 AP"dualloop: \n\t"
362 "vldm %[s]!, {d0} \n\t"
363 "vstm %[d]!, {d0} \n\t"
364
365 "andS %[tmp], %[d], $0x1f \n\t"
366 "bne "AP"dualloop \n\t"
367
368
369 AP"quadstart: \n\t"
370 "sub %[tmp], %[e], %[d] \n\t"
371 "cmp %[tmp], #64 \n\t"
372 "blt "AP"loopout \n\t"
373
374 "sub %[tmp],%[e],#63 \n\t"
375
376 AP "quadloop: \n\t"
377 "vldm %[s]!, {d0,d1,d2,d3} \n\t"
378 "vldm %[s]!, {d4,d5,d6,d7} \n\t"
379 "vstm %[d]!, {d0,d1,d2,d3} \n\t"
380 "vstm %[d]!, {d4,d5,d6,d7} \n\t"
381
382 "cmp %[tmp], %[d] \n\t"
383 "bhi "AP"quadloop \n\t"
384
385
386 AP "loopout: \n\t"
387 "cmp %[d], %[e] \n\t"
388 "beq "AP"done \n\t"
389 "sub %[tmp],%[e], %[d] \n\t"
390 "cmp %[tmp],$0x04 \n\t"
391 "beq "AP"singleloop2 \n\t"
392
393 AP "dualloop2: \n\t"
394 "sub %[tmp],%[e],$0x7 \n\t"
395 AP "dualloop2int: \n\t"
396 "vldm %[s]!, {d0} \n\t"
397 "vstm %[d]!, {d0} \n\t"
398
399 "cmp %[tmp], %[d] \n\t"
400 "bhi "AP"dualloop2int \n\t"
401
402 // Single ??
403 "cmp %[e], %[d] \n\t"
404 "beq "AP"done \n\t"
405
406 AP "singleloop2: \n\t"
407 "vld1.32 d0[0], [%[s]] \n\t"
408 "vst1.32 d0[0], [%[d]] \n\t"
409
410 AP "done:\n\t"
411
412 : // No output regs
413 // Input
414 : [s] "r" (src), [e] "r" (e), [d] "r" (dst),[tmp] "r" (tmp)
415 // Clobbered
416 : "q0","q1","q2","q3","memory"
417 );
418#undef AP
419
420}
421#endif /* BUILD_NEON */
422
423#ifdef BUILD_SSE
424static void
425evas_common_copy_pixels_sse(DATA32 *src, DATA32 *dst, int len)
426{
427 DATA32 *src_ptr, *dst_ptr, *dst_end_ptr;
428
429 dst_end_ptr = dst + len;
430 dst_end_ptr -= 15;
431 src_ptr = src;
432 dst_ptr = dst;
433 while (dst_ptr < dst_end_ptr)
434 {
435 MOVE_16DWORDS_MMX2(src_ptr, dst_ptr);
436 src_ptr+=16;
437 dst_ptr+=16;
438 }
439 dst_end_ptr = dst + len;
440 while (dst_ptr < dst_end_ptr)
441 {
442 *dst_ptr = *src_ptr;
443 src_ptr++;
444 dst_ptr++;
445 }
446#if 0
447#ifdef ALIGN_FIX
448 int src_align;
449 int dst_align;
450
451 src_align = (int)src & 0x3f; /* 64 byte alignment */
452 dst_align = (int)dst & 0x3f; /* 64 byte alignment */
453
454 if ((src_align != dst_align) ||
455 ((src_align & 0x3) != 0))
456 {
457#ifdef BUILD_C
458 evas_common_copy_pixels_c(src, dst, len);
459#endif
460 return;
461 }
462
463 while ((src_align > 0) && (len > 0))
464 {
465 *dst = *src;
466 dst++;
467 src++;
468 len--;
469 src_align -= sizeof(DATA32);
470 }
471#endif /* ALIGN_FIX */
472
473 src_ptr = src;
474 dst_ptr = dst;
475 dst_end_ptr = dst + len;
476 dst_end_ptr_pre = dst + ((len / 16) * 16);
477
478 while (dst_ptr < dst_end_ptr_pre)
479 {
480 prefetch(&src_ptr[16]);
481 MOVE_16DWORDS_MMX(src_ptr, dst_ptr);
482 src_ptr+=16;
483 dst_ptr+=16;
484 }
485 while (dst_ptr < dst_end_ptr)
486 {
487 *dst_ptr = *src_ptr;
488 src_ptr++;
489 dst_ptr++;
490 }
491#endif
492}
493#endif
494
495/****************************************************************************/
496
497#ifdef BUILD_C
498static void
499evas_common_copy_pixels_rev_c(DATA32 *src, DATA32 *dst, int len)
500{
501 DATA32 *dst_end;
502
503 src = src + len - 1;
504 dst_end = dst - 1;
505 dst = dst + len - 1;
506
507 while (dst > dst_end) *dst-- = *src--;
508}
509#endif
510
511#ifdef BUILD_MMX
512static void
513evas_common_copy_pixels_rev_mmx(DATA32 *src, DATA32 *dst, int len)
514{
515 DATA32 *dst_end, *dst_end_pre;
516
517 if (len >= 16)
518 {
519 src = src + len - 16;
520 dst_end = dst;
521 dst_end_pre = dst + len - ((len / 16) * 16);
522 dst = dst + len - 16;
523
524 while (dst >= dst_end_pre)
525 {
526 MOVE_16DWORDS_MMX(src, dst);
527 src -= 16;
528 dst -= 16;
529 }
530 src += 15;
531 dst += 15;
532 while (dst >= dst_end)
533 *dst-- = *src--;
534 }
535 else
536 {
537 src = src + len - 1;
538 dst_end = dst - 1;
539 dst = dst + len - 1;
540 while (dst > dst_end)
541 *dst-- = *src--;
542 }
543}
544#endif
545
546#ifdef BUILD_SSE
547static void
548evas_common_copy_pixels_rev_sse(DATA32 *src, DATA32 *dst, int len)
549{
550 DATA32 *src_ptr, *dst_ptr, *dst_end_ptr, *dst_end_ptr_pre;
551
552 src_ptr = src + len - 16;
553 dst_ptr = dst + len - 16;
554 dst_end_ptr = dst;
555 dst_end_ptr_pre = dst + len - ((len / 16) * 16);
556
557 if (len >= 16)
558 {
559 while (dst_ptr >= dst_end_ptr_pre)
560 {
561 prefetch(&src_ptr[-16]);
562 MOVE_10DWORDS_MMX(src_ptr, dst_ptr);
563 src_ptr -= 16;
564 dst_ptr -= 16;
565 }
566 src_ptr += 15;
567 dst_ptr += 15;
568 while (dst_ptr >= dst_end_ptr)
569 {
570 *dst_ptr = *src_ptr;
571 src_ptr--;
572 dst_ptr--;
573 }
574 }
575 else
576 {
577 src_ptr = src + len - 1;
578 dst_ptr = dst + len - 1;
579 while (dst_ptr >= dst_end_ptr)
580 {
581 *dst_ptr = *src_ptr;
582 src_ptr--;
583 dst_ptr--;
584 }
585 }
586}
587#endif
588
589
590Gfx_Func_Copy
591evas_common_draw_func_copy_get(int pixels, int reverse)
592{
593 if (reverse == -1)
594 return evas_common_copy_rev_pixels_c;
595 if (reverse)
596 {
597#ifdef BUILD_SSE
598 if (evas_common_cpu_has_feature(CPU_FEATURE_SSE) && (pixels > 256 * 256))
599 return evas_common_copy_pixels_rev_sse;
600#endif
601#ifdef BUILD_MMX
602# ifdef BUILD_SSE
603 else
604# endif
605 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
606 return evas_common_copy_pixels_rev_mmx;
607#endif
608#ifdef BUILD_NEON
609# if defined(BUILD_SSE) || defined(BUILD_MMX)
610 else
611# endif
612 if (evas_common_cpu_has_feature(CPU_FEATURE_NEON))
613 return evas_common_copy_pixels_rev_neon;
614#endif
615
616#ifdef BUILD_C
617# if defined(BUILD_MMX) || defined(BUILD_NEON)
618 else
619# endif
620 return evas_common_copy_pixels_rev_c;
621#endif
622 }
623 else
624 {
625#if 1
626
627# ifdef BUILD_MMX
628# ifdef BUILD_C
629 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX2))
630# endif
631 return evas_common_copy_pixels_mmx2;
632# ifdef BUILD_SSE
633 else
634# endif
635#endif
636#ifdef BUILD_SSE
637# ifdef BUILD_C
638 if (evas_common_cpu_has_feature(CPU_FEATURE_SSE) && (pixels > 64 * 64))
639# endif
640 return evas_common_copy_pixels_sse;
641# ifdef BUILD_MMX
642 else
643# endif
644#endif
645# ifdef BUILD_NEON
646# ifdef BUILD_C
647 if (evas_common_cpu_has_feature(CPU_FEATURE_NEON))
648# endif
649 return evas_common_copy_pixels_neon;
650# ifdef BUILD_SSE
651 else
652# endif
653#endif
654#ifdef BUILD_MMX
655# ifdef BUILD_C
656 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
657# endif
658 return evas_common_copy_pixels_mmx;
659# ifdef BUILD_C
660 else
661# endif
662#endif
663#ifdef BUILD_C
664 return evas_common_copy_pixels_c;
665#endif
666
667#else
668
669# ifdef BUILD_SSE
670 if (evas_common_cpu_has_feature(CPU_FEATURE_SSE) && (pixels > 256 * 256))
671 return evas_common_copy_pixels_sse;
672# ifdef BUILD_MMX
673 else
674# endif
675#endif
676#ifdef BUILD_MMX
677# ifdef BUILD_C
678 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX2))
679# endif
680 return evas_common_copy_pixels_mmx2;
681# ifdef BUILD_C
682 else if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
683# endif
684 return evas_common_copy_pixels_mmx;
685# ifdef BUILD_C
686 else
687# endif
688#endif
689#ifdef BUILD_C
690 return evas_common_copy_pixels_c;
691#endif
692
693#endif
694 }
695#ifdef BUILD_C
696 return evas_common_copy_pixels_c;
697#else
698 return NULL;
699#endif
700}
diff --git a/libraries/evas/src/lib/engines/common/evas_convert_color.c b/libraries/evas/src/lib/engines/common/evas_convert_color.c
new file mode 100644
index 0000000..70a9e90
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_convert_color.c
@@ -0,0 +1,246 @@
1#include "evas_common.h"
2#include "evas_convert_color.h"
3
4
5EAPI DATA32
6evas_common_convert_argb_premul(DATA32 *data, unsigned int len)
7{
8 DATA32 *de = data + len;
9 DATA32 nas = 0;
10
11 while (data < de)
12 {
13 DATA32 a = 1 + (*data >> 24);
14
15 *data = (*data & 0xff000000) +
16 (((((*data) >> 8) & 0xff) * a) & 0xff00) +
17 (((((*data) & 0x00ff00ff) * a) >> 8) & 0x00ff00ff);
18 data++;
19
20 if ((a == 1) || (a == 256))
21 nas++;
22 }
23
24 return nas;
25}
26
27EAPI void
28evas_common_convert_argb_unpremul(DATA32 *data, unsigned int len)
29{
30 DATA32 *de = data + len;
31
32 while (data < de)
33 {
34 DATA32 a = (*data >> 24);
35
36 if ((a > 0) && (a < 255))
37 *data = ARGB_JOIN(a,
38 (R_VAL(data) * 255) / a,
39 (G_VAL(data) * 255) / a,
40 (B_VAL(data) * 255) / a);
41 data++;
42 }
43
44}
45
46EAPI void
47evas_common_convert_color_argb_premul(int a, int *r, int *g, int *b)
48{
49 a++;
50 if (r) { *r = (a * *r) >> 8; }
51 if (g) { *g = (a * *g) >> 8; }
52 if (b) { *b = (a * *b) >> 8; }
53}
54
55EAPI void
56evas_common_convert_color_argb_unpremul(int a, int *r, int *g, int *b)
57{
58 if (!a) return;
59 if (r) { *r = (255 * *r) / a; }
60 if (g) { *g = (255 * *g) / a; }
61 if (b) { *b = (255 * *b) / a; }
62}
63
64EAPI void
65evas_common_convert_color_hsv_to_rgb(float h, float s, float v, int *r, int *g, int *b)
66{
67 int i;
68 float f;
69
70 v *= 255;
71 if (s == 0)
72 {
73 if (r) *r = v;
74 if (g) *g = v;
75 if (b) *b = v;
76 return;
77 }
78
79 h /= 60;
80 i = h;
81 f = h - i;
82
83 s *= v;
84 f *= s;
85 s = v - s;
86
87 switch (i)
88 {
89 case 1:
90 if (r) *r = v - f; if (g) *g = v; if (b) *b = s;
91 return;
92 case 2:
93 if (r) *r = s; if (g) *g = v; if (b) *b = s + f;
94 return;
95 case 3:
96 if (r) *r = s; if (g) *g = v - f; if (b) *b = v;
97 return;
98 case 4:
99 if (r) *r = s + f; if (g) *g = s; if (b) *b = v;
100 return;
101 case 5:
102 if (r) *r = v; if (g) *g = s; if (b) *b = v - f;
103 return;
104 default:
105 if (r) *r = v; if (g) *g = s + f; if (b) *b = s;
106 break;
107 }
108}
109
110EAPI void
111evas_common_convert_color_rgb_to_hsv(int r, int g, int b, float *h, float *s, float *v)
112{
113 int max, min, d = r - g;
114
115 //set min to MIN(g,r)
116 d = (d & (~(d >> 8)));
117 min = r - d;
118 //set max to MAX(g,r)
119 max = g + d;
120
121 //set min to MIN(b,min)
122 d = min - b;
123 min -= (d & (~(d >> 8)));
124
125 //set max to MAX(max,b)
126 d = b - max;
127 max += (d & (~(d >> 8)));
128
129 d = max - min;
130
131 if (v) *v = (max / 255.0);
132 if (!max || !d)
133 {
134 if (s) *s = 0;
135 if (h) *h = 0;
136 return;
137 }
138
139 if (s) *s = (d / (float)max);
140 if (r == max)
141 {
142 if (h)
143 {
144 *h = 60 * ((g - b) / (float)d);
145 if (*h < 0) *h += 360;
146 }
147 return;
148 }
149 if (g == max)
150 {
151 if (h)
152 {
153 *h = 120 + (60 * ((b - r) / (float)d));
154 if (*h < 0) *h += 360;
155 }
156 return;
157 }
158 if (h)
159 {
160 *h = 240 + (60 * ((r - g) / (float)d));
161 if (*h < 0) *h += 360;
162 }
163}
164
165EAPI void
166evas_common_convert_color_hsv_to_rgb_int(int h, int s, int v, int *r, int *g, int *b)
167{
168 int i, f;
169
170 if (!s)
171 {
172 *r = *g = *b = v;
173 return;
174 }
175
176 i = h / 255;
177 f = h - (i * 255);
178 s = (v * s) / 255;
179 f = (s * f) / 255;
180 s = v - s;
181
182 switch (i)
183 {
184 case 1:
185 *r = v - f; *g = v; *b = s;
186 return;
187 case 2:
188 *r = s; *g = v; *b = s + f;
189 return;
190 case 3:
191 *r = s; *g = v - f; *b = v;
192 return;
193 case 4:
194 *r = s + f; *g = s; *b = v;
195 return;
196 case 5:
197 *r = v; *g = s; *b = v - f;
198 return;
199 default:
200 *r = v; *g = s + f; *b = s;
201 break;
202 }
203}
204
205EAPI void
206evas_common_convert_color_rgb_to_hsv_int(int r, int g, int b, int *h, int *s, int *v)
207{
208 int min, max, d = r - g;
209
210 d = (d & (~(d >> 8)));
211 min = r - d;
212 max = g + d;
213
214 d = min - b;
215 min -= (d & (~(d >> 8)));
216
217 d = b - max;
218 max += (d & (~(d >> 8)));
219
220 d = max - min;
221
222 *v = max;
223 if (!max)
224 {
225 *s = *h = 0;
226 return;
227 }
228
229 *s = ((d * 255) / max);
230
231 if (r == max)
232 {
233 *h = (((g - b) * 255) / d);
234 if (*h < 0) *h += 1530;
235 return;
236 }
237 if (g == max)
238 {
239 *h = 510 + (((b - r) * 255) / d);
240 if (*h < 0) *h += 1530;
241 return;
242 }
243 *h = 1020 + (((r - g) * 255) / d);
244 if (*h < 0) *h += 1530;
245
246}
diff --git a/libraries/evas/src/lib/engines/common/evas_convert_color.h b/libraries/evas/src/lib/engines/common/evas_convert_color.h
new file mode 100644
index 0000000..0224879
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_convert_color.h
@@ -0,0 +1,16 @@
1#ifndef _EVAS_CONVERT_COLOR_H
2#define _EVAS_CONVERT_COLOR_H
3
4
5EAPI DATA32 evas_common_convert_argb_premul (DATA32 *src, unsigned int len);
6EAPI void evas_common_convert_argb_unpremul (DATA32 *src, unsigned int len);
7EAPI void evas_common_convert_color_argb_premul (int a, int *r, int *g, int *b);
8EAPI void evas_common_convert_color_argb_unpremul (int a, int *r, int *g, int *b);
9
10EAPI void evas_common_convert_color_hsv_to_rgb (float h, float s, float v, int *r, int *g, int *b);
11EAPI void evas_common_convert_color_rgb_to_hsv (int r, int g, int b, float *h, float *s, float *v);
12EAPI void evas_common_convert_color_hsv_to_rgb_int (int h, int s, int v, int *r, int *g, int *b);
13EAPI void evas_common_convert_color_rgb_to_hsv_int (int r, int g, int b, int *h, int *s, int *v);
14
15
16#endif /* _EVAS_CONVERT_COLOR_H */
diff --git a/libraries/evas/src/lib/engines/common/evas_convert_colorspace.c b/libraries/evas/src/lib/engines/common/evas_convert_colorspace.c
new file mode 100644
index 0000000..013c2e7
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_convert_colorspace.c
@@ -0,0 +1,186 @@
1#include "evas_common.h"
2#include "evas_convert_colorspace.h"
3
4#define CONVERT_RGB_565_TO_RGB_888(s) \
5 (((((s) << 3) & 0xf8) | (((s) >> 2) & 0x7)) | \
6 ((((s) << 5) & 0xfc00) | (((s) >> 1) & 0x300)) | \
7 ((((s) << 8) & 0xf80000) | (((s) << 3) & 0x70000)))
8
9#define CONVERT_A5P_TO_A8(s) \
10 ((((s) << 3) & 0xf8) | (((s) >> 2) & 0x7))
11
12#define CONVERT_ARGB_8888_TO_A_8(s) ((s) >> 24)
13
14
15static inline void *
16evas_common_convert_argb8888_to_rgb565_a5p(void *data __UNUSED__, int w __UNUSED__, int h __UNUSED__, int stride __UNUSED__, Eina_Bool has_alpha __UNUSED__)
17{
18 return NULL;
19}
20
21static inline void *
22evas_common_convert_rgb565_a5p_to_argb8888(void *data, int w, int h, int stride, Eina_Bool has_alpha)
23{
24 DATA16 *src, *end;
25 DATA32 *ret, *dst;
26
27 src = data;
28 end = src + (stride * h);
29 ret = malloc(w * h * sizeof(DATA32));
30
31 dst = ret;
32 if (has_alpha)
33 {
34 DATA8 *alpha;
35
36 alpha = (DATA8 *)end;
37 for (; src < end; src++, alpha++, dst++)
38 *dst = (CONVERT_A5P_TO_A8(*alpha) << 24) |
39 CONVERT_RGB_565_TO_RGB_888(*src);
40 }
41 else
42 {
43 for (; src < end; src++, dst++)
44 *dst = CONVERT_RGB_565_TO_RGB_888(*src);
45 }
46 return ret;
47}
48
49static inline void *
50evas_common_convert_argb8888_to_a8(void *data, int w, int h, int stride, Eina_Bool has_alpha)
51{
52 uint32_t *src, *end;
53 uint8_t *ret, *dst;
54
55 src = data;
56 end = src + (stride * h);
57 ret = malloc(w * h);
58 if (!ret) return NULL;
59
60 if (!has_alpha)
61 {
62 return memset(ret, 0xff, w * h);
63 }
64
65 dst = ret;
66 for ( ; src < end ; src++, dst++)
67 *dst = CONVERT_ARGB_8888_TO_A_8(*src);
68 return ret;
69}
70
71
72
73EAPI void *
74evas_common_convert_argb8888_to(void *data, int w, int h, int stride, Eina_Bool has_alpha, Evas_Colorspace cspace)
75{
76 switch (cspace)
77 {
78 case EVAS_COLORSPACE_RGB565_A5P:
79 return evas_common_convert_argb8888_to_rgb565_a5p(data, w, h, stride, has_alpha);
80 default:
81 break;
82 }
83 return NULL;
84}
85
86EAPI void *
87evas_common_convert_rgb565_a5p_to(void *data, int w, int h, int stride, Eina_Bool has_alpha, Evas_Colorspace cspace)
88{
89 switch (cspace)
90 {
91 case EVAS_COLORSPACE_ARGB8888:
92 return evas_common_convert_rgb565_a5p_to_argb8888(data, w, h, stride, has_alpha);
93 default:
94 break;
95 }
96 return NULL;
97}
98
99EAPI void *
100evas_common_convert_yuv_422_601_to(void *data, int w, int h, Evas_Colorspace cspace)
101{
102 switch (cspace)
103 {
104 case EVAS_COLORSPACE_ARGB8888:
105 {
106 void *dst;
107
108 fprintf(stderr, "to argb888\n");
109
110 dst = malloc(sizeof (unsigned int) * w * h);
111 if (!dst) return NULL;
112
113 evas_common_convert_yuv_422_601_rgba(data, dst, w, h);
114 return dst;
115 }
116 default:
117 break;
118 }
119 return NULL;
120}
121
122EAPI void *
123evas_common_convert_yuv_422P_601_to(void *data, int w, int h, Evas_Colorspace cspace)
124{
125 switch (cspace)
126 {
127 case EVAS_COLORSPACE_ARGB8888:
128 {
129 void *dst;
130
131 dst = malloc(sizeof (unsigned int) * w * h);
132 if (!dst) return NULL;
133
134 evas_common_convert_yuv_420p_601_rgba(data, dst, w, h);
135 break;
136 }
137 default:
138 break;
139 }
140 return NULL;
141}
142
143EAPI void *
144evas_common_convert_yuv_420_601_to(void *data, int w, int h, Evas_Colorspace cspace)
145{
146 switch (cspace)
147 {
148 case EVAS_COLORSPACE_ARGB8888:
149 {
150 void *dst;
151
152 dst = malloc(sizeof (unsigned int) * w * h);
153 if (!dst) return NULL;
154
155 evas_common_convert_yuv_420_601_rgba(data, dst, w, h);
156 break;
157 }
158 default:
159 break;
160 }
161 return NULL;
162}
163
164EAPI void *
165evas_common_convert_yuv_420T_601_to(void *data, int w, int h, Evas_Colorspace cspace)
166{
167 switch (cspace)
168 {
169 case EVAS_COLORSPACE_ARGB8888:
170 {
171 void *dst;
172
173 dst = malloc(sizeof (unsigned int) * w * h);
174 if (!dst) return NULL;
175
176 evas_common_convert_yuv_420_601_rgba(data, dst, w, h);
177 break;
178 }
179 default:
180 break;
181 }
182 return NULL;
183}
184
185
186/* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/
diff --git a/libraries/evas/src/lib/engines/common/evas_convert_colorspace.h b/libraries/evas/src/lib/engines/common/evas_convert_colorspace.h
new file mode 100644
index 0000000..f3bec78
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_convert_colorspace.h
@@ -0,0 +1,12 @@
1#ifndef _EVAS_CONVERT_COLORSPACE_H
2#define _EVAS_CONVERT_COLORSPACE_H
3
4
5EAPI void *evas_common_convert_argb8888_to (void *data, int w, int h, int stride, Eina_Bool has_alpha, Evas_Colorspace cspace);
6EAPI void *evas_common_convert_rgb565_a5p_to (void *data, int w, int h, int stride, Eina_Bool has_alpha, Evas_Colorspace cspace);
7EAPI void *evas_common_convert_yuv_422P_601_to(void *data, int w, int h, Evas_Colorspace cspace);
8EAPI void *evas_common_convert_yuv_422_601_to (void *data, int w, int h, Evas_Colorspace cspace);
9EAPI void *evas_common_convert_yuv_420_601_to (void *data, int w, int h, Evas_Colorspace cspace);
10EAPI void *evas_common_convert_yuv_420T_601_to(void *data, int w, int h, Evas_Colorspace cspace);
11
12#endif /* _EVAS_CONVERT_COLORSPACE_H */
diff --git a/libraries/evas/src/lib/engines/common/evas_convert_gry_1.c b/libraries/evas/src/lib/engines/common/evas_convert_gry_1.c
new file mode 100644
index 0000000..45e16ee
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_convert_gry_1.c
@@ -0,0 +1,6 @@
1#include "evas_common.h"
2#include "evas_convert_gry_1.h"
3
4#ifdef BUILD_CONVERT_1_GRY_1
5void evas_common_convert_rgba_to_1bpp_gry_1_dith (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal){}
6#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_convert_gry_1.h b/libraries/evas/src/lib/engines/common/evas_convert_gry_1.h
new file mode 100644
index 0000000..38d6776
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_convert_gry_1.h
@@ -0,0 +1,9 @@
1#ifndef _EVAS_CONVERT_GRY_1_H
2#define _EVAS_CONVERT_GRY_1_H
3
4
5void evas_common_convert_rgba_to_1bpp_gry_1_dith (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
6
7
8
9#endif /* _EVAS_CONVERT_GRY_1_H */
diff --git a/libraries/evas/src/lib/engines/common/evas_convert_gry_4.c b/libraries/evas/src/lib/engines/common/evas_convert_gry_4.c
new file mode 100644
index 0000000..2fa7ee3
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_convert_gry_4.c
@@ -0,0 +1,10 @@
1#include "evas_common.h"
2#include "evas_convert_gry_4.h"
3
4#ifdef BUILD_CONVERT_4_GRY_4
5void evas_common_convert_rgba_to_4bpp_gry_4_dith (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal){}
6#endif
7
8#ifdef BUILD_CONVERT_4_GRY_1
9void evas_common_convert_rgba_to_4bpp_gry_1_dith (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal){}
10#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_convert_gry_4.h b/libraries/evas/src/lib/engines/common/evas_convert_gry_4.h
new file mode 100644
index 0000000..1614359
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_convert_gry_4.h
@@ -0,0 +1,9 @@
1#ifndef _EVAS_CONVERT_GRY_4_H
2#define _EVAS_CONVERT_GRY_4_H
3
4
5void evas_common_convert_rgba_to_4bpp_gry_4_dith (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
6void evas_common_convert_rgba_to_4bpp_gry_1_dith (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
7
8
9#endif /* _EVAS_CONVERT_GRY_4_H */
diff --git a/libraries/evas/src/lib/engines/common/evas_convert_gry_8.c b/libraries/evas/src/lib/engines/common/evas_convert_gry_8.c
new file mode 100644
index 0000000..9bc5ca7
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_convert_gry_8.c
@@ -0,0 +1,78 @@
1#include "evas_common.h"
2#include "evas_convert_gry_8.h"
3
4#ifdef USE_DITHER_44
5extern const DATA8 _evas_dither_44[4][4];
6#endif
7#ifdef USE_DITHER_128128
8extern const DATA8 _evas_dither_128128[128][128];
9#endif
10
11#ifdef BUILD_CONVERT_8_GRY_1
12void evas_common_convert_rgba_to_8bpp_gry_256_dith (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x __UNUSED__, int dith_y __UNUSED__, DATA8 *pal __UNUSED__)
13{
14 DATA32 *src_ptr;
15 DATA8 *dst_ptr;
16 int x, y;
17 DATA8 r, g, b;
18 DATA32 gry8;
19
20 dst_ptr = (DATA8 *)dst;
21
22 CONVERT_LOOP_START_ROT_0();
23
24 r = (R_VAL(src_ptr));
25 g = (G_VAL(src_ptr));
26 b = (B_VAL(src_ptr));
27
28 // Y = 0.299 * R + 0.587 * G + 0.114 * B;
29 gry8 = ((r * 19595) + (g * 38469) + (b * 7471)) >> 16;
30
31 *dst_ptr = gry8;
32
33 CONVERT_LOOP_END_ROT_0();
34}
35#endif
36
37#ifdef BUILD_CONVERT_8_GRY_4
38void evas_common_convert_rgba_to_8bpp_gry_64_dith (DATA32 *src __UNUSED__, DATA8 *dst __UNUSED__, int src_jump __UNUSED__, int dst_jump __UNUSED__, int w __UNUSED__, int h __UNUSED__, int dith_x __UNUSED__, int dith_y __UNUSED__, DATA8 *pal __UNUSED__){}
39#endif
40
41#ifdef BUILD_CONVERT_8_GRY_16
42void evas_common_convert_rgba_to_8bpp_gry_16_dith (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal __UNUSED__)
43{
44 DATA32 *src_ptr;
45 DATA8 *dst_ptr;
46 int x, y;
47 DATA8 r, g, b;
48 DATA32 gry8;
49 DATA8 dith;
50
51 dst_ptr = (DATA8 *)dst;
52
53 CONVERT_LOOP_START_ROT_0();
54
55 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
56
57 r = (R_VAL(src_ptr));
58 g = (G_VAL(src_ptr));
59 b = (B_VAL(src_ptr));
60
61 // Y = 0.299 * R + 0.587 * G + 0.114 * B;
62 gry8 = ((r * 19595) + (g * 38469) + (b * 7471)) >> 16;
63
64 if (((gry8 - gry8 * 255 / 4) >= dith) && (gry8 < 0x07)) gry8++;
65
66 *dst_ptr = gry8;
67
68 CONVERT_LOOP_END_ROT_0();
69}
70#endif
71
72#ifdef BUILD_CONVERT_8_GRY_64
73void evas_common_convert_rgba_to_8bpp_gry_4_dith (DATA32 *src __UNUSED__, DATA8 *dst __UNUSED__, int src_jump __UNUSED__, int dst_jump __UNUSED__, int w __UNUSED__, int h __UNUSED__, int dith_x __UNUSED__, int dith_y __UNUSED__, DATA8 *pal __UNUSED__){}
74#endif
75
76#ifdef BUILD_CONVERT_8_GRY_256
77void evas_common_convert_rgba_to_8bpp_gry_1_dith (DATA32 *src __UNUSED__, DATA8 *dst __UNUSED__, int src_jump __UNUSED__, int dst_jump __UNUSED__, int w __UNUSED__, int h __UNUSED__, int dith_x __UNUSED__, int dith_y __UNUSED__, DATA8 *pal __UNUSED__){}
78#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_convert_gry_8.h b/libraries/evas/src/lib/engines/common/evas_convert_gry_8.h
new file mode 100644
index 0000000..d70f59d
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_convert_gry_8.h
@@ -0,0 +1,12 @@
1#ifndef _EVAS_CONVERT_GRY_8_H
2#define _EVAS_CONVERT_GRY_8_H
3
4
5void evas_common_convert_rgba_to_8bpp_gry_256_dith (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
6void evas_common_convert_rgba_to_8bpp_gry_64_dith (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
7void evas_common_convert_rgba_to_8bpp_gry_16_dith (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
8void evas_common_convert_rgba_to_8bpp_gry_4_dith (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
9void evas_common_convert_rgba_to_8bpp_gry_1_dith (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
10
11
12#endif /* _EVAS_CONVERT_GRY_8_H */
diff --git a/libraries/evas/src/lib/engines/common/evas_convert_grypal_6.c b/libraries/evas/src/lib/engines/common/evas_convert_grypal_6.c
new file mode 100644
index 0000000..2351fda
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_convert_grypal_6.c
@@ -0,0 +1,23 @@
1#include "evas_common.h"
2#include "evas_convert_grypal_6.h"
3
4#ifdef BUILD_CONVERT_8_GRAYSCALE_64
5void evas_common_convert_rgba_to_8bpp_pal_gray64(DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x __UNUSED__, int dith_y __UNUSED__, DATA8 *pal)
6{
7 DATA32 *src_ptr;
8 DATA8 *dst_ptr;
9 int x, y;
10 DATA8 Y;
11
12 dst_ptr = dst;
13 CONVERT_LOOP_START_ROT_0();
14
15 /* RGB -> YUV conversion */
16 Y = ((R_VAL(src_ptr) * 76) +
17 (G_VAL(src_ptr) * 151) +
18 (B_VAL(src_ptr) * 29)) >> 10;
19 *dst_ptr = pal[Y];
20
21 CONVERT_LOOP_END_ROT_0();
22}
23#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_convert_grypal_6.h b/libraries/evas/src/lib/engines/common/evas_convert_grypal_6.h
new file mode 100644
index 0000000..5f839c2
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_convert_grypal_6.h
@@ -0,0 +1,6 @@
1#ifndef _EVAS_CONVERT_GRY_4_H
2#define _EVAS_CONVERT_GRY_4_H
3
4void evas_common_convert_rgba_to_8bpp_pal_gray64 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
5
6#endif /* _EVAS_CONVERT_GRY_4_H */
diff --git a/libraries/evas/src/lib/engines/common/evas_convert_main.c b/libraries/evas/src/lib/engines/common/evas_convert_main.c
new file mode 100644
index 0000000..da19f9c
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_convert_main.c
@@ -0,0 +1,632 @@
1#include "evas_common.h"
2#include "evas_convert_rgb_8.h"
3#include "evas_convert_rgb_16.h"
4#include "evas_convert_rgb_24.h"
5#include "evas_convert_rgb_32.h"
6#include "evas_convert_grypal_6.h"
7#include "evas_convert_gry_8.h"
8#include "evas_convert_yuv.h"
9
10#ifdef USE_DITHER_44
11
12const DATA8 _evas_dither_44[4][4] =
13{
14 { 0, 8, 2, 10},
15 {12, 4, 14, 6},
16 { 3, 11, 1, 9},
17 {15, 7, 13, 5}
18};
19
20#endif
21
22#ifdef USE_DITHER_128128
23
24const DATA8 _evas_dither_128128[128][128] =
25{
26 { 0, 41, 23, 5, 17, 39, 7, 15, 62, 23, 40, 51, 31, 47, 9, 32, 52, 27, 57, 25, 6, 61, 27, 52, 37, 7, 40, 63, 18, 36, 10, 42, 25, 62, 45, 34, 20, 42, 37, 14, 35, 29, 50, 10, 61, 2, 40, 8, 37, 12, 58, 22, 5, 41, 10, 39, 0, 60, 11, 46, 2, 55, 38, 17, 36, 59, 13, 54, 37, 56, 8, 29, 16, 13, 63, 22, 41, 55, 7, 20, 49, 14, 23, 55, 37, 23, 19, 36, 15, 49, 23, 63, 30, 14, 38, 27, 53, 13, 22, 41, 19, 31, 7, 19, 50, 30, 49, 16, 3, 32, 56, 40, 29, 34, 8, 48, 19, 45, 4, 51, 12, 46, 35, 49, 16, 42, 12, 62 },
27 { 30, 57, 36, 54, 47, 34, 52, 27, 43, 4, 28, 7, 17, 36, 62, 13, 44, 7, 18, 48, 33, 21, 44, 14, 30, 47, 12, 33, 5, 55, 31, 58, 13, 30, 4, 17, 52, 10, 60, 26, 46, 0, 39, 27, 42, 22, 47, 25, 60, 32, 9, 38, 48, 17, 59, 30, 49, 18, 34, 25, 51, 19, 5, 48, 21, 8, 28, 46, 1, 32, 41, 19, 54, 47, 37, 18, 28, 11, 44, 30, 39, 56, 2, 33, 8, 42, 61, 28, 58, 8, 46, 9, 41, 4, 58, 7, 21, 48, 59, 10, 52, 14, 42, 57, 12, 25, 7, 53, 42, 24, 11, 50, 17, 59, 42, 2, 36, 60, 32, 17, 63, 29, 21, 7, 59, 32, 24, 39 },
28 { 22, 8, 16, 32, 3, 25, 13, 57, 18, 45, 58, 39, 55, 20, 5, 42, 23, 34, 63, 1, 51, 10, 58, 4, 60, 23, 53, 27, 44, 21, 3, 48, 8, 50, 43, 54, 27, 32, 5, 55, 21, 58, 12, 53, 6, 36, 14, 50, 17, 29, 53, 15, 24, 52, 7, 36, 13, 42, 4, 53, 9, 35, 61, 26, 56, 32, 49, 15, 62, 23, 6, 60, 2, 31, 4, 48, 58, 38, 15, 61, 5, 25, 47, 28, 50, 15, 7, 40, 3, 32, 33, 52, 25, 50, 35, 42, 61, 3, 28, 36, 23, 63, 4, 33, 46, 62, 36, 23, 60, 6, 54, 28, 4, 37, 23, 55, 25, 8, 42, 54, 14, 6, 56, 38, 19, 52, 4, 46 },
29 { 48, 53, 43, 12, 45, 63, 30, 37, 9, 34, 21, 1, 25, 47, 29, 58, 3, 54, 15, 39, 29, 17, 38, 35, 20, 43, 1, 49, 15, 59, 29, 39, 22, 35, 16, 23, 1, 47, 39, 18, 8, 44, 25, 31, 57, 19, 63, 4, 45, 3, 42, 61, 1, 31, 45, 20, 57, 29, 62, 21, 32, 41, 14, 44, 3, 39, 5, 34, 10, 43, 51, 35, 23, 52, 40, 10, 21, 1, 53, 18, 51, 43, 12, 62, 18, 54, 26, 51, 20, 57, 14, 1, 62, 16, 11, 18, 32, 39, 17, 44, 1, 48, 26, 37, 18, 2, 51, 14, 28, 45, 35, 18, 57, 13, 47, 11, 51, 20, 2, 39, 31, 47, 25, 1, 50, 11, 60, 7 },
30 { 18, 28, 1, 56, 21, 10, 51, 2, 46, 54, 14, 61, 11, 50, 13, 38, 19, 31, 45, 9, 55, 24, 47, 5, 54, 9, 62, 11, 35, 8, 51, 14, 57, 6, 63, 40, 58, 14, 51, 28, 62, 34, 15, 48, 1, 41, 30, 35, 55, 21, 34, 11, 49, 37, 8, 52, 4, 23, 15, 43, 1, 58, 11, 23, 53, 16, 55, 26, 58, 18, 27, 12, 45, 14, 25, 63, 42, 33, 27, 35, 9, 31, 21, 38, 1, 44, 34, 12, 48, 38, 21, 44, 29, 47, 26, 53, 1, 46, 54, 8, 59, 29, 11, 55, 22, 41, 33, 20, 39, 1, 48, 9, 44, 32, 5, 62, 29, 44, 57, 23, 10, 58, 34, 43, 15, 37, 26, 33 },
31 { 51, 38, 59, 24, 35, 42, 19, 60, 5, 32, 41, 26, 43, 33, 7, 53, 48, 11, 59, 23, 42, 2, 61, 30, 16, 40, 32, 24, 56, 41, 19, 33, 37, 26, 47, 9, 31, 22, 2, 45, 9, 54, 4, 37, 21, 52, 11, 23, 7, 57, 16, 25, 55, 18, 63, 27, 46, 39, 56, 10, 50, 37, 29, 47, 19, 63, 24, 9, 46, 2, 39, 60, 9, 57, 30, 7, 49, 11, 59, 3, 45, 57, 5, 60, 29, 22, 5, 60, 30, 9, 59, 18, 40, 6, 57, 36, 30, 12, 24, 34, 15, 40, 52, 6, 49, 9, 58, 4, 63, 12, 26, 61, 22, 53, 38, 16, 35, 14, 28, 50, 42, 17, 5, 28, 62, 20, 54, 12 },
32 { 26, 6, 31, 15, 49, 6, 38, 27, 22, 49, 16, 56, 2, 62, 30, 21, 0, 36, 28, 6, 49, 32, 13, 52, 26, 50, 19, 46, 3, 26, 62, 0, 53, 12, 29, 3, 53, 41, 60, 24, 38, 13, 58, 16, 43, 9, 59, 39, 46, 28, 44, 40, 2, 33, 13, 41, 16, 6, 47, 31, 26, 17, 57, 6, 38, 0, 42, 36, 29, 52, 20, 31, 48, 0, 34, 56, 20, 36, 23, 54, 14, 41, 24, 37, 10, 55, 46, 25, 16, 45, 36, 4, 55, 23, 15, 8, 50, 62, 5, 56, 44, 20, 13, 28, 59, 31, 24, 47, 31, 52, 37, 17, 40, 0, 26, 49, 3, 60, 7, 33, 0, 61, 53, 40, 8, 45, 2, 41 },
33 { 16, 63, 43, 4, 61, 24, 56, 13, 53, 8, 36, 12, 24, 41, 16, 46, 60, 26, 52, 39, 14, 57, 21, 37, 0, 45, 7, 59, 38, 17, 43, 10, 45, 20, 61, 43, 19, 11, 33, 17, 50, 32, 23, 61, 28, 49, 26, 0, 18, 51, 5, 60, 22, 58, 29, 0, 59, 34, 19, 62, 3, 52, 7, 44, 30, 59, 13, 50, 15, 62, 7, 17, 38, 22, 44, 15, 40, 4, 47, 28, 33, 17, 49, 16, 51, 40, 10, 56, 0, 53, 13, 49, 28, 38, 60, 21, 43, 19, 37, 27, 3, 51, 34, 39, 0, 45, 15, 43, 10, 21, 3, 55, 8, 33, 59, 10, 41, 18, 52, 24, 46, 20, 30, 13, 58, 22, 36, 57 },
34 { 50, 34, 11, 47, 29, 17, 44, 0, 33, 63, 28, 46, 52, 5, 57, 10, 42, 18, 4, 63, 20, 8, 44, 10, 56, 34, 14, 29, 5, 54, 23, 59, 32, 49, 7, 34, 49, 27, 56, 0, 42, 7, 46, 3, 40, 6, 54, 32, 62, 13, 36, 10, 47, 8, 35, 49, 24, 51, 12, 40, 22, 35, 60, 12, 22, 51, 33, 4, 40, 25, 43, 55, 5, 54, 12, 61, 26, 51, 8, 62, 0, 53, 7, 63, 2, 32, 19, 34, 42, 24, 31, 63, 2, 10, 45, 33, 0, 48, 9, 61, 22, 47, 8, 62, 18, 56, 7, 54, 27, 57, 46, 30, 50, 19, 45, 30, 56, 36, 22, 47, 11, 38, 3, 51, 32, 48, 18, 9 },
35 { 0, 21, 40, 19, 52, 9, 37, 48, 20, 40, 3, 18, 27, 38, 35, 22, 31, 56, 13, 35, 46, 28, 60, 40, 27, 18, 61, 50, 41, 30, 7, 36, 2, 25, 16, 57, 5, 15, 47, 29, 55, 19, 30, 52, 15, 34, 20, 12, 43, 30, 20, 54, 25, 44, 53, 12, 38, 5, 55, 27, 48, 15, 33, 27, 45, 8, 19, 28, 56, 11, 33, 49, 18, 36, 29, 2, 45, 16, 39, 19, 31, 43, 27, 35, 20, 52, 26, 6, 61, 11, 41, 17, 29, 51, 20, 56, 25, 32, 41, 17, 53, 31, 25, 14, 42, 23, 35, 16, 38, 6, 34, 12, 15, 62, 6, 21, 13, 1, 63, 9, 55, 27, 43, 25, 14, 4, 31, 55 },
36 { 44, 29, 61, 2, 35, 58, 26, 15, 60, 10, 51, 59, 14, 55, 8, 50, 2, 44, 25, 51, 1, 33, 16, 4, 48, 36, 2, 21, 12, 57, 48, 13, 51, 55, 40, 28, 37, 62, 8, 39, 12, 63, 36, 10, 59, 24, 56, 47, 9, 50, 41, 1, 32, 17, 6, 21, 61, 30, 9, 43, 1, 54, 41, 2, 54, 37, 48, 61, 1, 46, 21, 3, 58, 24, 50, 32, 60, 10, 57, 25, 46, 12, 59, 4, 45, 13, 57, 47, 27, 39, 5, 58, 47, 14, 35, 4, 52, 13, 60, 6, 36, 10, 45, 55, 4, 50, 29, 2, 61, 50, 25, 58, 44, 24, 36, 42, 54, 28, 40, 32, 16, 56, 6, 62, 46, 39, 60, 23 },
37 { 7, 48, 14, 54, 23, 40, 4, 45, 30, 22, 42, 32, 1, 44, 20, 29, 58, 8, 37, 19, 41, 54, 24, 58, 9, 53, 25, 46, 34, 16, 23, 38, 27, 11, 18, 1, 52, 21, 35, 22, 48, 5, 25, 45, 18, 38, 2, 27, 35, 4, 57, 15, 62, 39, 57, 28, 42, 16, 36, 60, 24, 18, 10, 63, 20, 5, 16, 23, 37, 14, 59, 27, 41, 8, 13, 42, 21, 35, 6, 50, 3, 38, 15, 48, 30, 39, 17, 3, 49, 14, 53, 33, 24, 7, 61, 44, 11, 39, 23, 49, 19, 58, 1, 32, 36, 12, 60, 41, 20, 13, 41, 4, 39, 1, 48, 8, 18, 51, 14, 44, 5, 37, 21, 34, 1, 26, 10, 37 },
38 { 53, 36, 27, 9, 50, 12, 32, 55, 2, 57, 7, 17, 48, 34, 63, 15, 40, 26, 62, 11, 49, 6, 31, 39, 22, 42, 6, 63, 1, 39, 60, 4, 42, 61, 32, 45, 24, 44, 2, 60, 16, 41, 53, 1, 33, 61, 49, 17, 63, 23, 45, 26, 33, 3, 23, 46, 2, 50, 20, 4, 45, 34, 49, 30, 39, 58, 44, 31, 53, 34, 6, 52, 30, 47, 63, 1, 53, 22, 42, 31, 58, 23, 54, 22, 61, 8, 36, 59, 22, 35, 21, 1, 55, 40, 27, 16, 30, 54, 2, 29, 43, 16, 39, 63, 21, 46, 26, 10, 48, 32, 19, 53, 30, 56, 26, 60, 33, 4, 61, 23, 49, 59, 15, 53, 19, 58, 42, 16 },
39 { 20, 5, 59, 46, 25, 62, 7, 19, 43, 25, 37, 61, 11, 24, 4, 54, 12, 52, 3, 32, 17, 61, 12, 47, 15, 55, 18, 31, 53, 28, 9, 50, 21, 6, 55, 9, 58, 14, 54, 26, 33, 7, 31, 58, 13, 21, 8, 42, 29, 6, 37, 11, 48, 52, 14, 60, 11, 39, 56, 32, 14, 58, 7, 26, 17, 4, 42, 8, 11, 47, 19, 38, 10, 17, 26, 37, 9, 55, 28, 13, 18, 40, 6, 33, 1, 43, 25, 11, 51, 7, 62, 43, 18, 37, 3, 57, 45, 9, 38, 58, 5, 52, 27, 7, 17, 53, 5, 57, 37, 2, 63, 9, 22, 15, 11, 38, 25, 45, 35, 0, 28, 10, 41, 30, 50, 8, 31, 57 },
40 { 49, 33, 16, 38, 1, 42, 51, 34, 53, 14, 28, 49, 30, 56, 36, 23, 43, 20, 38, 56, 22, 45, 28, 0, 62, 35, 26, 44, 11, 19, 52, 35, 44, 15, 30, 38, 10, 31, 40, 4, 46, 50, 20, 40, 27, 44, 51, 14, 56, 53, 19, 59, 7, 29, 41, 19, 35, 25, 8, 52, 22, 44, 13, 53, 50, 32, 61, 24, 56, 25, 63, 0, 45, 57, 33, 59, 16, 46, 4, 62, 50, 11, 60, 37, 52, 19, 55, 29, 37, 46, 13, 26, 48, 10, 50, 34, 21, 63, 26, 13, 42, 33, 22, 55, 35, 28, 43, 15, 24, 51, 27, 34, 46, 49, 58, 3, 52, 9, 57, 19, 48, 55, 3, 35, 12, 45, 24, 3 },
41 { 41, 11, 56, 28, 18, 31, 22, 10, 37, 6, 47, 13, 3, 41, 9, 46, 0, 48, 29, 6, 34, 10, 55, 37, 20, 8, 49, 3, 41, 59, 14, 25, 0, 63, 19, 47, 27, 51, 17, 57, 23, 10, 61, 6, 54, 3, 38, 31, 0, 22, 34, 43, 20, 55, 31, 0, 49, 63, 29, 38, 3, 62, 28, 40, 0, 22, 14, 35, 2, 48, 15, 43, 23, 14, 3, 29, 49, 20, 39, 34, 0, 44, 29, 9, 15, 47, 5, 42, 0, 31, 58, 5, 31, 61, 23, 15, 0, 47, 19, 50, 24, 3, 59, 11, 44, 0, 31, 59, 6, 42, 17, 60, 0, 39, 20, 31, 43, 17, 29, 40, 12, 25, 60, 22, 52, 15, 63, 29 },
42 { 20, 52, 8, 44, 62, 4, 59, 49, 17, 63, 21, 39, 60, 18, 52, 27, 33, 59, 14, 51, 59, 43, 24, 5, 51, 30, 57, 17, 32, 5, 37, 56, 48, 34, 42, 3, 60, 5, 36, 13, 43, 37, 18, 34, 25, 12, 59, 24, 47, 36, 11, 50, 3, 38, 9, 58, 16, 5, 43, 18, 47, 10, 37, 18, 59, 46, 29, 52, 40, 12, 34, 28, 56, 36, 53, 7, 43, 8, 24, 52, 26, 17, 56, 43, 24, 32, 63, 20, 57, 16, 22, 52, 36, 8, 41, 56, 29, 32, 54, 7, 35, 57, 14, 48, 20, 62, 13, 39, 53, 29, 8, 45, 13, 29, 7, 61, 14, 54, 6, 63, 38, 32, 18, 43, 2, 39, 6, 47 },
43 { 0, 58, 23, 35, 13, 46, 12, 39, 0, 31, 55, 24, 5, 35, 15, 61, 17, 5, 39, 25, 18, 2, 50, 33, 41, 13, 39, 23, 62, 46, 29, 12, 22, 8, 56, 25, 20, 49, 32, 62, 0, 56, 11, 46, 63, 42, 9, 16, 55, 5, 60, 15, 62, 26, 45, 21, 36, 51, 13, 57, 31, 24, 55, 6, 35, 9, 57, 5, 20, 60, 7, 51, 5, 19, 40, 25, 61, 32, 56, 12, 36, 48, 21, 2, 58, 12, 39, 28, 9, 50, 40, 12, 44, 18, 25, 49, 6, 38, 11, 62, 18, 46, 30, 9, 40, 25, 49, 19, 10, 36, 55, 22, 33, 52, 41, 18, 37, 27, 49, 21, 2, 46, 7, 53, 33, 61, 27, 35 },
44 { 41, 31, 5, 39, 51, 26, 33, 57, 27, 41, 9, 44, 54, 29, 48, 7, 44, 36, 57, 10, 31, 63, 16, 45, 11, 60, 1, 47, 7, 20, 43, 3, 58, 36, 13, 52, 39, 7, 15, 28, 22, 48, 30, 21, 1, 29, 49, 44, 27, 17, 40, 30, 24, 42, 12, 53, 33, 7, 47, 20, 1, 42, 11, 49, 25, 43, 17, 32, 45, 27, 41, 21, 31, 62, 11, 49, 2, 15, 42, 5, 63, 7, 41, 27, 49, 6, 54, 23, 46, 34, 2, 28, 54, 3, 59, 12, 46, 17, 42, 28, 40, 1, 37, 51, 5, 55, 2, 34, 47, 16, 3, 62, 47, 5, 23, 56, 1, 44, 12, 34, 51, 16, 57, 11, 25, 17, 54, 13 },
45 { 60, 26, 55, 18, 3, 60, 20, 6, 52, 15, 50, 19, 32, 11, 23, 53, 26, 21, 1, 47, 42, 27, 8, 58, 21, 27, 53, 36, 26, 54, 31, 50, 17, 30, 45, 1, 29, 59, 44, 53, 41, 4, 35, 58, 51, 19, 32, 4, 52, 34, 48, 8, 51, 5, 56, 2, 25, 61, 27, 38, 54, 27, 62, 21, 51, 1, 39, 62, 10, 50, 1, 58, 13, 47, 38, 18, 35, 54, 22, 51, 30, 19, 59, 34, 14, 32, 44, 4, 60, 15, 52, 62, 20, 43, 30, 35, 21, 60, 4, 52, 12, 24, 61, 18, 30, 42, 23, 61, 25, 50, 27, 38, 11, 59, 12, 35, 50, 30, 59, 24, 8, 42, 28, 37, 48, 9, 44, 21 },
46 { 10, 47, 15, 50, 30, 43, 8, 45, 29, 2, 36, 59, 1, 58, 41, 3, 63, 31, 54, 20, 13, 55, 35, 38, 4, 44, 15, 9, 61, 2, 14, 38, 61, 10, 23, 54, 18, 12, 24, 2, 14, 55, 16, 8, 38, 14, 41, 60, 10, 23, 1, 58, 32, 17, 28, 37, 41, 15, 3, 60, 15, 33, 4, 36, 16, 59, 28, 14, 23, 55, 37, 18, 44, 28, 2, 57, 30, 10, 27, 46, 14, 38, 3, 53, 21, 61, 17, 35, 10, 41, 26, 7, 33, 9, 57, 1, 53, 37, 26, 20, 56, 48, 9, 33, 58, 16, 37, 7, 45, 1, 57, 15, 32, 26, 42, 23, 7, 20, 4, 54, 31, 62, 22, 1, 59, 30, 4, 51 },
47 { 36, 2, 38, 11, 24, 36, 54, 22, 62, 47, 25, 8, 28, 45, 16, 38, 12, 43, 9, 37, 49, 3, 23, 52, 18, 30, 50, 33, 19, 42, 49, 26, 6, 40, 47, 35, 63, 38, 50, 33, 60, 26, 36, 47, 24, 57, 6, 26, 39, 63, 19, 44, 14, 46, 61, 9, 50, 30, 45, 23, 10, 50, 44, 8, 31, 54, 6, 46, 36, 4, 30, 54, 8, 52, 22, 41, 4, 60, 40, 0, 58, 24, 45, 10, 37, 1, 48, 30, 56, 17, 38, 48, 24, 47, 19, 39, 14, 8, 45, 32, 2, 34, 27, 44, 4, 52, 11, 56, 31, 21, 40, 19, 44, 51, 2, 63, 46, 58, 36, 43, 14, 5, 50, 38, 14, 56, 40, 23 },
48 { 61, 46, 32, 63, 54, 1, 14, 34, 12, 40, 18, 49, 37, 10, 61, 30, 51, 24, 60, 7, 29, 40, 62, 11, 46, 58, 6, 56, 24, 10, 34, 52, 21, 59, 16, 3, 27, 5, 20, 46, 9, 40, 7, 62, 2, 30, 53, 15, 48, 10, 28, 35, 54, 6, 21, 34, 18, 55, 7, 40, 57, 19, 26, 60, 41, 13, 24, 51, 19, 61, 9, 25, 34, 15, 63, 11, 45, 17, 20, 47, 33, 8, 31, 62, 43, 26, 53, 7, 24, 59, 0, 13, 55, 4, 62, 27, 51, 31, 63, 15, 58, 7, 54, 14, 46, 22, 28, 43, 12, 63, 8, 54, 5, 17, 39, 33, 15, 10, 27, 17, 47, 34, 19, 45, 27, 12, 33, 17 },
49 { 5, 28, 21, 7, 17, 48, 42, 58, 23, 4, 63, 14, 55, 21, 34, 5, 19, 0, 45, 17, 52, 15, 25, 32, 0, 22, 40, 13, 45, 62, 18, 0, 43, 11, 33, 55, 30, 42, 57, 19, 51, 31, 22, 43, 18, 45, 34, 0, 43, 31, 56, 3, 23, 40, 59, 0, 44, 13, 48, 35, 2, 32, 46, 0, 21, 48, 35, 3, 40, 32, 43, 59, 0, 48, 33, 26, 53, 36, 55, 12, 51, 16, 55, 5, 18, 29, 11, 39, 51, 19, 45, 31, 42, 21, 35, 6, 22, 47, 10, 38, 23, 50, 20, 36, 0, 60, 38, 4, 50, 35, 48, 34, 24, 57, 9, 53, 28, 48, 61, 0, 56, 24, 53, 3, 63, 6, 42, 57 },
50 { 13, 53, 45, 40, 58, 27, 6, 16, 38, 51, 33, 30, 43, 2, 47, 56, 40, 50, 33, 57, 27, 5, 47, 42, 60, 36, 16, 54, 28, 4, 37, 57, 28, 51, 22, 8, 45, 14, 6, 39, 0, 54, 11, 59, 28, 12, 50, 21, 61, 13, 19, 38, 49, 11, 25, 37, 58, 29, 22, 63, 14, 56, 12, 53, 30, 63, 9, 57, 26, 12, 47, 16, 23, 39, 50, 6, 31, 2, 25, 6, 28, 41, 36, 22, 50, 57, 42, 3, 34, 8, 28, 61, 11, 50, 16, 54, 41, 0, 55, 43, 5, 29, 41, 63, 25, 16, 53, 18, 26, 10, 21, 0, 61, 30, 41, 22, 3, 38, 20, 39, 29, 8, 41, 16, 36, 52, 22, 19 },
51 { 55, 34, 0, 25, 10, 32, 56, 44, 28, 0, 57, 7, 26, 53, 23, 8, 13, 35, 22, 12, 36, 60, 20, 8, 14, 29, 48, 2, 41, 49, 23, 13, 39, 7, 48, 58, 25, 53, 34, 62, 28, 16, 48, 4, 37, 56, 27, 5, 36, 52, 46, 7, 62, 33, 52, 11, 17, 53, 5, 28, 41, 24, 38, 17, 5, 39, 20, 45, 15, 56, 5, 38, 60, 8, 14, 57, 21, 48, 62, 39, 59, 13, 1, 60, 9, 32, 16, 63, 44, 25, 52, 15, 36, 2, 60, 29, 12, 33, 25, 17, 59, 45, 13, 8, 49, 32, 6, 40, 59, 29, 45, 37, 13, 47, 6, 55, 30, 45, 9, 52, 13, 59, 25, 47, 32, 1, 49, 30 },
52 { 9, 39, 14, 61, 49, 37, 3, 20, 50, 13, 41, 19, 46, 17, 38, 59, 28, 62, 4, 44, 54, 1, 34, 51, 55, 7, 63, 32, 21, 8, 56, 31, 62, 19, 36, 1, 41, 17, 24, 12, 42, 35, 25, 52, 20, 8, 44, 59, 25, 2, 22, 42, 16, 29, 4, 46, 20, 36, 43, 9, 51, 8, 49, 26, 58, 33, 54, 1, 37, 29, 52, 20, 27, 45, 19, 35, 42, 16, 10, 32, 20, 49, 46, 27, 40, 4, 47, 22, 13, 55, 4, 47, 26, 44, 23, 40, 58, 19, 48, 13, 31, 2, 57, 34, 42, 19, 61, 32, 14, 55, 5, 51, 26, 19, 58, 16, 49, 14, 62, 5, 33, 44, 21, 7, 60, 26, 11, 41 },
53 { 62, 24, 47, 29, 8, 19, 53, 11, 60, 24, 32, 61, 4, 55, 31, 2, 49, 16, 39, 9, 31, 24, 43, 17, 26, 38, 11, 25, 58, 43, 12, 35, 3, 46, 15, 32, 63, 4, 49, 56, 2, 60, 10, 32, 63, 17, 39, 12, 55, 30, 57, 9, 48, 55, 39, 24, 60, 2, 58, 31, 19, 61, 34, 3, 42, 11, 22, 46, 7, 61, 10, 42, 3, 55, 32, 1, 58, 28, 44, 54, 4, 34, 23, 15, 56, 20, 37, 58, 6, 30, 38, 18, 63, 9, 32, 5, 51, 3, 62, 37, 52, 18, 39, 23, 3, 51, 9, 47, 1, 23, 43, 15, 60, 35, 11, 40, 1, 36, 31, 26, 57, 2, 37, 54, 18, 44, 58, 16 },
54 { 5, 51, 3, 33, 43, 62, 21, 42, 35, 9, 48, 15, 36, 10, 22, 42, 20, 46, 26, 56, 50, 12, 59, 3, 48, 19, 45, 53, 1, 27, 47, 17, 52, 24, 56, 11, 51, 21, 37, 30, 20, 46, 14, 41, 1, 47, 33, 7, 41, 17, 35, 27, 20, 1, 14, 54, 26, 33, 18, 47, 1, 44, 14, 59, 16, 52, 28, 18, 49, 31, 25, 34, 63, 13, 51, 24, 9, 50, 3, 23, 38, 63, 7, 52, 29, 46, 11, 33, 50, 22, 57, 36, 1, 57, 49, 17, 39, 28, 9, 35, 6, 27, 53, 15, 55, 30, 24, 58, 36, 41, 11, 52, 32, 3, 44, 25, 62, 23, 51, 15, 42, 22, 50, 10, 39, 4, 31, 35 },
55 { 46, 22, 57, 17, 12, 39, 26, 5, 31, 59, 1, 45, 27, 62, 52, 7, 58, 33, 6, 18, 39, 22, 33, 41, 57, 5, 35, 18, 40, 16, 60, 5, 29, 42, 7, 39, 27, 44, 9, 47, 8, 26, 54, 22, 51, 29, 24, 49, 15, 61, 4, 51, 31, 63, 43, 6, 50, 8, 39, 12, 53, 37, 23, 30, 40, 6, 62, 43, 14, 53, 2, 49, 7, 36, 17, 41, 61, 37, 18, 56, 11, 18, 44, 35, 2, 19, 61, 0, 41, 14, 8, 30, 43, 12, 24, 46, 14, 54, 42, 21, 44, 61, 10, 46, 37, 11, 44, 7, 18, 63, 20, 29, 7, 49, 28, 54, 8, 43, 4, 48, 18, 63, 12, 29, 48, 24, 59, 20 },
56 { 13, 36, 28, 54, 35, 2, 56, 46, 16, 49, 22, 40, 11, 34, 14, 43, 29, 12, 63, 48, 2, 61, 7, 15, 28, 30, 50, 9, 61, 33, 38, 23, 54, 13, 61, 33, 3, 59, 16, 35, 58, 40, 5, 38, 13, 57, 3, 58, 37, 21, 45, 12, 39, 7, 35, 30, 13, 56, 22, 62, 27, 6, 55, 10, 48, 21, 33, 2, 38, 23, 40, 20, 44, 29, 59, 4, 26, 12, 33, 47, 28, 53, 31, 13, 59, 41, 27, 49, 26, 54, 45, 16, 53, 21, 35, 7, 59, 26, 11, 56, 1, 24, 33, 4, 28, 62, 21, 49, 31, 2, 56, 39, 24, 58, 13, 17, 37, 21, 56, 10, 38, 0, 34, 55, 15, 43, 1, 52 },
57 { 42, 9, 50, 6, 25, 60, 14, 38, 10, 29, 53, 18, 57, 3, 25, 51, 0, 53, 25, 17, 29, 37, 52, 46, 0, 62, 14, 37, 4, 50, 10, 44, 0, 46, 20, 25, 50, 19, 55, 0, 23, 31, 62, 34, 11, 45, 19, 32, 0, 53, 10, 59, 23, 47, 18, 60, 42, 28, 37, 3, 50, 15, 35, 44, 0, 51, 27, 60, 9, 57, 16, 58, 11, 22, 46, 15, 53, 48, 7, 42, 0, 60, 5, 49, 24, 54, 9, 17, 39, 5, 34, 62, 3, 40, 60, 31, 0, 47, 29, 16, 49, 39, 59, 17, 50, 0, 40, 13, 53, 38, 16, 46, 0, 42, 34, 60, 2, 53, 29, 31, 58, 46, 27, 6, 61, 8, 37, 28 },
58 { 0, 63, 21, 40, 45, 18, 51, 23, 63, 34, 6, 43, 28, 38, 55, 19, 40, 35, 8, 41, 54, 10, 21, 32, 39, 23, 53, 26, 55, 28, 22, 63, 30, 34, 9, 48, 6, 38, 29, 43, 49, 6, 18, 52, 27, 61, 9, 43, 28, 42, 33, 26, 56, 3, 51, 23, 0, 48, 16, 45, 32, 25, 63, 20, 57, 17, 42, 12, 35, 47, 5, 31, 39, 56, 6, 30, 34, 21, 61, 25, 14, 40, 22, 38, 15, 6, 36, 56, 20, 60, 25, 12, 51, 27, 10, 56, 42, 20, 36, 63, 32, 6, 21, 41, 12, 34, 60, 26, 5, 48, 27, 10, 62, 19, 6, 47, 39, 14, 45, 7, 24, 17, 41, 32, 23, 51, 19, 56 },
59 { 45, 31, 15, 59, 4, 33, 7, 47, 0, 41, 13, 61, 4, 47, 9, 23, 60, 14, 57, 31, 4, 45, 59, 6, 58, 10, 44, 20, 8, 42, 15, 6, 55, 17, 58, 31, 53, 12, 61, 10, 15, 57, 43, 2, 23, 35, 48, 14, 54, 6, 18, 49, 15, 38, 11, 34, 62, 9, 21, 58, 11, 41, 4, 31, 38, 8, 29, 55, 19, 36, 27, 52, 0, 25, 50, 43, 1, 39, 8, 55, 35, 51, 10, 30, 45, 62, 29, 2, 46, 10, 32, 48, 18, 38, 5, 22, 33, 8, 51, 3, 14, 44, 54, 25, 57, 30, 18, 52, 33, 22, 59, 28, 36, 52, 32, 21, 26, 50, 5, 55, 35, 60, 14, 54, 4, 40, 16, 33 },
60 { 27, 3, 49, 10, 30, 40, 55, 27, 57, 24, 52, 21, 32, 17, 60, 30, 5, 44, 27, 49, 19, 34, 13, 24, 43, 36, 3, 49, 31, 59, 37, 48, 26, 41, 2, 41, 14, 36, 21, 32, 40, 26, 13, 49, 55, 5, 16, 40, 25, 60, 36, 1, 63, 29, 17, 44, 25, 40, 52, 5, 29, 47, 54, 13, 46, 24, 60, 4, 51, 22, 63, 14, 45, 18, 12, 62, 17, 57, 19, 42, 3, 26, 58, 48, 1, 21, 40, 52, 23, 37, 44, 1, 29, 58, 43, 50, 15, 61, 19, 45, 58, 28, 7, 48, 2, 46, 8, 42, 3, 55, 8, 50, 12, 4, 55, 10, 63, 33, 20, 40, 11, 3, 46, 20, 48, 26, 61, 11 },
61 { 44, 56, 24, 36, 53, 19, 12, 37, 16, 44, 7, 36, 49, 54, 11, 37, 48, 21, 15, 1, 62, 25, 47, 56, 16, 18, 51, 12, 40, 1, 24, 11, 52, 16, 23, 59, 28, 1, 45, 53, 4, 60, 37, 21, 39, 30, 63, 20, 52, 10, 30, 45, 8, 41, 54, 4, 57, 7, 34, 55, 36, 18, 23, 59, 2, 48, 11, 32, 44, 1, 41, 8, 33, 54, 38, 23, 30, 46, 6, 29, 62, 18, 32, 16, 55, 34, 14, 11, 61, 7, 55, 16, 53, 13, 23, 2, 55, 37, 26, 10, 33, 23, 36, 16, 38, 22, 56, 15, 24, 43, 35, 17, 44, 40, 25, 46, 16, 1, 57, 25, 49, 36, 28, 62, 9, 35, 7, 53 },
62 { 17, 38, 8, 61, 1, 50, 26, 62, 3, 31, 56, 15, 1, 26, 40, 2, 34, 51, 56, 36, 42, 9, 38, 2, 29, 60, 32, 57, 19, 62, 34, 47, 4, 57, 39, 7, 44, 63, 24, 18, 46, 28, 8, 54, 1, 34, 7, 46, 3, 37, 50, 23, 57, 21, 13, 46, 31, 20, 43, 15, 1, 61, 8, 33, 37, 17, 56, 26, 15, 49, 24, 59, 28, 3, 56, 9, 52, 32, 13, 49, 10, 43, 5, 45, 8, 25, 59, 42, 28, 33, 19, 40, 8, 63, 35, 47, 25, 4, 40, 52, 1, 60, 12, 53, 63, 9, 29, 60, 37, 19, 1, 62, 31, 20, 58, 12, 41, 30, 43, 9, 18, 52, 22, 1, 39, 30, 58, 21 },
63 { 13, 47, 29, 18, 43, 34, 5, 48, 20, 42, 10, 45, 30, 58, 20, 63, 24, 11, 6, 28, 54, 14, 22, 52, 41, 7, 26, 5, 45, 15, 53, 13, 35, 27, 18, 50, 12, 33, 5, 56, 10, 17, 45, 24, 59, 15, 50, 26, 56, 13, 19, 5, 32, 52, 27, 36, 2, 61, 12, 26, 49, 40, 27, 52, 13, 50, 6, 39, 61, 34, 10, 37, 48, 20, 41, 27, 2, 36, 59, 24, 54, 33, 63, 20, 38, 50, 3, 17, 52, 4, 58, 27, 45, 21, 32, 11, 48, 17, 57, 20, 46, 38, 25, 43, 4, 34, 51, 6, 13, 45, 57, 26, 6, 48, 2, 35, 53, 23, 61, 34, 59, 6, 42, 56, 13, 51, 2, 41 },
64 { 32, 5, 55, 23, 58, 14, 22, 52, 29, 15, 61, 25, 51, 8, 43, 13, 53, 41, 46, 20, 3, 33, 63, 11, 48, 21, 54, 38, 28, 3, 30, 43, 21, 62, 9, 31, 55, 22, 51, 29, 37, 62, 32, 12, 42, 29, 41, 9, 33, 44, 62, 28, 43, 1, 59, 19, 48, 30, 51, 39, 24, 4, 58, 19, 42, 29, 22, 43, 3, 18, 53, 5, 13, 50, 16, 60, 45, 21, 7, 40, 15, 0, 26, 53, 13, 31, 43, 24, 47, 31, 15, 49, 2, 41, 6, 59, 29, 42, 9, 30, 14, 7, 49, 18, 31, 47, 20, 39, 49, 32, 11, 41, 54, 15, 61, 18, 7, 38, 4, 13, 44, 28, 15, 32, 45, 19, 27, 49 },
65 { 63, 34, 11, 39, 2, 45, 37, 8, 59, 39, 33, 4, 36, 17, 48, 5, 29, 18, 32, 61, 39, 50, 5, 27, 35, 0, 46, 12, 22, 49, 60, 6, 54, 0, 38, 49, 2, 42, 15, 40, 0, 47, 20, 51, 3, 57, 18, 61, 22, 0, 39, 16, 55, 12, 35, 8, 41, 22, 6, 59, 16, 45, 10, 36, 0, 62, 9, 54, 30, 58, 21, 43, 63, 31, 7, 35, 12, 48, 58, 28, 47, 37, 41, 9, 57, 20, 61, 0, 36, 11, 57, 35, 23, 52, 37, 18, 0, 62, 22, 55, 35, 62, 27, 54, 0, 15, 61, 28, 2, 59, 22, 9, 37, 27, 33, 51, 29, 48, 19, 50, 25, 37, 10, 57, 5, 37, 60, 8 },
66 { 20, 25, 46, 52, 31, 60, 12, 55, 0, 19, 11, 46, 62, 35, 23, 38, 57, 0, 55, 10, 16, 30, 58, 44, 17, 59, 29, 63, 42, 8, 36, 20, 33, 46, 16, 61, 25, 35, 8, 54, 26, 7, 58, 22, 34, 6, 47, 14, 53, 31, 48, 9, 37, 25, 49, 63, 16, 55, 45, 14, 34, 63, 21, 53, 25, 33, 46, 16, 35, 7, 46, 29, 0, 39, 25, 55, 22, 34, 18, 4, 56, 11, 23, 51, 28, 6, 39, 14, 62, 44, 19, 8, 60, 12, 56, 28, 50, 34, 39, 5, 51, 3, 41, 12, 57, 35, 10, 53, 25, 17, 52, 30, 47, 0, 43, 14, 5, 57, 31, 55, 0, 63, 47, 23, 54, 24, 14, 43 },
67 { 0, 57, 16, 6, 26, 19, 35, 28, 49, 42, 54, 26, 21, 1, 59, 27, 9, 47, 26, 44, 50, 22, 13, 40, 8, 37, 10, 34, 17, 56, 25, 58, 13, 27, 44, 9, 20, 58, 31, 17, 60, 36, 10, 41, 53, 25, 36, 39, 4, 24, 58, 17, 60, 4, 22, 38, 10, 32, 0, 50, 31, 7, 28, 47, 12, 57, 5, 26, 52, 23, 14, 40, 57, 17, 47, 5, 53, 1, 44, 31, 19, 60, 46, 2, 35, 48, 30, 54, 22, 5, 51, 39, 25, 31, 4, 43, 14, 9, 45, 16, 24, 44, 19, 29, 40, 23, 44, 7, 38, 42, 4, 63, 12, 54, 23, 59, 22, 42, 8, 15, 40, 21, 8, 34, 3, 41, 30, 50 },
68 { 39, 10, 48, 33, 41, 54, 5, 47, 23, 13, 32, 7, 52, 44, 14, 39, 58, 18, 35, 6, 37, 2, 60, 24, 55, 19, 53, 2, 51, 32, 1, 41, 51, 4, 40, 29, 47, 3, 52, 44, 13, 49, 28, 16, 1, 62, 11, 27, 52, 35, 5, 42, 29, 47, 14, 56, 28, 53, 26, 38, 9, 56, 40, 3, 38, 15, 41, 60, 1, 37, 50, 25, 11, 28, 61, 19, 42, 62, 10, 52, 39, 6, 32, 14, 58, 17, 7, 26, 42, 34, 27, 10, 54, 40, 20, 63, 26, 53, 21, 61, 32, 7, 59, 48, 3, 56, 18, 31, 58, 14, 49, 21, 36, 16, 45, 9, 36, 24, 62, 45, 27, 31, 53, 17, 49, 12, 62, 18 },
69 { 28, 59, 21, 58, 2, 16, 38, 9, 62, 3, 56, 41, 10, 31, 50, 4, 32, 52, 12, 63, 23, 46, 33, 31, 4, 48, 25, 43, 14, 23, 47, 11, 22, 55, 14, 60, 23, 37, 11, 39, 23, 2, 45, 56, 31, 43, 19, 55, 16, 46, 21, 51, 11, 33, 44, 2, 41, 18, 5, 52, 23, 44, 17, 60, 27, 49, 11, 32, 44, 10, 54, 2, 56, 33, 8, 38, 13, 29, 36, 16, 24, 63, 27, 51, 21, 43, 56, 12, 49, 3, 59, 48, 1, 15, 46, 7, 36, 2, 47, 11, 50, 27, 37, 13, 33, 8, 51, 46, 1, 34, 28, 40, 3, 33, 60, 29, 47, 1, 35, 11, 59, 42, 2, 60, 26, 46, 6, 35 },
70 { 4, 43, 9, 29, 36, 63, 24, 44, 20, 50, 30, 17, 60, 22, 16, 43, 25, 3, 42, 19, 51, 15, 8, 54, 42, 15, 61, 5, 39, 57, 18, 61, 31, 48, 34, 2, 50, 19, 57, 5, 63, 33, 19, 38, 13, 27, 48, 7, 32, 61, 2, 26, 58, 6, 24, 50, 13, 61, 42, 20, 62, 2, 35, 20, 51, 4, 62, 18, 23, 58, 20, 31, 43, 15, 51, 45, 26, 50, 4, 55, 45, 3, 35, 9, 38, 1, 32, 61, 20, 45, 17, 33, 24, 57, 29, 51, 22, 58, 38, 30, 15, 1, 54, 21, 63, 43, 26, 12, 24, 56, 8, 60, 50, 19, 5, 52, 13, 54, 17, 50, 4, 16, 36, 12, 32, 56, 22, 54 },
71 { 51, 25, 40, 53, 12, 49, 15, 57, 34, 7, 38, 47, 2, 36, 55, 8, 61, 30, 56, 7, 28, 59, 48, 11, 27, 35, 21, 45, 28, 36, 9, 38, 6, 16, 24, 63, 10, 32, 28, 43, 21, 53, 5, 60, 8, 57, 3, 45, 11, 37, 15, 54, 40, 20, 62, 36, 27, 34, 11, 48, 30, 15, 54, 8, 30, 42, 22, 34, 48, 13, 35, 63, 4, 37, 22, 2, 59, 9, 41, 23, 13, 41, 49, 18, 59, 24, 40, 5, 37, 30, 9, 61, 44, 6, 37, 11, 33, 17, 5, 55, 41, 60, 23, 39, 17, 5, 30, 62, 41, 16, 46, 25, 11, 56, 39, 26, 20, 38, 29, 39, 22, 52, 44, 20, 48, 1, 38, 14 },
72 { 15, 33, 2, 18, 44, 6, 27, 0, 32, 61, 25, 12, 58, 28, 40, 20, 47, 13, 34, 43, 38, 1, 23, 62, 40, 0, 51, 10, 63, 3, 52, 26, 44, 30, 45, 6, 41, 54, 0, 51, 12, 30, 46, 24, 49, 22, 40, 33, 63, 23, 43, 30, 9, 47, 0, 17, 54, 7, 57, 3, 37, 47, 24, 46, 13, 55, 7, 52, 2, 42, 6, 26, 49, 18, 60, 34, 16, 57, 33, 20, 61, 30, 8, 54, 14, 46, 12, 53, 16, 55, 38, 13, 22, 53, 18, 59, 46, 27, 43, 19, 32, 10, 45, 6, 49, 36, 52, 2, 20, 55, 6, 39, 32, 15, 44, 3, 58, 10, 63, 6, 56, 30, 7, 58, 9, 40, 19, 63 },
73 { 10, 47, 61, 23, 55, 31, 52, 42, 17, 45, 4, 51, 27, 6, 15, 53, 0, 49, 26, 10, 56, 18, 36, 6, 20, 58, 32, 30, 13, 49, 19, 56, 0, 59, 12, 53, 27, 17, 38, 25, 48, 9, 15, 36, 14, 30, 59, 17, 0, 50, 8, 58, 18, 56, 31, 45, 21, 41, 29, 19, 60, 6, 32, 59, 0, 36, 29, 39, 19, 59, 46, 12, 55, 30, 10, 47, 24, 3, 28, 48, 0, 55, 44, 27, 33, 4, 63, 29, 49, 0, 26, 50, 34, 2, 42, 14, 0, 62, 9, 56, 3, 52, 28, 34, 58, 9, 20, 48, 37, 32, 22, 53, 0, 62, 27, 49, 34, 46, 21, 33, 41, 14, 25, 37, 53, 29, 31, 45 },
74 { 56, 28, 7, 37, 11, 36, 20, 9, 54, 14, 39, 19, 34, 63, 45, 37, 24, 17, 60, 31, 21, 45, 53, 29, 47, 15, 7, 55, 40, 23, 34, 14, 42, 20, 37, 35, 15, 59, 7, 62, 34, 40, 59, 1, 51, 42, 10, 28, 54, 21, 35, 5, 38, 13, 36, 4, 59, 12, 39, 53, 15, 43, 9, 21, 39, 62, 16, 56, 25, 9, 32, 38, 0, 41, 14, 51, 40, 53, 43, 11, 37, 17, 5, 22, 57, 39, 19, 7, 42, 21, 60, 10, 31, 63, 25, 52, 30, 49, 36, 25, 48, 17, 61, 14, 22, 42, 29, 13, 60, 11, 47, 18, 35, 41, 7, 23, 4, 16, 51, 11, 0, 48, 61, 3, 17, 50, 5, 24 },
75 { 0, 42, 21, 49, 60, 3, 57, 40, 29, 48, 23, 56, 42, 11, 22, 5, 59, 39, 4, 50, 3, 41, 12, 57, 25, 50, 44, 18, 4, 46, 7, 62, 33, 50, 4, 56, 21, 32, 43, 18, 3, 23, 55, 34, 20, 4, 53, 38, 12, 46, 29, 52, 25, 61, 23, 51, 26, 46, 1, 34, 25, 57, 28, 51, 26, 11, 50, 3, 44, 28, 53, 21, 57, 27, 62, 6, 31, 19, 8, 63, 26, 59, 36, 47, 15, 29, 50, 25, 35, 47, 18, 41, 4, 48, 8, 40, 12, 23, 6, 44, 13, 40, 1, 31, 55, 0, 61, 43, 4, 50, 26, 58, 9, 53, 24, 61, 42, 55, 31, 43, 57, 20, 34, 27, 43, 8, 59, 39 },
76 { 18, 51, 30, 13, 26, 16, 46, 22, 2, 59, 8, 30, 1, 48, 33, 51, 29, 9, 46, 16, 62, 14, 33, 2, 38, 9, 27, 60, 37, 26, 53, 17, 28, 10, 24, 46, 2, 49, 8, 57, 29, 45, 6, 26, 62, 44, 18, 25, 61, 3, 42, 14, 49, 10, 43, 6, 17, 32, 63, 10, 49, 4, 40, 14, 45, 33, 22, 37, 12, 61, 5, 17, 43, 7, 23, 37, 15, 58, 49, 13, 39, 21, 10, 52, 1, 62, 9, 56, 12, 2, 58, 28, 36, 16, 56, 28, 56, 35, 20, 63, 24, 37, 51, 8, 45, 25, 16, 33, 27, 38, 2, 44, 13, 30, 17, 36, 12, 26, 5, 18, 28, 47, 13, 60, 23, 45, 13, 33 },
77 { 55, 4, 62, 34, 52, 38, 7, 63, 32, 37, 13, 53, 25, 62, 18, 12, 55, 41, 27, 35, 24, 49, 31, 52, 17, 63, 34, 1, 56, 12, 41, 2, 48, 58, 39, 16, 61, 27, 41, 52, 13, 19, 50, 39, 11, 31, 57, 6, 32, 40, 20, 55, 1, 28, 33, 57, 48, 8, 37, 22, 44, 18, 53, 1, 61, 5, 54, 16, 47, 36, 50, 24, 55, 34, 48, 45, 1, 30, 33, 46, 2, 50, 32, 42, 25, 34, 43, 21, 38, 52, 23, 45, 14, 54, 21, 4, 44, 16, 53, 29, 10, 47, 19, 57, 12, 54, 39, 10, 51, 15, 63, 21, 57, 40, 51, 1, 48, 57, 37, 62, 2, 38, 9, 52, 1, 35, 58, 22 },
78 { 36, 46, 10, 42, 1, 27, 43, 15, 50, 21, 45, 16, 41, 3, 35, 44, 20, 1, 57, 11, 55, 7, 43, 8, 22, 42, 13, 46, 21, 39, 31, 60, 22, 5, 29, 44, 11, 35, 20, 4, 36, 58, 32, 15, 47, 2, 36, 48, 16, 60, 8, 35, 44, 63, 16, 2, 40, 26, 55, 14, 58, 35, 24, 31, 19, 42, 31, 58, 1, 29, 10, 40, 2, 19, 12, 54, 22, 61, 7, 24, 56, 5, 28, 16, 54, 3, 15, 58, 6, 30, 8, 62, 1, 43, 31, 47, 7, 59, 1, 38, 58, 4, 34, 27, 38, 5, 31, 59, 7, 46, 30, 3, 34, 6, 28, 59, 20, 8, 32, 15, 53, 24, 55, 31, 19, 49, 11, 26 },
79 { 2, 24, 16, 58, 19, 55, 5, 35, 10, 61, 4, 28, 57, 24, 58, 7, 31, 47, 22, 38, 19, 28, 61, 36, 54, 5, 59, 29, 6, 52, 15, 11, 43, 36, 8, 54, 52, 1, 62, 25, 47, 9, 1, 60, 28, 53, 24, 14, 46, 27, 51, 22, 12, 24, 38, 53, 20, 11, 51, 3, 29, 7, 48, 63, 8, 49, 9, 21, 52, 14, 63, 32, 46, 60, 35, 4, 41, 16, 52, 35, 18, 42, 59, 7, 36, 61, 45, 27, 33, 51, 19, 39, 34, 11, 61, 18, 33, 41, 28, 15, 54, 22, 42, 3, 49, 21, 47, 18, 36, 23, 55, 19, 48, 24, 45, 10, 33, 44, 50, 40, 7, 35, 15, 41, 63, 6, 40, 54 },
80 { 62, 41, 32, 8, 47, 28, 60, 24, 44, 30, 38, 49, 9, 33, 14, 40, 50, 14, 60, 2, 54, 40, 0, 20, 25, 39, 16, 49, 24, 35, 57, 47, 19, 61, 33, 18, 23, 37, 13, 55, 31, 43, 22, 41, 17, 8, 42, 58, 0, 37, 5, 56, 31, 54, 7, 30, 60, 33, 42, 17, 59, 39, 12, 27, 38, 17, 35, 41, 27, 45, 20, 7, 25, 15, 29, 58, 27, 47, 11, 40, 14, 54, 23, 46, 19, 31, 11, 40, 13, 49, 5, 58, 24, 51, 26, 6, 50, 20, 49, 9, 32, 46, 17, 60, 14, 63, 24, 1, 57, 41, 9, 43, 14, 62, 16, 52, 3, 27, 14, 22, 61, 45, 4, 28, 9, 47, 29, 17 },
81 { 5, 50, 12, 53, 38, 18, 11, 51, 0, 55, 17, 6, 47, 54, 19, 63, 5, 26, 34, 45, 13, 30, 47, 58, 10, 48, 32, 3, 62, 9, 26, 0, 25, 14, 50, 3, 47, 30, 42, 16, 6, 63, 12, 49, 33, 55, 21, 10, 34, 63, 18, 41, 3, 47, 19, 43, 0, 49, 8, 28, 46, 20, 52, 0, 56, 24, 60, 3, 59, 5, 39, 57, 48, 52, 9, 38, 3, 21, 26, 60, 0, 32, 12, 38, 4, 48, 53, 0, 60, 15, 29, 44, 18, 10, 38, 57, 13, 60, 2, 26, 62, 7, 50, 29, 35, 8, 40, 53, 28, 12, 60, 33, 38, 5, 37, 29, 60, 39, 56, 0, 30, 18, 50, 34, 59, 25, 14, 44 },
82 { 20, 31, 60, 22, 3, 49, 33, 25, 40, 13, 34, 59, 22, 36, 0, 28, 37, 56, 8, 18, 51, 16, 4, 45, 27, 12, 53, 42, 18, 44, 51, 31, 55, 40, 28, 58, 7, 60, 10, 51, 27, 37, 24, 56, 5, 26, 44, 29, 50, 23, 45, 11, 34, 15, 59, 27, 13, 23, 62, 37, 4, 57, 15, 32, 42, 6, 47, 11, 30, 43, 23, 13, 0, 36, 18, 44, 63, 51, 37, 29, 49, 20, 57, 27, 62, 9, 24, 35, 23, 53, 37, 3, 42, 55, 0, 36, 23, 39, 31, 43, 17, 37, 24, 11, 52, 43, 19, 32, 5, 50, 26, 0, 56, 21, 54, 11, 19, 6, 47, 25, 59, 42, 12, 54, 21, 3, 38, 57 },
83 { 48, 0, 35, 27, 44, 14, 59, 7, 57, 46, 26, 2, 42, 12, 52, 43, 10, 27, 53, 42, 32, 62, 37, 21, 34, 61, 7, 23, 36, 4, 38, 12, 41, 5, 17, 45, 22, 27, 39, 21, 59, 0, 45, 18, 39, 62, 3, 38, 14, 7, 54, 26, 61, 39, 9, 52, 45, 36, 18, 50, 10, 34, 44, 22, 50, 14, 36, 55, 17, 34, 53, 62, 33, 26, 56, 6, 31, 12, 6, 53, 9, 44, 2, 50, 20, 40, 55, 17, 47, 7, 26, 63, 22, 32, 48, 16, 46, 8, 52, 12, 57, 41, 0, 56, 25, 3, 61, 14, 45, 35, 18, 44, 12, 46, 23, 42, 32, 51, 35, 10, 17, 36, 23, 1, 45, 52, 32, 10 },
84 { 37, 15, 43, 8, 63, 39, 21, 31, 16, 37, 19, 62, 30, 46, 17, 60, 21, 48, 1, 23, 6, 25, 11, 56, 1, 40, 30, 58, 15, 54, 21, 59, 9, 63, 35, 56, 11, 51, 2, 46, 34, 14, 53, 7, 30, 11, 51, 19, 60, 40, 30, 1, 24, 50, 20, 32, 3, 56, 5, 25, 31, 13, 61, 2, 29, 60, 25, 20, 51, 2, 27, 8, 18, 42, 10, 45, 21, 34, 43, 17, 62, 29, 41, 14, 34, 6, 30, 43, 2, 57, 33, 13, 45, 12, 27, 62, 4, 55, 21, 35, 5, 27, 45, 33, 16, 47, 30, 54, 22, 10, 51, 27, 63, 7, 49, 1, 58, 22, 15, 43, 53, 7, 57, 39, 27, 12, 61, 24 },
85 { 56, 51, 26, 56, 19, 2, 41, 54, 5, 52, 9, 48, 6, 23, 39, 4, 32, 15, 63, 35, 59, 49, 43, 15, 52, 19, 50, 9, 46, 33, 1, 29, 48, 20, 32, 1, 38, 33, 19, 54, 9, 32, 24, 48, 58, 35, 16, 48, 4, 52, 13, 57, 33, 5, 45, 59, 15, 29, 41, 55, 47, 39, 23, 53, 9, 40, 4, 57, 10, 44, 48, 40, 50, 14, 61, 24, 55, 1, 59, 22, 33, 8, 51, 25, 58, 46, 11, 59, 20, 41, 17, 51, 6, 56, 35, 25, 42, 30, 15, 58, 48, 18, 61, 9, 58, 39, 13, 2, 37, 59, 40, 2, 31, 16, 34, 41, 8, 30, 62, 3, 29, 48, 33, 5, 63, 16, 41, 7 },
86 { 22, 4, 46, 11, 33, 51, 29, 10, 62, 24, 43, 27, 15, 58, 50, 25, 54, 44, 9, 38, 18, 3, 29, 57, 32, 5, 26, 43, 17, 61, 24, 52, 8, 42, 23, 53, 15, 61, 7, 28, 57, 43, 4, 40, 20, 2, 43, 25, 32, 35, 21, 43, 17, 48, 10, 22, 38, 54, 11, 21, 1, 58, 16, 30, 48, 18, 46, 32, 38, 13, 22, 4, 59, 35, 2, 51, 30, 39, 15, 47, 4, 56, 13, 37, 1, 28, 16, 52, 32, 9, 61, 29, 38, 19, 3, 52, 10, 48, 1, 32, 11, 40, 20, 36, 6, 22, 49, 29, 55, 6, 20, 56, 36, 52, 19, 60, 26, 46, 18, 54, 40, 13, 20, 46, 35, 19, 49, 29 },
87 { 61, 17, 34, 53, 23, 6, 48, 35, 20, 40, 1, 56, 36, 29, 11, 34, 7, 41, 14, 30, 55, 20, 46, 8, 24, 38, 63, 2, 37, 10, 45, 14, 34, 49, 6, 13, 44, 25, 49, 41, 21, 12, 61, 15, 54, 29, 63, 12, 56, 8, 49, 2, 62, 36, 28, 61, 0, 25, 41, 63, 35, 8, 44, 6, 37, 62, 7, 21, 63, 28, 55, 31, 16, 24, 41, 19, 9, 57, 27, 36, 18, 42, 31, 62, 22, 55, 38, 4, 27, 47, 1, 40, 14, 54, 43, 20, 60, 23, 38, 63, 25, 51, 2, 53, 26, 63, 10, 42, 17, 34, 47, 25, 13, 5, 44, 11, 55, 2, 38, 27, 6, 60, 52, 25, 9, 55, 1, 40 },
88 { 8, 30, 58, 3, 42, 61, 17, 38, 13, 59, 32, 10, 54, 3, 51, 20, 61, 26, 57, 2, 46, 33, 12, 60, 41, 13, 48, 29, 55, 20, 39, 27, 57, 18, 62, 29, 55, 2, 31, 16, 37, 50, 26, 36, 6, 46, 9, 41, 27, 57, 23, 39, 26, 6, 51, 12, 31, 46, 7, 16, 27, 52, 19, 56, 26, 12, 33, 53, 1, 41, 8, 57, 46, 7, 54, 32, 47, 5, 49, 11, 60, 23, 5, 48, 10, 43, 19, 63, 35, 24, 49, 21, 59, 5, 31, 37, 14, 44, 7, 42, 6, 30, 46, 13, 44, 32, 19, 50, 4, 58, 8, 30, 62, 38, 28, 53, 21, 36, 13, 50, 21, 33, 15, 2, 44, 31, 14, 47 },
89 { 37, 13, 39, 16, 28, 9, 57, 0, 25, 49, 21, 45, 18, 47, 12, 42, 0, 49, 22, 39, 16, 53, 25, 36, 0, 52, 22, 16, 6, 60, 4, 51, 0, 26, 37, 47, 10, 36, 63, 5, 57, 0, 18, 59, 23, 33, 51, 19, 0, 44, 15, 11, 54, 17, 42, 35, 53, 18, 58, 33, 49, 4, 34, 42, 0, 50, 43, 25, 16, 49, 34, 20, 37, 28, 12, 63, 16, 38, 25, 44, 0, 40, 52, 17, 35, 3, 50, 14, 8, 53, 11, 36, 25, 45, 9, 62, 0, 54, 28, 17, 50, 55, 15, 24, 57, 0, 53, 34, 23, 41, 15, 45, 0, 49, 16, 4, 48, 9, 63, 45, 0, 42, 58, 37, 61, 22, 54, 26 },
90 { 0, 50, 21, 47, 54, 36, 27, 45, 52, 4, 34, 15, 63, 29, 37, 59, 17, 31, 6, 61, 28, 5, 48, 18, 59, 27, 34, 56, 44, 31, 35, 12, 41, 59, 16, 3, 40, 20, 50, 22, 30, 40, 52, 10, 45, 3, 59, 22, 37, 61, 29, 46, 31, 58, 2, 22, 9, 43, 3, 39, 14, 61, 24, 54, 15, 29, 11, 60, 39, 17, 5, 61, 0, 44, 50, 3, 31, 14, 58, 21, 54, 28, 15, 45, 60, 26, 33, 58, 44, 22, 60, 2, 57, 34, 49, 27, 18, 34, 21, 59, 29, 4, 36, 41, 8, 39, 28, 11, 62, 26, 53, 20, 35, 24, 59, 32, 29, 39, 24, 31, 57, 23, 11, 28, 5, 36, 11, 59 },
91 { 44, 32, 63, 5, 20, 12, 41, 7, 30, 61, 42, 8, 39, 5, 33, 8, 24, 53, 45, 11, 37, 58, 7, 44, 10, 50, 3, 40, 8, 22, 53, 19, 46, 9, 33, 52, 24, 58, 8, 44, 13, 47, 8, 34, 38, 30, 14, 47, 7, 34, 4, 55, 9, 19, 40, 49, 56, 26, 60, 21, 30, 45, 10, 19, 40, 58, 23, 36, 3, 52, 45, 23, 54, 13, 22, 42, 53, 45, 7, 33, 10, 36, 57, 6, 29, 12, 41, 0, 30, 15, 41, 30, 17, 7, 16, 53, 40, 56, 2, 39, 12, 61, 10, 52, 31, 60, 16, 45, 1, 37, 7, 61, 40, 10, 43, 17, 58, 7, 54, 14, 4, 51, 39, 49, 18, 56, 42, 20 },
92 { 14, 6, 24, 36, 56, 49, 22, 60, 18, 14, 23, 51, 26, 57, 21, 52, 41, 14, 35, 50, 19, 31, 40, 23, 33, 14, 63, 17, 32, 47, 7, 62, 23, 30, 56, 11, 42, 27, 14, 60, 35, 19, 28, 61, 17, 55, 25, 39, 53, 17, 42, 21, 38, 63, 25, 5, 14, 36, 12, 50, 1, 37, 59, 32, 2, 51, 6, 56, 27, 32, 11, 30, 38, 26, 60, 8, 26, 19, 62, 39, 50, 2, 21, 39, 53, 23, 56, 19, 49, 39, 5, 46, 55, 23, 42, 4, 31, 11, 47, 26, 45, 22, 48, 18, 21, 5, 48, 25, 57, 14, 47, 30, 3, 56, 12, 50, 1, 42, 19, 47, 35, 17, 8, 30, 45, 25, 4, 51 },
93 { 28, 58, 43, 1, 31, 8, 33, 2, 44, 55, 32, 1, 60, 12, 46, 27, 4, 62, 23, 1, 56, 13, 62, 2, 54, 36, 25, 51, 1, 57, 26, 42, 3, 49, 17, 38, 1, 48, 31, 4, 54, 3, 50, 24, 1, 49, 5, 63, 13, 27, 52, 1, 48, 13, 45, 33, 52, 30, 46, 20, 55, 28, 6, 48, 24, 38, 20, 47, 14, 62, 48, 9, 58, 4, 36, 30, 56, 1, 34, 12, 18, 63, 25, 48, 4, 16, 37, 7, 62, 10, 52, 28, 13, 50, 36, 63, 24, 51, 15, 58, 8, 33, 1, 38, 56, 35, 42, 9, 33, 51, 22, 18, 48, 32, 27, 37, 23, 61, 33, 11, 59, 29, 62, 1, 53, 10, 60, 33 },
94 { 12, 39, 17, 52, 26, 46, 53, 38, 25, 11, 48, 36, 16, 43, 2, 35, 55, 17, 39, 29, 43, 9, 28, 45, 20, 5, 46, 12, 42, 28, 13, 52, 36, 6, 60, 22, 54, 17, 62, 39, 25, 42, 15, 55, 44, 20, 31, 10, 35, 57, 24, 32, 29, 6, 59, 18, 7, 62, 3, 41, 10, 44, 16, 54, 13, 62, 31, 9, 41, 1, 21, 43, 18, 47, 15, 40, 11, 49, 28, 55, 46, 30, 8, 43, 32, 61, 28, 47, 25, 34, 21, 61, 32, 1, 20, 9, 46, 6, 35, 19, 41, 54, 27, 63, 14, 3, 51, 20, 62, 2, 38, 55, 8, 21, 63, 6, 46, 9, 26, 51, 3, 24, 43, 34, 16, 41, 18, 48 },
95 { 62, 23, 55, 9, 15, 62, 19, 13, 58, 40, 6, 30, 54, 19, 50, 31, 10, 44, 6, 59, 21, 47, 51, 15, 60, 39, 30, 54, 21, 61, 19, 33, 14, 29, 43, 11, 34, 45, 7, 21, 10, 56, 36, 6, 38, 11, 58, 42, 2, 47, 11, 60, 50, 16, 41, 28, 38, 23, 47, 17, 35, 63, 22, 33, 42, 5, 45, 17, 53, 35, 25, 56, 33, 6, 51, 19, 60, 23, 43, 15, 5, 40, 58, 13, 51, 1, 45, 11, 54, 3, 43, 8, 37, 48, 59, 29, 39, 21, 61, 43, 3, 31, 10, 44, 24, 29, 60, 12, 28, 40, 11, 25, 43, 52, 14, 41, 16, 57, 44, 20, 40, 55, 12, 21, 57, 27, 35, 2 },
96 { 37, 6, 31, 42, 40, 4, 29, 50, 0, 20, 63, 28, 9, 58, 14, 24, 63, 26, 48, 16, 34, 4, 32, 38, 23, 11, 58, 4, 37, 9, 45, 5, 63, 48, 26, 57, 2, 28, 32, 51, 46, 29, 13, 62, 27, 46, 28, 18, 50, 15, 40, 4, 19, 34, 54, 0, 53, 9, 26, 58, 28, 5, 49, 0, 57, 27, 19, 60, 29, 8, 59, 12, 37, 63, 24, 46, 3, 37, 6, 52, 26, 32, 20, 36, 9, 22, 59, 18, 35, 51, 14, 57, 17, 24, 12, 44, 56, 0, 30, 13, 59, 20, 49, 17, 54, 43, 6, 34, 46, 17, 58, 36, 0, 34, 29, 54, 25, 2, 36, 15, 60, 6, 37, 46, 4, 50, 9, 45 },
97 { 19, 59, 48, 3, 24, 60, 44, 22, 34, 51, 15, 45, 41, 5, 33, 47, 0, 37, 12, 55, 25, 54, 8, 57, 0, 47, 18, 34, 49, 15, 55, 24, 40, 20, 8, 35, 53, 13, 41, 18, 0, 59, 22, 33, 4, 52, 8, 60, 24, 36, 31, 56, 45, 26, 10, 43, 15, 56, 36, 4, 51, 14, 39, 30, 12, 55, 36, 2, 39, 49, 4, 44, 17, 0, 32, 13, 53, 35, 59, 17, 62, 0, 55, 24, 52, 38, 31, 6, 42, 19, 29, 40, 4, 54, 33, 5, 16, 27, 52, 37, 23, 55, 7, 37, 0, 39, 23, 49, 4, 53, 31, 15, 59, 10, 50, 4, 60, 34, 48, 7, 31, 49, 27, 14, 62, 22, 53, 29 },
98 { 46, 21, 14, 51, 36, 17, 7, 57, 10, 32, 3, 37, 22, 60, 39, 18, 56, 20, 42, 3, 36, 10, 44, 26, 41, 29, 53, 27, 2, 39, 30, 52, 0, 59, 15, 48, 23, 61, 6, 58, 37, 12, 40, 49, 16, 39, 20, 44, 0, 62, 8, 21, 3, 59, 23, 32, 49, 31, 12, 44, 22, 59, 18, 50, 24, 7, 43, 52, 15, 23, 41, 26, 51, 28, 55, 39, 21, 27, 10, 42, 12, 45, 27, 47, 3, 15, 63, 26, 55, 0, 60, 26, 45, 18, 62, 38, 58, 49, 8, 47, 4, 33, 46, 29, 57, 13, 56, 16, 59, 21, 5, 47, 23, 39, 18, 44, 13, 22, 28, 53, 19, 0, 58, 32, 41, 7, 26, 13 },
99 { 0, 56, 34, 28, 11, 55, 31, 47, 26, 41, 56, 13, 53, 28, 11, 49, 7, 52, 32, 61, 50, 22, 63, 17, 13, 56, 7, 19, 43, 62, 10, 21, 37, 32, 43, 4, 38, 19, 44, 25, 31, 54, 5, 23, 61, 30, 53, 12, 35, 22, 43, 53, 37, 48, 7, 62, 20, 2, 61, 41, 8, 34, 47, 9, 63, 34, 28, 10, 55, 33, 14, 57, 7, 47, 9, 61, 4, 49, 31, 50, 21, 38, 8, 16, 57, 44, 33, 5, 49, 36, 12, 50, 7, 34, 10, 25, 2, 22, 36, 15, 26, 61, 18, 9, 22, 46, 32, 8, 27, 37, 44, 30, 55, 3, 62, 24, 38, 56, 5, 45, 38, 24, 43, 10, 19, 54, 39, 61 },
100 { 41, 30, 8, 63, 43, 23, 38, 3, 62, 19, 8, 49, 25, 1, 58, 30, 23, 40, 9, 28, 18, 40, 6, 38, 49, 22, 35, 59, 8, 27, 50, 5, 56, 17, 11, 50, 30, 9, 55, 2, 51, 19, 34, 47, 9, 41, 6, 26, 48, 57, 14, 28, 17, 12, 39, 13, 37, 46, 25, 19, 54, 27, 1, 37, 16, 45, 20, 60, 1, 48, 20, 38, 31, 22, 42, 15, 19, 44, 1, 61, 6, 34, 56, 40, 29, 10, 20, 46, 13, 22, 41, 23, 59, 42, 30, 51, 45, 13, 63, 53, 42, 12, 51, 38, 62, 2, 26, 41, 50, 1, 61, 10, 19, 42, 31, 8, 49, 32, 12, 63, 9, 52, 16, 56, 36, 2, 31, 16 },
101 { 52, 5, 47, 20, 1, 53, 12, 50, 16, 35, 43, 21, 33, 43, 16, 44, 3, 59, 14, 46, 1, 30, 60, 33, 2, 45, 12, 42, 31, 47, 14, 33, 46, 25, 55, 27, 60, 36, 16, 42, 14, 46, 26, 1, 55, 15, 63, 32, 2, 38, 5, 47, 33, 61, 30, 52, 4, 57, 6, 38, 11, 43, 61, 24, 52, 3, 31, 22, 42, 10, 62, 3, 59, 11, 35, 57, 33, 54, 24, 14, 29, 48, 18, 2, 60, 41, 53, 24, 32, 62, 3, 53, 15, 1, 55, 17, 32, 40, 6, 31, 1, 40, 28, 5, 35, 52, 19, 63, 13, 33, 17, 41, 52, 26, 15, 57, 1, 20, 42, 17, 35, 27, 48, 5, 25, 50, 44, 11 },
102 { 35, 25, 38, 57, 33, 17, 40, 6, 59, 27, 54, 5, 61, 10, 52, 26, 36, 19, 51, 35, 57, 48, 11, 20, 54, 25, 61, 16, 1, 58, 24, 61, 3, 39, 7, 47, 1, 22, 49, 28, 63, 10, 58, 32, 17, 36, 45, 19, 51, 29, 59, 10, 50, 1, 23, 42, 18, 29, 51, 21, 56, 32, 14, 5, 40, 58, 47, 13, 54, 35, 29, 45, 18, 52, 26, 2, 38, 8, 46, 36, 58, 11, 52, 35, 17, 28, 1, 58, 9, 39, 17, 28, 37, 48, 20, 9, 57, 24, 50, 19, 58, 16, 48, 25, 43, 11, 35, 6, 45, 24, 56, 4, 36, 7, 47, 35, 52, 28, 59, 30, 2, 61, 21, 33, 63, 12, 18, 59 },
103 { 3, 49, 15, 10, 27, 61, 25, 45, 30, 0, 14, 47, 31, 38, 17, 62, 7, 55, 27, 4, 15, 24, 42, 52, 10, 34, 5, 51, 36, 18, 41, 11, 35, 21, 62, 13, 33, 57, 8, 35, 5, 40, 21, 43, 52, 3, 24, 56, 11, 16, 33, 25, 41, 20, 55, 8, 60, 35, 15, 48, 2, 57, 30, 49, 18, 25, 6, 39, 17, 57, 7, 25, 43, 5, 49, 16, 62, 22, 55, 4, 25, 43, 23, 7, 50, 11, 37, 48, 14, 51, 33, 57, 7, 27, 39, 46, 4, 29, 11, 43, 34, 56, 7, 60, 20, 54, 30, 57, 22, 49, 9, 33, 54, 14, 63, 23, 6, 43, 10, 40, 50, 13, 44, 8, 38, 33, 46, 23 },
104 { 55, 39, 22, 50, 44, 4, 36, 9, 52, 23, 37, 59, 21, 2, 46, 13, 31, 41, 11, 45, 62, 29, 6, 37, 19, 48, 30, 23, 44, 7, 53, 28, 54, 16, 41, 29, 44, 18, 52, 24, 60, 15, 48, 7, 27, 59, 9, 34, 42, 54, 7, 63, 4, 46, 31, 27, 45, 0, 40, 26, 34, 17, 37, 10, 53, 29, 36, 50, 2, 27, 51, 11, 61, 37, 23, 41, 30, 7, 18, 50, 39, 14, 63, 32, 45, 61, 19, 30, 25, 44, 2, 47, 23, 63, 11, 34, 59, 37, 60, 3, 22, 14, 44, 30, 15, 0, 47, 15, 3, 38, 61, 20, 27, 45, 11, 39, 51, 16, 55, 3, 22, 54, 29, 58, 1, 57, 6, 29 },
105 { 9, 17, 60, 2, 34, 56, 20, 62, 39, 12, 49, 6, 29, 56, 34, 48, 0, 58, 22, 38, 18, 43, 56, 0, 63, 14, 55, 3, 59, 31, 15, 45, 0, 49, 6, 58, 3, 38, 12, 45, 0, 37, 29, 57, 13, 39, 30, 49, 0, 23, 44, 36, 16, 57, 13, 54, 11, 24, 63, 9, 53, 7, 62, 42, 0, 59, 15, 23, 63, 34, 40, 16, 32, 0, 53, 12, 48, 28, 59, 33, 0, 53, 9, 27, 3, 22, 54, 5, 56, 9, 61, 13, 42, 14, 52, 19, 0, 21, 47, 27, 53, 36, 3, 50, 39, 58, 25, 40, 53, 28, 12, 50, 0, 59, 32, 2, 21, 34, 26, 46, 37, 7, 18, 47, 24, 14, 53, 42 },
106 { 61, 32, 13, 54, 29, 7, 46, 13, 28, 57, 18, 41, 53, 15, 9, 39, 24, 49, 33, 3, 53, 9, 26, 32, 40, 28, 46, 39, 25, 9, 56, 21, 63, 37, 26, 22, 51, 27, 17, 56, 31, 53, 4, 43, 22, 46, 12, 18, 60, 40, 20, 26, 50, 21, 39, 5, 49, 33, 16, 44, 22, 46, 20, 32, 24, 45, 8, 43, 12, 46, 4, 48, 56, 20, 29, 58, 3, 40, 10, 42, 31, 21, 47, 41, 56, 38, 15, 42, 36, 27, 20, 33, 55, 3, 26, 44, 31, 54, 12, 35, 9, 63, 28, 10, 21, 32, 9, 60, 17, 8, 43, 29, 40, 16, 36, 48, 60, 7, 57, 14, 62, 31, 42, 15, 36, 40, 20, 26 },
107 { 0, 37, 47, 23, 41, 18, 32, 48, 1, 35, 8, 25, 4, 26, 63, 20, 54, 8, 16, 61, 35, 23, 51, 15, 58, 7, 12, 20, 50, 34, 42, 4, 38, 10, 32, 47, 8, 60, 41, 20, 9, 25, 50, 19, 62, 1, 37, 56, 28, 8, 53, 11, 3, 58, 34, 43, 19, 60, 38, 4, 58, 31, 3, 51, 11, 55, 38, 30, 21, 58, 19, 26, 9, 44, 36, 13, 46, 20, 62, 24, 13, 60, 5, 28, 12, 34, 7, 59, 0, 53, 45, 6, 38, 30, 50, 7, 62, 16, 41, 5, 46, 18, 55, 42, 51, 5, 45, 23, 34, 48, 19, 58, 5, 25, 54, 19, 13, 41, 28, 21, 0, 49, 10, 60, 4, 51, 9, 45 },
108 { 19, 28, 6, 58, 10, 51, 4, 22, 55, 42, 60, 45, 34, 51, 42, 5, 30, 45, 27, 40, 13, 47, 4, 49, 21, 38, 60, 29, 2, 57, 17, 27, 52, 19, 61, 14, 30, 34, 2, 44, 63, 33, 11, 35, 16, 51, 25, 6, 14, 47, 31, 61, 37, 29, 18, 8, 52, 2, 28, 54, 13, 41, 15, 62, 35, 18, 2, 60, 6, 33, 41, 61, 31, 6, 56, 17, 34, 50, 6, 52, 44, 35, 16, 51, 59, 24, 48, 18, 31, 40, 16, 49, 21, 60, 17, 39, 10, 49, 32, 57, 24, 39, 1, 25, 18, 62, 37, 12, 56, 1, 37, 11, 52, 44, 9, 30, 47, 4, 51, 40, 55, 25, 34, 27, 56, 30, 32, 54 },
109 { 63, 40, 49, 15, 43, 26, 63, 38, 16, 20, 30, 12, 57, 14, 19, 60, 36, 12, 59, 2, 57, 17, 42, 31, 1, 44, 16, 35, 47, 11, 32, 48, 13, 43, 1, 39, 51, 12, 57, 23, 6, 40, 53, 3, 55, 31, 39, 60, 35, 44, 5, 15, 45, 1, 62, 41, 26, 14, 47, 22, 36, 27, 50, 9, 26, 47, 52, 28, 54, 16, 1, 13, 51, 39, 23, 63, 1, 30, 15, 26, 2, 57, 19, 37, 1, 44, 21, 50, 13, 63, 8, 24, 56, 1, 35, 25, 58, 20, 2, 28, 14, 51, 33, 59, 13, 30, 4, 49, 31, 24, 63, 26, 33, 3, 58, 38, 62, 24, 32, 8, 17, 45, 5, 48, 18, 3, 43, 11 },
110 { 21, 4, 24, 34, 59, 1, 37, 11, 53, 5, 47, 2, 22, 40, 32, 1, 24, 50, 21, 29, 38, 25, 63, 8, 55, 24, 53, 6, 62, 23, 59, 3, 54, 20, 58, 24, 5, 46, 15, 38, 48, 14, 27, 42, 23, 7, 46, 10, 17, 58, 25, 52, 23, 32, 49, 12, 55, 30, 40, 7, 59, 1, 56, 21, 39, 4, 23, 15, 37, 46, 55, 42, 21, 4, 48, 8, 45, 54, 37, 55, 32, 8, 46, 10, 30, 54, 4, 41, 25, 29, 36, 48, 11, 43, 14, 47, 5, 43, 53, 36, 61, 10, 45, 6, 41, 54, 27, 43, 16, 55, 6, 46, 18, 42, 23, 15, 1, 45, 12, 60, 37, 22, 62, 12, 39, 59, 16, 52 },
111 { 47, 35, 56, 7, 19, 46, 31, 50, 33, 24, 61, 35, 50, 7, 53, 44, 55, 6, 46, 10, 52, 5, 21, 43, 36, 10, 18, 41, 26, 37, 8, 29, 40, 36, 9, 49, 34, 26, 61, 21, 7, 59, 18, 62, 29, 54, 20, 32, 51, 0, 40, 10, 55, 6, 20, 36, 9, 61, 5, 51, 44, 19, 33, 43, 13, 57, 40, 63, 8, 24, 29, 10, 60, 34, 27, 40, 25, 18, 10, 42, 21, 49, 26, 62, 38, 12, 33, 61, 5, 57, 2, 19, 54, 28, 62, 22, 38, 31, 16, 7, 22, 47, 29, 17, 35, 8, 20, 51, 2, 40, 22, 50, 13, 61, 28, 53, 35, 20, 56, 30, 2, 53, 14, 41, 23, 34, 8, 31 },
112 { 12, 2, 42, 29, 52, 13, 21, 8, 55, 14, 41, 17, 28, 58, 23, 11, 17, 36, 31, 62, 17, 34, 50, 14, 28, 61, 33, 52, 2, 51, 17, 45, 7, 25, 62, 30, 18, 55, 0, 42, 30, 35, 45, 1, 12, 48, 3, 63, 21, 36, 30, 48, 19, 59, 43, 27, 46, 17, 34, 25, 12, 29, 53, 6, 48, 31, 11, 34, 49, 3, 36, 50, 19, 47, 14, 61, 11, 36, 58, 4, 60, 14, 39, 22, 6, 52, 15, 35, 17, 46, 31, 42, 9, 34, 3, 52, 12, 60, 26, 56, 40, 2, 53, 23, 57, 38, 62, 14, 36, 59, 10, 31, 39, 6, 49, 9, 41, 26, 5, 48, 43, 27, 33, 58, 1, 50, 25, 57 },
113 { 61, 37, 15, 61, 3, 39, 58, 43, 26, 0, 44, 10, 47, 3, 37, 63, 28, 43, 13, 39, 3, 57, 30, 59, 0, 48, 5, 43, 13, 22, 60, 33, 55, 15, 42, 4, 52, 10, 45, 13, 54, 4, 24, 49, 37, 26, 41, 14, 42, 9, 61, 13, 38, 23, 3, 53, 0, 58, 21, 42, 63, 10, 17, 61, 25, 0, 58, 28, 17, 44, 57, 12, 27, 0, 55, 5, 52, 28, 23, 47, 29, 0, 43, 17, 58, 28, 47, 23, 55, 10, 58, 23, 51, 40, 18, 33, 45, 0, 49, 8, 32, 61, 19, 48, 0, 26, 7, 47, 29, 18, 44, 0, 56, 34, 20, 59, 15, 51, 37, 18, 10, 52, 7, 20, 46, 9, 38, 17 },
114 { 6, 27, 48, 23, 45, 29, 5, 18, 38, 62, 27, 56, 20, 32, 15, 9, 48, 0, 54, 22, 45, 20, 7, 41, 23, 39, 19, 27, 58, 31, 44, 0, 12, 50, 23, 56, 20, 39, 32, 59, 16, 52, 33, 9, 57, 22, 6, 58, 28, 50, 24, 2, 56, 35, 16, 45, 32, 38, 15, 54, 2, 38, 46, 22, 35, 45, 20, 5, 52, 25, 7, 35, 59, 32, 22, 43, 38, 3, 51, 16, 34, 53, 32, 50, 3, 40, 8, 43, 0, 39, 27, 4, 14, 61, 8, 55, 15, 41, 20, 44, 27, 13, 39, 11, 46, 42, 54, 33, 4, 52, 23, 61, 14, 25, 43, 2, 33, 11, 63, 29, 61, 17, 40, 55, 22, 62, 28, 44 },
115 { 20, 54, 8, 56, 35, 10, 63, 31, 52, 12, 48, 6, 59, 41, 52, 33, 19, 58, 25, 49, 11, 37, 47, 12, 54, 15, 56, 35, 7, 47, 16, 53, 28, 34, 5, 37, 28, 8, 48, 3, 28, 38, 18, 61, 16, 43, 53, 32, 4, 17, 47, 27, 44, 8, 63, 10, 25, 49, 6, 37, 24, 52, 32, 3, 50, 12, 41, 56, 38, 14, 62, 20, 40, 16, 53, 31, 18, 63, 41, 9, 59, 7, 13, 25, 57, 20, 63, 26, 53, 18, 48, 62, 30, 46, 21, 25, 58, 29, 36, 4, 55, 34, 6, 60, 31, 16, 21, 12, 58, 38, 9, 29, 47, 7, 52, 30, 57, 44, 22, 0, 35, 45, 3, 31, 14, 36, 0, 51 },
116 { 42, 14, 33, 24, 16, 49, 40, 2, 22, 33, 16, 36, 25, 1, 21, 61, 38, 8, 33, 4, 62, 26, 29, 60, 6, 46, 30, 11, 63, 4, 36, 40, 19, 57, 46, 11, 41, 63, 22, 25, 58, 10, 46, 2, 34, 27, 11, 38, 56, 34, 12, 53, 18, 33, 41, 51, 13, 28, 60, 20, 47, 14, 29, 59, 16, 62, 8, 22, 32, 47, 9, 49, 2, 44, 7, 12, 45, 6, 20, 27, 45, 24, 62, 42, 36, 11, 33, 15, 37, 7, 32, 10, 37, 1, 35, 50, 6, 11, 63, 24, 52, 15, 50, 24, 3, 37, 56, 27, 34, 22, 49, 16, 36, 62, 17, 39, 4, 15, 54, 24, 50, 8, 58, 26, 49, 54, 11, 30 },
117 { 4, 59, 41, 1, 53, 12, 25, 45, 59, 7, 51, 39, 54, 14, 46, 4, 27, 53, 16, 44, 18, 51, 1, 32, 25, 2, 50, 40, 20, 54, 24, 9, 62, 2, 27, 60, 1, 17, 36, 50, 6, 40, 30, 55, 41, 19, 49, 1, 21, 60, 40, 5, 62, 1, 22, 30, 57, 4, 43, 31, 1, 55, 40, 7, 27, 37, 30, 54, 1, 19, 42, 30, 56, 26, 62, 49, 24, 57, 37, 56, 2, 39, 16, 5, 30, 55, 3, 49, 60, 23, 56, 44, 17, 52, 13, 42, 28, 48, 18, 45, 9, 37, 21, 41, 58, 10, 48, 1, 63, 5, 41, 57, 2, 24, 12, 48, 27, 42, 32, 46, 13, 38, 19, 34, 5, 41, 25, 60 },
118 { 39, 28, 21, 46, 32, 57, 36, 9, 19, 42, 4, 29, 11, 43, 30, 49, 13, 42, 35, 56, 9, 39, 15, 52, 36, 61, 18, 26, 45, 14, 31, 48, 21, 43, 14, 33, 49, 54, 14, 44, 21, 62, 13, 23, 8, 62, 15, 51, 44, 7, 30, 37, 20, 42, 56, 7, 39, 18, 50, 11, 61, 9, 19, 43, 57, 2, 48, 11, 39, 60, 28, 4, 37, 17, 35, 1, 33, 11, 31, 14, 48, 19, 35, 51, 46, 21, 44, 29, 12, 41, 2, 22, 58, 26, 54, 4, 59, 38, 2, 33, 57, 1, 63, 13, 28, 51, 15, 40, 18, 45, 8, 30, 43, 37, 54, 19, 8, 59, 21, 6, 60, 29, 55, 10, 63, 15, 47, 17 },
119 { 3, 50, 10, 62, 18, 5, 27, 49, 60, 23, 55, 18, 62, 24, 56, 10, 59, 28, 2, 23, 34, 59, 43, 20, 10, 42, 8, 49, 1, 37, 57, 6, 51, 29, 53, 7, 23, 31, 5, 32, 51, 0, 35, 54, 45, 31, 5, 26, 36, 24, 55, 15, 48, 29, 14, 48, 26, 60, 21, 41, 36, 26, 50, 33, 14, 44, 17, 24, 52, 15, 46, 23, 54, 6, 47, 21, 60, 50, 4, 53, 29, 61, 8, 23, 1, 60, 19, 6, 53, 16, 47, 34, 6, 39, 16, 31, 12, 20, 53, 22, 30, 43, 25, 46, 35, 6, 44, 32, 53, 26, 55, 19, 11, 59, 5, 33, 51, 1, 35, 53, 25, 3, 42, 23, 44, 32, 7, 53 },
120 { 22, 44, 37, 6, 26, 51, 38, 0, 34, 13, 31, 46, 3, 37, 6, 19, 40, 21, 47, 63, 12, 5, 29, 55, 22, 58, 34, 28, 60, 22, 11, 41, 17, 38, 9, 44, 59, 39, 56, 19, 11, 47, 25, 15, 3, 39, 57, 17, 61, 11, 46, 3, 58, 9, 54, 35, 2, 34, 8, 45, 15, 56, 5, 23, 53, 33, 63, 35, 4, 59, 10, 51, 13, 61, 29, 41, 15, 25, 43, 19, 40, 10, 54, 33, 41, 12, 38, 51, 31, 26, 61, 9, 30, 45, 24, 62, 49, 40, 10, 61, 14, 49, 5, 17, 54, 20, 60, 23, 3, 13, 35, 50, 32, 23, 46, 27, 38, 63, 16, 12, 39, 48, 18, 51, 1, 27, 56, 35 },
121 { 63, 15, 30, 55, 43, 14, 57, 17, 53, 44, 7, 48, 26, 50, 32, 60, 0, 53, 14, 31, 50, 24, 46, 0, 38, 13, 4, 52, 16, 45, 30, 59, 0, 25, 55, 35, 16, 10, 26, 42, 58, 29, 60, 38, 50, 22, 28, 47, 0, 50, 28, 19, 33, 39, 11, 44, 16, 52, 24, 59, 3, 38, 27, 51, 0, 21, 7, 42, 26, 34, 21, 40, 33, 18, 39, 3, 54, 38, 8, 59, 0, 44, 27, 15, 58, 28, 57, 9, 43, 0, 36, 50, 20, 59, 8, 34, 0, 27, 47, 7, 36, 19, 56, 32, 0, 38, 11, 29, 62, 47, 6, 61, 0, 41, 14, 56, 10, 23, 45, 31, 57, 8, 36, 13, 58, 38, 11, 19 },
122 { 0, 34, 12, 47, 21, 2, 40, 30, 11, 25, 61, 20, 40, 15, 35, 22, 45, 36, 7, 41, 17, 57, 9, 48, 32, 62, 44, 24, 35, 3, 54, 13, 33, 63, 19, 4, 48, 22, 62, 2, 37, 8, 33, 6, 20, 52, 9, 32, 43, 13, 39, 63, 25, 4, 49, 23, 62, 32, 9, 30, 48, 18, 63, 12, 46, 29, 58, 13, 48, 8, 57, 31, 0, 51, 9, 58, 12, 22, 47, 29, 35, 22, 49, 5, 46, 4, 34, 20, 63, 24, 56, 11, 41, 3, 51, 19, 56, 35, 17, 58, 28, 42, 9, 45, 59, 26, 51, 42, 17, 36, 25, 15, 53, 21, 44, 3, 30, 55, 5, 50, 21, 28, 61, 32, 6, 49, 28, 46 },
123 { 58, 42, 60, 4, 31, 59, 22, 63, 35, 38, 9, 54, 1, 57, 8, 51, 16, 58, 27, 53, 3, 38, 30, 15, 27, 6, 19, 56, 10, 50, 21, 36, 47, 5, 43, 28, 51, 32, 13, 46, 18, 54, 16, 43, 63, 12, 36, 59, 22, 34, 5, 52, 17, 59, 27, 41, 0, 19, 55, 37, 13, 43, 6, 34, 41, 10, 36, 55, 19, 44, 3, 16, 58, 27, 49, 25, 32, 62, 17, 55, 13, 63, 18, 52, 25, 37, 17, 48, 13, 32, 5, 46, 28, 37, 14, 43, 25, 5, 51, 39, 3, 52, 33, 22, 8, 40, 12, 4, 57, 9, 46, 39, 28, 58, 13, 62, 17, 42, 19, 36, 0, 47, 16, 43, 24, 21, 54, 13 },
124 { 25, 9, 23, 50, 36, 8, 45, 14, 3, 51, 16, 28, 44, 12, 42, 29, 4, 26, 10, 47, 22, 61, 18, 54, 51, 39, 46, 13, 41, 26, 58, 7, 18, 39, 12, 57, 15, 1, 52, 27, 41, 23, 48, 1, 27, 45, 18, 2, 57, 26, 55, 8, 43, 31, 6, 58, 14, 51, 40, 5, 61, 31, 24, 54, 17, 60, 22, 1, 39, 30, 53, 45, 36, 13, 43, 5, 45, 2, 37, 6, 34, 42, 2, 39, 10, 62, 7, 54, 40, 18, 60, 15, 52, 21, 63, 8, 55, 46, 15, 30, 23, 13, 62, 16, 50, 24, 58, 31, 48, 21, 34, 2, 49, 7, 31, 37, 26, 48, 9, 61, 40, 11, 52, 2, 60, 40, 4, 37 },
125 { 52, 28, 39, 16, 54, 19, 29, 55, 42, 20, 58, 33, 24, 63, 18, 55, 39, 62, 43, 34, 12, 40, 6, 35, 2, 25, 8, 62, 34, 1, 31, 42, 61, 27, 53, 24, 40, 61, 34, 8, 59, 4, 30, 56, 40, 6, 53, 42, 10, 48, 16, 37, 12, 46, 21, 36, 47, 11, 28, 45, 22, 10, 57, 2, 49, 31, 14, 44, 61, 11, 25, 6, 23, 63, 18, 36, 28, 56, 20, 51, 11, 48, 27, 56, 32, 22, 45, 30, 2, 42, 27, 39, 1, 44, 23, 31, 38, 22, 11, 61, 43, 54, 4, 47, 35, 2, 44, 16, 28, 54, 12, 62, 18, 43, 10, 52, 1, 58, 33, 15, 29, 56, 20, 34, 9, 30, 48, 17 },
126 { 46, 2, 56, 11, 41, 1, 49, 6, 27, 47, 2, 48, 5, 32, 37, 3, 13, 19, 32, 1, 55, 28, 60, 17, 43, 59, 32, 20, 49, 16, 55, 23, 14, 46, 2, 36, 6, 30, 20, 49, 12, 47, 35, 14, 21, 60, 29, 14, 35, 24, 46, 1, 56, 29, 53, 8, 33, 23, 56, 1, 35, 46, 20, 39, 26, 4, 53, 28, 17, 38, 60, 34, 48, 9, 55, 15, 46, 7, 41, 31, 60, 24, 16, 36, 1, 59, 19, 52, 35, 6, 55, 11, 59, 33, 7, 57, 4, 29, 48, 1, 19, 26, 37, 30, 18, 63, 37, 6, 59, 1, 40, 24, 56, 33, 46, 22, 35, 7, 24, 53, 39, 5, 26, 45, 55, 18, 62, 7 },
127 { 20, 60, 29, 34, 20, 62, 33, 52, 10, 36, 13, 60, 41, 21, 50, 27, 56, 49, 8, 51, 21, 45, 11, 48, 8, 23, 53, 3, 29, 44, 5, 52, 9, 32, 50, 17, 43, 56, 3, 38, 24, 10, 62, 25, 51, 9, 33, 49, 61, 7, 30, 62, 22, 19, 2, 42, 63, 5, 49, 18, 60, 15, 52, 7, 43, 56, 23, 50, 5, 50, 2, 20, 41, 30, 1, 52, 22, 61, 14, 26, 3, 43, 53, 7, 47, 28, 11, 14, 23, 58, 33, 25, 47, 13, 50, 17, 40, 54, 34, 60, 41, 6, 59, 14, 50, 7, 25, 55, 20, 42, 51, 8, 27, 4, 16, 60, 28, 50, 44, 3, 22, 49, 63, 12, 33, 1, 43, 31 },
128 { 36, 5, 46, 8, 44, 24, 13, 39, 25, 57, 31, 18, 8, 52, 10, 45, 6, 30, 36, 24, 63, 4, 33, 26, 57, 40, 15, 56, 37, 12, 40, 25, 37, 58, 11, 63, 21, 45, 16, 60, 31, 53, 18, 33, 3, 45, 23, 0, 20, 54, 40, 15, 50, 38, 60, 16, 25, 42, 29, 38, 7, 41, 25, 62, 18, 33, 8, 35, 42, 16, 32, 56, 12, 39, 59, 19, 34, 9, 49, 38, 57, 12, 21, 50, 14, 40, 61, 44, 50, 9, 49, 19, 3, 29, 35, 62, 12, 24, 7, 18, 52, 32, 10, 46, 21, 41, 32, 11, 36, 29, 14, 34, 60, 38, 54, 11, 41, 14, 19, 57, 32, 16, 7, 41, 51, 25, 14, 57 },
129 { 53, 18, 26, 50, 15, 58, 4, 63, 17, 43, 7, 40, 61, 35, 15, 41, 23, 60, 16, 38, 14, 42, 19, 50, 0, 31, 10, 46, 27, 63, 18, 60, 0, 20, 29, 39, 8, 26, 37, 5, 42, 0, 44, 39, 57, 17, 58, 41, 28, 37, 4, 32, 9, 44, 12, 31, 54, 10, 59, 14, 27, 53, 12, 36, 0, 47, 13, 63, 21, 58, 10, 24, 50, 27, 4, 26, 44, 53, 31, 0, 18, 42, 29, 33, 57, 4, 32, 26, 0, 38, 16, 61, 41, 53, 20, 0, 42, 44, 49, 27, 10, 56, 39, 0, 57, 15, 53, 49, 3, 61, 22, 47, 17, 5, 49, 26, 2, 63, 39, 10, 47, 27, 37, 23, 4, 59, 38, 10 },
130 { 23, 39, 61, 3, 37, 28, 48, 31, 0, 34, 51, 23, 2, 26, 58, 0, 53, 11, 46, 1, 57, 29, 52, 14, 37, 61, 21, 35, 2, 49, 7, 34, 47, 55, 4, 33, 54, 13, 58, 52, 19, 50, 22, 7, 13, 29, 36, 11, 51, 17, 60, 25, 55, 4, 34, 51, 0, 35, 20, 48, 32, 3, 51, 30, 59, 28, 40, 3, 46, 29, 54, 43, 7, 62, 47, 11, 39, 4, 23, 46, 55, 8, 63, 5, 25, 37, 18, 46, 21, 56, 31, 5, 36, 8, 45, 58, 26, 15, 2, 36, 47, 21, 29, 44, 25, 34, 3, 27, 43, 10, 52, 0, 45, 30, 24, 36, 43, 18, 34, 59, 0, 52, 61, 15, 44, 19, 30, 49 },
131 { 0, 27, 12, 43, 54, 9, 22, 53, 21, 46, 15, 55, 29, 47, 20, 33, 39, 28, 59, 35, 9, 44, 5, 24, 47, 7, 52, 17, 56, 22, 30, 42, 14, 26, 45, 18, 49, 1, 24, 34, 11, 27, 55, 32, 61, 47, 2, 56, 6, 44, 13, 47, 36, 27, 58, 22, 16, 47, 40, 4, 57, 38, 21, 45, 16, 9, 56, 26, 11, 38, 0, 22, 36, 17, 33, 57, 16, 30, 62, 15, 35, 40, 20, 45, 59, 10, 54, 8, 63, 13, 52, 27, 22, 57, 28, 12, 32, 51, 55, 22, 63, 4, 16, 54, 12, 62, 45, 19, 58, 13, 32, 40, 20, 56, 7, 57, 9, 54, 6, 29, 42, 21, 8, 55, 35, 47, 6, 41 },
132 { 56, 33, 58, 32, 19, 35, 42, 6, 59, 11, 38, 5, 49, 12, 62, 7, 52, 17, 5, 25, 54, 20, 61, 31, 54, 27, 41, 11, 44, 5, 59, 12, 36, 51, 10, 61, 28, 41, 48, 9, 43, 63, 5, 40, 20, 8, 49, 26, 34, 21, 58, 1, 18, 45, 7, 39, 61, 26, 8, 50, 23, 10, 63, 5, 55, 37, 19, 49, 52, 15, 59, 47, 13, 54, 1, 25, 42, 58, 10, 48, 3, 27, 50, 1, 17, 48, 34, 41, 16, 40, 2, 45, 10, 39, 17, 61, 5, 38, 19, 9, 41, 31, 60, 38, 5, 23, 36, 8, 30, 55, 24, 63, 12, 48, 14, 51, 31, 20, 45, 25, 12, 50, 32, 2, 28, 11, 62, 14 },
133 { 44, 16, 7, 48, 1, 62, 16, 50, 27, 33, 61, 25, 17, 44, 31, 14, 22, 43, 32, 48, 18, 40, 8, 36, 3, 16, 33, 62, 23, 38, 25, 53, 2, 21, 41, 6, 22, 15, 59, 29, 16, 37, 26, 15, 52, 42, 23, 15, 54, 39, 10, 30, 53, 11, 49, 24, 2, 43, 55, 17, 34, 44, 15, 31, 24, 44, 2, 32, 7, 35, 25, 5, 40, 45, 29, 51, 6, 21, 37, 52, 24, 60, 13, 31, 53, 23, 2, 28, 49, 24, 31, 60, 20, 51, 1, 34, 48, 14, 59, 33, 50, 1, 18, 33, 48, 60, 17, 51, 39, 6, 38, 2, 35, 29, 40, 23, 1, 62, 15, 53, 37, 17, 46, 57, 40, 51, 24, 22 },
134 { 5, 37, 52, 24, 45, 13, 40, 3, 45, 9, 19, 42, 56, 4, 37, 46, 56, 2, 63, 11, 51, 1, 49, 13, 59, 45, 39, 1, 48, 15, 58, 9, 46, 31, 54, 35, 57, 38, 3, 46, 56, 4, 47, 57, 1, 30, 38, 63, 3, 46, 28, 63, 41, 14, 33, 62, 19, 32, 13, 28, 61, 1, 53, 42, 11, 60, 22, 62, 27, 42, 61, 31, 19, 8, 61, 12, 32, 55, 2, 18, 33, 12, 43, 36, 9, 62, 30, 55, 6, 58, 35, 7, 43, 29, 54, 23, 43, 30, 3, 25, 11, 45, 52, 28, 7, 14, 42, 1, 22, 50, 16, 53, 19, 59, 4, 46, 33, 41, 4, 35, 58, 5, 26, 13, 20, 2, 34, 54 },
135 { 30, 63, 21, 10, 26, 55, 29, 59, 23, 39, 53, 1, 36, 24, 59, 27, 10, 34, 23, 38, 30, 60, 22, 42, 28, 19, 9, 57, 30, 19, 43, 33, 13, 63, 3, 19, 11, 50, 31, 20, 14, 34, 10, 35, 17, 59, 7, 31, 19, 25, 50, 5, 20, 57, 29, 6, 52, 41, 4, 46, 20, 37, 26, 17, 49, 6, 39, 18, 53, 14, 3, 49, 57, 23, 34, 48, 14, 41, 28, 38, 56, 6, 58, 25, 39, 19, 43, 15, 37, 11, 47, 18, 53, 4, 37, 9, 62, 21, 53, 40, 57, 24, 13, 40, 56, 26, 47, 31, 59, 25, 45, 27, 10, 43, 21, 61, 13, 27, 48, 9, 23, 43, 31, 62, 38, 59, 9, 47 },
136 { 25, 4, 40, 60, 34, 6, 18, 36, 8, 57, 12, 30, 49, 14, 6, 54, 41, 16, 50, 6, 43, 15, 34, 4, 53, 24, 50, 35, 4, 51, 7, 55, 28, 24, 39, 44, 60, 7, 25, 62, 42, 53, 24, 61, 28, 45, 52, 12, 48, 37, 9, 35, 43, 3, 37, 48, 12, 58, 30, 52, 9, 59, 6, 57, 33, 29, 48, 4, 37, 45, 20, 34, 10, 39, 0, 60, 22, 45, 8, 63, 21, 42, 14, 49, 3, 56, 11, 46, 21, 61, 0, 42, 25, 13, 63, 17, 36, 8, 46, 16, 6, 35, 63, 0, 21, 37, 4, 57, 9, 34, 5, 61, 48, 32, 8, 37, 54, 17, 56, 30, 60, 0, 50, 16, 7, 29, 42, 17 },
137 { 32, 50, 15, 48, 2, 43, 52, 25, 47, 16, 32, 63, 21, 52, 40, 19, 0, 61, 29, 58, 20, 56, 26, 46, 12, 55, 6, 22, 62, 32, 17, 40, 0, 49, 34, 8, 27, 32, 48, 0, 21, 39, 5, 44, 12, 6, 22, 40, 0, 57, 16, 60, 23, 17, 54, 22, 36, 15, 24, 39, 19, 34, 47, 23, 0, 54, 13, 51, 24, 9, 55, 16, 52, 27, 44, 20, 4, 54, 26, 49, 0, 30, 46, 16, 29, 51, 34, 4, 52, 28, 33, 15, 57, 39, 26, 49, 0, 56, 27, 31, 48, 20, 43, 29, 53, 11, 46, 19, 41, 13, 55, 18, 0, 57, 26, 51, 2, 44, 6, 38, 14, 40, 22, 45, 36, 53, 3, 57 },
138 { 44, 12, 37, 28, 22, 57, 11, 38, 0, 51, 9, 41, 4, 29, 11, 47, 33, 45, 12, 26, 3, 36, 9, 63, 31, 16, 38, 44, 14, 47, 25, 61, 20, 58, 15, 47, 17, 57, 13, 36, 9, 51, 18, 29, 50, 36, 54, 20, 61, 27, 32, 13, 53, 44, 9, 27, 0, 63, 45, 2, 56, 10, 14, 43, 41, 28, 58, 11, 35, 60, 30, 41, 6, 63, 11, 51, 37, 32, 15, 10, 35, 53, 5, 61, 22, 7, 26, 59, 23, 9, 44, 48, 21, 3, 51, 32, 24, 41, 12, 61, 2, 55, 9, 15, 35, 58, 28, 15, 62, 30, 37, 23, 42, 29, 11, 17, 35, 24, 63, 20, 52, 28, 8, 55, 11, 23, 47, 19 },
139 { 0, 56, 8, 53, 14, 31, 61, 20, 55, 28, 62, 18, 35, 60, 25, 57, 7, 23, 39, 54, 47, 17, 43, 0, 40, 59, 29, 2, 56, 10, 37, 5, 43, 11, 29, 52, 1, 23, 54, 41, 59, 30, 55, 1, 62, 15, 33, 4, 43, 10, 47, 39, 1, 31, 40, 60, 49, 33, 7, 55, 26, 50, 31, 61, 8, 18, 21, 32, 44, 1, 25, 47, 18, 36, 30, 23, 59, 7, 40, 59, 27, 19, 38, 32, 44, 54, 40, 17, 38, 60, 27, 6, 35, 55, 10, 14, 44, 5, 50, 17, 38, 26, 42, 50, 18, 3, 44, 52, 2, 49, 7, 52, 15, 46, 62, 39, 55, 10, 31, 48, 3, 58, 33, 18, 61, 34, 13, 59 },
140 { 39, 27, 63, 20, 35, 41, 4, 45, 26, 5, 38, 13, 44, 2, 50, 17, 37, 52, 2, 13, 28, 58, 24, 51, 21, 8, 34, 48, 27, 42, 18, 51, 31, 56, 5, 36, 38, 44, 4, 17, 26, 11, 38, 23, 42, 8, 56, 39, 24, 51, 5, 56, 21, 59, 14, 6, 18, 42, 22, 35, 16, 37, 3, 25, 39, 46, 63, 5, 50, 17, 58, 8, 55, 3, 50, 12, 43, 17, 47, 2, 51, 9, 62, 12, 1, 35, 13, 50, 1, 37, 12, 51, 19, 29, 46, 59, 22, 58, 33, 45, 22, 60, 10, 32, 61, 39, 8, 33, 25, 36, 20, 60, 38, 4, 21, 5, 28, 45, 12, 18, 42, 11, 49, 1, 27, 40, 6, 30 },
141 { 24, 16, 42, 1, 50, 10, 48, 17, 33, 43, 24, 48, 21, 55, 31, 42, 10, 21, 63, 35, 49, 6, 33, 13, 41, 53, 10, 20, 60, 6, 53, 26, 12, 41, 22, 60, 14, 28, 63, 33, 49, 3, 45, 16, 48, 26, 14, 46, 18, 30, 35, 26, 8, 50, 29, 51, 25, 57, 12, 47, 53, 9, 62, 20, 54, 2, 36, 15, 40, 28, 33, 13, 38, 24, 46, 1, 29, 56, 33, 20, 44, 24, 41, 26, 57, 20, 63, 8, 30, 55, 5, 41, 62, 8, 34, 2, 37, 10, 19, 6, 37, 1, 53, 23, 5, 27, 58, 22, 43, 12, 50, 26, 9, 34, 54, 32, 49, 1, 59, 37, 22, 46, 25, 36, 51, 15, 54, 46 },
142 { 52, 7, 45, 33, 26, 58, 14, 60, 7, 54, 3, 58, 8, 34, 14, 5, 59, 30, 18, 44, 8, 22, 48, 62, 3, 26, 55, 38, 23, 16, 39, 1, 62, 24, 49, 9, 53, 19, 46, 7, 19, 60, 31, 58, 2, 34, 53, 7, 59, 2, 62, 42, 46, 19, 36, 11, 44, 4, 38, 28, 1, 43, 32, 51, 12, 29, 56, 22, 52, 2, 62, 49, 22, 60, 14, 35, 63, 5, 25, 57, 14, 53, 4, 46, 18, 31, 42, 22, 47, 20, 58, 31, 16, 43, 23, 54, 30, 42, 52, 57, 29, 49, 30, 13, 45, 48, 16, 55, 6, 63, 1, 44, 14, 58, 19, 47, 15, 24, 51, 34, 6, 55, 5, 63, 20, 41, 21, 9 },
143 { 30, 62, 18, 55, 5, 23, 39, 29, 49, 30, 15, 36, 28, 46, 60, 25, 39, 46, 4, 32, 61, 40, 15, 30, 36, 45, 14, 2, 49, 33, 57, 45, 18, 32, 3, 45, 30, 2, 35, 52, 40, 27, 13, 21, 38, 63, 20, 28, 37, 23, 16, 10, 13, 55, 2, 62, 21, 32, 60, 17, 58, 23, 5, 40, 16, 48, 7, 45, 10, 26, 43, 19, 6, 31, 52, 21, 39, 16, 48, 9, 37, 28, 36, 55, 7, 48, 3, 59, 15, 45, 25, 1, 53, 13, 47, 7, 62, 15, 4, 25, 12, 41, 18, 60, 38, 11, 34, 19, 39, 31, 29, 56, 23, 42, 3, 27, 60, 41, 8, 16, 61, 29, 43, 9, 32, 2, 60, 34 },
144 { 3, 38, 13, 37, 52, 44, 2, 19, 12, 42, 63, 19, 40, 1, 20, 50, 12, 55, 15, 56, 27, 1, 54, 11, 57, 18, 32, 63, 44, 4, 29, 13, 37, 61, 35, 16, 42, 57, 12, 22, 6, 55, 43, 10, 50, 5, 44, 11, 48, 52, 34, 58, 28, 41, 38, 30, 7, 52, 11, 49, 30, 14, 45, 27, 59, 34, 21, 38, 32, 58, 11, 36, 56, 42, 9, 41, 3, 54, 31, 42, 0, 60, 16, 11, 39, 24, 52, 33, 6, 36, 10, 40, 32, 60, 26, 20, 39, 28, 47, 34, 63, 8, 54, 3, 24, 56, 0, 51, 13, 47, 16, 40, 7, 35, 52, 11, 36, 4, 57, 30, 39, 13, 18, 50, 58, 28, 12, 48 },
145 { 57, 24, 49, 21, 10, 31, 61, 36, 56, 0, 22, 53, 11, 56, 32, 7, 36, 27, 41, 9, 46, 19, 34, 42, 25, 7, 50, 9, 28, 21, 54, 8, 50, 7, 27, 59, 10, 25, 48, 62, 37, 0, 33, 58, 25, 18, 32, 61, 0, 15, 45, 5, 50, 3, 23, 55, 47, 17, 40, 6, 60, 34, 53, 8, 41, 0, 61, 13, 54, 4, 46, 28, 0, 17, 48, 27, 58, 13, 23, 61, 33, 21, 50, 30, 62, 8, 14, 29, 56, 27, 61, 49, 17, 2, 44, 11, 51, 0, 59, 17, 40, 20, 32, 47, 36, 21, 42, 28, 60, 4, 54, 10, 59, 17, 30, 62, 21, 43, 26, 48, 0, 56, 36, 25, 8, 44, 39, 17 },
146 { 10, 42, 4, 59, 27, 47, 8, 23, 51, 32, 45, 6, 37, 26, 48, 43, 62, 0, 21, 53, 38, 12, 51, 5, 60, 47, 24, 37, 59, 15, 35, 47, 22, 55, 0, 50, 21, 40, 6, 29, 15, 52, 24, 8, 41, 55, 13, 29, 40, 56, 24, 31, 19, 33, 61, 15, 0, 35, 24, 42, 21, 2, 19, 57, 24, 15, 30, 50, 20, 25, 40, 16, 57, 34, 61, 8, 29, 45, 6, 49, 11, 47, 2, 44, 19, 57, 38, 50, 12, 42, 21, 4, 35, 52, 28, 56, 23, 36, 13, 45, 4, 52, 27, 14, 6, 62, 9, 45, 21, 37, 25, 46, 33, 49, 0, 44, 7, 53, 13, 19, 53, 31, 3, 47, 15, 56, 22, 51 },
147 { 35, 28, 53, 32, 1, 16, 54, 40, 9, 17, 25, 58, 14, 59, 3, 22, 16, 51, 31, 5, 23, 58, 28, 17, 35, 20, 0, 42, 11, 52, 3, 31, 41, 17, 43, 13, 32, 54, 18, 60, 32, 45, 17, 49, 2, 36, 51, 22, 7, 36, 9, 63, 48, 12, 46, 26, 43, 28, 63, 13, 48, 37, 51, 33, 5, 47, 55, 9, 42, 63, 7, 51, 24, 12, 37, 19, 55, 34, 18, 38, 15, 28, 54, 34, 5, 43, 22, 0, 48, 14, 54, 24, 58, 9, 38, 5, 32, 55, 21, 30, 49, 9, 59, 43, 30, 51, 35, 26, 7, 53, 2, 22, 14, 27, 57, 18, 38, 24, 33, 45, 10, 41, 20, 60, 37, 5, 32, 0 },
148 { 63, 19, 15, 40, 62, 35, 14, 28, 46, 61, 4, 49, 35, 10, 29, 54, 33, 8, 45, 62, 37, 1, 43, 55, 10, 52, 61, 30, 19, 40, 25, 62, 11, 38, 27, 58, 36, 3, 46, 8, 39, 4, 62, 28, 47, 20, 4, 54, 47, 27, 43, 1, 21, 38, 8, 58, 10, 54, 4, 56, 9, 26, 12, 39, 60, 27, 18, 37, 1, 31, 35, 5, 45, 50, 2, 43, 26, 1, 59, 23, 56, 40, 7, 26, 58, 17, 32, 63, 25, 39, 7, 31, 45, 19, 63, 15, 48, 8, 37, 61, 16, 34, 1, 56, 18, 3, 15, 58, 49, 32, 63, 41, 55, 5, 40, 22, 50, 6, 59, 2, 63, 23, 52, 11, 26, 61, 44, 23 },
149 { 11, 56, 46, 6, 22, 43, 58, 3, 34, 21, 38, 30, 18, 44, 52, 13, 41, 57, 17, 28, 14, 49, 25, 7, 33, 39, 26, 6, 56, 48, 1, 20, 56, 5, 46, 9, 19, 51, 30, 25, 56, 21, 35, 14, 57, 42, 16, 33, 10, 57, 17, 59, 41, 25, 53, 37, 20, 40, 30, 18, 31, 62, 44, 22, 3, 44, 11, 48, 23, 53, 18, 60, 29, 22, 62, 15, 53, 47, 10, 41, 3, 19, 52, 36, 13, 46, 10, 35, 3, 61, 41, 16, 1, 50, 26, 42, 18, 46, 2, 25, 54, 20, 39, 23, 47, 31, 41, 12, 38, 17, 8, 19, 31, 48, 12, 61, 9, 54, 29, 35, 15, 38, 6, 43, 34, 14, 7, 47 },
150 { 39, 2, 33, 26, 53, 8, 18, 50, 41, 12, 53, 1, 63, 24, 19, 39, 2, 24, 47, 10, 60, 38, 19, 63, 48, 4, 15, 45, 32, 14, 60, 36, 29, 53, 23, 63, 34, 12, 61, 1, 43, 11, 53, 30, 1, 26, 60, 45, 23, 39, 3, 29, 12, 50, 4, 16, 51, 3, 45, 36, 50, 1, 16, 54, 35, 14, 57, 30, 58, 9, 46, 14, 41, 10, 32, 38, 4, 30, 21, 51, 32, 63, 25, 1, 60, 27, 53, 18, 51, 22, 28, 55, 34, 12, 40, 3, 60, 29, 57, 41, 6, 44, 11, 53, 8, 61, 24, 57, 1, 28, 44, 59, 36, 3, 34, 25, 41, 31, 16, 44, 22, 47, 28, 58, 1, 49, 54, 29 },
151 { 58, 25, 50, 13, 38, 30, 60, 24, 6, 57, 27, 42, 9, 45, 6, 61, 30, 50, 4, 34, 29, 3, 46, 13, 22, 42, 58, 28, 9, 39, 23, 44, 7, 15, 44, 2, 40, 15, 47, 41, 23, 37, 7, 59, 38, 11, 34, 6, 62, 14, 52, 35, 55, 19, 32, 61, 33, 24, 57, 6, 22, 59, 29, 7, 49, 25, 40, 3, 17, 39, 27, 52, 0, 55, 16, 57, 24, 61, 36, 6, 29, 12, 48, 39, 20, 44, 6, 40, 33, 5, 48, 10, 57, 36, 22, 51, 33, 9, 24, 12, 62, 29, 50, 35, 14, 43, 5, 33, 47, 52, 13, 23, 10, 51, 56, 16, 46, 1, 49, 4, 61, 9, 52, 18, 31, 21, 36, 17 },
152 { 19, 42, 9, 48, 2, 44, 11, 37, 48, 20, 33, 16, 55, 35, 49, 15, 37, 20, 59, 16, 53, 22, 56, 31, 50, 11, 34, 54, 16, 51, 4, 49, 33, 53, 21, 28, 56, 24, 31, 9, 52, 16, 48, 24, 44, 13, 51, 20, 31, 49, 18, 6, 34, 2, 44, 14, 47, 8, 15, 43, 13, 41, 33, 52, 20, 61, 7, 51, 34, 62, 4, 20, 36, 33, 43, 8, 46, 13, 53, 17, 45, 42, 9, 31, 52, 11, 30, 56, 13, 59, 17, 44, 27, 6, 62, 11, 43, 17, 49, 38, 26, 2, 16, 27, 58, 21, 54, 18, 26, 5, 35, 61, 43, 27, 7, 39, 14, 58, 37, 55, 20, 33, 13, 40, 62, 10, 55, 5 },
153 { 51, 14, 61, 29, 59, 20, 55, 31, 0, 49, 11, 60, 3, 26, 22, 56, 0, 40, 12, 43, 41, 8, 36, 0, 17, 57, 24, 2, 46, 26, 61, 18, 0, 38, 12, 59, 6, 49, 3, 57, 19, 63, 5, 33, 18, 54, 28, 56, 0, 43, 26, 46, 63, 27, 56, 22, 27, 54, 38, 28, 63, 24, 10, 45, 0, 31, 42, 21, 12, 25, 44, 49, 59, 6, 26, 50, 3, 34, 27, 59, 0, 35, 62, 16, 4, 58, 47, 0, 43, 24, 37, 2, 54, 20, 46, 31, 0, 56, 34, 5, 55, 45, 60, 37, 0, 40, 10, 38, 63, 46, 15, 20, 0, 53, 21, 62, 30, 11, 24, 27, 40, 0, 57, 26, 3, 45, 27, 35 }
154};
155
156#endif /* USE_DITHER_128128 */
157
158EAPI void
159evas_common_convert_init(void)
160{
161}
162
163EAPI Gfx_Func_Convert
164evas_common_convert_func_get(DATA8 *dest, int w, int h __UNUSED__, int depth, DATA32 rmask, DATA32 gmask, DATA32 bmask, Convert_Pal_Mode pal_mode, int rotation)
165{
166 if ((rmask == 0) && (gmask == 0) && (bmask == 0))
167 {
168 if (depth == 8)
169 {
170#ifdef BUILD_CONVERT_8_GRY_1
171 if (pal_mode == PAL_MODE_NONE)
172 return evas_common_convert_rgba_to_8bpp_gry_256_dith;
173#endif
174#ifdef BUILD_CONVERT_8_GRY_16
175 if (pal_mode == PAL_MODE_NONE)
176 return evas_common_convert_rgba_to_8bpp_gry_16_dith;
177#endif
178#ifdef BUILD_CONVERT_8_RGB_332
179 if (pal_mode == PAL_MODE_RGB332)
180 return evas_common_convert_rgba_to_8bpp_rgb_332_dith;
181#endif
182#ifdef BUILD_CONVERT_8_RGB_666
183 if (pal_mode == PAL_MODE_RGB666)
184 return evas_common_convert_rgba_to_8bpp_rgb_666_dith;
185#endif
186#ifdef BUILD_CONVERT_8_RGB_232
187 if (pal_mode == PAL_MODE_RGB232)
188 return evas_common_convert_rgba_to_8bpp_rgb_232_dith;
189#endif
190#ifdef BUILD_CONVERT_8_RGB_222
191 if (pal_mode == PAL_MODE_RGB222)
192 return evas_common_convert_rgba_to_8bpp_rgb_222_dith;
193#endif
194#ifdef BUILD_CONVERT_8_RGB_221
195 if (pal_mode == PAL_MODE_RGB221)
196 return evas_common_convert_rgba_to_8bpp_rgb_221_dith;
197#endif
198#ifdef BUILD_CONVERT_8_RGB_121
199 if (pal_mode == PAL_MODE_RGB121)
200 return evas_common_convert_rgba_to_8bpp_rgb_121_dith;
201#endif
202#ifdef BUILD_CONVERT_8_RGB_111
203 if (pal_mode == PAL_MODE_RGB111)
204 return evas_common_convert_rgba_to_8bpp_rgb_111_dith;
205#endif
206#ifdef BUILD_CONVERT_8_GRAYSCALE_64
207 if (pal_mode == PAL_MODE_GRAY64)
208 return evas_common_convert_rgba_to_8bpp_pal_gray64;
209#endif
210 }
211 }
212 else
213 {
214 if (depth == 16)
215 {
216#ifdef BUILD_CONVERT_16_RGB_565
217 if ((rmask == 0x0000f800) && (gmask == 0x000007e0) && (bmask == 0x0000001f))
218 {
219#ifdef BUILD_CONVERT_16_RGB_ROT0
220 if (rotation == 0)
221 {
222 if ((!(w & 0x1)) && (!((intptr_t)dest & 0x3)))
223 return evas_common_convert_rgba2_to_16bpp_rgb_565_dith;
224 else
225 return evas_common_convert_rgba_to_16bpp_rgb_565_dith;
226 }
227#endif
228#ifdef BUILD_CONVERT_16_RGB_ROT180
229 if (rotation == 180)
230 {
231 if ((!(w & 0x1)) && (!((intptr_t)dest & 0x3)))
232 return evas_common_convert_rgba2_to_16bpp_rgb_565_dith_rot_180;
233 else
234 return evas_common_convert_rgba_to_16bpp_rgb_565_dith_rot_180;
235 }
236#endif
237#ifdef BUILD_CONVERT_16_RGB_ROT270
238 if (rotation == 270)
239 {
240 if ((!(w & 0x1)) && (!((intptr_t)dest & 0x3)))
241 return evas_common_convert_rgba2_to_16bpp_rgb_565_dith_rot_270;
242 else
243 return evas_common_convert_rgba_to_16bpp_rgb_565_dith_rot_270;
244 }
245#endif
246#ifdef BUILD_CONVERT_16_RGB_ROT90
247 if (rotation == 90)
248 {
249 if ((!(w & 0x1)) && (!((intptr_t)dest & 0x3)))
250 return evas_common_convert_rgba2_to_16bpp_rgb_565_dith_rot_90;
251 else
252 return evas_common_convert_rgba_to_16bpp_rgb_565_dith_rot_90;
253 }
254#endif
255 }
256#endif
257#ifdef BUILD_CONVERT_16_BGR_565
258 if ((rmask == 0x0000001f) && (gmask == 0x000007e0) && (bmask == 0x0000f800))
259 {
260#ifdef BUILD_CONVERT_16_RGB_ROT0
261 if (rotation == 0)
262 {
263 if ((!(w & 0x1)) && (!((intptr_t)dest & 0x3)))
264 return evas_common_convert_rgba2_to_16bpp_bgr_565_dith;
265 else
266 return evas_common_convert_rgba_to_16bpp_bgr_565_dith;
267 }
268#endif
269#ifdef BUILD_CONVERT_16_RGB_ROT180
270 if (rotation == 180)
271 {
272 if ((!(w & 0x1)) && (!((intptr_t)dest & 0x3)))
273 return evas_common_convert_rgba2_to_16bpp_bgr_565_dith_rot_180;
274 else
275 return evas_common_convert_rgba_to_16bpp_bgr_565_dith_rot_180;
276 }
277#endif
278#ifdef BUILD_CONVERT_16_RGB_ROT270
279 if (rotation == 270)
280 {
281 if ((!(w & 0x1)) && (!((intptr_t)dest & 0x3)))
282 return evas_common_convert_rgba2_to_16bpp_bgr_565_dith_rot_270;
283 else
284 return evas_common_convert_rgba_to_16bpp_bgr_565_dith_rot_270;
285 }
286#endif
287#ifdef BUILD_CONVERT_16_RGB_ROT90
288 if (rotation == 90)
289 {
290 if ((!(w & 0x1)) && (!((intptr_t)dest & 0x3)))
291 return evas_common_convert_rgba2_to_16bpp_bgr_565_dith_rot_90;
292 else
293 return evas_common_convert_rgba_to_16bpp_bgr_565_dith_rot_90;
294 }
295#endif
296 }
297#endif
298#ifdef BUILD_CONVERT_16_RGB_555
299 if ((rmask == 0x00007c00) && (gmask == 0x000003e0) && (bmask == 0x0000001f))
300 {
301#ifdef BUILD_CONVERT_16_RGB_ROT0
302 if (rotation == 0)
303 {
304 if ((!(w & 0x1)) && (!((intptr_t)dest & 0x3)))
305 return evas_common_convert_rgba2_to_16bpp_rgb_555_dith;
306 else
307 return evas_common_convert_rgba_to_16bpp_rgb_555_dith;
308 }
309#endif
310#ifdef BUILD_CONVERT_16_RGB_ROT180
311 if (rotation == 180)
312 {
313 if ((!(w & 0x1)) && (!((intptr_t)dest & 0x3)))
314 return evas_common_convert_rgba2_to_16bpp_rgb_555_dith_rot_180;
315 else
316 return evas_common_convert_rgba_to_16bpp_rgb_555_dith_rot_180;
317 }
318#endif
319#ifdef BUILD_CONVERT_16_RGB_ROT270
320 if (rotation == 270)
321 {
322 if ((!(w & 0x1)) && (!((intptr_t)dest & 0x3)))
323 return evas_common_convert_rgba2_to_16bpp_rgb_555_dith_rot_270;
324 else
325 return evas_common_convert_rgba_to_16bpp_rgb_555_dith_rot_270;
326 }
327#endif
328#ifdef BUILD_CONVERT_16_RGB_ROT90
329 if (rotation == 90)
330 {
331 if ((!(w & 0x1)) && (!((intptr_t)dest & 0x3)))
332 return evas_common_convert_rgba2_to_16bpp_rgb_555_dith_rot_90;
333 else
334 return evas_common_convert_rgba_to_16bpp_rgb_555_dith_rot_90;
335 }
336#endif
337 }
338#endif
339#ifdef BUILD_CONVERT_16_RGB_444
340 if ((rmask == 0x00000f00) && (gmask == 0x000000f0) && (bmask == 0x0000000f))
341 {
342#ifdef BUILD_CONVERT_16_RGB_ROT0
343 if (rotation == 0)
344 {
345 if ((!(w & 0x1)) && (!((intptr_t)dest & 0x3)))
346 return evas_common_convert_rgba2_to_16bpp_rgb_444_dith;
347 else
348 return evas_common_convert_rgba_to_16bpp_rgb_444_dith;
349 }
350#endif
351#ifdef BUILD_CONVERT_16_RGB_ROT180
352 if (rotation == 180)
353 {
354 if ((!(w & 0x1)) && (!((intptr_t)dest & 0x3)))
355 return evas_common_convert_rgba2_to_16bpp_rgb_444_dith_rot_180;
356 else
357 return evas_common_convert_rgba_to_16bpp_rgb_444_dith_rot_180;
358 }
359#endif
360#ifdef BUILD_CONVERT_16_RGB_ROT270
361 if (rotation == 270)
362 {
363 if ((!(w & 0x1)) && (!((intptr_t)dest & 0x3)))
364 return evas_common_convert_rgba2_to_16bpp_rgb_444_dith_rot_270;
365 else
366 return evas_common_convert_rgba_to_16bpp_rgb_444_dith_rot_270;
367 }
368#endif
369#ifdef BUILD_CONVERT_16_RGB_ROT90
370 if (rotation == 90)
371 {
372 if ((!(w & 0x1)) && (!((intptr_t)dest & 0x3)))
373 return evas_common_convert_rgba2_to_16bpp_rgb_444_dith_rot_90;
374 else
375 return evas_common_convert_rgba_to_16bpp_rgb_444_dith_rot_90;
376 }
377#endif
378 }
379#endif
380#ifdef BUILD_CONVERT_16_RGB_454645
381 if ((rmask == 0x0000f000) && (gmask == 0x00000780) && (bmask == 0x0000001e))
382 {
383#ifdef BUILD_CONVERT_16_RGB_ROT0
384 if (rotation == 0)
385 {
386 if ((!(w & 0x1)) && (!((intptr_t)dest & 0x3)))
387 return evas_common_convert_rgba2_to_16bpp_rgb_454645_dith;
388 else
389 return evas_common_convert_rgba_to_16bpp_rgb_454645_dith;
390
391 }
392#endif
393#ifdef BUILD_CONVERT_16_RGB_ROT180
394 if (rotation == 180)
395 {
396 if ((!(w & 0x1)) && (!((intptr_t)dest & 0x3)))
397 return evas_common_convert_rgba2_to_16bpp_rgb_454645_dith_rot_180;
398 else
399 return evas_common_convert_rgba_to_16bpp_rgb_454645_dith_rot_180;
400 }
401#endif
402#ifdef BUILD_CONVERT_16_RGB_ROT270
403 if (rotation == 270)
404 {
405 if ((!(w & 0x1)) && (!((intptr_t)dest & 0x3)))
406 return evas_common_convert_rgba2_to_16bpp_rgb_454645_dith_rot_270;
407 else
408 return evas_common_convert_rgba_to_16bpp_rgb_454645_dith_rot_270;
409 }
410#endif
411#ifdef BUILD_CONVERT_16_RGB_ROT90
412 if (rotation == 270)
413 {
414 if ((!(w & 0x1)) && (!((intptr_t)dest & 0x3)))
415 return evas_common_convert_rgba2_to_16bpp_rgb_454645_dith_rot_90;
416 else
417 return evas_common_convert_rgba_to_16bpp_rgb_454645_dith_rot_90;
418 }
419#endif
420 }
421#endif
422#ifdef BUILD_CONVERT_16_RGB_454645
423 if ((rmask == 0x0000f800) && (gmask == 0x000007e0) && (bmask == 0x0000001f))
424 {
425#ifdef BUILD_CONVERT_16_RGB_ROT0
426 if (rotation == 0)
427 {
428 if ((!(w & 0x1)) && (!((intptr_t)dest & 0x3)))
429 return evas_common_convert_rgba2_to_16bpp_rgb_454645_dith;
430 else
431 return evas_common_convert_rgba_to_16bpp_rgb_454645_dith;
432
433 }
434#endif
435#ifdef BUILD_CONVERT_16_RGB_ROT180
436 if (rotation == 180)
437 {
438 if ((!(w & 0x1)) && (!((intptr_t)dest & 0x3)))
439 return evas_common_convert_rgba2_to_16bpp_rgb_454645_dith_rot_180;
440 else
441 return evas_common_convert_rgba_to_16bpp_rgb_454645_dith_rot_180;
442 }
443#endif
444#ifdef BUILD_CONVERT_16_RGB_ROT270
445 if (rotation == 270)
446 {
447 if ((!(w & 0x1)) && (!((intptr_t)dest & 0x3)))
448 return evas_common_convert_rgba2_to_16bpp_rgb_454645_dith_rot_270;
449 else
450 return evas_common_convert_rgba_to_16bpp_rgb_454645_dith_rot_270;
451 }
452#endif
453#ifdef BUILD_CONVERT_16_RGB_ROT90
454 if (rotation == 90)
455 {
456 if ((!(w & 0x1)) && (!((intptr_t)dest & 0x3)))
457 return evas_common_convert_rgba2_to_16bpp_rgb_454645_dith_rot_90;
458 else
459 return evas_common_convert_rgba_to_16bpp_rgb_454645_dith_rot_90;
460 }
461#endif
462 }
463#endif
464 }
465 if (depth == 32)
466 {
467#ifdef BUILD_CONVERT_32_RGB_8888
468 if ((rmask == 0x00ff0000) && (gmask == 0x0000ff00) && (bmask == 0x000000ff))
469 {
470#ifdef BUILD_CONVERT_32_RGB_ROT0
471 if (rotation == 0)
472 return evas_common_convert_rgba_to_32bpp_rgb_8888;
473#endif
474#ifdef BUILD_CONVERT_32_RGB_ROT180
475 if (rotation == 180)
476 return evas_common_convert_rgba_to_32bpp_rgb_8888_rot_180;
477#endif
478#ifdef BUILD_CONVERT_32_RGB_ROT270
479 if (rotation == 270)
480 return evas_common_convert_rgba_to_32bpp_rgb_8888_rot_270;
481#endif
482#ifdef BUILD_CONVERT_32_RGB_ROT90
483 if (rotation == 90)
484 return evas_common_convert_rgba_to_32bpp_rgb_8888_rot_90;
485#endif
486 }
487#endif
488#ifdef BUILD_CONVERT_32_RGBX_8888
489 if ((rmask == 0xff000000) && (gmask == 0x00ff0000) && (bmask == 0x0000ff00))
490 {
491#ifdef BUILD_CONVERT_32_RGB_ROT0
492 if (rotation == 0)
493 return evas_common_convert_rgba_to_32bpp_rgbx_8888;
494#endif
495#ifdef BUILD_CONVERT_32_RGB_ROT180
496 if (rotation == 180)
497 return evas_common_convert_rgba_to_32bpp_rgbx_8888_rot_180;
498#endif
499#ifdef BUILD_CONVERT_32_RGB_ROT270
500 if (rotation == 270)
501 return evas_common_convert_rgba_to_32bpp_rgbx_8888_rot_270;
502#endif
503#ifdef BUILD_CONVERT_32_RGB_ROT90
504 if (rotation == 90)
505 return evas_common_convert_rgba_to_32bpp_rgbx_8888_rot_90;
506#endif
507 }
508#endif
509#ifdef BUILD_CONVERT_32_BGR_8888
510 if ((rmask == 0x000000ff) && (gmask == 0x0000ff00) && (bmask == 0x00ff0000))
511 {
512#ifdef BUILD_CONVERT_32_RGB_ROT0
513 if (rotation == 0)
514 return evas_common_convert_rgba_to_32bpp_bgr_8888;
515#endif
516#ifdef BUILD_CONVERT_32_RGB_ROT180
517 if (rotation == 180)
518 return evas_common_convert_rgba_to_32bpp_bgr_8888_rot_180;
519#endif
520#ifdef BUILD_CONVERT_32_RGB_ROT270
521 if (rotation == 270)
522 return evas_common_convert_rgba_to_32bpp_bgr_8888_rot_270;
523#endif
524#ifdef BUILD_CONVERT_32_RGB_ROT90
525 if (rotation == 90)
526 return evas_common_convert_rgba_to_32bpp_bgr_8888_rot_90;
527#endif
528 }
529#endif
530#ifdef BUILD_CONVERT_32_BGRX_8888
531 if ((rmask == 0x0000ff00) && (gmask == 0x00ff0000) && (bmask == 0xff000000))
532 {
533#ifdef BUILD_CONVERT_32_RGB_ROT0
534 if (rotation == 0)
535 return evas_common_convert_rgba_to_32bpp_bgrx_8888;
536#endif
537#ifdef BUILD_CONVERT_32_RGB_ROT180
538 if (rotation == 180)
539 return evas_common_convert_rgba_to_32bpp_bgrx_8888_rot_180;
540#endif
541#ifdef BUILD_CONVERT_32_RGB_ROT270
542 if (rotation == 270)
543 return evas_common_convert_rgba_to_32bpp_bgrx_8888_rot_270;
544#endif
545#ifdef BUILD_CONVERT_32_RGB_ROT90
546 if (rotation == 90)
547 return evas_common_convert_rgba_to_32bpp_bgrx_8888_rot_90;
548#endif
549 }
550#endif
551#ifdef BUILD_CONVERT_32_RGB_666
552 if ((rmask == 0x0003f000) && (gmask == 0x00000fc0) && (bmask == 0x0000003f))
553 {
554#ifdef BUILD_CONVERT_32_RGB_ROT0
555 if (rotation == 0)
556 return evas_common_convert_rgba_to_32bpp_rgb_666;
557#endif
558#ifdef BUILD_CONVERT_32_RGB_ROT180
559// if (rotation == 180)
560// return evas_common_convert_rgba_to_32bpp_rgb_8888_rot_180;
561#endif
562#ifdef BUILD_CONVERT_32_RGB_ROT270
563// if (rotation == 270)
564// return evas_common_convert_rgba_to_32bpp_rgb_8888_rot_270;
565#endif
566#ifdef BUILD_CONVERT_32_RGB_ROT90
567// if (rotation == 90)
568// return evas_common_convert_rgba_to_32bpp_rgb_8888_rot_90;
569#endif
570 }
571#endif
572 }
573 if (depth == 24)
574 {
575#ifdef BUILD_CONVERT_24_RGB_888
576 if ((rmask == 0x00ff0000) && (gmask == 0x0000ff00) && (bmask == 0x000000ff))
577 {
578 if (rotation == 0)
579 return evas_common_convert_rgba_to_24bpp_rgb_888;
580 }
581#endif
582#ifdef BUILD_CONVERT_24_RGB_666
583 if ((rmask == 0x0003f000) && (gmask == 0x00000fc0) && (bmask == 0x0000003f))
584 {
585 if (rotation == 0)
586 return evas_common_convert_rgba_to_24bpp_rgb_666;
587 }
588#endif
589#ifdef BUILD_CONVERT_24_BGR_888
590 if ((rmask == 0x000000ff) && (gmask == 0x0000ff00) && (bmask == 0x00ff0000))
591 {
592 if (rotation == 0)
593 return evas_common_convert_rgba_to_24bpp_bgr_888;
594 }
595#endif
596 }
597 INF("depth = %i mode = %i", depth, pal_mode);
598 if (depth == 8)
599 {
600#ifdef BUILD_CONVERT_8_RGB_332
601 if (pal_mode == PAL_MODE_RGB332)
602 return evas_common_convert_rgba_to_8bpp_rgb_332_dith;
603#endif
604#ifdef BUILD_CONVERT_8_RGB_666
605 if (pal_mode == PAL_MODE_RGB666)
606 return evas_common_convert_rgba_to_8bpp_rgb_666_dith;
607#endif
608#ifdef BUILD_CONVERT_8_RGB_232
609 if (pal_mode == PAL_MODE_RGB232)
610 return evas_common_convert_rgba_to_8bpp_rgb_232_dith;
611#endif
612#ifdef BUILD_CONVERT_8_RGB_222
613 if (pal_mode == PAL_MODE_RGB222)
614 return evas_common_convert_rgba_to_8bpp_rgb_222_dith;
615#endif
616#ifdef BUILD_CONVERT_8_RGB_221
617 if (pal_mode == PAL_MODE_RGB221)
618 return evas_common_convert_rgba_to_8bpp_rgb_221_dith;
619#endif
620#ifdef BUILD_CONVERT_8_RGB_121
621 if (pal_mode == PAL_MODE_RGB121)
622 return evas_common_convert_rgba_to_8bpp_rgb_121_dith;
623#endif
624#ifdef BUILD_CONVERT_8_RGB_111
625 if (pal_mode == PAL_MODE_RGB111)
626 return evas_common_convert_rgba_to_8bpp_rgb_111_dith;
627#endif
628 }
629 }
630 /* no optimised converter for this... no generic one either. NULL */
631 return NULL;
632}
diff --git a/libraries/evas/src/lib/engines/common/evas_convert_main.h b/libraries/evas/src/lib/engines/common/evas_convert_main.h
new file mode 100644
index 0000000..51c2cc8
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_convert_main.h
@@ -0,0 +1,9 @@
1#ifndef _EVAS_CONVERT_MAIN_H
2#define _EVAS_CONVERT_MAIN_H
3
4
5EAPI void evas_common_convert_init (void);
6EAPI Gfx_Func_Convert evas_common_convert_func_get (DATA8 *dest, int w, int h, int depth, DATA32 rmask, DATA32 gmask, DATA32 bmask, Convert_Pal_Mode pal_mode, int rotation);
7
8
9#endif /* _EVAS_CONVERT_MAIN_H */
diff --git a/libraries/evas/src/lib/engines/common/evas_convert_rgb_16.c b/libraries/evas/src/lib/engines/common/evas_convert_rgb_16.c
new file mode 100644
index 0000000..b30ec1e
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_convert_rgb_16.c
@@ -0,0 +1,2089 @@
1#include "evas_common.h"
2#include "evas_convert_rgb_16.h"
3
4#ifndef BUILD_NO_DITHER_MASK
5#ifdef USE_DITHER_44
6extern const DATA8 _evas_dither_44[4][4];
7#endif
8#ifdef USE_DITHER_128128
9extern const DATA8 _evas_dither_128128[128][128];
10#endif
11#endif
12
13#ifdef BUILD_CONVERT_16_RGB_565
14#ifdef BUILD_CONVERT_16_RGB_ROT0
15void
16evas_common_convert_rgba2_to_16bpp_rgb_565_dith (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
17{
18#ifndef BUILD_NO_DITHER_MASK
19 DATA16 *d = (DATA16 *)dst;
20 DATA32 r1, g1, b1;
21 DATA32 r2, g2, b2;
22 unsigned int dith, dith2;
23 int x, y;
24
25#ifdef BUILD_LINE_DITHER_MASK
26 for (y = 0; y < h; y++)
27 {
28 if ((y + dith_y) & 0x1)
29 {
30 for (x = 0; x < w; x+=2)
31 {
32 DATA32 p = *src++, q = *src++;
33 r1 = ((p & 0xff0000) + 0x030000) >> 19;
34 if (r1 > 0x1f) r1 = 0x1f;
35 g1 = ((p & 0xff00) + 0x000100) >> 10;
36 if (g1 > 0x3f) g1 = 0x3f;
37 b1 = ((p & 0xff) + 0x000003) >> 3;
38 if (b1 > 0x1f) b1 = 0x1f;
39 r2 = ((q & 0xff0000) + 0x030000) >> 19;
40 if (r2 > 0x1f) r2 = 0x1f;
41 g2 = ((q & 0xff00) + 0x000100) >> 10;
42 if (g2 > 0x3f) g2 = 0x3f;
43 b2 = ((q & 0xff) + 0x000003) >> 3;
44 if (b2 > 0x1f) b2 = 0x1f;
45#ifndef WORDS_BIGENDIAN
46 *((DATA32 *)d) = (r2 << 27) | (g2 << 21) | (b2 << 16) |
47 (r1 << 11) | (g1 << 5) | (b1);
48#else
49 *((DATA32 *)d) = (r1 << 27) | (g1 << 21) | (b1 << 16) |
50 (r2 << 11) | (g2 << 5) | (b2);
51#endif
52 d += 2;
53 }
54 }
55 else
56 {
57 x = w;
58 while (w > 0)
59 {
60 DATA32 p = *src++, q = *src++;
61
62#ifndef WORDS_BIGENDIAN
63 *((DATA32 *)d) =
64 (((q & 0xff0000) >> 19) << 27) | (((q & 0xff00) >> 10) << 21) | (((q & 0xff) >> 3) << 16) |
65 (((p & 0xff0000) >> 19) << 11) | (((p & 0xff00) >> 10) << 5) | ((p & 0xff) >> 3);
66#else
67 *((DATA32 *)d) =
68 (((p & 0xff0000) >> 19) << 27) | (((p & 0xff00) >> 10) << 21) | (((p & 0xff) >> 3) << 16) |
69 (((q & 0xff0000) >> 19) << 11) | (((q & 0xff00) >> 10) << 5) | ((q & 0xff) >> 3);
70#endif
71 d += 2; w -= 2;
72 }
73 w = x;
74 }
75 src += src_jump;
76 d += dst_jump;
77 }
78#else
79 for (y = 0; y < h; y++)
80 {
81 for (x = 0; x < w; x++)
82 {
83 DATA32 p = *src++, q = *src++;
84
85 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK];
86 dith2 = dith >> DM_SHF(6);
87 dith >>= DM_SHF(5);
88 r1 = (p & 0xff0000) >> 19;
89 g1 = (p & 0xff00) >> 10;
90 b1 = (p & 0xff) >> 3;
91 if ((r1 < 0x1f) && ((((p & 0xff0000) >> 16) - (r1 << 3)) >= dith )) r1++;
92 if ((g1 < 0x3f) && ((((p & 0xff00) >> 8) - (g1 << 2)) >= dith2)) g1++;
93 if ((b1 < 0x1f) && (((p & 0xff) - (b1 << 3)) >= dith )) b1++;
94
95 x++;
96 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK];
97 dith2 = dith >> DM_SHF(6);
98 dith >>= DM_SHF(5);
99 r2 = (q & 0xff0000) >> 19;
100 g2 = (q & 0xff00) >> 10;
101 b2 = (q & 0xff) >> 3;
102 if ((r2 < 0x1f) && ((((q & 0xff0000) >> 16) - (r2 << 3)) >= dith )) r2++;
103 if ((g2 < 0x3f) && ((((q & 0xff00) >> 8) - (g2 << 2)) >= dith2)) g2++;
104 if ((b2 < 0x1f) && (((q & 0xff) - (b2 << 3)) >= dith )) b2++;
105
106#ifndef WORDS_BIGENDIAN
107 *((DATA32 *)d) = (r2 << 27) | (g2 << 21) | (b2 << 16) |
108 (r1 << 11) | (g1 << 5) | (b1);
109#else
110 *((DATA32 *)d) = (r1 << 27) | (g1 << 21) | (b1 << 16) |
111 (r2 << 11) | (g2 << 5) | (b2);
112#endif
113 d += 2;
114 }
115 src += src_jump;
116 d += dst_jump;
117 }
118#endif
119 return;
120 pal = 0;
121#else
122 DATA16 *d = (DATA16 *)dst;
123 int w0 = w;
124
125 while (h--)
126 {
127 while (w > 0)
128 {
129 DATA32 p = *src++, q = *src++;
130
131#ifndef WORDS_BIGENDIAN
132 *((DATA32 *)d) =
133 (((q & 0xff0000) >> 19) << 27) | (((q & 0xff00) >> 10) << 21) | (((q & 0xff) >> 3) << 16) |
134 (((p & 0xff0000) >> 19) << 11) | (((p & 0xff00) >> 10) << 5) | ((p & 0xff) >> 3);
135#else
136 *((DATA32 *)d) =
137 (((p & 0xff0000) >> 19) << 27) | (((p & 0xff00) >> 10) << 21) | (((p & 0xff) >> 3) << 16) |
138 (((q & 0xff0000) >> 19) << 11) | (((q & 0xff00) >> 10) << 5) | ((q & 0xff) >> 3);
139#endif
140 d += 2; w -= 2;
141 }
142 w = w0;
143 src += src_jump;
144 d += dst_jump;
145 }
146 return;
147 pal = 0;
148#endif
149}
150#endif
151#endif
152
153#ifdef BUILD_CONVERT_16_RGB_565
154#ifdef BUILD_CONVERT_16_RGB_ROT0
155void
156evas_common_convert_rgba_to_16bpp_rgb_565_dith (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
157{
158#ifndef BUILD_NO_DITHER_MASK
159 DATA16 *d = (DATA16 *)dst;
160 DATA32 r, g, b;
161 unsigned int dith, dith2;
162 int x, y;
163
164#ifdef BUILD_LINE_DITHER_MASK
165 for (y = 0; y < h; y++)
166 {
167 if ((y + dith_y) & 0x1)
168 {
169 for (x = 0; x < w; x++)
170 {
171 DATA32 p = *src++;
172
173 r = (p & 0xff0000) >> 19;
174 if (r > 0x1f) r = 0x1f;
175 g = (p & 0xff00) >> 10;
176 if (g > 0x3f) g = 0x3f;
177 b = (p & 0xff) >> 3;
178 if (b > 0x1f) b = 0x1f;
179 *d++ = (r << 11) | (g << 5) | b;
180 }
181 }
182 else
183 {
184 x = w;
185 while (w--)
186 {
187 *d++ = (((*src & 0xff0000) >> 19) << 11) | (((*src & 0xff00) >> 10) << 5) | ((*src & 0xff) >> 3);
188 src++;
189 }
190 w = x;
191 }
192 src += src_jump;
193 d += dst_jump;
194 }
195#else
196 for (y = 0; y < h; y++)
197 {
198 for (x = 0; x < w; x++)
199 {
200 DATA32 p = *src++;
201
202 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK];
203 dith2 = dith >> DM_SHF(6);
204 dith >>= DM_SHF(5);
205 r = (p & 0xff0000) >> 19;
206 g = (p & 0xff00) >> 10;
207 b = (p & 0xff) >> 3;
208 if ((r < 0x1f) && ((((p & 0xff0000) >> 16) - (r << 3)) >= dith )) r++;
209 if ((g < 0x3f) && ((((p & 0xff00) >> 8) - (g << 2)) >= dith2)) g++;
210 if ((b < 0x1f) && (((p & 0xff) - (b << 3)) >= dith )) b++;
211
212 *d++ = (r << 11) | (g << 5) | b;
213 }
214 src += src_jump;
215 d += dst_jump;
216 }
217#endif
218 return;
219 pal = 0;
220#else
221 DATA16 *d = (DATA16 *)dst;
222 int w0 = w;
223
224 while (h--)
225 {
226 while (w--)
227 {
228 *d++ = (((*src & 0xff0000) >> 19) << 11) | (((*src & 0xff00) >> 10) << 5) | ((*src & 0xff) >> 3);
229 src++;
230 }
231 w = w0;
232 src += src_jump;
233 d += dst_jump;
234 }
235 return;
236 pal = 0;
237#endif
238}
239#endif
240#endif
241
242#ifdef BUILD_CONVERT_16_RGB_565
243#ifdef BUILD_CONVERT_16_RGB_ROT180
244void
245evas_common_convert_rgba2_to_16bpp_rgb_565_dith_rot_180 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
246{
247 DATA32 *src_ptr;
248 DATA16 *dst_ptr;
249 int x, y;
250 DATA8 r1, g1, b1;
251 DATA8 r2, g2, b2;
252#ifndef BUILD_NO_DITHER_MASK
253 DATA8 dith, dith2;
254#endif
255
256 dst_ptr = (DATA16 *)dst;
257
258 CONVERT_LOOP2_START_ROT_180();
259
260 r1 = (R_VAL(src_ptr)) >> 3;
261 g1 = (G_VAL(src_ptr)) >> 2;
262 b1 = (B_VAL(src_ptr)) >> 3;
263
264#ifndef BUILD_NO_DITHER_MASK
265 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
266 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6);
267 if (((R_VAL(src_ptr) - (r1 << 3)) >= dith ) && (r1 < 0x1f)) r1++;
268 if (((G_VAL(src_ptr) - (g1 << 2)) >= dith2) && (g1 < 0x3f)) g1++;
269 if (((B_VAL(src_ptr) - (b1 << 3)) >= dith ) && (b1 < 0x1f)) b1++;
270#endif
271
272 CONVERT_LOOP2_INC_ROT_180();
273
274 r2 = (R_VAL(src_ptr)) >> 3;
275 g2 = (G_VAL(src_ptr)) >> 2;
276 b2 = (B_VAL(src_ptr)) >> 3;
277
278#ifndef BUILD_NO_DITHER_MASK
279 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
280 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6);
281 if (((R_VAL(src_ptr) - (r2 << 3)) >= dith ) && (r2 < 0x1f)) r2++;
282 if (((G_VAL(src_ptr) - (g2 << 2)) >= dith2) && (g2 < 0x3f)) g2++;
283 if (((B_VAL(src_ptr) - (b2 << 3)) >= dith ) && (b2 < 0x1f)) b2++;
284#endif
285
286#ifndef WORDS_BIGENDIAN
287 *((DATA32 *)dst_ptr) =
288 (r2 << 27) | (g2 << 21) | (b2 << 16) |
289 (r1 << 11) | (g1 << 5 ) | (b1 );
290#else
291 *((DATA32 *)dst_ptr) =
292 (r1 << 27) | (g1 << 21) | (b1 << 16) |
293 (r2 << 11) | (g2 << 5 ) | (b2 );
294#endif
295
296 CONVERT_LOOP2_END_ROT_180();
297 return;
298 pal = 0;
299}
300#endif
301#endif
302
303#ifdef BUILD_CONVERT_16_RGB_565
304#ifdef BUILD_CONVERT_16_RGB_ROT180
305void
306evas_common_convert_rgba_to_16bpp_rgb_565_dith_rot_180 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
307{
308 DATA32 *src_ptr;
309 DATA16 *dst_ptr;
310 int x, y;
311 DATA8 r, g, b;
312#ifndef BUILD_NO_DITHER_MASK
313 DATA8 dith, dith2;
314#endif
315
316 dst_ptr = (DATA16 *)dst;
317
318 CONVERT_LOOP_START_ROT_180();
319
320 r = (R_VAL(src_ptr)) >> 3;
321 g = (G_VAL(src_ptr)) >> 2;
322 b = (B_VAL(src_ptr)) >> 3;
323
324#ifndef BUILD_NO_DITHER_MASK
325 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
326 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6);
327 if (((R_VAL(src_ptr) - (r << 3)) >= dith ) && (r < 0x1f)) r++;
328 if (((G_VAL(src_ptr) - (g << 2)) >= dith2) && (g < 0x3f)) g++;
329 if (((B_VAL(src_ptr) - (b << 3)) >= dith ) && (b < 0x1f)) b++;
330#endif
331
332 *dst_ptr = (r << 11) | (g << 5) | (b);
333
334 CONVERT_LOOP_END_ROT_180();
335 return;
336 pal = 0;
337}
338#endif
339#endif
340
341#ifdef BUILD_CONVERT_16_RGB_565
342#ifdef BUILD_CONVERT_16_RGB_ROT270
343void
344evas_common_convert_rgba2_to_16bpp_rgb_565_dith_rot_270 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
345{
346 DATA32 *src_ptr;
347 DATA16 *dst_ptr;
348 int x, y;
349 DATA8 r1, g1, b1;
350 DATA8 r2, g2, b2;
351#ifndef BUILD_NO_DITHER_MASK
352 DATA8 dith, dith2;
353#endif
354
355 dst_ptr = (DATA16 *)dst;
356
357 CONVERT_LOOP2_START_ROT_270();
358
359 r1 = (R_VAL(src_ptr)) >> 3;
360 g1 = (G_VAL(src_ptr)) >> 2;
361 b1 = (B_VAL(src_ptr)) >> 3;
362
363#ifndef BUILD_NO_DITHER_MASK
364 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
365 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6);
366 if (((R_VAL(src_ptr) - (r1 << 3)) >= dith ) && (r1 < 0x1f)) r1++;
367 if (((G_VAL(src_ptr) - (g1 << 2)) >= dith2) && (g1 < 0x3f)) g1++;
368 if (((B_VAL(src_ptr) - (b1 << 3)) >= dith ) && (b1 < 0x1f)) b1++;
369#endif
370
371 CONVERT_LOOP2_INC_ROT_270();
372
373 r2 = (R_VAL(src_ptr)) >> 3;
374 g2 = (G_VAL(src_ptr)) >> 2;
375 b2 = (B_VAL(src_ptr)) >> 3;
376
377#ifndef BUILD_NO_DITHER_MASK
378 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
379 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6);
380 if (((R_VAL(src_ptr) - (r2 << 3)) >= dith ) && (r2 < 0x1f)) r2++;
381 if (((G_VAL(src_ptr) - (g2 << 2)) >= dith2) && (g2 < 0x3f)) g2++;
382 if (((B_VAL(src_ptr) - (b2 << 3)) >= dith ) && (b2 < 0x1f)) b2++;
383#endif
384
385#ifndef WORDS_BIGENDIAN
386 *((DATA32 *)dst_ptr) =
387 (r2 << 27) | (g2 << 21) | (b2 << 16) |
388 (r1 << 11) | (g1 << 5 ) | (b1 );
389#else
390 *((DATA32 *)dst_ptr) =
391 (r1 << 27) | (g1 << 21) | (b1 << 16) |
392 (r2 << 11) | (g2 << 5 ) | (b2 );
393#endif
394
395 CONVERT_LOOP2_END_ROT_270();
396 return;
397 pal = 0;
398}
399#endif
400#endif
401
402#ifdef BUILD_CONVERT_16_RGB_565
403#ifdef BUILD_CONVERT_16_RGB_ROT270
404void
405evas_common_convert_rgba_to_16bpp_rgb_565_dith_rot_270 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
406{
407 DATA32 *src_ptr;
408 DATA16 *dst_ptr;
409 int x, y;
410 DATA8 r, g, b;
411#ifndef BUILD_NO_DITHER_MASK
412 DATA8 dith, dith2;
413#endif
414
415 dst_ptr = (DATA16 *)dst;
416
417 CONVERT_LOOP_START_ROT_270();
418
419 r = (R_VAL(src_ptr)) >> 3;
420 g = (G_VAL(src_ptr)) >> 2;
421 b = (B_VAL(src_ptr)) >> 3;
422
423#ifndef BUILD_NO_DITHER_MASK
424 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
425 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6);
426 if (((R_VAL(src_ptr) - (r << 3)) >= dith ) && (r < 0x1f)) r++;
427 if (((G_VAL(src_ptr) - (g << 2)) >= dith2) && (g < 0x3f)) g++;
428 if (((B_VAL(src_ptr) - (b << 3)) >= dith ) && (b < 0x1f)) b++;
429#endif
430
431 *dst_ptr = (r << 11) | (g << 5) | (b);
432
433 CONVERT_LOOP_END_ROT_270();
434 return;
435 pal = 0;
436}
437#endif
438#endif
439
440#ifdef BUILD_CONVERT_16_RGB_565
441#ifdef BUILD_CONVERT_16_RGB_ROT90
442void
443evas_common_convert_rgba2_to_16bpp_rgb_565_dith_rot_90 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
444{
445 DATA32 *src_ptr;
446 DATA16 *dst_ptr;
447 int x, y;
448 DATA8 r1, g1, b1;
449 DATA8 r2, g2, b2;
450#ifndef BUILD_NO_DITHER_MASK
451 DATA8 dith, dith2;
452#endif
453
454 dst_ptr = (DATA16 *)dst;
455
456 CONVERT_LOOP2_START_ROT_90();
457
458 r1 = (R_VAL(src_ptr)) >> 3;
459 g1 = (G_VAL(src_ptr)) >> 2;
460 b1 = (B_VAL(src_ptr)) >> 3;
461
462#ifndef BUILD_NO_DITHER_MASK
463 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
464 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6);
465 if (((R_VAL(src_ptr) - (r1 << 3)) >= dith ) && (r1 < 0x1f)) r1++;
466 if (((G_VAL(src_ptr) - (g1 << 2)) >= dith2) && (g1 < 0x3f)) g1++;
467 if (((B_VAL(src_ptr) - (b1 << 3)) >= dith ) && (b1 < 0x1f)) b1++;
468#endif
469
470 CONVERT_LOOP2_INC_ROT_90();
471
472 r2 = (R_VAL(src_ptr)) >> 3;
473 g2 = (G_VAL(src_ptr)) >> 2;
474 b2 = (B_VAL(src_ptr)) >> 3;
475
476#ifndef BUILD_NO_DITHER_MASK
477 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
478 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6);
479 if (((R_VAL(src_ptr) - (r2 << 3)) >= dith ) && (r2 < 0x1f)) r2++;
480 if (((G_VAL(src_ptr) - (g2 << 2)) >= dith2) && (g2 < 0x3f)) g2++;
481 if (((B_VAL(src_ptr) - (b2 << 3)) >= dith ) && (b2 < 0x1f)) b2++;
482#endif
483
484#ifndef WORDS_BIGENDIAN
485 *((DATA32 *)dst_ptr) =
486 (r2 << 27) | (g2 << 21) | (b2 << 16) |
487 (r1 << 11) | (g1 << 5 ) | (b1 );
488#else
489 *((DATA32 *)dst_ptr) =
490 (r1 << 27) | (g1 << 21) | (b1 << 16) |
491 (r2 << 11) | (g2 << 5 ) | (b2 );
492#endif
493
494 CONVERT_LOOP2_END_ROT_90();
495 return;
496 pal = 0;
497}
498#endif
499#endif
500
501#ifdef BUILD_CONVERT_16_RGB_565
502#ifdef BUILD_CONVERT_16_RGB_ROT90
503void
504evas_common_convert_rgba_to_16bpp_rgb_565_dith_rot_90 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
505{
506 DATA32 *src_ptr;
507 DATA16 *dst_ptr;
508 int x, y;
509 DATA8 r, g, b;
510#ifndef BUILD_NO_DITHER_MASK
511 DATA8 dith, dith2;
512#endif
513
514 dst_ptr = (DATA16 *)dst;
515
516 CONVERT_LOOP_START_ROT_90();
517
518 r = (R_VAL(src_ptr)) >> 3;
519 g = (G_VAL(src_ptr)) >> 2;
520 b = (B_VAL(src_ptr)) >> 3;
521
522#ifndef BUILD_NO_DITHER_MASK
523 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
524 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6);
525 if (((R_VAL(src_ptr) - (r << 3)) >= dith ) && (r < 0x1f)) r++;
526 if (((G_VAL(src_ptr) - (g << 2)) >= dith2) && (g < 0x3f)) g++;
527 if (((B_VAL(src_ptr) - (b << 3)) >= dith ) && (b < 0x1f)) b++;
528#endif
529
530 *dst_ptr = (r << 11) | (g << 5) | (b);
531
532 CONVERT_LOOP_END_ROT_90();
533 return;
534 pal = 0;
535}
536#endif
537#endif
538
539#ifdef BUILD_CONVERT_16_BGR_565
540#ifdef BUILD_CONVERT_16_RGB_ROT0
541void
542evas_common_convert_rgba2_to_16bpp_bgr_565_dith (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
543{
544 DATA32 *src_ptr;
545 DATA16 *dst_ptr;
546 int x, y;
547 DATA8 r1, g1, b1;
548 DATA8 r2, g2, b2;
549#ifndef BUILD_NO_DITHER_MASK
550 DATA8 dith, dith2;
551#endif
552
553 dst_ptr = (DATA16 *)dst;
554
555 CONVERT_LOOP2_START_ROT_0();
556
557 r1 = (R_VAL(src_ptr)) >> 3;
558 g1 = (G_VAL(src_ptr)) >> 2;
559 b1 = (B_VAL(src_ptr)) >> 3;
560
561#ifndef BUILD_NO_DITHER_MASK
562 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
563 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6);
564 if (((R_VAL(src_ptr) - (r1 << 3)) >= dith ) && (r1 < 0x1f)) r1++;
565 if (((G_VAL(src_ptr) - (g1 << 2)) >= dith2) && (g1 < 0x3f)) g1++;
566 if (((B_VAL(src_ptr) - (b1 << 3)) >= dith ) && (b1 < 0x1f)) b1++;
567#endif
568
569 CONVERT_LOOP2_INC_ROT_0();
570
571 r2 = (R_VAL(src_ptr)) >> 3;
572 g2 = (G_VAL(src_ptr)) >> 2;
573 b2 = (B_VAL(src_ptr)) >> 3;
574
575#ifndef BUILD_NO_DITHER_MASK
576 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
577 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6);
578 if (((R_VAL(src_ptr) - (r2 << 3)) >= dith ) && (r2 < 0x1f)) r2++;
579 if (((G_VAL(src_ptr) - (g2 << 2)) >= dith2) && (g2 < 0x3f)) g2++;
580 if (((B_VAL(src_ptr) - (b2 << 3)) >= dith ) && (b2 < 0x1f)) b2++;
581#endif
582
583#ifndef WORDS_BIGENDIAN
584 *((DATA32 *)dst_ptr) =
585 (b2 << 27) | (g2 << 21) | (r2 << 16) |
586 (b1 << 11) | (g1 << 5 ) | (r1 );
587#else
588 *((DATA32 *)dst_ptr) =
589 (b1 << 27) | (g1 << 21) | (r1 << 16) |
590 (b2 << 11) | (g2 << 5 ) | (r2 );
591#endif
592
593 CONVERT_LOOP2_END_ROT_0();
594 return;
595 pal = 0;
596}
597#endif
598#endif
599
600#ifdef BUILD_CONVERT_16_BGR_565
601#ifdef BUILD_CONVERT_16_RGB_ROT0
602void
603evas_common_convert_rgba_to_16bpp_bgr_565_dith (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
604{
605 DATA32 *src_ptr;
606 DATA16 *dst_ptr;
607 int x, y;
608 DATA8 r, g, b;
609#ifndef BUILD_NO_DITHER_MASK
610 DATA8 dith, dith2;
611#endif
612
613 dst_ptr = (DATA16 *)dst;
614
615 CONVERT_LOOP_START_ROT_0();
616
617 r = (R_VAL(src_ptr)) >> 3;
618 g = (G_VAL(src_ptr)) >> 2;
619 b = (B_VAL(src_ptr)) >> 3;
620
621#ifndef BUILD_NO_DITHER_MASK
622 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
623 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6);
624 if (((R_VAL(src_ptr) - (r << 3)) >= dith ) && (r < 0x1f)) r++;
625 if (((G_VAL(src_ptr) - (g << 2)) >= dith2) && (g < 0x3f)) g++;
626 if (((B_VAL(src_ptr) - (b << 3)) >= dith ) && (b < 0x1f)) b++;
627#endif
628
629 *dst_ptr = (b << 11) | (g << 5) | (r);
630
631 CONVERT_LOOP_END_ROT_0();
632 return;
633 pal = 0;
634}
635#endif
636#endif
637
638#ifdef BUILD_CONVERT_16_BGR_565
639#ifdef BUILD_CONVERT_16_RGB_ROT180
640void
641evas_common_convert_rgba2_to_16bpp_bgr_565_dith_rot_180 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
642{
643 DATA32 *src_ptr;
644 DATA16 *dst_ptr;
645 int x, y;
646 DATA8 r1, g1, b1;
647 DATA8 r2, g2, b2;
648#ifndef BUILD_NO_DITHER_MASK
649 DATA8 dith, dith2;
650#endif
651
652 dst_ptr = (DATA16 *)dst;
653
654 CONVERT_LOOP2_START_ROT_180();
655
656 r1 = (R_VAL(src_ptr)) >> 3;
657 g1 = (G_VAL(src_ptr)) >> 2;
658 b1 = (B_VAL(src_ptr)) >> 3;
659
660#ifndef BUILD_NO_DITHER_MASK
661 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
662 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6);
663 if (((R_VAL(src_ptr) - (r1 << 3)) >= dith ) && (r1 < 0x1f)) r1++;
664 if (((G_VAL(src_ptr) - (g1 << 2)) >= dith2) && (g1 < 0x3f)) g1++;
665 if (((B_VAL(src_ptr) - (b1 << 3)) >= dith ) && (b1 < 0x1f)) b1++;
666#endif
667
668 CONVERT_LOOP2_INC_ROT_180();
669
670 r2 = (R_VAL(src_ptr)) >> 3;
671 g2 = (G_VAL(src_ptr)) >> 2;
672 b2 = (B_VAL(src_ptr)) >> 3;
673
674#ifndef BUILD_NO_DITHER_MASK
675 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
676 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6);
677 if (((R_VAL(src_ptr) - (r2 << 3)) >= dith ) && (r2 < 0x1f)) r2++;
678 if (((G_VAL(src_ptr) - (g2 << 2)) >= dith2) && (g2 < 0x3f)) g2++;
679 if (((B_VAL(src_ptr) - (b2 << 3)) >= dith ) && (b2 < 0x1f)) b2++;
680#endif
681
682#ifndef WORDS_BIGENDIAN
683 *((DATA32 *)dst_ptr) =
684 (b2 << 27) | (g2 << 21) | (r2 << 16) |
685 (b1 << 11) | (g1 << 5 ) | (r1 );
686#else
687 *((DATA32 *)dst_ptr) =
688 (b1 << 27) | (g1 << 21) | (r1 << 16) |
689 (b2 << 11) | (g2 << 5 ) | (r2 );
690#endif
691
692 CONVERT_LOOP2_END_ROT_180();
693 return;
694 pal = 0;
695}
696#endif
697#endif
698
699#ifdef BUILD_CONVERT_16_BGR_565
700#ifdef BUILD_CONVERT_16_RGB_ROT180
701void
702evas_common_convert_rgba_to_16bpp_bgr_565_dith_rot_180 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
703{
704 DATA32 *src_ptr;
705 DATA16 *dst_ptr;
706 int x, y;
707 DATA8 r, g, b;
708#ifndef BUILD_NO_DITHER_MASK
709 DATA8 dith, dith2;
710#endif
711
712 dst_ptr = (DATA16 *)dst;
713
714 ERR("evas_common_convert_rgba_to_16bpp_bgr_565_dith_rot_180");
715
716 CONVERT_LOOP_START_ROT_180();
717
718 r = (R_VAL(src_ptr)) >> 3;
719 g = (G_VAL(src_ptr)) >> 2;
720 b = (B_VAL(src_ptr)) >> 3;
721
722#ifndef BUILD_NO_DITHER_MASK
723 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
724 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6);
725 if (((R_VAL(src_ptr) - (r << 3)) >= dith ) && (r < 0x1f)) r++;
726 if (((G_VAL(src_ptr) - (g << 2)) >= dith2) && (g < 0x3f)) g++;
727 if (((B_VAL(src_ptr) - (b << 3)) >= dith ) && (b < 0x1f)) b++;
728#endif
729
730 *dst_ptr = (b << 11) | (g << 5) | (r);
731
732 CONVERT_LOOP_END_ROT_180();
733 return;
734 pal = 0;
735}
736#endif
737#endif
738
739#ifdef BUILD_CONVERT_16_BGR_565
740#ifdef BUILD_CONVERT_16_RGB_ROT270
741void
742evas_common_convert_rgba2_to_16bpp_bgr_565_dith_rot_270 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
743{
744 DATA32 *src_ptr;
745 DATA16 *dst_ptr;
746 int x, y;
747 DATA8 r1, g1, b1;
748 DATA8 r2, g2, b2;
749#ifndef BUILD_NO_DITHER_MASK
750 DATA8 dith, dith2;
751#endif
752
753 dst_ptr = (DATA16 *)dst;
754
755 CONVERT_LOOP2_START_ROT_270();
756
757 r1 = (R_VAL(src_ptr)) >> 3;
758 g1 = (G_VAL(src_ptr)) >> 2;
759 b1 = (B_VAL(src_ptr)) >> 3;
760
761#ifndef BUILD_NO_DITHER_MASK
762 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
763 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6);
764 if (((R_VAL(src_ptr) - (r1 << 3)) >= dith ) && (r1 < 0x1f)) r1++;
765 if (((G_VAL(src_ptr) - (g1 << 2)) >= dith2) && (g1 < 0x3f)) g1++;
766 if (((B_VAL(src_ptr) - (b1 << 3)) >= dith ) && (b1 < 0x1f)) b1++;
767#endif
768
769 CONVERT_LOOP2_INC_ROT_270();
770
771 r2 = (R_VAL(src_ptr)) >> 3;
772 g2 = (G_VAL(src_ptr)) >> 2;
773 b2 = (B_VAL(src_ptr)) >> 3;
774
775#ifndef BUILD_NO_DITHER_MASK
776 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
777 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6);
778 if (((R_VAL(src_ptr) - (r2 << 3)) >= dith ) && (r2 < 0x1f)) r2++;
779 if (((G_VAL(src_ptr) - (g2 << 2)) >= dith2) && (g2 < 0x3f)) g2++;
780 if (((B_VAL(src_ptr) - (b2 << 3)) >= dith ) && (b2 < 0x1f)) b2++;
781#endif
782
783#ifndef WORDS_BIGENDIAN
784 *((DATA32 *)dst_ptr) =
785 (b2 << 27) | (g2 << 21) | (r2 << 16) |
786 (b1 << 11) | (g1 << 5 ) | (r1 );
787#else
788 *((DATA32 *)dst_ptr) =
789 (b1 << 27) | (g1 << 21) | (r1 << 16) |
790 (b2 << 11) | (g2 << 5 ) | (r2 );
791#endif
792
793 CONVERT_LOOP2_END_ROT_270();
794 return;
795 pal = 0;
796}
797#endif
798#endif
799
800#ifdef BUILD_CONVERT_16_BGR_565
801#ifdef BUILD_CONVERT_16_RGB_ROT270
802void
803evas_common_convert_rgba_to_16bpp_bgr_565_dith_rot_270 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
804{
805 DATA32 *src_ptr;
806 DATA16 *dst_ptr;
807 int x, y;
808 DATA8 r, g, b;
809#ifndef BUILD_NO_DITHER_MASK
810 DATA8 dith, dith2;
811#endif
812
813 dst_ptr = (DATA16 *)dst;
814
815 CONVERT_LOOP_START_ROT_270();
816
817 r = (R_VAL(src_ptr)) >> 3;
818 g = (G_VAL(src_ptr)) >> 2;
819 b = (B_VAL(src_ptr)) >> 3;
820
821#ifndef BUILD_NO_DITHER_MASK
822 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
823 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6);
824 if (((R_VAL(src_ptr) - (r << 3)) >= dith ) && (r < 0x1f)) r++;
825 if (((G_VAL(src_ptr) - (g << 2)) >= dith2) && (g < 0x3f)) g++;
826 if (((B_VAL(src_ptr) - (b << 3)) >= dith ) && (b < 0x1f)) b++;
827#endif
828
829 *dst_ptr = (b << 11) | (g << 5) | (r);
830
831 CONVERT_LOOP_END_ROT_270();
832 return;
833 pal = 0;
834}
835#endif
836#endif
837
838#ifdef BUILD_CONVERT_16_BGR_565
839#ifdef BUILD_CONVERT_16_RGB_ROT90
840void
841evas_common_convert_rgba2_to_16bpp_bgr_565_dith_rot_90 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
842{
843 DATA32 *src_ptr;
844 DATA16 *dst_ptr;
845 int x, y;
846 DATA8 r1, g1, b1;
847 DATA8 r2, g2, b2;
848#ifndef BUILD_NO_DITHER_MASK
849 DATA8 dith, dith2;
850#endif
851
852 dst_ptr = (DATA16 *)dst;
853
854 CONVERT_LOOP2_START_ROT_90();
855
856 r1 = (R_VAL(src_ptr)) >> 3;
857 g1 = (G_VAL(src_ptr)) >> 2;
858 b1 = (B_VAL(src_ptr)) >> 3;
859
860#ifndef BUILD_NO_DITHER_MASK
861 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
862 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6);
863 if (((R_VAL(src_ptr) - (r1 << 3)) >= dith ) && (r1 < 0x1f)) r1++;
864 if (((G_VAL(src_ptr) - (g1 << 2)) >= dith2) && (g1 < 0x3f)) g1++;
865 if (((B_VAL(src_ptr) - (b1 << 3)) >= dith ) && (b1 < 0x1f)) b1++;
866#endif
867
868 CONVERT_LOOP2_INC_ROT_90();
869
870 r2 = (R_VAL(src_ptr)) >> 3;
871 g2 = (G_VAL(src_ptr)) >> 2;
872 b2 = (B_VAL(src_ptr)) >> 3;
873
874#ifndef BUILD_NO_DITHER_MASK
875 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
876 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6);
877 if (((R_VAL(src_ptr) - (r2 << 3)) >= dith ) && (r2 < 0x1f)) r2++;
878 if (((G_VAL(src_ptr) - (g2 << 2)) >= dith2) && (g2 < 0x3f)) g2++;
879 if (((B_VAL(src_ptr) - (b2 << 3)) >= dith ) && (b2 < 0x1f)) b2++;
880#endif
881
882#ifndef WORDS_BIGENDIAN
883 *((DATA32 *)dst_ptr) =
884 (b2 << 27) | (g2 << 21) | (r2 << 16) |
885 (b1 << 11) | (g1 << 5 ) | (r1 );
886#else
887 *((DATA32 *)dst_ptr) =
888 (b1 << 27) | (g1 << 21) | (r1 << 16) |
889 (b2 << 11) | (g2 << 5 ) | (r2 );
890#endif
891
892 CONVERT_LOOP2_END_ROT_90();
893 return;
894 pal = 0;
895}
896#endif
897#endif
898
899#ifdef BUILD_CONVERT_16_BGR_565
900#ifdef BUILD_CONVERT_16_RGB_ROT90
901void
902evas_common_convert_rgba_to_16bpp_bgr_565_dith_rot_90 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
903{
904 DATA32 *src_ptr;
905 DATA16 *dst_ptr;
906 int x, y;
907 DATA8 r, g, b;
908#ifndef BUILD_NO_DITHER_MASK
909 DATA8 dith, dith2;
910#endif
911
912 dst_ptr = (DATA16 *)dst;
913
914 CONVERT_LOOP_START_ROT_90();
915
916 r = (R_VAL(src_ptr)) >> 3;
917 g = (G_VAL(src_ptr)) >> 2;
918 b = (B_VAL(src_ptr)) >> 3;
919
920#ifndef BUILD_NO_DITHER_MASK
921 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
922 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6);
923 if (((R_VAL(src_ptr) - (r << 3)) >= dith ) && (r < 0x1f)) r++;
924 if (((G_VAL(src_ptr) - (g << 2)) >= dith2) && (g < 0x3f)) g++;
925 if (((B_VAL(src_ptr) - (b << 3)) >= dith ) && (b < 0x1f)) b++;
926#endif
927
928 *dst_ptr = (b << 11) | (g << 5) | (r);
929
930 CONVERT_LOOP_END_ROT_90();
931 return;
932 pal = 0;
933}
934#endif
935#endif
936
937#ifdef BUILD_CONVERT_16_RGB_444
938#ifdef BUILD_CONVERT_16_RGB_ROT0
939void
940evas_common_convert_rgba2_to_16bpp_rgb_444_dith (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
941{
942 DATA32 *src_ptr;
943 DATA16 *dst_ptr;
944 int x, y;
945 DATA8 r1, g1, b1;
946 DATA8 r2, g2, b2;
947#ifndef BUILD_NO_DITHER_MASK
948 DATA8 dith;
949#endif
950
951 dst_ptr = (DATA16 *)dst;
952
953 CONVERT_LOOP2_START_ROT_0();
954
955 r1 = (R_VAL(src_ptr)) >> 4;
956 g1 = (G_VAL(src_ptr)) >> 4;
957 b1 = (B_VAL(src_ptr)) >> 4;
958
959#ifndef BUILD_NO_DITHER_MASK
960 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
961 if (((R_VAL(src_ptr) - (r1 << 4)) >= dith ) && (r1 < 0x0f)) r1++;
962 if (((G_VAL(src_ptr) - (g1 << 4)) >= dith ) && (g1 < 0x0f)) g1++;
963 if (((B_VAL(src_ptr) - (b1 << 4)) >= dith ) && (b1 < 0x0f)) b1++;
964#endif
965
966 CONVERT_LOOP2_INC_ROT_0();
967
968 r2 = (R_VAL(src_ptr)) >> 4;
969 g2 = (G_VAL(src_ptr)) >> 4;
970 b2 = (B_VAL(src_ptr)) >> 4;
971
972#ifndef BUILD_NO_DITHER_MASK
973 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
974 if (((R_VAL(src_ptr) - (r2 << 4)) >= dith ) && (r2 < 0x0f)) r2++;
975 if (((G_VAL(src_ptr) - (g2 << 4)) >= dith ) && (g2 < 0x0f)) g2++;
976 if (((B_VAL(src_ptr) - (b2 << 4)) >= dith ) && (b2 < 0x0f)) b2++;
977#endif
978
979#ifndef WORDS_BIGENDIAN
980 *((DATA32 *)dst_ptr) =
981 (r2 << 24) | (g2 << 20) | (b2 << 16) |
982 (r1 << 8 ) | (g1 << 4 ) | (b1 );
983#else
984 *((DATA32 *)dst_ptr) =
985 (r1 << 24) | (g1 << 20) | (b1 << 16) |
986 (r2 << 8 ) | (g2 << 4 ) | (b2 );
987#endif
988
989 CONVERT_LOOP2_END_ROT_0();
990 return;
991 pal = 0;
992}
993#endif
994#endif
995
996#ifdef BUILD_CONVERT_16_RGB_444
997#ifdef BUILD_CONVERT_16_RGB_ROT0
998void
999evas_common_convert_rgba_to_16bpp_rgb_444_dith (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
1000{
1001 DATA32 *src_ptr;
1002 DATA16 *dst_ptr;
1003 int x, y;
1004 DATA8 r, g, b;
1005#ifndef BUILD_NO_DITHER_MASK
1006 DATA8 dith;
1007#endif
1008
1009 dst_ptr = (DATA16 *)dst;
1010
1011 CONVERT_LOOP_START_ROT_0();
1012
1013 r = (R_VAL(src_ptr)) >> 4;
1014 g = (G_VAL(src_ptr)) >> 4;
1015 b = (B_VAL(src_ptr)) >> 4;
1016
1017#ifndef BUILD_NO_DITHER_MASK
1018 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
1019 if (((R_VAL(src_ptr) - (r << 4)) >= dith ) && (r < 0x0f)) r++;
1020 if (((G_VAL(src_ptr) - (g << 4)) >= dith ) && (g < 0x0f)) g++;
1021 if (((B_VAL(src_ptr) - (b << 4)) >= dith ) && (b < 0x0f)) b++;
1022#endif
1023
1024 *dst_ptr = (r << 8) | (g << 4) | (b);
1025
1026 CONVERT_LOOP_END_ROT_0();
1027 return;
1028 pal = 0;
1029}
1030#endif
1031#endif
1032
1033#ifdef BUILD_CONVERT_16_RGB_444
1034#ifdef BUILD_CONVERT_16_RGB_ROT180
1035void
1036evas_common_convert_rgba2_to_16bpp_rgb_444_dith_rot_180 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
1037{
1038 DATA32 *src_ptr;
1039 DATA16 *dst_ptr;
1040 int x, y;
1041 DATA8 r1, g1, b1;
1042 DATA8 r2, g2, b2;
1043#ifndef BUILD_NO_DITHER_MASK
1044 DATA8 dith;
1045#endif
1046
1047 dst_ptr = (DATA16 *)dst;
1048
1049 CONVERT_LOOP2_START_ROT_180();
1050
1051 r1 = (R_VAL(src_ptr)) >> 4;
1052 g1 = (G_VAL(src_ptr)) >> 4;
1053 b1 = (B_VAL(src_ptr)) >> 4;
1054
1055#ifndef BUILD_NO_DITHER_MASK
1056 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
1057 if (((R_VAL(src_ptr) - (r1 << 4)) >= dith ) && (r1 < 0x0f)) r1++;
1058 if (((G_VAL(src_ptr) - (g1 << 4)) >= dith ) && (g1 < 0x0f)) g1++;
1059 if (((B_VAL(src_ptr) - (b1 << 4)) >= dith ) && (b1 < 0x0f)) b1++;
1060#endif
1061
1062 CONVERT_LOOP2_INC_ROT_180();
1063
1064 r2 = (R_VAL(src_ptr)) >> 4;
1065 g2 = (G_VAL(src_ptr)) >> 4;
1066 b2 = (B_VAL(src_ptr)) >> 4;
1067
1068#ifndef BUILD_NO_DITHER_MASK
1069 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
1070 if (((R_VAL(src_ptr) - (r2 << 4)) >= dith ) && (r2 < 0x0f)) r2++;
1071 if (((G_VAL(src_ptr) - (g2 << 4)) >= dith ) && (g2 < 0x0f)) g2++;
1072 if (((B_VAL(src_ptr) - (b2 << 4)) >= dith ) && (b2 < 0x0f)) b2++;
1073#endif
1074
1075#ifndef WORDS_BIGENDIAN
1076 *((DATA32 *)dst_ptr) =
1077 (r2 << 24) | (g2 << 20) | (b2 << 16) |
1078 (r1 << 8 ) | (g1 << 4 ) | (b1 );
1079#else
1080 *((DATA32 *)dst_ptr) =
1081 (r1 << 24) | (g1 << 20) | (b1 << 16) |
1082 (r2 << 8 ) | (g2 << 4 ) | (b2 );
1083#endif
1084
1085 CONVERT_LOOP2_END_ROT_180();
1086 return;
1087 pal = 0;
1088}
1089#endif
1090#endif
1091
1092#ifdef BUILD_CONVERT_16_RGB_444
1093#ifdef BUILD_CONVERT_16_RGB_ROT180
1094void
1095evas_common_convert_rgba_to_16bpp_rgb_444_dith_rot_180 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
1096{
1097 DATA32 *src_ptr;
1098 DATA16 *dst_ptr;
1099 int x, y;
1100 DATA8 r, g, b;
1101#ifndef BUILD_NO_DITHER_MASK
1102 DATA8 dith;
1103#endif
1104
1105 dst_ptr = (DATA16 *)dst;
1106
1107 CONVERT_LOOP_START_ROT_180();
1108
1109 r = (R_VAL(src_ptr)) >> 4;
1110 g = (G_VAL(src_ptr)) >> 4;
1111 b = (B_VAL(src_ptr)) >> 4;
1112
1113#ifndef BUILD_NO_DITHER_MASK
1114 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
1115 if (((R_VAL(src_ptr) - (r << 4)) >= dith ) && (r < 0x0f)) r++;
1116 if (((G_VAL(src_ptr) - (g << 4)) >= dith ) && (g < 0x0f)) g++;
1117 if (((B_VAL(src_ptr) - (b << 4)) >= dith ) && (b < 0x0f)) b++;
1118#endif
1119
1120 *dst_ptr = (r << 8) | (g << 4) | (b);
1121
1122 CONVERT_LOOP_END_ROT_180();
1123 return;
1124 pal = 0;
1125}
1126#endif
1127#endif
1128
1129#ifdef BUILD_CONVERT_16_RGB_444
1130#ifdef BUILD_CONVERT_16_RGB_ROT270
1131void
1132evas_common_convert_rgba2_to_16bpp_rgb_444_dith_rot_270 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
1133{
1134 DATA32 *src_ptr;
1135 DATA16 *dst_ptr;
1136 int x, y;
1137 DATA8 r1, g1, b1;
1138 DATA8 r2, g2, b2;
1139#ifndef BUILD_NO_DITHER_MASK
1140 DATA8 dith;
1141#endif
1142
1143 dst_ptr = (DATA16 *)dst;
1144
1145 CONVERT_LOOP2_START_ROT_270();
1146
1147 r1 = (R_VAL(src_ptr)) >> 4;
1148 g1 = (G_VAL(src_ptr)) >> 4;
1149 b1 = (B_VAL(src_ptr)) >> 4;
1150
1151#ifndef BUILD_NO_DITHER_MASK
1152 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
1153 if (((R_VAL(src_ptr) - (r1 << 4)) >= dith ) && (r1 < 0x0f)) r1++;
1154 if (((G_VAL(src_ptr) - (g1 << 4)) >= dith ) && (g1 < 0x0f)) g1++;
1155 if (((B_VAL(src_ptr) - (b1 << 4)) >= dith ) && (b1 < 0x0f)) b1++;
1156#endif
1157
1158 CONVERT_LOOP2_INC_ROT_270();
1159
1160 r2 = (R_VAL(src_ptr)) >> 4;
1161 g2 = (G_VAL(src_ptr)) >> 4;
1162 b2 = (B_VAL(src_ptr)) >> 4;
1163
1164#ifndef BUILD_NO_DITHER_MASK
1165 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
1166 if (((R_VAL(src_ptr) - (r2 << 4)) >= dith ) && (r2 < 0x0f)) r2++;
1167 if (((G_VAL(src_ptr) - (g2 << 4)) >= dith ) && (g2 < 0x0f)) g2++;
1168 if (((B_VAL(src_ptr) - (b2 << 4)) >= dith ) && (b2 < 0x0f)) b2++;
1169#endif
1170
1171#ifndef WORDS_BIGENDIAN
1172 *((DATA32 *)dst_ptr) =
1173 (r2 << 24) | (g2 << 20) | (b2 << 16) |
1174 (r1 << 8 ) | (g1 << 4 ) | (b1 );
1175#else
1176 *((DATA32 *)dst_ptr) =
1177 (r1 << 24) | (g1 << 20) | (b1 << 16) |
1178 (r2 << 8 ) | (g2 << 4 ) | (b2 );
1179#endif
1180
1181 CONVERT_LOOP2_END_ROT_270();
1182 return;
1183 pal = 0;
1184}
1185#endif
1186#endif
1187
1188#ifdef BUILD_CONVERT_16_RGB_444
1189#ifdef BUILD_CONVERT_16_RGB_ROT270
1190void
1191evas_common_convert_rgba_to_16bpp_rgb_444_dith_rot_270 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
1192{
1193 DATA32 *src_ptr;
1194 DATA16 *dst_ptr;
1195 int x, y;
1196 DATA8 r, g, b;
1197#ifndef BUILD_NO_DITHER_MASK
1198 DATA8 dith;
1199#endif
1200
1201 dst_ptr = (DATA16 *)dst;
1202
1203 CONVERT_LOOP_START_ROT_270();
1204
1205 r = (R_VAL(src_ptr)) >> 4;
1206 g = (G_VAL(src_ptr)) >> 4;
1207 b = (B_VAL(src_ptr)) >> 4;
1208
1209#ifndef BUILD_NO_DITHER_MASK
1210 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
1211 if (((R_VAL(src_ptr) - (r << 4)) >= dith ) && (r < 0x0f)) r++;
1212 if (((G_VAL(src_ptr) - (g << 4)) >= dith ) && (g < 0x0f)) g++;
1213 if (((B_VAL(src_ptr) - (b << 4)) >= dith ) && (b < 0x0f)) b++;
1214#endif
1215
1216 *dst_ptr = (r << 8) | (g << 4) | (b);
1217
1218 CONVERT_LOOP_END_ROT_270();
1219 return;
1220 pal = 0;
1221}
1222#endif
1223#endif
1224
1225#ifdef BUILD_CONVERT_16_RGB_444
1226#ifdef BUILD_CONVERT_16_RGB_ROT90
1227void
1228evas_common_convert_rgba2_to_16bpp_rgb_444_dith_rot_90 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
1229{
1230 DATA32 *src_ptr;
1231 DATA16 *dst_ptr;
1232 int x, y;
1233 DATA8 r1, g1, b1;
1234 DATA8 r2, g2, b2;
1235#ifndef BUILD_NO_DITHER_MASK
1236 DATA8 dith;
1237#endif
1238
1239 dst_ptr = (DATA16 *)dst;
1240
1241 CONVERT_LOOP2_START_ROT_90();
1242
1243 r1 = (R_VAL(src_ptr)) >> 4;
1244 g1 = (G_VAL(src_ptr)) >> 4;
1245 b1 = (B_VAL(src_ptr)) >> 4;
1246
1247#ifndef BUILD_NO_DITHER_MASK
1248 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
1249 if (((R_VAL(src_ptr) - (r1 << 4)) >= dith ) && (r1 < 0x0f)) r1++;
1250 if (((G_VAL(src_ptr) - (g1 << 4)) >= dith ) && (g1 < 0x0f)) g1++;
1251 if (((B_VAL(src_ptr) - (b1 << 4)) >= dith ) && (b1 < 0x0f)) b1++;
1252#endif
1253
1254 CONVERT_LOOP2_INC_ROT_90();
1255
1256 r2 = (R_VAL(src_ptr)) >> 4;
1257 g2 = (G_VAL(src_ptr)) >> 4;
1258 b2 = (B_VAL(src_ptr)) >> 4;
1259
1260#ifndef BUILD_NO_DITHER_MASK
1261 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
1262 if (((R_VAL(src_ptr) - (r2 << 4)) >= dith ) && (r2 < 0x0f)) r2++;
1263 if (((G_VAL(src_ptr) - (g2 << 4)) >= dith ) && (g2 < 0x0f)) g2++;
1264 if (((B_VAL(src_ptr) - (b2 << 4)) >= dith ) && (b2 < 0x0f)) b2++;
1265#endif
1266
1267#ifndef WORDS_BIGENDIAN
1268 *((DATA32 *)dst_ptr) =
1269 (r2 << 24) | (g2 << 20) | (b2 << 16) |
1270 (r1 << 8 ) | (g1 << 4 ) | (b1 );
1271#else
1272 *((DATA32 *)dst_ptr) =
1273 (r1 << 24) | (g1 << 20) | (b1 << 16) |
1274 (r2 << 8 ) | (g2 << 4 ) | (b2 );
1275#endif
1276
1277 CONVERT_LOOP2_END_ROT_90();
1278 return;
1279 pal = 0;
1280}
1281#endif
1282#endif
1283
1284#ifdef BUILD_CONVERT_16_RGB_444
1285#ifdef BUILD_CONVERT_16_RGB_ROT90
1286void
1287evas_common_convert_rgba_to_16bpp_rgb_444_dith_rot_90 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
1288{
1289 DATA32 *src_ptr;
1290 DATA16 *dst_ptr;
1291 int x, y;
1292 DATA8 r, g, b;
1293#ifndef BUILD_NO_DITHER_MASK
1294 DATA8 dith;
1295#endif
1296
1297 dst_ptr = (DATA16 *)dst;
1298
1299 CONVERT_LOOP_START_ROT_90();
1300
1301 r = (R_VAL(src_ptr)) >> 4;
1302 g = (G_VAL(src_ptr)) >> 4;
1303 b = (B_VAL(src_ptr)) >> 4;
1304
1305#ifndef BUILD_NO_DITHER_MASK
1306 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
1307 if (((R_VAL(src_ptr) - (r << 4)) >= dith ) && (r < 0x0f)) r++;
1308 if (((G_VAL(src_ptr) - (g << 4)) >= dith ) && (g < 0x0f)) g++;
1309 if (((B_VAL(src_ptr) - (b << 4)) >= dith ) && (b < 0x0f)) b++;
1310#endif
1311
1312 *dst_ptr = (r << 8) | (g << 4) | (b);
1313
1314 CONVERT_LOOP_END_ROT_90();
1315 return;
1316 pal = 0;
1317}
1318#endif
1319#endif
1320
1321#ifdef BUILD_CONVERT_16_RGB_454645
1322#ifdef BUILD_CONVERT_16_RGB_ROT0
1323void
1324evas_common_convert_rgba2_to_16bpp_rgb_454645_dith (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
1325{
1326 DATA32 *src_ptr;
1327 DATA16 *dst_ptr;
1328 int x, y;
1329 DATA8 r1, g1, b1;
1330 DATA8 r2, g2, b2;
1331#ifndef BUILD_NO_DITHER_MASK
1332 DATA8 dith;
1333#endif
1334
1335 dst_ptr = (DATA16 *)dst;
1336
1337 CONVERT_LOOP2_START_ROT_0();
1338
1339 r1 = (R_VAL(src_ptr)) >> 4;
1340 g1 = (G_VAL(src_ptr)) >> 4;
1341 b1 = (B_VAL(src_ptr)) >> 4;
1342
1343#ifndef BUILD_NO_DITHER_MASK
1344 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
1345 if (((R_VAL(src_ptr) - (r1 << 4)) >= dith ) && (r1 < 0x0f)) r1++;
1346 if (((G_VAL(src_ptr) - (g1 << 4)) >= dith ) && (g1 < 0x0f)) g1++;
1347 if (((B_VAL(src_ptr) - (b1 << 4)) >= dith ) && (b1 < 0x0f)) b1++;
1348#endif
1349
1350 CONVERT_LOOP2_INC_ROT_0();
1351
1352 r2 = (R_VAL(src_ptr)) >> 4;
1353 g2 = (G_VAL(src_ptr)) >> 4;
1354 b2 = (B_VAL(src_ptr)) >> 4;
1355
1356#ifndef BUILD_NO_DITHER_MASK
1357 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
1358 if (((R_VAL(src_ptr) - (r2 << 4)) >= dith ) && (r2 < 0x0f)) r2++;
1359 if (((G_VAL(src_ptr) - (g2 << 4)) >= dith ) && (g2 < 0x0f)) g2++;
1360 if (((B_VAL(src_ptr) - (b2 << 4)) >= dith ) && (b2 < 0x0f)) b2++;
1361#endif
1362
1363#ifndef WORDS_BIGENDIAN
1364 *((DATA32 *)dst_ptr) =
1365 (r2 << 28) | (g2 << 23) | (b2 << 17) |
1366 (r1 << 12) | (g1 << 7 ) | (b1 << 1 );
1367#else
1368 *((DATA32 *)dst_ptr) =
1369 (r1 << 28) | (g1 << 23) | (b1 << 17) |
1370 (r2 << 12) | (g2 << 7 ) | (b2 << 1 );
1371#endif
1372
1373 CONVERT_LOOP2_END_ROT_0();
1374 return;
1375 pal = 0;
1376}
1377#endif
1378#endif
1379
1380#ifdef BUILD_CONVERT_16_RGB_454645
1381#ifdef BUILD_CONVERT_16_RGB_ROT0
1382void
1383evas_common_convert_rgba_to_16bpp_rgb_454645_dith (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
1384{
1385 DATA32 *src_ptr;
1386 DATA16 *dst_ptr;
1387 int x, y;
1388 DATA8 r, g, b;
1389#ifndef BUILD_NO_DITHER_MASK
1390 DATA8 dith;
1391#endif
1392
1393 dst_ptr = (DATA16 *)dst;
1394
1395 CONVERT_LOOP_START_ROT_0();
1396
1397 r = (R_VAL(src_ptr)) >> 4;
1398 g = (G_VAL(src_ptr)) >> 4;
1399 b = (B_VAL(src_ptr)) >> 4;
1400
1401#ifndef BUILD_NO_DITHER_MASK
1402 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
1403 if (((R_VAL(src_ptr) - (r << 4)) >= dith ) && (r < 0x0f)) r++;
1404 if (((G_VAL(src_ptr) - (g << 4)) >= dith ) && (g < 0x0f)) g++;
1405 if (((B_VAL(src_ptr) - (b << 4)) >= dith ) && (b < 0x0f)) b++;
1406#endif
1407
1408 *dst_ptr = (r << 12) | (g << 7) | (b << 1);
1409
1410 CONVERT_LOOP_END_ROT_0();
1411 return;
1412 pal = 0;
1413}
1414#endif
1415#endif
1416
1417#ifdef BUILD_CONVERT_16_RGB_454645
1418#ifdef BUILD_CONVERT_16_RGB_ROT180
1419void
1420evas_common_convert_rgba2_to_16bpp_rgb_454645_dith_rot_180 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
1421{
1422 DATA32 *src_ptr;
1423 DATA16 *dst_ptr;
1424 int x, y;
1425 DATA8 r1, g1, b1;
1426 DATA8 r2, g2, b2;
1427#ifndef BUILD_NO_DITHER_MASK
1428 DATA8 dith;
1429#endif
1430
1431 dst_ptr = (DATA16 *)dst;
1432
1433 CONVERT_LOOP2_START_ROT_180();
1434
1435 r1 = (R_VAL(src_ptr)) >> 4;
1436 g1 = (G_VAL(src_ptr)) >> 4;
1437 b1 = (B_VAL(src_ptr)) >> 4;
1438
1439#ifndef BUILD_NO_DITHER_MASK
1440 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
1441 if (((R_VAL(src_ptr) - (r1 << 4)) >= dith ) && (r1 < 0x0f)) r1++;
1442 if (((G_VAL(src_ptr) - (g1 << 4)) >= dith ) && (g1 < 0x0f)) g1++;
1443 if (((B_VAL(src_ptr) - (b1 << 4)) >= dith ) && (b1 < 0x0f)) b1++;
1444#endif
1445
1446 CONVERT_LOOP2_INC_ROT_180();
1447
1448 r2 = (R_VAL(src_ptr)) >> 4;
1449 g2 = (G_VAL(src_ptr)) >> 4;
1450 b2 = (B_VAL(src_ptr)) >> 4;
1451
1452#ifndef BUILD_NO_DITHER_MASK
1453 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
1454 if (((R_VAL(src_ptr) - (r2 << 4)) >= dith ) && (r2 < 0x0f)) r2++;
1455 if (((G_VAL(src_ptr) - (g2 << 4)) >= dith ) && (g2 < 0x0f)) g2++;
1456 if (((B_VAL(src_ptr) - (b2 << 4)) >= dith ) && (b2 < 0x0f)) b2++;
1457#endif
1458
1459#ifndef WORDS_BIGENDIAN
1460 *((DATA32 *)dst_ptr) =
1461 (r2 << 28) | (g2 << 23) | (b2 << 17) |
1462 (r1 << 12) | (g1 << 7 ) | (b1 << 1 );
1463#else
1464 *((DATA32 *)dst_ptr) =
1465 (r1 << 28) | (g1 << 23) | (b1 << 17) |
1466 (r2 << 12) | (g2 << 7 ) | (b2 << 1 );
1467#endif
1468
1469 CONVERT_LOOP2_END_ROT_180();
1470 return;
1471 pal = 0;
1472}
1473#endif
1474#endif
1475
1476#ifdef BUILD_CONVERT_16_RGB_454645
1477#ifdef BUILD_CONVERT_16_RGB_ROT180
1478void
1479evas_common_convert_rgba_to_16bpp_rgb_454645_dith_rot_180 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
1480{
1481 DATA32 *src_ptr;
1482 DATA16 *dst_ptr;
1483 int x, y;
1484 DATA8 r, g, b;
1485#ifndef BUILD_NO_DITHER_MASK
1486 DATA8 dith;
1487#endif
1488
1489 dst_ptr = (DATA16 *)dst;
1490
1491 CONVERT_LOOP_START_ROT_180();
1492
1493 r = (R_VAL(src_ptr)) >> 4;
1494 g = (G_VAL(src_ptr)) >> 4;
1495 b = (B_VAL(src_ptr)) >> 4;
1496
1497#ifndef BUILD_NO_DITHER_MASK
1498 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
1499 if (((R_VAL(src_ptr) - (r << 4)) >= dith ) && (r < 0x0f)) r++;
1500 if (((G_VAL(src_ptr) - (g << 4)) >= dith ) && (g < 0x0f)) g++;
1501 if (((B_VAL(src_ptr) - (b << 4)) >= dith ) && (b < 0x0f)) b++;
1502#endif
1503
1504 *dst_ptr = (r << 12) | (g << 7) | (b << 1);
1505
1506 CONVERT_LOOP_END_ROT_180();
1507 return;
1508 pal = 0;
1509}
1510#endif
1511#endif
1512
1513
1514#ifdef BUILD_CONVERT_16_RGB_454645
1515#ifdef BUILD_CONVERT_16_RGB_ROT270
1516void
1517evas_common_convert_rgba2_to_16bpp_rgb_454645_dith_rot_270 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
1518{
1519 DATA32 *src_ptr;
1520 DATA16 *dst_ptr;
1521 int x, y;
1522 DATA8 r1, g1, b1;
1523 DATA8 r2, g2, b2;
1524#ifndef BUILD_NO_DITHER_MASK
1525 DATA8 dith;
1526#endif
1527
1528 dst_ptr = (DATA16 *)dst;
1529
1530 CONVERT_LOOP2_START_ROT_270();
1531
1532 r1 = (R_VAL(src_ptr)) >> 4;
1533 g1 = (G_VAL(src_ptr)) >> 4;
1534 b1 = (B_VAL(src_ptr)) >> 4;
1535
1536#ifndef BUILD_NO_DITHER_MASK
1537 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
1538 if (((R_VAL(src_ptr) - (r1 << 4)) >= dith ) && (r1 < 0x0f)) r1++;
1539 if (((G_VAL(src_ptr) - (g1 << 4)) >= dith ) && (g1 < 0x0f)) g1++;
1540 if (((B_VAL(src_ptr) - (b1 << 4)) >= dith ) && (b1 < 0x0f)) b1++;
1541#endif
1542
1543 CONVERT_LOOP2_INC_ROT_270();
1544
1545 r2 = (R_VAL(src_ptr)) >> 4;
1546 g2 = (G_VAL(src_ptr)) >> 4;
1547 b2 = (B_VAL(src_ptr)) >> 4;
1548
1549#ifndef BUILD_NO_DITHER_MASK
1550 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
1551 if (((R_VAL(src_ptr) - (r2 << 4)) >= dith ) && (r2 < 0x0f)) r2++;
1552 if (((G_VAL(src_ptr) - (g2 << 4)) >= dith ) && (g2 < 0x0f)) g2++;
1553 if (((B_VAL(src_ptr) - (b2 << 4)) >= dith ) && (b2 < 0x0f)) b2++;
1554#endif
1555
1556#ifndef WORDS_BIGENDIAN
1557 *((DATA32 *)dst_ptr) =
1558 (r2 << 28) | (g2 << 23) | (b2 << 17) |
1559 (r1 << 12) | (g1 << 7 ) | (b1 << 1 );
1560#else
1561 *((DATA32 *)dst_ptr) =
1562 (r1 << 28) | (g1 << 23) | (b1 << 17) |
1563 (r2 << 12) | (g2 << 7 ) | (b2 << 1 );
1564#endif
1565
1566 CONVERT_LOOP2_END_ROT_270();
1567 return;
1568 pal = 0;
1569}
1570#endif
1571#endif
1572
1573#ifdef BUILD_CONVERT_16_RGB_454645
1574#ifdef BUILD_CONVERT_16_RGB_ROT270
1575void
1576evas_common_convert_rgba_to_16bpp_rgb_454645_dith_rot_270 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
1577{
1578 DATA32 *src_ptr;
1579 DATA16 *dst_ptr;
1580 int x, y;
1581 DATA8 r, g, b;
1582#ifndef BUILD_NO_DITHER_MASK
1583 DATA8 dith;
1584#endif
1585
1586 dst_ptr = (DATA16 *)dst;
1587
1588 CONVERT_LOOP_START_ROT_270();
1589
1590 r = (R_VAL(src_ptr)) >> 4;
1591 g = (G_VAL(src_ptr)) >> 4;
1592 b = (B_VAL(src_ptr)) >> 4;
1593
1594#ifndef BUILD_NO_DITHER_MASK
1595 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
1596 if (((R_VAL(src_ptr) - (r << 4)) >= dith ) && (r < 0x0f)) r++;
1597 if (((G_VAL(src_ptr) - (g << 4)) >= dith ) && (g < 0x0f)) g++;
1598 if (((B_VAL(src_ptr) - (b << 4)) >= dith ) && (b < 0x0f)) b++;
1599#endif
1600
1601 *dst_ptr = (r << 12) | (g << 7) | (b << 1);
1602
1603 CONVERT_LOOP_END_ROT_270();
1604 return;
1605 pal = 0;
1606}
1607#endif
1608#endif
1609
1610#ifdef BUILD_CONVERT_16_RGB_454645
1611#ifdef BUILD_CONVERT_16_RGB_ROT90
1612void
1613evas_common_convert_rgba2_to_16bpp_rgb_454645_dith_rot_90 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
1614{
1615 DATA32 *src_ptr;
1616 DATA16 *dst_ptr;
1617 int x, y;
1618 DATA8 r1, g1, b1;
1619 DATA8 r2, g2, b2;
1620#ifndef BUILD_NO_DITHER_MASK
1621 DATA8 dith;
1622#endif
1623
1624 dst_ptr = (DATA16 *)dst;
1625
1626 CONVERT_LOOP2_START_ROT_90();
1627
1628 r1 = (R_VAL(src_ptr)) >> 4;
1629 g1 = (G_VAL(src_ptr)) >> 4;
1630 b1 = (B_VAL(src_ptr)) >> 4;
1631
1632#ifndef BUILD_NO_DITHER_MASK
1633 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
1634 if (((R_VAL(src_ptr) - (r1 << 4)) >= dith ) && (r1 < 0x0f)) r1++;
1635 if (((G_VAL(src_ptr) - (g1 << 4)) >= dith ) && (g1 < 0x0f)) g1++;
1636 if (((B_VAL(src_ptr) - (b1 << 4)) >= dith ) && (b1 < 0x0f)) b1++;
1637#endif
1638
1639 CONVERT_LOOP2_INC_ROT_90();
1640
1641 r2 = (R_VAL(src_ptr)) >> 4;
1642 g2 = (G_VAL(src_ptr)) >> 4;
1643 b2 = (B_VAL(src_ptr)) >> 4;
1644
1645#ifndef BUILD_NO_DITHER_MASK
1646 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
1647 if (((R_VAL(src_ptr) - (r2 << 4)) >= dith ) && (r2 < 0x0f)) r2++;
1648 if (((G_VAL(src_ptr) - (g2 << 4)) >= dith ) && (g2 < 0x0f)) g2++;
1649 if (((B_VAL(src_ptr) - (b2 << 4)) >= dith ) && (b2 < 0x0f)) b2++;
1650#endif
1651
1652#ifndef WORDS_BIGENDIAN
1653 *((DATA32 *)dst_ptr) =
1654 (r2 << 28) | (g2 << 23) | (b2 << 17) |
1655 (r1 << 12) | (g1 << 7 ) | (b1 << 1 );
1656#else
1657 *((DATA32 *)dst_ptr) =
1658 (r1 << 28) | (g1 << 23) | (b1 << 17) |
1659 (r2 << 12) | (g2 << 7 ) | (b2 << 1 );
1660#endif
1661
1662 CONVERT_LOOP2_END_ROT_90();
1663 return;
1664 pal = 0;
1665}
1666#endif
1667#endif
1668
1669#ifdef BUILD_CONVERT_16_RGB_454645
1670#ifdef BUILD_CONVERT_16_RGB_ROT90
1671void
1672evas_common_convert_rgba_to_16bpp_rgb_454645_dith_rot_90 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
1673{
1674 DATA32 *src_ptr;
1675 DATA16 *dst_ptr;
1676 int x, y;
1677 DATA8 r, g, b;
1678#ifndef BUILD_NO_DITHER_MASK
1679 DATA8 dith;
1680#endif
1681
1682 dst_ptr = (DATA16 *)dst;
1683
1684 CONVERT_LOOP_START_ROT_90();
1685
1686 r = (R_VAL(src_ptr)) >> 4;
1687 g = (G_VAL(src_ptr)) >> 4;
1688 b = (B_VAL(src_ptr)) >> 4;
1689
1690#ifndef BUILD_NO_DITHER_MASK
1691 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
1692 if (((R_VAL(src_ptr) - (r << 4)) >= dith ) && (r < 0x0f)) r++;
1693 if (((G_VAL(src_ptr) - (g << 4)) >= dith ) && (g < 0x0f)) g++;
1694 if (((B_VAL(src_ptr) - (b << 4)) >= dith ) && (b < 0x0f)) b++;
1695#endif
1696
1697 *dst_ptr = (r << 12) | (g << 7) | (b << 1);
1698
1699 CONVERT_LOOP_END_ROT_90();
1700 return;
1701 pal = 0;
1702}
1703#endif
1704#endif
1705
1706#ifdef BUILD_CONVERT_16_RGB_555
1707#ifdef BUILD_CONVERT_16_RGB_ROT0
1708void
1709evas_common_convert_rgba2_to_16bpp_rgb_555_dith (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
1710{
1711 DATA32 *src_ptr;
1712 DATA16 *dst_ptr;
1713 int x, y;
1714 DATA8 r1, g1, b1;
1715 DATA8 r2, g2, b2;
1716#ifndef BUILD_NO_DITHER_MASK
1717 DATA8 dith;
1718#endif
1719
1720 dst_ptr = (DATA16 *)dst;
1721
1722 CONVERT_LOOP2_START_ROT_0();
1723
1724 r1 = (R_VAL(src_ptr)) >> 3;
1725 g1 = (G_VAL(src_ptr)) >> 3;
1726 b1 = (B_VAL(src_ptr)) >> 3;
1727
1728#ifndef BUILD_NO_DITHER_MASK
1729 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
1730 if (((R_VAL(src_ptr) - (r1 << 3)) >= dith) && (r1 < 0x1f)) r1++;
1731 if (((G_VAL(src_ptr) - (g1 << 3)) >= dith) && (g1 < 0x1f)) g1++;
1732 if (((B_VAL(src_ptr) - (b1 << 3)) >= dith) && (b1 < 0x1f)) b1++;
1733#endif
1734
1735 CONVERT_LOOP2_INC_ROT_0();
1736
1737 r2 = (R_VAL(src_ptr)) >> 3;
1738 g2 = (G_VAL(src_ptr)) >> 3;
1739 b2 = (B_VAL(src_ptr)) >> 3;
1740
1741#ifndef BUILD_NO_DITHER_MASK
1742 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
1743 if (((R_VAL(src_ptr) - (r2 << 3)) >= dith) && (r2 < 0x1f)) r2++;
1744 if (((G_VAL(src_ptr) - (g2 << 3)) >= dith) && (g2 < 0x1f)) g2++;
1745 if (((B_VAL(src_ptr) - (b2 << 3)) >= dith) && (b2 < 0x1f)) b2++;
1746#endif
1747
1748#ifndef WORDS_BIGENDIAN
1749 *((DATA32 *)dst_ptr) =
1750 (r2 << 26) | (g2 << 21) | (b2 << 16) |
1751 (r1 << 10) | (g1 << 5 ) | (b1 );
1752#else
1753 *((DATA32 *)dst_ptr) =
1754 (r1 << 26) | (g1 << 21) | (b1 << 16) |
1755 (r2 << 10) | (g2 << 5 ) | (b2 );
1756#endif
1757
1758 CONVERT_LOOP2_END_ROT_0();
1759 return;
1760 pal = 0;
1761}
1762#endif
1763#endif
1764
1765#ifdef BUILD_CONVERT_16_RGB_555
1766#ifdef BUILD_CONVERT_16_RGB_ROT0
1767void
1768evas_common_convert_rgba_to_16bpp_rgb_555_dith (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
1769{
1770 DATA32 *src_ptr;
1771 DATA16 *dst_ptr;
1772 int x, y;
1773 DATA8 r, g, b;
1774#ifndef BUILD_NO_DITHER_MASK
1775 DATA8 dith;
1776#endif
1777
1778 dst_ptr = (DATA16 *)dst;
1779
1780 CONVERT_LOOP_START_ROT_0();
1781
1782 r = (R_VAL(src_ptr)) >> 3;
1783 g = (G_VAL(src_ptr)) >> 3;
1784 b = (B_VAL(src_ptr)) >> 3;
1785
1786#ifndef BUILD_NO_DITHER_MASK
1787 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
1788 if (((R_VAL(src_ptr) - (r << 3)) >= dith) && (r < 0x1f)) r++;
1789 if (((G_VAL(src_ptr) - (g << 3)) >= dith) && (g < 0x1f)) g++;
1790 if (((B_VAL(src_ptr) - (b << 3)) >= dith) && (b < 0x1f)) b++;
1791#endif
1792
1793 *dst_ptr = (r << 10) | (g << 5) | (b);
1794
1795 CONVERT_LOOP_END_ROT_0();
1796 return;
1797 pal = 0;
1798}
1799#endif
1800#endif
1801
1802#ifdef BUILD_CONVERT_16_RGB_555
1803#ifdef BUILD_CONVERT_16_RGB_ROT180
1804void
1805evas_common_convert_rgba2_to_16bpp_rgb_555_dith_rot_180 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
1806{
1807 DATA32 *src_ptr;
1808 DATA16 *dst_ptr;
1809 int x, y;
1810 DATA8 r1, g1, b1;
1811 DATA8 r2, g2, b2;
1812#ifndef BUILD_NO_DITHER_MASK
1813 DATA8 dith;
1814#endif
1815
1816 dst_ptr = (DATA16 *)dst;
1817
1818 CONVERT_LOOP2_START_ROT_180();
1819
1820 r1 = (R_VAL(src_ptr)) >> 3;
1821 g1 = (G_VAL(src_ptr)) >> 3;
1822 b1 = (B_VAL(src_ptr)) >> 3;
1823
1824#ifndef BUILD_NO_DITHER_MASK
1825 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
1826 if (((R_VAL(src_ptr) - (r1 << 3)) >= dith) && (r1 < 0x1f)) r1++;
1827 if (((G_VAL(src_ptr) - (g1 << 3)) >= dith) && (g1 < 0x1f)) g1++;
1828 if (((B_VAL(src_ptr) - (b1 << 3)) >= dith) && (b1 < 0x1f)) b1++;
1829#endif
1830
1831 CONVERT_LOOP2_INC_ROT_180();
1832
1833 r2 = (R_VAL(src_ptr)) >> 3;
1834 g2 = (G_VAL(src_ptr)) >> 3;
1835 b2 = (B_VAL(src_ptr)) >> 3;
1836
1837#ifndef BUILD_NO_DITHER_MASK
1838 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
1839 if (((R_VAL(src_ptr) - (r2 << 3)) >= dith) && (r2 < 0x1f)) r2++;
1840 if (((G_VAL(src_ptr) - (g2 << 3)) >= dith) && (g2 < 0x1f)) g2++;
1841 if (((B_VAL(src_ptr) - (b2 << 3)) >= dith) && (b2 < 0x1f)) b2++;
1842#endif
1843
1844#ifndef WORDS_BIGENDIAN
1845 *((DATA32 *)dst_ptr) =
1846 (r2 << 26) | (g2 << 21) | (b2 << 16) |
1847 (r1 << 10) | (g1 << 5 ) | (b1 );
1848#else
1849 *((DATA32 *)dst_ptr) =
1850 (r1 << 26) | (g1 << 21) | (b1 << 16) |
1851 (r2 << 10) | (g2 << 5 ) | (b2 );
1852#endif
1853
1854 CONVERT_LOOP2_END_ROT_180();
1855 return;
1856 pal = 0;
1857}
1858#endif
1859#endif
1860
1861#ifdef BUILD_CONVERT_16_RGB_555
1862#ifdef BUILD_CONVERT_16_RGB_ROT180
1863void
1864evas_common_convert_rgba_to_16bpp_rgb_555_dith_rot_180 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
1865{
1866 DATA32 *src_ptr;
1867 DATA16 *dst_ptr;
1868 int x, y;
1869 DATA8 r, g, b;
1870#ifndef BUILD_NO_DITHER_MASK
1871 DATA8 dith;
1872#endif
1873
1874 dst_ptr = (DATA16 *)dst;
1875
1876 CONVERT_LOOP_START_ROT_180();
1877
1878 r = (R_VAL(src_ptr)) >> 3;
1879 g = (G_VAL(src_ptr)) >> 3;
1880 b = (B_VAL(src_ptr)) >> 3;
1881
1882#ifndef BUILD_NO_DITHER_MASK
1883 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
1884 if (((R_VAL(src_ptr) - (r << 3)) >= dith) && (r < 0x1f)) r++;
1885 if (((G_VAL(src_ptr) - (g << 3)) >= dith) && (g < 0x1f)) g++;
1886 if (((B_VAL(src_ptr) - (b << 3)) >= dith) && (b < 0x1f)) b++;
1887#endif
1888
1889 *dst_ptr = (r << 10) | (g << 5) | (b);
1890
1891 CONVERT_LOOP_END_ROT_180();
1892 return;
1893 pal = 0;
1894}
1895#endif
1896#endif
1897
1898#ifdef BUILD_CONVERT_16_RGB_555
1899#ifdef BUILD_CONVERT_16_RGB_ROT270
1900void
1901evas_common_convert_rgba2_to_16bpp_rgb_555_dith_rot_270 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
1902{
1903 DATA32 *src_ptr;
1904 DATA16 *dst_ptr;
1905 int x, y;
1906 DATA8 r1, g1, b1;
1907 DATA8 r2, g2, b2;
1908#ifndef BUILD_NO_DITHER_MASK
1909 DATA8 dith;
1910#endif
1911
1912 dst_ptr = (DATA16 *)dst;
1913
1914 CONVERT_LOOP2_START_ROT_270();
1915
1916 r1 = (R_VAL(src_ptr)) >> 3;
1917 g1 = (G_VAL(src_ptr)) >> 3;
1918 b1 = (B_VAL(src_ptr)) >> 3;
1919
1920#ifndef BUILD_NO_DITHER_MASK
1921 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
1922 if (((R_VAL(src_ptr) - (r1 << 3)) >= dith) && (r1 < 0x1f)) r1++;
1923 if (((G_VAL(src_ptr) - (g1 << 3)) >= dith) && (g1 < 0x1f)) g1++;
1924 if (((B_VAL(src_ptr) - (b1 << 3)) >= dith) && (b1 < 0x1f)) b1++;
1925#endif
1926
1927 CONVERT_LOOP2_INC_ROT_270();
1928
1929 r2 = (R_VAL(src_ptr)) >> 3;
1930 g2 = (G_VAL(src_ptr)) >> 3;
1931 b2 = (B_VAL(src_ptr)) >> 3;
1932
1933#ifndef BUILD_NO_DITHER_MASK
1934 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
1935 if (((R_VAL(src_ptr) - (r2 << 3)) >= dith) && (r2 < 0x1f)) r2++;
1936 if (((G_VAL(src_ptr) - (g2 << 3)) >= dith) && (g2 < 0x1f)) g2++;
1937 if (((B_VAL(src_ptr) - (b2 << 3)) >= dith) && (b2 < 0x1f)) b2++;
1938#endif
1939
1940#ifndef WORDS_BIGENDIAN
1941 *((DATA32 *)dst_ptr) =
1942 (r2 << 26) | (g2 << 21) | (b2 << 16) |
1943 (r1 << 10) | (g1 << 5 ) | (b1 );
1944#else
1945 *((DATA32 *)dst_ptr) =
1946 (r1 << 26) | (g1 << 21) | (b1 << 16) |
1947 (r2 << 10) | (g2 << 5 ) | (b2 );
1948#endif
1949
1950 CONVERT_LOOP2_END_ROT_270();
1951 return;
1952 pal = 0;
1953}
1954#endif
1955#endif
1956
1957#ifdef BUILD_CONVERT_16_RGB_555
1958#ifdef BUILD_CONVERT_16_RGB_ROT270
1959void
1960evas_common_convert_rgba_to_16bpp_rgb_555_dith_rot_270 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
1961{
1962 DATA32 *src_ptr;
1963 DATA16 *dst_ptr;
1964 int x, y;
1965 DATA8 r, g, b;
1966#ifndef BUILD_NO_DITHER_MASK
1967 DATA8 dith;
1968#endif
1969
1970 dst_ptr = (DATA16 *)dst;
1971
1972 CONVERT_LOOP_START_ROT_270();
1973
1974 r = (R_VAL(src_ptr)) >> 3;
1975 g = (G_VAL(src_ptr)) >> 3;
1976 b = (B_VAL(src_ptr)) >> 3;
1977
1978#ifndef BUILD_NO_DITHER_MASK
1979 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
1980 if (((R_VAL(src_ptr) - (r << 3)) >= dith) && (r < 0x1f)) r++;
1981 if (((G_VAL(src_ptr) - (g << 3)) >= dith) && (g < 0x1f)) g++;
1982 if (((B_VAL(src_ptr) - (b << 3)) >= dith) && (b < 0x1f)) b++;
1983#endif
1984
1985 *dst_ptr = (r << 10) | (g << 5) | (b);
1986
1987 CONVERT_LOOP_END_ROT_270();
1988 return;
1989 pal = 0;
1990}
1991#endif
1992#endif
1993
1994#ifdef BUILD_CONVERT_16_RGB_555
1995#ifdef BUILD_CONVERT_16_RGB_ROT90
1996void
1997evas_common_convert_rgba2_to_16bpp_rgb_555_dith_rot_90 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
1998{
1999 DATA32 *src_ptr;
2000 DATA16 *dst_ptr;
2001 int x, y;
2002 DATA8 r1, g1, b1;
2003 DATA8 r2, g2, b2;
2004#ifndef BUILD_NO_DITHER_MASK
2005 DATA8 dith;
2006#endif
2007
2008 dst_ptr = (DATA16 *)dst;
2009
2010 CONVERT_LOOP2_START_ROT_90();
2011
2012 r1 = (R_VAL(src_ptr)) >> 3;
2013 g1 = (G_VAL(src_ptr)) >> 3;
2014 b1 = (B_VAL(src_ptr)) >> 3;
2015
2016#ifndef BUILD_NO_DITHER_MASK
2017 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
2018 if (((R_VAL(src_ptr) - (r1 << 3)) >= dith) && (r1 < 0x1f)) r1++;
2019 if (((G_VAL(src_ptr) - (g1 << 3)) >= dith) && (g1 < 0x1f)) g1++;
2020 if (((B_VAL(src_ptr) - (b1 << 3)) >= dith) && (b1 < 0x1f)) b1++;
2021#endif
2022
2023 CONVERT_LOOP2_INC_ROT_90();
2024
2025 r2 = (R_VAL(src_ptr)) >> 3;
2026 g2 = (G_VAL(src_ptr)) >> 3;
2027 b2 = (B_VAL(src_ptr)) >> 3;
2028
2029#ifndef BUILD_NO_DITHER_MASK
2030 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
2031 if (((R_VAL(src_ptr) - (r2 << 3)) >= dith) && (r2 < 0x1f)) r2++;
2032 if (((G_VAL(src_ptr) - (g2 << 3)) >= dith) && (g2 < 0x1f)) g2++;
2033 if (((B_VAL(src_ptr) - (b2 << 3)) >= dith) && (b2 < 0x1f)) b2++;
2034#endif
2035
2036#ifndef WORDS_BIGENDIAN
2037 *((DATA32 *)dst_ptr) =
2038 (r2 << 26) | (g2 << 21) | (b2 << 16) |
2039 (r1 << 10) | (g1 << 5 ) | (b1 );
2040#else
2041 *((DATA32 *)dst_ptr) =
2042 (r1 << 26) | (g1 << 21) | (b1 << 16) |
2043 (r2 << 10) | (g2 << 5 ) | (b2 );
2044#endif
2045
2046 CONVERT_LOOP2_END_ROT_90();
2047 return;
2048 pal = 0;
2049}
2050#endif
2051#endif
2052
2053#ifdef BUILD_CONVERT_16_RGB_555
2054#ifdef BUILD_CONVERT_16_RGB_ROT90
2055void
2056evas_common_convert_rgba_to_16bpp_rgb_555_dith_rot_90 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
2057{
2058 DATA32 *src_ptr;
2059 DATA16 *dst_ptr;
2060 int x, y;
2061 DATA8 r, g, b;
2062#ifndef BUILD_NO_DITHER_MASK
2063 DATA8 dith;
2064#endif
2065
2066 dst_ptr = (DATA16 *)dst;
2067
2068 CONVERT_LOOP_START_ROT_90();
2069
2070 r = (R_VAL(src_ptr)) >> 3;
2071 g = (G_VAL(src_ptr)) >> 3;
2072 b = (B_VAL(src_ptr)) >> 3;
2073
2074#ifndef BUILD_NO_DITHER_MASK
2075 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
2076 if (((R_VAL(src_ptr) - (r << 3)) >= dith) && (r < 0x1f)) r++;
2077 if (((G_VAL(src_ptr) - (g << 3)) >= dith) && (g < 0x1f)) g++;
2078 if (((B_VAL(src_ptr) - (b << 3)) >= dith) && (b < 0x1f)) b++;
2079#endif
2080
2081 *dst_ptr = (r << 10) | (g << 5) | (b);
2082
2083 CONVERT_LOOP_END_ROT_90();
2084 return;
2085 pal = 0;
2086}
2087#endif
2088#endif
2089
diff --git a/libraries/evas/src/lib/engines/common/evas_convert_rgb_16.h b/libraries/evas/src/lib/engines/common/evas_convert_rgb_16.h
new file mode 100644
index 0000000..f7ae63c
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_convert_rgb_16.h
@@ -0,0 +1,50 @@
1#ifndef _EVAS_CONVERT_RGB_16_H
2#define _EVAS_CONVERT_RGB_16_H
3
4
5void evas_common_convert_rgba2_to_16bpp_rgb_565_dith (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
6void evas_common_convert_rgba_to_16bpp_rgb_565_dith (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
7void evas_common_convert_rgba2_to_16bpp_bgr_565_dith (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
8void evas_common_convert_rgba_to_16bpp_bgr_565_dith (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
9void evas_common_convert_rgba2_to_16bpp_rgb_444_dith (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
10void evas_common_convert_rgba_to_16bpp_rgb_444_dith (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
11void evas_common_convert_rgba2_to_16bpp_rgb_454645_dith (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
12void evas_common_convert_rgba_to_16bpp_rgb_454645_dith (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
13void evas_common_convert_rgba2_to_16bpp_rgb_555_dith (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
14void evas_common_convert_rgba_to_16bpp_rgb_555_dith (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
15
16void evas_common_convert_rgba2_to_16bpp_rgb_565_dith_rot_180 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
17void evas_common_convert_rgba_to_16bpp_rgb_565_dith_rot_180 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
18void evas_common_convert_rgba2_to_16bpp_bgr_565_dith_rot_180 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
19void evas_common_convert_rgba_to_16bpp_bgr_565_dith_rot_180 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
20void evas_common_convert_rgba2_to_16bpp_rgb_444_dith_rot_180 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
21void evas_common_convert_rgba_to_16bpp_rgb_444_dith_rot_180 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
22void evas_common_convert_rgba2_to_16bpp_rgb_454645_dith_rot_180 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
23void evas_common_convert_rgba_to_16bpp_rgb_454645_dith_rot_180 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
24void evas_common_convert_rgba2_to_16bpp_rgb_555_dith_rot_180 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
25void evas_common_convert_rgba_to_16bpp_rgb_555_dith_rot_180 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
26
27void evas_common_convert_rgba2_to_16bpp_rgb_565_dith_rot_270 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
28void evas_common_convert_rgba_to_16bpp_rgb_565_dith_rot_270 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
29void evas_common_convert_rgba2_to_16bpp_bgr_565_dith_rot_270 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
30void evas_common_convert_rgba_to_16bpp_bgr_565_dith_rot_270 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
31void evas_common_convert_rgba2_to_16bpp_rgb_444_dith_rot_270 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
32void evas_common_convert_rgba_to_16bpp_rgb_444_dith_rot_270 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
33void evas_common_convert_rgba2_to_16bpp_rgb_454645_dith_rot_270 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
34void evas_common_convert_rgba_to_16bpp_rgb_454645_dith_rot_270 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
35void evas_common_convert_rgba2_to_16bpp_rgb_555_dith_rot_270 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
36void evas_common_convert_rgba_to_16bpp_rgb_555_dith_rot_270 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
37
38void evas_common_convert_rgba2_to_16bpp_rgb_565_dith_rot_90 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
39void evas_common_convert_rgba_to_16bpp_rgb_565_dith_rot_90 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
40void evas_common_convert_rgba2_to_16bpp_bgr_565_dith_rot_90 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
41void evas_common_convert_rgba_to_16bpp_bgr_565_dith_rot_90 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
42void evas_common_convert_rgba2_to_16bpp_rgb_444_dith_rot_90 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
43void evas_common_convert_rgba_to_16bpp_rgb_444_dith_rot_90 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
44void evas_common_convert_rgba2_to_16bpp_rgb_454645_dith_rot_90 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
45void evas_common_convert_rgba_to_16bpp_rgb_454645_dith_rot_90 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
46void evas_common_convert_rgba2_to_16bpp_rgb_555_dith_rot_90 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
47void evas_common_convert_rgba_to_16bpp_rgb_555_dith_rot_90 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
48
49
50#endif /* _EVAS_CONVERT_RGB_16_H */
diff --git a/libraries/evas/src/lib/engines/common/evas_convert_rgb_24.c b/libraries/evas/src/lib/engines/common/evas_convert_rgb_24.c
new file mode 100644
index 0000000..9efa006
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_convert_rgb_24.c
@@ -0,0 +1,89 @@
1#include "evas_common.h"
2#include "evas_convert_rgb_24.h"
3
4#ifdef BUILD_CONVERT_24_RGB_888
5void
6evas_common_convert_rgba_to_24bpp_rgb_888(DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x __UNUSED__, int dith_y __UNUSED__, DATA8 *pal __UNUSED__)
7{
8 DATA32 *src_ptr;
9 DATA8 *dst_ptr;
10 int x, y;
11
12 dst_ptr = (DATA8 *)dst;
13 src_ptr = (DATA32 *)src;
14
15 for (y = 0; y < h; y++)
16 {
17 for (x = 0; x < w; x++)
18 {
19 dst_ptr[0] = R_VAL(src_ptr);
20 dst_ptr[1] = G_VAL(src_ptr);
21 dst_ptr[2] = B_VAL(src_ptr);
22 src_ptr++;
23 dst_ptr+=3;
24 }
25 src_ptr += src_jump;
26 dst_ptr += (dst_jump * 3);
27 }
28 return;
29}
30#endif
31#ifdef BUILD_CONVERT_24_RGB_666
32void
33evas_common_convert_rgba_to_24bpp_rgb_666(DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x __UNUSED__, int dith_y __UNUSED__, DATA8 *pal __UNUSED__)
34{
35 DATA32 *src_ptr;
36 DATA8 *dst_ptr, *scratch_ptr;
37 DATA32 scratch;
38 int x, y;
39
40 dst_ptr = (DATA8 *)dst;
41 src_ptr = (DATA32 *)src;
42
43 scratch_ptr = (DATA8 *)(&scratch);
44 for (y = 0; y < h; y++)
45 {
46 for (x = 0; x < w; x++)
47 {
48 scratch =
49 (((R_VAL(src_ptr) << 12) | (B_VAL(src_ptr) >> 2)) & 0x03f03f) |
50 ((G_VAL(src_ptr) << 4) & 0x000fc0);
51 dst_ptr[0] = scratch_ptr[1];
52 dst_ptr[1] = scratch_ptr[2];
53 dst_ptr[2] = scratch_ptr[3];
54 src_ptr++;
55 dst_ptr+=3;
56 }
57 src_ptr += src_jump;
58 dst_ptr += (dst_jump * 3);
59 }
60 return;
61}
62#endif
63#ifdef BUILD_CONVERT_24_BGR_888
64void
65evas_common_convert_rgba_to_24bpp_bgr_888(DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x __UNUSED__, int dith_y __UNUSED__, DATA8 *pal __UNUSED__)
66{
67 DATA32 *src_ptr;
68 DATA8 *dst_ptr;
69 int x, y;
70
71 dst_ptr = (DATA8 *)dst;
72 src_ptr = (DATA32 *)src;
73
74 for (y = 0; y < h; y++)
75 {
76 for (x = 0; x < w; x++)
77 {
78 dst_ptr[2] = R_VAL(src_ptr);
79 dst_ptr[1] = G_VAL(src_ptr);
80 dst_ptr[0] = B_VAL(src_ptr);
81 src_ptr++;
82 dst_ptr+=3;
83 }
84 src_ptr += src_jump;
85 dst_ptr += (dst_jump * 3);
86 }
87 return;
88}
89#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_convert_rgb_24.h b/libraries/evas/src/lib/engines/common/evas_convert_rgb_24.h
new file mode 100644
index 0000000..bc114ca
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_convert_rgb_24.h
@@ -0,0 +1,10 @@
1#ifndef _EVAS_CONVERT_RGB_24_H
2#define _EVAS_CONVERT_RGB_24_H
3
4
5void evas_common_convert_rgba_to_24bpp_rgb_888 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
6void evas_common_convert_rgba_to_24bpp_bgr_888 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
7
8void evas_common_convert_rgba_to_24bpp_rgb_666 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
9
10#endif /* _EVAS_CONVERT_RGB_24_H */
diff --git a/libraries/evas/src/lib/engines/common/evas_convert_rgb_32.c b/libraries/evas/src/lib/engines/common/evas_convert_rgb_32.c
new file mode 100644
index 0000000..41dac6f
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_convert_rgb_32.c
@@ -0,0 +1,460 @@
1#include "evas_common.h"
2#include "evas_convert_rgb_32.h"
3
4#ifdef BUILD_CONVERT_32_RGB_8888
5#ifdef BUILD_CONVERT_32_RGB_ROT0
6void
7evas_common_convert_rgba_to_32bpp_rgb_8888 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x __UNUSED__, int dith_y __UNUSED__, DATA8 *pal __UNUSED__)
8{
9 DATA32 *src_ptr;
10 DATA32 *dst_ptr;
11 int y;
12 Gfx_Func_Copy func;
13
14 dst_ptr = (DATA32 *)dst;
15 src_ptr = src;
16
17 func = evas_common_draw_func_copy_get(w, 0);
18
19 for (y = 0; y < h; y++)
20 {
21 func(src_ptr, dst_ptr, w);
22 src_ptr += w + src_jump;
23 dst_ptr += w + dst_jump;
24 }
25 return;
26}
27#endif
28#endif
29
30#ifdef BUILD_CONVERT_32_RGB_8888
31#ifdef BUILD_CONVERT_32_RGB_ROT180
32void
33evas_common_convert_rgba_to_32bpp_rgb_8888_rot_180 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x __UNUSED__, int dith_y __UNUSED__, DATA8 *pal __UNUSED__)
34{
35 DATA32 *src_ptr;
36 DATA32 *dst_ptr;
37 int x, y;
38
39 dst_ptr = (DATA32 *)dst;
40
41 CONVERT_LOOP_START_ROT_180();
42
43 *dst_ptr = *src_ptr;
44
45 CONVERT_LOOP_END_ROT_180();
46 return;
47}
48#endif
49#endif
50
51#ifdef BUILD_CONVERT_32_RGB_8888
52#ifdef BUILD_CONVERT_32_RGB_ROT270
53void
54evas_common_convert_rgba_to_32bpp_rgb_8888_rot_270 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x __UNUSED__, int dith_y __UNUSED__, DATA8 *pal __UNUSED__)
55{
56 DATA32 *src_ptr;
57 DATA32 *dst_ptr;
58 int x, y;
59
60 dst_ptr = (DATA32 *)dst;
61
62 CONVERT_LOOP_START_ROT_270();
63
64 *dst_ptr = *src_ptr;
65
66 CONVERT_LOOP_END_ROT_270();
67 return;
68}
69#endif
70#endif
71
72#ifdef BUILD_CONVERT_32_RGB_8888
73#ifdef BUILD_CONVERT_32_RGB_ROT90
74void
75evas_common_convert_rgba_to_32bpp_rgb_8888_rot_90 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x __UNUSED__, int dith_y __UNUSED__, DATA8 *pal __UNUSED__)
76{
77#ifndef BUILD_NEON
78 DATA32 *src_ptr;
79 DATA32 *dst_ptr;
80 int x, y;
81
82 dst_ptr = (DATA32 *)dst;
83 CONVERT_LOOP_START_ROT_90();
84
85 *dst_ptr = *src_ptr;
86
87 CONVERT_LOOP_END_ROT_90();
88#else
89 if ((w & 1) || (h & 1))
90 {
91 /* Rarely (if ever) if ever: so slow path is fine */
92 DATA32 *src_ptr;
93 DATA32 *dst_ptr;
94 int x, y;
95
96 dst_ptr = (DATA32 *)dst;
97 CONVERT_LOOP_START_ROT_90();
98
99 *dst_ptr = *src_ptr;
100
101 CONVERT_LOOP_END_ROT_90();
102 } else {
103#define AP "convert_rgba32_rot_90_"
104 asm volatile (
105 ".fpu neon \n\t"
106 " mov %[s1], %[src] \n\t"
107 " add %[s1], %[h],lsl #2 \n\t"
108 " sub %[s1], #8 \n\t"
109
110 " mov %[s2], %[src] \n\t"
111 " add %[s2], %[h], lsl #3 \n\t"
112 " add %[s2], %[sjmp], lsr #1 \n\t"
113 " sub %[s2], #8 \n\t"
114
115 " mov %[d1], %[dst] \n\t"
116
117 " add %[d2], %[d1], %[djmp] \n\t"
118 " add %[d2], %[w], lsl #2 \n\t"
119
120 " mov %[sadv], %[h], lsl #3 \n\t"
121 " add %[sadv], %[sjmp], lsl #1 \n\t"
122
123 " mov %[y], #0 \n\t"
124 " mov %[x], #0 \n\t"
125 AP"loop: \n\t"
126 " vld1.u32 d0, [%[s1]] \n\t"
127 " vld1.u32 d1, [%[s2]] \n\t"
128 " add %[x], #2 \n\t"
129 " add %[s1], %[sadv] \n\t"
130 " add %[s2], %[sadv] \n\t"
131 " vtrn.u32 d0, d1 \n\t"
132 " cmp %[x], %[w] \n\t"
133 " vst1.u32 d1, [%[d1]]! \n\t"
134 " vst1.u32 d0, [%[d2]]! \n\t"
135 " blt "AP"loop \n\t"
136
137 " mov %[x], #0 \n\t"
138 " add %[d1], %[djmp] \n\t"
139 " add %[d1], %[w], lsl #2 \n\t"
140 " add %[d2], %[djmp] \n\t"
141 " add %[d2], %[w], lsl #2 \n\t"
142
143 " mov %[s1], %[src] \n\t"
144 " add %[s1], %[h], lsl #2 \n\t"
145 " sub %[s1], %[y], lsl #2 \n\t"
146 " sub %[s1], #16 \n\t"
147
148 " add %[s2], %[s1], %[h], lsl #2 \n\t"
149 " add %[s2], %[sjmp], lsl #2 \n\t"
150
151 " add %[y], #2 \n\t"
152
153 " cmp %[y], %[h] \n\t"
154 " blt "AP"loop \n\t"
155
156 : // Out
157 : [s1] "r" (1),
158 [s2] "r" (11),
159 [d1] "r" (2),
160 [d2] "r" (12),
161 [src] "r" (src),
162 [dst] "r" (dst),
163 [x] "r" (3),
164 [y] "r" (4),
165 [w] "r" (w),
166 [h] "r" (h),
167 [sadv] "r" (5),
168 [sjmp] "r" (src_jump * 4),
169 [djmp] "r" (dst_jump * 4 * 2)
170 : "d0", "d1", "memory", "cc"// Clober
171
172
173 );
174 }
175#undef AP
176#endif
177 return;
178}
179#endif
180#endif
181
182#ifdef BUILD_CONVERT_32_RGBX_8888
183#ifdef BUILD_CONVERT_32_RGB_ROT0
184void
185evas_common_convert_rgba_to_32bpp_rgbx_8888 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x __UNUSED__, int dith_y __UNUSED__, DATA8 *pal __UNUSED__)
186{
187 DATA32 *src_ptr;
188 DATA32 *dst_ptr;
189 int x, y;
190
191 dst_ptr = (DATA32 *)dst;
192
193 CONVERT_LOOP_START_ROT_0();
194
195// *dst_ptr = (R_VAL(src_ptr) << 24) | (G_VAL(src_ptr) << 16) | (B_VAL(src_ptr) << 8);
196 *dst_ptr = (*src_ptr << 8);
197
198 CONVERT_LOOP_END_ROT_0();
199 return;
200}
201#endif
202#endif
203
204#ifdef BUILD_CONVERT_32_RGBX_8888
205#ifdef BUILD_CONVERT_32_RGB_ROT180
206void
207evas_common_convert_rgba_to_32bpp_rgbx_8888_rot_180 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x __UNUSED__, int dith_y __UNUSED__, DATA8 *pal __UNUSED__)
208{
209 DATA32 *src_ptr;
210 DATA32 *dst_ptr;
211 int x, y;
212
213 dst_ptr = (DATA32 *)dst;
214
215 CONVERT_LOOP_START_ROT_180();
216
217// *dst_ptr = (R_VAL(src_ptr) << 24) | (G_VAL(src_ptr) << 16) | (B_VAL(src_ptr) << 8);
218 *dst_ptr = (*src_ptr << 8);
219
220 CONVERT_LOOP_END_ROT_180();
221 return;
222}
223#endif
224#endif
225
226#ifdef BUILD_CONVERT_32_RGBX_8888
227#ifdef BUILD_CONVERT_32_RGB_ROT270
228void
229evas_common_convert_rgba_to_32bpp_rgbx_8888_rot_270 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x __UNUSED__, int dith_y __UNUSED__, DATA8 *pal __UNUSED__)
230{
231 DATA32 *src_ptr;
232 DATA32 *dst_ptr;
233 int x, y;
234
235 dst_ptr = (DATA32 *)dst;
236
237 CONVERT_LOOP_START_ROT_270();
238
239// *dst_ptr = (R_VAL(src_ptr) << 24) | (G_VAL(src_ptr) << 16) | (B_VAL(src_ptr) << 8);
240 *dst_ptr = (*src_ptr << 8);
241
242 CONVERT_LOOP_END_ROT_270();
243 return;
244}
245#endif
246#endif
247
248#ifdef BUILD_CONVERT_32_RGBX_8888
249#ifdef BUILD_CONVERT_32_RGB_ROT90
250void
251evas_common_convert_rgba_to_32bpp_rgbx_8888_rot_90 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x __UNUSED__, int dith_y __UNUSED__, DATA8 *pal __UNUSED__)
252{
253 DATA32 *src_ptr;
254 DATA32 *dst_ptr;
255 int x, y;
256
257 dst_ptr = (DATA32 *)dst;
258
259 CONVERT_LOOP_START_ROT_90();
260
261// *dst_ptr = (R_VAL(src_ptr) << 24) | (G_VAL(src_ptr) << 16) | (B_VAL(src_ptr) << 8);
262 *dst_ptr = (*src_ptr << 8);
263
264 CONVERT_LOOP_END_ROT_90();
265 return;
266}
267#endif
268#endif
269
270#ifdef BUILD_CONVERT_32_BGR_8888
271#ifdef BUILD_CONVERT_32_RGB_ROT0
272void
273evas_common_convert_rgba_to_32bpp_bgr_8888 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x __UNUSED__, int dith_y __UNUSED__, DATA8 *pal __UNUSED__)
274{
275 DATA32 *src_ptr;
276 DATA32 *dst_ptr;
277 int x, y;
278
279 dst_ptr = (DATA32 *)dst;
280
281 CONVERT_LOOP_START_ROT_0();
282
283 *dst_ptr = (B_VAL(src_ptr) << 16) | (G_VAL(src_ptr) << 8) | (R_VAL(src_ptr));
284
285 CONVERT_LOOP_END_ROT_0();
286 return;
287}
288#endif
289#endif
290
291#ifdef BUILD_CONVERT_32_BGR_8888
292#ifdef BUILD_CONVERT_32_RGB_ROT180
293void
294evas_common_convert_rgba_to_32bpp_bgr_8888_rot_180 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x __UNUSED__, int dith_y __UNUSED__, DATA8 *pal __UNUSED__)
295{
296 DATA32 *src_ptr;
297 DATA32 *dst_ptr;
298 int x, y;
299
300 dst_ptr = (DATA32 *)dst;
301
302 CONVERT_LOOP_START_ROT_180();
303
304 *dst_ptr = (B_VAL(src_ptr) << 16) | (G_VAL(src_ptr) << 8) | (R_VAL(src_ptr));
305
306 CONVERT_LOOP_END_ROT_180();
307 return;
308}
309#endif
310#endif
311
312#ifdef BUILD_CONVERT_32_BGR_8888
313#ifdef BUILD_CONVERT_32_RGB_ROT270
314void
315evas_common_convert_rgba_to_32bpp_bgr_8888_rot_270 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x __UNUSED__, int dith_y __UNUSED__, DATA8 *pal __UNUSED__)
316{
317 DATA32 *src_ptr;
318 DATA32 *dst_ptr;
319 int x, y;
320
321 dst_ptr = (DATA32 *)dst;
322
323 CONVERT_LOOP_START_ROT_270();
324
325 *dst_ptr = (B_VAL(src_ptr) << 16) | (G_VAL(src_ptr) << 8) | (R_VAL(src_ptr));
326
327 CONVERT_LOOP_END_ROT_270();
328 return;
329}
330#endif
331#endif
332
333#ifdef BUILD_CONVERT_32_BGR_8888
334#ifdef BUILD_CONVERT_32_RGB_ROT90
335void
336evas_common_convert_rgba_to_32bpp_bgr_8888_rot_90 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x __UNUSED__, int dith_y __UNUSED__, DATA8 *pal __UNUSED__)
337{
338 DATA32 *src_ptr;
339 DATA32 *dst_ptr;
340 int x, y;
341
342 dst_ptr = (DATA32 *)dst;
343
344 CONVERT_LOOP_START_ROT_90();
345
346 *dst_ptr = (B_VAL(src_ptr) << 16) | (G_VAL(src_ptr) << 8) | (R_VAL(src_ptr));
347
348 CONVERT_LOOP_END_ROT_90();
349 return;
350}
351#endif
352#endif
353
354#ifdef BUILD_CONVERT_32_BGRX_8888
355#ifdef BUILD_CONVERT_32_RGB_ROT0
356void
357evas_common_convert_rgba_to_32bpp_bgrx_8888 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x __UNUSED__, int dith_y __UNUSED__, DATA8 *pal __UNUSED__)
358{
359 DATA32 *src_ptr;
360 DATA32 *dst_ptr;
361 int x, y;
362
363 dst_ptr = (DATA32 *)dst;
364
365 CONVERT_LOOP_START_ROT_0();
366
367 *dst_ptr = (B_VAL(src_ptr) << 24) | (G_VAL(src_ptr) << 16) | (R_VAL(src_ptr) << 8);
368
369 CONVERT_LOOP_END_ROT_0();
370 return;
371}
372#endif
373#endif
374
375#ifdef BUILD_CONVERT_32_BGRX_8888
376#ifdef BUILD_CONVERT_32_RGB_ROT180
377void
378evas_common_convert_rgba_to_32bpp_bgrx_8888_rot_180 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x __UNUSED__, int dith_y __UNUSED__, DATA8 *pal __UNUSED__)
379{
380 DATA32 *src_ptr;
381 DATA32 *dst_ptr;
382 int x, y;
383
384 dst_ptr = (DATA32 *)dst;
385
386 CONVERT_LOOP_START_ROT_180();
387
388 *dst_ptr = (B_VAL(src_ptr) << 24) | (G_VAL(src_ptr) << 16) | (R_VAL(src_ptr) << 8);
389
390 CONVERT_LOOP_END_ROT_180();
391 return;
392}
393#endif
394#endif
395
396#ifdef BUILD_CONVERT_32_BGRX_8888
397#ifdef BUILD_CONVERT_32_RGB_ROT270
398void
399evas_common_convert_rgba_to_32bpp_bgrx_8888_rot_270 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x __UNUSED__, int dith_y __UNUSED__, DATA8 *pal __UNUSED__)
400{
401 DATA32 *src_ptr;
402 DATA32 *dst_ptr;
403 int x, y;
404
405 dst_ptr = (DATA32 *)dst;
406
407 CONVERT_LOOP_START_ROT_270();
408
409 *dst_ptr = (B_VAL(src_ptr) << 24) | (G_VAL(src_ptr) << 16) | (R_VAL(src_ptr) << 8);
410
411 CONVERT_LOOP_END_ROT_270();
412 return;
413}
414#endif
415#endif
416
417#ifdef BUILD_CONVERT_32_BGRX_8888
418#ifdef BUILD_CONVERT_32_RGB_ROT90
419void
420evas_common_convert_rgba_to_32bpp_bgrx_8888_rot_90 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x __UNUSED__, int dith_y __UNUSED__, DATA8 *pal __UNUSED__)
421{
422 DATA32 *src_ptr;
423 DATA32 *dst_ptr;
424 int x, y;
425
426 dst_ptr = (DATA32 *)dst;
427
428 CONVERT_LOOP_START_ROT_90();
429
430 *dst_ptr = (B_VAL(src_ptr) << 24) | (G_VAL(src_ptr) << 16) | (R_VAL(src_ptr) << 8);
431
432 CONVERT_LOOP_END_ROT_90();
433 return;
434}
435#endif
436#endif
437
438#ifdef BUILD_CONVERT_32_RGB_666
439#ifdef BUILD_CONVERT_32_RGB_ROT0
440void
441evas_common_convert_rgba_to_32bpp_rgb_666(DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x __UNUSED__, int dith_y __UNUSED__, DATA8 *pal __UNUSED__)
442{
443 DATA32 *src_ptr;
444 DATA32 *dst_ptr;
445 int x, y;
446
447 dst_ptr = (DATA32 *)dst;
448
449 CONVERT_LOOP_START_ROT_0();
450
451 *dst_ptr =
452 (((R_VAL(src_ptr) << 12) | (B_VAL(src_ptr) >> 2)) & 0x03f03f) |
453 ((G_VAL(src_ptr) << 4) & 0x000fc0);
454
455 CONVERT_LOOP_END_ROT_0();
456 return;
457}
458#endif
459#endif
460
diff --git a/libraries/evas/src/lib/engines/common/evas_convert_rgb_32.h b/libraries/evas/src/lib/engines/common/evas_convert_rgb_32.h
new file mode 100644
index 0000000..75595c7
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_convert_rgb_32.h
@@ -0,0 +1,24 @@
1#ifndef _EVAS_CONVERT_RGB_32_H
2#define _EVAS_CONVERT_RGB_32_H
3
4
5void evas_common_convert_rgba_to_32bpp_rgb_8888 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
6void evas_common_convert_rgba_to_32bpp_rgb_8888_rot_180 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
7void evas_common_convert_rgba_to_32bpp_rgb_8888_rot_270 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
8void evas_common_convert_rgba_to_32bpp_rgb_8888_rot_90 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
9void evas_common_convert_rgba_to_32bpp_rgbx_8888 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
10void evas_common_convert_rgba_to_32bpp_rgbx_8888_rot_180 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
11void evas_common_convert_rgba_to_32bpp_rgbx_8888_rot_270 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
12void evas_common_convert_rgba_to_32bpp_rgbx_8888_rot_90 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
13void evas_common_convert_rgba_to_32bpp_bgr_8888 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
14void evas_common_convert_rgba_to_32bpp_bgr_8888_rot_180 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
15void evas_common_convert_rgba_to_32bpp_bgr_8888_rot_270 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
16void evas_common_convert_rgba_to_32bpp_bgr_8888_rot_90 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
17void evas_common_convert_rgba_to_32bpp_bgrx_8888 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
18void evas_common_convert_rgba_to_32bpp_bgrx_8888_rot_180 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
19void evas_common_convert_rgba_to_32bpp_bgrx_8888_rot_270 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
20void evas_common_convert_rgba_to_32bpp_bgrx_8888_rot_90 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
21
22void evas_common_convert_rgba_to_32bpp_rgb_666 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
23
24#endif /* _EVAS_CONVERT_RGB_32_H */
diff --git a/libraries/evas/src/lib/engines/common/evas_convert_rgb_8.c b/libraries/evas/src/lib/engines/common/evas_convert_rgb_8.c
new file mode 100644
index 0000000..f69f398
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_convert_rgb_8.c
@@ -0,0 +1,248 @@
1#include "evas_common.h"
2#include "evas_convert_rgb_8.h"
3
4#ifdef USE_DITHER_44
5extern const DATA8 _evas_dither_44[4][4];
6#endif
7#ifdef USE_DITHER_128128
8extern const DATA8 _evas_dither_128128[128][128];
9#endif
10
11#ifdef BUILD_CONVERT_8_RGB_332
12void evas_common_convert_rgba_to_8bpp_rgb_332_dith (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
13{
14 DATA32 *src_ptr;
15 DATA8 *dst_ptr;
16 int x, y;
17 DATA8 r, g, b;
18 DATA8 dith, dith2;
19
20 dst_ptr = (DATA8 *)dst;
21
22 CONVERT_LOOP_START_ROT_0();
23
24 dith = DM_SHR(DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK], 3);
25 dith2 = DM_SHR(DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK], 2);
26/* r = (R_VAL(src_ptr)) >> (8 - 3);*/
27/* g = (G_VAL(src_ptr)) >> (8 - 3);*/
28/* b = (B_VAL(src_ptr)) >> (8 - 2);*/
29/* if (((R_VAL(src_ptr) - (r << (8 - 3))) >= dith ) && (r < 0x07)) r++;*/
30/* if (((G_VAL(src_ptr) - (g << (8 - 3))) >= dith ) && (g < 0x07)) g++;*/
31/* if (((B_VAL(src_ptr) - (b << (8 - 2))) >= dith2) && (b < 0x03)) b++;*/
32 r = (R_VAL(src_ptr)) * 7 / 255;
33 if (((R_VAL(src_ptr) - (r * 255 / 7)) >= dith ) && (r < 0x07)) r++;
34 g = (G_VAL(src_ptr)) * 7 / 255;
35 if (((G_VAL(src_ptr) - (g * 255 / 7)) >= dith ) && (g < 0x07)) g++;
36 b = (B_VAL(src_ptr)) * 3 / 255;
37 if (((B_VAL(src_ptr) - (b * 255 / 3)) >= dith2) && (b < 0x03)) b++;
38
39 *dst_ptr = pal[(r << 5) | (g << 2) | (b)];
40
41 CONVERT_LOOP_END_ROT_0();
42}
43#endif
44#ifdef BUILD_CONVERT_8_RGB_666
45static DATA8 p_to_6[256];
46static DATA8 p_to_6_err[256];
47
48void evas_common_convert_rgba_to_8bpp_rgb_666_dith (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
49{
50 DATA32 *src_ptr;
51 DATA8 *dst_ptr;
52 int x, y;
53 DATA8 r, g, b;
54 DATA8 dith;
55 static int tables_calcualted = 0;
56
57 if (!tables_calcualted)
58 {
59 int i;
60
61 tables_calcualted = 1;
62 for (i = 0; i < 256; i++)
63 p_to_6[i] = (i * 5) / 255;
64 for (i = 0; i < 256; i++)
65 p_to_6_err[i] = ((i * 5) - (p_to_6[i] * 255)) * DM_DIV / 255;
66 }
67 dst_ptr = (DATA8 *)dst;
68
69 CONVERT_LOOP_START_ROT_0();
70
71 r = p_to_6[(R_VAL(src_ptr))];
72 g = p_to_6[(G_VAL(src_ptr))];
73 b = p_to_6[(B_VAL(src_ptr))];
74 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK];
75 if ((p_to_6_err[(R_VAL(src_ptr))] >= dith ) && (r < 5)) r++;
76 if ((p_to_6_err[(G_VAL(src_ptr))] >= dith ) && (g < 5)) g++;
77 if ((p_to_6_err[(B_VAL(src_ptr))] >= dith ) && (b < 5)) b++;
78
79 *dst_ptr = pal[(r * 36) + (g * 6) + (b)];
80
81 CONVERT_LOOP_END_ROT_0();
82}
83#endif
84#ifdef BUILD_CONVERT_8_RGB_232
85void evas_common_convert_rgba_to_8bpp_rgb_232_dith (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
86{
87 DATA32 *src_ptr;
88 DATA8 *dst_ptr;
89 int x, y;
90 DATA8 r, g, b;
91 DATA8 dith, dith2;
92
93 dst_ptr = (DATA8 *)dst;
94
95 CONVERT_LOOP_START_ROT_0();
96
97 dith = DM_SHR(DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK], 3);
98 dith2 = DM_SHR(DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK], 2);
99/* r = (R_VAL(src_ptr)) >> (8 - 2);*/
100/* g = (G_VAL(src_ptr)) >> (8 - 3);*/
101/* b = (B_VAL(src_ptr)) >> (8 - 2);*/
102/* if (((R_VAL(src_ptr) - (r << (8 - 2))) >= dith2) && (r < 0x03)) r++;*/
103/* if (((G_VAL(src_ptr) - (g << (8 - 3))) >= dith ) && (g < 0x07)) g++;*/
104/* if (((B_VAL(src_ptr) - (b << (8 - 2))) >= dith2) && (b < 0x03)) b++;*/
105 r = (R_VAL(src_ptr)) * 3 / 255;
106 if (((R_VAL(src_ptr) - (r * 255 / 3)) >= dith2) && (r < 0x03)) r++;
107 g = (G_VAL(src_ptr)) * 7 / 255;
108 if (((G_VAL(src_ptr) - (g * 255 / 7)) >= dith ) && (g < 0x07)) g++;
109 b = (B_VAL(src_ptr)) * 3 / 255;
110 if (((B_VAL(src_ptr) - (b * 255 / 3)) >= dith2) && (b < 0x03)) b++;
111
112 *dst_ptr = pal[(r << 5) | (g << 2) | (b)];
113
114 CONVERT_LOOP_END_ROT_0();
115}
116#endif
117#ifdef BUILD_CONVERT_8_RGB_222
118void evas_common_convert_rgba_to_8bpp_rgb_222_dith (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
119{
120 DATA32 *src_ptr;
121 DATA8 *dst_ptr;
122 int x, y;
123 DATA8 r, g, b;
124 DATA8 dith;
125
126 dst_ptr = (DATA8 *)dst;
127
128 CONVERT_LOOP_START_ROT_0();
129
130 dith = DM_SHR(DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK], 2);
131/* r = (R_VAL(src_ptr)) >> (8 - 2);*/
132/* g = (G_VAL(src_ptr)) >> (8 - 2);*/
133/* b = (B_VAL(src_ptr)) >> (8 - 2);*/
134/* if (((R_VAL(src_ptr) - (r << (8 - 2))) >= dith ) && (r < 0x03)) r++;*/
135/* if (((G_VAL(src_ptr) - (g << (8 - 2))) >= dith ) && (g < 0x03)) g++;*/
136/* if (((B_VAL(src_ptr) - (b << (8 - 2))) >= dith ) && (b < 0x03)) b++;*/
137 r = (R_VAL(src_ptr)) * 3 / 255;
138 if (((R_VAL(src_ptr) - (r * 255 / 3)) >= dith ) && (r < 0x03)) r++;
139 g = (G_VAL(src_ptr)) * 3 / 255;
140 if (((G_VAL(src_ptr) - (g * 255 / 3)) >= dith ) && (g < 0x03)) g++;
141 b = (B_VAL(src_ptr)) * 3 / 255;
142 if (((B_VAL(src_ptr) - (b * 255 / 3)) >= dith ) && (b < 0x03)) b++;
143
144 *dst_ptr = pal[(r << 4) | (g << 2) | (b)];
145
146 CONVERT_LOOP_END_ROT_0();
147}
148#endif
149#ifdef BUILD_CONVERT_8_RGB_221
150void evas_common_convert_rgba_to_8bpp_rgb_221_dith (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
151{
152 DATA32 *src_ptr;
153 DATA8 *dst_ptr;
154 int x, y;
155 DATA8 r, g, b;
156 DATA8 dith, dith2;
157
158 dst_ptr = (DATA8 *)dst;
159
160 CONVERT_LOOP_START_ROT_0();
161
162 dith = DM_SHR(DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK], 2);
163 dith2 = DM_SHR(DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK], 1);
164/* r = (R_VAL(src_ptr)) >> (8 - 2);*/
165/* g = (G_VAL(src_ptr)) >> (8 - 2);*/
166/* b = (B_VAL(src_ptr)) >> (8 - 1);*/
167/* if (((R_VAL(src_ptr) - (r << (8 - 2))) >= dith ) && (r < 0x03)) r++;*/
168/* if (((G_VAL(src_ptr) - (g << (8 - 2))) >= dith ) && (g < 0x03)) g++;*/
169/* if (((B_VAL(src_ptr) - (b << (8 - 1))) >= dith2) && (b < 0x01)) b++;*/
170 r = (R_VAL(src_ptr)) * 3 / 255;
171 if (((R_VAL(src_ptr) - (r * 255 / 3)) >= dith ) && (r < 0x03)) r++;
172 g = (G_VAL(src_ptr)) * 3 / 255;
173 if (((G_VAL(src_ptr) - (g * 255 / 3)) >= dith ) && (g < 0x03)) g++;
174 b = (B_VAL(src_ptr)) * 1 / 255;
175 if (((B_VAL(src_ptr) - (b * 255 / 1)) >= dith2) && (b < 0x01)) b++;
176
177 *dst_ptr = pal[(r << 3) | (g << 1) | (b)];
178
179 CONVERT_LOOP_END_ROT_0();
180}
181#endif
182#ifdef BUILD_CONVERT_8_RGB_121
183void evas_common_convert_rgba_to_8bpp_rgb_121_dith (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
184{
185 DATA32 *src_ptr;
186 DATA8 *dst_ptr;
187 int x, y;
188 DATA8 r, g, b;
189 DATA8 dith, dith2;
190
191 dst_ptr = (DATA8 *)dst;
192
193 CONVERT_LOOP_START_ROT_0();
194
195 dith = DM_SHR(DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK], 2);
196 dith2 = DM_SHR(DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK], 1);
197/* r = (R_VAL(src_ptr)) >> (8 - 1);*/
198/* g = (G_VAL(src_ptr)) >> (8 - 2);*/
199/* b = (B_VAL(src_ptr)) >> (8 - 1);*/
200/* if (((R_VAL(src_ptr) - (r << (8 - 1))) >= dith2) && (r < 0x01)) r++;*/
201/* if (((G_VAL(src_ptr) - (g << (8 - 2))) >= dith ) && (g < 0x03)) g++;*/
202/* if (((B_VAL(src_ptr) - (b << (8 - 1))) >= dith2) && (b < 0x01)) b++;*/
203
204 r = (R_VAL(src_ptr)) * 1 / 255;
205 if (((R_VAL(src_ptr) - (r * 255 / 1)) >= dith2) && (r < 0x01)) r++;
206 g = (G_VAL(src_ptr)) * 3 / 255;
207 if (((G_VAL(src_ptr) - (g * 255 / 3)) >= dith ) && (g < 0x03)) g++;
208 b = (B_VAL(src_ptr)) * 1 / 255;
209 if (((B_VAL(src_ptr) - (b * 255 / 1)) >= dith2) && (b < 0x01)) b++;
210
211 *dst_ptr = pal[(r << 3) | (g << 1) | (b)];
212
213 CONVERT_LOOP_END_ROT_0();
214}
215#endif
216#ifdef BUILD_CONVERT_8_RGB_111
217void evas_common_convert_rgba_to_8bpp_rgb_111_dith (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
218{
219 DATA32 *src_ptr;
220 DATA8 *dst_ptr;
221 int x, y;
222 DATA8 r, g, b;
223 DATA8 dith;
224
225 dst_ptr = (DATA8 *)dst;
226
227 CONVERT_LOOP_START_ROT_0();
228
229 dith = DM_SHR(DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK], 1);
230/* r = (R_VAL(src_ptr)) >> (8 - 1);*/
231/* g = (G_VAL(src_ptr)) >> (8 - 1);*/
232/* b = (B_VAL(src_ptr)) >> (8 - 1);*/
233/* if (((R_VAL(src_ptr) - (r << (8 - 1))) >= dith ) && (r < 0x01)) r++;*/
234/* if (((G_VAL(src_ptr) - (g << (8 - 1))) >= dith ) && (g < 0x01)) g++;*/
235/* if (((B_VAL(src_ptr) - (b << (8 - 1))) >= dith ) && (b < 0x01)) b++;*/
236
237 r = (R_VAL(src_ptr)) * 1 / 255;
238 if (((R_VAL(src_ptr) - (r * 255 / 1)) >= dith ) && (r < 0x01)) r++;
239 g = (G_VAL(src_ptr)) * 1 / 255;
240 if (((G_VAL(src_ptr) - (g * 255 / 1)) >= dith ) && (g < 0x01)) g++;
241 b = (B_VAL(src_ptr)) * 1 / 255;
242 if (((B_VAL(src_ptr) - (b * 255 / 1)) >= dith ) && (b < 0x01)) b++;
243
244 *dst_ptr = pal[(r << 2) | (g << 1) | (b)];
245
246 CONVERT_LOOP_END_ROT_0();
247}
248#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_convert_rgb_8.h b/libraries/evas/src/lib/engines/common/evas_convert_rgb_8.h
new file mode 100644
index 0000000..edb3a89
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_convert_rgb_8.h
@@ -0,0 +1,14 @@
1#ifndef _EVAS_CONVERT_RGB_8_H
2#define _EVAS_CONVERT_RGB_8_H
3
4
5void evas_common_convert_rgba_to_8bpp_rgb_332_dith (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
6void evas_common_convert_rgba_to_8bpp_rgb_666_dith (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
7void evas_common_convert_rgba_to_8bpp_rgb_232_dith (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
8void evas_common_convert_rgba_to_8bpp_rgb_222_dith (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
9void evas_common_convert_rgba_to_8bpp_rgb_221_dith (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
10void evas_common_convert_rgba_to_8bpp_rgb_121_dith (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
11void evas_common_convert_rgba_to_8bpp_rgb_111_dith (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
12
13
14#endif /* _EVAS_CONVERT_RGB_8_H */
diff --git a/libraries/evas/src/lib/engines/common/evas_convert_yuv.c b/libraries/evas/src/lib/engines/common/evas_convert_yuv.c
new file mode 100644
index 0000000..a0d155c
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_convert_yuv.c
@@ -0,0 +1,1258 @@
1#include "evas_common.h"
2#include "evas_convert_yuv.h"
3
4#if defined BUILD_MMX || defined BUILD_SSE
5# include "evas_mmx.h"
6#endif
7
8#if defined HAVE_ALTIVEC_H
9# include <altivec.h>
10#ifdef CONFIG_DARWIN
11#define AVV(x...) (x)
12#else
13#define AVV(x...) {x}
14#endif
15
16#endif
17
18#ifdef BUILD_CONVERT_YUV
19
20static void _evas_yuv_init (void);
21static void _evas_yv12torgb_sse (unsigned char **yuv, unsigned char *rgb, int w, int h);
22static void _evas_yv12torgb_mmx (unsigned char **yuv, unsigned char *rgb, int w, int h);
23#ifdef BUILD_ALTIVEC
24static void _evas_yv12torgb_altivec(unsigned char **yuv, unsigned char *rgb, int w, int h);
25static void _evas_yv12torgb_diz (unsigned char **yuv, unsigned char *rgb, int w, int h);
26#endif
27static void _evas_yv12torgb_raster (unsigned char **yuv, unsigned char *rgb, int w, int h);
28static void _evas_yuy2torgb_raster (unsigned char **yuv, unsigned char *rgb, int w, int h);
29static void _evas_nv12torgb_raster (unsigned char **yuv, unsigned char *rgb, int w, int h);
30static void _evas_nv12tiledtorgb_raster(unsigned char **yuv, unsigned char *rgb, int w, int h);
31
32#define CRV 104595
33#define CBU 132251
34#define CGU 25624
35#define CGV 53280
36#define YMUL 76283
37#define OFF 32768
38#define BITRES 16
39
40/* calculation float resolution in bits */
41/* ie RES = 6 is 10.6 fixed point */
42/* RES = 8 is 8.8 fixed point */
43/* RES = 4 is 12.4 fixed point */
44/* NB: going above 6 will lead to overflow... :( */
45#define RES 6
46
47#define RZ(i) (i >> (BITRES - RES))
48#define FOUR(i) {i, i, i, i}
49
50#if defined BUILD_MMX || defined BUILD_SSE
51__attribute__ ((aligned (8))) const volatile unsigned short _const_crvcrv[4] = FOUR(RZ(CRV));
52__attribute__ ((aligned (8))) const volatile unsigned short _const_cbucbu[4] = FOUR(RZ(CBU));
53__attribute__ ((aligned (8))) const volatile unsigned short _const_cgucgu[4] = FOUR(RZ(CGU));
54__attribute__ ((aligned (8))) const volatile unsigned short _const_cgvcgv[4] = FOUR(RZ(CGV));
55__attribute__ ((aligned (8))) const volatile unsigned short _const_ymul [4] = FOUR(RZ(YMUL));
56__attribute__ ((aligned (8))) const volatile unsigned short _const_128 [4] = FOUR(128);
57__attribute__ ((aligned (8))) const volatile unsigned short _const_32 [4] = FOUR(RZ(OFF));
58__attribute__ ((aligned (8))) const volatile unsigned short _const_16 [4] = FOUR(16);
59__attribute__ ((aligned (8))) const volatile unsigned short _const_ff [4] = FOUR(-1);
60
61#define CONST_CRVCRV *_const_crvcrv
62#define CONST_CBUCBU *_const_cbucbu
63#define CONST_CGUCGU *_const_cgucgu
64#define CONST_CGVCGV *_const_cgvcgv
65#define CONST_YMUL *_const_ymul
66#define CONST_128 *_const_128
67#define CONST_32 *_const_32
68#define CONST_16 *_const_16
69#define CONST_FF *_const_ff
70
71/* for C non aligned cleanup */
72const int _crv = RZ(CRV); /* 1.596 */
73const int _cbu = RZ(CBU); /* 2.018 */
74const int _cgu = RZ(CGU); /* 0.391 */
75const int _cgv = RZ(CGV); /* 0.813 */
76
77#endif
78
79#ifdef BUILD_ALTIVEC
80#ifdef __VEC__
81const vector unsigned short res = AVV(RES);
82const vector signed short crv = AVV(RZ(CRV));
83const vector signed short cbu = AVV(RZ(CBU));
84const vector signed short cgu = AVV(RZ(CGU));
85const vector signed short cgv = AVV(RZ(CGV));
86const vector signed short ymul = AVV(RZ(YMUL));
87const vector signed short c128 = AVV(128);
88const vector signed short c32 = AVV(RZ(OFF));
89const vector signed short c16 = AVV(16);
90const vector unsigned char zero = AVV(0);
91const vector signed short maxchar = AVV(255);
92const vector unsigned char pickrg1 = AVV(0, 0x1, 0x11, 0,
93 0, 0x3, 0x13, 0,
94 0, 0x5, 0x15, 0,
95 0, 0x7, 0x17, 0);
96const vector unsigned char pickrg2 = AVV(0, 0x9, 0x19, 0,
97 0, 0xb, 0x1b, 0,
98 0, 0xd, 0x1d, 0,
99 0, 0xf, 0x1f, 0);
100const vector unsigned char pickrgb1 = AVV(0x3, 0x1, 0x2, 0x11,
101 0x7, 0x5, 0x6, 0x13,
102 0xb, 0x9, 0xa, 0x15,
103 0xf, 0xd, 0xe, 0x17);
104const vector unsigned char pickrgb2 = AVV(0x3, 0x1, 0x2, 0x19,
105 0x7, 0x5, 0x6, 0x1b,
106 0xb, 0x9, 0xa, 0x1d,
107 0xf, 0xd, 0xe, 0x1f);
108#endif
109#endif
110
111#ifdef BUILD_C
112
113/* shortcut speedup lookup-tables */
114static short _v1164[256];
115static short _v1596[256];
116static short _v813[256];
117static short _v391[256];
118static short _v2018[256];
119
120static unsigned char _clip_lut[1024];
121#define LUT_CLIP(i) ((_clip_lut+384)[(i)])
122
123#define CMP_CLIP(i) ((i&256)? (~(i>>10)) : i);
124
125static int initted = 0;
126
127#endif
128
129void
130evas_common_convert_yuv_420p_601_rgba(DATA8 **src, DATA8 *dst, int w, int h)
131{
132 int mmx, sse, sse2;
133
134#if defined BUILD_MMX || defined BUILD_SSE
135 evas_common_cpu_can_do(&mmx, &sse, &sse2);
136#endif
137#ifndef BUILD_SSE
138 sse = 0;
139 sse2 = 0;
140#endif
141#ifndef BUILD_MMX
142 mmx = 0;
143#endif
144 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX2))
145 _evas_yv12torgb_sse(src, dst, w, h);
146 else if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
147 _evas_yv12torgb_mmx(src, dst, w, h);
148#ifdef BUILD_ALTIVEC
149 if (evas_common_cpu_has_feature(CPU_FEATURE_ALTIVEC))
150 _evas_yv12torgb_altivec(src, dst, w, h);
151#endif
152 else
153 {
154#ifdef BUILD_C
155 if (!initted) _evas_yuv_init();
156 initted = 1;
157 /* FIXME: diz may be faster sometimes */
158 _evas_yv12torgb_raster(src, dst, w, h);
159#endif
160 }
161}
162
163/* Thanks to Diz for this code. i've munged it a little and turned it into */
164/* inline macros. I tried beating it with a different algorithm using MMX */
165/* but failed. So here we are. This is the fastest YUV->RGB i know of for */
166/* x86. It has an issue that it doesn't convert colours accurately so the */
167/* image looks a little "yellowy". This is a result of only 10.6 fixed point */
168/* resolution as opposed to 16.16 in the C code. This could be fixed by */
169/* processing half the number of pixels per cycle and going up to 32bits */
170/* per element during compute, but it would all but negate the speedup */
171/* from mmx I think :( It might be possible to use SSE and SSE2 here, but */
172/* I haven't tried yet. Let's see. */
173
174/* NB: XviD has almost the same code in it's assembly YV12->RGB code. same */
175/* algorithm, same constants, same all over actually, except it actually */
176/* does a few extra memory accesses that this one doesn't, so in theory */
177/* this code should be faster. In the end it's all just an mmx version of */
178/* the reference implimentation done with fixed point math */
179
180static void
181_evas_yv12torgb_sse(unsigned char **yuv, unsigned char *rgb, int w, int h)
182{
183#ifdef BUILD_SSE
184 int xx, yy;
185 register unsigned char *yp1, *up, *vp;
186 unsigned char *dp1;
187
188 /* destination pointers */
189 dp1 = rgb;
190
191 for (yy = 0; yy < h; yy++)
192 {
193 /* plane pointers */
194 yp1 = yuv[yy];
195 up = yuv[h + (yy / 2)];
196 vp = yuv[h + (h / 2) + (yy / 2)];
197 for (xx = 0; xx < (w - 7); xx += 8)
198 {
199 movd_m2r(*up, mm3);
200 movd_m2r(*vp, mm2);
201 movq_m2r(*yp1, mm0);
202
203 pxor_r2r(mm7, mm7);
204 punpcklbw_r2r(mm7, mm2);
205 punpcklbw_r2r(mm7, mm3);
206
207 movq_r2r(mm0, mm1);
208 psrlw_i2r(8, mm0);
209 psllw_i2r(8, mm1);
210 psrlw_i2r(8, mm1);
211
212 movq_m2r(CONST_16, mm4);
213 psubsw_r2r(mm4, mm0);
214 psubsw_r2r(mm4, mm1);
215
216 movq_m2r(CONST_128, mm5);
217 psubsw_r2r(mm5, mm2);
218 psubsw_r2r(mm5, mm3);
219
220 movq_m2r(CONST_YMUL, mm4);
221 pmullw_r2r(mm4, mm0);
222 pmullw_r2r(mm4, mm1);
223
224 movq_m2r(CONST_CRVCRV, mm7);
225 pmullw_r2r(mm3, mm7);
226 movq_m2r(CONST_CBUCBU, mm6);
227 pmullw_r2r(mm2, mm6);
228 movq_m2r(CONST_CGUCGU, mm5);
229 pmullw_r2r(mm2, mm5);
230 movq_m2r(CONST_CGVCGV, mm4);
231 pmullw_r2r(mm3, mm4);
232
233 movq_r2r(mm0, mm2);
234 paddsw_r2r(mm7, mm2);
235 paddsw_r2r(mm1, mm7);
236
237 psraw_i2r(RES, mm2);
238 psraw_i2r(RES, mm7);
239 packuswb_r2r(mm7, mm2);
240
241 pxor_r2r(mm7, mm7);
242 movq_r2r(mm2, mm3);
243 punpckhbw_r2r(mm7, mm2);
244 punpcklbw_r2r(mm3, mm7);
245 por_r2r(mm7, mm2);
246
247 movq_r2r(mm0, mm3);
248 psubsw_r2r(mm5, mm3);
249 psubsw_r2r(mm4, mm3);
250 paddsw_m2r(CONST_32, mm3);
251
252 movq_r2r(mm1, mm7);
253 psubsw_r2r(mm5, mm7);
254 psubsw_r2r(mm4, mm7);
255 paddsw_m2r(CONST_32, mm7);
256
257 psraw_i2r(RES, mm3);
258 psraw_i2r(RES, mm7);
259 packuswb_r2r(mm7, mm3);
260
261 pxor_r2r(mm7, mm7);
262 movq_r2r(mm3, mm4);
263 punpckhbw_r2r(mm7, mm3);
264 punpcklbw_r2r(mm4, mm7);
265 por_r2r(mm7, mm3);
266
267 movq_m2r(CONST_32, mm4);
268 paddsw_r2r(mm6, mm0);
269 paddsw_r2r(mm6, mm1);
270 paddsw_r2r(mm4, mm0);
271 paddsw_r2r(mm4, mm1);
272 psraw_i2r(RES, mm0);
273 psraw_i2r(RES, mm1);
274 packuswb_r2r(mm1, mm0);
275
276 pxor_r2r(mm7, mm7);
277 movq_r2r(mm0, mm5);
278 punpckhbw_r2r(mm7, mm0);
279 punpcklbw_r2r(mm5, mm7);
280 por_r2r(mm7, mm0);
281
282 movq_m2r(CONST_FF, mm1);
283 movq_r2r(mm0, mm5);
284 movq_r2r(mm3, mm6);
285 movq_r2r(mm2, mm7);
286 punpckhbw_r2r(mm3, mm2);
287 punpcklbw_r2r(mm6, mm7);
288 punpckhbw_r2r(mm1, mm0);
289 punpcklbw_r2r(mm1, mm5);
290
291 movq_r2r(mm7, mm1);
292 punpckhwd_r2r(mm5, mm7);
293 punpcklwd_r2r(mm5, mm1);
294
295 movq_r2r(mm2, mm4);
296 punpckhwd_r2r(mm0, mm2);
297 punpcklwd_r2r(mm0, mm4);
298
299 movntq_r2m(mm1, *(dp1));
300 movntq_r2m(mm7, *(dp1 + 8));
301 movntq_r2m(mm4, *(dp1 + 16));
302 movntq_r2m(mm2, *(dp1 + 24));
303
304 yp1 += 8;
305 up += 4;
306 vp += 4;
307 dp1 += 8 * 4;
308 }
309 /* cleanup pixles that arent a multiple of 8 pixels wide */
310 if (xx < w)
311 {
312 int y, u, v, r, g, b;
313
314 for (; xx < w; xx += 2)
315 {
316 u = (*up++) - 128;
317 v = (*vp++) - 128;
318
319 y = RZ(YMUL) * ((*yp1++) - 16);
320 r = LUT_CLIP((y + (_crv * v)) >> RES);
321 g = LUT_CLIP((y - (_cgu * u) - (_cgv * v) + RZ(OFF)) >> RES);
322 b = LUT_CLIP((y + (_cbu * u) + RZ(OFF)) >> RES);
323 *((DATA32 *) dp1) = 0xff000000 + RGB_JOIN(r,g,b);
324
325 dp1 += 4;
326
327 y = RZ(YMUL) * ((*yp1++) - 16);
328 r = LUT_CLIP((y + (_crv * v)) >> RES);
329 g = LUT_CLIP((y - (_cgu * u) - (_cgv * v) + RZ(OFF)) >> RES);
330 b = LUT_CLIP((y + (_cbu * u) + RZ(OFF)) >> RES);
331 *((DATA32 *) dp1) = 0xff000000 + RGB_JOIN(r,g,b);
332
333 dp1 += 4;
334 }
335 }
336 }
337 emms();
338#else
339 _evas_yv12torgb_mmx(yuv, rgb, w, h);
340#endif
341}
342
343static void
344_evas_yv12torgb_mmx(unsigned char **yuv, unsigned char *rgb, int w, int h)
345{
346#ifdef BUILD_MMX
347 int xx, yy;
348 register unsigned char *yp1, *up, *vp;
349 unsigned char *dp1;
350
351 /* destination pointers */
352 dp1 = rgb;
353
354 for (yy = 0; yy < h; yy++)
355 {
356 /* plane pointers */
357 yp1 = yuv[yy];
358 up = yuv[h + (yy / 2)];
359 vp = yuv[h + (h / 2) + (yy / 2)];
360 for (xx = 0; xx < (w - 7); xx += 8)
361 {
362 movd_m2r(*up, mm3);
363 movd_m2r(*vp, mm2);
364 movq_m2r(*yp1, mm0);
365
366 pxor_r2r(mm7, mm7);
367 punpcklbw_r2r(mm7, mm2);
368 punpcklbw_r2r(mm7, mm3);
369
370 movq_r2r(mm0, mm1);
371 psrlw_i2r(8, mm0);
372 psllw_i2r(8, mm1);
373 psrlw_i2r(8, mm1);
374
375 movq_m2r(CONST_16, mm4);
376 psubsw_r2r(mm4, mm0);
377 psubsw_r2r(mm4, mm1);
378
379 movq_m2r(CONST_128, mm5);
380 psubsw_r2r(mm5, mm2);
381 psubsw_r2r(mm5, mm3);
382
383 movq_m2r(CONST_YMUL, mm4);
384 pmullw_r2r(mm4, mm0);
385 pmullw_r2r(mm4, mm1);
386
387 movq_m2r(CONST_CRVCRV, mm7);
388 pmullw_r2r(mm3, mm7);
389 movq_m2r(CONST_CBUCBU, mm6);
390 pmullw_r2r(mm2, mm6);
391 movq_m2r(CONST_CGUCGU, mm5);
392 pmullw_r2r(mm2, mm5);
393 movq_m2r(CONST_CGVCGV, mm4);
394 pmullw_r2r(mm3, mm4);
395
396 movq_r2r(mm0, mm2);
397 paddsw_r2r(mm7, mm2);
398 paddsw_r2r(mm1, mm7);
399
400 psraw_i2r(RES, mm2);
401 psraw_i2r(RES, mm7);
402 packuswb_r2r(mm7, mm2);
403
404 pxor_r2r(mm7, mm7);
405 movq_r2r(mm2, mm3);
406 punpckhbw_r2r(mm7, mm2);
407 punpcklbw_r2r(mm3, mm7);
408 por_r2r(mm7, mm2);
409
410 movq_r2r(mm0, mm3);
411 psubsw_r2r(mm5, mm3);
412 psubsw_r2r(mm4, mm3);
413 paddsw_m2r(CONST_32, mm3);
414
415 movq_r2r(mm1, mm7);
416 psubsw_r2r(mm5, mm7);
417 psubsw_r2r(mm4, mm7);
418 paddsw_m2r(CONST_32, mm7);
419
420 psraw_i2r(RES, mm3);
421 psraw_i2r(RES, mm7);
422 packuswb_r2r(mm7, mm3);
423
424 pxor_r2r(mm7, mm7);
425 movq_r2r(mm3, mm4);
426 punpckhbw_r2r(mm7, mm3);
427 punpcklbw_r2r(mm4, mm7);
428 por_r2r(mm7, mm3);
429
430 movq_m2r(CONST_32, mm4);
431 paddsw_r2r(mm6, mm0);
432 paddsw_r2r(mm6, mm1);
433 paddsw_r2r(mm4, mm0);
434 paddsw_r2r(mm4, mm1);
435 psraw_i2r(RES, mm0);
436 psraw_i2r(RES, mm1);
437 packuswb_r2r(mm1, mm0);
438
439 pxor_r2r(mm7, mm7);
440 movq_r2r(mm0, mm5);
441 punpckhbw_r2r(mm7, mm0);
442 punpcklbw_r2r(mm5, mm7);
443 por_r2r(mm7, mm0);
444
445 movq_m2r(CONST_FF, mm1);
446 movq_r2r(mm0, mm5);
447 movq_r2r(mm3, mm6);
448 movq_r2r(mm2, mm7);
449 punpckhbw_r2r(mm3, mm2);
450 punpcklbw_r2r(mm6, mm7);
451 punpckhbw_r2r(mm1, mm0);
452 punpcklbw_r2r(mm1, mm5);
453
454 movq_r2r(mm7, mm1);
455 punpckhwd_r2r(mm5, mm7);
456 punpcklwd_r2r(mm5, mm1);
457
458 movq_r2r(mm2, mm4);
459 punpckhwd_r2r(mm0, mm2);
460 punpcklwd_r2r(mm0, mm4);
461
462 movq_r2m(mm1, *(dp1));
463 movq_r2m(mm7, *(dp1 + 8));
464 movq_r2m(mm4, *(dp1 + 16));
465 movq_r2m(mm2, *(dp1 + 24));
466
467 yp1 += 8;
468 up += 4;
469 vp += 4;
470 dp1 += 8 * 4;
471 }
472 /* cleanup pixles that arent a multiple of 8 pixels wide */
473 if (xx < w)
474 {
475 int y, u, v, r, g, b;
476
477 for (; xx < w; xx += 2)
478 {
479 u = (*up++) - 128;
480 v = (*vp++) - 128;
481
482 y = RZ(YMUL) * ((*yp1++) - 16);
483 r = LUT_CLIP((y + (_crv * v)) >> RES);
484 g = LUT_CLIP((y - (_cgu * u) - (_cgv * v) + RZ(OFF)) >> RES);
485 b = LUT_CLIP((y + (_cbu * u) + RZ(OFF)) >> RES);
486 *((DATA32 *) dp1) = 0xff000000 + RGB_JOIN(r,g,b);
487
488 dp1 += 4;
489
490 y = RZ(YMUL) * ((*yp1++) - 16);
491 r = LUT_CLIP((y + (_crv * v)) >> RES);
492 g = LUT_CLIP((y - (_cgu * u) - (_cgv * v) + RZ(OFF)) >> RES);
493 b = LUT_CLIP((y + (_cbu * u) + RZ(OFF)) >> RES);
494 *((DATA32 *) dp1) = 0xff000000 + RGB_JOIN(r,g,b);
495
496 dp1 += 4;
497 }
498 }
499 }
500 emms();
501#else
502 _evas_yv12torgb_raster(yuv, rgb, w, h);
503#endif
504}
505
506#ifdef BUILD_ALTIVEC
507static void
508_evas_yv12torgb_altivec(unsigned char **yuv, unsigned char *rgb, int w, int h)
509{
510#ifdef __VEC__
511 int xx, yy;
512 int w2, h2;
513 unsigned char *yp1, *yp2, *up, *vp;
514 unsigned char *dp1, *dp2;
515 vector signed short y, u, v;
516 vector signed short r, g, b;
517 vector signed short tmp1, tmp2, tmp3;
518 vector unsigned char yperm, uperm, vperm, rgb1, rgb2;
519 vector unsigned char alpha;
520
521 /* handy halved w & h */
522 w2 = w / 2;
523 h2 = h / 2;
524 /* plane pointers */
525 yp1 = yuv;
526 yp2 = yuv + w;
527 up = yuv + (w * h);
528 vp = up + (w2 * h2);
529 /* destination pointers */
530 dp1 = rgb;
531 dp2 = rgb + (w * 4);
532
533 alpha = vec_mergeh((vector unsigned char)AVV(255), zero);
534 alpha = (vector unsigned char)vec_mergeh((vector unsigned short)alpha,
535 (vector unsigned short)zero);
536
537 for (yy = 0; yy < h2; yy++)
538 {
539 for (xx = 0; xx < w2; xx += 4)
540 {
541/* Cycles */
542 /*
543 * Load 4 y and 4 u & v pixels for the 8x2 pixel block.
544 */
545/* 3 */ tmp3 = (vector signed short)vec_lde(0, (unsigned int *)yp1);
546/* 3 */ tmp1 = (vector signed short)vec_lde(0, (unsigned int *)up);
547/* 3 */ tmp2 = (vector signed short)vec_lde(0, (unsigned int *)vp);
548
549 /* Prepare for aligning the data in their vectors */
550/* 3 */ yperm = vec_lvsl(0, yp1);
551/* 3 */ uperm = vec_lvsl(0, up);
552/* 3 */ vperm = vec_lvsl(0, vp);
553 yp1 += 4;
554
555 /* Save y and load the next 4 y pixels for a total of 8 */
556/* 2 */ y = vec_perm(tmp3, tmp3, yperm);
557/* 3 */ tmp3 = (vector signed short)vec_lde(0, (unsigned int *)yp1);
558
559 /* Setup and calculate the 4 u pixels */
560/* 2 */ tmp1 = vec_perm(tmp1, tmp1, uperm);
561/* 2 */ tmp2 = vec_perm(tmp2, tmp2, vperm);
562
563 /* Avoid dependency stalls on yperm and calculate the 4 u values */
564/* 3 */ yperm = vec_lvsr(12, yp1);
565/* 1 */ tmp1 = (vector signed short)vec_mergeh((vector unsigned char)tmp1,
566 (vector unsigned char)tmp1);
567/* 1 */ u = (vector signed short)vec_mergeh(zero,
568 (vector unsigned char)tmp1);
569
570/* 1 */ u = vec_sub(u, c128);
571/* 2 */ tmp3 = vec_perm(tmp3, tmp3, yperm);
572
573 /* Setup and calculate the 4 v values */
574/* 1 */ tmp2 = (vector signed short)vec_mergeh((vector unsigned char)tmp2,
575 (vector unsigned char)tmp2);
576/* 1 */ v = (vector signed short)vec_mergeh(zero,
577 (vector unsigned char)tmp2);
578/* 4 */ tmp2 = vec_mladd(cgu, u, (vector signed short)zero);
579/* 1 */ v = vec_sub(v, c128);
580
581 /* Move the data into y and start loading the next 4 pixels */
582/* 1 */ y = (vector signed short)vec_mergeh(zero,
583 (vector unsigned char)y);
584/* 1 */ tmp3 = (vector signed short)vec_mergeh(zero,
585 (vector unsigned char)tmp3);
586/* 1 */ y = vec_or(y, tmp3);
587
588 /* Finish calculating y */
589/* 1 */ y = vec_sub(y, c16);
590/* 4 */ y = vec_mladd(ymul, y, (vector signed short)zero);
591
592 /* Perform non-dependent multiplies first. */
593/* 4 */ tmp1 = vec_mladd(crv, v, y);
594/* 4 */ tmp2 = vec_mladd(cgv, v, tmp2);
595/* 4 */ tmp3 = vec_mladd(cbu, u, y);
596
597 /* Calculate rgb values */
598/* 1 */ r = vec_sra(tmp1, res);
599
600/* 1 */ tmp2 = vec_sub(y, tmp2);
601/* 1 */ tmp2 = vec_add(tmp2, c32);
602/* 1 */ g = vec_sra(tmp2, res);
603
604/* 1 */ tmp3 = vec_add(tmp3, c32);
605/* 1 */ b = vec_sra(tmp3, res);
606
607 /* Bound to 0 <= x <= 255 */
608/* 1 */ r = vec_min(r, maxchar);
609/* 1 */ g = vec_min(g, maxchar);
610/* 1 */ b = vec_min(b, maxchar);
611/* 1 */ r = vec_max(r, (vector signed short)zero);
612/* 1 */ g = vec_max(g, (vector signed short)zero);
613/* 1 */ b = vec_max(b, (vector signed short)zero);
614
615 /* Combine r, g and b. */
616/* 2 */ rgb1 = vec_perm((vector unsigned char)r, (vector unsigned char)g,
617 pickrg1);
618/* 2 */ rgb2 = vec_perm((vector unsigned char)r, (vector unsigned char)g,
619 pickrg2);
620
621/* 2 */ rgb1 = vec_perm(rgb1, (vector unsigned char)b, pickrgb1);
622/* 2 */ rgb2 = vec_perm(rgb2, (vector unsigned char)b, pickrgb2);
623
624/* 1 */ rgb1 = vec_or(alpha, rgb1);
625/* 1 */ rgb2 = vec_or(alpha, rgb2);
626
627/* 3 */ vec_stl(rgb1, 0, dp1);
628 dp1 += 16;
629/* 3 */ vec_stl(rgb2, 0, dp1);
630
631 /*
632 * Begin the second row calculations
633 */
634
635 /*
636 * Load 4 y pixels for the 8x2 pixel block.
637 */
638/* 3 */ yperm = vec_lvsl(0, yp2);
639/* 3 */ tmp3 = (vector signed short)vec_lde(0, (unsigned int *)yp2);
640 yp2 += 4;
641
642 /* Save y and load the next 4 y pixels for a total of 8 */
643/* 2 */ y = vec_perm(tmp3, tmp3, yperm);
644/* 3 */ yperm = vec_lvsr(12, yp2);
645/* 3 */ tmp3 = (vector signed short)vec_lde(0, (unsigned int *)yp2);
646/* 1 */ y = (vector signed short)vec_mergeh(zero,
647 (vector unsigned char)y);
648
649 /* Avoid dependency stalls on yperm */
650/* 2 */ tmp3 = vec_perm(tmp3, tmp3, yperm);
651/* 1 */ tmp3 = (vector signed short)vec_mergeh(zero,
652 (vector unsigned char)tmp3);
653/* 1 */ y = vec_or(y, tmp3);
654
655 /* Start the calculation for g */
656/* 4 */ tmp2 = vec_mladd(cgu, u, (vector signed short)zero);
657
658 /* Finish calculating y */
659/* 1 */ y = vec_sub(y, c16);
660/* 4 */ y = vec_mladd(ymul, y, (vector signed short)zero);
661
662 /* Perform non-dependent multiplies first. */
663/* 4 */ tmp2 = vec_mladd(cgv, v, tmp2);
664/* 4 */ tmp1 = vec_mladd(crv, v, y);
665/* 4 */ tmp3 = vec_mladd(cbu, u, y);
666
667 /* Calculate rgb values */
668/* 1 */ r = vec_sra(tmp1, res);
669
670/* 1 */ tmp2 = vec_sub(y, tmp2);
671/* 1 */ tmp2 = vec_add(tmp2, c32);
672/* 1 */ g = vec_sra(tmp2, res);
673
674/* 1 */ tmp3 = vec_add(tmp3, c32);
675/* 1 */ b = vec_sra(tmp3, res);
676
677 /* Bound to 0 <= x <= 255 */
678/* 1 */ r = vec_min(r, maxchar);
679/* 1 */ g = vec_min(g, maxchar);
680/* 1 */ b = vec_min(b, maxchar);
681/* 1 */ r = vec_max(r, (vector signed short)zero);
682/* 1 */ g = vec_max(g, (vector signed short)zero);
683/* 1 */ b = vec_max(b, (vector signed short)zero);
684
685 /* Combine r, g and b. */
686/* 2 */ rgb1 = vec_perm((vector unsigned char)r, (vector unsigned char)g,
687 pickrg1);
688/* 2 */ rgb2 = vec_perm((vector unsigned char)r, (vector unsigned char)g,
689 pickrg2);
690
691/* 2 */ rgb1 = vec_perm(rgb1, (vector unsigned char)b, pickrgb1);
692/* 2 */ rgb2 = vec_perm(rgb2, (vector unsigned char)b, pickrgb2);
693
694/* 1 */ rgb1 = vec_or(alpha, rgb1);
695/* 1 */ rgb2 = vec_or(alpha, rgb2);
696
697/* 3 */ vec_stl(rgb1, 0, dp2);
698 dp2 += 16;
699/* 3 */ vec_stl(rgb2, 0, dp2);
700
701 /* Increment the YUV data pointers to the next set of pixels. */
702 yp1 += 4;
703 yp2 += 4;
704 up += 4;
705 vp += 4;
706
707 /* Move the destination pointers to the next set of pixels. */
708 dp1 += 16;
709 dp2 += 16;
710 }
711
712 /* jump down one line since we are doing 2 at once */
713 yp1 += w;
714 yp2 += w;
715 dp1 += (w * 4);
716 dp2 += (w * 4);
717 }
718#else
719 _evas_yv12torgb_diz(yuv, rgb, w, h);
720#endif
721}
722#endif
723
724static void
725_evas_yuv_init(void)
726{
727#ifdef BUILD_C
728 int i;
729
730 for (i = 0; i < 256; i++)
731 {
732 _v1164[i] = (int)(((float)(i - 16 )) * 1.164);
733
734 _v1596[i] = (int)(((float)(i - 128)) * 1.596);
735 _v813[i] = (int)(((float)(i - 128)) * 0.813);
736
737 _v391[i] = (int)(((float)(i - 128)) * 0.391);
738 _v2018[i] = (int)(((float)(i - 128)) * 2.018);
739 }
740
741 for (i = -384; i < 640; i++)
742 {
743 _clip_lut[i+384] = i < 0 ? 0 : (i > 255) ? 255 : i;
744 }
745#endif
746}
747
748#ifdef BUILD_ALTIVEC
749static void
750_evas_yv12torgb_diz(unsigned char **yuv, unsigned char *rgb, int w, int h)
751{
752#ifdef BUILD_C
753 int xx, yy;
754 int y, u, v, r, g, b;
755 unsigned char *yp1, *yp2, *up, *vp;
756 unsigned char *dp1, *dp2;
757 int crv, cbu, cgu, cgv;
758
759 /* destination pointers */
760 dp1 = rgb;
761 dp2 = rgb + (w * 4);
762
763 crv = CRV; /* 1.596 */
764 cbu = CBU; /* 2.018 */
765 cgu = CGU; /* 0.391 */
766 cgv = CGV; /* 0.813 */
767
768 for (yy = 0; yy < h; yy += 2)
769 {
770 /* plane pointers */
771 yp1 = yuv[yy];
772 yp2 = yuv[yy + 1];
773 up = yuv[h + (yy / 2)];
774 vp = yuv[h + (h / 2) + (yy / 2)];
775 for (xx = 0; xx < w; xx += 2)
776 {
777 /* collect u & v for 2x2 pixel block */
778 u = (*up++) - 128;
779 v = (*vp++) - 128;
780
781 /* do the top 2 pixels of the 2x2 block which shared u & v */
782 /* yuv to rgb */
783 y = YMUL * ((*yp1++) - 16);
784 r = LUT_CLIP((y + (crv * v)) >> 16);
785 g = LUT_CLIP((y - (cgu * u) - (cgv * v) + OFF) >>16);
786 b = LUT_CLIP((y + (cbu * u) + OFF) >> 16);
787 *((DATA32 *) dp1) = 0xff000000 + RGB_JOIN(r,g,b);
788
789 dp1 += 4;
790
791 /* yuv to rgb */
792 y = YMUL * ((*yp1++) - 16);
793 r = LUT_CLIP((y + (crv * v)) >> 16);
794 g = LUT_CLIP((y - (cgu * u) - (cgv * v) + OFF) >>16);
795 b = LUT_CLIP((y + (cbu * u) + OFF) >> 16);
796 *((DATA32 *) dp1) = 0xff000000 + RGB_JOIN(r,g,b);
797
798 dp1 += 4;
799
800 /* do the bottom 2 pixels */
801 /* yuv to rgb */
802 y = YMUL * ((*yp2++) - 16);
803 r = LUT_CLIP((y + (crv * v)) >> 16);
804 g = LUT_CLIP((y - (cgu * u) - (cgv * v) + OFF) >>16);
805 b = LUT_CLIP((y + (cbu * u) + OFF) >> 16);
806 *((DATA32 *) dp2) = 0xff000000 + RGB_JOIN(r,g,b);
807
808 dp2 += 4;
809
810 /* yuv to rgb */
811 y = YMUL * ((*yp2++) - 16);
812 r = LUT_CLIP((y + (crv * v)) >> 16);
813 g = LUT_CLIP((y - (cgu * u) - (cgv * v) + OFF) >>16);
814 b = LUT_CLIP((y + (cbu * u) + OFF) >> 16);
815 *((DATA32 *) dp2) = 0xff000000 + RGB_JOIN(r,g,b);
816
817 dp2 += 4;
818 }
819 /* jump down one line since we are doing 2 at once */
820 dp1 += (w * 4);
821 dp2 += (w * 4);
822 }
823#endif
824}
825#endif
826
827static void
828_evas_yv12torgb_raster(unsigned char **yuv, unsigned char *rgb, int w, int h)
829{
830#ifdef BUILD_C
831 int xx, yy;
832 int y, u, v;
833 unsigned char *yp1, *yp2, *up, *vp;
834 unsigned char *dp1, *dp2;
835
836 /* destination pointers */
837 dp1 = rgb;
838 dp2 = rgb + (w * 4);
839
840 for (yy = 0; yy < h; yy += 2)
841 {
842 /* plane pointers */
843 yp1 = yuv[yy];
844 yp2 = yuv[yy + 1];
845 up = yuv[h + (yy / 2)];
846 vp = yuv[h + (h / 2) + (yy / 2)];
847 for (xx = 0; xx < w; xx += 2)
848 {
849 int vmu;
850
851 /* collect u & v for 2x2 pixel block */
852 u = *up++;
853 v = *vp++;
854
855 /* save lookups */
856 vmu = _v813[v] + _v391[u];
857 u = _v2018[u];
858 v = _v1596[v];
859
860 /* do the top 2 pixels of the 2x2 block which shared u & v */
861 /* yuv to rgb */
862 y = _v1164[*yp1++];
863 *((DATA32 *) dp1) = 0xff000000 + RGB_JOIN(LUT_CLIP(y + v), LUT_CLIP(y - vmu), LUT_CLIP(y + u));
864
865 dp1 += 4;
866
867 /* yuv to rgb */
868 y = _v1164[*yp1++];
869 *((DATA32 *) dp1) = 0xff000000 + RGB_JOIN(LUT_CLIP(y + v), LUT_CLIP(y - vmu), LUT_CLIP(y + u));
870
871 dp1 += 4;
872
873 /* do the bottom 2 pixels */
874 /* yuv to rgb */
875 y = _v1164[*yp2++];
876 *((DATA32 *) dp2) = 0xff000000 + RGB_JOIN(LUT_CLIP(y + v), LUT_CLIP(y - vmu), LUT_CLIP(y + u));
877
878 dp2 += 4;
879
880 /* yuv to rgb */
881 y = _v1164[*yp2++];
882 *((DATA32 *) dp2) = 0xff000000 + RGB_JOIN(LUT_CLIP(y + v), LUT_CLIP(y - vmu), LUT_CLIP(y + u));
883
884 dp2 += 4;
885 }
886 /* jump down one line since we are doing 2 at once */
887 dp1 += (w * 4);
888 dp2 += (w * 4);
889 }
890#endif
891}
892
893void
894evas_common_convert_yuv_422_601_rgba(DATA8 **src, DATA8 *dst, int w, int h)
895{
896#ifdef BUILD_C
897 if (!initted) _evas_yuv_init();
898 initted = 1;
899 _evas_yuy2torgb_raster(src, dst, w, h);
900#endif
901}
902
903void
904evas_common_convert_yuv_420_601_rgba(DATA8 **src, DATA8 *dst, int w, int h)
905{
906#ifdef BUILD_C
907 if (!initted) _evas_yuv_init();
908 initted = 1;
909 _evas_nv12torgb_raster(src, dst, w, h);
910#endif
911}
912
913void
914evas_common_convert_yuv_420T_601_rgba(DATA8 **src, DATA8 *dst, int w, int h)
915{
916#ifdef BUILD_C
917 if (initted) _evas_yuv_init();
918 initted = 1;
919 _evas_nv12tiledtorgb_raster(src, dst, w, h);
920#endif
921}
922
923static void
924_evas_yuy2torgb_raster(unsigned char **yuv, unsigned char *rgb, int w, int h)
925{
926#ifdef BUILD_C
927 int xx, yy;
928 int y, u, v;
929 unsigned char *yp1, *yp2, *up, *vp;
930 unsigned char *dp1;
931
932 dp1 = rgb;
933
934 /* destination pointers */
935 for (yy = 0; yy < h; yy++)
936 {
937 /* plane pointers */
938 unsigned char *line;
939
940 line = yuv[yy];
941 yp1 = line + 0;
942 up = line + 1;
943 yp2 = line + 2;
944 vp = line + 3;
945
946 for (xx = 0; xx < w; xx += 2)
947 {
948 int vmu;
949
950 /* collect u & v for 2 pixels block */
951 u = *up;
952 v = *vp;
953
954 /* save lookups */
955 vmu = _v813[v] + _v391[u];
956 u = _v2018[u];
957 v = _v1596[v];
958
959 /* do the top 2 pixels of the 2x2 block which shared u & v */
960 /* yuv to rgb */
961 y = _v1164[*yp1];
962 *((DATA32 *) dp1) = 0xff000000 + RGB_JOIN(LUT_CLIP(y + v), LUT_CLIP(y - vmu), LUT_CLIP(y + u));
963
964 dp1 += 4;
965
966 /* yuv to rgb */
967 y = _v1164[*yp2];
968 *((DATA32 *) dp1) = 0xff000000 + RGB_JOIN(LUT_CLIP(y + v), LUT_CLIP(y - vmu), LUT_CLIP(y + u));
969
970 dp1 += 4;
971
972 yp1 += 4; yp2 += 4; up += 4; vp += 4;
973 }
974 }
975#endif
976}
977
978#ifdef BUILD_C
979static inline void
980_evas_yuv2rgb_420_raster(unsigned char *yp1, unsigned char *yp2, unsigned char *up, unsigned char *vp,
981 unsigned char *dp1, unsigned char *dp2)
982{
983 int y, u, v;
984 int vmu;
985 int rgb;
986
987 /* collect u & v for 4 pixels block */
988 u = *up;
989 v = *vp;
990
991 /* save lookups */
992#ifdef MEM_BP
993 vmu = _v813[v] + _v391[u];
994 u = _v2018[u];
995 v = _v1596[v];
996#else
997 u -= 128;
998 v -= 128;
999 vmu = v * CGV + u * CGU;
1000 u = u * CBU;
1001 v = v * CRV;
1002#endif
1003
1004 /* do the top 2 pixels of the 2x2 block which shared u & v */
1005 /* yuv to rgb */
1006#ifdef MEM_BP
1007 y = _v1164[*yp1];
1008 rgb = RGB_JOIN(LUT_CLIP(y + v), LUT_CLIP(y - vmu), LUT_CLIP(y + u));
1009#else
1010 y = (*yp1 - 16 ) * YMUL;
1011 rgb = RGB_JOIN(LUT_CLIP(((y + v) >> 16)),
1012 LUT_CLIP(((y - vmu + OFF) >> 16)),
1013 LUT_CLIP(((y + u + OFF) >> 16)));
1014#endif
1015 *((DATA32 *) dp1) = 0xff000000 + rgb;
1016
1017 dp1 += 4; yp1++;
1018
1019 /* yuv to rgb */
1020#ifdef MEM_BP
1021 y = _v1164[*yp1];
1022 rgb = RGB_JOIN(LUT_CLIP(y + v), LUT_CLIP(y - vmu), LUT_CLIP(y + u));
1023#else
1024 y = (*yp1 - 16 ) * YMUL;
1025 rgb = RGB_JOIN(LUT_CLIP(((y + v) >> 16)),
1026 LUT_CLIP(((y - vmu + OFF) >> 16)),
1027 LUT_CLIP(((y + u + OFF) >> 16)));
1028#endif
1029 *((DATA32 *) dp1) = 0xff000000 + rgb;
1030
1031 /* do the bottom 2 pixels of the 2x2 block which shared u & v */
1032 /* yuv to rgb */
1033#ifdef MEM_BP
1034 y = _v1164[*yp2];
1035 rgb = RGB_JOIN(LUT_CLIP(y + v), LUT_CLIP(y - vmu), LUT_CLIP(y + u));
1036#else
1037 y = (*yp2 - 16 ) * YMUL;
1038 rgb = RGB_JOIN(LUT_CLIP(((y + v) >> 16)),
1039 LUT_CLIP(((y - vmu + OFF) >> 16)),
1040 LUT_CLIP(((y + u + OFF) >> 16)));
1041#endif
1042 *((DATA32 *) dp2) = 0xff000000 + rgb;
1043
1044 dp2 += 4; yp2++;
1045
1046 /* yuv to rgb */
1047#ifdef MEM_BP
1048 y = _v1164[*yp2];
1049 rgb = RGB_JOIN(LUT_CLIP(y + v), LUT_CLIP(y - vmu), LUT_CLIP(y + u));
1050#else
1051 y = (*yp2 - 16 ) * YMUL;
1052 rgb = RGB_JOIN(LUT_CLIP(((y + v) >> 16)),
1053 LUT_CLIP(((y - vmu + OFF) >> 16)),
1054 LUT_CLIP(((y + u + OFF) >> 16)));
1055#endif
1056 *((DATA32 *) dp2) = 0xff000000 + rgb;
1057}
1058#endif
1059
1060static void
1061_evas_nv12tiledtorgb_raster(unsigned char **yuv, unsigned char *rgb, int w, int h)
1062{
1063#ifdef BUILD_C
1064
1065#define HANDLE_MACROBLOCK(YP1, YP2, UP, VP, DP1, DP2) \
1066 { \
1067 int i; \
1068 int j; \
1069 \
1070 for (i = 0; i < 32; i += 2) \
1071 { \
1072 for (j = 0; j < 64; j += 2) \
1073 { \
1074 _evas_yuv2rgb_420_raster(YP1, YP2, UP, VP, DP1, DP2); \
1075 \
1076 /* the previous call just rendered 2 pixels per lines */ \
1077 DP1 += 8; DP2 += 8; \
1078 \
1079 /* and took for that 2 lines with 2 Y, 1 U and 1 V. Don't forget U & V are in the same plane */ \
1080 YP1 += 2; YP2 += 2; UP += 2; VP += 2; \
1081 } \
1082 \
1083 DP1 += sizeof (int) * ((w << 1) - 64); \
1084 DP2 += sizeof (int) * ((w << 1) - 64); \
1085 YP1 += 64; \
1086 YP2 += 64; \
1087 } \
1088 }
1089
1090 /* One macro block is 32 lines of Y and 16 lines of UV */
1091 const int offset_value[2] = { 0, 64 * 16 };
1092 int mb_x, mb_y, mb_w, mb_h;
1093 int base_h;
1094 int uv_x, uv_y, uv_step;
1095 int stride;
1096
1097 /* Idea iterate over each macroblock and convert each of them using _evas_nv12torgb_raster */
1098
1099 /* The layout of the Y macroblock order in RGB non tiled space : */
1100 /* --------------------------------------------------- */
1101 /* | 0 | 1 | 6 | 7 | 8 | 9 | 14 | 15 | 16 | 17 | */
1102 /* --------------------------------------------------- */
1103 /* | 2 | 3 | 4 | 5 | 10 | 11 | 12 | 13 | 18 | 19 | */
1104 /* --------------------------------------------------- */
1105 /* | 20 | 21 | 26 | 27 | 28 | 29 | 34 | 35 | 36 | 37 | */
1106 /* --------------------------------------------------- */
1107 /* | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 38 | 39 | */
1108 /* --------------------------------------------------- */
1109 /* | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | */
1110 /* --------------------------------------------------- */
1111 /* The layout of the UV macroblock order in the same RGB non tiled space : */
1112 /* --------------------------------------------------- */
1113 /* | | | | | | | | | | | */
1114 /* - 0 - 1 - 6 - 7 - 8 - 9 - 14 - 15 - 16 - 17 - */
1115 /* | | | | | | | | | | | */
1116 /* --------------------------------------------------- */
1117 /* | | | | | | | | | | | */
1118 /* - 2 - 3 - 4 - 5 - 10 - 11 - 12 - 13 - 18 - 19 - */
1119 /* | | | | | | | | | | | */
1120 /* --------------------------------------------------- */
1121 /* | | | | | | | | | | | */
1122 /* - 20 - 21 - 22 - 22 - 23 - 24 - 25 - 26 - 27 - 28 - */
1123
1124 /* the number of macroblock should be a multiple of 64x32 */
1125 mb_w = w / 64;
1126 mb_h = h / 32;
1127
1128 base_h = (mb_h >> 1) + (mb_h & 0x1);
1129 stride = w * sizeof (int);
1130
1131 uv_x = 0; uv_y = 0;
1132
1133 /* In this format we linearize macroblock on two line to form a Z and it's invert */
1134 for (mb_y = 0; mb_y < (mb_h >> 1); mb_y++)
1135 {
1136 int step = 2;
1137 int offset = 0;
1138 int x = 0;
1139 int rmb_x = 0;
1140 int ry[2];
1141
1142 ry[0] = mb_y * 2 * 32 * stride;
1143 ry[1] = ry[0] + 32 * stride;
1144
1145 uv_step = (mb_y & 0x1) == 0 ? 4 : 0;
1146 uv_x = (mb_y & 0x1) == 0 ? 0 : 2 * 64 * 32;
1147
1148 for (mb_x = 0; mb_x < mb_w * 2; mb_x++, rmb_x += 64 * 32)
1149 {
1150 unsigned char *yp1, *yp2, *up, *vp;
1151 unsigned char *dp1, *dp2;
1152
1153 dp1 = rgb + x + ry[offset];
1154 dp2 = dp1 + stride;
1155
1156 yp1 = yuv[mb_y] + rmb_x;
1157 yp2 = yp1 + 64;
1158
1159 /* UV plane is two time less bigger in pixel count, but it old two bytes each times */
1160 up = yuv[(mb_y >> 1) + base_h] + uv_x + offset_value[offset];
1161 vp = up + 1;
1162
1163 HANDLE_MACROBLOCK(yp1, yp2, up, vp, dp1, dp2);
1164
1165 step++;
1166 if ((step & 0x3) == 0)
1167 {
1168 offset = 1 - offset;
1169 x -= 64 * sizeof (int);
1170 uv_x -= 64 * 32;
1171 }
1172 else
1173 {
1174 x += 64 * sizeof (int);
1175 uv_x += 64 * 32;
1176 }
1177
1178 uv_step++;
1179 if (uv_step == 8)
1180 {
1181 uv_step = 0;
1182 uv_x += 4 * 64 * 32;
1183 }
1184 }
1185 }
1186
1187 if (mb_h & 0x1)
1188 {
1189 int x = 0;
1190 int ry;
1191
1192 ry = mb_y << 1;
1193
1194 uv_step = 0;
1195 uv_x = 0;
1196
1197 for (mb_x = 0; mb_x < mb_w; mb_x++, x++, uv_x++)
1198 {
1199 unsigned char *yp1, *yp2, *up, *vp;
1200 unsigned char *dp1, *dp2;
1201
1202 dp1 = rgb + (x * 64 + (ry * 32 * w)) * sizeof (int);
1203 dp2 = dp1 + sizeof (int) * w;
1204
1205 yp1 = yuv[mb_y] + mb_x * 64 * 32;
1206 yp2 = yp1 + 64;
1207
1208 up = yuv[mb_y / 2 + base_h] + uv_x * 64 * 32;
1209 vp = up + 1;
1210
1211 HANDLE_MACROBLOCK(yp1, yp2, up, vp, dp1, dp2);
1212 }
1213 }
1214#endif
1215}
1216
1217static void
1218_evas_nv12torgb_raster(unsigned char **yuv, unsigned char *rgb, int w, int h)
1219{
1220#ifdef BUILD_C
1221 int xx, yy;
1222 unsigned char *yp1, *yp2, *up, *vp;
1223 unsigned char *dp1;
1224 unsigned char *dp2;
1225
1226 dp1 = rgb;
1227 dp2 = dp1 + sizeof (int) * w;
1228
1229 for (yy = 0; yy < h; yy++)
1230 {
1231 yp1 = yuv[yy++];
1232 yp2 = yuv[yy];
1233
1234 up = yuv[h + (yy >> 1)];
1235 vp = up + 1;
1236
1237 for (xx = 0; xx < w; xx += 2)
1238 {
1239 _evas_yuv2rgb_420_raster(yp1, yp2, up, vp, dp1, dp2);
1240
1241 /* the previous call just rendered 2 pixels per lines */
1242 dp1 += 8; dp2 += 8;
1243
1244 /* and took for that 2 lines with 2 Y, 1 U and 1 V. Don't forget U & V are in the same plane */
1245 yp1 += 2; yp2 += 2; up += 2; vp += 2;
1246 }
1247
1248 /* jump one line */
1249 dp1 += sizeof (int) * w;
1250 dp2 += sizeof (int) * w;
1251 yp1 += w;
1252 yp2 += w;
1253 }
1254#endif
1255}
1256
1257#endif
1258
diff --git a/libraries/evas/src/lib/engines/common/evas_convert_yuv.h b/libraries/evas/src/lib/engines/common/evas_convert_yuv.h
new file mode 100644
index 0000000..b598807
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_convert_yuv.h
@@ -0,0 +1,9 @@
1#ifndef _EVAS_CONVERT_YUV_H
2#define _EVAS_CONVERT_YUV_H
3
4EAPI void evas_common_convert_yuv_420p_601_rgba (DATA8 **src, DATA8 *dst, int w, int h);
5EAPI void evas_common_convert_yuv_422_601_rgba (DATA8 **src, DATA8 *dst, int w, int h);
6EAPI void evas_common_convert_yuv_420_601_rgba (DATA8 **src, DATA8 *dst, int w, int h);
7EAPI void evas_common_convert_yuv_420T_601_rgba (DATA8 **src, DATA8 *dst, int w, int h);
8
9#endif /* _EVAS_CONVERT_YUV_H */
diff --git a/libraries/evas/src/lib/engines/common/evas_cpu.c b/libraries/evas/src/lib/engines/common/evas_cpu.c
new file mode 100644
index 0000000..cff8b2b
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_cpu.c
@@ -0,0 +1,270 @@
1#include "evas_common.h"
2#if defined BUILD_MMX || defined BUILD_SSE
3#include "evas_mmx.h"
4#endif
5
6#if defined BUILD_SSE3
7#include <immintrin.h>
8#endif
9
10#if defined (HAVE_STRUCT_SIGACTION) && defined (HAVE_SIGLONGJMP)
11#include <signal.h>
12#include <setjmp.h>
13#include <errno.h>
14
15static sigjmp_buf detect_buf;
16#endif
17
18static int cpu_feature_mask = 0;
19
20#if defined (HAVE_STRUCT_SIGACTION) && defined (HAVE_SIGLONGJMP)
21static void evas_common_cpu_catch_ill(int sig);
22static void evas_common_cpu_catch_segv(int sig);
23
24static void
25evas_common_cpu_catch_ill(int sig __UNUSED__)
26{
27 siglongjmp(detect_buf, 1);
28}
29
30static void
31evas_common_cpu_catch_segv(int sig __UNUSED__)
32{
33 siglongjmp(detect_buf, 1);
34}
35#endif
36
37void
38evas_common_cpu_mmx_test(void)
39{
40#ifdef BUILD_MMX
41 pxor_r2r(mm4, mm4);
42#endif
43}
44
45void
46evas_common_cpu_mmx2_test(void)
47{
48#ifdef BUILD_MMX
49 char data[16];
50
51 data[0] = 0;
52 mmx_r2m(movntq, mm0, data);
53 data[0] = 0;
54#endif
55}
56
57void
58evas_common_cpu_sse_test(void)
59{
60#ifdef BUILD_SSE
61 int blah[16];
62
63 movntq_r2m(mm0, blah);
64#endif
65}
66
67void evas_common_op_sse3_test(void);
68
69void
70evas_common_cpu_sse3_test(void)
71{
72#ifdef BUILD_SSE3
73 evas_common_op_sse3_test();
74#endif
75}
76
77void
78evas_common_cpu_altivec_test(void)
79{
80#ifdef __POWERPC__
81#ifdef __VEC__
82 vector unsigned int zero;
83
84 zero = vec_splat_u32(0);
85#endif /* __VEC__ */
86#endif /* __POWERPC__ */
87}
88
89void
90evas_common_cpu_neon_test(void)
91{
92//#if defined(__ARM_ARCH__) && (__ARM_ARCH__ >= 70)
93#ifdef BUILD_NEON
94 asm volatile (
95 ".fpu neon \n\t"
96 "vqadd.u8 d0, d1, d0\n"
97 : /* Out */
98 : /* In */
99 : /* Clobbered */
100 "d0", "d1"
101 );
102#endif
103//#endif
104}
105
106void
107evas_common_cpu_vis_test(void)
108{
109#ifdef __SPARC__
110#endif /* __SPARC__ */
111}
112
113int
114evas_common_cpu_feature_test(void (*feature)(void))
115{
116#if defined (HAVE_STRUCT_SIGACTION) && defined (HAVE_SIGLONGJMP)
117 int enabled = 1;
118 struct sigaction act, oact, oact2;
119
120 act.sa_handler = evas_common_cpu_catch_ill;
121 act.sa_flags = SA_RESTART;
122 sigemptyset(&act.sa_mask);
123 sigaction(SIGILL, &act, &oact);
124
125 act.sa_handler = evas_common_cpu_catch_segv;
126 act.sa_flags = SA_RESTART;
127 sigemptyset(&act.sa_mask);
128 sigaction(SIGSEGV, &act, &oact2);
129
130 if (sigsetjmp(detect_buf, 1))
131 {
132 sigaction(SIGILL, &oact, NULL);
133 sigaction(SIGSEGV, &oact2, NULL);
134 return 0;
135 }
136
137 feature();
138
139 sigaction(SIGILL, &oact, NULL);
140 sigaction(SIGSEGV, &oact2, NULL);
141 return enabled;
142#else
143 return 0;
144#endif
145}
146
147EAPI void
148evas_common_cpu_init(void)
149{
150 static int called = 0;
151
152 if (called) return;
153 called = 1;
154#ifdef BUILD_MMX
155 cpu_feature_mask |= CPU_FEATURE_MMX *
156 evas_common_cpu_feature_test(evas_common_cpu_mmx_test);
157 evas_common_cpu_end_opt();
158 if (getenv("EVAS_CPU_NO_MMX"))
159 cpu_feature_mask &= ~CPU_FEATURE_MMX;
160 cpu_feature_mask |= CPU_FEATURE_MMX2 *
161 evas_common_cpu_feature_test(evas_common_cpu_mmx2_test);
162 evas_common_cpu_end_opt();
163 if (getenv("EVAS_CPU_NO_MMX2"))
164 cpu_feature_mask &= ~CPU_FEATURE_MMX2;
165#ifdef BUILD_SSE
166 cpu_feature_mask |= CPU_FEATURE_SSE *
167 evas_common_cpu_feature_test(evas_common_cpu_sse_test);
168 evas_common_cpu_end_opt();
169 if (getenv("EVAS_CPU_NO_SSE"))
170 cpu_feature_mask &= ~CPU_FEATURE_SSE;
171#ifdef BUILD_SSE3
172 cpu_feature_mask |= CPU_FEATURE_SSE3 *
173 evas_common_cpu_feature_test(evas_common_cpu_sse3_test);
174 evas_common_cpu_end_opt();
175 if (getenv("EVAS_CPU_NO_SSE3"))
176 cpu_feature_mask &= ~CPU_FEATURE_SSE3;
177#endif /* BUILD_SSE3 */
178#endif /* BUILD_SSE */
179#endif /* BUILD_MMX */
180#ifdef __POWERPC__
181#ifdef __VEC__
182 cpu_feature_mask |= CPU_FEATURE_ALTIVEC *
183 evas_common_cpu_feature_test(evas_common_cpu_altivec_test);
184 evas_common_cpu_end_opt();
185 if (getenv("EVAS_CPU_NO_ALTIVEC"))
186 cpu_feature_mask &= ~CPU_FEATURE_ALTIVEC;
187#endif /* __VEC__ */
188#endif /* __POWERPC__ */
189#ifdef __SPARC__
190 cpu_feature_mask |= CPU_FEATURE_VIS *
191 evas_common_cpu_feature_test(evas_common_cpu_vis_test);
192 evas_common_cpu_end_opt();
193 if (getenv("EVAS_CPU_NO_VIS"))
194 cpu_feature_mask &= ~CPU_FEATURE_VIS;
195#endif /* __SPARC__ */
196#if defined(__ARM_ARCH__)
197#ifdef BUILD_NEON
198 cpu_feature_mask |= CPU_FEATURE_NEON *
199 evas_common_cpu_feature_test(evas_common_cpu_neon_test);
200 evas_common_cpu_end_opt();
201 if (getenv("EVAS_CPU_NO_NEON"))
202 cpu_feature_mask &= ~CPU_FEATURE_NEON;
203#endif
204#endif
205}
206
207int
208evas_common_cpu_has_feature(unsigned int feature)
209{
210 return (cpu_feature_mask & feature);
211}
212
213int
214evas_common_cpu_have_cpuid(void)
215{
216 return 0;
217/*
218#ifdef BUILD_MMX
219 unsigned int have_cpu_id;
220
221 have_cpu_id = 0;
222 have_cpuid(have_cpu_id);
223 return have_cpu_id;
224#else
225 return 0;
226#endif
227 */
228}
229
230EAPI void
231evas_common_cpu_can_do(int *mmx, int *sse, int *sse2)
232{
233 static int do_mmx = 0, do_sse = 0, do_sse2 = 0, done = 0;
234
235 if (!done)
236 {
237# ifdef HARD_CODED_P3
238 cpu_feature_mask |= CPU_FEATURE_MMX;
239 cpu_feature_mask |= CPU_FEATURE_SSE;
240#endif
241#ifdef HARD_CODED_P2
242 cpu_feature_mask |= CPU_FEATURE_MMX;
243#endif
244 if (cpu_feature_mask & CPU_FEATURE_MMX) do_mmx = 1;
245 if (cpu_feature_mask & CPU_FEATURE_MMX2) do_sse = 1;
246 if (cpu_feature_mask & CPU_FEATURE_SSE) do_sse = 1;
247 }
248// INF("%i %i %i", do_mmx, do_sse, do_sse2);
249 *mmx = do_mmx;
250 *sse = do_sse;
251 *sse2 = do_sse2;
252 done = 1;
253}
254
255#ifdef BUILD_MMX
256EAPI void
257evas_common_cpu_end_opt(void)
258{
259 if (cpu_feature_mask &
260 (CPU_FEATURE_MMX | CPU_FEATURE_MMX2))
261 {
262 emms();
263 }
264}
265#else
266EAPI void
267evas_common_cpu_end_opt(void)
268{
269}
270#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_draw.h b/libraries/evas/src/lib/engines/common/evas_draw.h
new file mode 100644
index 0000000..34e0ed3
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_draw.h
@@ -0,0 +1,36 @@
1#ifndef _EVAS_DRAW_H
2#define _EVAS_DRAW_H
3
4
5EAPI void evas_common_draw_init (void);
6
7EAPI RGBA_Draw_Context *evas_common_draw_context_new (void);
8EAPI void evas_common_draw_context_free (RGBA_Draw_Context *dc);
9EAPI void evas_common_draw_context_font_ext_set (RGBA_Draw_Context *dc,
10 void *data,
11 void *(*gl_new) (void *data, RGBA_Font_Glyph *fg),
12 void (*gl_free) (void *ext_dat),
13 void (*gl_draw) (void *data, void *dest, void *context, RGBA_Font_Glyph *fg, int x, int y));
14EAPI void evas_common_draw_context_clip_clip (RGBA_Draw_Context *dc, int x, int y, int w, int h);
15EAPI void evas_common_draw_context_set_clip (RGBA_Draw_Context *dc, int x, int y, int w, int h);
16EAPI void evas_common_draw_context_unset_clip (RGBA_Draw_Context *dc);
17EAPI void evas_common_draw_context_set_color (RGBA_Draw_Context *dc, int r, int g, int b, int a);
18EAPI void evas_common_draw_context_set_multiplier (RGBA_Draw_Context *dc, int r, int g, int b, int a);
19EAPI void evas_common_draw_context_unset_multiplier (RGBA_Draw_Context *dc);
20EAPI void evas_common_draw_context_set_mask (RGBA_Draw_Context *dc, RGBA_Image *im, int x, int y, int w, int h);
21EAPI void evas_common_draw_context_unset_mask (RGBA_Draw_Context *dc);
22EAPI Cutout_Rects *evas_common_draw_context_cutouts_new (void);
23EAPI void evas_common_draw_context_cutouts_free (Cutout_Rects* rects);
24EAPI void evas_common_draw_context_cutouts_del (Cutout_Rects* rects, int idx);
25EAPI void evas_common_draw_context_add_cutout (RGBA_Draw_Context *dc, int x, int y, int w, int h);
26EAPI void evas_common_draw_context_clear_cutouts (RGBA_Draw_Context *dc);
27EAPI Cutout_Rects *evas_common_draw_context_apply_cutouts (RGBA_Draw_Context *dc);
28EAPI void evas_common_draw_context_apply_clear_cutouts (Cutout_Rects* rects);
29EAPI void evas_common_draw_context_apply_clean_cutouts (Cutout_Rects* rects);
30EAPI void evas_common_draw_context_set_anti_alias (RGBA_Draw_Context *dc, unsigned char aa);
31EAPI void evas_common_draw_context_set_color_interpolation (RGBA_Draw_Context *dc, int color_space);
32EAPI void evas_common_draw_context_set_render_op (RGBA_Draw_Context *dc, int op);
33EAPI void evas_common_draw_context_set_sli (RGBA_Draw_Context *dc, int y, int h);
34
35
36#endif /* _EVAS_DRAW_H */
diff --git a/libraries/evas/src/lib/engines/common/evas_draw_main.c b/libraries/evas/src/lib/engines/common/evas_draw_main.c
new file mode 100644
index 0000000..7652708
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_draw_main.c
@@ -0,0 +1,576 @@
1#include "evas_common.h"
2#include "evas_convert_main.h"
3#include "evas_private.h"
4
5EAPI Cutout_Rects*
6evas_common_draw_context_cutouts_new(void)
7{
8 Cutout_Rects *rects;
9
10 rects = calloc(1, sizeof(Cutout_Rects));
11 return rects;
12}
13
14EAPI void
15evas_common_draw_context_cutouts_free(Cutout_Rects* rects)
16{
17 rects->active = 0;
18}
19
20EAPI void
21evas_common_draw_context_cutouts_del(Cutout_Rects* rects, int idx)
22{
23 if ((idx >= 0) && (idx < rects->active))
24 {
25 Cutout_Rect *rect;
26
27 rect = rects->rects + idx;
28 memmove(rect, rect + 1,
29 sizeof(Cutout_Rect) * (rects->active - idx - 1));
30 rects->active--;
31 }
32}
33
34void
35evas_common_init(void)
36{
37 evas_common_cpu_init();
38
39 evas_common_blend_init();
40 evas_common_image_init();
41 evas_common_convert_init();
42 evas_common_scale_init();
43 evas_common_rectangle_init();
44 evas_common_polygon_init();
45 evas_common_line_init();
46 evas_common_font_init();
47 evas_common_draw_init();
48 evas_common_tilebuf_init();
49}
50
51void
52evas_common_shutdown(void)
53{
54 evas_font_dir_cache_free();
55 evas_common_image_cache_free();
56}
57
58EAPI void
59evas_common_draw_init(void)
60{
61}
62
63EAPI RGBA_Draw_Context *
64evas_common_draw_context_new(void)
65{
66 RGBA_Draw_Context *dc;
67
68 dc = calloc(1, sizeof(RGBA_Draw_Context));
69 dc->sli.h = 1;
70 return dc;
71}
72
73EAPI void
74evas_common_draw_context_free(RGBA_Draw_Context *dc)
75{
76 if (!dc) return;
77
78 evas_common_draw_context_apply_clean_cutouts(&dc->cutout);
79 free(dc);
80}
81
82EAPI void
83evas_common_draw_context_clear_cutouts(RGBA_Draw_Context *dc)
84{
85 evas_common_draw_context_apply_clean_cutouts(&dc->cutout);
86}
87
88EAPI void
89evas_common_draw_context_font_ext_set(RGBA_Draw_Context *dc,
90 void *data,
91 void *(*gl_new) (void *data, RGBA_Font_Glyph *fg),
92 void (*gl_free) (void *ext_dat),
93 void (*gl_draw) (void *data, void *dest, void *context, RGBA_Font_Glyph *fg, int x, int y))
94{
95 dc->font_ext.data = data;
96 dc->font_ext.func.gl_new = gl_new;
97 dc->font_ext.func.gl_free = gl_free;
98 dc->font_ext.func.gl_draw = gl_draw;
99}
100
101EAPI void
102evas_common_draw_context_clip_clip(RGBA_Draw_Context *dc, int x, int y, int w, int h)
103{
104 if (dc->clip.use)
105 {
106 RECTS_CLIP_TO_RECT(dc->clip.x, dc->clip.y, dc->clip.w, dc->clip.h,
107 x, y, w, h);
108 }
109 else
110 evas_common_draw_context_set_clip(dc, x, y, w, h);
111}
112
113EAPI void
114evas_common_draw_context_set_clip(RGBA_Draw_Context *dc, int x, int y, int w, int h)
115{
116 dc->clip.use = 1;
117 dc->clip.x = x;
118 dc->clip.y = y;
119 dc->clip.w = w;
120 dc->clip.h = h;
121}
122
123EAPI void
124evas_common_draw_context_unset_clip(RGBA_Draw_Context *dc)
125{
126 dc->clip.use = 0;
127}
128
129EAPI void
130evas_common_draw_context_set_color(RGBA_Draw_Context *dc, int r, int g, int b, int a)
131{
132 R_VAL(&(dc->col.col)) = (DATA8)r;
133 G_VAL(&(dc->col.col)) = (DATA8)g;
134 B_VAL(&(dc->col.col)) = (DATA8)b;
135 A_VAL(&(dc->col.col)) = (DATA8)a;
136}
137
138EAPI void
139evas_common_draw_context_set_multiplier(RGBA_Draw_Context *dc, int r, int g, int b, int a)
140{
141 dc->mul.use = 1;
142 R_VAL(&(dc->mul.col)) = (DATA8)r;
143 G_VAL(&(dc->mul.col)) = (DATA8)g;
144 B_VAL(&(dc->mul.col)) = (DATA8)b;
145 A_VAL(&(dc->mul.col)) = (DATA8)a;
146}
147
148EAPI void
149evas_common_draw_context_unset_multiplier(RGBA_Draw_Context *dc)
150{
151 dc->mul.use = 0;
152}
153
154EAPI void
155evas_common_draw_context_set_mask(RGBA_Draw_Context *dc, RGBA_Image *mask, int x, int y, int w, int h)
156{
157 dc->mask.mask = mask;
158 dc->mask.x = x;
159 dc->mask.y = y;
160 dc->mask.w = w;
161 dc->mask.h = h;
162}
163
164EAPI void
165evas_common_draw_context_unset_mask(RGBA_Draw_Context *dc)
166{
167 dc->mask.mask = NULL;
168}
169
170
171
172
173
174EAPI void
175evas_common_draw_context_add_cutout(RGBA_Draw_Context *dc, int x, int y, int w, int h)
176{
177// if (dc->cutout.rects > 512) return;
178 if (dc->clip.use)
179 {
180#if 1 // this is a bit faster
181 int xa1, xa2, xb1, xb2;
182
183 xa1 = x;
184 xa2 = xa1 + w - 1;
185 xb1 = dc->clip.x;
186 if (xa2 < xb1) return;
187 xb2 = xb1 + dc->clip.w - 1;
188 if (xa1 >= xb2) return;
189 if (xa2 > xb2) xa2 = xb2;
190 if (xb1 > xa1) xa1 = xb1;
191 x = xa1;
192 w = xa2 - xa1 + 1;
193
194 xa1 = y;
195 xa2 = xa1 + h - 1;
196 xb1 = dc->clip.y;
197 if (xa2 < xb1) return;
198 xb2 = xb1 + dc->clip.h - 1;
199 if (xa1 >= xb2) return;
200 if (xa2 > xb2) xa2 = xb2;
201 if (xb1 > xa1) xa1 = xb1;
202 y = xa1;
203 h = xa2 - xa1 + 1;
204#else
205 RECTS_CLIP_TO_RECT(x, y, w, h,
206 dc->clip.x, dc->clip.y, dc->clip.w, dc->clip.h);
207#endif
208 if ((w < 1) || (h < 1)) return;
209 }
210 evas_common_draw_context_cutouts_add(&dc->cutout, x, y, w, h);
211}
212
213int
214evas_common_draw_context_cutout_split(Cutout_Rects* res, int idx, Cutout_Rect *split)
215{
216 /* 1 input rect, multiple out */
217 Cutout_Rect in = res->rects[idx];
218
219 /* this is to save me a LOT of typing */
220#define INX1 (in.x)
221#define INX2 (in.x + in.w)
222#define SPX1 (split->x)
223#define SPX2 (split->x + split->w)
224#define INY1 (in.y)
225#define INY2 (in.y + in.h)
226#define SPY1 (split->y)
227#define SPY2 (split->y + split->h)
228#define X1_IN (in.x < split->x)
229#define X2_IN ((in.x + in.w) > (split->x + split->w))
230#define Y1_IN (in.y < split->y)
231#define Y2_IN ((in.y + in.h) > (split->y + split->h))
232#define R_NEW(_r, _x, _y, _w, _h) { evas_common_draw_context_cutouts_add(_r, _x, _y, _w, _h); }
233 if (!RECTS_INTERSECT(in.x, in.y, in.w, in.h,
234 split->x, split->y, split->w, split->h))
235 {
236 /* No colision => no clipping, don't touch it. */
237 return 1;
238 }
239
240 /* S = split (ie cut out rect) */
241 /* +--+ = in (rect to be cut) */
242
243 /*
244 * +---+
245 * | |
246 * | S |
247 * | |
248 * +---+
249 *
250 */
251 if (X1_IN && X2_IN && Y1_IN && Y2_IN)
252 {
253 R_NEW(res, in.x, in.y, in.w, SPY1 - in.y);
254 R_NEW(res, in.x, SPY1, SPX1 - in.x, SPY2 - SPY1);
255 R_NEW(res, SPX2, SPY1, INX2 - SPX2, SPY2 - SPY1);
256 /* out => (in.x, SPY2, in.w, INY2 - SPY2) */
257 res->rects[idx].h = INY2 - SPY2;
258 res->rects[idx].y = SPY2;
259 return 1;
260 }
261 /* SSSSSSS
262 * S+---+S
263 * S|SSS|S
264 * S|SSS|S
265 * S|SSS|S
266 * S+---+S
267 * SSSSSSS
268 */
269 if (!X1_IN && !X2_IN && !Y1_IN && !Y2_IN)
270 {
271 evas_common_draw_context_cutouts_del(res, idx);
272 return 0;
273 }
274 /* SSS
275 * S+---+
276 * S|S |
277 * S|S |
278 * S|S |
279 * S+---+
280 * SSS
281 */
282 if (!X1_IN && X2_IN && !Y1_IN && !Y2_IN)
283 {
284 /* in => (SPX2, in.y, INX2 - SPX2, in.h) */
285 res->rects[idx].w = INX2 - SPX2;
286 res->rects[idx].x = SPX2;
287 return 1;
288 }
289 /* S
290 * +---+
291 * | S |
292 * | S |
293 * | S |
294 * +---+
295 * S
296 */
297 if (X1_IN && X2_IN && !Y1_IN && !Y2_IN)
298 {
299 R_NEW(res, in.x, in.y, SPX1 - in.x, in.h);
300 /* in => (SPX2, in.y, INX2 - SPX2, in.h) */
301 res->rects[idx].w = INX2 - SPX2;
302 res->rects[idx].x = SPX2;
303 return 1;
304 }
305 /* SSS
306 * +---+S
307 * | S|S
308 * | S|S
309 * | S|S
310 * +---+S
311 * SSS
312 */
313 if (X1_IN && !X2_IN && !Y1_IN && !Y2_IN)
314 {
315 /* in => (in.x, in.y, SPX1 - in.x, in.h) */
316 res->rects[idx].w = SPX1 - in.x;
317 return 1;
318 }
319 /* SSSSSSS
320 * S+---+S
321 * S|SSS|S
322 * | |
323 * | |
324 * +---+
325 *
326 */
327 if (!X1_IN && !X2_IN && !Y1_IN && Y2_IN)
328 {
329 /* in => (in.x, SPY2, in.w, INY2 - SPY2) */
330 res->rects[idx].h = INY2 - SPY2;
331 res->rects[idx].y = SPY2;
332 return 1;
333 }
334 /*
335 * +---+
336 * | |
337 * S|SSS|S
338 * | |
339 * +---+
340 *
341 */
342 if (!X1_IN && !X2_IN && Y1_IN && Y2_IN)
343 {
344 R_NEW(res, in.x, SPY2, in.w, INY2 - SPY2);
345 /* in => (in.x, in.y, in.w, SPY1 - in.y) */
346 res->rects[idx].h = SPY1 - in.y;
347 return 1;
348 }
349 /*
350 * +---+
351 * | |
352 * | |
353 * S|SSS|S
354 * S+---+S
355 * SSSSSSS
356 */
357 if (!X1_IN && !X2_IN && Y1_IN && !Y2_IN)
358 {
359 /* in => (in.x, in.y, in.w, SPY1 - in.y) */
360 res->rects[idx].h = SPY1 - in.y;
361 return 1;
362 }
363 /* SSS
364 * S+---+
365 * S|S |
366 * | |
367 * | |
368 * +---+
369 *
370 */
371 if (!X1_IN && X2_IN && !Y1_IN && Y2_IN)
372 {
373 R_NEW(res, SPX2, in.y, INX2 - SPX2, SPY2 - in.y);
374 /* in => (in.x, SPY2, in.w, INY2 - SPY2) */
375 res->rects[idx].h = INY2 - SPY2;
376 res->rects[idx].y = SPY2;
377 return 1;
378 }
379 /* S
380 * +---+
381 * | S |
382 * | |
383 * | |
384 * +---+
385 *
386 */
387 if (X1_IN && X2_IN && !Y1_IN && Y2_IN)
388 {
389 R_NEW(res, in.x, in.y, SPX1 - in.x, SPY2 - in.y);
390 R_NEW(res, SPX2, in.y, INX2 - SPX2, SPY2 - in.y);
391 /* in => (in.x, SPY2, in.w, INY2 - SPY2) */
392 res->rects[idx].h = INY2 - SPY2;
393 res->rects[idx].y = SPY2;
394 return 1;
395 }
396 /* SSS
397 * +---+S
398 * | S|S
399 * | |
400 * | |
401 * +---+
402 *
403 */
404 if (X1_IN && !X2_IN && !Y1_IN && Y2_IN)
405 {
406 R_NEW(res, in.x, in.y, SPX1 - in.x, SPY2 - in.y);
407 /* in => (in.x, SPY2, in.w, INY2 - SPY2) */
408 res->rects[idx].h = INY2 - SPY2;
409 res->rects[idx].y = SPY2;
410 return 1;
411 }
412 /*
413 * +---+
414 * | |
415 * S|S |
416 * | |
417 * +---+
418 *
419 */
420 if (!X1_IN && X2_IN && Y1_IN && Y2_IN)
421 {
422 R_NEW(res, in.x, SPY2, in.w, INY2 - SPY2);
423 R_NEW(res, SPX2, SPY1, INX2 - SPX2, SPY2 - SPY1);
424 /* in => (in.x, SPY2, in.w, INY2 - SPY2) */
425 res->rects[idx].h = SPY1 - in.y;
426 return 1;
427 }
428 /*
429 * +---+
430 * | |
431 * | S|S
432 * | |
433 * +---+
434 *
435 */
436 if (X1_IN && !X2_IN && Y1_IN && Y2_IN)
437 {
438 R_NEW(res, in.x, SPY2, in.w, INY2 - SPY2);
439 R_NEW(res, in.x, SPY1, SPX1 - in.x, SPY2 - SPY1);
440 /* in => (in.x, in.y, in.w, SPY1 - in.y) */
441 res->rects[idx].h = SPY1 - in.y;
442 return 1;
443 }
444 /*
445 * +---+
446 * | |
447 * | |
448 * S|S |
449 * S+---+
450 * SSS
451 */
452 if (!X1_IN && X2_IN && Y1_IN && !Y2_IN)
453 {
454 R_NEW(res, SPX2, SPY1, INX2 - SPX2, INY2 - SPY1);
455 /* in => (in.x, in.y, in.w, SPY1 - in.y) */
456 res->rects[idx].h = SPY1 - in.y;
457 return 1;
458 }
459 /*
460 * +---+
461 * | |
462 * | |
463 * | S |
464 * +---+
465 * S
466 */
467 if (X1_IN && X2_IN && Y1_IN && !Y2_IN)
468 {
469 R_NEW(res, in.x, SPY1, SPX1 - in.x, INY2 - SPY1);
470 R_NEW(res, SPX2, SPY1, INX2 - SPX2, INY2 - SPY1);
471 /* in => (in.x, in.y, in.w, SPY1 - in.y) */
472 res->rects[idx].h = SPY1 - in.y;
473 return 1;
474 }
475 /*
476 * +---+
477 * | |
478 * | |
479 * | S|S
480 * +---+S
481 * SSS
482 */
483 if (X1_IN && !X2_IN && Y1_IN && !Y2_IN)
484 {
485 R_NEW(res, in.x, SPY1, SPX1 - in.x, INY2 - SPY1);
486 /* in => (in.x, in.y, in.w, SPY1 - in.y) */
487 res->rects[idx].h = SPY1 - in.y;
488 return 1;
489 }
490 evas_common_draw_context_cutouts_del(res, idx);
491 return 0;
492#undef INX1
493#undef INX2
494#undef SPX1
495#undef SPX2
496#undef INY1
497#undef INY2
498#undef SPY1
499#undef SPY2
500#undef X1_IN
501#undef X2_IN
502#undef Y1_IN
503#undef Y2_IN
504#undef R_NEW
505}
506
507EAPI Cutout_Rects*
508evas_common_draw_context_apply_cutouts(RGBA_Draw_Context *dc)
509{
510 Cutout_Rects* res;
511 int i;
512 int j;
513
514 if (!dc->clip.use) return NULL;
515 if ((dc->clip.w <= 0) || (dc->clip.h <= 0)) return NULL;
516
517
518 res = evas_common_draw_context_cutouts_new();
519 evas_common_draw_context_cutouts_add(res, dc->clip.x, dc->clip.y, dc->clip.w, dc->clip.h);
520
521 for (i = 0; i < dc->cutout.active; ++i)
522 {
523 /* Don't loop on the element just added to the list as they are already correctly clipped. */
524 int active = res->active;
525
526 for (j = 0; j < active; )
527 {
528 if (evas_common_draw_context_cutout_split(res, j, dc->cutout.rects + i))
529 ++j;
530 else
531 active--;
532 }
533 }
534 return res;
535}
536
537EAPI void
538evas_common_draw_context_apply_clear_cutouts(Cutout_Rects* rects)
539{
540 evas_common_draw_context_apply_clean_cutouts(rects);
541 free(rects);
542}
543
544EAPI void
545evas_common_draw_context_apply_clean_cutouts(Cutout_Rects* rects)
546{
547 free(rects->rects);
548 rects->rects = NULL;
549 rects->active = 0;
550 rects->max = 0;
551}
552
553EAPI void
554evas_common_draw_context_set_anti_alias(RGBA_Draw_Context *dc , unsigned char aa)
555{
556 dc->anti_alias = !!aa;
557}
558
559EAPI void
560evas_common_draw_context_set_color_interpolation(RGBA_Draw_Context *dc, int color_space)
561{
562 dc->interpolation.color_space = color_space;
563}
564
565EAPI void
566evas_common_draw_context_set_render_op(RGBA_Draw_Context *dc , int op)
567{
568 dc->render_op = op;
569}
570
571EAPI void
572evas_common_draw_context_set_sli(RGBA_Draw_Context *dc, int y, int h)
573{
574 dc->sli.y = y;
575 dc->sli.h = h;
576}
diff --git a/libraries/evas/src/lib/engines/common/evas_font.h b/libraries/evas/src/lib/engines/common/evas_font.h
new file mode 100644
index 0000000..533d897
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_font.h
@@ -0,0 +1,76 @@
1#ifndef _EVAS_FONT_H
2#define _EVAS_FONT_H
3#include "evas_text_utils.h"
4
5
6/* main */
7
8EAPI void evas_common_font_init (void);
9EAPI void evas_common_font_shutdown (void);
10EAPI void evas_common_font_font_all_unload (void);
11
12EAPI int evas_common_font_ascent_get (RGBA_Font *fn);
13EAPI int evas_common_font_descent_get (RGBA_Font *fn);
14EAPI int evas_common_font_max_ascent_get (RGBA_Font *fn);
15EAPI int evas_common_font_max_descent_get (RGBA_Font *fn);
16EAPI int evas_common_font_get_line_advance (RGBA_Font *fn);
17
18/* draw */
19
20EAPI void evas_common_font_draw (RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Font *fn, int x, int y, const Evas_Text_Props *intl_props);
21EAPI int evas_common_font_glyph_search (RGBA_Font *fn, RGBA_Font_Int **fi_ret, Eina_Unicode gl);
22EAPI RGBA_Font_Glyph *evas_common_font_int_cache_glyph_get (RGBA_Font_Int *fi, FT_UInt index);
23EAPI FT_UInt evas_common_get_char_index (RGBA_Font_Int* fi, Eina_Unicode gl);
24EAPI void evas_common_font_draw_init (void);
25
26/* load */
27EAPI void evas_common_font_dpi_set (int dpi);
28EAPI RGBA_Font_Source *evas_common_font_source_memory_load (const char *name, const void *data, int data_size);
29EAPI RGBA_Font_Source *evas_common_font_source_load (const char *name);
30EAPI int evas_common_font_source_load_complete (RGBA_Font_Source *fs);
31EAPI RGBA_Font_Source *evas_common_font_source_find (const char *name);
32EAPI void evas_common_font_source_free (RGBA_Font_Source *fs);
33EAPI void evas_common_font_size_use (RGBA_Font *fn);
34EAPI RGBA_Font_Int *evas_common_font_int_load (const char *name, int size, Font_Rend_Flags wanted_rend);
35EAPI RGBA_Font_Int *evas_common_font_int_load_init (RGBA_Font_Int *fn);
36EAPI RGBA_Font_Int *evas_common_font_int_load_complete (RGBA_Font_Int *fi);
37EAPI RGBA_Font *evas_common_font_memory_load (const char *name, int size, const void *data, int data_size, Font_Rend_Flags wanted_rend);
38EAPI RGBA_Font *evas_common_font_load (const char *name, int size, Font_Rend_Flags wanted_rend);
39EAPI RGBA_Font *evas_common_font_add (RGBA_Font *fn, const char *name, int size, Font_Rend_Flags wanted_rend);
40EAPI RGBA_Font *evas_common_font_memory_add (RGBA_Font *fn, const char *name, int size, const void *data, int data_size, Font_Rend_Flags wanted_rend);
41EAPI void evas_common_font_free (RGBA_Font *fn);
42EAPI void evas_common_font_hinting_set (RGBA_Font *fn, Font_Hint_Flags hinting);
43EAPI Eina_Bool evas_common_hinting_available (Font_Hint_Flags hinting);
44EAPI RGBA_Font *evas_common_font_memory_hinting_load (const char *name, int size, const void *data, int data_size, Font_Hint_Flags hinting, Font_Rend_Flags wanted_rend);
45EAPI RGBA_Font *evas_common_font_hinting_load (const char *name, int size, Font_Hint_Flags hinting, Font_Rend_Flags wanted_rend);
46EAPI RGBA_Font *evas_common_font_hinting_add (RGBA_Font *fn, const char *name, int size, Font_Hint_Flags hinting, Font_Rend_Flags wanted_rend);
47EAPI RGBA_Font *evas_common_font_memory_hinting_add (RGBA_Font *fn, const char *name, int size, const void *data, int data_size, Font_Hint_Flags hinting, Font_Rend_Flags wanted_rend);
48EAPI void evas_common_font_int_modify_cache_by (RGBA_Font_Int *fi, int dir);
49EAPI int evas_common_font_cache_get (void);
50EAPI void evas_common_font_cache_set (int size);
51EAPI void evas_common_font_flush (void);
52EAPI void evas_common_font_flush_last (void);
53EAPI RGBA_Font_Int *evas_common_font_int_find (const char *name, int size, Font_Rend_Flags wanted_rend);
54EAPI void evas_common_font_all_clear (void);
55
56/* query */
57
58EAPI int evas_common_font_query_kerning (RGBA_Font_Int* fi, FT_UInt left, FT_UInt right, int* kerning);
59EAPI void evas_common_font_query_size (RGBA_Font *fn, const Evas_Text_Props *intl_props, int *w, int *h);
60EAPI int evas_common_font_query_inset (RGBA_Font *fn __UNUSED__, const Evas_Text_Props *text_props);
61EAPI int evas_common_font_query_right_inset (RGBA_Font *fn __UNUSED__, const Evas_Text_Props *text_props);
62EAPI void evas_common_font_query_advance (RGBA_Font *fn, const Evas_Text_Props *intl_props, int *h_adv, int *v_adv);
63EAPI int evas_common_font_query_char_coords (RGBA_Font *fn, const Evas_Text_Props *intl_props, int pos, int *cx, int *cy, int *cw, int *ch);
64EAPI int evas_common_font_query_pen_coords (RGBA_Font *fn, const Evas_Text_Props *intl_props, int pos, int *cpen_x, int *cy, int *cadv, int *ch);
65EAPI int evas_common_font_query_char_at_coords (RGBA_Font *fn, const Evas_Text_Props *intl_props, int x, int y, int *cx, int *cy, int *cw, int *ch);
66EAPI int evas_common_font_query_last_up_to_pos (RGBA_Font *fn, const Evas_Text_Props *intl_props, int x, int y);
67EAPI int evas_common_font_query_run_font_end_get(RGBA_Font *fn, RGBA_Font_Int **script_fi, RGBA_Font_Int **cur_fi, Evas_Script_Type script, const Eina_Unicode *text, int run_len);
68
69#ifdef EVAS_FRAME_QUEUING
70EAPI void evas_common_font_draw_finish(void);
71#endif
72
73void evas_common_font_load_init(void);
74void evas_common_font_load_shutdown(void);
75
76#endif /* _EVAS_FONT_H */
diff --git a/libraries/evas/src/lib/engines/common/evas_font_default_walk.x b/libraries/evas/src/lib/engines/common/evas_font_default_walk.x
new file mode 100644
index 0000000..94e7fde
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_font_default_walk.x
@@ -0,0 +1,144 @@
1#ifndef _EVAS_FONT_DEFAULT_WALK_X
2#define _EVAS_FONT_DEFAULT_WALK_X
3/* Macros for text walking */
4
5/**
6 * @def EVAS_FONT_WALK_TEXT_INIT
7 * @internal
8 * This macro defines the variables that will later be used with the following
9 * macros, and by font handling functions.
10 * @see EVAS_FONT_WALK_TEXT_START
11 * @see EVAS_FONT_WALK_TEXT_WORK
12 * @see EVAS_FONT_WALK_TEXT_END
13 */
14# define EVAS_FONT_WALK_TEXT_INIT() \
15 int _pen_x = 0, _pen_y = 0; \
16 Evas_Coord _start_pen = (text_props->info && \
17 (text_props->start > 0)) ? \
18 text_props->info->glyph[text_props->start - 1].pen_after : 0 ; \
19 size_t char_index; \
20 (void) _pen_y; /* Sometimes it won't be used */
21
22/* Visual walk helper macros */
23#ifdef OT_SUPPORT
24#define _EVAS_FONT_WALK_TEXT_START() \
25 Evas_Font_OT_Info *_ot_itr = (text_props->info) ? \
26 text_props->info->ot + text_props->start : NULL; \
27 if (!_ot_itr) break; \
28 for (char_index = 0 ; char_index < text_props->len ; char_index++, _glyph_itr++, _ot_itr++) \
29 {
30#else
31#define _EVAS_FONT_WALK_TEXT_START() \
32 for (char_index = 0 ; char_index < text_props->len ; char_index++, _glyph_itr++) \
33 {
34#endif
35
36/**
37 * @def EVAS_FONT_WALK_TEXT_START
38 * @internal
39 * This runs through the text in visual order while updating char_index,
40 * which is the current index in the text.
41 * Does not end with a ;
42 * Take a look at EVAS_FONT_WALK_X_OFF and the like.
43 * @see EVAS_FONT_WALK_TEXT_INIT
44 * @see EVAS_FONT_WALK_TEXT_WORK
45 * @see EVAS_FONT_WALK_TEXT_END
46 */
47#define EVAS_FONT_WALK_TEXT_START() \
48 do \
49 { \
50 Evas_Font_Glyph_Info *_glyph_itr = (text_props->info) ? \
51 text_props->info->glyph + text_props->start : NULL; \
52 if (!_glyph_itr) break; \
53 _EVAS_FONT_WALK_TEXT_START()
54
55/*FIXME: doc */
56#ifdef OT_SUPPORT
57# define EVAS_FONT_WALK_X_OFF \
58 (EVAS_FONT_ROUND_26_6_TO_INT(EVAS_FONT_OT_X_OFF_GET(*_ot_itr)))
59# define EVAS_FONT_WALK_Y_OFF \
60 (EVAS_FONT_ROUND_26_6_TO_INT(EVAS_FONT_OT_Y_OFF_GET(*_ot_itr)))
61# define EVAS_FONT_WALK_POS \
62 (EVAS_FONT_OT_POS_GET(*_ot_itr) - text_props->text_offset)
63# define EVAS_FONT_WALK_POS_NEXT \
64 ((!EVAS_FONT_WALK_IS_LAST) ? \
65 EVAS_FONT_OT_POS_GET(*(_ot_itr + 1)) - \
66 text_props->text_offset : \
67 EVAS_FONT_WALK_POS \
68 )
69# define EVAS_FONT_WALK_POS_PREV \
70 ((char_index > 0) ? \
71 EVAS_FONT_OT_POS_GET(*(_ot_itr - 1)) - \
72 text_props->text_offset : \
73 EVAS_FONT_WALK_POS \
74 )
75#else
76# define EVAS_FONT_WALK_X_OFF 0
77# define EVAS_FONT_WALK_Y_OFF 0
78# define EVAS_FONT_WALK_POS \
79 ((text_props->bidi.dir == EVAS_BIDI_DIRECTION_RTL) ? \
80 (text_props->len - char_index - 1) : \
81 (char_index))
82# define EVAS_FONT_WALK_POS_NEXT \
83 ((!EVAS_FONT_WALK_IS_LAST) ? \
84 ((text_props->bidi.dir == EVAS_BIDI_DIRECTION_RTL) ? \
85 text_props->len - char_index - 2 \
86 : (char_index + 1)) : \
87 EVAS_FONT_WALK_POS)
88# define EVAS_FONT_WALK_POS_PREV \
89 ((char_index > 0) ? \
90 ((text_props->bidi.dir == EVAS_BIDI_DIRECTION_RTL) ? \
91 text_props->len - char_index \
92 : (char_index - 1)) : \
93 EVAS_FONT_WALK_POS)
94#endif
95
96
97#define EVAS_FONT_WALK_IS_VISIBLE (_glyph_itr->index != 0)
98#define EVAS_FONT_WALK_X_BEAR (_glyph_itr->x_bear)
99#define EVAS_FONT_WALK_Y_BEAR (fg->glyph_out->top)
100#define EVAS_FONT_WALK_X_ADV ((_glyph_itr > text_props->info->glyph) ? \
101 _glyph_itr->pen_after - (_glyph_itr - 1)->pen_after : \
102 _glyph_itr->pen_after)
103#define EVAS_FONT_WALK_WIDTH (_glyph_itr->width)
104
105#define EVAS_FONT_WALK_INDEX (_glyph_itr->index)
106#define EVAS_FONT_WALK_PEN_X (_pen_x)
107#define EVAS_FONT_WALK_PEN_X_AFTER (_glyph_itr->pen_after - _start_pen)
108#define EVAS_FONT_WALK_PEN_Y (EVAS_FONT_ROUND_26_6_TO_INT(_pen_y))
109#define EVAS_FONT_WALK_Y_ADV (0)
110#define EVAS_FONT_WALK_IS_LAST \
111 (char_index + 1 == text_props->len)
112#define EVAS_FONT_WALK_IS_FIRST \
113 (char_index == 0)
114#define EVAS_FONT_WALK_LEN (text_props->len)
115
116/**
117 * @def EVAS_FONT_WALK_TEXT_WORK
118 * @internal
119 * This macro actually updates the values mentioned in EVAS_FONT_WALK_TEXT_START
120 * according to the current positing in the walk.
121 * @see EVAS_FONT_WALK_TEXT_START
122 * @see EVAS_FONT_WALK_TEXT_INIT
123 * @see EVAS_FONT_WALK_TEXT_END
124 */
125#define EVAS_FONT_WALK_TEXT_WORK() do {} while(0)
126
127/**
128 * @def EVAS_FONT_WALK_TEXT_END
129 * @internal
130 * Closes EVAS_FONT_WALK_TEXT_START, needs to end with a ;
131 * @see EVAS_FONT_WALK_TEXT_START
132 * @see EVAS_FONT_WALK_TEXT_INIT
133 * @see EVAS_FONT_WALK_TEXT_WORK
134 */
135#define EVAS_FONT_WALK_TEXT_END() \
136 if (EVAS_FONT_WALK_IS_VISIBLE) \
137 { \
138 _pen_x = _glyph_itr->pen_after - _start_pen; \
139 } \
140 } \
141 } \
142 while(0)
143
144#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_font_draw.c b/libraries/evas/src/lib/engines/common/evas_font_draw.c
new file mode 100644
index 0000000..94aa085
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_font_draw.c
@@ -0,0 +1,615 @@
1#include "evas_common.h"
2#include "evas_private.h"
3#include "evas_blend_private.h"
4
5#include "language/evas_bidi_utils.h" /*defines BIDI_SUPPORT if possible */
6#include "evas_font_private.h" /* for Frame-Queuing support */
7
8#include "evas_font_ot.h"
9
10/* Forcibly disable the broken word/metric caching. */
11#ifdef METRIC_CACHE
12# undef METRIC_CACHE
13#endif
14
15#ifdef WORD_CACHE
16# undef WORD_CACHE
17#endif
18
19#define WORD_CACHE_MAXLEN 50
20/* How many to cache */
21#define WORD_CACHE_NWORDS 40
22
23static int max_cached_words = WORD_CACHE_NWORDS;
24
25struct prword
26{
27 EINA_INLIST;
28 struct cinfo *cinfo;
29 Evas_Text_Props text_props;
30 DATA8 *im;
31 int roww;
32 int width;
33 int height;
34 int baseline;
35};
36
37struct cinfo
38{
39 FT_UInt index;
40 struct
41 {
42 int x, y;
43 } pos;
44 int posx;
45 RGBA_Font_Glyph *fg;
46 struct
47 {
48 int w,h;
49 int rows;
50 unsigned char *data;
51 } bm;
52};
53
54
55#if defined(METRIC_CACHE) || defined(WORD_CACHE)
56LK(lock_words); // for word cache call
57static Eina_Inlist *words = NULL;
58static struct prword *evas_font_word_prerender(RGBA_Draw_Context *dc, const Evas_Text_Props *text_props);
59#endif
60
61EAPI void
62evas_common_font_draw_init(void)
63{
64 char *p;
65 int tmp;
66
67 if ((p = getenv("EVAS_WORD_CACHE_MAX_WORDS")))
68 {
69 tmp = strtol(p,NULL,10);
70 /* 0 to disable of course */
71 if (tmp > -1 && tmp < 500){
72 max_cached_words = tmp;
73 }
74 }
75}
76
77#ifdef EVAS_FRAME_QUEUING
78EAPI void
79evas_common_font_draw_finish(void)
80{
81}
82#endif
83
84/*
85 * BiDi handling: We receive the shaped string + other props from text_props,
86 * we need to reorder it so we'll have the visual string (the way we draw)
87 * and then for kerning we have to switch the order of the kerning query (as the prev
88 * is on the right, and not on the left).
89 */
90static void
91evas_common_font_draw_internal(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Font *fn __UNUSED__, int x, int y,
92 const Evas_Text_Props *text_props, RGBA_Gfx_Func func, int ext_x, int ext_y, int ext_w,
93 int ext_h, int im_w, int im_h __UNUSED__)
94{
95 DATA32 *im;
96 RGBA_Font_Int *fi;
97 EVAS_FONT_WALK_TEXT_INIT();
98
99 fi = text_props->font_instance;
100 if (!fi) return;
101
102 evas_common_font_int_reload(fi);
103
104 if (fi->src->current_size != fi->size)
105 {
106 FTLOCK();
107 FT_Activate_Size(fi->ft.size);
108 FTUNLOCK();
109 fi->src->current_size = fi->size;
110 }
111
112
113#if defined(METRIC_CACHE) || defined(WORD_CACHE)
114 unsigned int len;
115
116 len = text_props->len;
117
118 if (len > 2 && (len < WORD_CACHE_MAXLEN))
119 {
120 struct prword *word;
121
122 word =
123 evas_font_word_prerender(dc, text_props);
124 if (word)
125 {
126 int j, rowstart, rowend, xstart, xrun;
127
128 im = dst->image.data;
129 xrun = word->width;
130 y -= word->baseline;
131 xstart = 0;
132 rowstart = 0;
133 rowend = word->height;
134 /* Clip to extent */
135 if (x + xrun > ext_x + ext_w)
136 {
137 xrun -= x + xrun - ext_x - ext_w;
138 }
139 if (x < ext_x)
140 {
141 int excess = ext_x - x;
142 xstart = excess - 1;
143 xrun -= excess;
144 x = ext_x;
145 }
146 if (y + rowend > ext_y + ext_h)
147 {
148 rowend -= (y - ext_y + rowend - ext_h);
149 }
150 if (y < ext_y)
151 {
152 int excess = ext_y - y;
153 rowstart += excess;
154 //rowend -= excess;
155 // y = ext_y;
156 }
157
158 if (xrun < 1) return;
159/* For some reason, metric and word chache are exactly the same except for
160 * this piece of code that makes metric go nuts. ATM, we'll just go the
161 * WORD_CACHE path. */
162#if defined(METRIC_CACHE) || defined(WORD_CACHE)
163 if (word->im)
164 {
165 for (j = rowstart ; j < rowend ; j ++)
166 {
167 func(NULL, word->im + (word->roww * j) + xstart, dc->col.col,
168 im + ((y + j) * im_w) + x, xrun);
169 }
170 return;
171 }
172# elif defined(METRIC_CACHE)
173 unsigned int ind;
174
175 y += word->baseline;
176 for (ind = 0 ; ind < len ; ind ++)
177 {
178 // FIXME Do we need to draw?
179 struct cinfo *ci = word->cinfo + ind;
180 for (j = rowstart ; j < rowend ; j ++)
181 {
182 if ((ci->fg->ext_dat) && (dc->font_ext.func.gl_draw))
183 {
184 /* ext glyph draw */
185 dc->font_ext.func.gl_draw(dc->font_ext.data,
186 (void *)dst,
187 dc, ci->fg,
188 x + ci->pos.x,
189 y - ci->bm.h + j);
190 }
191 else
192 {
193 func(NULL, word->im + (word->roww * j) + xstart,
194 dc->col.col, im + ((y + j) * im_w) + x, xrun);
195 }
196 }
197 }
198 return;
199# endif
200 }
201 }
202#endif
203
204 im = dst->image.data;
205
206 EVAS_FONT_WALK_TEXT_START()
207 {
208 FT_UInt idx;
209 RGBA_Font_Glyph *fg;
210 int chr_x, chr_y;
211
212 if (!EVAS_FONT_WALK_IS_VISIBLE) continue;
213
214 idx = EVAS_FONT_WALK_INDEX;
215
216 LKL(fi->ft_mutex);
217 fg = evas_common_font_int_cache_glyph_get(fi, idx);
218 if (!fg)
219 {
220 LKU(fi->ft_mutex);
221 continue;
222 }
223
224 LKU(fi->ft_mutex);
225
226 if (dc->font_ext.func.gl_new)
227 {
228 /* extension calls */
229 fg->ext_dat = dc->font_ext.func.gl_new(dc->font_ext.data, fg);
230 fg->ext_dat_free = dc->font_ext.func.gl_free;
231 }
232
233 chr_x = x + EVAS_FONT_WALK_PEN_X + EVAS_FONT_WALK_X_OFF + EVAS_FONT_WALK_X_BEAR;
234 chr_y = y + EVAS_FONT_WALK_PEN_Y + EVAS_FONT_WALK_Y_OFF + EVAS_FONT_WALK_Y_BEAR;
235
236 if (chr_x < (ext_x + ext_w))
237 {
238 DATA8 *data;
239 int i, j, w, h;
240
241 data = fg->glyph_out->bitmap.buffer;
242 j = fg->glyph_out->bitmap.pitch;
243 w = fg->glyph_out->bitmap.width;
244 if (j < w) j = w;
245 h = fg->glyph_out->bitmap.rows;
246 /*
247 if ((fg->glyph_out->bitmap.pixel_mode == ft_pixel_mode_grays)
248 && (fg->glyph_out->bitmap.num_grays == 256)
249 )
250 */
251 {
252 if ((j > 0) && (chr_x + w > ext_x))
253 {
254 if ((fg->ext_dat) && (dc->font_ext.func.gl_draw))
255 {
256 /* ext glyph draw */
257 dc->font_ext.func.gl_draw(dc->font_ext.data,
258 (void *)dst,
259 dc, fg, chr_x,
260 y - (chr_y - y));
261 }
262 else
263 {
264 if ((fg->glyph_out->bitmap.num_grays == 256) &&
265 (fg->glyph_out->bitmap.pixel_mode == FT_PIXEL_MODE_GRAY))
266 {
267 for (i = 0; i < h; i++)
268 {
269 int dx, dy;
270 int in_x, in_w;
271
272 in_x = 0;
273 in_w = 0;
274 dx = chr_x;
275 dy = y - (chr_y - i - y);
276#ifdef EVAS_SLI
277 if (((dy) % dc->sli.h) == dc->sli.y)
278#endif
279 {
280 if ((dx < (ext_x + ext_w)) &&
281 (dy >= (ext_y)) &&
282 (dy < (ext_y + ext_h)))
283 {
284 if (dx + w > (ext_x + ext_w))
285 in_w += (dx + w) - (ext_x + ext_w);
286 if (dx < ext_x)
287 {
288 in_w += ext_x - dx;
289 in_x = ext_x - dx;
290 dx = ext_x;
291 }
292 if (in_w < w)
293 {
294 func(NULL, data + (i * j) + in_x, dc->col.col,
295 im + (dy * im_w) + dx, w - in_w);
296 }
297 }
298 }
299 }
300 }
301 else
302 {
303 DATA8 *tmpbuf = NULL, *dp, *tp, bits;
304 int bi, bj;
305 const DATA8 bitrepl[2] = {0x0, 0xff};
306
307 tmpbuf = alloca(w);
308 for (i = 0; i < h; i++)
309 {
310 int dx, dy;
311 int in_x, in_w, end;
312
313 in_x = 0;
314 in_w = 0;
315 dx = chr_x;
316 dy = y - (chr_y - i - y);
317#ifdef EVAS_SLI
318 if (((dy) % dc->sli.h) == dc->sli.y)
319#endif
320 {
321 tp = tmpbuf;
322 dp = data + (i * fg->glyph_out->bitmap.pitch);
323 for (bi = 0; bi < w; bi += 8)
324 {
325 bits = *dp;
326 if ((w - bi) < 8) end = w - bi;
327 else end = 8;
328 for (bj = 0; bj < end; bj++)
329 {
330 *tp = bitrepl[(bits >> (7 - bj)) & 0x1];
331 tp++;
332 }
333 dp++;
334 }
335 if ((dx < (ext_x + ext_w)) &&
336 (dy >= (ext_y)) &&
337 (dy < (ext_y + ext_h)))
338 {
339 if (dx + w > (ext_x + ext_w))
340 in_w += (dx + w) - (ext_x + ext_w);
341 if (dx < ext_x)
342 {
343 in_w += ext_x - dx;
344 in_x = ext_x - dx;
345 dx = ext_x;
346 }
347 if (in_w < w)
348 {
349 func(NULL, tmpbuf + in_x, dc->col.col,
350 im + (dy * im_w) + dx, w - in_w);
351 }
352 }
353 }
354 }
355 }
356 }
357 }
358 }
359 }
360 else
361 break;
362 }
363 EVAS_FONT_WALK_TEXT_END();
364 evas_common_font_int_use_trim();
365}
366
367EAPI void
368evas_common_font_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Font *fn, int x, int y, const Evas_Text_Props *text_props)
369{
370 int ext_x, ext_y, ext_w, ext_h;
371 int im_w, im_h;
372 RGBA_Gfx_Func func;
373 Cutout_Rects *rects;
374 Cutout_Rect *r;
375 int c, cx, cy, cw, ch;
376 int i;
377
378 im_w = dst->cache_entry.w;
379 im_h = dst->cache_entry.h;
380
381 ext_x = 0; ext_y = 0; ext_w = im_w; ext_h = im_h;
382 if (dc->clip.use)
383 {
384 ext_x = dc->clip.x;
385 ext_y = dc->clip.y;
386 ext_w = dc->clip.w;
387 ext_h = dc->clip.h;
388 if (ext_x < 0)
389 {
390 ext_w += ext_x;
391 ext_x = 0;
392 }
393 if (ext_y < 0)
394 {
395 ext_h += ext_y;
396 ext_y = 0;
397 }
398 if ((ext_x + ext_w) > im_w)
399 ext_w = im_w - ext_x;
400 if ((ext_y + ext_h) > im_h)
401 ext_h = im_h - ext_y;
402 }
403 if (ext_w <= 0) return;
404 if (ext_h <= 0) return;
405
406#ifdef EVAS_FRAME_QUEUING
407 LKL(fn->lock);
408#endif
409// evas_common_font_size_use(fn);
410 func = evas_common_gfx_func_composite_mask_color_span_get(dc->col.col, dst, 1, dc->render_op);
411
412 if (!dc->cutout.rects)
413 {
414 evas_common_font_draw_internal(dst, dc, fn, x, y, text_props,
415 func, ext_x, ext_y, ext_w, ext_h,
416 im_w, im_h);
417 }
418 else
419 {
420 c = dc->clip.use; cx = dc->clip.x; cy = dc->clip.y; cw = dc->clip.w; ch = dc->clip.h;
421 evas_common_draw_context_clip_clip(dc, 0, 0, dst->cache_entry.w, dst->cache_entry.h);
422 /* our clip is 0 size.. abort */
423 if ((dc->clip.w > 0) && (dc->clip.h > 0))
424 {
425 rects = evas_common_draw_context_apply_cutouts(dc);
426 for (i = 0; i < rects->active; ++i)
427 {
428 r = rects->rects + i;
429 evas_common_draw_context_set_clip(dc, r->x, r->y, r->w, r->h);
430 evas_common_font_draw_internal(dst, dc, fn, x, y, text_props,
431 func, r->x, r->y, r->w, r->h,
432 im_w, im_h);
433 }
434 evas_common_draw_context_apply_clear_cutouts(rects);
435 }
436 dc->clip.use = c; dc->clip.x = cx; dc->clip.y = cy; dc->clip.w = cw; dc->clip.h = ch;
437 }
438#ifdef EVAS_FRAME_QUEUING
439 LKU(fn->lock);
440#endif
441}
442
443/* Only used if cache is on */
444#if defined(METRIC_CACHE) || defined(WORD_CACHE)
445
446static Eina_Bool
447_evas_font_word_prerender_text_props_equal(const Evas_Text_Props *_a, const Evas_Text_Props *_b)
448{
449 Evas_Font_Glyph_Info *gl1, *gl2;
450 size_t i;
451
452 if ((_a->len != _b->len) ||
453 (_a->font_instance != _b->font_instance))
454 return EINA_FALSE;
455
456 gl1 = _a->info->glyph + _a->start;
457 gl2 = _b->info->glyph + _b->start;
458 i = _a->len;
459 for ( ; (i > 0) && (gl1->index == gl2->index) ; i--, gl1++, gl2++)
460 ;
461
462 return (i == 0);
463}
464
465static struct prword *
466evas_font_word_prerender(RGBA_Draw_Context *dc, const Evas_Text_Props *text_props)
467{
468 struct cinfo *metrics;
469 unsigned char *im;
470 int width;
471 int height, above, below, baseline, descent;
472 unsigned int i,j;
473 struct prword *w;
474 int last_delta = 0;
475 Eina_Unicode gl;
476 struct cinfo *ci;
477 unsigned int len = text_props->len;
478 RGBA_Font_Int *fi = (RGBA_Font_Int *) text_props->font_instance;
479 EVAS_FONT_WALK_TEXT_INIT();
480
481# ifndef METRIC_CACHE
482 gl = dc->font_ext.func.gl_new ? 1: 0;
483 if (gl) return NULL;
484# endif
485
486 LKL(lock_words);
487 EINA_INLIST_FOREACH(words,w)
488 {
489 if (_evas_font_word_prerender_text_props_equal(&w->text_props,
490 text_props))
491 {
492 words = eina_inlist_promote(words, EINA_INLIST_GET(w));
493 LKU(lock_words);
494 return w;
495 }
496 }
497 LKU(lock_words);
498
499 gl = dc->font_ext.func.gl_new ? 1: 0;
500
501 above = 0; below = 0; baseline = 0; height = 0; descent = 0;
502
503 /* First pass: Work out how big and populate */
504 metrics = malloc(sizeof(struct cinfo) * len);
505 ci = metrics;
506 EVAS_FONT_WALK_TEXT_START()
507 {
508 FT_UInt index;
509 RGBA_Font_Glyph *fg;
510 index = EVAS_FONT_WALK_INDEX;
511 LKL(fi->ft_mutex);
512 fg = evas_common_font_int_cache_glyph_get(fi, index);
513 if (!fg)
514 {
515 LKU(fi->ft_mutex);
516 continue;
517 }
518
519 LKU(fi->ft_mutex);
520 EVAS_FONT_WALK_TEXT_WORK();
521 /* Currently broken with invisible chars if (!EVAS_FONT_WALK_IS_VISIBLE) continue; */
522 ci->index = index;
523 ci->fg = fg;
524
525 if (gl)
526 {
527 ci->fg->ext_dat =dc->font_ext.func.gl_new(dc->font_ext.data,ci->fg);
528 ci->fg->ext_dat_free = dc->font_ext.func.gl_free;
529 }
530 ci->bm.data = ci->fg->glyph_out->bitmap.buffer;
531 ci->bm.w = MAX(ci->fg->glyph_out->bitmap.pitch,
532 ci->fg->glyph_out->bitmap.width);
533 ci->bm.rows = ci->fg->glyph_out->bitmap.rows;
534 ci->bm.h = ci->fg->glyph_out->top;
535 above = ci->bm.rows - (ci->bm.rows - ci->bm.h);
536 below = ci->bm.rows - ci->bm.h;
537 if (below > descent) descent = below;
538 if (above > baseline) baseline = above;
539 ci->pos.x = EVAS_FONT_WALK_PEN_X + EVAS_FONT_WALK_X_OFF + EVAS_FONT_WALK_X_BEAR;
540 ci->pos.y = EVAS_FONT_WALK_PEN_Y + EVAS_FONT_WALK_Y_OFF + EVAS_FONT_WALK_Y_BEAR;
541 last_delta = EVAS_FONT_WALK_X_ADV -
542 (ci->bm.w + ci->fg->glyph_out->left);
543 ci++;
544 }
545 EVAS_FONT_WALK_TEXT_END();
546
547 /* First loop done */
548 width = EVAS_FONT_WALK_PEN_X;
549 if (last_delta < 0)
550 width -= last_delta;
551 width = (width & 0x7) ? width + (8 - (width & 0x7)) : width;
552
553 height = baseline + descent;
554 if (!gl)
555 {
556 im = calloc(height, width);
557 for (i = 0 ; i < len ; i ++)
558 {
559 struct cinfo *cin = metrics + i;
560
561 for (j = 0 ; j < cin->bm.rows ; j ++)
562 {
563 int correction; /* Used to remove negative inset and such */
564 if (cin->pos.x < 0)
565 correction = -cin->pos.x;
566 else
567 correction = 0;
568
569 memcpy(im + cin->pos.x + (j + baseline - cin->bm.h) * width +
570 correction,
571 cin->bm.data + j * cin->bm.w + correction,
572 cin->bm.w - correction);
573 }
574 }
575 }
576 else
577 {
578 im = NULL;
579 }
580
581 /* Save it */
582 struct prword *save;
583
584 save = malloc(sizeof(struct prword));
585 save->cinfo = metrics;
586 evas_common_text_props_content_copy_and_ref(&save->text_props, text_props);
587 save->im = im;
588 save->width = EVAS_FONT_WALK_PEN_X;
589 if (last_delta < 0)
590 save->width += last_delta;
591 save->roww = width;
592 save->height = height;
593 save->baseline = baseline;
594 LKL(lock_words);
595 words = eina_inlist_prepend(words, EINA_INLIST_GET(save));
596
597 /* Clean up if too long */
598 if (eina_inlist_count(words) > max_cached_words)
599 {
600 struct prword *last = (struct prword *)(words->last);
601
602 if (last)
603 {
604 if (last->im) free(last->im);
605 if (last->cinfo) free(last->cinfo);
606 evas_common_text_props_content_unref(&last->text_props);
607 words = eina_inlist_remove(words, EINA_INLIST_GET(last));
608 free(last);
609 }
610 }
611 LKU(lock_words);
612
613 return save;
614}
615#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_font_load.c b/libraries/evas/src/lib/engines/common/evas_font_load.c
new file mode 100644
index 0000000..3fc4521
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_font_load.c
@@ -0,0 +1,929 @@
1#include "evas_common.h"
2#include "evas_private.h"
3
4#include <assert.h>
5
6#include "evas_font_private.h" /* for Frame-Queuing support */
7#include "evas_font_ot.h"
8
9#ifdef USE_HARFBUZZ
10# include <hb.h>
11# include <hb-ft.h>
12#endif
13
14extern FT_Library evas_ft_lib;
15
16static int font_cache_usage = 0;
17static int font_cache = 0;
18static int font_dpi = 75;
19
20static Eina_Hash *fonts_src = NULL;
21static Eina_Hash *fonts = NULL;
22static Eina_List *fonts_lru = NULL;
23static Eina_Inlist *fonts_use_lru = NULL;
24static int fonts_use_usage = 0;
25
26static void _evas_common_font_int_clear(RGBA_Font_Int *fi);
27
28static int
29_evas_font_cache_int_cmp(const RGBA_Font_Int *k1, int k1_length __UNUSED__,
30 const RGBA_Font_Int *k2, int k2_length __UNUSED__)
31{
32 /* RGBA_Font_Source->name is a stringshare */
33 if (k1->src->name == k2->src->name)
34 {
35 if (k1->size == k2->size)
36 return k1->wanted_rend - k2->wanted_rend;
37 else
38 return k1->size - k2->size;
39 }
40 return strcmp(k1->src->name, k2->src->name);
41}
42
43static int
44_evas_font_cache_int_hash(const RGBA_Font_Int *key, int key_length __UNUSED__)
45{
46 int hash;
47 unsigned int wanted_rend = key->wanted_rend;
48 hash = eina_hash_djb2(key->src->name, eina_stringshare_strlen(key->src->name) + 1);
49 hash ^= eina_hash_int32(&key->size, sizeof (int));
50 hash ^= eina_hash_int32(&wanted_rend, sizeof (int));
51 return hash;
52}
53
54static void
55_evas_common_font_source_free(RGBA_Font_Source *fs)
56{
57 FTLOCK();
58 FT_Done_Face(fs->ft.face);
59 FTUNLOCK();
60 if (fs->name) eina_stringshare_del(fs->name);
61 if (fs->file) eina_stringshare_del(fs->file);
62 free(fs);
63}
64
65static void
66_evas_common_font_int_free(RGBA_Font_Int *fi)
67{
68 FT_Done_Size(fi->ft.size);
69
70 evas_common_font_int_modify_cache_by(fi, -1);
71 _evas_common_font_int_clear(fi);
72 eina_hash_free(fi->kerning);
73
74#ifdef HAVE_PTHREAD
75 pthread_mutex_destroy(&fi->ft_mutex);
76#endif
77#ifdef USE_HARFBUZZ
78 hb_font_destroy(fi->ft.hb_font);
79#endif
80 evas_common_font_source_free(fi->src);
81 if (fi->references == 0) fonts_lru = eina_list_remove(fonts_lru, fi);
82 if (fi->fash) fi->fash->freeme(fi->fash);
83 if (fi->inuse)
84 {
85 fonts_use_lru = eina_inlist_remove(fonts_use_lru, EINA_INLIST_GET(fi));
86 fi->inuse = 0;
87 fonts_use_usage -= fi->usage;
88 fi->usage = 0;
89 }
90 free(fi);
91}
92
93void
94evas_common_font_load_init(void)
95{
96 fonts_src = eina_hash_string_small_new(EINA_FREE_CB(_evas_common_font_source_free));
97 fonts = eina_hash_new(NULL,
98 EINA_KEY_CMP(_evas_font_cache_int_cmp),
99 EINA_KEY_HASH(_evas_font_cache_int_hash),
100 EINA_FREE_CB(_evas_common_font_int_free),
101 5);
102}
103
104void
105evas_common_font_load_shutdown(void)
106{
107 eina_hash_free(fonts);
108 fonts = NULL;
109 eina_hash_free(fonts_src);
110 fonts_src = NULL;
111}
112
113EAPI void
114evas_common_font_dpi_set(int dpi)
115{
116 font_dpi = dpi;
117}
118
119EAPI RGBA_Font_Source *
120evas_common_font_source_memory_load(const char *name, const void *data, int data_size)
121{
122 int error;
123 RGBA_Font_Source *fs;
124
125 assert(name != NULL);
126 fs = calloc(1, sizeof(RGBA_Font_Source) + data_size);
127 if (!fs) return NULL;
128 fs->data = ((unsigned char *)fs) + sizeof(RGBA_Font_Source);
129 fs->data_size = data_size;
130 fs->current_size = 0;
131 memcpy(fs->data, data, data_size);
132 FTLOCK();
133 error = FT_New_Memory_Face(evas_ft_lib, fs->data, fs->data_size, 0, &(fs->ft.face));
134 FTUNLOCK();
135 if (error)
136 {
137 free(fs);
138 return NULL;
139 }
140 fs->name = eina_stringshare_add(name);
141 fs->file = NULL;
142 FTLOCK();
143 error = FT_Select_Charmap(fs->ft.face, ft_encoding_unicode);
144 if (error)
145 {
146 FT_Done_Face(fs->ft.face);
147 fs->ft.face = NULL;
148 free(fs);
149 return NULL;
150 }
151 FTUNLOCK();
152 fs->ft.orig_upem = fs->ft.face->units_per_EM;
153 fs->references = 1;
154 eina_hash_direct_add(fonts_src, fs->name, fs);
155 return fs;
156}
157
158EAPI RGBA_Font_Source *
159evas_common_font_source_load(const char *name)
160{
161 RGBA_Font_Source *fs;
162
163 assert(name != NULL);
164 fs = calloc(1, sizeof(RGBA_Font_Source));
165 if (!fs) return NULL;
166 fs->data = NULL;
167 fs->data_size = 0;
168 fs->current_size = 0;
169 fs->ft.face = NULL;
170 fs->name = eina_stringshare_add(name);
171 fs->file = eina_stringshare_ref(fs->name);
172 fs->ft.orig_upem = 0;
173 fs->references = 1;
174 eina_hash_direct_add(fonts_src, fs->name, fs);
175 return fs;
176}
177
178void
179evas_common_font_source_unload(RGBA_Font_Source *fs)
180{
181 FTLOCK();
182 FT_Done_Face(fs->ft.face);
183 fs->ft.face = NULL;
184 FTUNLOCK();
185}
186
187void
188evas_common_font_source_reload(RGBA_Font_Source *fs)
189{
190 if (fs->ft.face) return;
191 if (fs->data)
192 {
193 int error;
194
195 FTLOCK();
196 error = FT_New_Memory_Face(evas_ft_lib, fs->data, fs->data_size, 0, &(fs->ft.face));
197 FTUNLOCK();
198 if (error) return;
199 FTLOCK();
200 error = FT_Select_Charmap(fs->ft.face, ft_encoding_unicode);
201 if (error)
202 {
203 FT_Done_Face(fs->ft.face);
204 fs->ft.face = NULL;
205 }
206 FTUNLOCK();
207 }
208 else
209 evas_common_font_source_load_complete(fs);
210}
211
212EAPI int
213evas_common_font_source_load_complete(RGBA_Font_Source *fs)
214{
215 int error;
216
217 FTLOCK();
218 error = FT_New_Face(evas_ft_lib, fs->file, 0, &(fs->ft.face));
219 if (error)
220 {
221 FTUNLOCK();
222 fs->ft.face = NULL;
223 return error;
224 }
225 error = FT_Select_Charmap(fs->ft.face, ft_encoding_unicode);
226 if (error)
227 {
228 FT_Done_Face(fs->ft.face);
229 FTUNLOCK();
230 fs->ft.face = NULL;
231 return error;
232 }
233 FTUNLOCK();
234 fs->ft.orig_upem = fs->ft.face->units_per_EM;
235 return error;
236}
237
238EAPI RGBA_Font_Source *
239evas_common_font_source_find(const char *name)
240{
241 RGBA_Font_Source *fs;
242
243 if (!name) return NULL;
244 fs = eina_hash_find(fonts_src, name);
245 if (fs)
246 {
247 fs->references++;
248 return fs;
249 }
250 return NULL;
251}
252
253EAPI void
254evas_common_font_source_free(RGBA_Font_Source *fs)
255{
256 fs->references--;
257 if (fs->references > 0) return;
258 eina_hash_del(fonts_src, fs->name, fs);
259}
260
261EAPI void
262evas_common_font_size_use(RGBA_Font *fn)
263{
264 RGBA_Font_Int *fi;
265 Eina_List *l;
266
267 EINA_LIST_FOREACH(fn->fonts, l, fi)
268 {
269 if (fi->src->current_size != fi->size)
270 {
271 evas_common_font_source_reload(fi->src);
272 FTLOCK();
273 FT_Activate_Size(fi->ft.size);
274 FTUNLOCK();
275 fi->src->current_size = fi->size;
276 }
277 }
278}
279
280static int
281_evas_common_font_double_int_cmp(const int *key1, __UNUSED__ int key1_length,
282 const int *key2, __UNUSED__ int key2_length)
283{
284 if (key1[0] - key2[0] == 0) return key1[1] - key2[1];
285 return key1[0] - key2[0];
286}
287
288static int
289_evas_common_font_double_int_hash(const unsigned int key[2], int key_length)
290{
291 return
292 eina_hash_int32(&key[0], key_length) ^
293 eina_hash_int32(&key[1], key_length);
294}
295
296static void
297_evas_common_font_int_cache_init(RGBA_Font_Int *fi)
298{
299 /* Add some font kerning cache. */
300 fi->kerning = eina_hash_new(NULL,
301 EINA_KEY_CMP(_evas_common_font_double_int_cmp),
302 EINA_KEY_HASH(_evas_common_font_double_int_hash),
303 free, 3);
304#ifdef HAVE_PTHREAD
305 pthread_mutex_init(&fi->ft_mutex, NULL);
306#endif
307}
308
309EAPI RGBA_Font_Int *
310evas_common_font_int_memory_load(const char *name, int size, const void *data, int data_size, Font_Rend_Flags wanted_rend)
311{
312 RGBA_Font_Int *fi;
313
314 fi = evas_common_font_int_find(name, size, wanted_rend);
315 if (fi) return fi;
316 fi = calloc(1, sizeof(RGBA_Font_Int));
317 if (!fi) return NULL;
318 fi->src = evas_common_font_source_find(name);
319 if (!fi->src)
320 fi->src = evas_common_font_source_memory_load(name, data, data_size);
321 if (!fi->src)
322 {
323 free(fi);
324 return NULL;
325 }
326 fi->size = size;
327 _evas_common_font_int_cache_init(fi);
328 fi = evas_common_font_int_load_init(fi);
329 evas_common_font_int_load_complete(fi);
330 return fi;
331}
332
333EAPI RGBA_Font_Int *
334evas_common_font_int_load(const char *name, int size,
335 Font_Rend_Flags wanted_rend)
336{
337 RGBA_Font_Int *fi;
338
339 fi = evas_common_font_int_find(name, size, wanted_rend);
340 if (fi) return fi;
341 fi = calloc(1, sizeof(RGBA_Font_Int));
342 if (!fi) return NULL;
343 fi->src = evas_common_font_source_find(name);
344 if (!fi->src && evas_file_path_is_file(name))
345 fi->src = evas_common_font_source_load(name);
346
347 if (!fi->src)
348 {
349 free(fi);
350 return NULL;
351 }
352 fi->size = size;
353 fi->wanted_rend = wanted_rend;
354 _evas_common_font_int_cache_init(fi);
355 fi = evas_common_font_int_load_init(fi);
356// evas_common_font_int_load_complete(fi);
357 return fi;
358}
359
360EAPI RGBA_Font_Int *
361evas_common_font_int_load_init(RGBA_Font_Int *fi)
362{
363 fi->ft.size = NULL;
364 fi->references = 1;
365 eina_hash_direct_add(fonts, fi, fi);
366 return fi;
367}
368
369EAPI RGBA_Font_Int *
370evas_common_font_int_load_complete(RGBA_Font_Int *fi)
371{
372 int val, dv;
373 int ret;
374 int error;
375
376 FTLOCK();
377 error = FT_New_Size(fi->src->ft.face, &(fi->ft.size));
378 if (!error)
379 {
380 FT_Activate_Size(fi->ft.size);
381 }
382 fi->real_size = fi->size * 64;
383 error = FT_Set_Char_Size(fi->src->ft.face, 0, fi->real_size, font_dpi, font_dpi);
384 if (error)
385 {
386 fi->real_size = fi->size;
387 error = FT_Set_Pixel_Sizes(fi->src->ft.face, 0, fi->real_size);
388 }
389 FTUNLOCK();
390 if (error)
391 {
392 int i;
393 int chosen_size = 0;
394 int chosen_width = 0;
395
396 for (i = 0; i < fi->src->ft.face->num_fixed_sizes; i++)
397 {
398 int s;
399 int d, cd;
400
401 s = fi->src->ft.face->available_sizes[i].height;
402 cd = chosen_size - fi->size;
403 if (cd < 0) cd = -cd;
404 d = s - fi->size;
405 if (d < 0) d = -d;
406 if (d < cd)
407 {
408 chosen_width = fi->src->ft.face->available_sizes[i].width;
409 chosen_size = s;
410 }
411 if (d == 0) break;
412 }
413 fi->real_size = chosen_size;
414 FTLOCK();
415 error = FT_Set_Pixel_Sizes(fi->src->ft.face, chosen_width, fi->real_size);
416 FTUNLOCK();
417 if (error)
418 {
419 /* couldn't choose the size anyway... what now? */
420 }
421 }
422 fi->src->current_size = 0;
423 fi->max_h = 0;
424 val = (int)fi->src->ft.face->bbox.yMax;
425 if (fi->src->ft.face->units_per_EM != 0)
426 {
427 dv = (fi->src->ft.orig_upem * 2048) / fi->src->ft.face->units_per_EM;
428 ret = (val * fi->src->ft.face->size->metrics.y_scale) / (dv * dv);
429 }
430 else ret = val;
431 fi->max_h += ret;
432 val = -(int)fi->src->ft.face->bbox.yMin;
433 if (fi->src->ft.face->units_per_EM != 0)
434 {
435 dv = (fi->src->ft.orig_upem * 2048) / fi->src->ft.face->units_per_EM;
436 ret = (val * fi->src->ft.face->size->metrics.y_scale) / (dv * dv);
437 }
438 else ret = val;
439 fi->max_h += ret;
440
441 /* If the loaded font doesn't match with wanted_rend value requested by
442 * textobject and textblock, Set the runtime_rend value as FONT_REND_SLANT
443 * or FONT_REND_WEIGHT for software rendering. */
444 fi->runtime_rend = FONT_REND_REGULAR;
445 if ((fi->wanted_rend & FONT_REND_SLANT) &&
446 !(fi->src->ft.face->style_flags & FT_STYLE_FLAG_ITALIC))
447 fi->runtime_rend |= FONT_REND_SLANT;
448
449 if ((fi->wanted_rend & FONT_REND_WEIGHT) &&
450 !(fi->src->ft.face->style_flags & FT_STYLE_FLAG_BOLD))
451 fi->runtime_rend |= FONT_REND_WEIGHT;
452
453 return fi;
454}
455
456EAPI RGBA_Font *
457evas_common_font_memory_load(const char *name, int size, const void *data, int data_size, Font_Rend_Flags wanted_rend)
458{
459 RGBA_Font *fn;
460 RGBA_Font_Int *fi;
461
462 fi = evas_common_font_int_memory_load(name, size, data, data_size,
463 wanted_rend);
464 if (!fi) return NULL;
465 fn = calloc(1, sizeof(RGBA_Font));
466 if (!fn)
467 {
468 fi->references--;
469 if (fi->references == 0)
470 {
471 fonts_lru = eina_list_prepend(fonts_lru, fi);
472 evas_common_font_int_modify_cache_by(fi, 1);
473 evas_common_font_flush();
474 }
475 return NULL;
476 }
477 fn->fonts = eina_list_append(fn->fonts, fi);
478 fn->hinting = FONT_BYTECODE_HINT;
479 fi->hinting = fn->hinting;
480 fn->references = 1;
481 LKI(fn->lock);
482#ifdef EVAS_FRAME_QUEUING
483 LKI(fn->ref_fq_add);
484 LKI(fn->ref_fq_del);
485 eina_condition_new(&(fn->cond_fq_del), &(fn->ref_fq_del));
486#endif
487 if (fi->inuse) evas_common_font_int_promote(fi);
488 else
489 {
490 fi->inuse = 1;
491 fonts_use_lru = eina_inlist_prepend(fonts_use_lru, EINA_INLIST_GET(fi));
492 }
493 return fn;
494}
495
496
497//ZZZ: font struct looks like:
498// fn->(fi, fi, fi, ...)
499// fi->fs
500
501EAPI RGBA_Font *
502evas_common_font_load(const char *name, int size, Font_Rend_Flags wanted_rend)
503{
504 RGBA_Font *fn;
505 RGBA_Font_Int *fi;
506
507 fi = evas_common_font_int_load(name, size, wanted_rend);
508 if (!fi) return NULL;
509 /* First font, complete load */
510 if (!fi->ft.size)
511 {
512 if (!fi->src->ft.face)
513 {
514 if (evas_common_font_source_load_complete(fi->src))
515 {
516 fi->references--;
517 if (fi->references == 0)
518 {
519 fonts_lru = eina_list_prepend(fonts_lru, fi);
520 evas_common_font_int_modify_cache_by(fi, 1);
521 evas_common_font_flush();
522 }
523 return NULL;
524 }
525 }
526 evas_common_font_int_load_complete(fi);
527 }
528 fn = calloc(1, sizeof(RGBA_Font));
529 if (!fn)
530 {
531 fi->references--;
532 if (fi->references == 0)
533 {
534 fonts_lru = eina_list_prepend(fonts_lru, fi);
535 evas_common_font_int_modify_cache_by(fi, 1);
536 evas_common_font_flush();
537 }
538 return NULL;
539 }
540
541 fn->fonts = eina_list_append(fn->fonts, fi);
542 fn->hinting = FONT_BYTECODE_HINT;
543 fi->hinting = fn->hinting;
544 fn->references = 1;
545 LKI(fn->lock);
546#ifdef EVAS_FRAME_QUEUING
547 LKI(fn->ref_fq_add);
548 LKI(fn->ref_fq_del);
549 eina_condition_new(&(fn->cond_fq_del), &(fn->ref_fq_del));
550#endif
551 if (fi->inuse) evas_common_font_int_promote(fi);
552 else
553 {
554 fi->inuse = 1;
555 fonts_use_lru = eina_inlist_prepend(fonts_use_lru, EINA_INLIST_GET(fi));
556 }
557 return fn;
558}
559
560EAPI RGBA_Font *
561evas_common_font_add(RGBA_Font *fn, const char *name, int size, Font_Rend_Flags wanted_rend)
562{
563 RGBA_Font_Int *fi;
564
565 if (!fn) return NULL;
566 fi = evas_common_font_int_load(name, size, wanted_rend);
567 if (fi)
568 {
569 fn->fonts = eina_list_append(fn->fonts, fi);
570 fi->hinting = fn->hinting;
571 if (fi->inuse) evas_common_font_int_promote(fi);
572 else
573 {
574 fi->inuse = 1;
575 fonts_use_lru = eina_inlist_prepend(fonts_use_lru, EINA_INLIST_GET(fi));
576 }
577 return fn;
578 }
579 return NULL;
580}
581
582EAPI RGBA_Font *
583evas_common_font_memory_add(RGBA_Font *fn, const char *name, int size, const void *data, int data_size, Font_Rend_Flags wanted_rend)
584{
585 RGBA_Font_Int *fi;
586
587 if (!fn)
588 return NULL;
589 fi = evas_common_font_int_memory_load(name, size, data, data_size, wanted_rend);
590 if (fi)
591 {
592 fn->fonts = eina_list_append(fn->fonts, fi);
593 fi->hinting = fn->hinting;
594 if (fi->inuse) evas_common_font_int_promote(fi);
595 else
596 {
597 fi->inuse = 1;
598 fonts_use_lru = eina_inlist_prepend(fonts_use_lru, EINA_INLIST_GET(fi));
599 }
600 return fn;
601 }
602 return NULL;
603}
604
605EAPI void
606evas_common_font_free(RGBA_Font *fn)
607{
608 Eina_List *l;
609 RGBA_Font_Int *fi;
610
611 if (!fn) return;
612 fn->references--;
613 if (fn->references > 0) return;
614#ifdef EVAS_FRAME_QUEUING
615 LKL(fn->ref_fq_add);
616 LKL(fn->ref_fq_del);
617 if (fn->ref_fq[0] != fn->ref_fq[1])
618 {
619 LKU(fn->ref_fq_add);
620 LKU(fn->ref_fq_del);
621 return;
622 }
623 LKU(fn->ref_fq_add);
624 LKU(fn->ref_fq_del);
625#endif
626 EINA_LIST_FOREACH(fn->fonts, l, fi)
627 {
628 fi->references--;
629 if (fi->references == 0)
630 {
631 fonts_lru = eina_list_append(fonts_lru, fi);
632 evas_common_font_int_modify_cache_by(fi, 1);
633 }
634 }
635 evas_common_font_flush();
636 eina_list_free(fn->fonts);
637 if (fn->fash) fn->fash->freeme(fn->fash);
638 LKD(fn->lock);
639#ifdef EVAS_FRAME_QUEUING
640 LKD(fn->ref_fq_add);
641 LKD(fn->ref_fq_del);
642 eina_condition_free(&(fn->cond_fq_del));
643#endif
644 free(fn);
645}
646
647EAPI void
648evas_common_font_hinting_set(RGBA_Font *fn, Font_Hint_Flags hinting)
649{
650 Eina_List *l;
651 RGBA_Font_Int *fi;
652
653 if (!fn) return;
654 fn->hinting = hinting;
655 EINA_LIST_FOREACH(fn->fonts, l, fi)
656 {
657 fi->hinting = fn->hinting;
658 }
659}
660
661EAPI Eina_Bool
662evas_common_hinting_available(Font_Hint_Flags hinting)
663{
664 switch (hinting)
665 {
666 case FONT_NO_HINT:
667 case FONT_AUTO_HINT:
668 /* these two hinting modes are always available */
669 return EINA_TRUE;
670 case FONT_BYTECODE_HINT:
671 /* Only use the bytecode interpreter if support for the _patented_
672 * algorithms is available because the free bytecode
673 * interpreter's results are too crappy.
674 *
675 * On freetyp 2.2+, we can ask the library about support for
676 * the patented interpreter. On older versions, we need to use
677 * macros to check for it.
678 */
679#if FREETYPE_MINOR >= 2
680 return FT_Get_TrueType_Engine_Type(evas_ft_lib) >=
681 FT_TRUETYPE_ENGINE_TYPE_PATENTED;
682#else
683 /* we may not rely on TT_CONFIG_OPTION_BYTECODE_INTERPRETER
684 * here to find out whether it's supported.
685 *
686 * so, assume it is. o_O
687 */
688 return EINA_TRUE;
689#endif
690 }
691 /* shouldn't get here - need to add another case statement */
692 return EINA_FALSE;
693}
694
695EAPI RGBA_Font *
696evas_common_font_memory_hinting_load(const char *name, int size, const void *data, int data_size, Font_Hint_Flags hinting, Font_Rend_Flags wanted_rend)
697{
698 RGBA_Font *fn;
699
700 fn = evas_common_font_memory_load(name, size, data, data_size, wanted_rend);
701 if (fn) evas_common_font_hinting_set(fn, hinting);
702 return fn;
703}
704
705EAPI RGBA_Font *
706evas_common_font_hinting_load(const char *name, int size, Font_Hint_Flags hinting, Font_Rend_Flags wanted_rend)
707{
708 RGBA_Font *fn;
709
710 fn = evas_common_font_load(name, size, wanted_rend);
711 if (fn) evas_common_font_hinting_set(fn, hinting);
712 return fn;
713}
714
715EAPI RGBA_Font *
716evas_common_font_hinting_add(RGBA_Font *fn, const char *name, int size, Font_Hint_Flags hinting, Font_Rend_Flags wanted_rend)
717{
718 fn = evas_common_font_add(fn, name, size, wanted_rend);
719 if (fn) evas_common_font_hinting_set(fn, hinting);
720 return fn;
721}
722
723EAPI RGBA_Font *
724evas_common_font_memory_hinting_add(RGBA_Font *fn, const char *name, int size, const void *data, int data_size, Font_Hint_Flags hinting, Font_Rend_Flags wanted_rend)
725{
726 fn = evas_common_font_memory_add(fn, name, size, data, data_size,
727 wanted_rend);
728 if (fn) evas_common_font_hinting_set(fn, hinting);
729 return fn;
730}
731
732static void
733_evas_common_font_int_clear(RGBA_Font_Int *fi)
734{
735 int i, j, k;
736
737 LKL(fi->ft_mutex);
738 if (!fi->fash)
739 {
740 LKU(fi->ft_mutex);
741 return;
742 }
743 evas_common_font_int_modify_cache_by(fi, -1);
744 if (fi->fash)
745 {
746 for (k = 0; k <= 0xff; k++) // 24bits for unicode - v6 up to E01EF (chrs) & 10FFFD for private use (plane 16)
747 {
748 Fash_Glyph_Map2 *fmap2 = fi->fash->bucket[k];
749 if (fmap2)
750 {
751 for (j = 0; j <= 0xff; j++) // 24bits for unicode - v6 up to E01EF (chrs) & 10FFFD for private use (plane 16)
752 {
753 Fash_Glyph_Map *fmap = fmap2->bucket[j];
754 if (fmap)
755 {
756 for (i = 0; i <= 0xff; i++)
757 {
758 RGBA_Font_Glyph *fg = fmap->item[i];
759 if ((fg) && (fg != (void *)(-1)))
760 {
761 FT_Done_Glyph(fg->glyph);
762 /* extension calls */
763 if (fg->ext_dat_free) fg->ext_dat_free(fg->ext_dat);
764 free(fg);
765 fmap->item[i] = NULL;
766 }
767 }
768 }
769 }
770 }
771 }
772 fi->fash->freeme(fi->fash);
773 fi->fash = NULL;
774 }
775 if (fi->inuse) fonts_use_usage -= fi->usage;
776 fi->usage = 0;
777 LKU(fi->ft_mutex);
778}
779
780static Eina_Bool
781_evas_common_font_all_clear_cb(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED__, void *data, void *fdata __UNUSED__)
782{
783 RGBA_Font_Int *fi = data;
784 _evas_common_font_int_clear(fi);
785 return 1;
786}
787
788EAPI void
789evas_common_font_all_clear(void)
790{
791 eina_hash_foreach(fonts, _evas_common_font_all_clear_cb, NULL);
792}
793
794void
795evas_common_font_int_promote(RGBA_Font_Int *fi)
796{
797 return;
798 if (fonts_use_lru == (Eina_Inlist *)fi) return;
799 if (!fi->inuse) return;
800 fonts_use_lru = eina_inlist_remove(fonts_use_lru, EINA_INLIST_GET(fi));
801 fonts_use_lru = eina_inlist_prepend(fonts_use_lru, EINA_INLIST_GET(fi));
802}
803
804void
805evas_common_font_int_use_increase(int size)
806{
807 fonts_use_usage += size;
808}
809
810void
811evas_common_font_int_use_trim(void)
812{
813 Eina_Inlist *l;
814
815 return;
816 if (fonts_use_usage <= (font_cache << 1)) return;
817 if (!fonts_use_lru) return;
818 l = fonts_use_lru->last;
819 while (l)
820 {
821 RGBA_Font_Int *fi = (RGBA_Font_Int *)l;
822 if (fonts_use_usage <= (font_cache << 1)) break;
823 // FIXME: del fi->kerning content
824 _evas_common_font_int_clear(fi);
825 evas_common_font_int_unload(fi);
826 evas_common_font_int_promote(fi);
827 l = l->prev;
828 }
829}
830
831void
832evas_common_font_int_unload(RGBA_Font_Int *fi)
833{
834 return;
835 if (!fi->src->ft.face) return;
836 _evas_common_font_int_clear(fi);
837 FT_Done_Size(fi->ft.size);
838 fi->ft.size = NULL;
839 evas_common_font_source_unload(fi->src);
840}
841
842void
843evas_common_font_int_reload(RGBA_Font_Int *fi)
844{
845 if (fi->src->ft.face) return;
846 evas_common_font_source_load_complete(fi->src);
847 return;
848 evas_common_font_source_reload(fi->src);
849 evas_common_font_int_load_complete(fi);
850}
851
852/* when the fi->references == 0 we increase this instead of really deleting
853 * we then check if the cache_useage size is larger than allowed
854 * !If the cache is NOT too large we dont delete font_int
855 * !If the cache is too large we really delete font_int */
856EAPI void
857evas_common_font_int_modify_cache_by(RGBA_Font_Int *fi, int dir)
858{
859 font_cache_usage += dir * (sizeof(RGBA_Font) + fi->usage +
860 sizeof(FT_FaceRec) + 16384); /* fudge values */
861}
862
863EAPI int
864evas_common_font_cache_get(void)
865{
866 return font_cache;
867}
868
869EAPI void
870evas_common_font_cache_set(int size)
871{
872 font_cache = size;
873 evas_common_font_flush();
874 evas_common_font_int_use_trim();
875}
876
877EAPI void
878evas_common_font_flush(void)
879{
880 if (font_cache_usage < font_cache) return;
881 while (font_cache_usage > font_cache)
882 {
883 int pfont_cache_usage;
884
885 pfont_cache_usage = font_cache_usage;
886 evas_common_font_flush_last();
887 if (pfont_cache_usage == font_cache_usage) break;
888 }
889}
890
891/* We run this when the cache gets larger than allowed size
892 * We check cache size each time a fi->references goes to 0
893 * PERFORMS: Find font_int(s) with references == 0 and delete them */
894EAPI void
895evas_common_font_flush_last(void)
896{
897 RGBA_Font_Int *fi = NULL;
898
899 if (!fonts_lru) return ;
900 fi = eina_list_data_get(fonts_lru);
901 fonts_lru = eina_list_remove_list(fonts_lru, fonts_lru);
902 eina_hash_del(fonts, fi, fi);
903}
904
905EAPI RGBA_Font_Int *
906evas_common_font_int_find(const char *name, int size,
907 Font_Rend_Flags wanted_rend)
908{
909 RGBA_Font_Int tmp_fi;
910 RGBA_Font_Source tmp_fn;
911 RGBA_Font_Int *fi;
912
913 tmp_fn.name = (char*) eina_stringshare_add(name);
914 tmp_fi.src = &tmp_fn;
915 tmp_fi.size = size;
916 tmp_fi.wanted_rend = wanted_rend;
917 fi = eina_hash_find(fonts, &tmp_fi);
918 if (fi)
919 {
920 if (fi->references == 0)
921 {
922 evas_common_font_int_modify_cache_by(fi, -1);
923 fonts_lru = eina_list_remove(fonts_lru, fi);
924 }
925 fi->references++;
926 }
927 eina_stringshare_del(tmp_fn.name);
928 return fi;
929}
diff --git a/libraries/evas/src/lib/engines/common/evas_font_main.c b/libraries/evas/src/lib/engines/common/evas_font_main.c
new file mode 100644
index 0000000..64b1d5e
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_font_main.c
@@ -0,0 +1,547 @@
1#include "evas_common.h"
2#include "evas_private.h"
3
4#include "evas_font_private.h"
5
6#include FT_OUTLINE_H
7
8FT_Library evas_ft_lib = 0;
9static int initialised = 0;
10
11LK(lock_font_draw); // for freetype2 API calls
12LK(lock_bidi); // for evas bidi internal usage.
13LK(lock_ot); // for evas bidi internal usage.
14
15EAPI void
16evas_common_font_init(void)
17{
18 int error;
19 const char *s;
20
21 initialised++;
22 if (initialised != 1) return;
23 error = FT_Init_FreeType(&evas_ft_lib);
24 if (error) return;
25 evas_common_font_load_init();
26 evas_common_font_draw_init();
27 s = getenv("EVAS_FONT_DPI");
28 if (s)
29 {
30 int dpi = atoi(s);
31
32 if (dpi > 0) evas_common_font_dpi_set(dpi);
33 }
34 LKI(lock_font_draw);
35 LKI(lock_bidi);
36 LKI(lock_ot);
37}
38
39EAPI void
40evas_common_font_shutdown(void)
41{
42 int error;
43
44 if (initialised < 1) return;
45 initialised--;
46 if (initialised != 0) return;
47
48 LKD(lock_font_draw);
49 LKD(lock_bidi);
50 LKD(lock_ot);
51
52 evas_common_font_load_shutdown();
53 evas_common_font_cache_set(0);
54 evas_common_font_flush();
55
56 error = FT_Done_FreeType(evas_ft_lib);
57#ifdef EVAS_FRAME_QUEUING
58 evas_common_font_draw_finish();
59#endif
60 evas_ft_lib = 0;
61}
62
63EAPI void
64evas_common_font_font_all_unload(void)
65{
66 evas_common_font_all_clear();
67}
68
69EAPI int
70evas_common_font_ascent_get(RGBA_Font *fn)
71{
72 int val;
73 RGBA_Font_Int *fi;
74
75// evas_common_font_size_use(fn);
76#if 0
77 {
78 Eina_List *l;
79
80 EINA_LIST_FOREACH(fn->fonts, l, fi)
81 {
82 if (!fi->src->ft.face) continue;
83 if (fi->src->current_size != fi->size)
84 {
85 FTLOCK();
86 FT_Activate_Size(fi->ft.size);
87 FTUNLOCK();
88 fi->src->current_size = fi->size;
89 }
90 val = (int)fi->src->ft.face->size->metrics.ascender;
91 if (fi->src->ft.face->units_per_EM == 0)
92 return val;
93 dv = (fi->src->ft.orig_upem * 2048) / fi->src->ft.face->units_per_EM;
94 ret = (val * fi->src->ft.face->size->metrics.y_scale) / (dv * dv);
95 printf(" ==== %p: %i\n", fi, ret);
96 }
97 }
98#endif
99 fi = fn->fonts->data;
100 evas_common_font_int_reload(fi);
101 if (fi->src->current_size != fi->size)
102 {
103 FTLOCK();
104 FT_Activate_Size(fi->ft.size);
105 FTUNLOCK();
106 fi->src->current_size = fi->size;
107 }
108 if (!FT_IS_SCALABLE(fi->src->ft.face))
109 {
110 WRN("NOT SCALABLE!");
111 }
112 val = (int)fi->src->ft.face->size->metrics.ascender;
113 return val >> 6;
114// printf("%i | %i\n", val, val >> 6);
115// if (fi->src->ft.face->units_per_EM == 0)
116// return val;
117// dv = (fi->src->ft.orig_upem * 2048) / fi->src->ft.face->units_per_EM;
118// ret = (val * fi->src->ft.face->size->metrics.y_scale) / (dv * dv);
119// return ret;
120}
121
122EAPI int
123evas_common_font_descent_get(RGBA_Font *fn)
124{
125 int val;
126 RGBA_Font_Int *fi;
127
128// evas_common_font_size_use(fn);
129 fi = fn->fonts->data;
130 evas_common_font_int_reload(fi);
131 if (fi->src->current_size != fi->size)
132 {
133 FTLOCK();
134 FT_Activate_Size(fi->ft.size);
135 FTUNLOCK();
136 fi->src->current_size = fi->size;
137 }
138 val = -(int)fi->src->ft.face->size->metrics.descender;
139 return val >> 6;
140// if (fi->src->ft.face->units_per_EM == 0)
141// return val;
142// dv = (fi->src->ft.orig_upem * 2048) / fi->src->ft.face->units_per_EM;
143// ret = (val * fi->src->ft.face->size->metrics.y_scale) / (dv * dv);
144// return ret;
145}
146
147EAPI int
148evas_common_font_max_ascent_get(RGBA_Font *fn)
149{
150 int val, dv;
151 int ret;
152 RGBA_Font_Int *fi;
153
154// evas_common_font_size_use(fn);
155 fi = fn->fonts->data;
156 evas_common_font_int_reload(fi);
157 if (fi->src->current_size != fi->size)
158 {
159 FTLOCK();
160 FT_Activate_Size(fi->ft.size);
161 FTUNLOCK();
162 fi->src->current_size = fi->size;
163 }
164 val = (int)fi->src->ft.face->bbox.yMax;
165 if (fi->src->ft.face->units_per_EM == 0)
166 return val;
167 dv = (fi->src->ft.orig_upem * 2048) / fi->src->ft.face->units_per_EM;
168 ret = (val * fi->src->ft.face->size->metrics.y_scale) / (dv * dv);
169 return ret;
170}
171
172EAPI int
173evas_common_font_max_descent_get(RGBA_Font *fn)
174{
175 int val, dv;
176 int ret;
177 RGBA_Font_Int *fi;
178
179// evas_common_font_size_use(fn);
180 fi = fn->fonts->data;
181 evas_common_font_int_reload(fi);
182 if (fi->src->current_size != fi->size)
183 {
184 FTLOCK();
185 FT_Activate_Size(fi->ft.size);
186 FTUNLOCK();
187 fi->src->current_size = fi->size;
188 }
189 val = -(int)fi->src->ft.face->bbox.yMin;
190 if (fi->src->ft.face->units_per_EM == 0)
191 return val;
192 dv = (fi->src->ft.orig_upem * 2048) / fi->src->ft.face->units_per_EM;
193 ret = (val * fi->src->ft.face->size->metrics.y_scale) / (dv * dv);
194 return ret;
195}
196
197EAPI int
198evas_common_font_get_line_advance(RGBA_Font *fn)
199{
200 int val;
201 RGBA_Font_Int *fi;
202
203// evas_common_font_size_use(fn);
204 fi = fn->fonts->data;
205 evas_common_font_int_reload(fi);
206 if (fi->src->current_size != fi->size)
207 {
208 FTLOCK();
209 FT_Activate_Size(fi->ft.size);
210 FTUNLOCK();
211 fi->src->current_size = fi->size;
212 }
213 val = (int)fi->src->ft.face->size->metrics.height;
214 if (fi->src->ft.face->units_per_EM == 0)
215 return val;
216 return val >> 6;
217// dv = (fi->src->ft.orig_upem * 2048) / fi->src->ft.face->units_per_EM;
218// ret = (val * fi->src->ft.face->size->metrics.y_scale) / (dv * dv);
219// return ret;
220}
221
222/* Set of common functions that are used in a couple of places. */
223
224static void
225_fash_int2_free(Fash_Int_Map2 *fash)
226{
227 int i;
228
229 for (i = 0; i < 256; i++) if (fash->bucket[i]) free(fash->bucket[i]);
230 free(fash);
231}
232
233static void
234_fash_int_free(Fash_Int *fash)
235{
236 int i;
237
238 for (i = 0; i < 256; i++) if (fash->bucket[i]) _fash_int2_free(fash->bucket[i]);
239 free(fash);
240}
241
242static Fash_Int *
243_fash_int_new(void)
244{
245 Fash_Int *fash = calloc(1, sizeof(Fash_Int));
246 fash->freeme = _fash_int_free;
247 return fash;
248}
249
250static Fash_Item_Index_Map *
251_fash_int_find(Fash_Int *fash, int item)
252{
253 int grp, maj, min;
254
255 // 24bits for unicode - v6 up to E01EF (chrs) & 10FFFD for private use (plane 16)
256 grp = (item >> 16) & 0xff;
257 maj = (item >> 8) & 0xff;
258 min = item & 0xff;
259 if (!fash->bucket[grp]) return NULL;
260 if (!fash->bucket[grp]->bucket[maj]) return NULL;
261 return &(fash->bucket[grp]->bucket[maj]->item[min]);
262}
263
264static void
265_fash_int_add(Fash_Int *fash, int item, RGBA_Font_Int *fint, int idx)
266{
267 int grp, maj, min;
268
269 // 24bits for unicode - v6 up to E01EF (chrs) & 10FFFD for private use (plane 16)
270 grp = (item >> 16) & 0xff;
271 maj = (item >> 8) & 0xff;
272 min = item & 0xff;
273 if (!fash->bucket[grp])
274 fash->bucket[grp] = calloc(1, sizeof(Fash_Int_Map2));
275 EINA_SAFETY_ON_NULL_RETURN(fash->bucket[grp]);
276 if (!fash->bucket[grp]->bucket[maj])
277 fash->bucket[grp]->bucket[maj] = calloc(1, sizeof(Fash_Int_Map));
278 EINA_SAFETY_ON_NULL_RETURN(fash->bucket[grp]->bucket[maj]);
279 fash->bucket[grp]->bucket[maj]->item[min].fint = fint;
280 fash->bucket[grp]->bucket[maj]->item[min].index = idx;
281}
282
283static void
284_fash_gl2_free(Fash_Glyph_Map2 *fash)
285{
286 int i;
287
288 for (i = 0; i < 256; i++) if (fash->bucket[i]) free(fash->bucket[i]);
289 free(fash);
290}
291
292static void
293_fash_gl_free(Fash_Glyph *fash)
294{
295 int i;
296
297 for (i = 0; i < 256; i++) if (fash->bucket[i]) _fash_gl2_free(fash->bucket[i]);
298 free(fash);
299}
300
301static Fash_Glyph *
302_fash_gl_new(void)
303{
304 Fash_Glyph *fash = calloc(1, sizeof(Fash_Glyph));
305 fash->freeme = _fash_gl_free;
306 return fash;
307}
308
309static RGBA_Font_Glyph *
310_fash_gl_find(Fash_Glyph *fash, int item)
311{
312 int grp, maj, min;
313
314 // 24bits for unicode - v6 up to E01EF (chrs) & 10FFFD for private use (plane 16)
315 grp = (item >> 16) & 0xff;
316 maj = (item >> 8) & 0xff;
317 min = item & 0xff;
318 if (!fash->bucket[grp]) return NULL;
319 if (!fash->bucket[grp]->bucket[maj]) return NULL;
320 return fash->bucket[grp]->bucket[maj]->item[min];
321}
322
323static void
324_fash_gl_add(Fash_Glyph *fash, int item, RGBA_Font_Glyph *glyph)
325{
326 int grp, maj, min;
327
328 // 24bits for unicode - v6 up to E01EF (chrs) & 10FFFD for private use (plane 16)
329 grp = (item >> 16) & 0xff;
330 maj = (item >> 8) & 0xff;
331 min = item & 0xff;
332 if (!fash->bucket[grp])
333 fash->bucket[grp] = calloc(1, sizeof(Fash_Glyph_Map2));
334 EINA_SAFETY_ON_NULL_RETURN(fash->bucket[grp]);
335 if (!fash->bucket[grp]->bucket[maj])
336 fash->bucket[grp]->bucket[maj] = calloc(1, sizeof(Fash_Glyph_Map));
337 EINA_SAFETY_ON_NULL_RETURN(fash->bucket[grp]->bucket[maj]);
338 fash->bucket[grp]->bucket[maj]->item[min] = glyph;
339}
340
341EAPI RGBA_Font_Glyph *
342evas_common_font_int_cache_glyph_get(RGBA_Font_Int *fi, FT_UInt idx)
343{
344 RGBA_Font_Glyph *fg;
345 FT_UInt hindex;
346 FT_Error error;
347 int size;
348 const FT_Int32 hintflags[3] =
349 { FT_LOAD_NO_HINTING, FT_LOAD_FORCE_AUTOHINT, FT_LOAD_NO_AUTOHINT };
350 static FT_Matrix transform = {0x10000, 0x05000, 0x0000, 0x10000}; // about 12 degree.
351
352 evas_common_font_int_promote(fi);
353 if (fi->fash)
354 {
355 fg = _fash_gl_find(fi->fash, idx);
356 if (fg == (void *)(-1)) return NULL;
357 else if (fg) return fg;
358 }
359
360 hindex = idx + (fi->hinting * 500000000);
361
362// fg = eina_hash_find(fi->glyphs, &hindex);
363// if (fg) return fg;
364
365 evas_common_font_int_reload(fi);
366 FTLOCK();
367 error = FT_Load_Glyph(fi->src->ft.face, idx,
368 FT_LOAD_DEFAULT | FT_LOAD_NO_BITMAP |
369 hintflags[fi->hinting]);
370 FTUNLOCK();
371 if (error)
372 {
373 if (!fi->fash) fi->fash = _fash_gl_new();
374 if (fi->fash) _fash_gl_add(fi->fash, idx, (void *)(-1));
375 return NULL;
376 }
377
378 /* Transform the outline of Glyph according to runtime_rend. */
379 if (fi->runtime_rend & FONT_REND_SLANT)
380 FT_Outline_Transform(&fi->src->ft.face->glyph->outline, &transform);
381 /* Embolden the outline of Glyph according to rundtime_rend. */
382 if (fi->runtime_rend & FONT_REND_WEIGHT)
383 FT_Outline_Embolden(&fi->src->ft.face->glyph->outline,
384 (fi->src->ft.face->size->metrics.x_ppem * 5 * 64) / 100);
385
386 fg = malloc(sizeof(struct _RGBA_Font_Glyph));
387 if (!fg) return NULL;
388 memset(fg, 0, (sizeof(struct _RGBA_Font_Glyph)));
389
390 FTLOCK();
391 error = FT_Get_Glyph(fi->src->ft.face->glyph, &(fg->glyph));
392 FTUNLOCK();
393 if (error)
394 {
395 free(fg);
396 if (!fi->fash) fi->fash = _fash_gl_new();
397 if (fi->fash) _fash_gl_add(fi->fash, idx, (void *)(-1));
398 return NULL;
399 }
400
401 FTLOCK();
402 error = FT_Glyph_To_Bitmap(&(fg->glyph), FT_RENDER_MODE_NORMAL, 0, 1);
403 if (error)
404 {
405 FT_Done_Glyph(fg->glyph);
406 FTUNLOCK();
407 free(fg);
408 if (!fi->fash) fi->fash = _fash_gl_new();
409 if (fi->fash) _fash_gl_add(fi->fash, idx, (void *)(-1));
410 return NULL;
411 }
412 FTUNLOCK();
413
414 fg->glyph_out = (FT_BitmapGlyph)fg->glyph;
415 fg->index = hindex;
416 fg->fi = fi;
417
418 if (!fi->fash) fi->fash = _fash_gl_new();
419 if (fi->fash) _fash_gl_add(fi->fash, idx, fg);
420 /* This '+ 200' is just an estimation of how much memory freetype will use
421 * on it's size. This value is not really used anywhere in code - it's
422 * only for statistics. */
423 size = sizeof(RGBA_Font_Glyph) + sizeof(Eina_List) +
424 (fg->glyph_out->bitmap.width * fg->glyph_out->bitmap.rows) + 200;
425 fi->usage += size;
426 if (fi->inuse) evas_common_font_int_use_increase(size);
427
428// eina_hash_direct_add(fi->glyphs, &fg->index, fg);
429 return fg;
430}
431
432typedef struct _Font_Char_Index Font_Char_Index;
433struct _Font_Char_Index
434{
435 FT_UInt index;
436 Eina_Unicode gl;
437};
438
439EAPI FT_UInt
440evas_common_get_char_index(RGBA_Font_Int* fi, Eina_Unicode gl)
441{
442 Font_Char_Index result;
443 //FT_UInt ret;
444
445#ifdef HAVE_PTHREAD
446/// pthread_mutex_lock(&fi->ft_mutex);
447#endif
448
449// result = eina_hash_find(fi->indexes, &gl);
450// if (result) goto on_correct;
451//
452// result = malloc(sizeof (Font_Char_Index));
453// if (!result)
454// {
455//#ifdef HAVE_PTHREAD
456// pthread_mutex_unlock(&fi->ft_mutex);
457//#endif
458// return FT_Get_Char_Index(fi->src->ft.face, gl);
459// }
460
461 evas_common_font_int_reload(fi);
462 FTLOCK();
463 result.index = FT_Get_Char_Index(fi->src->ft.face, gl);
464 FTUNLOCK();
465 result.gl = gl;
466
467// eina_hash_direct_add(fi->indexes, &result->gl, result);
468//
469// on_correct:
470#ifdef HAVE_PTHREAD
471// pthread_mutex_unlock(&fi->ft_mutex);
472#endif
473 return result.index;
474}
475
476EAPI int
477evas_common_font_glyph_search(RGBA_Font *fn, RGBA_Font_Int **fi_ret, Eina_Unicode gl)
478{
479 Eina_List *l;
480
481 if (fn->fash)
482 {
483 Fash_Item_Index_Map *fm = _fash_int_find(fn->fash, gl);
484 if (fm)
485 {
486 if (fm->fint)
487 {
488 *fi_ret = fm->fint;
489 return fm->index;
490 }
491 else if (fm->index == -1) return 0;
492 }
493 }
494
495 for (l = fn->fonts; l; l = l->next)
496 {
497 RGBA_Font_Int *fi;
498 int idx;
499
500 fi = l->data;
501
502#if 0 /* FIXME: charmap user is disabled and use a deprecated data type. */
503/*
504 if (fi->src->charmap) // Charmap loaded, FI/FS blank
505 {
506 idx = evas_array_hash_search(fi->src->charmap, gl);
507 if (idx != 0)
508 {
509 evas_common_font_source_load_complete(fi->src);
510 evas_common_font_int_load_complete(fi);
511
512 evas_array_hash_free(fi->src->charmap);
513 fi->src->charmap = NULL;
514
515 *fi_ret = fi;
516 return idx;
517 }
518 }
519 else
520*/
521#endif
522 if (!fi->src->ft.face) /* Charmap not loaded, FI/FS blank */
523 {
524 evas_common_font_int_reload(fi);
525 }
526 if (fi->src->ft.face)
527 {
528 idx = evas_common_get_char_index(fi, gl);
529 if (idx != 0)
530 {
531 if (!fi->ft.size)
532 evas_common_font_int_load_complete(fi);
533 if (!fn->fash) fn->fash = _fash_int_new();
534 if (fn->fash) _fash_int_add(fn->fash, gl, fi, idx);
535 *fi_ret = fi;
536 return idx;
537 }
538 else
539 {
540 if (!fn->fash) fn->fash = _fash_int_new();
541 if (fn->fash) _fash_int_add(fn->fash, gl, NULL, -1);
542 }
543 }
544 }
545 *fi_ret = NULL;
546 return 0;
547}
diff --git a/libraries/evas/src/lib/engines/common/evas_font_ot.c b/libraries/evas/src/lib/engines/common/evas_font_ot.c
new file mode 100644
index 0000000..2912d55
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_font_ot.c
@@ -0,0 +1,336 @@
1#include "evas_font_ot.h"
2
3#ifdef USE_HARFBUZZ
4# include <hb.h>
5# include <hb-ft.h>
6#endif
7
8#include "evas_common.h"
9
10#include <Eina.h>
11#include "evas_font_private.h"
12
13#ifdef USE_HARFBUZZ
14static const hb_script_t
15_evas_script_to_harfbuzz[] =
16{
17 HB_SCRIPT_COMMON,
18 HB_SCRIPT_INHERITED,
19 HB_SCRIPT_ARABIC,
20 HB_SCRIPT_ARMENIAN,
21 HB_SCRIPT_BENGALI,
22 HB_SCRIPT_BOPOMOFO,
23 HB_SCRIPT_CHEROKEE,
24 HB_SCRIPT_COPTIC,
25 HB_SCRIPT_CYRILLIC,
26 HB_SCRIPT_DESERET,
27 HB_SCRIPT_DEVANAGARI,
28 HB_SCRIPT_ETHIOPIC,
29 HB_SCRIPT_GEORGIAN,
30 HB_SCRIPT_GOTHIC,
31 HB_SCRIPT_GREEK,
32 HB_SCRIPT_GUJARATI,
33 HB_SCRIPT_GURMUKHI,
34 HB_SCRIPT_HAN,
35 HB_SCRIPT_HANGUL,
36 HB_SCRIPT_HEBREW,
37 HB_SCRIPT_HIRAGANA,
38 HB_SCRIPT_KANNADA,
39 HB_SCRIPT_KATAKANA,
40 HB_SCRIPT_KHMER,
41 HB_SCRIPT_LAO,
42 HB_SCRIPT_LATIN,
43 HB_SCRIPT_MALAYALAM,
44 HB_SCRIPT_MONGOLIAN,
45 HB_SCRIPT_MYANMAR,
46 HB_SCRIPT_OGHAM,
47 HB_SCRIPT_OLD_ITALIC,
48 HB_SCRIPT_ORIYA,
49 HB_SCRIPT_RUNIC,
50 HB_SCRIPT_SINHALA,
51 HB_SCRIPT_SYRIAC,
52 HB_SCRIPT_TAMIL,
53 HB_SCRIPT_TELUGU,
54 HB_SCRIPT_THAANA,
55 HB_SCRIPT_THAI,
56 HB_SCRIPT_TIBETAN,
57 HB_SCRIPT_CANADIAN_ABORIGINAL,
58 HB_SCRIPT_YI,
59 HB_SCRIPT_TAGALOG,
60 HB_SCRIPT_HANUNOO,
61 HB_SCRIPT_BUHID,
62 HB_SCRIPT_TAGBANWA,
63
64 /* Unicode-4.0 additions */
65 HB_SCRIPT_BRAILLE,
66 HB_SCRIPT_CYPRIOT,
67 HB_SCRIPT_LIMBU,
68 HB_SCRIPT_OSMANYA,
69 HB_SCRIPT_SHAVIAN,
70 HB_SCRIPT_LINEAR_B,
71 HB_SCRIPT_TAI_LE,
72 HB_SCRIPT_UGARITIC,
73
74 /* Unicode-4.1 additions */
75 HB_SCRIPT_NEW_TAI_LUE,
76 HB_SCRIPT_BUGINESE,
77 HB_SCRIPT_GLAGOLITIC,
78 HB_SCRIPT_TIFINAGH,
79 HB_SCRIPT_SYLOTI_NAGRI,
80 HB_SCRIPT_OLD_PERSIAN,
81 HB_SCRIPT_KHAROSHTHI,
82
83 /* Unicode-5.0 additions */
84 HB_SCRIPT_UNKNOWN,
85 HB_SCRIPT_BALINESE,
86 HB_SCRIPT_CUNEIFORM,
87 HB_SCRIPT_PHOENICIAN,
88 HB_SCRIPT_PHAGS_PA,
89 HB_SCRIPT_NKO,
90
91 /* Unicode-5.1 additions */
92 HB_SCRIPT_KAYAH_LI,
93 HB_SCRIPT_LEPCHA,
94 HB_SCRIPT_REJANG,
95 HB_SCRIPT_SUNDANESE,
96 HB_SCRIPT_SAURASHTRA,
97 HB_SCRIPT_CHAM,
98 HB_SCRIPT_OL_CHIKI,
99 HB_SCRIPT_VAI,
100 HB_SCRIPT_CARIAN,
101 HB_SCRIPT_LYCIAN,
102 HB_SCRIPT_LYDIAN,
103
104 /* Unicode-5.2 additions */
105 HB_SCRIPT_AVESTAN,
106 HB_SCRIPT_BAMUM,
107 HB_SCRIPT_EGYPTIAN_HIEROGLYPHS,
108 HB_SCRIPT_IMPERIAL_ARAMAIC,
109 HB_SCRIPT_INSCRIPTIONAL_PAHLAVI,
110 HB_SCRIPT_INSCRIPTIONAL_PARTHIAN,
111 HB_SCRIPT_JAVANESE,
112 HB_SCRIPT_KAITHI,
113 HB_SCRIPT_TAI_THAM,
114 HB_SCRIPT_LISU,
115 HB_SCRIPT_MEETEI_MAYEK,
116 HB_SCRIPT_OLD_SOUTH_ARABIAN,
117 HB_SCRIPT_OLD_TURKIC,
118 HB_SCRIPT_SAMARITAN,
119 HB_SCRIPT_TAI_VIET,
120
121 /* Unicode-6.0 additions */
122 HB_SCRIPT_BATAK,
123 HB_SCRIPT_BRAHMI,
124 HB_SCRIPT_MANDAIC
125};
126#endif
127
128#ifdef OT_SUPPORT
129/* FIXME: doc. returns #items */
130EAPI int
131evas_common_font_ot_cluster_size_get(const Evas_Text_Props *props, size_t char_index)
132{
133 int i;
134 int items;
135 int left_bound, right_bound;
136 size_t base_cluster;
137 char_index += props->start;
138 base_cluster = EVAS_FONT_OT_POS_GET(props->info->ot[char_index]);
139 for (i = (int) char_index ;
140 (i >= (int) props->start) &&
141 (EVAS_FONT_OT_POS_GET(props->info->ot[i]) == base_cluster) ;
142 i--)
143 ;
144 left_bound = i;
145 for (i = (int) char_index + 1;
146 (i < (int) (props->start + props->len)) &&
147 (EVAS_FONT_OT_POS_GET(props->info->ot[i]) == base_cluster) ;
148 i++)
149 ;
150 right_bound = i;
151
152 if (right_bound == left_bound)
153 {
154 items = 1;
155 }
156 else if (props->bidi.dir == EVAS_BIDI_DIRECTION_RTL)
157 {
158 if (left_bound < 0)
159 {
160 items = props->text_offset + props->text_len - base_cluster;
161 }
162 else
163 {
164 items = props->info->ot[left_bound].source_cluster - base_cluster;
165 }
166 }
167 else
168 {
169 if (right_bound >= (int) (props->text_offset + props->text_len))
170 {
171 items = props->text_offset + props->text_len - base_cluster;
172 }
173 else
174 {
175 items = props->info->ot[right_bound].source_cluster - base_cluster;
176 }
177 }
178 return (items > 0) ? items : 1;
179}
180
181/* Harfbuzz font functions */
182
183static hb_position_t
184_evas_common_font_ot_hb_get_glyph_advance(hb_font_t *font,
185 void *font_data, hb_codepoint_t glyph,
186 void *user_data)
187{
188 /* Use our cache*/
189 RGBA_Font_Int *fi = (RGBA_Font_Int *) font_data;
190 RGBA_Font_Glyph *fg;
191 (void) font;
192 (void) user_data;
193 fg = evas_common_font_int_cache_glyph_get(fi, glyph);
194 if (fg)
195 {
196 return fg->glyph->advance.x >> 10;
197 }
198 return 0;
199}
200
201static hb_position_t
202_evas_common_font_ot_hb_get_kerning(hb_font_t *font, void *font_data,
203 hb_codepoint_t first_glyph, hb_codepoint_t second_glyph, void *user_data)
204{
205 RGBA_Font_Int *fi = (RGBA_Font_Int *) font_data;
206 int kern;
207 (void) font;
208 (void) user_data;
209 if (evas_common_font_query_kerning(fi, first_glyph, second_glyph, &kern))
210 return kern;
211
212 return 0;
213}
214
215/* End of harfbuzz font funcs */
216
217static inline hb_font_funcs_t *
218_evas_common_font_ot_font_funcs_get(void)
219{
220 static hb_font_funcs_t *font_funcs = NULL;
221 if (!font_funcs)
222 {
223 font_funcs = hb_font_funcs_create();
224 hb_font_funcs_set_glyph_h_advance_func(font_funcs,
225 _evas_common_font_ot_hb_get_glyph_advance, NULL, NULL);
226 hb_font_funcs_set_glyph_h_kerning_func(font_funcs,
227 _evas_common_font_ot_hb_get_kerning, NULL, NULL);
228 }
229
230 return font_funcs;
231}
232
233static inline hb_unicode_funcs_t *
234_evas_common_font_ot_unicode_funcs_get(void)
235{
236 static hb_unicode_funcs_t *unicode_funcs = NULL;
237 if (!unicode_funcs)
238 {
239 unicode_funcs = hb_unicode_funcs_get_default();
240 }
241
242 return unicode_funcs;
243}
244
245static void
246_evas_common_font_ot_shape(hb_buffer_t *buffer, RGBA_Font_Int *fi)
247{
248 /* Create hb_font if not previously created */
249 if (!fi->ft.hb_font)
250 {
251 hb_font_t *hb_ft_font;
252
253 hb_ft_font = hb_ft_font_create(fi->src->ft.face, NULL);
254 fi->ft.hb_font = hb_font_create_sub_font(hb_ft_font);
255 hb_font_destroy(hb_ft_font);
256
257 hb_font_set_funcs(fi->ft.hb_font,
258 _evas_common_font_ot_font_funcs_get(), fi, NULL);
259 }
260
261 hb_shape(fi->ft.hb_font, buffer, NULL, 0);
262}
263
264EAPI Eina_Bool
265evas_common_font_ot_populate_text_props(const Eina_Unicode *text,
266 Evas_Text_Props *props, int len)
267{
268 RGBA_Font_Int *fi;
269 hb_buffer_t *buffer;
270 hb_glyph_position_t *positions;
271 hb_glyph_info_t *infos;
272 int slen;
273 unsigned int i;
274 Evas_Font_Glyph_Info *gl_itr;
275 Evas_Font_OT_Info *ot_itr;
276 Evas_Coord pen_x = 0;
277
278 fi = props->font_instance;
279
280 if (len < 0)
281 {
282 slen = eina_unicode_strlen(text);
283 }
284 else
285 {
286 slen = len;
287 }
288
289 buffer = hb_buffer_create();
290 hb_buffer_set_unicode_funcs(buffer, _evas_common_font_ot_unicode_funcs_get());
291 hb_buffer_set_language(buffer, hb_language_from_string(
292 evas_common_language_from_locale_get(), -1));
293 hb_buffer_set_script(buffer, _evas_script_to_harfbuzz[props->script]);
294 hb_buffer_set_direction(buffer,
295 (props->bidi.dir == EVAS_BIDI_DIRECTION_RTL) ?
296 HB_DIRECTION_RTL : HB_DIRECTION_LTR);
297 /* FIXME: add run-time conversions if needed, which is very unlikely */
298 hb_buffer_add_utf32(buffer, (const uint32_t *) text, slen, 0, slen);
299
300 _evas_common_font_ot_shape(buffer, fi);
301
302 props->len = hb_buffer_get_length(buffer);
303 props->info->ot = calloc(props->len,
304 sizeof(Evas_Font_OT_Info));
305 props->info->glyph = calloc(props->len,
306 sizeof(Evas_Font_Glyph_Info));
307 positions = hb_buffer_get_glyph_positions(buffer, NULL);
308 infos = hb_buffer_get_glyph_infos(buffer, NULL);
309 gl_itr = props->info->glyph;
310 ot_itr = props->info->ot;
311 for (i = 0 ; i < props->len ; i++)
312 {
313 Evas_Coord adv;
314 ot_itr->source_cluster = infos->cluster;
315 ot_itr->x_offset = positions->x_offset;
316 ot_itr->y_offset = positions->y_offset;
317 gl_itr->index = infos->codepoint;
318 adv = positions->x_advance;
319
320 pen_x += adv;
321 gl_itr->pen_after = EVAS_FONT_ROUND_26_6_TO_INT(pen_x);
322
323 ot_itr++;
324 gl_itr++;
325 infos++;
326 positions++;
327 }
328
329 hb_buffer_destroy(buffer);
330 evas_common_font_int_use_trim();
331
332 return EINA_FALSE;
333}
334
335#endif
336
diff --git a/libraries/evas/src/lib/engines/common/evas_font_ot.h b/libraries/evas/src/lib/engines/common/evas_font_ot.h
new file mode 100644
index 0000000..bc5ab02
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_font_ot.h
@@ -0,0 +1,45 @@
1#ifndef _EVAS_FONT_OT_H
2# define _EVAS_FONT_OT_H
3
4# ifdef HAVE_CONFIG_H
5# include "config.h"
6# endif
7
8# ifdef HAVE_HARFBUZZ
9# define OT_SUPPORT
10# define USE_HARFBUZZ
11# endif
12
13# ifdef OT_SUPPORT
14# include <stdlib.h>
15typedef struct _Evas_Font_OT_Info Evas_Font_OT_Info;
16# else
17typedef void *Evas_Font_OT_Info;
18# endif
19
20# include "Evas.h"
21
22# ifdef OT_SUPPORT
23struct _Evas_Font_OT_Info
24{
25 size_t source_cluster;
26 Evas_Coord x_offset;
27 Evas_Coord y_offset;
28};
29# endif
30
31# ifdef OT_SUPPORT
32# define EVAS_FONT_OT_X_OFF_GET(a) ((a).x_offset)
33# define EVAS_FONT_OT_Y_OFF_GET(a) ((a).y_offset)
34# define EVAS_FONT_OT_POS_GET(a) ((a).source_cluster)
35# endif
36
37# include "evas_text_utils.h"
38EAPI int
39evas_common_font_ot_cluster_size_get(const Evas_Text_Props *props, size_t char_index);
40
41EAPI Eina_Bool
42evas_common_font_ot_populate_text_props(const Eina_Unicode *text,
43 Evas_Text_Props *props, int len);
44#endif
45
diff --git a/libraries/evas/src/lib/engines/common/evas_font_private.h b/libraries/evas/src/lib/engines/common/evas_font_private.h
new file mode 100644
index 0000000..eed3faf
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_font_private.h
@@ -0,0 +1,52 @@
1#ifndef _EVAS_FONT_PRIVATE_H
2# define _EVAS_FONT_PRIVATE_H
3#include "evas_font_ot.h"
4
5#ifdef BUILD_PTHREAD
6extern LK(lock_font_draw); // for freetype2 API calls
7extern LK(lock_bidi); // for fribidi API calls
8extern LK(lock_ot); // for harfbuzz calls
9#endif
10
11# if defined(EVAS_FRAME_QUEUING) || defined(BUILD_PIPE_RENDER)
12# define FTLOCK() LKL(lock_font_draw)
13# define FTUNLOCK() LKU(lock_font_draw)
14
15# define BIDILOCK() LKL(lock_bidi)
16# define BIDIUNLOCK() LKU(lock_bidi)
17
18# define OTLOCK() LKL(lock_ot)
19# define OTUNLOCK() LKU(lock_ot)
20# else
21# define FTLOCK(x)
22# define FTUNLOCK(x)
23
24# define BIDILOCK()
25# define BIDIUNLOCK()
26
27/* Macros for text walking */
28# define OTLOCK()
29# define OTUNLOCK()
30# endif
31
32void evas_common_font_source_unload(RGBA_Font_Source *fs);
33void evas_common_font_source_reload(RGBA_Font_Source *fs);
34
35void evas_common_font_int_promote(RGBA_Font_Int *fi);
36void evas_common_font_int_use_increase(int size);
37void evas_common_font_int_use_trim(void);
38void evas_common_font_int_unload(RGBA_Font_Int *fi);
39void evas_common_font_int_reload(RGBA_Font_Int *fi);
40
41/* 6th bit is on is the same as frac part >= 0.5 */
42# define EVAS_FONT_ROUND_26_6_TO_INT(x) \
43 (((x + 0x20) & -0x40) >> 6)
44
45# define EVAS_FONT_CHARACTER_IS_INVISIBLE(x) ( \
46 ((0x200C <= (x)) && ((x) <= 0x200D)) || /* ZWNJ..ZWH */ \
47 ((0x200E <= (x)) && ((x) <= 0x200F)) || /* BIDI stuff */ \
48 ((0x202A <= (x)) && ((x) <= 0x202E)) /* BIDI stuff */ \
49 )
50
51# include "evas_font_default_walk.x"
52#endif /* !_EVAS_FONT_PRIVATE_H */
diff --git a/libraries/evas/src/lib/engines/common/evas_font_query.c b/libraries/evas/src/lib/engines/common/evas_font_query.c
new file mode 100644
index 0000000..af2cc84
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_font_query.c
@@ -0,0 +1,789 @@
1#include "evas_common.h"
2#include "language/evas_bidi_utils.h" /*defines BIDI_SUPPORT if possible */
3#include "evas_font_private.h" /* for Frame-Queuing support */
4#include "evas_font_ot.h"
5
6
7/* FIXME: Check coverage according to the font and not by actually loading */
8/**
9 * @internal
10 * Find the end of a run according to font coverage, and return the base script
11 * font and the current wanted font.
12 *
13 * @param[in] fn the font to use.
14 * @param script_fi The base font instance to be used with the script. If NULL, then it's calculated and returned in this variable, if not NULL, it's used and not modified.
15 * @param[out] cur_fi The font instance found for the current run.
16 * @param[in] script the base script
17 * @param[in] text the text to work on.
18 * @param[in] run_let the current run len, i.e "search limit".
19 * @return length of the run found.
20 */
21EAPI int
22evas_common_font_query_run_font_end_get(RGBA_Font *fn, RGBA_Font_Int **script_fi, RGBA_Font_Int **cur_fi, Evas_Script_Type script, const Eina_Unicode *text, int run_len)
23{
24 RGBA_Font_Int *fi = NULL;
25 const Eina_Unicode *run_end = text + run_len;
26 const Eina_Unicode *itr;
27
28 /* If there's no current script_fi, find it first */
29 if (!*script_fi)
30 {
31 const Eina_Unicode *base_char = NULL;
32 /* Skip common chars */
33 for (base_char = text ;
34 (base_char < run_end) &&
35 (evas_common_language_char_script_get(*base_char) != script) ;
36 base_char++)
37 ;
38 if (base_char == run_end) base_char = text;
39
40 /* Find the first renderable char */
41 while (base_char < run_end)
42 {
43 /* 0x1F is the last ASCII contral char, just a hack in
44 * the meanwhile. */
45 if ((*base_char > 0x1F) &&
46 evas_common_font_glyph_search(fn, &fi, *base_char))
47 break;
48 base_char++;
49 }
50
51
52 /* If everything else fails, at least try to find a font for the
53 * replacement char */
54 if (base_char == run_end)
55 evas_common_font_glyph_search(fn, &fi, REPLACEMENT_CHAR);
56
57 if (!fi)
58 fi = fn->fonts->data;
59
60 *script_fi = fi;
61 }
62 else
63 {
64 fi = *script_fi;
65 }
66
67 /* Find the longest run of the same font starting from the start position
68 * and update cur_fi accordingly. */
69 itr = text;
70 while (itr < run_end)
71 {
72 RGBA_Font_Int *tmp_fi;
73 /* Itr will end up being the first of the next run */
74 for ( ; itr < run_end ; itr++)
75 {
76 /* 0x1F is the last ASCII contral char, just a hack in
77 * the meanwhile. */
78 if (*itr <= 0x1F)
79 continue;
80 /* Break if either it's not in the font, or if it is in the
81 * script's font. */
82 if (fi == *script_fi)
83 {
84 if (!evas_common_get_char_index(fi, *itr))
85 break;
86 }
87 else
88 {
89 if (evas_common_get_char_index(*script_fi, *itr))
90 break;
91 }
92 }
93
94 /* Abort if we reached the end */
95 if (itr == run_end)
96 break;
97
98 /* If the script font doesn't fit even one char, find a new font. */
99 if (itr == text)
100 {
101 /* If we can find a font, use it. Otherwise, find the first
102 * char the run of chars that can't be rendered until the first
103 * one that can. */
104 if (evas_common_font_glyph_search(fn, &tmp_fi, *itr))
105 {
106 fi = tmp_fi;
107 }
108 else
109 {
110 itr++;
111 /* Go through all the chars that can't be rendered with any
112 * font */
113 for ( ; itr < run_end ; itr++)
114 {
115 tmp_fi = fi;
116 if (evas_common_get_char_index(fi, *itr) ||
117 evas_common_font_glyph_search(fn, &tmp_fi, *itr))
118 {
119 fi = tmp_fi;
120 break;
121 }
122 }
123
124 /* If we found a renderable character and the found font
125 * can render the replacement char, continue, otherwise
126 * find a font most suitable for the replacement char and
127 * break */
128 if ((itr == run_end) ||
129 !evas_common_get_char_index(fi, REPLACEMENT_CHAR))
130 {
131 evas_common_font_glyph_search(fn, &fi, REPLACEMENT_CHAR);
132 break;
133 }
134 }
135 itr++;
136 }
137 else
138 {
139 /* If this char is not renderable by any font, but the replacement
140 * char can be rendered using the currentfont, continue this
141 * run. */
142 if (!evas_common_font_glyph_search(fn, &tmp_fi, *itr) &&
143 evas_common_get_char_index(fi, REPLACEMENT_CHAR))
144 {
145 itr++;
146 }
147 else
148 {
149 /* Done, we did as much as possible */
150 break;
151 }
152 }
153 }
154
155 if (fi)
156 *cur_fi = fi;
157 else
158 *cur_fi = *script_fi;
159
160 return itr - text;
161}
162
163/**
164 * @internal
165 * Calculate the kerning between "left" and "right.
166 *
167 * @param fi the font instance to use
168 * @param left the left glyph index
169 * @param right the right glyph index
170 * @param[out] kerning the kerning calculated.
171 * @return FALSE on error, TRUE on success.
172 */
173EAPI int
174evas_common_font_query_kerning(RGBA_Font_Int *fi, FT_UInt left, FT_UInt right,
175 int *kerning)
176{
177 int *result;
178 FT_Vector delta;
179 int key[2];
180 int error = 1;
181
182 key[0] = left;
183 key[1] = right;
184
185 result = eina_hash_find(fi->kerning, key);
186 if (result)
187 {
188 *kerning = result[2];
189 goto on_correct;
190 }
191
192 /* NOTE: ft2 seems to have a bug. and sometimes returns bizarre
193 * values to kern by - given same font, same size and same
194 * prev_index and index. auto/bytecode or none hinting doesn't
195 * matter */
196 evas_common_font_int_reload(fi);
197 FTLOCK();
198 if (FT_Get_Kerning(fi->src->ft.face,
199 key[0], key[1],
200 FT_KERNING_DEFAULT, &delta) == 0)
201 {
202 int *push;
203
204 FTUNLOCK();
205 *kerning = delta.x;
206
207 push = malloc(sizeof (int) * 3);
208 if (!push) return 1;
209
210 push[0] = key[0];
211 push[1] = key[1];
212 push[2] = *kerning;
213
214 eina_hash_direct_add(fi->kerning, push, push);
215
216 goto on_correct;
217 }
218
219 FTUNLOCK();
220 error = 0;
221
222 on_correct:
223 return error;
224}
225
226/**
227 * @internal
228 * Calculate the inset of the text. Inset is the difference between the pen
229 * position of the first char in the string, and the first pixel drawn.
230 * (can be negative).
231 *
232 * @param fn the font set to use.
233 * @param text_props the string object.
234 * @return the calculated inset.
235 */
236EAPI int
237evas_common_font_query_inset(RGBA_Font *fn __UNUSED__, const Evas_Text_Props *text_props)
238{
239 if (!text_props->len) return 0;
240 return text_props->info->glyph[text_props->start].x_bear;
241}
242
243/**
244 * @internal
245 * Calculate the right inset of the text. This is the difference between the
246 * pen position of the glyph after the last glyph in the text, and the last
247 * pixel drawn in the text (essentially "advance - width" of the last char).
248 *
249 * @param fn the font set to use.
250 * @param text_props the string object.
251 * @return the calculated inset.
252 *
253 * @see evas_common_font_query_inset()
254 */
255EAPI int
256evas_common_font_query_right_inset(RGBA_Font *fn __UNUSED__, const Evas_Text_Props *text_props)
257{
258 const Evas_Font_Glyph_Info *gli;
259 if (!text_props->len) return 0;
260 gli = text_props->info->glyph + text_props->start + text_props->len - 1;
261
262 /* If the last char is a whitespace, we use the advance as the size,
263 * so the right_inset is 0. */
264 if (gli->width == 0)
265 return 0;
266
267 return ((gli > text_props->info->glyph) ?
268 gli->pen_after - (gli - 1)->pen_after : gli->pen_after) -
269 (gli->width + gli->x_bear
270#ifdef OT_SUPPORT
271 + EVAS_FONT_ROUND_26_6_TO_INT(EVAS_FONT_OT_X_OFF_GET(
272 text_props->info->ot[text_props->start + text_props->len - 1]))
273#endif
274 );
275}
276
277/**
278 * @internal
279 * Calculate the size of the string (width and height).
280 * The width is the disntance between the first pen position and the last pixel
281 * drawn.
282 * The height is the max ascent+descent of the font.
283 *
284 * @param fn the font set to use.
285 * @param text_props the string object.
286 * @param[out] w the calculated width
287 * @param[out] h the calculated height
288 */
289EAPI void
290evas_common_font_query_size(RGBA_Font *fn, const Evas_Text_Props *text_props, int *w, int *h)
291{
292 Evas_Coord ret_w = 0;
293
294 if (text_props->len > 0)
295 {
296 const Evas_Font_Glyph_Info *glyph = text_props->info->glyph +
297 text_props->start;
298 const Evas_Font_Glyph_Info *last_glyph = glyph;
299
300 if (text_props->len > 1)
301 {
302 last_glyph += text_props->len - 1;
303 ret_w = last_glyph[-1].pen_after;
304 if (text_props->start > 0)
305 ret_w -= glyph[-1].pen_after;
306 }
307#ifdef OT_SUPPORT
308 ret_w += EVAS_FONT_ROUND_26_6_TO_INT(EVAS_FONT_OT_X_OFF_GET(
309 text_props->info->ot[text_props->start + text_props->len - 1]));
310#endif
311 ret_w += last_glyph->width + last_glyph->x_bear;
312 }
313
314 if (w) *w = ret_w;
315 if (h) *h = evas_common_font_max_ascent_get(fn) + evas_common_font_max_descent_get(fn);
316}
317
318/**
319 * @internal
320 * Calculate the advance of the string. Advance is the distance between the
321 * first pen position and the pen position after the string.
322 *
323 * @param fn the font set to use.
324 * @param text_props the string object.
325 * @param[out] h_adv the calculated horizontal advance.
326 * @param[out] v_adv the calculated vertical advance.
327 */
328EAPI void
329evas_common_font_query_advance(RGBA_Font *fn, const Evas_Text_Props *text_props, int *h_adv, int *v_adv)
330{
331 Evas_Coord ret_adv = 0;
332 if (text_props->len > 0)
333 {
334 const Evas_Font_Glyph_Info *glyph = text_props->info->glyph +
335 text_props->start;
336 ret_adv = glyph[text_props->len - 1].pen_after;
337 if (text_props->start > 0)
338 ret_adv -= glyph[-1].pen_after;
339 }
340
341 if (h_adv) *h_adv = ret_adv;
342 if (v_adv) *v_adv = evas_common_font_get_line_advance(fn);
343}
344
345/**
346 * @internal
347 * Query the coordinates of the char at position pos. If the position is at the
348 * end of the string (i.e where the finishing null would be) it returns the
349 * coordinates of the position right after the last char. This is either on
350 * the left or on the right of the string, depending on BiDi direction. Returned
351 * width in this case is 0. It returns the x of the leftmost pixel drawn.
352 *
353 * @param fn the font set to use.
354 * @param text_props the string object.
355 * @param pos the position of the char in the string object (not actual position in the string object, but the position of the source character).
356 * @param[out] cx the calculated x - CAN BE NULL
357 * @param[out] cy the calculated y - CAN BE NULL
358 * @param[out] cw the calculated width - CAN BE NULL
359 * @param[out] ch the calculated height - CAN BE NULL
360 * @return TRUE on success, FALSE otherwise.
361 *
362 * @see evas_common_font_query_pen_coords()
363 */
364EAPI int
365evas_common_font_query_char_coords(RGBA_Font *fn, const Evas_Text_Props *text_props, int pos, int *cx, int *cy, int *cw, int *ch)
366{
367 int asc, desc;
368 size_t position = 0;
369 int ret_val = 0;
370 EVAS_FONT_WALK_TEXT_INIT();
371
372 asc = evas_common_font_max_ascent_get(fn);
373 desc = evas_common_font_max_descent_get(fn);
374
375 position = pos;
376 /* If it's the null, choose location according to the direction. */
377 if (position == text_props->text_len)
378 {
379 /* if it's rtl then the location is the left of the string,
380 * otherwise, the right. */
381#ifdef BIDI_SUPPORT
382 if (text_props->bidi.dir == EVAS_BIDI_DIRECTION_RTL)
383 {
384 if (cx) *cx = 0;
385 if (ch) *ch = asc + desc;
386 }
387 else
388#endif
389 {
390 evas_common_font_query_advance(fn, text_props, cx, ch);
391 }
392 if (cy) *cy = 0;
393 if (cw) *cw = 0;
394 ret_val = 1;
395 goto end;
396 }
397
398 Evas_Coord cluster_start = 0, last_end = 0;
399 int prev_cluster = -1;
400 int found = 0, items = 1, item_pos = 1;
401 int last_is_visible = 0;
402 EVAS_FONT_WALK_TEXT_START()
403 {
404 EVAS_FONT_WALK_TEXT_WORK();
405
406 if (prev_cluster != (int) EVAS_FONT_WALK_POS)
407 {
408 if (found)
409 {
410 break;
411 }
412 else
413 {
414 cluster_start = EVAS_FONT_WALK_PEN_X +
415 EVAS_FONT_WALK_X_OFF +
416 EVAS_FONT_WALK_X_BEAR;
417 }
418 }
419 last_is_visible = EVAS_FONT_WALK_IS_VISIBLE;
420 last_end = EVAS_FONT_WALK_PEN_X + EVAS_FONT_WALK_X_OFF +
421 EVAS_FONT_WALK_X_BEAR + EVAS_FONT_WALK_WIDTH;
422 /* we need to see if the char at the visual position is the char wanted */
423 if ((text_props->bidi.dir == EVAS_BIDI_DIRECTION_LTR) &&
424 (EVAS_FONT_WALK_POS <= (size_t) position) &&
425 ((((size_t) position) < EVAS_FONT_WALK_POS_NEXT) ||
426 (EVAS_FONT_WALK_IS_LAST)))
427 {
428 found = 1;
429#ifdef OT_SUPPORT
430 items = evas_common_font_ot_cluster_size_get(text_props,
431 char_index);
432#endif
433 item_pos = position - EVAS_FONT_WALK_POS + 1;
434 }
435 else if ((text_props->bidi.dir == EVAS_BIDI_DIRECTION_RTL) &&
436 ((EVAS_FONT_WALK_POS_PREV > (size_t) position) ||
437 (EVAS_FONT_WALK_IS_FIRST)) &&
438 (((size_t) position) >= EVAS_FONT_WALK_POS))
439 {
440 found = 1;
441#ifdef OT_SUPPORT
442 items = evas_common_font_ot_cluster_size_get(text_props,
443 char_index);
444#endif
445 item_pos = items - (position - EVAS_FONT_WALK_POS);
446 }
447
448 prev_cluster = EVAS_FONT_WALK_POS;
449 }
450 EVAS_FONT_WALK_TEXT_END();
451 if (found)
452 {
453 Evas_Coord cluster_w;
454 cluster_w = last_end - cluster_start;
455 if (cy) *cy = -asc;
456 if (ch) *ch = asc + desc;
457 if (last_is_visible)
458 {
459 if (cx) *cx = cluster_start +
460 (cluster_w / items) *
461 (item_pos - 1);
462 if (cw) *cw = (cluster_w / items);
463 }
464 else
465 {
466 if (cx) *cx = cluster_start;
467 if (cw) *cw = 0;
468 }
469 ret_val = 1;
470 goto end;
471 }
472end:
473
474 return ret_val;
475}
476
477/**
478 * @internal
479 * Query the coordinates of the char at position pos. If the position is at the
480 * end of the string (i.e where the finishing null would be) it returns the
481 * coordinates of the position right after the last char. This is either on
482 * the left or on the right of the string, depending on BiDi direction. Returned
483 * advance in this case is 0.
484 *
485 * This is the same as evas_common_font_query_char_coords() except that the
486 * advance of the character is returned instead of the width and the pen
487 * position is returned instead of the actual pixel position.
488 *
489 * @param fn the font set to use.
490 * @param text_props the string object.
491 * @param pos the position of the char in the string object (not actual position in the string object, but the position of the source character).
492 * @param[out] cpenx the calculated x - CAN BE NULL
493 * @param[out] cy the calculated y - CAN BE NULL
494 * @param[out] cadv the calculated advance - CAN BE NULL
495 * @param[out] ch the calculated height - CAN BE NULL
496 * @return TRUE on success, FALSE otherwise.
497 *
498 * @see evas_common_font_query_char_coords()
499 */
500EAPI int
501evas_common_font_query_pen_coords(RGBA_Font *fn, const Evas_Text_Props *text_props, int pos, int *cpen_x, int *cy, int *cadv, int *ch)
502{
503 int asc, desc;
504 size_t position;
505 int ret_val = 0;
506 EVAS_FONT_WALK_TEXT_INIT();
507
508 asc = evas_common_font_max_ascent_get(fn);
509 desc = evas_common_font_max_descent_get(fn);
510
511 position = pos;
512 /* If it's the null, choose location according to the direction. */
513 if (position == text_props->text_len)
514 {
515 /* if it's rtl then the location is the left of the string,
516 * otherwise, the right. */
517#ifdef BIDI_SUPPORT
518 if (text_props->bidi.dir == EVAS_BIDI_DIRECTION_RTL)
519 {
520 if (cpen_x) *cpen_x = 0;
521 if (ch) *ch = asc + desc;
522 }
523 else
524#endif
525 {
526 evas_common_font_query_advance(fn, text_props, cpen_x, ch);
527 }
528 if (cy) *cy = 0;
529 if (cadv) *cadv = 0;
530 ret_val = 1;
531 goto end;
532 }
533 Evas_Coord cluster_start = 0;
534 int prev_cluster = -1;
535 int found = 0, items = 1, item_pos = 1;
536 int last_is_visible = 0;
537 EVAS_FONT_WALK_TEXT_START()
538 {
539 EVAS_FONT_WALK_TEXT_WORK();
540
541 if (prev_cluster != (int) EVAS_FONT_WALK_POS)
542 {
543 if (found)
544 {
545 break;
546 }
547 else
548 {
549 cluster_start = EVAS_FONT_WALK_PEN_X;
550 }
551 }
552 last_is_visible = EVAS_FONT_WALK_IS_VISIBLE;
553
554 if ((text_props->bidi.dir == EVAS_BIDI_DIRECTION_LTR) &&
555 (EVAS_FONT_WALK_POS <= (size_t) position) &&
556 ((((size_t) position) < EVAS_FONT_WALK_POS_NEXT) ||
557 (EVAS_FONT_WALK_IS_LAST)))
558 {
559 found = 1;
560#ifdef OT_SUPPORT
561 items = evas_common_font_ot_cluster_size_get(text_props,
562 char_index);
563#endif
564 item_pos = position - EVAS_FONT_WALK_POS + 1;
565 }
566 else if ((text_props->bidi.dir == EVAS_BIDI_DIRECTION_RTL) &&
567 ((EVAS_FONT_WALK_POS_PREV > (size_t) position) ||
568 (EVAS_FONT_WALK_IS_FIRST)) &&
569 (((size_t) position) >= EVAS_FONT_WALK_POS))
570 {
571 found = 1;
572#ifdef OT_SUPPORT
573 items = evas_common_font_ot_cluster_size_get(text_props,
574 char_index);
575#endif
576 item_pos = items - (position - EVAS_FONT_WALK_POS);
577 }
578
579 prev_cluster = EVAS_FONT_WALK_POS;
580 }
581 EVAS_FONT_WALK_TEXT_END();
582
583 if (found)
584 {
585 Evas_Coord cluster_adv;
586 cluster_adv = EVAS_FONT_WALK_PEN_X - cluster_start;
587 if (cy) *cy = -asc;
588 if (ch) *ch = asc + desc;
589 if (last_is_visible)
590 {
591 if (cpen_x) *cpen_x = cluster_start +
592 (cluster_adv / items) *
593 (item_pos - 1);
594 if (cadv) *cadv = (cluster_adv / items);
595 }
596 else
597 {
598 if (cpen_x) *cpen_x = EVAS_FONT_WALK_PEN_X;
599 if (cadv) *cadv = 0;
600 }
601 ret_val = 1;
602 goto end;
603 }
604end:
605
606 return ret_val;
607}
608
609/**
610 * @internal
611 * Find the character at a specific x, y coordinates and return it's position
612 * in the text (not in the text object, but in the source text). Also calculate
613 * the char's geometry.
614 *
615 * @param fn the font set to use.
616 * @param text_props the string object.
617 * @param x the x to look at.
618 * @param y the y to look at.
619 * @param[out] cx the calculated x - CAN BE NULL
620 * @param[out] cy the calculated y - CAN BE NULL
621 * @param[out] cw the calculated width - CAN BE NULL
622 * @param[out] ch the calculated height - CAN BE NULL
623 * @return the position found, -1 on failure.
624 */
625EAPI int
626evas_common_font_query_char_at_coords(RGBA_Font *fn, const Evas_Text_Props *text_props, int x, int y, int *cx, int *cy, int *cw, int *ch)
627{
628 int asc, desc;
629 int ret_val = -1;
630 EVAS_FONT_WALK_TEXT_INIT();
631
632 asc = evas_common_font_max_ascent_get(fn);
633 desc = evas_common_font_max_descent_get(fn);
634 Evas_Coord cluster_start = 0;
635 int prev_cluster = -1;
636 int found = 0, items = 1;
637 EVAS_FONT_WALK_TEXT_START()
638 {
639 EVAS_FONT_WALK_TEXT_WORK();
640 if (prev_cluster != (int) EVAS_FONT_WALK_POS)
641 {
642 if (found)
643 {
644 break;
645 }
646 else
647 {
648 cluster_start = EVAS_FONT_WALK_PEN_X;
649 }
650 }
651
652 if (!EVAS_FONT_WALK_IS_VISIBLE) continue;
653
654 /* we need to see if the char at the visual position is the char,
655 * we check that by checking if it's before the current pen
656 * position and the next */
657 if ((x >= EVAS_FONT_WALK_PEN_X) &&
658 (x <= (EVAS_FONT_WALK_PEN_X_AFTER)) && (y >= -asc) && (y <= desc))
659 {
660#ifdef OT_SUPPORT
661 items = evas_common_font_ot_cluster_size_get(text_props,
662 char_index);
663#endif
664 found = 1;
665 }
666
667 prev_cluster = EVAS_FONT_WALK_POS;
668 }
669 EVAS_FONT_WALK_TEXT_END();
670 if (found)
671 {
672 int item_pos;
673 Evas_Coord cluster_adv;
674 cluster_adv = EVAS_FONT_WALK_PEN_X - cluster_start;
675
676 if (text_props->bidi.dir == EVAS_BIDI_DIRECTION_LTR)
677 {
678 double part;
679 part = cluster_adv / items;
680 item_pos = (int) ((x - cluster_start) / part);
681 }
682 else
683 {
684 double part;
685 part = cluster_adv / items;
686 item_pos = items - ((int) ((x - cluster_start) / part)) - 1;
687 }
688 if (cx) *cx = EVAS_FONT_WALK_PEN_X +
689 ((cluster_adv / items) * (item_pos - 1));
690 if (cy) *cy = -asc;
691 if (cw) *cw = (cluster_adv / items);
692 if (ch) *ch = asc + desc;
693 ret_val = prev_cluster + item_pos;
694 goto end;
695 }
696end:
697
698 return ret_val;
699}
700
701/**
702 * @internal
703 * Find one after the last character that fits until the boundaries set by x
704 * and y. I.e find the first char that doesn't fit.
705 * This LOGICALLY walks the string. This is needed for wrapping for example
706 * where we want the first part to be the first logical part.
707 *
708 * @param fn the font set to use.
709 * @param text_props the string object.
710 * @param x the x boundary.
711 * @param y the y boundary.
712 * @return the position found, -1 on failure.
713 */
714EAPI int
715evas_common_font_query_last_up_to_pos(RGBA_Font *fn, const Evas_Text_Props *text_props, int x, int y)
716{
717 int asc, desc;
718 int ret=-1;
719
720 asc = evas_common_font_max_ascent_get(fn);
721 desc = evas_common_font_max_descent_get(fn);
722
723#ifdef BIDI_SUPPORT
724 if (text_props->bidi.dir == EVAS_BIDI_DIRECTION_RTL)
725 {
726 Evas_Font_Glyph_Info *gli = NULL;
727 Evas_Coord full_adv = 0, pen_x = 0, start_pen = 0;
728 int i;
729
730 if ((text_props->info) && (text_props->len > 0))
731 {
732 gli = text_props->info->glyph + text_props->start;
733 full_adv = gli[text_props->len - 1].pen_after;
734 if (text_props->start > 0)
735 {
736 start_pen = gli[-1].pen_after;
737 full_adv -= start_pen;
738 }
739
740 gli += text_props->len - 1;
741
742 for (i = text_props->len - 1 ; i >= 0 ; i--, gli--)
743 {
744 pen_x = full_adv - (gli->pen_after - start_pen);
745 /* If invisible, skip */
746 if (gli->index == 0) continue;
747 if ((x >= pen_x) &&
748 (((i == 0) && (x <= full_adv)) ||
749 (x <= (full_adv - (gli[-1].pen_after - start_pen)))) &&
750 (y >= -asc) && (y <= desc))
751 {
752#ifdef OT_SUPPORT
753 ret = EVAS_FONT_OT_POS_GET(
754 text_props->info->ot[text_props->start + i]) -
755 text_props->text_offset;
756#else
757 ret = text_props->text_len - i - 1;
758#endif
759 goto end;
760 }
761 }
762 }
763 }
764 else
765#endif
766 {
767 EVAS_FONT_WALK_TEXT_INIT();
768 /* When text is not rtl, visual direction = logical direction */
769 EVAS_FONT_WALK_TEXT_START()
770 {
771 EVAS_FONT_WALK_TEXT_WORK();
772 if (!EVAS_FONT_WALK_IS_VISIBLE) continue;
773
774 if ((x >= EVAS_FONT_WALK_PEN_X) &&
775 (x <= (EVAS_FONT_WALK_PEN_X_AFTER)) &&
776 (y >= -asc) && (y <= desc))
777 {
778 ret = EVAS_FONT_WALK_POS;
779 goto end;
780 }
781 }
782 EVAS_FONT_WALK_TEXT_END();
783 }
784
785end:
786
787 return ret;
788}
789
diff --git a/libraries/evas/src/lib/engines/common/evas_image.h b/libraries/evas/src/lib/engines/common/evas_image.h
new file mode 100644
index 0000000..300697c
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_image.h
@@ -0,0 +1,63 @@
1#ifndef _EVAS_IMAGE_H
2#define _EVAS_IMAGE_H
3
4
5EAPI void evas_common_image_init (void);
6EAPI void evas_common_image_shutdown (void);
7
8EAPI void evas_common_image_image_all_unload (void);
9
10EAPI void evas_common_rgba_image_free (Image_Entry *ie);
11EAPI void evas_common_rgba_image_unload (Image_Entry *ie);
12EAPI void evas_common_image_colorspace_normalize (RGBA_Image *im);
13EAPI void evas_common_image_colorspace_dirty (RGBA_Image *im);
14EAPI void evas_common_image_cache_free (void); /*2*/
15EAPI void evas_common_image_premul (Image_Entry *ie); /*2*/
16EAPI void evas_common_image_set_alpha_sparse (Image_Entry *ie); /*2*/
17/* EAPI RGBA_Image *evas_common_image_alpha_create (int w, int h); */
18/* EAPI RGBA_Image *evas_common_image_create (int w, int h); */
19EAPI RGBA_Image *evas_common_image_new (unsigned int w, unsigned int h, unsigned int alpha);
20EAPI Evas_Cache_Image *evas_common_image_cache_get (void);
21
22EAPI void evas_common_image_set_cache (unsigned int size);
23EAPI int evas_common_image_get_cache (void);
24
25EAPI RGBA_Image *evas_common_image_line_buffer_obtain (int len);
26EAPI void evas_common_image_line_buffer_release (RGBA_Image *im);
27
28EAPI RGBA_Image *evas_common_image_alpha_line_buffer_obtain (int len);
29EAPI void evas_common_image_alpha_line_buffer_release (RGBA_Image *im);
30EAPI void evas_common_image_alpha_line_buffer_free (RGBA_Image *im);
31
32EAPI RGBA_Image *evas_common_load_image_from_file (const char *file, const char *key, RGBA_Image_Loadopts *lo, int *error);
33EAPI int evas_common_save_image_to_file (RGBA_Image *im, const char *file, const char *key, int quality, int compress);
34
35EAPI void evas_common_rgba_image_scalecache_size_set(unsigned int size);
36EAPI unsigned int evas_common_rgba_image_scalecache_size_get(void);
37EAPI void evas_common_rgba_image_scalecache_flush(void);
38EAPI void evas_common_rgba_image_scalecache_dump(void);
39EAPI void
40 evas_common_rgba_image_scalecache_prepare(Image_Entry *ie, RGBA_Image *dst,
41 RGBA_Draw_Context *dc, int smooth,
42 int src_region_x, int src_region_y,
43 int src_region_w, int src_region_h,
44 int dst_region_x, int dst_region_y,
45 int dst_region_w, int dst_region_h);
46EAPI void
47 evas_common_rgba_image_scalecache_do(Image_Entry *ie, RGBA_Image *dst,
48 RGBA_Draw_Context *dc, int smooth,
49 int src_region_x, int src_region_y,
50 int src_region_w, int src_region_h,
51 int dst_region_x, int dst_region_y,
52 int dst_region_w, int dst_region_h);
53
54
55EAPI int evas_common_load_rgba_image_module_from_file (Image_Entry *im);
56EAPI int evas_common_load_rgba_image_data_from_file (Image_Entry *im);
57EAPI double evas_common_load_rgba_image_frame_duration_from_file(Image_Entry *im, int start_frame, int frame_num);
58
59void _evas_common_rgba_image_post_surface(Image_Entry *ie);
60
61EAPI Eina_Bool evas_common_extension_can_load_get(const char *file);
62
63#endif /* _EVAS_IMAGE_H */
diff --git a/libraries/evas/src/lib/engines/common/evas_image_data.c b/libraries/evas/src/lib/engines/common/evas_image_data.c
new file mode 100644
index 0000000..10b3988
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_image_data.c
@@ -0,0 +1,147 @@
1#include <assert.h>
2
3#include "evas_common.h"
4#include "evas_private.h"
5#include "evas_image.h"
6
7int
8evas_common_rgba_image_from_data(Image_Entry* ie_dst, int w, int h, DATA32 *image_data, int alpha, int cspace)
9{
10 RGBA_Image *dst = (RGBA_Image *) ie_dst;
11
12 switch (cspace)
13 {
14 case EVAS_COLORSPACE_ARGB8888:
15 dst->cache_entry.w = w;
16 dst->cache_entry.h = h;
17 dst->image.data = image_data;
18 dst->image.no_free = 1;
19 dst->cache_entry.flags.alpha = alpha ? 1 : 0;
20 break;
21 case EVAS_COLORSPACE_YCBCR422P601_PL:
22 case EVAS_COLORSPACE_YCBCR422P709_PL:
23 case EVAS_COLORSPACE_YCBCR422601_PL:
24 case EVAS_COLORSPACE_YCBCR420TM12601_PL:
25 case EVAS_COLORSPACE_YCBCR420NV12601_PL:
26 w &= ~0x1;
27 dst->cache_entry.w = w;
28 dst->cache_entry.h = h;
29 dst->cs.data = image_data;
30 dst->cs.no_free = 1;
31 break;
32 default:
33 abort();
34 break;
35 }
36 dst->cache_entry.space = cspace;
37 evas_common_image_colorspace_dirty(dst);
38 _evas_common_rgba_image_post_surface(ie_dst);
39 return 0;
40}
41
42int
43evas_common_rgba_image_from_copied_data(Image_Entry* ie_dst, int w, int h, DATA32 *image_data, int alpha, int cspace)
44{
45 RGBA_Image *dst = (RGBA_Image *) ie_dst;
46
47 /* FIXME: Is dst->image.data valid. */
48 switch (cspace)
49 {
50 case EVAS_COLORSPACE_ARGB8888:
51 dst->cache_entry.flags.alpha = alpha ? 1 : 0;
52 if (image_data)
53 memcpy(dst->image.data, image_data, w * h * sizeof(DATA32));
54 break;
55 case EVAS_COLORSPACE_YCBCR422P601_PL:
56 case EVAS_COLORSPACE_YCBCR422P709_PL:
57 case EVAS_COLORSPACE_YCBCR422601_PL:
58 case EVAS_COLORSPACE_YCBCR420TM12601_PL:
59 case EVAS_COLORSPACE_YCBCR420NV12601_PL:
60 dst->cs.data = calloc(1, dst->cache_entry.h * sizeof(unsigned char*) * 2);
61 if (image_data && (dst->cs.data))
62 memcpy(dst->cs.data, image_data, dst->cache_entry.h * sizeof(unsigned char*) * 2);
63 break;
64 default:
65 abort();
66 break;
67 }
68
69 dst->cache_entry.space = cspace;
70 evas_common_image_colorspace_dirty(dst);
71 _evas_common_rgba_image_post_surface(ie_dst);
72 return 0;
73}
74
75int
76evas_common_rgba_image_size_set(Image_Entry *ie_dst, const Image_Entry *ie_im, unsigned int w, unsigned int h __UNUSED__)
77{
78 RGBA_Image *dst = (RGBA_Image *) ie_dst;
79 RGBA_Image *im = (RGBA_Image *) ie_im;
80
81 if ((im->cache_entry.space == EVAS_COLORSPACE_YCBCR422P601_PL) ||
82 (im->cache_entry.space == EVAS_COLORSPACE_YCBCR422P709_PL) ||
83 (im->cache_entry.space == EVAS_COLORSPACE_YCBCR422601_PL) ||
84 (im->cache_entry.space == EVAS_COLORSPACE_YCBCR420TM12601_PL) ||
85 (im->cache_entry.space == EVAS_COLORSPACE_YCBCR420NV12601_PL))
86 {
87 w &= ~0x1;
88 dst->cs.data = calloc(1, dst->cache_entry.h * sizeof(unsigned char *) * 2);
89 }
90
91 dst->flags = im->flags;
92 dst->cs.no_free = 0;
93 evas_common_image_colorspace_dirty(dst);
94
95 _evas_common_rgba_image_post_surface(ie_dst);
96 return 0;
97}
98
99int
100evas_common_rgba_image_colorspace_set(Image_Entry* ie_dst, int cspace)
101{
102 RGBA_Image *dst = (RGBA_Image *) ie_dst;
103
104 switch (cspace)
105 {
106 case EVAS_COLORSPACE_ARGB8888:
107 if (dst->cs.data)
108 {
109 if (!dst->cs.no_free) free(dst->cs.data);
110 dst->cs.data = NULL;
111 dst->cs.no_free = 0;
112 }
113 break;
114 case EVAS_COLORSPACE_YCBCR422P601_PL:
115 case EVAS_COLORSPACE_YCBCR422P709_PL:
116 case EVAS_COLORSPACE_YCBCR422601_PL:
117 case EVAS_COLORSPACE_YCBCR420TM12601_PL:
118 case EVAS_COLORSPACE_YCBCR420NV12601_PL:
119 if (dst->image.no_free)
120 {
121 ie_dst->allocated.w = 0;
122 ie_dst->allocated.h = 0;
123#ifdef BUILD_ASYNC_PRELOAD
124 ie_dst->flags.preload_done = 0;
125#endif
126 ie_dst->flags.loaded = 0;
127 dst->image.data = NULL;
128 dst->image.no_free = 0;
129 /* FIXME: Must allocate image.data surface cleanly. */
130 }
131 if (dst->cs.data)
132 {
133 if (!dst->cs.no_free) free(dst->cs.data);
134 }
135 dst->cs.data = calloc(1, dst->cache_entry.h * sizeof(unsigned char *) * 2);
136 dst->cs.no_free = 0;
137 break;
138 default:
139 abort();
140 break;
141 }
142 dst->cache_entry.space = cspace;
143 evas_common_image_colorspace_dirty(dst);
144
145 _evas_common_rgba_image_post_surface(ie_dst);
146 return 0;
147}
diff --git a/libraries/evas/src/lib/engines/common/evas_image_load.c b/libraries/evas/src/lib/engines/common/evas_image_load.c
new file mode 100644
index 0000000..c7eff3f
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_image_load.c
@@ -0,0 +1,381 @@
1#include <sys/types.h>
2#include <sys/stat.h>
3#include <unistd.h>
4
5#include "evas_common.h"
6#include "evas_private.h"
7#include "evas_cs.h"
8
9struct ext_loader_s
10{
11 unsigned int length;
12 const char *extension;
13 const char *loader;
14};
15
16#define MATCHING(Ext, Module) \
17 { sizeof (Ext), Ext, Module }
18
19static const struct ext_loader_s loaders[] =
20{ /* map extensions to loaders to use for good first-guess tries */
21 MATCHING(".png", "png"),
22 MATCHING(".jpg", "jpeg"),
23 MATCHING(".jpeg", "jpeg"),
24 MATCHING(".jfif", "jpeg"),
25 MATCHING(".eet", "eet"),
26 MATCHING(".edj", "eet"),
27 MATCHING(".eap", "eet"),
28 MATCHING(".edb", "edb"),
29 MATCHING(".xpm", "xpm"),
30 MATCHING(".tiff", "tiff"),
31 MATCHING(".tif", "tiff"),
32 MATCHING(".svg", "svg"),
33 MATCHING(".svgz", "svg"),
34 MATCHING(".svg.gz", "svg"),
35 MATCHING(".gif", "gif"),
36 MATCHING(".pbm", "pmaps"),
37 MATCHING(".pgm", "pmaps"),
38 MATCHING(".ppm", "pmaps"),
39 MATCHING(".pnm", "pmaps"),
40 MATCHING(".bmp", "bmp"),
41 MATCHING(".tga", "tga"),
42 MATCHING(".wbmp", "wbmp"),
43 MATCHING(".ico", "ico"),
44 MATCHING(".cur", "ico"),
45 MATCHING(".psd", "psd"),
46 MATCHING(".pdf", "generic"),
47 MATCHING(".ps", "generic"),
48 MATCHING(".xcf", "generic"),
49 MATCHING(".xcf.gz", "generic"),
50 /* RAW */
51 MATCHING(".arw", "generic"),
52 MATCHING(".cr2", "generic"),
53 MATCHING(".crw", "generic"),
54 MATCHING(".dcr", "generic"),
55 MATCHING(".dng", "generic"),
56 MATCHING(".k25", "generic"),
57 MATCHING(".kdc", "generic"),
58 MATCHING(".erf", "generic"),
59 MATCHING(".mrw", "generic"),
60 MATCHING(".nef", "generic"),
61 MATCHING(".nrf", "generic"),
62 MATCHING(".nrw", "generic"),
63 MATCHING(".orf", "generic"),
64 MATCHING(".raw", "generic"),
65 MATCHING(".rw2", "generic"),
66 MATCHING(".pef", "generic"),
67 MATCHING(".raf", "generic"),
68 MATCHING(".sr2", "generic"),
69 MATCHING(".srf", "generic"),
70 MATCHING(".x3f", "generic"),
71 /* video */
72 MATCHING(".264", "generic"),
73 MATCHING(".3g2", "generic"),
74 MATCHING(".3gp", "generic"),
75 MATCHING(".3gp2", "generic"),
76 MATCHING(".3gpp", "generic"),
77 MATCHING(".3gpp2", "generic"),
78 MATCHING(".3p2", "generic"),
79 MATCHING(".asf", "generic"),
80 MATCHING(".avi", "generic"),
81 MATCHING(".bdm", "generic"),
82 MATCHING(".bdmv", "generic"),
83 MATCHING(".clpi", "generic"),
84 MATCHING(".clp", "generic"),
85 MATCHING(".fla", "generic"),
86 MATCHING(".flv", "generic"),
87 MATCHING(".m1v", "generic"),
88 MATCHING(".m2v", "generic"),
89 MATCHING(".m2t", "generic"),
90 MATCHING(".m4v", "generic"),
91 MATCHING(".mkv", "generic"),
92 MATCHING(".mov", "generic"),
93 MATCHING(".mp2", "generic"),
94 MATCHING(".mp2ts", "generic"),
95 MATCHING(".mp4", "generic"),
96 MATCHING(".mpe", "generic"),
97 MATCHING(".mpeg", "generic"),
98 MATCHING(".mpg", "generic"),
99 MATCHING(".mpl", "generic"),
100 MATCHING(".mpls", "generic"),
101 MATCHING(".mts", "generic"),
102 MATCHING(".mxf", "generic"),
103 MATCHING(".nut", "generic"),
104 MATCHING(".nuv", "generic"),
105 MATCHING(".ogg", "generic"),
106 MATCHING(".ogm", "generic"),
107 MATCHING(".ogv", "generic"),
108 MATCHING(".rm", "generic"),
109 MATCHING(".rmj", "generic"),
110 MATCHING(".rmm", "generic"),
111 MATCHING(".rms", "generic"),
112 MATCHING(".rmx", "generic"),
113 MATCHING(".rmvb", "generic"),
114 MATCHING(".swf", "generic"),
115 MATCHING(".ts", "generic"),
116 MATCHING(".weba", "generic"),
117 MATCHING(".webm", "generic"),
118 MATCHING(".wmv", "generic")
119};
120
121static const char *loaders_name[] =
122{ /* in order of most likely needed */
123 "png", "jpeg", "eet", "xpm", "tiff", "gif", "svg", "pmaps", "bmp", "tga", "wbmp", "ico", "psd", "edb", "generic"
124};
125
126struct evas_image_foreach_loader_data
127{
128 Image_Entry *ie;
129 int *error;
130 Evas_Module *em;
131};
132
133
134static Eina_Bool
135_evas_image_foreach_loader(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED__, void *data, void *fdata)
136{
137 Evas_Image_Load_Func *evas_image_load_func = NULL;
138 Evas_Module *em = data;
139 struct evas_image_foreach_loader_data *d = fdata;
140 Image_Entry *ie = d->ie;
141
142 if (!evas_module_load(em)) return EINA_TRUE;
143 evas_image_load_func = em->functions;
144 evas_module_use(em);
145 *(d->error) = EVAS_LOAD_ERROR_NONE;
146 if (evas_image_load_func &&
147 evas_image_load_func->file_head(ie, ie->file, ie->key, d->error) &&
148 (*(d->error) == EVAS_LOAD_ERROR_NONE))
149 {
150 d->em = em;
151 return EINA_FALSE;
152 }
153
154 return EINA_TRUE;
155}
156
157EAPI int
158evas_common_load_rgba_image_module_from_file(Image_Entry *ie)
159{
160 Evas_Image_Load_Func *evas_image_load_func = NULL;
161 const char *loader = NULL, *end;
162 Evas_Module *em;
163 struct stat st;
164 unsigned int i;
165 int len, ret = EVAS_LOAD_ERROR_NONE;
166 struct evas_image_foreach_loader_data fdata;
167
168
169#ifdef EVAS_CSERVE
170 if (evas_cserve_use_get())
171 {
172 // TODO: handle errors from server and return them?
173 DBG("try cserve '%s' '%s'", ie->file, ie->key ? ie->key : "");
174 if (evas_cserve_image_load(ie, ie->file, ie->key, &(ie->load_opts)))
175 {
176 DBG("try cserve '%s' '%s' loaded!",
177 ie->file, ie->key ? ie->key : "");
178 return EVAS_LOAD_ERROR_NONE;
179 }
180 }
181#endif
182 if (stat(ie->file, &st) != 0 || S_ISDIR(st.st_mode))
183 {
184 DBG("trying to open directory '%s' !", ie->file);
185 return EVAS_LOAD_ERROR_DOES_NOT_EXIST;
186 }
187
188 len = strlen(ie->file);
189 end = ie->file + len;
190 for (i = 0; i < (sizeof (loaders) / sizeof(struct ext_loader_s)); i++)
191 {
192 int len2 = strlen(loaders[i].extension);
193 if (len2 > len) continue;
194 if (!strcasecmp(end - len2, loaders[i].extension))
195 {
196 loader = loaders[i].loader;
197 DBG("known loader '%s' handles extension '%s' of file '%s'",
198 loader, end - len2, ie->file);
199 break;
200 }
201 }
202
203 if (loader)
204 {
205 em = evas_module_find_type(EVAS_MODULE_TYPE_IMAGE_LOADER, loader);
206 if (em)
207 {
208 DBG("found image loader '%s' (%p)", loader, em);
209 if (evas_module_load(em))
210 {
211 evas_module_use(em);
212 evas_image_load_func = em->functions;
213 ret = EVAS_LOAD_ERROR_NONE;
214 if (evas_image_load_func->file_head(ie, ie->file, ie->key, &ret))
215 {
216 DBG("loaded file head using module '%s' (%p): %s",
217 loader, em, ie->file);
218 goto end;
219 }
220 evas_module_unload(em);
221 INF("failed to load file head using module '%s' (%p): "
222 "%s (%s)",
223 loader, em, ie->file, evas_load_error_str(ret));
224 }
225 else
226 WRN("failed to load module '%s' (%p)", loader, em);
227 }
228 else
229 INF("image loader '%s' is not enabled or missing!", loader);
230 }
231
232 fdata.ie = ie;
233 fdata.error = &ret;
234 fdata.em = NULL;
235 ret = EVAS_LOAD_ERROR_NONE;
236 evas_module_foreach_image_loader(_evas_image_foreach_loader, &fdata);
237 em = fdata.em;
238 evas_image_load_func = em ? em->functions : NULL;
239 if (em) goto end;
240
241 /* This is our last chance, try all known image loader. */
242 /* FIXME: We could use eina recursive module search ability. */
243 for (i = 0; i < sizeof (loaders_name) / sizeof (char *); i++)
244 {
245 em = evas_module_find_type(EVAS_MODULE_TYPE_IMAGE_LOADER, loaders_name[i]);
246 if (em)
247 {
248 if (evas_module_load(em))
249 {
250 evas_module_use(em);
251 evas_image_load_func = em->functions;
252 ret = EVAS_LOAD_ERROR_NONE;
253 if (evas_image_load_func->file_head(ie, ie->file, ie->key, &ret))
254 {
255 DBG("brute force loader '%s' (%p) worked on %s",
256 loaders_name[i], em, ie->file);
257 goto end;
258 }
259 else
260 INF("brute force loader '%s' (%p) failed on %s (%s)",
261 loaders_name[i], em, ie->file,
262 evas_load_error_str(ret));
263
264 evas_module_unload(em);
265 }
266 else
267 INF("failed to load module '%s' (%p)", loaders_name[i], em);
268 }
269 else
270 DBG("could not find module '%s'", loaders_name[i]);
271 }
272
273 INF("exhausted all means to load image '%s'", ie->file);
274 return EVAS_LOAD_ERROR_UNKNOWN_FORMAT;
275
276 end:
277
278 if (ret != EVAS_LOAD_ERROR_NONE)
279 {
280 const char *modname = NULL;
281 int modversion = -1;
282 if (em && em->definition)
283 {
284 modname = em->definition->name;
285 modversion = em->definition->version;
286 }
287 WRN("loader '%s' (version %d) "
288 "handled file '%s', key '%s' with errors: %s",
289 modname ? modname : "<UNKNOWN>", modversion,
290 ie->file, ie->key ? ie->key : "",
291 evas_load_error_str(ret));
292 goto end;
293 }
294
295 DBG("loader '%s' used for file %s",
296 (em && em->definition && em->definition->name) ?
297 em->definition->name : "<UNKNOWN>",
298 ie->file);
299
300 ie->info.module = (void*) em;
301 ie->info.loader = (void*) evas_image_load_func;
302 evas_module_ref((Evas_Module*) ie->info.module);
303 return ret;
304}
305
306EAPI int
307evas_common_load_rgba_image_data_from_file(Image_Entry *ie)
308{
309 Evas_Image_Load_Func *evas_image_load_func = NULL;
310 int ret = EVAS_LOAD_ERROR_NONE;
311
312 if ((ie->flags.loaded) && (!ie->flags.animated)) return EVAS_LOAD_ERROR_GENERIC;
313
314#ifdef EVAS_CSERVE
315 if (ie->data1)
316 {
317 if (evas_cserve_image_data_load(ie))
318 {
319 RGBA_Image *im = (RGBA_Image *)ie;
320 Mem *mem = ie->data2;
321 if (mem)
322 {
323 im->image.data = (void*) (mem->data + mem->offset);
324 im->image.no_free = 1;
325 return EVAS_LOAD_ERROR_NONE;
326 }
327 }
328 return EVAS_LOAD_ERROR_GENERIC;
329 }
330#endif
331
332 if (!ie->info.module) return EVAS_LOAD_ERROR_GENERIC;
333
334// printf("load data [%p] %s %s\n", ie, ie->file, ie->key);
335
336 evas_image_load_func = ie->info.loader;
337 evas_module_use((Evas_Module*) ie->info.module);
338 if (!evas_image_load_func->file_data(ie, ie->file, ie->key, &ret))
339 {
340 return ret;
341 }
342
343// evas_module_unref((Evas_Module*) ie->info.module);
344// ie->info.module = NULL;
345
346 return EVAS_LOAD_ERROR_NONE;
347}
348
349EAPI double
350evas_common_load_rgba_image_frame_duration_from_file(Image_Entry *ie, const int start, const int frame_num)
351{
352 Evas_Image_Load_Func *evas_image_load_func = NULL;
353
354 if (!ie->info.module) return -1;
355
356 evas_image_load_func = ie->info.loader;
357 evas_module_use((Evas_Module*) ie->info.module);
358 if (evas_image_load_func->frame_duration)
359 return evas_image_load_func->frame_duration(ie, ie->file, start, frame_num);
360 return -1;
361}
362
363EAPI Eina_Bool
364evas_common_extension_can_load_get(const char *file)
365{
366 unsigned int length;
367 unsigned int i;
368
369 length = eina_stringshare_strlen(file) + 1;
370 if (length < 5) return EINA_FALSE;
371
372 for (i = 0; i < sizeof (loaders) / sizeof (struct ext_loader_s); ++i)
373 {
374 if (loaders[i].length > length) continue;
375
376 if (!strcasecmp(loaders[i].extension, file + length - loaders[i].length))
377 return EINA_TRUE;
378 }
379
380 return EINA_FALSE;
381}
diff --git a/libraries/evas/src/lib/engines/common/evas_image_main.c b/libraries/evas/src/lib/engines/common/evas_image_main.c
new file mode 100644
index 0000000..d4d847c
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_image_main.c
@@ -0,0 +1,818 @@
1#ifdef HAVE_CONFIG_H
2# include "config.h" /* so that EAPI in Eet.h is correctly defined */
3#endif
4
5#ifdef BUILD_LOADER_EET
6# include <Eet.h>
7#endif
8
9#include "evas_common.h"
10#include "evas_private.h"
11#include "evas_image_private.h"
12#include "evas_convert_yuv.h"
13#include "evas_cs.h"
14
15#ifdef HAVE_VALGRIND
16# include <memcheck.h>
17#endif
18
19static Evas_Cache_Image * eci = NULL;
20static int reference = 0;
21
22/* static RGBA_Image *evas_rgba_line_buffer = NULL; */
23
24#define EVAS_RGBA_LINE_BUFFER_MIN_LEN 256
25#define EVAS_RGBA_LINE_BUFFER_MAX_LEN 2048
26
27/* static RGBA_Image *evas_alpha_line_buffer = NULL; */
28
29#define EVAS_ALPHA_LINE_BUFFER_MIN_LEN 256
30#define EVAS_ALPHA_LINE_BUFFER_MAX_LEN 2048
31
32
33static Image_Entry *_evas_common_rgba_image_new(void);
34static void _evas_common_rgba_image_delete(Image_Entry *ie);
35
36static int _evas_common_rgba_image_surface_alloc(Image_Entry *ie, unsigned int w, unsigned int h);
37static void _evas_common_rgba_image_surface_delete(Image_Entry *ie);
38static DATA32 *_evas_common_rgba_image_surface_pixels(Image_Entry *ie);
39
40static void _evas_common_rgba_image_unload(Image_Entry *im);
41
42static void _evas_common_rgba_image_dirty_region(Image_Entry *im, unsigned int x, unsigned int y, unsigned int w, unsigned int h);
43
44static int _evas_common_rgba_image_ram_usage(Image_Entry *ie);
45
46/* Only called when references > 0. Need to provide a fresh copie of im. */
47/* The destination surface does have a surface, but no allocated pixel data. */
48static int _evas_common_rgba_image_dirty(Image_Entry* dst, const Image_Entry* src);
49
50#if 0
51static void
52_evas_common_rgba_image_debug(const char* context, Image_Entry *eim)
53{
54 DBG("%p = [%s] {%s,%s} %i [%i|%i]", eim, context, eim->file, eim->key, eim->references, eim->w, eim->h);
55}
56#endif
57
58static const Evas_Cache_Image_Func _evas_common_image_func =
59{
60 _evas_common_rgba_image_new,
61 _evas_common_rgba_image_delete,
62 _evas_common_rgba_image_surface_alloc,
63 _evas_common_rgba_image_surface_delete,
64 _evas_common_rgba_image_surface_pixels,
65 evas_common_load_rgba_image_module_from_file,
66 _evas_common_rgba_image_unload,
67 _evas_common_rgba_image_dirty_region,
68 _evas_common_rgba_image_dirty,
69 evas_common_rgba_image_size_set,
70 evas_common_rgba_image_from_copied_data,
71 evas_common_rgba_image_from_data,
72 evas_common_rgba_image_colorspace_set,
73 evas_common_load_rgba_image_data_from_file,
74 _evas_common_rgba_image_ram_usage,
75/* _evas_common_rgba_image_debug */
76 NULL
77};
78
79EAPI void
80evas_common_image_init(void)
81{
82 if (!eci)
83 eci = evas_cache_image_init(&_evas_common_image_func);
84 reference++;
85//// ERR("REF++=%i", reference);
86
87#ifdef BUILD_LOADER_EET
88 eet_init();
89#endif
90 evas_common_scalecache_init();
91}
92
93EAPI void
94evas_common_image_shutdown(void)
95{
96 if (--reference == 0)
97 {
98//// printf("REF--=%i\n", reference);
99// DISABLE for now - something wrong with cache shutdown freeing things
100// still in use - rage_thumb segv's now.
101//
102// actually - i think i see it. cache ref goes to 0 (and thus gets freed)
103// because in eng_setup() when a buffer changes size it is FIRST freed
104// THEN allocated again - thus brignhjing ref to 0 then back to 1 immediately
105// where it should stay at 1. - see evas_engine.c in the buffer enigne for
106// example. eng_output_free() is called BEFORE _output_setup(). although this
107// is only a SIGNE of the problem. we can patch this up with either freeing
108// after the setup (so we just pt a ref of 2 then back to 1), or just
109// evas_common_image_init() at the start and evas_common_image_shutdown()
110// after it all. really ref 0 should only be reached when no more canvases
111// with no more objects exist anywhere.
112
113// ENABLE IT AGAIN, hope it is fixed. Gustavo @ January 22nd, 2009.
114 evas_cache_image_shutdown(eci);
115 eci = NULL;
116 }
117
118#ifdef BUILD_LOADER_EET
119 eet_shutdown();
120#endif
121 evas_common_scalecache_shutdown();
122}
123
124EAPI void
125evas_common_image_image_all_unload(void)
126{
127 evas_common_rgba_image_scalecache_dump();
128 evas_cache_image_unload_all(eci);
129}
130
131static Image_Entry *
132_evas_common_rgba_image_new(void)
133{
134 RGBA_Image *im;
135
136 im = calloc(1, sizeof(RGBA_Image));
137 if (!im) return NULL;
138 im->flags = RGBA_IMAGE_NOTHING;
139 im->ref = 1;
140#ifdef EVAS_FRAME_QUEUING
141 LKI(im->cache_entry.ref_fq_add);
142 LKI(im->cache_entry.ref_fq_del);
143 eina_condition_new(&(im->cache_entry.cond_fq_del),
144 &(im->cache_entry.ref_fq_del));
145#endif
146
147 evas_common_rgba_image_scalecache_init(&im->cache_entry);
148
149 return &im->cache_entry;
150}
151
152static void
153_evas_common_rgba_image_delete(Image_Entry *ie)
154{
155 RGBA_Image *im = (RGBA_Image *)ie;
156
157#ifdef BUILD_PIPE_RENDER
158 evas_common_pipe_free(im);
159# ifdef EVAS_FRAME_QUEUING
160 LKD(im->cache_entry.ref_fq_add);
161 LKD(im->cache_entry.ref_fq_del);
162 eina_condition_free(&(im->cache_entry.cond_fq_del));
163# endif
164#endif
165 evas_common_rgba_image_scalecache_shutdown(&im->cache_entry);
166 if (ie->info.module) evas_module_unref((Evas_Module *)ie->info.module);
167 /* memset the image to 0x99 because i recently saw a segv where an
168 * seemed to be used BUT its contents were wrong - it looks like it was
169 * overwritten by something from efreet - as there was an execute command
170 * for a command there and some other signs - but to make sure, I am
171 * going to empty this struct out in case this happens again so i know
172 * that something else is overwritign this struct - or not */
173// memset(im, 0x99, sizeof(im));
174#ifdef EVAS_CSERVE
175 if (ie->data1) evas_cserve_image_free(ie);
176#endif
177/*
178 * FIXME: This doesn't seem to be needed... But I'm not sure why.
179 * -- nash
180 {
181 Filtered_Image *fi;
182
183 EINA_LIST_FREE(im->filtered, fi)
184 {
185 free(fi->key);
186 _evas_common_rgba_image_delete((Image_Entry *)(fi->image));
187 free(fi);
188 }
189 }
190*/
191 if (ie->frames)
192 {
193 Eina_List *l;
194 Image_Entry_Frame *frame;
195 EINA_LIST_FOREACH(ie->frames, l, frame)
196 {
197 if (frame)
198 {
199 if (frame->data) free(frame->data);
200 if (frame->info) free(frame->info);
201 free (frame);
202 }
203 }
204 }
205 free(im);
206}
207
208EAPI void
209evas_common_rgba_image_free(Image_Entry *ie)
210{
211 _evas_common_rgba_image_surface_delete(ie);
212 _evas_common_rgba_image_delete(ie);
213}
214
215EAPI void
216evas_common_rgba_image_unload(Image_Entry *ie)
217{
218 RGBA_Image *im = (RGBA_Image *) ie;
219
220 if (!ie->flags.loaded) return;
221 if ((!ie->info.module) && (!ie->data1)) return;
222 if (!ie->file) return;
223
224 ie->flags.loaded = 0;
225
226 if ((im->cs.data) && (im->image.data))
227 {
228 if (im->cs.data != im->image.data)
229 {
230 if (!im->cs.no_free) free(im->cs.data);
231 }
232 }
233 else if (im->cs.data)
234 {
235 if (!im->cs.no_free) free(im->cs.data);
236 }
237 im->cs.data = NULL;
238
239#ifdef EVAS_CSERVE
240 if (ie->data1)
241 {
242 evas_cserve_image_useless(ie);
243 im->image.data = NULL;
244 ie->allocated.w = 0;
245 ie->allocated.h = 0;
246 ie->flags.loaded = 0;
247#ifdef BUILD_ASYNC_PRELOAD
248 ie->flags.preload_done = 0;
249#endif
250 return;
251 }
252#endif
253
254 if (im->image.data && !im->image.no_free)
255 free(im->image.data);
256 im->image.data = NULL;
257 ie->allocated.w = 0;
258 ie->allocated.h = 0;
259 ie->flags.loaded = 0;
260#ifdef BUILD_ASYNC_PRELOAD
261 ie->flags.preload_done = 0;
262#endif
263}
264
265void
266_evas_common_rgba_image_post_surface(Image_Entry *ie)
267{
268#ifdef HAVE_PIXMAN
269 RGBA_Image *im = (RGBA_Image *) ie;
270
271 if (im->pixman.im) pixman_image_unref(im->pixman.im);
272 if (im->cache_entry.flags.alpha)
273 {
274 im->pixman.im = pixman_image_create_bits
275 (
276// FIXME: endianess determines this
277 PIXMAN_a8r8g8b8,
278// PIXMAN_b8g8r8a8,
279 im->cache_entry.w, im->cache_entry.h,
280 im->image.data,
281 im->cache_entry.w * 4
282 );
283 }
284 else
285 {
286 im->pixman.im = pixman_image_create_bits
287 (
288// FIXME: endianess determines this
289 PIXMAN_x8r8g8b8,
290// PIXMAN_b8g8r8x8,
291 im->cache_entry.w, im->cache_entry.h,
292 im->image.data,
293 im->cache_entry.w * 4
294 );
295 }
296#else
297 ie = NULL;
298#endif
299}
300
301static int
302_evas_common_rgba_image_surface_alloc(Image_Entry *ie, unsigned int w, unsigned int h)
303{
304 RGBA_Image *im = (RGBA_Image *) ie;
305 size_t siz = 0;
306
307#ifdef EVAS_CSERVE
308 if (ie->data1) return 0;
309#endif
310 if (im->image.no_free) return 0;
311
312 if (im->flags & RGBA_IMAGE_ALPHA_ONLY)
313 siz = w * h * sizeof(DATA8);
314 else
315 siz = w * h * sizeof(DATA32);
316
317 if (im->image.data) free(im->image.data);
318 im->image.data = malloc(siz);
319 if (!im->image.data) return -1;
320
321#ifdef HAVE_VALGRIND
322# ifdef VALGRIND_MAKE_READABLE
323 VALGRIND_MAKE_READABLE(im->image.data, siz);
324# else
325# ifdef VALGRIND_MAKE_MEM_DEFINED
326 VALGRIND_MAKE_MEM_DEFINED(im->image.data, siz);
327# endif
328# endif
329#endif
330 _evas_common_rgba_image_post_surface(ie);
331
332 return 0;
333}
334
335static void
336_evas_common_rgba_image_surface_delete(Image_Entry *ie)
337{
338 RGBA_Image *im = (RGBA_Image *) ie;
339
340#ifdef HAVE_PIXMAN
341 if (im->pixman.im)
342 {
343 pixman_image_unref(im->pixman.im);
344 im->pixman.im = NULL;
345 }
346#endif
347 if (ie->file)
348 DBG("unload: [%p] %s %s", ie, ie->file, ie->key);
349 if ((im->cs.data) && (im->image.data))
350 {
351 if (im->cs.data != im->image.data)
352 {
353 if (!im->cs.no_free) free(im->cs.data);
354 }
355 }
356 else if (im->cs.data)
357 {
358 if (!im->cs.no_free) free(im->cs.data);
359 }
360 im->cs.data = NULL;
361
362 if (im->image.data && !im->image.no_free)
363 free(im->image.data);
364#ifdef EVAS_CSERVE
365 else if (ie->data1)
366 evas_cserve_image_free(ie);
367#endif
368
369 im->image.data = NULL;
370 ie->allocated.w = 0;
371 ie->allocated.h = 0;
372#ifdef BUILD_ASYNC_PRELOAD
373 ie->flags.preload_done = 0;
374#endif
375 ie->flags.loaded = 0;
376 evas_common_rgba_image_scalecache_dirty(&im->cache_entry);
377}
378
379static void
380_evas_common_rgba_image_unload(Image_Entry *im)
381{
382// DBG("unload: [%p] %s %s", im, im->file, im->key);
383 evas_common_rgba_image_scalecache_dirty(im);
384 evas_common_rgba_image_unload(im);
385}
386
387static void
388_evas_common_rgba_image_dirty_region(Image_Entry* ie, unsigned int x __UNUSED__, unsigned int y __UNUSED__, unsigned int w __UNUSED__, unsigned int h __UNUSED__)
389{
390 RGBA_Image *im = (RGBA_Image *) ie;
391
392#ifdef EVAS_CSERVE
393 if (ie->data1) evas_cserve_image_free(ie);
394#endif
395 im->flags |= RGBA_IMAGE_IS_DIRTY;
396 evas_common_rgba_image_scalecache_dirty(&im->cache_entry);
397}
398
399/* Only called when references > 0. Need to provide a fresh copie of im. */
400static int
401_evas_common_rgba_image_dirty(Image_Entry *ie_dst, const Image_Entry *ie_src)
402{
403 RGBA_Image *dst = (RGBA_Image *) ie_dst;
404 RGBA_Image *src = (RGBA_Image *) ie_src;
405
406 evas_common_rgba_image_scalecache_dirty((Image_Entry *)ie_src);
407 evas_common_rgba_image_scalecache_dirty(ie_dst);
408 evas_cache_image_load_data(&src->cache_entry);
409 if (_evas_common_rgba_image_surface_alloc(&dst->cache_entry,
410 src->cache_entry.w, src->cache_entry.h))
411 {
412#ifdef EVAS_CSERVE
413 if (ie_src->data1) evas_cserve_image_free((Image_Entry*) ie_src);
414#endif
415 return 1;
416 }
417
418#ifdef EVAS_CSERVE
419 if (ie_src->data1) evas_cserve_image_free((Image_Entry*) ie_src);
420#endif
421 evas_common_image_colorspace_normalize(src);
422 evas_common_image_colorspace_normalize(dst);
423/* evas_common_blit_rectangle(src, dst, 0, 0, src->cache_entry.w, src->cache_entry.h, 0, 0); */
424/* evas_common_cpu_end_opt(); */
425
426 return 0;
427}
428
429static int
430_evas_common_rgba_image_ram_usage(Image_Entry *ie)
431{
432 RGBA_Image *im = (RGBA_Image *)ie;
433 int size = sizeof(struct _RGBA_Image);
434
435 if (ie->cache_key) size += strlen(ie->cache_key);
436 if (ie->file) size += strlen(ie->file);
437 if (ie->key) size += strlen(ie->key);
438
439 if (im->image.data)
440 {
441#ifdef EVAS_CSERVE
442 if ((!im->image.no_free) || (ie->data1))
443#else
444 if ((!im->image.no_free))
445#endif
446 size += im->cache_entry.w * im->cache_entry.h * sizeof(DATA32);
447 }
448 size += evas_common_rgba_image_scalecache_usage_get(&im->cache_entry);
449 return size;
450}
451
452static DATA32 *
453_evas_common_rgba_image_surface_pixels(Image_Entry *ie)
454{
455 RGBA_Image *im = (RGBA_Image *) ie;
456
457 return im->image.data;
458}
459
460#if 0
461void
462evas_common_image_surface_alpha_tiles_calc(RGBA_Surface *is, int tsize)
463{
464 int x, y;
465 DATA32 *ptr;
466
467 if (is->spans) return;
468 if (!is->im->cache_entry.flags.alpha) return;
469 /* FIXME: dont handle alpha only images yet */
470 if ((is->im->flags & RGBA_IMAGE_ALPHA_ONLY)) return;
471 if (tsize < 0) tsize = 0;
472 is->spans = calloc(1, sizeof(RGBA_Image_Span *) * is->h);
473 if (!is->spans) return;
474 ptr = is->data;
475 for (y = 0; y < is->h; y++)
476 {
477 RGBA_Image_Span *sp;
478
479 sp = NULL;
480 for (x = 0; x < is->w; x++)
481 {
482 DATA8 a;
483
484 a = A_VAL(ptr);
485 if (sp)
486 {
487 if (a == 0)
488 {
489 is->spans[y] = eina_inlist_append(is->spans[y], sp);
490 sp = NULL;
491 }
492 else
493 {
494 sp->w++;
495 if ((sp->v == 2) && (a != 255)) sp->v = 1;
496 }
497 }
498 else
499 {
500 if (a == 255)
501 {
502 sp = calloc(1, sizeof(RGBA_Image_Span));
503 sp->x = x;
504 sp->w = 1;
505 sp->v = 2;
506 }
507 else if (a > 0)
508 {
509 sp = calloc(1, sizeof(RGBA_Image_Span));
510 sp->x = x;
511 sp->w = 1;
512 sp->v = 1;
513 }
514 }
515 ptr++;
516 }
517 if (sp)
518 {
519 is->spans[y] = eina_inlist_append(is->spans[y], sp);
520 sp = NULL;
521 }
522 }
523}
524#endif
525
526/* EAPI void */
527/* evas_common_image_surface_dealloc(RGBA_Surface *is) */
528/* { */
529/* if ((is->data) && (!is->no_free)) */
530/* { */
531/* free(is->data); */
532/* is->data = NULL; */
533/* } */
534/* } */
535
536static RGBA_Image *
537evas_common_image_create(unsigned int w, unsigned int h)
538{
539 RGBA_Image *im;
540
541 im = (RGBA_Image *) _evas_common_rgba_image_new();
542 if (!im) return NULL;
543 im->cache_entry.w = w;
544 im->cache_entry.h = h;
545 if (_evas_common_rgba_image_surface_alloc(&im->cache_entry, w, h))
546 {
547 _evas_common_rgba_image_delete(&im->cache_entry);
548 return NULL;
549 }
550 im->cache_entry.flags.cached = 0;
551 return im;
552}
553
554EAPI RGBA_Image *
555evas_common_image_alpha_create(unsigned int w, unsigned int h)
556{
557 RGBA_Image *im;
558
559 im = (RGBA_Image *) _evas_common_rgba_image_new();
560 if (!im) return NULL;
561 im->cache_entry.w = w;
562 im->cache_entry.h = h;
563 im->cache_entry.flags.alpha = 1;
564 if (_evas_common_rgba_image_surface_alloc(&im->cache_entry, w, h))
565 {
566 _evas_common_rgba_image_delete(&im->cache_entry);
567 return NULL;
568 }
569 im->cache_entry.flags.cached = 0;
570 return im;
571}
572
573EAPI RGBA_Image *
574evas_common_image_new(unsigned int w, unsigned int h, unsigned int alpha)
575{
576 if (alpha)
577 return evas_common_image_alpha_create(w, h);
578 return evas_common_image_create(w, h);
579}
580
581void
582evas_common_image_colorspace_normalize(RGBA_Image *im)
583{
584 if ((!im->cs.data) ||
585 ((!im->cs.dirty) && (!(im->flags & RGBA_IMAGE_IS_DIRTY)))) return;
586 switch (im->cache_entry.space)
587 {
588 case EVAS_COLORSPACE_ARGB8888:
589 if (im->image.data != im->cs.data)
590 {
591#ifdef EVAS_CSERVE
592 if (((Image_Entry *)im)->data1) evas_cserve_image_free(&im->cache_entry);
593#endif
594 if (!im->image.no_free) free(im->image.data);
595 im->image.data = im->cs.data;
596 im->cs.no_free = im->image.no_free;
597 }
598 break;
599 case EVAS_COLORSPACE_YCBCR422P601_PL:
600#ifdef BUILD_CONVERT_YUV
601 if ((im->image.data) && (*((unsigned char **)im->cs.data)))
602 evas_common_convert_yuv_420p_601_rgba(im->cs.data, (DATA8*) im->image.data,
603 im->cache_entry.w, im->cache_entry.h);
604#endif
605 break;
606 case EVAS_COLORSPACE_YCBCR422601_PL:
607#ifdef BUILD_CONVERT_YUV
608 if ((im->image.data) && (*((unsigned char **)im->cs.data)))
609 evas_common_convert_yuv_422_601_rgba(im->cs.data, (DATA8*) im->image.data,
610 im->cache_entry.w, im->cache_entry.h);
611#endif
612 break;
613 case EVAS_COLORSPACE_YCBCR420NV12601_PL:
614#ifdef BUILD_CONVERT_YUV
615 if ((im->image.data) && (*((unsigned char **)im->cs.data)))
616 evas_common_convert_yuv_420_601_rgba(im->cs.data, (DATA8*) im->image.data,
617 im->cache_entry.w, im->cache_entry.h);
618#endif
619 break;
620 case EVAS_COLORSPACE_YCBCR420TM12601_PL:
621#ifdef BUILD_CONVERT_YUV
622 if ((im->image.data) && (*((unsigned char **)im->cs.data)))
623 evas_common_convert_yuv_420T_601_rgba(im->cs.data, (DATA8*) im->image.data,
624 im->cache_entry.w, im->cache_entry.h);
625#endif
626 break;
627 default:
628 break;
629 }
630 im->cs.dirty = 0;
631}
632
633EAPI void
634evas_common_image_colorspace_dirty(RGBA_Image *im)
635{
636 im->cs.dirty = 1;
637 evas_common_rgba_image_scalecache_dirty(&im->cache_entry);
638}
639
640EAPI void
641evas_common_image_set_cache(unsigned int size)
642{
643 if (eci)
644 evas_cache_image_set(eci, size);
645}
646
647EAPI int
648evas_common_image_get_cache(void)
649{
650 return evas_cache_image_get(eci);
651}
652
653EAPI RGBA_Image *
654evas_common_load_image_from_file(const char *file, const char *key, RGBA_Image_Loadopts *lo, int *error)
655{
656 if (!file)
657 {
658 *error = EVAS_LOAD_ERROR_GENERIC;
659 return NULL;
660 }
661 return (RGBA_Image *) evas_cache_image_request(eci, file, key, lo, error);
662}
663
664EAPI void
665evas_common_image_cache_free(void)
666{
667 evas_common_image_set_cache(0);
668}
669
670EAPI Evas_Cache_Image*
671evas_common_image_cache_get(void)
672{
673 return eci;
674}
675
676EAPI RGBA_Image *
677evas_common_image_line_buffer_obtain(int len)
678{
679 if (len < 1) return NULL;
680 if (len < EVAS_RGBA_LINE_BUFFER_MIN_LEN)
681 len = EVAS_RGBA_LINE_BUFFER_MIN_LEN;
682 return evas_common_image_create(len, 1);
683/*
684 if (evas_rgba_line_buffer)
685 {
686 if (evas_rgba_line_buffer->image->w >= len)
687 return evas_rgba_line_buffer;
688 evas_rgba_line_buffer->image->data = (DATA32 *)realloc(evas_rgba_line_buffer->image->data, len * sizeof(DATA32));
689 if (!evas_rgba_line_buffer->image->data)
690 {
691 evas_common_image_free(evas_rgba_line_buffer);
692 evas_rgba_line_buffer = NULL;
693 return NULL;
694 }
695 evas_rgba_line_buffer->image->w = len;
696 return evas_rgba_line_buffer;
697 }
698 evas_rgba_line_buffer = evas_common_image_create(len, 1);
699 if (!evas_rgba_line_buffer) return NULL;
700 return evas_rgba_line_buffer;
701 */
702}
703
704EAPI void
705evas_common_image_line_buffer_release(RGBA_Image *im)
706{
707 _evas_common_rgba_image_delete(&im->cache_entry);
708/*
709 if (!evas_rgba_line_buffer) return;
710 if (EVAS_RGBA_LINE_BUFFER_MAX_LEN < evas_rgba_line_buffer->image->w)
711 {
712 evas_rgba_line_buffer->image->w = EVAS_RGBA_LINE_BUFFER_MAX_LEN;
713 evas_rgba_line_buffer->image->data = (DATA32 *)realloc(evas_rgba_line_buffer->image->data,
714 evas_rgba_line_buffer->image->w * sizeof(DATA32));
715 if (!evas_rgba_line_buffer->image->data)
716 {
717 evas_common_image_free(evas_rgba_line_buffer);
718 evas_rgba_line_buffer = NULL;
719 }
720 }
721 */
722}
723
724EAPI void
725evas_common_image_line_buffer_free(RGBA_Image *im)
726{
727 _evas_common_rgba_image_delete(&im->cache_entry);
728/*
729 if (!evas_rgba_line_buffer) return;
730 evas_common_image_free(evas_rgba_line_buffer);
731 evas_rgba_line_buffer = NULL;
732 */
733}
734
735EAPI RGBA_Image *
736evas_common_image_alpha_line_buffer_obtain(int len)
737{
738 if (len < 1) return NULL;
739 if (len < EVAS_ALPHA_LINE_BUFFER_MIN_LEN)
740 len = EVAS_ALPHA_LINE_BUFFER_MIN_LEN;
741 return evas_common_image_alpha_create(len, 1);
742/*
743 if (evas_alpha_line_buffer)
744 {
745 if (evas_alpha_line_buffer->image->w >= len)
746 return evas_alpha_line_buffer;
747 evas_alpha_line_buffer->image->data = realloc(evas_alpha_line_buffer->image->data, len * sizeof(DATA8));
748 if (!evas_alpha_line_buffer->image->data)
749 {
750 evas_common_image_free(evas_alpha_line_buffer);
751 evas_alpha_line_buffer = NULL;
752 return NULL;
753 }
754 evas_alpha_line_buffer->image->w = len;
755 return evas_alpha_line_buffer;
756 }
757 evas_alpha_line_buffer = evas_common_image_alpha_create(len, 1);
758 return evas_alpha_line_buffer;
759 */
760}
761
762EAPI void
763evas_common_image_alpha_line_buffer_release(RGBA_Image *im)
764{
765 _evas_common_rgba_image_delete(&im->cache_entry);
766/*
767 if (!evas_alpha_line_buffer) return;
768 if (EVAS_ALPHA_LINE_BUFFER_MAX_LEN < evas_alpha_line_buffer->image->w)
769 {
770 evas_alpha_line_buffer->image->w = EVAS_ALPHA_LINE_BUFFER_MAX_LEN;
771 evas_alpha_line_buffer->image->data = realloc(evas_alpha_line_buffer->image->data,
772 evas_alpha_line_buffer->image->w * sizeof(DATA8));
773 if (!evas_alpha_line_buffer->image->data)
774 {
775 evas_common_image_free(evas_alpha_line_buffer);
776 evas_alpha_line_buffer = NULL;
777 }
778 }
779 */
780}
781
782EAPI void
783evas_common_image_premul(Image_Entry *ie)
784{
785 DATA32 nas = 0;
786
787 if (!ie) return ;
788 if (!evas_cache_image_pixels(ie)) return ;
789 if (!ie->flags.alpha) return;
790
791 nas = evas_common_convert_argb_premul(evas_cache_image_pixels(ie), ie->w * ie->h);
792 if ((ALPHA_SPARSE_INV_FRACTION * nas) >= (ie->w * ie->h))
793 ie->flags.alpha_sparse = 1;
794}
795
796EAPI void
797evas_common_image_set_alpha_sparse(Image_Entry *ie)
798{
799 DATA32 *s, *se;
800 DATA32 nas = 0;
801
802 if (!ie) return;
803 if (!evas_cache_image_pixels(ie)) return ;
804 if (!ie->flags.alpha) return;
805
806 s = evas_cache_image_pixels(ie);
807 se = s + (ie->w * ie->h);
808 while (s < se)
809 {
810 DATA32 p = *s & 0xff000000;
811
812 if (!p || (p == 0xff000000))
813 nas++;
814 s++;
815 }
816 if ((ALPHA_SPARSE_INV_FRACTION * nas) >= (ie->w * ie->h))
817 ie->flags.alpha_sparse = 1;
818}
diff --git a/libraries/evas/src/lib/engines/common/evas_image_private.h b/libraries/evas/src/lib/engines/common/evas_image_private.h
new file mode 100644
index 0000000..1bec6c8
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_image_private.h
@@ -0,0 +1,17 @@
1#ifndef _EVAS_IMAGE_PRIVATE_H
2#define _EVAS_IMAGE_PRIVATE_H
3
4int evas_common_rgba_image_size_set (Image_Entry* dst, const Image_Entry* im, unsigned int w, unsigned int h);
5int evas_common_rgba_image_from_copied_data (Image_Entry* dst, unsigned int w, unsigned int h, DATA32 *image_data, int alpha, int cspace);
6int evas_common_rgba_image_from_data (Image_Entry* dst, unsigned int w, unsigned int h, DATA32 *image_data, int alpha, int cspace);
7int evas_common_rgba_image_colorspace_set (Image_Entry* dst, int cspace);
8
9void evas_common_scalecache_init(void);
10void evas_common_scalecache_shutdown(void);
11void evas_common_rgba_image_scalecache_init(Image_Entry *ie);
12void evas_common_rgba_image_scalecache_shutdown(Image_Entry *ie);
13void evas_common_rgba_image_scalecache_dirty(Image_Entry *ie);
14void evas_common_rgba_image_scalecache_orig_use(Image_Entry *ie);
15int evas_common_rgba_image_scalecache_usage_get(Image_Entry *ie);
16
17#endif /* _EVAS_IMAGE_PRIVATE_H */
diff --git a/libraries/evas/src/lib/engines/common/evas_image_save.c b/libraries/evas/src/lib/engines/common/evas_image_save.c
new file mode 100644
index 0000000..d7484c0
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_image_save.c
@@ -0,0 +1,51 @@
1#ifdef HAVE_CONFIG_H
2# include "config.h"
3#endif
4
5#include "evas_options.h"
6
7#include "evas_common.h"
8#include "evas_private.h"
9
10
11int
12evas_common_save_image_to_file(RGBA_Image *im, const char *file, const char *key, int quality, int compress)
13{
14 Evas_Image_Save_Func *evas_image_save_func = NULL;
15 char *p;
16 char *saver = NULL;
17
18 p = strrchr(file, '.');
19 if (p)
20 {
21 p++;
22
23 if (!strcasecmp(p, "png"))
24 saver = "png";
25 if ((!strcasecmp(p, "jpg")) || (!strcasecmp(p, "jpeg")) ||
26 (!strcasecmp(p, "jfif")))
27 saver = "jpeg";
28 if ((!strcasecmp(p, "eet")) || (!strcasecmp(p, "edj")) ||
29 (!strcasecmp(p, "eap")))
30 saver = "eet";
31 if (!strcasecmp(p, "edb"))
32 saver = "edb";
33 }
34
35 if (saver)
36 {
37 Evas_Module *em;
38
39 em = evas_module_find_type(EVAS_MODULE_TYPE_IMAGE_SAVER, saver);
40 if (em)
41 {
42 evas_module_use(em);
43 if (evas_module_load(em))
44 {
45 evas_image_save_func = em->functions;
46 return evas_image_save_func->image_save(im, file, key, quality, compress);
47 }
48 }
49 }
50 return 0;
51}
diff --git a/libraries/evas/src/lib/engines/common/evas_image_scalecache.c b/libraries/evas/src/lib/engines/common/evas_image_scalecache.c
new file mode 100644
index 0000000..24a4f2d
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_image_scalecache.c
@@ -0,0 +1,846 @@
1#ifdef HAVE_CONFIG_H
2# include "config.h"
3#endif
4
5#ifdef HAVE_EVIL
6# include <Evil.h>
7#endif
8
9#include <assert.h>
10
11#include "evas_common.h"
12#include "evas_private.h"
13#include "evas_image_private.h"
14
15#define SCALECACHE 1
16
17#define MAX_SCALEITEMS 32
18#define MIN_SCALE_USES 3
19//#define MIN_SCALE_AGE_GAP 5000
20#define MAX_SCALECACHE_DIM 3200
21#define FLOP_ADD 4
22#define MAX_FLOP_COUNT 16
23#define FLOP_DEL 1
24#define SCALE_CACHE_SIZE 4 * 1024 * 1024
25//#define SCALE_CACHE_SIZE 0
26
27typedef struct _Scaleitem Scaleitem;
28
29struct _Scaleitem
30{
31 EINA_INLIST;
32 unsigned long long usage;
33 unsigned long long usage_count;
34 RGBA_Image *im, *parent_im;
35 int src_x, src_y;
36 unsigned int src_w, src_h;
37 unsigned int dst_w, dst_h;
38 unsigned int flop;
39 unsigned int size_adjust;
40#ifdef EVAS_FRAME_QUEUING
41 RWLK(lock);
42#endif
43 Eina_Bool forced_unload : 1;
44 Eina_Bool smooth : 1;
45 Eina_Bool populate_me : 1;
46};
47
48#ifdef SCALECACHE
49static unsigned long long use_counter = 0;
50
51#ifdef BUILD_PTHREAD
52static LK(cache_lock);
53#endif
54static Eina_Inlist *cache_list = NULL;
55static unsigned int cache_size = 0;
56static int init = 0;
57
58static unsigned int max_cache_size = SCALE_CACHE_SIZE;
59static unsigned int max_dimension = MAX_SCALECACHE_DIM;
60static unsigned int max_flop_count = MAX_FLOP_COUNT;
61static unsigned int max_scale_items = MAX_SCALEITEMS;
62static unsigned int min_scale_uses = MIN_SCALE_USES;
63#endif
64
65void
66evas_common_scalecache_init(void)
67{
68#ifdef SCALECACHE
69 const char *s;
70
71 init++;
72 if (init > 1) return;
73 use_counter = 0;
74 LKI(cache_lock);
75 s = getenv("EVAS_SCALECACHE_SIZE");
76 if (s) max_cache_size = atoi(s) * 1024;
77 s = getenv("EVAS_SCALECACHE_MAX_DIMENSION");
78 if (s) max_dimension = atoi(s);
79 s = getenv("EVAS_SCALECACHE_MAX_FLOP_COUNT");
80 if (s) max_flop_count = atoi(s);
81 s = getenv("EVAS_SCALECACHE_MAX_ITEMS");
82 if (s) max_scale_items = atoi(s);
83 s = getenv("EVAS_SCALECACHE_MIN_USES");
84 if (s) min_scale_uses = atoi(s);
85#endif
86}
87
88void
89evas_common_scalecache_shutdown(void)
90{
91#ifdef SCALECACHE
92 init--;
93 if (init ==0)
94 LKD(cache_lock);
95#endif
96}
97
98void
99evas_common_rgba_image_scalecache_init(Image_Entry *ie)
100{
101#ifdef SCALECACHE
102 RGBA_Image *im = (RGBA_Image *)ie;
103 // NOTE: this conflicts with evas image cache init and del of lock
104 LKI(im->cache.lock);
105#endif
106}
107
108void
109evas_common_rgba_image_scalecache_shutdown(Image_Entry *ie)
110{
111#ifdef SCALECACHE
112 RGBA_Image *im = (RGBA_Image *)ie;
113 evas_common_rgba_image_scalecache_dirty(ie);
114 // NOTE: this conflicts with evas image cache init and del of lock
115 LKD(im->cache.lock);
116#endif
117}
118
119void
120evas_common_rgba_image_scalecache_dirty(Image_Entry *ie)
121{
122#ifdef SCALECACHE
123 RGBA_Image *im = (RGBA_Image *)ie;
124 LKL(im->cache.lock);
125 while (im->cache.list)
126 {
127 Scaleitem *sci;
128 sci = im->cache.list->data;
129#ifdef EVAS_FRAME_QUEUING
130 WRLKL(sci->lock);
131#endif
132 im->cache.list = eina_list_remove(im->cache.list, sci);
133 if (sci->im)
134 {
135// INF(" 0- %i", sci->dst_w * sci->dst_h * 4);
136 LKL(cache_lock);
137 evas_common_rgba_image_free(&sci->im->cache_entry);
138 if (!sci->forced_unload)
139 cache_size -= sci->dst_w * sci->dst_h * 4;
140 else
141 cache_size -= sci->size_adjust;
142 cache_list = eina_inlist_remove(cache_list, (Eina_Inlist *)sci);
143 LKU(cache_lock);
144 }
145#ifdef EVAS_FRAME_QUEUING
146 RWLKU(sci->lock);
147 RWLKD(sci->lock);
148#endif
149 free(sci);
150 }
151 LKU(im->cache.lock);
152#endif
153}
154
155void
156evas_common_rgba_image_scalecache_orig_use(Image_Entry *ie)
157{
158#ifdef SCALECACHE
159 RGBA_Image *im = (RGBA_Image *)ie;
160 LKL(im->cache.lock);
161 use_counter++;
162 // FIXME: if orig not loaded, reload
163 // FIXME: mark orig with current used counter
164 im->cache.orig_usage++;
165 im->cache.usage_count = use_counter;
166 LKU(im->cache.lock);
167#endif
168}
169
170int
171evas_common_rgba_image_scalecache_usage_get(Image_Entry *ie)
172{
173#ifdef SCALECACHE
174 RGBA_Image *im = (RGBA_Image *)ie;
175 int size = 0;
176 Eina_List *l;
177 Scaleitem *sci;
178 LKL(im->cache.lock);
179 EINA_LIST_FOREACH(im->cache.list, l, sci)
180 {
181 if (sci->im) size += sci->dst_w * sci->dst_h * 4;
182 }
183 LKU(im->cache.lock);
184 return size;
185#else
186 return 0;
187#endif
188}
189
190#ifdef SCALECACHE
191static void
192_sci_fix_newest(RGBA_Image *im)
193{
194 Eina_List *l;
195 Scaleitem *sci;
196
197 im->cache.newest_usage = 0;
198 im->cache.newest_usage_count = 0;
199 EINA_LIST_FOREACH(im->cache.list, l, sci)
200 {
201 if (sci->usage > im->cache.newest_usage)
202 im->cache.newest_usage = sci->usage;
203 if (sci->usage_count > im->cache.newest_usage_count)
204 im->cache.newest_usage_count = sci->usage_count;
205 }
206// INF("_sci_fix_newest! -> %i", im->cache.newest_usage);
207}
208
209static Scaleitem *
210_sci_find(RGBA_Image *im,
211 RGBA_Draw_Context *dc __UNUSED__, int smooth,
212 int src_region_x, int src_region_y,
213 unsigned int src_region_w, unsigned int src_region_h,
214 unsigned int dst_region_w, unsigned int dst_region_h)
215{
216 Eina_List *l;
217 Scaleitem *sci;
218
219 EINA_LIST_FOREACH(im->cache.list, l, sci)
220 {
221 if (
222 (sci->src_w == src_region_w) &&
223 (sci->src_h == src_region_h) &&
224 (sci->dst_w == dst_region_w) &&
225 (sci->dst_h == dst_region_h) &&
226 (sci->src_x == src_region_x) &&
227 (sci->src_y == src_region_y) &&
228 (sci->smooth == smooth)
229 )
230 {
231 if (im->cache.list != l)
232 {
233 im->cache.list = eina_list_remove_list(im->cache.list, l);
234 im->cache.list = eina_list_prepend(im->cache.list, sci);
235 }
236 return sci;
237 }
238 }
239 if (eina_list_count(im->cache.list) > max_scale_items)
240 {
241 l = eina_list_last(im->cache.list);
242 sci = l->data;
243#ifdef EVAS_FRAME_QUEUING
244 WRLKL(sci->lock);
245#endif
246 im->cache.list = eina_list_remove_list(im->cache.list, l);
247 if ((sci->usage == im->cache.newest_usage) ||
248 (sci->usage_count == im->cache.newest_usage_count))
249 _sci_fix_newest(im);
250 if (sci->im)
251 {
252 evas_common_rgba_image_free(&sci->im->cache_entry);
253 if (!sci->forced_unload)
254 cache_size -= sci->dst_w * sci->dst_h * 4;
255 else
256 cache_size -= sci->size_adjust;
257// INF(" 1- %i", sci->dst_w * sci->dst_h * 4);
258 cache_list = eina_inlist_remove(cache_list, (Eina_Inlist *)sci);
259 }
260#ifdef EVAS_FRAME_QUEUING
261 RWLKU(sci->lock);
262#endif
263 if (max_scale_items < 1) return NULL;
264 }
265 else
266 {
267 if (max_scale_items < 1) return NULL;
268
269 if (eina_list_count(im->cache.list) > (max_scale_items - 1))
270 return NULL;
271 sci = calloc(1, sizeof(Scaleitem));
272 sci->parent_im = im;
273#ifdef EVAS_FRAME_QUEUING
274 RWLKI(sci->lock);
275#endif
276 }
277 sci->usage = 0;
278 sci->usage_count = 0;
279 sci->populate_me = 0;
280 sci->smooth = smooth;
281 sci->forced_unload = 0;
282 sci->flop = 0;
283 sci->im = NULL;
284 sci->src_x = src_region_x;
285 sci->src_y = src_region_y;
286 sci->src_w = src_region_w;
287 sci->src_h = src_region_h;
288 sci->dst_w = dst_region_w;
289 sci->dst_h = dst_region_h;
290 im->cache.list = eina_list_prepend(im->cache.list, sci);
291 return sci;
292}
293
294static void
295_cache_prune(Scaleitem *notsci, Eina_Bool copies_only)
296{
297 Scaleitem *sci;
298 while (cache_size > max_cache_size)
299 {
300 if (!cache_list) break;
301 sci = (Scaleitem *)(cache_list);
302 if (copies_only)
303 {
304 while ((sci) && (!sci->parent_im->image.data))
305 sci = (Scaleitem *)(((Eina_Inlist *)sci)->next);
306 if (!sci) return;
307 }
308 if (sci == notsci) return;
309#ifdef EVAS_FRAME_QUEUING
310 WRLKL(sci->lock);
311#endif
312 if (sci->im)
313 {
314 evas_common_rgba_image_free(&sci->im->cache_entry);
315 sci->im = NULL;
316 sci->usage = 0;
317 sci->usage_count = 0;
318 sci->flop += FLOP_ADD;
319 if (!sci->forced_unload)
320 cache_size -= sci->dst_w * sci->dst_h * 4;
321 else
322 cache_size -= sci->size_adjust;
323// INF(" 2- %i", sci->dst_w * sci->dst_h * 4);
324 cache_list = eina_inlist_remove(cache_list, (Eina_Inlist *)sci);
325 memset(sci, 0, sizeof(Eina_Inlist));
326 }
327#ifdef EVAS_FRAME_QUEUING
328 RWLKU(sci->lock);
329#endif
330
331// INF("FLUSH %i > %i", cache_size, max_cache_size);
332 }
333}
334#endif
335
336EAPI void
337evas_common_rgba_image_scalecache_size_set(unsigned int size)
338{
339#ifdef SCALECACHE
340 LKL(cache_lock);
341 if (size != max_cache_size)
342 {
343 max_cache_size = size;
344 _cache_prune(NULL, 1);
345 }
346 LKU(cache_lock);
347#endif
348}
349
350EAPI unsigned int
351evas_common_rgba_image_scalecache_size_get(void)
352{
353#ifdef SCALECACHE
354 int t;
355 LKL(cache_lock);
356 t = max_cache_size;
357 LKU(cache_lock);
358 return t;
359#else
360 return 0;
361#endif
362}
363
364EAPI void
365evas_common_rgba_image_scalecache_dump(void)
366{
367#ifdef SCALECACHE
368 int t;
369 LKL(cache_lock);
370 t = max_cache_size;
371 max_cache_size = 0;
372 _cache_prune(NULL, 0);
373 max_cache_size = t;
374 LKU(cache_lock);
375#endif
376}
377
378EAPI void
379evas_common_rgba_image_scalecache_flush(void)
380{
381#ifdef SCALECACHE
382 int t;
383 LKL(cache_lock);
384 t = max_cache_size;
385 max_cache_size = 0;
386 _cache_prune(NULL, 1);
387 max_cache_size = t;
388 LKU(cache_lock);
389#endif
390}
391
392EAPI void
393evas_common_rgba_image_scalecache_prepare(Image_Entry *ie, RGBA_Image *dst __UNUSED__,
394 RGBA_Draw_Context *dc, int smooth,
395 int src_region_x, int src_region_y,
396 int src_region_w, int src_region_h,
397 int dst_region_x __UNUSED__, int dst_region_y __UNUSED__,
398 int dst_region_w, int dst_region_h)
399{
400#ifdef SCALECACHE
401 int locked = 0;
402 Eina_Lock_Result ret;
403 RGBA_Image *im = (RGBA_Image *)ie;
404 Scaleitem *sci;
405 if (!im->image.data) return;
406 if ((dst_region_w == 0) || (dst_region_h == 0) ||
407 (src_region_w == 0) || (src_region_h == 0)) return;
408 // was having major lock issues here - LKL was deadlocking. what was
409 // going on? it may have been an eina treads badness but this will stay here
410 // for now for debug
411#if 1
412 ret = LKT(im->cache.lock);
413 if (ret == EINA_FALSE) /* can't get image lock */
414 {
415 useconds_t slp = 1, slpt = 0;
416
417 while (slpt < 500000)
418 {
419#ifdef _WIN32
420 Sleep(slp / 1000);
421#else
422 usleep(slp);
423#endif
424 slpt += slp;
425 slp++;
426 ret = LKT(im->cache.lock);
427 if (ret == EINA_LOCK_DEADLOCK)
428 {
429 printf("WARNING: DEADLOCK on image %p (%s)\n", im, ie->file);
430 }
431 else
432 {
433 locked = 1;
434 break;
435 }
436 }
437 if (ret == EINA_FALSE)
438 {
439 printf("WARNING: lock still there after %i usec\n", slpt);
440 printf("WARNING: stucklock on image %p (%s)\n", im, ie->file);
441 LKDBG(im->cache.lock);
442 }
443 }
444 else if (ret == EINA_LOCK_DEADLOCK)
445 {
446 printf("WARNING: DEADLOCK on image %p (%s)\n", im, ie->file);
447 }
448 else locked = 1;
449#endif
450 if (!locked) { LKL(im->cache.lock); locked = 1; }
451 use_counter++;
452 if ((src_region_w == dst_region_w) && (src_region_h == dst_region_h))
453 {
454 // 1:1 scale.
455 im->cache.orig_usage++;
456 im->cache.usage_count = use_counter;
457 if (locked) LKU(im->cache.lock);
458 return;
459 }
460 if ((!im->cache_entry.flags.alpha) && (!smooth))
461 {
462 // solid nearest scaling - it's actually the same speed cached or not,
463 // or in some cases faster not cached
464 im->cache.orig_usage++;
465 im->cache.usage_count = use_counter;
466 if (locked) LKU(im->cache.lock);
467 return;
468 }
469 LKL(cache_lock);
470 sci = _sci_find(im, dc, smooth,
471 src_region_x, src_region_y, src_region_w, src_region_h,
472 dst_region_w, dst_region_h);
473 if (!sci)
474 {
475 LKU(cache_lock);
476 if (locked) LKU(im->cache.lock);
477 return;
478 }
479// INF("%10i | %4i %4i %4ix%4i -> %4i %4i %4ix%4i | %i",
480// (int)use_counter,
481// src_region_x, src_region_y, src_region_w, src_region_h,
482// dst_region_x, dst_region_y, dst_region_w, dst_region_h,
483// smooth);
484 if ((sci->usage >= min_scale_uses)
485 && (ie->scale_hint != EVAS_IMAGE_SCALE_HINT_DYNAMIC)
486// && (sci->usage_count > (use_counter - MIN_SCALE_AGE_GAP))
487 )
488 {
489 if (!sci->im)
490 {
491 if ((sci->dst_w < max_dimension) &&
492 (sci->dst_h < max_dimension))
493 {
494 if (sci->flop <= max_flop_count)
495 {
496 sci->populate_me = 1;
497 im->cache.populate_count++;
498 }
499 }
500 }
501 }
502 sci->usage++;
503 sci->usage_count = use_counter;
504 LKU(cache_lock);
505 if (sci->usage > im->cache.newest_usage)
506 im->cache.newest_usage = sci->usage;
507// INF("newset? %p %i > %i", im,
508// (int)sci->usage,
509// (int)im->cache.newest_usage);
510 if (sci->usage_count > im->cache.newest_usage_count)
511 im->cache.newest_usage_count = sci->usage_count;
512// INF(" -------------- used %8i#, %8i@", (int)sci->usage, (int)sci->usage_count);
513 if (locked) LKU(im->cache.lock);
514#endif
515}
516
517#ifdef SCALECACHE
518//static int pops = 0;
519//static int hits = 0;
520//static int misses = 0;
521//static int noscales = 0;
522#endif
523
524EAPI void
525evas_common_rgba_image_scalecache_do(Image_Entry *ie, RGBA_Image *dst,
526 RGBA_Draw_Context *dc, int smooth,
527 int src_region_x, int src_region_y,
528 int src_region_w, int src_region_h,
529 int dst_region_x, int dst_region_y,
530 int dst_region_w, int dst_region_h)
531{
532#ifdef SCALECACHE
533 RGBA_Image *im = (RGBA_Image *)ie;
534 Scaleitem *sci;
535 int didpop = 0;
536 int dounload = 0;
537/*
538 static int i = 0;
539
540 i++;
541 if (i > 2000)
542 {
543 INF("p: %6i, h: %6i, m: %6i, n: %6i",
544 pops, hits, misses, noscales);
545 i = 0;
546 }
547 */
548 if ((dst_region_w == 0) || (dst_region_h == 0) ||
549 (src_region_w == 0) || (src_region_h == 0)) return;
550 LKL(im->cache.lock);
551 if ((src_region_w == dst_region_w) && (src_region_h == dst_region_h))
552 {
553#ifdef EVAS_FRAME_QUEUING
554 if (!evas_common_frameq_enabled())
555#endif
556 {
557 if (im->cache_entry.space == EVAS_COLORSPACE_ARGB8888)
558 evas_cache_image_load_data(&im->cache_entry);
559 evas_common_image_colorspace_normalize(im);
560 }
561// noscales++;
562 LKU(im->cache.lock);
563 if (im->image.data)
564 {
565 evas_common_scale_rgba_in_to_out_clip_sample(im, dst, dc,
566 src_region_x, src_region_y,
567 src_region_w, src_region_h,
568 dst_region_x, dst_region_y,
569 dst_region_w, dst_region_h);
570 }
571 return;
572 }
573 LKL(cache_lock);
574 sci = _sci_find(im, dc, smooth,
575 src_region_x, src_region_y, src_region_w, src_region_h,
576 dst_region_w, dst_region_h);
577 LKU(cache_lock);
578 if (!sci)
579 {
580#ifdef EVAS_FRAME_QUEUING
581 if (!evas_common_frameq_enabled())
582#endif
583 {
584 if (im->cache_entry.space == EVAS_COLORSPACE_ARGB8888)
585 evas_cache_image_load_data(&im->cache_entry);
586 evas_common_image_colorspace_normalize(im);
587 }
588// misses++;
589 LKU(im->cache.lock);
590 if (im->image.data)
591 {
592 if (smooth)
593 evas_common_scale_rgba_in_to_out_clip_smooth(im, dst, dc,
594 src_region_x, src_region_y,
595 src_region_w, src_region_h,
596 dst_region_x, dst_region_y,
597 dst_region_w, dst_region_h);
598 else
599 evas_common_scale_rgba_in_to_out_clip_sample(im, dst, dc,
600 src_region_x, src_region_y,
601 src_region_w, src_region_h,
602 dst_region_x, dst_region_y,
603 dst_region_w, dst_region_h);
604 }
605 return;
606 }
607 if (sci->populate_me)
608 {
609 int size, osize, used;
610
611 size = dst_region_w * dst_region_h;
612 if (((((dst_region_w > 640) || (dst_region_h > 640)) &&
613 (size > (480 * 480))) ||
614 (ie->scale_hint == EVAS_IMAGE_SCALE_HINT_STATIC)) &&
615 (ie->scale_hint != EVAS_IMAGE_SCALE_HINT_DYNAMIC))
616 {
617 Eina_List *l;
618 Scaleitem *sci2;
619
620 dounload = 1;
621 osize = sci->parent_im->cache_entry.w * sci->parent_im->cache_entry.h;
622 used = 0;
623 EINA_LIST_FOREACH(im->cache.list, l, sci2)
624 {
625 if (sci2->im) used += sci2->dst_w * sci2->dst_h;
626 }
627 if ((size < osize) && (used == 0))
628 sci->size_adjust = 0;
629 else
630 {
631 osize -= used;
632 if (osize < 0) osize = 0;
633 size -= osize;
634 sci->size_adjust = size * 4;
635 }
636 }
637 else
638 {
639 size *= sizeof(DATA32);
640 if ((cache_size + size) > max_cache_size)
641 {
642 sci->populate_me = 0;
643 im->cache.populate_count--;
644 }
645 }
646 }
647 if (sci->populate_me)
648 {
649// INF("##! populate!");
650 sci->im = evas_common_image_new
651 (dst_region_w, dst_region_h, im->cache_entry.flags.alpha);
652 if (sci->im)
653 {
654 static RGBA_Draw_Context *ct = NULL;
655
656 LKL(cache_lock);
657 im->cache.orig_usage++;
658 im->cache.usage_count = use_counter;
659 im->cache.populate_count--;
660// pops++;
661 if (!ct)
662 {
663 // FIXME: static ct - never can free on shutdown? not a leak
664 // or real harm - just annoying valgrind bitch
665 ct = evas_common_draw_context_new();
666 evas_common_draw_context_set_render_op(ct, _EVAS_RENDER_COPY);
667 }
668 if (im->cache_entry.space == EVAS_COLORSPACE_ARGB8888)
669 evas_cache_image_load_data(&im->cache_entry);
670 evas_common_image_colorspace_normalize(im);
671 if (im->image.data)
672 {
673 if (smooth)
674 evas_common_scale_rgba_in_to_out_clip_smooth
675 (im, sci->im, ct,
676 src_region_x, src_region_y,
677 src_region_w, src_region_h,
678 0, 0,
679 dst_region_w, dst_region_h);
680 else
681 evas_common_scale_rgba_in_to_out_clip_sample
682 (im, sci->im, ct,
683 src_region_x, src_region_y,
684 src_region_w, src_region_h,
685 0, 0,
686 dst_region_w, dst_region_h);
687 sci->populate_me = 0;
688#if 0 // visual debug of cached images
689 {
690 int xx, yy;
691 DATA32 *pp;
692
693 pp = sci->im->image.data;
694 for (yy = 0; yy < dst_region_h; yy++)
695 {
696
697 for (xx = 0; xx < dst_region_w; xx++)
698 {
699 if (yy & 0x1)
700 {
701 if (xx & 0x1) *pp = 0x882288ff;
702 }
703 else
704 {
705 if (!(xx & 0x1)) *pp = 0x882288ff;
706 }
707 pp++;
708 }
709 }
710 }
711#endif
712 }
713 if (dounload)
714 {
715 sci->forced_unload = 1;
716 cache_size += sci->size_adjust;
717 }
718 else
719 {
720 cache_size += sci->dst_w * sci->dst_h * 4;
721 }
722// INF(" + %i @ flop: %i (%ix%i)",
723// sci->dst_w * sci->dst_h * 4, sci->flop,
724// sci->dst_w, sci->dst_h);
725 cache_list = eina_inlist_append(cache_list, (Eina_Inlist *)sci);
726 _cache_prune(sci, 0);
727 LKU(cache_lock);
728 didpop = 1;
729 }
730 }
731 if (sci->im && !ie->flags.animated)
732 {
733 if (!didpop)
734 {
735 LKL(cache_lock);
736 cache_list = eina_inlist_remove(cache_list, (Eina_Inlist *)sci);
737 cache_list = eina_inlist_append(cache_list, (Eina_Inlist *)sci);
738 LKU(cache_lock);
739 }
740 else
741 {
742 if (sci->flop >= FLOP_DEL) sci->flop -= FLOP_DEL;
743 }
744// INF("use cached!");
745#ifdef EVAS_FRAME_QUEUING
746 RDLKL(sci->lock);
747#endif
748 LKU(im->cache.lock);
749 evas_common_scale_rgba_in_to_out_clip_sample
750 (sci->im, dst, dc,
751 0, 0,
752 dst_region_w, dst_region_h,
753 dst_region_x, dst_region_y,
754 dst_region_w, dst_region_h);
755#ifdef EVAS_FRAME_QUEUING
756 RWLKU(sci->lock);
757#endif
758// hits++;
759// INF("check %p %i < %i",
760// im,
761// (int)im->cache.orig_usage,
762// (int)im->cache.newest_usage);
763#ifndef EVAS_FRAME_QUEUING
764 /* while framequeuing is applied,
765 * original image data is loaded by the main thread
766 * just before enqueuing the rendering op into the pipe.
767 * so unloading the original image data here
768 * causes only speed-down side-effect and no memory usage gain;
769 * it will be loaded again for the very next rendering for this image.
770 */
771 if (ie->scale_hint != EVAS_IMAGE_SCALE_HINT_DYNAMIC)
772 {
773 if ((dounload) ||
774 ((im->cache_entry.flags.loaded) &&
775 ((!im->cs.no_free)
776#ifdef EVAS_CSERVE
777 || (ie->data1)
778#endif
779 ) &&
780 (im->cache_entry.space == EVAS_COLORSPACE_ARGB8888)))
781 {
782 if ((dounload) || (im->cache.orig_usage <
783 (im->cache.newest_usage / 20)))
784 {
785 //FIXME: imagedataunload - inform owners
786 evas_common_rgba_image_unload(&im->cache_entry);
787 }
788 }
789 }
790#endif
791 }
792 else
793 {
794#ifdef EVAS_FRAME_QUEUING
795 if (!evas_common_frameq_enabled())
796#endif
797 {
798 if (im->cache_entry.space == EVAS_COLORSPACE_ARGB8888)
799 evas_cache_image_load_data(&im->cache_entry);
800 evas_common_image_colorspace_normalize(im);
801 }
802// misses++;
803 LKU(im->cache.lock);
804 if (im->image.data)
805 {
806 if (smooth)
807 evas_common_scale_rgba_in_to_out_clip_smooth(im, dst, dc,
808 src_region_x, src_region_y,
809 src_region_w, src_region_h,
810 dst_region_x, dst_region_y,
811 dst_region_w, dst_region_h);
812 else
813 evas_common_scale_rgba_in_to_out_clip_sample(im, dst, dc,
814 src_region_x, src_region_y,
815 src_region_w, src_region_h,
816 dst_region_x, dst_region_y,
817 dst_region_w, dst_region_h);
818 }
819 }
820#else
821 RGBA_Image *im = (RGBA_Image *)ie;
822#ifdef EVAS_FRAME_QUEUING
823 if (!evas_common_frameq_enabled())
824#endif
825 {
826 if (im->cache_entry.space == EVAS_COLORSPACE_ARGB8888)
827 evas_cache_image_load_data(&im->cache_entry);
828 evas_common_image_colorspace_normalize(im);
829 }
830 if (im->image.data)
831 {
832 if (smooth)
833 evas_common_scale_rgba_in_to_out_clip_smooth(im, dst, dc,
834 src_region_x, src_region_y,
835 src_region_w, src_region_h,
836 dst_region_x, dst_region_y,
837 dst_region_w, dst_region_h);
838 else
839 evas_common_scale_rgba_in_to_out_clip_sample(im, dst, dc,
840 src_region_x, src_region_y,
841 src_region_w, src_region_h,
842 dst_region_x, dst_region_y,
843 dst_region_w, dst_region_h);
844 }
845#endif
846}
diff --git a/libraries/evas/src/lib/engines/common/evas_line.h b/libraries/evas/src/lib/engines/common/evas_line.h
new file mode 100644
index 0000000..9d45e3d
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_line.h
@@ -0,0 +1,11 @@
1#ifndef _EVAS_LINE_H
2#define _EVAS_LINE_H
3
4
5EAPI void evas_common_line_init (void);
6
7EAPI void evas_common_line_draw (RGBA_Image *dst, RGBA_Draw_Context *dc, int x1, int y1, int x2, int y2);
8
9
10#endif /* _EVAS_LINE_H */
11
diff --git a/libraries/evas/src/lib/engines/common/evas_line_main.c b/libraries/evas/src/lib/engines/common/evas_line_main.c
new file mode 100644
index 0000000..04401cb
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_line_main.c
@@ -0,0 +1,678 @@
1#include "evas_common.h"
2#include "evas_blend_private.h"
3
4
5static void
6_evas_draw_point(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y);
7
8static void
9_evas_draw_simple_line(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, int x1, int y1);
10
11static void
12_evas_draw_line(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, int x1, int y1);
13
14static void
15_evas_draw_line_aa(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, int x1, int y1);
16
17
18#define IN_RANGE(x, y, w, h) \
19 ( x > 0 && y > 0 &&((unsigned)(x) < (unsigned)(w)) && ((unsigned)(y) < (unsigned)(h)) )
20
21#define IN_RECT(x, y, rx, ry, rw, rh) \
22 ( ((unsigned)((x) - (rx)) < (unsigned)(rw)) && \
23 ((unsigned)((y) - (ry)) < (unsigned)(rh)) )
24
25#define EXCHANGE_POINTS(x0, y0, x1, y1) \
26 { \
27 int _tmp = y0; \
28 \
29 y0 = y1; \
30 y1 = _tmp; \
31 \
32 _tmp = x0; \
33 x0 = x1; \
34 x1 = _tmp; \
35 }
36
37
38EAPI void
39evas_common_line_init(void)
40{
41}
42
43EAPI void
44evas_common_line_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, int x1, int y1)
45{
46 int x, y, w, h;
47 int clx, cly, clw, clh;
48 int cuse, cx, cy, cw, ch;
49
50 if ((x0 == x1) && (y0 == y1))
51 {
52 _evas_draw_point(dst, dc, x0, y0);
53 return;
54 }
55
56 clx = cly = 0;
57 clw = dst->cache_entry.w;
58 clh = dst->cache_entry.h;
59
60 /* save out clip info */
61 cuse = dc->clip.use;
62 cx = dc->clip.x;
63 cy = dc->clip.y;
64 cw = dc->clip.w;
65 ch = dc->clip.h;
66
67 if (cuse)
68 {
69 RECTS_CLIP_TO_RECT(clx, cly, clw, clh, cx, cy, cw, ch);
70 if ((clw < 1) || (clh < 1))
71 return;
72 }
73
74 x = MIN(x0, x1);
75 y = MIN(y0, y1);
76 w = MAX(x0, x1) - x + 1;
77 h = MAX(y0, y1) - y + 1;
78
79 RECTS_CLIP_TO_RECT(clx, cly, clw, clh, x, y, w, h);
80 if ((clw < 1) || (clh < 1))
81 return;
82
83 dc->clip.use = 1;
84 dc->clip.x = clx;
85 dc->clip.y = cly;
86 dc->clip.w = clw;
87 dc->clip.h = clh;
88
89 if (dc->anti_alias)
90 _evas_draw_line_aa(dst, dc, x0, y0, x1, y1);
91 else
92 _evas_draw_line(dst, dc, x0, y0, x1, y1);
93
94 /* restore clip info */
95 dc->clip.use = cuse;
96 dc->clip.x = cx;
97 dc->clip.y = cy;
98 dc->clip.w = cw;
99 dc->clip.h = ch;
100}
101
102
103static void
104_evas_draw_point(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y)
105{
106 RGBA_Gfx_Pt_Func pfunc;
107
108 if (!IN_RANGE(x, y, dst->cache_entry.w, dst->cache_entry.h))
109 return;
110 if ((dc->clip.use) && (!IN_RECT(x, y, dc->clip.x, dc->clip.y, dc->clip.w, dc->clip.h)))
111 return;
112 pfunc = evas_common_gfx_func_composite_color_pt_get(dc->col.col, dst, dc->render_op);
113 if (pfunc)
114 pfunc(0, 255, dc->col.col, dst->image.data + (dst->cache_entry.w * y) + x);
115}
116
117/*
118 these functions use the dc->clip data as bounding
119 data. they assume that such data has already been cut
120 back to lie in the dst image rect and the object's
121 (line) bounding rect.
122*/
123static void
124_evas_draw_simple_line(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, int x1, int y1)
125{
126 int dx, dy, len, lx, ty, rx, by;
127 int clx, cly, clw, clh;
128 int dstw;
129 DATA32 *p, color;
130 RGBA_Gfx_Pt_Func pfunc;
131 RGBA_Gfx_Func sfunc;
132
133 dstw = dst->cache_entry.w;
134 color = dc->col.col;
135
136 if (y0 > y1)
137 EXCHANGE_POINTS(x0, y0, x1, y1)
138 if (x0 > x1)
139 EXCHANGE_POINTS(x0, y0, x1, y1)
140
141 dx = x1 - x0;
142 dy = y1 - y0;
143
144 clx = dc->clip.x;
145 cly = dc->clip.y;
146 clw = dc->clip.w;
147 clh = dc->clip.h;
148
149 lx = clx;
150 rx = clx + clw - 1;
151 ty = cly;
152 by = cly + clh - 1;
153
154 if (dy == 0)
155 {
156#ifdef EVAS_SLI
157 if (((y0) % dc->sli.h) == dc->sli.y)
158#endif
159 {
160 if ((y0 >= ty) && (y0 <= by))
161 {
162 if (dx < 0)
163 {
164 int tmp = x1;
165
166 x1 = x0;
167 x0 = tmp;
168 }
169
170 if (x0 < lx) x0 = lx;
171 if (x1 > rx) x1 = rx;
172
173 len = x1 - x0 + 1;
174 p = dst->image.data + (dstw * y0) + x0;
175 sfunc = evas_common_gfx_func_composite_color_span_get(color, dst, len, dc->render_op);
176 if (sfunc)
177 sfunc(NULL, NULL, color, p, len);
178 }
179 }
180 return;
181 }
182
183 pfunc = evas_common_gfx_func_composite_color_pt_get(color, dst, dc->render_op);
184 if (!pfunc) return;
185
186 if (dx == 0)
187 {
188 if ((x0 >= lx) && (x0 <= rx))
189 {
190 if (y0 < ty) y0 = ty;
191 if (y1 > by) y1 = by;
192
193 len = y1 - y0 + 1;
194 p = dst->image.data + (dstw * y0) + x0;
195 while (len--)
196 {
197#ifdef EVAS_SLI
198 if (((y1 + 1 - len) % dc->sli.h) == dc->sli.y)
199#endif
200 {
201 pfunc(0, 255, color, p);
202 }
203 p += dstw;
204 }
205 }
206 return;
207 }
208
209 if ((dy == dx) || (dy == -dx))
210 {
211 int p0_in, p1_in;
212
213 p0_in = (IN_RECT(x0, y0, clx, cly, clw, clh) ? 1 : 0);
214 p1_in = (IN_RECT(x1, y1, clx, cly, clw, clh) ? 1 : 0);
215
216 if (dy > 0)
217 {
218 if (!p0_in)
219 {
220 x0 = x0 + (ty - y0);
221 y0 = ty;
222 if (x0 > rx) return;
223 if (x0 < lx)
224 {
225 y0 = y0 + (lx - x0);
226 x0 = lx;
227 if ((y0 < ty) || (y0 > by)) return;
228 }
229 }
230 if (!p1_in)
231 {
232 x1 = x0 + (by - y0);
233 y1 = by;
234 if (x1 < lx) return;
235 if (x1 > rx)
236 {
237 y1 = y0 + (rx - x0);
238 x1 = rx;
239 if ((y1 < ty) || (y1 > by)) return;
240 }
241 }
242 }
243 else
244 {
245 if (!p0_in)
246 {
247 x0 = x0 - (by - y0);
248 y0 = by;
249 if (x0 > rx) return;
250 if (x0 < lx)
251 {
252 y0 = y0 - (lx - x0);
253 x0 = lx;
254 if ((y0 < ty) || (y0 > by)) return;
255 }
256 }
257 if (!p1_in)
258 {
259 x1 = x0 - (ty - y0);
260 y1 = ty;
261 if (x1 < lx) return;
262 if (x1 > rx)
263 {
264 y1 = y0 - (rx - x0);
265 x1 = rx;
266 if ((y1 < ty) || (y1 > by)) return;
267 }
268 }
269 }
270 if (y1 > y0)
271 {
272 p = dst->image.data + (dstw * y0) + x0;
273 len = y1 - y0 + 1;
274 if (dx > 0) dstw++;
275 else dstw--;
276 }
277 else
278 {
279 len = y0 - y1 + 1;
280 p = dst->image.data + (dstw * y1) + x1;
281 if (dx > 0) dstw--;
282 else dstw++;
283 }
284
285 while (len--)
286 {
287#ifdef EVAS_SLI
288 if (((y1 + 1 - len) % dc->sli.h) == dc->sli.y)
289#endif
290 {
291 pfunc(0, 255, color, p);
292 }
293 p += dstw;
294 }
295 }
296}
297
298
299#define SETUP_LINE_SHALLOW \
300 if (x0 > x1) \
301 { \
302 EXCHANGE_POINTS(x0, y0, x1, y1); \
303 dx = -dx; \
304 dy = -dy; \
305 } \
306 \
307 px = x0; \
308 py = y0; \
309 \
310 p0_in = (IN_RANGE(x0 , y0 , clw, clh) ? 1 : 0); \
311 p1_in = (IN_RANGE(x1 , y1 , clw, clh) ? 1 : 0); \
312 \
313 dely = 1; \
314 dh = dstw; \
315 if (dy < 0) \
316 { \
317 dely = -1; \
318 dh = -dstw; \
319 } \
320 \
321 dyy = ((dy) << 16) / (dx); \
322 \
323 if (!p0_in) \
324 { \
325 dxx = ((dx) << 16) / (dy); \
326 if (px < 0) \
327 { \
328 x = -px; px = 0; \
329 yy = x * dyy; \
330 y = yy >> 16; \
331 if (!a_a) \
332 y += (yy - (y << 16)) >> 15; \
333 py += y; \
334 if ((dely > 0) && (py >= clh)) \
335 return; \
336 else if ((dely < 0) && (py < -1)) \
337 return; \
338 } \
339 \
340 y = 0; \
341 if ((dely > 0) && (py < 0)) \
342 y = (-1 - py); \
343 else if ((dely < 0) && (py >= clh)) \
344 y = (clh - 1 - py); \
345 \
346 xx = y * dxx; \
347 x = xx >> 16; \
348 if (!a_a) \
349 x += (xx - (x << 16)) >> 15; \
350 px += x; \
351 if (px >= clw) return; \
352 \
353 yy = x * dyy; \
354 y = yy >> 16; \
355 if (!a_a) \
356 y += (yy - (y << 16)) >> 15; \
357 py += y; \
358 if ((dely > 0) && (py >= clh)) \
359 return; \
360 else if ((dely < 0) && (py < -1)) \
361 return; \
362 } \
363 \
364 p = data + (dstw * py) + px; \
365 \
366 x = px - x0; \
367 yy = x * dyy; \
368 prev_y = (yy >> 16); \
369 \
370 rx = MIN(x1 + 1, clw); \
371 by = clh - 1;
372
373
374#define SETUP_LINE_STEEP \
375 if (y0 > y1) \
376 { \
377 EXCHANGE_POINTS(x0, y0, x1, y1); \
378 dx = -dx; \
379 dy = -dy; \
380 } \
381 \
382 px = x0; \
383 py = y0; \
384 \
385 p0_in = (IN_RANGE(x0 , y0 , clw, clh) ? 1 : 0); \
386 p1_in = (IN_RANGE(x1 , y1 , clw, clh) ? 1 : 0); \
387 \
388 delx = 1; \
389 if (dx < 0) \
390 delx = -1; \
391 \
392 dxx = ((dx) << 16) / (dy); \
393 \
394 if (!p0_in) \
395 { \
396 dyy = ((dy) << 16) / (dx); \
397 \
398 if (py < 0) \
399 { \
400 y = -py; py = 0; \
401 xx = y * dxx; \
402 x = xx >> 16; \
403 if (!a_a) \
404 x += (xx - (x << 16)) >> 15; \
405 px += x; \
406 if ((delx > 0) && (px >= clw)) \
407 return; \
408 else if ((delx < 0) && (px < -1)) \
409 return; \
410 } \
411 \
412 x = 0; \
413 if ((delx > 0) && (px < -1)) \
414 x = (-1 - px); \
415 else if ((delx < 0) && (px >= clw)) \
416 x = (clw - 1 - px); \
417 \
418 yy = x * dyy; \
419 y = yy >> 16; \
420 if (!a_a) \
421 y += (yy - (y << 16)) >> 15; \
422 py += y; \
423 if (py >= clh) return; \
424 \
425 xx = y * dxx; \
426 x = xx >> 16; \
427 if (!a_a) \
428 x += (xx - (x << 16)) >> 15; \
429 px += x; \
430 if ((delx > 0) && (px >= clw)) \
431 return; \
432 else if ((delx < 0) && (px < -1)) \
433 return; \
434 } \
435 \
436 p = data + (dstw * py) + px; \
437 \
438 y = py - y0; \
439 xx = y * dxx; \
440 prev_x = (xx >> 16); \
441 \
442 by = MIN(y1 + 1, clh); \
443 rx = clw - 1;
444
445static void
446_evas_draw_line(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, int x1, int y1)
447{
448 int px, py, x, y, prev_x, prev_y;
449 int dx, dy, rx, by, p0_in, p1_in, dh, a_a = 0;
450 int delx, dely, xx, yy, dxx, dyy;
451 int clx, cly, clw, clh;
452 int dstw;
453 DATA32 *p, *data, color;
454 RGBA_Gfx_Pt_Func pfunc;
455
456 dx = x1 - x0;
457 dy = y1 - y0;
458
459 if ( (dx == 0) || (dy == 0) || (dx == dy) || (dx == -dy) )
460 {
461 _evas_draw_simple_line(dst, dc, x0, y0, x1, y1);
462 return;
463 }
464
465 color = dc->col.col;
466 pfunc = evas_common_gfx_func_composite_color_pt_get(color, dst, dc->render_op);
467 if (!pfunc) return;
468
469 clx = dc->clip.x;
470 cly = dc->clip.y;
471 clw = dc->clip.w;
472 clh = dc->clip.h;
473
474 data = dst->image.data;
475 dstw = dst->cache_entry.w;
476
477 data += (dstw * cly) + clx;
478 x0 -= clx;
479 y0 -= cly;
480 x1 -= clx;
481 y1 -= cly;
482
483 /* shallow: x-parametric */
484 if ((dy < dx) || (dy < -dx))
485 {
486 SETUP_LINE_SHALLOW;
487
488 while (px < rx)
489 {
490 y = (yy >> 16);
491 y += ((yy - (y << 16)) >> 15);
492 if (prev_y != y)
493 {
494 prev_y = y;
495 p += dh;
496 py += dely;
497 }
498 if (!p1_in)
499 {
500 if ((py < 0) && (dely < 0)) return;
501 if ((py > by) && (dely > 0)) return;
502 }
503 if (!p0_in)
504 {
505 if (py < 0) goto next_x;
506 }
507#ifdef EVAS_SLI
508 if (((py) % dc->sli.h) == dc->sli.y)
509#endif
510 {
511 if (IN_RANGE(px, py, clw, clh))
512 pfunc(0, 255, color, p);
513 }
514 next_x:
515 yy += dyy;
516 px++;
517 p++;
518 }
519 return;
520 }
521
522 /* steep: y-parametric */
523
524 SETUP_LINE_STEEP;
525
526 while (py < by)
527 {
528 x = (xx >> 16);
529 x += ((xx - (x << 16)) >> 15);
530 if (prev_x != x)
531 {
532 prev_x = x;
533 px += delx;
534 p += delx;
535 }
536 if (!p1_in)
537 {
538 if ((px < 0) && (delx < 0)) return;
539 if ((px > rx) && (delx > 0)) return;
540 }
541 if (!p0_in)
542 {
543 if (px < 0) goto next_y;
544 }
545#ifdef EVAS_SLI
546 if (((py) % dc->sli.h) == dc->sli.y)
547#endif
548 {
549 if (IN_RANGE(px, py, clw, clh))
550 pfunc(0, 255, color, p);
551 }
552 next_y:
553 xx += dxx;
554 py++;
555 p += dstw;
556 }
557}
558
559
560static void
561_evas_draw_line_aa(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, int x1, int y1)
562{
563 int px, py, x, y, prev_x, prev_y;
564 int dx, dy, rx, by, p0_in, p1_in, dh, a_a = 1;
565 int delx, dely, xx, yy, dxx, dyy;
566 int clx, cly, clw, clh;
567 int dstw;
568 DATA32 *p, *data, color;
569 RGBA_Gfx_Pt_Func pfunc;
570
571 if (y0 > y1)
572 EXCHANGE_POINTS(x0, y0, x1, y1);
573 dx = x1 - x0;
574 dy = y1 - y0;
575
576 if ( (dx == 0) || (dy == 0) || (dx == dy) || (dx == -dy) )
577 {
578 _evas_draw_simple_line(dst, dc, x0, y0, x1, y1);
579 return;
580 }
581
582 color = dc->col.col;
583 pfunc = evas_common_gfx_func_composite_mask_color_pt_get(color, dst, dc->render_op);
584 if (!pfunc) return;
585
586 clx = dc->clip.x;
587 cly = dc->clip.y;
588 clw = dc->clip.w;
589 clh = dc->clip.h;
590
591 data = evas_cache_image_pixels(&dst->cache_entry);
592 dstw = dst->cache_entry.w;
593
594 data += (dstw * cly) + clx;
595 x0 -= clx;
596 y0 -= cly;
597 x1 -= clx;
598 y1 -= cly;
599
600 /* shallow: x-parametric */
601 if ((dy < dx) || (dy < -dx))
602 {
603 SETUP_LINE_SHALLOW;
604
605 while (px < rx)
606 {
607 DATA8 aa;
608
609 y = (yy >> 16);
610 if (prev_y != y)
611 {
612 prev_y = y;
613 p += dh;
614 py += dely;
615 }
616 if (!p1_in)
617 {
618 if ((py < 0) && (dely < 0)) return;
619 if ((py > by) && (dely > 0)) return;
620 }
621 if (!p0_in)
622 {
623 if (py < 0) goto next_x;
624 }
625 if (px < clw)
626 {
627 aa = ((yy - (y << 16)) >> 8);
628 if ((py) < clh)
629 pfunc(0, 255 - aa, color, p);
630 if ((py + 1) < clh)
631 pfunc(0, aa, color, p + dstw);
632 }
633
634 next_x:
635 yy += dyy;
636 px++;
637 p++;
638 }
639 return;
640 }
641
642 /* steep: y-parametric */
643 SETUP_LINE_STEEP;
644
645 while (py < by)
646 {
647 DATA8 aa;
648
649 x = (xx >> 16);
650 if (prev_x != x)
651 {
652 prev_x = x;
653 px += delx;
654 p += delx;
655 }
656 if (!p1_in)
657 {
658 if ((px < 0) && (delx < 0)) return;
659 if ((px > rx) && (delx > 0)) return;
660 }
661 if (!p0_in)
662 {
663 if (px < 0) goto next_y;
664 }
665 if (py < clh)
666 {
667 aa = ((xx - (x << 16)) >> 8);
668 if ((px) < clw)
669 pfunc(0, 255 - aa, color, p);
670 if ((px + 1) < clw)
671 pfunc(0, aa, color, p + 1);
672 }
673 next_y:
674 xx += dxx;
675 py++;
676 p += dstw;
677 }
678}
diff --git a/libraries/evas/src/lib/engines/common/evas_map_image.c b/libraries/evas/src/lib/engines/common/evas_map_image.c
new file mode 100644
index 0000000..502b2dc
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_map_image.c
@@ -0,0 +1,432 @@
1#include "evas_common.h"
2#include "evas_blend_private.h"
3
4#ifdef BUILD_SCALE_SMOOTH
5# ifdef BUILD_MMX
6# undef SCALE_USING_MMX
7# define SCALE_USING_MMX
8# endif
9#endif
10
11#define FPI 8
12#define FPI1 (1 << (FPI))
13#define FPIH (1 << (FPI - 1))
14
15#define FPFPI1 (1 << (FP + FPI))
16
17typedef struct _Line Line;
18typedef struct _Span Span;
19
20struct _Span
21{
22 int x1, x2;
23 FPc o1, o2, z1, z2;
24 FPc u[2], v[2];
25 DATA32 col[2];
26};
27
28struct _Line
29{
30 Span span[2];
31};
32
33static FPc
34_interp(int x1, int x2, int p, FPc u1, FPc u2)
35{
36 FPc u;
37
38 x2 -= x1;
39 p -= x1;
40 u = u2 - u1;
41 u = (u * p) / (x2 + 1);
42 // FIXME: do z persp
43 return u1 + u;
44}
45
46static DATA32
47_interp_col(int x1, int x2, int p, DATA32 col1, DATA32 col2)
48{
49 x2 -= x1;
50 p -= x1;
51 p = (p << 8) / (x2 + 1);
52 // FIXME: do z persp
53 return INTERP_256(p, col2, col1);
54}
55
56static void
57_limit(Span *s, int c1, int c2, int nocol)
58{
59 if (s->x1 < c1)
60 {
61 s->u[0] = _interp(s->x1, s->x2, c1, s->u[0], s->u[1]);
62 s->v[0] = _interp(s->x1, s->x2, c1, s->v[0], s->v[1]);
63 if (!nocol)
64 s->col[0] = _interp_col(s->x1, s->x2, c1, s->col[0], s->col[1]);
65 s->x1 = c1;
66 s->o1 = c1 << FP;
67 // FIXME: do s->z1
68 }
69 if (s->x2 > c2)
70 {
71 s->u[1] = _interp(s->x1, s->x2, c2, s->u[0], s->u[1]);
72 s->v[1] = _interp(s->x1, s->x2, c2, s->v[0], s->v[1]);
73 if (!nocol)
74 s->col[1] = _interp_col(s->x1, s->x2, c2, s->col[0], s->col[1]);
75 s->x2 = c2;
76 s->o2 = c2 << FP;
77 // FIXME: do s->z2
78 }
79}
80
81// 12.63 % of time - this can improve
82static void
83_calc_spans(RGBA_Map_Point *p, Line *spans, int ystart, int yend, int cx, int cy __UNUSED__, int cw, int ch __UNUSED__)
84{
85 int i, y, yp, yy;
86 int py[4];
87 int edge[4][4], edge_num, swapped, order[4];
88 FPc uv[4][2], u, v, x, h, t, uu, vv;
89 DATA32 col[4];
90
91#if 1 // maybe faster on x86?
92 for (i = 0; i < 4; i++) py[i] = p[i].y >> FP;
93# define PY(x) (py[x])
94#else
95# define PY(x) (p[x].y >> FP)
96#endif
97
98 if ((PY(0) == PY(1)) && (PY(0) == PY(2)) && (PY(0) == PY(3)))
99 {
100 int leftp, rightp;
101 int nocol = 1;
102
103 leftp = rightp = 0;
104 for (i = 1; i < 4; i++)
105 {
106 if (p[i].x < p[leftp].x) leftp = i;
107 if (p[i].x > p[rightp].x) rightp = i;
108 if (p[i].col != 0xffffffff) nocol = 0;
109 }
110 for (y = ystart; y <= yend; y++)
111 {
112 yp = y - ystart;
113 if (y == PY(0))
114 {
115 i = 0;
116 spans[yp].span[i].x1 = p[leftp].x >> FP;
117 spans[yp].span[i].o1 = p[leftp].x;
118 spans[yp].span[i].u[0] = p[leftp].u;
119 spans[yp].span[i].v[0] = p[leftp].v;
120 spans[yp].span[i].col[0] = p[leftp].col;
121 spans[yp].span[i].x2 = p[rightp].x >> FP;
122 spans[yp].span[i].o2 = p[rightp].x;
123 spans[yp].span[i].u[1] = p[rightp].u;
124 spans[yp].span[i].v[1] = p[rightp].v;
125 spans[yp].span[i].col[1] = p[rightp].col;
126 if ((spans[yp].span[i].x1 >= (cx + cw)) ||
127 (spans[yp].span[i].x2 < cx))
128 spans[yp].span[i].x1 = -1;
129 else
130 {
131 _limit(&(spans[yp].span[i]), cx, cx + cw, nocol);
132 i++;
133 spans[yp].span[i].x1 = -1;
134 }
135 }
136 else
137 spans[yp].span[0].x1 = -1;
138 }
139 return;
140 }
141 for (y = ystart; y <= yend; y++)
142 {
143 int nocol = 1;
144
145 yp = y - ystart;
146 edge_num = 0;
147 for (i = 0; i < 4; i++)
148 {
149 if ((PY(i) <= y) && (PY((i + 1) % 4) > y))
150 {
151 edge[edge_num][0] = i;
152 edge[edge_num][1] = (i + 1) % 4;
153 edge_num++;
154 }
155 else if ((PY((i + 1) % 4) <= y) && (PY(i) > y))
156 {
157 edge[edge_num][0] = (i + 1) % 4;
158 edge[edge_num][1] = i;
159 edge_num++;
160 }
161 if (p[i].col != 0xffffffff) nocol = 0;
162 }
163 // calculate line x points for each edge
164 for (i = 0; i < edge_num; i++)
165 {
166 int e1 = edge[i][0];
167 int e2 = edge[i][1];
168 FPc t256;
169
170 h = (p[e2].y - p[e1].y) >> FP; // height of edge
171 if (h < 1) h = 1;
172 t = (((y << FP) + (FP1 / 2) - 1) - p[e1].y) >> FP;
173 x = p[e2].x - p[e1].x;
174 x = p[e1].x + ((x * t) / h);
175
176/*
177 // FIXME: 3d accuracy here
178 // XXX t needs adjusting. above its a linear interp point
179 // only.
180 //
181 // // FIXME: do in fixed pt. reduce divides
182 evas_common_cpu_end_opt();
183 //
184 int foc = 512, z0 = 0, px = 320, py = 240; // FIXME: need from map points
185 //
186 float focf, hf;
187 float z1, z2, y1, y2, dz, dy, zt, dydz, yt;
188
189 focf = foc;
190 hf = h;
191
192 // adjust for fixed point and focal length and z0 for map
193 z1 = (p[e1].z >> FP) - z0 + foc;
194 z2 = (p[e2].z >> FP) - z0 + foc;
195 // deltas
196 dz = z1 - z2;
197
198 if (dz != 0)
199 {
200 int pt;
201
202 // adjust for perspective point (being 0 0)
203 y1 = (p[e1].y >> FP) - py;
204 y2 = (p[e2].y >> FP) - py;
205
206 // correct for x &y not being in world coords - screen coords
207 y1 = (y1 * z1) / focf;
208 y2 = (y2 * z2) / focf;
209
210 // deltas
211 dy = y1 - y2;
212
213 yt = y - py;
214 dydz = dy / dz;
215
216 zt = (y2 - (dydz * z2)) / ((yt / focf) - dydz);
217
218 pt = t;
219 t = ((z1 - zt) * hf) / dz;
220 }
221 */
222 u = p[e2].u - p[e1].u;
223 uu = u >> FP;
224 if (uu < 0) uu = -uu;
225 if (uu == h)
226 {
227 yy = ((y << FP) - p[e1].y) >> FP;
228 if (u > 0)
229 u = p[e1].u + (yy << FP);
230 else
231 u = p[e1].u - (yy << FP) - (FP1 - 1);
232 }
233 else
234 {
235 if (u >= 0)
236 u = p[e1].u + ((u * t) / h);
237 else
238 u = p[e1].u + (((u * t) - (FP1 / 2)) / h);
239 }
240
241 v = p[e2].v - p[e1].v;
242 vv = v >> FP;
243 if (vv < 0) vv = -vv;
244 if (vv == h)
245 {
246 yy = ((y << FP) - p[e1].y) >> FP;
247 if (v > 0)
248 v = p[e1].v + (yy << FP);
249 else
250 v = p[e1].v - (yy << FP) - (FP1 - 1);
251 }
252 else
253 {
254 if (v >= 0)
255 v = p[e1].v + ((v * t) / h);
256 else
257 v = p[e1].v + (((v * t) - (FP1 / 2)) / h);
258 }
259
260 // FIXME: 3d accuracy for color too
261 t256 = (t << 8) / h; // maybe * 255?
262 col[i] = INTERP_256(t256, p[e2].col, p[e1].col);
263
264 // FIXME: store z persp
265 uv[i][1] = v;
266 uv[i][0] = u;
267 edge[i][2] = x >> FP;
268 edge[i][3] = x;
269 // also fill in order
270 order[i] = i;
271 }
272 // sort edges from left to right - bubble. its a small list!
273 do
274 {
275 swapped = 0;
276 for (i = 0; i < (edge_num - 1); i++)
277 {
278 if (edge[order[i]][2] > edge[order[i + 1]][2])
279 {
280 t = order[i];
281 order[i] = order[i + 1];
282 order[i + 1] = t;
283 swapped = 1;
284 }
285 }
286 }
287 while (swapped);
288 if (edge_num == 2)
289 {
290 i = 0;
291 spans[yp].span[i].x1 = edge[order[0]][2];
292 spans[yp].span[i].o1 = edge[order[0]][3];
293 spans[yp].span[i].u[0] = uv[order[0]][0];
294 spans[yp].span[i].v[0] = uv[order[0]][1];
295 spans[yp].span[i].col[0] = col[order[0]];
296
297 spans[yp].span[i].x2 = edge[order[1]][2];
298 spans[yp].span[i].o2 = edge[order[1]][3];
299 spans[yp].span[i].u[1] = uv[order[1]][0];
300 spans[yp].span[i].v[1] = uv[order[1]][1];
301 spans[yp].span[i].col[1] = col[order[1]];
302 if ((spans[yp].span[i].x1 >= (cx + cw)) ||
303 (spans[yp].span[i].x2 < cx))
304 spans[yp].span[i].x1 = -1;
305 else
306 {
307 _limit(&(spans[yp].span[i]), cx, cx + cw, nocol);
308 i++;
309 spans[yp].span[i].x1 = -1;
310 }
311 }
312 else if (edge_num == 4)
313 {
314 i = 0;
315 spans[yp].span[i].x1 = edge[order[0]][2];
316 spans[yp].span[i].u[0] = uv[order[0]][0];
317 spans[yp].span[i].v[0] = uv[order[0]][1];
318 spans[yp].span[i].col[0] = col[order[0]];
319
320 spans[yp].span[i].x2 = edge[order[1]][2];
321 spans[yp].span[i].u[1] = uv[order[1]][0];
322 spans[yp].span[i].v[1] = uv[order[1]][1];
323 spans[yp].span[i].col[1] = col[order[1]];
324 if ((spans[yp].span[i].x1 >= (cx + cw)) ||
325 (spans[yp].span[i].x2 < cx))
326 spans[yp].span[i].x1 = -1;
327 else
328 {
329 _limit(&(spans[yp].span[i]), cx, cx + cw, nocol);
330 i++;
331 }
332 spans[yp].span[i].x1 = edge[order[2]][2];
333 spans[yp].span[i].u[0] = uv[order[2]][0];
334 spans[yp].span[i].v[0] = uv[order[2]][1];
335 spans[yp].span[i].col[0] = col[order[2]];
336
337 spans[yp].span[i].x2 = edge[order[3]][2];
338 spans[yp].span[i].u[1] = uv[order[3]][0];
339 spans[yp].span[i].v[1] = uv[order[3]][1];
340 spans[yp].span[i].col[1] = col[order[3]];
341 if ((spans[yp].span[i].x1 >= (cx + cw)) ||
342 (spans[yp].span[i].x2 < cx))
343 spans[yp].span[i].x1 = -1;
344 else
345 {
346 int l = cx;
347
348 if (i > 0) l = spans[yp].span[i - 1].x2;
349 _limit(&(spans[yp].span[i]), l, cx + cw, nocol);
350 }
351 }
352 else
353 spans[yp].span[0].x1 = -1;
354 }
355}
356
357#ifdef BUILD_SCALE_SMOOTH
358# ifdef BUILD_MMX
359# undef FUNC_NAME
360# define FUNC_NAME evas_common_map_rgba_internal_mmx
361# undef SCALE_USING_MMX
362# define SCALE_USING_MMX
363# include "evas_map_image_internal.c"
364# endif
365# ifdef BUILD_C
366# undef FUNC_NAME
367# define FUNC_NAME evas_common_map_rgba_internal
368# undef SCALE_USING_MMX
369# include "evas_map_image_internal.c"
370# endif
371#endif
372
373EAPI void
374evas_common_map_rgba(RGBA_Image *src, RGBA_Image *dst,
375 RGBA_Draw_Context *dc,
376 int npoints __UNUSED__, RGBA_Map_Point *p,
377 int smooth, int level)
378{
379#ifdef BUILD_MMX
380 int mmx, sse, sse2;
381#endif
382 Cutout_Rects *rects;
383 Cutout_Rect *r;
384 int c, cx, cy, cw, ch;
385 int i;
386
387 if (src->cache_entry.space == EVAS_COLORSPACE_ARGB8888)
388 evas_cache_image_load_data(&src->cache_entry);
389 evas_common_image_colorspace_normalize(src);
390 if (!src->image.data) return;
391#ifdef BUILD_MMX
392 evas_common_cpu_can_do(&mmx, &sse, &sse2);
393#endif
394 if ((!dc->cutout.rects) && (!dc->clip.use))
395 {
396#ifdef BUILD_MMX
397 if (mmx)
398 evas_common_map_rgba_internal_mmx(src, dst, dc, p, smooth, level);
399 else
400#endif
401#ifdef BUILD_C
402 evas_common_map_rgba_internal(src, dst, dc, p, smooth, level);
403#endif
404 return;
405 }
406 /* save out clip info */
407 c = dc->clip.use; cx = dc->clip.x; cy = dc->clip.y; cw = dc->clip.w; ch = dc->clip.h;
408 evas_common_draw_context_clip_clip(dc, 0, 0, dst->cache_entry.w, dst->cache_entry.h);
409 /* our clip is 0 size.. abort */
410 if ((dc->clip.w <= 0) || (dc->clip.h <= 0))
411 {
412 dc->clip.use = c; dc->clip.x = cx; dc->clip.y = cy; dc->clip.w = cw; dc->clip.h = ch;
413 return;
414 }
415 rects = evas_common_draw_context_apply_cutouts(dc);
416 for (i = 0; i < rects->active; ++i)
417 {
418 r = rects->rects + i;
419 evas_common_draw_context_set_clip(dc, r->x, r->y, r->w, r->h);
420#ifdef BUILD_MMX
421 if (mmx)
422 evas_common_map_rgba_internal_mmx(src, dst, dc, p, smooth, level);
423 else
424#endif
425#ifdef BUILD_C
426 evas_common_map_rgba_internal(src, dst, dc, p, smooth, level);
427#endif
428 }
429 evas_common_draw_context_apply_clear_cutouts(rects);
430 /* restore clip info */
431 dc->clip.use = c; dc->clip.x = cx; dc->clip.y = cy; dc->clip.w = cw; dc->clip.h = ch;
432}
diff --git a/libraries/evas/src/lib/engines/common/evas_map_image.h b/libraries/evas/src/lib/engines/common/evas_map_image.h
new file mode 100644
index 0000000..a7cb8cf
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_map_image.h
@@ -0,0 +1,10 @@
1#ifndef _EVAS_MAP_H
2#define _EVAS_MAP_H
3
4EAPI void
5evas_common_map_rgba(RGBA_Image *src, RGBA_Image *dst,
6 RGBA_Draw_Context *dc,
7 int npoints, RGBA_Map_Point *points,
8 int smooth, int level);
9
10#endif /* _EVAS_MAP_H */
diff --git a/libraries/evas/src/lib/engines/common/evas_map_image_core.c b/libraries/evas/src/lib/engines/common/evas_map_image_core.c
new file mode 100644
index 0000000..b9bbeb5
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_map_image_core.c
@@ -0,0 +1,226 @@
1//#undef SCALE_USING_MMX
2{
3 if (smooth)
4 {
5 for (y = ystart; y <= yend; y++)
6 {
7 int x, w, ww;
8 FPc u, v, ud, vd, dv, ue, ve;
9 DATA32 *d, *s;
10#ifdef COLMUL
11 FPc cv, cd; // col
12# ifdef SCALE_USING_MMX
13 FPc cc;
14#endif
15 DATA32 c1, c2; // col
16#endif
17 Line *line;
18
19#ifdef SCALE_USING_MMX
20 pxor_r2r(mm0, mm0);
21 MOV_A2R(ALPHA_255, mm5)
22#endif
23
24 line = &(spans[y - ystart]);
25 for (i = 0; i < 2; i++)
26 {
27 Span *span;
28
29 span = &(line->span[i]);
30 if (span->x1 >= 0)
31 {
32 long long tl;
33
34 x = span->x1;
35 w = (span->x2 - x);
36 if (w <= 0) continue;
37 dv = (span->o2 - span->o1);
38 if (dv <= 0) continue;
39
40 ww = w;
41 u = span->u[0] << FPI;
42 if (u < 0) u = 0;
43 else if (u > swp) u = swp;
44 v = span->v[0] << FPI;
45 if (v < 0) v = 0;
46 else if (v > shp) v = shp;
47 ue = span->u[1] << FPI;
48 if (ue < 0) ue = 0;
49 else if (ue > swp) ue = swp;
50 ve = span->v[1] << FPI;
51 if (ve < 0) ve = 0;
52 else if (ve > shp) ve = shp;
53 ud = (ue - u) / w;
54 vd = (ve - v) / w;
55 tl = (long long)ud * (w << FP);
56 tl = tl / dv;
57 ud = tl;
58 u -= (ud * (span->o1 - (span->x1 << FP))) / FP1;
59
60 tl = (long long)vd * (w << FP);
61 tl = tl / dv;
62 vd = tl;
63 v -= (vd * (span->o1 - (span->x1 << FP))) / FP1;
64
65 if (ud < 0) u += ud;
66 if (vd < 0) v += vd;
67 if (u < 0) u = 0;
68 else if (u >= swp) u = swp - 1;
69 if (v < 0) v = 0;
70 else if (v >= shp) v = shp - 1;
71
72 if (direct)
73 d = dst->image.data + (y * dst->cache_entry.w) + x;
74 else
75 d = buf;
76
77#define SMOOTH 1
78#ifdef COLMUL
79 c1 = span->col[0]; // col
80 c2 = span->col[1]; // col
81 cv = 0; // col
82 cd = (255 << 16) / w; // col
83
84 if (c1 == c2)
85 {
86 if (c1 == 0xffffffff)
87 {
88#endif
89#include "evas_map_image_loop.c"
90#ifdef COLMUL
91 }
92 else if ((c1 == 0x0000ff) && (!src->cache_entry.flags.alpha))
93 {
94 // all black line
95# define COLBLACK 1
96# include "evas_map_image_loop.c"
97# undef COLBLACK
98 }
99 else if (c1 == 0x000000)
100 {
101 // skip span
102 }
103 else
104 {
105 // generic loop
106# include "evas_map_image_loop.c"
107 }
108 }
109 else
110 {
111# include "evas_map_image_loop.c"
112 }
113#endif
114 if (!direct)
115 {
116 d = dst->image.data;
117 d += (y * dst->cache_entry.w) + x;
118 func(buf, NULL, dc->mul.col, d, w);
119 }
120 }
121 else break;
122 }
123 }
124 }
125 else
126 {
127 for (y = ystart; y <= yend; y++)
128 {
129 int x, w, ww;
130 FPc u, v, ud, vd, ue, ve;
131 DATA32 *d, *s;
132#ifdef COLMUL
133 FPc cv, cd; // col
134 DATA32 c1, c2; // col
135#endif
136 Line *line;
137
138 line = &(spans[y - ystart]);
139 for (i = 0; i < 2; i++)
140 {
141 Span *span;
142
143 span = &(line->span[i]);
144 if (span->x1 >= 0)
145 {
146 x = span->x1;
147 w = (span->x2 - x);
148
149 if (w <= 0) continue;
150 ww = w;
151 u = span->u[0] << FPI;
152 if (u < 0) u = 0;
153 else if (u > swp) u = swp;
154 v = span->v[0] << FPI;
155 if (v < 0) v = 0;
156 else if (v > shp) v = shp;
157 ue = span->u[1] << FPI;
158 if (ue < 0) ue = 0;
159 else if (ue > swp) ue = swp;
160 ve = span->v[1] << FPI;
161 if (ve < 0) ve = 0;
162 else if (ve > shp) ve = shp;
163 ud = (ue - u) / w;
164 vd = (ve - v) / w;
165 if (direct)
166 d = dst->image.data + (y * dst->cache_entry.w) + x;
167 else
168 d = buf;
169
170 if (ud < 0) u += ud;
171 if (vd < 0) v += vd;
172 if (u < 0) u = 0;
173 else if (u >= swp) u = swp - 1;
174 if (v < 0) v = 0;
175 else if (v >= shp) v = shp - 1;
176
177#undef SMOOTH
178#ifdef COLMUL
179 c1 = span->col[0]; // col
180 c2 = span->col[1]; // col
181 cv = 0; // col
182 cd = (255 << 16) / w; // col
183
184 if (c1 == c2)
185 {
186 if (c1 == 0xffffffff)
187 {
188#endif
189#include "evas_map_image_loop.c"
190#ifdef COLMUL
191 }
192 else if ((c1 == 0x0000ff) && (!src->cache_entry.flags.alpha))
193 {
194 // all black line
195# define COLBLACK 1
196# include "evas_map_image_loop.c"
197# undef COLBLACK
198 }
199 else if (c1 == 0x000000)
200 {
201 // skip span
202 }
203 else
204 {
205 // generic loop
206# include "evas_map_image_loop.c"
207 }
208 }
209 else
210 {
211 // generic loop
212# include "evas_map_image_loop.c"
213 }
214#endif
215 if (!direct)
216 {
217 d = dst->image.data;
218 d += (y * dst->cache_entry.w) + x;
219 func(buf, NULL, dc->mul.col, d, w);
220 }
221 }
222 else break;
223 }
224 }
225 }
226}
diff --git a/libraries/evas/src/lib/engines/common/evas_map_image_internal.c b/libraries/evas/src/lib/engines/common/evas_map_image_internal.c
new file mode 100644
index 0000000..d60117e
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_map_image_internal.c
@@ -0,0 +1,117 @@
1// 66.74 % of time
2static void
3FUNC_NAME(RGBA_Image *src, RGBA_Image *dst,
4 RGBA_Draw_Context *dc,
5 RGBA_Map_Point *p,
6 int smooth, int level __UNUSED__) // level unused for now - for future use
7{
8 int i;
9 int c, cx, cy, cw, ch;
10 int ytop, ybottom, ystart, yend, y, sw, shp, swp, direct;
11 Line *spans;
12 DATA32 *buf = NULL, *sp;
13 RGBA_Gfx_Func func = NULL;
14 int havea = 0;
15 int havecol = 4;
16
17 // get the clip
18 c = dc->clip.use; cx = dc->clip.x; cy = dc->clip.y; cw = dc->clip.w; ch = dc->clip.h;
19 if (!c)
20 {
21 cx = 0;
22 cy = 0;
23 cw = dst->cache_entry.w;
24 ch = dst->cache_entry.h;
25 }
26
27 // find y yop line and y bottom line
28 ytop = p[0].y;
29 if ((p[0].col >> 24) < 0xff) havea = 1;
30 if (p[0].col == 0xffffffff) havecol--;
31 for (i = 1; i < 4; i++)
32 {
33 if (p[i].y < ytop) ytop = p[i].y;
34 if ((p[i].col >> 24) < 0xff) havea = 1;
35 if (p[i].col == 0xffffffff) havecol--;
36 }
37
38 ybottom = p[0].y;
39 for (i = 1; i < 4; i++)
40 {
41 if (p[i].y > ybottom) ybottom = p[i].y;
42 }
43
44 // convert to screen space from fixed point
45 ytop = ytop >> FP;
46 ybottom = ybottom >> FP;
47
48 // if its outside the clip vertical bounds - don't bother
49 if ((ytop >= (cy + ch)) || (ybottom < cy)) return;
50
51 // limit to the clip vertical bounds
52 if (ytop < cy) ystart = cy;
53 else ystart = ytop;
54 if (ybottom >= (cy + ch)) yend = (cy + ch) - 1;
55 else yend = ybottom;
56
57 // get some source image information
58 sp = src->image.data;
59 sw = src->cache_entry.w;
60 swp = sw << (FP + FPI);
61 shp = src->cache_entry.h << (FP + FPI);
62
63 // limit u,v coords of points to be within the source image
64 for (i = 0; i < 4; i++)
65 {
66 if (p[i].u < 0) p[i].u = 0;
67 else if (p[i].u > (int)(src->cache_entry.w << FP))
68 p[i].u = src->cache_entry.w << FP;
69
70 if (p[i].v < 0) p[i].v = 0;
71 else if (p[i].v > (int)(src->cache_entry.h << FP))
72 p[i].v = src->cache_entry.h << FP;
73 }
74
75 // allocate some spans to hold out span list
76 spans = alloca((yend - ystart + 1) * sizeof(Line));
77 if (!spans) return;
78 memset(spans, 0, (yend - ystart + 1) * sizeof(Line));
79
80 // calculate the spans list
81 _calc_spans(p, spans, ystart, yend, cx, cy, cw, ch);
82
83 // walk through spans and render
84
85 // if operation is solid, bypass buf and draw func and draw direct to dst
86 direct = 0;
87 if ((!src->cache_entry.flags.alpha) && (!dst->cache_entry.flags.alpha) &&
88 (!dc->mul.use) && (!havea))
89 {
90 direct = 1;
91 }
92 else
93 {
94 int pa;
95
96 buf = alloca(cw * sizeof(DATA32));
97 if (!buf) return;
98 pa = src->cache_entry.flags.alpha;
99 if (havea) src->cache_entry.flags.alpha = 1;
100 if (dc->mul.use)
101 func = evas_common_gfx_func_composite_pixel_color_span_get(src, dc->mul.col, dst, cw, dc->render_op);
102 else
103 func = evas_common_gfx_func_composite_pixel_span_get(src, dst, cw, dc->render_op);
104 src->cache_entry.flags.alpha = pa;
105 }
106
107 if (!havecol)
108 {
109#undef COLMUL
110#include "evas_map_image_core.c"
111 }
112 else
113 {
114#define COLMUL 1
115#include "evas_map_image_core.c"
116 }
117}
diff --git a/libraries/evas/src/lib/engines/common/evas_map_image_loop.c b/libraries/evas/src/lib/engines/common/evas_map_image_loop.c
new file mode 100644
index 0000000..c434386
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_map_image_loop.c
@@ -0,0 +1,116 @@
1#ifdef SMOOTH
2{
3 while (ww > 0)
4 {
5# ifdef COLBLACK
6 *d = 0xff000000; // col
7# else
8 FPc u1, v1, u2, v2;
9 FPc rv, ru;
10 DATA32 val1, val2, val3, val4;
11
12 u1 = u;
13 if (u1 < 0) u1 = 0;
14 else if (u1 >= swp) u1 = swp - 1;
15
16 v1 = v;
17 if (v1 < 0) v1 = 0;
18 else if (v1 >= shp) v1 = shp - 1;
19
20 u2 = u1 + FPFPI1;
21 if (u2 >= swp) u2 = swp - 1;
22
23 v2 = v1 + FPFPI1;
24 if (v2 >= shp) v2 = shp - 1;
25
26 ru = (u >> (FP + FPI - 8)) & 0xff;
27 rv = (v >> (FP + FPI - 8)) & 0xff;
28
29 s = sp + ((v1 >> (FP + FPI)) * sw) +
30 (u1 >> (FP + FPI));
31 val1 = *s;
32 s = sp + ((v1 >> (FP + FPI)) * sw) +
33 (u2 >> (FP + FPI));
34 val2 = *s;
35
36 s = sp + ((v2 >> (FP + FPI)) * sw) +
37 (u1 >> (FP + FPI));
38 val3 = *s;
39 s = sp + ((v2 >> (FP + FPI)) * sw) +
40 (u2 >> (FP + FPI));
41 val4 = *s;
42# ifdef SCALE_USING_MMX
43 MOV_A2R(rv, mm4);
44 MOV_A2R(ru, mm6);
45 MOV_P2R(val1, mm1, mm0);
46 if (val1 | val2)
47 {
48 MOV_P2R(val2, mm2, mm0);
49 INTERP_256_R2R(mm6, mm2, mm1, mm5);
50 }
51 MOV_P2R(val3, mm2, mm0);
52 if (val3 | val4)
53 {
54 MOV_P2R(val4, mm3, mm0);
55 INTERP_256_R2R(mm6, mm3, mm2, mm5);
56 }
57 INTERP_256_R2R(mm4, mm2, mm1, mm5);
58# ifdef COLMUL
59 cc = cv >> 16; // col
60 cv += cd; // col
61 MOV_A2R(cc, mm2); // col
62 MOV_P2R(c1, mm3, mm0); // col
63 MOV_P2R(c2, mm4, mm0); // col
64 INTERP_256_R2R(mm2, mm4, mm3, mm5); // col
65 MUL4_SYM_R2R(mm3, mm1, mm5); // col
66# endif
67 MOV_R2P(mm1, *d, mm0);
68# else
69 val1 = INTERP_256(ru, val2, val1);
70 val3 = INTERP_256(ru, val4, val3);
71 val1 = INTERP_256(rv, val3, val1); // col
72# ifdef COLMUL
73 val2 = INTERP_256((cv >> 16), c2, c1); // col
74 *d = MUL4_SYM(val2, val1); // col
75 cv += cd; // col
76# else
77 *d = INTERP_256(rv, val3, val1);
78# endif
79# endif
80 u += ud;
81 v += vd;
82# endif
83 d++;
84 ww--;
85 }
86}
87#else
88{
89 while (ww > 0)
90 {
91# ifdef COLMUL
92# ifndef COLBLACK
93 DATA32 val1, cval; // col
94# endif
95# endif
96# ifdef COLBLACK
97 *d = 0xff000000; // col
98# else
99 s = sp + ((v >> (FP + FPI)) * sw) +
100 (u >> (FP + FPI));
101# ifdef COLMUL
102 val1 = *s; // col
103 cval = INTERP_256((cv >> 16), c2, c1); // col
104 *d = MUL4_SYM(cval, val1);
105 cv += cd; // col
106# else
107 *d = *s;
108# endif
109 u += ud;
110 v += vd;
111# endif
112 d++;
113 ww--;
114 }
115}
116#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_add/Makefile.am b/libraries/evas/src/lib/engines/common/evas_op_add/Makefile.am
new file mode 100644
index 0000000..78ce9fa
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_add/Makefile.am
@@ -0,0 +1,13 @@
1MAINTAINERCLEANFILES = Makefile.in
2
3EXTRA_DIST = \
4op_add_color_.c \
5op_add_color_i386.c \
6op_add_mask_color_.c \
7op_add_mask_color_i386.c \
8op_add_pixel_.c \
9op_add_pixel_color_.c \
10op_add_pixel_color_i386.c \
11op_add_pixel_i386.c \
12op_add_pixel_mask_.c \
13op_add_pixel_mask_i386.c
diff --git a/libraries/evas/src/lib/engines/common/evas_op_add/Makefile.in b/libraries/evas/src/lib/engines/common/evas_op_add/Makefile.in
new file mode 100644
index 0000000..4c721f9
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_add/Makefile.in
@@ -0,0 +1,543 @@
1# Makefile.in generated by automake 1.11.1 from Makefile.am.
2# @configure_input@
3
4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
6# Inc.
7# This Makefile.in is free software; the Free Software Foundation
8# gives unlimited permission to copy and/or distribute it,
9# with or without modifications, as long as this notice is preserved.
10
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
13# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14# PARTICULAR PURPOSE.
15
16@SET_MAKE@
17VPATH = @srcdir@
18pkgdatadir = $(datadir)/@PACKAGE@
19pkgincludedir = $(includedir)/@PACKAGE@
20pkglibdir = $(libdir)/@PACKAGE@
21pkglibexecdir = $(libexecdir)/@PACKAGE@
22am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
23install_sh_DATA = $(install_sh) -c -m 644
24install_sh_PROGRAM = $(install_sh) -c
25install_sh_SCRIPT = $(install_sh) -c
26INSTALL_HEADER = $(INSTALL_DATA)
27transform = $(program_transform_name)
28NORMAL_INSTALL = :
29PRE_INSTALL = :
30POST_INSTALL = :
31NORMAL_UNINSTALL = :
32PRE_UNINSTALL = :
33POST_UNINSTALL = :
34build_triplet = @build@
35host_triplet = @host@
36subdir = src/lib/engines/common/evas_op_add
37DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
38ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
39am__aclocal_m4_deps = $(top_srcdir)/m4/efl_attribute.m4 \
40 $(top_srcdir)/m4/efl_coverage.m4 \
41 $(top_srcdir)/m4/efl_doxygen.m4 \
42 $(top_srcdir)/m4/efl_fnmatch.m4 \
43 $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \
44 $(top_srcdir)/m4/evas_check_engine.m4 \
45 $(top_srcdir)/m4/evas_check_loader.m4 \
46 $(top_srcdir)/m4/evas_converter.m4 \
47 $(top_srcdir)/m4/evas_dither.m4 \
48 $(top_srcdir)/m4/evas_scaler.m4 $(top_srcdir)/m4/libtool.m4 \
49 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
50 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
51 $(top_srcdir)/configure.ac
52am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
53 $(ACLOCAL_M4)
54mkinstalldirs = $(install_sh) -d
55CONFIG_HEADER = $(top_builddir)/config.h
56CONFIG_CLEAN_FILES =
57CONFIG_CLEAN_VPATH_FILES =
58AM_V_GEN = $(am__v_GEN_$(V))
59am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
60am__v_GEN_0 = @echo " GEN " $@;
61AM_V_at = $(am__v_at_$(V))
62am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
63am__v_at_0 = @
64SOURCES =
65DIST_SOURCES =
66DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
67ACLOCAL = @ACLOCAL@
68ALLOCA = @ALLOCA@
69AMTAR = @AMTAR@
70AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
71AR = @AR@
72AS = @AS@
73AUTOCONF = @AUTOCONF@
74AUTOHEADER = @AUTOHEADER@
75AUTOMAKE = @AUTOMAKE@
76AWK = @AWK@
77CC = @CC@
78CCDEPMODE = @CCDEPMODE@
79CFLAGS = @CFLAGS@
80CHECK_CFLAGS = @CHECK_CFLAGS@
81CHECK_LIBS = @CHECK_LIBS@
82CPP = @CPP@
83CPPFLAGS = @CPPFLAGS@
84CXX = @CXX@
85CXXCPP = @CXXCPP@
86CXXDEPMODE = @CXXDEPMODE@
87CXXFLAGS = @CXXFLAGS@
88CYGPATH_W = @CYGPATH_W@
89DEFS = @DEFS@
90DEPDIR = @DEPDIR@
91DIRECTFB_CFLAGS = @DIRECTFB_CFLAGS@
92DIRECTFB_LIBS = @DIRECTFB_LIBS@
93DLLTOOL = @DLLTOOL@
94DSYMUTIL = @DSYMUTIL@
95DUMPBIN = @DUMPBIN@
96ECHO_C = @ECHO_C@
97ECHO_N = @ECHO_N@
98ECHO_T = @ECHO_T@
99ECORE_EVAS_CFLAGS = @ECORE_EVAS_CFLAGS@
100ECORE_EVAS_LIBS = @ECORE_EVAS_LIBS@
101EDB_CFLAGS = @EDB_CFLAGS@
102EDB_LIBS = @EDB_LIBS@
103EDJE_CFLAGS = @EDJE_CFLAGS@
104EDJE_LIBS = @EDJE_LIBS@
105EET_CFLAGS = @EET_CFLAGS@
106EET_LIBS = @EET_LIBS@
107EFL_COVERAGE_CFLAGS = @EFL_COVERAGE_CFLAGS@
108EFL_COVERAGE_LIBS = @EFL_COVERAGE_LIBS@
109EFL_FNMATCH_LIBS = @EFL_FNMATCH_LIBS@
110EGREP = @EGREP@
111EINA_CFLAGS = @EINA_CFLAGS@
112EINA_LIBS = @EINA_LIBS@
113EVAS_CFLAGS = @EVAS_CFLAGS@
114EVAS_LIBS = @EVAS_LIBS@
115EVAS_SSE3_CFLAGS = @EVAS_SSE3_CFLAGS@
116EVIL_CFLAGS = @EVIL_CFLAGS@
117EVIL_LIBS = @EVIL_LIBS@
118EXEEXT = @EXEEXT@
119FGREP = @FGREP@
120FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@
121FONTCONFIG_LIBS = @FONTCONFIG_LIBS@
122FREETYPE_CFLAGS = @FREETYPE_CFLAGS@
123FREETYPE_LIBS = @FREETYPE_LIBS@
124FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@
125FRIBIDI_LIBS = @FRIBIDI_LIBS@
126GL_EET_CFLAGS = @GL_EET_CFLAGS@
127GL_EET_LIBS = @GL_EET_LIBS@
128GREP = @GREP@
129HARFBUZZ_CFLAGS = @HARFBUZZ_CFLAGS@
130HARFBUZZ_LIBS = @HARFBUZZ_LIBS@
131INSTALL = @INSTALL@
132INSTALL_DATA = @INSTALL_DATA@
133INSTALL_PROGRAM = @INSTALL_PROGRAM@
134INSTALL_SCRIPT = @INSTALL_SCRIPT@
135INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
136LD = @LD@
137LDFLAGS = @LDFLAGS@
138LIBOBJS = @LIBOBJS@
139LIBS = @LIBS@
140LIBTOOL = @LIBTOOL@
141LINEBREAK_CFLAGS = @LINEBREAK_CFLAGS@
142LINEBREAK_LIBS = @LINEBREAK_LIBS@
143LIPO = @LIPO@
144LN_S = @LN_S@
145LTLIBOBJS = @LTLIBOBJS@
146MAKEINFO = @MAKEINFO@
147MKDIR_P = @MKDIR_P@
148MODULE_ARCH = @MODULE_ARCH@
149NM = @NM@
150NMEDIT = @NMEDIT@
151OBJC = @OBJC@
152OBJCDEPMODE = @OBJCDEPMODE@
153OBJCFLAGS = @OBJCFLAGS@
154OBJDUMP = @OBJDUMP@
155OBJEXT = @OBJEXT@
156OTOOL = @OTOOL@
157OTOOL64 = @OTOOL64@
158PACKAGE = @PACKAGE@
159PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
160PACKAGE_NAME = @PACKAGE_NAME@
161PACKAGE_STRING = @PACKAGE_STRING@
162PACKAGE_TARNAME = @PACKAGE_TARNAME@
163PACKAGE_URL = @PACKAGE_URL@
164PACKAGE_VERSION = @PACKAGE_VERSION@
165PATH_SEPARATOR = @PATH_SEPARATOR@
166PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
167PIXMAN_LIBS = @PIXMAN_LIBS@
168PKG_CONFIG = @PKG_CONFIG@
169PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
170PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
171PNG_CFLAGS = @PNG_CFLAGS@
172PNG_LIBS = @PNG_LIBS@
173RANLIB = @RANLIB@
174SDL_CFLAGS = @SDL_CFLAGS@
175SDL_LIBS = @SDL_LIBS@
176SED = @SED@
177SET_MAKE = @SET_MAKE@
178SHELL = @SHELL@
179SHM_OPEN_LINK = @SHM_OPEN_LINK@
180STRIP = @STRIP@
181SVG_CFLAGS = @SVG_CFLAGS@
182SVG_LIBS = @SVG_LIBS@
183VALGRIND_CFLAGS = @VALGRIND_CFLAGS@
184VALGRIND_LIBS = @VALGRIND_LIBS@
185VERSION = @VERSION@
186VMAJ = @VMAJ@
187WIN32_CFLAGS = @WIN32_CFLAGS@
188WIN32_CPPFLAGS = @WIN32_CPPFLAGS@
189XCB_CFLAGS = @XCB_CFLAGS@
190XCB_GL_CFLAGS = @XCB_GL_CFLAGS@
191XCB_GL_LIBS = @XCB_GL_LIBS@
192XCB_LIBS = @XCB_LIBS@
193XEXT_CFLAGS = @XEXT_CFLAGS@
194XEXT_LIBS = @XEXT_LIBS@
195XMKMF = @XMKMF@
196X_CFLAGS = @X_CFLAGS@
197X_EXTRA_LIBS = @X_EXTRA_LIBS@
198X_LIBS = @X_LIBS@
199X_PRE_LIBS = @X_PRE_LIBS@
200abs_builddir = @abs_builddir@
201abs_srcdir = @abs_srcdir@
202abs_top_builddir = @abs_top_builddir@
203abs_top_srcdir = @abs_top_srcdir@
204ac_ct_CC = @ac_ct_CC@
205ac_ct_CXX = @ac_ct_CXX@
206ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
207ac_ct_OBJC = @ac_ct_OBJC@
208altivec_cflags = @altivec_cflags@
209am__include = @am__include@
210am__leading_dot = @am__leading_dot@
211am__quote = @am__quote@
212am__tar = @am__tar@
213am__untar = @am__untar@
214bindir = @bindir@
215build = @build@
216build_alias = @build_alias@
217build_cpu = @build_cpu@
218build_os = @build_os@
219build_vendor = @build_vendor@
220builddir = @builddir@
221datadir = @datadir@
222datarootdir = @datarootdir@
223dlopen_libs = @dlopen_libs@
224docdir = @docdir@
225dvidir = @dvidir@
226edje_cc = @edje_cc@
227efl_doxygen = @efl_doxygen@
228efl_have_doxygen = @efl_have_doxygen@
229evas_engine_buffer_cflags = @evas_engine_buffer_cflags@
230evas_engine_buffer_libs = @evas_engine_buffer_libs@
231evas_engine_direct3d_cflags = @evas_engine_direct3d_cflags@
232evas_engine_direct3d_libs = @evas_engine_direct3d_libs@
233evas_engine_directfb_cflags = @evas_engine_directfb_cflags@
234evas_engine_directfb_libs = @evas_engine_directfb_libs@
235evas_engine_fb_cflags = @evas_engine_fb_cflags@
236evas_engine_fb_libs = @evas_engine_fb_libs@
237evas_engine_gl_cocoa_cflags = @evas_engine_gl_cocoa_cflags@
238evas_engine_gl_cocoa_libs = @evas_engine_gl_cocoa_libs@
239evas_engine_gl_common_libs = @evas_engine_gl_common_libs@
240evas_engine_gl_sdl_cflags = @evas_engine_gl_sdl_cflags@
241evas_engine_gl_sdl_libs = @evas_engine_gl_sdl_libs@
242evas_engine_gl_xcb_cflags = @evas_engine_gl_xcb_cflags@
243evas_engine_gl_xcb_libs = @evas_engine_gl_xcb_libs@
244evas_engine_gl_xlib_cflags = @evas_engine_gl_xlib_cflags@
245evas_engine_gl_xlib_libs = @evas_engine_gl_xlib_libs@
246evas_engine_psl1ght_cflags = @evas_engine_psl1ght_cflags@
247evas_engine_psl1ght_libs = @evas_engine_psl1ght_libs@
248evas_engine_software_16_ddraw_cflags = @evas_engine_software_16_ddraw_cflags@
249evas_engine_software_16_ddraw_libs = @evas_engine_software_16_ddraw_libs@
250evas_engine_software_16_sdl_cflags = @evas_engine_software_16_sdl_cflags@
251evas_engine_software_16_sdl_libs = @evas_engine_software_16_sdl_libs@
252evas_engine_software_16_wince_cflags = @evas_engine_software_16_wince_cflags@
253evas_engine_software_16_wince_libs = @evas_engine_software_16_wince_libs@
254evas_engine_software_16_x11_cflags = @evas_engine_software_16_x11_cflags@
255evas_engine_software_16_x11_libs = @evas_engine_software_16_x11_libs@
256evas_engine_software_8_x11_cflags = @evas_engine_software_8_x11_cflags@
257evas_engine_software_8_x11_libs = @evas_engine_software_8_x11_libs@
258evas_engine_software_ddraw_cflags = @evas_engine_software_ddraw_cflags@
259evas_engine_software_ddraw_libs = @evas_engine_software_ddraw_libs@
260evas_engine_software_gdi_cflags = @evas_engine_software_gdi_cflags@
261evas_engine_software_gdi_libs = @evas_engine_software_gdi_libs@
262evas_engine_software_sdl_cflags = @evas_engine_software_sdl_cflags@
263evas_engine_software_sdl_libs = @evas_engine_software_sdl_libs@
264evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@
265evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@
266evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@
267evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@
268evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@
269evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@
270evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@
271evas_image_loader_edb_libs = @evas_image_loader_edb_libs@
272evas_image_loader_eet_cflags = @evas_image_loader_eet_cflags@
273evas_image_loader_eet_libs = @evas_image_loader_eet_libs@
274evas_image_loader_generic_cflags = @evas_image_loader_generic_cflags@
275evas_image_loader_generic_libs = @evas_image_loader_generic_libs@
276evas_image_loader_gif_cflags = @evas_image_loader_gif_cflags@
277evas_image_loader_gif_libs = @evas_image_loader_gif_libs@
278evas_image_loader_ico_cflags = @evas_image_loader_ico_cflags@
279evas_image_loader_ico_libs = @evas_image_loader_ico_libs@
280evas_image_loader_jpeg_cflags = @evas_image_loader_jpeg_cflags@
281evas_image_loader_jpeg_libs = @evas_image_loader_jpeg_libs@
282evas_image_loader_pmaps_cflags = @evas_image_loader_pmaps_cflags@
283evas_image_loader_pmaps_libs = @evas_image_loader_pmaps_libs@
284evas_image_loader_png_cflags = @evas_image_loader_png_cflags@
285evas_image_loader_png_libs = @evas_image_loader_png_libs@
286evas_image_loader_psd_cflags = @evas_image_loader_psd_cflags@
287evas_image_loader_psd_libs = @evas_image_loader_psd_libs@
288evas_image_loader_svg_cflags = @evas_image_loader_svg_cflags@
289evas_image_loader_svg_libs = @evas_image_loader_svg_libs@
290evas_image_loader_tga_cflags = @evas_image_loader_tga_cflags@
291evas_image_loader_tga_libs = @evas_image_loader_tga_libs@
292evas_image_loader_tiff_cflags = @evas_image_loader_tiff_cflags@
293evas_image_loader_tiff_libs = @evas_image_loader_tiff_libs@
294evas_image_loader_wbmp_cflags = @evas_image_loader_wbmp_cflags@
295evas_image_loader_wbmp_libs = @evas_image_loader_wbmp_libs@
296evas_image_loader_xpm_cflags = @evas_image_loader_xpm_cflags@
297evas_image_loader_xpm_libs = @evas_image_loader_xpm_libs@
298exec_prefix = @exec_prefix@
299have_evas_engine_gl_x11 = @have_evas_engine_gl_x11@
300have_evas_engine_gl_xcb = @have_evas_engine_gl_xcb@
301have_evas_engine_gl_xlib = @have_evas_engine_gl_xlib@
302have_evas_engine_software_x11 = @have_evas_engine_software_x11@
303have_evas_engine_software_xcb = @have_evas_engine_software_xcb@
304have_evas_engine_software_xlib = @have_evas_engine_software_xlib@
305have_lcov = @have_lcov@
306host = @host@
307host_alias = @host_alias@
308host_cpu = @host_cpu@
309host_os = @host_os@
310host_vendor = @host_vendor@
311htmldir = @htmldir@
312includedir = @includedir@
313infodir = @infodir@
314install_sh = @install_sh@
315libdir = @libdir@
316libexecdir = @libexecdir@
317localedir = @localedir@
318localstatedir = @localstatedir@
319lt_ECHO = @lt_ECHO@
320lt_enable_auto_import = @lt_enable_auto_import@
321mandir = @mandir@
322mkdir_p = @mkdir_p@
323oldincludedir = @oldincludedir@
324pdfdir = @pdfdir@
325pkgconfig_requires_private = @pkgconfig_requires_private@
326prefix = @prefix@
327program_transform_name = @program_transform_name@
328psdir = @psdir@
329pthread_cflags = @pthread_cflags@
330pthread_libs = @pthread_libs@
331release_info = @release_info@
332requirement_evas = @requirement_evas@
333sbindir = @sbindir@
334sharedstatedir = @sharedstatedir@
335srcdir = @srcdir@
336sysconfdir = @sysconfdir@
337target_alias = @target_alias@
338top_build_prefix = @top_build_prefix@
339top_builddir = @top_builddir@
340top_srcdir = @top_srcdir@
341version_info = @version_info@
342MAINTAINERCLEANFILES = Makefile.in
343EXTRA_DIST = \
344op_add_color_.c \
345op_add_color_i386.c \
346op_add_mask_color_.c \
347op_add_mask_color_i386.c \
348op_add_pixel_.c \
349op_add_pixel_color_.c \
350op_add_pixel_color_i386.c \
351op_add_pixel_i386.c \
352op_add_pixel_mask_.c \
353op_add_pixel_mask_i386.c
354
355all: all-am
356
357.SUFFIXES:
358$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
359 @for dep in $?; do \
360 case '$(am__configure_deps)' in \
361 *$$dep*) \
362 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
363 && { if test -f $@; then exit 0; else break; fi; }; \
364 exit 1;; \
365 esac; \
366 done; \
367 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/engines/common/evas_op_add/Makefile'; \
368 $(am__cd) $(top_srcdir) && \
369 $(AUTOMAKE) --gnu src/lib/engines/common/evas_op_add/Makefile
370.PRECIOUS: Makefile
371Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
372 @case '$?' in \
373 *config.status*) \
374 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
375 *) \
376 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
377 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
378 esac;
379
380$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
381 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
382
383$(top_srcdir)/configure: $(am__configure_deps)
384 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
385$(ACLOCAL_M4): $(am__aclocal_m4_deps)
386 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
387$(am__aclocal_m4_deps):
388
389mostlyclean-libtool:
390 -rm -f *.lo
391
392clean-libtool:
393 -rm -rf .libs _libs
394tags: TAGS
395TAGS:
396
397ctags: CTAGS
398CTAGS:
399
400
401distdir: $(DISTFILES)
402 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
403 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
404 list='$(DISTFILES)'; \
405 dist_files=`for file in $$list; do echo $$file; done | \
406 sed -e "s|^$$srcdirstrip/||;t" \
407 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
408 case $$dist_files in \
409 */*) $(MKDIR_P) `echo "$$dist_files" | \
410 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
411 sort -u` ;; \
412 esac; \
413 for file in $$dist_files; do \
414 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
415 if test -d $$d/$$file; then \
416 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
417 if test -d "$(distdir)/$$file"; then \
418 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
419 fi; \
420 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
421 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
422 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
423 fi; \
424 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
425 else \
426 test -f "$(distdir)/$$file" \
427 || cp -p $$d/$$file "$(distdir)/$$file" \
428 || exit 1; \
429 fi; \
430 done
431check-am: all-am
432check: check-am
433all-am: Makefile
434installdirs:
435install: install-am
436install-exec: install-exec-am
437install-data: install-data-am
438uninstall: uninstall-am
439
440install-am: all-am
441 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
442
443installcheck: installcheck-am
444install-strip:
445 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
446 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
447 `test -z '$(STRIP)' || \
448 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
449mostlyclean-generic:
450
451clean-generic:
452
453distclean-generic:
454 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
455 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
456
457maintainer-clean-generic:
458 @echo "This command is intended for maintainers to use"
459 @echo "it deletes files that may require special tools to rebuild."
460 -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
461clean: clean-am
462
463clean-am: clean-generic clean-libtool mostlyclean-am
464
465distclean: distclean-am
466 -rm -f Makefile
467distclean-am: clean-am distclean-generic
468
469dvi: dvi-am
470
471dvi-am:
472
473html: html-am
474
475html-am:
476
477info: info-am
478
479info-am:
480
481install-data-am:
482
483install-dvi: install-dvi-am
484
485install-dvi-am:
486
487install-exec-am:
488
489install-html: install-html-am
490
491install-html-am:
492
493install-info: install-info-am
494
495install-info-am:
496
497install-man:
498
499install-pdf: install-pdf-am
500
501install-pdf-am:
502
503install-ps: install-ps-am
504
505install-ps-am:
506
507installcheck-am:
508
509maintainer-clean: maintainer-clean-am
510 -rm -f Makefile
511maintainer-clean-am: distclean-am maintainer-clean-generic
512
513mostlyclean: mostlyclean-am
514
515mostlyclean-am: mostlyclean-generic mostlyclean-libtool
516
517pdf: pdf-am
518
519pdf-am:
520
521ps: ps-am
522
523ps-am:
524
525uninstall-am:
526
527.MAKE: install-am install-strip
528
529.PHONY: all all-am check check-am clean clean-generic clean-libtool \
530 distclean distclean-generic distclean-libtool distdir dvi \
531 dvi-am html html-am info info-am install install-am \
532 install-data install-data-am install-dvi install-dvi-am \
533 install-exec install-exec-am install-html install-html-am \
534 install-info install-info-am install-man install-pdf \
535 install-pdf-am install-ps install-ps-am install-strip \
536 installcheck installcheck-am installdirs maintainer-clean \
537 maintainer-clean-generic mostlyclean mostlyclean-generic \
538 mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am
539
540
541# Tell versions [3.59,3.63) of GNU make to not export all variables.
542# Otherwise a system limit (for SysV at least) may be exceeded.
543.NOEXPORT:
diff --git a/libraries/evas/src/lib/engines/common/evas_op_add/op_add_color_.c b/libraries/evas/src/lib/engines/common/evas_op_add/op_add_color_.c
new file mode 100644
index 0000000..ace781b
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_add/op_add_color_.c
@@ -0,0 +1,33 @@
1/* add color -> dst */
2
3#ifdef BUILD_C
4static void
5init_add_color_span_funcs_c(void)
6{
7}
8#endif
9
10#ifdef BUILD_C
11static void
12init_add_color_pt_funcs_c(void)
13{
14}
15#endif
16
17/*-----*/
18
19/* add_rel color -> dst */
20
21#ifdef BUILD_C
22static void
23init_add_rel_color_span_funcs_c(void)
24{
25}
26#endif
27
28#ifdef BUILD_C
29static void
30init_add_rel_color_pt_funcs_c(void)
31{
32}
33#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_add/op_add_color_i386.c b/libraries/evas/src/lib/engines/common/evas_op_add/op_add_color_i386.c
new file mode 100644
index 0000000..f4f83a4
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_add/op_add_color_i386.c
@@ -0,0 +1,33 @@
1/* add color -> dst */
2
3#ifdef BUILD_MMX
4static void
5init_add_color_span_funcs_mmx(void)
6{
7}
8#endif
9
10#ifdef BUILD_MMX
11static void
12init_add_color_pt_funcs_mmx(void)
13{
14}
15#endif
16
17/*-----*/
18
19/* add_rel color -> dst */
20
21#ifdef BUILD_MMX
22static void
23init_add_rel_color_span_funcs_mmx(void)
24{
25}
26#endif
27
28#ifdef BUILD_MMX
29static void
30init_add_rel_color_pt_funcs_mmx(void)
31{
32}
33#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_add/op_add_mask_color_.c b/libraries/evas/src/lib/engines/common/evas_op_add/op_add_mask_color_.c
new file mode 100644
index 0000000..b20053c
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_add/op_add_mask_color_.c
@@ -0,0 +1,33 @@
1/* add mask x color -> dst */
2
3#ifdef BUILD_C
4static void
5init_add_mask_color_span_funcs_c(void)
6{
7}
8#endif
9
10#ifdef BUILD_C
11static void
12init_add_mask_color_pt_funcs_c(void)
13{
14}
15#endif
16
17/*-----*/
18
19/* add_rel mask x color -> dst */
20
21#ifdef BUILD_C
22static void
23init_add_rel_mask_color_span_funcs_c(void)
24{
25}
26#endif
27
28#ifdef BUILD_C
29static void
30init_add_rel_mask_color_pt_funcs_c(void)
31{
32}
33#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_add/op_add_mask_color_i386.c b/libraries/evas/src/lib/engines/common/evas_op_add/op_add_mask_color_i386.c
new file mode 100644
index 0000000..6a86f86
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_add/op_add_mask_color_i386.c
@@ -0,0 +1,33 @@
1/* add mask x color -> dst */
2
3#ifdef BUILD_MMX
4static void
5init_add_mask_color_span_funcs_mmx(void)
6{
7}
8#endif
9
10#ifdef BUILD_MMX
11static void
12init_add_mask_color_pt_funcs_mmx(void)
13{
14}
15#endif
16
17/*-----*/
18
19/* add_rel mask x color -> dst */
20
21#ifdef BUILD_MMX
22static void
23init_add_rel_mask_color_span_funcs_mmx(void)
24{
25}
26#endif
27
28#ifdef BUILD_MMX
29static void
30init_add_rel_mask_color_pt_funcs_mmx(void)
31{
32}
33#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_add/op_add_pixel_.c b/libraries/evas/src/lib/engines/common/evas_op_add/op_add_pixel_.c
new file mode 100644
index 0000000..4fe5a76
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_add/op_add_pixel_.c
@@ -0,0 +1,33 @@
1/* add pixel --> dst */
2
3#ifdef BUILD_C
4static void
5init_add_pixel_span_funcs_c(void)
6{
7}
8#endif
9
10#ifdef BUILD_C
11static void
12init_add_pixel_pt_funcs_c(void)
13{
14}
15#endif
16
17/*-----*/
18
19/* add_rel pixel --> dst */
20
21#ifdef BUILD_C
22static void
23init_add_rel_pixel_span_funcs_c(void)
24{
25}
26#endif
27
28#ifdef BUILD_C
29static void
30init_add_rel_pixel_pt_funcs_c(void)
31{
32}
33#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_add/op_add_pixel_color_.c b/libraries/evas/src/lib/engines/common/evas_op_add/op_add_pixel_color_.c
new file mode 100644
index 0000000..aa0dba1
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_add/op_add_pixel_color_.c
@@ -0,0 +1,33 @@
1/* add pixel x color --> dst */
2
3#ifdef BUILD_C
4static void
5init_add_pixel_color_span_funcs_c(void)
6{
7}
8#endif
9
10#ifdef BUILD_C
11static void
12init_add_pixel_color_pt_funcs_c(void)
13{
14}
15#endif
16
17/*-----*/
18
19/* add_rel pixel x color --> dst */
20
21#ifdef BUILD_C
22static void
23init_add_rel_pixel_color_span_funcs_c(void)
24{
25}
26#endif
27
28#ifdef BUILD_C
29static void
30init_add_rel_pixel_color_pt_funcs_c(void)
31{
32}
33#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_add/op_add_pixel_color_i386.c b/libraries/evas/src/lib/engines/common/evas_op_add/op_add_pixel_color_i386.c
new file mode 100644
index 0000000..fa382d9
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_add/op_add_pixel_color_i386.c
@@ -0,0 +1,29 @@
1/* add pixel x color --> dst */
2
3#ifdef BUILD_MMX
4static void
5init_add_pixel_color_span_funcs_mmx(void)
6{ }
7#endif
8
9#ifdef BUILD_MMX
10static void
11init_add_pixel_color_pt_funcs_mmx(void)
12{ }
13#endif
14
15/*-----*/
16
17/* add_rel pixel x color --> dst */
18
19#ifdef BUILD_MMX
20static void
21init_add_rel_pixel_color_span_funcs_mmx(void)
22{ }
23#endif
24
25#ifdef BUILD_MMX
26static void
27init_add_rel_pixel_color_pt_funcs_mmx(void)
28{ }
29#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_add/op_add_pixel_i386.c b/libraries/evas/src/lib/engines/common/evas_op_add/op_add_pixel_i386.c
new file mode 100644
index 0000000..eb2b5a3
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_add/op_add_pixel_i386.c
@@ -0,0 +1,33 @@
1/* add pixel --> dst */
2
3#ifdef BUILD_MMX
4static void
5init_add_pixel_span_funcs_mmx(void)
6{
7}
8#endif
9
10#ifdef BUILD_MMX
11static void
12init_add_pixel_pt_funcs_mmx(void)
13{
14}
15#endif
16
17/*-----*/
18
19/* add_rel pixel --> dst */
20
21#ifdef BUILD_MMX
22static void
23init_add_rel_pixel_span_funcs_mmx(void)
24{
25}
26#endif
27
28#ifdef BUILD_MMX
29static void
30init_add_rel_pixel_pt_funcs_mmx(void)
31{
32}
33#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_add/op_add_pixel_mask_.c b/libraries/evas/src/lib/engines/common/evas_op_add/op_add_pixel_mask_.c
new file mode 100644
index 0000000..8414bce
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_add/op_add_pixel_mask_.c
@@ -0,0 +1,37 @@
1/* add pixel x mask --> dst */
2
3#ifdef BUILD_C
4/* XXX: not used
5static void
6init_add_pixel_mask_span_funcs_c(void)
7{
8}
9*/
10#endif
11
12#ifdef BUILD_C
13/* XXX: not used
14static void
15init_add_pixel_mask_pt_funcs_c(void)
16{
17}
18*/
19#endif
20
21/*-----*/
22
23/* add_rel pixel x mask --> dst */
24
25#ifdef BUILD_C
26static void
27init_add_rel_pixel_mask_span_funcs_c(void)
28{
29}
30#endif
31
32#ifdef BUILD_C
33static void
34init_add_rel_pixel_mask_pt_funcs_c(void)
35{
36}
37#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_add/op_add_pixel_mask_i386.c b/libraries/evas/src/lib/engines/common/evas_op_add/op_add_pixel_mask_i386.c
new file mode 100644
index 0000000..a6309c3
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_add/op_add_pixel_mask_i386.c
@@ -0,0 +1,33 @@
1/* add pixel x mask -> dst */
2
3#ifdef BUILD_MMX
4static void
5init_add_pixel_mask_span_funcs_mmx(void)
6{
7}
8#endif
9
10#ifdef BUILD_MMX
11static void
12init_add_pixel_mask_pt_funcs_mmx(void)
13{
14}
15#endif
16
17/*-----*/
18
19/* add_rel pixel x mask -> dst */
20
21#ifdef BUILD_MMX
22static void
23init_add_rel_pixel_mask_span_funcs_mmx(void)
24{
25}
26#endif
27
28#ifdef BUILD_MMX
29static void
30init_add_rel_pixel_mask_pt_funcs_mmx(void)
31{
32}
33#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_add_main_.c b/libraries/evas/src/lib/engines/common/evas_op_add_main_.c
new file mode 100644
index 0000000..ef8b728
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_add_main_.c
@@ -0,0 +1,541 @@
1#include "evas_common.h"
2static RGBA_Gfx_Func op_add_span_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
3static RGBA_Gfx_Pt_Func op_add_pt_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
4
5static void op_add_init(void);
6static void op_add_shutdown(void);
7
8static RGBA_Gfx_Func op_add_pixel_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels);
9static RGBA_Gfx_Func op_add_color_span_get(DATA32 col, RGBA_Image *dst, int pixels);
10static RGBA_Gfx_Func op_add_pixel_color_span_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels);
11static RGBA_Gfx_Func op_add_mask_color_span_get(DATA32 col, RGBA_Image *dst, int pixels);
12static RGBA_Gfx_Func op_add_pixel_mask_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels);
13
14static RGBA_Gfx_Pt_Func op_add_pixel_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst);
15static RGBA_Gfx_Pt_Func op_add_color_pt_get(DATA32 col, RGBA_Image *dst);
16static RGBA_Gfx_Pt_Func op_add_pixel_color_pt_get(Image_Entry_Flags src_flags, DATA32 col, RGBA_Image *dst);
17static RGBA_Gfx_Pt_Func op_add_mask_color_pt_get(DATA32 col, RGBA_Image *dst);
18static RGBA_Gfx_Pt_Func op_add_pixel_mask_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst);
19
20static RGBA_Gfx_Compositor _composite_add = { "add",
21 op_add_init, op_add_shutdown,
22 op_add_pixel_span_get, op_add_color_span_get,
23 op_add_pixel_color_span_get, op_add_mask_color_span_get,
24 op_add_pixel_mask_span_get,
25 op_add_pixel_pt_get, op_add_color_pt_get,
26 op_add_pixel_color_pt_get, op_add_mask_color_pt_get,
27 op_add_pixel_mask_pt_get
28 };
29
30RGBA_Gfx_Compositor *
31evas_common_gfx_compositor_add_get(void)
32{
33 return &(_composite_add);
34}
35
36static RGBA_Gfx_Func op_add_rel_span_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
37static RGBA_Gfx_Pt_Func op_add_rel_pt_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
38
39static void op_add_rel_init(void);
40static void op_add_rel_shutdown(void);
41
42static RGBA_Gfx_Func op_add_rel_pixel_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels);
43static RGBA_Gfx_Func op_add_rel_color_span_get(DATA32 col, RGBA_Image *dst, int pixels);
44static RGBA_Gfx_Func op_add_rel_pixel_color_span_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels);
45static RGBA_Gfx_Func op_add_rel_mask_color_span_get(DATA32 col, RGBA_Image *dst, int pixels);
46static RGBA_Gfx_Func op_add_rel_pixel_mask_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels);
47
48static RGBA_Gfx_Pt_Func op_add_rel_pixel_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst);
49static RGBA_Gfx_Pt_Func op_add_rel_color_pt_get(DATA32 col, RGBA_Image *dst);
50static RGBA_Gfx_Pt_Func op_add_rel_pixel_color_pt_get(Image_Entry_Flags src_flags, DATA32 col, RGBA_Image *dst);
51static RGBA_Gfx_Pt_Func op_add_rel_mask_color_pt_get(DATA32 col, RGBA_Image *dst);
52static RGBA_Gfx_Pt_Func op_add_rel_pixel_mask_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst);
53
54static RGBA_Gfx_Compositor _composite_add_rel = { "add_rel",
55 op_add_rel_init, op_add_rel_shutdown,
56 op_add_rel_pixel_span_get, op_add_rel_color_span_get,
57 op_add_rel_pixel_color_span_get, op_add_rel_mask_color_span_get,
58 op_add_rel_pixel_mask_span_get,
59 op_add_rel_pixel_pt_get, op_add_rel_color_pt_get,
60 op_add_rel_pixel_color_pt_get, op_add_rel_mask_color_pt_get,
61 op_add_rel_pixel_mask_pt_get
62 };
63
64RGBA_Gfx_Compositor *
65evas_common_gfx_compositor_add_rel_get(void)
66{
67 return &(_composite_add_rel);
68}
69
70
71# include "./evas_op_add/op_add_pixel_.c"
72# include "./evas_op_add/op_add_color_.c"
73# include "./evas_op_add/op_add_pixel_color_.c"
74# include "./evas_op_add/op_add_pixel_mask_.c"
75# include "./evas_op_add/op_add_mask_color_.c"
76//# include "./evas_op_add/op_add_pixel_mask_color_.c"
77
78# include "./evas_op_add/op_add_pixel_i386.c"
79# include "./evas_op_add/op_add_color_i386.c"
80# include "./evas_op_add/op_add_pixel_color_i386.c"
81# include "./evas_op_add/op_add_pixel_mask_i386.c"
82# include "./evas_op_add/op_add_mask_color_i386.c"
83//# include "op_add_pixel_mask_color_.c"
84
85static void
86op_add_init(void)
87{
88 memset(op_add_span_funcs, 0, sizeof(op_add_span_funcs));
89 memset(op_add_pt_funcs, 0, sizeof(op_add_pt_funcs));
90#ifdef BUILD_MMX
91 init_add_pixel_span_funcs_mmx();
92 init_add_pixel_color_span_funcs_mmx();
93 init_add_pixel_mask_span_funcs_mmx();
94 init_add_color_span_funcs_mmx();
95 init_add_mask_color_span_funcs_mmx();
96
97 init_add_pixel_pt_funcs_mmx();
98 init_add_pixel_color_pt_funcs_mmx();
99 init_add_pixel_mask_pt_funcs_mmx();
100 init_add_color_pt_funcs_mmx();
101 init_add_mask_color_pt_funcs_mmx();
102#endif
103#ifdef BUILD_C
104 init_add_pixel_span_funcs_c();
105 init_add_pixel_color_span_funcs_c();
106 init_add_rel_pixel_mask_span_funcs_c();
107 init_add_color_span_funcs_c();
108 init_add_mask_color_span_funcs_c();
109
110 init_add_pixel_pt_funcs_c();
111 init_add_pixel_color_pt_funcs_c();
112 init_add_rel_pixel_mask_pt_funcs_c();
113 init_add_color_pt_funcs_c();
114 init_add_mask_color_pt_funcs_c();
115#endif
116}
117
118static void
119op_add_shutdown(void)
120{
121}
122
123static RGBA_Gfx_Func
124add_gfx_span_func_cpu(int s, int m, int c, int d)
125{
126 RGBA_Gfx_Func func = NULL;
127 int cpu = CPU_N;
128#ifdef BUILD_MMX
129 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
130 {
131 cpu = CPU_MMX;
132 func = op_add_span_funcs[s][m][c][d][cpu];
133 if (func) return func;
134 }
135#endif
136#ifdef BUILD_C
137 cpu = CPU_C;
138 func = op_add_span_funcs[s][m][c][d][cpu];
139 if (func) return func;
140#endif
141 return func;
142}
143
144static RGBA_Gfx_Func
145op_add_pixel_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels __UNUSED__)
146{
147 int s = SP_AN, m = SM_N, c = SC_N, d = DP_AN;
148
149 if (src && src->cache_entry.flags.alpha)
150 s = SP;
151 if (dst && dst->cache_entry.flags.alpha)
152 d = DP;
153 return add_gfx_span_func_cpu(s, m, c, d);
154}
155
156static RGBA_Gfx_Func
157op_add_color_span_get(DATA32 col, RGBA_Image *dst, int pixels __UNUSED__)
158{
159 int s = SP_N, m = SM_N, c = SC_AN, d = DP_AN;
160
161 if ((col >> 24) < 255)
162 c = SC;
163 if (col == (col | 0x00ffffff))
164 c = SC_AA;
165 if (col == 0xffffffff)
166 c = SC_N;
167 if (dst && dst->cache_entry.flags.alpha)
168 d = DP;
169 return add_gfx_span_func_cpu(s, m, c, d);
170}
171
172static RGBA_Gfx_Func
173op_add_pixel_color_span_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels __UNUSED__)
174{
175 int s = SP_AN, m = SM_N, c = SC_AN, d = DP_AN;
176
177 if (src && src->cache_entry.flags.alpha)
178 s = SP;
179 if ((col >> 24) < 255)
180 c = SC;
181 if (col == (col | 0x00ffffff))
182 c = SC_AA;
183 if (col == 0xffffffff)
184 c = SC_N;
185 if (dst && dst->cache_entry.flags.alpha)
186 d = DP;
187 return add_gfx_span_func_cpu(s, m, c, d);
188}
189
190static RGBA_Gfx_Func
191op_add_mask_color_span_get(DATA32 col, RGBA_Image *dst, int pixels __UNUSED__)
192{
193 int s = SP_N, m = SM_AS, c = SC_AN, d = DP_AN;
194
195 if ((col >> 24) < 255)
196 c = SC;
197 if (col == (col | 0x00ffffff))
198 c = SC_AA;
199 if (col == 0xffffffff)
200 c = SC_N;
201 if (dst && dst->cache_entry.flags.alpha)
202 d = DP;
203 return add_gfx_span_func_cpu(s, m, c, d);
204}
205
206static RGBA_Gfx_Func
207op_add_pixel_mask_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels __UNUSED__)
208{
209 int s = SP_AN, m = SM_AS, c = SC_N, d = DP_AN;
210
211 if (src && src->cache_entry.flags.alpha)
212 s = SP;
213 if (dst && dst->cache_entry.flags.alpha)
214 d = DP;
215 return add_gfx_span_func_cpu(s, m, c, d);
216}
217
218static RGBA_Gfx_Pt_Func
219add_gfx_pt_func_cpu(int s, int m, int c, int d)
220{
221 RGBA_Gfx_Pt_Func func = NULL;
222 int cpu = CPU_N;
223#ifdef BUILD_MMX
224 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
225 {
226 cpu = CPU_MMX;
227 func = op_add_pt_funcs[s][m][c][d][cpu];
228 if (func) return func;
229 }
230#endif
231#ifdef BUILD_C
232 cpu = CPU_C;
233 func = op_add_pt_funcs[s][m][c][d][cpu];
234 if (func) return func;
235#endif
236 return func;
237}
238
239static RGBA_Gfx_Pt_Func
240op_add_pixel_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst)
241{
242 int s = SP_AN, m = SM_N, c = SC_N, d = DP_AN;
243
244 if (src_flags.alpha)
245 s = SP;
246 if (dst && dst->cache_entry.flags.alpha)
247 d = DP;
248 return add_gfx_pt_func_cpu(s, m, c, d);
249}
250
251static RGBA_Gfx_Pt_Func
252op_add_color_pt_get(DATA32 col, RGBA_Image *dst)
253{
254 int s = SP_N, m = SM_N, c = SC_AN, d = DP_AN;
255
256 if ((col >> 24) < 255)
257 c = SC;
258 if (col == (col | 0x00ffffff))
259 c = SC_AA;
260 if (col == 0xffffffff)
261 c = SC_N;
262 if (dst && dst->cache_entry.flags.alpha)
263 d = DP;
264 return add_gfx_pt_func_cpu(s, m, c, d);
265}
266
267static RGBA_Gfx_Pt_Func
268op_add_pixel_color_pt_get(Image_Entry_Flags src_flags, DATA32 col, RGBA_Image *dst)
269{
270 int s = SP_AN, m = SM_N, c = SC_AN, d = DP_AN;
271
272 if (src_flags.alpha)
273 s = SP;
274 if ((col >> 24) < 255)
275 c = SC;
276 if (col == (col | 0x00ffffff))
277 c = SC_AA;
278 if (col == 0xffffffff)
279 c = SC_N;
280 if (dst && dst->cache_entry.flags.alpha)
281 d = DP;
282 return add_gfx_pt_func_cpu(s, m, c, d);
283}
284
285static RGBA_Gfx_Pt_Func
286op_add_mask_color_pt_get(DATA32 col, RGBA_Image *dst)
287{
288 int s = SP_N, m = SM_AS, c = SC_AN, d = DP_AN;
289
290 if ((col >> 24) < 255)
291 c = SC;
292 if (col == (col | 0x00ffffff))
293 c = SC_AA;
294 if (col == 0xffffffff)
295 c = SC_N;
296 if (dst && dst->cache_entry.flags.alpha)
297 d = DP;
298 return add_gfx_pt_func_cpu(s, m, c, d);
299}
300
301static RGBA_Gfx_Pt_Func
302op_add_pixel_mask_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst)
303{
304 int s = SP_AN, m = SM_AS, c = SC_N, d = DP_AN;
305
306 if (src_flags.alpha)
307 s = SP;
308 if (dst && dst->cache_entry.flags.alpha)
309 d = DP;
310 return add_gfx_pt_func_cpu(s, m, c, d);
311}
312
313
314
315static void
316op_add_rel_init(void)
317{
318 memset(op_add_rel_span_funcs, 0, sizeof(op_add_rel_span_funcs));
319 memset(op_add_rel_pt_funcs, 0, sizeof(op_add_rel_pt_funcs));
320#ifdef BUILD_MMX
321 init_add_rel_pixel_span_funcs_mmx();
322 init_add_rel_pixel_color_span_funcs_mmx();
323 init_add_rel_pixel_mask_span_funcs_mmx();
324 init_add_rel_color_span_funcs_mmx();
325 init_add_rel_mask_color_span_funcs_mmx();
326
327 init_add_rel_pixel_pt_funcs_mmx();
328 init_add_rel_pixel_color_pt_funcs_mmx();
329 init_add_rel_pixel_mask_pt_funcs_mmx();
330 init_add_rel_color_pt_funcs_mmx();
331 init_add_rel_mask_color_pt_funcs_mmx();
332#endif
333#ifdef BUILD_C
334 init_add_rel_pixel_span_funcs_c();
335 init_add_rel_pixel_color_span_funcs_c();
336 init_add_rel_pixel_mask_span_funcs_c();
337 init_add_rel_color_span_funcs_c();
338 init_add_rel_mask_color_span_funcs_c();
339
340 init_add_rel_pixel_pt_funcs_c();
341 init_add_rel_pixel_color_pt_funcs_c();
342 init_add_rel_pixel_mask_pt_funcs_c();
343 init_add_rel_color_pt_funcs_c();
344 init_add_rel_mask_color_pt_funcs_c();
345#endif
346}
347
348static void
349op_add_rel_shutdown(void)
350{
351}
352
353static RGBA_Gfx_Func
354add_rel_gfx_span_func_cpu(int s, int m, int c, int d)
355{
356 RGBA_Gfx_Func func = NULL;
357 int cpu = CPU_N;
358#ifdef BUILD_MMX
359 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
360 {
361 cpu = CPU_MMX;
362 func = op_add_rel_span_funcs[s][m][c][d][cpu];
363 if (func) return func;
364 }
365#endif
366#ifdef BUILD_C
367 cpu = CPU_C;
368 func = op_add_rel_span_funcs[s][m][c][d][cpu];
369 if (func) return func;
370#endif
371 return func;
372}
373
374static RGBA_Gfx_Func
375op_add_rel_pixel_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels __UNUSED__)
376{
377 int s = SP_AN, m = SM_N, c = SC_N, d = DP_AN;
378
379 if (src && src->cache_entry.flags.alpha)
380 s = SP;
381 if (dst && dst->cache_entry.flags.alpha)
382 d = DP;
383 return add_rel_gfx_span_func_cpu(s, m, c, d);
384}
385
386static RGBA_Gfx_Func
387op_add_rel_color_span_get(DATA32 col, RGBA_Image *dst, int pixels __UNUSED__)
388{
389 int s = SP_N, m = SM_N, c = SC_AN, d = DP_AN;
390
391 if ((col >> 24) < 255)
392 c = SC;
393 if (col == (col | 0x00ffffff))
394 c = SC_AA;
395 if (col == 0xffffffff)
396 c = SC_N;
397 if (dst && dst->cache_entry.flags.alpha)
398 d = DP;
399 return add_rel_gfx_span_func_cpu(s, m, c, d);
400}
401
402static RGBA_Gfx_Func
403op_add_rel_pixel_color_span_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels __UNUSED__)
404{
405 int s = SP_AN, m = SM_N, c = SC_AN, d = DP_AN;
406
407 if (src && src->cache_entry.flags.alpha)
408 s = SP;
409 if ((col >> 24) < 255)
410 c = SC;
411 if (col == (col | 0x00ffffff))
412 c = SC_AA;
413 if (col == 0xffffffff)
414 c = SC_N;
415 if (dst && dst->cache_entry.flags.alpha)
416 d = DP;
417 return add_rel_gfx_span_func_cpu(s, m, c, d);
418}
419
420static RGBA_Gfx_Func
421op_add_rel_mask_color_span_get(DATA32 col, RGBA_Image *dst, int pixels __UNUSED__)
422{
423 int s = SP_N, m = SM_AS, c = SC_AN, d = DP_AN;
424
425 if ((col >> 24) < 255)
426 c = SC;
427 if (col == (col | 0x00ffffff))
428 c = SC_AA;
429 if (col == 0xffffffff)
430 c = SC_N;
431 if (dst && dst->cache_entry.flags.alpha)
432 d = DP;
433 return add_rel_gfx_span_func_cpu(s, m, c, d);
434}
435
436static RGBA_Gfx_Func
437op_add_rel_pixel_mask_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels __UNUSED__)
438{
439 int s = SP_AN, m = SM_AS, c = SC_N, d = DP_AN;
440
441 if (src && src->cache_entry.flags.alpha)
442 s = SP;
443 if (dst && dst->cache_entry.flags.alpha)
444 d = DP;
445 return add_rel_gfx_span_func_cpu(s, m, c, d);
446}
447
448static RGBA_Gfx_Pt_Func
449add_rel_gfx_pt_func_cpu(int s, int m, int c, int d)
450{
451 RGBA_Gfx_Pt_Func func = NULL;
452 int cpu = CPU_N;
453#ifdef BUILD_MMX
454 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
455 {
456 cpu = CPU_MMX;
457 func = op_add_rel_pt_funcs[s][m][c][d][cpu];
458 if (func) return func;
459 }
460#endif
461#ifdef BUILD_C
462 cpu = CPU_C;
463 func = op_add_rel_pt_funcs[s][m][c][d][cpu];
464 if (func) return func;
465#endif
466 return func;
467}
468
469static RGBA_Gfx_Pt_Func
470op_add_rel_pixel_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst)
471{
472 int s = SP_AN, m = SM_N, c = SC_N, d = DP_AN;
473
474 if (src_flags.alpha)
475 s = SP;
476 if (dst && dst->cache_entry.flags.alpha)
477 d = DP;
478 return add_rel_gfx_pt_func_cpu(s, m, c, d);
479}
480
481static RGBA_Gfx_Pt_Func
482op_add_rel_color_pt_get(DATA32 col, RGBA_Image *dst)
483{
484 int s = SP_N, m = SM_N, c = SC_AN, d = DP_AN;
485
486 if ((col >> 24) < 255)
487 c = SC;
488 if (col == (col | 0x00ffffff))
489 c = SC_AA;
490 if (col == 0xffffffff)
491 c = SC_N;
492 if (dst && dst->cache_entry.flags.alpha)
493 d = DP;
494 return add_rel_gfx_pt_func_cpu(s, m, c, d);
495}
496
497static RGBA_Gfx_Pt_Func
498op_add_rel_pixel_color_pt_get(Image_Entry_Flags src_flags, DATA32 col, RGBA_Image *dst)
499{
500 int s = SP_AN, m = SM_N, c = SC_AN, d = DP_AN;
501
502 if (src_flags.alpha)
503 s = SP;
504 if ((col >> 24) < 255)
505 c = SC;
506 if (col == (col | 0x00ffffff))
507 c = SC_AA;
508 if (col == 0xffffffff)
509 c = SC_N;
510 if (dst && dst->cache_entry.flags.alpha)
511 d = DP;
512 return add_rel_gfx_pt_func_cpu(s, m, c, d);
513}
514
515static RGBA_Gfx_Pt_Func
516op_add_rel_mask_color_pt_get(DATA32 col, RGBA_Image *dst)
517{
518 int s = SP_N, m = SM_AS, c = SC_AN, d = DP_AN;
519
520 if ((col >> 24) < 255)
521 c = SC;
522 if (col == (col | 0x00ffffff))
523 c = SC_AA;
524 if (col == 0xffffffff)
525 c = SC_N;
526 if (dst && dst->cache_entry.flags.alpha)
527 d = DP;
528 return add_rel_gfx_pt_func_cpu(s, m, c, d);
529}
530
531static RGBA_Gfx_Pt_Func
532op_add_rel_pixel_mask_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst)
533{
534 int s = SP_AN, m = SM_AS, c = SC_N, d = DP_AN;
535
536 if (src_flags.alpha)
537 s = SP;
538 if (dst && dst->cache_entry.flags.alpha)
539 d = DP;
540 return add_rel_gfx_pt_func_cpu(s, m, c, d);
541}
diff --git a/libraries/evas/src/lib/engines/common/evas_op_blend/Makefile.am b/libraries/evas/src/lib/engines/common/evas_op_blend/Makefile.am
new file mode 100644
index 0000000..84add38
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_blend/Makefile.am
@@ -0,0 +1,50 @@
1MAINTAINERCLEANFILES = Makefile.in
2
3EXTRA_DIST = \
4op_blend_color_.c \
5op_blend_color_i386.c \
6op_blend_color_neon.c \
7op_blend_color_sse3.c \
8op_blend_mask_color_.c \
9op_blend_mask_color_i386.c \
10op_blend_mask_color_neon.c \
11op_blend_mask_color_sse3.c \
12op_blend_pixel_.c \
13op_blend_pixel_color_.c \
14op_blend_pixel_color_i386.c \
15op_blend_pixel_color_neon.c \
16op_blend_pixel_color_sse3.c \
17op_blend_pixel_i386.c \
18op_blend_pixel_mask_.c \
19op_blend_pixel_mask_i386.c \
20op_blend_pixel_mask_neon.c \
21op_blend_pixel_mask_sse3.c \
22op_blend_pixel_neon.c \
23op_blend_pixel_sse3.c
24
25noinst_LTLIBRARIES = libevas_engine_common_op_blend_master_sse3.la
26
27libevas_engine_common_op_blend_master_sse3_la_SOURCES = \
28op_blend_master_sse3.c
29
30libevas_engine_common_op_blend_master_sse3_la_CFLAGS = \
31-I. \
32-I$(top_srcdir)/src/lib \
33-I$(top_srcdir)/src/lib/engines/common \
34-I$(top_srcdir)/src/lib/engines/common/evas_op_blend \
35-I$(top_srcdir)/src/lib/cserve \
36-I$(top_srcdir)/src/lib/include \
37-DPACKAGE_BIN_DIR=\"$(bindir)\" \
38-DPACKAGE_LIB_DIR=\"$(libdir)\" \
39-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
40@FREETYPE_CFLAGS@ @VALGRIND_CFLAGS@ \
41@PIXMAN_CFLAGS@ \
42@EET_CFLAGS@ @pthread_cflags@ \
43@WIN32_CFLAGS@ @EINA_CFLAGS@ \
44@FRIBIDI_CFLAGS@ @HARFBUZZ_CFLAGS@ \
45@PIXMAN_CFLAGS@ \
46@EVAS_SSE3_CFLAGS@
47
48libevas_engine_common_op_blend_master_sse3_la_DEPENENCIES = \
49$(top_builddir)/config.h
50
diff --git a/libraries/evas/src/lib/engines/common/evas_op_blend/Makefile.in b/libraries/evas/src/lib/engines/common/evas_op_blend/Makefile.in
new file mode 100644
index 0000000..e796ef2
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_blend/Makefile.in
@@ -0,0 +1,720 @@
1# Makefile.in generated by automake 1.11.1 from Makefile.am.
2# @configure_input@
3
4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
6# Inc.
7# This Makefile.in is free software; the Free Software Foundation
8# gives unlimited permission to copy and/or distribute it,
9# with or without modifications, as long as this notice is preserved.
10
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
13# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14# PARTICULAR PURPOSE.
15
16@SET_MAKE@
17
18VPATH = @srcdir@
19pkgdatadir = $(datadir)/@PACKAGE@
20pkgincludedir = $(includedir)/@PACKAGE@
21pkglibdir = $(libdir)/@PACKAGE@
22pkglibexecdir = $(libexecdir)/@PACKAGE@
23am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
24install_sh_DATA = $(install_sh) -c -m 644
25install_sh_PROGRAM = $(install_sh) -c
26install_sh_SCRIPT = $(install_sh) -c
27INSTALL_HEADER = $(INSTALL_DATA)
28transform = $(program_transform_name)
29NORMAL_INSTALL = :
30PRE_INSTALL = :
31POST_INSTALL = :
32NORMAL_UNINSTALL = :
33PRE_UNINSTALL = :
34POST_UNINSTALL = :
35build_triplet = @build@
36host_triplet = @host@
37subdir = src/lib/engines/common/evas_op_blend
38DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
39ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
40am__aclocal_m4_deps = $(top_srcdir)/m4/efl_attribute.m4 \
41 $(top_srcdir)/m4/efl_coverage.m4 \
42 $(top_srcdir)/m4/efl_doxygen.m4 \
43 $(top_srcdir)/m4/efl_fnmatch.m4 \
44 $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \
45 $(top_srcdir)/m4/evas_check_engine.m4 \
46 $(top_srcdir)/m4/evas_check_loader.m4 \
47 $(top_srcdir)/m4/evas_converter.m4 \
48 $(top_srcdir)/m4/evas_dither.m4 \
49 $(top_srcdir)/m4/evas_scaler.m4 $(top_srcdir)/m4/libtool.m4 \
50 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
51 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
52 $(top_srcdir)/configure.ac
53am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
54 $(ACLOCAL_M4)
55mkinstalldirs = $(install_sh) -d
56CONFIG_HEADER = $(top_builddir)/config.h
57CONFIG_CLEAN_FILES =
58CONFIG_CLEAN_VPATH_FILES =
59LTLIBRARIES = $(noinst_LTLIBRARIES)
60libevas_engine_common_op_blend_master_sse3_la_LIBADD =
61am_libevas_engine_common_op_blend_master_sse3_la_OBJECTS = libevas_engine_common_op_blend_master_sse3_la-op_blend_master_sse3.lo
62libevas_engine_common_op_blend_master_sse3_la_OBJECTS = \
63 $(am_libevas_engine_common_op_blend_master_sse3_la_OBJECTS)
64AM_V_lt = $(am__v_lt_$(V))
65am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
66am__v_lt_0 = --silent
67libevas_engine_common_op_blend_master_sse3_la_LINK = $(LIBTOOL) \
68 $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
69 --mode=link $(CCLD) \
70 $(libevas_engine_common_op_blend_master_sse3_la_CFLAGS) \
71 $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
72DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
73depcomp = $(SHELL) $(top_srcdir)/depcomp
74am__depfiles_maybe = depfiles
75am__mv = mv -f
76COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
77 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
78LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
79 $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
80 $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
81 $(AM_CFLAGS) $(CFLAGS)
82AM_V_CC = $(am__v_CC_$(V))
83am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
84am__v_CC_0 = @echo " CC " $@;
85AM_V_at = $(am__v_at_$(V))
86am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
87am__v_at_0 = @
88CCLD = $(CC)
89LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
90 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
91 $(AM_LDFLAGS) $(LDFLAGS) -o $@
92AM_V_CCLD = $(am__v_CCLD_$(V))
93am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
94am__v_CCLD_0 = @echo " CCLD " $@;
95AM_V_GEN = $(am__v_GEN_$(V))
96am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
97am__v_GEN_0 = @echo " GEN " $@;
98SOURCES = $(libevas_engine_common_op_blend_master_sse3_la_SOURCES)
99DIST_SOURCES = \
100 $(libevas_engine_common_op_blend_master_sse3_la_SOURCES)
101ETAGS = etags
102CTAGS = ctags
103DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
104ACLOCAL = @ACLOCAL@
105ALLOCA = @ALLOCA@
106AMTAR = @AMTAR@
107AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
108AR = @AR@
109AS = @AS@
110AUTOCONF = @AUTOCONF@
111AUTOHEADER = @AUTOHEADER@
112AUTOMAKE = @AUTOMAKE@
113AWK = @AWK@
114CC = @CC@
115CCDEPMODE = @CCDEPMODE@
116CFLAGS = @CFLAGS@
117CHECK_CFLAGS = @CHECK_CFLAGS@
118CHECK_LIBS = @CHECK_LIBS@
119CPP = @CPP@
120CPPFLAGS = @CPPFLAGS@
121CXX = @CXX@
122CXXCPP = @CXXCPP@
123CXXDEPMODE = @CXXDEPMODE@
124CXXFLAGS = @CXXFLAGS@
125CYGPATH_W = @CYGPATH_W@
126DEFS = @DEFS@
127DEPDIR = @DEPDIR@
128DIRECTFB_CFLAGS = @DIRECTFB_CFLAGS@
129DIRECTFB_LIBS = @DIRECTFB_LIBS@
130DLLTOOL = @DLLTOOL@
131DSYMUTIL = @DSYMUTIL@
132DUMPBIN = @DUMPBIN@
133ECHO_C = @ECHO_C@
134ECHO_N = @ECHO_N@
135ECHO_T = @ECHO_T@
136ECORE_EVAS_CFLAGS = @ECORE_EVAS_CFLAGS@
137ECORE_EVAS_LIBS = @ECORE_EVAS_LIBS@
138EDB_CFLAGS = @EDB_CFLAGS@
139EDB_LIBS = @EDB_LIBS@
140EDJE_CFLAGS = @EDJE_CFLAGS@
141EDJE_LIBS = @EDJE_LIBS@
142EET_CFLAGS = @EET_CFLAGS@
143EET_LIBS = @EET_LIBS@
144EFL_COVERAGE_CFLAGS = @EFL_COVERAGE_CFLAGS@
145EFL_COVERAGE_LIBS = @EFL_COVERAGE_LIBS@
146EFL_FNMATCH_LIBS = @EFL_FNMATCH_LIBS@
147EGREP = @EGREP@
148EINA_CFLAGS = @EINA_CFLAGS@
149EINA_LIBS = @EINA_LIBS@
150EVAS_CFLAGS = @EVAS_CFLAGS@
151EVAS_LIBS = @EVAS_LIBS@
152EVAS_SSE3_CFLAGS = @EVAS_SSE3_CFLAGS@
153EVIL_CFLAGS = @EVIL_CFLAGS@
154EVIL_LIBS = @EVIL_LIBS@
155EXEEXT = @EXEEXT@
156FGREP = @FGREP@
157FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@
158FONTCONFIG_LIBS = @FONTCONFIG_LIBS@
159FREETYPE_CFLAGS = @FREETYPE_CFLAGS@
160FREETYPE_LIBS = @FREETYPE_LIBS@
161FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@
162FRIBIDI_LIBS = @FRIBIDI_LIBS@
163GL_EET_CFLAGS = @GL_EET_CFLAGS@
164GL_EET_LIBS = @GL_EET_LIBS@
165GREP = @GREP@
166HARFBUZZ_CFLAGS = @HARFBUZZ_CFLAGS@
167HARFBUZZ_LIBS = @HARFBUZZ_LIBS@
168INSTALL = @INSTALL@
169INSTALL_DATA = @INSTALL_DATA@
170INSTALL_PROGRAM = @INSTALL_PROGRAM@
171INSTALL_SCRIPT = @INSTALL_SCRIPT@
172INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
173LD = @LD@
174LDFLAGS = @LDFLAGS@
175LIBOBJS = @LIBOBJS@
176LIBS = @LIBS@
177LIBTOOL = @LIBTOOL@
178LINEBREAK_CFLAGS = @LINEBREAK_CFLAGS@
179LINEBREAK_LIBS = @LINEBREAK_LIBS@
180LIPO = @LIPO@
181LN_S = @LN_S@
182LTLIBOBJS = @LTLIBOBJS@
183MAKEINFO = @MAKEINFO@
184MKDIR_P = @MKDIR_P@
185MODULE_ARCH = @MODULE_ARCH@
186NM = @NM@
187NMEDIT = @NMEDIT@
188OBJC = @OBJC@
189OBJCDEPMODE = @OBJCDEPMODE@
190OBJCFLAGS = @OBJCFLAGS@
191OBJDUMP = @OBJDUMP@
192OBJEXT = @OBJEXT@
193OTOOL = @OTOOL@
194OTOOL64 = @OTOOL64@
195PACKAGE = @PACKAGE@
196PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
197PACKAGE_NAME = @PACKAGE_NAME@
198PACKAGE_STRING = @PACKAGE_STRING@
199PACKAGE_TARNAME = @PACKAGE_TARNAME@
200PACKAGE_URL = @PACKAGE_URL@
201PACKAGE_VERSION = @PACKAGE_VERSION@
202PATH_SEPARATOR = @PATH_SEPARATOR@
203PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
204PIXMAN_LIBS = @PIXMAN_LIBS@
205PKG_CONFIG = @PKG_CONFIG@
206PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
207PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
208PNG_CFLAGS = @PNG_CFLAGS@
209PNG_LIBS = @PNG_LIBS@
210RANLIB = @RANLIB@
211SDL_CFLAGS = @SDL_CFLAGS@
212SDL_LIBS = @SDL_LIBS@
213SED = @SED@
214SET_MAKE = @SET_MAKE@
215SHELL = @SHELL@
216SHM_OPEN_LINK = @SHM_OPEN_LINK@
217STRIP = @STRIP@
218SVG_CFLAGS = @SVG_CFLAGS@
219SVG_LIBS = @SVG_LIBS@
220VALGRIND_CFLAGS = @VALGRIND_CFLAGS@
221VALGRIND_LIBS = @VALGRIND_LIBS@
222VERSION = @VERSION@
223VMAJ = @VMAJ@
224WIN32_CFLAGS = @WIN32_CFLAGS@
225WIN32_CPPFLAGS = @WIN32_CPPFLAGS@
226XCB_CFLAGS = @XCB_CFLAGS@
227XCB_GL_CFLAGS = @XCB_GL_CFLAGS@
228XCB_GL_LIBS = @XCB_GL_LIBS@
229XCB_LIBS = @XCB_LIBS@
230XEXT_CFLAGS = @XEXT_CFLAGS@
231XEXT_LIBS = @XEXT_LIBS@
232XMKMF = @XMKMF@
233X_CFLAGS = @X_CFLAGS@
234X_EXTRA_LIBS = @X_EXTRA_LIBS@
235X_LIBS = @X_LIBS@
236X_PRE_LIBS = @X_PRE_LIBS@
237abs_builddir = @abs_builddir@
238abs_srcdir = @abs_srcdir@
239abs_top_builddir = @abs_top_builddir@
240abs_top_srcdir = @abs_top_srcdir@
241ac_ct_CC = @ac_ct_CC@
242ac_ct_CXX = @ac_ct_CXX@
243ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
244ac_ct_OBJC = @ac_ct_OBJC@
245altivec_cflags = @altivec_cflags@
246am__include = @am__include@
247am__leading_dot = @am__leading_dot@
248am__quote = @am__quote@
249am__tar = @am__tar@
250am__untar = @am__untar@
251bindir = @bindir@
252build = @build@
253build_alias = @build_alias@
254build_cpu = @build_cpu@
255build_os = @build_os@
256build_vendor = @build_vendor@
257builddir = @builddir@
258datadir = @datadir@
259datarootdir = @datarootdir@
260dlopen_libs = @dlopen_libs@
261docdir = @docdir@
262dvidir = @dvidir@
263edje_cc = @edje_cc@
264efl_doxygen = @efl_doxygen@
265efl_have_doxygen = @efl_have_doxygen@
266evas_engine_buffer_cflags = @evas_engine_buffer_cflags@
267evas_engine_buffer_libs = @evas_engine_buffer_libs@
268evas_engine_direct3d_cflags = @evas_engine_direct3d_cflags@
269evas_engine_direct3d_libs = @evas_engine_direct3d_libs@
270evas_engine_directfb_cflags = @evas_engine_directfb_cflags@
271evas_engine_directfb_libs = @evas_engine_directfb_libs@
272evas_engine_fb_cflags = @evas_engine_fb_cflags@
273evas_engine_fb_libs = @evas_engine_fb_libs@
274evas_engine_gl_cocoa_cflags = @evas_engine_gl_cocoa_cflags@
275evas_engine_gl_cocoa_libs = @evas_engine_gl_cocoa_libs@
276evas_engine_gl_common_libs = @evas_engine_gl_common_libs@
277evas_engine_gl_sdl_cflags = @evas_engine_gl_sdl_cflags@
278evas_engine_gl_sdl_libs = @evas_engine_gl_sdl_libs@
279evas_engine_gl_xcb_cflags = @evas_engine_gl_xcb_cflags@
280evas_engine_gl_xcb_libs = @evas_engine_gl_xcb_libs@
281evas_engine_gl_xlib_cflags = @evas_engine_gl_xlib_cflags@
282evas_engine_gl_xlib_libs = @evas_engine_gl_xlib_libs@
283evas_engine_psl1ght_cflags = @evas_engine_psl1ght_cflags@
284evas_engine_psl1ght_libs = @evas_engine_psl1ght_libs@
285evas_engine_software_16_ddraw_cflags = @evas_engine_software_16_ddraw_cflags@
286evas_engine_software_16_ddraw_libs = @evas_engine_software_16_ddraw_libs@
287evas_engine_software_16_sdl_cflags = @evas_engine_software_16_sdl_cflags@
288evas_engine_software_16_sdl_libs = @evas_engine_software_16_sdl_libs@
289evas_engine_software_16_wince_cflags = @evas_engine_software_16_wince_cflags@
290evas_engine_software_16_wince_libs = @evas_engine_software_16_wince_libs@
291evas_engine_software_16_x11_cflags = @evas_engine_software_16_x11_cflags@
292evas_engine_software_16_x11_libs = @evas_engine_software_16_x11_libs@
293evas_engine_software_8_x11_cflags = @evas_engine_software_8_x11_cflags@
294evas_engine_software_8_x11_libs = @evas_engine_software_8_x11_libs@
295evas_engine_software_ddraw_cflags = @evas_engine_software_ddraw_cflags@
296evas_engine_software_ddraw_libs = @evas_engine_software_ddraw_libs@
297evas_engine_software_gdi_cflags = @evas_engine_software_gdi_cflags@
298evas_engine_software_gdi_libs = @evas_engine_software_gdi_libs@
299evas_engine_software_sdl_cflags = @evas_engine_software_sdl_cflags@
300evas_engine_software_sdl_libs = @evas_engine_software_sdl_libs@
301evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@
302evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@
303evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@
304evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@
305evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@
306evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@
307evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@
308evas_image_loader_edb_libs = @evas_image_loader_edb_libs@
309evas_image_loader_eet_cflags = @evas_image_loader_eet_cflags@
310evas_image_loader_eet_libs = @evas_image_loader_eet_libs@
311evas_image_loader_generic_cflags = @evas_image_loader_generic_cflags@
312evas_image_loader_generic_libs = @evas_image_loader_generic_libs@
313evas_image_loader_gif_cflags = @evas_image_loader_gif_cflags@
314evas_image_loader_gif_libs = @evas_image_loader_gif_libs@
315evas_image_loader_ico_cflags = @evas_image_loader_ico_cflags@
316evas_image_loader_ico_libs = @evas_image_loader_ico_libs@
317evas_image_loader_jpeg_cflags = @evas_image_loader_jpeg_cflags@
318evas_image_loader_jpeg_libs = @evas_image_loader_jpeg_libs@
319evas_image_loader_pmaps_cflags = @evas_image_loader_pmaps_cflags@
320evas_image_loader_pmaps_libs = @evas_image_loader_pmaps_libs@
321evas_image_loader_png_cflags = @evas_image_loader_png_cflags@
322evas_image_loader_png_libs = @evas_image_loader_png_libs@
323evas_image_loader_psd_cflags = @evas_image_loader_psd_cflags@
324evas_image_loader_psd_libs = @evas_image_loader_psd_libs@
325evas_image_loader_svg_cflags = @evas_image_loader_svg_cflags@
326evas_image_loader_svg_libs = @evas_image_loader_svg_libs@
327evas_image_loader_tga_cflags = @evas_image_loader_tga_cflags@
328evas_image_loader_tga_libs = @evas_image_loader_tga_libs@
329evas_image_loader_tiff_cflags = @evas_image_loader_tiff_cflags@
330evas_image_loader_tiff_libs = @evas_image_loader_tiff_libs@
331evas_image_loader_wbmp_cflags = @evas_image_loader_wbmp_cflags@
332evas_image_loader_wbmp_libs = @evas_image_loader_wbmp_libs@
333evas_image_loader_xpm_cflags = @evas_image_loader_xpm_cflags@
334evas_image_loader_xpm_libs = @evas_image_loader_xpm_libs@
335exec_prefix = @exec_prefix@
336have_evas_engine_gl_x11 = @have_evas_engine_gl_x11@
337have_evas_engine_gl_xcb = @have_evas_engine_gl_xcb@
338have_evas_engine_gl_xlib = @have_evas_engine_gl_xlib@
339have_evas_engine_software_x11 = @have_evas_engine_software_x11@
340have_evas_engine_software_xcb = @have_evas_engine_software_xcb@
341have_evas_engine_software_xlib = @have_evas_engine_software_xlib@
342have_lcov = @have_lcov@
343host = @host@
344host_alias = @host_alias@
345host_cpu = @host_cpu@
346host_os = @host_os@
347host_vendor = @host_vendor@
348htmldir = @htmldir@
349includedir = @includedir@
350infodir = @infodir@
351install_sh = @install_sh@
352libdir = @libdir@
353libexecdir = @libexecdir@
354localedir = @localedir@
355localstatedir = @localstatedir@
356lt_ECHO = @lt_ECHO@
357lt_enable_auto_import = @lt_enable_auto_import@
358mandir = @mandir@
359mkdir_p = @mkdir_p@
360oldincludedir = @oldincludedir@
361pdfdir = @pdfdir@
362pkgconfig_requires_private = @pkgconfig_requires_private@
363prefix = @prefix@
364program_transform_name = @program_transform_name@
365psdir = @psdir@
366pthread_cflags = @pthread_cflags@
367pthread_libs = @pthread_libs@
368release_info = @release_info@
369requirement_evas = @requirement_evas@
370sbindir = @sbindir@
371sharedstatedir = @sharedstatedir@
372srcdir = @srcdir@
373sysconfdir = @sysconfdir@
374target_alias = @target_alias@
375top_build_prefix = @top_build_prefix@
376top_builddir = @top_builddir@
377top_srcdir = @top_srcdir@
378version_info = @version_info@
379MAINTAINERCLEANFILES = Makefile.in
380EXTRA_DIST = \
381op_blend_color_.c \
382op_blend_color_i386.c \
383op_blend_color_neon.c \
384op_blend_color_sse3.c \
385op_blend_mask_color_.c \
386op_blend_mask_color_i386.c \
387op_blend_mask_color_neon.c \
388op_blend_mask_color_sse3.c \
389op_blend_pixel_.c \
390op_blend_pixel_color_.c \
391op_blend_pixel_color_i386.c \
392op_blend_pixel_color_neon.c \
393op_blend_pixel_color_sse3.c \
394op_blend_pixel_i386.c \
395op_blend_pixel_mask_.c \
396op_blend_pixel_mask_i386.c \
397op_blend_pixel_mask_neon.c \
398op_blend_pixel_mask_sse3.c \
399op_blend_pixel_neon.c \
400op_blend_pixel_sse3.c
401
402noinst_LTLIBRARIES = libevas_engine_common_op_blend_master_sse3.la
403libevas_engine_common_op_blend_master_sse3_la_SOURCES = \
404op_blend_master_sse3.c
405
406libevas_engine_common_op_blend_master_sse3_la_CFLAGS = \
407-I. \
408-I$(top_srcdir)/src/lib \
409-I$(top_srcdir)/src/lib/engines/common \
410-I$(top_srcdir)/src/lib/engines/common/evas_op_blend \
411-I$(top_srcdir)/src/lib/cserve \
412-I$(top_srcdir)/src/lib/include \
413-DPACKAGE_BIN_DIR=\"$(bindir)\" \
414-DPACKAGE_LIB_DIR=\"$(libdir)\" \
415-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
416@FREETYPE_CFLAGS@ @VALGRIND_CFLAGS@ \
417@PIXMAN_CFLAGS@ \
418@EET_CFLAGS@ @pthread_cflags@ \
419@WIN32_CFLAGS@ @EINA_CFLAGS@ \
420@FRIBIDI_CFLAGS@ @HARFBUZZ_CFLAGS@ \
421@PIXMAN_CFLAGS@ \
422@EVAS_SSE3_CFLAGS@
423
424libevas_engine_common_op_blend_master_sse3_la_DEPENENCIES = \
425$(top_builddir)/config.h
426
427all: all-am
428
429.SUFFIXES:
430.SUFFIXES: .c .lo .o .obj
431$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
432 @for dep in $?; do \
433 case '$(am__configure_deps)' in \
434 *$$dep*) \
435 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
436 && { if test -f $@; then exit 0; else break; fi; }; \
437 exit 1;; \
438 esac; \
439 done; \
440 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/engines/common/evas_op_blend/Makefile'; \
441 $(am__cd) $(top_srcdir) && \
442 $(AUTOMAKE) --gnu src/lib/engines/common/evas_op_blend/Makefile
443.PRECIOUS: Makefile
444Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
445 @case '$?' in \
446 *config.status*) \
447 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
448 *) \
449 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
450 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
451 esac;
452
453$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
454 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
455
456$(top_srcdir)/configure: $(am__configure_deps)
457 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
458$(ACLOCAL_M4): $(am__aclocal_m4_deps)
459 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
460$(am__aclocal_m4_deps):
461
462clean-noinstLTLIBRARIES:
463 -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
464 @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
465 dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
466 test "$$dir" != "$$p" || dir=.; \
467 echo "rm -f \"$${dir}/so_locations\""; \
468 rm -f "$${dir}/so_locations"; \
469 done
470libevas_engine_common_op_blend_master_sse3.la: $(libevas_engine_common_op_blend_master_sse3_la_OBJECTS) $(libevas_engine_common_op_blend_master_sse3_la_DEPENDENCIES)
471 $(AM_V_CCLD)$(libevas_engine_common_op_blend_master_sse3_la_LINK) $(libevas_engine_common_op_blend_master_sse3_la_OBJECTS) $(libevas_engine_common_op_blend_master_sse3_la_LIBADD) $(LIBS)
472
473mostlyclean-compile:
474 -rm -f *.$(OBJEXT)
475
476distclean-compile:
477 -rm -f *.tab.c
478
479@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libevas_engine_common_op_blend_master_sse3_la-op_blend_master_sse3.Plo@am__quote@
480
481.c.o:
482@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
483@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
484@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
485@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
486@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
487@am__fastdepCC_FALSE@ $(COMPILE) -c $<
488
489.c.obj:
490@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
491@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
492@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
493@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
494@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
495@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
496
497.c.lo:
498@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
499@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
500@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
501@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
502@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
503@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
504
505libevas_engine_common_op_blend_master_sse3_la-op_blend_master_sse3.lo: op_blend_master_sse3.c
506@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libevas_engine_common_op_blend_master_sse3_la_CFLAGS) $(CFLAGS) -MT libevas_engine_common_op_blend_master_sse3_la-op_blend_master_sse3.lo -MD -MP -MF $(DEPDIR)/libevas_engine_common_op_blend_master_sse3_la-op_blend_master_sse3.Tpo -c -o libevas_engine_common_op_blend_master_sse3_la-op_blend_master_sse3.lo `test -f 'op_blend_master_sse3.c' || echo '$(srcdir)/'`op_blend_master_sse3.c
507@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libevas_engine_common_op_blend_master_sse3_la-op_blend_master_sse3.Tpo $(DEPDIR)/libevas_engine_common_op_blend_master_sse3_la-op_blend_master_sse3.Plo
508@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
509@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='op_blend_master_sse3.c' object='libevas_engine_common_op_blend_master_sse3_la-op_blend_master_sse3.lo' libtool=yes @AMDEPBACKSLASH@
510@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
511@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libevas_engine_common_op_blend_master_sse3_la_CFLAGS) $(CFLAGS) -c -o libevas_engine_common_op_blend_master_sse3_la-op_blend_master_sse3.lo `test -f 'op_blend_master_sse3.c' || echo '$(srcdir)/'`op_blend_master_sse3.c
512
513mostlyclean-libtool:
514 -rm -f *.lo
515
516clean-libtool:
517 -rm -rf .libs _libs
518
519ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
520 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
521 unique=`for i in $$list; do \
522 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
523 done | \
524 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
525 END { if (nonempty) { for (i in files) print i; }; }'`; \
526 mkid -fID $$unique
527tags: TAGS
528
529TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
530 $(TAGS_FILES) $(LISP)
531 set x; \
532 here=`pwd`; \
533 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
534 unique=`for i in $$list; do \
535 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
536 done | \
537 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
538 END { if (nonempty) { for (i in files) print i; }; }'`; \
539 shift; \
540 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
541 test -n "$$unique" || unique=$$empty_fix; \
542 if test $$# -gt 0; then \
543 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
544 "$$@" $$unique; \
545 else \
546 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
547 $$unique; \
548 fi; \
549 fi
550ctags: CTAGS
551CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
552 $(TAGS_FILES) $(LISP)
553 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
554 unique=`for i in $$list; do \
555 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
556 done | \
557 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
558 END { if (nonempty) { for (i in files) print i; }; }'`; \
559 test -z "$(CTAGS_ARGS)$$unique" \
560 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
561 $$unique
562
563GTAGS:
564 here=`$(am__cd) $(top_builddir) && pwd` \
565 && $(am__cd) $(top_srcdir) \
566 && gtags -i $(GTAGS_ARGS) "$$here"
567
568distclean-tags:
569 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
570
571distdir: $(DISTFILES)
572 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
573 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
574 list='$(DISTFILES)'; \
575 dist_files=`for file in $$list; do echo $$file; done | \
576 sed -e "s|^$$srcdirstrip/||;t" \
577 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
578 case $$dist_files in \
579 */*) $(MKDIR_P) `echo "$$dist_files" | \
580 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
581 sort -u` ;; \
582 esac; \
583 for file in $$dist_files; do \
584 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
585 if test -d $$d/$$file; then \
586 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
587 if test -d "$(distdir)/$$file"; then \
588 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
589 fi; \
590 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
591 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
592 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
593 fi; \
594 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
595 else \
596 test -f "$(distdir)/$$file" \
597 || cp -p $$d/$$file "$(distdir)/$$file" \
598 || exit 1; \
599 fi; \
600 done
601check-am: all-am
602check: check-am
603all-am: Makefile $(LTLIBRARIES)
604installdirs:
605install: install-am
606install-exec: install-exec-am
607install-data: install-data-am
608uninstall: uninstall-am
609
610install-am: all-am
611 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
612
613installcheck: installcheck-am
614install-strip:
615 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
616 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
617 `test -z '$(STRIP)' || \
618 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
619mostlyclean-generic:
620
621clean-generic:
622
623distclean-generic:
624 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
625 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
626
627maintainer-clean-generic:
628 @echo "This command is intended for maintainers to use"
629 @echo "it deletes files that may require special tools to rebuild."
630 -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
631clean: clean-am
632
633clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
634 mostlyclean-am
635
636distclean: distclean-am
637 -rm -rf ./$(DEPDIR)
638 -rm -f Makefile
639distclean-am: clean-am distclean-compile distclean-generic \
640 distclean-tags
641
642dvi: dvi-am
643
644dvi-am:
645
646html: html-am
647
648html-am:
649
650info: info-am
651
652info-am:
653
654install-data-am:
655
656install-dvi: install-dvi-am
657
658install-dvi-am:
659
660install-exec-am:
661
662install-html: install-html-am
663
664install-html-am:
665
666install-info: install-info-am
667
668install-info-am:
669
670install-man:
671
672install-pdf: install-pdf-am
673
674install-pdf-am:
675
676install-ps: install-ps-am
677
678install-ps-am:
679
680installcheck-am:
681
682maintainer-clean: maintainer-clean-am
683 -rm -rf ./$(DEPDIR)
684 -rm -f Makefile
685maintainer-clean-am: distclean-am maintainer-clean-generic
686
687mostlyclean: mostlyclean-am
688
689mostlyclean-am: mostlyclean-compile mostlyclean-generic \
690 mostlyclean-libtool
691
692pdf: pdf-am
693
694pdf-am:
695
696ps: ps-am
697
698ps-am:
699
700uninstall-am:
701
702.MAKE: install-am install-strip
703
704.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
705 clean-libtool clean-noinstLTLIBRARIES ctags distclean \
706 distclean-compile distclean-generic distclean-libtool \
707 distclean-tags distdir dvi dvi-am html html-am info info-am \
708 install install-am install-data install-data-am install-dvi \
709 install-dvi-am install-exec install-exec-am install-html \
710 install-html-am install-info install-info-am install-man \
711 install-pdf install-pdf-am install-ps install-ps-am \
712 install-strip installcheck installcheck-am installdirs \
713 maintainer-clean maintainer-clean-generic mostlyclean \
714 mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
715 pdf pdf-am ps ps-am tags uninstall uninstall-am
716
717
718# Tell versions [3.59,3.63) of GNU make to not export all variables.
719# Otherwise a system limit (for SysV at least) may be exceeded.
720.NOEXPORT:
diff --git a/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_color_.c b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_color_.c
new file mode 100644
index 0000000..be70065
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_color_.c
@@ -0,0 +1,109 @@
1/* blend color -> dst */
2
3#ifdef BUILD_C
4static void
5_op_blend_c_dp(DATA32 *s __UNUSED__, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) {
6 DATA32 *e, a = 256 - (c >> 24);
7 UNROLL8_PLD_WHILE(d, l, e,
8 {
9 *d = c + MUL_256(a, *d);
10 d++;
11 });
12}
13
14#define _op_blend_caa_dp _op_blend_c_dp
15
16#define _op_blend_c_dpan _op_blend_c_dp
17#define _op_blend_caa_dpan _op_blend_c_dpan
18
19static void
20init_blend_color_span_funcs_c(void)
21{
22 op_blend_span_funcs[SP_N][SM_N][SC][DP][CPU_C] = _op_blend_c_dp;
23 op_blend_span_funcs[SP_N][SM_N][SC_AA][DP][CPU_C] = _op_blend_caa_dp;
24
25 op_blend_span_funcs[SP_N][SM_N][SC][DP_AN][CPU_C] = _op_blend_c_dpan;
26 op_blend_span_funcs[SP_N][SM_N][SC_AA][DP_AN][CPU_C] = _op_blend_caa_dpan;
27}
28#endif
29
30#ifdef BUILD_C
31static void
32_op_blend_pt_c_dp(DATA32 s, DATA8 m __UNUSED__, DATA32 c, DATA32 *d) {
33 s = 256 - (c >> 24);
34 *d = c + MUL_256(s, *d);
35}
36
37#define _op_blend_pt_caa_dp _op_blend_pt_c_dp
38
39#define _op_blend_pt_c_dpan _op_blend_pt_c_dp
40#define _op_blend_pt_caa_dpan _op_blend_pt_c_dpan
41
42#define _op_blend_pt_c_dpas _op_blend_pt_c_dp
43#define _op_blend_pt_caa_dpas _op_blend_pt_c_dp
44
45static void
46init_blend_color_pt_funcs_c(void)
47{
48 op_blend_pt_funcs[SP_N][SM_N][SC][DP][CPU_C] = _op_blend_pt_c_dp;
49 op_blend_pt_funcs[SP_N][SM_N][SC_AA][DP][CPU_C] = _op_blend_pt_caa_dp;
50
51 op_blend_pt_funcs[SP_N][SM_N][SC][DP_AN][CPU_C] = _op_blend_pt_c_dpan;
52 op_blend_pt_funcs[SP_N][SM_N][SC_AA][DP_AN][CPU_C] = _op_blend_pt_caa_dpan;
53}
54#endif
55
56/*-----*/
57
58/* blend_rel color -> dst */
59
60#ifdef BUILD_C
61static void
62_op_blend_rel_c_dp(DATA32 *s __UNUSED__, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) {
63 DATA32 *e;
64 int alpha = 256 - (c >> 24);
65 UNROLL8_PLD_WHILE(d, l, e,
66 {
67 *d = MUL_SYM(*d >> 24, c) + MUL_256(alpha, *d);
68 d++;
69 });
70}
71
72#define _op_blend_rel_caa_dp _op_blend_rel_c_dp
73
74#define _op_blend_rel_c_dpan _op_blend_c_dpan
75#define _op_blend_rel_caa_dpan _op_blend_caa_dpan
76
77static void
78init_blend_rel_color_span_funcs_c(void)
79{
80 op_blend_rel_span_funcs[SP_N][SM_N][SC][DP][CPU_C] = _op_blend_rel_c_dp;
81 op_blend_rel_span_funcs[SP_N][SM_N][SC_AA][DP][CPU_C] = _op_blend_rel_caa_dp;
82
83 op_blend_rel_span_funcs[SP_N][SM_N][SC][DP_AN][CPU_C] = _op_blend_rel_c_dpan;
84 op_blend_rel_span_funcs[SP_N][SM_N][SC_AA][DP_AN][CPU_C] = _op_blend_rel_caa_dpan;
85}
86#endif
87
88#ifdef BUILD_C
89static void
90_op_blend_rel_pt_c_dp(DATA32 s, DATA8 m __UNUSED__, DATA32 c, DATA32 *d) {
91 s = *d >> 24;
92 *d = MUL_SYM(s, c) + MUL_256(256 - (c >> 24), *d);
93}
94
95#define _op_blend_rel_pt_caa_dp _op_blend_rel_pt_c_dp
96
97#define _op_blend_rel_pt_c_dpan _op_blend_pt_c_dpan
98#define _op_blend_rel_pt_caa_dpan _op_blend_pt_caa_dpan
99
100static void
101init_blend_rel_color_pt_funcs_c(void)
102{
103 op_blend_rel_pt_funcs[SP_N][SM_N][SC][DP][CPU_C] = _op_blend_rel_pt_c_dp;
104 op_blend_rel_pt_funcs[SP_N][SM_N][SC_AA][DP][CPU_C] = _op_blend_rel_pt_caa_dp;
105
106 op_blend_rel_pt_funcs[SP_N][SM_N][SC][DP_AN][CPU_C] = _op_blend_rel_pt_c_dpan;
107 op_blend_rel_pt_funcs[SP_N][SM_N][SC_AA][DP_AN][CPU_C] = _op_blend_rel_pt_caa_dpan;
108}
109#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_color_i386.c b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_color_i386.c
new file mode 100644
index 0000000..a05af7d
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_color_i386.c
@@ -0,0 +1,138 @@
1/* blend color --> dst */
2
3#ifdef BUILD_MMX
4static void
5_op_blend_c_dp_mmx(DATA32 *s __UNUSED__, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) {
6 DATA32 *e = d + l;
7 pxor_r2r(mm0, mm0);
8 MOV_P2R(c, mm2, mm0)
9 c = 256 - (c >> 24);
10 MOV_A2R(c, mm3)
11 while (d < e) {
12 MOV_P2R(*d, mm1, mm0)
13 MUL4_256_R2R(mm3, mm1)
14 paddw_r2r(mm2, mm1);
15 MOV_R2P(mm1, *d, mm0)
16 d++;
17 }
18}
19
20#define _op_blend_caa_dp_mmx _op_blend_c_dp_mmx
21
22#define _op_blend_c_dpan_mmx _op_blend_c_dp_mmx
23#define _op_blend_caa_dpan_mmx _op_blend_c_dpan_mmx
24
25static void
26init_blend_color_span_funcs_mmx(void)
27{
28 op_blend_span_funcs[SP_N][SM_N][SC][DP][CPU_MMX] = _op_blend_c_dp_mmx;
29 op_blend_span_funcs[SP_N][SM_N][SC_AA][DP][CPU_MMX] = _op_blend_caa_dp_mmx;
30
31 op_blend_span_funcs[SP_N][SM_N][SC][DP_AN][CPU_MMX] = _op_blend_c_dpan_mmx;
32 op_blend_span_funcs[SP_N][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_blend_caa_dpan_mmx;
33}
34#endif
35
36#ifdef BUILD_MMX
37static void
38_op_blend_pt_c_dp_mmx(DATA32 s __UNUSED__, DATA8 m __UNUSED__, DATA32 c, DATA32 *d) {
39 pxor_r2r(mm0, mm0);
40 MOV_P2R(c, mm2, mm0)
41 c = 256 - (c >> 24);
42 MOV_A2R(c, mm3)
43 MOV_P2R(*d, mm1, mm0)
44 MUL4_256_R2R(mm3, mm1)
45 paddw_r2r(mm2, mm1);
46 MOV_R2P(mm1, *d, mm0)
47}
48
49#define _op_blend_pt_caa_dp_mmx _op_blend_pt_c_dp_mmx
50
51#define _op_blend_pt_c_dpan_mmx _op_blend_pt_c_dp_mmx
52#define _op_blend_pt_caa_dpan_mmx _op_blend_pt_c_dpan_mmx
53
54static void
55init_blend_color_pt_funcs_mmx(void)
56{
57 op_blend_pt_funcs[SP_N][SM_N][SC][DP][CPU_MMX] = _op_blend_pt_c_dp_mmx;
58 op_blend_pt_funcs[SP_N][SM_N][SC_AA][DP][CPU_MMX] = _op_blend_pt_caa_dp_mmx;
59
60 op_blend_pt_funcs[SP_N][SM_N][SC][DP_AN][CPU_MMX] = _op_blend_pt_c_dpan_mmx;
61 op_blend_pt_funcs[SP_N][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_blend_pt_caa_dpan_mmx;
62}
63#endif
64/*-----*/
65
66/* blend_rel color -> dst */
67
68#ifdef BUILD_MMX
69static void
70_op_blend_rel_c_dp_mmx(DATA32 *s __UNUSED__, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) {
71 DATA32 *e = d + l;
72 pxor_r2r(mm0, mm0);
73 MOV_P2R(c, mm2, mm0)
74 c = 256 - (c >> 24);
75 MOV_A2R(c, mm3)
76 MOV_A2R(ALPHA_255, mm5)
77 while (d < e) {
78 MOV_P2R(*d, mm1, mm0)
79 MOV_RA2R(mm1, mm4)
80 MUL4_256_R2R(mm3, mm1)
81 MUL4_SYM_R2R(mm2, mm4, mm5)
82 paddw_r2r(mm4, mm1);
83 MOV_R2P(mm1, *d, mm0)
84 d++;
85 }
86}
87
88#define _op_blend_rel_caa_dp_mmx _op_blend_rel_c_dp_mmx
89
90#define _op_blend_rel_c_dpan_mmx _op_blend_c_dpan_mmx
91#define _op_blend_rel_caa_dpan_mmx _op_blend_caa_dpan_mmx
92
93static void
94init_blend_rel_color_span_funcs_mmx(void)
95{
96 op_blend_rel_span_funcs[SP_N][SM_N][SC][DP][CPU_MMX] = _op_blend_rel_c_dp_mmx;
97 op_blend_rel_span_funcs[SP_N][SM_N][SC_AA][DP][CPU_MMX] = _op_blend_rel_caa_dp_mmx;
98
99 op_blend_rel_span_funcs[SP_N][SM_N][SC][DP_AN][CPU_MMX] = _op_blend_rel_c_dpan_mmx;
100 op_blend_rel_span_funcs[SP_N][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_blend_rel_caa_dpan_mmx;
101}
102#endif
103
104#ifdef BUILD_MMX
105static void
106_op_blend_rel_pt_c_dp_mmx(DATA32 s __UNUSED__, DATA8 m __UNUSED__, DATA32 c, DATA32 *d) {
107 pxor_r2r(mm0, mm0);
108 MOV_A2R(ALPHA_256, mm6)
109 MOV_A2R(ALPHA_255, mm5)
110
111 MOV_P2R(c, mm2, mm0)
112 MOV_RA2R(mm2, mm1)
113 psubw_r2r(mm1, mm6);
114
115 MOV_P2R(*d, mm1, mm0)
116 MOV_RA2R(mm1, mm4)
117 MUL4_256_R2R(mm6, mm1)
118
119 MUL4_SYM_R2R(mm4, mm2, mm5)
120 paddw_r2r(mm2, mm1);
121 MOV_R2P(mm1, *d, mm0)
122}
123
124#define _op_blend_rel_pt_caa_dp_mmx _op_blend_rel_pt_c_dp_mmx
125
126#define _op_blend_rel_pt_c_dpan_mmx _op_blend_pt_c_dpan_mmx
127#define _op_blend_rel_pt_caa_dpan_mmx _op_blend_pt_caa_dpan_mmx
128
129static void
130init_blend_rel_color_pt_funcs_mmx(void)
131{
132 op_blend_rel_pt_funcs[SP_N][SM_N][SC][DP][CPU_MMX] = _op_blend_rel_pt_c_dp_mmx;
133 op_blend_rel_pt_funcs[SP_N][SM_N][SC_AA][DP][CPU_MMX] = _op_blend_rel_pt_caa_dp_mmx;
134
135 op_blend_rel_pt_funcs[SP_N][SM_N][SC][DP_AN][CPU_MMX] = _op_blend_rel_pt_c_dpan_mmx;
136 op_blend_rel_pt_funcs[SP_N][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_blend_rel_pt_caa_dpan_mmx;
137}
138#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_color_neon.c b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_color_neon.c
new file mode 100644
index 0000000..53b9991
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_color_neon.c
@@ -0,0 +1,223 @@
1/* blend color --> dst */
2
3#ifdef BUILD_NEON
4static void
5_op_blend_c_dp_neon(DATA32 *s __UNUSED__, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) {
6 DATA32 *e, *tmp = 0;
7#define AP "B_C_DP"
8 asm volatile (
9 ".fpu neon \n\t"
10 "vdup.u32 q6, %[c] \n\t"
11 "vmov.i8 q5, #1 \n\t"
12 "vmvn.u8 q7,q6 \n\t"
13 "vshr.u32 q7, q7, $0x18 \n\t"
14 "vmul.u32 q7,q5, q7 \n\t"
15 "bic %[e], #3 \n\t"
16 "bic %[d], #3 \n\t"
17
18 AP "loopchoose: \n\t"
19 // If aligned already - straight to quads
20 "andS %[tmp], %[d],$0x1f \n\t"
21 "beq "AP"quadloops \n\t"
22
23 "andS %[tmp], %[d],$0x4 \n\t"
24 "beq "AP"dualloop \n\t"
25
26 // Only ever executes once, fall through to dual
27 AP "singleloop: \n\t"
28 // Use 'tmp' not 'd'
29 "vld1.32 d0[0], [%[d]] \n\t"
30 // Only touch d1
31 "vmull.u8 q0, d0, d14 \n\t"
32 "vqrshrn.u16 d0, q0, #8 \n\t"
33 "vadd.u8 d0, d12, d0 \n\t"
34 "vst1.32 d0[0], [%[d]] \n\t"
35
36 "add %[d], #4 \n\t"
37
38 // Can we go the fast path?
39 "andS %[tmp], %[d],$0x1f \n\t"
40 "beq "AP"quadloops \n\t"
41
42 AP "dualloop: \n\t"
43 "sub %[tmp], %[e], %[d] \n\t"
44 "cmp %[tmp], #32 \n\t"
45 "blt "AP"loopout \n\t"
46
47
48 AP "dualloopint: \n\t"
49 "vldr.32 d0, [%[d]] \n\t"
50 "vmull.u8 q1, d0, d14 \n\t"
51 "vqrshrn.u16 d0, q1, #8 \n\t"
52 "vqadd.u8 d0, d0, d12 \n\t"
53
54 "vstm %[d]!, {d0} \n\t"
55
56 "ands %[tmp], %[d], $0x1f \n\t"
57 "bne "AP"dualloopint \n\t"
58
59 AP "quadloops: \n\t"
60 "sub %[tmp], %[e], %[d] \n\t"
61 "cmp %[tmp], #32 \n\t"
62 "blt "AP"loopout \n\t"
63
64 "sub %[tmp],%[e],#31 \n\t"
65
66 AP "quadloopint:\n\t"
67 "vldm %[d], {d0,d1,d2,d3} \n\t"
68
69 "vmull.u8 q2, d0, d14 \n\t"
70 "vmull.u8 q3, d1, d15 \n\t"
71 "vmull.u8 q4, d2, d14 \n\t"
72 "vmull.u8 q5, d3, d15 \n\t"
73
74 "vqrshrn.u16 d0, q2, #8 \n\t"
75 "vqrshrn.u16 d1, q3, #8 \n\t"
76 "vqrshrn.u16 d2, q4, #8 \n\t"
77 "vqrshrn.u16 d3, q5, #8 \n\t"
78
79 "vqadd.u8 q0, q6, q0 \n\t"
80 "vqadd.u8 q1, q6, q1 \n\t"
81
82 "vstm %[d]!, {d0,d1,d2,d3} \n\t"
83
84 "cmp %[tmp], %[d]\n\t"
85 "bhi "AP"quadloopint\n\t"
86
87 AP "loopout: \n\t"
88 "cmp %[d], %[e]\n\t"
89 "beq "AP"done\n\t"
90 "sub %[tmp],%[e], %[d] \n\t"
91 "cmp %[tmp],#8 \n\t"
92 "blt "AP"singleloop2 \n\t"
93
94 AP "dualloop2: \n\t"
95 "sub %[tmp],%[e],$0x7 \n\t"
96 AP "dualloop2int: \n\t"
97 "vldr.64 d0, [%[d]] \n\t"
98 "vmull.u8 q1, d0, d14 \n\t"
99 "vqrshrn.u16 d0, q1, #8 \n\t"
100 "vqadd.u8 d0, d0, d12 \n\t"
101
102 "vstr.64 d0, [%[d]] \n\t"
103
104 "add %[d], #8 \n\t"
105 "cmp %[tmp], %[d] \n\t"
106 "bhi "AP"dualloop2int \n\t"
107
108 // Single ??
109 "cmp %[e], %[d] \n\t"
110 "beq "AP"done \n\t"
111
112 AP "singleloop2: \n\t"
113 "vld1.32 d0[0], [%[d]] \n\t"
114 "vmull.u8 q1, d0, d14 \n\t"
115 "vqrshrn.u16 d0, q1, #8 \n\t"
116 "vqadd.u8 d0, d0, d12 \n\t"
117
118 "vst1.32 d0[0], [%[d]] \n\t"
119
120 AP "done:\n\t"
121
122 : // output regs
123 // Input
124 : [e] "r" (e = d + l), [d] "r" (d), [c] "r" (c), [tmp] "r" (tmp)
125 : "q0", "q1", "q2","q3", "q4","q5","q6", "q7","memory" // clobbered
126
127 );
128#undef AP
129
130}
131
132#define _op_blend_caa_dp_neon _op_blend_c_dp_neon
133
134#define _op_blend_c_dpan_neon _op_blend_c_dp_neon
135#define _op_blend_caa_dpan_neon _op_blend_c_dpan_neon
136
137static void
138init_blend_color_span_funcs_neon(void)
139{
140 op_blend_span_funcs[SP_N][SM_N][SC][DP][CPU_NEON] = _op_blend_c_dp_neon;
141 op_blend_span_funcs[SP_N][SM_N][SC_AA][DP][CPU_NEON] = _op_blend_caa_dp_neon;
142
143 op_blend_span_funcs[SP_N][SM_N][SC][DP_AN][CPU_NEON] = _op_blend_c_dpan_neon;
144 op_blend_span_funcs[SP_N][SM_N][SC_AA][DP_AN][CPU_NEON] = _op_blend_caa_dpan_neon;
145}
146#endif
147
148#ifdef BUILD_NEON
149static void
150_op_blend_pt_c_dp_neon(DATA32 s __UNUSED__, DATA8 m __UNUSED__, DATA32 c, DATA32 *d) {
151 s = 256 - (c >> 24);
152 *d = c + MUL_256(s, *d);
153}
154
155#define _op_blend_pt_caa_dp_neon _op_blend_pt_c_dp_neon
156
157#define _op_blend_pt_c_dpan_neon _op_blend_pt_c_dp_neon
158#define _op_blend_pt_caa_dpan_neon _op_blend_pt_c_dpan_neon
159
160static void
161init_blend_color_pt_funcs_neon(void)
162{
163 op_blend_pt_funcs[SP_N][SM_N][SC][DP][CPU_NEON] = _op_blend_pt_c_dp_neon;
164 op_blend_pt_funcs[SP_N][SM_N][SC_AA][DP][CPU_NEON] = _op_blend_pt_caa_dp_neon;
165
166 op_blend_pt_funcs[SP_N][SM_N][SC][DP_AN][CPU_NEON] = _op_blend_pt_c_dpan_neon;
167 op_blend_pt_funcs[SP_N][SM_N][SC_AA][DP_AN][CPU_NEON] = _op_blend_pt_caa_dpan_neon;
168}
169#endif
170/*-----*/
171
172/* blend_rel color -> dst */
173
174#ifdef BUILD_NEON
175static void
176_op_blend_rel_c_dp_neon(DATA32 *s __UNUSED__, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) {
177 DATA32 *e;
178 int alpha = 256 - (c >> 24);
179 UNROLL8_PLD_WHILE(d, l, e,
180 {
181 *d = MUL_SYM(*d >> 24, c) + MUL_256(alpha, *d);
182 d++;
183 });
184}
185
186#define _op_blend_rel_caa_dp_neon _op_blend_rel_c_dp_neon
187
188#define _op_blend_rel_c_dpan_neon _op_blend_c_dpan_neon
189#define _op_blend_rel_caa_dpan_neon _op_blend_caa_dpan_neon
190
191static void
192init_blend_rel_color_span_funcs_neon(void)
193{
194 op_blend_rel_span_funcs[SP_N][SM_N][SC][DP][CPU_NEON] = _op_blend_rel_c_dp_neon;
195 op_blend_rel_span_funcs[SP_N][SM_N][SC_AA][DP][CPU_NEON] = _op_blend_rel_caa_dp_neon;
196
197 op_blend_rel_span_funcs[SP_N][SM_N][SC][DP_AN][CPU_NEON] = _op_blend_rel_c_dpan_neon;
198 op_blend_rel_span_funcs[SP_N][SM_N][SC_AA][DP_AN][CPU_NEON] = _op_blend_rel_caa_dpan_neon;
199}
200#endif
201
202#ifdef BUILD_NEON
203static void
204_op_blend_rel_pt_c_dp_neon(DATA32 s __UNUSED__, DATA8 m __UNUSED__, DATA32 c, DATA32 *d) {
205 s = *d >> 24;
206 *d = MUL_SYM(s, c) + MUL_256(256 - (c >> 24), *d);
207}
208
209#define _op_blend_rel_pt_caa_dp_neon _op_blend_rel_pt_c_dp_neon
210
211#define _op_blend_rel_pt_c_dpan_neon _op_blend_pt_c_dpan_neon
212#define _op_blend_rel_pt_caa_dpan_neon _op_blend_pt_caa_dpan_neon
213
214static void
215init_blend_rel_color_pt_funcs_neon(void)
216{
217 op_blend_rel_pt_funcs[SP_N][SM_N][SC][DP][CPU_NEON] = _op_blend_rel_pt_c_dp_neon;
218 op_blend_rel_pt_funcs[SP_N][SM_N][SC_AA][DP][CPU_NEON] = _op_blend_rel_pt_caa_dp_neon;
219
220 op_blend_rel_pt_funcs[SP_N][SM_N][SC][DP_AN][CPU_NEON] = _op_blend_rel_pt_c_dpan_neon;
221 op_blend_rel_pt_funcs[SP_N][SM_N][SC_AA][DP_AN][CPU_NEON] = _op_blend_rel_pt_caa_dpan_neon;
222}
223#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_color_sse3.c b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_color_sse3.c
new file mode 100644
index 0000000..64d5a86
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_color_sse3.c
@@ -0,0 +1,166 @@
1/* blend color -> dst */
2
3#ifdef BUILD_SSE3
4
5static void
6_op_blend_c_dp_sse3(DATA32 *s __UNUSED__, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) {
7
8 DATA32 a = 256 - (c >> 24);
9
10 const __m128i c_packed = _mm_set_epi32(c, c, c, c);
11 const __m128i a_packed = _mm_set_epi32(a, a, a, a);
12
13 LOOP_ALIGNED_U1_A48_SSE3(d, l,
14 { /* UOP */
15
16 *d = c + MUL_256(a, *d);
17 d++; l--;
18 },
19 { /* A4OP */
20
21 __m128i d0 = _mm_load_si128((__m128i *)d);
22
23 d0 = mul_256_sse3(a_packed, d0);
24 d0 = _mm_add_epi32(d0, c_packed);
25
26 _mm_store_si128((__m128i *)d, d0);
27
28 d += 4; l -= 4;
29 },
30 { /* A8OP */
31
32 __m128i d0 = _mm_load_si128((__m128i *)d);
33 __m128i d1 = _mm_load_si128((__m128i *)(d+4));
34
35 d0 = mul_256_sse3(a_packed, d0);
36 d1 = mul_256_sse3(a_packed, d1);
37
38 d0 = _mm_add_epi32(d0, c_packed);
39 d1 = _mm_add_epi32(d1, c_packed);
40
41 _mm_store_si128((__m128i *)d, d0);
42 _mm_store_si128((__m128i *)(d+4), d1);
43
44 d += 8; l -= 8;
45 })
46}
47
48#define _op_blend_caa_dp_sse3 _op_blend_c_dp_sse3
49
50#define _op_blend_c_dpan_sse3 _op_blend_c_dp_sse3
51#define _op_blend_caa_dpan_sse3 _op_blend_c_dpan_sse3
52
53static void
54init_blend_color_span_funcs_sse3(void)
55{
56 op_blend_span_funcs[SP_N][SM_N][SC][DP][CPU_SSE3] = _op_blend_c_dp_sse3;
57 op_blend_span_funcs[SP_N][SM_N][SC_AA][DP][CPU_SSE3] = _op_blend_caa_dp_sse3;
58
59// FIXME: BUGGY BUGGY Core i5 750 (32bit), 4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu4), ello (text and rectangle)
60// op_blend_span_funcs[SP_N][SM_N][SC][DP_AN][CPU_SSE3] = _op_blend_c_dpan_sse3;
61 op_blend_span_funcs[SP_N][SM_N][SC_AA][DP_AN][CPU_SSE3] = _op_blend_caa_dpan_sse3;
62}
63
64#define _op_blend_pt_c_dp_sse3 NULL
65#define _op_blend_pt_caa_dp_sse3 _op_blend_pt_c_dp_sse3
66
67#define _op_blend_pt_c_dpan_sse3 _op_blend_pt_c_dp_sse3
68#define _op_blend_pt_caa_dpan_sse3 _op_blend_pt_c_dpan_sse3
69
70#define _op_blend_pt_c_dpas_sse3 _op_blend_pt_c_dp_sse3
71#define _op_blend_pt_caa_dpas_sse3 _op_blend_pt_c_dp_sse3
72
73static void
74init_blend_color_pt_funcs_sse3(void)
75{
76 op_blend_pt_funcs[SP_N][SM_N][SC][DP][CPU_SSE3] = _op_blend_pt_c_dp_sse3;
77 op_blend_pt_funcs[SP_N][SM_N][SC_AA][DP][CPU_SSE3] = _op_blend_pt_caa_dp_sse3;
78
79 op_blend_pt_funcs[SP_N][SM_N][SC][DP_AN][CPU_SSE3] = _op_blend_pt_c_dpan_sse3;
80 op_blend_pt_funcs[SP_N][SM_N][SC_AA][DP_AN][CPU_SSE3] = _op_blend_pt_caa_dpan_sse3;
81}
82
83
84/*-----*/
85
86/* blend_rel color -> dst */
87
88static void
89_op_blend_rel_c_dp_sse3(DATA32 *s __UNUSED__, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) {
90
91 int alpha = 256 - (c >> 24);
92
93 const __m128i c_packed = _mm_set_epi32(c, c, c, c);
94 const __m128i alpha_packed = _mm_set_epi32(alpha, alpha, alpha, alpha);
95
96 LOOP_ALIGNED_U1_A48_SSE3(d, l,
97 { /* UOP */
98
99 *d = MUL_SYM(*d >> 24, c) + MUL_256(alpha, *d);
100 d++; l--;
101 },
102 { /* A4OP */
103
104 __m128i d0 = _mm_load_si128((__m128i *)d);
105
106 __m128i mul0 = mul_256_sse3(alpha_packed, d0);
107 __m128i sym0 = mul_sym_sse3(_mm_srli_epi32(d0, 24), c_packed);
108
109 d0 = _mm_add_epi32(mul0, sym0);
110
111 _mm_store_si128((__m128i *)d, d0);
112
113 d += 4; l -= 4;
114 },
115 { /* A8OP */
116
117 __m128i d0 = _mm_load_si128((__m128i *)d);
118 __m128i d1 = _mm_load_si128((__m128i *)(d+4));
119
120 __m128i mul0 = mul_256_sse3(alpha_packed, d0);
121 __m128i mul1 = mul_256_sse3(alpha_packed, d1);
122
123 __m128i sym0 = mul_sym_sse3(_mm_srli_epi32(d0, 24), c_packed);
124 __m128i sym1 = mul_sym_sse3(_mm_srli_epi32(d1, 24), c_packed);
125
126 d0 = _mm_add_epi32(mul0, sym0);
127 d1 = _mm_add_epi32(mul1, sym1);
128
129 _mm_store_si128((__m128i *)d, d0);
130 _mm_store_si128((__m128i *)(d+4), d1);
131
132 d += 8; l -= 8;
133 })
134}
135
136#define _op_blend_rel_caa_dp_sse3 _op_blend_rel_c_dp_sse3
137#define _op_blend_rel_c_dpan_sse3 _op_blend_c_dpan_sse3
138#define _op_blend_rel_caa_dpan_sse3 _op_blend_caa_dpan_sse3
139
140static void
141init_blend_rel_color_span_funcs_sse3(void)
142{
143 op_blend_rel_span_funcs[SP_N][SM_N][SC][DP][CPU_SSE3] = _op_blend_rel_c_dp_sse3;
144 op_blend_rel_span_funcs[SP_N][SM_N][SC_AA][DP][CPU_SSE3] = _op_blend_rel_caa_dp_sse3;
145
146 op_blend_rel_span_funcs[SP_N][SM_N][SC][DP_AN][CPU_SSE3] = _op_blend_rel_c_dpan_sse3;
147 op_blend_rel_span_funcs[SP_N][SM_N][SC_AA][DP_AN][CPU_SSE3] = _op_blend_rel_caa_dpan_sse3;
148}
149
150#define _op_blend_rel_pt_c_dp_sse3 NULL
151#define _op_blend_rel_pt_caa_dp_sse3 _op_blend_rel_pt_c_dp_sse3
152
153#define _op_blend_rel_pt_c_dpan_sse3 _op_blend_pt_c_dpan_sse3
154#define _op_blend_rel_pt_caa_dpan_sse3 _op_blend_pt_caa_dpan_sse3
155
156static void
157init_blend_rel_color_pt_funcs_sse3(void)
158{
159 op_blend_rel_pt_funcs[SP_N][SM_N][SC][DP][CPU_SSE3] = _op_blend_rel_pt_c_dp_sse3;
160 op_blend_rel_pt_funcs[SP_N][SM_N][SC_AA][DP][CPU_SSE3] = _op_blend_rel_pt_caa_dp_sse3;
161
162 op_blend_rel_pt_funcs[SP_N][SM_N][SC][DP_AN][CPU_SSE3] = _op_blend_rel_pt_c_dpan_sse3;
163 op_blend_rel_pt_funcs[SP_N][SM_N][SC_AA][DP_AN][CPU_SSE3] = _op_blend_rel_pt_caa_dpan_sse3;
164}
165
166#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_mask_color_.c b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_mask_color_.c
new file mode 100644
index 0000000..12a0a75
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_mask_color_.c
@@ -0,0 +1,185 @@
1/* blend mask x color -> dst */
2
3#ifdef BUILD_C
4static void
5_op_blend_mas_c_dp(DATA32 *s __UNUSED__, DATA8 *m, DATA32 c, DATA32 *d, int l) {
6 DATA32 *e;
7 int alpha = 256 - (c >> 24);
8 UNROLL8_PLD_WHILE(d, l, e,
9 {
10 DATA32 a = *m;
11 switch(a)
12 {
13 case 0:
14 break;
15 case 255:
16 *d = c + MUL_256(alpha, *d);
17 break;
18 default:
19 {
20 DATA32 mc = MUL_SYM(a, c);
21 a = 256 - (mc >> 24);
22 *d = mc + MUL_256(a, *d);
23 }
24 break;
25 }
26 m++; d++;
27 });
28}
29
30static void
31_op_blend_mas_can_dp(DATA32 *s __UNUSED__, DATA8 *m, DATA32 c, DATA32 *d, int l) {
32 DATA32 *e;
33 int alpha;
34 UNROLL8_PLD_WHILE(d, l, e,
35 {
36 alpha = *m;
37 switch(alpha)
38 {
39 case 0:
40 break;
41 case 255:
42 *d = c;
43 break;
44 default:
45 alpha++;
46 *d = INTERP_256(alpha, c, *d);
47 break;
48 }
49 m++; d++;
50 });
51}
52
53#define _op_blend_mas_cn_dp _op_blend_mas_can_dp
54#define _op_blend_mas_caa_dp _op_blend_mas_c_dp
55
56#define _op_blend_mas_c_dpan _op_blend_mas_c_dp
57#define _op_blend_mas_cn_dpan _op_blend_mas_cn_dp
58#define _op_blend_mas_can_dpan _op_blend_mas_can_dp
59#define _op_blend_mas_caa_dpan _op_blend_mas_caa_dp
60
61static void
62init_blend_mask_color_span_funcs_c(void)
63{
64 op_blend_span_funcs[SP_N][SM_AS][SC][DP][CPU_C] = _op_blend_mas_c_dp;
65 op_blend_span_funcs[SP_N][SM_AS][SC_N][DP][CPU_C] = _op_blend_mas_cn_dp;
66 op_blend_span_funcs[SP_N][SM_AS][SC_AN][DP][CPU_C] = _op_blend_mas_can_dp;
67 op_blend_span_funcs[SP_N][SM_AS][SC_AA][DP][CPU_C] = _op_blend_mas_caa_dp;
68
69 op_blend_span_funcs[SP_N][SM_AS][SC][DP_AN][CPU_C] = _op_blend_mas_c_dpan;
70 op_blend_span_funcs[SP_N][SM_AS][SC_N][DP_AN][CPU_C] = _op_blend_mas_cn_dpan;
71 op_blend_span_funcs[SP_N][SM_AS][SC_AN][DP_AN][CPU_C] = _op_blend_mas_can_dpan;
72 op_blend_span_funcs[SP_N][SM_AS][SC_AA][DP_AN][CPU_C] = _op_blend_mas_caa_dpan;
73}
74#endif
75
76#ifdef BUILD_C
77static void
78_op_blend_pt_mas_c_dp(DATA32 s, DATA8 m, DATA32 c, DATA32 *d) {
79 s = MUL_SYM(m, c);
80 m = 256 - (s >> 24);
81 *d = s + MUL_256(m, *d);
82}
83
84static void
85_op_blend_pt_mas_can_dp(DATA32 s __UNUSED__, DATA8 m, DATA32 c, DATA32 *d) {
86 *d = INTERP_256(m + 1, c, *d);
87}
88
89#define _op_blend_pt_mas_cn_dp _op_blend_pt_mas_can_dp
90#define _op_blend_pt_mas_caa_dp _op_blend_pt_mas_c_dp
91
92#define _op_blend_pt_mas_c_dpan _op_blend_pt_mas_c_dp
93#define _op_blend_pt_mas_cn_dpan _op_blend_pt_mas_cn_dp
94#define _op_blend_pt_mas_can_dpan _op_blend_pt_mas_can_dp
95#define _op_blend_pt_mas_caa_dpan _op_blend_pt_mas_caa_dp
96
97static void
98init_blend_mask_color_pt_funcs_c(void)
99{
100 op_blend_pt_funcs[SP_N][SM_AS][SC][DP][CPU_C] = _op_blend_pt_mas_c_dp;
101 op_blend_pt_funcs[SP_N][SM_AS][SC_N][DP][CPU_C] = _op_blend_pt_mas_cn_dp;
102 op_blend_pt_funcs[SP_N][SM_AS][SC_AN][DP][CPU_C] = _op_blend_pt_mas_can_dp;
103 op_blend_pt_funcs[SP_N][SM_AS][SC_AA][DP][CPU_C] = _op_blend_pt_mas_caa_dp;
104
105 op_blend_pt_funcs[SP_N][SM_AS][SC][DP_AN][CPU_C] = _op_blend_pt_mas_c_dpan;
106 op_blend_pt_funcs[SP_N][SM_AS][SC_N][DP_AN][CPU_C] = _op_blend_pt_mas_cn_dpan;
107 op_blend_pt_funcs[SP_N][SM_AS][SC_AN][DP_AN][CPU_C] = _op_blend_pt_mas_can_dpan;
108 op_blend_pt_funcs[SP_N][SM_AS][SC_AA][DP_AN][CPU_C] = _op_blend_pt_mas_caa_dpan;
109}
110#endif
111
112/*-----*/
113
114/* blend_rel mask x color --> dst */
115
116#ifdef BUILD_C
117static void
118_op_blend_rel_mas_c_dp(DATA32 *s __UNUSED__, DATA8 *m, DATA32 c, DATA32 *d, int l) {
119 DATA32 *e;
120 int alpha;
121 UNROLL8_PLD_WHILE(d, l, e,
122 {
123 DATA32 mc = MUL_SYM(*m, c);
124 alpha = 256 - (mc >> 24);
125 *d = MUL_SYM(*d >> 24, mc) + MUL_256(alpha, *d);
126 d++;
127 m++;
128 });
129}
130
131#define _op_blend_rel_mas_cn_dp _op_blend_rel_mas_c_dp
132#define _op_blend_rel_mas_can_dp _op_blend_rel_mas_c_dp
133#define _op_blend_rel_mas_caa_dp _op_blend_rel_mas_c_dp
134
135#define _op_blend_rel_mas_c_dpan _op_blend_mas_c_dpan
136#define _op_blend_rel_mas_cn_dpan _op_blend_mas_cn_dpan
137#define _op_blend_rel_mas_can_dpan _op_blend_mas_can_dpan
138#define _op_blend_rel_mas_caa_dpan _op_blend_mas_caa_dpan
139
140static void
141init_blend_rel_mask_color_span_funcs_c(void)
142{
143 op_blend_rel_span_funcs[SP_N][SM_AS][SC][DP][CPU_C] = _op_blend_rel_mas_c_dp;
144 op_blend_rel_span_funcs[SP_N][SM_AS][SC_N][DP][CPU_C] = _op_blend_rel_mas_can_dp;
145 op_blend_rel_span_funcs[SP_N][SM_AS][SC_AN][DP][CPU_C] = _op_blend_rel_mas_can_dp;
146 op_blend_rel_span_funcs[SP_N][SM_AS][SC_AA][DP][CPU_C] = _op_blend_rel_mas_caa_dp;
147
148 op_blend_rel_span_funcs[SP_N][SM_AS][SC][DP_AN][CPU_C] = _op_blend_rel_mas_c_dpan;
149 op_blend_rel_span_funcs[SP_N][SM_AS][SC_N][DP_AN][CPU_C] = _op_blend_rel_mas_cn_dpan;
150 op_blend_rel_span_funcs[SP_N][SM_AS][SC_AN][DP_AN][CPU_C] = _op_blend_rel_mas_can_dpan;
151 op_blend_rel_span_funcs[SP_N][SM_AS][SC_AA][DP_AN][CPU_C] = _op_blend_rel_mas_caa_dpan;
152}
153#endif
154
155#ifdef BUILD_C
156static void
157_op_blend_rel_pt_mas_c_dp(DATA32 s, DATA8 m, DATA32 c, DATA32 *d) {
158 s = MUL_SYM(m, c);
159 c = 256 - (s >> 24);
160 *d = MUL_SYM(*d >> 24, s) + MUL_256(c, *d);
161}
162
163#define _op_blend_rel_pt_mas_cn_dp _op_blend_rel_pt_mas_c_dp
164#define _op_blend_rel_pt_mas_can_dp _op_blend_rel_pt_mas_c_dp
165#define _op_blend_rel_pt_mas_caa_dp _op_blend_rel_pt_mas_c_dp
166
167#define _op_blend_rel_pt_mas_c_dpan _op_blend_pt_mas_c_dpan
168#define _op_blend_rel_pt_mas_cn_dpan _op_blend_pt_mas_cn_dpan
169#define _op_blend_rel_pt_mas_can_dpan _op_blend_pt_mas_can_dpan
170#define _op_blend_rel_pt_mas_caa_dpan _op_blend_pt_mas_caa_dpan
171
172static void
173init_blend_rel_mask_color_pt_funcs_c(void)
174{
175 op_blend_rel_pt_funcs[SP_N][SM_AS][SC][DP][CPU_C] = _op_blend_rel_pt_mas_c_dp;
176 op_blend_rel_pt_funcs[SP_N][SM_AS][SC_N][DP][CPU_C] = _op_blend_rel_pt_mas_cn_dp;
177 op_blend_rel_pt_funcs[SP_N][SM_AS][SC_AN][DP][CPU_C] = _op_blend_rel_pt_mas_can_dp;
178 op_blend_rel_pt_funcs[SP_N][SM_AS][SC_AA][DP][CPU_C] = _op_blend_rel_pt_mas_caa_dp;
179
180 op_blend_rel_pt_funcs[SP_N][SM_AS][SC][DP_AN][CPU_C] = _op_blend_rel_pt_mas_c_dpan;
181 op_blend_rel_pt_funcs[SP_N][SM_AS][SC_N][DP_AN][CPU_C] = _op_blend_rel_pt_mas_cn_dpan;
182 op_blend_rel_pt_funcs[SP_N][SM_AS][SC_AN][DP_AN][CPU_C] = _op_blend_rel_pt_mas_can_dpan;
183 op_blend_rel_pt_funcs[SP_N][SM_AS][SC_AA][DP_AN][CPU_C] = _op_blend_rel_pt_mas_caa_dpan;
184}
185#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_mask_color_i386.c b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_mask_color_i386.c
new file mode 100644
index 0000000..f8fe02e
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_mask_color_i386.c
@@ -0,0 +1,251 @@
1/* blend mask x color -> dst */
2
3#ifdef BUILD_MMX
4static void
5_op_blend_mas_c_dp_mmx(DATA32 *s __UNUSED__, DATA8 *m, DATA32 c, DATA32 *d, int l) {
6 DATA32 *e = d + l;
7 pxor_r2r(mm0, mm0);
8 MOV_A2R(ALPHA_256, mm6)
9 MOV_P2R(c, mm2, mm0)
10 c = 256 - (c >> 24);
11 MOV_A2R(c, mm4)
12 while (d < e) {
13 l = *m;
14 switch(l)
15 {
16 case 0:
17 break;
18 case 255:
19 MOV_P2R(*d, mm1, mm0)
20 MUL4_256_R2R(mm4, mm1)
21 paddw_r2r(mm2, mm1);
22 MOV_R2P(mm1, *d, mm0)
23 break;
24 default:
25 l++;
26 MOV_A2R(l, mm3)
27 MUL4_256_R2R(mm2, mm3)
28
29 MOV_RA2R(mm3, mm1)
30 movq_r2r(mm6, mm7);
31 psubw_r2r(mm1, mm7);
32
33 MOV_P2R(*d, mm1, mm0)
34 MUL4_256_R2R(mm7, mm1)
35
36 paddw_r2r(mm3, mm1);
37 MOV_R2P(mm1, *d, mm0)
38 break;
39 }
40 m++; d++;
41 }
42}
43
44static void
45_op_blend_mas_can_dp_mmx(DATA32 *s __UNUSED__, DATA8 *m, DATA32 c, DATA32 *d, int l) {
46 DATA32 *e = d + l;
47 pxor_r2r(mm0, mm0);
48 MOV_P2R(c, mm2, mm0)
49 MOV_A2R(ALPHA_255, mm5)
50 while (d < e) {
51 l = *m;
52 switch(l)
53 {
54 case 0:
55 break;
56 case 255:
57 *d = c;
58 break;
59 default:
60 l++;
61 MOV_A2R(l, mm3)
62 MOV_P2R(*d, mm1, mm0)
63 movq_r2r(mm2, mm4);
64 INTERP_256_R2R(mm3, mm4, mm1, mm5)
65 MOV_R2P(mm1, *d, mm0)
66 break;
67 }
68 m++; d++;
69 }
70}
71
72#define _op_blend_mas_cn_dp_mmx _op_blend_mas_can_dp_mmx
73#define _op_blend_mas_caa_dp_mmx _op_blend_mas_c_dp_mmx
74
75#define _op_blend_mas_c_dpan_mmx _op_blend_mas_c_dp_mmx
76#define _op_blend_mas_cn_dpan_mmx _op_blend_mas_cn_dp_mmx
77#define _op_blend_mas_can_dpan_mmx _op_blend_mas_can_dp_mmx
78#define _op_blend_mas_caa_dpan_mmx _op_blend_mas_caa_dp_mmx
79
80static void
81init_blend_mask_color_span_funcs_mmx(void)
82{
83 op_blend_span_funcs[SP_N][SM_AS][SC][DP][CPU_MMX] = _op_blend_mas_c_dp_mmx;
84 op_blend_span_funcs[SP_N][SM_AS][SC_N][DP][CPU_MMX] = _op_blend_mas_cn_dp_mmx;
85 op_blend_span_funcs[SP_N][SM_AS][SC_AN][DP][CPU_MMX] = _op_blend_mas_can_dp_mmx;
86 op_blend_span_funcs[SP_N][SM_AS][SC_AA][DP][CPU_MMX] = _op_blend_mas_caa_dp_mmx;
87
88 op_blend_span_funcs[SP_N][SM_AS][SC][DP_AN][CPU_MMX] = _op_blend_mas_c_dpan_mmx;
89 op_blend_span_funcs[SP_N][SM_AS][SC_N][DP_AN][CPU_MMX] = _op_blend_mas_cn_dpan_mmx;
90 op_blend_span_funcs[SP_N][SM_AS][SC_AN][DP_AN][CPU_MMX] = _op_blend_mas_can_dpan_mmx;
91 op_blend_span_funcs[SP_N][SM_AS][SC_AA][DP_AN][CPU_MMX] = _op_blend_mas_caa_dpan_mmx;
92}
93#endif
94
95#ifdef BUILD_MMX
96static void
97_op_blend_pt_mas_c_dp_mmx(DATA32 s, DATA8 m, DATA32 c, DATA32 *d) {
98 s = m + 1;
99 MOV_A2R(s, mm3)
100 MOV_A2R(ALPHA_256, mm6)
101 pxor_r2r(mm0, mm0);
102 MOV_P2R(c, mm2, mm0)
103 MUL4_256_R2R(mm2, mm3)
104
105 MOV_RA2R(mm3, mm1)
106 psubw_r2r(mm1, mm6);
107
108 MOV_P2R(*d, mm1, mm0)
109 MUL4_256_R2R(mm6, mm1)
110
111 paddw_r2r(mm3, mm1);
112 MOV_R2P(mm1, *d, mm0)
113}
114
115
116#define _op_blend_pt_mas_cn_dp_mmx _op_blend_pt_mas_c_dp_mmx
117#define _op_blend_pt_mas_can_dp_mmx _op_blend_pt_mas_c_dp_mmx
118#define _op_blend_pt_mas_caa_dp_mmx _op_blend_pt_mas_c_dp_mmx
119
120#define _op_blend_pt_mas_c_dpan_mmx _op_blend_pt_mas_c_dp_mmx
121#define _op_blend_pt_mas_cn_dpan_mmx _op_blend_pt_mas_cn_dp_mmx
122#define _op_blend_pt_mas_can_dpan_mmx _op_blend_pt_mas_can_dp_mmx
123#define _op_blend_pt_mas_caa_dpan_mmx _op_blend_pt_mas_caa_dp_mmx
124
125static void
126init_blend_mask_color_pt_funcs_mmx(void)
127{
128 op_blend_pt_funcs[SP_N][SM_AS][SC][DP][CPU_MMX] = _op_blend_pt_mas_c_dp_mmx;
129 op_blend_pt_funcs[SP_N][SM_AS][SC_N][DP][CPU_MMX] = _op_blend_pt_mas_cn_dp_mmx;
130 op_blend_pt_funcs[SP_N][SM_AS][SC_AN][DP][CPU_MMX] = _op_blend_pt_mas_can_dp_mmx;
131 op_blend_pt_funcs[SP_N][SM_AS][SC_AA][DP][CPU_MMX] = _op_blend_pt_mas_caa_dp_mmx;
132
133 op_blend_pt_funcs[SP_N][SM_AS][SC][DP_AN][CPU_MMX] = _op_blend_pt_mas_c_dpan_mmx;
134 op_blend_pt_funcs[SP_N][SM_AS][SC_N][DP_AN][CPU_MMX] = _op_blend_pt_mas_cn_dpan_mmx;
135 op_blend_pt_funcs[SP_N][SM_AS][SC_AN][DP_AN][CPU_MMX] = _op_blend_pt_mas_can_dpan_mmx;
136 op_blend_pt_funcs[SP_N][SM_AS][SC_AA][DP_AN][CPU_MMX] = _op_blend_pt_mas_caa_dpan_mmx;
137}
138#endif
139
140/*-----*/
141
142/* blend_rel mask x color -> dst */
143
144#ifdef BUILD_MMX
145static void
146_op_blend_rel_mas_c_dp_mmx(DATA32 *s __UNUSED__, DATA8 *m, DATA32 c, DATA32 *d, int l) {
147 DATA32 *e = d + l;
148 pxor_r2r(mm0, mm0);
149 MOV_A2R(ALPHA_256, mm6)
150 MOV_A2R(ALPHA_255, mm5)
151 MOV_P2R(c, mm2, mm0)
152 while (d < e) {
153 l = *m;
154 switch(l)
155 {
156 case 0:
157 break;
158 default:
159 l++;
160 MOV_A2R(l, mm3)
161 MUL4_256_R2R(mm2, mm3)
162
163 MOV_RA2R(mm3, mm1)
164 movq_r2r(mm6, mm7);
165 psubw_r2r(mm1, mm7);
166
167 MOV_P2R(*d, mm1, mm0)
168 MOV_RA2R(mm1, mm4)
169 MUL4_256_R2R(mm7, mm1)
170
171 MUL4_SYM_R2R(mm4, mm3, mm5)
172
173 paddw_r2r(mm3, mm1);
174 MOV_R2P(mm1, *d, mm0)
175 break;
176 }
177 m++; d++;
178 }
179}
180
181#define _op_blend_rel_mas_cn_dp_mmx _op_blend_rel_mas_c_dp_mmx
182#define _op_blend_rel_mas_can_dp_mmx _op_blend_rel_mas_c_dp_mmx
183#define _op_blend_rel_mas_caa_dp_mmx _op_blend_rel_mas_c_dp_mmx
184
185#define _op_blend_rel_mas_c_dpan_mmx _op_blend_mas_c_dpan_mmx
186#define _op_blend_rel_mas_cn_dpan_mmx _op_blend_mas_cn_dpan_mmx
187#define _op_blend_rel_mas_can_dpan_mmx _op_blend_mas_can_dpan_mmx
188#define _op_blend_rel_mas_caa_dpan_mmx _op_blend_mas_caa_dpan_mmx
189
190static void
191init_blend_rel_mask_color_span_funcs_mmx(void)
192{
193 op_blend_rel_span_funcs[SP_N][SM_AS][SC][DP][CPU_MMX] = _op_blend_rel_mas_c_dp_mmx;
194 op_blend_rel_span_funcs[SP_N][SM_AS][SC_N][DP][CPU_MMX] = _op_blend_rel_mas_cn_dp_mmx;
195 op_blend_rel_span_funcs[SP_N][SM_AS][SC_AN][DP][CPU_MMX] = _op_blend_rel_mas_can_dp_mmx;
196 op_blend_rel_span_funcs[SP_N][SM_AS][SC_AA][DP][CPU_MMX] = _op_blend_rel_mas_caa_dp_mmx;
197
198 op_blend_rel_span_funcs[SP_N][SM_AS][SC][DP_AN][CPU_MMX] = _op_blend_rel_mas_c_dpan_mmx;
199 op_blend_rel_span_funcs[SP_N][SM_AS][SC_N][DP_AN][CPU_MMX] = _op_blend_rel_mas_cn_dpan_mmx;
200 op_blend_rel_span_funcs[SP_N][SM_AS][SC_AN][DP_AN][CPU_MMX] = _op_blend_rel_mas_can_dpan_mmx;
201 op_blend_rel_span_funcs[SP_N][SM_AS][SC_AA][DP_AN][CPU_MMX] = _op_blend_rel_mas_caa_dpan_mmx;
202}
203#endif
204
205#ifdef BUILD_MMX
206static void
207_op_blend_rel_pt_mas_c_dp_mmx(DATA32 s, DATA8 m, DATA32 c, DATA32 *d) {
208 pxor_r2r(mm0, mm0);
209 MOV_A2R(ALPHA_256, mm6)
210 MOV_A2R(ALPHA_255, mm5)
211 s = m + 1;
212 MOV_A2R(s, mm3)
213 MOV_P2R(c, mm2, mm0)
214 MUL4_256_R2R(mm2, mm3)
215
216 MOV_RA2R(mm3, mm1)
217 psubw_r2r(mm1, mm6);
218
219 MOV_P2R(*d, mm1, mm0)
220 MOV_RA2R(mm1, mm4)
221 MUL4_256_R2R(mm6, mm1)
222
223 MUL4_SYM_R2R(mm4, mm3, mm5)
224
225 paddw_r2r(mm3, mm1);
226 MOV_R2P(mm1, *d, mm0)
227}
228
229#define _op_blend_rel_pt_mas_cn_dp_mmx _op_blend_rel_pt_mas_c_dp_mmx
230#define _op_blend_rel_pt_mas_can_dp_mmx _op_blend_rel_pt_mas_c_dp_mmx
231#define _op_blend_rel_pt_mas_caa_dp_mmx _op_blend_rel_pt_mas_c_dp_mmx
232
233#define _op_blend_rel_pt_mas_c_dpan_mmx _op_blend_pt_mas_c_dpan_mmx
234#define _op_blend_rel_pt_mas_cn_dpan_mmx _op_blend_pt_mas_cn_dpan_mmx
235#define _op_blend_rel_pt_mas_can_dpan_mmx _op_blend_pt_mas_can_dpan_mmx
236#define _op_blend_rel_pt_mas_caa_dpan_mmx _op_blend_pt_mas_caa_dpan_mmx
237
238static void
239init_blend_rel_mask_color_pt_funcs_mmx(void)
240{
241 op_blend_rel_pt_funcs[SP_N][SM_AS][SC][DP][CPU_MMX] = _op_blend_rel_pt_mas_c_dp_mmx;
242 op_blend_rel_pt_funcs[SP_N][SM_AS][SC_N][DP][CPU_MMX] = _op_blend_rel_pt_mas_cn_dp_mmx;
243 op_blend_rel_pt_funcs[SP_N][SM_AS][SC_AN][DP][CPU_MMX] = _op_blend_rel_pt_mas_can_dp_mmx;
244 op_blend_rel_pt_funcs[SP_N][SM_AS][SC_AA][DP][CPU_MMX] = _op_blend_rel_pt_mas_caa_dp_mmx;
245
246 op_blend_rel_pt_funcs[SP_N][SM_AS][SC][DP_AN][CPU_MMX] = _op_blend_rel_pt_mas_c_dpan_mmx;
247 op_blend_rel_pt_funcs[SP_N][SM_AS][SC_N][DP_AN][CPU_MMX] = _op_blend_rel_pt_mas_cn_dpan_mmx;
248 op_blend_rel_pt_funcs[SP_N][SM_AS][SC_AN][DP_AN][CPU_MMX] = _op_blend_rel_pt_mas_can_dpan_mmx;
249 op_blend_rel_pt_funcs[SP_N][SM_AS][SC_AA][DP_AN][CPU_MMX] = _op_blend_rel_pt_mas_caa_dpan_mmx;
250}
251#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_mask_color_neon.c b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_mask_color_neon.c
new file mode 100644
index 0000000..f5eb480
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_mask_color_neon.c
@@ -0,0 +1,562 @@
1#define NEONDEBUG 0
2
3
4#if NEONDEBUG
5#define DEBUG_FNCOUNT(x) \
6 do { \
7 static int _foo = 0; \
8 if (_foo++%10000 ==0) \
9 printf("%s %+d %s: %d (%s)\n",__FILE__,__LINE__,__FUNCTION__,\
10 _foo, x " optimised");\
11 } while (0)
12#else
13#define DEBUG_FNCOUNT(x) ((void)x)
14#endif
15
16
17/* blend mask x color -> dst */
18
19#ifdef BUILD_NEON
20static void
21_op_blend_mas_c_dp_neon(DATA32 *s __UNUSED__, DATA8 *m, DATA32 c, DATA32 *d, int l) {
22 DATA32 *e;
23
24 DEBUG_FNCOUNT("");
25
26#define AP "blend_mas_c_dp_"
27 asm volatile (
28 ".fpu neon \n\t"
29 " vdup.i32 q15, %[c] \n\t"
30 " vmov.i8 q14, #1 \n\t"
31
32 // If aligned already - straight to quads
33 " andS %[tmp], %[d],$0xf \n\t"
34 " beq "AP"quadloops \n\t"
35
36 " andS %[tmp], %[d],$0x4 \n\t"
37 " beq "AP"dualloop \n\t"
38
39 AP"singleloop: \n\t"
40 " vld1.8 d0[0], [%[m]]! \n\t"
41 " vld1.32 d4[0], [%[d]] \n\t"
42 " vdup.u8 d0, d0[0] \n\t"
43 " vmull.u8 q4, d0, d30 \n\t"
44 " vqrshrn.u16 d12, q4, #8 \n\t"
45 " vmvn.u16 d14, d12 \n\t"
46 " vshr.u32 d16, d14, #24 \n\t"
47 " vmul.u32 d16, d16, d28 \n\t"
48 " vmull.u8 q7, d16, d4 \n\t"
49 " vqrshrn.u16 d0, q7, #8 \n\t"
50 " vqadd.u8 d0, d0, d12 \n\t"
51 " vst1.32 d0[0], [%[d]]! \n\t"
52
53 // Can we go the fast path?
54 " andS %[tmp], %[d],$0xf \n\t"
55 " beq "AP"quadloops \n\t"
56
57 AP"dualloop: \n\t"
58 " sub %[tmp], %[e], %[d] \n\t"
59 " cmp %[tmp], #16 \n\t"
60 " blt "AP"loopout \n\t"
61
62 " vld1.16 d0[0], [%[m]]! \n\t"
63 " vldm %[d], {d4} \n\t"
64 " vmovl.u8 q0, d0 \n\t"
65 " vmovl.u8 q0, d0 \n\t"
66 " vmul.u32 q0, q14 \n\t"
67 " vmull.u8 q4, d0, d30 \n\t"
68 " vqrshrn.u16 d12, q4, #8 \n\t"
69 " vmvn.u16 d14, d12 \n\t"
70 " vshr.u32 d16, d14, #24 \n\t"
71 " vmul.u32 d16, d16, d28 \n\t"
72 " vmull.u8 q7, d16, d4 \n\t"
73 " vqrshrn.u16 d0, q7, #8 \n\t"
74 " vqadd.u8 q0, q0, q6 \n\t"
75 " vstm %[d]!, {d0} \n\t"
76
77 AP"quadloops: \n\t"
78 " sub %[tmp], %[e], %[d] \n\t"
79 " cmp %[tmp], #16 \n\t"
80 " blt "AP"loopout \n\t"
81
82
83 " sub %[tmp], %[e], #15 \n\t"
84
85 " sub %[d], #16 \n\t"
86 AP"fastloop:"
87 " add %[d], #16 \n\t"
88 " cmp %[tmp], %[d] \n\t"
89 " ble "AP"loopout \n\t"
90 AP"quadloopint: \n\t"
91 " ldr %[x], [%[m]] \n\t"
92 " add %[m], #4 \n\t"
93 " cmp %[x], #0 \n\t"
94 " beq "AP"fastloop \n\t"
95 " vmov.32 d0[0], %[x] \n\t"
96 " vldm %[d], {d4,d5} \n\t"
97
98 // Expand M: Fixme: Can we do this quicker?
99 " vmovl.u8 q0, d0 \n\t"
100 " vmovl.u8 q0, d0 \n\t"
101 " vmul.u32 q0, q14 \n\t"
102
103 // Multiply a * c
104 " vmull.u8 q4, d0, d30 \n\t"
105 " vmull.u8 q5, d1, d31 \n\t"
106
107 // Shorten
108 " vqrshrn.u16 d12, q4, #8 \n\t"
109 " vqrshrn.u16 d13, q5, #8 \n\t"
110
111 // extract negated alpha
112 " vmvn.u16 q7, q6 \n\t"
113 " vshr.u32 q8, q7, #24 \n\t"
114 " vmul.u32 q8, q8, q14 \n\t"
115
116 // Multiply
117 " vmull.u8 q7, d16, d4 \n\t"
118 " vmull.u8 q8, d17, d5 \n\t"
119
120 " vqrshrn.u16 d0, q7, #8 \n\t"
121 " vqrshrn.u16 d1, q8, #8 \n\t"
122
123 // Add
124 " vqadd.u8 q0, q0, q6 \n\t"
125
126 " vstm %[d]!, {d0,d1} \n\t"
127
128 " cmp %[tmp], %[d] \n\t"
129 " bhi "AP"quadloopint \n\t"
130
131 AP"loopout: \n\t"
132#if NEONDEBUG
133 "cmp %[d], %[e] \n\t"
134 "ble "AP"foo \n\t"
135 "cmp %[tmp], %[m] \n\t"
136 "sub %[x], %[x] \n\t"
137 "vst1.32 d0[0], [%[x]] \n\t"
138 AP"foo: \n\t"
139#endif
140
141 " cmp %[d], %[e] \n\t"
142 " beq "AP"done \n\t"
143 " sub %[tmp],%[e], %[d] \n\t"
144 " cmp %[tmp],#4 \n\t"
145 " beq "AP"singleout \n\t"
146
147 AP "dualloop2: \n\t"
148 "sub %[tmp],%[e],$0x8 \n\t"
149 " vld1.16 d0[0], [%[m]]! \n\t"
150 " vldm %[d], {d4} \n\t"
151 " vmovl.u8 q0, d0 \n\t"
152 " vmovl.u8 q0, d0 \n\t"
153 " vmul.u32 q0, q14 \n\t"
154 " vmull.u8 q4, d0, d30 \n\t"
155 " vqrshrn.u16 d12, q4, #8 \n\t"
156 " vmvn.u16 d14, d12 \n\t"
157 " vshr.u32 d16, d14, #24 \n\t"
158 " vmul.u32 d16, d16, d28 \n\t"
159 " vmull.u8 q7, d16, d4 \n\t"
160 " vqrshrn.u16 d0, q7, #8 \n\t"
161 " vqadd.u8 q0, q0, q6 \n\t"
162 " vstm %[d]!, {d0} \n\t"
163
164 " cmp %[e], %[d] \n\t"
165 " beq "AP"done \n\t"
166
167 AP"singleout: \n\t"
168 " vld1.8 d0[0], [%[m]]! \n\t"
169 " vld1.32 d4[0], [%[d]] \n\t"
170 " vdup.u8 d0, d0[0] \n\t"
171 " vmull.u8 q4, d0, d30 \n\t"
172 " vqrshrn.u16 d12, q4, #8 \n\t"
173 " vmvn.u16 d14, d12 \n\t"
174 " vshr.u32 d16, d14, #24 \n\t"
175 " vmul.u32 d16, d16, d28 \n\t"
176 " vmull.u8 q7, d16, d4 \n\t"
177 " vqrshrn.u16 d0, q7, #8 \n\t"
178 " vqadd.u8 q0, q0, q6 \n\t"
179 " vst1.32 d0[0], [%[d]]! \n\t"
180
181 AP"done: \n\t"
182#if NEONDEBUG
183 "cmp %[d], %[e] \n\t"
184 "beq "AP"reallydone \n\t"
185 "sub %[tmp], %[tmp] \n\t"
186 "vst1.32 d0[0], [%[tmp]] \n\t"
187 AP"reallydone:"
188#endif
189 : // Out
190 : [e] "r" (d + l), [d] "r" (d), [c] "r" (c),
191 [tmp] "r" (7), [m] "r" (m), [x] "r" (0)
192 : "q0", "q1", "q2","q3", "q4","q5","q6", "q7","q8","q14","q15",
193 "memory" // clobbered
194 );
195#undef AP
196}
197#endif
198
199#ifdef BUILD_NEON
200static void
201_op_blend_mas_can_dp_neon(DATA32 *s __UNUSED__, DATA8 *m, DATA32 c, DATA32 *d, int l) {
202 DATA32 *e,*tmp;
203 int alpha;
204
205 DEBUG_FNCOUNT("");
206
207#define AP "_blend_mas_can_dp_neon_"
208 asm volatile (
209 ".fpu neon \n\t"
210 "vdup.u32 q9, %[c] \n\t"
211 "vmov.i8 q15, #1 \n\t"
212 "vmov.i8 q14, #0 \n\t"
213
214 // Make C 16 bit (C in q3/q2)
215 "vmovl.u8 q3, d19 \n\t"
216 "vmovl.u8 q2, d18 \n\t"
217
218 // Which loop to start
219 " andS %[tmp], %[d],$0xf \n\t"
220 " beq "AP"quadloop \n\t"
221
222 " andS %[tmp], %[d], #4 \n\t"
223 " beq "AP"dualstart \n\t"
224
225
226 AP"singleloop: \n\t"
227 " vld1.8 d0[0], [%[m]]! \n\t"
228 " vld1.32 d8[0], [%[d]] \n\t"
229 " vdup.u8 d0, d0[0] \n\t"
230 " vshr.u8 d0, d0, #1 \n\t"
231 " vmovl.u8 q0, d0 \n\t"
232 " vmovl.u8 q4, d8 \n\t"
233 " vsub.s16 q6, q2, q4 \n\t"
234 " vmul.s16 q6, q0 \n\t"
235 " vshr.s16 q6, #7 \n\t"
236 " vadd.s16 q6, q4 \n\t"
237 " vqmovun.s16 d2, q6 \n\t"
238 " vst1.32 d2[0], [%[d]]! \n\t"
239
240 " andS %[tmp], %[d], $0xf \n\t"
241 " beq "AP"quadloop \n\t"
242
243 AP"dualstart: \n\t"
244 " sub %[tmp], %[e], %[d] \n\t"
245 " cmp %[tmp], #16 \n\t"
246 " blt "AP"loopout \n\t"
247
248 AP"dualloop: \n\t"
249 " vld1.16 d0[0], [%[m]]! \n\t"
250 " vldm %[d], {d8} \n\t"
251 " vmovl.u8 q0, d0 \n\t"
252 " vmovl.u8 q0, d0 \n\t"
253 " vmul.u32 d0, d0, d30 \n\t"
254 " vshr.u8 d0, d0, #1 \n\t"
255 " vmovl.u8 q0, d0 \n\t"
256 " vmovl.u8 q4, d8 \n\t"
257 " vsub.s16 q6, q2, q4 \n\t"
258 " vmul.s16 q6, q0 \n\t"
259 " vshr.s16 q6, #7 \n\t"
260 " vadd.s16 q6, q4 \n\t"
261 " vqmovun.s16 d2, q6 \n\t"
262 " vstm %[d]!, {d2} \n\t"
263
264 AP"quadloop: \n\t"
265 " sub %[tmp], %[e], %[d] \n\t"
266 " cmp %[tmp], #16 \n\t"
267 " blt "AP"loopout \n\t"
268 " sub %[tmp], %[e], #15 \n\t"
269
270 " sub %[d], #16 \n\t"
271 AP"fastloop: \n\t"
272 " add %[d], #16 \n\t"
273 " cmp %[tmp], %[d] \n\t"
274 " blt "AP"loopout \n\t"
275
276 AP"quadloopint: \n\t"
277 // Load the mask: 4 bytes: It has d0/d1
278 " ldr %[x], [%[m]] \n\t"
279 " add %[m], #4 \n\t"
280
281 // Check for shortcuts
282 " cmp %[x], #0 \n\t"
283 " beq "AP"fastloop \n\t"
284
285 " cmp %[x], $0xffffffff \n\t"
286 " beq "AP"quadstore \n\t"
287
288 " vmov.32 d0[0], %[x] \n\t"
289 // Load d into d8/d9 q4
290 " vldm %[d], {d8,d9} \n\t"
291
292 // Get the alpha channel ready (m)
293 " vmovl.u8 q0, d0 \n\t"
294 " vmovl.u8 q0, d0 \n\t"
295 " vmul.u32 q0, q0,q15 \n\t"
296 // Lop a bit off to prevent overflow
297 " vshr.u8 q0, q0, #1 \n\t"
298
299 // Now make it 16 bit
300 " vmovl.u8 q1, d1 \n\t"
301 " vmovl.u8 q0, d0 \n\t"
302
303 // 16 bit 'd'
304 " vmovl.u8 q5, d9 \n\t"
305 " vmovl.u8 q4, d8 \n\t"
306
307 // Diff 'd' & 'c'
308 " vsub.s16 q7, q3, q5 \n\t"
309 " vsub.s16 q6, q2, q4 \n\t"
310
311 " vmul.s16 q7, q1 \n\t"
312 " vmul.s16 q6, q0 \n\t"
313
314 // Shift results a bit
315 " vshr.s16 q7, #7 \n\t"
316 " vshr.s16 q6, #7 \n\t"
317
318 // Add 'd'
319 " vadd.s16 q7, q5 \n\t"
320 " vadd.s16 q6, q4 \n\t"
321
322 // Make sure none are negative
323 " vqmovun.s16 d9, q7 \n\t"
324 " vqmovun.s16 d8, q6 \n\t"
325
326 " vstm %[d]!, {d8,d9} \n\t"
327
328 " cmp %[tmp], %[d] \n\t"
329 " bhi "AP"quadloopint \n\t"
330 " b "AP"loopout \n\t"
331
332 AP"quadstore: \n\t"
333 " vstm %[d]!, {d18,d19} \n\t"
334 " cmp %[tmp], %[d] \n\t"
335 " bhi "AP"quadloopint \n\t"
336
337 AP"loopout: \n\t"
338#if NEONDEBUG
339 "cmp %[d], %[e] \n\t"
340 "ble "AP"foo \n\t"
341 "sub %[tmp], %[tmp] \n\t"
342 "vst1.32 d0[0], [%[tmp]] \n\t"
343 AP"foo: \n\t"
344#endif
345
346 " cmp %[e], %[d] \n\t"
347 " beq "AP"done \n\t"
348
349 " sub %[tmp],%[e], %[d] \n\t"
350 " cmp %[tmp],#8 \n\t"
351
352 " blt "AP"onebyte \n\t"
353
354 // Load the mask: 2 bytes: It has d0
355 " vld1.16 d0[0], [%[m]]! \n\t"
356
357 // Load d into d8/d9 q4
358 " vldm %[d], {d8} \n\t"
359
360 // Get the alpha channel ready (m)
361 " vmovl.u8 q0, d0 \n\t"
362 " vmovl.u8 q0, d0 \n\t"
363 " vmul.u32 d0, d0, d30 \n\t"
364 // Lop a bit off to prevent overflow
365 " vshr.u8 d0, d0, #1 \n\t"
366
367 // Now make it 16 bit
368 " vmovl.u8 q0, d0 \n\t"
369
370 // 16 bit 'd'
371 " vmovl.u8 q4, d8 \n\t"
372
373 // Diff 'd' & 'c'
374 " vsub.s16 q6, q2, q4 \n\t"
375
376 " vmul.s16 q6, q0 \n\t"
377
378 // Shift results a bit
379 " vshr.s16 q6, #7 \n\t"
380
381 // Add 'd'
382 "vadd.s16 q6, q4 \n\t"
383
384 // Make sure none are negative
385 "vqmovun.s16 d2, q6 \n\t"
386
387 "vstm %[d]!, {d2} \n\t"
388
389 "cmp %[e], %[d] \n\t"
390 "beq "AP"done \n\t"
391
392 AP"onebyte: \n\t"
393 "vld1.8 d0[0], [%[m]]! \n\t"
394 "vld1.32 d8[0], [%[d]] \n\t"
395 "vdup.u8 d0, d0[0] \n\t"
396 "vshr.u8 d0, d0, #1 \n\t"
397 "vmovl.u8 q0, d0 \n\t"
398 "vmovl.u8 q4, d8 \n\t"
399 "vsub.s16 q6, q2, q4 \n\t"
400 "vmul.s16 q6, q0 \n\t"
401 "vshr.s16 q6, #7 \n\t"
402 "vadd.s16 q6, q4 \n\t"
403 "vqmovun.s16 d2, q6 \n\t"
404 "vst1.32 d2[0], [%[d]]! \n\t"
405
406
407 AP"done: \n\t"
408#if NEONDEBUG
409 "cmp %[d], %[e] \n\t"
410 "beq "AP"reallydone \n\t"
411 "sub %[m], %[m] \n\t"
412 "vst1.32 d0[0], [%[m]] \n\t"
413 AP"reallydone:"
414#endif
415
416
417 : // output regs
418 // Input
419 : [e] "r" (e = d + l), [d] "r" (d), [c] "r" (c),
420 [m] "r" (m), [tmp] "r" (7), [x] "r" (33)
421 : "q0", "q1", "q2","q3", "q4","q5","q6", "q7","q9","q14","q15",
422 "memory" // clobbered
423
424 );
425#undef AP
426}
427#endif
428
429#ifdef BUILD_NEON
430#define _op_blend_mas_cn_dp_neon _op_blend_mas_can_dp_neon
431#define _op_blend_mas_caa_dp_neon _op_blend_mas_c_dp_neon
432
433#define _op_blend_mas_c_dpan_neon _op_blend_mas_c_dp_neon
434#define _op_blend_mas_cn_dpan_neon _op_blend_mas_cn_dp_neon
435#define _op_blend_mas_can_dpan_neon _op_blend_mas_can_dp_neon
436#define _op_blend_mas_caa_dpan_neon _op_blend_mas_caa_dp_neon
437
438static void
439init_blend_mask_color_span_funcs_neon(void)
440{
441 op_blend_span_funcs[SP_N][SM_AS][SC][DP][CPU_NEON] = _op_blend_mas_c_dp_neon;
442 op_blend_span_funcs[SP_N][SM_AS][SC_N][DP][CPU_NEON] = _op_blend_mas_cn_dp_neon;
443 op_blend_span_funcs[SP_N][SM_AS][SC_AN][DP][CPU_NEON] = _op_blend_mas_can_dp_neon;
444 op_blend_span_funcs[SP_N][SM_AS][SC_AA][DP][CPU_NEON] = _op_blend_mas_caa_dp_neon;
445
446 op_blend_span_funcs[SP_N][SM_AS][SC][DP_AN][CPU_NEON] = _op_blend_mas_c_dpan_neon;
447 op_blend_span_funcs[SP_N][SM_AS][SC_N][DP_AN][CPU_NEON] = _op_blend_mas_cn_dpan_neon;
448 op_blend_span_funcs[SP_N][SM_AS][SC_AN][DP_AN][CPU_NEON] = _op_blend_mas_can_dpan_neon;
449 op_blend_span_funcs[SP_N][SM_AS][SC_AA][DP_AN][CPU_NEON] = _op_blend_mas_caa_dpan_neon;
450}
451#endif
452
453#ifdef BUILD_NEON
454static void
455_op_blend_pt_mas_c_dp_neon(DATA32 s, DATA8 m, DATA32 c, DATA32 *d) {
456 s = MUL_SYM(m, c);
457 c = 256 - (s >> 24);
458 *d = MUL_SYM(*d >> 24, s) + MUL_256(c, *d);
459}
460
461
462#define _op_blend_pt_mas_cn_dp_neon _op_blend_pt_mas_c_dp_neon
463#define _op_blend_pt_mas_can_dp_neon _op_blend_pt_mas_c_dp_neon
464#define _op_blend_pt_mas_caa_dp_neon _op_blend_pt_mas_c_dp_neon
465
466#define _op_blend_pt_mas_c_dpan_neon _op_blend_pt_mas_c_dp_neon
467#define _op_blend_pt_mas_cn_dpan_neon _op_blend_pt_mas_cn_dp_neon
468#define _op_blend_pt_mas_can_dpan_neon _op_blend_pt_mas_can_dp_neon
469#define _op_blend_pt_mas_caa_dpan_neon _op_blend_pt_mas_caa_dp_neon
470
471static void
472init_blend_mask_color_pt_funcs_neon(void)
473{
474 op_blend_pt_funcs[SP_N][SM_AS][SC][DP][CPU_NEON] = _op_blend_pt_mas_c_dp_neon;
475 op_blend_pt_funcs[SP_N][SM_AS][SC_N][DP][CPU_NEON] = _op_blend_pt_mas_cn_dp_neon;
476 op_blend_pt_funcs[SP_N][SM_AS][SC_AN][DP][CPU_NEON] = _op_blend_pt_mas_can_dp_neon;
477 op_blend_pt_funcs[SP_N][SM_AS][SC_AA][DP][CPU_NEON] = _op_blend_pt_mas_caa_dp_neon;
478
479 op_blend_pt_funcs[SP_N][SM_AS][SC][DP_AN][CPU_NEON] = _op_blend_pt_mas_c_dpan_neon;
480 op_blend_pt_funcs[SP_N][SM_AS][SC_N][DP_AN][CPU_NEON] = _op_blend_pt_mas_cn_dpan_neon;
481 op_blend_pt_funcs[SP_N][SM_AS][SC_AN][DP_AN][CPU_NEON] = _op_blend_pt_mas_can_dpan_neon;
482 op_blend_pt_funcs[SP_N][SM_AS][SC_AA][DP_AN][CPU_NEON] = _op_blend_pt_mas_caa_dpan_neon;
483}
484#endif
485
486/*-----*/
487
488/* blend_rel mask x color -> dst */
489
490#ifdef BUILD_NEON
491static void
492_op_blend_rel_mas_c_dp_neon(DATA32 *s __UNUSED__, DATA8 *m, DATA32 c, DATA32 *d, int l) {
493 DATA32 *e;
494 int alpha;
495
496 DEBUG_FNCOUNT("not");
497
498 UNROLL8_PLD_WHILE(d, l, e,
499 {
500 DATA32 mc = MUL_SYM(*m, c);
501 alpha = 256 - (mc >> 24);
502 *d = MUL_SYM(*d >> 24, mc) + MUL_256(alpha, *d);
503 d++;
504 m++;
505 });
506}
507
508#define _op_blend_rel_mas_cn_dp_neon _op_blend_rel_mas_c_dp_neon
509#define _op_blend_rel_mas_can_dp_neon _op_blend_rel_mas_c_dp_neon
510#define _op_blend_rel_mas_caa_dp_neon _op_blend_rel_mas_c_dp_neon
511
512#define _op_blend_rel_mas_c_dpan_neon _op_blend_mas_c_dpan_neon
513#define _op_blend_rel_mas_cn_dpan_neon _op_blend_mas_cn_dpan_neon
514#define _op_blend_rel_mas_can_dpan_neon _op_blend_mas_can_dpan_neon
515#define _op_blend_rel_mas_caa_dpan_neon _op_blend_mas_caa_dpan_neon
516
517static void
518init_blend_rel_mask_color_span_funcs_neon(void)
519{
520 op_blend_rel_span_funcs[SP_N][SM_AS][SC][DP][CPU_NEON] = _op_blend_rel_mas_c_dp_neon;
521 op_blend_rel_span_funcs[SP_N][SM_AS][SC_N][DP][CPU_NEON] = _op_blend_rel_mas_cn_dp_neon;
522 op_blend_rel_span_funcs[SP_N][SM_AS][SC_AN][DP][CPU_NEON] = _op_blend_rel_mas_can_dp_neon;
523 op_blend_rel_span_funcs[SP_N][SM_AS][SC_AA][DP][CPU_NEON] = _op_blend_rel_mas_caa_dp_neon;
524
525 op_blend_rel_span_funcs[SP_N][SM_AS][SC][DP_AN][CPU_NEON] = _op_blend_rel_mas_c_dpan_neon;
526 op_blend_rel_span_funcs[SP_N][SM_AS][SC_N][DP_AN][CPU_NEON] = _op_blend_rel_mas_cn_dpan_neon;
527 op_blend_rel_span_funcs[SP_N][SM_AS][SC_AN][DP_AN][CPU_NEON] = _op_blend_rel_mas_can_dpan_neon;
528 op_blend_rel_span_funcs[SP_N][SM_AS][SC_AA][DP_AN][CPU_NEON] = _op_blend_rel_mas_caa_dpan_neon;
529}
530#endif
531
532#ifdef BUILD_NEON
533static void
534_op_blend_rel_pt_mas_c_dp_neon(DATA32 s, DATA8 m, DATA32 c, DATA32 *d) {
535 s = MUL_SYM(m, c);
536 c = 256 - (s >> 24);
537 *d = MUL_SYM(*d >> 24, s) + MUL_256(c, *d);
538}
539
540#define _op_blend_rel_pt_mas_cn_dp_neon _op_blend_rel_pt_mas_c_dp_neon
541#define _op_blend_rel_pt_mas_can_dp_neon _op_blend_rel_pt_mas_c_dp_neon
542#define _op_blend_rel_pt_mas_caa_dp_neon _op_blend_rel_pt_mas_c_dp_neon
543
544#define _op_blend_rel_pt_mas_c_dpan_neon _op_blend_pt_mas_c_dpan_neon
545#define _op_blend_rel_pt_mas_cn_dpan_neon _op_blend_pt_mas_cn_dpan_neon
546#define _op_blend_rel_pt_mas_can_dpan_neon _op_blend_pt_mas_can_dpan_neon
547#define _op_blend_rel_pt_mas_caa_dpan_neon _op_blend_pt_mas_caa_dpan_neon
548
549static void
550init_blend_rel_mask_color_pt_funcs_neon(void)
551{
552 op_blend_rel_pt_funcs[SP_N][SM_AS][SC][DP][CPU_NEON] = _op_blend_rel_pt_mas_c_dp_neon;
553 op_blend_rel_pt_funcs[SP_N][SM_AS][SC_N][DP][CPU_NEON] = _op_blend_rel_pt_mas_cn_dp_neon;
554 op_blend_rel_pt_funcs[SP_N][SM_AS][SC_AN][DP][CPU_NEON] = _op_blend_rel_pt_mas_can_dp_neon;
555 op_blend_rel_pt_funcs[SP_N][SM_AS][SC_AA][DP][CPU_NEON] = _op_blend_rel_pt_mas_caa_dp_neon;
556
557 op_blend_rel_pt_funcs[SP_N][SM_AS][SC][DP_AN][CPU_NEON] = _op_blend_rel_pt_mas_c_dpan_neon;
558 op_blend_rel_pt_funcs[SP_N][SM_AS][SC_N][DP_AN][CPU_NEON] = _op_blend_rel_pt_mas_cn_dpan_neon;
559 op_blend_rel_pt_funcs[SP_N][SM_AS][SC_AN][DP_AN][CPU_NEON] = _op_blend_rel_pt_mas_can_dpan_neon;
560 op_blend_rel_pt_funcs[SP_N][SM_AS][SC_AA][DP_AN][CPU_NEON] = _op_blend_rel_pt_mas_caa_dpan_neon;
561}
562#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_mask_color_sse3.c b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_mask_color_sse3.c
new file mode 100644
index 0000000..83230e5
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_mask_color_sse3.c
@@ -0,0 +1,320 @@
1/* blend mask x color -> dst */
2
3#ifdef BUILD_SSE3
4
5static void
6_op_blend_mas_c_dp_sse3(DATA32 *s __UNUSED__, DATA8 *m, DATA32 c, DATA32 *d, int l) {
7
8 const __m128i c_packed = _mm_set_epi32(c, c, c, c);
9
10 LOOP_ALIGNED_U1_A48_SSE3(d, l,
11 { /* UOP */
12
13 DATA32 a = *m;
14 DATA32 mc = MUL_SYM(a, c);
15 a = 256 - (mc >> 24);
16 *d = mc + MUL_256(a, *d);
17 m++; d++; l--;
18 },
19 { /* A4OP */
20
21 if ((m[3] | m[2] | m[1] | m[0]) == 0) {
22 m += 4; d += 4; l -= 4;
23 continue;
24 }
25
26 __m128i m0 = _mm_set_epi32(m[3], m[2], m[1], m[0]);
27 __m128i d0 = _mm_load_si128((__m128i *)d);
28
29 __m128i mc0 = mul_sym_sse3(m0, c_packed);
30 __m128i a0 = sub4_alpha_sse3(mc0);
31 __m128i mul0 = mul_256_sse3(a0, d0);
32
33 mul0 = _mm_add_epi32(mul0, mc0);
34
35 _mm_store_si128((__m128i *)d, mul0);
36
37 m += 4; d += 4; l -= 4;
38 },
39 { /* A8OP */
40
41 if((m[7] | m[6] | m[5] | m[4] | m[3] | m[2] | m[1] | m[0]) == 0) {
42 m += 8; d += 8; l -= 8;
43 continue;
44 }
45
46 __m128i m0 = _mm_set_epi32(m[3], m[2], m[1], m[0]);
47 __m128i d0 = _mm_load_si128((__m128i *)d);
48
49 __m128i m1 = _mm_set_epi32(m[7], m[6], m[5], m[4]);
50 __m128i d1 = _mm_load_si128((__m128i *)(d+4));
51
52 __m128i mc0 = mul_sym_sse3(m0, c_packed);
53 __m128i a0 = sub4_alpha_sse3(mc0);
54 __m128i mul0 = mul_256_sse3(a0, d0);
55
56 mul0 = _mm_add_epi32(mc0, mul0);
57
58 __m128i mc1 = mul_sym_sse3(m1, c_packed);
59 __m128i a1 = sub4_alpha_sse3(mc1);
60 __m128i mul1 = mul_256_sse3(a1, d1);
61
62 mul1 = _mm_add_epi32(mc1, mul1);
63
64 _mm_store_si128((__m128i *)d, mul0);
65 _mm_store_si128((__m128i *)(d+4), mul1);
66
67 m += 8; d += 8; l -= 8;
68 })
69}
70
71static void
72_op_blend_mas_can_dp_sse3(DATA32 *s __UNUSED__, DATA8 *m, DATA32 c, DATA32 *d, int l) {
73
74 DATA32 alpha;
75
76 const __m128i one = _mm_set_epi32(1, 1, 1, 1);
77 const __m128i c_packed = _mm_set_epi32(c, c, c, c);
78
79 LOOP_ALIGNED_U1_A48_SSE3(d, l,
80 { /* UOP */
81
82 alpha = *m;
83 switch(alpha)
84 {
85 case 0:
86 break;
87 case 255:
88 *d = c;
89 break;
90 default:
91 alpha++;
92 *d = INTERP_256(alpha, c, *d);
93 break;
94 }
95 m++; d++; l--;
96 },
97 { /* A4OP */
98
99 if ((m[3] | m[2] | m[1] | m[0]) == 0) {
100 m += 4; d += 4; l -= 4;
101 continue;
102 }
103
104 __m128i m0 = _mm_set_epi32(m[3], m[2], m[1], m[0]);
105 __m128i d0 = _mm_load_si128((__m128i *)d);
106
107 __m128i zm0 = _mm_cmpeq_epi32(m0, _mm_setzero_si128());
108
109 m0 = _mm_add_epi32(one, m0);
110
111 __m128i r0 = interp4_256_sse3(m0, c_packed, d0);
112
113 r0 = _mm_and_si128(~zm0, r0);
114 d0 = _mm_and_si128(zm0, d0);
115
116 d0 = _mm_add_epi32(r0, d0);
117
118 _mm_store_si128((__m128i *)d, d0);
119
120 m += 4; d += 4; l -= 4;
121 },
122 { /* A8OP */
123
124 if ((m[7] | m[6] | m[5] | m[4] | m[3] | m[2] | m[1] | m[0]) == 0) {
125 m += 8; d += 8; l -= 8;
126 continue;
127 }
128
129 __m128i m0 = _mm_set_epi32(m[3], m[2], m[1], m[0]);
130 __m128i d0 = _mm_load_si128((__m128i *)d);
131
132 __m128i m1 = _mm_set_epi32(m[7], m[6], m[5], m[4]);
133 __m128i d1 = _mm_load_si128((__m128i *)(d+4));
134
135 __m128i zm0 = _mm_cmpeq_epi32(m0, _mm_setzero_si128());
136 __m128i zm1 = _mm_cmpeq_epi32(m1, _mm_setzero_si128());
137
138 m0 = _mm_add_epi32(one, m0);
139 m1 = _mm_add_epi32(one, m1);
140
141 __m128i r0 = interp4_256_sse3(m0, c_packed, d0);
142 __m128i r1 = interp4_256_sse3(m1, c_packed, d1);
143
144 r0 = _mm_and_si128(~zm0, r0);
145 d0 = _mm_and_si128(zm0, d0);
146
147 r1 = _mm_and_si128(~zm1, r1);
148 d1 = _mm_and_si128(zm1, d1);
149
150 d0 = _mm_add_epi32(d0, r0);
151 d1 = _mm_add_epi32(d1, r1);
152
153 _mm_store_si128((__m128i *)d, d0);
154 _mm_store_si128((__m128i *)(d+4), d1);
155
156 m += 8; d += 8; l -= 8;
157 })
158}
159
160#define _op_blend_mas_cn_dp_sse3 _op_blend_mas_can_dp_sse3
161#define _op_blend_mas_caa_dp_sse3 _op_blend_mas_c_dp_sse3
162
163#define _op_blend_mas_c_dpan_sse3 _op_blend_mas_c_dp_sse3
164#define _op_blend_mas_cn_dpan_sse3 _op_blend_mas_cn_dp_sse3
165#define _op_blend_mas_can_dpan_sse3 _op_blend_mas_can_dp_sse3
166#define _op_blend_mas_caa_dpan_sse3 _op_blend_mas_caa_dp_sse3
167
168static void
169init_blend_mask_color_span_funcs_sse3(void)
170{
171 op_blend_span_funcs[SP_N][SM_AS][SC][DP][CPU_SSE3] = _op_blend_mas_c_dp_sse3;
172 op_blend_span_funcs[SP_N][SM_AS][SC_N][DP][CPU_SSE3] = _op_blend_mas_cn_dp_sse3;
173 op_blend_span_funcs[SP_N][SM_AS][SC_AN][DP][CPU_SSE3] = _op_blend_mas_can_dp_sse3;
174 op_blend_span_funcs[SP_N][SM_AS][SC_AA][DP][CPU_SSE3] = _op_blend_mas_caa_dp_sse3;
175
176// FIXME: BUGGY BUGGY Core i5 2500 (64bit), gcc version 4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu4), ello (text)
177// op_blend_span_funcs[SP_N][SM_AS][SC][DP_AN][CPU_SSE3] = _op_blend_mas_c_dpan_sse3;
178 op_blend_span_funcs[SP_N][SM_AS][SC_N][DP_AN][CPU_SSE3] = _op_blend_mas_cn_dpan_sse3;
179 op_blend_span_funcs[SP_N][SM_AS][SC_AN][DP_AN][CPU_SSE3] = _op_blend_mas_can_dpan_sse3;
180 op_blend_span_funcs[SP_N][SM_AS][SC_AA][DP_AN][CPU_SSE3] = _op_blend_mas_caa_dpan_sse3;
181}
182
183#define _op_blend_pt_mas_c_dp_sse3 NULL
184#define _op_blend_pt_mas_can_dp_sse3 NULL
185
186#define _op_blend_pt_mas_cn_dp_sse3 _op_blend_pt_mas_can_dp_sse3
187#define _op_blend_pt_mas_caa_dp_sse3 _op_blend_pt_mas_c_dp_sse3
188
189#define _op_blend_pt_mas_c_dpan_sse3 _op_blend_pt_mas_c_dp_sse3
190#define _op_blend_pt_mas_cn_dpan_sse3 _op_blend_pt_mas_cn_dp_sse3
191#define _op_blend_pt_mas_can_dpan_sse3 _op_blend_pt_mas_can_dp_sse3
192#define _op_blend_pt_mas_caa_dpan_sse3 _op_blend_pt_mas_caa_dp_sse3
193
194static void
195init_blend_mask_color_pt_funcs_sse3(void)
196{
197 op_blend_pt_funcs[SP_N][SM_AS][SC][DP][CPU_SSE3] = _op_blend_pt_mas_c_dp_sse3;
198 op_blend_pt_funcs[SP_N][SM_AS][SC_N][DP][CPU_SSE3] = _op_blend_pt_mas_cn_dp_sse3;
199 op_blend_pt_funcs[SP_N][SM_AS][SC_AN][DP][CPU_SSE3] = _op_blend_pt_mas_can_dp_sse3;
200 op_blend_pt_funcs[SP_N][SM_AS][SC_AA][DP][CPU_SSE3] = _op_blend_pt_mas_caa_dp_sse3;
201
202 op_blend_pt_funcs[SP_N][SM_AS][SC][DP_AN][CPU_SSE3] = _op_blend_pt_mas_c_dpan_sse3;
203 op_blend_pt_funcs[SP_N][SM_AS][SC_N][DP_AN][CPU_SSE3] = _op_blend_pt_mas_cn_dpan_sse3;
204 op_blend_pt_funcs[SP_N][SM_AS][SC_AN][DP_AN][CPU_SSE3] = _op_blend_pt_mas_can_dpan_sse3;
205 op_blend_pt_funcs[SP_N][SM_AS][SC_AA][DP_AN][CPU_SSE3] = _op_blend_pt_mas_caa_dpan_sse3;
206}
207
208/*-----*/
209
210/* blend_rel mask x color --> dst */
211
212static void
213_op_blend_rel_mas_c_dp_sse3(DATA32 *s __UNUSED__, DATA8 *m, DATA32 c, DATA32 *d, int l) {
214
215 const __m128i c_packed = _mm_set_epi32(c, c, c, c);
216
217 LOOP_ALIGNED_U1_A48_SSE3(d, l,
218 { /* UOP */
219
220 DATA32 mc = MUL_SYM(*m, c);
221 int alpha = 256 - (mc >> 24);
222 *d = MUL_SYM(*d >> 24, mc) + MUL_256(alpha, *d);
223 d++; m++; l--;
224 },
225 { /* A4OP */
226
227 __m128i m0 = _mm_set_epi32(m[3], m[2], m[1], m[0]);
228 __m128i d0 = _mm_load_si128((__m128i *) d);
229
230 __m128i mc0 = mul_sym_sse3(m0, c_packed);
231 __m128i a0 = sub4_alpha_sse3(mc0);
232
233 __m128i d0_sym = mul_sym_sse3(_mm_srli_epi32(d0, 24), mc0);
234 d0 = mul_256_sse3(a0, d0);
235
236 d0 = _mm_add_epi32(d0, d0_sym);
237
238 _mm_store_si128((__m128i *)d, d0);
239
240 d += 4; m += 4; l -= 4;
241 },
242 { /* A8OP */
243
244 __m128i m0 = _mm_set_epi32(m[3], m[2], m[1], m[0]);
245 __m128i d0 = _mm_load_si128((__m128i *)d);
246
247 __m128i m1 = _mm_set_epi32(m[7], m[6], m[5], m[4]);
248 __m128i d1 = _mm_load_si128((__m128i *)(d+4));
249
250 __m128i mc0 = mul_sym_sse3(m0, c_packed);
251 __m128i mc1 = mul_sym_sse3(m1, c_packed);
252
253 __m128i a0 = sub4_alpha_sse3(mc0);
254 __m128i a1 = sub4_alpha_sse3(mc1);
255
256 __m128i d0_sym = mul_sym_sse3(_mm_srli_epi32(d0, 24), mc0);
257 __m128i d1_sym = mul_sym_sse3(_mm_srli_epi32(d1, 24), mc1);
258
259 d0 = mul_256_sse3(a0, d0);
260 d1 = mul_256_sse3(a1, d1);
261
262 d0 = _mm_add_epi32(d0, d0_sym);
263 d1 = _mm_add_epi32(d1, d1_sym);
264
265 _mm_store_si128((__m128i *)d, d0);
266 _mm_store_si128((__m128i *)(d+4), d1);
267
268 d += 8; m += 8; l -= 8;
269 })
270}
271
272#define _op_blend_rel_mas_cn_dp_sse3 _op_blend_rel_mas_c_dp_sse3
273#define _op_blend_rel_mas_can_dp_sse3 _op_blend_rel_mas_c_dp_sse3
274#define _op_blend_rel_mas_caa_dp_sse3 _op_blend_rel_mas_c_dp_sse3
275
276#define _op_blend_rel_mas_c_dpan_sse3 _op_blend_mas_c_dpan_sse3
277#define _op_blend_rel_mas_cn_dpan_sse3 _op_blend_mas_cn_dpan_sse3
278#define _op_blend_rel_mas_can_dpan_sse3 _op_blend_mas_can_dpan_sse3
279#define _op_blend_rel_mas_caa_dpan_sse3 _op_blend_mas_caa_dpan_sse3
280
281static void
282init_blend_rel_mask_color_span_funcs_sse3(void)
283{
284 op_blend_rel_span_funcs[SP_N][SM_AS][SC][DP][CPU_SSE3] = _op_blend_rel_mas_c_dp_sse3;
285 op_blend_rel_span_funcs[SP_N][SM_AS][SC_N][DP][CPU_SSE3] = _op_blend_rel_mas_can_dp_sse3;
286 op_blend_rel_span_funcs[SP_N][SM_AS][SC_AN][DP][CPU_SSE3] = _op_blend_rel_mas_can_dp_sse3;
287 op_blend_rel_span_funcs[SP_N][SM_AS][SC_AA][DP][CPU_SSE3] = _op_blend_rel_mas_caa_dp_sse3;
288
289 op_blend_rel_span_funcs[SP_N][SM_AS][SC][DP_AN][CPU_SSE3] = _op_blend_rel_mas_c_dpan_sse3;
290 op_blend_rel_span_funcs[SP_N][SM_AS][SC_N][DP_AN][CPU_SSE3] = _op_blend_rel_mas_cn_dpan_sse3;
291 op_blend_rel_span_funcs[SP_N][SM_AS][SC_AN][DP_AN][CPU_SSE3] = _op_blend_rel_mas_can_dpan_sse3;
292 op_blend_rel_span_funcs[SP_N][SM_AS][SC_AA][DP_AN][CPU_SSE3] = _op_blend_rel_mas_caa_dpan_sse3;
293}
294
295#define _op_blend_rel_pt_mas_c_dp_sse3 NULL
296
297#define _op_blend_rel_pt_mas_cn_dp_sse3 _op_blend_rel_pt_mas_c_dp_sse3
298#define _op_blend_rel_pt_mas_can_dp_sse3 _op_blend_rel_pt_mas_c_dp_sse3
299#define _op_blend_rel_pt_mas_caa_dp_sse3 _op_blend_rel_pt_mas_c_dp_sse3
300
301#define _op_blend_rel_pt_mas_c_dpan_sse3 _op_blend_pt_mas_c_dpan_sse3
302#define _op_blend_rel_pt_mas_cn_dpan_sse3 _op_blend_pt_mas_cn_dpan_sse3
303#define _op_blend_rel_pt_mas_can_dpan_sse3 _op_blend_pt_mas_can_dpan_sse3
304#define _op_blend_rel_pt_mas_caa_dpan_sse3 _op_blend_pt_mas_caa_dpan_sse3
305
306static void
307init_blend_rel_mask_color_pt_funcs_sse3(void)
308{
309 op_blend_rel_pt_funcs[SP_N][SM_AS][SC][DP][CPU_SSE3] = _op_blend_rel_pt_mas_c_dp_sse3;
310 op_blend_rel_pt_funcs[SP_N][SM_AS][SC_N][DP][CPU_SSE3] = _op_blend_rel_pt_mas_cn_dp_sse3;
311 op_blend_rel_pt_funcs[SP_N][SM_AS][SC_AN][DP][CPU_SSE3] = _op_blend_rel_pt_mas_can_dp_sse3;
312 op_blend_rel_pt_funcs[SP_N][SM_AS][SC_AA][DP][CPU_SSE3] = _op_blend_rel_pt_mas_caa_dp_sse3;
313
314 op_blend_rel_pt_funcs[SP_N][SM_AS][SC][DP_AN][CPU_SSE3] = _op_blend_rel_pt_mas_c_dpan_sse3;
315 op_blend_rel_pt_funcs[SP_N][SM_AS][SC_N][DP_AN][CPU_SSE3] = _op_blend_rel_pt_mas_cn_dpan_sse3;
316 op_blend_rel_pt_funcs[SP_N][SM_AS][SC_AN][DP_AN][CPU_SSE3] = _op_blend_rel_pt_mas_can_dpan_sse3;
317 op_blend_rel_pt_funcs[SP_N][SM_AS][SC_AA][DP_AN][CPU_SSE3] = _op_blend_rel_pt_mas_caa_dpan_sse3;
318}
319
320#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_master_sse3.c b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_master_sse3.c
new file mode 100644
index 0000000..eac6755
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_master_sse3.c
@@ -0,0 +1,77 @@
1#define NEED_SSE3 1
2
3#include "evas_common.h"
4
5#ifdef BUILD_SSE3
6static __m128i A_MASK_SSE3;
7#endif
8
9extern RGBA_Gfx_Func op_blend_span_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
10extern RGBA_Gfx_Pt_Func op_blend_pt_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
11
12extern RGBA_Gfx_Func op_blend_rel_span_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
13extern RGBA_Gfx_Pt_Func op_blend_rel_pt_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
14
15# include "op_blend_pixel_sse3.c"
16# include "op_blend_color_sse3.c"
17# include "op_blend_pixel_color_sse3.c"
18# include "op_blend_pixel_mask_sse3.c"
19# include "op_blend_mask_color_sse3.c"
20
21void
22evas_common_op_blend_init_sse3(void)
23{
24#ifdef BUILD_SSE3
25 GA_MASK_SSE3 = _mm_set_epi32(0x00FF00FF, 0x00FF00FF, 0x00FF00FF, 0x00FF00FF);
26 RB_MASK_SSE3 = _mm_set_epi32(0xFF00FF00, 0xFF00FF00, 0xFF00FF00, 0xFF00FF00);
27 SYM4_MASK_SSE3 = _mm_set_epi32(0x00FF00FF, 0x000000FF, 0x00FF00FF, 0x000000FF);
28 RGB_MASK_SSE3 = _mm_set_epi32(0xFFFFFF, 0xFFFFFF, 0xFFFFFF, 0xFFFFFF);
29 A_MASK_SSE3 = _mm_set_epi32(0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000);
30 ALPHA_SSE3 = _mm_set_epi32(256, 256, 256, 256);
31
32 init_blend_pixel_span_funcs_sse3();
33 init_blend_pixel_color_span_funcs_sse3();
34 init_blend_pixel_mask_span_funcs_sse3();
35 init_blend_color_span_funcs_sse3();
36 init_blend_mask_color_span_funcs_sse3();
37
38 init_blend_pixel_pt_funcs_sse3();
39 init_blend_pixel_color_pt_funcs_sse3();
40 init_blend_pixel_mask_pt_funcs_sse3();
41 init_blend_color_pt_funcs_sse3();
42 init_blend_mask_color_pt_funcs_sse3();
43#endif
44}
45
46void
47evas_common_op_blend_rel_init_sse3(void)
48{
49#ifdef BUILD_SSE3
50 init_blend_rel_pixel_span_funcs_sse3();
51 init_blend_rel_pixel_color_span_funcs_sse3();
52 init_blend_rel_pixel_mask_span_funcs_sse3();
53 init_blend_rel_color_span_funcs_sse3();
54 init_blend_rel_mask_color_span_funcs_sse3();
55
56 init_blend_rel_pixel_pt_funcs_sse3();
57 init_blend_rel_pixel_color_pt_funcs_sse3();
58 init_blend_rel_pixel_mask_pt_funcs_sse3();
59 init_blend_rel_color_pt_funcs_sse3();
60 init_blend_rel_mask_color_pt_funcs_sse3();
61#endif
62}
63
64//#pragma GCC push_options
65//#pragma GCC optimize ("O0")
66void
67evas_common_op_sse3_test(void)
68{
69#ifdef BUILD_SSE3
70 DATA32 s[64] = {0x11883399}, d[64] = {0xff88cc33};
71
72 s[0] = rand(); d[1] = rand();
73 _op_blend_pas_dp_sse3(s, NULL, 0, d, 64);
74 evas_common_cpu_end_opt();
75#endif
76}
77//#pragma GCC pop_options
diff --git a/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_.c b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_.c
new file mode 100644
index 0000000..0ce78d8
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_.c
@@ -0,0 +1,162 @@
1/* blend pixel --> dst */
2
3#ifdef BUILD_C
4static void
5_op_blend_p_dp(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c __UNUSED__, DATA32 *d, int l) {
6 DATA32 *e;
7 int alpha;
8 UNROLL8_PLD_WHILE(d, l, e,
9 {
10 alpha = 256 - (*s >> 24);
11 *d = *s++ + MUL_256(alpha, *d);
12 d++;
13 });
14}
15
16static void
17_op_blend_pas_dp(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c __UNUSED__, DATA32 *d, int l) {
18 DATA32 *e;
19 int alpha;
20 UNROLL8_PLD_WHILE(d, l, e,
21 {
22 switch (*s & 0xff000000)
23 {
24 case 0:
25 break;
26 case 0xff000000:
27 *d = *s;
28 break;
29 default:
30 alpha = 256 - (*s >> 24);
31 *d = *s + MUL_256(alpha, *d);
32 break;
33 }
34 s++; d++;
35 });
36}
37
38#define _op_blend_pan_dp NULL
39
40#define _op_blend_p_dpan _op_blend_p_dp
41#define _op_blend_pas_dpan _op_blend_pas_dp
42#define _op_blend_pan_dpan _op_blend_pan_dp
43
44static void
45init_blend_pixel_span_funcs_c(void)
46{
47 op_blend_span_funcs[SP][SM_N][SC_N][DP][CPU_C] = _op_blend_p_dp;
48 op_blend_span_funcs[SP_AS][SM_N][SC_N][DP][CPU_C] = _op_blend_pas_dp;
49 op_blend_span_funcs[SP_AN][SM_N][SC_N][DP][CPU_C] = _op_blend_pan_dp;
50
51 op_blend_span_funcs[SP][SM_N][SC_N][DP_AN][CPU_C] = _op_blend_p_dpan;
52 op_blend_span_funcs[SP_AS][SM_N][SC_N][DP_AN][CPU_C] = _op_blend_pas_dpan;
53 op_blend_span_funcs[SP_AN][SM_N][SC_N][DP_AN][CPU_C] = _op_blend_pan_dpan;
54}
55#endif
56
57#ifdef BUILD_C
58static void
59_op_blend_pt_p_dp(DATA32 s, DATA8 m __UNUSED__, DATA32 c, DATA32 *d) {
60 c = 256 - (s >> 24);
61 *d = s + MUL_256(c, *d);
62}
63
64#define _op_blend_pt_pas_dp _op_blend_pt_p_dp
65#define _op_blend_pt_pan_dp NULL
66
67#define _op_blend_pt_p_dpan _op_blend_pt_p_dp
68#define _op_blend_pt_pan_dpan _op_blend_pt_pan_dp
69#define _op_blend_pt_pas_dpan _op_blend_pt_pas_dp
70
71static void
72init_blend_pixel_pt_funcs_c(void)
73{
74 op_blend_pt_funcs[SP][SM_N][SC_N][DP][CPU_C] = _op_blend_pt_p_dp;
75 op_blend_pt_funcs[SP_AS][SM_N][SC_N][DP][CPU_C] = _op_blend_pt_pas_dp;
76 op_blend_pt_funcs[SP_AN][SM_N][SC_N][DP][CPU_C] = _op_blend_pt_pan_dp;
77
78 op_blend_pt_funcs[SP][SM_N][SC_N][DP_AN][CPU_C] = _op_blend_pt_p_dpan;
79 op_blend_pt_funcs[SP_AS][SM_N][SC_N][DP_AN][CPU_C] = _op_blend_pt_pas_dpan;
80 op_blend_pt_funcs[SP_AN][SM_N][SC_N][DP_AN][CPU_C] = _op_blend_pt_pan_dpan;
81}
82#endif
83
84/*-----*/
85
86/* blend_rel pixel -> dst */
87
88#ifdef BUILD_C
89static void
90_op_blend_rel_p_dp(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) {
91 DATA32 *e;
92 int alpha;
93 UNROLL8_PLD_WHILE(d, l, e,
94 {
95 alpha = 256 - (*s >> 24);
96 c = 1 + (*d >> 24);
97 *d = MUL_256(c, *s) + MUL_256(alpha, *d);
98 d++;
99 s++;
100 });
101}
102
103static void
104_op_blend_rel_pan_dp(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) {
105 DATA32 *e;
106 UNROLL8_PLD_WHILE(d, l, e,
107 {
108 c = 1 + (*d >> 24);
109 *d++ = MUL_256(c, *s);
110 s++;
111 });
112}
113
114#define _op_blend_rel_pas_dp _op_blend_rel_p_dp
115
116#define _op_blend_rel_p_dpan _op_blend_p_dpan
117#define _op_blend_rel_pan_dpan _op_blend_pan_dpan
118#define _op_blend_rel_pas_dpan _op_blend_pas_dpan
119
120static void
121init_blend_rel_pixel_span_funcs_c(void)
122{
123 op_blend_rel_span_funcs[SP][SM_N][SC_N][DP][CPU_C] = _op_blend_rel_p_dp;
124 op_blend_rel_span_funcs[SP_AS][SM_N][SC_N][DP][CPU_C] = _op_blend_rel_pas_dp;
125 op_blend_rel_span_funcs[SP_AN][SM_N][SC_N][DP][CPU_C] = _op_blend_rel_pan_dp;
126
127 op_blend_rel_span_funcs[SP][SM_N][SC_N][DP_AN][CPU_C] = _op_blend_rel_p_dpan;
128 op_blend_rel_span_funcs[SP_AS][SM_N][SC_N][DP_AN][CPU_C] = _op_blend_rel_pas_dpan;
129 op_blend_rel_span_funcs[SP_AN][SM_N][SC_N][DP_AN][CPU_C] = _op_blend_rel_pan_dpan;
130}
131#endif
132
133#ifdef BUILD_C
134static void
135_op_blend_rel_pt_p_dp(DATA32 s, DATA8 m __UNUSED__, DATA32 c, DATA32 *d) {
136 c = 256 - (s >> 24);
137 *d = MUL_SYM(*d >> 24, s) + MUL_256(c, *d);
138}
139
140static void
141_op_blend_rel_pt_pan_dp(DATA32 s, DATA8 m __UNUSED__, DATA32 c __UNUSED__, DATA32 *d) {
142 *d = MUL_SYM(*d >> 24, s);
143}
144
145#define _op_blend_rel_pt_pas_dp _op_blend_rel_pt_p_dp
146
147#define _op_blend_rel_pt_p_dpan _op_blend_pt_p_dpan
148#define _op_blend_rel_pt_pan_dpan _op_blend_pt_pan_dpan
149#define _op_blend_rel_pt_pas_dpan _op_blend_pt_pas_dpan
150
151static void
152init_blend_rel_pixel_pt_funcs_c(void)
153{
154 op_blend_rel_pt_funcs[SP][SM_N][SC_N][DP][CPU_C] = _op_blend_rel_pt_p_dp;
155 op_blend_rel_pt_funcs[SP_AS][SM_N][SC_N][DP][CPU_C] = _op_blend_rel_pt_pas_dp;
156 op_blend_rel_pt_funcs[SP_AN][SM_N][SC_N][DP][CPU_C] = _op_blend_rel_pt_pan_dp;
157
158 op_blend_rel_pt_funcs[SP][SM_N][SC_N][DP_AN][CPU_C] = _op_blend_rel_pt_p_dpan;
159 op_blend_rel_pt_funcs[SP_AS][SM_N][SC_N][DP_AN][CPU_C] = _op_blend_rel_pt_pas_dpan;
160 op_blend_rel_pt_funcs[SP_AN][SM_N][SC_N][DP_AN][CPU_C] = _op_blend_rel_pt_pan_dpan;
161}
162#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_color_.c b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_color_.c
new file mode 100644
index 0000000..c5e40a0
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_color_.c
@@ -0,0 +1,284 @@
1/* blend pixel x color --> dst */
2
3#ifdef BUILD_C
4static void
5_op_blend_p_c_dp(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) {
6 DATA32 *e;
7 int alpha;
8 UNROLL8_PLD_WHILE(d, l, e,
9 {
10 DATA32 sc = MUL4_SYM(c, *s);
11 alpha = 256 - (sc >> 24);
12 *d = sc + MUL_256(alpha, *d);
13 d++;
14 s++;
15 });
16}
17
18static void
19_op_blend_pan_c_dp(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) {
20 DATA32 *e;
21 int alpha = 256 - (c >> 24);
22 UNROLL8_PLD_WHILE(d, l, e,
23 {
24 *d = ((c & 0xff000000) + MUL3_SYM(c, *s)) + MUL_256(alpha, *d);
25 d++;
26 s++;
27 });
28}
29
30static void
31_op_blend_p_can_dp(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) {
32 DATA32 *e;
33 int alpha;
34 UNROLL8_PLD_WHILE(d, l, e,
35 {
36 alpha = 256 - (*s >> 24);
37 *d = ((*s & 0xff000000) + MUL3_SYM(c, *s)) + MUL_256(alpha, *d);
38 d++;
39 s++;
40 });
41}
42
43static void
44_op_blend_pan_can_dp(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) {
45 DATA32 *e;
46 UNROLL8_PLD_WHILE(d, l, e,
47 {
48 *d++ = 0xff000000 + MUL3_SYM(c, *s);
49 s++;
50 });
51}
52
53static void
54_op_blend_p_caa_dp(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) {
55 DATA32 *e;
56 int alpha;
57 c = 1 + (c & 0xff);
58 UNROLL8_PLD_WHILE(d, l, e,
59 {
60 DATA32 sc = MUL_256(c, *s);
61 alpha = 256 - (sc >> 24);
62 *d = sc + MUL_256(alpha, *d);
63 d++;
64 s++;
65 });
66}
67
68static void
69_op_blend_pan_caa_dp(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) {
70 DATA32 *e;
71 c = 1 + (c & 0xff);
72 UNROLL8_PLD_WHILE(d, l, e,
73 {
74 *d = INTERP_256(c, *s, *d);
75 d++;
76 s++;
77 });
78}
79
80#define _op_blend_pas_c_dp _op_blend_p_c_dp
81#define _op_blend_pas_can_dp _op_blend_p_can_dp
82#define _op_blend_pas_caa_dp _op_blend_p_caa_dp
83
84#define _op_blend_p_c_dpan _op_blend_p_c_dp
85#define _op_blend_pas_c_dpan _op_blend_pas_c_dp
86#define _op_blend_pan_c_dpan _op_blend_pan_c_dp
87#define _op_blend_p_can_dpan _op_blend_p_can_dp
88#define _op_blend_pas_can_dpan _op_blend_pas_can_dp
89#define _op_blend_pan_can_dpan _op_blend_pan_can_dp
90#define _op_blend_p_caa_dpan _op_blend_p_caa_dp
91#define _op_blend_pas_caa_dpan _op_blend_pas_caa_dp
92#define _op_blend_pan_caa_dpan _op_blend_pan_caa_dp
93
94static void
95init_blend_pixel_color_span_funcs_c(void)
96{
97 op_blend_span_funcs[SP][SM_N][SC][DP][CPU_C] = _op_blend_p_c_dp;
98 op_blend_span_funcs[SP_AS][SM_N][SC][DP][CPU_C] = _op_blend_pas_c_dp;
99 op_blend_span_funcs[SP_AN][SM_N][SC][DP][CPU_C] = _op_blend_pan_c_dp;
100 op_blend_span_funcs[SP][SM_N][SC_AN][DP][CPU_C] = _op_blend_p_can_dp;
101 op_blend_span_funcs[SP_AS][SM_N][SC_AN][DP][CPU_C] = _op_blend_pas_can_dp;
102 op_blend_span_funcs[SP_AN][SM_N][SC_AN][DP][CPU_C] = _op_blend_pan_can_dp;
103 op_blend_span_funcs[SP][SM_N][SC_AA][DP][CPU_C] = _op_blend_p_caa_dp;
104 op_blend_span_funcs[SP_AS][SM_N][SC_AA][DP][CPU_C] = _op_blend_pas_caa_dp;
105 op_blend_span_funcs[SP_AN][SM_N][SC_AA][DP][CPU_C] = _op_blend_pan_caa_dp;
106
107 op_blend_span_funcs[SP][SM_N][SC][DP_AN][CPU_C] = _op_blend_p_c_dpan;
108 op_blend_span_funcs[SP_AS][SM_N][SC][DP_AN][CPU_C] = _op_blend_pas_c_dpan;
109 op_blend_span_funcs[SP_AN][SM_N][SC][DP_AN][CPU_C] = _op_blend_pan_c_dpan;
110 op_blend_span_funcs[SP][SM_N][SC_AN][DP_AN][CPU_C] = _op_blend_p_can_dpan;
111 op_blend_span_funcs[SP_AS][SM_N][SC_AN][DP_AN][CPU_C] = _op_blend_pas_can_dpan;
112 op_blend_span_funcs[SP_AN][SM_N][SC_AN][DP_AN][CPU_C] = _op_blend_pan_can_dpan;
113 op_blend_span_funcs[SP][SM_N][SC_AA][DP_AN][CPU_C] = _op_blend_p_caa_dpan;
114 op_blend_span_funcs[SP_AS][SM_N][SC_AA][DP_AN][CPU_C] = _op_blend_pas_caa_dpan;
115 op_blend_span_funcs[SP_AN][SM_N][SC_AA][DP_AN][CPU_C] = _op_blend_pan_caa_dpan;
116}
117#endif
118
119#ifdef BUILD_C
120static void
121_op_blend_pt_p_c_dp(DATA32 s, DATA8 m __UNUSED__, DATA32 c, DATA32 *d) {
122 s = MUL4_SYM(c, s);
123 c = 256 - (s >> 24);
124 *d = s + MUL_256(c, *d);
125}
126
127#define _op_blend_pt_pas_c_dp _op_blend_pt_p_c_dp
128#define _op_blend_pt_pan_c_dp _op_blend_pt_p_c_dp
129#define _op_blend_pt_p_can_dp _op_blend_pt_p_c_dp
130#define _op_blend_pt_pas_can_dp _op_blend_pt_p_c_dp
131#define _op_blend_pt_pan_can_dp _op_blend_pt_p_c_dp
132#define _op_blend_pt_p_caa_dp _op_blend_pt_p_c_dp
133#define _op_blend_pt_pas_caa_dp _op_blend_pt_p_c_dp
134#define _op_blend_pt_pan_caa_dp _op_blend_pt_p_c_dp
135
136#define _op_blend_pt_p_c_dpan _op_blend_pt_p_c_dp
137#define _op_blend_pt_pas_c_dpan _op_blend_pt_pas_c_dp
138#define _op_blend_pt_pan_c_dpan _op_blend_pt_pan_c_dp
139#define _op_blend_pt_p_can_dpan _op_blend_pt_p_can_dp
140#define _op_blend_pt_pas_can_dpan _op_blend_pt_pas_can_dp
141#define _op_blend_pt_pan_can_dpan _op_blend_pt_pan_can_dp
142#define _op_blend_pt_p_caa_dpan _op_blend_pt_p_caa_dp
143#define _op_blend_pt_pas_caa_dpan _op_blend_pt_pas_caa_dp
144#define _op_blend_pt_pan_caa_dpan _op_blend_pt_pan_caa_dp
145
146static void
147init_blend_pixel_color_pt_funcs_c(void)
148{
149 op_blend_pt_funcs[SP][SM_N][SC][DP][CPU_C] = _op_blend_pt_p_c_dp;
150 op_blend_pt_funcs[SP_AS][SM_N][SC][DP][CPU_C] = _op_blend_pt_pas_c_dp;
151 op_blend_pt_funcs[SP_AN][SM_N][SC][DP][CPU_C] = _op_blend_pt_pan_c_dp;
152 op_blend_pt_funcs[SP][SM_N][SC_AN][DP][CPU_C] = _op_blend_pt_p_can_dp;
153 op_blend_pt_funcs[SP_AS][SM_N][SC_AN][DP][CPU_C] = _op_blend_pt_pas_can_dp;
154 op_blend_pt_funcs[SP_AN][SM_N][SC_AN][DP][CPU_C] = _op_blend_pt_pan_can_dp;
155 op_blend_pt_funcs[SP][SM_N][SC_AA][DP][CPU_C] = _op_blend_pt_p_caa_dp;
156 op_blend_pt_funcs[SP_AS][SM_N][SC_AA][DP][CPU_C] = _op_blend_pt_pas_caa_dp;
157 op_blend_pt_funcs[SP_AN][SM_N][SC_AA][DP][CPU_C] = _op_blend_pt_pan_caa_dp;
158
159 op_blend_pt_funcs[SP][SM_N][SC][DP_AN][CPU_C] = _op_blend_pt_p_c_dpan;
160 op_blend_pt_funcs[SP_AS][SM_N][SC][DP_AN][CPU_C] = _op_blend_pt_pas_c_dpan;
161 op_blend_pt_funcs[SP_AN][SM_N][SC][DP_AN][CPU_C] = _op_blend_pt_pan_c_dpan;
162 op_blend_pt_funcs[SP][SM_N][SC_AN][DP_AN][CPU_C] = _op_blend_pt_p_can_dpan;
163 op_blend_pt_funcs[SP_AS][SM_N][SC_AN][DP_AN][CPU_C] = _op_blend_pt_pas_can_dpan;
164 op_blend_pt_funcs[SP_AN][SM_N][SC_AN][DP_AN][CPU_C] = _op_blend_pt_pan_can_dpan;
165 op_blend_pt_funcs[SP][SM_N][SC_AA][DP_AN][CPU_C] = _op_blend_pt_p_caa_dpan;
166 op_blend_pt_funcs[SP_AS][SM_N][SC_AA][DP_AN][CPU_C] = _op_blend_pt_pas_caa_dpan;
167 op_blend_pt_funcs[SP_AN][SM_N][SC_AA][DP_AN][CPU_C] = _op_blend_pt_pan_caa_dpan;
168}
169#endif
170
171/*-----*/
172
173/* blend_rel pixel x color -> dst */
174
175#ifdef BUILD_C
176static void
177_op_blend_rel_p_c_dp(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) {
178 DATA32 *e;
179 int alpha;
180 UNROLL8_PLD_WHILE(d, l, e,
181 {
182 DATA32 sc = MUL4_SYM(c, *s);
183 alpha = 256 - (sc >> 24);
184 *d = MUL_SYM(*d >> 24, sc) + MUL_256(alpha, *d);
185 d++;
186 s++;
187 });
188}
189
190#define _op_blend_rel_pas_c_dp _op_blend_rel_p_c_dp
191#define _op_blend_rel_pan_c_dp _op_blend_rel_p_c_dp
192#define _op_blend_rel_p_can_dp _op_blend_rel_p_c_dp
193#define _op_blend_rel_pas_can_dp _op_blend_rel_p_c_dp
194#define _op_blend_rel_pan_can_dp _op_blend_rel_p_c_dp
195#define _op_blend_rel_p_caa_dp _op_blend_rel_p_c_dp
196#define _op_blend_rel_pas_caa_dp _op_blend_rel_p_c_dp
197#define _op_blend_rel_pan_caa_dp _op_blend_rel_p_c_dp
198
199#define _op_blend_rel_p_c_dpan _op_blend_p_c_dpan
200#define _op_blend_rel_pas_c_dpan _op_blend_pas_c_dpan
201#define _op_blend_rel_pan_c_dpan _op_blend_pan_c_dpan
202#define _op_blend_rel_p_can_dpan _op_blend_p_can_dpan
203#define _op_blend_rel_pas_can_dpan _op_blend_pas_can_dpan
204#define _op_blend_rel_pan_can_dpan _op_blend_pan_can_dpan
205#define _op_blend_rel_p_caa_dpan _op_blend_p_caa_dpan
206#define _op_blend_rel_pas_caa_dpan _op_blend_pas_caa_dpan
207#define _op_blend_rel_pan_caa_dpan _op_blend_pan_caa_dpan
208
209static void
210init_blend_rel_pixel_color_span_funcs_c(void)
211{
212 op_blend_rel_span_funcs[SP][SM_N][SC][DP][CPU_C] = _op_blend_rel_p_c_dp;
213 op_blend_rel_span_funcs[SP_AS][SM_N][SC][DP][CPU_C] = _op_blend_rel_pas_c_dp;
214 op_blend_rel_span_funcs[SP_AN][SM_N][SC][DP][CPU_C] = _op_blend_rel_pan_c_dp;
215 op_blend_rel_span_funcs[SP][SM_N][SC_AN][DP][CPU_C] = _op_blend_rel_p_can_dp;
216 op_blend_rel_span_funcs[SP_AS][SM_N][SC_AN][DP][CPU_C] = _op_blend_rel_pas_can_dp;
217 op_blend_rel_span_funcs[SP_AN][SM_N][SC_AN][DP][CPU_C] = _op_blend_rel_pan_can_dp;
218 op_blend_rel_span_funcs[SP][SM_N][SC_AA][DP][CPU_C] = _op_blend_rel_p_caa_dp;
219 op_blend_rel_span_funcs[SP_AS][SM_N][SC_AA][DP][CPU_C] = _op_blend_rel_pas_caa_dp;
220 op_blend_rel_span_funcs[SP_AN][SM_N][SC_AA][DP][CPU_C] = _op_blend_rel_pan_caa_dp;
221
222 op_blend_rel_span_funcs[SP][SM_N][SC][DP_AN][CPU_C] = _op_blend_rel_p_c_dpan;
223 op_blend_rel_span_funcs[SP_AS][SM_N][SC][DP_AN][CPU_C] = _op_blend_rel_pas_c_dpan;
224 op_blend_rel_span_funcs[SP_AN][SM_N][SC][DP_AN][CPU_C] = _op_blend_rel_pan_c_dpan;
225 op_blend_rel_span_funcs[SP][SM_N][SC_AN][DP_AN][CPU_C] = _op_blend_rel_p_can_dpan;
226 op_blend_rel_span_funcs[SP_AS][SM_N][SC_AN][DP_AN][CPU_C] = _op_blend_rel_pas_can_dpan;
227 op_blend_rel_span_funcs[SP_AN][SM_N][SC_AN][DP_AN][CPU_C] = _op_blend_rel_pan_can_dpan;
228 op_blend_rel_span_funcs[SP][SM_N][SC_AA][DP_AN][CPU_C] = _op_blend_rel_p_caa_dpan;
229 op_blend_rel_span_funcs[SP_AS][SM_N][SC_AA][DP_AN][CPU_C] = _op_blend_rel_pas_caa_dpan;
230 op_blend_rel_span_funcs[SP_AN][SM_N][SC_AA][DP_AN][CPU_C] = _op_blend_rel_pan_caa_dpan;
231}
232#endif
233
234#ifdef BUILD_C
235static void
236_op_blend_rel_pt_p_c_dp(DATA32 s, DATA8 m __UNUSED__, DATA32 c, DATA32 *d) {
237 s = MUL4_SYM(c, s);
238 c = 256 - (s >> 24);
239 *d = MUL_SYM(*d >> 24, s) + MUL_256(c, *d);
240}
241
242#define _op_blend_rel_pt_pas_c_dp _op_blend_rel_pt_p_c_dp
243#define _op_blend_rel_pt_pan_c_dp _op_blend_rel_pt_p_c_dp
244#define _op_blend_rel_pt_p_can_dp _op_blend_rel_pt_p_c_dp
245#define _op_blend_rel_pt_pas_can_dp _op_blend_rel_pt_p_c_dp
246#define _op_blend_rel_pt_pan_can_dp _op_blend_rel_pt_p_c_dp
247#define _op_blend_rel_pt_p_caa_dp _op_blend_rel_pt_p_c_dp
248#define _op_blend_rel_pt_pas_caa_dp _op_blend_rel_pt_p_c_dp
249#define _op_blend_rel_pt_pan_caa_dp _op_blend_rel_pt_p_c_dp
250
251#define _op_blend_rel_pt_p_c_dpan _op_blend_pt_p_c_dpan
252#define _op_blend_rel_pt_pas_c_dpan _op_blend_pt_pas_c_dpan
253#define _op_blend_rel_pt_pan_c_dpan _op_blend_pt_pan_c_dpan
254#define _op_blend_rel_pt_p_can_dpan _op_blend_pt_p_can_dpan
255#define _op_blend_rel_pt_pas_can_dpan _op_blend_pt_pas_can_dpan
256#define _op_blend_rel_pt_pan_can_dpan _op_blend_pt_pan_can_dpan
257#define _op_blend_rel_pt_p_caa_dpan _op_blend_pt_p_caa_dpan
258#define _op_blend_rel_pt_pas_caa_dpan _op_blend_pt_pas_caa_dpan
259#define _op_blend_rel_pt_pan_caa_dpan _op_blend_pt_pan_caa_dpan
260
261static void
262init_blend_rel_pixel_color_pt_funcs_c(void)
263{
264 op_blend_rel_pt_funcs[SP][SM_N][SC][DP][CPU_C] = _op_blend_rel_pt_p_c_dp;
265 op_blend_rel_pt_funcs[SP_AS][SM_N][SC][DP][CPU_C] = _op_blend_rel_pt_pas_c_dp;
266 op_blend_rel_pt_funcs[SP_AN][SM_N][SC][DP][CPU_C] = _op_blend_rel_pt_pan_c_dp;
267 op_blend_rel_pt_funcs[SP][SM_N][SC_AN][DP][CPU_C] = _op_blend_rel_pt_p_can_dp;
268 op_blend_rel_pt_funcs[SP_AS][SM_N][SC_AN][DP][CPU_C] = _op_blend_rel_pt_pas_can_dp;
269 op_blend_rel_pt_funcs[SP_AN][SM_N][SC_AN][DP][CPU_C] = _op_blend_rel_pt_pan_can_dp;
270 op_blend_rel_pt_funcs[SP][SM_N][SC_AA][DP][CPU_C] = _op_blend_rel_pt_p_caa_dp;
271 op_blend_rel_pt_funcs[SP_AS][SM_N][SC_AA][DP][CPU_C] = _op_blend_rel_pt_pas_caa_dp;
272 op_blend_rel_pt_funcs[SP_AN][SM_N][SC_AA][DP][CPU_C] = _op_blend_rel_pt_pan_caa_dp;
273
274 op_blend_rel_pt_funcs[SP][SM_N][SC][DP_AN][CPU_C] = _op_blend_rel_pt_p_c_dpan;
275 op_blend_rel_pt_funcs[SP_AS][SM_N][SC][DP_AN][CPU_C] = _op_blend_rel_pt_pas_c_dpan;
276 op_blend_rel_pt_funcs[SP_AN][SM_N][SC][DP_AN][CPU_C] = _op_blend_rel_pt_pan_c_dpan;
277 op_blend_rel_pt_funcs[SP][SM_N][SC_AN][DP_AN][CPU_C] = _op_blend_rel_pt_p_can_dpan;
278 op_blend_rel_pt_funcs[SP_AS][SM_N][SC_AN][DP_AN][CPU_C] = _op_blend_rel_pt_pas_can_dpan;
279 op_blend_rel_pt_funcs[SP_AN][SM_N][SC_AN][DP_AN][CPU_C] = _op_blend_rel_pt_pan_can_dpan;
280 op_blend_rel_pt_funcs[SP][SM_N][SC_AA][DP_AN][CPU_C] = _op_blend_rel_pt_p_caa_dpan;
281 op_blend_rel_pt_funcs[SP_AS][SM_N][SC_AA][DP_AN][CPU_C] = _op_blend_rel_pt_pas_caa_dpan;
282 op_blend_rel_pt_funcs[SP_AN][SM_N][SC_AA][DP_AN][CPU_C] = _op_blend_rel_pt_pan_caa_dpan;
283}
284#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_color_i386.c b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_color_i386.c
new file mode 100644
index 0000000..52751f4
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_color_i386.c
@@ -0,0 +1,221 @@
1/* blend pixel x color --> dst */
2
3#ifdef BUILD_MMX
4static void
5_op_blend_p_c_dp_mmx(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) {
6 DATA32 *e = d + l;
7 MOV_A2R(ALPHA_256, mm6)
8 MOV_A2R(ALPHA_255, mm5)
9 pxor_r2r(mm0, mm0);
10 MOV_P2R(c, mm2, mm0)
11 while (d < e) {
12 MOV_P2R(*s, mm3, mm0)
13 MUL4_SYM_R2R(mm2, mm3, mm5)
14
15 MOV_RA2R(mm3, mm1)
16 movq_r2r(mm6, mm4);
17 psubw_r2r(mm1, mm4);
18
19 MOV_P2R(*d, mm1, mm0)
20 MUL4_256_R2R(mm4, mm1)
21
22 paddw_r2r(mm3, mm1);
23 MOV_R2P(mm1, *d, mm0)
24 s++; d++;
25 }
26}
27
28static void
29_op_blend_pan_can_dp_mmx(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) {
30 DATA32 *e = d + l;
31 pxor_r2r(mm0, mm0);
32 MOV_P2R(c, mm2, mm0)
33 MOV_A2R(ALPHA_255, mm5)
34 while (d < e) {
35 MOV_P2R(*s, mm1, mm0)
36 MUL4_SYM_R2R(mm2, mm1, mm5)
37 MOV_R2P(mm1, *d, mm0)
38 s++; d++;
39 }
40}
41
42static void
43_op_blend_pan_caa_dp_mmx(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) {
44 DATA32 *e = d + l;
45 c = 1 + (c & 0xff);
46 MOV_A2R(c, mm2)
47 MOV_A2R(ALPHA_255, mm5)
48 pxor_r2r(mm0, mm0);
49 while (d < e) {
50 MOV_P2R(*s, mm3, mm0)
51 MOV_P2R(*d, mm1, mm0)
52 INTERP_256_R2R(mm2, mm3, mm1, mm5)
53 MOV_R2P(mm1, *d, mm0)
54 s++; d++;
55 }
56}
57
58#define _op_blend_pas_c_dp_mmx _op_blend_p_c_dp_mmx
59#define _op_blend_pan_c_dp_mmx _op_blend_p_c_dp_mmx
60#define _op_blend_p_can_dp_mmx _op_blend_p_c_dp_mmx
61#define _op_blend_pas_can_dp_mmx _op_blend_p_c_dp_mmx
62#define _op_blend_p_caa_dp_mmx _op_blend_p_c_dp_mmx
63#define _op_blend_pas_caa_dp_mmx _op_blend_p_c_dp_mmx
64
65#define _op_blend_p_c_dpan_mmx _op_blend_p_c_dp_mmx
66#define _op_blend_pas_c_dpan_mmx _op_blend_pas_c_dp_mmx
67#define _op_blend_pan_c_dpan_mmx _op_blend_pan_c_dp_mmx
68#define _op_blend_p_can_dpan_mmx _op_blend_p_can_dp_mmx
69#define _op_blend_pas_can_dpan_mmx _op_blend_pas_can_dp_mmx
70#define _op_blend_pan_can_dpan_mmx _op_blend_pan_can_dp_mmx
71#define _op_blend_p_caa_dpan_mmx _op_blend_p_caa_dp_mmx
72#define _op_blend_pas_caa_dpan_mmx _op_blend_pas_caa_dp_mmx
73#define _op_blend_pan_caa_dpan_mmx _op_blend_pan_caa_dp_mmx
74
75
76static void
77init_blend_pixel_color_span_funcs_mmx(void)
78{
79 op_blend_span_funcs[SP][SM_N][SC][DP][CPU_MMX] = _op_blend_p_c_dp_mmx;
80 op_blend_span_funcs[SP_AS][SM_N][SC][DP][CPU_MMX] = _op_blend_pas_c_dp_mmx;
81 op_blend_span_funcs[SP_AN][SM_N][SC][DP][CPU_MMX] = _op_blend_pan_c_dp_mmx;
82 op_blend_span_funcs[SP][SM_N][SC_AN][DP][CPU_MMX] = _op_blend_p_can_dp_mmx;
83 op_blend_span_funcs[SP_AS][SM_N][SC_AN][DP][CPU_MMX] = _op_blend_pas_can_dp_mmx;
84 op_blend_span_funcs[SP_AN][SM_N][SC_AN][DP][CPU_MMX] = _op_blend_pan_can_dp_mmx;
85 op_blend_span_funcs[SP][SM_N][SC_AA][DP][CPU_MMX] = _op_blend_p_caa_dp_mmx;
86 op_blend_span_funcs[SP_AS][SM_N][SC_AA][DP][CPU_MMX] = _op_blend_pas_caa_dp_mmx;
87 op_blend_span_funcs[SP_AN][SM_N][SC_AA][DP][CPU_MMX] = _op_blend_pan_caa_dp_mmx;
88
89 op_blend_span_funcs[SP][SM_N][SC][DP_AN][CPU_MMX] = _op_blend_p_c_dpan_mmx;
90 op_blend_span_funcs[SP_AS][SM_N][SC][DP_AN][CPU_MMX] = _op_blend_pas_c_dpan_mmx;
91 op_blend_span_funcs[SP_AN][SM_N][SC][DP_AN][CPU_MMX] = _op_blend_pan_c_dpan_mmx;
92 op_blend_span_funcs[SP][SM_N][SC_AN][DP_AN][CPU_MMX] = _op_blend_p_can_dpan_mmx;
93 op_blend_span_funcs[SP_AS][SM_N][SC_AN][DP_AN][CPU_MMX] = _op_blend_pas_can_dpan_mmx;
94 op_blend_span_funcs[SP_AN][SM_N][SC_AN][DP_AN][CPU_MMX] = _op_blend_pan_can_dpan_mmx;
95 op_blend_span_funcs[SP][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_blend_p_caa_dpan_mmx;
96 op_blend_span_funcs[SP_AS][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_blend_pas_caa_dpan_mmx;
97 op_blend_span_funcs[SP_AN][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_blend_pan_caa_dpan_mmx;
98}
99#endif
100
101#ifdef BUILD_MMX
102static void
103_op_blend_pt_p_c_dp_mmx(DATA32 s, DATA8 m __UNUSED__, DATA32 c, DATA32 *d) {
104 MOV_A2R(ALPHA_256, mm4)
105 MOV_A2R(ALPHA_255, mm5)
106 pxor_r2r(mm0, mm0);
107 MOV_P2R(c, mm2, mm0)
108 MOV_P2R(s, mm3, mm0)
109 MUL4_SYM_R2R(mm2, mm3, mm5)
110
111 MOV_RA2R(mm3, mm1)
112 psubw_r2r(mm1, mm4);
113
114 MOV_P2R(*d, mm1, mm0)
115 MUL4_256_R2R(mm4, mm1)
116
117 paddw_r2r(mm3, mm1);
118 MOV_R2P(mm1, *d, mm0)
119}
120
121#define _op_blend_pt_pas_c_dp_mmx _op_blend_pt_p_c_dp_mmx
122#define _op_blend_pt_pan_c_dp_mmx _op_blend_pt_p_c_dp_mmx
123#define _op_blend_pt_p_can_dp_mmx _op_blend_pt_p_c_dp_mmx
124#define _op_blend_pt_pas_can_dp_mmx _op_blend_pt_p_c_dp_mmx
125#define _op_blend_pt_pan_can_dp_mmx _op_blend_pt_p_c_dp_mmx
126#define _op_blend_pt_p_caa_dp_mmx _op_blend_pt_p_c_dp_mmx
127#define _op_blend_pt_pas_caa_dp_mmx _op_blend_pt_p_c_dp_mmx
128#define _op_blend_pt_pan_caa_dp_mmx _op_blend_pt_p_c_dp_mmx
129
130#define _op_blend_pt_p_c_dpan_mmx _op_blend_pt_p_c_dp_mmx
131#define _op_blend_pt_pas_c_dpan_mmx _op_blend_pt_p_c_dp_mmx
132#define _op_blend_pt_pan_c_dpan_mmx _op_blend_pt_p_c_dp_mmx
133#define _op_blend_pt_p_can_dpan_mmx _op_blend_pt_p_c_dp_mmx
134#define _op_blend_pt_pas_can_dpan_mmx _op_blend_pt_p_c_dp_mmx
135#define _op_blend_pt_pan_can_dpan_mmx _op_blend_pt_p_c_dp_mmx
136#define _op_blend_pt_p_caa_dpan_mmx _op_blend_pt_p_c_dp_mmx
137#define _op_blend_pt_pas_caa_dpan_mmx _op_blend_pt_p_c_dp_mmx
138#define _op_blend_pt_pan_caa_dpan_mmx _op_blend_pt_p_c_dp_mmx
139
140static void
141init_blend_pixel_color_pt_funcs_mmx(void)
142{
143 op_blend_pt_funcs[SP][SM_N][SC][DP][CPU_MMX] = _op_blend_pt_p_c_dp_mmx;
144 op_blend_pt_funcs[SP_AS][SM_N][SC][DP][CPU_MMX] = _op_blend_pt_pas_c_dp_mmx;
145 op_blend_pt_funcs[SP_AN][SM_N][SC][DP][CPU_MMX] = _op_blend_pt_pan_c_dp_mmx;
146 op_blend_pt_funcs[SP][SM_N][SC_AN][DP][CPU_MMX] = _op_blend_pt_p_can_dp_mmx;
147 op_blend_pt_funcs[SP_AS][SM_N][SC_AN][DP][CPU_MMX] = _op_blend_pt_pas_can_dp_mmx;
148 op_blend_pt_funcs[SP_AN][SM_N][SC_AN][DP][CPU_MMX] = _op_blend_pt_pan_can_dp_mmx;
149 op_blend_pt_funcs[SP][SM_N][SC_AA][DP][CPU_MMX] = _op_blend_pt_p_caa_dp_mmx;
150 op_blend_pt_funcs[SP_AS][SM_N][SC_AA][DP][CPU_MMX] = _op_blend_pt_pas_caa_dp_mmx;
151 op_blend_pt_funcs[SP_AN][SM_N][SC_AA][DP][CPU_MMX] = _op_blend_pt_pan_caa_dp_mmx;
152
153 op_blend_pt_funcs[SP][SM_N][SC][DP_AN][CPU_MMX] = _op_blend_pt_p_c_dpan_mmx;
154 op_blend_pt_funcs[SP_AS][SM_N][SC][DP_AN][CPU_MMX] = _op_blend_pt_pas_c_dpan_mmx;
155 op_blend_pt_funcs[SP_AN][SM_N][SC][DP_AN][CPU_MMX] = _op_blend_pt_pan_c_dpan_mmx;
156 op_blend_pt_funcs[SP][SM_N][SC_AN][DP_AN][CPU_MMX] = _op_blend_pt_p_can_dpan_mmx;
157 op_blend_pt_funcs[SP_AS][SM_N][SC_AN][DP_AN][CPU_MMX] = _op_blend_pt_pas_can_dpan_mmx;
158 op_blend_pt_funcs[SP_AN][SM_N][SC_AN][DP_AN][CPU_MMX] = _op_blend_pt_pan_can_dpan_mmx;
159 op_blend_pt_funcs[SP][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_blend_pt_p_caa_dpan_mmx;
160 op_blend_pt_funcs[SP_AS][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_blend_pt_pas_caa_dpan_mmx;
161 op_blend_pt_funcs[SP_AN][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_blend_pt_pan_caa_dpan_mmx;
162}
163#endif
164
165/*-----*/
166
167/* blend_rel pixel x color -> dst */
168
169#ifdef BUILD_MMX
170
171#define _op_blend_rel_p_c_dpan_mmx _op_blend_p_c_dpan_mmx
172#define _op_blend_rel_pas_c_dpan_mmx _op_blend_pas_c_dpan_mmx
173#define _op_blend_rel_pan_c_dpan_mmx _op_blend_pan_c_dpan_mmx
174#define _op_blend_rel_p_can_dpan_mmx _op_blend_p_can_dpan_mmx
175#define _op_blend_rel_pas_can_dpan_mmx _op_blend_pas_can_dpan_mmx
176#define _op_blend_rel_pan_can_dpan_mmx _op_blend_pan_can_dpan_mmx
177#define _op_blend_rel_p_caa_dpan_mmx _op_blend_p_caa_dpan_mmx
178#define _op_blend_rel_pas_caa_dpan_mmx _op_blend_pas_caa_dpan_mmx
179#define _op_blend_rel_pan_caa_dpan_mmx _op_blend_pan_caa_dpan_mmx
180
181static void
182init_blend_rel_pixel_color_span_funcs_mmx(void)
183{
184 op_blend_rel_span_funcs[SP][SM_N][SC][DP_AN][CPU_MMX] = _op_blend_rel_p_c_dpan_mmx;
185 op_blend_rel_span_funcs[SP_AS][SM_N][SC][DP_AN][CPU_MMX] = _op_blend_rel_pas_c_dpan_mmx;
186 op_blend_rel_span_funcs[SP_AN][SM_N][SC][DP_AN][CPU_MMX] = _op_blend_rel_pan_c_dpan_mmx;
187 op_blend_rel_span_funcs[SP][SM_N][SC_AN][DP_AN][CPU_MMX] = _op_blend_rel_p_can_dpan_mmx;
188 op_blend_rel_span_funcs[SP_AS][SM_N][SC_AN][DP_AN][CPU_MMX] = _op_blend_rel_pas_can_dpan_mmx;
189 op_blend_rel_span_funcs[SP_AN][SM_N][SC_AN][DP_AN][CPU_MMX] = _op_blend_rel_pan_can_dpan_mmx;
190 op_blend_rel_span_funcs[SP][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_blend_rel_p_caa_dpan_mmx;
191 op_blend_rel_span_funcs[SP_AS][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_blend_rel_pas_caa_dpan_mmx;
192 op_blend_rel_span_funcs[SP_AN][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_blend_rel_pan_caa_dpan_mmx;
193}
194#endif
195
196#ifdef BUILD_MMX
197
198#define _op_blend_rel_pt_p_c_dpan_mmx _op_blend_pt_p_c_dpan_mmx
199#define _op_blend_rel_pt_pas_c_dpan_mmx _op_blend_pt_pas_c_dpan_mmx
200#define _op_blend_rel_pt_pan_c_dpan_mmx _op_blend_pt_pan_c_dpan_mmx
201#define _op_blend_rel_pt_p_can_dpan_mmx _op_blend_pt_p_can_dpan_mmx
202#define _op_blend_rel_pt_pas_can_dpan_mmx _op_blend_pt_pas_can_dpan_mmx
203#define _op_blend_rel_pt_pan_can_dpan_mmx _op_blend_pt_pan_can_dpan_mmx
204#define _op_blend_rel_pt_p_caa_dpan_mmx _op_blend_pt_p_caa_dpan_mmx
205#define _op_blend_rel_pt_pas_caa_dpan_mmx _op_blend_pt_pas_caa_dpan_mmx
206#define _op_blend_rel_pt_pan_caa_dpan_mmx _op_blend_pt_pan_caa_dpan_mmx
207
208static void
209init_blend_rel_pixel_color_pt_funcs_mmx(void)
210{
211 op_blend_rel_pt_funcs[SP][SM_N][SC][DP_AN][CPU_MMX] = _op_blend_rel_pt_p_c_dpan_mmx;
212 op_blend_rel_pt_funcs[SP_AS][SM_N][SC][DP_AN][CPU_MMX] = _op_blend_rel_pt_pas_c_dpan_mmx;
213 op_blend_rel_pt_funcs[SP_AN][SM_N][SC][DP_AN][CPU_MMX] = _op_blend_rel_pt_pan_c_dpan_mmx;
214 op_blend_rel_pt_funcs[SP][SM_N][SC_AN][DP_AN][CPU_MMX] = _op_blend_rel_pt_p_can_dpan_mmx;
215 op_blend_rel_pt_funcs[SP_AS][SM_N][SC_AN][DP_AN][CPU_MMX] = _op_blend_rel_pt_pas_can_dpan_mmx;
216 op_blend_rel_pt_funcs[SP_AN][SM_N][SC_AN][DP_AN][CPU_MMX] = _op_blend_rel_pt_pan_can_dpan_mmx;
217 op_blend_rel_pt_funcs[SP][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_blend_rel_pt_p_caa_dpan_mmx;
218 op_blend_rel_pt_funcs[SP_AS][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_blend_rel_pt_pas_caa_dpan_mmx;
219 op_blend_rel_pt_funcs[SP_AN][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_blend_rel_pt_pan_caa_dpan_mmx;
220}
221#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_color_neon.c b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_color_neon.c
new file mode 100644
index 0000000..6e35970
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_color_neon.c
@@ -0,0 +1,570 @@
1/* blend pixel x color --> dst */
2#ifdef BUILD_NEON
3/* Note: Optimisation is based on keeping _dest_ aligned: else it's a pair of
4 * reads, then two writes, a miss on read is 'just' two reads */
5static void
6_op_blend_p_c_dp_neon(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) {
7#define AP "blend_p_c_dp_"
8 asm volatile (
9 ".fpu neon \n\t"
10 // Load 'c'
11 "vdup.u32 q7, %[c] \n\t"
12 "vmov.i8 q6, #1 \n\t"
13
14 // Choose a loop
15 "andS %[tmp], %[d], $0xf \n\t"
16 "beq "AP"quadstart \n\t"
17
18 "andS %[tmp],%[d], $0x4 \n\t"
19 "beq "AP"dualloop \n\t"
20
21 AP"singleloop:"
22 "vld1.32 d0[0], [%[s]]! \n\t"
23 "vld1.32 d2[0], [%[d]] \n\t"
24 // Mulitply s * c (= sc)
25 "vmull.u8 q4, d0,d14 \n\t"
26 // sc in d8
27 "vqrshrn.u16 d4, q4, #8 \n\t"
28
29 // sca in d9
30 "vmvn.u32 d6, d4 \n\t"
31 "vshr.u32 d6, d6, #24 \n\t"
32
33 "vmul.u32 d6, d12, d6 \n\t"
34
35 /* d * alpha */
36 "vmull.u8 q4, d6, d2 \n\t"
37 "vqrshrn.u16 d0, q4, #8 \n\t"
38
39 "vqadd.u8 d2, d0, d4 \n\t"
40
41 // Save dsc + sc
42 "vst1.32 d2[0], [%[d]]! \n\t"
43
44 // Now where?
45 // Can we go the fast path?
46 "andS %[tmp], %[d],$0xf \n\t"
47 "beq "AP"quadstart \n\t"
48
49 AP"dualloop: \n\t"
50 // Check we have enough to bother with!
51 "sub %[tmp], %[e], %[d] \n\t"
52 "cmp %[tmp], #16 \n\t"
53 "blt "AP"loopout \n\t"
54
55 // load 's' -> q0, 'd' -> q1
56 "vldm %[s]!, {d0} \n\t"
57 "vldm %[d], {d2} \n\t"
58 // Mulitply s * c (= sc)
59 "vmull.u8 q4, d0,d14 \n\t"
60 // sc in d8
61 "vqrshrn.u16 d4, q4, #8 \n\t"
62
63 // sca in d9
64 "vmvn.u32 d6, d4 \n\t"
65 "vshr.u32 d6, d6, #24 \n\t"
66
67 "vmul.u32 d6, d12, d6 \n\t"
68
69 /* d * alpha */
70 "vmull.u8 q4, d6, d2 \n\t"
71 "vqrshrn.u16 d0, q4, #8 \n\t"
72
73 "vqadd.u8 d2, d0, d4 \n\t"
74
75 // Save dsc + sc
76 "vst1.32 d2, [%[d]]! \n\t"
77
78 AP"quadstart: \n\t"
79 "sub %[tmp], %[e], %[d] \n\t"
80 "cmp %[tmp], #16 \n\t"
81 "blt "AP"loopout \n\t"
82
83 "sub %[tmp], %[e], #15 \n\t"
84
85 AP"quadloop:\n\t"
86 // load 's' -> q0, 'd' -> q1
87 "vldm %[s]!, {d0,d1} \n\t"
88 "vldm %[d], {d2,d3} \n\t"
89 // Mulitply s * c (= sc)
90 "vmull.u8 q4, d0,d14 \n\t"
91 "vmull.u8 q5, d1,d14 \n\t"
92
93 // Get sc & sc alpha
94 "vqrshrn.u16 d4, q4, #8 \n\t"
95 "vqrshrn.u16 d5, q5, #8 \n\t"
96 // sc is now in q2, 8bpp
97 // Shift out, then spread alpha for q2
98 "vmvn.u32 q3, q2 \n\t"
99 "vshr.u32 q3, q3, $0x18 \n\t"
100 "vmul.u32 q3, q6,q3 \n\t"
101
102 // Multiply 'd' by sc.alpha (dsca)
103 "vmull.u8 q4, d6,d2 \n\t"
104 "vmull.u8 q5, d7,d3 \n\t"
105
106 "vqrshrn.u16 d0, q4, #8 \n\t"
107 "vqrshrn.u16 d1, q5, #8 \n\t"
108
109 "vqadd.u8 q1, q0, q2 \n\t"
110
111 // Save dsc + sc
112 "vstm %[d]!, {d2,d3} \n\t"
113
114 "cmp %[tmp], %[d] \n\t"
115
116 "bhi "AP"quadloop \n\t"
117
118 /* Trailing stuff */
119 AP"loopout: \n\t"
120
121 "cmp %[d], %[e] \n\t"
122 "beq "AP"done\n\t"
123 "sub %[tmp],%[e], %[d] \n\t"
124 "cmp %[tmp],$0x04 \n\t"
125 "beq "AP"singleloop2 \n\t"
126
127 "sub %[tmp], %[e], #7 \n\t"
128 /* Dual loop */
129 AP"dualloop2: \n\t"
130 "vldm %[s]!, {d0} \n\t"
131 "vldm %[d], {d2} \n\t"
132 // Mulitply s * c (= sc)
133 "vmull.u8 q4, d0,d14 \n\t"
134 // sc in d8
135 "vqrshrn.u16 d4, q4, #8 \n\t"
136
137 // sca in d9
138 // XXX: I can probably squash one of these 3
139 "vmvn.u32 d6, d4 \n\t"
140 "vshr.u32 d6, d6, #24 \n\t"
141 "vmul.u32 d6, d6, d12 \n\t"
142
143 /* d * alpha */
144 "vmull.u8 q4, d6, d2 \n\t"
145 "vqrshrn.u16 d0, q4, #8 \n\t"
146
147 "vqadd.u8 d2, d0, d4 \n\t"
148
149 // Save dsc + sc
150 "vstm %[d]!, {d2} \n\t"
151
152 "cmp %[tmp], %[d] \n\t"
153 "bhi "AP"dualloop2 \n\t"
154
155 "cmp %[d], %[e] \n\t"
156 "beq "AP"done \n\t"
157
158 AP"singleloop2: \n\t"
159 "vld1.32 d0[0], [%[s]]! \n\t"
160 "vld1.32 d2[0], [%[d]] \n\t"
161 // Mulitply s * c (= sc)
162 "vmull.u8 q4, d0,d14 \n\t"
163 // sc in d8
164 "vqrshrn.u16 d4, q4, #8 \n\t"
165
166 // sca in d6
167 "vmvn.u32 d6, d4 \n\t"
168 "vshr.u32 d6, d6, #24 \n\t"
169 "vmul.u32 d6, d12,d6 \n\t"
170
171 /* d * alpha */
172 "vmull.u8 q4, d6, d2 \n\t"
173 "vqrshrn.u16 d0, q4, #8 \n\t"
174
175 "vqadd.u8 d2, d0, d4 \n\t"
176
177 // Save dsc + sc
178 "vst1.32 d2[0], [%[d]]! \n\t"
179
180
181 AP"done:"
182 : // No output
183 //
184 : [s] "r" (s), [e] "r" (d + l), [d] "r" (d), [c] "r" (c),
185 [tmp] "r" (12)
186 : "q0","q1","q2","q3","q4","q5","q6","q7","memory"
187 );
188#undef AP
189}
190
191static void
192_op_blend_pan_can_dp_neon(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) {
193 DATA32 *e;
194 UNROLL8_PLD_WHILE(d, l, e,
195 {
196 *d++ = 0xff000000 + MUL3_SYM(c, *s);
197 s++;
198 });
199}
200
201static void
202_op_blend_pan_caa_dp_neon(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) {
203#if 1
204 DATA32 *e;
205 int alpha;
206 c = 1 + (c & 0xff);
207 UNROLL8_PLD_WHILE(d, l, e,
208 {
209 DATA32 sc = MUL_256(c, *s);
210 alpha = 256 - (sc >> 24);
211 *d = sc + MUL_256(alpha, *d);
212 d++;
213 s++;
214 });
215#else // the below neon is buggy!! misses rendering of spans, i think with alignment. quick - just disable this.
216#define AP "_op_blend_pan_caa_dp_"
217 DATA32 *e = d + l, *tmp = (void*)73;
218 asm volatile (
219 ".fpu neon \n\t"
220 /* Set up 'c' */
221 "vdup.u8 d14, %[c] \n\t"
222 "vmov.i8 d15, #1 \n\t"
223 "vaddl.u8 q15, d14, d15 \n\t"
224 "vshr.u8 q15,#1 \n\t"
225
226 // Pick a loop
227 "andS %[tmp], %[d], $0xf \n\t"
228 "beq "AP"quadstart \n\t"
229
230 "andS %[tmp], %[d], $0x4 \n\t"
231 "beq "AP"dualstart \n\t"
232
233 AP"singleloop: \n\t"
234 "vld1.32 d4[0], [%[d]] \n\t"
235 "vld1.32 d0[0], [%[s]]! \n\t"
236
237 // Long version of 'd'
238 "vmovl.u8 q8, d4 \n\t"
239
240 // Long version of 's'
241 "vmovl.u8 q6, d0 \n\t"
242
243 // d8 = s -d
244 "vsub.s16 d8, d12, d16 \n\t"
245
246 // Multiply
247 "vmul.s16 d8, d8, d30 \n\t"
248
249 // Shift down
250 "vshr.s16 d8, #7 \n\t"
251
252 // Add 'd'
253 "vqadd.s16 d8, d8, d16 \n\t"
254
255 // Shrink to save
256 "vqmovun.s16 d0, q4 \n\t"
257 "vst1.32 d0[0], [%[d]]! \n\t"
258
259 // Now where?
260 "andS %[tmp], %[d], $0xf \n\t"
261 "beq "AP"quadstart \n\t"
262
263 AP"dualstart: \n\t"
264 // Check we have enough
265 "sub %[tmp], %[e], %[d] \n\t"
266 "cmp %[tmp], #16 \n\t"
267 "blt "AP"loopout \n\t"
268
269 AP"dualloop:"
270 "vldm %[d], {d4} \n\t"
271 "vldm %[s]!, {d0} \n\t"
272
273 // Long version of d
274 "vmovl.u8 q8, d4 \n\t"
275
276 // Long version of s
277 "vmovl.u8 q6, d0 \n\t"
278
279 // q4/q5 = s-d
280 "vsub.s16 q4, q6, q8 \n\t"
281
282 // Multiply
283 "vmul.s16 q4, q4,q15 \n\t"
284
285 // Shift down
286 "vshr.s16 q4, #7 \n\t"
287
288 // Add d
289 "vqadd.s16 q4, q4, q8 \n\t"
290
291 // Shrink to save
292 "vqmovun.s16 d0, q4 \n\t"
293
294 "vstm %[d]!, {d0} \n\t"
295 AP"quadstart: \n\t"
296 "sub %[tmp], %[e], %[d] \n\t"
297 "cmp %[tmp], #16 \n\t"
298 "blt "AP"loopout \n\t"
299
300 "sub %[tmp], %[e], #15 \n\t"
301
302 AP"quadloop: \n\t"
303 // load 's' -> q0, 'd' -> q2
304 "vldm %[d], {d4,d5} \n\t"
305 "vldm %[s]!, {d0,d1} \n\t"
306
307 // Long version of d
308 "vmovl.u8 q8, d4 \n\t"
309 "vmovl.u8 q9, d5 \n\t"
310
311 // Long version of s
312 "vmovl.u8 q6, d0 \n\t"
313 "vmovl.u8 q7, d1 \n\t"
314
315 // q4/q5 = s-d
316 "vsub.s16 q4, q6, q8 \n\t"
317 "vsub.s16 q5, q7, q9 \n\t"
318
319 // Multiply
320 "vmul.s16 q4, q4,q15 \n\t"
321 "vmul.s16 q5, q5,q15 \n\t"
322
323 // Shift down
324 "vshr.s16 q4, #7 \n\t"
325 "vshr.s16 q5, #7 \n\t"
326
327 // Add d
328 "vqadd.s16 q4, q4, q8 \n\t"
329 "vqadd.s16 q5, q5, q9 \n\t"
330
331 // Shrink to save
332 "vqmovun.s16 d0, q4 \n\t"
333 "vqmovun.s16 d1, q5 \n\t"
334 "vstm %[d]!, {d0,d1} \n\t"
335 "cmp %[tmp], %[d] \n\t"
336
337 "bhi "AP"quadloop\n\t"
338
339
340 "b "AP"done\n\t"
341 AP"loopout: \n\t"
342 "cmp %[d], %[e] \n\t"
343 "beq "AP"done\n\t"
344 "sub %[tmp],%[e], %[d] \n\t"
345 "cmp %[tmp],$0x04 \n\t"
346 "beq "AP"singleloop2 \n\t"
347
348 AP"dualloop2: \n\t"
349 "vldm %[d], {d4} \n\t"
350 "vldm %[s]!, {d0} \n\t"
351
352 // Long version of d
353 "vmovl.u8 q8, d4 \n\t"
354
355 // Long version of s
356 "vmovl.u8 q6, d0 \n\t"
357
358 // q4/q5 = s-d
359 "vsub.s16 q4, q6, q8 \n\t"
360
361 // Multiply
362 "vmul.s16 q4, q4,q15 \n\t"
363
364 // Shift down
365 "vshr.s16 q4, #7 \n\t"
366
367 // Add d
368 "vqadd.s16 q4, q4, q8 \n\t"
369
370 // Shrink to save
371 "vqmovun.s16 d0, q4 \n\t"
372
373 "vstm %[d]!, {d0} \n\t"
374
375 "cmp %[d], %[e] \n\t"
376 "beq "AP"done \n\t"
377
378 AP"singleloop2: \n\t"
379 "vld1.32 d4[0], [%[d]] \n\t"
380 "vld1.32 d0[0], [%[s]]! \n\t"
381
382 // Long version of 'd'
383 "vmovl.u8 q8, d4 \n\t"
384
385 // Long version of 's'
386 "vmovl.u8 q6, d0 \n\t"
387
388 // d8 = s -d
389 "vsub.s16 d8, d12, d16 \n\t"
390
391 // Multiply
392 "vmul.s16 d8, d8, d30 \n\t"
393
394 // Shift down
395 "vshr.s16 d8, #7 \n\t"
396
397 // Add 'd'
398 "vqadd.s16 d8, d8, d16 \n\t"
399
400 // Shrink to save
401 "vqmovun.s16 d0, q4 \n\t"
402
403 "vst1.32 d0[0], [%[d]] \n\t"
404
405
406 AP"done: \n\t"
407
408 // No output
409 :
410 // Input
411 : [s] "r" (s), [d] "r" (d), [e] "r" (e), [c] "r" (c), [tmp] "r" (tmp)
412 // Clobbered
413 : "q0", "q1", "q2", "q3", "q4", "q5", "q6", "q7", "q8", "q9", "memory"
414 );
415#undef AP
416#endif
417}
418
419#define _op_blend_pas_c_dp_neon _op_blend_p_c_dp_neon
420#define _op_blend_pan_c_dp_neon _op_blend_p_c_dp_neon
421#define _op_blend_p_can_dp_neon _op_blend_p_c_dp_neon
422#define _op_blend_pas_can_dp_neon _op_blend_p_c_dp_neon
423#define _op_blend_p_caa_dp_neon _op_blend_p_c_dp_neon
424#define _op_blend_pas_caa_dp_neon _op_blend_p_c_dp_neon
425
426#define _op_blend_p_c_dpan_neon _op_blend_p_c_dp_neon
427#define _op_blend_pas_c_dpan_neon _op_blend_pas_c_dp_neon
428#define _op_blend_pan_c_dpan_neon _op_blend_pan_c_dp_neon
429#define _op_blend_p_can_dpan_neon _op_blend_p_can_dp_neon
430#define _op_blend_pas_can_dpan_neon _op_blend_pas_can_dp_neon
431#define _op_blend_pan_can_dpan_neon _op_blend_pan_can_dp_neon
432#define _op_blend_p_caa_dpan_neon _op_blend_p_caa_dp_neon
433#define _op_blend_pas_caa_dpan_neon _op_blend_pas_caa_dp_neon
434#define _op_blend_pan_caa_dpan_neon _op_blend_pan_caa_dp_neon
435
436
437static void
438init_blend_pixel_color_span_funcs_neon(void)
439{
440 op_blend_span_funcs[SP][SM_N][SC][DP][CPU_NEON] = _op_blend_p_c_dp_neon;
441 op_blend_span_funcs[SP_AS][SM_N][SC][DP][CPU_NEON] = _op_blend_pas_c_dp_neon;
442 op_blend_span_funcs[SP_AN][SM_N][SC][DP][CPU_NEON] = _op_blend_pan_c_dp_neon;
443 op_blend_span_funcs[SP][SM_N][SC_AN][DP][CPU_NEON] = _op_blend_p_can_dp_neon;
444 op_blend_span_funcs[SP_AS][SM_N][SC_AN][DP][CPU_NEON] = _op_blend_pas_can_dp_neon;
445 op_blend_span_funcs[SP_AN][SM_N][SC_AN][DP][CPU_NEON] = _op_blend_pan_can_dp_neon;
446 op_blend_span_funcs[SP][SM_N][SC_AA][DP][CPU_NEON] = _op_blend_p_caa_dp_neon;
447 op_blend_span_funcs[SP_AS][SM_N][SC_AA][DP][CPU_NEON] = _op_blend_pas_caa_dp_neon;
448 op_blend_span_funcs[SP_AN][SM_N][SC_AA][DP][CPU_NEON] = _op_blend_pan_caa_dp_neon;
449
450 op_blend_span_funcs[SP][SM_N][SC][DP_AN][CPU_NEON] = _op_blend_p_c_dpan_neon;
451 op_blend_span_funcs[SP_AS][SM_N][SC][DP_AN][CPU_NEON] = _op_blend_pas_c_dpan_neon;
452 op_blend_span_funcs[SP_AN][SM_N][SC][DP_AN][CPU_NEON] = _op_blend_pan_c_dpan_neon;
453 op_blend_span_funcs[SP][SM_N][SC_AN][DP_AN][CPU_NEON] = _op_blend_p_can_dpan_neon;
454 op_blend_span_funcs[SP_AS][SM_N][SC_AN][DP_AN][CPU_NEON] = _op_blend_pas_can_dpan_neon;
455 op_blend_span_funcs[SP_AN][SM_N][SC_AN][DP_AN][CPU_NEON] = _op_blend_pan_can_dpan_neon;
456 op_blend_span_funcs[SP][SM_N][SC_AA][DP_AN][CPU_NEON] = _op_blend_p_caa_dpan_neon;
457 op_blend_span_funcs[SP_AS][SM_N][SC_AA][DP_AN][CPU_NEON] = _op_blend_pas_caa_dpan_neon;
458 op_blend_span_funcs[SP_AN][SM_N][SC_AA][DP_AN][CPU_NEON] = _op_blend_pan_caa_dpan_neon;
459}
460#endif
461
462#ifdef BUILD_NEON
463static void
464_op_blend_pt_p_c_dp_neon(DATA32 s, DATA8 m __UNUSED__, DATA32 c, DATA32 *d) {
465 s = MUL4_SYM(c, s);
466 c = 256 - (s >> 24);
467 *d = s + MUL_256(c, *d);
468}
469
470#define _op_blend_pt_pas_c_dp_neon _op_blend_pt_p_c_dp_neon
471#define _op_blend_pt_pan_c_dp_neon _op_blend_pt_p_c_dp_neon
472#define _op_blend_pt_p_can_dp_neon _op_blend_pt_p_c_dp_neon
473#define _op_blend_pt_pas_can_dp_neon _op_blend_pt_p_c_dp_neon
474#define _op_blend_pt_pan_can_dp_neon _op_blend_pt_p_c_dp_neon
475#define _op_blend_pt_p_caa_dp_neon _op_blend_pt_p_c_dp_neon
476#define _op_blend_pt_pas_caa_dp_neon _op_blend_pt_p_c_dp_neon
477#define _op_blend_pt_pan_caa_dp_neon _op_blend_pt_p_c_dp_neon
478
479#define _op_blend_pt_p_c_dpan_neon _op_blend_pt_p_c_dp_neon
480#define _op_blend_pt_pas_c_dpan_neon _op_blend_pt_p_c_dp_neon
481#define _op_blend_pt_pan_c_dpan_neon _op_blend_pt_p_c_dp_neon
482#define _op_blend_pt_p_can_dpan_neon _op_blend_pt_p_c_dp_neon
483#define _op_blend_pt_pas_can_dpan_neon _op_blend_pt_p_c_dp_neon
484#define _op_blend_pt_pan_can_dpan_neon _op_blend_pt_p_c_dp_neon
485#define _op_blend_pt_p_caa_dpan_neon _op_blend_pt_p_c_dp_neon
486#define _op_blend_pt_pas_caa_dpan_neon _op_blend_pt_p_c_dp_neon
487#define _op_blend_pt_pan_caa_dpan_neon _op_blend_pt_p_c_dp_neon
488
489static void
490init_blend_pixel_color_pt_funcs_neon(void)
491{
492 op_blend_pt_funcs[SP][SM_N][SC][DP][CPU_NEON] = _op_blend_pt_p_c_dp_neon;
493 op_blend_pt_funcs[SP_AS][SM_N][SC][DP][CPU_NEON] = _op_blend_pt_pas_c_dp_neon;
494 op_blend_pt_funcs[SP_AN][SM_N][SC][DP][CPU_NEON] = _op_blend_pt_pan_c_dp_neon;
495 op_blend_pt_funcs[SP][SM_N][SC_AN][DP][CPU_NEON] = _op_blend_pt_p_can_dp_neon;
496 op_blend_pt_funcs[SP_AS][SM_N][SC_AN][DP][CPU_NEON] = _op_blend_pt_pas_can_dp_neon;
497 op_blend_pt_funcs[SP_AN][SM_N][SC_AN][DP][CPU_NEON] = _op_blend_pt_pan_can_dp_neon;
498 op_blend_pt_funcs[SP][SM_N][SC_AA][DP][CPU_NEON] = _op_blend_pt_p_caa_dp_neon;
499 op_blend_pt_funcs[SP_AS][SM_N][SC_AA][DP][CPU_NEON] = _op_blend_pt_pas_caa_dp_neon;
500 op_blend_pt_funcs[SP_AN][SM_N][SC_AA][DP][CPU_NEON] = _op_blend_pt_pan_caa_dp_neon;
501
502 op_blend_pt_funcs[SP][SM_N][SC][DP_AN][CPU_NEON] = _op_blend_pt_p_c_dpan_neon;
503 op_blend_pt_funcs[SP_AS][SM_N][SC][DP_AN][CPU_NEON] = _op_blend_pt_pas_c_dpan_neon;
504 op_blend_pt_funcs[SP_AN][SM_N][SC][DP_AN][CPU_NEON] = _op_blend_pt_pan_c_dpan_neon;
505 op_blend_pt_funcs[SP][SM_N][SC_AN][DP_AN][CPU_NEON] = _op_blend_pt_p_can_dpan_neon;
506 op_blend_pt_funcs[SP_AS][SM_N][SC_AN][DP_AN][CPU_NEON] = _op_blend_pt_pas_can_dpan_neon;
507 op_blend_pt_funcs[SP_AN][SM_N][SC_AN][DP_AN][CPU_NEON] = _op_blend_pt_pan_can_dpan_neon;
508 op_blend_pt_funcs[SP][SM_N][SC_AA][DP_AN][CPU_NEON] = _op_blend_pt_p_caa_dpan_neon;
509 op_blend_pt_funcs[SP_AS][SM_N][SC_AA][DP_AN][CPU_NEON] = _op_blend_pt_pas_caa_dpan_neon;
510 op_blend_pt_funcs[SP_AN][SM_N][SC_AA][DP_AN][CPU_NEON] = _op_blend_pt_pan_caa_dpan_neon;
511}
512#endif
513
514/*-----*/
515
516/* blend_rel pixel x color -> dst */
517
518#ifdef BUILD_NEON
519
520#define _op_blend_rel_p_c_dpan_neon _op_blend_p_c_dpan_neon
521#define _op_blend_rel_pas_c_dpan_neon _op_blend_pas_c_dpan_neon
522#define _op_blend_rel_pan_c_dpan_neon _op_blend_pan_c_dpan_neon
523#define _op_blend_rel_p_can_dpan_neon _op_blend_p_can_dpan_neon
524#define _op_blend_rel_pas_can_dpan_neon _op_blend_pas_can_dpan_neon
525#define _op_blend_rel_pan_can_dpan_neon _op_blend_pan_can_dpan_neon
526#define _op_blend_rel_p_caa_dpan_neon _op_blend_p_caa_dpan_neon
527#define _op_blend_rel_pas_caa_dpan_neon _op_blend_pas_caa_dpan_neon
528#define _op_blend_rel_pan_caa_dpan_neon _op_blend_pan_caa_dpan_neon
529
530static void
531init_blend_rel_pixel_color_span_funcs_neon(void)
532{
533 op_blend_rel_span_funcs[SP][SM_N][SC][DP_AN][CPU_NEON] = _op_blend_rel_p_c_dpan_neon;
534 op_blend_rel_span_funcs[SP_AS][SM_N][SC][DP_AN][CPU_NEON] = _op_blend_rel_pas_c_dpan_neon;
535 op_blend_rel_span_funcs[SP_AN][SM_N][SC][DP_AN][CPU_NEON] = _op_blend_rel_pan_c_dpan_neon;
536 op_blend_rel_span_funcs[SP][SM_N][SC_AN][DP_AN][CPU_NEON] = _op_blend_rel_p_can_dpan_neon;
537 op_blend_rel_span_funcs[SP_AS][SM_N][SC_AN][DP_AN][CPU_NEON] = _op_blend_rel_pas_can_dpan_neon;
538 op_blend_rel_span_funcs[SP_AN][SM_N][SC_AN][DP_AN][CPU_NEON] = _op_blend_rel_pan_can_dpan_neon;
539 op_blend_rel_span_funcs[SP][SM_N][SC_AA][DP_AN][CPU_NEON] = _op_blend_rel_p_caa_dpan_neon;
540 op_blend_rel_span_funcs[SP_AS][SM_N][SC_AA][DP_AN][CPU_NEON] = _op_blend_rel_pas_caa_dpan_neon;
541 op_blend_rel_span_funcs[SP_AN][SM_N][SC_AA][DP_AN][CPU_NEON] = _op_blend_rel_pan_caa_dpan_neon;
542}
543#endif
544
545#ifdef BUILD_NEON
546
547#define _op_blend_rel_pt_p_c_dpan_neon _op_blend_pt_p_c_dpan_neon
548#define _op_blend_rel_pt_pas_c_dpan_neon _op_blend_pt_pas_c_dpan_neon
549#define _op_blend_rel_pt_pan_c_dpan_neon _op_blend_pt_pan_c_dpan_neon
550#define _op_blend_rel_pt_p_can_dpan_neon _op_blend_pt_p_can_dpan_neon
551#define _op_blend_rel_pt_pas_can_dpan_neon _op_blend_pt_pas_can_dpan_neon
552#define _op_blend_rel_pt_pan_can_dpan_neon _op_blend_pt_pan_can_dpan_neon
553#define _op_blend_rel_pt_p_caa_dpan_neon _op_blend_pt_p_caa_dpan_neon
554#define _op_blend_rel_pt_pas_caa_dpan_neon _op_blend_pt_pas_caa_dpan_neon
555#define _op_blend_rel_pt_pan_caa_dpan_neon _op_blend_pt_pan_caa_dpan_neon
556
557static void
558init_blend_rel_pixel_color_pt_funcs_neon(void)
559{
560 op_blend_rel_pt_funcs[SP][SM_N][SC][DP_AN][CPU_NEON] = _op_blend_rel_pt_p_c_dpan_neon;
561 op_blend_rel_pt_funcs[SP_AS][SM_N][SC][DP_AN][CPU_NEON] = _op_blend_rel_pt_pas_c_dpan_neon;
562 op_blend_rel_pt_funcs[SP_AN][SM_N][SC][DP_AN][CPU_NEON] = _op_blend_rel_pt_pan_c_dpan_neon;
563 op_blend_rel_pt_funcs[SP][SM_N][SC_AN][DP_AN][CPU_NEON] = _op_blend_rel_pt_p_can_dpan_neon;
564 op_blend_rel_pt_funcs[SP_AS][SM_N][SC_AN][DP_AN][CPU_NEON] = _op_blend_rel_pt_pas_can_dpan_neon;
565 op_blend_rel_pt_funcs[SP_AN][SM_N][SC_AN][DP_AN][CPU_NEON] = _op_blend_rel_pt_pan_can_dpan_neon;
566 op_blend_rel_pt_funcs[SP][SM_N][SC_AA][DP_AN][CPU_NEON] = _op_blend_rel_pt_p_caa_dpan_neon;
567 op_blend_rel_pt_funcs[SP_AS][SM_N][SC_AA][DP_AN][CPU_NEON] = _op_blend_rel_pt_pas_caa_dpan_neon;
568 op_blend_rel_pt_funcs[SP_AN][SM_N][SC_AA][DP_AN][CPU_NEON] = _op_blend_rel_pt_pan_caa_dpan_neon;
569}
570#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_color_sse3.c b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_color_sse3.c
new file mode 100644
index 0000000..4ee31f5
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_color_sse3.c
@@ -0,0 +1,543 @@
1/* blend pixel x color --> dst */
2
3#ifdef BUILD_SSE3
4
5static void
6_op_blend_p_c_dp_sse3(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) {
7
8 DATA32 alpha;
9
10 const __m128i c_packed = _mm_set_epi32(c, c, c, c);
11
12 LOOP_ALIGNED_U1_A48_SSE3(d, l,
13 { /* UOP */
14
15 DATA32 sc = MUL4_SYM(c, *s);
16 alpha = 256 - (sc >> 24);
17 *d = sc + MUL_256(alpha, *d);
18 d++; s++; l--;
19 },
20 { /* A4OP */
21
22 __m128i s0 = _mm_lddqu_si128((__m128i *)s);
23 __m128i d0 = _mm_load_si128((__m128i *)d);
24
25 __m128i sc0 = mul4_sym_sse3(c_packed, s0);
26 __m128i a0 = sub4_alpha_sse3(sc0);
27 __m128i mul0 = mul_256_sse3(a0, d0);
28
29 d0 = _mm_add_epi32(sc0, mul0);
30
31 _mm_store_si128((__m128i *)d, d0);
32
33 d += 4; s += 4; l -= 4;
34 },
35 { /* A8OP */
36
37 __m128i s0 = _mm_lddqu_si128((__m128i *)s);
38 __m128i d0 = _mm_load_si128((__m128i *)d);
39
40 __m128i s1 = _mm_lddqu_si128((__m128i *)(s+4));
41 __m128i d1 = _mm_load_si128((__m128i *)(d+4));
42
43 __m128i sc0 = mul4_sym_sse3(c_packed, s0);
44 __m128i sc1 = mul4_sym_sse3(c_packed, s1);
45
46 __m128i a0 = sub4_alpha_sse3(sc0);
47 __m128i a1 = sub4_alpha_sse3(sc1);
48
49 __m128i mul0 = mul_256_sse3(a0, d0);
50 __m128i mul1 = mul_256_sse3(a1, d1);
51
52 d0 = _mm_add_epi32(sc0, mul0);
53 d1 = _mm_add_epi32(sc1, mul1);
54
55 _mm_store_si128((__m128i *)d, d0);
56 _mm_store_si128((__m128i *)(d+4), d1);
57
58 d += 8; s += 8; l -= 8;
59 })
60}
61
62static void
63_op_blend_pan_c_dp_sse3(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) {
64
65 DATA32 c_a = c & 0xFF000000;
66 DATA32 alpha = 256 - (c >> 24);
67
68 const __m128i c_packed = _mm_set_epi32(c, c, c, c);
69 const __m128i c_alpha = _mm_set_epi32(c_a, c_a, c_a, c_a);
70 const __m128i a0 = _mm_set_epi32(alpha, alpha, alpha, alpha);
71
72 LOOP_ALIGNED_U1_A48_SSE3(d, l,
73 { /* UOP */
74
75 *d = ((c & 0xff000000) + MUL3_SYM(c, *s)) + MUL_256(alpha, *d);
76 d++; s++; l--;
77 },
78 { /* A4OP */
79
80 __m128i s0 = _mm_lddqu_si128((__m128i *)s);
81 __m128i d0 = _mm_load_si128((__m128i *)d);
82
83 __m128i r0 = _mm_add_epi32(mul3_sym_sse3(c_packed, s0),
84 mul_256_sse3(a0, d0));
85
86 r0 = _mm_add_epi32(r0, c_alpha);
87
88 _mm_store_si128((__m128i *)d, r0);
89
90 d += 4; s += 4; l -= 4;
91 },
92 { /* A8OP */
93
94 __m128i s0 = _mm_lddqu_si128((__m128i *)s);
95 __m128i d0 = _mm_load_si128((__m128i *)d);
96
97 __m128i s1 = _mm_lddqu_si128((__m128i *)(s+4));
98 __m128i d1 = _mm_load_si128((__m128i *)(d+4));
99
100 __m128i r0 = _mm_add_epi32(mul3_sym_sse3(c_packed, s0),
101 mul_256_sse3(a0, d0));
102
103 __m128i r1 = _mm_add_epi32(mul3_sym_sse3(c_packed, s1),
104 mul_256_sse3(a0, d1));
105
106 r0 = _mm_add_epi32(r0, c_alpha);
107 r1 = _mm_add_epi32(r1, c_alpha);
108
109 _mm_store_si128((__m128i *)d, r0);
110 _mm_store_si128((__m128i *)(d+4), r1);
111
112 d += 8; s += 8; l -= 8;
113 })
114}
115
116static void
117_op_blend_p_can_dp_sse3(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) {
118
119 int alpha;
120 const __m128i c_packed = _mm_set_epi32(c, c, c, c);
121
122 LOOP_ALIGNED_U1_A48_SSE3(d, l,
123 { /* UOP */
124
125 alpha = 256 - (*s >> 24);
126 *d = ((*s & 0xff000000) + MUL3_SYM(c, *s)) + MUL_256(alpha, *d);
127 d++; s++; l--;
128 },
129 { /* A4OP */
130
131 __m128i s0 = _mm_lddqu_si128((__m128i *)s);
132 __m128i d0 = _mm_load_si128((__m128i *)d);
133
134 __m128i a0 = sub4_alpha_sse3(s0);
135
136 __m128i r0 = _mm_add_epi32(mul3_sym_sse3(c_packed, s0),
137 mul_256_sse3(a0, d0));
138
139 r0 = _mm_add_epi32(r0, _mm_and_si128(s0, A_MASK_SSE3));
140
141 _mm_store_si128((__m128i *)d, r0);
142
143 d += 4; s += 4; l -= 4;
144 },
145 {
146 __m128i s0 = _mm_lddqu_si128((__m128i *)s);
147 __m128i d0 = _mm_load_si128((__m128i *)d);
148
149 __m128i s1 = _mm_lddqu_si128((__m128i *)(s+4));
150 __m128i d1 = _mm_load_si128((__m128i *)(d+4));
151
152 __m128i a0 = sub4_alpha_sse3(s0);
153 __m128i a1 = sub4_alpha_sse3(s1);
154
155 __m128i r0 = _mm_add_epi32(mul3_sym_sse3(c_packed, s0),
156 mul_256_sse3(a0, d0));
157
158 __m128i r1 = _mm_add_epi32(mul3_sym_sse3(c_packed, s1),
159 mul_256_sse3(a1, d1));
160
161 r0 = _mm_add_epi32(r0, _mm_and_si128(s0, A_MASK_SSE3));
162 r1 = _mm_add_epi32(r1, _mm_and_si128(s1, A_MASK_SSE3));
163
164 _mm_store_si128((__m128i *)d, r0);
165 _mm_store_si128((__m128i *)(d+4), r1);
166
167 d += 8; s += 8; l -= 8;
168 })
169}
170
171static void
172_op_blend_pan_can_dp_sse3(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) {
173
174 const __m128i c_packed = _mm_set_epi32(c, c, c, c);
175
176 LOOP_ALIGNED_U1_A48_SSE3(d, l,
177 { /* UOP */
178
179 *d++ = 0xff000000 + MUL3_SYM(c, *s);
180 s++; l--;
181 },
182 { /* A4OP */
183
184 __m128i s0 = _mm_lddqu_si128((__m128i *)s);
185
186 __m128i r0 = mul3_sym_sse3(c_packed, s0);
187 r0 = _mm_add_epi32(r0, A_MASK_SSE3);
188
189 _mm_store_si128((__m128i *)d, r0);
190
191 d += 4; s += 4; l -= 4;
192 },
193 { /* A8OP */
194
195 __m128i s0 = _mm_lddqu_si128((__m128i *)s);
196 __m128i s1 = _mm_lddqu_si128((__m128i *)(s+4));
197
198 __m128i r0 = mul3_sym_sse3(c_packed, s0);
199 __m128i r1 = mul3_sym_sse3(c_packed, s1);
200
201 r0 = _mm_add_epi32(r0, A_MASK_SSE3);
202 r1 = _mm_add_epi32(r1, A_MASK_SSE3);
203
204 _mm_store_si128((__m128i *)d, r0);
205 _mm_store_si128((__m128i *)(d+4), r1);
206
207 d += 8; s += 8; l -= 8;
208 })
209}
210
211static void
212_op_blend_p_caa_dp_sse3(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) {
213
214 int alpha;
215 c = 1 + (c & 0xff);
216 const __m128i c_packed = _mm_set_epi32(c, c, c, c);
217
218 LOOP_ALIGNED_U1_A48_SSE3(d, l,
219 { /* UOP */
220
221 DATA32 sc = MUL_256(c, *s);
222 alpha = 256 - (sc >> 24);
223 *d = sc + MUL_256(alpha, *d);
224 d++;
225 s++;
226 l--;
227 },
228 { /* A4OP */
229
230 __m128i s0 = _mm_lddqu_si128((__m128i *)s);
231 __m128i d0 = _mm_load_si128 ((__m128i *)d);
232
233 __m128i sc0 = mul_256_sse3(c_packed, s0);
234 __m128i a0 = sub4_alpha_sse3(sc0);
235
236 __m128i r0 = _mm_add_epi32(mul_256_sse3(a0, d0), sc0);
237
238 _mm_store_si128((__m128i *)d, r0);
239
240 d += 4; s += 4; l -= 4;
241 },
242 {
243 __m128i s0 = _mm_lddqu_si128((__m128i *)s);
244 __m128i d0 = _mm_load_si128((__m128i *)d);
245
246 __m128i s1 = _mm_lddqu_si128((__m128i *)(s+4));
247 __m128i d1 = _mm_load_si128((__m128i *)(d+4));
248
249 __m128i sc0 = mul_256_sse3(c_packed, s0);
250 __m128i sc1 = mul_256_sse3(c_packed, s1);
251
252 __m128i a0 = sub4_alpha_sse3(sc0);
253 __m128i a1 = sub4_alpha_sse3(sc1);
254
255 __m128i r0 = _mm_add_epi32(mul_256_sse3(a0, d0), sc0);
256 __m128i r1 = _mm_add_epi32(mul_256_sse3(a1, d1), sc1);
257
258 _mm_store_si128((__m128i *)d, r0);
259 _mm_store_si128((__m128i *)(d+4), r1);
260
261 d += 8; s += 8; l -= 8;
262 })
263}
264
265static void
266_op_blend_pan_caa_dp_sse3(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) {
267
268 c = 1 + (c & 0xff);
269 const __m128i c_packed = _mm_set_epi32(c, c, c,c);
270
271 LOOP_ALIGNED_U1_A48_SSE3(d, l,
272 { /* UOP */
273
274 *d = INTERP_256(c, *s, *d);
275 d++; s++; l--;
276 },
277 { /* A4OP */
278
279 __m128i s0 = _mm_lddqu_si128((__m128i *)s);
280 __m128i d0 = _mm_load_si128((__m128i *)d);
281
282 __m128i r0 = interp4_256_sse3(c_packed, s0, d0);
283
284 _mm_store_si128((__m128i *)d, r0);
285
286 d += 4; s += 4; l -= 4;
287 },
288 {
289
290 __m128i s0 = _mm_lddqu_si128((__m128i *)s);
291 __m128i d0 = _mm_load_si128((__m128i *)d);
292
293 __m128i s1 = _mm_lddqu_si128((__m128i *)(s+4));
294 __m128i d1 = _mm_load_si128((__m128i *)(d+4));
295
296 __m128i r0 = interp4_256_sse3(c_packed, s0, d0);
297 __m128i r1 = interp4_256_sse3(c_packed, s1, d1);
298
299 _mm_store_si128((__m128i *)d, r0);
300 _mm_store_si128((__m128i *)(d+4), r1);
301
302 d += 8; s += 8; l -= 8;
303 })
304}
305
306#define _op_blend_pas_c_dp_sse3 _op_blend_p_c_dp_sse3
307#define _op_blend_pas_can_dp_sse3 _op_blend_p_can_dp_sse3
308#define _op_blend_pas_caa_dp_sse3 _op_blend_p_caa_dp_sse3
309
310#define _op_blend_p_c_dpan_sse3 _op_blend_p_c_dp_sse3
311#define _op_blend_pas_c_dpan_sse3 _op_blend_pas_c_dp_sse3
312#define _op_blend_pan_c_dpan_sse3 _op_blend_pan_c_dp_sse3
313#define _op_blend_p_can_dpan_sse3 _op_blend_p_can_dp_sse3
314#define _op_blend_pas_can_dpan_sse3 _op_blend_pas_can_dp_sse3
315#define _op_blend_pan_can_dpan_sse3 _op_blend_pan_can_dp_sse3
316#define _op_blend_p_caa_dpan_sse3 _op_blend_p_caa_dp_sse3
317#define _op_blend_pas_caa_dpan_sse3 _op_blend_pas_caa_dp_sse3
318#define _op_blend_pan_caa_dpan_sse3 _op_blend_pan_caa_dp_sse3
319
320static void
321init_blend_pixel_color_span_funcs_sse3(void)
322{
323 op_blend_span_funcs[SP][SM_N][SC][DP][CPU_SSE3] = _op_blend_p_c_dp_sse3;
324 op_blend_span_funcs[SP_AS][SM_N][SC][DP][CPU_SSE3] = _op_blend_pas_c_dp_sse3;
325 op_blend_span_funcs[SP_AN][SM_N][SC][DP][CPU_SSE3] = _op_blend_pan_c_dp_sse3;
326 op_blend_span_funcs[SP][SM_N][SC_AN][DP][CPU_SSE3] = _op_blend_p_can_dp_sse3;
327 op_blend_span_funcs[SP_AS][SM_N][SC_AN][DP][CPU_SSE3] = _op_blend_pas_can_dp_sse3;
328 op_blend_span_funcs[SP_AN][SM_N][SC_AN][DP][CPU_SSE3] = _op_blend_pan_can_dp_sse3;
329 op_blend_span_funcs[SP][SM_N][SC_AA][DP][CPU_SSE3] = _op_blend_p_caa_dp_sse3;
330 op_blend_span_funcs[SP_AS][SM_N][SC_AA][DP][CPU_SSE3] = _op_blend_pas_caa_dp_sse3;
331 op_blend_span_funcs[SP_AN][SM_N][SC_AA][DP][CPU_SSE3] = _op_blend_pan_caa_dp_sse3;
332
333 op_blend_span_funcs[SP][SM_N][SC][DP_AN][CPU_SSE3] = _op_blend_p_c_dpan_sse3;
334 op_blend_span_funcs[SP_AS][SM_N][SC][DP_AN][CPU_SSE3] = _op_blend_pas_c_dpan_sse3;
335 op_blend_span_funcs[SP_AN][SM_N][SC][DP_AN][CPU_SSE3] = _op_blend_pan_c_dpan_sse3;
336 op_blend_span_funcs[SP][SM_N][SC_AN][DP_AN][CPU_SSE3] = _op_blend_p_can_dpan_sse3;
337 op_blend_span_funcs[SP_AS][SM_N][SC_AN][DP_AN][CPU_SSE3] = _op_blend_pas_can_dpan_sse3;
338 op_blend_span_funcs[SP_AN][SM_N][SC_AN][DP_AN][CPU_SSE3] = _op_blend_pan_can_dpan_sse3;
339 op_blend_span_funcs[SP][SM_N][SC_AA][DP_AN][CPU_SSE3] = _op_blend_p_caa_dpan_sse3;
340 op_blend_span_funcs[SP_AS][SM_N][SC_AA][DP_AN][CPU_SSE3] = _op_blend_pas_caa_dpan_sse3;
341 op_blend_span_funcs[SP_AN][SM_N][SC_AA][DP_AN][CPU_SSE3] = _op_blend_pan_caa_dpan_sse3;
342}
343
344#define _op_blend_pt_p_c_dp_sse3 NULL
345
346#define _op_blend_pt_pas_c_dp_sse3 _op_blend_pt_p_c_dp_sse3
347#define _op_blend_pt_pan_c_dp_sse3 _op_blend_pt_p_c_dp_sse3
348#define _op_blend_pt_p_can_dp_sse3 _op_blend_pt_p_c_dp_sse3
349#define _op_blend_pt_pas_can_dp_sse3 _op_blend_pt_p_c_dp_sse3
350#define _op_blend_pt_pan_can_dp_sse3 _op_blend_pt_p_c_dp_sse3
351#define _op_blend_pt_p_caa_dp_sse3 _op_blend_pt_p_c_dp_sse3
352#define _op_blend_pt_pas_caa_dp_sse3 _op_blend_pt_p_c_dp_sse3
353#define _op_blend_pt_pan_caa_dp_sse3 _op_blend_pt_p_c_dp_sse3
354
355#define _op_blend_pt_p_c_dpan_sse3 _op_blend_pt_p_c_dp_sse3
356#define _op_blend_pt_pas_c_dpan_sse3 _op_blend_pt_pas_c_dp_sse3
357#define _op_blend_pt_pan_c_dpan_sse3 _op_blend_pt_pan_c_dp_sse3
358#define _op_blend_pt_p_can_dpan_sse3 _op_blend_pt_p_can_dp_sse3
359#define _op_blend_pt_pas_can_dpan_sse3 _op_blend_pt_pas_can_dp_sse3
360#define _op_blend_pt_pan_can_dpan_sse3 _op_blend_pt_pan_can_dp_sse3
361#define _op_blend_pt_p_caa_dpan_sse3 _op_blend_pt_p_caa_dp_sse3
362#define _op_blend_pt_pas_caa_dpan_sse3 _op_blend_pt_pas_caa_dp_sse3
363#define _op_blend_pt_pan_caa_dpan_sse3 _op_blend_pt_pan_caa_dp_sse3
364
365static void
366init_blend_pixel_color_pt_funcs_sse3(void)
367{
368 op_blend_pt_funcs[SP][SM_N][SC][DP][CPU_SSE3] = _op_blend_pt_p_c_dp_sse3;
369 op_blend_pt_funcs[SP_AS][SM_N][SC][DP][CPU_SSE3] = _op_blend_pt_pas_c_dp_sse3;
370 op_blend_pt_funcs[SP_AN][SM_N][SC][DP][CPU_SSE3] = _op_blend_pt_pan_c_dp_sse3;
371 op_blend_pt_funcs[SP][SM_N][SC_AN][DP][CPU_SSE3] = _op_blend_pt_p_can_dp_sse3;
372 op_blend_pt_funcs[SP_AS][SM_N][SC_AN][DP][CPU_SSE3] = _op_blend_pt_pas_can_dp_sse3;
373 op_blend_pt_funcs[SP_AN][SM_N][SC_AN][DP][CPU_SSE3] = _op_blend_pt_pan_can_dp_sse3;
374 op_blend_pt_funcs[SP][SM_N][SC_AA][DP][CPU_SSE3] = _op_blend_pt_p_caa_dp_sse3;
375 op_blend_pt_funcs[SP_AS][SM_N][SC_AA][DP][CPU_SSE3] = _op_blend_pt_pas_caa_dp_sse3;
376 op_blend_pt_funcs[SP_AN][SM_N][SC_AA][DP][CPU_SSE3] = _op_blend_pt_pan_caa_dp_sse3;
377
378 op_blend_pt_funcs[SP][SM_N][SC][DP_AN][CPU_SSE3] = _op_blend_pt_p_c_dpan_sse3;
379 op_blend_pt_funcs[SP_AS][SM_N][SC][DP_AN][CPU_SSE3] = _op_blend_pt_pas_c_dpan_sse3;
380 op_blend_pt_funcs[SP_AN][SM_N][SC][DP_AN][CPU_SSE3] = _op_blend_pt_pan_c_dpan_sse3;
381 op_blend_pt_funcs[SP][SM_N][SC_AN][DP_AN][CPU_SSE3] = _op_blend_pt_p_can_dpan_sse3;
382 op_blend_pt_funcs[SP_AS][SM_N][SC_AN][DP_AN][CPU_SSE3] = _op_blend_pt_pas_can_dpan_sse3;
383 op_blend_pt_funcs[SP_AN][SM_N][SC_AN][DP_AN][CPU_SSE3] = _op_blend_pt_pan_can_dpan_sse3;
384 op_blend_pt_funcs[SP][SM_N][SC_AA][DP_AN][CPU_SSE3] = _op_blend_pt_p_caa_dpan_sse3;
385 op_blend_pt_funcs[SP_AS][SM_N][SC_AA][DP_AN][CPU_SSE3] = _op_blend_pt_pas_caa_dpan_sse3;
386 op_blend_pt_funcs[SP_AN][SM_N][SC_AA][DP_AN][CPU_SSE3] = _op_blend_pt_pan_caa_dpan_sse3;
387}
388
389/*-----*/
390
391/* blend_rel pixel x color -> dst */
392
393static void
394_op_blend_rel_p_c_dp_sse3(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) {
395
396 int alpha;
397
398 const __m128i c_packed = _mm_set_epi32(c, c, c, c);
399
400 LOOP_ALIGNED_U1_A48_SSE3(d, l,
401 { /* UOP */
402
403 DATA32 sc = MUL4_SYM(c, *s);
404 alpha = 256 - (sc >> 24);
405 *d = MUL_SYM(*d >> 24, sc) + MUL_256(alpha, *d);
406 d++; s++; l--;
407 },
408 { /* A4OP */
409
410 __m128i s0 = _mm_lddqu_si128((__m128i *)s);
411 __m128i d0 = _mm_load_si128((__m128i *)d);
412
413 __m128i sc0 = mul4_sym_sse3(c_packed, s0);
414 __m128i a0 = sub4_alpha_sse3(sc0);
415
416 __m128i l0 = mul_sym_sse3(_mm_srli_epi32(d0, 24), sc0);
417 __m128i r0 = mul_256_sse3(a0, d0);
418
419 r0 = _mm_add_epi32(l0, r0);
420
421 _mm_store_si128((__m128i *)d, r0);
422
423 d += 4; s += 4; l -= 4;
424 },
425 { /* A8OP */
426
427 __m128i s0 = _mm_lddqu_si128((__m128i *)s);
428 __m128i d0 = _mm_load_si128((__m128i *)d);
429
430 __m128i s1 = _mm_lddqu_si128((__m128i *)(s+4));
431 __m128i d1 = _mm_load_si128((__m128i *)(d+4));
432
433 __m128i sc0 = mul4_sym_sse3(c_packed, s0);
434 __m128i sc1 = mul4_sym_sse3(c_packed, s1);
435
436 __m128i a0 = sub4_alpha_sse3(sc0);
437 __m128i a1 = sub4_alpha_sse3(sc1);
438
439 __m128i l0 = mul_sym_sse3(_mm_srli_epi32(d0, 24), sc0);
440 __m128i r0 = mul_256_sse3(a0, d0);
441
442 __m128i l1 = mul_sym_sse3(_mm_srli_epi32(d1, 24), sc1);
443 __m128i r1 = mul_256_sse3(a1, d1);
444
445 r0 = _mm_add_epi32(l0, r0);
446 r1 = _mm_add_epi32(l1, r1);
447
448 _mm_store_si128((__m128i *)d, r0);
449 _mm_store_si128((__m128i *)(d+4), r1);
450
451 d += 8; s += 8; l -= 8;
452 })
453}
454
455#define _op_blend_rel_pas_c_dp_sse3 _op_blend_rel_p_c_dp_sse3
456#define _op_blend_rel_pan_c_dp_sse3 _op_blend_rel_p_c_dp_sse3
457#define _op_blend_rel_p_can_dp_sse3 _op_blend_rel_p_c_dp_sse3
458#define _op_blend_rel_pas_can_dp_sse3 _op_blend_rel_p_c_dp_sse3
459#define _op_blend_rel_pan_can_dp_sse3 _op_blend_rel_p_c_dp_sse3
460#define _op_blend_rel_p_caa_dp_sse3 _op_blend_rel_p_c_dp_sse3
461#define _op_blend_rel_pas_caa_dp_sse3 _op_blend_rel_p_c_dp_sse3
462#define _op_blend_rel_pan_caa_dp_sse3 _op_blend_rel_p_c_dp_sse3
463
464#define _op_blend_rel_p_c_dpan_sse3 _op_blend_p_c_dpan_sse3
465#define _op_blend_rel_pas_c_dpan_sse3 _op_blend_pas_c_dpan_sse3
466#define _op_blend_rel_pan_c_dpan_sse3 _op_blend_pan_c_dpan_sse3
467#define _op_blend_rel_p_can_dpan_sse3 _op_blend_p_can_dpan_sse3
468#define _op_blend_rel_pas_can_dpan_sse3 _op_blend_pas_can_dpan_sse3
469#define _op_blend_rel_pan_can_dpan_sse3 _op_blend_pan_can_dpan_sse3
470#define _op_blend_rel_p_caa_dpan_sse3 _op_blend_p_caa_dpan_sse3
471#define _op_blend_rel_pas_caa_dpan_sse3 _op_blend_pas_caa_dpan_sse3
472#define _op_blend_rel_pan_caa_dpan_sse3 _op_blend_pan_caa_dpan_sse3
473
474static void
475init_blend_rel_pixel_color_span_funcs_sse3(void)
476{
477 op_blend_rel_span_funcs[SP][SM_N][SC][DP][CPU_SSE3] = _op_blend_rel_p_c_dp_sse3;
478 op_blend_rel_span_funcs[SP_AS][SM_N][SC][DP][CPU_SSE3] = _op_blend_rel_pas_c_dp_sse3;
479 op_blend_rel_span_funcs[SP_AN][SM_N][SC][DP][CPU_SSE3] = _op_blend_rel_pan_c_dp_sse3;
480 op_blend_rel_span_funcs[SP][SM_N][SC_AN][DP][CPU_SSE3] = _op_blend_rel_p_can_dp_sse3;
481 op_blend_rel_span_funcs[SP_AS][SM_N][SC_AN][DP][CPU_SSE3] = _op_blend_rel_pas_can_dp_sse3;
482 op_blend_rel_span_funcs[SP_AN][SM_N][SC_AN][DP][CPU_SSE3] = _op_blend_rel_pan_can_dp_sse3;
483 op_blend_rel_span_funcs[SP][SM_N][SC_AA][DP][CPU_SSE3] = _op_blend_rel_p_caa_dp_sse3;
484 op_blend_rel_span_funcs[SP_AS][SM_N][SC_AA][DP][CPU_SSE3] = _op_blend_rel_pas_caa_dp_sse3;
485 op_blend_rel_span_funcs[SP_AN][SM_N][SC_AA][DP][CPU_SSE3] = _op_blend_rel_pan_caa_dp_sse3;
486
487 op_blend_rel_span_funcs[SP][SM_N][SC][DP_AN][CPU_SSE3] = _op_blend_rel_p_c_dpan_sse3;
488 op_blend_rel_span_funcs[SP_AS][SM_N][SC][DP_AN][CPU_SSE3] = _op_blend_rel_pas_c_dpan_sse3;
489 op_blend_rel_span_funcs[SP_AN][SM_N][SC][DP_AN][CPU_SSE3] = _op_blend_rel_pan_c_dpan_sse3;
490 op_blend_rel_span_funcs[SP][SM_N][SC_AN][DP_AN][CPU_SSE3] = _op_blend_rel_p_can_dpan_sse3;
491 op_blend_rel_span_funcs[SP_AS][SM_N][SC_AN][DP_AN][CPU_SSE3] = _op_blend_rel_pas_can_dpan_sse3;
492 op_blend_rel_span_funcs[SP_AN][SM_N][SC_AN][DP_AN][CPU_SSE3] = _op_blend_rel_pan_can_dpan_sse3;
493 op_blend_rel_span_funcs[SP][SM_N][SC_AA][DP_AN][CPU_SSE3] = _op_blend_rel_p_caa_dpan_sse3;
494 op_blend_rel_span_funcs[SP_AS][SM_N][SC_AA][DP_AN][CPU_SSE3] = _op_blend_rel_pas_caa_dpan_sse3;
495 op_blend_rel_span_funcs[SP_AN][SM_N][SC_AA][DP_AN][CPU_SSE3] = _op_blend_rel_pan_caa_dpan_sse3;
496}
497
498#define _op_blend_rel_pt_p_c_dp_sse3 NULL
499
500#define _op_blend_rel_pt_pas_c_dp_sse3 _op_blend_rel_pt_p_c_dp_sse3
501#define _op_blend_rel_pt_pan_c_dp_sse3 _op_blend_rel_pt_p_c_dp_sse3
502#define _op_blend_rel_pt_p_can_dp_sse3 _op_blend_rel_pt_p_c_dp_sse3
503#define _op_blend_rel_pt_pas_can_dp_sse3 _op_blend_rel_pt_p_c_dp_sse3
504#define _op_blend_rel_pt_pan_can_dp_sse3 _op_blend_rel_pt_p_c_dp_sse3
505#define _op_blend_rel_pt_p_caa_dp_sse3 _op_blend_rel_pt_p_c_dp_sse3
506#define _op_blend_rel_pt_pas_caa_dp_sse3 _op_blend_rel_pt_p_c_dp_sse3
507#define _op_blend_rel_pt_pan_caa_dp_sse3 _op_blend_rel_pt_p_c_dp_sse3
508
509#define _op_blend_rel_pt_p_c_dpan_sse3 _op_blend_pt_p_c_dpan_sse3
510#define _op_blend_rel_pt_pas_c_dpan_sse3 _op_blend_pt_pas_c_dpan_sse3
511#define _op_blend_rel_pt_pan_c_dpan_sse3 _op_blend_pt_pan_c_dpan_sse3
512#define _op_blend_rel_pt_p_can_dpan_sse3 _op_blend_pt_p_can_dpan_sse3
513#define _op_blend_rel_pt_pas_can_dpan_sse3 _op_blend_pt_pas_can_dpan_sse3
514#define _op_blend_rel_pt_pan_can_dpan_sse3 _op_blend_pt_pan_can_dpan_sse3
515#define _op_blend_rel_pt_p_caa_dpan_sse3 _op_blend_pt_p_caa_dpan_sse3
516#define _op_blend_rel_pt_pas_caa_dpan_sse3 _op_blend_pt_pas_caa_dpan_sse3
517#define _op_blend_rel_pt_pan_caa_dpan_sse3 _op_blend_pt_pan_caa_dpan_sse3
518
519static void
520init_blend_rel_pixel_color_pt_funcs_sse3(void)
521{
522 op_blend_rel_pt_funcs[SP][SM_N][SC][DP][CPU_SSE3] = _op_blend_rel_pt_p_c_dp_sse3;
523 op_blend_rel_pt_funcs[SP_AS][SM_N][SC][DP][CPU_SSE3] = _op_blend_rel_pt_pas_c_dp_sse3;
524 op_blend_rel_pt_funcs[SP_AN][SM_N][SC][DP][CPU_SSE3] = _op_blend_rel_pt_pan_c_dp_sse3;
525 op_blend_rel_pt_funcs[SP][SM_N][SC_AN][DP][CPU_SSE3] = _op_blend_rel_pt_p_can_dp_sse3;
526 op_blend_rel_pt_funcs[SP_AS][SM_N][SC_AN][DP][CPU_SSE3] = _op_blend_rel_pt_pas_can_dp_sse3;
527 op_blend_rel_pt_funcs[SP_AN][SM_N][SC_AN][DP][CPU_SSE3] = _op_blend_rel_pt_pan_can_dp_sse3;
528 op_blend_rel_pt_funcs[SP][SM_N][SC_AA][DP][CPU_SSE3] = _op_blend_rel_pt_p_caa_dp_sse3;
529 op_blend_rel_pt_funcs[SP_AS][SM_N][SC_AA][DP][CPU_SSE3] = _op_blend_rel_pt_pas_caa_dp_sse3;
530 op_blend_rel_pt_funcs[SP_AN][SM_N][SC_AA][DP][CPU_SSE3] = _op_blend_rel_pt_pan_caa_dp_sse3;
531
532 op_blend_rel_pt_funcs[SP][SM_N][SC][DP_AN][CPU_SSE3] = _op_blend_rel_pt_p_c_dpan_sse3;
533 op_blend_rel_pt_funcs[SP_AS][SM_N][SC][DP_AN][CPU_SSE3] = _op_blend_rel_pt_pas_c_dpan_sse3;
534 op_blend_rel_pt_funcs[SP_AN][SM_N][SC][DP_AN][CPU_SSE3] = _op_blend_rel_pt_pan_c_dpan_sse3;
535 op_blend_rel_pt_funcs[SP][SM_N][SC_AN][DP_AN][CPU_SSE3] = _op_blend_rel_pt_p_can_dpan_sse3;
536 op_blend_rel_pt_funcs[SP_AS][SM_N][SC_AN][DP_AN][CPU_SSE3] = _op_blend_rel_pt_pas_can_dpan_sse3;
537 op_blend_rel_pt_funcs[SP_AN][SM_N][SC_AN][DP_AN][CPU_SSE3] = _op_blend_rel_pt_pan_can_dpan_sse3;
538 op_blend_rel_pt_funcs[SP][SM_N][SC_AA][DP_AN][CPU_SSE3] = _op_blend_rel_pt_p_caa_dpan_sse3;
539 op_blend_rel_pt_funcs[SP_AS][SM_N][SC_AA][DP_AN][CPU_SSE3] = _op_blend_rel_pt_pas_caa_dpan_sse3;
540 op_blend_rel_pt_funcs[SP_AN][SM_N][SC_AA][DP_AN][CPU_SSE3] = _op_blend_rel_pt_pan_caa_dpan_sse3;
541}
542
543#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_i386.c b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_i386.c
new file mode 100644
index 0000000..9b5abe6
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_i386.c
@@ -0,0 +1,217 @@
1/* blend pixel --> dst */
2
3#ifdef BUILD_MMX
4static void
5_op_blend_p_dp_mmx(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c __UNUSED__, DATA32 *d, int l) {
6 DATA32 *e = d + l;
7 pxor_r2r(mm0, mm0);
8 MOV_A2R(ALPHA_256, mm6)
9 while (d < e)
10 {
11 MOV_P2R(*s, mm2, mm0)
12 MOV_RA2R(mm2, mm1)
13 movq_r2r(mm6, mm3);
14 psubw_r2r(mm1, mm3);
15
16 MOV_P2R(*d, mm1, mm0)
17 MUL4_256_R2R(mm3, mm1)
18
19 paddw_r2r(mm2, mm1);
20 MOV_R2P(mm1, *d, mm0)
21 s++; d++;
22 }
23}
24
25static void
26_op_blend_pas_dp_mmx(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c __UNUSED__, DATA32 *d, int l) {
27 _op_blend_p_dp_mmx(s, m, c, d, l);
28 return;
29 DATA32 *e = d + l;
30 pxor_r2r(mm0, mm0);
31 MOV_A2R(ALPHA_256, mm6)
32 while (d < e)
33 {
34 switch (*s & 0xff000000)
35 {
36 case 0:
37 break;
38 case 0xff000000:
39 *d = *s;
40 break;
41 default :
42 MOV_P2R(*s, mm2, mm0)
43 MOV_RA2R(mm2, mm1)
44 movq_r2r(mm6, mm3);
45 psubw_r2r(mm1, mm3);
46
47 MOV_P2R(*d, mm1, mm0)
48 MUL4_256_R2R(mm3, mm1)
49
50 paddw_r2r(mm2, mm1);
51 MOV_R2P(mm1, *d, mm0)
52 break;
53 }
54 s++; d++;
55 }
56}
57
58#define _op_blend_pan_dp_mmx NULL
59
60#define _op_blend_p_dpan_mmx _op_blend_p_dp_mmx
61#define _op_blend_pas_dpan_mmx _op_blend_pas_dp_mmx
62#define _op_blend_pan_dpan_mmx _op_blend_pan_dp_mmx
63
64static void
65init_blend_pixel_span_funcs_mmx(void)
66{
67 op_blend_span_funcs[SP][SM_N][SC_N][DP][CPU_MMX] = _op_blend_p_dp_mmx;
68 op_blend_span_funcs[SP_AS][SM_N][SC_N][DP][CPU_MMX] = _op_blend_pas_dp_mmx;
69 op_blend_span_funcs[SP_AN][SM_N][SC_N][DP][CPU_MMX] = _op_blend_pan_dp_mmx;
70
71 op_blend_span_funcs[SP][SM_N][SC_N][DP_AN][CPU_MMX] = _op_blend_p_dpan_mmx;
72 op_blend_span_funcs[SP_AS][SM_N][SC_N][DP_AN][CPU_MMX] = _op_blend_pas_dpan_mmx;
73 op_blend_span_funcs[SP_AN][SM_N][SC_N][DP_AN][CPU_MMX] = _op_blend_pan_dpan_mmx;
74}
75#endif
76
77#ifdef BUILD_MMX
78static void
79_op_blend_pt_p_dp_mmx(DATA32 s, DATA8 m __UNUSED__, DATA32 c __UNUSED__, DATA32 *d) {
80 pxor_r2r(mm0, mm0);
81 MOV_A2R(ALPHA_256, mm6)
82 MOV_P2R(s, mm2, mm0)
83 MOV_RA2R(mm2, mm1)
84 movq_r2r(mm6, mm3);
85 psubw_r2r(mm1, mm3);
86
87 MOV_P2R(*d, mm1, mm0)
88 MUL4_256_R2R(mm3, mm1)
89
90 paddw_r2r(mm2, mm1);
91 MOV_R2P(mm1, *d, mm0)
92}
93
94
95#define _op_blend_pt_pan_dp_mmx NULL
96#define _op_blend_pt_pas_dp_mmx _op_blend_pt_p_dp_mmx
97
98#define _op_blend_pt_p_dpan_mmx _op_blend_pt_p_dp_mmx
99#define _op_blend_pt_pan_dpan_mmx _op_blend_pt_pan_dp_mmx
100#define _op_blend_pt_pas_dpan_mmx _op_blend_pt_pas_dp_mmx
101
102static void
103init_blend_pixel_pt_funcs_mmx(void)
104{
105 op_blend_pt_funcs[SP][SM_N][SC_N][DP][CPU_MMX] = _op_blend_pt_p_dp_mmx;
106 op_blend_pt_funcs[SP_AS][SM_N][SC_N][DP][CPU_MMX] = _op_blend_pt_pas_dp_mmx;
107 op_blend_pt_funcs[SP_AN][SM_N][SC_N][DP][CPU_MMX] = _op_blend_pt_pan_dp_mmx;
108
109 op_blend_pt_funcs[SP][SM_N][SC_N][DP_AN][CPU_MMX] = _op_blend_pt_p_dpan_mmx;
110 op_blend_pt_funcs[SP_AS][SM_N][SC_N][DP_AN][CPU_MMX] = _op_blend_pt_pas_dpan_mmx;
111 op_blend_pt_funcs[SP_AN][SM_N][SC_N][DP_AN][CPU_MMX] = _op_blend_pt_pan_dpan_mmx;
112}
113#endif
114
115/*-----*/
116
117/* blend_rel pixel -> dst */
118
119#ifdef BUILD_MMX
120static void
121_op_blend_rel_p_dp_mmx(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c __UNUSED__, DATA32 *d, int l) {
122 DATA32 *e = d + l;
123 pxor_r2r(mm0, mm0);
124 MOV_A2R(ALPHA_256, mm6)
125 MOV_A2R(ALPHA_255, mm5)
126 while (d < e)
127 {
128 MOV_P2R(*s, mm2, mm0)
129 MOV_RA2R(mm2, mm1)
130 movq_r2r(mm6, mm3);
131 psubw_r2r(mm1, mm3);
132
133 MOV_P2R(*d, mm1, mm0)
134 MOV_RA2R(mm1, mm4)
135 MUL4_256_R2R(mm3, mm1)
136
137 MUL4_SYM_R2R(mm4, mm2, mm5)
138 paddw_r2r(mm2, mm1);
139 MOV_R2P(mm1, *d, mm0)
140 s++; d++;
141 }
142}
143
144static void
145_op_blend_rel_pan_dp_mmx(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c __UNUSED__, DATA32 *d, int l) {
146 DATA32 *e = d + l;
147 pxor_r2r(mm0, mm0);
148 MOV_A2R(ALPHA_256, mm6)
149 MOV_A2R(ALPHA_255, mm5)
150 while (d < e)
151 {
152 MOV_P2R(*s, mm2, mm0)
153 MOV_PA2R(*d, mm1)
154 MUL4_SYM_R2R(mm2, mm1, mm5)
155 MOV_R2P(mm1, *d, mm0)
156 s++; d++;
157 }
158}
159
160#define _op_blend_rel_pas_dp_mmx _op_blend_rel_p_dp_mmx
161
162#define _op_blend_rel_p_dpan_mmx _op_blend_p_dpan_mmx
163#define _op_blend_rel_pan_dpan_mmx _op_blend_pan_dpan_mmx
164#define _op_blend_rel_pas_dpan_mmx _op_blend_pas_dpan_mmx
165
166static void
167init_blend_rel_pixel_span_funcs_mmx(void)
168{
169 op_blend_rel_span_funcs[SP][SM_N][SC_N][DP][CPU_MMX] = _op_blend_rel_p_dp_mmx;
170 op_blend_rel_span_funcs[SP_AS][SM_N][SC_N][DP][CPU_MMX] = _op_blend_rel_pas_dp_mmx;
171 op_blend_rel_span_funcs[SP_AN][SM_N][SC_N][DP][CPU_MMX] = _op_blend_rel_pan_dp_mmx;
172
173 op_blend_rel_span_funcs[SP][SM_N][SC_N][DP_AN][CPU_MMX] = _op_blend_rel_p_dpan_mmx;
174 op_blend_rel_span_funcs[SP_AS][SM_N][SC_N][DP_AN][CPU_MMX] = _op_blend_rel_pas_dpan_mmx;
175 op_blend_rel_span_funcs[SP_AN][SM_N][SC_N][DP_AN][CPU_MMX] = _op_blend_rel_pan_dpan_mmx;
176}
177#endif
178
179#ifdef BUILD_MMX
180static void
181_op_blend_rel_pt_p_dp_mmx(DATA32 s, DATA8 m __UNUSED__, DATA32 c __UNUSED__, DATA32 *d) {
182 pxor_r2r(mm0, mm0);
183 MOV_A2R(ALPHA_256, mm6)
184 MOV_A2R(ALPHA_255, mm5)
185
186 MOV_P2R(s, mm2, mm0)
187 MOV_RA2R(mm2, mm1)
188 psubw_r2r(mm1, mm6);
189
190 MOV_P2R(*d, mm1, mm0)
191 MOV_RA2R(mm1, mm4)
192 MUL4_256_R2R(mm6, mm1)
193
194 MUL4_SYM_R2R(mm4, mm2, mm5)
195 paddw_r2r(mm2, mm1);
196 MOV_R2P(mm1, *d, mm0)
197}
198
199#define _op_blend_rel_pt_pas_dp_mmx _op_blend_rel_pt_p_dp_mmx
200#define _op_blend_rel_pt_pan_dp_mmx _op_blend_rel_pt_p_dp_mmx
201
202#define _op_blend_rel_pt_p_dpan_mmx _op_blend_pt_p_dpan_mmx
203#define _op_blend_rel_pt_pas_dpan_mmx _op_blend_pt_pas_dpan_mmx
204#define _op_blend_rel_pt_pan_dpan_mmx _op_blend_pt_pan_dpan_mmx
205
206static void
207init_blend_rel_pixel_pt_funcs_mmx(void)
208{
209 op_blend_rel_pt_funcs[SP][SM_N][SC_N][DP][CPU_MMX] = _op_blend_rel_pt_p_dp_mmx;
210 op_blend_rel_pt_funcs[SP_AS][SM_N][SC_N][DP][CPU_MMX] = _op_blend_rel_pt_pas_dp_mmx;
211 op_blend_rel_pt_funcs[SP_AN][SM_N][SC_N][DP][CPU_MMX] = _op_blend_rel_pt_pan_dp_mmx;
212
213 op_blend_rel_pt_funcs[SP][SM_N][SC_N][DP_AN][CPU_MMX] = _op_blend_rel_pt_p_dpan_mmx;
214 op_blend_rel_pt_funcs[SP_AS][SM_N][SC_N][DP_AN][CPU_MMX] = _op_blend_rel_pt_pas_dpan_mmx;
215 op_blend_rel_pt_funcs[SP_AN][SM_N][SC_N][DP_AN][CPU_MMX] = _op_blend_rel_pt_pan_dpan_mmx;
216}
217#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_mask_.c b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_mask_.c
new file mode 100644
index 0000000..a9d0f4b
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_mask_.c
@@ -0,0 +1,189 @@
1/* blend pixel x mask --> dst */
2
3#ifdef BUILD_C
4static void
5_op_blend_p_mas_dp(DATA32 *s, DATA8 *m, DATA32 c, DATA32 *d, int l) {
6 DATA32 *e;
7 int alpha;
8 UNROLL8_PLD_WHILE(d, l, e,
9 {
10 alpha = *m;
11 switch(alpha)
12 {
13 case 0:
14 break;
15 case 255:
16 alpha = 256 - (*s >> 24);
17 *d = *s + MUL_256(alpha, *d);
18 break;
19 default:
20 c = MUL_SYM(alpha, *s);
21 alpha = 256 - (c >> 24);
22 *d = c + MUL_256(alpha, *d);
23 break;
24 }
25 m++; s++; d++;
26 });
27}
28
29static void
30_op_blend_pas_mas_dp(DATA32 *s, DATA8 *m, DATA32 c __UNUSED__, DATA32 *d, int l) {
31 DATA32 *e;
32 int alpha;
33 UNROLL8_PLD_WHILE(d, l, e,
34 {
35 alpha = *m;
36 switch(alpha)
37 {
38 case 0:
39 break;
40 case 255:
41 *d = *s;
42 break;
43 default:
44 alpha++;
45 *d = INTERP_256(alpha, *s, *d);
46 break;
47 }
48 m++; s++; d++;
49 });
50}
51
52static void
53_op_blend_pan_mas_dp(DATA32 *s, DATA8 *m, DATA32 c __UNUSED__, DATA32 *d, int l) {
54 DATA32 *e;
55 int alpha;
56 UNROLL8_PLD_WHILE(d, l, e,
57 {
58 alpha = *m;
59 switch(alpha)
60 {
61 case 0:
62 break;
63 case 255:
64 *d = *s;
65 break;
66 default:
67 alpha++;
68 *d = INTERP_256(alpha, *s, *d);
69 break;
70 }
71 m++; s++; d++;
72 });
73}
74
75
76#define _op_blend_p_mas_dpan _op_blend_p_mas_dp
77#define _op_blend_pas_mas_dpan _op_blend_pas_mas_dp
78#define _op_blend_pan_mas_dpan _op_blend_pan_mas_dp
79
80static void
81init_blend_pixel_mask_span_funcs_c(void)
82{
83 op_blend_span_funcs[SP][SM_AS][SC_N][DP][CPU_C] = _op_blend_p_mas_dp;
84 op_blend_span_funcs[SP_AS][SM_AS][SC_N][DP][CPU_C] = _op_blend_pas_mas_dp;
85 op_blend_span_funcs[SP_AN][SM_AS][SC_N][DP][CPU_C] = _op_blend_pan_mas_dp;
86
87 op_blend_span_funcs[SP][SM_AS][SC_N][DP_AN][CPU_C] = _op_blend_p_mas_dpan;
88 op_blend_span_funcs[SP_AS][SM_AS][SC_N][DP_AN][CPU_C] = _op_blend_pas_mas_dpan;
89 op_blend_span_funcs[SP_AN][SM_AS][SC_N][DP_AN][CPU_C] = _op_blend_pan_mas_dpan;
90}
91#endif
92
93#ifdef BUILD_C
94static void
95_op_blend_pt_p_mas_dp(DATA32 s, DATA8 m, DATA32 c, DATA32 *d) {
96 s = MUL_SYM(m, s);
97 c = 256 - (s >> 24);
98 *d = s + MUL_256(c, *d);
99}
100
101static void
102_op_blend_pt_pan_mas_dp(DATA32 s, DATA8 m, DATA32 c __UNUSED__, DATA32 *d) {
103 *d = INTERP_256(m + 1, s, *d);
104}
105
106#define _op_blend_pt_pas_mas_dp _op_blend_pt_p_mas_dp
107
108#define _op_blend_pt_p_mas_dpan _op_blend_pt_p_mas_dp
109#define _op_blend_pt_pas_mas_dpan _op_blend_pt_pas_mas_dp
110#define _op_blend_pt_pan_mas_dpan _op_blend_pt_pan_mas_dp
111
112static void
113init_blend_pixel_mask_pt_funcs_c(void)
114{
115 op_blend_pt_funcs[SP][SM_AS][SC_N][DP][CPU_C] = _op_blend_pt_p_mas_dp;
116 op_blend_pt_funcs[SP_AS][SM_AS][SC_N][DP][CPU_C] = _op_blend_pt_pas_mas_dp;
117 op_blend_pt_funcs[SP_AN][SM_AS][SC_N][DP][CPU_C] = _op_blend_pt_pan_mas_dp;
118
119 op_blend_pt_funcs[SP][SM_AS][SC_N][DP_AN][CPU_C] = _op_blend_pt_p_mas_dpan;
120 op_blend_pt_funcs[SP_AS][SM_AS][SC_N][DP_AN][CPU_C] = _op_blend_pt_pas_mas_dpan;
121 op_blend_pt_funcs[SP_AN][SM_AS][SC_N][DP_AN][CPU_C] = _op_blend_pt_pan_mas_dpan;
122}
123#endif
124
125/*-----*/
126
127/* blend_rel pixel x mask -> dst */
128
129#ifdef BUILD_C
130static void
131_op_blend_rel_p_mas_dp(DATA32 *s, DATA8 *m, DATA32 c, DATA32 *d, int l) {
132 DATA32 *e;
133 int alpha;
134 UNROLL8_PLD_WHILE(d, l, e,
135 {
136 c = MUL_SYM(*m, *s);
137 alpha = 256 - (c >> 24);
138 *d = MUL_SYM(*d >> 24, c) + MUL_256(alpha, *d);
139 d++; m++; s++;
140 });
141}
142
143#define _op_blend_rel_pas_mas_dp _op_blend_rel_p_mas_dp
144#define _op_blend_rel_pan_mas_dp _op_blend_rel_p_mas_dp
145
146#define _op_blend_rel_p_mas_dpan _op_blend_p_mas_dpan
147#define _op_blend_rel_pas_mas_dpan _op_blend_pas_mas_dpan
148#define _op_blend_rel_pan_mas_dpan _op_blend_pan_mas_dpan
149
150static void
151init_blend_rel_pixel_mask_span_funcs_c(void)
152{
153 op_blend_rel_span_funcs[SP][SM_AS][SC_N][DP][CPU_C] = _op_blend_rel_p_mas_dp;
154 op_blend_rel_span_funcs[SP_AS][SM_AS][SC_N][DP][CPU_C] = _op_blend_rel_pas_mas_dp;
155 op_blend_rel_span_funcs[SP_AN][SM_AS][SC_N][DP][CPU_C] = _op_blend_rel_pan_mas_dp;
156
157 op_blend_rel_span_funcs[SP][SM_AS][SC_N][DP_AN][CPU_C] = _op_blend_rel_p_mas_dpan;
158 op_blend_rel_span_funcs[SP_AS][SM_AS][SC_N][DP_AN][CPU_C] = _op_blend_rel_pas_mas_dpan;
159 op_blend_rel_span_funcs[SP_AN][SM_AS][SC_N][DP_AN][CPU_C] = _op_blend_rel_pan_mas_dpan;
160}
161#endif
162
163#ifdef BUILD_C
164static void
165_op_blend_rel_pt_p_mas_dp(DATA32 s, DATA8 m, DATA32 c, DATA32 *d) {
166 s = MUL_SYM(m, s);
167 c = 256 - (s >> 24);
168 *d = MUL_SYM(*d >> 24, s) + MUL_256(c, *d);
169}
170
171#define _op_blend_rel_pt_pas_mas_dp _op_blend_rel_pt_p_mas_dp
172#define _op_blend_rel_pt_pan_mas_dp _op_blend_rel_pt_p_mas_dp
173
174#define _op_blend_rel_pt_p_mas_dpan _op_blend_pt_p_mas_dpan
175#define _op_blend_rel_pt_pas_mas_dpan _op_blend_pt_pas_mas_dpan
176#define _op_blend_rel_pt_pan_mas_dpan _op_blend_pt_pan_mas_dpan
177
178static void
179init_blend_rel_pixel_mask_pt_funcs_c(void)
180{
181 op_blend_rel_pt_funcs[SP][SM_AS][SC_N][DP][CPU_C] = _op_blend_rel_pt_p_mas_dp;
182 op_blend_rel_pt_funcs[SP_AS][SM_AS][SC_N][DP][CPU_C] = _op_blend_rel_pt_pas_mas_dp;
183 op_blend_rel_pt_funcs[SP_AN][SM_AS][SC_N][DP][CPU_C] = _op_blend_rel_pt_pan_mas_dp;
184
185 op_blend_rel_pt_funcs[SP][SM_AS][SC_N][DP_AN][CPU_C] = _op_blend_rel_pt_p_mas_dpan;
186 op_blend_rel_pt_funcs[SP_AS][SM_AS][SC_N][DP_AN][CPU_C] = _op_blend_rel_pt_pas_mas_dpan;
187 op_blend_rel_pt_funcs[SP_AN][SM_AS][SC_N][DP_AN][CPU_C] = _op_blend_rel_pt_pan_mas_dpan;
188}
189#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_mask_i386.c b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_mask_i386.c
new file mode 100644
index 0000000..4fa50a9
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_mask_i386.c
@@ -0,0 +1,157 @@
1/* blend pixel x mask --> dst */
2
3#ifdef BUILD_MMX
4static void
5_op_blend_pas_mas_dp_mmx(DATA32 *s, DATA8 *m, DATA32 c __UNUSED__, DATA32 *d, int l) {
6 DATA32 *e = d + l;
7 pxor_r2r(mm0, mm0);
8 MOV_A2R(ALPHA_256, mm6)
9 while (d < e) {
10 l = (*s >> 24);
11 switch(*m & l)
12 {
13 case 0:
14 break;
15 case 255:
16 *d = *s;
17 break;
18 default:
19 l = 1 + *m;
20 MOV_A2R(l, mm3)
21 MOV_P2R(*s, mm2, mm0)
22 MUL4_256_R2R(mm3, mm2)
23
24 MOV_RA2R(mm2, mm1)
25 movq_r2r(mm6, mm3);
26 psubw_r2r(mm1, mm3);
27
28 MOV_P2R(*d, mm1, mm0)
29 MUL4_256_R2R(mm3, mm1)
30
31 paddw_r2r(mm2, mm1);
32 MOV_R2P(mm1, *d, mm0)
33 break;
34 }
35 m++; s++; d++;
36 }
37}
38
39static void
40_op_blend_pan_mas_dp_mmx(DATA32 *s, DATA8 *m, DATA32 c __UNUSED__, DATA32 *d, int l) {
41 DATA32 *e = d + l;
42 MOV_A2R(ALPHA_255, mm5)
43 pxor_r2r(mm0, mm0);
44 while (d < e) {
45 l = *m;
46 switch(l)
47 {
48 case 0:
49 break;
50 case 255:
51 *d = *s;
52 break;
53 default:
54 l++;
55 MOV_A2R(l, mm3)
56 MOV_P2R(*s, mm2, mm0)
57 MOV_P2R(*d, mm1, mm0)
58 INTERP_256_R2R(mm3, mm2, mm1, mm5)
59 MOV_R2P(mm1, *d, mm0)
60 break;
61 }
62 m++; s++; d++;
63 }
64}
65
66#define _op_blend_p_mas_dp_mmx _op_blend_pas_mas_dp_mmx
67
68#define _op_blend_p_mas_dpan_mmx _op_blend_p_mas_dp_mmx
69#define _op_blend_pan_mas_dpan_mmx _op_blend_pan_mas_dp_mmx
70#define _op_blend_pas_mas_dpan_mmx _op_blend_pas_mas_dp_mmx
71
72static void
73init_blend_pixel_mask_span_funcs_mmx(void)
74{
75 op_blend_span_funcs[SP][SM_AS][SC_N][DP][CPU_MMX] = _op_blend_p_mas_dp_mmx;
76 op_blend_span_funcs[SP_AS][SM_AS][SC_N][DP][CPU_MMX] = _op_blend_pas_mas_dp_mmx;
77 op_blend_span_funcs[SP_AN][SM_AS][SC_N][DP][CPU_MMX] = _op_blend_pan_mas_dp_mmx;
78
79 op_blend_span_funcs[SP][SM_AS][SC_N][DP_AN][CPU_MMX] = _op_blend_p_mas_dpan_mmx;
80 op_blend_span_funcs[SP_AS][SM_AS][SC_N][DP_AN][CPU_MMX] = _op_blend_pas_mas_dpan_mmx;
81 op_blend_span_funcs[SP_AN][SM_AS][SC_N][DP_AN][CPU_MMX] = _op_blend_pan_mas_dpan_mmx;
82}
83#endif
84
85#ifdef BUILD_MMX
86static void
87_op_blend_pt_p_mas_dp_mmx(DATA32 s, DATA8 m, DATA32 c, DATA32 *d) {
88 c = m + 1;
89 MOV_A2R(c, mm3)
90 pxor_r2r(mm0, mm0);
91 MOV_A2R(ALPHA_256, mm6)
92 MOV_P2R(s, mm2, mm0)
93 MUL4_256_R2R(mm3, mm2)
94
95 MOV_RA2R(mm2, mm1)
96 psubw_r2r(mm1, mm6);
97
98 MOV_P2R(*d, mm1, mm0)
99 MUL4_256_R2R(mm6, mm1)
100
101 paddw_r2r(mm2, mm1);
102 MOV_R2P(mm1, *d, mm0)
103}
104
105#define _op_blend_pt_pan_mas_dp_mmx _op_blend_pt_p_mas_dp_mmx
106#define _op_blend_pt_pas_mas_dp_mmx _op_blend_pt_p_mas_dp_mmx
107
108#define _op_blend_pt_p_mas_dpan_mmx _op_blend_pt_p_mas_dp_mmx
109#define _op_blend_pt_pas_mas_dpan_mmx _op_blend_pt_pas_mas_dp_mmx
110#define _op_blend_pt_pan_mas_dpan_mmx _op_blend_pt_pan_mas_dp_mmx
111
112static void
113init_blend_pixel_mask_pt_funcs_mmx(void)
114{
115 op_blend_pt_funcs[SP][SM_AS][SC_N][DP][CPU_MMX] = _op_blend_pt_p_mas_dp_mmx;
116 op_blend_pt_funcs[SP_AS][SM_AS][SC_N][DP][CPU_MMX] = _op_blend_pt_pas_mas_dp_mmx;
117 op_blend_pt_funcs[SP_AN][SM_AS][SC_N][DP][CPU_MMX] = _op_blend_pt_pan_mas_dp_mmx;
118
119 op_blend_pt_funcs[SP][SM_AS][SC_N][DP_AN][CPU_MMX] = _op_blend_pt_p_mas_dpan_mmx;
120 op_blend_pt_funcs[SP_AS][SM_AS][SC_N][DP_AN][CPU_MMX] = _op_blend_pt_pas_mas_dpan_mmx;
121 op_blend_pt_funcs[SP_AN][SM_AS][SC_N][DP_AN][CPU_MMX] = _op_blend_pt_pan_mas_dpan_mmx;
122}
123#endif
124
125/*-----*/
126
127/* blend_rel pixel x mask -> dst */
128
129#ifdef BUILD_MMX
130
131#define _op_blend_rel_p_mas_dpan_mmx _op_blend_p_mas_dpan_mmx
132#define _op_blend_rel_pas_mas_dpan_mmx _op_blend_pas_mas_dpan_mmx
133#define _op_blend_rel_pan_mas_dpan_mmx _op_blend_pan_mas_dpan_mmx
134
135static void
136init_blend_rel_pixel_mask_span_funcs_mmx(void)
137{
138 op_blend_rel_span_funcs[SP][SM_AS][SC_N][DP_AN][CPU_MMX] = _op_blend_rel_p_mas_dpan_mmx;
139 op_blend_rel_span_funcs[SP_AS][SM_AS][SC_N][DP_AN][CPU_MMX] = _op_blend_rel_pas_mas_dpan_mmx;
140 op_blend_rel_span_funcs[SP_AN][SM_AS][SC_N][DP_AN][CPU_MMX] = _op_blend_rel_pan_mas_dpan_mmx;
141}
142#endif
143
144#ifdef BUILD_MMX
145
146#define _op_blend_rel_pt_p_mas_dpan_mmx _op_blend_pt_p_mas_dpan_mmx
147#define _op_blend_rel_pt_pas_mas_dpan_mmx _op_blend_pt_pas_mas_dpan_mmx
148#define _op_blend_rel_pt_pan_mas_dpan_mmx _op_blend_pt_pan_mas_dpan_mmx
149
150static void
151init_blend_rel_pixel_mask_pt_funcs_mmx(void)
152{
153 op_blend_rel_pt_funcs[SP][SM_AS][SC_N][DP_AN][CPU_MMX] = _op_blend_rel_pt_p_mas_dpan_mmx;
154 op_blend_rel_pt_funcs[SP_AS][SM_AS][SC_N][DP_AN][CPU_MMX] = _op_blend_rel_pt_pas_mas_dpan_mmx;
155 op_blend_rel_pt_funcs[SP_AN][SM_AS][SC_N][DP_AN][CPU_MMX] = _op_blend_rel_pt_pan_mas_dpan_mmx;
156}
157#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_mask_neon.c b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_mask_neon.c
new file mode 100644
index 0000000..b252a67
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_mask_neon.c
@@ -0,0 +1,129 @@
1/* blend pixel x mask --> dst */
2
3#ifdef BUILD_NEON
4static void
5_op_blend_pas_mas_dp_neon(DATA32 *s, DATA8 *m, DATA32 c __UNUSED__, DATA32 *d, int l) {
6 DATA32 *e;
7 int alpha;
8 UNROLL8_PLD_WHILE(d, l, e,
9 {
10 alpha = *m;
11 switch(alpha)
12 {
13 case 0:
14 break;
15 case 255:
16 *d = *s;
17 break;
18 default:
19 alpha++;
20 *d = INTERP_256(alpha, *s, *d);
21 break;
22 }
23 m++; s++; d++;
24 });
25}
26
27static void
28_op_blend_pan_mas_dp_neon(DATA32 *s, DATA8 *m, DATA32 c __UNUSED__, DATA32 *d, int l) {
29 DATA32 *e;
30 int alpha;
31 UNROLL8_PLD_WHILE(d, l, e,
32 {
33 alpha = *m;
34 switch(alpha)
35 {
36 case 0:
37 break;
38 case 255:
39 *d = *s;
40 break;
41 default:
42 alpha++;
43 *d = INTERP_256(alpha, *s, *d);
44 break;
45 }
46 m++; s++; d++;
47 });
48}
49
50#define _op_blend_p_mas_dp_neon _op_blend_pas_mas_dp_neon
51
52#define _op_blend_p_mas_dpan_neon _op_blend_p_mas_dp_neon
53#define _op_blend_pan_mas_dpan_neon _op_blend_pan_mas_dp_neon
54#define _op_blend_pas_mas_dpan_neon _op_blend_pas_mas_dp_neon
55
56static void
57init_blend_pixel_mask_span_funcs_neon(void)
58{
59 op_blend_span_funcs[SP][SM_AS][SC_N][DP][CPU_NEON] = _op_blend_p_mas_dp_neon;
60 op_blend_span_funcs[SP_AS][SM_AS][SC_N][DP][CPU_NEON] = _op_blend_pas_mas_dp_neon;
61 op_blend_span_funcs[SP_AN][SM_AS][SC_N][DP][CPU_NEON] = _op_blend_pan_mas_dp_neon;
62
63 op_blend_span_funcs[SP][SM_AS][SC_N][DP_AN][CPU_NEON] = _op_blend_p_mas_dpan_neon;
64 op_blend_span_funcs[SP_AS][SM_AS][SC_N][DP_AN][CPU_NEON] = _op_blend_pas_mas_dpan_neon;
65 op_blend_span_funcs[SP_AN][SM_AS][SC_N][DP_AN][CPU_NEON] = _op_blend_pan_mas_dpan_neon;
66}
67#endif
68
69#ifdef BUILD_NEON
70static void
71_op_blend_pt_p_mas_dp_neon(DATA32 s, DATA8 m, DATA32 c, DATA32 *d) {
72 s = MUL_SYM(m, s);
73 c = 256 - (s >> 24);
74 *d = s + MUL_256(c, *d);
75}
76
77#define _op_blend_pt_pan_mas_dp_neon _op_blend_pt_p_mas_dp_neon
78#define _op_blend_pt_pas_mas_dp_neon _op_blend_pt_p_mas_dp_neon
79
80#define _op_blend_pt_p_mas_dpan_neon _op_blend_pt_p_mas_dp_neon
81#define _op_blend_pt_pas_mas_dpan_neon _op_blend_pt_pas_mas_dp_neon
82#define _op_blend_pt_pan_mas_dpan_neon _op_blend_pt_pan_mas_dp_neon
83
84static void
85init_blend_pixel_mask_pt_funcs_neon(void)
86{
87 op_blend_pt_funcs[SP][SM_AS][SC_N][DP][CPU_NEON] = _op_blend_pt_p_mas_dp_neon;
88 op_blend_pt_funcs[SP_AS][SM_AS][SC_N][DP][CPU_NEON] = _op_blend_pt_pas_mas_dp_neon;
89 op_blend_pt_funcs[SP_AN][SM_AS][SC_N][DP][CPU_NEON] = _op_blend_pt_pan_mas_dp_neon;
90
91 op_blend_pt_funcs[SP][SM_AS][SC_N][DP_AN][CPU_NEON] = _op_blend_pt_p_mas_dpan_neon;
92 op_blend_pt_funcs[SP_AS][SM_AS][SC_N][DP_AN][CPU_NEON] = _op_blend_pt_pas_mas_dpan_neon;
93 op_blend_pt_funcs[SP_AN][SM_AS][SC_N][DP_AN][CPU_NEON] = _op_blend_pt_pan_mas_dpan_neon;
94}
95#endif
96
97/*-----*/
98
99/* blend_rel pixel x mask -> dst */
100
101#ifdef BUILD_NEON
102
103#define _op_blend_rel_p_mas_dpan_neon _op_blend_p_mas_dpan_neon
104#define _op_blend_rel_pas_mas_dpan_neon _op_blend_pas_mas_dpan_neon
105#define _op_blend_rel_pan_mas_dpan_neon _op_blend_pan_mas_dpan_neon
106
107static void
108init_blend_rel_pixel_mask_span_funcs_neon(void)
109{
110 op_blend_rel_span_funcs[SP][SM_AS][SC_N][DP_AN][CPU_NEON] = _op_blend_rel_p_mas_dpan_neon;
111 op_blend_rel_span_funcs[SP_AS][SM_AS][SC_N][DP_AN][CPU_NEON] = _op_blend_rel_pas_mas_dpan_neon;
112 op_blend_rel_span_funcs[SP_AN][SM_AS][SC_N][DP_AN][CPU_NEON] = _op_blend_rel_pan_mas_dpan_neon;
113}
114#endif
115
116#ifdef BUILD_NEON
117
118#define _op_blend_rel_pt_p_mas_dpan_neon _op_blend_pt_p_mas_dpan_neon
119#define _op_blend_rel_pt_pas_mas_dpan_neon _op_blend_pt_pas_mas_dpan_neon
120#define _op_blend_rel_pt_pan_mas_dpan_neon _op_blend_pt_pan_mas_dpan_neon
121
122static void
123init_blend_rel_pixel_mask_pt_funcs_neon(void)
124{
125 op_blend_rel_pt_funcs[SP][SM_AS][SC_N][DP_AN][CPU_NEON] = _op_blend_rel_pt_p_mas_dpan_neon;
126 op_blend_rel_pt_funcs[SP_AS][SM_AS][SC_N][DP_AN][CPU_NEON] = _op_blend_rel_pt_pas_mas_dpan_neon;
127 op_blend_rel_pt_funcs[SP_AN][SM_AS][SC_N][DP_AN][CPU_NEON] = _op_blend_rel_pt_pan_mas_dpan_neon;
128}
129#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_mask_sse3.c b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_mask_sse3.c
new file mode 100644
index 0000000..617b9e2
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_mask_sse3.c
@@ -0,0 +1,300 @@
1/* blend pixel x mask --> dst */
2
3#ifdef BUILD_SSE3
4
5static void
6_op_blend_p_mas_dp_sse3(DATA32 *s, DATA8 *m, DATA32 c, DATA32 *d, int l) {
7
8 int alpha;
9
10 LOOP_ALIGNED_U1_A48_SSE3(d, l,
11 { /* UOP */
12
13 alpha = *m;
14 c = MUL_SYM(alpha, *s);
15 alpha = 256 - (c >> 24);
16 *d = c + MUL_256(alpha, *d);
17 m++; s++; d++; l--;
18 },
19 { /* A4OP */
20
21 __m128i s0 = _mm_lddqu_si128((__m128i *)s);
22 __m128i d0 = _mm_load_si128((__m128i *)d);
23 __m128i m0 = _mm_set_epi32(m[3], m[2], m[1], m[0]);
24
25 __m128i c0 = mul_sym_sse3(m0, s0);
26 __m128i a0 = sub4_alpha_sse3(c0);
27 __m128i r0 = mul_256_sse3(a0, d0);
28
29 r0 = _mm_add_epi32(r0, c0);
30
31 _mm_store_si128((__m128i *)d, r0);
32
33 m += 4; s += 4; d += 4; l -= 4;
34 },
35 { /* A8OP */
36
37 __m128i s0 = _mm_lddqu_si128((__m128i *)s);
38 __m128i d0 = _mm_load_si128((__m128i *)d);
39 __m128i m0 = _mm_set_epi32(m[3], m[2], m[1], m[0]);
40
41 __m128i s1 = _mm_lddqu_si128((__m128i *)(s+4));
42 __m128i d1 = _mm_load_si128((__m128i *)(d+4));
43 __m128i m1 = _mm_set_epi32(m[7], m[6], m[5], m[4]);
44
45 __m128i c0 = mul_sym_sse3(m0, s0);
46 __m128i c1 = mul_sym_sse3(m1, s1);
47
48 __m128i a0 = sub4_alpha_sse3(c0);
49 __m128i a1 = sub4_alpha_sse3(c1);
50
51 __m128i r0 = mul_256_sse3(a0, d0);
52 __m128i r1 = mul_256_sse3(a1, d1);
53
54 r0 = _mm_add_epi32(r0, c0);
55 r1 = _mm_add_epi32(r1, c1);
56
57 _mm_store_si128((__m128i *)d, r0);
58 _mm_store_si128((__m128i *)(d+4), r1);
59
60 m += 8; s += 8; d += 8; l -= 8;
61 })
62}
63
64static void
65_op_blend_pas_mas_dp_sse3(DATA32 *s, DATA8 *m, DATA32 c __UNUSED__, DATA32 *d, int l) {
66
67 const __m128i ones = _mm_set_epi32(1, 1, 1, 1);
68 int alpha;
69
70 LOOP_ALIGNED_U1_A48_SSE3(d, l,
71 { /* UOP */
72
73 alpha = *m;
74 switch(alpha)
75 {
76 case 0:
77 break;
78 case 255:
79 *d = *s;
80 break;
81 default:
82 alpha++;
83 *d = INTERP_256(alpha, *s, *d);
84 break;
85 }
86 m++; s++; d++; l--;
87 },
88 { /*A4OP */
89
90 if ((m[3] | m[2] | m[1] | m[0]) == 0) {
91 m += 4; s += 4; d += 4; l -= 4;
92 continue;
93 }
94
95 __m128i s0 = _mm_lddqu_si128((__m128i *)s);
96 __m128i d0 = _mm_load_si128((__m128i *)d);
97 __m128i m0 = _mm_set_epi32(m[3], m[2], m[1], m[0]);
98
99 __m128i zm0 = _mm_cmpeq_epi32(m0, _mm_setzero_si128());
100
101 m0 = _mm_add_epi32(m0, ones);
102
103 __m128i r0 = interp4_256_sse3(m0, s0, d0);
104
105 r0 = _mm_and_si128(~zm0, r0);
106 d0 = _mm_and_si128(zm0, d0);
107
108 d0 = _mm_add_epi32(r0, d0);
109
110 _mm_store_si128((__m128i *)d, d0);
111
112 m += 4; s += 4; d += 4; l -= 4;
113 },
114 { /* A8OP */
115
116 if ((m[7] | m[6] | m[5] | m[4] | m[3] | m[2] | m[1] | m[0]) == 0) {
117 m += 8; s += 8; d += 8; l -= 8;
118 continue;
119 }
120
121 __m128i s0 = _mm_lddqu_si128((__m128i *)s);
122 __m128i d0 = _mm_load_si128((__m128i *)d);
123 __m128i m0 = _mm_set_epi32(m[3], m[2], m[1], m[0]);
124
125 __m128i s1 = _mm_lddqu_si128((__m128i *)(s+4));
126 __m128i d1 = _mm_load_si128((__m128i *)(d+4));
127 __m128i m1 = _mm_set_epi32(m[7], m[6], m[5], m[4]);
128
129 __m128i zm0 = _mm_cmpeq_epi32(m0, _mm_setzero_si128());
130 __m128i zm1 = _mm_cmpeq_epi32(m1, _mm_setzero_si128());
131
132 m0 = _mm_add_epi32(m0, ones);
133 m1 = _mm_add_epi32(m1, ones);
134
135 __m128i r0 = interp4_256_sse3(m0, s0, d0);
136 __m128i r1 = interp4_256_sse3(m1, s1, d1);
137
138 r0 = _mm_and_si128(~zm0, r0);
139 d0 = _mm_and_si128(zm0, d0);
140
141 r1 = _mm_and_si128(~zm1, r1);
142 d1 = _mm_and_si128(zm1, d1);
143
144 d0 = _mm_add_epi32(d0, r0);
145 d1 = _mm_add_epi32(d1, r1);
146
147 _mm_store_si128((__m128i *)d, d0);
148 _mm_store_si128((__m128i *)(d+4), d1);
149
150 m += 8; s += 8; d += 8; l -= 8;
151 })
152}
153
154#define _op_blend_pan_mas_dp_sse3 _op_blend_pas_mas_dp_sse3
155
156#define _op_blend_p_mas_dpan_sse3 _op_blend_p_mas_dp_sse3
157#define _op_blend_pas_mas_dpan_sse3 _op_blend_pas_mas_dp_sse3
158#define _op_blend_pan_mas_dpan_sse3 _op_blend_pan_mas_dp_sse3
159
160static void
161init_blend_pixel_mask_span_funcs_sse3(void)
162{
163 op_blend_span_funcs[SP][SM_AS][SC_N][DP][CPU_SSE3] = _op_blend_p_mas_dp_sse3;
164 op_blend_span_funcs[SP_AS][SM_AS][SC_N][DP][CPU_SSE3] = _op_blend_pas_mas_dp_sse3;
165 op_blend_span_funcs[SP_AN][SM_AS][SC_N][DP][CPU_SSE3] = _op_blend_pan_mas_dp_sse3;
166
167 op_blend_span_funcs[SP][SM_AS][SC_N][DP_AN][CPU_SSE3] = _op_blend_p_mas_dpan_sse3;
168 op_blend_span_funcs[SP_AS][SM_AS][SC_N][DP_AN][CPU_SSE3] = _op_blend_pas_mas_dpan_sse3;
169 op_blend_span_funcs[SP_AN][SM_AS][SC_N][DP_AN][CPU_SSE3] = _op_blend_pan_mas_dpan_sse3;
170}
171
172#define _op_blend_pt_p_mas_dp_sse3 NULL
173#define _op_blend_pt_pan_mas_dp_sse3 NULL
174
175#define _op_blend_pt_pas_mas_dp_sse3 _op_blend_pt_p_mas_dp_sse3
176
177#define _op_blend_pt_p_mas_dpan_sse3 _op_blend_pt_p_mas_dp_sse3
178#define _op_blend_pt_pas_mas_dpan_sse3 _op_blend_pt_pas_mas_dp_sse3
179#define _op_blend_pt_pan_mas_dpan_sse3 _op_blend_pt_pan_mas_dp_sse3
180
181static void
182init_blend_pixel_mask_pt_funcs_sse3(void)
183{
184 op_blend_pt_funcs[SP][SM_AS][SC_N][DP][CPU_SSE3] = _op_blend_pt_p_mas_dp_sse3;
185 op_blend_pt_funcs[SP_AS][SM_AS][SC_N][DP][CPU_SSE3] = _op_blend_pt_pas_mas_dp_sse3;
186 op_blend_pt_funcs[SP_AN][SM_AS][SC_N][DP][CPU_SSE3] = _op_blend_pt_pan_mas_dp_sse3;
187
188 op_blend_pt_funcs[SP][SM_AS][SC_N][DP_AN][CPU_SSE3] = _op_blend_pt_p_mas_dpan_sse3;
189 op_blend_pt_funcs[SP_AS][SM_AS][SC_N][DP_AN][CPU_SSE3] = _op_blend_pt_pas_mas_dpan_sse3;
190 op_blend_pt_funcs[SP_AN][SM_AS][SC_N][DP_AN][CPU_SSE3] = _op_blend_pt_pan_mas_dpan_sse3;
191}
192
193/*-----*/
194
195/* blend_rel pixel x mask -> dst */
196
197static void
198_op_blend_rel_p_mas_dp_sse3(DATA32 *s, DATA8 *m, DATA32 c, DATA32 *d, int l) {
199
200 int alpha;
201
202 LOOP_ALIGNED_U1_A48_SSE3(d, l,
203 { /* UOP */
204
205 c = MUL_SYM(*m, *s);
206 alpha = 256 - (c >> 24);
207 *d = MUL_SYM(*d >> 24, c) + MUL_256(alpha, *d);
208 d++; m++; s++; l--;
209 },
210 { /* A4OP */
211
212 __m128i s0 = _mm_lddqu_si128((__m128i *)s);
213 __m128i m0 = _mm_set_epi32(m[3], m[2], m[1], m[0]);
214 __m128i d0 = _mm_load_si128((__m128i *)d);
215
216 __m128i c0 = mul_sym_sse3(m0, s0);
217 __m128i a0 = sub4_alpha_sse3(c0);
218
219 __m128i l0 = mul_sym_sse3(_mm_srli_epi32(d0, 24), c0);
220 __m128i r0 = mul_256_sse3(a0, d0);
221
222 d0 = _mm_add_epi32(l0, r0);
223
224 _mm_store_si128((__m128i *)d, d0);
225
226 d += 4; m += 4; s += 4; l -= 4;
227 },
228 { /* A8OP */
229
230 __m128i s0 = _mm_lddqu_si128((__m128i *)s);
231 __m128i m0 = _mm_set_epi32(m[3], m[2], m[1], m[0]);
232 __m128i d0 = _mm_load_si128((__m128i *)d);
233
234 __m128i s1 = _mm_lddqu_si128((__m128i *)(s+4));
235 __m128i m1 = _mm_set_epi32(m[7], m[6], m[5], m[4]);
236 __m128i d1 = _mm_load_si128((__m128i *)(d+4));
237
238 __m128i c0 = mul_sym_sse3(m0, s0);
239 __m128i c1 = mul_sym_sse3(m1, s1);
240
241 __m128i a0 = sub4_alpha_sse3(c0);
242 __m128i a1 = sub4_alpha_sse3(c1);
243
244 __m128i l0 = mul_sym_sse3(_mm_srli_epi32(d0, 24), c0);
245 __m128i r0 = mul_256_sse3(a0, d0);
246
247 __m128i l1 = mul_sym_sse3(_mm_srli_epi32(d1, 24), c1);
248 __m128i r1 = mul_256_sse3(a1, d1);
249
250 d0 = _mm_add_epi32(l0, r0);
251 d1 = _mm_add_epi32(l1, r1);
252
253 _mm_store_si128((__m128i *)d, d0);
254 _mm_store_si128((__m128i *)(d+4), d1);
255
256 d += 8; m += 8; s += 8; l -= 8;
257 })
258}
259
260#define _op_blend_rel_pas_mas_dp_sse3 _op_blend_rel_p_mas_dp_sse3
261#define _op_blend_rel_pan_mas_dp_sse3 _op_blend_rel_p_mas_dp_sse3
262
263#define _op_blend_rel_p_mas_dpan_sse3 _op_blend_p_mas_dpan_sse3
264#define _op_blend_rel_pas_mas_dpan_sse3 _op_blend_pas_mas_dpan_sse3
265#define _op_blend_rel_pan_mas_dpan_sse3 _op_blend_pan_mas_dpan_sse3
266
267static void
268init_blend_rel_pixel_mask_span_funcs_sse3(void)
269{
270 op_blend_rel_span_funcs[SP][SM_AS][SC_N][DP][CPU_SSE3] = _op_blend_rel_p_mas_dp_sse3;
271 op_blend_rel_span_funcs[SP_AS][SM_AS][SC_N][DP][CPU_SSE3] = _op_blend_rel_pas_mas_dp_sse3;
272 op_blend_rel_span_funcs[SP_AN][SM_AS][SC_N][DP][CPU_SSE3] = _op_blend_rel_pan_mas_dp_sse3;
273
274 op_blend_rel_span_funcs[SP][SM_AS][SC_N][DP_AN][CPU_SSE3] = _op_blend_rel_p_mas_dpan_sse3;
275 op_blend_rel_span_funcs[SP_AS][SM_AS][SC_N][DP_AN][CPU_SSE3] = _op_blend_rel_pas_mas_dpan_sse3;
276 op_blend_rel_span_funcs[SP_AN][SM_AS][SC_N][DP_AN][CPU_SSE3] = _op_blend_rel_pan_mas_dpan_sse3;
277}
278
279#define _op_blend_rel_pt_p_mas_dp_sse3 NULL
280
281#define _op_blend_rel_pt_pas_mas_dp_sse3 _op_blend_rel_pt_p_mas_dp_sse3
282#define _op_blend_rel_pt_pan_mas_dp_sse3 _op_blend_rel_pt_p_mas_dp_sse3
283
284#define _op_blend_rel_pt_p_mas_dpan_sse3 _op_blend_pt_p_mas_dpan_sse3
285#define _op_blend_rel_pt_pas_mas_dpan_sse3 _op_blend_pt_pas_mas_dpan_sse3
286#define _op_blend_rel_pt_pan_mas_dpan_sse3 _op_blend_pt_pan_mas_dpan_sse3
287
288static void
289init_blend_rel_pixel_mask_pt_funcs_sse3(void)
290{
291 op_blend_rel_pt_funcs[SP][SM_AS][SC_N][DP][CPU_SSE3] = _op_blend_rel_pt_p_mas_dp_sse3;
292 op_blend_rel_pt_funcs[SP_AS][SM_AS][SC_N][DP][CPU_SSE3] = _op_blend_rel_pt_pas_mas_dp_sse3;
293 op_blend_rel_pt_funcs[SP_AN][SM_AS][SC_N][DP][CPU_SSE3] = _op_blend_rel_pt_pan_mas_dp_sse3;
294
295 op_blend_rel_pt_funcs[SP][SM_AS][SC_N][DP_AN][CPU_SSE3] = _op_blend_rel_pt_p_mas_dpan_sse3;
296 op_blend_rel_pt_funcs[SP_AS][SM_AS][SC_N][DP_AN][CPU_SSE3] = _op_blend_rel_pt_pas_mas_dpan_sse3;
297 op_blend_rel_pt_funcs[SP_AN][SM_AS][SC_N][DP_AN][CPU_SSE3] = _op_blend_rel_pt_pan_mas_dpan_sse3;
298}
299
300#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_neon.c b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_neon.c
new file mode 100644
index 0000000..1cb50b6
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_neon.c
@@ -0,0 +1,530 @@
1/* blend pixel --> dst */
2
3#ifdef BUILD_NEON
4static void
5_op_blend_p_dp_neon(DATA32 *s, DATA8 *m, DATA32 c, DATA32 *d, int l) {
6#define AP "blend_p_dp_"
7 asm volatile (
8 ".fpu neon \n\t"
9 //** init
10 "vmov.i8 q8, $0x1 \n\t"
11
12 AP "loopchoose: \n\t"
13 // If aligned already - straight to octs
14 "andS %[tmp], %[d],$0x1f \n\t"
15 "beq "AP"octloops \n\t"
16
17 "andS %[tmp], %[d],$0xf \n\t"
18 "beq "AP"quadloops \n\t"
19
20 "andS %[tmp], %[d],$0x4 \n\t"
21 "beq "AP"dualloop \n\t"
22
23 // Only ever executes once, fall through to dual
24 AP "singleloop: \n\t"
25 "vld1.32 d0[0], [%[s]]! \n\t"
26 "vld1.32 d4[0], [%[d]] \n\t"
27
28 "vmvn.u8 d8, d0 \n\t"
29 "vshr.u32 d8, d8, #24 \n\t"
30
31 "vmul.u32 d8, d16, d8 \n\t"
32
33 "vmull.u8 q6, d4,d8 \n\t"
34 "vqrshrn.u16 d8, q6, #8 \n\t"
35 // Add to 's'
36 "vqadd.u8 q2, q4,q0 \n\t"
37
38 "vst1.32 d4[0], [%[d]] \n\t"
39 "add %[d], #4 \n\t"
40
41 // Can we go the fast path?
42 "andS %[tmp], %[d],$0x1f \n\t"
43 "beq "AP"octloops \n\t"
44
45 "andS %[tmp], %[d],$0x0f \n\t"
46 "beq "AP"quadloops \n\t"
47
48
49 AP "dualloop: \n\t"
50 "sub %[tmp], %[e], %[d] \n\t"
51 "cmp %[tmp], #32 \n\t"
52 "blt "AP"loopout \n\t"
53
54 AP "dualloopint: \n\t"
55 //** Dual Loop
56 "vldm %[s]!, {d0} \n\t"
57 "vldr d4, [%[d]] \n\t"
58
59 "vmvn.u8 d8, d0 \n\t"
60 "vshr.u32 d8, d8, #24 \n\t"
61
62 "vmul.u32 d8, d16, d8 \n\t"
63
64 "vmull.u8 q6, d4,d8 \n\t"
65 "vqrshrn.u16 d8, q6, #8 \n\t"
66 // Add to 's'
67 "vqadd.u8 d4, d8,d0 \n\t"
68 "vstr d4, [%[d]] \n\t"
69 "add %[d], #8 \n\t"
70
71 "ands %[tmp], %[d], $0x1f \n\t"
72 "beq "AP"octloops \n\t"
73
74 AP"quadloops: \n\t"
75 "sub %[tmp], %[e], %[d] \n\t"
76 "cmp %[tmp], #32 \n\t"
77 "blt "AP"loopout \n\t"
78
79 "vldm %[s]!, {d0,d1) \n\t"
80 "vldm %[d], {d4,d5} \n\t"
81
82
83 // Copy s.a into q2 (>> 24) & subtract from 255
84 "vmvn.u8 q4, q0 \n\t"
85 "vshr.u32 q4, q4,$0x18 \n\t"
86
87 // Multiply into all fields
88 "vmul.u32 q4, q8,q4 \n\t"
89
90 // a * d (clobbering 'd'/q7)
91 "vmull.u8 q6, d4,d8 \n\t"
92 "vmull.u8 q2, d5,d9 \n\t"
93
94 // Shift & narrow it
95 "vqrshrn.u16 d8, q6, #8 \n\t"
96 "vqrshrn.u16 d9, q2, #8 \n\t"
97
98 // Add to s
99 "vqadd.u8 q2, q4,q0 \n\t"
100
101 // Write it
102 "vstm %[d]!, {d4,d5} \n\t"
103
104 AP "octloops: \n\t"
105 "sub %[tmp], %[e], %[d] \n\t"
106 "cmp %[tmp], #32 \n\t"
107 "ble "AP"loopout \n\t"
108
109 "sub %[tmp],%[e],#64 \n\t"
110
111
112 AP "octloopint:\n\t"
113 //** Oct loop
114 "vldm %[s]!, {d0,d1,d2,d3) \n\t"
115 "vldm %[d], {d4,d5,d6,d7} \n\t"
116 "pld [%[s], #64] \n\t"
117
118
119 // Copy s.a into q2 (>> 24) & subtract from 255
120 "vmvn.u8 q4, q0 \n\t"
121 "vmvn.u8 q5, q1 \n\t"
122 "vshr.u32 q4, q4,$0x18 \n\t"
123 "vshr.u32 q5, q5,$0x18\n\t"
124
125 // Multiply into all fields
126 "vmul.u32 q4, q8,q4 \n\t"
127 "vmul.u32 q5, q8,q5 \n\t"
128
129
130 // a * d (clobbering 'd'/q7)
131 "vmull.u8 q6, d4,d8 \n\t"
132 "vmull.u8 q2, d5,d9 \n\t"
133 "vmull.u8 q7, d6,d10 \n\t"
134 "vmull.u8 q3, d7,d11 \n\t"
135
136 "cmp %[tmp], %[d]\n\t"
137
138 // Shift & narrow it
139 "vqrshrn.u16 d8, q6, #8 \n\t"
140 "vqrshrn.u16 d9, q2, #8 \n\t"
141 "vqrshrn.u16 d10, q7, #8 \n\t"
142 "vqrshrn.u16 d11, q3, #8 \n\t"
143
144
145 // Add to s
146 "vqadd.u8 q2, q4,q0 \n\t"
147 "vqadd.u8 q3, q5,q1 \n\t"
148
149 // Write it
150 "vstm %[d]!, {d4,d5,d6,d7} \n\t"
151
152 "bhi "AP"octloopint\n\t"
153
154 AP "loopout: \n\t"
155 "cmp %[d], %[e] \n\t"
156 "beq "AP"done \n\t"
157 "sub %[tmp],%[e], %[d] \n\t"
158 "cmp %[tmp],$0x04 \n\t"
159 "ble "AP"singleloop2 \n\t"
160
161 AP "dualloop2: \n\t"
162 "sub %[tmp],%[e],$0x7 \n\t"
163 AP "dualloop2int: \n\t"
164 //** Trailing double
165
166 "vldm %[s]!, {d0} \n\t"
167 "vldm %[d], {d4} \n\t"
168
169 "vmvn.u8 d8, d0 \n\t"
170 "vshr.u32 d8, d8, #24 \n\t"
171
172 "vmul.u32 d8, d16, d8 \n\t"
173
174 "vmull.u8 q6, d4,d8 \n\t"
175 "vqrshrn.u16 d8, q6, #8 \n\t"
176 // Add to 's'
177 "vqadd.u8 d4, d8,d0 \n\t"
178
179 "vstr.32 d4, [%[d]] \n\t"
180 "add %[d], #8 \n\t"
181
182 "cmp %[tmp], %[d] \n\t"
183 "bhi "AP"dualloop2int \n\t"
184
185 // Single ??
186 "cmp %[e], %[d] \n\t"
187 "beq "AP"done \n\t"
188
189 AP"singleloop2: \n\t"
190 "vld1.32 d0[0], [%[s]] \n\t"
191 "vld1.32 d4[0], [%[d]] \n\t"
192
193 "vmvn.u8 d8, d0 \n\t"
194 "vshr.u32 d8, d8, #24 \n\t"
195
196 "vmul.u32 d8, d8, d16 \n\t"
197
198 "vmull.u8 q6, d8,d4 \n\t"
199 "vqrshrn.u16 d8, q6, #8 \n\t"
200 // Add to 's'
201 "vqadd.u8 d0, d0,d8 \n\t"
202 "vst1.32 d0[0], [%[d]] \n\t"
203
204 //** Trailing single
205
206 AP"done:\n\t"
207//"sub %[tmp], %[e], #4 \n\t"
208//"vmov.i32 d0, $0xffff0000 \n\t"
209//"vst1.32 d0[0], [%[tmp]] \n\t"
210
211
212 : // output regs
213 // Input
214 : [e] "r" (d + l), [d] "r" (d), [s] "r" (s), [c] "r" (c),
215 [tmp] "r" (7)
216 : "q0", "q1", "q2","q3", "q4","q5","q6", "q7","q8","memory" // clobbered
217 );
218#undef AP
219
220}
221
222static void
223_op_blend_pas_dp_neon(DATA32 *s, DATA8 *m, DATA32 c, DATA32 *d, int l) {
224#define AP "blend_pas_dp_"
225 DATA32 *e = d + l,*tmp = e + 32,*pl=(void*)912;
226 asm volatile (
227 ".fpu neon \n\t"
228 "vmov.i8 q8, #1 \n\t"
229 AP"loopchoose: \n\t"
230 // If aliged - go as fast we can
231 "andS %[tmp], %[d], #31 \n\t"
232 "beq "AP"quadstart \n\t"
233
234 // See if we can at least do our double loop
235 "andS %[tmp], %[d], $0x7 \n\t"
236 "beq "AP"dualstart \n\t"
237
238 // Ugly single word version
239 AP "singleloop: \n\t"
240 "vld1.32 d0[0], [%[s]]! \n\t"
241 "vld1.32 d4[0], [%[d]] \n\t"
242
243 "vmvn.u8 d8, d0 \n\t"
244
245 "vshr.u32 d8, d8,$0x18 \n\t"
246
247 // Mulitply into all fields
248 "vmul.u32 d8, d8, d16 \n\t"
249
250 // Multiply out
251 "vmull.u8 q6, d8, d4 \n\t"
252
253 "vqrshrn.u16 d8, q6, #8 \n\t"
254
255 // Add to s
256 "vqadd.u8 d0, d0,d8 \n\t"
257 "vst1.32 d0[0], [%[d]]! \n\t"
258
259 AP"dualstart: \n\t"
260 "sub %[tmp], %[e], %[d] \n\t"
261 "cmp %[tmp], #32 \n\t"
262 "blt "AP"loopout \n\t"
263
264 // If aligned - go as fast we can
265 "andS %[tmp], %[d], #31 \n\t"
266 "beq "AP"quadstart \n\t"
267
268
269 AP"dualloop: \n\t"
270
271 "vldm %[s]!, {d0) \n\t"
272 "vldm %[d], {d4} \n\t"
273
274 // Subtract from 255 (ie negate) and extract alpha channel
275 "vmvn.u8 d8, d0 \n\t"
276 "vshr.u32 d8, d8,$0x18 \n\t"
277
278 // Mulitply into all fields
279 "vmul.u32 d8, d8, d16 \n\t"
280
281 // Multiply out
282 "vmull.u8 q6, d8, d4 \n\t"
283
284 "vqrshrn.u16 d8, q6, #8 \n\t"
285
286 // Add to s
287 "vqadd.u8 d0, d0,d8 \n\t"
288 "vstm %[d]!, {d0} \n\t"
289
290 "andS %[tmp], %[d], $0x1f \n\t"
291 "bne "AP"dualloop \n\t"
292
293
294 AP"quadstart: \n\t"
295 "sub %[tmp], %[e], %[d] \n\t"
296 "cmp %[tmp], #32 \n\t"
297 "blt "AP"loopout \n\t"
298
299 "sub %[tmp], %[e], #31 \n\t"
300
301 AP"quadloop:\n\t"
302 "vldm %[s]!, {d0,d1,d2,d3) \n\t"
303 "vldm %[d], {d4,d5,d6,d7} \n\t"
304
305 // Subtract from 255 (ie negate) and extract alpha channel
306 "vmvn.u8 q4, q0 \n\t"
307 "vmvn.u8 q5, q1 \n\t"
308 "vshr.u32 q4, q4,$0x18 \n\t"
309 "vshr.u32 q5, q5,$0x18 \n\t"
310
311 // Prepare to preload
312 "add %[pl], %[s], #32 \n\t"
313
314 // Mulitply into all fields
315 "vmul.u32 q4, q4, q8 \n\t"
316 "vmul.u32 q5, q5, q8 \n\t"
317 "pld [%[pl]] \n\t"
318
319 // Multiply out
320 "vmull.u8 q6, d8, d4 \n\t"
321 "vmull.u8 q7, d10, d6 \n\t"
322 "vmull.u8 q2, d9, d5 \n\t"
323 "vmull.u8 q3, d11, d7 \n\t"
324
325 "add %[pl], %[d], #32 \n\t"
326
327 "vqrshrn.u16 d8, q6, #8 \n\t"
328 "vqrshrn.u16 d10, q7, #8 \n\t"
329 "vqrshrn.u16 d9, q2, #8 \n\t"
330 "vqrshrn.u16 d11, q3, #8 \n\t"
331 "pld [%[pl]] \n\t"
332
333 "cmp %[tmp], %[pl] \n\t"
334 // Add to s
335 "vqadd.u8 q0, q0,q4 \n\t"
336 "vqadd.u8 q1, q1,q5 \n\t"
337
338 "vstm %[d]!, {d0,d1,d2,d3} \n\t"
339
340 "bhi "AP"quadloop \n\t"
341
342 AP "loopout: \n\t"
343 "cmp %[d], %[e] \n\t"
344 "beq "AP"done \n\t"
345
346 "sub %[tmp],%[e], %[d] \n\t"
347 "cmp %[tmp],$0x04 \n\t"
348 "beq "AP"singleloop2 \n\t"
349
350 "sub %[tmp],%[e],$0x7 \n\t"
351
352 AP"dualloop2: \n\t"
353 "vldm %[s]!, {d0) \n\t"
354 "vldm %[d], {d4} \n\t"
355
356 // Subtract from 255 (ie negate) and extract alpha channel
357 "vmvn.u8 d8, d0 \n\t"
358 "vshr.u32 d8, d8,$0x18 \n\t"
359
360 // Mulitply into all fields
361 "vmul.u32 d8, d8, d16 \n\t"
362
363 // Multiply out
364 "vmull.u8 q6, d8, d4 \n\t"
365
366 "vqrshrn.u16 d8, q6, #8 \n\t"
367
368 // Add to s
369 "vqadd.u8 d0, d0,d8 \n\t"
370
371 "vstm %[d]!, {d0} \n\t"
372 "cmp %[tmp], %[d] \n\t"
373
374 "bhi "AP"dualloop2 \n\t"
375
376 // Single ??
377 "cmp %[e], %[d] \n\t"
378 "beq "AP"done \n\t"
379
380 AP "singleloop2: \n\t"
381 "vld1.32 d0[0], [%[s]] \n\t"
382 "vld1.32 d4[0], [%[d]] \n\t"
383
384 "vmvn.u8 d8, d0 \n\t"
385
386 "vshr.u32 d8, d8,$0x18 \n\t"
387
388 // Mulitply into all fields
389 "vmul.u32 d8, d8, d16 \n\t"
390
391 // Multiply out
392 "vmull.u8 q6, d8, d4 \n\t"
393
394 "vqrshrn.u16 d8, q6, #8 \n\t"
395
396 // Add to s
397 "vqadd.u8 d0, d0,d8 \n\t"
398
399 "vst1.32 d0[0], [%[d]] \n\t"
400 AP "done:\n\t"
401
402
403 : /* Out */
404 : /* In */ [s] "r" (s), [e] "r" (e), [d] "r" (d), [tmp] "r" (tmp),
405 [pl] "r" (pl)
406 : /* Clobbered */
407 "q0","q1","q2","q3","q4","q5","q6","q7","q8","memory"
408 );
409#undef AP
410}
411
412#define _op_blend_pan_dp_neon NULL
413
414#define _op_blend_p_dpan_neon _op_blend_p_dp_neon
415#define _op_blend_pas_dpan_neon _op_blend_pas_dp_neon
416#define _op_blend_pan_dpan_neon _op_blend_pan_dp_neon
417
418static void
419init_blend_pixel_span_funcs_neon(void)
420{
421 op_blend_span_funcs[SP][SM_N][SC_N][DP][CPU_NEON] = _op_blend_p_dp_neon;
422 op_blend_span_funcs[SP_AS][SM_N][SC_N][DP][CPU_NEON] = _op_blend_pas_dp_neon;
423 op_blend_span_funcs[SP_AN][SM_N][SC_N][DP][CPU_NEON] = _op_blend_pan_dp_neon;
424
425 op_blend_span_funcs[SP][SM_N][SC_N][DP_AN][CPU_NEON] = _op_blend_p_dpan_neon;
426 op_blend_span_funcs[SP_AS][SM_N][SC_N][DP_AN][CPU_NEON] = _op_blend_pas_dpan_neon;
427 op_blend_span_funcs[SP_AN][SM_N][SC_N][DP_AN][CPU_NEON] = _op_blend_pan_dpan_neon;
428}
429#endif
430
431#ifdef BUILD_NEON
432static void
433_op_blend_pt_p_dp_neon(DATA32 s, DATA8 m, DATA32 c, DATA32 *d) {
434 c = 256 - (s >> 24);
435 *d = s + MUL_256(c, *d);
436}
437
438
439#define _op_blend_pt_pan_dp_neon NULL
440#define _op_blend_pt_pas_dp_neon _op_blend_pt_p_dp_neon
441
442#define _op_blend_pt_p_dpan_neon _op_blend_pt_p_dp_neon
443#define _op_blend_pt_pan_dpan_neon _op_blend_pt_pan_dp_neon
444#define _op_blend_pt_pas_dpan_neon _op_blend_pt_pas_dp_neon
445
446static void
447init_blend_pixel_pt_funcs_neon(void)
448{
449 op_blend_pt_funcs[SP][SM_N][SC_N][DP][CPU_NEON] = _op_blend_pt_p_dp_neon;
450 op_blend_pt_funcs[SP_AS][SM_N][SC_N][DP][CPU_NEON] = _op_blend_pt_pas_dp_neon;
451 op_blend_pt_funcs[SP_AN][SM_N][SC_N][DP][CPU_NEON] = _op_blend_pt_pan_dp_neon;
452
453 op_blend_pt_funcs[SP][SM_N][SC_N][DP_AN][CPU_NEON] = _op_blend_pt_p_dpan_neon;
454 op_blend_pt_funcs[SP_AS][SM_N][SC_N][DP_AN][CPU_NEON] = _op_blend_pt_pas_dpan_neon;
455 op_blend_pt_funcs[SP_AN][SM_N][SC_N][DP_AN][CPU_NEON] = _op_blend_pt_pan_dpan_neon;
456}
457#endif
458
459/*-----*/
460
461/* blend_rel pixel -> dst */
462
463#ifdef BUILD_NEON
464static void
465_op_blend_rel_p_dp_neon(DATA32 *s, DATA8 *m, DATA32 c, DATA32 *d, int l) {
466 DATA32 *e = d + l;
467 while (d < e) {
468 l = 256 - (*s >> 24);
469 c = 1 + (*d >> 24);
470 *d = MUL_256(c, *s) + MUL_256(l, *d);
471 d++;
472 s++;
473 }
474}
475
476static void
477_op_blend_rel_pan_dp_neon(DATA32 *s, DATA8 *m, DATA32 c, DATA32 *d, int l) {
478 DATA32 *e = d + l;
479 while (d < e) {
480 c = 1 + (*d >> 24);
481 *d++ = MUL_256(c, *s);
482 s++;
483 }
484}
485
486#define _op_blend_rel_pas_dp_neon _op_blend_rel_p_dp_neon
487
488#define _op_blend_rel_p_dpan_neon _op_blend_p_dpan_neon
489#define _op_blend_rel_pan_dpan_neon _op_blend_pan_dpan_neon
490#define _op_blend_rel_pas_dpan_neon _op_blend_pas_dpan_neon
491
492static void
493init_blend_rel_pixel_span_funcs_neon(void)
494{
495 op_blend_rel_span_funcs[SP][SM_N][SC_N][DP][CPU_NEON] = _op_blend_rel_p_dp_neon;
496 op_blend_rel_span_funcs[SP_AS][SM_N][SC_N][DP][CPU_NEON] = _op_blend_rel_pas_dp_neon;
497 op_blend_rel_span_funcs[SP_AN][SM_N][SC_N][DP][CPU_NEON] = _op_blend_rel_pan_dp_neon;
498
499 op_blend_rel_span_funcs[SP][SM_N][SC_N][DP_AN][CPU_NEON] = _op_blend_rel_p_dpan_neon;
500 op_blend_rel_span_funcs[SP_AS][SM_N][SC_N][DP_AN][CPU_NEON] = _op_blend_rel_pas_dpan_neon;
501 op_blend_rel_span_funcs[SP_AN][SM_N][SC_N][DP_AN][CPU_NEON] = _op_blend_rel_pan_dpan_neon;
502}
503#endif
504
505#ifdef BUILD_NEON
506static void
507_op_blend_rel_pt_p_dp_neon(DATA32 s, DATA8 m, DATA32 c, DATA32 *d) {
508 c = 256 - (s >> 24);
509 *d = MUL_SYM(*d >> 24, s) + MUL_256(c, *d);
510}
511
512#define _op_blend_rel_pt_pas_dp_neon _op_blend_rel_pt_p_dp_neon
513#define _op_blend_rel_pt_pan_dp_neon _op_blend_rel_pt_p_dp_neon
514
515#define _op_blend_rel_pt_p_dpan_neon _op_blend_pt_p_dpan_neon
516#define _op_blend_rel_pt_pas_dpan_neon _op_blend_pt_pas_dpan_neon
517#define _op_blend_rel_pt_pan_dpan_neon _op_blend_pt_pan_dpan_neon
518
519static void
520init_blend_rel_pixel_pt_funcs_neon(void)
521{
522 op_blend_rel_pt_funcs[SP][SM_N][SC_N][DP][CPU_NEON] = _op_blend_rel_pt_p_dp_neon;
523 op_blend_rel_pt_funcs[SP_AS][SM_N][SC_N][DP][CPU_NEON] = _op_blend_rel_pt_pas_dp_neon;
524 op_blend_rel_pt_funcs[SP_AN][SM_N][SC_N][DP][CPU_NEON] = _op_blend_rel_pt_pan_dp_neon;
525
526 op_blend_rel_pt_funcs[SP][SM_N][SC_N][DP_AN][CPU_NEON] = _op_blend_rel_pt_p_dpan_neon;
527 op_blend_rel_pt_funcs[SP_AS][SM_N][SC_N][DP_AN][CPU_NEON] = _op_blend_rel_pt_pas_dpan_neon;
528 op_blend_rel_pt_funcs[SP_AN][SM_N][SC_N][DP_AN][CPU_NEON] = _op_blend_rel_pt_pan_dpan_neon;
529}
530#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_sse3.c b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_sse3.c
new file mode 100644
index 0000000..2e72fec
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_sse3.c
@@ -0,0 +1,316 @@
1/* blend pixel --> dst */
2
3#ifdef BUILD_SSE3
4
5static void
6_op_blend_p_dp_sse3(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c __UNUSED__, DATA32 *d, int l) {
7
8 LOOP_ALIGNED_U1_A48_SSE3(d, l,
9 { /* UOP */
10
11 int alpha = 256 - (*s >> 24);
12 *d = *s + MUL_256(alpha, *d);
13 s++; d++; l--;
14 },
15 { /* A4OP */
16
17 __m128i s0 = _mm_lddqu_si128((__m128i *)s);
18 __m128i d0 = _mm_load_si128((__m128i *)d);
19
20 __m128i a0 = sub4_alpha_sse3(s0);
21 __m128i mul0 = mul_256_sse3(a0, d0);
22 d0 = _mm_add_epi32(mul0, s0);
23
24 _mm_store_si128((__m128i *)d, d0);
25
26 s += 4; d += 4; l -= 4;
27 },
28 { /* A8OP */
29
30 __m128i s0 = _mm_lddqu_si128((__m128i *)s);
31 __m128i d0 = _mm_load_si128((__m128i *)d);
32
33 __m128i s1 = _mm_lddqu_si128((__m128i *)(s+4));
34 __m128i d1 = _mm_load_si128((__m128i *)(d+4));
35
36 __m128i a0 = sub4_alpha_sse3(s0);
37 __m128i a1 = sub4_alpha_sse3(s1);
38
39 __m128i mul0 = mul_256_sse3(a0, d0);
40 __m128i mul1 = mul_256_sse3(a1, d1);
41
42 d0 = _mm_add_epi32(mul0, s0);
43 d1 = _mm_add_epi32(mul1, s1);
44
45 _mm_store_si128((__m128i *)d, d0);
46 _mm_store_si128((__m128i *)(d+4), d1);
47
48 s += 8; d += 8; l -= 8;
49 })
50}
51
52static void
53_op_blend_pas_dp_sse3(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c __UNUSED__, DATA32 *d, int l) {
54
55 int alpha;
56
57 const __m128i zero = _mm_setzero_si128();
58
59 LOOP_ALIGNED_U1_A48_SSE3(d, l,
60 { /* UOP */
61 switch (*s & 0xff000000)
62 {
63 case 0:
64 break;
65 case 0xff000000:
66 *d = *s;
67 break;
68 default:
69 alpha = 256 - (*s >> 24);
70 *d = *s + MUL_256(alpha, *d);
71 break;
72 }
73 s++; d++; l--;
74 },
75 { /* A4OP */
76
77 __m128i s0 = _mm_lddqu_si128((__m128i *)s);
78 __m128i d0 = _mm_load_si128((__m128i *)d);
79
80 __m128i a0 = sub4_alpha_sse3(s0);
81 __m128i mul0 = mul_256_sse3(a0, d0);
82
83 mul0 = _mm_add_epi32(s0, mul0);
84
85 __m128i zmask0 = _mm_cmpeq_epi32(_mm_srli_epi32(s0, 24), zero);
86 __m128i imask0 = ~zmask0;
87
88 mul0 = _mm_and_si128(imask0, mul0);
89 d0 = _mm_and_si128(zmask0, d0);
90
91 d0 = _mm_add_epi32(mul0, d0);
92
93 _mm_store_si128((__m128i *)d, d0);
94
95 s += 4; d += 4; l -= 4;
96 },
97 { /* A8OP */
98
99 __m128i s0 = _mm_lddqu_si128((__m128i *)s);
100 __m128i d0 = _mm_load_si128((__m128i *)d);
101
102 __m128i s1 = _mm_lddqu_si128((__m128i *)(s+4));
103 __m128i d1 = _mm_load_si128((__m128i *)(d+4));
104
105 __m128i a0 = sub4_alpha_sse3(s0);
106 __m128i a1 = sub4_alpha_sse3(s1);
107
108 __m128i mul0 = mul_256_sse3(a0, d0);
109 __m128i mul1 = mul_256_sse3(a1, d1);
110
111 mul0 = _mm_add_epi32(s0, mul0);
112 mul1 = _mm_add_epi32(s1, mul1);
113
114 __m128i zmask0 = _mm_cmpeq_epi32(_mm_srli_epi32(s0, 24), zero);
115 __m128i zmask1 = _mm_cmpeq_epi32(_mm_srli_epi32(s1, 24), zero);
116
117 __m128i imask0 = ~zmask0;
118 __m128i imask1 = ~zmask1;
119
120 mul0 = _mm_and_si128(imask0, mul0);
121 d0 = _mm_and_si128(zmask0, d0);
122
123 mul1 = _mm_and_si128(imask1, mul1);
124 d1 = _mm_and_si128(zmask1, d1);
125
126 d0 = _mm_add_epi32(mul0, d0);
127 d1 = _mm_add_epi32(mul1, d1);
128
129 _mm_store_si128((__m128i *)d, d0);
130 _mm_store_si128((__m128i *)(d+4), d1);
131
132 s += 8; d += 8; l -= 8;
133 })
134}
135
136#define _op_blend_pan_dp_sse3 NULL
137
138#define _op_blend_p_dpan_sse3 _op_blend_p_dp_sse3
139#define _op_blend_pas_dpan_sse3 _op_blend_pas_dp_sse3
140#define _op_blend_pan_dpan_sse3 _op_blend_pan_dp_sse3
141
142static void
143init_blend_pixel_span_funcs_sse3(void)
144{
145 op_blend_span_funcs[SP][SM_N][SC_N][DP][CPU_SSE3] = _op_blend_p_dp_sse3;
146 op_blend_span_funcs[SP_AS][SM_N][SC_N][DP][CPU_SSE3] = _op_blend_pas_dp_sse3;
147 op_blend_span_funcs[SP_AN][SM_N][SC_N][DP][CPU_SSE3] = _op_blend_pan_dp_sse3;
148
149
150// FIXME: BUGGY BUGGY Core i5 750 (32bit), 4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu4), ello (text and rectangle)
151// op_blend_span_funcs[SP][SM_N][SC_N][DP_AN][CPU_SSE3] = _op_blend_p_dpan_sse3;
152 op_blend_span_funcs[SP_AS][SM_N][SC_N][DP_AN][CPU_SSE3] = _op_blend_pas_dpan_sse3;
153 op_blend_span_funcs[SP_AN][SM_N][SC_N][DP_AN][CPU_SSE3] = _op_blend_pan_dpan_sse3;
154}
155
156#define _op_blend_pt_p_dp_sse3 NULL
157
158#define _op_blend_pt_pas_dp_sse3 _op_blend_pt_p_dp_sse3
159#define _op_blend_pt_pan_dp_sse3 NULL
160
161#define _op_blend_pt_p_dpan_sse3 _op_blend_pt_p_dp_sse3
162#define _op_blend_pt_pan_dpan_sse3 _op_blend_pt_pan_dp_sse3
163#define _op_blend_pt_pas_dpan_sse3 _op_blend_pt_pas_dp_sse3
164
165static void
166init_blend_pixel_pt_funcs_sse3(void)
167{
168 op_blend_pt_funcs[SP][SM_N][SC_N][DP][CPU_SSE3] = _op_blend_pt_p_dp_sse3;
169 op_blend_pt_funcs[SP_AS][SM_N][SC_N][DP][CPU_SSE3] = _op_blend_pt_pas_dp_sse3;
170 op_blend_pt_funcs[SP_AN][SM_N][SC_N][DP][CPU_SSE3] = _op_blend_pt_pan_dp_sse3;
171
172 op_blend_pt_funcs[SP][SM_N][SC_N][DP_AN][CPU_SSE3] = _op_blend_pt_p_dpan_sse3;
173 op_blend_pt_funcs[SP_AS][SM_N][SC_N][DP_AN][CPU_SSE3] = _op_blend_pt_pas_dpan_sse3;
174 op_blend_pt_funcs[SP_AN][SM_N][SC_N][DP_AN][CPU_SSE3] = _op_blend_pt_pan_dpan_sse3;
175}
176
177/*-----*/
178
179/* blend_rel pixel -> dst */
180
181static void
182_op_blend_rel_p_dp_sse3(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) {
183
184 const __m128i ones = _mm_set_epi32(1, 1, 1, 1);
185
186 LOOP_ALIGNED_U1_A48_SSE3(d, l,
187 { /* UOP */
188
189 int alpha = 256 - (*s >> 24);
190 c = 1 + (*d >> 24);
191 *d = MUL_256(c, *s) + MUL_256(alpha, *d);
192 d++; s++; l--;
193 },
194 { /*A4OP */
195
196 __m128i s0 = _mm_lddqu_si128((__m128i *)s);
197 __m128i d0 = _mm_load_si128((__m128i *)d);
198
199 __m128i c0 = _mm_add_epi32(_mm_srli_epi32(d0, 24), ones);
200 __m128i a0 = sub4_alpha_sse3(s0);
201
202 d0 = _mm_add_epi32(mul_256_sse3(c0, s0), mul_256_sse3(a0, d0));
203
204 _mm_store_si128((__m128i *)d, d0);
205
206 d += 4; s += 4; l -= 4;
207 },
208 { /* A8OP */
209
210 __m128i s0 = _mm_lddqu_si128((__m128i *)s);
211 __m128i d0 = _mm_load_si128 ((__m128i *)d);
212
213 __m128i s1 = _mm_lddqu_si128((__m128i *)(s+4));
214 __m128i d1 = _mm_load_si128 ((__m128i *)(d+4));
215
216 __m128i c0 = _mm_add_epi32(_mm_srli_epi32(d0, 24), ones);
217 __m128i c1 = _mm_add_epi32(_mm_srli_epi32(d1, 24), ones);
218
219 __m128i a0 = sub4_alpha_sse3(s0);
220 __m128i a1 = sub4_alpha_sse3(s1);
221
222 d0 = _mm_add_epi32(mul_256_sse3(c0, s0), mul_256_sse3(a0, d0));
223 d1 = _mm_add_epi32(mul_256_sse3(c1, s1), mul_256_sse3(a1, d1));
224
225 _mm_store_si128((__m128i *)d, d0);
226 _mm_store_si128((__m128i *)(d+4), d1);
227
228 d += 8; s += 8; l -= 8;
229 })
230}
231
232static void
233_op_blend_rel_pan_dp_sse3(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) {
234
235 const __m128i ones = _mm_set_epi32(1, 1, 1, 1);
236
237 LOOP_ALIGNED_U1_A48_SSE3(d, l,
238 { /* UOP */
239
240 c = 1 + (*d >> 24);
241 *d++ = MUL_256(c, *s);
242 s++; l--;
243 },
244 { /* A4OP */
245
246 __m128i s0 = _mm_lddqu_si128((__m128i *)s);
247 __m128i d0 = _mm_load_si128((__m128i *)d);
248
249 __m128i c0 = _mm_add_epi32(_mm_srli_epi32(d0, 24), ones);
250 d0 = mul_256_sse3(c0, s0);
251
252 _mm_store_si128((__m128i *)d, d0);
253
254 d += 4; s += 4; l -= 4;
255 },
256 { /* A8OP */
257
258 __m128i s0 = _mm_lddqu_si128((__m128i *)s);
259 __m128i d0 = _mm_load_si128 ((__m128i *)d);
260
261 __m128i s1 = _mm_lddqu_si128((__m128i *)(s+4));
262 __m128i d1 = _mm_load_si128 ((__m128i *)(d+4));
263
264 __m128i c0 = _mm_add_epi32(_mm_srli_epi32(d0, 24), ones);
265 __m128i c1 = _mm_add_epi32(_mm_srli_epi32(d1, 24), ones);
266
267 d0 = mul_256_sse3(c0, s0);
268 d1 = mul_256_sse3(c1, s1);
269
270 _mm_store_si128((__m128i *)d, d0);
271 _mm_store_si128((__m128i *)(d+4), d1);
272
273 d += 8; s += 8; l -= 8;
274 })
275}
276
277#define _op_blend_rel_pas_dp_sse3 _op_blend_rel_p_dp_sse3
278
279#define _op_blend_rel_p_dpan_sse3 _op_blend_p_dpan_sse3
280#define _op_blend_rel_pan_dpan_sse3 _op_blend_pan_dpan_sse3
281#define _op_blend_rel_pas_dpan_sse3 _op_blend_pas_dpan_sse3
282
283static void
284init_blend_rel_pixel_span_funcs_sse3(void)
285{
286 op_blend_rel_span_funcs[SP][SM_N][SC_N][DP][CPU_SSE3] = _op_blend_rel_p_dp_sse3;
287 op_blend_rel_span_funcs[SP_AS][SM_N][SC_N][DP][CPU_SSE3] = _op_blend_rel_pas_dp_sse3;
288 op_blend_rel_span_funcs[SP_AN][SM_N][SC_N][DP][CPU_SSE3] = _op_blend_rel_pan_dp_sse3;
289
290 op_blend_rel_span_funcs[SP][SM_N][SC_N][DP_AN][CPU_SSE3] = _op_blend_rel_p_dpan_sse3;
291 op_blend_rel_span_funcs[SP_AS][SM_N][SC_N][DP_AN][CPU_SSE3] = _op_blend_rel_pas_dpan_sse3;
292 op_blend_rel_span_funcs[SP_AN][SM_N][SC_N][DP_AN][CPU_SSE3] = _op_blend_rel_pan_dpan_sse3;
293}
294
295#define _op_blend_rel_pt_p_dp_sse3 NULL
296#define _op_blend_rel_pt_pan_dp_sse3 NULL
297
298#define _op_blend_rel_pt_pas_dp_sse3 _op_blend_rel_pt_p_dp_sse3
299
300#define _op_blend_rel_pt_p_dpan_sse3 _op_blend_pt_p_dpan_sse3
301#define _op_blend_rel_pt_pan_dpan_sse3 _op_blend_pt_pan_dpan_sse3
302#define _op_blend_rel_pt_pas_dpan_sse3 _op_blend_pt_pas_dpan_sse3
303
304static void
305init_blend_rel_pixel_pt_funcs_sse3(void)
306{
307 op_blend_rel_pt_funcs[SP][SM_N][SC_N][DP][CPU_SSE3] = _op_blend_rel_pt_p_dp_sse3;
308 op_blend_rel_pt_funcs[SP_AS][SM_N][SC_N][DP][CPU_SSE3] = _op_blend_rel_pt_pas_dp_sse3;
309 op_blend_rel_pt_funcs[SP_AN][SM_N][SC_N][DP][CPU_SSE3] = _op_blend_rel_pt_pan_dp_sse3;
310
311 op_blend_rel_pt_funcs[SP][SM_N][SC_N][DP_AN][CPU_SSE3] = _op_blend_rel_pt_p_dpan_sse3;
312 op_blend_rel_pt_funcs[SP_AS][SM_N][SC_N][DP_AN][CPU_SSE3] = _op_blend_rel_pt_pas_dpan_sse3;
313 op_blend_rel_pt_funcs[SP_AN][SM_N][SC_N][DP_AN][CPU_SSE3] = _op_blend_rel_pt_pan_dpan_sse3;
314}
315
316#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_blend_main_.c b/libraries/evas/src/lib/engines/common/evas_op_blend_main_.c
new file mode 100644
index 0000000..a1a5de8
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_blend_main_.c
@@ -0,0 +1,671 @@
1#include "evas_common.h"
2
3RGBA_Gfx_Func op_blend_span_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
4RGBA_Gfx_Pt_Func op_blend_pt_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
5
6static void op_blend_init(void);
7static void op_blend_shutdown(void);
8
9static RGBA_Gfx_Func op_blend_pixel_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels);
10static RGBA_Gfx_Func op_blend_color_span_get(DATA32 col, RGBA_Image *dst, int pixels);
11static RGBA_Gfx_Func op_blend_pixel_color_span_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels);
12static RGBA_Gfx_Func op_blend_mask_color_span_get(DATA32 col, RGBA_Image *dst, int pixels);
13static RGBA_Gfx_Func op_blend_pixel_mask_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels);
14
15static RGBA_Gfx_Pt_Func op_blend_pixel_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst);
16static RGBA_Gfx_Pt_Func op_blend_color_pt_get(DATA32 col, RGBA_Image *dst);
17static RGBA_Gfx_Pt_Func op_blend_pixel_color_pt_get(Image_Entry_Flags src_flags, DATA32 col, RGBA_Image *dst);
18static RGBA_Gfx_Pt_Func op_blend_mask_color_pt_get(DATA32 col, RGBA_Image *dst);
19static RGBA_Gfx_Pt_Func op_blend_pixel_mask_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst);
20
21static RGBA_Gfx_Compositor _composite_blend = { "blend",
22 op_blend_init, op_blend_shutdown,
23 op_blend_pixel_span_get, op_blend_color_span_get,
24 op_blend_pixel_color_span_get, op_blend_mask_color_span_get,
25 op_blend_pixel_mask_span_get,
26 op_blend_pixel_pt_get, op_blend_color_pt_get,
27 op_blend_pixel_color_pt_get, op_blend_mask_color_pt_get,
28 op_blend_pixel_mask_pt_get
29 };
30
31RGBA_Gfx_Compositor *
32evas_common_gfx_compositor_blend_get(void)
33{
34 return &(_composite_blend);
35}
36
37
38RGBA_Gfx_Func op_blend_rel_span_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
39RGBA_Gfx_Pt_Func op_blend_rel_pt_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
40
41static void op_blend_rel_init(void);
42static void op_blend_rel_shutdown(void);
43
44static RGBA_Gfx_Func op_blend_rel_pixel_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels);
45static RGBA_Gfx_Func op_blend_rel_color_span_get(DATA32 col, RGBA_Image *dst, int pixels);
46static RGBA_Gfx_Func op_blend_rel_pixel_color_span_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels);
47static RGBA_Gfx_Func op_blend_rel_mask_color_span_get(DATA32 col, RGBA_Image *dst, int pixels);
48static RGBA_Gfx_Func op_blend_rel_pixel_mask_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels);
49
50static RGBA_Gfx_Pt_Func op_blend_rel_pixel_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst);
51static RGBA_Gfx_Pt_Func op_blend_rel_color_pt_get(DATA32 col, RGBA_Image *dst);
52static RGBA_Gfx_Pt_Func op_blend_rel_pixel_color_pt_get(Image_Entry_Flags src_flags, DATA32 col, RGBA_Image *dst);
53static RGBA_Gfx_Pt_Func op_blend_rel_mask_color_pt_get(DATA32 col, RGBA_Image *dst);
54static RGBA_Gfx_Pt_Func op_blend_rel_pixel_mask_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst);
55
56static RGBA_Gfx_Compositor _composite_blend_rel = { "blend_rel",
57 op_blend_rel_init, op_blend_rel_shutdown,
58 op_blend_rel_pixel_span_get, op_blend_rel_color_span_get,
59 op_blend_rel_pixel_color_span_get, op_blend_rel_mask_color_span_get,
60 op_blend_rel_pixel_mask_span_get,
61 op_blend_rel_pixel_pt_get, op_blend_rel_color_pt_get,
62 op_blend_rel_pixel_color_pt_get, op_blend_rel_mask_color_pt_get,
63 op_blend_rel_pixel_mask_pt_get
64 };
65
66RGBA_Gfx_Compositor *
67evas_common_gfx_compositor_blend_rel_get(void)
68{
69 return &(_composite_blend_rel);
70}
71
72
73# include "./evas_op_blend/op_blend_pixel_.c"
74# include "./evas_op_blend/op_blend_color_.c"
75# include "./evas_op_blend/op_blend_pixel_color_.c"
76# include "./evas_op_blend/op_blend_pixel_mask_.c"
77# include "./evas_op_blend/op_blend_mask_color_.c"
78//# include "./evas_op_blend/op_blend_pixel_mask_color_.c"
79
80# include "./evas_op_blend/op_blend_pixel_i386.c"
81# include "./evas_op_blend/op_blend_color_i386.c"
82# include "./evas_op_blend/op_blend_pixel_color_i386.c"
83# include "./evas_op_blend/op_blend_pixel_mask_i386.c"
84# include "./evas_op_blend/op_blend_mask_color_i386.c"
85//# include "./evas_op_blend/op_blend_pixel_mask_color_i386.c"
86
87# include "./evas_op_blend/op_blend_pixel_neon.c"
88# include "./evas_op_blend/op_blend_color_neon.c"
89# include "./evas_op_blend/op_blend_pixel_color_neon.c"
90# include "./evas_op_blend/op_blend_pixel_mask_neon.c"
91# include "./evas_op_blend/op_blend_mask_color_neon.c"
92//# include "./evas_op_blend/op_blend_pixel_mask_color_neon.c"
93
94#ifdef BUILD_SSE3
95void evas_common_op_blend_init_sse3(void);
96#endif
97
98static void
99op_blend_init(void)
100{
101 memset(op_blend_span_funcs, 0, sizeof(op_blend_span_funcs));
102 memset(op_blend_pt_funcs, 0, sizeof(op_blend_pt_funcs));
103#ifdef BUILD_SSE3
104 evas_common_op_blend_init_sse3();
105#endif
106#ifdef BUILD_MMX
107 init_blend_pixel_span_funcs_mmx();
108 init_blend_pixel_color_span_funcs_mmx();
109 init_blend_pixel_mask_span_funcs_mmx();
110 init_blend_color_span_funcs_mmx();
111 init_blend_mask_color_span_funcs_mmx();
112
113 init_blend_pixel_pt_funcs_mmx();
114 init_blend_pixel_color_pt_funcs_mmx();
115 init_blend_pixel_mask_pt_funcs_mmx();
116 init_blend_color_pt_funcs_mmx();
117 init_blend_mask_color_pt_funcs_mmx();
118#endif
119#ifdef BUILD_NEON
120 init_blend_pixel_span_funcs_neon();
121 init_blend_pixel_color_span_funcs_neon();
122 init_blend_pixel_mask_span_funcs_neon();
123 init_blend_color_span_funcs_neon();
124 init_blend_mask_color_span_funcs_neon();
125
126 init_blend_pixel_pt_funcs_neon();
127 init_blend_pixel_color_pt_funcs_neon();
128 init_blend_pixel_mask_pt_funcs_neon();
129 init_blend_color_pt_funcs_neon();
130 init_blend_mask_color_pt_funcs_neon();
131#endif
132#ifdef BUILD_C
133 init_blend_pixel_span_funcs_c();
134 init_blend_pixel_color_span_funcs_c();
135 init_blend_pixel_mask_span_funcs_c();
136 init_blend_color_span_funcs_c();
137 init_blend_mask_color_span_funcs_c();
138
139 init_blend_pixel_pt_funcs_c();
140 init_blend_pixel_color_pt_funcs_c();
141 init_blend_pixel_mask_pt_funcs_c();
142 init_blend_color_pt_funcs_c();
143 init_blend_mask_color_pt_funcs_c();
144#endif
145}
146
147static void
148op_blend_shutdown(void)
149{
150}
151
152static RGBA_Gfx_Func
153blend_gfx_span_func_cpu(int s, int m, int c, int d)
154{
155 RGBA_Gfx_Func func = NULL;
156 int cpu = CPU_N;
157#ifdef BUILD_SSE3
158 if (evas_common_cpu_has_feature(CPU_FEATURE_SSE3))
159 {
160 cpu = CPU_SSE3;
161 func = op_blend_span_funcs[s][m][c][d][cpu];
162 if(func) return func;
163 }
164#endif
165#ifdef BUILD_MMX
166 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
167 {
168 cpu = CPU_MMX;
169 func = op_blend_span_funcs[s][m][c][d][cpu];
170 if (func) return func;
171 }
172#endif
173#ifdef BUILD_NEON
174 if (evas_common_cpu_has_feature(CPU_FEATURE_NEON))
175 {
176 cpu = CPU_NEON;
177 func = op_blend_span_funcs[s][m][c][d][cpu];
178 if (func) return func;
179 }
180#endif
181#ifdef BUILD_C
182 cpu = CPU_C;
183 func = op_blend_span_funcs[s][m][c][d][cpu];
184 if (func) return func;
185#endif
186 return func;
187}
188
189static RGBA_Gfx_Func
190op_blend_pixel_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels __UNUSED__)
191{
192 int s = SP_AN, m = SM_N, c = SC_N, d = DP_AN;
193
194 if (src && src->cache_entry.flags.alpha)
195 {
196 s = SP;
197 if (src->cache_entry.flags.alpha_sparse)
198 s = SP_AS;
199 }
200 if (dst && dst->cache_entry.flags.alpha)
201 d = DP;
202 return blend_gfx_span_func_cpu(s, m, c, d);
203}
204
205static RGBA_Gfx_Func
206op_blend_color_span_get(DATA32 col, RGBA_Image *dst, int pixels __UNUSED__)
207{
208 int s = SP_N, m = SM_N, c = SC_AN, d = DP_AN;
209
210 if ((col >> 24) < 255)
211 c = SC;
212 if (col == ((col >> 24) * 0x01010101))
213 c = SC_AA;
214 if (col == 0xffffffff)
215 c = SC_N;
216 if (dst && dst->cache_entry.flags.alpha)
217 d = DP;
218 return blend_gfx_span_func_cpu(s, m, c, d);
219}
220
221static RGBA_Gfx_Func
222op_blend_pixel_color_span_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels __UNUSED__)
223{
224 int s = SP_AN, m = SM_N, c = SC_AN, d = DP_AN;
225
226 if (src && src->cache_entry.flags.alpha)
227 {
228 s = SP;
229 if (src->cache_entry.flags.alpha_sparse)
230 s = SP_AS;
231 }
232 if ((col >> 24) < 255)
233 c = SC;
234 if (col == ((col >> 24) * 0x01010101))
235 c = SC_AA;
236 if (col == 0xffffffff)
237 c = SC_N;
238 if (dst && dst->cache_entry.flags.alpha)
239 d = DP;
240 return blend_gfx_span_func_cpu(s, m, c, d);
241}
242
243static RGBA_Gfx_Func
244op_blend_mask_color_span_get(DATA32 col, RGBA_Image *dst, int pixels __UNUSED__)
245{
246 int s = SP_N, m = SM_AS, c = SC_AN, d = DP_AN;
247
248 if ((col >> 24) < 255)
249 c = SC;
250 if (col == ((col >> 24) * 0x01010101))
251 c = SC_AA;
252 if (col == 0xffffffff)
253 c = SC_N;
254 if (dst && dst->cache_entry.flags.alpha)
255 d = DP;
256 return blend_gfx_span_func_cpu(s, m, c, d);
257}
258
259static RGBA_Gfx_Func
260op_blend_pixel_mask_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels __UNUSED__)
261{
262 int s = SP_AN, m = SM_AS, c = SC_N, d = DP_AN;
263
264 if (src && src->cache_entry.flags.alpha)
265 {
266 s = SP;
267 if (src->cache_entry.flags.alpha_sparse)
268 s = SP_AS;
269 }
270 if (dst && dst->cache_entry.flags.alpha)
271 d = DP;
272 return blend_gfx_span_func_cpu(s, m, c, d);
273}
274
275
276static RGBA_Gfx_Pt_Func
277blend_gfx_pt_func_cpu(int s, int m, int c, int d)
278{
279 RGBA_Gfx_Pt_Func func = NULL;
280 int cpu = CPU_N;
281#ifdef BUILD_SSE3
282 if(evas_common_cpu_has_feature(CPU_FEATURE_SSE3))
283 {
284 cpu = CPU_SSE3;
285 func = op_blend_pt_funcs[s][m][c][d][cpu];
286 if(func) return func;
287 }
288#endif
289#ifdef BUILD_MMX
290 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
291 {
292 cpu = CPU_MMX;
293 func = op_blend_pt_funcs[s][m][c][d][cpu];
294 if (func) return func;
295 }
296#endif
297#ifdef BUILD_NEON
298 if (evas_common_cpu_has_feature(CPU_FEATURE_NEON))
299 {
300 cpu = CPU_NEON;
301 func = op_blend_pt_funcs[s][m][c][d][cpu];
302 if (func) return func;
303 }
304#endif
305#ifdef BUILD_C
306 cpu = CPU_C;
307 func = op_blend_pt_funcs[s][m][c][d][cpu];
308 if (func) return func;
309#endif
310 return func;
311}
312
313static RGBA_Gfx_Pt_Func
314op_blend_pixel_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst)
315{
316 int s = SP_AN, m = SM_N, c = SC_N, d = DP_AN;
317
318 if (src_flags.alpha)
319 s = SP;
320 if (dst && dst->cache_entry.flags.alpha)
321 d = DP;
322 return blend_gfx_pt_func_cpu(s, m, c, d);
323}
324
325static RGBA_Gfx_Pt_Func
326op_blend_color_pt_get(DATA32 col, RGBA_Image *dst)
327{
328 int s = SP_N, m = SM_N, c = SC_AN, d = DP_AN;
329
330 if ((col >> 24) < 255)
331 c = SC;
332 if (col == ((col >> 24) * 0x01010101))
333 c = SC_AA;
334 if (col == 0xffffffff)
335 c = SC_N;
336 if (dst && dst->cache_entry.flags.alpha)
337 d = DP;
338 return blend_gfx_pt_func_cpu(s, m, c, d);
339}
340
341static RGBA_Gfx_Pt_Func
342op_blend_pixel_color_pt_get(Image_Entry_Flags src_flags, DATA32 col, RGBA_Image *dst)
343{
344 int s = SP_AN, m = SM_N, c = SC_AN, d = DP_AN;
345
346 if (src_flags.alpha)
347 s = SP;
348 if ((col >> 24) < 255)
349 c = SC;
350 if (col == ((col >> 24) * 0x01010101))
351 c = SC_AA;
352 if (col == 0xffffffff)
353 c = SC_N;
354 if (dst && dst->cache_entry.flags.alpha)
355 d = DP;
356 return blend_gfx_pt_func_cpu(s, m, c, d);
357}
358
359static RGBA_Gfx_Pt_Func
360op_blend_mask_color_pt_get(DATA32 col, RGBA_Image *dst)
361{
362 int s = SP_N, m = SM_AS, c = SC_AN, d = DP_AN;
363
364 if ((col >> 24) < 255)
365 c = SC;
366 if (col == ((col >> 24) * 0x01010101))
367 c = SC_AA;
368 if (col == 0xffffffff)
369 c = SC_N;
370 if (dst && dst->cache_entry.flags.alpha)
371 d = DP;
372 return blend_gfx_pt_func_cpu(s, m, c, d);
373}
374
375static RGBA_Gfx_Pt_Func
376op_blend_pixel_mask_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst)
377{
378 int s = SP_AN, m = SM_AS, c = SC_N, d = DP_AN;
379
380 if (src_flags.alpha)
381 s = SP;
382 if (dst && dst->cache_entry.flags.alpha)
383 d = DP;
384 return blend_gfx_pt_func_cpu(s, m, c, d);
385}
386
387void evas_common_op_blend_rel_init_sse3(void);
388
389static void
390op_blend_rel_init(void)
391{
392 memset(op_blend_rel_span_funcs, 0, sizeof(op_blend_rel_span_funcs));
393 memset(op_blend_rel_pt_funcs, 0, sizeof(op_blend_rel_pt_funcs));
394#ifdef BUILD_SSE3
395 evas_common_op_blend_rel_init_sse3();
396#endif
397#ifdef BUILD_MMX
398 init_blend_rel_pixel_span_funcs_mmx();
399 init_blend_rel_pixel_color_span_funcs_mmx();
400 init_blend_rel_pixel_mask_span_funcs_mmx();
401 init_blend_rel_color_span_funcs_mmx();
402 init_blend_rel_mask_color_span_funcs_mmx();
403
404 init_blend_rel_pixel_pt_funcs_mmx();
405 init_blend_rel_pixel_color_pt_funcs_mmx();
406 init_blend_rel_pixel_mask_pt_funcs_mmx();
407 init_blend_rel_color_pt_funcs_mmx();
408 init_blend_rel_mask_color_pt_funcs_mmx();
409#endif
410#ifdef BUILD_NEON
411 init_blend_rel_pixel_span_funcs_neon();
412 init_blend_rel_pixel_color_span_funcs_neon();
413 init_blend_rel_pixel_mask_span_funcs_neon();
414 init_blend_rel_color_span_funcs_neon();
415 init_blend_rel_mask_color_span_funcs_neon();
416
417 init_blend_rel_pixel_pt_funcs_neon();
418 init_blend_rel_pixel_color_pt_funcs_neon();
419 init_blend_rel_pixel_mask_pt_funcs_neon();
420 init_blend_rel_color_pt_funcs_neon();
421 init_blend_rel_mask_color_pt_funcs_neon();
422#endif
423#ifdef BUILD_C
424 init_blend_rel_pixel_span_funcs_c();
425 init_blend_rel_pixel_color_span_funcs_c();
426 init_blend_rel_pixel_mask_span_funcs_c();
427 init_blend_rel_color_span_funcs_c();
428 init_blend_rel_mask_color_span_funcs_c();
429
430 init_blend_rel_pixel_pt_funcs_c();
431 init_blend_rel_pixel_color_pt_funcs_c();
432 init_blend_rel_pixel_mask_pt_funcs_c();
433 init_blend_rel_color_pt_funcs_c();
434 init_blend_rel_mask_color_pt_funcs_c();
435#endif
436}
437
438static void
439op_blend_rel_shutdown(void)
440{
441}
442
443static RGBA_Gfx_Func
444blend_rel_gfx_span_func_cpu(int s, int m, int c, int d)
445{
446 RGBA_Gfx_Func func = NULL;
447 int cpu = CPU_N;
448#ifdef BUILD_SSE3
449 if (evas_common_cpu_has_feature(CPU_FEATURE_SSE3))
450 {
451 cpu = CPU_SSE3;
452 func = op_blend_rel_span_funcs[s][m][c][d][cpu];
453 if(func) return func;
454 }
455#endif
456#ifdef BUILD_MMX
457 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
458 {
459 cpu = CPU_MMX;
460 func = op_blend_rel_span_funcs[s][m][c][d][cpu];
461 if (func) return func;
462 }
463#endif
464#ifdef BUILD_NEON
465 if (evas_common_cpu_has_feature(CPU_FEATURE_NEON))
466 {
467 cpu = CPU_NEON;
468 func = op_blend_rel_span_funcs[s][m][c][d][cpu];
469 if (func) return func;
470 }
471#endif
472#ifdef BUILD_C
473 cpu = CPU_C;
474 func = op_blend_rel_span_funcs[s][m][c][d][cpu];
475 if (func) return func;
476#endif
477 return func;
478}
479
480static RGBA_Gfx_Func
481op_blend_rel_pixel_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels __UNUSED__)
482{
483 int s = SP_AN, m = SM_N, c = SC_N, d = DP_AN;
484
485 if (src && src->cache_entry.flags.alpha)
486 {
487 s = SP;
488 if (src->cache_entry.flags.alpha_sparse)
489 s = SP_AS;
490 }
491 if (dst && dst->cache_entry.flags.alpha)
492 d = DP;
493 return blend_rel_gfx_span_func_cpu(s, m, c, d);
494}
495
496static RGBA_Gfx_Func
497op_blend_rel_color_span_get(DATA32 col, RGBA_Image *dst, int pixels __UNUSED__)
498{
499 int s = SP_N, m = SM_N, c = SC_AN, d = DP_AN;
500
501 if ((col >> 24) < 255)
502 c = SC;
503 if (col == ((col >> 24) * 0x01010101))
504 c = SC_AA;
505 if (col == 0xffffffff)
506 c = SC_N;
507 if (dst && dst->cache_entry.flags.alpha)
508 d = DP;
509 return blend_rel_gfx_span_func_cpu(s, m, c, d);
510}
511
512static RGBA_Gfx_Func
513op_blend_rel_pixel_color_span_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels __UNUSED__)
514{
515 int s = SP_AN, m = SM_N, c = SC_AN, d = DP_AN;
516
517 if (src && src->cache_entry.flags.alpha)
518 s = SP;
519 if ((col >> 24) < 255)
520 c = SC;
521 if (col == ((col >> 24) * 0x01010101))
522 c = SC_AA;
523 if (col == 0xffffffff)
524 c = SC_N;
525 if (dst && dst->cache_entry.flags.alpha)
526 d = DP;
527 return blend_rel_gfx_span_func_cpu(s, m, c, d);
528}
529
530static RGBA_Gfx_Func
531op_blend_rel_mask_color_span_get(DATA32 col, RGBA_Image *dst, int pixels __UNUSED__)
532{
533 int s = SP_N, m = SM_AS, c = SC_AN, d = DP_AN;
534
535 if ((col >> 24) < 255)
536 c = SC;
537 if (col == ((col >> 24) * 0x01010101))
538 c = SC_AA;
539 if (col == 0xffffffff)
540 c = SC_N;
541 if (dst && dst->cache_entry.flags.alpha)
542 d = DP;
543 return blend_rel_gfx_span_func_cpu(s, m, c, d);
544}
545
546static RGBA_Gfx_Func
547op_blend_rel_pixel_mask_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels __UNUSED__)
548{
549 int s = SP_AN, m = SM_AS, c = SC_N, d = DP_AN;
550
551 if (src && src->cache_entry.flags.alpha)
552 {
553 s = SP;
554 if (src->cache_entry.flags.alpha_sparse)
555 s = SP_AS;
556 }
557 if (dst && dst->cache_entry.flags.alpha)
558 d = DP;
559 return blend_rel_gfx_span_func_cpu(s, m, c, d);
560}
561
562static RGBA_Gfx_Pt_Func
563blend_rel_gfx_pt_func_cpu(int s, int m, int c, int d)
564{
565 RGBA_Gfx_Pt_Func func = NULL;
566 int cpu = CPU_N;
567#ifdef BUILD_SSE3
568 if (evas_common_cpu_has_feature(CPU_FEATURE_SSE3))
569 {
570 cpu = CPU_SSE3;
571 func = op_blend_rel_pt_funcs[s][m][c][d][cpu];
572 if(func) return func;
573 }
574#endif
575#ifdef BUILD_MMX
576 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
577 {
578 cpu = CPU_MMX;
579 func = op_blend_rel_pt_funcs[s][m][c][d][cpu];
580 if (func) return func;
581 }
582#endif
583#ifdef BUILD_NEON
584 if (evas_common_cpu_has_feature(CPU_FEATURE_NEON))
585 {
586 cpu = CPU_NEON;
587 func = op_blend_rel_pt_funcs[s][m][c][d][cpu];
588 if (func) return func;
589 }
590#endif
591#ifdef BUILD_C
592 cpu = CPU_C;
593 func = op_blend_rel_pt_funcs[s][m][c][d][cpu];
594 if (func) return func;
595#endif
596 return func;
597}
598
599static RGBA_Gfx_Pt_Func
600op_blend_rel_pixel_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst)
601{
602 int s = SP_AN, m = SM_N, c = SC_N, d = DP_AN;
603
604 if (src_flags.alpha)
605 s = SP;
606 if (dst && dst->cache_entry.flags.alpha)
607 d = DP;
608 return blend_rel_gfx_pt_func_cpu(s, m, c, d);
609}
610
611static RGBA_Gfx_Pt_Func
612op_blend_rel_color_pt_get(DATA32 col, RGBA_Image *dst)
613{
614 int s = SP_N, m = SM_N, c = SC_AN, d = DP_AN;
615
616 if ((col >> 24) < 255)
617 c = SC;
618 if (col == ((col >> 24) * 0x01010101))
619 c = SC_AA;
620 if (col == 0xffffffff)
621 c = SC_N;
622 if (dst && dst->cache_entry.flags.alpha)
623 d = DP;
624 return blend_rel_gfx_pt_func_cpu(s, m, c, d);
625}
626
627static RGBA_Gfx_Pt_Func
628op_blend_rel_pixel_color_pt_get(Image_Entry_Flags src_flags, DATA32 col, RGBA_Image *dst)
629{
630 int s = SP_AN, m = SM_N, c = SC_AN, d = DP_AN;
631
632 if (src_flags.alpha)
633 s = SP;
634 if ((col >> 24) < 255)
635 c = SC;
636 if (col == ((col >> 24) * 0x01010101))
637 c = SC_AA;
638 if (col == 0xffffffff)
639 c = SC_N;
640 if (dst && dst->cache_entry.flags.alpha)
641 d = DP;
642 return blend_rel_gfx_pt_func_cpu(s, m, c, d);
643}
644
645static RGBA_Gfx_Pt_Func
646op_blend_rel_mask_color_pt_get(DATA32 col, RGBA_Image *dst)
647{
648 int s = SP_N, m = SM_AS, c = SC_AN, d = DP_AN;
649
650 if ((col >> 24) < 255)
651 c = SC;
652 if (col == ((col >> 24) * 0x01010101))
653 c = SC_AA;
654 if (col == 0xffffffff)
655 c = SC_N;
656 if (dst && dst->cache_entry.flags.alpha)
657 d = DP;
658 return blend_rel_gfx_pt_func_cpu(s, m, c, d);
659}
660
661static RGBA_Gfx_Pt_Func
662op_blend_rel_pixel_mask_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst)
663{
664 int s = SP_AN, m = SM_AS, c = SC_N, d = DP_AN;
665
666 if (src_flags.alpha)
667 s = SP;
668 if (dst && dst->cache_entry.flags.alpha)
669 d = DP;
670 return blend_rel_gfx_pt_func_cpu(s, m, c, d);
671}
diff --git a/libraries/evas/src/lib/engines/common/evas_op_copy/Makefile.am b/libraries/evas/src/lib/engines/common/evas_op_copy/Makefile.am
new file mode 100644
index 0000000..599e98d
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_copy/Makefile.am
@@ -0,0 +1,18 @@
1MAINTAINERCLEANFILES = Makefile.in
2
3EXTRA_DIST = \
4op_copy_color_.c \
5op_copy_color_i386.c \
6op_copy_color_neon.c \
7op_copy_mask_color_.c \
8op_copy_mask_color_i386.c \
9op_copy_mask_color_neon.c \
10op_copy_pixel_.c \
11op_copy_pixel_neon.c \
12op_copy_pixel_color_.c \
13op_copy_pixel_color_i386.c \
14op_copy_pixel_color_neon.c \
15op_copy_pixel_i386.c \
16op_copy_pixel_mask_.c \
17op_copy_pixel_mask_i386.c \
18op_copy_pixel_mask_neon.c
diff --git a/libraries/evas/src/lib/engines/common/evas_op_copy/Makefile.in b/libraries/evas/src/lib/engines/common/evas_op_copy/Makefile.in
new file mode 100644
index 0000000..52658a4
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_copy/Makefile.in
@@ -0,0 +1,548 @@
1# Makefile.in generated by automake 1.11.1 from Makefile.am.
2# @configure_input@
3
4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
6# Inc.
7# This Makefile.in is free software; the Free Software Foundation
8# gives unlimited permission to copy and/or distribute it,
9# with or without modifications, as long as this notice is preserved.
10
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
13# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14# PARTICULAR PURPOSE.
15
16@SET_MAKE@
17VPATH = @srcdir@
18pkgdatadir = $(datadir)/@PACKAGE@
19pkgincludedir = $(includedir)/@PACKAGE@
20pkglibdir = $(libdir)/@PACKAGE@
21pkglibexecdir = $(libexecdir)/@PACKAGE@
22am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
23install_sh_DATA = $(install_sh) -c -m 644
24install_sh_PROGRAM = $(install_sh) -c
25install_sh_SCRIPT = $(install_sh) -c
26INSTALL_HEADER = $(INSTALL_DATA)
27transform = $(program_transform_name)
28NORMAL_INSTALL = :
29PRE_INSTALL = :
30POST_INSTALL = :
31NORMAL_UNINSTALL = :
32PRE_UNINSTALL = :
33POST_UNINSTALL = :
34build_triplet = @build@
35host_triplet = @host@
36subdir = src/lib/engines/common/evas_op_copy
37DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
38ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
39am__aclocal_m4_deps = $(top_srcdir)/m4/efl_attribute.m4 \
40 $(top_srcdir)/m4/efl_coverage.m4 \
41 $(top_srcdir)/m4/efl_doxygen.m4 \
42 $(top_srcdir)/m4/efl_fnmatch.m4 \
43 $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \
44 $(top_srcdir)/m4/evas_check_engine.m4 \
45 $(top_srcdir)/m4/evas_check_loader.m4 \
46 $(top_srcdir)/m4/evas_converter.m4 \
47 $(top_srcdir)/m4/evas_dither.m4 \
48 $(top_srcdir)/m4/evas_scaler.m4 $(top_srcdir)/m4/libtool.m4 \
49 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
50 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
51 $(top_srcdir)/configure.ac
52am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
53 $(ACLOCAL_M4)
54mkinstalldirs = $(install_sh) -d
55CONFIG_HEADER = $(top_builddir)/config.h
56CONFIG_CLEAN_FILES =
57CONFIG_CLEAN_VPATH_FILES =
58AM_V_GEN = $(am__v_GEN_$(V))
59am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
60am__v_GEN_0 = @echo " GEN " $@;
61AM_V_at = $(am__v_at_$(V))
62am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
63am__v_at_0 = @
64SOURCES =
65DIST_SOURCES =
66DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
67ACLOCAL = @ACLOCAL@
68ALLOCA = @ALLOCA@
69AMTAR = @AMTAR@
70AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
71AR = @AR@
72AS = @AS@
73AUTOCONF = @AUTOCONF@
74AUTOHEADER = @AUTOHEADER@
75AUTOMAKE = @AUTOMAKE@
76AWK = @AWK@
77CC = @CC@
78CCDEPMODE = @CCDEPMODE@
79CFLAGS = @CFLAGS@
80CHECK_CFLAGS = @CHECK_CFLAGS@
81CHECK_LIBS = @CHECK_LIBS@
82CPP = @CPP@
83CPPFLAGS = @CPPFLAGS@
84CXX = @CXX@
85CXXCPP = @CXXCPP@
86CXXDEPMODE = @CXXDEPMODE@
87CXXFLAGS = @CXXFLAGS@
88CYGPATH_W = @CYGPATH_W@
89DEFS = @DEFS@
90DEPDIR = @DEPDIR@
91DIRECTFB_CFLAGS = @DIRECTFB_CFLAGS@
92DIRECTFB_LIBS = @DIRECTFB_LIBS@
93DLLTOOL = @DLLTOOL@
94DSYMUTIL = @DSYMUTIL@
95DUMPBIN = @DUMPBIN@
96ECHO_C = @ECHO_C@
97ECHO_N = @ECHO_N@
98ECHO_T = @ECHO_T@
99ECORE_EVAS_CFLAGS = @ECORE_EVAS_CFLAGS@
100ECORE_EVAS_LIBS = @ECORE_EVAS_LIBS@
101EDB_CFLAGS = @EDB_CFLAGS@
102EDB_LIBS = @EDB_LIBS@
103EDJE_CFLAGS = @EDJE_CFLAGS@
104EDJE_LIBS = @EDJE_LIBS@
105EET_CFLAGS = @EET_CFLAGS@
106EET_LIBS = @EET_LIBS@
107EFL_COVERAGE_CFLAGS = @EFL_COVERAGE_CFLAGS@
108EFL_COVERAGE_LIBS = @EFL_COVERAGE_LIBS@
109EFL_FNMATCH_LIBS = @EFL_FNMATCH_LIBS@
110EGREP = @EGREP@
111EINA_CFLAGS = @EINA_CFLAGS@
112EINA_LIBS = @EINA_LIBS@
113EVAS_CFLAGS = @EVAS_CFLAGS@
114EVAS_LIBS = @EVAS_LIBS@
115EVAS_SSE3_CFLAGS = @EVAS_SSE3_CFLAGS@
116EVIL_CFLAGS = @EVIL_CFLAGS@
117EVIL_LIBS = @EVIL_LIBS@
118EXEEXT = @EXEEXT@
119FGREP = @FGREP@
120FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@
121FONTCONFIG_LIBS = @FONTCONFIG_LIBS@
122FREETYPE_CFLAGS = @FREETYPE_CFLAGS@
123FREETYPE_LIBS = @FREETYPE_LIBS@
124FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@
125FRIBIDI_LIBS = @FRIBIDI_LIBS@
126GL_EET_CFLAGS = @GL_EET_CFLAGS@
127GL_EET_LIBS = @GL_EET_LIBS@
128GREP = @GREP@
129HARFBUZZ_CFLAGS = @HARFBUZZ_CFLAGS@
130HARFBUZZ_LIBS = @HARFBUZZ_LIBS@
131INSTALL = @INSTALL@
132INSTALL_DATA = @INSTALL_DATA@
133INSTALL_PROGRAM = @INSTALL_PROGRAM@
134INSTALL_SCRIPT = @INSTALL_SCRIPT@
135INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
136LD = @LD@
137LDFLAGS = @LDFLAGS@
138LIBOBJS = @LIBOBJS@
139LIBS = @LIBS@
140LIBTOOL = @LIBTOOL@
141LINEBREAK_CFLAGS = @LINEBREAK_CFLAGS@
142LINEBREAK_LIBS = @LINEBREAK_LIBS@
143LIPO = @LIPO@
144LN_S = @LN_S@
145LTLIBOBJS = @LTLIBOBJS@
146MAKEINFO = @MAKEINFO@
147MKDIR_P = @MKDIR_P@
148MODULE_ARCH = @MODULE_ARCH@
149NM = @NM@
150NMEDIT = @NMEDIT@
151OBJC = @OBJC@
152OBJCDEPMODE = @OBJCDEPMODE@
153OBJCFLAGS = @OBJCFLAGS@
154OBJDUMP = @OBJDUMP@
155OBJEXT = @OBJEXT@
156OTOOL = @OTOOL@
157OTOOL64 = @OTOOL64@
158PACKAGE = @PACKAGE@
159PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
160PACKAGE_NAME = @PACKAGE_NAME@
161PACKAGE_STRING = @PACKAGE_STRING@
162PACKAGE_TARNAME = @PACKAGE_TARNAME@
163PACKAGE_URL = @PACKAGE_URL@
164PACKAGE_VERSION = @PACKAGE_VERSION@
165PATH_SEPARATOR = @PATH_SEPARATOR@
166PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
167PIXMAN_LIBS = @PIXMAN_LIBS@
168PKG_CONFIG = @PKG_CONFIG@
169PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
170PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
171PNG_CFLAGS = @PNG_CFLAGS@
172PNG_LIBS = @PNG_LIBS@
173RANLIB = @RANLIB@
174SDL_CFLAGS = @SDL_CFLAGS@
175SDL_LIBS = @SDL_LIBS@
176SED = @SED@
177SET_MAKE = @SET_MAKE@
178SHELL = @SHELL@
179SHM_OPEN_LINK = @SHM_OPEN_LINK@
180STRIP = @STRIP@
181SVG_CFLAGS = @SVG_CFLAGS@
182SVG_LIBS = @SVG_LIBS@
183VALGRIND_CFLAGS = @VALGRIND_CFLAGS@
184VALGRIND_LIBS = @VALGRIND_LIBS@
185VERSION = @VERSION@
186VMAJ = @VMAJ@
187WIN32_CFLAGS = @WIN32_CFLAGS@
188WIN32_CPPFLAGS = @WIN32_CPPFLAGS@
189XCB_CFLAGS = @XCB_CFLAGS@
190XCB_GL_CFLAGS = @XCB_GL_CFLAGS@
191XCB_GL_LIBS = @XCB_GL_LIBS@
192XCB_LIBS = @XCB_LIBS@
193XEXT_CFLAGS = @XEXT_CFLAGS@
194XEXT_LIBS = @XEXT_LIBS@
195XMKMF = @XMKMF@
196X_CFLAGS = @X_CFLAGS@
197X_EXTRA_LIBS = @X_EXTRA_LIBS@
198X_LIBS = @X_LIBS@
199X_PRE_LIBS = @X_PRE_LIBS@
200abs_builddir = @abs_builddir@
201abs_srcdir = @abs_srcdir@
202abs_top_builddir = @abs_top_builddir@
203abs_top_srcdir = @abs_top_srcdir@
204ac_ct_CC = @ac_ct_CC@
205ac_ct_CXX = @ac_ct_CXX@
206ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
207ac_ct_OBJC = @ac_ct_OBJC@
208altivec_cflags = @altivec_cflags@
209am__include = @am__include@
210am__leading_dot = @am__leading_dot@
211am__quote = @am__quote@
212am__tar = @am__tar@
213am__untar = @am__untar@
214bindir = @bindir@
215build = @build@
216build_alias = @build_alias@
217build_cpu = @build_cpu@
218build_os = @build_os@
219build_vendor = @build_vendor@
220builddir = @builddir@
221datadir = @datadir@
222datarootdir = @datarootdir@
223dlopen_libs = @dlopen_libs@
224docdir = @docdir@
225dvidir = @dvidir@
226edje_cc = @edje_cc@
227efl_doxygen = @efl_doxygen@
228efl_have_doxygen = @efl_have_doxygen@
229evas_engine_buffer_cflags = @evas_engine_buffer_cflags@
230evas_engine_buffer_libs = @evas_engine_buffer_libs@
231evas_engine_direct3d_cflags = @evas_engine_direct3d_cflags@
232evas_engine_direct3d_libs = @evas_engine_direct3d_libs@
233evas_engine_directfb_cflags = @evas_engine_directfb_cflags@
234evas_engine_directfb_libs = @evas_engine_directfb_libs@
235evas_engine_fb_cflags = @evas_engine_fb_cflags@
236evas_engine_fb_libs = @evas_engine_fb_libs@
237evas_engine_gl_cocoa_cflags = @evas_engine_gl_cocoa_cflags@
238evas_engine_gl_cocoa_libs = @evas_engine_gl_cocoa_libs@
239evas_engine_gl_common_libs = @evas_engine_gl_common_libs@
240evas_engine_gl_sdl_cflags = @evas_engine_gl_sdl_cflags@
241evas_engine_gl_sdl_libs = @evas_engine_gl_sdl_libs@
242evas_engine_gl_xcb_cflags = @evas_engine_gl_xcb_cflags@
243evas_engine_gl_xcb_libs = @evas_engine_gl_xcb_libs@
244evas_engine_gl_xlib_cflags = @evas_engine_gl_xlib_cflags@
245evas_engine_gl_xlib_libs = @evas_engine_gl_xlib_libs@
246evas_engine_psl1ght_cflags = @evas_engine_psl1ght_cflags@
247evas_engine_psl1ght_libs = @evas_engine_psl1ght_libs@
248evas_engine_software_16_ddraw_cflags = @evas_engine_software_16_ddraw_cflags@
249evas_engine_software_16_ddraw_libs = @evas_engine_software_16_ddraw_libs@
250evas_engine_software_16_sdl_cflags = @evas_engine_software_16_sdl_cflags@
251evas_engine_software_16_sdl_libs = @evas_engine_software_16_sdl_libs@
252evas_engine_software_16_wince_cflags = @evas_engine_software_16_wince_cflags@
253evas_engine_software_16_wince_libs = @evas_engine_software_16_wince_libs@
254evas_engine_software_16_x11_cflags = @evas_engine_software_16_x11_cflags@
255evas_engine_software_16_x11_libs = @evas_engine_software_16_x11_libs@
256evas_engine_software_8_x11_cflags = @evas_engine_software_8_x11_cflags@
257evas_engine_software_8_x11_libs = @evas_engine_software_8_x11_libs@
258evas_engine_software_ddraw_cflags = @evas_engine_software_ddraw_cflags@
259evas_engine_software_ddraw_libs = @evas_engine_software_ddraw_libs@
260evas_engine_software_gdi_cflags = @evas_engine_software_gdi_cflags@
261evas_engine_software_gdi_libs = @evas_engine_software_gdi_libs@
262evas_engine_software_sdl_cflags = @evas_engine_software_sdl_cflags@
263evas_engine_software_sdl_libs = @evas_engine_software_sdl_libs@
264evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@
265evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@
266evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@
267evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@
268evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@
269evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@
270evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@
271evas_image_loader_edb_libs = @evas_image_loader_edb_libs@
272evas_image_loader_eet_cflags = @evas_image_loader_eet_cflags@
273evas_image_loader_eet_libs = @evas_image_loader_eet_libs@
274evas_image_loader_generic_cflags = @evas_image_loader_generic_cflags@
275evas_image_loader_generic_libs = @evas_image_loader_generic_libs@
276evas_image_loader_gif_cflags = @evas_image_loader_gif_cflags@
277evas_image_loader_gif_libs = @evas_image_loader_gif_libs@
278evas_image_loader_ico_cflags = @evas_image_loader_ico_cflags@
279evas_image_loader_ico_libs = @evas_image_loader_ico_libs@
280evas_image_loader_jpeg_cflags = @evas_image_loader_jpeg_cflags@
281evas_image_loader_jpeg_libs = @evas_image_loader_jpeg_libs@
282evas_image_loader_pmaps_cflags = @evas_image_loader_pmaps_cflags@
283evas_image_loader_pmaps_libs = @evas_image_loader_pmaps_libs@
284evas_image_loader_png_cflags = @evas_image_loader_png_cflags@
285evas_image_loader_png_libs = @evas_image_loader_png_libs@
286evas_image_loader_psd_cflags = @evas_image_loader_psd_cflags@
287evas_image_loader_psd_libs = @evas_image_loader_psd_libs@
288evas_image_loader_svg_cflags = @evas_image_loader_svg_cflags@
289evas_image_loader_svg_libs = @evas_image_loader_svg_libs@
290evas_image_loader_tga_cflags = @evas_image_loader_tga_cflags@
291evas_image_loader_tga_libs = @evas_image_loader_tga_libs@
292evas_image_loader_tiff_cflags = @evas_image_loader_tiff_cflags@
293evas_image_loader_tiff_libs = @evas_image_loader_tiff_libs@
294evas_image_loader_wbmp_cflags = @evas_image_loader_wbmp_cflags@
295evas_image_loader_wbmp_libs = @evas_image_loader_wbmp_libs@
296evas_image_loader_xpm_cflags = @evas_image_loader_xpm_cflags@
297evas_image_loader_xpm_libs = @evas_image_loader_xpm_libs@
298exec_prefix = @exec_prefix@
299have_evas_engine_gl_x11 = @have_evas_engine_gl_x11@
300have_evas_engine_gl_xcb = @have_evas_engine_gl_xcb@
301have_evas_engine_gl_xlib = @have_evas_engine_gl_xlib@
302have_evas_engine_software_x11 = @have_evas_engine_software_x11@
303have_evas_engine_software_xcb = @have_evas_engine_software_xcb@
304have_evas_engine_software_xlib = @have_evas_engine_software_xlib@
305have_lcov = @have_lcov@
306host = @host@
307host_alias = @host_alias@
308host_cpu = @host_cpu@
309host_os = @host_os@
310host_vendor = @host_vendor@
311htmldir = @htmldir@
312includedir = @includedir@
313infodir = @infodir@
314install_sh = @install_sh@
315libdir = @libdir@
316libexecdir = @libexecdir@
317localedir = @localedir@
318localstatedir = @localstatedir@
319lt_ECHO = @lt_ECHO@
320lt_enable_auto_import = @lt_enable_auto_import@
321mandir = @mandir@
322mkdir_p = @mkdir_p@
323oldincludedir = @oldincludedir@
324pdfdir = @pdfdir@
325pkgconfig_requires_private = @pkgconfig_requires_private@
326prefix = @prefix@
327program_transform_name = @program_transform_name@
328psdir = @psdir@
329pthread_cflags = @pthread_cflags@
330pthread_libs = @pthread_libs@
331release_info = @release_info@
332requirement_evas = @requirement_evas@
333sbindir = @sbindir@
334sharedstatedir = @sharedstatedir@
335srcdir = @srcdir@
336sysconfdir = @sysconfdir@
337target_alias = @target_alias@
338top_build_prefix = @top_build_prefix@
339top_builddir = @top_builddir@
340top_srcdir = @top_srcdir@
341version_info = @version_info@
342MAINTAINERCLEANFILES = Makefile.in
343EXTRA_DIST = \
344op_copy_color_.c \
345op_copy_color_i386.c \
346op_copy_color_neon.c \
347op_copy_mask_color_.c \
348op_copy_mask_color_i386.c \
349op_copy_mask_color_neon.c \
350op_copy_pixel_.c \
351op_copy_pixel_neon.c \
352op_copy_pixel_color_.c \
353op_copy_pixel_color_i386.c \
354op_copy_pixel_color_neon.c \
355op_copy_pixel_i386.c \
356op_copy_pixel_mask_.c \
357op_copy_pixel_mask_i386.c \
358op_copy_pixel_mask_neon.c
359
360all: all-am
361
362.SUFFIXES:
363$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
364 @for dep in $?; do \
365 case '$(am__configure_deps)' in \
366 *$$dep*) \
367 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
368 && { if test -f $@; then exit 0; else break; fi; }; \
369 exit 1;; \
370 esac; \
371 done; \
372 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/engines/common/evas_op_copy/Makefile'; \
373 $(am__cd) $(top_srcdir) && \
374 $(AUTOMAKE) --gnu src/lib/engines/common/evas_op_copy/Makefile
375.PRECIOUS: Makefile
376Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
377 @case '$?' in \
378 *config.status*) \
379 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
380 *) \
381 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
382 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
383 esac;
384
385$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
386 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
387
388$(top_srcdir)/configure: $(am__configure_deps)
389 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
390$(ACLOCAL_M4): $(am__aclocal_m4_deps)
391 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
392$(am__aclocal_m4_deps):
393
394mostlyclean-libtool:
395 -rm -f *.lo
396
397clean-libtool:
398 -rm -rf .libs _libs
399tags: TAGS
400TAGS:
401
402ctags: CTAGS
403CTAGS:
404
405
406distdir: $(DISTFILES)
407 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
408 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
409 list='$(DISTFILES)'; \
410 dist_files=`for file in $$list; do echo $$file; done | \
411 sed -e "s|^$$srcdirstrip/||;t" \
412 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
413 case $$dist_files in \
414 */*) $(MKDIR_P) `echo "$$dist_files" | \
415 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
416 sort -u` ;; \
417 esac; \
418 for file in $$dist_files; do \
419 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
420 if test -d $$d/$$file; then \
421 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
422 if test -d "$(distdir)/$$file"; then \
423 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
424 fi; \
425 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
426 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
427 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
428 fi; \
429 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
430 else \
431 test -f "$(distdir)/$$file" \
432 || cp -p $$d/$$file "$(distdir)/$$file" \
433 || exit 1; \
434 fi; \
435 done
436check-am: all-am
437check: check-am
438all-am: Makefile
439installdirs:
440install: install-am
441install-exec: install-exec-am
442install-data: install-data-am
443uninstall: uninstall-am
444
445install-am: all-am
446 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
447
448installcheck: installcheck-am
449install-strip:
450 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
451 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
452 `test -z '$(STRIP)' || \
453 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
454mostlyclean-generic:
455
456clean-generic:
457
458distclean-generic:
459 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
460 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
461
462maintainer-clean-generic:
463 @echo "This command is intended for maintainers to use"
464 @echo "it deletes files that may require special tools to rebuild."
465 -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
466clean: clean-am
467
468clean-am: clean-generic clean-libtool mostlyclean-am
469
470distclean: distclean-am
471 -rm -f Makefile
472distclean-am: clean-am distclean-generic
473
474dvi: dvi-am
475
476dvi-am:
477
478html: html-am
479
480html-am:
481
482info: info-am
483
484info-am:
485
486install-data-am:
487
488install-dvi: install-dvi-am
489
490install-dvi-am:
491
492install-exec-am:
493
494install-html: install-html-am
495
496install-html-am:
497
498install-info: install-info-am
499
500install-info-am:
501
502install-man:
503
504install-pdf: install-pdf-am
505
506install-pdf-am:
507
508install-ps: install-ps-am
509
510install-ps-am:
511
512installcheck-am:
513
514maintainer-clean: maintainer-clean-am
515 -rm -f Makefile
516maintainer-clean-am: distclean-am maintainer-clean-generic
517
518mostlyclean: mostlyclean-am
519
520mostlyclean-am: mostlyclean-generic mostlyclean-libtool
521
522pdf: pdf-am
523
524pdf-am:
525
526ps: ps-am
527
528ps-am:
529
530uninstall-am:
531
532.MAKE: install-am install-strip
533
534.PHONY: all all-am check check-am clean clean-generic clean-libtool \
535 distclean distclean-generic distclean-libtool distdir dvi \
536 dvi-am html html-am info info-am install install-am \
537 install-data install-data-am install-dvi install-dvi-am \
538 install-exec install-exec-am install-html install-html-am \
539 install-info install-info-am install-man install-pdf \
540 install-pdf-am install-ps install-ps-am install-strip \
541 installcheck installcheck-am installdirs maintainer-clean \
542 maintainer-clean-generic mostlyclean mostlyclean-generic \
543 mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am
544
545
546# Tell versions [3.59,3.63) of GNU make to not export all variables.
547# Otherwise a system limit (for SysV at least) may be exceeded.
548.NOEXPORT:
diff --git a/libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_color_.c b/libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_color_.c
new file mode 100644
index 0000000..0178358
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_color_.c
@@ -0,0 +1,138 @@
1/* copy color --> dst */
2
3#ifdef BUILD_C
4static void
5_op_copy_c_dp(DATA32 *s __UNUSED__, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) {
6 DATA32 *e;
7 UNROLL8_PLD_WHILE(d, l, e,
8 {
9 *d = c;
10 d++;
11 });
12}
13
14#define _op_copy_cn_dp _op_copy_c_dp
15#define _op_copy_can_dp _op_copy_c_dp
16#define _op_copy_caa_dp _op_copy_c_dp
17
18#define _op_copy_c_dpan _op_copy_c_dp
19#define _op_copy_cn_dpan _op_copy_c_dp
20#define _op_copy_can_dpan _op_copy_c_dp
21#define _op_copy_caa_dpan _op_copy_c_dp
22
23static void
24init_copy_color_span_funcs_c(void)
25{
26 op_copy_span_funcs[SP_N][SM_N][SC_N][DP][CPU_C] = _op_copy_cn_dp;
27 op_copy_span_funcs[SP_N][SM_N][SC][DP][CPU_C] = _op_copy_c_dp;
28 op_copy_span_funcs[SP_N][SM_N][SC_AN][DP][CPU_C] = _op_copy_can_dp;
29 op_copy_span_funcs[SP_N][SM_N][SC_AA][DP][CPU_C] = _op_copy_caa_dp;
30
31 op_copy_span_funcs[SP_N][SM_N][SC_N][DP_AN][CPU_C] = _op_copy_cn_dpan;
32 op_copy_span_funcs[SP_N][SM_N][SC][DP_AN][CPU_C] = _op_copy_c_dpan;
33 op_copy_span_funcs[SP_N][SM_N][SC_AN][DP_AN][CPU_C] = _op_copy_can_dpan;
34 op_copy_span_funcs[SP_N][SM_N][SC_AA][DP_AN][CPU_C] = _op_copy_caa_dpan;
35}
36#endif
37
38#ifdef BUILD_C
39static void
40_op_copy_pt_c_dp(DATA32 s __UNUSED__, DATA8 m __UNUSED__, DATA32 c, DATA32 *d) {
41 *d = c;
42}
43
44#define _op_copy_pt_cn_dp _op_copy_pt_c_dp
45#define _op_copy_pt_can_dp _op_copy_pt_c_dp
46#define _op_copy_pt_caa_dp _op_copy_pt_c_dp
47
48#define _op_copy_pt_c_dpan _op_copy_pt_c_dp
49#define _op_copy_pt_cn_dpan _op_copy_pt_c_dp
50#define _op_copy_pt_can_dpan _op_copy_pt_c_dp
51#define _op_copy_pt_caa_dpan _op_copy_pt_c_dp
52
53static void
54init_copy_color_pt_funcs_c(void)
55{
56 op_copy_pt_funcs[SP_N][SM_N][SC_N][DP][CPU_C] = _op_copy_pt_cn_dp;
57 op_copy_pt_funcs[SP_N][SM_N][SC][DP][CPU_C] = _op_copy_pt_c_dp;
58 op_copy_pt_funcs[SP_N][SM_N][SC_AN][DP][CPU_C] = _op_copy_pt_can_dp;
59 op_copy_pt_funcs[SP_N][SM_N][SC_AA][DP][CPU_C] = _op_copy_pt_caa_dp;
60
61 op_copy_pt_funcs[SP_N][SM_N][SC_N][DP_AN][CPU_C] = _op_copy_pt_cn_dpan;
62 op_copy_pt_funcs[SP_N][SM_N][SC][DP_AN][CPU_C] = _op_copy_pt_c_dpan;
63 op_copy_pt_funcs[SP_N][SM_N][SC_AN][DP_AN][CPU_C] = _op_copy_pt_can_dpan;
64 op_copy_pt_funcs[SP_N][SM_N][SC_AA][DP_AN][CPU_C] = _op_copy_pt_caa_dpan;
65}
66#endif
67
68/*-----*/
69
70/* copy_rel color --> dst */
71
72#ifdef BUILD_C
73static void
74_op_copy_rel_c_dp(DATA32 *s __UNUSED__, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) {
75 DATA32 *e;
76 UNROLL8_PLD_WHILE(d, l, e,
77 {
78 *d = MUL_SYM(*d >> 24, c);
79 d++;
80 });
81}
82
83
84#define _op_copy_rel_cn_dp _op_copy_rel_c_dp
85#define _op_copy_rel_can_dp _op_copy_rel_c_dp
86#define _op_copy_rel_caa_dp _op_copy_rel_c_dp
87
88#define _op_copy_rel_c_dpan _op_copy_c_dp
89#define _op_copy_rel_cn_dpan _op_copy_cn_dp
90#define _op_copy_rel_can_dpan _op_copy_can_dp
91#define _op_copy_rel_caa_dpan _op_copy_caa_dp
92
93static void
94init_copy_rel_color_span_funcs_c(void)
95{
96 op_copy_rel_span_funcs[SP_N][SM_N][SC_N][DP][CPU_C] = _op_copy_rel_cn_dp;
97 op_copy_rel_span_funcs[SP_N][SM_N][SC][DP][CPU_C] = _op_copy_rel_c_dp;
98 op_copy_rel_span_funcs[SP_N][SM_N][SC_AN][DP][CPU_C] = _op_copy_rel_can_dp;
99 op_copy_rel_span_funcs[SP_N][SM_N][SC_AA][DP][CPU_C] = _op_copy_rel_caa_dp;
100
101 op_copy_rel_span_funcs[SP_N][SM_N][SC_N][DP_AN][CPU_C] = _op_copy_rel_cn_dpan;
102 op_copy_rel_span_funcs[SP_N][SM_N][SC][DP_AN][CPU_C] = _op_copy_rel_c_dpan;
103 op_copy_rel_span_funcs[SP_N][SM_N][SC_AN][DP_AN][CPU_C] = _op_copy_rel_can_dpan;
104 op_copy_rel_span_funcs[SP_N][SM_N][SC_AA][DP_AN][CPU_C] = _op_copy_rel_caa_dpan;
105}
106#endif
107
108#ifdef BUILD_C
109static void
110_op_copy_rel_pt_c_dp(DATA32 s, DATA8 m __UNUSED__, DATA32 c, DATA32 *d) {
111 s = 1 + (*d >> 24);
112 *d = MUL_256(s, c);
113}
114
115
116#define _op_copy_rel_pt_cn_dp _op_copy_rel_pt_c_dp
117#define _op_copy_rel_pt_can_dp _op_copy_rel_pt_c_dp
118#define _op_copy_rel_pt_caa_dp _op_copy_rel_pt_c_dp
119
120#define _op_copy_rel_pt_c_dpan _op_copy_pt_c_dp
121#define _op_copy_rel_pt_cn_dpan _op_copy_pt_cn_dp
122#define _op_copy_rel_pt_can_dpan _op_copy_pt_can_dp
123#define _op_copy_rel_pt_caa_dpan _op_copy_pt_caa_dp
124
125static void
126init_copy_rel_color_pt_funcs_c(void)
127{
128 op_copy_rel_pt_funcs[SP_N][SM_N][SC_N][DP][CPU_C] = _op_copy_rel_pt_cn_dp;
129 op_copy_rel_pt_funcs[SP_N][SM_N][SC][DP][CPU_C] = _op_copy_rel_pt_c_dp;
130 op_copy_rel_pt_funcs[SP_N][SM_N][SC_AN][DP][CPU_C] = _op_copy_rel_pt_can_dp;
131 op_copy_rel_pt_funcs[SP_N][SM_N][SC_AA][DP][CPU_C] = _op_copy_rel_pt_caa_dp;
132
133 op_copy_rel_pt_funcs[SP_N][SM_N][SC_N][DP_AN][CPU_C] = _op_copy_rel_pt_cn_dpan;
134 op_copy_rel_pt_funcs[SP_N][SM_N][SC][DP_AN][CPU_C] = _op_copy_rel_pt_c_dpan;
135 op_copy_rel_pt_funcs[SP_N][SM_N][SC_AN][DP_AN][CPU_C] = _op_copy_rel_pt_can_dpan;
136 op_copy_rel_pt_funcs[SP_N][SM_N][SC_AA][DP_AN][CPU_C] = _op_copy_rel_pt_caa_dpan;
137}
138#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_color_i386.c b/libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_color_i386.c
new file mode 100644
index 0000000..d864d92
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_color_i386.c
@@ -0,0 +1,150 @@
1/* copy color --> dst */
2
3#ifdef BUILD_MMX
4static void
5_op_copy_c_dp_mmx(DATA32 *s __UNUSED__, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) {
6 DATA32 *e = d + l - 1;
7 movd_m2r(c, mm1);
8 movq_r2r(mm1, mm2);
9 psllq_i2r(32, mm1);
10 por_r2r(mm2, mm1);
11 for (; d < e; d+=2) {
12 movq_r2m(mm1, d[0]);
13 }
14 e+=1;
15 for (; d < e; d++) {
16 *d = c;
17 }
18}
19
20#define _op_copy_cn_dp_mmx _op_copy_c_dp_mmx
21#define _op_copy_can_dp_mmx _op_copy_c_dp_mmx
22#define _op_copy_caa_dp_mmx _op_copy_c_dp_mmx
23
24#define _op_copy_cn_dpan_mmx _op_copy_c_dp_mmx
25#define _op_copy_c_dpan_mmx _op_copy_c_dp_mmx
26#define _op_copy_can_dpan_mmx _op_copy_c_dp_mmx
27#define _op_copy_caa_dpan_mmx _op_copy_c_dp_mmx
28
29static void
30init_copy_color_span_funcs_mmx(void)
31{
32 op_copy_span_funcs[SP_N][SM_N][SC_N][DP][CPU_MMX] = _op_copy_cn_dp_mmx;
33 op_copy_span_funcs[SP_N][SM_N][SC][DP][CPU_MMX] = _op_copy_c_dp_mmx;
34 op_copy_span_funcs[SP_N][SM_N][SC_AN][DP][CPU_MMX] = _op_copy_can_dp_mmx;
35 op_copy_span_funcs[SP_N][SM_N][SC_AA][DP][CPU_MMX] = _op_copy_caa_dp_mmx;
36
37 op_copy_span_funcs[SP_N][SM_N][SC_N][DP_AN][CPU_MMX] = _op_copy_cn_dpan_mmx;
38 op_copy_span_funcs[SP_N][SM_N][SC][DP_AN][CPU_MMX] = _op_copy_c_dpan_mmx;
39 op_copy_span_funcs[SP_N][SM_N][SC_AN][DP_AN][CPU_MMX] = _op_copy_can_dpan_mmx;
40 op_copy_span_funcs[SP_N][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_copy_caa_dpan_mmx;
41}
42#endif
43
44#ifdef BUILD_MMX
45static void
46_op_copy_pt_c_dp_mmx(DATA32 s __UNUSED__, DATA8 m __UNUSED__, DATA32 c, DATA32 *d) {
47 *d = c;
48}
49
50#define _op_copy_pt_cn_dp_mmx _op_copy_pt_c_dp_mmx
51#define _op_copy_pt_can_dp_mmx _op_copy_pt_c_dp_mmx
52#define _op_copy_pt_caa_dp_mmx _op_copy_pt_c_dp_mmx
53
54#define _op_copy_pt_cn_dpan_mmx _op_copy_pt_c_dp_mmx
55#define _op_copy_pt_c_dpan_mmx _op_copy_pt_c_dp_mmx
56#define _op_copy_pt_can_dpan_mmx _op_copy_pt_c_dp_mmx
57#define _op_copy_pt_caa_dpan_mmx _op_copy_pt_c_dp_mmx
58
59static void
60init_copy_color_pt_funcs_mmx(void)
61{
62 op_copy_pt_funcs[SP_N][SM_N][SC_N][DP][CPU_MMX] = _op_copy_pt_cn_dp_mmx;
63 op_copy_pt_funcs[SP_N][SM_N][SC][DP][CPU_MMX] = _op_copy_pt_c_dp_mmx;
64 op_copy_pt_funcs[SP_N][SM_N][SC_AN][DP][CPU_MMX] = _op_copy_pt_can_dp_mmx;
65 op_copy_pt_funcs[SP_N][SM_N][SC_AA][DP][CPU_MMX] = _op_copy_pt_caa_dp_mmx;
66
67 op_copy_pt_funcs[SP_N][SM_N][SC_N][DP_AN][CPU_MMX] = _op_copy_pt_cn_dpan_mmx;
68 op_copy_pt_funcs[SP_N][SM_N][SC][DP_AN][CPU_MMX] = _op_copy_pt_c_dpan_mmx;
69 op_copy_pt_funcs[SP_N][SM_N][SC_AN][DP_AN][CPU_MMX] = _op_copy_pt_can_dpan_mmx;
70 op_copy_pt_funcs[SP_N][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_copy_pt_caa_dpan_mmx;
71}
72#endif
73
74/*-----*/
75
76/* copy_rel color --> dst */
77
78#ifdef BUILD_MMX
79static void
80_op_copy_rel_c_dp_mmx(DATA32 *s __UNUSED__, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) {
81 DATA32 *e = d + l;
82 pxor_r2r(mm0, mm0);
83 MOV_P2R(c, mm2, mm0)
84 for (; d < e; d++) {
85 DATA32 da = 1 + (*d >> 24);
86 MOV_A2R(da, mm1)
87 MUL4_256_R2R(mm2, mm1)
88 MOV_R2P(mm1, *d, mm0)
89 }
90}
91
92#define _op_copy_rel_cn_dp_mmx _op_copy_rel_c_dp_mmx
93#define _op_copy_rel_can_dp_mmx _op_copy_rel_c_dp_mmx
94#define _op_copy_rel_caa_dp_mmx _op_copy_rel_c_dp_mmx
95
96#define _op_copy_rel_cn_dpan_mmx _op_copy_cn_dpan_mmx
97#define _op_copy_rel_c_dpan_mmx _op_copy_c_dpan_mmx
98#define _op_copy_rel_can_dpan_mmx _op_copy_can_dpan_mmx
99#define _op_copy_rel_caa_dpan_mmx _op_copy_caa_dpan_mmx
100
101static void
102init_copy_rel_color_span_funcs_mmx(void)
103{
104 op_copy_rel_span_funcs[SP_N][SM_N][SC_N][DP][CPU_MMX] = _op_copy_rel_cn_dp_mmx;
105 op_copy_rel_span_funcs[SP_N][SM_N][SC][DP][CPU_MMX] = _op_copy_rel_c_dp_mmx;
106 op_copy_rel_span_funcs[SP_N][SM_N][SC_AN][DP][CPU_MMX] = _op_copy_rel_can_dp_mmx;
107 op_copy_rel_span_funcs[SP_N][SM_N][SC_AA][DP][CPU_MMX] = _op_copy_rel_caa_dp_mmx;
108
109 op_copy_rel_span_funcs[SP_N][SM_N][SC_N][DP_AN][CPU_MMX] = _op_copy_rel_cn_dpan_mmx;
110 op_copy_rel_span_funcs[SP_N][SM_N][SC][DP_AN][CPU_MMX] = _op_copy_rel_c_dpan_mmx;
111 op_copy_rel_span_funcs[SP_N][SM_N][SC_AN][DP_AN][CPU_MMX] = _op_copy_rel_can_dpan_mmx;
112 op_copy_rel_span_funcs[SP_N][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_copy_rel_caa_dpan_mmx;
113}
114#endif
115
116#ifdef BUILD_MMX
117static void
118_op_copy_rel_pt_c_dp_mmx(DATA32 s, DATA8 m __UNUSED__, DATA32 c, DATA32 *d) {
119 s = 1 + (*d >> 24);
120 pxor_r2r(mm0, mm0);
121 MOV_P2R(c, mm2, mm0)
122 MOV_A2R(s, mm1)
123 MUL4_256_R2R(mm2, mm1)
124 MOV_R2P(mm1, *d, mm0)
125}
126
127
128#define _op_copy_rel_pt_cn_dp_mmx _op_copy_rel_pt_c_dp_mmx
129#define _op_copy_rel_pt_can_dp_mmx _op_copy_rel_pt_c_dp_mmx
130#define _op_copy_rel_pt_caa_dp_mmx _op_copy_rel_pt_c_dp_mmx
131
132#define _op_copy_rel_pt_cn_dpan_mmx _op_copy_pt_cn_dpan_mmx
133#define _op_copy_rel_pt_c_dpan_mmx _op_copy_pt_c_dpan_mmx
134#define _op_copy_rel_pt_can_dpan_mmx _op_copy_pt_can_dpan_mmx
135#define _op_copy_rel_pt_caa_dpan_mmx _op_copy_pt_caa_dpan_mmx
136
137static void
138init_copy_rel_color_pt_funcs_mmx(void)
139{
140 op_copy_rel_pt_funcs[SP_N][SM_N][SC_N][DP][CPU_MMX] = _op_copy_rel_pt_cn_dp_mmx;
141 op_copy_rel_pt_funcs[SP_N][SM_N][SC][DP][CPU_MMX] = _op_copy_rel_pt_c_dp_mmx;
142 op_copy_rel_pt_funcs[SP_N][SM_N][SC_AN][DP][CPU_MMX] = _op_copy_rel_pt_can_dp_mmx;
143 op_copy_rel_pt_funcs[SP_N][SM_N][SC_AA][DP][CPU_MMX] = _op_copy_rel_pt_caa_dp_mmx;
144
145 op_copy_rel_pt_funcs[SP_N][SM_N][SC_N][DP_AN][CPU_MMX] = _op_copy_rel_pt_cn_dpan_mmx;
146 op_copy_rel_pt_funcs[SP_N][SM_N][SC][DP_AN][CPU_MMX] = _op_copy_rel_pt_c_dpan_mmx;
147 op_copy_rel_pt_funcs[SP_N][SM_N][SC_AN][DP_AN][CPU_MMX] = _op_copy_rel_pt_can_dpan_mmx;
148 op_copy_rel_pt_funcs[SP_N][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_copy_rel_pt_caa_dpan_mmx;
149}
150#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_color_neon.c b/libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_color_neon.c
new file mode 100644
index 0000000..96310cd
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_color_neon.c
@@ -0,0 +1,212 @@
1/* copy color --> dst */
2
3#ifdef BUILD_NEON
4static void
5_op_copy_c_dp_neon(DATA32 *s, DATA8 *m, DATA32 c, DATA32 *d, int l) {
6#define AP "COPY_C_DP_"
7 uint32_t *e = d + l,*tmp;
8 asm volatile (
9 ".fpu neon \n\t"
10
11 "vdup.i32 q0, %[c] \n\t"
12
13 // Can we do 32 byte?
14 "andS %[tmp], %[d], $0x1f \n\t"
15 "beq "AP"quadstart \n\t"
16
17 // Can we do at least 16 byte?
18 "andS %[tmp], %[d], $0x4 \n\t"
19 "beq "AP"dualstart \n\t"
20
21 // Only once
22 AP"singleloop: \n\t"
23 "vst1.32 d0[0], [%[d]] \n\t"
24 "add %[d], #4 \n\t"
25
26 // Up to 3 times
27 AP"dualstart: \n\t"
28 "sub %[tmp], %[e], %[d] \n\t"
29 "cmp %[tmp], #32 \n\t"
30 "blt "AP"loopout \n\t"
31
32 AP"dualloop: \n\t"
33 "vstr.32 d0, [%[d]] \n\t"
34
35 "add %[d], #8 \n\t"
36 "andS %[tmp], %[d], $0x1f \n\t"
37 "bne "AP"dualloop \n\t"
38
39
40 AP"quadstart: \n\t"
41 "sub %[tmp], %[e], %[d] \n\t"
42 "cmp %[tmp], #32 \n\t"
43 "blt "AP"loopout \n\t"
44
45 "vmov q1, q0 \n\t"
46 "sub %[tmp],%[e],#31 \n\t"
47
48 AP "quadloop: \n\t"
49 "vstm %[d]!, {d0,d1,d2,d3} \n\t"
50
51 "cmp %[tmp], %[d] \n\t"
52 "bhi "AP"quadloop \n\t"
53
54
55 AP "loopout: \n\t"
56 "cmp %[d], %[e] \n\t"
57 "beq "AP"done \n\t"
58 "sub %[tmp],%[e], %[d] \n\t"
59 "cmp %[tmp],$0x04 \n\t"
60 "beq "AP"singleloop2 \n\t"
61
62 AP "dualloop2: \n\t"
63 "sub %[tmp],%[e],#7 \n\t"
64 AP "dualloop2int: \n\t"
65 "vstr.64 d0, [%[d]] \n\t"
66
67 "add %[d], #8 \n\t"
68 "cmp %[tmp], %[d] \n\t"
69 "bhi "AP"dualloop2int \n\t"
70
71 // Single ??
72 "cmp %[e], %[d] \n\t"
73 "beq "AP"done \n\t"
74
75 AP "singleloop2: \n\t"
76 "vst1.32 d0[0], [%[d]] \n\t"
77
78 AP "done:\n\t"
79
80 : // No output regs
81 // Input
82 : [c] "r" (c), [e] "r" (e), [d] "r" (d),[tmp] "r" (tmp)
83 // Clobbered
84 : "q0","q1","memory"
85
86
87 );
88}
89
90#define _op_copy_cn_dp_neon _op_copy_c_dp_neon
91#define _op_copy_can_dp_neon _op_copy_c_dp_neon
92#define _op_copy_caa_dp_neon _op_copy_c_dp_neon
93
94#define _op_copy_cn_dpan_neon _op_copy_c_dp_neon
95#define _op_copy_c_dpan_neon _op_copy_c_dp_neon
96#define _op_copy_can_dpan_neon _op_copy_c_dp_neon
97#define _op_copy_caa_dpan_neon _op_copy_c_dp_neon
98
99static void
100init_copy_color_span_funcs_neon(void)
101{
102 op_copy_span_funcs[SP_N][SM_N][SC_N][DP][CPU_NEON] = _op_copy_cn_dp_neon;
103 op_copy_span_funcs[SP_N][SM_N][SC][DP][CPU_NEON] = _op_copy_c_dp_neon;
104 op_copy_span_funcs[SP_N][SM_N][SC_AN][DP][CPU_NEON] = _op_copy_can_dp_neon;
105 op_copy_span_funcs[SP_N][SM_N][SC_AA][DP][CPU_NEON] = _op_copy_caa_dp_neon;
106
107 op_copy_span_funcs[SP_N][SM_N][SC_N][DP_AN][CPU_NEON] = _op_copy_cn_dpan_neon;
108 op_copy_span_funcs[SP_N][SM_N][SC][DP_AN][CPU_NEON] = _op_copy_c_dpan_neon;
109 op_copy_span_funcs[SP_N][SM_N][SC_AN][DP_AN][CPU_NEON] = _op_copy_can_dpan_neon;
110 op_copy_span_funcs[SP_N][SM_N][SC_AA][DP_AN][CPU_NEON] = _op_copy_caa_dpan_neon;
111}
112#endif
113
114#ifdef BUILD_NEON
115static void
116_op_copy_pt_c_dp_neon(DATA32 s, DATA8 m, DATA32 c, DATA32 *d) {
117 *d = c;
118}
119
120#define _op_copy_pt_cn_dp_neon _op_copy_pt_c_dp_neon
121#define _op_copy_pt_can_dp_neon _op_copy_pt_c_dp_neon
122#define _op_copy_pt_caa_dp_neon _op_copy_pt_c_dp_neon
123
124#define _op_copy_pt_cn_dpan_neon _op_copy_pt_c_dp_neon
125#define _op_copy_pt_c_dpan_neon _op_copy_pt_c_dp_neon
126#define _op_copy_pt_can_dpan_neon _op_copy_pt_c_dp_neon
127#define _op_copy_pt_caa_dpan_neon _op_copy_pt_c_dp_neon
128
129static void
130init_copy_color_pt_funcs_neon(void)
131{
132 op_copy_pt_funcs[SP_N][SM_N][SC_N][DP][CPU_NEON] = _op_copy_pt_cn_dp_neon;
133 op_copy_pt_funcs[SP_N][SM_N][SC][DP][CPU_NEON] = _op_copy_pt_c_dp_neon;
134 op_copy_pt_funcs[SP_N][SM_N][SC_AN][DP][CPU_NEON] = _op_copy_pt_can_dp_neon;
135 op_copy_pt_funcs[SP_N][SM_N][SC_AA][DP][CPU_NEON] = _op_copy_pt_caa_dp_neon;
136
137 op_copy_pt_funcs[SP_N][SM_N][SC_N][DP_AN][CPU_NEON] = _op_copy_pt_cn_dpan_neon;
138 op_copy_pt_funcs[SP_N][SM_N][SC][DP_AN][CPU_NEON] = _op_copy_pt_c_dpan_neon;
139 op_copy_pt_funcs[SP_N][SM_N][SC_AN][DP_AN][CPU_NEON] = _op_copy_pt_can_dpan_neon;
140 op_copy_pt_funcs[SP_N][SM_N][SC_AA][DP_AN][CPU_NEON] = _op_copy_pt_caa_dpan_neon;
141}
142#endif
143
144/*-----*/
145
146/* copy_rel color --> dst */
147
148#ifdef BUILD_NEON
149static void
150_op_copy_rel_c_dp_neon(DATA32 *s, DATA8 *m, DATA32 c, DATA32 *d, int l) {
151 // FIXME: neon-it
152 DATA32 *e = d + l;
153 for (; d < e; d++) {
154 *d = MUL_SYM(*d >> 24, c);
155 }
156}
157
158#define _op_copy_rel_cn_dp_neon _op_copy_rel_c_dp_neon
159#define _op_copy_rel_can_dp_neon _op_copy_rel_c_dp_neon
160#define _op_copy_rel_caa_dp_neon _op_copy_rel_c_dp_neon
161
162#define _op_copy_rel_cn_dpan_neon _op_copy_cn_dpan_neon
163#define _op_copy_rel_c_dpan_neon _op_copy_c_dpan_neon
164#define _op_copy_rel_can_dpan_neon _op_copy_can_dpan_neon
165#define _op_copy_rel_caa_dpan_neon _op_copy_caa_dpan_neon
166
167static void
168init_copy_rel_color_span_funcs_neon(void)
169{
170 op_copy_rel_span_funcs[SP_N][SM_N][SC_N][DP][CPU_NEON] = _op_copy_rel_cn_dp_neon;
171 op_copy_rel_span_funcs[SP_N][SM_N][SC][DP][CPU_NEON] = _op_copy_rel_c_dp_neon;
172 op_copy_rel_span_funcs[SP_N][SM_N][SC_AN][DP][CPU_NEON] = _op_copy_rel_can_dp_neon;
173 op_copy_rel_span_funcs[SP_N][SM_N][SC_AA][DP][CPU_NEON] = _op_copy_rel_caa_dp_neon;
174
175 op_copy_rel_span_funcs[SP_N][SM_N][SC_N][DP_AN][CPU_NEON] = _op_copy_rel_cn_dpan_neon;
176 op_copy_rel_span_funcs[SP_N][SM_N][SC][DP_AN][CPU_NEON] = _op_copy_rel_c_dpan_neon;
177 op_copy_rel_span_funcs[SP_N][SM_N][SC_AN][DP_AN][CPU_NEON] = _op_copy_rel_can_dpan_neon;
178 op_copy_rel_span_funcs[SP_N][SM_N][SC_AA][DP_AN][CPU_NEON] = _op_copy_rel_caa_dpan_neon;
179}
180#endif
181
182#ifdef BUILD_NEON
183static void
184_op_copy_rel_pt_c_dp_neon(DATA32 s, DATA8 m, DATA32 c, DATA32 *d) {
185 s = 1 + (*d >> 24);
186 *d = MUL_256(s, c);
187}
188
189
190#define _op_copy_rel_pt_cn_dp_neon _op_copy_rel_pt_c_dp_neon
191#define _op_copy_rel_pt_can_dp_neon _op_copy_rel_pt_c_dp_neon
192#define _op_copy_rel_pt_caa_dp_neon _op_copy_rel_pt_c_dp_neon
193
194#define _op_copy_rel_pt_cn_dpan_neon _op_copy_pt_cn_dpan_neon
195#define _op_copy_rel_pt_c_dpan_neon _op_copy_pt_c_dpan_neon
196#define _op_copy_rel_pt_can_dpan_neon _op_copy_pt_can_dpan_neon
197#define _op_copy_rel_pt_caa_dpan_neon _op_copy_pt_caa_dpan_neon
198
199static void
200init_copy_rel_color_pt_funcs_neon(void)
201{
202 op_copy_rel_pt_funcs[SP_N][SM_N][SC_N][DP][CPU_NEON] = _op_copy_rel_pt_cn_dp_neon;
203 op_copy_rel_pt_funcs[SP_N][SM_N][SC][DP][CPU_NEON] = _op_copy_rel_pt_c_dp_neon;
204 op_copy_rel_pt_funcs[SP_N][SM_N][SC_AN][DP][CPU_NEON] = _op_copy_rel_pt_can_dp_neon;
205 op_copy_rel_pt_funcs[SP_N][SM_N][SC_AA][DP][CPU_NEON] = _op_copy_rel_pt_caa_dp_neon;
206
207 op_copy_rel_pt_funcs[SP_N][SM_N][SC_N][DP_AN][CPU_NEON] = _op_copy_rel_pt_cn_dpan_neon;
208 op_copy_rel_pt_funcs[SP_N][SM_N][SC][DP_AN][CPU_NEON] = _op_copy_rel_pt_c_dpan_neon;
209 op_copy_rel_pt_funcs[SP_N][SM_N][SC_AN][DP_AN][CPU_NEON] = _op_copy_rel_pt_can_dpan_neon;
210 op_copy_rel_pt_funcs[SP_N][SM_N][SC_AA][DP_AN][CPU_NEON] = _op_copy_rel_pt_caa_dpan_neon;
211}
212#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_mask_color_.c b/libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_mask_color_.c
new file mode 100644
index 0000000..c03a843
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_mask_color_.c
@@ -0,0 +1,170 @@
1/* copy mask x color -> dst */
2
3#ifdef BUILD_C
4static void
5_op_copy_mas_c_dp(DATA32 *s __UNUSED__, DATA8 *m, DATA32 c, DATA32 *d, int l) {
6 DATA32 *e;
7 int color;
8 UNROLL8_PLD_WHILE(d, l, e,
9 {
10 color = *m;
11 switch(color)
12 {
13 case 0:
14 break;
15 case 255:
16 *d = c;
17 break;
18 default:
19 color++;
20 *d = INTERP_256(color, c, *d);
21 break;
22 }
23 m++; d++;
24 });
25}
26
27#define _op_copy_mas_cn_dp _op_copy_mas_c_dp
28#define _op_copy_mas_can_dp _op_copy_mas_c_dp
29#define _op_copy_mas_caa_dp _op_copy_mas_c_dp
30
31#define _op_copy_mas_c_dpan _op_copy_mas_c_dp
32#define _op_copy_mas_cn_dpan _op_copy_mas_c_dpan
33#define _op_copy_mas_can_dpan _op_copy_mas_c_dpan
34#define _op_copy_mas_caa_dpan _op_copy_mas_c_dpan
35
36static void
37init_copy_mask_color_span_funcs_c(void)
38{
39 op_copy_span_funcs[SP_N][SM_AS][SC_N][DP][CPU_C] = _op_copy_mas_cn_dp;
40 op_copy_span_funcs[SP_N][SM_AS][SC][DP][CPU_C] = _op_copy_mas_c_dp;
41 op_copy_span_funcs[SP_N][SM_AS][SC_AN][DP][CPU_C] = _op_copy_mas_can_dp;
42 op_copy_span_funcs[SP_N][SM_AS][SC_AA][DP][CPU_C] = _op_copy_mas_caa_dp;
43
44 op_copy_span_funcs[SP_N][SM_AS][SC_N][DP_AN][CPU_C] = _op_copy_mas_cn_dpan;
45 op_copy_span_funcs[SP_N][SM_AS][SC][DP_AN][CPU_C] = _op_copy_mas_c_dpan;
46 op_copy_span_funcs[SP_N][SM_AS][SC_AN][DP_AN][CPU_C] = _op_copy_mas_can_dpan;
47 op_copy_span_funcs[SP_N][SM_AS][SC_AA][DP_AN][CPU_C] = _op_copy_mas_caa_dpan;
48}
49#endif
50
51#ifdef BUILD_C
52static void
53_op_copy_pt_mas_c_dp(DATA32 s __UNUSED__, DATA8 m, DATA32 c, DATA32 *d) {
54 *d = INTERP_256(m + 1, c, *d);
55}
56
57
58#define _op_copy_pt_mas_cn_dp _op_copy_pt_mas_c_dp
59#define _op_copy_pt_mas_can_dp _op_copy_pt_mas_c_dp
60#define _op_copy_pt_mas_caa_dp _op_copy_pt_mas_c_dp
61
62#define _op_copy_pt_mas_c_dpan _op_copy_pt_mas_c_dp
63#define _op_copy_pt_mas_cn_dpan _op_copy_pt_mas_c_dpan
64#define _op_copy_pt_mas_can_dpan _op_copy_pt_mas_c_dpan
65#define _op_copy_pt_mas_caa_dpan _op_copy_pt_mas_c_dpan
66
67static void
68init_copy_mask_color_pt_funcs_c(void)
69{
70 op_copy_pt_funcs[SP_N][SM_AS][SC_N][DP][CPU_C] = _op_copy_pt_mas_cn_dp;
71 op_copy_pt_funcs[SP_N][SM_AS][SC][DP][CPU_C] = _op_copy_pt_mas_c_dp;
72 op_copy_pt_funcs[SP_N][SM_AS][SC_AN][DP][CPU_C] = _op_copy_pt_mas_can_dp;
73 op_copy_pt_funcs[SP_N][SM_AS][SC_AA][DP][CPU_C] = _op_copy_pt_mas_caa_dp;
74
75 op_copy_pt_funcs[SP_N][SM_AS][SC_N][DP_AN][CPU_C] = _op_copy_pt_mas_cn_dpan;
76 op_copy_pt_funcs[SP_N][SM_AS][SC][DP_AN][CPU_C] = _op_copy_pt_mas_c_dpan;
77 op_copy_pt_funcs[SP_N][SM_AS][SC_AN][DP_AN][CPU_C] = _op_copy_pt_mas_can_dpan;
78 op_copy_pt_funcs[SP_N][SM_AS][SC_AA][DP_AN][CPU_C] = _op_copy_pt_mas_caa_dpan;
79}
80#endif
81
82/*-----*/
83
84/* copy_rel mask x color -> dst */
85
86#ifdef BUILD_C
87static void
88_op_copy_rel_mas_c_dp(DATA32 *s __UNUSED__, DATA8 *m, DATA32 c, DATA32 *d, int l) {
89 DATA32 *e;
90 int color;
91 UNROLL8_PLD_WHILE(d, l, e,
92 {
93 color = *m;
94 switch(color)
95 {
96 case 0:
97 break;
98 case 255:
99 color = 1 + (*d >> 24);
100 *d = MUL_256(color, c);
101 break;
102 default:
103 {
104 DATA32 da = 1 + (*d >> 24);
105 da = MUL_256(da, c);
106 color++;
107 *d = INTERP_256(color, da, *d);
108 }
109 break;
110 }
111 m++; d++;
112 });
113}
114
115
116#define _op_copy_rel_mas_cn_dp _op_copy_rel_mas_c_dp
117#define _op_copy_rel_mas_can_dp _op_copy_rel_mas_c_dp
118#define _op_copy_rel_mas_caa_dp _op_copy_rel_mas_c_dp
119
120#define _op_copy_rel_mas_c_dpan _op_copy_mas_c_dpan
121#define _op_copy_rel_mas_cn_dpan _op_copy_mas_cn_dpan
122#define _op_copy_rel_mas_can_dpan _op_copy_mas_can_dpan
123#define _op_copy_rel_mas_caa_dpan _op_copy_mas_caa_dpan
124
125static void
126init_copy_rel_mask_color_span_funcs_c(void)
127{
128 op_copy_rel_span_funcs[SP_N][SM_AS][SC_N][DP][CPU_C] = _op_copy_rel_mas_cn_dp;
129 op_copy_rel_span_funcs[SP_N][SM_AS][SC][DP][CPU_C] = _op_copy_rel_mas_c_dp;
130 op_copy_rel_span_funcs[SP_N][SM_AS][SC_AN][DP][CPU_C] = _op_copy_rel_mas_can_dp;
131 op_copy_rel_span_funcs[SP_N][SM_AS][SC_AA][DP][CPU_C] = _op_copy_rel_mas_caa_dp;
132
133 op_copy_rel_span_funcs[SP_N][SM_AS][SC_N][DP_AN][CPU_C] = _op_copy_rel_mas_cn_dpan;
134 op_copy_rel_span_funcs[SP_N][SM_AS][SC][DP_AN][CPU_C] = _op_copy_rel_mas_c_dpan;
135 op_copy_rel_span_funcs[SP_N][SM_AS][SC_AN][DP_AN][CPU_C] = _op_copy_rel_mas_can_dpan;
136 op_copy_rel_span_funcs[SP_N][SM_AS][SC_AA][DP_AN][CPU_C] = _op_copy_rel_mas_caa_dpan;
137}
138#endif
139
140#ifdef BUILD_C
141static void
142_op_copy_rel_pt_mas_c_dp(DATA32 s, DATA8 m, DATA32 c, DATA32 *d) {
143 s = 1 + (*d >> 24);
144 s = MUL_256(s, c);
145 *d = INTERP_256(m + 1, s, *d);
146}
147
148#define _op_copy_rel_pt_mas_cn_dp _op_copy_rel_pt_mas_c_dp
149#define _op_copy_rel_pt_mas_can_dp _op_copy_rel_pt_mas_c_dp
150#define _op_copy_rel_pt_mas_caa_dp _op_copy_rel_pt_mas_c_dp
151
152#define _op_copy_rel_pt_mas_c_dpan _op_copy_pt_mas_c_dpan
153#define _op_copy_rel_pt_mas_cn_dpan _op_copy_pt_mas_cn_dpan
154#define _op_copy_rel_pt_mas_can_dpan _op_copy_pt_mas_can_dpan
155#define _op_copy_rel_pt_mas_caa_dpan _op_copy_pt_mas_caa_dpan
156
157static void
158init_copy_rel_mask_color_pt_funcs_c(void)
159{
160 op_copy_rel_pt_funcs[SP_N][SM_AS][SC_N][DP][CPU_C] = _op_copy_rel_pt_mas_cn_dp;
161 op_copy_rel_pt_funcs[SP_N][SM_AS][SC][DP][CPU_C] = _op_copy_rel_pt_mas_c_dp;
162 op_copy_rel_pt_funcs[SP_N][SM_AS][SC_AN][DP][CPU_C] = _op_copy_rel_pt_mas_can_dp;
163 op_copy_rel_pt_funcs[SP_N][SM_AS][SC_AA][DP][CPU_C] = _op_copy_rel_pt_mas_caa_dp;
164
165 op_copy_rel_pt_funcs[SP_N][SM_AS][SC_N][DP_AN][CPU_C] = _op_copy_rel_pt_mas_cn_dpan;
166 op_copy_rel_pt_funcs[SP_N][SM_AS][SC][DP_AN][CPU_C] = _op_copy_rel_pt_mas_c_dpan;
167 op_copy_rel_pt_funcs[SP_N][SM_AS][SC_AN][DP_AN][CPU_C] = _op_copy_rel_pt_mas_can_dpan;
168 op_copy_rel_pt_funcs[SP_N][SM_AS][SC_AA][DP_AN][CPU_C] = _op_copy_rel_pt_mas_caa_dpan;
169}
170#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_mask_color_i386.c b/libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_mask_color_i386.c
new file mode 100644
index 0000000..e27493f
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_mask_color_i386.c
@@ -0,0 +1,193 @@
1/* copy mask x color -> dst */
2
3#ifdef BUILD_MMX
4static void
5_op_copy_mas_c_dp_mmx(DATA32 *s __UNUSED__, DATA8 *m, DATA32 c, DATA32 *d, int l) {
6 DATA32 *e = d + l;
7 pxor_r2r(mm0, mm0);
8 MOV_P2R(c, mm2, mm0)
9 MOV_A2R(ALPHA_255, mm5)
10 while (d < e) {
11 l = *m;
12 switch(l)
13 {
14 case 0:
15 break;
16 case 255:
17 *d = c;
18 break;
19 default:
20 {
21 l++;
22 MOV_A2R(l, mm3)
23 MOV_P2R(*d, mm1, mm0)
24 movq_r2r(mm2, mm4);
25 INTERP_256_R2R(mm3, mm4, mm1, mm5);
26 MOV_R2P(mm1, *d, mm0)
27 }
28 break;
29 }
30 m++; d++;
31 }
32}
33
34#define _op_copy_mas_cn_dp_mmx _op_copy_mas_c_dp_mmx
35#define _op_copy_mas_can_dp_mmx _op_copy_mas_c_dp_mmx
36#define _op_copy_mas_caa_dp_mmx _op_copy_mas_c_dp_mmx
37
38#define _op_copy_mas_c_dpan_mmx _op_copy_mas_c_dp_mmx
39#define _op_copy_mas_cn_dpan_mmx _op_copy_mas_c_dpan_mmx
40#define _op_copy_mas_can_dpan_mmx _op_copy_mas_c_dpan_mmx
41#define _op_copy_mas_caa_dpan_mmx _op_copy_mas_c_dpan_mmx
42
43static void
44init_copy_mask_color_span_funcs_mmx(void)
45{
46 op_copy_span_funcs[SP_N][SM_AS][SC_N][DP][CPU_MMX] = _op_copy_mas_cn_dp_mmx;
47 op_copy_span_funcs[SP_N][SM_AS][SC][DP][CPU_MMX] = _op_copy_mas_c_dp_mmx;
48 op_copy_span_funcs[SP_N][SM_AS][SC_AN][DP][CPU_MMX] = _op_copy_mas_can_dp_mmx;
49 op_copy_span_funcs[SP_N][SM_AS][SC_AA][DP][CPU_MMX] = _op_copy_mas_caa_dp_mmx;
50
51 op_copy_span_funcs[SP_N][SM_AS][SC_N][DP_AN][CPU_MMX] = _op_copy_mas_cn_dpan_mmx;
52 op_copy_span_funcs[SP_N][SM_AS][SC][DP_AN][CPU_MMX] = _op_copy_mas_c_dpan_mmx;
53 op_copy_span_funcs[SP_N][SM_AS][SC_AN][DP_AN][CPU_MMX] = _op_copy_mas_can_dpan_mmx;
54 op_copy_span_funcs[SP_N][SM_AS][SC_AA][DP_AN][CPU_MMX] = _op_copy_mas_caa_dpan_mmx;
55}
56#endif
57
58#ifdef BUILD_MMX
59static void
60_op_copy_pt_mas_c_dp_mmx(DATA32 s, DATA8 m, DATA32 c, DATA32 *d) {
61 s = m + 1;
62 MOV_A2R(ALPHA_255, mm5)
63 pxor_r2r(mm0, mm0);
64 MOV_P2R(c, mm2, mm0)
65 MOV_A2R(s, mm3)
66 MOV_P2R(*d, mm1, mm0)
67 INTERP_256_R2R(mm3, mm2, mm1, mm5);
68 MOV_R2P(mm1, *d, mm0)
69}
70
71#define _op_copy_pt_mas_cn_dp_mmx _op_copy_pt_mas_c_dp_mmx
72#define _op_copy_pt_mas_can_dp_mmx _op_copy_pt_mas_c_dp_mmx
73#define _op_copy_pt_mas_caa_dp_mmx _op_copy_pt_mas_c_dp_mmx
74
75#define _op_copy_pt_mas_c_dpan_mmx _op_copy_pt_mas_c_dp_mmx
76#define _op_copy_pt_mas_cn_dpan_mmx _op_copy_pt_mas_c_dpan_mmx
77#define _op_copy_pt_mas_can_dpan_mmx _op_copy_pt_mas_c_dpan_mmx
78#define _op_copy_pt_mas_caa_dpan_mmx _op_copy_pt_mas_c_dpan_mmx
79
80static void
81init_copy_mask_color_pt_funcs_mmx(void)
82{
83 op_copy_pt_funcs[SP_N][SM_AS][SC_N][DP][CPU_MMX] = _op_copy_pt_mas_cn_dp_mmx;
84 op_copy_pt_funcs[SP_N][SM_AS][SC][DP][CPU_MMX] = _op_copy_pt_mas_c_dp_mmx;
85 op_copy_pt_funcs[SP_N][SM_AS][SC_AN][DP][CPU_MMX] = _op_copy_pt_mas_can_dp_mmx;
86 op_copy_pt_funcs[SP_N][SM_AS][SC_AA][DP][CPU_MMX] = _op_copy_pt_mas_caa_dp_mmx;
87
88 op_copy_pt_funcs[SP_N][SM_AS][SC_N][DP_AN][CPU_MMX] = _op_copy_pt_mas_cn_dpan_mmx;
89 op_copy_pt_funcs[SP_N][SM_AS][SC][DP_AN][CPU_MMX] = _op_copy_pt_mas_c_dpan_mmx;
90 op_copy_pt_funcs[SP_N][SM_AS][SC_AN][DP_AN][CPU_MMX] = _op_copy_pt_mas_can_dpan_mmx;
91 op_copy_pt_funcs[SP_N][SM_AS][SC_AA][DP_AN][CPU_MMX] = _op_copy_pt_mas_caa_dpan_mmx;
92}
93#endif
94
95/*-----*/
96
97/* copy_rel mask x color -> dst */
98
99#ifdef BUILD_MMX
100static void
101_op_copy_rel_mas_c_dp_mmx(DATA32 *s __UNUSED__, DATA8 *m, DATA32 c, DATA32 *d, int l) {
102 DATA32 *e = d + l;
103 pxor_r2r(mm0, mm0);
104 MOV_P2R(c, mm2, mm0)
105 MOV_A2R(ALPHA_255, mm5)
106 while (d < e) {
107 l = *m;
108 switch(l)
109 {
110 case 0:
111 break;
112 case 255:
113 l = 1 + (*d >> 24);
114 MOV_A2R(l, mm1)
115 MUL4_256_R2R(mm2, mm1)
116 MOV_R2P(mm1, *d, mm0)
117 break;
118 default:
119 l++;
120 MOV_A2R(l, mm3)
121 MOV_P2R(*d, mm1, mm0)
122 MOV_RA2R(mm1, mm4)
123 MUL4_256_R2R(mm2, mm4)
124 INTERP_256_R2R(mm3, mm4, mm1, mm5)
125 MOV_R2P(mm1, *d, mm0)
126 break;
127 }
128 m++; d++;
129 }
130}
131
132#define _op_copy_rel_mas_cn_dp_mmx _op_copy_rel_mas_c_dp_mmx
133#define _op_copy_rel_mas_can_dp_mmx _op_copy_rel_mas_c_dp_mmx
134#define _op_copy_rel_mas_caa_dp_mmx _op_copy_rel_mas_c_dp_mmx
135
136#define _op_copy_rel_mas_c_dpan_mmx _op_copy_mas_c_dpan_mmx
137#define _op_copy_rel_mas_cn_dpan_mmx _op_copy_mas_cn_dpan_mmx
138#define _op_copy_rel_mas_can_dpan_mmx _op_copy_mas_can_dpan_mmx
139#define _op_copy_rel_mas_caa_dpan_mmx _op_copy_mas_caa_dpan_mmx
140
141static void
142init_copy_rel_mask_color_span_funcs_mmx(void)
143{
144 op_copy_rel_span_funcs[SP_N][SM_AS][SC_N][DP][CPU_MMX] = _op_copy_rel_mas_cn_dp_mmx;
145 op_copy_rel_span_funcs[SP_N][SM_AS][SC][DP][CPU_MMX] = _op_copy_rel_mas_c_dp_mmx;
146 op_copy_rel_span_funcs[SP_N][SM_AS][SC_AN][DP][CPU_MMX] = _op_copy_rel_mas_can_dp_mmx;
147 op_copy_rel_span_funcs[SP_N][SM_AS][SC_AA][DP][CPU_MMX] = _op_copy_rel_mas_caa_dp_mmx;
148
149 op_copy_rel_span_funcs[SP_N][SM_AS][SC_N][DP_AN][CPU_MMX] = _op_copy_rel_mas_cn_dpan_mmx;
150 op_copy_rel_span_funcs[SP_N][SM_AS][SC][DP_AN][CPU_MMX] = _op_copy_rel_mas_c_dpan_mmx;
151 op_copy_rel_span_funcs[SP_N][SM_AS][SC_AN][DP_AN][CPU_MMX] = _op_copy_rel_mas_can_dpan_mmx;
152 op_copy_rel_span_funcs[SP_N][SM_AS][SC_AA][DP_AN][CPU_MMX] = _op_copy_rel_mas_caa_dpan_mmx;
153}
154#endif
155
156#ifdef BUILD_MMX
157static void
158_op_copy_rel_pt_mas_c_dp_mmx(DATA32 s, DATA8 m, DATA32 c, DATA32 *d) {
159 s = m + 1;
160 MOV_A2R(ALPHA_255, mm5)
161 pxor_r2r(mm0, mm0);
162 MOV_A2R(s, mm3)
163 MOV_P2R(*d, mm1, mm0)
164 MOV_RA2R(mm1, mm4)
165 MOV_P2R(c, mm2, mm0)
166 MUL4_256_R2R(mm2, mm4)
167 INTERP_256_R2R(mm3, mm4, mm1, mm5)
168 MOV_R2P(mm1, *d, mm0)
169}
170
171#define _op_copy_rel_pt_mas_cn_dp_mmx _op_copy_rel_pt_mas_c_dp_mmx
172#define _op_copy_rel_pt_mas_can_dp_mmx _op_copy_rel_pt_mas_c_dp_mmx
173#define _op_copy_rel_pt_mas_caa_dp_mmx _op_copy_rel_pt_mas_c_dp_mmx
174
175#define _op_copy_rel_pt_mas_c_dpan_mmx _op_copy_pt_mas_c_dpan_mmx
176#define _op_copy_rel_pt_mas_cn_dpan_mmx _op_copy_pt_mas_cn_dpan_mmx
177#define _op_copy_rel_pt_mas_can_dpan_mmx _op_copy_pt_mas_can_dpan_mmx
178#define _op_copy_rel_pt_mas_caa_dpan_mmx _op_copy_pt_mas_caa_dpan_mmx
179
180static void
181init_copy_rel_mask_color_pt_funcs_mmx(void)
182{
183 op_copy_rel_pt_funcs[SP_N][SM_AS][SC_N][DP][CPU_MMX] = _op_copy_rel_pt_mas_cn_dp_mmx;
184 op_copy_rel_pt_funcs[SP_N][SM_AS][SC][DP][CPU_MMX] = _op_copy_rel_pt_mas_c_dp_mmx;
185 op_copy_rel_pt_funcs[SP_N][SM_AS][SC_AN][DP][CPU_MMX] = _op_copy_rel_pt_mas_can_dp_mmx;
186 op_copy_rel_pt_funcs[SP_N][SM_AS][SC_AA][DP][CPU_MMX] = _op_copy_rel_pt_mas_caa_dp_mmx;
187
188 op_copy_rel_pt_funcs[SP_N][SM_AS][SC_N][DP_AN][CPU_MMX] = _op_copy_rel_pt_mas_cn_dpan_mmx;
189 op_copy_rel_pt_funcs[SP_N][SM_AS][SC][DP_AN][CPU_MMX] = _op_copy_rel_pt_mas_c_dpan_mmx;
190 op_copy_rel_pt_funcs[SP_N][SM_AS][SC_AN][DP_AN][CPU_MMX] = _op_copy_rel_pt_mas_can_dpan_mmx;
191 op_copy_rel_pt_funcs[SP_N][SM_AS][SC_AA][DP_AN][CPU_MMX] = _op_copy_rel_pt_mas_caa_dpan_mmx;
192}
193#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_mask_color_neon.c b/libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_mask_color_neon.c
new file mode 100644
index 0000000..dc7f78f
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_mask_color_neon.c
@@ -0,0 +1,170 @@
1/* copy mask x color -> dst */
2
3#ifdef BUILD_NEON
4static void
5_op_copy_mas_c_dp_neon(DATA32 *s __UNUSED__, DATA8 *m, DATA32 c, DATA32 *d, int l) {
6 // FIXME: neon-it
7 DATA32 *e;
8 int color;
9 UNROLL8_PLD_WHILE(d, l, e,
10 {
11 color = *m;
12 switch(color)
13 {
14 case 0:
15 break;
16 case 255:
17 *d = c;
18 break;
19 default:
20 color++;
21 *d = INTERP_256(color, c, *d);
22 break;
23 }
24 m++; d++;
25 });
26}
27
28#define _op_copy_mas_cn_dp_neon _op_copy_mas_c_dp_neon
29#define _op_copy_mas_can_dp_neon _op_copy_mas_c_dp_neon
30#define _op_copy_mas_caa_dp_neon _op_copy_mas_c_dp_neon
31
32#define _op_copy_mas_c_dpan_neon _op_copy_mas_c_dp_neon
33#define _op_copy_mas_cn_dpan_neon _op_copy_mas_c_dpan_neon
34#define _op_copy_mas_can_dpan_neon _op_copy_mas_c_dpan_neon
35#define _op_copy_mas_caa_dpan_neon _op_copy_mas_c_dpan_neon
36
37static void
38init_copy_mask_color_span_funcs_neon(void)
39{
40 op_copy_span_funcs[SP_N][SM_AS][SC_N][DP][CPU_NEON] = _op_copy_mas_cn_dp_neon;
41 op_copy_span_funcs[SP_N][SM_AS][SC][DP][CPU_NEON] = _op_copy_mas_c_dp_neon;
42 op_copy_span_funcs[SP_N][SM_AS][SC_AN][DP][CPU_NEON] = _op_copy_mas_can_dp_neon;
43 op_copy_span_funcs[SP_N][SM_AS][SC_AA][DP][CPU_NEON] = _op_copy_mas_caa_dp_neon;
44
45 op_copy_span_funcs[SP_N][SM_AS][SC_N][DP_AN][CPU_NEON] = _op_copy_mas_cn_dpan_neon;
46 op_copy_span_funcs[SP_N][SM_AS][SC][DP_AN][CPU_NEON] = _op_copy_mas_c_dpan_neon;
47 op_copy_span_funcs[SP_N][SM_AS][SC_AN][DP_AN][CPU_NEON] = _op_copy_mas_can_dpan_neon;
48 op_copy_span_funcs[SP_N][SM_AS][SC_AA][DP_AN][CPU_NEON] = _op_copy_mas_caa_dpan_neon;
49}
50#endif
51
52#ifdef BUILD_NEON
53static void
54_op_copy_pt_mas_c_dp_neon(DATA32 s, DATA8 m, DATA32 c, DATA32 *d) {
55 *d = INTERP_256(m + 1, c, *d);
56}
57
58#define _op_copy_pt_mas_cn_dp_neon _op_copy_pt_mas_c_dp_neon
59#define _op_copy_pt_mas_can_dp_neon _op_copy_pt_mas_c_dp_neon
60#define _op_copy_pt_mas_caa_dp_neon _op_copy_pt_mas_c_dp_neon
61
62#define _op_copy_pt_mas_c_dpan_neon _op_copy_pt_mas_c_dp_neon
63#define _op_copy_pt_mas_cn_dpan_neon _op_copy_pt_mas_c_dpan_neon
64#define _op_copy_pt_mas_can_dpan_neon _op_copy_pt_mas_c_dpan_neon
65#define _op_copy_pt_mas_caa_dpan_neon _op_copy_pt_mas_c_dpan_neon
66
67static void
68init_copy_mask_color_pt_funcs_neon(void)
69{
70 op_copy_pt_funcs[SP_N][SM_AS][SC_N][DP][CPU_NEON] = _op_copy_pt_mas_cn_dp_neon;
71 op_copy_pt_funcs[SP_N][SM_AS][SC][DP][CPU_NEON] = _op_copy_pt_mas_c_dp_neon;
72 op_copy_pt_funcs[SP_N][SM_AS][SC_AN][DP][CPU_NEON] = _op_copy_pt_mas_can_dp_neon;
73 op_copy_pt_funcs[SP_N][SM_AS][SC_AA][DP][CPU_NEON] = _op_copy_pt_mas_caa_dp_neon;
74
75 op_copy_pt_funcs[SP_N][SM_AS][SC_N][DP_AN][CPU_NEON] = _op_copy_pt_mas_cn_dpan_neon;
76 op_copy_pt_funcs[SP_N][SM_AS][SC][DP_AN][CPU_NEON] = _op_copy_pt_mas_c_dpan_neon;
77 op_copy_pt_funcs[SP_N][SM_AS][SC_AN][DP_AN][CPU_NEON] = _op_copy_pt_mas_can_dpan_neon;
78 op_copy_pt_funcs[SP_N][SM_AS][SC_AA][DP_AN][CPU_NEON] = _op_copy_pt_mas_caa_dpan_neon;
79}
80#endif
81
82/*-----*/
83
84/* copy_rel mask x color -> dst */
85
86#ifdef BUILD_NEON
87static void
88_op_copy_rel_mas_c_dp_neon(DATA32 *s __UNUSED__, DATA8 *m, DATA32 c, DATA32 *d, int l) {
89 // FIXME: neon-it
90 DATA32 *e;
91 int color;
92 UNROLL8_PLD_WHILE(d, l, e,
93 {
94 color = *m;
95 switch(color)
96 {
97 case 0:
98 break;
99 case 255:
100 color = 1 + (*d >> 24);
101 *d = MUL_256(color, c);
102 break;
103 default:
104 {
105 DATA32 da = 1 + (*d >> 24);
106 da = MUL_256(da, c);
107 color++;
108 *d = INTERP_256(color, da, *d);
109 }
110 break;
111 }
112 m++; d++;
113 });
114}
115
116#define _op_copy_rel_mas_cn_dp_neon _op_copy_rel_mas_c_dp_neon
117#define _op_copy_rel_mas_can_dp_neon _op_copy_rel_mas_c_dp_neon
118#define _op_copy_rel_mas_caa_dp_neon _op_copy_rel_mas_c_dp_neon
119
120#define _op_copy_rel_mas_c_dpan_neon _op_copy_mas_c_dpan_neon
121#define _op_copy_rel_mas_cn_dpan_neon _op_copy_mas_cn_dpan_neon
122#define _op_copy_rel_mas_can_dpan_neon _op_copy_mas_can_dpan_neon
123#define _op_copy_rel_mas_caa_dpan_neon _op_copy_mas_caa_dpan_neon
124
125static void
126init_copy_rel_mask_color_span_funcs_neon(void)
127{
128 op_copy_rel_span_funcs[SP_N][SM_AS][SC_N][DP][CPU_NEON] = _op_copy_rel_mas_cn_dp_neon;
129 op_copy_rel_span_funcs[SP_N][SM_AS][SC][DP][CPU_NEON] = _op_copy_rel_mas_c_dp_neon;
130 op_copy_rel_span_funcs[SP_N][SM_AS][SC_AN][DP][CPU_NEON] = _op_copy_rel_mas_can_dp_neon;
131 op_copy_rel_span_funcs[SP_N][SM_AS][SC_AA][DP][CPU_NEON] = _op_copy_rel_mas_caa_dp_neon;
132
133 op_copy_rel_span_funcs[SP_N][SM_AS][SC_N][DP_AN][CPU_NEON] = _op_copy_rel_mas_cn_dpan_neon;
134 op_copy_rel_span_funcs[SP_N][SM_AS][SC][DP_AN][CPU_NEON] = _op_copy_rel_mas_c_dpan_neon;
135 op_copy_rel_span_funcs[SP_N][SM_AS][SC_AN][DP_AN][CPU_NEON] = _op_copy_rel_mas_can_dpan_neon;
136 op_copy_rel_span_funcs[SP_N][SM_AS][SC_AA][DP_AN][CPU_NEON] = _op_copy_rel_mas_caa_dpan_neon;
137}
138#endif
139
140#ifdef BUILD_NEON
141static void
142_op_copy_rel_pt_mas_c_dp_neon(DATA32 s, DATA8 m, DATA32 c, DATA32 *d) {
143 s = 1 + (*d >> 24);
144 s = MUL_256(s, c);
145 *d = INTERP_256(m + 1, s, *d);
146}
147
148#define _op_copy_rel_pt_mas_cn_dp_neon _op_copy_rel_pt_mas_c_dp_neon
149#define _op_copy_rel_pt_mas_can_dp_neon _op_copy_rel_pt_mas_c_dp_neon
150#define _op_copy_rel_pt_mas_caa_dp_neon _op_copy_rel_pt_mas_c_dp_neon
151
152#define _op_copy_rel_pt_mas_c_dpan_neon _op_copy_pt_mas_c_dpan_neon
153#define _op_copy_rel_pt_mas_cn_dpan_neon _op_copy_pt_mas_cn_dpan_neon
154#define _op_copy_rel_pt_mas_can_dpan_neon _op_copy_pt_mas_can_dpan_neon
155#define _op_copy_rel_pt_mas_caa_dpan_neon _op_copy_pt_mas_caa_dpan_neon
156
157static void
158init_copy_rel_mask_color_pt_funcs_neon(void)
159{
160 op_copy_rel_pt_funcs[SP_N][SM_AS][SC_N][DP][CPU_NEON] = _op_copy_rel_pt_mas_cn_dp_neon;
161 op_copy_rel_pt_funcs[SP_N][SM_AS][SC][DP][CPU_NEON] = _op_copy_rel_pt_mas_c_dp_neon;
162 op_copy_rel_pt_funcs[SP_N][SM_AS][SC_AN][DP][CPU_NEON] = _op_copy_rel_pt_mas_can_dp_neon;
163 op_copy_rel_pt_funcs[SP_N][SM_AS][SC_AA][DP][CPU_NEON] = _op_copy_rel_pt_mas_caa_dp_neon;
164
165 op_copy_rel_pt_funcs[SP_N][SM_AS][SC_N][DP_AN][CPU_NEON] = _op_copy_rel_pt_mas_cn_dpan_neon;
166 op_copy_rel_pt_funcs[SP_N][SM_AS][SC][DP_AN][CPU_NEON] = _op_copy_rel_pt_mas_c_dpan_neon;
167 op_copy_rel_pt_funcs[SP_N][SM_AS][SC_AN][DP_AN][CPU_NEON] = _op_copy_rel_pt_mas_can_dpan_neon;
168 op_copy_rel_pt_funcs[SP_N][SM_AS][SC_AA][DP_AN][CPU_NEON] = _op_copy_rel_pt_mas_caa_dpan_neon;
169}
170#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_pixel_.c b/libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_pixel_.c
new file mode 100644
index 0000000..45d59d0
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_pixel_.c
@@ -0,0 +1,117 @@
1/* copy pixel --> dst */
2
3#ifdef BUILD_C
4static void
5_op_copy_p_dp(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c __UNUSED__, DATA32 *d, int l) {
6 memcpy(d, s, l * sizeof(DATA32));
7}
8
9#define _op_copy_pan_dp _op_copy_p_dp
10#define _op_copy_pas_dp _op_copy_p_dp
11
12#define _op_copy_p_dpan _op_copy_p_dp
13#define _op_copy_pan_dpan _op_copy_pan_dp
14#define _op_copy_pas_dpan _op_copy_pas_dp
15
16static void
17init_copy_pixel_span_funcs_c(void)
18{
19 op_copy_span_funcs[SP][SM_N][SC_N][DP][CPU_C] = _op_copy_p_dp;
20 op_copy_span_funcs[SP_AN][SM_N][SC_N][DP][CPU_C] = _op_copy_pan_dp;
21 op_copy_span_funcs[SP_AS][SM_N][SC_N][DP][CPU_C] = _op_copy_pas_dp;
22
23 op_copy_span_funcs[SP][SM_N][SC_N][DP_AN][CPU_C] = _op_copy_p_dpan;
24 op_copy_span_funcs[SP_AN][SM_N][SC_N][DP_AN][CPU_C] = _op_copy_pan_dpan;
25 op_copy_span_funcs[SP_AS][SM_N][SC_N][DP_AN][CPU_C] = _op_copy_pas_dpan;
26}
27#endif
28
29#ifdef BUILD_C
30static void
31_op_copy_pt_p_dp(DATA32 s, DATA8 m __UNUSED__, DATA32 c __UNUSED__, DATA32 *d) {
32 *d = s;
33}
34
35#define _op_copy_pt_pan_dp _op_copy_pt_p_dp
36#define _op_copy_pt_pas_dp _op_copy_pt_p_dp
37
38#define _op_copy_pt_p_dpan _op_copy_pt_p_dp
39#define _op_copy_pt_pan_dpan _op_copy_pt_pan_dp
40#define _op_copy_pt_pas_dpan _op_copy_pt_pas_dp
41
42static void
43init_copy_pixel_pt_funcs_c(void)
44{
45 op_copy_pt_funcs[SP][SM_N][SC_N][DP][CPU_C] = _op_copy_pt_p_dp;
46 op_copy_pt_funcs[SP_AN][SM_N][SC_N][DP][CPU_C] = _op_copy_pt_pan_dp;
47 op_copy_pt_funcs[SP_AS][SM_N][SC_N][DP][CPU_C] = _op_copy_pt_pas_dp;
48
49 op_copy_pt_funcs[SP][SM_N][SC_N][DP_AN][CPU_C] = _op_copy_pt_p_dpan;
50 op_copy_pt_funcs[SP_AN][SM_N][SC_N][DP_AN][CPU_C] = _op_copy_pt_pan_dpan;
51 op_copy_pt_funcs[SP_AS][SM_N][SC_N][DP_AN][CPU_C] = _op_copy_pt_pas_dpan;
52}
53#endif
54
55/*-----*/
56
57/* copy_rel pixel --> dst */
58
59#ifdef BUILD_C
60static void
61_op_copy_rel_p_dp(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c __UNUSED__, DATA32 *d, int l) {
62 DATA32 *e;
63 UNROLL8_PLD_WHILE(d, l, e,
64 {
65 *d = MUL_SYM(*d >> 24, *s);
66 d++; s++;
67 });
68}
69
70
71#define _op_copy_rel_pas_dp _op_copy_rel_p_dp
72#define _op_copy_rel_pan_dp _op_copy_rel_p_dp
73
74#define _op_copy_rel_p_dpan _op_copy_p_dpan
75#define _op_copy_rel_pan_dpan _op_copy_pan_dpan
76#define _op_copy_rel_pas_dpan _op_copy_pas_dpan
77
78static void
79init_copy_rel_pixel_span_funcs_c(void)
80{
81 op_copy_rel_span_funcs[SP][SM_N][SC_N][DP][CPU_C] = _op_copy_rel_p_dp;
82 op_copy_rel_span_funcs[SP_AN][SM_N][SC_N][DP][CPU_C] = _op_copy_rel_pan_dp;
83 op_copy_rel_span_funcs[SP_AS][SM_N][SC_N][DP][CPU_C] = _op_copy_rel_pas_dp;
84
85 op_copy_rel_span_funcs[SP][SM_N][SC_N][DP_AN][CPU_C] = _op_copy_rel_p_dpan;
86 op_copy_rel_span_funcs[SP_AN][SM_N][SC_N][DP_AN][CPU_C] = _op_copy_rel_pan_dpan;
87 op_copy_rel_span_funcs[SP_AS][SM_N][SC_N][DP_AN][CPU_C] = _op_copy_rel_pas_dpan;
88}
89#endif
90
91#ifdef BUILD_C
92static void
93_op_copy_rel_pt_p_dp(DATA32 s, DATA8 m __UNUSED__, DATA32 c, DATA32 *d) {
94 c = 1 + (*d >> 24);
95 *d = MUL_256(c, s);
96}
97
98
99#define _op_copy_rel_pt_pan_dp _op_copy_rel_pt_p_dp
100#define _op_copy_rel_pt_pas_dp _op_copy_rel_pt_p_dp
101
102#define _op_copy_rel_pt_p_dpan _op_copy_pt_p_dpan
103#define _op_copy_rel_pt_pan_dpan _op_copy_pt_pan_dpan
104#define _op_copy_rel_pt_pas_dpan _op_copy_pt_pas_dpan
105
106static void
107init_copy_rel_pixel_pt_funcs_c(void)
108{
109 op_copy_rel_pt_funcs[SP][SM_N][SC_N][DP][CPU_C] = _op_copy_rel_pt_p_dp;
110 op_copy_rel_pt_funcs[SP_AN][SM_N][SC_N][DP][CPU_C] = _op_copy_rel_pt_pan_dp;
111 op_copy_rel_pt_funcs[SP_AS][SM_N][SC_N][DP][CPU_C] = _op_copy_rel_pt_pas_dp;
112
113 op_copy_rel_pt_funcs[SP][SM_N][SC_N][DP_AN][CPU_C] = _op_copy_rel_pt_p_dpan;
114 op_copy_rel_pt_funcs[SP_AN][SM_N][SC_N][DP_AN][CPU_C] = _op_copy_rel_pt_pan_dpan;
115 op_copy_rel_pt_funcs[SP_AS][SM_N][SC_N][DP_AN][CPU_C] = _op_copy_rel_pt_pas_dpan;
116}
117#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_pixel_color_.c b/libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_pixel_color_.c
new file mode 100644
index 0000000..12b616d
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_pixel_color_.c
@@ -0,0 +1,236 @@
1/* copy pixel x color --> dst */
2
3#ifdef BUILD_C
4static void
5_op_copy_p_c_dp(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) {
6 DATA32 *e;
7 UNROLL8_PLD_WHILE(d, l, e,
8 {
9 *d = MUL4_SYM(c, *s);
10 d++;
11 s++;
12 });
13}
14
15static void
16_op_copy_p_caa_dp(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) {
17 DATA32 *e;
18 c = 1 + (c >> 24);
19 UNROLL8_PLD_WHILE(d, l, e,
20 {
21 *d = MUL_256(c, *s);
22 d++;
23 s++;
24 });
25}
26
27
28#define _op_copy_pas_c_dp _op_copy_p_c_dp
29#define _op_copy_pan_c_dp _op_copy_p_c_dp
30#define _op_copy_p_can_dp _op_copy_p_c_dp
31#define _op_copy_pas_can_dp _op_copy_p_can_dp
32#define _op_copy_pan_can_dp _op_copy_p_c_dp
33#define _op_copy_pas_caa_dp _op_copy_p_caa_dp
34#define _op_copy_pan_caa_dp _op_copy_p_caa_dp
35
36#define _op_copy_p_c_dpan _op_copy_p_c_dp
37#define _op_copy_pas_c_dpan _op_copy_pas_c_dp
38#define _op_copy_pan_c_dpan _op_copy_pan_c_dp
39#define _op_copy_p_can_dpan _op_copy_p_can_dp
40#define _op_copy_pas_can_dpan _op_copy_pas_can_dp
41#define _op_copy_pan_can_dpan _op_copy_pan_can_dp
42#define _op_copy_p_caa_dpan _op_copy_p_caa_dp
43#define _op_copy_pas_caa_dpan _op_copy_pas_caa_dp
44#define _op_copy_pan_caa_dpan _op_copy_pan_caa_dp
45
46static void
47init_copy_pixel_color_span_funcs_c(void)
48{
49 op_copy_span_funcs[SP][SM_N][SC][DP][CPU_C] = _op_copy_p_c_dp;
50 op_copy_span_funcs[SP_AS][SM_N][SC][DP][CPU_C] = _op_copy_pas_c_dp;
51 op_copy_span_funcs[SP_AN][SM_N][SC][DP][CPU_C] = _op_copy_pan_c_dp;
52 op_copy_span_funcs[SP][SM_N][SC_AN][DP][CPU_C] = _op_copy_p_can_dp;
53 op_copy_span_funcs[SP_AS][SM_N][SC_AN][DP][CPU_C] = _op_copy_pas_can_dp;
54 op_copy_span_funcs[SP_AN][SM_N][SC_AN][DP][CPU_C] = _op_copy_pan_can_dp;
55 op_copy_span_funcs[SP][SM_N][SC_AA][DP][CPU_C] = _op_copy_p_caa_dp;
56 op_copy_span_funcs[SP_AS][SM_N][SC_AA][DP][CPU_C] = _op_copy_pas_caa_dp;
57 op_copy_span_funcs[SP_AN][SM_N][SC_AA][DP][CPU_C] = _op_copy_pan_caa_dp;
58
59 op_copy_span_funcs[SP][SM_N][SC][DP_AN][CPU_C] = _op_copy_p_c_dpan;
60 op_copy_span_funcs[SP_AS][SM_N][SC][DP_AN][CPU_C] = _op_copy_pas_c_dpan;
61 op_copy_span_funcs[SP_AN][SM_N][SC][DP_AN][CPU_C] = _op_copy_pan_c_dpan;
62 op_copy_span_funcs[SP][SM_N][SC_AN][DP_AN][CPU_C] = _op_copy_p_can_dpan;
63 op_copy_span_funcs[SP_AS][SM_N][SC_AN][DP_AN][CPU_C] = _op_copy_pas_can_dpan;
64 op_copy_span_funcs[SP_AN][SM_N][SC_AN][DP_AN][CPU_C] = _op_copy_pan_can_dpan;
65 op_copy_span_funcs[SP][SM_N][SC_AA][DP_AN][CPU_C] = _op_copy_p_caa_dpan;
66 op_copy_span_funcs[SP_AS][SM_N][SC_AA][DP_AN][CPU_C] = _op_copy_pas_caa_dpan;
67 op_copy_span_funcs[SP_AN][SM_N][SC_AA][DP_AN][CPU_C] = _op_copy_pan_caa_dpan;
68}
69#endif
70
71#ifdef BUILD_C
72static void
73_op_copy_pt_p_c_dp(DATA32 s, DATA8 m __UNUSED__, DATA32 c, DATA32 *d) {
74 *d = MUL4_SYM(c, s);
75}
76
77static void
78_op_copy_pt_p_caa_dp(DATA32 s, DATA8 m __UNUSED__, DATA32 c, DATA32 *d) {
79 *d = MUL_SYM(c >> 24, s);
80}
81
82
83#define _op_copy_pt_p_can_dp _op_copy_pt_p_c_dp
84#define _op_copy_pt_pan_c_dp _op_copy_pt_p_c_dp
85#define _op_copy_pt_pan_can_dp _op_copy_pt_p_c_dp
86#define _op_copy_pt_pan_caa_dp _op_copy_pt_p_caa_dp
87#define _op_copy_pt_pas_c_dp _op_copy_pt_p_c_dp
88#define _op_copy_pt_pas_can_dp _op_copy_pt_p_can_dp
89#define _op_copy_pt_pas_caa_dp _op_copy_pt_p_caa_dp
90
91#define _op_copy_pt_p_c_dpan _op_copy_pt_p_c_dp
92#define _op_copy_pt_pas_c_dpan _op_copy_pt_pas_c_dp
93#define _op_copy_pt_pan_c_dpan _op_copy_pt_pan_c_dp
94#define _op_copy_pt_p_can_dpan _op_copy_pt_p_can_dp
95#define _op_copy_pt_pas_can_dpan _op_copy_pt_pas_can_dp
96#define _op_copy_pt_pan_can_dpan _op_copy_pt_pan_can_dp
97#define _op_copy_pt_p_caa_dpan _op_copy_pt_p_caa_dp
98#define _op_copy_pt_pas_caa_dpan _op_copy_pt_pas_caa_dp
99#define _op_copy_pt_pan_caa_dpan _op_copy_pt_pan_caa_dp
100
101static void
102init_copy_pixel_color_pt_funcs_c(void)
103{
104 op_copy_pt_funcs[SP][SM_N][SC][DP][CPU_C] = _op_copy_pt_p_c_dp;
105 op_copy_pt_funcs[SP_AS][SM_N][SC][DP][CPU_C] = _op_copy_pt_pas_c_dp;
106 op_copy_pt_funcs[SP_AN][SM_N][SC][DP][CPU_C] = _op_copy_pt_pan_c_dp;
107 op_copy_pt_funcs[SP][SM_N][SC_AN][DP][CPU_C] = _op_copy_pt_p_can_dp;
108 op_copy_pt_funcs[SP_AS][SM_N][SC_AN][DP][CPU_C] = _op_copy_pt_pas_can_dp;
109 op_copy_pt_funcs[SP_AN][SM_N][SC_AN][DP][CPU_C] = _op_copy_pt_pan_can_dp;
110 op_copy_pt_funcs[SP][SM_N][SC_AA][DP][CPU_C] = _op_copy_pt_p_caa_dp;
111 op_copy_pt_funcs[SP_AS][SM_N][SC_AA][DP][CPU_C] = _op_copy_pt_pas_caa_dp;
112 op_copy_pt_funcs[SP_AN][SM_N][SC_AA][DP][CPU_C] = _op_copy_pt_pan_caa_dp;
113
114 op_copy_pt_funcs[SP][SM_N][SC][DP_AN][CPU_C] = _op_copy_pt_p_c_dpan;
115 op_copy_pt_funcs[SP_AS][SM_N][SC][DP_AN][CPU_C] = _op_copy_pt_pas_c_dpan;
116 op_copy_pt_funcs[SP_AN][SM_N][SC][DP_AN][CPU_C] = _op_copy_pt_pan_c_dpan;
117 op_copy_pt_funcs[SP][SM_N][SC_AN][DP_AN][CPU_C] = _op_copy_pt_p_can_dpan;
118 op_copy_pt_funcs[SP_AS][SM_N][SC_AN][DP_AN][CPU_C] = _op_copy_pt_pas_can_dpan;
119 op_copy_pt_funcs[SP_AN][SM_N][SC_AN][DP_AN][CPU_C] = _op_copy_pt_pan_can_dpan;
120 op_copy_pt_funcs[SP][SM_N][SC_AA][DP_AN][CPU_C] = _op_copy_pt_p_caa_dpan;
121 op_copy_pt_funcs[SP_AS][SM_N][SC_AA][DP_AN][CPU_C] = _op_copy_pt_pas_caa_dpan;
122 op_copy_pt_funcs[SP_AN][SM_N][SC_AA][DP_AN][CPU_C] = _op_copy_pt_pan_caa_dpan;
123}
124#endif
125
126/*-----*/
127
128/* copy_rel pixel x color --> dst */
129
130#ifdef BUILD_C
131static void
132_op_copy_rel_p_c_dp(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) {
133 DATA32 *e;
134 UNROLL8_PLD_WHILE(d, l, e,
135 {
136 DATA32 cs = MUL4_SYM(c, *s);
137 *d = MUL_SYM(*d >> 24, cs);
138 d++;
139 s++;
140 });
141}
142
143#define _op_copy_rel_pas_c_dp _op_copy_rel_p_c_dp
144#define _op_copy_rel_pan_c_dp _op_copy_rel_p_c_dp
145#define _op_copy_rel_p_can_dp _op_copy_rel_p_c_dp
146#define _op_copy_rel_pas_can_dp _op_copy_rel_pas_c_dp
147#define _op_copy_rel_pan_can_dp _op_copy_rel_p_c_dp
148#define _op_copy_rel_p_caa_dp _op_copy_rel_p_c_dp
149#define _op_copy_rel_pas_caa_dp _op_copy_rel_p_c_dp
150#define _op_copy_rel_pan_caa_dp _op_copy_rel_p_c_dp
151
152#define _op_copy_rel_p_c_dpan _op_copy_p_c_dpan
153#define _op_copy_rel_pas_c_dpan _op_copy_pas_c_dpan
154#define _op_copy_rel_pan_c_dpan _op_copy_pan_c_dpan
155#define _op_copy_rel_p_can_dpan _op_copy_p_can_dpan
156#define _op_copy_rel_pas_can_dpan _op_copy_pas_can_dpan
157#define _op_copy_rel_pan_can_dpan _op_copy_pan_can_dpan
158#define _op_copy_rel_p_caa_dpan _op_copy_p_caa_dpan
159#define _op_copy_rel_pas_caa_dpan _op_copy_pas_caa_dpan
160#define _op_copy_rel_pan_caa_dpan _op_copy_pan_caa_dpan
161
162static void
163init_copy_rel_pixel_color_span_funcs_c(void)
164{
165 op_copy_rel_span_funcs[SP][SM_N][SC][DP][CPU_C] = _op_copy_rel_p_c_dp;
166 op_copy_rel_span_funcs[SP_AS][SM_N][SC][DP][CPU_C] = _op_copy_rel_pas_c_dp;
167 op_copy_rel_span_funcs[SP_AN][SM_N][SC][DP][CPU_C] = _op_copy_rel_pan_c_dp;
168 op_copy_rel_span_funcs[SP][SM_N][SC_AN][DP][CPU_C] = _op_copy_rel_p_can_dp;
169 op_copy_rel_span_funcs[SP_AS][SM_N][SC_AN][DP][CPU_C] = _op_copy_rel_pas_can_dp;
170 op_copy_rel_span_funcs[SP_AN][SM_N][SC_AN][DP][CPU_C] = _op_copy_rel_pan_can_dp;
171 op_copy_rel_span_funcs[SP][SM_N][SC_AA][DP][CPU_C] = _op_copy_rel_p_caa_dp;
172 op_copy_rel_span_funcs[SP_AS][SM_N][SC_AA][DP][CPU_C] = _op_copy_rel_pas_caa_dp;
173 op_copy_rel_span_funcs[SP_AN][SM_N][SC_AA][DP][CPU_C] = _op_copy_rel_pan_caa_dp;
174
175 op_copy_rel_span_funcs[SP][SM_N][SC][DP_AN][CPU_C] = _op_copy_rel_p_c_dpan;
176 op_copy_rel_span_funcs[SP_AS][SM_N][SC][DP_AN][CPU_C] = _op_copy_rel_pas_c_dpan;
177 op_copy_rel_span_funcs[SP_AN][SM_N][SC][DP_AN][CPU_C] = _op_copy_rel_pan_c_dpan;
178 op_copy_rel_span_funcs[SP][SM_N][SC_AN][DP_AN][CPU_C] = _op_copy_rel_p_can_dpan;
179 op_copy_rel_span_funcs[SP_AS][SM_N][SC_AN][DP_AN][CPU_C] = _op_copy_rel_pas_can_dpan;
180 op_copy_rel_span_funcs[SP_AN][SM_N][SC_AN][DP_AN][CPU_C] = _op_copy_rel_pan_can_dpan;
181 op_copy_rel_span_funcs[SP][SM_N][SC_AA][DP_AN][CPU_C] = _op_copy_rel_p_caa_dpan;
182 op_copy_rel_span_funcs[SP_AS][SM_N][SC_AA][DP_AN][CPU_C] = _op_copy_rel_pas_caa_dpan;
183 op_copy_rel_span_funcs[SP_AN][SM_N][SC_AA][DP_AN][CPU_C] = _op_copy_rel_pan_caa_dpan;
184}
185#endif
186
187#ifdef BUILD_C
188static void
189_op_copy_rel_pt_p_c_dp(DATA32 s, DATA8 m __UNUSED__, DATA32 c, DATA32 *d) {
190 s = MUL4_SYM(c, s);
191 *d = MUL_SYM(*d >> 24, s);
192}
193
194#define _op_copy_rel_pt_pas_c_dp _op_copy_rel_pt_p_c_dp
195#define _op_copy_rel_pt_pan_c_dp _op_copy_rel_pt_p_c_dp
196#define _op_copy_rel_pt_p_can_dp _op_copy_rel_pt_p_c_dp
197#define _op_copy_rel_pt_pas_can_dp _op_copy_rel_pt_p_can_dp
198#define _op_copy_rel_pt_pan_can_dp _op_copy_rel_pt_p_c_dp
199#define _op_copy_rel_pt_p_caa_dp _op_copy_rel_pt_p_c_dp
200#define _op_copy_rel_pt_pas_caa_dp _op_copy_rel_pt_p_caa_dp
201#define _op_copy_rel_pt_pan_caa_dp _op_copy_rel_pt_p_caa_dp
202
203#define _op_copy_rel_pt_p_c_dpan _op_copy_pt_p_c_dpan
204#define _op_copy_rel_pt_pas_c_dpan _op_copy_pt_pas_c_dpan
205#define _op_copy_rel_pt_pan_c_dpan _op_copy_pt_pan_c_dpan
206#define _op_copy_rel_pt_p_can_dpan _op_copy_pt_p_can_dpan
207#define _op_copy_rel_pt_pas_can_dpan _op_copy_pt_pas_can_dpan
208#define _op_copy_rel_pt_pan_can_dpan _op_copy_pt_pan_can_dpan
209#define _op_copy_rel_pt_p_caa_dpan _op_copy_pt_p_caa_dpan
210#define _op_copy_rel_pt_pas_caa_dpan _op_copy_pt_pas_caa_dpan
211#define _op_copy_rel_pt_pan_caa_dpan _op_copy_pt_pan_caa_dpan
212
213static void
214init_copy_rel_pixel_color_pt_funcs_c(void)
215{
216 op_copy_rel_pt_funcs[SP][SM_N][SC][DP][CPU_C] = _op_copy_rel_pt_p_c_dp;
217 op_copy_rel_pt_funcs[SP_AS][SM_N][SC][DP][CPU_C] = _op_copy_rel_pt_pas_c_dp;
218 op_copy_rel_pt_funcs[SP_AN][SM_N][SC][DP][CPU_C] = _op_copy_rel_pt_pan_c_dp;
219 op_copy_rel_pt_funcs[SP][SM_N][SC_AN][DP][CPU_C] = _op_copy_rel_pt_p_can_dp;
220 op_copy_rel_pt_funcs[SP_AS][SM_N][SC_AN][DP][CPU_C] = _op_copy_rel_pt_pas_can_dp;
221 op_copy_rel_pt_funcs[SP_AN][SM_N][SC_AN][DP][CPU_C] = _op_copy_rel_pt_pan_can_dp;
222 op_copy_rel_pt_funcs[SP][SM_N][SC_AA][DP][CPU_C] = _op_copy_rel_pt_p_caa_dp;
223 op_copy_rel_pt_funcs[SP_AS][SM_N][SC_AA][DP][CPU_C] = _op_copy_rel_pt_pas_caa_dp;
224 op_copy_rel_pt_funcs[SP_AN][SM_N][SC_AA][DP][CPU_C] = _op_copy_rel_pt_pan_caa_dp;
225
226 op_copy_rel_pt_funcs[SP][SM_N][SC][DP_AN][CPU_C] = _op_copy_rel_pt_p_c_dpan;
227 op_copy_rel_pt_funcs[SP_AS][SM_N][SC][DP_AN][CPU_C] = _op_copy_rel_pt_pas_c_dpan;
228 op_copy_rel_pt_funcs[SP_AN][SM_N][SC][DP_AN][CPU_C] = _op_copy_rel_pt_pan_c_dpan;
229 op_copy_rel_pt_funcs[SP][SM_N][SC_AN][DP_AN][CPU_C] = _op_copy_rel_pt_p_can_dpan;
230 op_copy_rel_pt_funcs[SP_AS][SM_N][SC_AN][DP_AN][CPU_C] = _op_copy_rel_pt_pas_can_dpan;
231 op_copy_rel_pt_funcs[SP_AN][SM_N][SC_AN][DP_AN][CPU_C] = _op_copy_rel_pt_pan_can_dpan;
232 op_copy_rel_pt_funcs[SP][SM_N][SC_AA][DP_AN][CPU_C] = _op_copy_rel_pt_p_caa_dpan;
233 op_copy_rel_pt_funcs[SP_AS][SM_N][SC_AA][DP_AN][CPU_C] = _op_copy_rel_pt_pas_caa_dpan;
234 op_copy_rel_pt_funcs[SP_AN][SM_N][SC_AA][DP_AN][CPU_C] = _op_copy_rel_pt_pan_caa_dpan;
235}
236#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_pixel_color_i386.c b/libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_pixel_color_i386.c
new file mode 100644
index 0000000..fb5bc70
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_pixel_color_i386.c
@@ -0,0 +1,255 @@
1/* copy pixel x color --> dst */
2
3#ifdef BUILD_MMX
4static void
5_op_copy_p_c_dp_mmx(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) {
6 DATA32 *e = d + l;
7 pxor_r2r(mm0, mm0);
8 MOV_P2R(c, mm3, mm0)
9 MOV_A2R(ALPHA_255, mm5)
10 while (d < e) {
11 MOV_P2R(*s, mm2, mm0)
12 MUL4_SYM_R2R(mm3, mm2, mm5);
13 MOV_R2P(mm2, *d, mm0)
14 s++; d++;
15 }
16}
17
18
19static void
20_op_copy_p_caa_dp_mmx(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) {
21 DATA32 *e = d + l;
22 c = 1 + (c >> 24);
23 MOV_A2R(c, mm3)
24 pxor_r2r(mm0, mm0);
25 while (d < e) {
26 MOV_P2R(*s, mm2, mm0)
27 MUL4_256_R2R(mm3, mm2);
28 MOV_R2P(mm2, *d, mm0)
29 s++; d++;
30 }
31}
32
33
34#define _op_copy_pas_c_dp_mmx _op_copy_p_c_dp_mmx
35#define _op_copy_pan_c_dp_mmx _op_copy_p_c_dp_mmx
36#define _op_copy_p_can_dp_mmx _op_copy_p_c_dp_mmx
37#define _op_copy_pas_can_dp_mmx _op_copy_pas_c_dp_mmx
38#define _op_copy_pan_can_dp_mmx _op_copy_pan_c_dp_mmx
39#define _op_copy_pas_caa_dp_mmx _op_copy_p_caa_dp_mmx
40#define _op_copy_pan_caa_dp_mmx _op_copy_p_caa_dp_mmx
41
42#define _op_copy_p_c_dpan_mmx _op_copy_p_c_dp_mmx
43#define _op_copy_pas_c_dpan_mmx _op_copy_pas_c_dp_mmx
44#define _op_copy_pan_c_dpan_mmx _op_copy_pan_c_dp_mmx
45#define _op_copy_p_can_dpan_mmx _op_copy_p_can_dp_mmx
46#define _op_copy_pas_can_dpan_mmx _op_copy_pas_can_dp_mmx
47#define _op_copy_pan_can_dpan_mmx _op_copy_pan_can_dp_mmx
48#define _op_copy_p_caa_dpan_mmx _op_copy_p_caa_dp_mmx
49#define _op_copy_pas_caa_dpan_mmx _op_copy_pas_caa_dp_mmx
50#define _op_copy_pan_caa_dpan_mmx _op_copy_pan_caa_dp_mmx
51
52static void
53init_copy_pixel_color_span_funcs_mmx(void)
54{
55 op_copy_span_funcs[SP][SM_N][SC][DP][CPU_MMX] = _op_copy_p_c_dp_mmx;
56 op_copy_span_funcs[SP_AS][SM_N][SC][DP][CPU_MMX] = _op_copy_pas_c_dp_mmx;
57 op_copy_span_funcs[SP_AN][SM_N][SC][DP][CPU_MMX] = _op_copy_pan_c_dp_mmx;
58 op_copy_span_funcs[SP][SM_N][SC_AN][DP][CPU_MMX] = _op_copy_p_can_dp_mmx;
59 op_copy_span_funcs[SP_AS][SM_N][SC_AN][DP][CPU_MMX] = _op_copy_pas_can_dp_mmx;
60 op_copy_span_funcs[SP_AN][SM_N][SC_AN][DP][CPU_MMX] = _op_copy_pan_can_dp_mmx;
61 op_copy_span_funcs[SP][SM_N][SC_AA][DP][CPU_MMX] = _op_copy_p_caa_dp_mmx;
62 op_copy_span_funcs[SP_AS][SM_N][SC_AA][DP][CPU_MMX] = _op_copy_pas_caa_dp_mmx;
63 op_copy_span_funcs[SP_AN][SM_N][SC_AA][DP][CPU_MMX] = _op_copy_pan_caa_dp_mmx;
64
65 op_copy_span_funcs[SP][SM_N][SC][DP_AN][CPU_MMX] = _op_copy_p_c_dpan_mmx;
66 op_copy_span_funcs[SP_AS][SM_N][SC][DP_AN][CPU_MMX] = _op_copy_pas_c_dpan_mmx;
67 op_copy_span_funcs[SP_AN][SM_N][SC][DP_AN][CPU_MMX] = _op_copy_pan_c_dpan_mmx;
68 op_copy_span_funcs[SP][SM_N][SC_AN][DP_AN][CPU_MMX] = _op_copy_p_can_dpan_mmx;
69 op_copy_span_funcs[SP_AS][SM_N][SC_AN][DP_AN][CPU_MMX] = _op_copy_pas_can_dpan_mmx;
70 op_copy_span_funcs[SP_AN][SM_N][SC_AN][DP_AN][CPU_MMX] = _op_copy_pan_can_dpan_mmx;
71 op_copy_span_funcs[SP][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_copy_p_caa_dpan_mmx;
72 op_copy_span_funcs[SP_AS][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_copy_pas_caa_dpan_mmx;
73 op_copy_span_funcs[SP_AN][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_copy_pan_caa_dpan_mmx;
74}
75#endif
76
77#ifdef BUILD_MMX
78static void
79_op_copy_pt_p_c_dp_mmx(DATA32 s, DATA8 m __UNUSED__, DATA32 c, DATA32 *d) {
80 pxor_r2r(mm0, mm0);
81 MOV_A2R(ALPHA_255, mm5)
82 MOV_P2R(c, mm2, mm0)
83 MOV_P2R(s, mm2, mm0)
84 MUL4_SYM_R2R(mm3, mm2, mm5);
85 MOV_R2P(mm2, *d, mm0)
86}
87
88#define _op_copy_pt_pas_c_dp_mmx _op_copy_pt_p_c_dp_mmx
89#define _op_copy_pt_pan_c_dp_mmx _op_copy_pt_p_c_dp_mmx
90#define _op_copy_pt_p_can_dp_mmx _op_copy_pt_p_c_dp_mmx
91#define _op_copy_pt_pas_can_dp_mmx _op_copy_pt_p_c_dp_mmx
92#define _op_copy_pt_pan_can_dp_mmx _op_copy_pt_p_c_dp_mmx
93#define _op_copy_pt_p_caa_dp_mmx _op_copy_pt_p_c_dp_mmx
94#define _op_copy_pt_pas_caa_dp_mmx _op_copy_pt_p_c_dp_mmx
95#define _op_copy_pt_pan_caa_dp_mmx _op_copy_pt_p_c_dp_mmx
96
97#define _op_copy_pt_p_c_dpan_mmx _op_copy_pt_p_c_dp_mmx
98#define _op_copy_pt_pas_c_dpan_mmx _op_copy_pt_pas_c_dp_mmx
99#define _op_copy_pt_pan_c_dpan_mmx _op_copy_pt_pan_c_dp_mmx
100#define _op_copy_pt_p_can_dpan_mmx _op_copy_pt_p_can_dp_mmx
101#define _op_copy_pt_pas_can_dpan_mmx _op_copy_pt_pas_can_dp_mmx
102#define _op_copy_pt_pan_can_dpan_mmx _op_copy_pt_pan_can_dp_mmx
103#define _op_copy_pt_p_caa_dpan_mmx _op_copy_pt_p_caa_dp_mmx
104#define _op_copy_pt_pas_caa_dpan_mmx _op_copy_pt_pas_caa_dp_mmx
105#define _op_copy_pt_pan_caa_dpan_mmx _op_copy_pt_pan_caa_dp_mmx
106
107static void
108init_copy_pixel_color_pt_funcs_mmx(void)
109{
110 op_copy_pt_funcs[SP][SM_N][SC][DP][CPU_MMX] = _op_copy_pt_p_c_dp_mmx;
111 op_copy_pt_funcs[SP_AS][SM_N][SC][DP][CPU_MMX] = _op_copy_pt_pas_c_dp_mmx;
112 op_copy_pt_funcs[SP_AN][SM_N][SC][DP][CPU_MMX] = _op_copy_pt_pan_c_dp_mmx;
113 op_copy_pt_funcs[SP][SM_N][SC_AN][DP][CPU_MMX] = _op_copy_pt_p_can_dp_mmx;
114 op_copy_pt_funcs[SP_AS][SM_N][SC_AN][DP][CPU_MMX] = _op_copy_pt_pas_can_dp_mmx;
115 op_copy_pt_funcs[SP_AN][SM_N][SC_AN][DP][CPU_MMX] = _op_copy_pt_pan_can_dp_mmx;
116 op_copy_pt_funcs[SP][SM_N][SC_AA][DP][CPU_MMX] = _op_copy_pt_p_caa_dp_mmx;
117 op_copy_pt_funcs[SP_AS][SM_N][SC_AA][DP][CPU_MMX] = _op_copy_pt_pas_caa_dp_mmx;
118 op_copy_pt_funcs[SP_AN][SM_N][SC_AA][DP][CPU_MMX] = _op_copy_pt_pan_caa_dp_mmx;
119
120 op_copy_pt_funcs[SP][SM_N][SC][DP_AN][CPU_MMX] = _op_copy_pt_p_c_dpan_mmx;
121 op_copy_pt_funcs[SP_AS][SM_N][SC][DP_AN][CPU_MMX] = _op_copy_pt_pas_c_dpan_mmx;
122 op_copy_pt_funcs[SP_AN][SM_N][SC][DP_AN][CPU_MMX] = _op_copy_pt_pan_c_dpan_mmx;
123 op_copy_pt_funcs[SP][SM_N][SC_AN][DP_AN][CPU_MMX] = _op_copy_pt_p_can_dpan_mmx;
124 op_copy_pt_funcs[SP_AS][SM_N][SC_AN][DP_AN][CPU_MMX] = _op_copy_pt_pas_can_dpan_mmx;
125 op_copy_pt_funcs[SP_AN][SM_N][SC_AN][DP_AN][CPU_MMX] = _op_copy_pt_pan_can_dpan_mmx;
126 op_copy_pt_funcs[SP][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_copy_pt_p_caa_dpan_mmx;
127 op_copy_pt_funcs[SP_AS][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_copy_pt_pas_caa_dpan_mmx;
128 op_copy_pt_funcs[SP_AN][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_copy_pt_pan_caa_dpan_mmx;
129}
130#endif
131
132/*-----*/
133
134/* copy_rel pixel x color --> dst */
135
136#ifdef BUILD_MMX
137static void
138_op_copy_rel_p_c_dp_mmx(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) {
139 DATA32 *e = d + l;
140 pxor_r2r(mm0, mm0);
141 MOV_P2R(c, mm3, mm0)
142 MOV_A2R(ALPHA_255, mm5)
143 while (d < e) {
144 MOV_PA2R(*d, mm1)
145 MOV_P2R(*s, mm2, mm0)
146 MUL4_SYM_R2R(mm3, mm2, mm5);
147 MUL4_SYM_R2R(mm2, mm1, mm5);
148 MOV_R2P(mm1, *d, mm0)
149 s++; d++;
150 }
151}
152
153
154#define _op_copy_rel_pas_c_dp_mmx _op_copy_rel_p_c_dp_mmx
155#define _op_copy_rel_pan_c_dp_mmx _op_copy_rel_p_c_dp_mmx
156#define _op_copy_rel_p_can_dp_mmx _op_copy_rel_p_c_dp_mmx
157#define _op_copy_rel_pas_can_dp_mmx _op_copy_rel_p_c_dp_mmx
158#define _op_copy_rel_pan_can_dp_mmx _op_copy_rel_p_c_dp_mmx
159#define _op_copy_rel_p_caa_dp_mmx _op_copy_rel_p_c_dp_mmx
160#define _op_copy_rel_pas_caa_dp_mmx _op_copy_rel_p_c_dp_mmx
161#define _op_copy_rel_pan_caa_dp_mmx _op_copy_rel_p_c_dp_mmx
162
163#define _op_copy_rel_p_c_dpan_mmx _op_copy_p_c_dpan_mmx
164#define _op_copy_rel_pas_c_dpan_mmx _op_copy_pas_c_dpan_mmx
165#define _op_copy_rel_pan_c_dpan_mmx _op_copy_pan_c_dpan_mmx
166#define _op_copy_rel_p_can_dpan_mmx _op_copy_p_can_dpan_mmx
167#define _op_copy_rel_pas_can_dpan_mmx _op_copy_pas_can_dpan_mmx
168#define _op_copy_rel_pan_can_dpan_mmx _op_copy_pan_can_dpan_mmx
169#define _op_copy_rel_p_caa_dpan_mmx _op_copy_p_caa_dpan_mmx
170#define _op_copy_rel_pas_caa_dpan_mmx _op_copy_pas_caa_dpan_mmx
171#define _op_copy_rel_pan_caa_dpan_mmx _op_copy_pan_caa_dpan_mmx
172
173static void
174init_copy_rel_pixel_color_span_funcs_mmx(void)
175{
176 op_copy_rel_span_funcs[SP][SM_N][SC][DP][CPU_MMX] = _op_copy_rel_p_c_dp_mmx;
177 op_copy_rel_span_funcs[SP_AS][SM_N][SC][DP][CPU_MMX] = _op_copy_rel_pas_c_dp_mmx;
178 op_copy_rel_span_funcs[SP_AN][SM_N][SC][DP][CPU_MMX] = _op_copy_rel_pan_c_dp_mmx;
179 op_copy_rel_span_funcs[SP][SM_N][SC_AN][DP][CPU_MMX] = _op_copy_rel_p_can_dp_mmx;
180 op_copy_rel_span_funcs[SP_AS][SM_N][SC_AN][DP][CPU_MMX] = _op_copy_rel_pas_can_dp_mmx;
181 op_copy_rel_span_funcs[SP_AN][SM_N][SC_AN][DP][CPU_MMX] = _op_copy_rel_pan_can_dp_mmx;
182 op_copy_rel_span_funcs[SP][SM_N][SC_AA][DP][CPU_MMX] = _op_copy_rel_p_caa_dp_mmx;
183 op_copy_rel_span_funcs[SP_AS][SM_N][SC_AA][DP][CPU_MMX] = _op_copy_rel_pas_caa_dp_mmx;
184 op_copy_rel_span_funcs[SP_AN][SM_N][SC_AA][DP][CPU_MMX] = _op_copy_rel_pan_caa_dp_mmx;
185
186 op_copy_rel_span_funcs[SP][SM_N][SC][DP_AN][CPU_MMX] = _op_copy_rel_p_c_dpan_mmx;
187 op_copy_rel_span_funcs[SP_AS][SM_N][SC][DP_AN][CPU_MMX] = _op_copy_rel_pas_c_dpan_mmx;
188 op_copy_rel_span_funcs[SP_AN][SM_N][SC][DP_AN][CPU_MMX] = _op_copy_rel_pan_c_dpan_mmx;
189 op_copy_rel_span_funcs[SP][SM_N][SC_AN][DP_AN][CPU_MMX] = _op_copy_rel_p_can_dpan_mmx;
190 op_copy_rel_span_funcs[SP_AS][SM_N][SC_AN][DP_AN][CPU_MMX] = _op_copy_rel_pas_can_dpan_mmx;
191 op_copy_rel_span_funcs[SP_AN][SM_N][SC_AN][DP_AN][CPU_MMX] = _op_copy_rel_pan_can_dpan_mmx;
192 op_copy_rel_span_funcs[SP][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_copy_rel_p_caa_dpan_mmx;
193 op_copy_rel_span_funcs[SP_AS][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_copy_rel_pas_caa_dpan_mmx;
194 op_copy_rel_span_funcs[SP_AN][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_copy_rel_pan_caa_dpan_mmx;
195}
196#endif
197
198#ifdef BUILD_MMX
199static void
200_op_copy_rel_pt_p_c_dp_mmx(DATA32 s, DATA8 m __UNUSED__, DATA32 c, DATA32 *d) {
201 pxor_r2r(mm0, mm0);
202 MOV_P2R(c, mm3, mm0)
203 MOV_A2R(ALPHA_255, mm5)
204 MOV_PA2R(*d, mm1)
205 MOV_P2R(s, mm2, mm0)
206 MUL4_SYM_R2R(mm3, mm2, mm5);
207 MUL4_SYM_R2R(mm2, mm1, mm5);
208 MOV_R2P(mm1, *d, mm0)
209}
210
211
212#define _op_copy_rel_pt_pas_c_dp_mmx _op_copy_rel_pt_p_c_dp_mmx
213#define _op_copy_rel_pt_pan_c_dp_mmx _op_copy_rel_pt_p_c_dp_mmx
214#define _op_copy_rel_pt_p_can_dp_mmx _op_copy_rel_pt_p_c_dp_mmx
215#define _op_copy_rel_pt_pas_can_dp_mmx _op_copy_rel_pt_p_c_dp_mmx
216#define _op_copy_rel_pt_pan_can_dp_mmx _op_copy_rel_pt_p_c_dp_mmx
217#define _op_copy_rel_pt_p_caa_dp_mmx _op_copy_rel_pt_p_c_dp_mmx
218#define _op_copy_rel_pt_pas_caa_dp_mmx _op_copy_rel_pt_p_c_dp_mmx
219#define _op_copy_rel_pt_pan_caa_dp_mmx _op_copy_rel_pt_p_c_dp_mmx
220
221#define _op_copy_rel_pt_p_c_dpan_mmx _op_copy_pt_p_c_dpan_mmx
222#define _op_copy_rel_pt_pas_c_dpan_mmx _op_copy_pt_pas_c_dpan_mmx
223#define _op_copy_rel_pt_pan_c_dpan_mmx _op_copy_pt_pan_c_dpan_mmx
224#define _op_copy_rel_pt_p_can_dpan_mmx _op_copy_pt_p_can_dpan_mmx
225#define _op_copy_rel_pt_pas_can_dpan_mmx _op_copy_pt_pas_can_dpan_mmx
226#define _op_copy_rel_pt_pan_can_dpan_mmx _op_copy_pt_pan_can_dpan_mmx
227#define _op_copy_rel_pt_p_caa_dpan_mmx _op_copy_pt_p_caa_dpan_mmx
228#define _op_copy_rel_pt_pas_caa_dpan_mmx _op_copy_pt_pas_caa_dpan_mmx
229#define _op_copy_rel_pt_pan_caa_dpan_mmx _op_copy_pt_pan_caa_dpan_mmx
230
231
232static void
233init_copy_rel_pixel_color_pt_funcs_mmx(void)
234{
235 op_copy_rel_pt_funcs[SP][SM_N][SC][DP][CPU_MMX] = _op_copy_rel_pt_p_c_dp_mmx;
236 op_copy_rel_pt_funcs[SP_AS][SM_N][SC][DP][CPU_MMX] = _op_copy_rel_pt_pas_c_dp_mmx;
237 op_copy_rel_pt_funcs[SP_AN][SM_N][SC][DP][CPU_MMX] = _op_copy_rel_pt_pan_c_dp_mmx;
238 op_copy_rel_pt_funcs[SP][SM_N][SC_AN][DP][CPU_MMX] = _op_copy_rel_pt_p_can_dp_mmx;
239 op_copy_rel_pt_funcs[SP_AS][SM_N][SC_AN][DP][CPU_MMX] = _op_copy_rel_pt_pas_can_dp_mmx;
240 op_copy_rel_pt_funcs[SP_AN][SM_N][SC_AN][DP][CPU_MMX] = _op_copy_rel_pt_pan_can_dp_mmx;
241 op_copy_rel_pt_funcs[SP][SM_N][SC_AA][DP][CPU_MMX] = _op_copy_rel_pt_p_caa_dp_mmx;
242 op_copy_rel_pt_funcs[SP_AS][SM_N][SC_AA][DP][CPU_MMX] = _op_copy_rel_pt_pas_caa_dp_mmx;
243 op_copy_rel_pt_funcs[SP_AN][SM_N][SC_AA][DP][CPU_MMX] = _op_copy_rel_pt_pan_caa_dp_mmx;
244
245 op_copy_rel_pt_funcs[SP][SM_N][SC][DP_AN][CPU_MMX] = _op_copy_rel_pt_p_c_dpan_mmx;
246 op_copy_rel_pt_funcs[SP_AS][SM_N][SC][DP_AN][CPU_MMX] = _op_copy_rel_pt_pas_c_dpan_mmx;
247 op_copy_rel_pt_funcs[SP_AN][SM_N][SC][DP_AN][CPU_MMX] = _op_copy_rel_pt_pan_c_dpan_mmx;
248 op_copy_rel_pt_funcs[SP][SM_N][SC_AN][DP_AN][CPU_MMX] = _op_copy_rel_pt_p_can_dpan_mmx;
249 op_copy_rel_pt_funcs[SP_AS][SM_N][SC_AN][DP_AN][CPU_MMX] = _op_copy_rel_pt_pas_can_dpan_mmx;
250 op_copy_rel_pt_funcs[SP_AN][SM_N][SC_AN][DP_AN][CPU_MMX] = _op_copy_rel_pt_pan_can_dpan_mmx;
251 op_copy_rel_pt_funcs[SP][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_copy_rel_pt_p_caa_dpan_mmx;
252 op_copy_rel_pt_funcs[SP_AS][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_copy_rel_pt_pas_caa_dpan_mmx;
253 op_copy_rel_pt_funcs[SP_AN][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_copy_rel_pt_pan_caa_dpan_mmx;
254}
255#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_pixel_color_neon.c b/libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_pixel_color_neon.c
new file mode 100644
index 0000000..f8a1e79
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_pixel_color_neon.c
@@ -0,0 +1,238 @@
1/* copy pixel x color --> dst */
2
3#ifdef BUILD_NEON
4static void
5_op_copy_p_c_dp_neon(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) {
6 // FIXME: neon-it
7 DATA32 *e;
8 UNROLL8_PLD_WHILE(d, l, e,
9 {
10 *d = MUL4_SYM(c, *s);
11 d++;
12 s++;
13 });
14}
15
16
17static void
18_op_copy_p_caa_dp_neon(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) { // FIXME: neon-it
19 // FIXME: neon-it
20 DATA32 *e;
21 c = 1 + (c >> 24);
22 UNROLL8_PLD_WHILE(d, l, e,
23 {
24 *d = MUL_256(c, *s);
25 d++;
26 s++;
27 });
28}
29
30
31#define _op_copy_pas_c_dp_neon _op_copy_p_c_dp_neon
32#define _op_copy_pan_c_dp_neon _op_copy_p_c_dp_neon
33#define _op_copy_p_can_dp_neon _op_copy_p_c_dp_neon
34#define _op_copy_pas_can_dp_neon _op_copy_pas_c_dp_neon
35#define _op_copy_pan_can_dp_neon _op_copy_pan_c_dp_neon
36#define _op_copy_pas_caa_dp_neon _op_copy_p_caa_dp_neon
37#define _op_copy_pan_caa_dp_neon _op_copy_p_caa_dp_neon
38
39#define _op_copy_p_c_dpan_neon _op_copy_p_c_dp_neon
40#define _op_copy_pas_c_dpan_neon _op_copy_pas_c_dp_neon
41#define _op_copy_pan_c_dpan_neon _op_copy_pan_c_dp_neon
42#define _op_copy_p_can_dpan_neon _op_copy_p_can_dp_neon
43#define _op_copy_pas_can_dpan_neon _op_copy_pas_can_dp_neon
44#define _op_copy_pan_can_dpan_neon _op_copy_pan_can_dp_neon
45#define _op_copy_p_caa_dpan_neon _op_copy_p_caa_dp_neon
46#define _op_copy_pas_caa_dpan_neon _op_copy_pas_caa_dp_neon
47#define _op_copy_pan_caa_dpan_neon _op_copy_pan_caa_dp_neon
48
49static void
50init_copy_pixel_color_span_funcs_neon(void)
51{
52 op_copy_span_funcs[SP][SM_N][SC][DP][CPU_NEON] = _op_copy_p_c_dp_neon;
53 op_copy_span_funcs[SP_AS][SM_N][SC][DP][CPU_NEON] = _op_copy_pas_c_dp_neon;
54 op_copy_span_funcs[SP_AN][SM_N][SC][DP][CPU_NEON] = _op_copy_pan_c_dp_neon;
55 op_copy_span_funcs[SP][SM_N][SC_AN][DP][CPU_NEON] = _op_copy_p_can_dp_neon;
56 op_copy_span_funcs[SP_AS][SM_N][SC_AN][DP][CPU_NEON] = _op_copy_pas_can_dp_neon;
57 op_copy_span_funcs[SP_AN][SM_N][SC_AN][DP][CPU_NEON] = _op_copy_pan_can_dp_neon;
58 op_copy_span_funcs[SP][SM_N][SC_AA][DP][CPU_NEON] = _op_copy_p_caa_dp_neon;
59 op_copy_span_funcs[SP_AS][SM_N][SC_AA][DP][CPU_NEON] = _op_copy_pas_caa_dp_neon;
60 op_copy_span_funcs[SP_AN][SM_N][SC_AA][DP][CPU_NEON] = _op_copy_pan_caa_dp_neon;
61
62 op_copy_span_funcs[SP][SM_N][SC][DP_AN][CPU_NEON] = _op_copy_p_c_dpan_neon;
63 op_copy_span_funcs[SP_AS][SM_N][SC][DP_AN][CPU_NEON] = _op_copy_pas_c_dpan_neon;
64 op_copy_span_funcs[SP_AN][SM_N][SC][DP_AN][CPU_NEON] = _op_copy_pan_c_dpan_neon;
65 op_copy_span_funcs[SP][SM_N][SC_AN][DP_AN][CPU_NEON] = _op_copy_p_can_dpan_neon;
66 op_copy_span_funcs[SP_AS][SM_N][SC_AN][DP_AN][CPU_NEON] = _op_copy_pas_can_dpan_neon;
67 op_copy_span_funcs[SP_AN][SM_N][SC_AN][DP_AN][CPU_NEON] = _op_copy_pan_can_dpan_neon;
68 op_copy_span_funcs[SP][SM_N][SC_AA][DP_AN][CPU_NEON] = _op_copy_p_caa_dpan_neon;
69 op_copy_span_funcs[SP_AS][SM_N][SC_AA][DP_AN][CPU_NEON] = _op_copy_pas_caa_dpan_neon;
70 op_copy_span_funcs[SP_AN][SM_N][SC_AA][DP_AN][CPU_NEON] = _op_copy_pan_caa_dpan_neon;
71}
72#endif
73
74#ifdef BUILD_NEON
75static void
76_op_copy_pt_p_c_dp_neon(DATA32 s, DATA8 m __UNUSED__, DATA32 c, DATA32 *d) {
77 *d = MUL4_SYM(c, s);
78}
79
80#define _op_copy_pt_pas_c_dp_neon _op_copy_pt_p_c_dp_neon
81#define _op_copy_pt_pan_c_dp_neon _op_copy_pt_p_c_dp_neon
82#define _op_copy_pt_p_can_dp_neon _op_copy_pt_p_c_dp_neon
83#define _op_copy_pt_pas_can_dp_neon _op_copy_pt_p_c_dp_neon
84#define _op_copy_pt_pan_can_dp_neon _op_copy_pt_p_c_dp_neon
85#define _op_copy_pt_p_caa_dp_neon _op_copy_pt_p_c_dp_neon
86#define _op_copy_pt_pas_caa_dp_neon _op_copy_pt_p_c_dp_neon
87#define _op_copy_pt_pan_caa_dp_neon _op_copy_pt_p_c_dp_neon
88
89#define _op_copy_pt_p_c_dpan_neon _op_copy_pt_p_c_dp_neon
90#define _op_copy_pt_pas_c_dpan_neon _op_copy_pt_pas_c_dp_neon
91#define _op_copy_pt_pan_c_dpan_neon _op_copy_pt_pan_c_dp_neon
92#define _op_copy_pt_p_can_dpan_neon _op_copy_pt_p_can_dp_neon
93#define _op_copy_pt_pas_can_dpan_neon _op_copy_pt_pas_can_dp_neon
94#define _op_copy_pt_pan_can_dpan_neon _op_copy_pt_pan_can_dp_neon
95#define _op_copy_pt_p_caa_dpan_neon _op_copy_pt_p_caa_dp_neon
96#define _op_copy_pt_pas_caa_dpan_neon _op_copy_pt_pas_caa_dp_neon
97#define _op_copy_pt_pan_caa_dpan_neon _op_copy_pt_pan_caa_dp_neon
98
99static void
100init_copy_pixel_color_pt_funcs_neon(void)
101{
102 op_copy_pt_funcs[SP][SM_N][SC][DP][CPU_NEON] = _op_copy_pt_p_c_dp_neon;
103 op_copy_pt_funcs[SP_AS][SM_N][SC][DP][CPU_NEON] = _op_copy_pt_pas_c_dp_neon;
104 op_copy_pt_funcs[SP_AN][SM_N][SC][DP][CPU_NEON] = _op_copy_pt_pan_c_dp_neon;
105 op_copy_pt_funcs[SP][SM_N][SC_AN][DP][CPU_NEON] = _op_copy_pt_p_can_dp_neon;
106 op_copy_pt_funcs[SP_AS][SM_N][SC_AN][DP][CPU_NEON] = _op_copy_pt_pas_can_dp_neon;
107 op_copy_pt_funcs[SP_AN][SM_N][SC_AN][DP][CPU_NEON] = _op_copy_pt_pan_can_dp_neon;
108 op_copy_pt_funcs[SP][SM_N][SC_AA][DP][CPU_NEON] = _op_copy_pt_p_caa_dp_neon;
109 op_copy_pt_funcs[SP_AS][SM_N][SC_AA][DP][CPU_NEON] = _op_copy_pt_pas_caa_dp_neon;
110 op_copy_pt_funcs[SP_AN][SM_N][SC_AA][DP][CPU_NEON] = _op_copy_pt_pan_caa_dp_neon;
111
112 op_copy_pt_funcs[SP][SM_N][SC][DP_AN][CPU_NEON] = _op_copy_pt_p_c_dpan_neon;
113 op_copy_pt_funcs[SP_AS][SM_N][SC][DP_AN][CPU_NEON] = _op_copy_pt_pas_c_dpan_neon;
114 op_copy_pt_funcs[SP_AN][SM_N][SC][DP_AN][CPU_NEON] = _op_copy_pt_pan_c_dpan_neon;
115 op_copy_pt_funcs[SP][SM_N][SC_AN][DP_AN][CPU_NEON] = _op_copy_pt_p_can_dpan_neon;
116 op_copy_pt_funcs[SP_AS][SM_N][SC_AN][DP_AN][CPU_NEON] = _op_copy_pt_pas_can_dpan_neon;
117 op_copy_pt_funcs[SP_AN][SM_N][SC_AN][DP_AN][CPU_NEON] = _op_copy_pt_pan_can_dpan_neon;
118 op_copy_pt_funcs[SP][SM_N][SC_AA][DP_AN][CPU_NEON] = _op_copy_pt_p_caa_dpan_neon;
119 op_copy_pt_funcs[SP_AS][SM_N][SC_AA][DP_AN][CPU_NEON] = _op_copy_pt_pas_caa_dpan_neon;
120 op_copy_pt_funcs[SP_AN][SM_N][SC_AA][DP_AN][CPU_NEON] = _op_copy_pt_pan_caa_dpan_neon;
121}
122#endif
123
124/*-----*/
125
126/* copy_rel pixel x color --> dst */
127
128#ifdef BUILD_NEON
129static void
130_op_copy_rel_p_c_dp_neon(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) {
131 // FIXME: neon-it
132 DATA32 *e;
133 UNROLL8_PLD_WHILE(d, l, e,
134 {
135 DATA32 cs = MUL4_SYM(c, *s);
136 *d = MUL_SYM(*d >> 24, cs);
137 d++;
138 s++;
139 });
140}
141
142
143#define _op_copy_rel_pas_c_dp_neon _op_copy_rel_p_c_dp_neon
144#define _op_copy_rel_pan_c_dp_neon _op_copy_rel_p_c_dp_neon
145#define _op_copy_rel_p_can_dp_neon _op_copy_rel_p_c_dp_neon
146#define _op_copy_rel_pas_can_dp_neon _op_copy_rel_p_c_dp_neon
147#define _op_copy_rel_pan_can_dp_neon _op_copy_rel_p_c_dp_neon
148#define _op_copy_rel_p_caa_dp_neon _op_copy_rel_p_c_dp_neon
149#define _op_copy_rel_pas_caa_dp_neon _op_copy_rel_p_c_dp_neon
150#define _op_copy_rel_pan_caa_dp_neon _op_copy_rel_p_c_dp_neon
151
152#define _op_copy_rel_p_c_dpan_neon _op_copy_p_c_dpan_neon
153#define _op_copy_rel_pas_c_dpan_neon _op_copy_pas_c_dpan_neon
154#define _op_copy_rel_pan_c_dpan_neon _op_copy_pan_c_dpan_neon
155#define _op_copy_rel_p_can_dpan_neon _op_copy_p_can_dpan_neon
156#define _op_copy_rel_pas_can_dpan_neon _op_copy_pas_can_dpan_neon
157#define _op_copy_rel_pan_can_dpan_neon _op_copy_pan_can_dpan_neon
158#define _op_copy_rel_p_caa_dpan_neon _op_copy_p_caa_dpan_neon
159#define _op_copy_rel_pas_caa_dpan_neon _op_copy_pas_caa_dpan_neon
160#define _op_copy_rel_pan_caa_dpan_neon _op_copy_pan_caa_dpan_neon
161
162static void
163init_copy_rel_pixel_color_span_funcs_neon(void)
164{
165 op_copy_rel_span_funcs[SP][SM_N][SC][DP][CPU_NEON] = _op_copy_rel_p_c_dp_neon;
166 op_copy_rel_span_funcs[SP_AS][SM_N][SC][DP][CPU_NEON] = _op_copy_rel_pas_c_dp_neon;
167 op_copy_rel_span_funcs[SP_AN][SM_N][SC][DP][CPU_NEON] = _op_copy_rel_pan_c_dp_neon;
168 op_copy_rel_span_funcs[SP][SM_N][SC_AN][DP][CPU_NEON] = _op_copy_rel_p_can_dp_neon;
169 op_copy_rel_span_funcs[SP_AS][SM_N][SC_AN][DP][CPU_NEON] = _op_copy_rel_pas_can_dp_neon;
170 op_copy_rel_span_funcs[SP_AN][SM_N][SC_AN][DP][CPU_NEON] = _op_copy_rel_pan_can_dp_neon;
171 op_copy_rel_span_funcs[SP][SM_N][SC_AA][DP][CPU_NEON] = _op_copy_rel_p_caa_dp_neon;
172 op_copy_rel_span_funcs[SP_AS][SM_N][SC_AA][DP][CPU_NEON] = _op_copy_rel_pas_caa_dp_neon;
173 op_copy_rel_span_funcs[SP_AN][SM_N][SC_AA][DP][CPU_NEON] = _op_copy_rel_pan_caa_dp_neon;
174
175 op_copy_rel_span_funcs[SP][SM_N][SC][DP_AN][CPU_NEON] = _op_copy_rel_p_c_dpan_neon;
176 op_copy_rel_span_funcs[SP_AS][SM_N][SC][DP_AN][CPU_NEON] = _op_copy_rel_pas_c_dpan_neon;
177 op_copy_rel_span_funcs[SP_AN][SM_N][SC][DP_AN][CPU_NEON] = _op_copy_rel_pan_c_dpan_neon;
178 op_copy_rel_span_funcs[SP][SM_N][SC_AN][DP_AN][CPU_NEON] = _op_copy_rel_p_can_dpan_neon;
179 op_copy_rel_span_funcs[SP_AS][SM_N][SC_AN][DP_AN][CPU_NEON] = _op_copy_rel_pas_can_dpan_neon;
180 op_copy_rel_span_funcs[SP_AN][SM_N][SC_AN][DP_AN][CPU_NEON] = _op_copy_rel_pan_can_dpan_neon;
181 op_copy_rel_span_funcs[SP][SM_N][SC_AA][DP_AN][CPU_NEON] = _op_copy_rel_p_caa_dpan_neon;
182 op_copy_rel_span_funcs[SP_AS][SM_N][SC_AA][DP_AN][CPU_NEON] = _op_copy_rel_pas_caa_dpan_neon;
183 op_copy_rel_span_funcs[SP_AN][SM_N][SC_AA][DP_AN][CPU_NEON] = _op_copy_rel_pan_caa_dpan_neon;
184}
185#endif
186
187#ifdef BUILD_NEON
188static void
189_op_copy_rel_pt_p_c_dp_neon(DATA32 s, DATA8 m __UNUSED__, DATA32 c, DATA32 *d) {
190 s = MUL4_SYM(c, s);
191 *d = MUL_SYM(*d >> 24, s);
192}
193
194
195#define _op_copy_rel_pt_pas_c_dp_neon _op_copy_rel_pt_p_c_dp_neon
196#define _op_copy_rel_pt_pan_c_dp_neon _op_copy_rel_pt_p_c_dp_neon
197#define _op_copy_rel_pt_p_can_dp_neon _op_copy_rel_pt_p_c_dp_neon
198#define _op_copy_rel_pt_pas_can_dp_neon _op_copy_rel_pt_p_c_dp_neon
199#define _op_copy_rel_pt_pan_can_dp_neon _op_copy_rel_pt_p_c_dp_neon
200#define _op_copy_rel_pt_p_caa_dp_neon _op_copy_rel_pt_p_c_dp_neon
201#define _op_copy_rel_pt_pas_caa_dp_neon _op_copy_rel_pt_p_c_dp_neon
202#define _op_copy_rel_pt_pan_caa_dp_neon _op_copy_rel_pt_p_c_dp_neon
203
204#define _op_copy_rel_pt_p_c_dpan_neon _op_copy_pt_p_c_dpan_neon
205#define _op_copy_rel_pt_pas_c_dpan_neon _op_copy_pt_pas_c_dpan_neon
206#define _op_copy_rel_pt_pan_c_dpan_neon _op_copy_pt_pan_c_dpan_neon
207#define _op_copy_rel_pt_p_can_dpan_neon _op_copy_pt_p_can_dpan_neon
208#define _op_copy_rel_pt_pas_can_dpan_neon _op_copy_pt_pas_can_dpan_neon
209#define _op_copy_rel_pt_pan_can_dpan_neon _op_copy_pt_pan_can_dpan_neon
210#define _op_copy_rel_pt_p_caa_dpan_neon _op_copy_pt_p_caa_dpan_neon
211#define _op_copy_rel_pt_pas_caa_dpan_neon _op_copy_pt_pas_caa_dpan_neon
212#define _op_copy_rel_pt_pan_caa_dpan_neon _op_copy_pt_pan_caa_dpan_neon
213
214
215static void
216init_copy_rel_pixel_color_pt_funcs_neon(void)
217{
218 op_copy_rel_pt_funcs[SP][SM_N][SC][DP][CPU_NEON] = _op_copy_rel_pt_p_c_dp_neon;
219 op_copy_rel_pt_funcs[SP_AS][SM_N][SC][DP][CPU_NEON] = _op_copy_rel_pt_pas_c_dp_neon;
220 op_copy_rel_pt_funcs[SP_AN][SM_N][SC][DP][CPU_NEON] = _op_copy_rel_pt_pan_c_dp_neon;
221 op_copy_rel_pt_funcs[SP][SM_N][SC_AN][DP][CPU_NEON] = _op_copy_rel_pt_p_can_dp_neon;
222 op_copy_rel_pt_funcs[SP_AS][SM_N][SC_AN][DP][CPU_NEON] = _op_copy_rel_pt_pas_can_dp_neon;
223 op_copy_rel_pt_funcs[SP_AN][SM_N][SC_AN][DP][CPU_NEON] = _op_copy_rel_pt_pan_can_dp_neon;
224 op_copy_rel_pt_funcs[SP][SM_N][SC_AA][DP][CPU_NEON] = _op_copy_rel_pt_p_caa_dp_neon;
225 op_copy_rel_pt_funcs[SP_AS][SM_N][SC_AA][DP][CPU_NEON] = _op_copy_rel_pt_pas_caa_dp_neon;
226 op_copy_rel_pt_funcs[SP_AN][SM_N][SC_AA][DP][CPU_NEON] = _op_copy_rel_pt_pan_caa_dp_neon;
227
228 op_copy_rel_pt_funcs[SP][SM_N][SC][DP_AN][CPU_NEON] = _op_copy_rel_pt_p_c_dpan_neon;
229 op_copy_rel_pt_funcs[SP_AS][SM_N][SC][DP_AN][CPU_NEON] = _op_copy_rel_pt_pas_c_dpan_neon;
230 op_copy_rel_pt_funcs[SP_AN][SM_N][SC][DP_AN][CPU_NEON] = _op_copy_rel_pt_pan_c_dpan_neon;
231 op_copy_rel_pt_funcs[SP][SM_N][SC_AN][DP_AN][CPU_NEON] = _op_copy_rel_pt_p_can_dpan_neon;
232 op_copy_rel_pt_funcs[SP_AS][SM_N][SC_AN][DP_AN][CPU_NEON] = _op_copy_rel_pt_pas_can_dpan_neon;
233 op_copy_rel_pt_funcs[SP_AN][SM_N][SC_AN][DP_AN][CPU_NEON] = _op_copy_rel_pt_pan_can_dpan_neon;
234 op_copy_rel_pt_funcs[SP][SM_N][SC_AA][DP_AN][CPU_NEON] = _op_copy_rel_pt_p_caa_dpan_neon;
235 op_copy_rel_pt_funcs[SP_AS][SM_N][SC_AA][DP_AN][CPU_NEON] = _op_copy_rel_pt_pas_caa_dpan_neon;
236 op_copy_rel_pt_funcs[SP_AN][SM_N][SC_AA][DP_AN][CPU_NEON] = _op_copy_rel_pt_pan_caa_dpan_neon;
237}
238#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_pixel_i386.c b/libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_pixel_i386.c
new file mode 100644
index 0000000..b03022b
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_pixel_i386.c
@@ -0,0 +1,131 @@
1/* copy pixel --> dst */
2
3#ifdef BUILD_MMX
4static void
5_op_copy_p_dp_mmx(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c __UNUSED__, DATA32 *d, int l) {
6 DATA32 *e = d + l - 15;
7 for (; d < e; d+=16, s+=16) {
8 MOVE_16DWORDS_MMX(s, d);
9 }
10 e+=15;
11 for (; d < e; d++, s++) {
12 *d = *s;
13 }
14}
15
16#define _op_copy_pan_dp_mmx _op_copy_p_dp_mmx
17#define _op_copy_pas_dp_mmx _op_copy_p_dp_mmx
18
19#define _op_copy_p_dpan_mmx _op_copy_p_dp_mmx
20#define _op_copy_pan_dpan_mmx _op_copy_pan_dp_mmx
21#define _op_copy_pas_dpan_mmx _op_copy_pas_dp_mmx
22
23static void
24init_copy_pixel_span_funcs_mmx(void)
25{
26 op_copy_span_funcs[SP][SM_N][SC_N][DP][CPU_MMX] = _op_copy_p_dp_mmx;
27 op_copy_span_funcs[SP_AN][SM_N][SC_N][DP][CPU_MMX] = _op_copy_pan_dp_mmx;
28 op_copy_span_funcs[SP_AS][SM_N][SC_N][DP][CPU_MMX] = _op_copy_pas_dp_mmx;
29
30 op_copy_span_funcs[SP][SM_N][SC_N][DP_AN][CPU_MMX] = _op_copy_p_dpan_mmx;
31 op_copy_span_funcs[SP_AN][SM_N][SC_N][DP_AN][CPU_MMX] = _op_copy_pan_dpan_mmx;
32 op_copy_span_funcs[SP_AS][SM_N][SC_N][DP_AN][CPU_MMX] = _op_copy_pas_dpan_mmx;
33}
34#endif
35
36#ifdef BUILD_MMX
37static void
38_op_copy_pt_p_dp_mmx(DATA32 s, DATA8 m __UNUSED__, DATA32 c __UNUSED__, DATA32 *d) {
39 *d = s;
40}
41
42#define _op_copy_pt_pan_dp_mmx _op_copy_pt_p_dp_mmx
43#define _op_copy_pt_pas_dp_mmx _op_copy_pt_p_dp_mmx
44
45#define _op_copy_pt_p_dpan_mmx _op_copy_pt_p_dp_mmx
46#define _op_copy_pt_pan_dpan_mmx _op_copy_pt_pan_dp_mmx
47#define _op_copy_pt_pas_dpan_mmx _op_copy_pt_pas_dp_mmx
48
49static void
50init_copy_pixel_pt_funcs_mmx(void)
51{
52 op_copy_pt_funcs[SP][SM_N][SC_N][DP][CPU_MMX] = _op_copy_pt_p_dp_mmx;
53 op_copy_pt_funcs[SP_AN][SM_N][SC_N][DP][CPU_MMX] = _op_copy_pt_pan_dp_mmx;
54 op_copy_pt_funcs[SP_AS][SM_N][SC_N][DP][CPU_MMX] = _op_copy_pt_pas_dp_mmx;
55
56 op_copy_pt_funcs[SP][SM_N][SC_N][DP_AN][CPU_MMX] = _op_copy_pt_p_dpan_mmx;
57 op_copy_pt_funcs[SP_AN][SM_N][SC_N][DP_AN][CPU_MMX] = _op_copy_pt_pan_dpan_mmx;
58 op_copy_pt_funcs[SP_AS][SM_N][SC_N][DP_AN][CPU_MMX] = _op_copy_pt_pas_dpan_mmx;
59}
60#endif
61
62/*-----*/
63
64/* copy_rel pixel --> dst */
65
66#ifdef BUILD_MMX
67static void
68_op_copy_rel_p_dp_mmx(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c __UNUSED__, DATA32 *d, int l) {
69 DATA32 *e = d + l;
70 pxor_r2r(mm0, mm0);
71 MOV_A2R(ALPHA_255, mm5)
72 for (; d < e; d++, s++) {
73 MOV_PA2R(*d, mm1)
74 MOV_P2R(*s, mm2, mm0)
75 MUL4_SYM_R2R(mm2, mm1, mm5)
76 MOV_R2P(mm1, *d, mm0)
77 }
78}
79
80
81#define _op_copy_rel_pas_dp_mmx _op_copy_rel_p_dp_mmx
82#define _op_copy_rel_pan_dp_mmx _op_copy_rel_p_dp_mmx
83
84#define _op_copy_rel_p_dpan_mmx _op_copy_p_dpan_mmx
85#define _op_copy_rel_pan_dpan_mmx _op_copy_pan_dpan_mmx
86#define _op_copy_rel_pas_dpan_mmx _op_copy_pas_dpan_mmx
87
88static void
89init_copy_rel_pixel_span_funcs_mmx(void)
90{
91 op_copy_rel_span_funcs[SP][SM_N][SC_N][DP][CPU_MMX] = _op_copy_rel_p_dp_mmx;
92 op_copy_rel_span_funcs[SP_AN][SM_N][SC_N][DP][CPU_MMX] = _op_copy_rel_pan_dp_mmx;
93 op_copy_rel_span_funcs[SP_AS][SM_N][SC_N][DP][CPU_MMX] = _op_copy_rel_pas_dp_mmx;
94
95 op_copy_rel_span_funcs[SP][SM_N][SC_N][DP_AN][CPU_MMX] = _op_copy_rel_p_dpan_mmx;
96 op_copy_rel_span_funcs[SP_AN][SM_N][SC_N][DP_AN][CPU_MMX] = _op_copy_rel_pan_dpan_mmx;
97 op_copy_rel_span_funcs[SP_AS][SM_N][SC_N][DP_AN][CPU_MMX] = _op_copy_rel_pas_dpan_mmx;
98}
99#endif
100
101#ifdef BUILD_MMX
102static void
103_op_copy_rel_pt_p_dp_mmx(DATA32 s, DATA8 m __UNUSED__, DATA32 c, DATA32 *d) {
104 c = 1 + (*d >> 24);
105 MOV_A2R(c, mm1)
106 pxor_r2r(mm0, mm0);
107 MOV_P2R(s, mm2, mm0)
108 MUL4_256_R2R(mm2, mm1)
109 MOV_R2P(mm1, *d, mm0)
110}
111
112
113#define _op_copy_rel_pt_pan_dp_mmx _op_copy_rel_pt_p_dp_mmx
114#define _op_copy_rel_pt_pas_dp_mmx _op_copy_rel_pt_p_dp_mmx
115
116#define _op_copy_rel_pt_p_dpan_mmx _op_copy_pt_p_dpan_mmx
117#define _op_copy_rel_pt_pan_dpan_mmx _op_copy_pt_pan_dpan_mmx
118#define _op_copy_rel_pt_pas_dpan_mmx _op_copy_pt_pas_dpan_mmx
119
120static void
121init_copy_rel_pixel_pt_funcs_mmx(void)
122{
123 op_copy_rel_pt_funcs[SP][SM_N][SC_N][DP][CPU_MMX] = _op_copy_rel_pt_p_dp_mmx;
124 op_copy_rel_pt_funcs[SP_AN][SM_N][SC_N][DP][CPU_MMX] = _op_copy_rel_pt_pan_dp_mmx;
125 op_copy_rel_pt_funcs[SP_AS][SM_N][SC_N][DP][CPU_MMX] = _op_copy_rel_pt_pas_dp_mmx;
126
127 op_copy_rel_pt_funcs[SP][SM_N][SC_N][DP_AN][CPU_MMX] = _op_copy_rel_pt_p_dpan_mmx;
128 op_copy_rel_pt_funcs[SP_AN][SM_N][SC_N][DP_AN][CPU_MMX] = _op_copy_rel_pt_pan_dpan_mmx;
129 op_copy_rel_pt_funcs[SP_AS][SM_N][SC_N][DP_AN][CPU_MMX] = _op_copy_rel_pt_pas_dpan_mmx;
130}
131#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_pixel_mask_.c b/libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_pixel_mask_.c
new file mode 100644
index 0000000..48b5338
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_pixel_mask_.c
@@ -0,0 +1,150 @@
1/* copy pixel x mask --> dst */
2
3#ifdef BUILD_C
4static void
5_op_copy_p_mas_dp(DATA32 *s, DATA8 *m, DATA32 c __UNUSED__, DATA32 *d, int l) {
6 DATA32 *e;
7 int color;
8 UNROLL8_PLD_WHILE(d, l, e,
9 {
10 color = *m;
11 switch(color)
12 {
13 case 0:
14 break;
15 case 255:
16 *d = *s;
17 break;
18 default:
19 color++;
20 *d = INTERP_256(color, *s, *d);
21 break;
22 }
23 m++; s++; d++;
24 });
25}
26
27
28#define _op_copy_pan_mas_dp _op_copy_p_mas_dp
29#define _op_copy_pas_mas_dp _op_copy_p_mas_dp
30
31#define _op_copy_p_mas_dpan _op_copy_p_mas_dp
32#define _op_copy_pan_mas_dpan _op_copy_p_mas_dpan
33#define _op_copy_pas_mas_dpan _op_copy_p_mas_dpan
34
35static void
36init_copy_pixel_mask_span_funcs_c(void)
37{
38 op_copy_span_funcs[SP][SM_AS][SC_N][DP][CPU_C] = _op_copy_p_mas_dp;
39 op_copy_span_funcs[SP_AN][SM_AS][SC_N][DP][CPU_C] = _op_copy_pan_mas_dp;
40 op_copy_span_funcs[SP_AS][SM_AS][SC_N][DP][CPU_C] = _op_copy_pas_mas_dp;
41
42 op_copy_span_funcs[SP][SM_AS][SC_N][DP_AN][CPU_C] = _op_copy_p_mas_dpan;
43 op_copy_span_funcs[SP_AN][SM_AS][SC_N][DP_AN][CPU_C] = _op_copy_pan_mas_dpan;
44 op_copy_span_funcs[SP_AS][SM_AS][SC_N][DP_AN][CPU_C] = _op_copy_pas_mas_dpan;
45}
46#endif
47
48#ifdef BUILD_C
49static void
50_op_copy_pt_p_mas_dp(DATA32 s, DATA8 m, DATA32 c __UNUSED__, DATA32 *d) {
51 *d = INTERP_256(m + 1, s, *d);
52}
53
54#define _op_copy_pt_pan_mas_dp _op_copy_pt_p_mas_dp
55#define _op_copy_pt_pas_mas_dp _op_copy_pt_p_mas_dp
56
57#define _op_copy_pt_p_mas_dpan _op_copy_pt_p_mas_dp
58#define _op_copy_pt_pan_mas_dpan _op_copy_pt_p_mas_dpan
59#define _op_copy_pt_pas_mas_dpan _op_copy_pt_p_mas_dpan
60
61static void
62init_copy_pixel_mask_pt_funcs_c(void)
63{
64 op_copy_pt_funcs[SP][SM_AS][SC_N][DP][CPU_C] = _op_copy_pt_p_mas_dp;
65 op_copy_pt_funcs[SP_AN][SM_AS][SC_N][DP][CPU_C] = _op_copy_pt_pan_mas_dp;
66 op_copy_pt_funcs[SP_AS][SM_AS][SC_N][DP][CPU_C] = _op_copy_pt_pas_mas_dp;
67
68 op_copy_pt_funcs[SP][SM_AS][SC_N][DP_AN][CPU_C] = _op_copy_pt_p_mas_dpan;
69 op_copy_pt_funcs[SP_AN][SM_AS][SC_N][DP_AN][CPU_C] = _op_copy_pt_pan_mas_dpan;
70 op_copy_pt_funcs[SP_AS][SM_AS][SC_N][DP_AN][CPU_C] = _op_copy_pt_pas_mas_dpan;
71}
72#endif
73
74/*-----*/
75
76/* copy_rel pixel x mask --> dst */
77
78#ifdef BUILD_C
79static void
80_op_copy_rel_p_mas_dp(DATA32 *s, DATA8 *m, DATA32 c, DATA32 *d, int l) {
81 DATA32 *e;
82 int color;
83 UNROLL8_PLD_WHILE(d, l, e,
84 {
85 color = *m;
86 switch(color)
87 {
88 case 0:
89 break;
90 case 255:
91 *d = MUL_SYM(*d >> 24, *s);
92 break;
93 default:
94 c = MUL_SYM(*d >> 24, *s);
95 l++;
96 *d = INTERP_256(l, c, *d);
97 break;
98 }
99 m++; s++; d++;
100 });
101}
102
103
104#define _op_copy_rel_pan_mas_dp _op_copy_rel_p_mas_dp
105#define _op_copy_rel_pas_mas_dp _op_copy_rel_p_mas_dp
106
107#define _op_copy_rel_p_mas_dpan _op_copy_p_mas_dpan
108#define _op_copy_rel_pan_mas_dpan _op_copy_pan_mas_dpan
109#define _op_copy_rel_pas_mas_dpan _op_copy_pas_mas_dpan
110
111static void
112init_copy_rel_pixel_mask_span_funcs_c(void)
113{
114 op_copy_rel_span_funcs[SP][SM_AS][SC_N][DP][CPU_C] = _op_copy_rel_p_mas_dp;
115 op_copy_rel_span_funcs[SP_AN][SM_AS][SC_N][DP][CPU_C] = _op_copy_rel_pan_mas_dp;
116 op_copy_rel_span_funcs[SP_AS][SM_AS][SC_N][DP][CPU_C] = _op_copy_rel_pas_mas_dp;
117
118 op_copy_rel_span_funcs[SP][SM_AS][SC_N][DP_AN][CPU_C] = _op_copy_rel_p_mas_dpan;
119 op_copy_rel_span_funcs[SP_AN][SM_AS][SC_N][DP_AN][CPU_C] = _op_copy_rel_pan_mas_dpan;
120 op_copy_rel_span_funcs[SP_AS][SM_AS][SC_N][DP_AN][CPU_C] = _op_copy_rel_pas_mas_dpan;
121}
122#endif
123
124#ifdef BUILD_C
125static void
126_op_copy_rel_pt_p_mas_dp(DATA32 s, DATA8 m, DATA32 c, DATA32 *d) {
127 c = MUL_SYM(*d >> 24, s);
128 *d = INTERP_256(m + 1, c, *d);
129}
130
131
132#define _op_copy_rel_pt_pan_mas_dp _op_copy_rel_pt_p_mas_dp
133#define _op_copy_rel_pt_pas_mas_dp _op_copy_rel_pt_p_mas_dp
134
135#define _op_copy_rel_pt_p_mas_dpan _op_copy_pt_p_mas_dpan
136#define _op_copy_rel_pt_pan_mas_dpan _op_copy_pt_pan_mas_dpan
137#define _op_copy_rel_pt_pas_mas_dpan _op_copy_pt_pas_mas_dpan
138
139static void
140init_copy_rel_pixel_mask_pt_funcs_c(void)
141{
142 op_copy_rel_pt_funcs[SP][SM_AS][SC_N][DP][CPU_C] = _op_copy_rel_pt_p_mas_dp;
143 op_copy_rel_pt_funcs[SP_AN][SM_AS][SC_N][DP][CPU_C] = _op_copy_rel_pt_pan_mas_dp;
144 op_copy_rel_pt_funcs[SP_AS][SM_AS][SC_N][DP][CPU_C] = _op_copy_rel_pt_pas_mas_dp;
145
146 op_copy_rel_pt_funcs[SP][SM_AS][SC_N][DP_AN][CPU_C] = _op_copy_rel_pt_p_mas_dpan;
147 op_copy_rel_pt_funcs[SP_AN][SM_AS][SC_N][DP_AN][CPU_C] = _op_copy_rel_pt_pan_mas_dpan;
148 op_copy_rel_pt_funcs[SP_AS][SM_AS][SC_N][DP_AN][CPU_C] = _op_copy_rel_pt_pas_mas_dpan;
149}
150#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_pixel_mask_i386.c b/libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_pixel_mask_i386.c
new file mode 100644
index 0000000..2511c41
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_pixel_mask_i386.c
@@ -0,0 +1,176 @@
1/* copy pixel x mask --> dst */
2
3#ifdef BUILD_MMX
4static void
5_op_copy_p_mas_dp_mmx(DATA32 *s, DATA8 *m, DATA32 c __UNUSED__, DATA32 *d, int l) {
6 DATA32 *e = d + l;
7 pxor_r2r(mm0, mm0);
8 MOV_A2R(ALPHA_255, mm5)
9 while (d < e) {
10 l = *m;
11 switch(l)
12 {
13 case 0:
14 break;
15 case 255:
16 *d = *s;
17 break;
18 default:
19 l++;
20 MOV_A2R(l, mm3)
21 MOV_P2R(*s, mm2, mm0)
22 MOV_P2R(*d, mm1, mm0)
23 INTERP_256_R2R(mm3, mm2, mm1, mm5);
24 MOV_R2P(mm1, *d, mm0)
25 break;
26 }
27 m++; d++;
28 }
29}
30
31#define _op_copy_pan_mas_dp_mmx _op_copy_p_mas_dp_mmx
32#define _op_copy_pas_mas_dp_mmx _op_copy_p_mas_dp_mmx
33
34#define _op_copy_p_mas_dpan_mmx _op_copy_p_mas_dp_mmx
35#define _op_copy_pan_mas_dpan_mmx _op_copy_p_mas_dpan_mmx
36#define _op_copy_pas_mas_dpan_mmx _op_copy_p_mas_dpan_mmx
37
38static void
39init_copy_pixel_mask_span_funcs_mmx(void)
40{
41 op_copy_span_funcs[SP][SM_AS][SC_N][DP][CPU_MMX] = _op_copy_p_mas_dp_mmx;
42 op_copy_span_funcs[SP_AN][SM_AS][SC_N][DP][CPU_MMX] = _op_copy_pan_mas_dp_mmx;
43 op_copy_span_funcs[SP_AS][SM_AS][SC_N][DP][CPU_MMX] = _op_copy_pas_mas_dp_mmx;
44
45 op_copy_span_funcs[SP][SM_AS][SC_N][DP_AN][CPU_MMX] = _op_copy_p_mas_dpan_mmx;
46 op_copy_span_funcs[SP_AN][SM_AS][SC_N][DP_AN][CPU_MMX] = _op_copy_pan_mas_dpan_mmx;
47 op_copy_span_funcs[SP_AS][SM_AS][SC_N][DP_AN][CPU_MMX] = _op_copy_pas_mas_dpan_mmx;
48}
49#endif
50
51#ifdef BUILD_MMX
52static void
53_op_copy_pt_p_mas_dp_mmx(DATA32 s, DATA8 m, DATA32 c, DATA32 *d) {
54 c = m + 1;
55 MOV_A2R(ALPHA_255, mm5)
56 MOV_A2R(c, mm3)
57 pxor_r2r(mm0, mm0);
58 MOV_P2R(s, mm2, mm0)
59 MOV_P2R(*d, mm1, mm0)
60 INTERP_256_R2R(mm3, mm2, mm1, mm5);
61 MOV_R2P(mm1, *d, mm0)
62}
63
64#define _op_copy_pt_pan_mas_dp_mmx _op_copy_pt_p_mas_dp_mmx
65#define _op_copy_pt_pas_mas_dp_mmx _op_copy_pt_p_mas_dp_mmx
66
67#define _op_copy_pt_p_mas_dpan_mmx _op_copy_pt_p_mas_dp_mmx
68#define _op_copy_pt_pan_mas_dpan_mmx _op_copy_pt_p_mas_dpan_mmx
69#define _op_copy_pt_pas_mas_dpan_mmx _op_copy_pt_p_mas_dpan_mmx
70
71static void
72init_copy_pixel_mask_pt_funcs_mmx(void)
73{
74 op_copy_pt_funcs[SP][SM_AS][SC_N][DP][CPU_MMX] = _op_copy_pt_p_mas_dp_mmx;
75 op_copy_pt_funcs[SP_AN][SM_AS][SC_N][DP][CPU_MMX] = _op_copy_pt_pan_mas_dp_mmx;
76 op_copy_pt_funcs[SP_AS][SM_AS][SC_N][DP][CPU_MMX] = _op_copy_pt_pas_mas_dp_mmx;
77
78 op_copy_pt_funcs[SP][SM_AS][SC_N][DP_AN][CPU_MMX] = _op_copy_pt_p_mas_dpan_mmx;
79 op_copy_pt_funcs[SP_AN][SM_AS][SC_N][DP_AN][CPU_MMX] = _op_copy_pt_pan_mas_dpan_mmx;
80 op_copy_pt_funcs[SP_AS][SM_AS][SC_N][DP_AN][CPU_MMX] = _op_copy_pt_pas_mas_dpan_mmx;
81}
82#endif
83
84/*-----*/
85
86/* copy_rel pixel x mask --> dst */
87
88#ifdef BUILD_MMX
89static void
90_op_copy_rel_p_mas_dp_mmx(DATA32 *s, DATA8 *m, DATA32 c __UNUSED__, DATA32 *d, int l) {
91 DATA32 *e = d + l;
92 pxor_r2r(mm0, mm0);
93 MOV_A2R(ALPHA_255, mm5)
94 while (d < e) {
95 l = *m;
96 switch(l)
97 {
98 case 0:
99 break;
100 case 255:
101 MOV_P2R(*s, mm2, mm0)
102 MOV_PA2R(*d, mm1)
103 MUL4_SYM_R2R(mm2, mm1, mm5)
104 MOV_R2P(mm1, *d, mm0)
105 break;
106 default:
107 l++;
108 MOV_P2R(*s, mm3, mm0)
109 MOV_P2R(*d, mm1, mm0)
110 MOV_RA2R(mm1, mm2)
111 MUL4_SYM_R2R(mm3, mm2, mm5)
112 MOV_A2R(l, mm3)
113 INTERP_256_R2R(mm3, mm2, mm1, mm5)
114 MOV_R2P(mm1, *d, mm0)
115 break;
116 }
117 m++; s++; d++;
118 }
119}
120
121#define _op_copy_rel_pan_mas_dp_mmx _op_copy_rel_p_mas_dp_mmx
122#define _op_copy_rel_pas_mas_dp_mmx _op_copy_rel_p_mas_dp_mmx
123
124#define _op_copy_rel_p_mas_dpan_mmx _op_copy_p_mas_dpan_mmx
125#define _op_copy_rel_pan_mas_dpan_mmx _op_copy_pan_mas_dpan_mmx
126#define _op_copy_rel_pas_mas_dpan_mmx _op_copy_pas_mas_dpan_mmx
127
128static void
129init_copy_rel_pixel_mask_span_funcs_mmx(void)
130{
131 op_copy_rel_span_funcs[SP][SM_AS][SC_N][DP][CPU_MMX] = _op_copy_rel_p_mas_dp_mmx;
132 op_copy_rel_span_funcs[SP_AN][SM_AS][SC_N][DP][CPU_MMX] = _op_copy_rel_pan_mas_dp_mmx;
133 op_copy_rel_span_funcs[SP_AS][SM_AS][SC_N][DP][CPU_MMX] = _op_copy_rel_pas_mas_dp_mmx;
134
135 op_copy_rel_span_funcs[SP][SM_AS][SC_N][DP_AN][CPU_MMX] = _op_copy_rel_p_mas_dpan_mmx;
136 op_copy_rel_span_funcs[SP_AN][SM_AS][SC_N][DP_AN][CPU_MMX] = _op_copy_rel_pan_mas_dpan_mmx;
137 op_copy_rel_span_funcs[SP_AS][SM_AS][SC_N][DP_AN][CPU_MMX] = _op_copy_rel_pas_mas_dpan_mmx;
138}
139#endif
140
141#ifdef BUILD_MMX
142static void
143_op_copy_rel_pt_p_mas_dp_mmx(DATA32 s, DATA8 m, DATA32 c, DATA32 *d) {
144 c = m + 1;
145 pxor_r2r(mm0, mm0);
146 MOV_A2R(ALPHA_255, mm5)
147 MOV_P2R(s, mm3, mm0)
148 MOV_P2R(*d, mm1, mm0)
149 MOV_RA2R(mm1, mm2)
150 MUL4_SYM_R2R(mm3, mm2, mm5)
151 MOV_A2R(c, mm3)
152 INTERP_256_R2R(mm3, mm2, mm1, mm5)
153 MOV_R2P(mm1, *d, mm0)
154}
155
156
157#define _op_copy_rel_pt_pan_mas_dp_mmx _op_copy_rel_pt_p_mas_dp_mmx
158#define _op_copy_rel_pt_pas_mas_dp_mmx _op_copy_rel_pt_p_mas_dp_mmx
159
160#define _op_copy_rel_pt_p_mas_dpan_mmx _op_copy_pt_p_mas_dpan_mmx
161#define _op_copy_rel_pt_pan_mas_dpan_mmx _op_copy_pt_pan_mas_dpan_mmx
162#define _op_copy_rel_pt_pas_mas_dpan_mmx _op_copy_pt_pas_mas_dpan_mmx
163
164static void
165init_copy_rel_pixel_mask_pt_funcs_mmx(void)
166{
167 op_copy_rel_pt_funcs[SP][SM_AS][SC_N][DP][CPU_MMX] = _op_copy_rel_pt_p_mas_dp_mmx;
168 op_copy_rel_pt_funcs[SP_AN][SM_AS][SC_N][DP][CPU_MMX] = _op_copy_rel_pt_pan_mas_dp_mmx;
169 op_copy_rel_pt_funcs[SP_AS][SM_AS][SC_N][DP][CPU_MMX] = _op_copy_rel_pt_pas_mas_dp_mmx;
170
171 op_copy_rel_pt_funcs[SP][SM_AS][SC_N][DP_AN][CPU_MMX] = _op_copy_rel_pt_p_mas_dpan_mmx;
172 op_copy_rel_pt_funcs[SP_AN][SM_AS][SC_N][DP_AN][CPU_MMX] = _op_copy_rel_pt_pan_mas_dpan_mmx;
173 op_copy_rel_pt_funcs[SP_AS][SM_AS][SC_N][DP_AN][CPU_MMX] = _op_copy_rel_pt_pas_mas_dpan_mmx;
174}
175#endif
176
diff --git a/libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_pixel_mask_neon.c b/libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_pixel_mask_neon.c
new file mode 100644
index 0000000..e25f8f8
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_pixel_mask_neon.c
@@ -0,0 +1,151 @@
1/* copy pixel x mask --> dst */
2
3#ifdef BUILD_NEON
4static void
5_op_copy_p_mas_dp_neon(DATA32 *s, DATA8 *m, DATA32 c __UNUSED__, DATA32 *d, int l) {
6 // FIXME: neon-it
7 DATA32 *e;
8 int color;
9 UNROLL8_PLD_WHILE(d, l, e,
10 {
11 color = *m;
12 switch(color)
13 {
14 case 0:
15 break;
16 case 255:
17 *d = *s;
18 break;
19 default:
20 color++;
21 *d = INTERP_256(color, *s, *d);
22 break;
23 }
24 m++; s++; d++;
25 });
26}
27
28#define _op_copy_pan_mas_dp_neon _op_copy_p_mas_dp_neon
29#define _op_copy_pas_mas_dp_neon _op_copy_p_mas_dp_neon
30
31#define _op_copy_p_mas_dpan_neon _op_copy_p_mas_dp_neon
32#define _op_copy_pan_mas_dpan_neon _op_copy_p_mas_dpan_neon
33#define _op_copy_pas_mas_dpan_neon _op_copy_p_mas_dpan_neon
34
35static void
36init_copy_pixel_mask_span_funcs_neon(void)
37{
38 op_copy_span_funcs[SP][SM_AS][SC_N][DP][CPU_NEON] = _op_copy_p_mas_dp_neon;
39 op_copy_span_funcs[SP_AN][SM_AS][SC_N][DP][CPU_NEON] = _op_copy_pan_mas_dp_neon;
40 op_copy_span_funcs[SP_AS][SM_AS][SC_N][DP][CPU_NEON] = _op_copy_pas_mas_dp_neon;
41
42 op_copy_span_funcs[SP][SM_AS][SC_N][DP_AN][CPU_NEON] = _op_copy_p_mas_dpan_neon;
43 op_copy_span_funcs[SP_AN][SM_AS][SC_N][DP_AN][CPU_NEON] = _op_copy_pan_mas_dpan_neon;
44 op_copy_span_funcs[SP_AS][SM_AS][SC_N][DP_AN][CPU_NEON] = _op_copy_pas_mas_dpan_neon;
45}
46#endif
47
48#ifdef BUILD_NEON
49static void
50_op_copy_pt_p_mas_dp_neon(DATA32 s, DATA8 m, DATA32 c, DATA32 *d) {
51 *d = INTERP_256(m + 1, s, *d);
52}
53
54#define _op_copy_pt_pan_mas_dp_neon _op_copy_pt_p_mas_dp_neon
55#define _op_copy_pt_pas_mas_dp_neon _op_copy_pt_p_mas_dp_neon
56
57#define _op_copy_pt_p_mas_dpan_neon _op_copy_pt_p_mas_dp_neon
58#define _op_copy_pt_pan_mas_dpan_neon _op_copy_pt_p_mas_dpan_neon
59#define _op_copy_pt_pas_mas_dpan_neon _op_copy_pt_p_mas_dpan_neon
60
61static void
62init_copy_pixel_mask_pt_funcs_neon(void)
63{
64 op_copy_pt_funcs[SP][SM_AS][SC_N][DP][CPU_NEON] = _op_copy_pt_p_mas_dp_neon;
65 op_copy_pt_funcs[SP_AN][SM_AS][SC_N][DP][CPU_NEON] = _op_copy_pt_pan_mas_dp_neon;
66 op_copy_pt_funcs[SP_AS][SM_AS][SC_N][DP][CPU_NEON] = _op_copy_pt_pas_mas_dp_neon;
67
68 op_copy_pt_funcs[SP][SM_AS][SC_N][DP_AN][CPU_NEON] = _op_copy_pt_p_mas_dpan_neon;
69 op_copy_pt_funcs[SP_AN][SM_AS][SC_N][DP_AN][CPU_NEON] = _op_copy_pt_pan_mas_dpan_neon;
70 op_copy_pt_funcs[SP_AS][SM_AS][SC_N][DP_AN][CPU_NEON] = _op_copy_pt_pas_mas_dpan_neon;
71}
72#endif
73
74/*-----*/
75
76/* copy_rel pixel x mask --> dst */
77
78#ifdef BUILD_NEON
79static void
80_op_copy_rel_p_mas_dp_neon(DATA32 *s, DATA8 *m, DATA32 c __UNUSED__, DATA32 *d, int l) {
81 // FIXME: neon-it
82 DATA32 *e;
83 int color;
84 UNROLL8_PLD_WHILE(d, l, e,
85 {
86 color = *m;
87 switch(color)
88 {
89 case 0:
90 break;
91 case 255:
92 *d = MUL_SYM(*d >> 24, *s);
93 break;
94 default:
95 c = MUL_SYM(*d >> 24, *s);
96 l++;
97 *d = INTERP_256(l, c, *d);
98 break;
99 }
100 m++; s++; d++;
101 });
102}
103
104#define _op_copy_rel_pan_mas_dp_neon _op_copy_rel_p_mas_dp_neon
105#define _op_copy_rel_pas_mas_dp_neon _op_copy_rel_p_mas_dp_neon
106
107#define _op_copy_rel_p_mas_dpan_neon _op_copy_p_mas_dpan_neon
108#define _op_copy_rel_pan_mas_dpan_neon _op_copy_pan_mas_dpan_neon
109#define _op_copy_rel_pas_mas_dpan_neon _op_copy_pas_mas_dpan_neon
110
111static void
112init_copy_rel_pixel_mask_span_funcs_neon(void)
113{
114 op_copy_rel_span_funcs[SP][SM_AS][SC_N][DP][CPU_NEON] = _op_copy_rel_p_mas_dp_neon;
115 op_copy_rel_span_funcs[SP_AN][SM_AS][SC_N][DP][CPU_NEON] = _op_copy_rel_pan_mas_dp_neon;
116 op_copy_rel_span_funcs[SP_AS][SM_AS][SC_N][DP][CPU_NEON] = _op_copy_rel_pas_mas_dp_neon;
117
118 op_copy_rel_span_funcs[SP][SM_AS][SC_N][DP_AN][CPU_NEON] = _op_copy_rel_p_mas_dpan_neon;
119 op_copy_rel_span_funcs[SP_AN][SM_AS][SC_N][DP_AN][CPU_NEON] = _op_copy_rel_pan_mas_dpan_neon;
120 op_copy_rel_span_funcs[SP_AS][SM_AS][SC_N][DP_AN][CPU_NEON] = _op_copy_rel_pas_mas_dpan_neon;
121}
122#endif
123
124#ifdef BUILD_NEON
125static void
126_op_copy_rel_pt_p_mas_dp_neon(DATA32 s, DATA8 m, DATA32 c, DATA32 *d) {
127 c = MUL_SYM(*d >> 24, s);
128 *d = INTERP_256(m + 1, c, *d);
129}
130
131
132#define _op_copy_rel_pt_pan_mas_dp_neon _op_copy_rel_pt_p_mas_dp_neon
133#define _op_copy_rel_pt_pas_mas_dp_neon _op_copy_rel_pt_p_mas_dp_neon
134
135#define _op_copy_rel_pt_p_mas_dpan_neon _op_copy_pt_p_mas_dpan_neon
136#define _op_copy_rel_pt_pan_mas_dpan_neon _op_copy_pt_pan_mas_dpan_neon
137#define _op_copy_rel_pt_pas_mas_dpan_neon _op_copy_pt_pas_mas_dpan_neon
138
139static void
140init_copy_rel_pixel_mask_pt_funcs_neon(void)
141{
142 op_copy_rel_pt_funcs[SP][SM_AS][SC_N][DP][CPU_NEON] = _op_copy_rel_pt_p_mas_dp_neon;
143 op_copy_rel_pt_funcs[SP_AN][SM_AS][SC_N][DP][CPU_NEON] = _op_copy_rel_pt_pan_mas_dp_neon;
144 op_copy_rel_pt_funcs[SP_AS][SM_AS][SC_N][DP][CPU_NEON] = _op_copy_rel_pt_pas_mas_dp_neon;
145
146 op_copy_rel_pt_funcs[SP][SM_AS][SC_N][DP_AN][CPU_NEON] = _op_copy_rel_pt_p_mas_dpan_neon;
147 op_copy_rel_pt_funcs[SP_AN][SM_AS][SC_N][DP_AN][CPU_NEON] = _op_copy_rel_pt_pan_mas_dpan_neon;
148 op_copy_rel_pt_funcs[SP_AS][SM_AS][SC_N][DP_AN][CPU_NEON] = _op_copy_rel_pt_pas_mas_dpan_neon;
149}
150#endif
151
diff --git a/libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_pixel_neon.c b/libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_pixel_neon.c
new file mode 100644
index 0000000..5b8bd60
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_copy/op_copy_pixel_neon.c
@@ -0,0 +1,158 @@
1/* copy pixel --> dst */
2
3#ifdef BUILD_NEON
4static void
5_op_copy_p_dp_neon(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c __UNUSED__, DATA32 *d, int l) {
6//#define USENEON 1
7#ifndef USENEON
8 memcpy(d, s, l * sizeof(DATA32));
9 return;
10#else
11 DATA32 *e;
12 e = d + l - 23;
13 if (e > d)
14 {
15 int dl;
16
17 asm volatile
18 (".fpu neon \n\t"
19 "_op_copy_p_dp_neon_asmloop: \n\t"
20 "pld [%[s], #192] \n\t" // preload 256 bytes ahead
21 "pld [%[s], #320] \n\t" // preload 320 bytes ahead
22 "vld1.32 {d0-d3}, [%[s]]! \n\t" // load 256bits (32 bytes 8 pix), 32bit aligned
23 "vld1.32 {d4-d7} , [%[s]]! \n\t" // load 256bits (32 bytes 8 pix), 32bit aligned
24 "vld1.32 {d8-d11}, [%[s]]! \n\t" // load 256bits (32 bytes 8 pix), 32bit aligned
25 "vst1.32 {d0-d3}, [%[d]]! \n\t" // store 256bits (32 bytes 8 pix), 32bit aligned
26 "vst1.32 {d4-d7}, [%[d]]! \n\t" // store 256bits (32 bytes 8 pix), 32bit aligned
27 "vst1.32 {d8-d11}, [%[d]]! \n\t" // store 256bits (32 bytes 8 pix), 32bit aligned
28 "cmp %[e], %[d] \n\t" // compare current and end ptr
29 "bgt _op_copy_p_dp_neon_asmloop \n\t"
30 : /*out*/
31 : /*in */ [s] "r" (s), [e] "r" (e), [d] "r" (d)
32 : /*clobber*/
33 "q0", "q1", "q2","q3", "q4", "q5", "q6",
34 "d0", "d1", "d2", "d3",
35 "d4", "d5", "d6", "d7",
36 "d8", "d9", "d10", "d11",
37 "memory" // clobbered
38 );
39 dl = l % 24; // dl is how many pixels at end that is not a multiple of 24
40 l = l - dl; // jump to there at the end of the run?
41 s = s + l;
42 d = d + l;
43 }
44 e += 23;
45 for (;d < e; d++, s++) *d = *s;
46#endif
47}
48
49#define _op_copy_pan_dp_neon _op_copy_p_dp_neon
50#define _op_copy_pas_dp_neon _op_copy_p_dp_neon
51
52#define _op_copy_p_dpan_neon _op_copy_p_dp_neon
53#define _op_copy_pan_dpan_neon _op_copy_pan_dp_neon
54#define _op_copy_pas_dpan_neon _op_copy_pas_dp_neon
55
56static void
57init_copy_pixel_span_funcs_neon(void)
58{
59 op_copy_span_funcs[SP][SM_N][SC_N][DP][CPU_NEON] = _op_copy_p_dp_neon;
60 op_copy_span_funcs[SP_AN][SM_N][SC_N][DP][CPU_NEON] = _op_copy_pan_dp_neon;
61 op_copy_span_funcs[SP_AS][SM_N][SC_N][DP][CPU_NEON] = _op_copy_pas_dp_neon;
62
63 op_copy_span_funcs[SP][SM_N][SC_N][DP_AN][CPU_NEON] = _op_copy_p_dpan_neon;
64 op_copy_span_funcs[SP_AN][SM_N][SC_N][DP_AN][CPU_NEON] = _op_copy_pan_dpan_neon;
65 op_copy_span_funcs[SP_AS][SM_N][SC_N][DP_AN][CPU_NEON] = _op_copy_pas_dpan_neon;
66}
67#endif
68
69#ifdef BUILD_NEON
70static void
71_op_copy_pt_p_dp_neon(DATA32 s, DATA8 m __UNUSED__, DATA32 c __UNUSED__, DATA32 *d) {
72 *d = s;
73}
74
75#define _op_copy_pt_pan_dp_neon _op_copy_pt_p_dp_neon
76#define _op_copy_pt_pas_dp_neon _op_copy_pt_p_dp_neon
77
78#define _op_copy_pt_p_dpan_neon _op_copy_pt_p_dp_neon
79#define _op_copy_pt_pan_dpan_neon _op_copy_pt_pan_dp_neon
80#define _op_copy_pt_pas_dpan_neon _op_copy_pt_pas_dp_neon
81
82static void
83init_copy_pixel_pt_funcs_neon(void)
84{
85 op_copy_pt_funcs[SP][SM_N][SC_N][DP][CPU_NEON] = _op_copy_pt_p_dp_neon;
86 op_copy_pt_funcs[SP_AN][SM_N][SC_N][DP][CPU_NEON] = _op_copy_pt_pan_dp_neon;
87 op_copy_pt_funcs[SP_AS][SM_N][SC_N][DP][CPU_NEON] = _op_copy_pt_pas_dp_neon;
88
89 op_copy_pt_funcs[SP][SM_N][SC_N][DP_AN][CPU_NEON] = _op_copy_pt_p_dpan_neon;
90 op_copy_pt_funcs[SP_AN][SM_N][SC_N][DP_AN][CPU_NEON] = _op_copy_pt_pan_dpan_neon;
91 op_copy_pt_funcs[SP_AS][SM_N][SC_N][DP_AN][CPU_NEON] = _op_copy_pt_pas_dpan_neon;
92}
93#endif
94
95/*-----*/
96
97/* copy_rel pixel --> dst */
98
99#ifdef BUILD_NEON
100static void
101_op_copy_rel_p_dp_neon(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c __UNUSED__, DATA32 *d, int l) {
102 // FIXME: neon-it
103 DATA32 *e;
104 UNROLL8_PLD_WHILE(d, l, e,
105 {
106 *d = MUL_SYM(*d >> 24, c);
107 d++;
108 });
109}
110
111
112#define _op_copy_rel_pas_dp_neon _op_copy_rel_p_dp_neon
113#define _op_copy_rel_pan_dp_neon _op_copy_rel_p_dp_neon
114
115#define _op_copy_rel_p_dpan_neon _op_copy_p_dpan_neon
116#define _op_copy_rel_pan_dpan_neon _op_copy_pan_dpan_neon
117#define _op_copy_rel_pas_dpan_neon _op_copy_pas_dpan_neon
118
119static void
120init_copy_rel_pixel_span_funcs_neon(void)
121{
122 op_copy_rel_span_funcs[SP][SM_N][SC_N][DP][CPU_NEON] = _op_copy_rel_p_dp_neon;
123 op_copy_rel_span_funcs[SP_AN][SM_N][SC_N][DP][CPU_NEON] = _op_copy_rel_pan_dp_neon;
124 op_copy_rel_span_funcs[SP_AS][SM_N][SC_N][DP][CPU_NEON] = _op_copy_rel_pas_dp_neon;
125
126 op_copy_rel_span_funcs[SP][SM_N][SC_N][DP_AN][CPU_NEON] = _op_copy_rel_p_dpan_neon;
127 op_copy_rel_span_funcs[SP_AN][SM_N][SC_N][DP_AN][CPU_NEON] = _op_copy_rel_pan_dpan_neon;
128 op_copy_rel_span_funcs[SP_AS][SM_N][SC_N][DP_AN][CPU_NEON] = _op_copy_rel_pas_dpan_neon;
129}
130#endif
131
132#ifdef BUILD_NEON
133static void
134_op_copy_rel_pt_p_dp_neon(DATA32 s, DATA8 m __UNUSED__, DATA32 c, DATA32 *d) {
135 s = 1 + (*d >> 24);
136 *d = MUL_256(s, c);
137}
138
139
140#define _op_copy_rel_pt_pan_dp_neon _op_copy_rel_pt_p_dp_neon
141#define _op_copy_rel_pt_pas_dp_neon _op_copy_rel_pt_p_dp_neon
142
143#define _op_copy_rel_pt_p_dpan_neon _op_copy_pt_p_dpan_neon
144#define _op_copy_rel_pt_pan_dpan_neon _op_copy_pt_pan_dpan_neon
145#define _op_copy_rel_pt_pas_dpan_neon _op_copy_pt_pas_dpan_neon
146
147static void
148init_copy_rel_pixel_pt_funcs_neon(void)
149{
150 op_copy_rel_pt_funcs[SP][SM_N][SC_N][DP][CPU_NEON] = _op_copy_rel_pt_p_dp_neon;
151 op_copy_rel_pt_funcs[SP_AN][SM_N][SC_N][DP][CPU_NEON] = _op_copy_rel_pt_pan_dp_neon;
152 op_copy_rel_pt_funcs[SP_AS][SM_N][SC_N][DP][CPU_NEON] = _op_copy_rel_pt_pas_dp_neon;
153
154 op_copy_rel_pt_funcs[SP][SM_N][SC_N][DP_AN][CPU_NEON] = _op_copy_rel_pt_p_dpan_neon;
155 op_copy_rel_pt_funcs[SP_AN][SM_N][SC_N][DP_AN][CPU_NEON] = _op_copy_rel_pt_pan_dpan_neon;
156 op_copy_rel_pt_funcs[SP_AS][SM_N][SC_N][DP_AN][CPU_NEON] = _op_copy_rel_pt_pas_dpan_neon;
157}
158#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_copy_main_.c b/libraries/evas/src/lib/engines/common/evas_op_copy_main_.c
new file mode 100644
index 0000000..4575aee
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_copy_main_.c
@@ -0,0 +1,675 @@
1#include "evas_common.h"
2#include "evas_blend_private.h"
3
4static RGBA_Gfx_Func op_copy_span_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
5static RGBA_Gfx_Pt_Func op_copy_pt_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
6
7static void op_copy_init(void);
8static void op_copy_shutdown(void);
9
10static RGBA_Gfx_Func op_copy_pixel_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels);
11static RGBA_Gfx_Func op_copy_color_span_get(DATA32 col, RGBA_Image *dst, int pixels);
12static RGBA_Gfx_Func op_copy_pixel_color_span_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels);
13static RGBA_Gfx_Func op_copy_mask_color_span_get(DATA32 col, RGBA_Image *dst, int pixels);
14static RGBA_Gfx_Func op_copy_pixel_mask_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels);
15
16static RGBA_Gfx_Pt_Func op_copy_pixel_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst);
17static RGBA_Gfx_Pt_Func op_copy_color_pt_get(DATA32 col, RGBA_Image *dst);
18static RGBA_Gfx_Pt_Func op_copy_pixel_color_pt_get(Image_Entry_Flags src_flags, DATA32 col, RGBA_Image *dst);
19static RGBA_Gfx_Pt_Func op_copy_mask_color_pt_get(DATA32 col, RGBA_Image *dst);
20static RGBA_Gfx_Pt_Func op_copy_pixel_mask_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst);
21
22static RGBA_Gfx_Compositor _composite_copy = { "copy",
23 op_copy_init, op_copy_shutdown,
24 op_copy_pixel_span_get, op_copy_color_span_get,
25 op_copy_pixel_color_span_get, op_copy_mask_color_span_get,
26 op_copy_pixel_mask_span_get,
27 op_copy_pixel_pt_get, op_copy_color_pt_get,
28 op_copy_pixel_color_pt_get, op_copy_mask_color_pt_get,
29 op_copy_pixel_mask_pt_get
30 };
31
32RGBA_Gfx_Compositor *
33evas_common_gfx_compositor_copy_get(void)
34{
35 return &(_composite_copy);
36}
37
38
39static RGBA_Gfx_Func op_copy_rel_span_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
40static RGBA_Gfx_Pt_Func op_copy_rel_pt_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
41
42static void op_copy_rel_init(void);
43static void op_copy_rel_shutdown(void);
44
45static RGBA_Gfx_Func op_copy_rel_pixel_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels);
46static RGBA_Gfx_Func op_copy_rel_color_span_get(DATA32 col, RGBA_Image *dst, int pixels);
47static RGBA_Gfx_Func op_copy_rel_pixel_color_span_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels);
48static RGBA_Gfx_Func op_copy_rel_mask_color_span_get(DATA32 col, RGBA_Image *dst, int pixels);
49static RGBA_Gfx_Func op_copy_rel_pixel_mask_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels);
50
51static RGBA_Gfx_Pt_Func op_copy_rel_pixel_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst);
52/* XXX: doesn't exist
53static RGBA_Gfx_Pt_Func op_copy_rel_color_pt_get(DATA32 col, RGBA_Image *dst);
54 */
55static RGBA_Gfx_Pt_Func op_copy_rel_pixel_color_pt_get(Image_Entry_Flags src_flags, DATA32 col, RGBA_Image *dst);
56static RGBA_Gfx_Pt_Func op_copy_rel_mask_color_pt_get(DATA32 col, RGBA_Image *dst);
57static RGBA_Gfx_Pt_Func op_copy_rel_pixel_mask_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst);
58
59static RGBA_Gfx_Compositor _composite_copy_rel = { "copy_rel",
60 op_copy_rel_init, op_copy_rel_shutdown,
61 op_copy_rel_pixel_span_get, op_copy_rel_color_span_get,
62 op_copy_rel_pixel_color_span_get, op_copy_rel_mask_color_span_get,
63 op_copy_rel_pixel_mask_span_get,
64 op_copy_rel_pixel_pt_get, op_copy_color_pt_get,
65 op_copy_rel_pixel_color_pt_get, op_copy_rel_mask_color_pt_get,
66 op_copy_rel_pixel_mask_pt_get
67 };
68
69RGBA_Gfx_Compositor *
70evas_common_gfx_compositor_copy_rel_get(void)
71{
72 return &(_composite_copy_rel);
73}
74
75
76# include "./evas_op_copy/op_copy_pixel_.c"
77# include "./evas_op_copy/op_copy_color_.c"
78# include "./evas_op_copy/op_copy_pixel_color_.c"
79# include "./evas_op_copy/op_copy_pixel_mask_.c"
80# include "./evas_op_copy/op_copy_mask_color_.c"
81//# include "./evas_op_copy/op_copy_pixel_mask_color_.c"
82
83# include "./evas_op_copy/op_copy_pixel_i386.c"
84# include "./evas_op_copy/op_copy_color_i386.c"
85# include "./evas_op_copy/op_copy_pixel_color_i386.c"
86# include "./evas_op_copy/op_copy_pixel_mask_i386.c"
87# include "./evas_op_copy/op_copy_mask_color_i386.c"
88//# include "./evas_op_copy/op_copy_pixel_mask_color_i386.c"
89
90# include "./evas_op_copy/op_copy_pixel_neon.c"
91# include "./evas_op_copy/op_copy_color_neon.c"
92# include "./evas_op_copy/op_copy_pixel_color_neon.c"
93# include "./evas_op_copy/op_copy_pixel_mask_neon.c"
94# include "./evas_op_copy/op_copy_mask_color_neon.c"
95//# include "./evas_op_copy/op_copy_pixel_mask_color_neon.c"
96
97
98static void
99op_copy_init(void)
100{
101 memset(op_copy_span_funcs, 0, sizeof(op_copy_span_funcs));
102 memset(op_copy_pt_funcs, 0, sizeof(op_copy_pt_funcs));
103#ifdef BUILD_MMX
104 init_copy_pixel_span_funcs_mmx();
105 init_copy_pixel_color_span_funcs_mmx();
106 init_copy_pixel_mask_span_funcs_mmx();
107 init_copy_color_span_funcs_mmx();
108 init_copy_mask_color_span_funcs_mmx();
109
110 init_copy_pixel_pt_funcs_mmx();
111 init_copy_pixel_color_pt_funcs_mmx();
112 init_copy_pixel_mask_pt_funcs_mmx();
113 init_copy_color_pt_funcs_mmx();
114 init_copy_mask_color_pt_funcs_mmx();
115#endif
116#ifdef BUILD_NEON
117 init_copy_pixel_span_funcs_neon();
118 init_copy_pixel_color_span_funcs_neon();
119 init_copy_pixel_mask_span_funcs_neon();
120 init_copy_color_span_funcs_neon();
121 init_copy_mask_color_span_funcs_neon();
122
123 init_copy_pixel_pt_funcs_neon();
124 init_copy_pixel_color_pt_funcs_neon();
125 init_copy_pixel_mask_pt_funcs_neon();
126 init_copy_color_pt_funcs_neon();
127 init_copy_mask_color_pt_funcs_neon();
128#endif
129#ifdef BUILD_C
130 init_copy_pixel_span_funcs_c();
131 init_copy_pixel_color_span_funcs_c();
132 init_copy_pixel_mask_span_funcs_c();
133 init_copy_color_span_funcs_c();
134 init_copy_mask_color_span_funcs_c();
135
136 init_copy_pixel_pt_funcs_c();
137 init_copy_pixel_color_pt_funcs_c();
138 init_copy_pixel_mask_pt_funcs_c();
139 init_copy_color_pt_funcs_c();
140 init_copy_mask_color_pt_funcs_c();
141#endif
142}
143
144static void
145op_copy_shutdown(void)
146{
147}
148
149static RGBA_Gfx_Func
150copy_gfx_span_func_cpu(int s, int m, int c, int d)
151{
152 RGBA_Gfx_Func func = NULL;
153 int cpu = CPU_N;
154#ifdef BUILD_MMX
155 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
156 {
157 cpu = CPU_MMX;
158 func = op_copy_span_funcs[s][m][c][d][cpu];
159 if (func) return func;
160 }
161#endif
162#ifdef BUILD_NEON
163 if (evas_common_cpu_has_feature(CPU_FEATURE_NEON))
164 {
165 cpu = CPU_NEON;
166 func = op_copy_span_funcs[s][m][c][d][cpu];
167 if (func) return func;
168 }
169#endif
170#ifdef BUILD_C
171 cpu = CPU_C;
172 func = op_copy_span_funcs[s][m][c][d][cpu];
173 if (func) return func;
174#endif
175 return func;
176}
177
178static RGBA_Gfx_Func
179op_copy_pixel_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels __UNUSED__)
180{
181 int s = SP_AN, m = SM_N, c = SC_N, d = DP_AN;
182
183 if (src && src->cache_entry.flags.alpha)
184 {
185 dst->cache_entry.flags.alpha = 1;
186 s = SP;
187 }
188 if (dst && dst->cache_entry.flags.alpha)
189 d = DP;
190 return copy_gfx_span_func_cpu(s, m, c, d);
191}
192
193static RGBA_Gfx_Func
194op_copy_color_span_get(DATA32 col, RGBA_Image *dst, int pixels __UNUSED__)
195{
196 int s = SP_N, m = SM_N, c = SC_AN, d = DP_AN;
197
198 if ((col >> 24) < 255)
199 {
200 if (dst)
201 dst->cache_entry.flags.alpha = 1;
202 c = SC;
203 }
204 if (col == ((col >> 24) * 0x01010101))
205 c = SC_AA;
206 if (col == 0xffffffff)
207 c = SC_N;
208 if (dst && dst->cache_entry.flags.alpha)
209 d = DP;
210 return copy_gfx_span_func_cpu(s, m, c, d);
211}
212
213static RGBA_Gfx_Func
214op_copy_pixel_color_span_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels __UNUSED__)
215{
216 int s = SP_AN, m = SM_N, c = SC_AN, d = DP_AN;
217
218 if (src && src->cache_entry.flags.alpha)
219 {
220 if (dst)
221 dst->cache_entry.flags.alpha = 1;
222 s = SP;
223 }
224 if ((col >> 24) < 255)
225 {
226 if (dst)
227 dst->cache_entry.flags.alpha = 1;
228 c = SC;
229 }
230 if (col == ((col >> 24) * 0x01010101))
231 c = SC_AA;
232 if (col == 0xffffffff)
233 c = SC_N;
234 if (dst && dst->cache_entry.flags.alpha)
235 d = DP;
236 return copy_gfx_span_func_cpu(s, m, c, d);
237}
238
239static RGBA_Gfx_Func
240op_copy_mask_color_span_get(DATA32 col, RGBA_Image *dst, int pixels __UNUSED__)
241{
242 int s = SP_N, m = SM_AS, c = SC_AN, d = DP;
243
244 if (dst)
245 dst->cache_entry.flags.alpha = 1;
246 if ((col >> 24) < 255)
247 c = SC;
248 if (col == ((col >> 24) * 0x01010101))
249 c = SC_AA;
250 if (col == 0xffffffff)
251 c = SC_N;
252 return copy_gfx_span_func_cpu(s, m, c, d);
253}
254
255static RGBA_Gfx_Func
256op_copy_pixel_mask_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels __UNUSED__)
257{
258 int s = SP_AN, m = SM_AS, c = SC_N, d = DP;
259
260 if (dst)
261 dst->cache_entry.flags.alpha = 1;
262 if (src && src->cache_entry.flags.alpha)
263 s = SP;
264 return copy_gfx_span_func_cpu(s, m, c, d);
265}
266
267static RGBA_Gfx_Pt_Func
268copy_gfx_pt_func_cpu(int s, int m, int c, int d)
269{
270 RGBA_Gfx_Pt_Func func = NULL;
271 int cpu = CPU_N;
272#ifdef BUILD_MMX
273 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
274 {
275 cpu = CPU_MMX;
276 func = op_copy_pt_funcs[s][m][c][d][cpu];
277 if (func) return func;
278 }
279#endif
280#ifdef BUILD_NEON
281 if (evas_common_cpu_has_feature(CPU_FEATURE_NEON))
282 {
283 cpu = CPU_NEON;
284 func = op_copy_pt_funcs[s][m][c][d][cpu];
285 if (func) return func;
286 }
287#endif
288#ifdef BUILD_C
289 cpu = CPU_C;
290 func = op_copy_pt_funcs[s][m][c][d][cpu];
291 if (func) return func;
292#endif
293 return func;
294}
295
296static RGBA_Gfx_Pt_Func
297op_copy_pixel_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst)
298{
299 int s = SP_AN, m = SM_N, c = SC_N, d = DP_AN;
300
301 if (src_flags.alpha)
302 {
303 dst->cache_entry.flags.alpha = 1;
304 s = SP;
305 }
306 if (dst && dst->cache_entry.flags.alpha)
307 d = DP;
308 return copy_gfx_pt_func_cpu(s, m, c, d);
309}
310
311static RGBA_Gfx_Pt_Func
312op_copy_color_pt_get(DATA32 col, RGBA_Image *dst)
313{
314 int s = SP_N, m = SM_N, c = SC_AN, d = DP_AN;
315
316 if ((col >> 24) < 255)
317 {
318 if (dst)
319 dst->cache_entry.flags.alpha = 1;
320 c = SC;
321 }
322 if (col == ((col >> 24) * 0x01010101))
323 c = SC_AA;
324 if (col == 0xffffffff)
325 c = SC_N;
326 if (dst && dst->cache_entry.flags.alpha)
327 d = DP;
328 return copy_gfx_pt_func_cpu(s, m, c, d);
329}
330
331static RGBA_Gfx_Pt_Func
332op_copy_pixel_color_pt_get(Image_Entry_Flags src_flags, DATA32 col, RGBA_Image *dst)
333{
334 int s = SP_AN, m = SM_N, c = SC_AN, d = DP_AN;
335
336 if (src_flags.alpha)
337 {
338 if (dst)
339 dst->cache_entry.flags.alpha = 1;
340 s = SP;
341 }
342 if ((col >> 24) < 255)
343 {
344 if (dst)
345 dst->cache_entry.flags.alpha = 1;
346 c = SC;
347 }
348 if (col == ((col >> 24) * 0x01010101))
349 c = SC_AA;
350 if (col == 0xffffffff)
351 c = SC_N;
352 if (dst && dst->cache_entry.flags.alpha)
353 d = DP;
354 return copy_gfx_pt_func_cpu(s, m, c, d);
355}
356
357static RGBA_Gfx_Pt_Func
358op_copy_mask_color_pt_get(DATA32 col, RGBA_Image *dst)
359{
360 int s = SP_N, m = SM_AS, c = SC_AN, d = DP;
361
362 if (dst)
363 dst->cache_entry.flags.alpha = 1;
364 if ((col >> 24) < 255)
365 c = SC;
366 if (col == ((col >> 24) * 0x01010101))
367 c = SC_AA;
368 if (col == 0xffffffff)
369 c = SC_N;
370 return copy_gfx_pt_func_cpu(s, m, c, d);
371}
372
373static RGBA_Gfx_Pt_Func
374op_copy_pixel_mask_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst)
375{
376 int s = SP_AN, m = SM_AS, c = SC_N, d = DP;
377
378 if (dst)
379 dst->cache_entry.flags.alpha = 1;
380 if (src_flags.alpha)
381 s = SP;
382 return copy_gfx_pt_func_cpu(s, m, c, d);
383}
384
385
386static void
387op_copy_rel_init(void)
388{
389 memset(op_copy_rel_span_funcs, 0, sizeof(op_copy_rel_span_funcs));
390 memset(op_copy_rel_pt_funcs, 0, sizeof(op_copy_rel_pt_funcs));
391#ifdef BUILD_MMX
392 init_copy_rel_pixel_span_funcs_mmx();
393 init_copy_rel_pixel_color_span_funcs_mmx();
394 init_copy_rel_pixel_mask_span_funcs_mmx();
395 init_copy_rel_color_span_funcs_mmx();
396 init_copy_rel_mask_color_span_funcs_mmx();
397
398 init_copy_rel_pixel_pt_funcs_mmx();
399 init_copy_rel_pixel_color_pt_funcs_mmx();
400 init_copy_rel_pixel_mask_pt_funcs_mmx();
401 init_copy_rel_color_pt_funcs_mmx();
402 init_copy_rel_mask_color_pt_funcs_mmx();
403#endif
404#ifdef BUILD_NEON
405 init_copy_rel_pixel_span_funcs_neon();
406 init_copy_rel_pixel_color_span_funcs_neon();
407 init_copy_rel_pixel_mask_span_funcs_neon();
408 init_copy_rel_color_span_funcs_neon();
409 init_copy_rel_mask_color_span_funcs_neon();
410
411 init_copy_rel_pixel_pt_funcs_neon();
412 init_copy_rel_pixel_color_pt_funcs_neon();
413 init_copy_rel_pixel_mask_pt_funcs_neon();
414 init_copy_rel_color_pt_funcs_neon();
415 init_copy_rel_mask_color_pt_funcs_neon();
416#endif
417#ifdef BUILD_C
418 init_copy_rel_pixel_span_funcs_c();
419 init_copy_rel_pixel_color_span_funcs_c();
420 init_copy_rel_pixel_mask_span_funcs_c();
421 init_copy_rel_color_span_funcs_c();
422 init_copy_rel_mask_color_span_funcs_c();
423
424 init_copy_rel_pixel_pt_funcs_c();
425 init_copy_rel_pixel_color_pt_funcs_c();
426 init_copy_rel_pixel_mask_pt_funcs_c();
427 init_copy_rel_color_pt_funcs_c();
428 init_copy_rel_mask_color_pt_funcs_c();
429#endif
430}
431
432static void
433op_copy_rel_shutdown(void)
434{
435}
436
437static RGBA_Gfx_Func
438copy_rel_gfx_span_func_cpu(int s, int m, int c, int d)
439{
440 RGBA_Gfx_Func func = NULL;
441 int cpu = CPU_N;
442#ifdef BUILD_MMX
443 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
444 {
445 cpu = CPU_MMX;
446 func = op_copy_rel_span_funcs[s][m][c][d][cpu];
447 if (func) return func;
448 }
449#endif
450#ifdef BUILD_NEON
451 if (evas_common_cpu_has_feature(CPU_FEATURE_NEON))
452 {
453 cpu = CPU_NEON;
454 func = op_copy_rel_span_funcs[s][m][c][d][cpu];
455 if (func) return func;
456 }
457#endif
458#ifdef BUILD_C
459 cpu = CPU_C;
460 func = op_copy_rel_span_funcs[s][m][c][d][cpu];
461 if (func) return func;
462#endif
463 return func;
464}
465
466static RGBA_Gfx_Func
467op_copy_rel_pixel_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels __UNUSED__)
468{
469 int s = SP_AN, m = SM_N, c = SC_N, d = DP_AN;
470
471 if (src && src->cache_entry.flags.alpha)
472 {
473 if (dst)
474 dst->cache_entry.flags.alpha = 1;
475 s = SP;
476 }
477 if (dst && dst->cache_entry.flags.alpha)
478 d = DP;
479 return copy_rel_gfx_span_func_cpu(s, m, c, d);
480}
481
482static RGBA_Gfx_Func
483op_copy_rel_color_span_get(DATA32 col, RGBA_Image *dst, int pixels __UNUSED__)
484{
485 int s = SP_N, m = SM_N, c = SC_AN, d = DP_AN;
486
487 if ((col >> 24) < 255)
488 {
489 if (dst)
490 dst->cache_entry.flags.alpha = 1;
491 c = SC;
492 }
493 if (col == ((col >> 24) * 0x01010101))
494 c = SC_AA;
495 if (col == 0xffffffff)
496 c = SC_N;
497 if (dst && dst->cache_entry.flags.alpha)
498 d = DP;
499 return copy_rel_gfx_span_func_cpu(s, m, c, d);
500}
501
502static RGBA_Gfx_Func
503op_copy_rel_pixel_color_span_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels __UNUSED__)
504{
505 int s = SP_AN, m = SM_N, c = SC_AN, d = DP_AN;
506
507 if (src && src->cache_entry.flags.alpha)
508 {
509 if (dst)
510 dst->cache_entry.flags.alpha = 1;
511 s = SP;
512 }
513 if ((col >> 24) < 255)
514 {
515 if (dst)
516 dst->cache_entry.flags.alpha = 1;
517 c = SC;
518 }
519 if (col == ((col >> 24) * 0x01010101))
520 c = SC_AA;
521 if (col == 0xffffffff)
522 c = SC_N;
523 if (dst && dst->cache_entry.flags.alpha)
524 d = DP;
525 return copy_rel_gfx_span_func_cpu(s, m, c, d);
526}
527
528static RGBA_Gfx_Func
529op_copy_rel_mask_color_span_get(DATA32 col, RGBA_Image *dst, int pixels __UNUSED__)
530{
531 int s = SP_N, m = SM_AS, c = SC_AN, d = DP;
532
533 if (dst)
534 dst->cache_entry.flags.alpha = 1;
535 if ((col >> 24) < 255)
536 c = SC;
537 if (col == ((col >> 24) * 0x01010101))
538 c = SC_AA;
539 if (col == 0xffffffff)
540 c = SC_N;
541 return copy_rel_gfx_span_func_cpu(s, m, c, d);
542}
543
544static RGBA_Gfx_Func
545op_copy_rel_pixel_mask_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels __UNUSED__)
546{
547 int s = SP_AN, m = SM_AS, c = SC_N, d = DP;
548
549 if (dst)
550 dst->cache_entry.flags.alpha = 1;
551 if (src && src->cache_entry.flags.alpha)
552 s = SP;
553 return copy_rel_gfx_span_func_cpu(s, m, c, d);
554}
555
556static RGBA_Gfx_Pt_Func
557copy_rel_gfx_pt_func_cpu(int s, int m, int c, int d)
558{
559 RGBA_Gfx_Pt_Func func = NULL;
560 int cpu = CPU_N;
561#ifdef BUILD_MMX
562 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
563 {
564 cpu = CPU_MMX;
565 func = op_copy_rel_pt_funcs[s][m][c][d][cpu];
566 if (func) return func;
567 }
568#endif
569#ifdef BUILD_NEON
570 if (evas_common_cpu_has_feature(CPU_FEATURE_NEON))
571 {
572 cpu = CPU_NEON;
573 func = op_copy_rel_pt_funcs[s][m][c][d][cpu];
574 if (func) return func;
575 }
576#endif
577#ifdef BUILD_C
578 cpu = CPU_C;
579 func = op_copy_rel_pt_funcs[s][m][c][d][cpu];
580 if (func) return func;
581#endif
582 return func;
583}
584
585static RGBA_Gfx_Pt_Func
586op_copy_rel_pixel_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst)
587{
588 int s = SP_AN, m = SM_N, c = SC_N, d = DP_AN;
589
590 if (src_flags.alpha)
591 {
592 if (dst)
593 dst->cache_entry.flags.alpha = 1;
594 s = SP;
595 }
596 if (dst && dst->cache_entry.flags.alpha)
597 d = DP;
598 return copy_rel_gfx_pt_func_cpu(s, m, c, d);
599}
600
601/* XXX: not used
602static RGBA_Gfx_Pt_Func
603op_copy_rel_color_pt_get(DATA32 col, RGBA_Image *dst)
604{
605 int s = SP_N, m = SM_N, c = SC_AN, d = DP_AN;
606
607 if ((col >> 24) < 255)
608 {
609 if (dst)
610 dst->cache_entry.flags.alpha = 1;
611 c = SC;
612 }
613 if (col == ((col >> 24) * 0x01010101))
614 c = SC_AA;
615 if (col == 0xffffffff)
616 c = SC_N;
617 if (dst && dst->cache_entry.flags.alpha)
618 d = DP;
619 return copy_rel_gfx_pt_func_cpu(s, m, c, d);
620}
621*/
622
623static RGBA_Gfx_Pt_Func
624op_copy_rel_pixel_color_pt_get(Image_Entry_Flags src_flags, DATA32 col, RGBA_Image *dst)
625{
626 int s = SP_AN, m = SM_N, c = SC_AN, d = DP_AN;
627
628 if (src_flags.alpha)
629 {
630 if (dst)
631 dst->cache_entry.flags.alpha = 1;
632 s = SP;
633 }
634 if ((col >> 24) < 255)
635 {
636 if (dst)
637 dst->cache_entry.flags.alpha = 1;
638 c = SC;
639 }
640 if (col == ((col >> 24) * 0x01010101))
641 c = SC_AA;
642 if (col == 0xffffffff)
643 c = SC_N;
644 if (dst && dst->cache_entry.flags.alpha)
645 d = DP;
646 return copy_rel_gfx_pt_func_cpu(s, m, c, d);
647}
648
649static RGBA_Gfx_Pt_Func
650op_copy_rel_mask_color_pt_get(DATA32 col, RGBA_Image *dst)
651{
652 int s = SP_N, m = SM_AS, c = SC_AN, d = DP;
653
654 if (dst)
655 dst->cache_entry.flags.alpha = 1;
656 if ((col >> 24) < 255)
657 c = SC;
658 if (col == ((col >> 24) * 0x01010101))
659 c = SC_AA;
660 if (col == 0xffffffff)
661 c = SC_N;
662 return copy_rel_gfx_pt_func_cpu(s, m, c, d);
663}
664
665static RGBA_Gfx_Pt_Func
666op_copy_rel_pixel_mask_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst)
667{
668 int s = SP_AN, m = SM_AS, c = SC_N, d = DP;
669
670 if (dst)
671 dst->cache_entry.flags.alpha = 1;
672 if (src_flags.alpha)
673 s = SP;
674 return copy_rel_gfx_pt_func_cpu(s, m, c, d);
675}
diff --git a/libraries/evas/src/lib/engines/common/evas_op_mask/Makefile.am b/libraries/evas/src/lib/engines/common/evas_op_mask/Makefile.am
new file mode 100644
index 0000000..47eefd2
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_mask/Makefile.am
@@ -0,0 +1,13 @@
1MAINTAINERCLEANFILES = Makefile.in
2
3EXTRA_DIST = \
4op_mask_color_.c \
5op_mask_color_i386.c \
6op_mask_mask_color_.c \
7op_mask_mask_color_i386.c \
8op_mask_pixel_.c \
9op_mask_pixel_color_.c \
10op_mask_pixel_color_i386.c \
11op_mask_pixel_i386.c \
12op_mask_pixel_mask_.c \
13op_mask_pixel_mask_i386.c
diff --git a/libraries/evas/src/lib/engines/common/evas_op_mask/Makefile.in b/libraries/evas/src/lib/engines/common/evas_op_mask/Makefile.in
new file mode 100644
index 0000000..0ccd7f3
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_mask/Makefile.in
@@ -0,0 +1,543 @@
1# Makefile.in generated by automake 1.11.1 from Makefile.am.
2# @configure_input@
3
4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
6# Inc.
7# This Makefile.in is free software; the Free Software Foundation
8# gives unlimited permission to copy and/or distribute it,
9# with or without modifications, as long as this notice is preserved.
10
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
13# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14# PARTICULAR PURPOSE.
15
16@SET_MAKE@
17VPATH = @srcdir@
18pkgdatadir = $(datadir)/@PACKAGE@
19pkgincludedir = $(includedir)/@PACKAGE@
20pkglibdir = $(libdir)/@PACKAGE@
21pkglibexecdir = $(libexecdir)/@PACKAGE@
22am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
23install_sh_DATA = $(install_sh) -c -m 644
24install_sh_PROGRAM = $(install_sh) -c
25install_sh_SCRIPT = $(install_sh) -c
26INSTALL_HEADER = $(INSTALL_DATA)
27transform = $(program_transform_name)
28NORMAL_INSTALL = :
29PRE_INSTALL = :
30POST_INSTALL = :
31NORMAL_UNINSTALL = :
32PRE_UNINSTALL = :
33POST_UNINSTALL = :
34build_triplet = @build@
35host_triplet = @host@
36subdir = src/lib/engines/common/evas_op_mask
37DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
38ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
39am__aclocal_m4_deps = $(top_srcdir)/m4/efl_attribute.m4 \
40 $(top_srcdir)/m4/efl_coverage.m4 \
41 $(top_srcdir)/m4/efl_doxygen.m4 \
42 $(top_srcdir)/m4/efl_fnmatch.m4 \
43 $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \
44 $(top_srcdir)/m4/evas_check_engine.m4 \
45 $(top_srcdir)/m4/evas_check_loader.m4 \
46 $(top_srcdir)/m4/evas_converter.m4 \
47 $(top_srcdir)/m4/evas_dither.m4 \
48 $(top_srcdir)/m4/evas_scaler.m4 $(top_srcdir)/m4/libtool.m4 \
49 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
50 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
51 $(top_srcdir)/configure.ac
52am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
53 $(ACLOCAL_M4)
54mkinstalldirs = $(install_sh) -d
55CONFIG_HEADER = $(top_builddir)/config.h
56CONFIG_CLEAN_FILES =
57CONFIG_CLEAN_VPATH_FILES =
58AM_V_GEN = $(am__v_GEN_$(V))
59am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
60am__v_GEN_0 = @echo " GEN " $@;
61AM_V_at = $(am__v_at_$(V))
62am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
63am__v_at_0 = @
64SOURCES =
65DIST_SOURCES =
66DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
67ACLOCAL = @ACLOCAL@
68ALLOCA = @ALLOCA@
69AMTAR = @AMTAR@
70AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
71AR = @AR@
72AS = @AS@
73AUTOCONF = @AUTOCONF@
74AUTOHEADER = @AUTOHEADER@
75AUTOMAKE = @AUTOMAKE@
76AWK = @AWK@
77CC = @CC@
78CCDEPMODE = @CCDEPMODE@
79CFLAGS = @CFLAGS@
80CHECK_CFLAGS = @CHECK_CFLAGS@
81CHECK_LIBS = @CHECK_LIBS@
82CPP = @CPP@
83CPPFLAGS = @CPPFLAGS@
84CXX = @CXX@
85CXXCPP = @CXXCPP@
86CXXDEPMODE = @CXXDEPMODE@
87CXXFLAGS = @CXXFLAGS@
88CYGPATH_W = @CYGPATH_W@
89DEFS = @DEFS@
90DEPDIR = @DEPDIR@
91DIRECTFB_CFLAGS = @DIRECTFB_CFLAGS@
92DIRECTFB_LIBS = @DIRECTFB_LIBS@
93DLLTOOL = @DLLTOOL@
94DSYMUTIL = @DSYMUTIL@
95DUMPBIN = @DUMPBIN@
96ECHO_C = @ECHO_C@
97ECHO_N = @ECHO_N@
98ECHO_T = @ECHO_T@
99ECORE_EVAS_CFLAGS = @ECORE_EVAS_CFLAGS@
100ECORE_EVAS_LIBS = @ECORE_EVAS_LIBS@
101EDB_CFLAGS = @EDB_CFLAGS@
102EDB_LIBS = @EDB_LIBS@
103EDJE_CFLAGS = @EDJE_CFLAGS@
104EDJE_LIBS = @EDJE_LIBS@
105EET_CFLAGS = @EET_CFLAGS@
106EET_LIBS = @EET_LIBS@
107EFL_COVERAGE_CFLAGS = @EFL_COVERAGE_CFLAGS@
108EFL_COVERAGE_LIBS = @EFL_COVERAGE_LIBS@
109EFL_FNMATCH_LIBS = @EFL_FNMATCH_LIBS@
110EGREP = @EGREP@
111EINA_CFLAGS = @EINA_CFLAGS@
112EINA_LIBS = @EINA_LIBS@
113EVAS_CFLAGS = @EVAS_CFLAGS@
114EVAS_LIBS = @EVAS_LIBS@
115EVAS_SSE3_CFLAGS = @EVAS_SSE3_CFLAGS@
116EVIL_CFLAGS = @EVIL_CFLAGS@
117EVIL_LIBS = @EVIL_LIBS@
118EXEEXT = @EXEEXT@
119FGREP = @FGREP@
120FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@
121FONTCONFIG_LIBS = @FONTCONFIG_LIBS@
122FREETYPE_CFLAGS = @FREETYPE_CFLAGS@
123FREETYPE_LIBS = @FREETYPE_LIBS@
124FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@
125FRIBIDI_LIBS = @FRIBIDI_LIBS@
126GL_EET_CFLAGS = @GL_EET_CFLAGS@
127GL_EET_LIBS = @GL_EET_LIBS@
128GREP = @GREP@
129HARFBUZZ_CFLAGS = @HARFBUZZ_CFLAGS@
130HARFBUZZ_LIBS = @HARFBUZZ_LIBS@
131INSTALL = @INSTALL@
132INSTALL_DATA = @INSTALL_DATA@
133INSTALL_PROGRAM = @INSTALL_PROGRAM@
134INSTALL_SCRIPT = @INSTALL_SCRIPT@
135INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
136LD = @LD@
137LDFLAGS = @LDFLAGS@
138LIBOBJS = @LIBOBJS@
139LIBS = @LIBS@
140LIBTOOL = @LIBTOOL@
141LINEBREAK_CFLAGS = @LINEBREAK_CFLAGS@
142LINEBREAK_LIBS = @LINEBREAK_LIBS@
143LIPO = @LIPO@
144LN_S = @LN_S@
145LTLIBOBJS = @LTLIBOBJS@
146MAKEINFO = @MAKEINFO@
147MKDIR_P = @MKDIR_P@
148MODULE_ARCH = @MODULE_ARCH@
149NM = @NM@
150NMEDIT = @NMEDIT@
151OBJC = @OBJC@
152OBJCDEPMODE = @OBJCDEPMODE@
153OBJCFLAGS = @OBJCFLAGS@
154OBJDUMP = @OBJDUMP@
155OBJEXT = @OBJEXT@
156OTOOL = @OTOOL@
157OTOOL64 = @OTOOL64@
158PACKAGE = @PACKAGE@
159PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
160PACKAGE_NAME = @PACKAGE_NAME@
161PACKAGE_STRING = @PACKAGE_STRING@
162PACKAGE_TARNAME = @PACKAGE_TARNAME@
163PACKAGE_URL = @PACKAGE_URL@
164PACKAGE_VERSION = @PACKAGE_VERSION@
165PATH_SEPARATOR = @PATH_SEPARATOR@
166PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
167PIXMAN_LIBS = @PIXMAN_LIBS@
168PKG_CONFIG = @PKG_CONFIG@
169PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
170PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
171PNG_CFLAGS = @PNG_CFLAGS@
172PNG_LIBS = @PNG_LIBS@
173RANLIB = @RANLIB@
174SDL_CFLAGS = @SDL_CFLAGS@
175SDL_LIBS = @SDL_LIBS@
176SED = @SED@
177SET_MAKE = @SET_MAKE@
178SHELL = @SHELL@
179SHM_OPEN_LINK = @SHM_OPEN_LINK@
180STRIP = @STRIP@
181SVG_CFLAGS = @SVG_CFLAGS@
182SVG_LIBS = @SVG_LIBS@
183VALGRIND_CFLAGS = @VALGRIND_CFLAGS@
184VALGRIND_LIBS = @VALGRIND_LIBS@
185VERSION = @VERSION@
186VMAJ = @VMAJ@
187WIN32_CFLAGS = @WIN32_CFLAGS@
188WIN32_CPPFLAGS = @WIN32_CPPFLAGS@
189XCB_CFLAGS = @XCB_CFLAGS@
190XCB_GL_CFLAGS = @XCB_GL_CFLAGS@
191XCB_GL_LIBS = @XCB_GL_LIBS@
192XCB_LIBS = @XCB_LIBS@
193XEXT_CFLAGS = @XEXT_CFLAGS@
194XEXT_LIBS = @XEXT_LIBS@
195XMKMF = @XMKMF@
196X_CFLAGS = @X_CFLAGS@
197X_EXTRA_LIBS = @X_EXTRA_LIBS@
198X_LIBS = @X_LIBS@
199X_PRE_LIBS = @X_PRE_LIBS@
200abs_builddir = @abs_builddir@
201abs_srcdir = @abs_srcdir@
202abs_top_builddir = @abs_top_builddir@
203abs_top_srcdir = @abs_top_srcdir@
204ac_ct_CC = @ac_ct_CC@
205ac_ct_CXX = @ac_ct_CXX@
206ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
207ac_ct_OBJC = @ac_ct_OBJC@
208altivec_cflags = @altivec_cflags@
209am__include = @am__include@
210am__leading_dot = @am__leading_dot@
211am__quote = @am__quote@
212am__tar = @am__tar@
213am__untar = @am__untar@
214bindir = @bindir@
215build = @build@
216build_alias = @build_alias@
217build_cpu = @build_cpu@
218build_os = @build_os@
219build_vendor = @build_vendor@
220builddir = @builddir@
221datadir = @datadir@
222datarootdir = @datarootdir@
223dlopen_libs = @dlopen_libs@
224docdir = @docdir@
225dvidir = @dvidir@
226edje_cc = @edje_cc@
227efl_doxygen = @efl_doxygen@
228efl_have_doxygen = @efl_have_doxygen@
229evas_engine_buffer_cflags = @evas_engine_buffer_cflags@
230evas_engine_buffer_libs = @evas_engine_buffer_libs@
231evas_engine_direct3d_cflags = @evas_engine_direct3d_cflags@
232evas_engine_direct3d_libs = @evas_engine_direct3d_libs@
233evas_engine_directfb_cflags = @evas_engine_directfb_cflags@
234evas_engine_directfb_libs = @evas_engine_directfb_libs@
235evas_engine_fb_cflags = @evas_engine_fb_cflags@
236evas_engine_fb_libs = @evas_engine_fb_libs@
237evas_engine_gl_cocoa_cflags = @evas_engine_gl_cocoa_cflags@
238evas_engine_gl_cocoa_libs = @evas_engine_gl_cocoa_libs@
239evas_engine_gl_common_libs = @evas_engine_gl_common_libs@
240evas_engine_gl_sdl_cflags = @evas_engine_gl_sdl_cflags@
241evas_engine_gl_sdl_libs = @evas_engine_gl_sdl_libs@
242evas_engine_gl_xcb_cflags = @evas_engine_gl_xcb_cflags@
243evas_engine_gl_xcb_libs = @evas_engine_gl_xcb_libs@
244evas_engine_gl_xlib_cflags = @evas_engine_gl_xlib_cflags@
245evas_engine_gl_xlib_libs = @evas_engine_gl_xlib_libs@
246evas_engine_psl1ght_cflags = @evas_engine_psl1ght_cflags@
247evas_engine_psl1ght_libs = @evas_engine_psl1ght_libs@
248evas_engine_software_16_ddraw_cflags = @evas_engine_software_16_ddraw_cflags@
249evas_engine_software_16_ddraw_libs = @evas_engine_software_16_ddraw_libs@
250evas_engine_software_16_sdl_cflags = @evas_engine_software_16_sdl_cflags@
251evas_engine_software_16_sdl_libs = @evas_engine_software_16_sdl_libs@
252evas_engine_software_16_wince_cflags = @evas_engine_software_16_wince_cflags@
253evas_engine_software_16_wince_libs = @evas_engine_software_16_wince_libs@
254evas_engine_software_16_x11_cflags = @evas_engine_software_16_x11_cflags@
255evas_engine_software_16_x11_libs = @evas_engine_software_16_x11_libs@
256evas_engine_software_8_x11_cflags = @evas_engine_software_8_x11_cflags@
257evas_engine_software_8_x11_libs = @evas_engine_software_8_x11_libs@
258evas_engine_software_ddraw_cflags = @evas_engine_software_ddraw_cflags@
259evas_engine_software_ddraw_libs = @evas_engine_software_ddraw_libs@
260evas_engine_software_gdi_cflags = @evas_engine_software_gdi_cflags@
261evas_engine_software_gdi_libs = @evas_engine_software_gdi_libs@
262evas_engine_software_sdl_cflags = @evas_engine_software_sdl_cflags@
263evas_engine_software_sdl_libs = @evas_engine_software_sdl_libs@
264evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@
265evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@
266evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@
267evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@
268evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@
269evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@
270evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@
271evas_image_loader_edb_libs = @evas_image_loader_edb_libs@
272evas_image_loader_eet_cflags = @evas_image_loader_eet_cflags@
273evas_image_loader_eet_libs = @evas_image_loader_eet_libs@
274evas_image_loader_generic_cflags = @evas_image_loader_generic_cflags@
275evas_image_loader_generic_libs = @evas_image_loader_generic_libs@
276evas_image_loader_gif_cflags = @evas_image_loader_gif_cflags@
277evas_image_loader_gif_libs = @evas_image_loader_gif_libs@
278evas_image_loader_ico_cflags = @evas_image_loader_ico_cflags@
279evas_image_loader_ico_libs = @evas_image_loader_ico_libs@
280evas_image_loader_jpeg_cflags = @evas_image_loader_jpeg_cflags@
281evas_image_loader_jpeg_libs = @evas_image_loader_jpeg_libs@
282evas_image_loader_pmaps_cflags = @evas_image_loader_pmaps_cflags@
283evas_image_loader_pmaps_libs = @evas_image_loader_pmaps_libs@
284evas_image_loader_png_cflags = @evas_image_loader_png_cflags@
285evas_image_loader_png_libs = @evas_image_loader_png_libs@
286evas_image_loader_psd_cflags = @evas_image_loader_psd_cflags@
287evas_image_loader_psd_libs = @evas_image_loader_psd_libs@
288evas_image_loader_svg_cflags = @evas_image_loader_svg_cflags@
289evas_image_loader_svg_libs = @evas_image_loader_svg_libs@
290evas_image_loader_tga_cflags = @evas_image_loader_tga_cflags@
291evas_image_loader_tga_libs = @evas_image_loader_tga_libs@
292evas_image_loader_tiff_cflags = @evas_image_loader_tiff_cflags@
293evas_image_loader_tiff_libs = @evas_image_loader_tiff_libs@
294evas_image_loader_wbmp_cflags = @evas_image_loader_wbmp_cflags@
295evas_image_loader_wbmp_libs = @evas_image_loader_wbmp_libs@
296evas_image_loader_xpm_cflags = @evas_image_loader_xpm_cflags@
297evas_image_loader_xpm_libs = @evas_image_loader_xpm_libs@
298exec_prefix = @exec_prefix@
299have_evas_engine_gl_x11 = @have_evas_engine_gl_x11@
300have_evas_engine_gl_xcb = @have_evas_engine_gl_xcb@
301have_evas_engine_gl_xlib = @have_evas_engine_gl_xlib@
302have_evas_engine_software_x11 = @have_evas_engine_software_x11@
303have_evas_engine_software_xcb = @have_evas_engine_software_xcb@
304have_evas_engine_software_xlib = @have_evas_engine_software_xlib@
305have_lcov = @have_lcov@
306host = @host@
307host_alias = @host_alias@
308host_cpu = @host_cpu@
309host_os = @host_os@
310host_vendor = @host_vendor@
311htmldir = @htmldir@
312includedir = @includedir@
313infodir = @infodir@
314install_sh = @install_sh@
315libdir = @libdir@
316libexecdir = @libexecdir@
317localedir = @localedir@
318localstatedir = @localstatedir@
319lt_ECHO = @lt_ECHO@
320lt_enable_auto_import = @lt_enable_auto_import@
321mandir = @mandir@
322mkdir_p = @mkdir_p@
323oldincludedir = @oldincludedir@
324pdfdir = @pdfdir@
325pkgconfig_requires_private = @pkgconfig_requires_private@
326prefix = @prefix@
327program_transform_name = @program_transform_name@
328psdir = @psdir@
329pthread_cflags = @pthread_cflags@
330pthread_libs = @pthread_libs@
331release_info = @release_info@
332requirement_evas = @requirement_evas@
333sbindir = @sbindir@
334sharedstatedir = @sharedstatedir@
335srcdir = @srcdir@
336sysconfdir = @sysconfdir@
337target_alias = @target_alias@
338top_build_prefix = @top_build_prefix@
339top_builddir = @top_builddir@
340top_srcdir = @top_srcdir@
341version_info = @version_info@
342MAINTAINERCLEANFILES = Makefile.in
343EXTRA_DIST = \
344op_mask_color_.c \
345op_mask_color_i386.c \
346op_mask_mask_color_.c \
347op_mask_mask_color_i386.c \
348op_mask_pixel_.c \
349op_mask_pixel_color_.c \
350op_mask_pixel_color_i386.c \
351op_mask_pixel_i386.c \
352op_mask_pixel_mask_.c \
353op_mask_pixel_mask_i386.c
354
355all: all-am
356
357.SUFFIXES:
358$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
359 @for dep in $?; do \
360 case '$(am__configure_deps)' in \
361 *$$dep*) \
362 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
363 && { if test -f $@; then exit 0; else break; fi; }; \
364 exit 1;; \
365 esac; \
366 done; \
367 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/engines/common/evas_op_mask/Makefile'; \
368 $(am__cd) $(top_srcdir) && \
369 $(AUTOMAKE) --gnu src/lib/engines/common/evas_op_mask/Makefile
370.PRECIOUS: Makefile
371Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
372 @case '$?' in \
373 *config.status*) \
374 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
375 *) \
376 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
377 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
378 esac;
379
380$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
381 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
382
383$(top_srcdir)/configure: $(am__configure_deps)
384 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
385$(ACLOCAL_M4): $(am__aclocal_m4_deps)
386 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
387$(am__aclocal_m4_deps):
388
389mostlyclean-libtool:
390 -rm -f *.lo
391
392clean-libtool:
393 -rm -rf .libs _libs
394tags: TAGS
395TAGS:
396
397ctags: CTAGS
398CTAGS:
399
400
401distdir: $(DISTFILES)
402 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
403 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
404 list='$(DISTFILES)'; \
405 dist_files=`for file in $$list; do echo $$file; done | \
406 sed -e "s|^$$srcdirstrip/||;t" \
407 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
408 case $$dist_files in \
409 */*) $(MKDIR_P) `echo "$$dist_files" | \
410 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
411 sort -u` ;; \
412 esac; \
413 for file in $$dist_files; do \
414 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
415 if test -d $$d/$$file; then \
416 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
417 if test -d "$(distdir)/$$file"; then \
418 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
419 fi; \
420 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
421 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
422 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
423 fi; \
424 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
425 else \
426 test -f "$(distdir)/$$file" \
427 || cp -p $$d/$$file "$(distdir)/$$file" \
428 || exit 1; \
429 fi; \
430 done
431check-am: all-am
432check: check-am
433all-am: Makefile
434installdirs:
435install: install-am
436install-exec: install-exec-am
437install-data: install-data-am
438uninstall: uninstall-am
439
440install-am: all-am
441 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
442
443installcheck: installcheck-am
444install-strip:
445 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
446 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
447 `test -z '$(STRIP)' || \
448 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
449mostlyclean-generic:
450
451clean-generic:
452
453distclean-generic:
454 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
455 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
456
457maintainer-clean-generic:
458 @echo "This command is intended for maintainers to use"
459 @echo "it deletes files that may require special tools to rebuild."
460 -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
461clean: clean-am
462
463clean-am: clean-generic clean-libtool mostlyclean-am
464
465distclean: distclean-am
466 -rm -f Makefile
467distclean-am: clean-am distclean-generic
468
469dvi: dvi-am
470
471dvi-am:
472
473html: html-am
474
475html-am:
476
477info: info-am
478
479info-am:
480
481install-data-am:
482
483install-dvi: install-dvi-am
484
485install-dvi-am:
486
487install-exec-am:
488
489install-html: install-html-am
490
491install-html-am:
492
493install-info: install-info-am
494
495install-info-am:
496
497install-man:
498
499install-pdf: install-pdf-am
500
501install-pdf-am:
502
503install-ps: install-ps-am
504
505install-ps-am:
506
507installcheck-am:
508
509maintainer-clean: maintainer-clean-am
510 -rm -f Makefile
511maintainer-clean-am: distclean-am maintainer-clean-generic
512
513mostlyclean: mostlyclean-am
514
515mostlyclean-am: mostlyclean-generic mostlyclean-libtool
516
517pdf: pdf-am
518
519pdf-am:
520
521ps: ps-am
522
523ps-am:
524
525uninstall-am:
526
527.MAKE: install-am install-strip
528
529.PHONY: all all-am check check-am clean clean-generic clean-libtool \
530 distclean distclean-generic distclean-libtool distdir dvi \
531 dvi-am html html-am info info-am install install-am \
532 install-data install-data-am install-dvi install-dvi-am \
533 install-exec install-exec-am install-html install-html-am \
534 install-info install-info-am install-man install-pdf \
535 install-pdf-am install-ps install-ps-am install-strip \
536 installcheck installcheck-am installdirs maintainer-clean \
537 maintainer-clean-generic mostlyclean mostlyclean-generic \
538 mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am
539
540
541# Tell versions [3.59,3.63) of GNU make to not export all variables.
542# Otherwise a system limit (for SysV at least) may be exceeded.
543.NOEXPORT:
diff --git a/libraries/evas/src/lib/engines/common/evas_op_mask/op_mask_color_.c b/libraries/evas/src/lib/engines/common/evas_op_mask/op_mask_color_.c
new file mode 100644
index 0000000..c95b125
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_mask/op_mask_color_.c
@@ -0,0 +1,49 @@
1/* mask color --> dst */
2
3#ifdef BUILD_C
4static void
5_op_mask_c_dp(DATA32 *s __UNUSED__, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) {
6 DATA32 *e = d + l;
7 c = 1 + (c >> 24);
8 for (; d < e; d++) {
9 *d = MUL_256(c, *d);
10 }
11}
12
13#define _op_mask_caa_dp _op_mask_c_dp
14
15#define _op_mask_c_dpan _op_mask_c_dp
16#define _op_mask_caa_dpan _op_mask_caa_dp
17
18static void
19init_mask_color_span_funcs_c(void)
20{
21 op_mask_span_funcs[SP_N][SM_N][SC][DP][CPU_C] = _op_mask_c_dp;
22 op_mask_span_funcs[SP_N][SM_N][SC_AA][DP][CPU_C] = _op_mask_caa_dp;
23
24 op_mask_span_funcs[SP_N][SM_N][SC][DP_AN][CPU_C] = _op_mask_c_dpan;
25 op_mask_span_funcs[SP_N][SM_N][SC_AA][DP_AN][CPU_C] = _op_mask_caa_dpan;
26}
27#endif
28
29#ifdef BUILD_C
30static void
31_op_mask_pt_c_dp(DATA32 s __UNUSED__, DATA8 m __UNUSED__, DATA32 c, DATA32 *d) {
32 *d = MUL_SYM(c >> 24, *d);
33}
34
35#define _op_mask_pt_caa_dp _op_mask_pt_c_dp
36
37#define _op_mask_pt_c_dpan _op_mask_pt_c_dp
38#define _op_mask_pt_caa_dpan _op_mask_pt_caa_dp
39
40static void
41init_mask_color_pt_funcs_c(void)
42{
43 op_mask_pt_funcs[SP_N][SM_N][SC][DP][CPU_C] = _op_mask_pt_c_dp;
44 op_mask_pt_funcs[SP_N][SM_N][SC_AA][DP][CPU_C] = _op_mask_pt_caa_dp;
45
46 op_mask_pt_funcs[SP_N][SM_N][SC][DP_AN][CPU_C] = _op_mask_pt_c_dpan;
47 op_mask_pt_funcs[SP_N][SM_N][SC_AA][DP_AN][CPU_C] = _op_mask_pt_caa_dpan;
48}
49#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_mask/op_mask_color_i386.c b/libraries/evas/src/lib/engines/common/evas_op_mask/op_mask_color_i386.c
new file mode 100644
index 0000000..9635eac
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_mask/op_mask_color_i386.c
@@ -0,0 +1,58 @@
1/* mask color --> dst */
2
3#ifdef BUILD_MMX
4static void
5_op_mask_c_dp_mmx(DATA32 *s __UNUSED__, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) {
6 DATA32 *e = d + l;
7 c = 1 + (c >> 24);
8 MOV_A2R(c, mm2)
9 pxor_r2r(mm0, mm0);
10 for (; d < e; d++) {
11 MOV_P2R(*d, mm1, mm0)
12 MUL4_256_R2R(mm2, mm1)
13 MOV_R2P(mm1, *d, mm0)
14 }
15}
16
17#define _op_mask_caa_dp_mmx _op_mask_c_dp_mmx
18
19#define _op_mask_c_dpan_mmx _op_mask_c_dp_mmx
20#define _op_mask_caa_dpan_mmx _op_mask_caa_dp_mmx
21
22static void
23init_mask_color_span_funcs_mmx(void)
24{
25 op_mask_span_funcs[SP_N][SM_N][SC][DP][CPU_MMX] = _op_mask_c_dp_mmx;
26 op_mask_span_funcs[SP_N][SM_N][SC_AA][DP][CPU_MMX] = _op_mask_caa_dp_mmx;
27
28 op_mask_span_funcs[SP_N][SM_N][SC][DP_AN][CPU_MMX] = _op_mask_c_dpan_mmx;
29 op_mask_span_funcs[SP_N][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_mask_caa_dpan_mmx;
30}
31#endif
32
33#ifdef BUILD_MMX
34static void
35_op_mask_pt_c_dp_mmx(DATA32 s __UNUSED__, DATA8 m __UNUSED__, DATA32 c, DATA32 *d) {
36 c = 1 + (c >> 24);
37 MOV_A2R(c, mm2)
38 pxor_r2r(mm0, mm0);
39 MOV_P2R(*d, mm1, mm0)
40 MUL4_256_R2R(mm2, mm1)
41 MOV_R2P(mm1, *d, mm0)
42}
43
44#define _op_mask_pt_caa_dp_mmx _op_mask_pt_c_dp_mmx
45
46#define _op_mask_pt_c_dpan_mmx _op_mask_pt_c_dp_mmx
47#define _op_mask_pt_caa_dpan_mmx _op_mask_pt_caa_dp_mmx
48
49static void
50init_mask_color_pt_funcs_mmx(void)
51{
52 op_mask_pt_funcs[SP_N][SM_N][SC][DP][CPU_MMX] = _op_mask_pt_c_dp_mmx;
53 op_mask_pt_funcs[SP_N][SM_N][SC_AA][DP][CPU_MMX] = _op_mask_pt_caa_dp_mmx;
54
55 op_mask_pt_funcs[SP_N][SM_N][SC][DP_AN][CPU_MMX] = _op_mask_pt_c_dpan_mmx;
56 op_mask_pt_funcs[SP_N][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_mask_pt_caa_dpan_mmx;
57}
58#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_mask/op_mask_mask_color_.c b/libraries/evas/src/lib/engines/common/evas_op_mask/op_mask_mask_color_.c
new file mode 100644
index 0000000..c75edb4
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_mask/op_mask_mask_color_.c
@@ -0,0 +1,63 @@
1/* mask mask x color -> dst */
2
3#ifdef BUILD_C
4static void
5_op_mask_mas_c_dp(DATA32 *s __UNUSED__, DATA8 *m, DATA32 c, DATA32 *d, int l) {
6 DATA32 *e = d + l;
7 c = 1 + (c >> 24);
8 while (d < e) {
9 l = *m;
10 switch(l)
11 {
12 case 0:
13 break;
14 case 255:
15 *d = MUL_256(c, *d);
16 break;
17 default:
18 l = 256 - (((257 - c) * l) >> 8);
19 *d = MUL_256(l, *d);
20 break;
21 }
22 m++; d++;
23 }
24}
25
26#define _op_mask_mas_caa_dp _op_mask_mas_c_dp
27
28#define _op_mask_mas_c_dpan _op_mask_mas_c_dp
29#define _op_mask_mas_caa_dpan _op_mask_mas_caa_dp
30
31static void
32init_mask_mask_color_span_funcs_c(void)
33{
34 op_mask_span_funcs[SP_N][SM_AS][SC][DP][CPU_C] = _op_mask_mas_c_dp;
35 op_mask_span_funcs[SP_N][SM_AS][SC_AA][DP][CPU_C] = _op_mask_mas_caa_dp;
36
37 op_mask_span_funcs[SP_N][SM_AS][SC][DP_AN][CPU_C] = _op_mask_mas_c_dpan;
38 op_mask_span_funcs[SP_N][SM_AS][SC_AA][DP_AN][CPU_C] = _op_mask_mas_caa_dpan;
39}
40#endif
41
42#ifdef BUILD_C
43static void
44_op_mask_pt_mas_c_dp(DATA32 s __UNUSED__, DATA8 m, DATA32 c, DATA32 *d) {
45 c = 256 - (((256 - (c >> 24)) * m) >> 8);
46 *d = MUL_256(c, *d);
47}
48
49#define _op_mask_pt_mas_caa_dp _op_mask_pt_mas_c_dp
50
51#define _op_mask_pt_mas_c_dpan _op_mask_pt_mas_c_dp
52#define _op_mask_pt_mas_caa_dpan _op_mask_pt_mas_caa_dp
53
54static void
55init_mask_mask_color_pt_funcs_c(void)
56{
57 op_mask_pt_funcs[SP_N][SM_AS][SC][DP][CPU_C] = _op_mask_pt_mas_c_dp;
58 op_mask_pt_funcs[SP_N][SM_AS][SC_AA][DP][CPU_C] = _op_mask_pt_mas_caa_dp;
59
60 op_mask_pt_funcs[SP_N][SM_AS][SC][DP_AN][CPU_C] = _op_mask_pt_mas_c_dpan;
61 op_mask_pt_funcs[SP_N][SM_AS][SC_AA][DP_AN][CPU_C] = _op_mask_pt_mas_caa_dpan;
62}
63#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_mask/op_mask_mask_color_i386.c b/libraries/evas/src/lib/engines/common/evas_op_mask/op_mask_mask_color_i386.c
new file mode 100644
index 0000000..9427dbf
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_mask/op_mask_mask_color_i386.c
@@ -0,0 +1,13 @@
1/* mask mask x color -> dst */
2
3#ifdef BUILD_MMX
4static void
5init_mask_mask_color_span_funcs_mmx(void)
6{}
7#endif
8
9#ifdef BUILD_MMX
10static void
11init_mask_mask_color_pt_funcs_mmx(void)
12{}
13#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_mask/op_mask_pixel_.c b/libraries/evas/src/lib/engines/common/evas_op_mask/op_mask_pixel_.c
new file mode 100644
index 0000000..ea7982b
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_mask/op_mask_pixel_.c
@@ -0,0 +1,48 @@
1/* mask pixel --> dst */
2
3#ifdef BUILD_C
4static void
5_op_mask_p_dp(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c __UNUSED__, DATA32 *d, int l) {
6 DATA32 *e = d + l;
7 for (; d < e; d++, s++) {
8 *d = MUL_SYM(*s >> 24, *d);
9 }
10}
11
12#define _op_mask_pas_dp _op_mask_p_dp
13
14#define _op_mask_p_dpan _op_mask_p_dp
15#define _op_mask_pas_dpan _op_mask_pas_dp
16
17static void
18init_mask_pixel_span_funcs_c(void)
19{
20 op_mask_span_funcs[SP][SM_N][SC_N][DP][CPU_C] = _op_mask_p_dp;
21 op_mask_span_funcs[SP_AS][SM_N][SC_N][DP][CPU_C] = _op_mask_pas_dp;
22
23 op_mask_span_funcs[SP][SM_N][SC_N][DP_AN][CPU_C] = _op_mask_p_dpan;
24 op_mask_span_funcs[SP_AS][SM_N][SC_N][DP_AN][CPU_C] = _op_mask_pas_dpan;
25}
26#endif
27
28#ifdef BUILD_C
29static void
30_op_mask_pt_p_dp(DATA32 s, DATA8 m __UNUSED__, DATA32 c __UNUSED__, DATA32 *d) {
31 *d = MUL_SYM(s >> 24, *d);
32}
33
34#define _op_mask_pt_pas_dp _op_mask_pt_p_dp
35
36#define _op_mask_pt_p_dpan _op_mask_pt_p_dp
37#define _op_mask_pt_pas_dpan _op_mask_pt_pas_dp
38
39static void
40init_mask_pixel_pt_funcs_c(void)
41{
42 op_mask_pt_funcs[SP][SM_N][SC_N][DP][CPU_C] = _op_mask_pt_p_dp;
43 op_mask_pt_funcs[SP_AS][SM_N][SC_N][DP][CPU_C] = _op_mask_pt_pas_dp;
44
45 op_mask_pt_funcs[SP][SM_N][SC_N][DP_AN][CPU_C] = _op_mask_pt_p_dpan;
46 op_mask_pt_funcs[SP_AS][SM_N][SC_N][DP_AN][CPU_C] = _op_mask_pt_pas_dpan;
47}
48#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_mask/op_mask_pixel_color_.c b/libraries/evas/src/lib/engines/common/evas_op_mask/op_mask_pixel_color_.c
new file mode 100644
index 0000000..18d1cab
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_mask/op_mask_pixel_color_.c
@@ -0,0 +1,100 @@
1/* mask pixel x color --> dst */
2
3#ifdef BUILD_C
4static void
5_op_mask_p_c_dp(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) {
6 DATA32 *e = d + l;
7 l = 1 + (c >> 24);
8 while (d < e) {
9 c = 1 + ((l * (*s >> 24)) >> 8);
10 *d = MUL_256(c, *d);
11 s++; d++;
12 }
13}
14
15#define _op_mask_pas_c_dp _op_mask_p_c_dp
16#define _op_mask_pan_c_dp _op_mask_p_c_dp
17#define _op_mask_p_can_dp _op_mask_p_c_dp
18#define _op_mask_pas_can_dp _op_mask_p_c_dp
19#define _op_mask_p_caa_dp _op_mask_p_c_dp
20#define _op_mask_pas_caa_dp _op_mask_p_c_dp
21#define _op_mask_pan_caa_dp _op_mask_p_c_dp
22
23#define _op_mask_p_c_dpan _op_mask_p_c_dp
24#define _op_mask_pas_c_dpan _op_mask_p_c_dp
25#define _op_mask_pan_c_dpan _op_mask_p_c_dp
26#define _op_mask_p_can_dpan _op_mask_p_c_dp
27#define _op_mask_pas_can_dpan _op_mask_p_c_dp
28#define _op_mask_p_caa_dpan _op_mask_p_c_dp
29#define _op_mask_pas_caa_dpan _op_mask_p_c_dp
30#define _op_mask_pan_caa_dpan _op_mask_p_c_dp
31
32static void
33init_mask_pixel_color_span_funcs_c(void)
34{
35 op_mask_span_funcs[SP][SM_N][SC][DP][CPU_C] = _op_mask_p_c_dp;
36 op_mask_span_funcs[SP_AS][SM_N][SC][DP][CPU_C] = _op_mask_pas_c_dp;
37 op_mask_span_funcs[SP_AN][SM_N][SC][DP][CPU_C] = _op_mask_pan_c_dp;
38 op_mask_span_funcs[SP][SM_N][SC_AN][DP][CPU_C] = _op_mask_p_can_dp;
39 op_mask_span_funcs[SP_AS][SM_N][SC_AN][DP][CPU_C] = _op_mask_pas_can_dp;
40 op_mask_span_funcs[SP][SM_N][SC_AA][DP][CPU_C] = _op_mask_p_caa_dp;
41 op_mask_span_funcs[SP_AS][SM_N][SC_AA][DP][CPU_C] = _op_mask_pas_caa_dp;
42 op_mask_span_funcs[SP_AN][SM_N][SC_AA][DP][CPU_C] = _op_mask_pan_caa_dp;
43
44 op_mask_span_funcs[SP][SM_N][SC][DP_AN][CPU_C] = _op_mask_p_c_dpan;
45 op_mask_span_funcs[SP_AS][SM_N][SC][DP_AN][CPU_C] = _op_mask_pas_c_dpan;
46 op_mask_span_funcs[SP_AN][SM_N][SC][DP_AN][CPU_C] = _op_mask_pan_c_dpan;
47 op_mask_span_funcs[SP][SM_N][SC_AN][DP_AN][CPU_C] = _op_mask_p_can_dpan;
48 op_mask_span_funcs[SP_AS][SM_N][SC_AN][DP_AN][CPU_C] = _op_mask_pas_can_dpan;
49 op_mask_span_funcs[SP][SM_N][SC_AA][DP_AN][CPU_C] = _op_mask_p_caa_dpan;
50 op_mask_span_funcs[SP_AS][SM_N][SC_AA][DP_AN][CPU_C] = _op_mask_pas_caa_dpan;
51 op_mask_span_funcs[SP_AN][SM_N][SC_AA][DP_AN][CPU_C] = _op_mask_pan_caa_dpan;
52}
53#endif
54
55#ifdef BUILD_C
56static void
57_op_mask_pt_p_c_dp(DATA32 s, DATA8 m __UNUSED__, DATA32 c, DATA32 *d) {
58 c = 1 + ((((c >> 24) * (s >> 24)) + 255) >> 8);
59 *d = MUL_256(c, *d);
60}
61
62#define _op_mask_pt_pas_c_dp _op_mask_pt_p_c_dp
63#define _op_mask_pt_pan_c_dp _op_mask_pt_p_c_dp
64#define _op_mask_pt_p_can_dp _op_mask_pt_p_c_dp
65#define _op_mask_pt_pas_can_dp _op_mask_pt_p_c_dp
66#define _op_mask_pt_p_caa_dp _op_mask_pt_p_c_dp
67#define _op_mask_pt_pas_caa_dp _op_mask_pt_p_c_dp
68#define _op_mask_pt_pan_caa_dp _op_mask_pt_p_c_dp
69
70#define _op_mask_pt_p_c_dpan _op_mask_pt_p_c_dp
71#define _op_mask_pt_pas_c_dpan _op_mask_pt_p_c_dp
72#define _op_mask_pt_pan_c_dpan _op_mask_pt_p_c_dp
73#define _op_mask_pt_p_can_dpan _op_mask_pt_p_c_dp
74#define _op_mask_pt_pas_can_dpan _op_mask_pt_p_c_dp
75#define _op_mask_pt_p_caa_dpan _op_mask_pt_p_c_dp
76#define _op_mask_pt_pas_caa_dpan _op_mask_pt_p_c_dp
77#define _op_mask_pt_pan_caa_dpan _op_mask_pt_p_c_dp
78
79static void
80init_mask_pixel_color_pt_funcs_c(void)
81{
82 op_mask_pt_funcs[SP][SM_N][SC][DP][CPU_C] = _op_mask_pt_p_c_dp;
83 op_mask_pt_funcs[SP_AS][SM_N][SC][DP][CPU_C] = _op_mask_pt_pas_c_dp;
84 op_mask_pt_funcs[SP_AN][SM_N][SC][DP][CPU_C] = _op_mask_pt_pan_c_dp;
85 op_mask_pt_funcs[SP][SM_N][SC_AN][DP][CPU_C] = _op_mask_pt_p_can_dp;
86 op_mask_pt_funcs[SP_AS][SM_N][SC_AN][DP][CPU_C] = _op_mask_pt_pas_can_dp;
87 op_mask_pt_funcs[SP][SM_N][SC_AA][DP][CPU_C] = _op_mask_pt_p_caa_dp;
88 op_mask_pt_funcs[SP_AS][SM_N][SC_AA][DP][CPU_C] = _op_mask_pt_pas_caa_dp;
89 op_mask_pt_funcs[SP_AN][SM_N][SC_AA][DP][CPU_C] = _op_mask_pt_pan_caa_dp;
90
91 op_mask_pt_funcs[SP][SM_N][SC][DP_AN][CPU_C] = _op_mask_pt_p_c_dpan;
92 op_mask_pt_funcs[SP_AS][SM_N][SC][DP_AN][CPU_C] = _op_mask_pt_pas_c_dpan;
93 op_mask_pt_funcs[SP_AN][SM_N][SC][DP_AN][CPU_C] = _op_mask_pt_pan_c_dpan;
94 op_mask_pt_funcs[SP][SM_N][SC_AN][DP_AN][CPU_C] = _op_mask_pt_p_can_dpan;
95 op_mask_pt_funcs[SP_AS][SM_N][SC_AN][DP_AN][CPU_C] = _op_mask_pt_pas_can_dpan;
96 op_mask_pt_funcs[SP][SM_N][SC_AA][DP_AN][CPU_C] = _op_mask_pt_p_caa_dpan;
97 op_mask_pt_funcs[SP_AS][SM_N][SC_AA][DP_AN][CPU_C] = _op_mask_pt_pas_caa_dpan;
98 op_mask_pt_funcs[SP_AN][SM_N][SC_AA][DP_AN][CPU_C] = _op_mask_pt_pan_caa_dpan;
99}
100#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_mask/op_mask_pixel_color_i386.c b/libraries/evas/src/lib/engines/common/evas_op_mask/op_mask_pixel_color_i386.c
new file mode 100644
index 0000000..0afcb71
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_mask/op_mask_pixel_color_i386.c
@@ -0,0 +1,13 @@
1/* mask pixel x color --> dst */
2
3#ifdef BUILD_MMX
4static void
5init_mask_pixel_color_span_funcs_mmx(void)
6{ }
7#endif
8
9#ifdef BUILD_MMX
10static void
11init_mask_pixel_color_pt_funcs_mmx(void)
12{ }
13#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_mask/op_mask_pixel_i386.c b/libraries/evas/src/lib/engines/common/evas_op_mask/op_mask_pixel_i386.c
new file mode 100644
index 0000000..a1c09af
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_mask/op_mask_pixel_i386.c
@@ -0,0 +1,58 @@
1/* mask pixel --> dst */
2
3#ifdef BUILD_MMX
4static void
5_op_mask_p_dp_mmx(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c __UNUSED__, DATA32 *d, int l) {
6 DATA32 *e = d + l;
7 MOV_A2R(ALPHA_255, mm5)
8 pxor_r2r(mm0, mm0);
9 for (; d < e; d++) {
10 MOV_P2R(*d, mm1, mm0)
11 MOV_PA2R(*s, mm2)
12 MUL4_SYM_R2R(mm2, mm1, mm5)
13 MOV_R2P(mm1, *d, mm0)
14 }
15}
16
17#define _op_mask_pas_dp_mmx _op_mask_p_dp_mmx
18
19#define _op_mask_p_dpan_mmx _op_mask_p_dp_mmx
20#define _op_mask_pas_dpan_mmx _op_mask_pas_dp_mmx
21
22static void
23init_mask_pixel_span_funcs_mmx(void)
24{
25 op_mask_span_funcs[SP][SM_N][SC_N][DP][CPU_MMX] = _op_mask_p_dp_mmx;
26 op_mask_span_funcs[SP_AS][SM_N][SC_N][DP][CPU_MMX] = _op_mask_pas_dp_mmx;
27
28 op_mask_span_funcs[SP][SM_N][SC_N][DP_AN][CPU_MMX] = _op_mask_p_dpan_mmx;
29 op_mask_span_funcs[SP_AS][SM_N][SC_N][DP_AN][CPU_MMX] = _op_mask_pas_dpan_mmx;
30}
31#endif
32
33#ifdef BUILD_MMX
34static void
35_op_mask_pt_p_dp_mmx(DATA32 s, DATA8 m __UNUSED__, DATA32 c __UNUSED__, DATA32 *d) {
36 MOV_A2R(ALPHA_255, mm5)
37 pxor_r2r(mm0, mm0);
38 MOV_P2R(*d, mm1, mm0)
39 MOV_PA2R(s, mm2)
40 MUL4_SYM_R2R(mm2, mm1, mm5)
41 MOV_R2P(mm1, *d, mm0)
42}
43
44#define _op_mask_pt_pas_dp_mmx _op_mask_pt_p_dp_mmx
45
46#define _op_mask_pt_p_dpan_mmx _op_mask_pt_p_dp_mmx
47#define _op_mask_pt_pas_dpan_mmx _op_mask_pt_pas_dp_mmx
48
49static void
50init_mask_pixel_pt_funcs_mmx(void)
51{
52 op_mask_pt_funcs[SP][SM_N][SC_N][DP][CPU_MMX] = _op_mask_pt_p_dp_mmx;
53 op_mask_pt_funcs[SP_AS][SM_N][SC_N][DP][CPU_MMX] = _op_mask_pt_pas_dp_mmx;
54
55 op_mask_pt_funcs[SP][SM_N][SC_N][DP_AN][CPU_MMX] = _op_mask_pt_p_dpan_mmx;
56 op_mask_pt_funcs[SP_AS][SM_N][SC_N][DP_AN][CPU_MMX] = _op_mask_pt_pas_dpan_mmx;
57}
58#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_mask/op_mask_pixel_mask_.c b/libraries/evas/src/lib/engines/common/evas_op_mask/op_mask_pixel_mask_.c
new file mode 100644
index 0000000..b948aa6
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_mask/op_mask_pixel_mask_.c
@@ -0,0 +1,62 @@
1/* mask pixel x mask --> dst */
2
3#ifdef BUILD_C
4static void
5_op_mask_p_mas_dp(DATA32 *s, DATA8 *m, DATA32 c __UNUSED__, DATA32 *d, int l) {
6 DATA32 *e = d + l;
7 while (d < e) {
8 l = *m;
9 switch(l)
10 {
11 case 0:
12 break;
13 case 255:
14 *d = MUL_SYM(*s >> 24, *d);
15 break;
16 default:
17 l = 256 - (((256 - (*s >> 24)) * l) >> 8);
18 *d = MUL_256(l, *d);
19 break;
20 }
21 m++; s++; d++;
22 }
23}
24
25#define _op_mask_pas_mas_dp _op_mask_p_mas_dp
26
27#define _op_mask_p_mas_dpan _op_mask_p_mas_dp
28#define _op_mask_pas_mas_dpan _op_mask_pas_mas_dp
29
30static void
31init_mask_pixel_mask_span_funcs_c(void)
32{
33 op_mask_span_funcs[SP][SM_AS][SC_N][DP][CPU_C] = _op_mask_p_mas_dp;
34 op_mask_span_funcs[SP_AS][SM_AS][SC_N][DP][CPU_C] = _op_mask_pas_mas_dp;
35
36 op_mask_span_funcs[SP][SM_AS][SC_N][DP_AN][CPU_C] = _op_mask_p_mas_dpan;
37 op_mask_span_funcs[SP_AS][SM_AS][SC_N][DP_AN][CPU_C] = _op_mask_pas_mas_dpan;
38}
39#endif
40
41#ifdef BUILD_C
42static void
43_op_mask_pt_p_mas_dp(DATA32 s, DATA8 m, DATA32 c __UNUSED__, DATA32 *d) {
44 s = 256 - (((256 - (s >> 24)) * m) >> 8);
45 *d = MUL_256(s, *d);
46}
47
48#define _op_mask_pt_pas_mas_dp _op_mask_pt_p_mas_dp
49
50#define _op_mask_pt_p_mas_dpan _op_mask_pt_p_mas_dp
51#define _op_mask_pt_pas_mas_dpan _op_mask_pt_pas_mas_dp
52
53static void
54init_mask_pixel_mask_pt_funcs_c(void)
55{
56 op_mask_pt_funcs[SP][SM_AS][SC_N][DP][CPU_C] = _op_mask_pt_p_mas_dp;
57 op_mask_pt_funcs[SP_AS][SM_AS][SC_N][DP][CPU_C] = _op_mask_pt_pas_mas_dp;
58
59 op_mask_pt_funcs[SP][SM_AS][SC_N][DP_AN][CPU_C] = _op_mask_pt_p_mas_dpan;
60 op_mask_pt_funcs[SP_AS][SM_AS][SC_N][DP_AN][CPU_C] = _op_mask_pt_pas_mas_dpan;
61}
62#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_mask/op_mask_pixel_mask_i386.c b/libraries/evas/src/lib/engines/common/evas_op_mask/op_mask_pixel_mask_i386.c
new file mode 100644
index 0000000..c5dd8da
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_mask/op_mask_pixel_mask_i386.c
@@ -0,0 +1,13 @@
1/* mask pixel x mask --> dst */
2
3#ifdef BUILD_MMX
4static void
5init_mask_pixel_mask_span_funcs_mmx(void)
6{ }
7#endif
8
9#ifdef BUILD_MMX
10static void
11init_mask_pixel_mask_pt_funcs_mmx(void)
12{ }
13#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_mask_main_.c b/libraries/evas/src/lib/engines/common/evas_op_mask_main_.c
new file mode 100644
index 0000000..bbe497a
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_mask_main_.c
@@ -0,0 +1,309 @@
1#include "evas_common.h"
2
3static RGBA_Gfx_Func op_mask_span_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
4static RGBA_Gfx_Pt_Func op_mask_pt_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
5
6static void op_mask_init(void);
7static void op_mask_shutdown(void);
8
9static RGBA_Gfx_Func op_mask_pixel_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels);
10static RGBA_Gfx_Func op_mask_color_span_get(DATA32 col, RGBA_Image *dst, int pixels);
11static RGBA_Gfx_Func op_mask_pixel_color_span_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels);
12static RGBA_Gfx_Func op_mask_mask_color_span_get(DATA32 col, RGBA_Image *dst, int pixels);
13static RGBA_Gfx_Func op_mask_pixel_mask_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels);
14
15static RGBA_Gfx_Pt_Func op_mask_pixel_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst);
16static RGBA_Gfx_Pt_Func op_mask_color_pt_get(DATA32 col, RGBA_Image *dst);
17static RGBA_Gfx_Pt_Func op_mask_pixel_color_pt_get(Image_Entry_Flags src_flags, DATA32 col, RGBA_Image *dst);
18static RGBA_Gfx_Pt_Func op_mask_mask_color_pt_get(DATA32 col, RGBA_Image *dst);
19static RGBA_Gfx_Pt_Func op_mask_pixel_mask_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst);
20
21static RGBA_Gfx_Compositor _composite_mask = { "mask",
22 op_mask_init, op_mask_shutdown,
23 op_mask_pixel_span_get, op_mask_color_span_get,
24 op_mask_pixel_color_span_get, op_mask_mask_color_span_get,
25 op_mask_pixel_mask_span_get,
26 op_mask_pixel_pt_get, op_mask_color_pt_get,
27 op_mask_pixel_color_pt_get, op_mask_mask_color_pt_get,
28 op_mask_pixel_mask_pt_get
29 };
30
31RGBA_Gfx_Compositor *
32evas_common_gfx_compositor_mask_get(void)
33{
34 return &(_composite_mask);
35}
36
37
38# include "./evas_op_mask/op_mask_pixel_.c"
39# include "./evas_op_mask/op_mask_color_.c"
40# include "./evas_op_mask/op_mask_pixel_color_.c"
41# include "./evas_op_mask/op_mask_pixel_mask_.c"
42# include "./evas_op_mask/op_mask_mask_color_.c"
43//# include "./evas_op_mask/op_mask_pixel_mask_color_.c"
44
45# include "./evas_op_mask/op_mask_pixel_i386.c"
46# include "./evas_op_mask/op_mask_color_i386.c"
47# include "./evas_op_mask/op_mask_pixel_color_i386.c"
48# include "./evas_op_mask/op_mask_pixel_mask_i386.c"
49# include "./evas_op_mask/op_mask_mask_color_i386.c"
50//# include "./evas_op_mask/op_mask_pixel_mask_color_i386.c"
51
52
53static void
54op_mask_init(void)
55{
56 memset(op_mask_span_funcs, 0, sizeof(op_mask_span_funcs));
57 memset(op_mask_pt_funcs, 0, sizeof(op_mask_pt_funcs));
58#ifdef BUILD_MMX
59 init_mask_pixel_span_funcs_mmx();
60 init_mask_pixel_color_span_funcs_mmx();
61 init_mask_pixel_mask_span_funcs_mmx();
62 init_mask_color_span_funcs_mmx();
63 init_mask_mask_color_span_funcs_mmx();
64
65 init_mask_pixel_pt_funcs_mmx();
66 init_mask_pixel_color_pt_funcs_mmx();
67 init_mask_pixel_mask_pt_funcs_mmx();
68 init_mask_color_pt_funcs_mmx();
69 init_mask_mask_color_pt_funcs_mmx();
70#endif
71#ifdef BUILD_C
72 init_mask_pixel_span_funcs_c();
73 init_mask_pixel_color_span_funcs_c();
74 init_mask_pixel_mask_span_funcs_c();
75 init_mask_color_span_funcs_c();
76 init_mask_mask_color_span_funcs_c();
77
78 init_mask_pixel_pt_funcs_c();
79 init_mask_pixel_color_pt_funcs_c();
80 init_mask_pixel_mask_pt_funcs_c();
81 init_mask_color_pt_funcs_c();
82 init_mask_mask_color_pt_funcs_c();
83#endif
84}
85
86static void
87op_mask_shutdown(void)
88{
89}
90
91static RGBA_Gfx_Func
92mask_gfx_span_func_cpu(int s, int m, int c, int d)
93{
94 RGBA_Gfx_Func func = NULL;
95 int cpu = CPU_N;
96#ifdef BUILD_MMX
97 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
98 {
99 cpu = CPU_MMX;
100 func = op_mask_span_funcs[s][m][c][d][cpu];
101 if (func) return func;
102 }
103#endif
104#ifdef BUILD_C
105 cpu = CPU_C;
106 func = op_mask_span_funcs[s][m][c][d][cpu];
107 if (func) return func;
108#endif
109 return func;
110}
111
112static RGBA_Gfx_Func
113op_mask_pixel_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels __UNUSED__)
114{
115 int s = SP_AN, m = SM_N, c = SC_N, d = DP_AN;
116
117 if (src && src->cache_entry.flags.alpha)
118 {
119 dst->cache_entry.flags.alpha = 1;
120 s = SP;
121 }
122 if (dst && dst->cache_entry.flags.alpha)
123 d = DP;
124 return mask_gfx_span_func_cpu(s, m, c, d);
125}
126
127static RGBA_Gfx_Func
128op_mask_color_span_get(DATA32 col, RGBA_Image *dst, int pixels __UNUSED__)
129{
130 int s = SP_N, m = SM_N, c = SC_AN, d = DP_AN;
131
132 if ((col >> 24) < 255)
133 {
134 if (dst)
135 dst->cache_entry.flags.alpha = 1;
136 c = SC;
137 }
138 if (col == (col | 0x00ffffff))
139 c = SC_AA;
140 if (col == 0xffffffff)
141 c = SC_N;
142 if (dst && dst->cache_entry.flags.alpha)
143 d = DP;
144 return mask_gfx_span_func_cpu(s, m, c, d);
145}
146
147static RGBA_Gfx_Func
148op_mask_pixel_color_span_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels __UNUSED__)
149{
150 int s = SP_AN, m = SM_N, c = SC_AN, d = DP_AN;
151
152 if (src && src->cache_entry.flags.alpha)
153 {
154 if (dst)
155 dst->cache_entry.flags.alpha = 1;
156 s = SP;
157 }
158 if ((col >> 24) < 255)
159 {
160 if (dst)
161 dst->cache_entry.flags.alpha = 1;
162 c = SC;
163 }
164 if (col == (col | 0x00ffffff))
165 c = SC_AA;
166 if (col == 0xffffffff)
167 c = SC_N;
168 if (dst && dst->cache_entry.flags.alpha)
169 d = DP;
170 return mask_gfx_span_func_cpu(s, m, c, d);
171}
172
173static RGBA_Gfx_Func
174op_mask_mask_color_span_get(DATA32 col, RGBA_Image *dst, int pixels __UNUSED__)
175{
176 int s = SP_N, m = SM_AS, c = SC_AN, d = DP;
177
178 if (dst)
179 dst->cache_entry.flags.alpha = 1;
180 if ((col >> 24) < 255)
181 c = SC;
182 if (col == (col | 0x00ffffff))
183 c = SC_AA;
184 if (col == 0xffffffff)
185 c = SC_N;
186 return mask_gfx_span_func_cpu(s, m, c, d);
187}
188
189static RGBA_Gfx_Func
190op_mask_pixel_mask_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels __UNUSED__)
191{
192 int s = SP_AN, m = SM_AS, c = SC_N, d = DP;
193
194 if (dst)
195 dst->cache_entry.flags.alpha = 1;
196 if (src && src->cache_entry.flags.alpha)
197 s = SP;
198 return mask_gfx_span_func_cpu(s, m, c, d);
199}
200
201static RGBA_Gfx_Pt_Func
202mask_gfx_pt_func_cpu(int s, int m, int c, int d)
203{
204 RGBA_Gfx_Pt_Func func = NULL;
205 int cpu = CPU_N;
206#ifdef BUILD_MMX
207 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
208 {
209 cpu = CPU_MMX;
210 func = op_mask_pt_funcs[s][m][c][d][cpu];
211 if (func) return func;
212 }
213#endif
214#ifdef BUILD_C
215 cpu = CPU_C;
216 func = op_mask_pt_funcs[s][m][c][d][cpu];
217 if (func) return func;
218#endif
219 return func;
220}
221
222static RGBA_Gfx_Pt_Func
223op_mask_pixel_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst)
224{
225 int s = SP_AN, m = SM_N, c = SC_N, d = DP_AN;
226
227 if (src_flags.alpha)
228 {
229 dst->cache_entry.flags.alpha = 1;
230 s = SP;
231 }
232 if (dst && dst->cache_entry.flags.alpha)
233 d = DP;
234 return mask_gfx_pt_func_cpu(s, m, c, d);
235}
236
237static RGBA_Gfx_Pt_Func
238op_mask_color_pt_get(DATA32 col, RGBA_Image *dst)
239{
240 int s = SP_N, m = SM_N, c = SC_AN, d = DP_AN;
241
242 if ((col >> 24) < 255)
243 {
244 if (dst)
245 dst->cache_entry.flags.alpha = 1;
246 c = SC;
247 }
248 if (col == (col | 0x00ffffff))
249 c = SC_AA;
250 if (col == 0xffffffff)
251 c = SC_N;
252 if (dst && dst->cache_entry.flags.alpha)
253 d = DP;
254 return mask_gfx_pt_func_cpu(s, m, c, d);
255}
256
257static RGBA_Gfx_Pt_Func
258op_mask_pixel_color_pt_get(Image_Entry_Flags src_flags, DATA32 col, RGBA_Image *dst)
259{
260 int s = SP_AN, m = SM_N, c = SC_AN, d = DP_AN;
261
262 if (src_flags.alpha)
263 {
264 if (dst)
265 dst->cache_entry.flags.alpha = 1;
266 s = SP;
267 }
268 if ((col >> 24) < 255)
269 {
270 if (dst)
271 dst->cache_entry.flags.alpha = 1;
272 c = SC;
273 }
274 if (col == (col | 0x00ffffff))
275 c = SC_AA;
276 if (col == 0xffffffff)
277 c = SC_N;
278 if (dst && dst->cache_entry.flags.alpha)
279 d = DP;
280 return mask_gfx_pt_func_cpu(s, m, c, d);
281}
282
283static RGBA_Gfx_Pt_Func
284op_mask_mask_color_pt_get(DATA32 col, RGBA_Image *dst)
285{
286 int s = SP_N, m = SM_AS, c = SC_AN, d = DP;
287
288 if (dst)
289 dst->cache_entry.flags.alpha = 1;
290 if ((col >> 24) < 255)
291 c = SC;
292 if (col == (col | 0x00ffffff))
293 c = SC_AA;
294 if (col == 0xffffffff)
295 c = SC_N;
296 return mask_gfx_pt_func_cpu(s, m, c, d);
297}
298
299static RGBA_Gfx_Pt_Func
300op_mask_pixel_mask_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst)
301{
302 int s = SP_AN, m = SM_AS, c = SC_N, d = DP;
303
304 if (dst)
305 dst->cache_entry.flags.alpha = 1;
306 if (src_flags.alpha)
307 s = SP;
308 return mask_gfx_pt_func_cpu(s, m, c, d);
309}
diff --git a/libraries/evas/src/lib/engines/common/evas_op_mul/Makefile.am b/libraries/evas/src/lib/engines/common/evas_op_mul/Makefile.am
new file mode 100644
index 0000000..e3d0b82
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_mul/Makefile.am
@@ -0,0 +1,13 @@
1MAINTAINERCLEANFILES = Makefile.in
2
3EXTRA_DIST = \
4op_mul_color_.c \
5op_mul_color_i386.c \
6op_mul_mask_color_.c \
7op_mul_mask_color_i386.c \
8op_mul_pixel_.c \
9op_mul_pixel_color_.c \
10op_mul_pixel_color_i386.c \
11op_mul_pixel_i386.c \
12op_mul_pixel_mask_.c \
13op_mul_pixel_mask_i386.c
diff --git a/libraries/evas/src/lib/engines/common/evas_op_mul/Makefile.in b/libraries/evas/src/lib/engines/common/evas_op_mul/Makefile.in
new file mode 100644
index 0000000..f239cf7
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_mul/Makefile.in
@@ -0,0 +1,543 @@
1# Makefile.in generated by automake 1.11.1 from Makefile.am.
2# @configure_input@
3
4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
6# Inc.
7# This Makefile.in is free software; the Free Software Foundation
8# gives unlimited permission to copy and/or distribute it,
9# with or without modifications, as long as this notice is preserved.
10
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
13# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14# PARTICULAR PURPOSE.
15
16@SET_MAKE@
17VPATH = @srcdir@
18pkgdatadir = $(datadir)/@PACKAGE@
19pkgincludedir = $(includedir)/@PACKAGE@
20pkglibdir = $(libdir)/@PACKAGE@
21pkglibexecdir = $(libexecdir)/@PACKAGE@
22am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
23install_sh_DATA = $(install_sh) -c -m 644
24install_sh_PROGRAM = $(install_sh) -c
25install_sh_SCRIPT = $(install_sh) -c
26INSTALL_HEADER = $(INSTALL_DATA)
27transform = $(program_transform_name)
28NORMAL_INSTALL = :
29PRE_INSTALL = :
30POST_INSTALL = :
31NORMAL_UNINSTALL = :
32PRE_UNINSTALL = :
33POST_UNINSTALL = :
34build_triplet = @build@
35host_triplet = @host@
36subdir = src/lib/engines/common/evas_op_mul
37DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
38ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
39am__aclocal_m4_deps = $(top_srcdir)/m4/efl_attribute.m4 \
40 $(top_srcdir)/m4/efl_coverage.m4 \
41 $(top_srcdir)/m4/efl_doxygen.m4 \
42 $(top_srcdir)/m4/efl_fnmatch.m4 \
43 $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \
44 $(top_srcdir)/m4/evas_check_engine.m4 \
45 $(top_srcdir)/m4/evas_check_loader.m4 \
46 $(top_srcdir)/m4/evas_converter.m4 \
47 $(top_srcdir)/m4/evas_dither.m4 \
48 $(top_srcdir)/m4/evas_scaler.m4 $(top_srcdir)/m4/libtool.m4 \
49 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
50 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
51 $(top_srcdir)/configure.ac
52am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
53 $(ACLOCAL_M4)
54mkinstalldirs = $(install_sh) -d
55CONFIG_HEADER = $(top_builddir)/config.h
56CONFIG_CLEAN_FILES =
57CONFIG_CLEAN_VPATH_FILES =
58AM_V_GEN = $(am__v_GEN_$(V))
59am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
60am__v_GEN_0 = @echo " GEN " $@;
61AM_V_at = $(am__v_at_$(V))
62am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
63am__v_at_0 = @
64SOURCES =
65DIST_SOURCES =
66DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
67ACLOCAL = @ACLOCAL@
68ALLOCA = @ALLOCA@
69AMTAR = @AMTAR@
70AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
71AR = @AR@
72AS = @AS@
73AUTOCONF = @AUTOCONF@
74AUTOHEADER = @AUTOHEADER@
75AUTOMAKE = @AUTOMAKE@
76AWK = @AWK@
77CC = @CC@
78CCDEPMODE = @CCDEPMODE@
79CFLAGS = @CFLAGS@
80CHECK_CFLAGS = @CHECK_CFLAGS@
81CHECK_LIBS = @CHECK_LIBS@
82CPP = @CPP@
83CPPFLAGS = @CPPFLAGS@
84CXX = @CXX@
85CXXCPP = @CXXCPP@
86CXXDEPMODE = @CXXDEPMODE@
87CXXFLAGS = @CXXFLAGS@
88CYGPATH_W = @CYGPATH_W@
89DEFS = @DEFS@
90DEPDIR = @DEPDIR@
91DIRECTFB_CFLAGS = @DIRECTFB_CFLAGS@
92DIRECTFB_LIBS = @DIRECTFB_LIBS@
93DLLTOOL = @DLLTOOL@
94DSYMUTIL = @DSYMUTIL@
95DUMPBIN = @DUMPBIN@
96ECHO_C = @ECHO_C@
97ECHO_N = @ECHO_N@
98ECHO_T = @ECHO_T@
99ECORE_EVAS_CFLAGS = @ECORE_EVAS_CFLAGS@
100ECORE_EVAS_LIBS = @ECORE_EVAS_LIBS@
101EDB_CFLAGS = @EDB_CFLAGS@
102EDB_LIBS = @EDB_LIBS@
103EDJE_CFLAGS = @EDJE_CFLAGS@
104EDJE_LIBS = @EDJE_LIBS@
105EET_CFLAGS = @EET_CFLAGS@
106EET_LIBS = @EET_LIBS@
107EFL_COVERAGE_CFLAGS = @EFL_COVERAGE_CFLAGS@
108EFL_COVERAGE_LIBS = @EFL_COVERAGE_LIBS@
109EFL_FNMATCH_LIBS = @EFL_FNMATCH_LIBS@
110EGREP = @EGREP@
111EINA_CFLAGS = @EINA_CFLAGS@
112EINA_LIBS = @EINA_LIBS@
113EVAS_CFLAGS = @EVAS_CFLAGS@
114EVAS_LIBS = @EVAS_LIBS@
115EVAS_SSE3_CFLAGS = @EVAS_SSE3_CFLAGS@
116EVIL_CFLAGS = @EVIL_CFLAGS@
117EVIL_LIBS = @EVIL_LIBS@
118EXEEXT = @EXEEXT@
119FGREP = @FGREP@
120FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@
121FONTCONFIG_LIBS = @FONTCONFIG_LIBS@
122FREETYPE_CFLAGS = @FREETYPE_CFLAGS@
123FREETYPE_LIBS = @FREETYPE_LIBS@
124FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@
125FRIBIDI_LIBS = @FRIBIDI_LIBS@
126GL_EET_CFLAGS = @GL_EET_CFLAGS@
127GL_EET_LIBS = @GL_EET_LIBS@
128GREP = @GREP@
129HARFBUZZ_CFLAGS = @HARFBUZZ_CFLAGS@
130HARFBUZZ_LIBS = @HARFBUZZ_LIBS@
131INSTALL = @INSTALL@
132INSTALL_DATA = @INSTALL_DATA@
133INSTALL_PROGRAM = @INSTALL_PROGRAM@
134INSTALL_SCRIPT = @INSTALL_SCRIPT@
135INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
136LD = @LD@
137LDFLAGS = @LDFLAGS@
138LIBOBJS = @LIBOBJS@
139LIBS = @LIBS@
140LIBTOOL = @LIBTOOL@
141LINEBREAK_CFLAGS = @LINEBREAK_CFLAGS@
142LINEBREAK_LIBS = @LINEBREAK_LIBS@
143LIPO = @LIPO@
144LN_S = @LN_S@
145LTLIBOBJS = @LTLIBOBJS@
146MAKEINFO = @MAKEINFO@
147MKDIR_P = @MKDIR_P@
148MODULE_ARCH = @MODULE_ARCH@
149NM = @NM@
150NMEDIT = @NMEDIT@
151OBJC = @OBJC@
152OBJCDEPMODE = @OBJCDEPMODE@
153OBJCFLAGS = @OBJCFLAGS@
154OBJDUMP = @OBJDUMP@
155OBJEXT = @OBJEXT@
156OTOOL = @OTOOL@
157OTOOL64 = @OTOOL64@
158PACKAGE = @PACKAGE@
159PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
160PACKAGE_NAME = @PACKAGE_NAME@
161PACKAGE_STRING = @PACKAGE_STRING@
162PACKAGE_TARNAME = @PACKAGE_TARNAME@
163PACKAGE_URL = @PACKAGE_URL@
164PACKAGE_VERSION = @PACKAGE_VERSION@
165PATH_SEPARATOR = @PATH_SEPARATOR@
166PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
167PIXMAN_LIBS = @PIXMAN_LIBS@
168PKG_CONFIG = @PKG_CONFIG@
169PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
170PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
171PNG_CFLAGS = @PNG_CFLAGS@
172PNG_LIBS = @PNG_LIBS@
173RANLIB = @RANLIB@
174SDL_CFLAGS = @SDL_CFLAGS@
175SDL_LIBS = @SDL_LIBS@
176SED = @SED@
177SET_MAKE = @SET_MAKE@
178SHELL = @SHELL@
179SHM_OPEN_LINK = @SHM_OPEN_LINK@
180STRIP = @STRIP@
181SVG_CFLAGS = @SVG_CFLAGS@
182SVG_LIBS = @SVG_LIBS@
183VALGRIND_CFLAGS = @VALGRIND_CFLAGS@
184VALGRIND_LIBS = @VALGRIND_LIBS@
185VERSION = @VERSION@
186VMAJ = @VMAJ@
187WIN32_CFLAGS = @WIN32_CFLAGS@
188WIN32_CPPFLAGS = @WIN32_CPPFLAGS@
189XCB_CFLAGS = @XCB_CFLAGS@
190XCB_GL_CFLAGS = @XCB_GL_CFLAGS@
191XCB_GL_LIBS = @XCB_GL_LIBS@
192XCB_LIBS = @XCB_LIBS@
193XEXT_CFLAGS = @XEXT_CFLAGS@
194XEXT_LIBS = @XEXT_LIBS@
195XMKMF = @XMKMF@
196X_CFLAGS = @X_CFLAGS@
197X_EXTRA_LIBS = @X_EXTRA_LIBS@
198X_LIBS = @X_LIBS@
199X_PRE_LIBS = @X_PRE_LIBS@
200abs_builddir = @abs_builddir@
201abs_srcdir = @abs_srcdir@
202abs_top_builddir = @abs_top_builddir@
203abs_top_srcdir = @abs_top_srcdir@
204ac_ct_CC = @ac_ct_CC@
205ac_ct_CXX = @ac_ct_CXX@
206ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
207ac_ct_OBJC = @ac_ct_OBJC@
208altivec_cflags = @altivec_cflags@
209am__include = @am__include@
210am__leading_dot = @am__leading_dot@
211am__quote = @am__quote@
212am__tar = @am__tar@
213am__untar = @am__untar@
214bindir = @bindir@
215build = @build@
216build_alias = @build_alias@
217build_cpu = @build_cpu@
218build_os = @build_os@
219build_vendor = @build_vendor@
220builddir = @builddir@
221datadir = @datadir@
222datarootdir = @datarootdir@
223dlopen_libs = @dlopen_libs@
224docdir = @docdir@
225dvidir = @dvidir@
226edje_cc = @edje_cc@
227efl_doxygen = @efl_doxygen@
228efl_have_doxygen = @efl_have_doxygen@
229evas_engine_buffer_cflags = @evas_engine_buffer_cflags@
230evas_engine_buffer_libs = @evas_engine_buffer_libs@
231evas_engine_direct3d_cflags = @evas_engine_direct3d_cflags@
232evas_engine_direct3d_libs = @evas_engine_direct3d_libs@
233evas_engine_directfb_cflags = @evas_engine_directfb_cflags@
234evas_engine_directfb_libs = @evas_engine_directfb_libs@
235evas_engine_fb_cflags = @evas_engine_fb_cflags@
236evas_engine_fb_libs = @evas_engine_fb_libs@
237evas_engine_gl_cocoa_cflags = @evas_engine_gl_cocoa_cflags@
238evas_engine_gl_cocoa_libs = @evas_engine_gl_cocoa_libs@
239evas_engine_gl_common_libs = @evas_engine_gl_common_libs@
240evas_engine_gl_sdl_cflags = @evas_engine_gl_sdl_cflags@
241evas_engine_gl_sdl_libs = @evas_engine_gl_sdl_libs@
242evas_engine_gl_xcb_cflags = @evas_engine_gl_xcb_cflags@
243evas_engine_gl_xcb_libs = @evas_engine_gl_xcb_libs@
244evas_engine_gl_xlib_cflags = @evas_engine_gl_xlib_cflags@
245evas_engine_gl_xlib_libs = @evas_engine_gl_xlib_libs@
246evas_engine_psl1ght_cflags = @evas_engine_psl1ght_cflags@
247evas_engine_psl1ght_libs = @evas_engine_psl1ght_libs@
248evas_engine_software_16_ddraw_cflags = @evas_engine_software_16_ddraw_cflags@
249evas_engine_software_16_ddraw_libs = @evas_engine_software_16_ddraw_libs@
250evas_engine_software_16_sdl_cflags = @evas_engine_software_16_sdl_cflags@
251evas_engine_software_16_sdl_libs = @evas_engine_software_16_sdl_libs@
252evas_engine_software_16_wince_cflags = @evas_engine_software_16_wince_cflags@
253evas_engine_software_16_wince_libs = @evas_engine_software_16_wince_libs@
254evas_engine_software_16_x11_cflags = @evas_engine_software_16_x11_cflags@
255evas_engine_software_16_x11_libs = @evas_engine_software_16_x11_libs@
256evas_engine_software_8_x11_cflags = @evas_engine_software_8_x11_cflags@
257evas_engine_software_8_x11_libs = @evas_engine_software_8_x11_libs@
258evas_engine_software_ddraw_cflags = @evas_engine_software_ddraw_cflags@
259evas_engine_software_ddraw_libs = @evas_engine_software_ddraw_libs@
260evas_engine_software_gdi_cflags = @evas_engine_software_gdi_cflags@
261evas_engine_software_gdi_libs = @evas_engine_software_gdi_libs@
262evas_engine_software_sdl_cflags = @evas_engine_software_sdl_cflags@
263evas_engine_software_sdl_libs = @evas_engine_software_sdl_libs@
264evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@
265evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@
266evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@
267evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@
268evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@
269evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@
270evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@
271evas_image_loader_edb_libs = @evas_image_loader_edb_libs@
272evas_image_loader_eet_cflags = @evas_image_loader_eet_cflags@
273evas_image_loader_eet_libs = @evas_image_loader_eet_libs@
274evas_image_loader_generic_cflags = @evas_image_loader_generic_cflags@
275evas_image_loader_generic_libs = @evas_image_loader_generic_libs@
276evas_image_loader_gif_cflags = @evas_image_loader_gif_cflags@
277evas_image_loader_gif_libs = @evas_image_loader_gif_libs@
278evas_image_loader_ico_cflags = @evas_image_loader_ico_cflags@
279evas_image_loader_ico_libs = @evas_image_loader_ico_libs@
280evas_image_loader_jpeg_cflags = @evas_image_loader_jpeg_cflags@
281evas_image_loader_jpeg_libs = @evas_image_loader_jpeg_libs@
282evas_image_loader_pmaps_cflags = @evas_image_loader_pmaps_cflags@
283evas_image_loader_pmaps_libs = @evas_image_loader_pmaps_libs@
284evas_image_loader_png_cflags = @evas_image_loader_png_cflags@
285evas_image_loader_png_libs = @evas_image_loader_png_libs@
286evas_image_loader_psd_cflags = @evas_image_loader_psd_cflags@
287evas_image_loader_psd_libs = @evas_image_loader_psd_libs@
288evas_image_loader_svg_cflags = @evas_image_loader_svg_cflags@
289evas_image_loader_svg_libs = @evas_image_loader_svg_libs@
290evas_image_loader_tga_cflags = @evas_image_loader_tga_cflags@
291evas_image_loader_tga_libs = @evas_image_loader_tga_libs@
292evas_image_loader_tiff_cflags = @evas_image_loader_tiff_cflags@
293evas_image_loader_tiff_libs = @evas_image_loader_tiff_libs@
294evas_image_loader_wbmp_cflags = @evas_image_loader_wbmp_cflags@
295evas_image_loader_wbmp_libs = @evas_image_loader_wbmp_libs@
296evas_image_loader_xpm_cflags = @evas_image_loader_xpm_cflags@
297evas_image_loader_xpm_libs = @evas_image_loader_xpm_libs@
298exec_prefix = @exec_prefix@
299have_evas_engine_gl_x11 = @have_evas_engine_gl_x11@
300have_evas_engine_gl_xcb = @have_evas_engine_gl_xcb@
301have_evas_engine_gl_xlib = @have_evas_engine_gl_xlib@
302have_evas_engine_software_x11 = @have_evas_engine_software_x11@
303have_evas_engine_software_xcb = @have_evas_engine_software_xcb@
304have_evas_engine_software_xlib = @have_evas_engine_software_xlib@
305have_lcov = @have_lcov@
306host = @host@
307host_alias = @host_alias@
308host_cpu = @host_cpu@
309host_os = @host_os@
310host_vendor = @host_vendor@
311htmldir = @htmldir@
312includedir = @includedir@
313infodir = @infodir@
314install_sh = @install_sh@
315libdir = @libdir@
316libexecdir = @libexecdir@
317localedir = @localedir@
318localstatedir = @localstatedir@
319lt_ECHO = @lt_ECHO@
320lt_enable_auto_import = @lt_enable_auto_import@
321mandir = @mandir@
322mkdir_p = @mkdir_p@
323oldincludedir = @oldincludedir@
324pdfdir = @pdfdir@
325pkgconfig_requires_private = @pkgconfig_requires_private@
326prefix = @prefix@
327program_transform_name = @program_transform_name@
328psdir = @psdir@
329pthread_cflags = @pthread_cflags@
330pthread_libs = @pthread_libs@
331release_info = @release_info@
332requirement_evas = @requirement_evas@
333sbindir = @sbindir@
334sharedstatedir = @sharedstatedir@
335srcdir = @srcdir@
336sysconfdir = @sysconfdir@
337target_alias = @target_alias@
338top_build_prefix = @top_build_prefix@
339top_builddir = @top_builddir@
340top_srcdir = @top_srcdir@
341version_info = @version_info@
342MAINTAINERCLEANFILES = Makefile.in
343EXTRA_DIST = \
344op_mul_color_.c \
345op_mul_color_i386.c \
346op_mul_mask_color_.c \
347op_mul_mask_color_i386.c \
348op_mul_pixel_.c \
349op_mul_pixel_color_.c \
350op_mul_pixel_color_i386.c \
351op_mul_pixel_i386.c \
352op_mul_pixel_mask_.c \
353op_mul_pixel_mask_i386.c
354
355all: all-am
356
357.SUFFIXES:
358$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
359 @for dep in $?; do \
360 case '$(am__configure_deps)' in \
361 *$$dep*) \
362 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
363 && { if test -f $@; then exit 0; else break; fi; }; \
364 exit 1;; \
365 esac; \
366 done; \
367 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/engines/common/evas_op_mul/Makefile'; \
368 $(am__cd) $(top_srcdir) && \
369 $(AUTOMAKE) --gnu src/lib/engines/common/evas_op_mul/Makefile
370.PRECIOUS: Makefile
371Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
372 @case '$?' in \
373 *config.status*) \
374 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
375 *) \
376 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
377 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
378 esac;
379
380$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
381 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
382
383$(top_srcdir)/configure: $(am__configure_deps)
384 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
385$(ACLOCAL_M4): $(am__aclocal_m4_deps)
386 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
387$(am__aclocal_m4_deps):
388
389mostlyclean-libtool:
390 -rm -f *.lo
391
392clean-libtool:
393 -rm -rf .libs _libs
394tags: TAGS
395TAGS:
396
397ctags: CTAGS
398CTAGS:
399
400
401distdir: $(DISTFILES)
402 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
403 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
404 list='$(DISTFILES)'; \
405 dist_files=`for file in $$list; do echo $$file; done | \
406 sed -e "s|^$$srcdirstrip/||;t" \
407 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
408 case $$dist_files in \
409 */*) $(MKDIR_P) `echo "$$dist_files" | \
410 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
411 sort -u` ;; \
412 esac; \
413 for file in $$dist_files; do \
414 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
415 if test -d $$d/$$file; then \
416 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
417 if test -d "$(distdir)/$$file"; then \
418 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
419 fi; \
420 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
421 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
422 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
423 fi; \
424 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
425 else \
426 test -f "$(distdir)/$$file" \
427 || cp -p $$d/$$file "$(distdir)/$$file" \
428 || exit 1; \
429 fi; \
430 done
431check-am: all-am
432check: check-am
433all-am: Makefile
434installdirs:
435install: install-am
436install-exec: install-exec-am
437install-data: install-data-am
438uninstall: uninstall-am
439
440install-am: all-am
441 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
442
443installcheck: installcheck-am
444install-strip:
445 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
446 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
447 `test -z '$(STRIP)' || \
448 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
449mostlyclean-generic:
450
451clean-generic:
452
453distclean-generic:
454 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
455 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
456
457maintainer-clean-generic:
458 @echo "This command is intended for maintainers to use"
459 @echo "it deletes files that may require special tools to rebuild."
460 -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
461clean: clean-am
462
463clean-am: clean-generic clean-libtool mostlyclean-am
464
465distclean: distclean-am
466 -rm -f Makefile
467distclean-am: clean-am distclean-generic
468
469dvi: dvi-am
470
471dvi-am:
472
473html: html-am
474
475html-am:
476
477info: info-am
478
479info-am:
480
481install-data-am:
482
483install-dvi: install-dvi-am
484
485install-dvi-am:
486
487install-exec-am:
488
489install-html: install-html-am
490
491install-html-am:
492
493install-info: install-info-am
494
495install-info-am:
496
497install-man:
498
499install-pdf: install-pdf-am
500
501install-pdf-am:
502
503install-ps: install-ps-am
504
505install-ps-am:
506
507installcheck-am:
508
509maintainer-clean: maintainer-clean-am
510 -rm -f Makefile
511maintainer-clean-am: distclean-am maintainer-clean-generic
512
513mostlyclean: mostlyclean-am
514
515mostlyclean-am: mostlyclean-generic mostlyclean-libtool
516
517pdf: pdf-am
518
519pdf-am:
520
521ps: ps-am
522
523ps-am:
524
525uninstall-am:
526
527.MAKE: install-am install-strip
528
529.PHONY: all all-am check check-am clean clean-generic clean-libtool \
530 distclean distclean-generic distclean-libtool distdir dvi \
531 dvi-am html html-am info info-am install install-am \
532 install-data install-data-am install-dvi install-dvi-am \
533 install-exec install-exec-am install-html install-html-am \
534 install-info install-info-am install-man install-pdf \
535 install-pdf-am install-ps install-ps-am install-strip \
536 installcheck installcheck-am installdirs maintainer-clean \
537 maintainer-clean-generic mostlyclean mostlyclean-generic \
538 mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am
539
540
541# Tell versions [3.59,3.63) of GNU make to not export all variables.
542# Otherwise a system limit (for SysV at least) may be exceeded.
543.NOEXPORT:
diff --git a/libraries/evas/src/lib/engines/common/evas_op_mul/op_mul_color_.c b/libraries/evas/src/lib/engines/common/evas_op_mul/op_mul_color_.c
new file mode 100644
index 0000000..fb656b5
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_mul/op_mul_color_.c
@@ -0,0 +1,65 @@
1/* mul color --> dst */
2
3#ifdef BUILD_C
4static void
5_op_mul_c_dp(DATA32 *s __UNUSED__, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) {
6 DATA32 *e = d + l;
7 for (; d < e; d++) {
8 *d = MUL4_SYM(c, *d);
9 }
10}
11
12static void
13_op_mul_caa_dp(DATA32 *s __UNUSED__, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) {
14 DATA32 *e = d + l;
15 c = 1 + (c >> 24);
16 for (; d < e; d++) {
17 *d = MUL_256(c, *d);
18 }
19}
20
21#define _op_mul_can_dp _op_mul_c_dp
22
23#define _op_mul_c_dpan _op_mul_c_dp
24#define _op_mul_can_dpan _op_mul_can_dp
25#define _op_mul_caa_dpan _op_mul_caa_dp
26
27static void
28init_mul_color_span_funcs_c(void)
29{
30 op_mul_span_funcs[SP_N][SM_N][SC][DP][CPU_C] = _op_mul_c_dp;
31 op_mul_span_funcs[SP_N][SM_N][SC_AN][DP][CPU_C] = _op_mul_can_dp;
32 op_mul_span_funcs[SP_N][SM_N][SC_AA][DP][CPU_C] = _op_mul_caa_dp;
33
34 op_mul_span_funcs[SP_N][SM_N][SC][DP_AN][CPU_C] = _op_mul_c_dpan;
35 op_mul_span_funcs[SP_N][SM_N][SC_AN][DP_AN][CPU_C] = _op_mul_can_dpan;
36 op_mul_span_funcs[SP_N][SM_N][SC_AA][DP_AN][CPU_C] = _op_mul_caa_dpan;
37}
38#endif
39
40#ifdef BUILD_C
41static void
42_op_mul_pt_c_dp(DATA32 s __UNUSED__, DATA8 m __UNUSED__, DATA32 c, DATA32 *d) {
43 *d = MUL4_SYM(c, *d);
44}
45
46#define _op_mul_pt_can_dp _op_mul_pt_c_dp
47#define _op_mul_pt_caa_dp _op_mul_pt_c_dp
48
49#define _op_mul_pt_c_dpan _op_mul_pt_c_dp
50#define _op_mul_pt_can_dpan _op_mul_pt_can_dp
51#define _op_mul_pt_caa_dpan _op_mul_pt_caa_dp
52
53static void
54init_mul_color_pt_funcs_c(void)
55{
56 op_mul_pt_funcs[SP_N][SM_N][SC][DP][CPU_C] = _op_mul_pt_c_dp;
57 op_mul_pt_funcs[SP_N][SM_N][SC_AN][DP][CPU_C] = _op_mul_pt_can_dp;
58 op_mul_pt_funcs[SP_N][SM_N][SC_AA][DP][CPU_C] = _op_mul_pt_caa_dp;
59
60 op_mul_pt_funcs[SP_N][SM_N][SC][DP_AN][CPU_C] = _op_mul_pt_c_dpan;
61 op_mul_pt_funcs[SP_N][SM_N][SC_AN][DP_AN][CPU_C] = _op_mul_pt_can_dpan;
62 op_mul_pt_funcs[SP_N][SM_N][SC_AA][DP_AN][CPU_C] = _op_mul_pt_caa_dpan;
63}
64#endif
65
diff --git a/libraries/evas/src/lib/engines/common/evas_op_mul/op_mul_color_i386.c b/libraries/evas/src/lib/engines/common/evas_op_mul/op_mul_color_i386.c
new file mode 100644
index 0000000..95f43f6
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_mul/op_mul_color_i386.c
@@ -0,0 +1,66 @@
1/* mul color --> dst */
2
3#ifdef BUILD_MMX
4static void
5_op_mul_c_dp_mmx(DATA32 *s __UNUSED__, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) {
6 DATA32 *e = d + l;
7 pxor_r2r(mm0, mm0);
8 MOV_A2R(ALPHA_255, mm5)
9 MOV_P2R(c, mm2, mm0)
10 for (; d < e; d++) {
11 MOV_P2R(*d, mm1, mm0)
12 MUL4_SYM_R2R(mm2, mm1, mm5)
13 MOV_R2P(mm1, *d, mm0)
14 }
15}
16
17#define _op_mul_can_dp_mmx _op_mul_c_dp_mmx
18#define _op_mul_caa_dp_mmx _op_mul_c_dp_mmx
19
20#define _op_mul_c_dpan_mmx _op_mul_c_dp_mmx
21#define _op_mul_can_dpan_mmx _op_mul_can_dp_mmx
22#define _op_mul_caa_dpan_mmx _op_mul_caa_dp_mmx
23
24static void
25init_mul_color_span_funcs_mmx(void)
26{
27 op_mul_span_funcs[SP_N][SM_N][SC][DP][CPU_MMX] = _op_mul_c_dp_mmx;
28 op_mul_span_funcs[SP_N][SM_N][SC_AN][DP][CPU_MMX] = _op_mul_can_dp_mmx;
29 op_mul_span_funcs[SP_N][SM_N][SC_AA][DP][CPU_MMX] = _op_mul_caa_dp_mmx;
30
31 op_mul_span_funcs[SP_N][SM_N][SC][DP_AN][CPU_MMX] = _op_mul_c_dpan_mmx;
32 op_mul_span_funcs[SP_N][SM_N][SC_AN][DP_AN][CPU_MMX] = _op_mul_can_dpan_mmx;
33 op_mul_span_funcs[SP_N][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_mul_caa_dpan_mmx;
34}
35#endif
36
37#ifdef BUILD_MMX
38static void
39_op_mul_pt_c_dp_mmx(DATA32 s __UNUSED__, DATA8 m __UNUSED__, DATA32 c, DATA32 *d) {
40 pxor_r2r(mm0, mm0);
41 MOV_A2R(ALPHA_255, mm5)
42 MOV_P2R(c, mm2, mm0)
43 MOV_P2R(*d, mm1, mm0)
44 MUL4_SYM_R2R(mm2, mm1, mm5)
45 MOV_R2P(mm1, *d, mm0)
46}
47
48#define _op_mul_pt_caa_dp_mmx _op_mul_pt_c_dp_mmx
49#define _op_mul_pt_can_dp_mmx _op_mul_pt_c_dp_mmx
50
51#define _op_mul_pt_c_dpan_mmx _op_mul_pt_c_dp_mmx
52#define _op_mul_pt_can_dpan_mmx _op_mul_pt_can_dp_mmx
53#define _op_mul_pt_caa_dpan_mmx _op_mul_pt_caa_dp_mmx
54
55static void
56init_mul_color_pt_funcs_mmx(void)
57{
58 op_mul_pt_funcs[SP_N][SM_N][SC][DP][CPU_MMX] = _op_mul_pt_c_dp_mmx;
59 op_mul_pt_funcs[SP_N][SM_N][SC_AN][DP][CPU_MMX] = _op_mul_pt_can_dp_mmx;
60 op_mul_pt_funcs[SP_N][SM_N][SC_AA][DP][CPU_MMX] = _op_mul_pt_caa_dp_mmx;
61
62 op_mul_pt_funcs[SP_N][SM_N][SC][DP_AN][CPU_MMX] = _op_mul_pt_c_dpan_mmx;
63 op_mul_pt_funcs[SP_N][SM_N][SC_AN][DP_AN][CPU_MMX] = _op_mul_pt_can_dpan_mmx;
64 op_mul_pt_funcs[SP_N][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_mul_pt_caa_dpan_mmx;
65}
66#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_mul/op_mul_mask_color_.c b/libraries/evas/src/lib/engines/common/evas_op_mul/op_mul_mask_color_.c
new file mode 100644
index 0000000..7a6e403
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_mul/op_mul_mask_color_.c
@@ -0,0 +1,72 @@
1/* mul mask x color -> dst */
2
3#ifdef BUILD_C
4static void
5_op_mul_mas_c_dp(DATA32 *s __UNUSED__, DATA8 *m, DATA32 c, DATA32 *d, int l) {
6 DATA32 *e = d + l, nc = ~c;
7 while (d < e)
8 {
9 DATA32 a = *m;
10 switch(a)
11 {
12 case 0:
13 break;
14 case 255:
15 *d = MUL4_SYM(c, *d);
16 break;
17 default:
18 a = ~MUL_SYM(a, nc);
19 *d = MUL4_SYM(a, *d);
20 break;
21 }
22 m++; d++;
23 }
24}
25
26#define _op_mul_mas_can_dp _op_mul_mas_c_dp
27#define _op_mul_mas_caa_dp _op_mul_mas_c_dp
28
29#define _op_mul_mas_c_dpan _op_mul_mas_c_dp
30#define _op_mul_mas_can_dpan _op_mul_mas_can_dp
31#define _op_mul_mas_caa_dpan _op_mul_mas_caa_dp
32
33static void
34init_mul_mask_color_span_funcs_c(void)
35{
36 op_mul_span_funcs[SP_N][SM_AS][SC][DP][CPU_C] = _op_mul_mas_c_dp;
37 op_mul_span_funcs[SP_N][SM_AS][SC_AN][DP][CPU_C] = _op_mul_mas_can_dp;
38 op_mul_span_funcs[SP_N][SM_AS][SC_AA][DP][CPU_C] = _op_mul_mas_caa_dp;
39
40 op_mul_span_funcs[SP_N][SM_AS][SC][DP_AN][CPU_C] = _op_mul_mas_c_dpan;
41 op_mul_span_funcs[SP_N][SM_AS][SC_AN][DP_AN][CPU_C] = _op_mul_mas_can_dpan;
42 op_mul_span_funcs[SP_N][SM_AS][SC_AA][DP_AN][CPU_C] = _op_mul_mas_caa_dpan;
43}
44#endif
45
46#ifdef BUILD_C
47static void
48_op_mul_pt_mas_c_dp(DATA32 s __UNUSED__, DATA8 m, DATA32 c, DATA32 *d) {
49 c = ~c;
50 c = ~MUL_SYM(m, c);
51 *d = MUL4_SYM(c, *d);
52}
53
54#define _op_mul_pt_mas_can_dp _op_mul_pt_mas_c_dp
55#define _op_mul_pt_mas_caa_dp _op_mul_pt_mas_c_dp
56
57#define _op_mul_pt_mas_c_dpan _op_mul_pt_mas_c_dp
58#define _op_mul_pt_mas_can_dpan _op_mul_pt_mas_can_dp
59#define _op_mul_pt_mas_caa_dpan _op_mul_pt_mas_caa_dp
60
61static void
62init_mul_mask_color_pt_funcs_c(void)
63{
64 op_mul_pt_funcs[SP_N][SM_AS][SC][DP][CPU_C] = _op_mul_pt_mas_c_dp;
65 op_mul_pt_funcs[SP_N][SM_AS][SC_AN][DP][CPU_C] = _op_mul_pt_mas_can_dp;
66 op_mul_pt_funcs[SP_N][SM_AS][SC_AA][DP][CPU_C] = _op_mul_pt_mas_caa_dp;
67
68 op_mul_pt_funcs[SP_N][SM_AS][SC][DP_AN][CPU_C] = _op_mul_pt_mas_c_dpan;
69 op_mul_pt_funcs[SP_N][SM_AS][SC_AN][DP_AN][CPU_C] = _op_mul_pt_mas_can_dpan;
70 op_mul_pt_funcs[SP_N][SM_AS][SC_AA][DP_AN][CPU_C] = _op_mul_pt_mas_caa_dpan;
71}
72#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_mul/op_mul_mask_color_i386.c b/libraries/evas/src/lib/engines/common/evas_op_mul/op_mul_mask_color_i386.c
new file mode 100644
index 0000000..1999503
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_mul/op_mul_mask_color_i386.c
@@ -0,0 +1,92 @@
1/* mul mask x color -> dst */
2
3#ifdef BUILD_MMX
4static void
5_op_mul_mas_c_dp_mmx(DATA32 *s __UNUSED__, DATA8 *m, DATA32 c, DATA32 *d, int l) {
6 DATA32 *e = d + l;
7 MOV_P2R(c, mm2, mm0)
8 c = ~c;
9 MOV_P2R(c, mm3, mm0)
10 MOV_A2R(ALPHA_255, mm5)
11 pxor_r2r(mm0, mm0);
12 while (d < e) {
13 DATA32 a = *m;
14 switch(a)
15 {
16 case 0:
17 break;
18 case 255:
19 MOV_P2R(*d, mm1, mm0)
20 MUL4_SYM_R2R(mm2, mm1, mm5)
21 MOV_R2P(mm1, *d, mm0)
22 break;
23 default:
24 a++;
25 MOV_A2R(a, mm1)
26 MUL4_256_R2R(mm3, mm1)
27 movq_r2r(mm5, mm4);
28 psubw_r2r(mm1, mm4);
29 MOV_P2R(*d, mm1, mm0)
30 MUL4_SYM_R2R(mm4, mm1, mm5)
31 MOV_R2P(mm1, *d, mm0)
32 break;
33 }
34 m++; d++;
35 }
36}
37
38#define _op_mul_mas_can_dp_mmx _op_mul_mas_c_dp_mmx
39#define _op_mul_mas_caa_dp_mmx _op_mul_mas_c_dp_mmx
40
41#define _op_mul_mas_c_dpan_mmx _op_mul_mas_c_dp_mmx
42#define _op_mul_mas_can_dpan_mmx _op_mul_mas_can_dp_mmx
43#define _op_mul_mas_caa_dpan_mmx _op_mul_mas_caa_dp_mmx
44
45static void
46init_mul_mask_color_span_funcs_mmx(void)
47{
48 op_mul_span_funcs[SP_N][SM_AS][SC][DP][CPU_MMX] = _op_mul_mas_c_dp_mmx;
49 op_mul_span_funcs[SP_N][SM_AS][SC_AN][DP][CPU_MMX] = _op_mul_mas_can_dp_mmx;
50 op_mul_span_funcs[SP_N][SM_AS][SC_AA][DP][CPU_MMX] = _op_mul_mas_caa_dp_mmx;
51
52 op_mul_span_funcs[SP_N][SM_AS][SC][DP_AN][CPU_MMX] = _op_mul_mas_c_dpan_mmx;
53 op_mul_span_funcs[SP_N][SM_AS][SC_AN][DP_AN][CPU_MMX] = _op_mul_mas_can_dpan_mmx;
54 op_mul_span_funcs[SP_N][SM_AS][SC_AA][DP_AN][CPU_MMX] = _op_mul_mas_caa_dpan_mmx;
55}
56#endif
57
58#ifdef BUILD_MMX
59static void
60_op_mul_pt_mas_c_dp_mmx(DATA32 s, DATA8 m, DATA32 c, DATA32 *d) {
61 s = m + 1;
62 c = ~c;
63 MOV_P2R(c, mm3, mm0)
64 MOV_A2R(ALPHA_255, mm4)
65 pxor_r2r(mm0, mm0);
66 MOV_A2R(s, mm1)
67 MUL4_256_R2R(mm3, mm1)
68 psubw_r2r(mm1, mm4);
69 MOV_P2R(*d, mm1, mm0)
70 MUL4_SYM_R2R(mm4, mm1, mm5)
71 MOV_R2P(mm1, *d, mm0)
72}
73
74#define _op_mul_pt_mas_can_dp_mmx _op_mul_pt_mas_c_dp_mmx
75#define _op_mul_pt_mas_caa_dp_mmx _op_mul_pt_mas_c_dp_mmx
76
77#define _op_mul_pt_mas_c_dpan_mmx _op_mul_pt_mas_c_dp_mmx
78#define _op_mul_pt_mas_can_dpan_mmx _op_mul_pt_mas_can_dp_mmx
79#define _op_mul_pt_mas_caa_dpan_mmx _op_mul_pt_mas_caa_dp_mmx
80
81static void
82init_mul_mask_color_pt_funcs_mmx(void)
83{
84 op_mul_pt_funcs[SP_N][SM_AS][SC][DP][CPU_MMX] = _op_mul_pt_mas_c_dp_mmx;
85 op_mul_pt_funcs[SP_N][SM_AS][SC_AN][DP][CPU_MMX] = _op_mul_pt_mas_can_dp_mmx;
86 op_mul_pt_funcs[SP_N][SM_AS][SC_AA][DP][CPU_MMX] = _op_mul_pt_mas_caa_dp_mmx;
87
88 op_mul_pt_funcs[SP_N][SM_AS][SC][DP_AN][CPU_MMX] = _op_mul_pt_mas_c_dpan_mmx;
89 op_mul_pt_funcs[SP_N][SM_AS][SC_AN][DP_AN][CPU_MMX] = _op_mul_pt_mas_can_dpan_mmx;
90 op_mul_pt_funcs[SP_N][SM_AS][SC_AA][DP_AN][CPU_MMX] = _op_mul_pt_mas_caa_dpan_mmx;
91}
92#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_mul/op_mul_pixel_.c b/libraries/evas/src/lib/engines/common/evas_op_mul/op_mul_pixel_.c
new file mode 100644
index 0000000..2e034b9
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_mul/op_mul_pixel_.c
@@ -0,0 +1,56 @@
1/* mul pixel --> dst */
2
3#ifdef BUILD_C
4static void
5_op_mul_p_dp(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c __UNUSED__, DATA32 *d, int l) {
6 DATA32 *e = d + l;
7 for (; d < e; d++, s++) {
8 *d = MUL4_SYM(*s, *d);
9 }
10}
11
12#define _op_mul_pas_dp _op_mul_p_dp
13#define _op_mul_pan_dp _op_mul_p_dp
14
15#define _op_mul_p_dpan _op_mul_p_dp
16#define _op_mul_pas_dpan _op_mul_pas_dp
17#define _op_mul_pan_dpan _op_mul_pan_dp
18
19static void
20init_mul_pixel_span_funcs_c(void)
21{
22 op_mul_span_funcs[SP][SM_N][SC_N][DP][CPU_C] = _op_mul_p_dp;
23 op_mul_span_funcs[SP_AS][SM_N][SC_N][DP][CPU_C] = _op_mul_pas_dp;
24 op_mul_span_funcs[SP_AN][SM_N][SC_N][DP][CPU_C] = _op_mul_pan_dp;
25
26 op_mul_span_funcs[SP][SM_N][SC_N][DP_AN][CPU_C] = _op_mul_p_dpan;
27 op_mul_span_funcs[SP_AS][SM_N][SC_N][DP_AN][CPU_C] = _op_mul_pas_dpan;
28 op_mul_span_funcs[SP_AN][SM_N][SC_N][DP_AN][CPU_C] = _op_mul_pan_dpan;
29}
30#endif
31
32#ifdef BUILD_C
33static void
34_op_mul_pt_p_dp(DATA32 s, DATA8 m __UNUSED__, DATA32 c __UNUSED__, DATA32 *d) {
35 *d = MUL4_SYM(s, *d);
36}
37
38#define _op_mul_pt_pas_dp _op_mul_pt_p_dp
39#define _op_mul_pt_pan_dp _op_mul_pt_p_dp
40
41#define _op_mul_pt_p_dpan _op_mul_pt_p_dp
42#define _op_mul_pt_pan_dpan _op_mul_pt_pan_dp
43#define _op_mul_pt_pas_dpan _op_mul_pt_pas_dp
44
45static void
46init_mul_pixel_pt_funcs_c(void)
47{
48 op_mul_pt_funcs[SP][SM_N][SC_N][DP][CPU_C] = _op_mul_pt_p_dp;
49 op_mul_pt_funcs[SP_AS][SM_N][SC_N][DP][CPU_C] = _op_mul_pt_pas_dp;
50 op_mul_pt_funcs[SP_AN][SM_N][SC_N][DP][CPU_C] = _op_mul_pt_pan_dp;
51
52 op_mul_pt_funcs[SP][SM_N][SC_N][DP_AN][CPU_C] = _op_mul_pt_p_dpan;
53 op_mul_pt_funcs[SP_AS][SM_N][SC_N][DP_AN][CPU_C] = _op_mul_pt_pas_dpan;
54 op_mul_pt_funcs[SP_AN][SM_N][SC_N][DP_AN][CPU_C] = _op_mul_pt_pan_dpan;
55}
56#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_mul/op_mul_pixel_color_.c b/libraries/evas/src/lib/engines/common/evas_op_mul/op_mul_pixel_color_.c
new file mode 100644
index 0000000..3ea6919
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_mul/op_mul_pixel_color_.c
@@ -0,0 +1,122 @@
1/* mul pixel x color --> dst */
2
3#ifdef BUILD_C
4static void
5_op_mul_p_c_dp(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) {
6 DATA32 *e = d + l;
7 while (d < e) {
8 DATA32 cs = MUL4_SYM(c, *s);
9 *d = MUL4_SYM(cs, *d);
10 s++; d++;
11 }
12}
13
14static void
15_op_mul_p_caa_dp(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) {
16 DATA32 *e = d + l;
17 c = 1 + (c >> 24);
18 while (d < e)
19 {
20 DATA32 cs = MUL_256(c, *s);
21 *d = MUL4_SYM(cs, *d);
22 s++; d++;
23 }
24}
25
26#define _op_mul_pas_c_dp _op_mul_p_c_dp
27#define _op_mul_pan_c_dp _op_mul_p_c_dp
28#define _op_mul_p_can_dp _op_mul_p_c_dp
29#define _op_mul_pas_can_dp _op_mul_p_c_dp
30#define _op_mul_pan_can_dp _op_mul_p_c_dp
31#define _op_mul_pas_caa_dp _op_mul_p_caa_dp
32#define _op_mul_pan_caa_dp _op_mul_p_caa_dp
33
34#define _op_mul_p_c_dpan _op_mul_p_c_dp
35#define _op_mul_pas_c_dpan _op_mul_pas_c_dp
36#define _op_mul_pan_c_dpan _op_mul_pan_c_dp
37#define _op_mul_p_can_dpan _op_mul_p_can_dp
38#define _op_mul_pas_can_dpan _op_mul_pas_can_dp
39#define _op_mul_pan_can_dpan _op_mul_pan_can_dp
40#define _op_mul_p_caa_dpan _op_mul_p_caa_dp
41#define _op_mul_pas_caa_dpan _op_mul_pas_caa_dp
42#define _op_mul_pan_caa_dpan _op_mul_pan_caa_dp
43
44static void
45init_mul_pixel_color_span_funcs_c(void)
46{
47 op_mul_span_funcs[SP][SM_N][SC][DP][CPU_C] = _op_mul_p_c_dp;
48 op_mul_span_funcs[SP_AS][SM_N][SC][DP][CPU_C] = _op_mul_pas_c_dp;
49 op_mul_span_funcs[SP_AN][SM_N][SC][DP][CPU_C] = _op_mul_pan_c_dp;
50 op_mul_span_funcs[SP][SM_N][SC_AN][DP][CPU_C] = _op_mul_p_can_dp;
51 op_mul_span_funcs[SP_AS][SM_N][SC_AN][DP][CPU_C] = _op_mul_pas_can_dp;
52 op_mul_span_funcs[SP_AN][SM_N][SC_AN][DP][CPU_C] = _op_mul_pan_can_dp;
53 op_mul_span_funcs[SP][SM_N][SC_AA][DP][CPU_C] = _op_mul_p_caa_dp;
54 op_mul_span_funcs[SP_AS][SM_N][SC_AA][DP][CPU_C] = _op_mul_pas_caa_dp;
55 op_mul_span_funcs[SP_AN][SM_N][SC_AA][DP][CPU_C] = _op_mul_pan_caa_dp;
56
57 op_mul_span_funcs[SP][SM_N][SC][DP_AN][CPU_C] = _op_mul_p_c_dpan;
58 op_mul_span_funcs[SP_AS][SM_N][SC][DP_AN][CPU_C] = _op_mul_pas_c_dpan;
59 op_mul_span_funcs[SP_AN][SM_N][SC][DP_AN][CPU_C] = _op_mul_pan_c_dpan;
60 op_mul_span_funcs[SP][SM_N][SC_AN][DP_AN][CPU_C] = _op_mul_p_can_dpan;
61 op_mul_span_funcs[SP_AS][SM_N][SC_AN][DP_AN][CPU_C] = _op_mul_pas_can_dpan;
62 op_mul_span_funcs[SP_AN][SM_N][SC_AN][DP_AN][CPU_C] = _op_mul_pan_can_dpan;
63 op_mul_span_funcs[SP][SM_N][SC_AA][DP_AN][CPU_C] = _op_mul_p_caa_dpan;
64 op_mul_span_funcs[SP_AS][SM_N][SC_AA][DP_AN][CPU_C] = _op_mul_pas_caa_dpan;
65 op_mul_span_funcs[SP_AN][SM_N][SC_AA][DP_AN][CPU_C] = _op_mul_pan_caa_dpan;
66}
67#endif
68
69#ifdef BUILD_C
70static void
71_op_mul_pt_p_c_dp(DATA32 s, DATA8 m __UNUSED__, DATA32 c, DATA32 *d) {
72 s = MUL4_SYM(c, s);
73 *d = MUL4_SYM(s, *d);
74}
75
76static void
77_op_mul_pt_p_caa_dp(DATA32 s, DATA8 m __UNUSED__, DATA32 c, DATA32 *d) {
78 s = MUL_SYM(c >> 24, s);
79 *d = MUL4_SYM(s, *d);
80}
81
82#define _op_mul_pt_pas_c_dp _op_mul_pt_p_c_dp
83#define _op_mul_pt_pan_c_dp _op_mul_pt_p_c_dp
84#define _op_mul_pt_p_can_dp _op_mul_pt_p_c_dp
85#define _op_mul_pt_pas_can_dp _op_mul_pt_p_c_dp
86#define _op_mul_pt_pan_can_dp _op_mul_pt_p_c_dp
87#define _op_mul_pt_pas_caa_dp _op_mul_pt_p_caa_dp
88#define _op_mul_pt_pan_caa_dp _op_mul_pt_p_caa_dp
89
90#define _op_mul_pt_p_c_dpan _op_mul_pt_p_c_dp
91#define _op_mul_pt_pan_c_dpan _op_mul_pt_pan_c_dp
92#define _op_mul_pt_pas_c_dpan _op_mul_pt_pas_c_dp
93#define _op_mul_pt_p_can_dpan _op_mul_pt_p_can_dp
94#define _op_mul_pt_pan_can_dpan _op_mul_pt_pan_can_dp
95#define _op_mul_pt_pas_can_dpan _op_mul_pt_pas_can_dp
96#define _op_mul_pt_p_caa_dpan _op_mul_pt_p_caa_dp
97#define _op_mul_pt_pan_caa_dpan _op_mul_pt_pan_caa_dp
98#define _op_mul_pt_pas_caa_dpan _op_mul_pt_pas_caa_dp
99static void
100init_mul_pixel_color_pt_funcs_c(void)
101{
102 op_mul_pt_funcs[SP][SM_N][SC][DP][CPU_C] = _op_mul_pt_p_c_dp;
103 op_mul_pt_funcs[SP_AS][SM_N][SC][DP][CPU_C] = _op_mul_pt_pas_c_dp;
104 op_mul_pt_funcs[SP_AN][SM_N][SC][DP][CPU_C] = _op_mul_pt_pan_c_dp;
105 op_mul_pt_funcs[SP][SM_N][SC_AN][DP][CPU_C] = _op_mul_pt_p_can_dp;
106 op_mul_pt_funcs[SP_AS][SM_N][SC_AN][DP][CPU_C] = _op_mul_pt_pas_can_dp;
107 op_mul_pt_funcs[SP_AN][SM_N][SC_AN][DP][CPU_C] = _op_mul_pt_pan_can_dp;
108 op_mul_pt_funcs[SP][SM_N][SC_AA][DP][CPU_C] = _op_mul_pt_p_caa_dp;
109 op_mul_pt_funcs[SP_AS][SM_N][SC_AA][DP][CPU_C] = _op_mul_pt_pas_caa_dp;
110 op_mul_pt_funcs[SP_AN][SM_N][SC_AA][DP][CPU_C] = _op_mul_pt_pan_caa_dp;
111
112 op_mul_pt_funcs[SP][SM_N][SC][DP_AN][CPU_C] = _op_mul_pt_p_c_dpan;
113 op_mul_pt_funcs[SP_AS][SM_N][SC][DP_AN][CPU_C] = _op_mul_pt_pas_c_dpan;
114 op_mul_pt_funcs[SP_AN][SM_N][SC][DP_AN][CPU_C] = _op_mul_pt_pan_c_dpan;
115 op_mul_pt_funcs[SP][SM_N][SC_AN][DP_AN][CPU_C] = _op_mul_pt_p_can_dpan;
116 op_mul_pt_funcs[SP_AS][SM_N][SC_AN][DP_AN][CPU_C] = _op_mul_pt_pas_can_dpan;
117 op_mul_pt_funcs[SP_AN][SM_N][SC_AN][DP_AN][CPU_C] = _op_mul_pt_pan_can_dpan;
118 op_mul_pt_funcs[SP][SM_N][SC_AA][DP_AN][CPU_C] = _op_mul_pt_p_caa_dpan;
119 op_mul_pt_funcs[SP_AS][SM_N][SC_AA][DP_AN][CPU_C] = _op_mul_pt_pas_caa_dpan;
120 op_mul_pt_funcs[SP_AN][SM_N][SC_AA][DP_AN][CPU_C] = _op_mul_pt_pan_caa_dpan;
121}
122#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_mul/op_mul_pixel_color_i386.c b/libraries/evas/src/lib/engines/common/evas_op_mul/op_mul_pixel_color_i386.c
new file mode 100644
index 0000000..24f5a80
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_mul/op_mul_pixel_color_i386.c
@@ -0,0 +1,120 @@
1/* mul pixel x color --> dst */
2
3#ifdef BUILD_MMX
4static void
5_op_mul_p_c_dp_mmx(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) {
6 DATA32 *e = d + l;
7 MOV_A2R(ALPHA_255, mm5)
8 pxor_r2r(mm0, mm0);
9 MOV_P2R(c, mm2, mm0)
10 while (d < e)
11 {
12 MOV_P2R(*s, mm3, mm0)
13 MUL4_SYM_R2R(mm2, mm3, mm5)
14 MOV_P2R(*d, mm1, mm0)
15 MUL4_SYM_R2R(mm3, mm1, mm5)
16 MOV_R2P(mm1, *d, mm0)
17 s++; d++;
18 }
19}
20
21#define _op_mul_pas_c_dp_mmx _op_mul_p_c_dp_mmx
22#define _op_mul_pan_c_dp_mmx _op_mul_p_c_dp_mmx
23#define _op_mul_p_can_dp_mmx _op_mul_p_c_dp_mmx
24#define _op_mul_pas_can_dp_mmx _op_mul_p_c_dp_mmx
25#define _op_mul_pan_can_dp_mmx _op_mul_p_c_dp_mmx
26#define _op_mul_p_caa_dp_mmx _op_mul_p_c_dp_mmx
27#define _op_mul_pas_caa_dp_mmx _op_mul_p_c_dp_mmx
28#define _op_mul_pan_caa_dp_mmx _op_mul_p_c_dp_mmx
29
30#define _op_mul_p_c_dpan_mmx _op_mul_p_c_dp_mmx
31#define _op_mul_pan_c_dpan_mmx _op_mul_pan_c_dp_mmx
32#define _op_mul_pas_c_dpan_mmx _op_mul_pas_c_dp_mmx
33#define _op_mul_p_can_dpan_mmx _op_mul_p_can_dp_mmx
34#define _op_mul_pan_can_dpan_mmx _op_mul_pan_can_dp_mmx
35#define _op_mul_pas_can_dpan_mmx _op_mul_pas_can_dp_mmx
36#define _op_mul_p_caa_dpan_mmx _op_mul_p_caa_dp_mmx
37#define _op_mul_pan_caa_dpan_mmx _op_mul_pan_caa_dp_mmx
38#define _op_mul_pas_caa_dpan_mmx _op_mul_pas_caa_dp_mmx
39
40static void
41init_mul_pixel_color_span_funcs_mmx(void)
42{
43 op_mul_span_funcs[SP][SM_N][SC][DP][CPU_MMX] = _op_mul_p_c_dp_mmx;
44 op_mul_span_funcs[SP_AS][SM_N][SC][DP][CPU_MMX] = _op_mul_pas_c_dp_mmx;
45 op_mul_span_funcs[SP_AN][SM_N][SC][DP][CPU_MMX] = _op_mul_pan_c_dp_mmx;
46 op_mul_span_funcs[SP][SM_N][SC_AN][DP][CPU_MMX] = _op_mul_p_can_dp_mmx;
47 op_mul_span_funcs[SP_AS][SM_N][SC_AN][DP][CPU_MMX] = _op_mul_pas_can_dp_mmx;
48 op_mul_span_funcs[SP_AN][SM_N][SC_AN][DP][CPU_MMX] = _op_mul_pan_can_dp_mmx;
49 op_mul_span_funcs[SP][SM_N][SC_AA][DP][CPU_MMX] = _op_mul_p_caa_dp_mmx;
50 op_mul_span_funcs[SP_AS][SM_N][SC_AA][DP][CPU_MMX] = _op_mul_pas_caa_dp_mmx;
51 op_mul_span_funcs[SP_AN][SM_N][SC_AA][DP][CPU_MMX] = _op_mul_pan_caa_dp_mmx;
52
53 op_mul_span_funcs[SP][SM_N][SC][DP_AN][CPU_MMX] = _op_mul_p_c_dpan_mmx;
54 op_mul_span_funcs[SP_AS][SM_N][SC][DP_AN][CPU_MMX] = _op_mul_pas_c_dpan_mmx;
55 op_mul_span_funcs[SP_AN][SM_N][SC][DP_AN][CPU_MMX] = _op_mul_pan_c_dpan_mmx;
56 op_mul_span_funcs[SP][SM_N][SC_AN][DP_AN][CPU_MMX] = _op_mul_p_can_dpan_mmx;
57 op_mul_span_funcs[SP_AS][SM_N][SC_AN][DP_AN][CPU_MMX] = _op_mul_pas_can_dpan_mmx;
58 op_mul_span_funcs[SP_AN][SM_N][SC_AN][DP_AN][CPU_MMX] = _op_mul_pan_can_dpan_mmx;
59 op_mul_span_funcs[SP][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_mul_p_caa_dpan_mmx;
60 op_mul_span_funcs[SP_AS][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_mul_pas_caa_dpan_mmx;
61 op_mul_span_funcs[SP_AN][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_mul_pan_caa_dpan_mmx;
62}
63#endif
64
65#ifdef BUILD_MMX
66static void
67_op_mul_pt_p_c_dp_mmx(DATA32 s, DATA8 m __UNUSED__, DATA32 c, DATA32 *d) {
68 MOV_A2R(ALPHA_255, mm5)
69 pxor_r2r(mm0, mm0);
70 MOV_P2R(c, mm2, mm0)
71 MOV_P2R(s, mm3, mm0)
72 MUL4_SYM_R2R(mm2, mm3, mm5)
73 MOV_P2R(*d, mm1, mm0)
74 MUL4_SYM_R2R(mm3, mm1, mm5)
75 MOV_R2P(mm1, *d, mm0)
76}
77
78#define _op_mul_pt_pas_c_dp_mmx _op_mul_pt_p_c_dp_mmx
79#define _op_mul_pt_pan_c_dp_mmx _op_mul_pt_p_c_dp_mmx
80#define _op_mul_pt_p_can_dp_mmx _op_mul_pt_p_c_dp_mmx
81#define _op_mul_pt_pas_can_dp_mmx _op_mul_pt_p_c_dp_mmx
82#define _op_mul_pt_pan_can_dp_mmx _op_mul_pt_p_c_dp_mmx
83#define _op_mul_pt_p_caa_dp_mmx _op_mul_pt_p_c_dp_mmx
84#define _op_mul_pt_pas_caa_dp_mmx _op_mul_pt_p_c_dp_mmx
85#define _op_mul_pt_pan_caa_dp_mmx _op_mul_pt_p_c_dp_mmx
86
87#define _op_mul_pt_p_c_dpan_mmx _op_mul_pt_p_c_dp_mmx
88#define _op_mul_pt_pan_c_dpan_mmx _op_mul_pt_pan_c_dp_mmx
89#define _op_mul_pt_pas_c_dpan_mmx _op_mul_pt_pas_c_dp_mmx
90#define _op_mul_pt_p_can_dpan_mmx _op_mul_pt_p_can_dp_mmx
91#define _op_mul_pt_pan_can_dpan_mmx _op_mul_pt_pan_can_dp_mmx
92#define _op_mul_pt_pas_can_dpan_mmx _op_mul_pt_pas_can_dp_mmx
93#define _op_mul_pt_p_caa_dpan_mmx _op_mul_pt_p_caa_dp_mmx
94#define _op_mul_pt_pan_caa_dpan_mmx _op_mul_pt_pan_caa_dp_mmx
95#define _op_mul_pt_pas_caa_dpan_mmx _op_mul_pt_pas_caa_dp_mmx
96
97static void
98init_mul_pixel_color_pt_funcs_mmx(void)
99{
100 op_mul_pt_funcs[SP][SM_N][SC][DP][CPU_MMX] = _op_mul_pt_p_c_dp_mmx;
101 op_mul_pt_funcs[SP_AS][SM_N][SC][DP][CPU_MMX] = _op_mul_pt_pas_c_dp_mmx;
102 op_mul_pt_funcs[SP_AN][SM_N][SC][DP][CPU_MMX] = _op_mul_pt_pan_c_dp_mmx;
103 op_mul_pt_funcs[SP][SM_N][SC_AN][DP][CPU_MMX] = _op_mul_pt_p_can_dp_mmx;
104 op_mul_pt_funcs[SP_AS][SM_N][SC_AN][DP][CPU_MMX] = _op_mul_pt_pas_can_dp_mmx;
105 op_mul_pt_funcs[SP_AN][SM_N][SC_AN][DP][CPU_MMX] = _op_mul_pt_pan_can_dp_mmx;
106 op_mul_pt_funcs[SP][SM_N][SC_AA][DP][CPU_MMX] = _op_mul_pt_p_caa_dp_mmx;
107 op_mul_pt_funcs[SP_AS][SM_N][SC_AA][DP][CPU_MMX] = _op_mul_pt_pas_caa_dp_mmx;
108 op_mul_pt_funcs[SP_AN][SM_N][SC_AA][DP][CPU_MMX] = _op_mul_pt_pan_caa_dp_mmx;
109
110 op_mul_pt_funcs[SP][SM_N][SC][DP_AN][CPU_MMX] = _op_mul_pt_p_c_dpan_mmx;
111 op_mul_pt_funcs[SP_AS][SM_N][SC][DP_AN][CPU_MMX] = _op_mul_pt_pas_c_dpan_mmx;
112 op_mul_pt_funcs[SP_AN][SM_N][SC][DP_AN][CPU_MMX] = _op_mul_pt_pan_c_dpan_mmx;
113 op_mul_pt_funcs[SP][SM_N][SC_AN][DP_AN][CPU_MMX] = _op_mul_pt_p_can_dpan_mmx;
114 op_mul_pt_funcs[SP_AS][SM_N][SC_AN][DP_AN][CPU_MMX] = _op_mul_pt_pas_can_dpan_mmx;
115 op_mul_pt_funcs[SP_AN][SM_N][SC_AN][DP_AN][CPU_MMX] = _op_mul_pt_pan_can_dpan_mmx;
116 op_mul_pt_funcs[SP][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_mul_pt_p_caa_dpan_mmx;
117 op_mul_pt_funcs[SP_AS][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_mul_pt_pas_caa_dpan_mmx;
118 op_mul_pt_funcs[SP_AN][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_mul_pt_pan_caa_dpan_mmx;
119}
120#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_mul/op_mul_pixel_i386.c b/libraries/evas/src/lib/engines/common/evas_op_mul/op_mul_pixel_i386.c
new file mode 100644
index 0000000..0db6cd7
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_mul/op_mul_pixel_i386.c
@@ -0,0 +1,66 @@
1/* mul pixel --> dst */
2
3#ifdef BUILD_MMX
4static void
5_op_mul_p_dp_mmx(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c __UNUSED__, DATA32 *d, int l) {
6 DATA32 *e = s + l;
7 pxor_r2r(mm0, mm0);
8 MOV_A2R(ALPHA_255, mm5)
9 for (; s < e; s++, d++) {
10 MOV_P2R(*d, mm1, mm0)
11 MOV_P2R(*s, mm2, mm0)
12 MUL4_SYM_R2R(mm2, mm1, mm5)
13 MOV_R2P(mm1, *d, mm0)
14 }
15}
16
17#define _op_mul_pas_dp_mmx _op_mul_p_dp_mmx
18#define _op_mul_pan_dp_mmx _op_mul_p_dp_mmx
19
20#define _op_mul_p_dpan_mmx _op_mul_p_dp_mmx
21#define _op_mul_pan_dpan_mmx _op_mul_pan_dp_mmx
22#define _op_mul_pas_dpan_mmx _op_mul_pas_dp_mmx
23
24static void
25init_mul_pixel_span_funcs_mmx(void)
26{
27 op_mul_span_funcs[SP][SM_N][SC_N][DP][CPU_MMX] = _op_mul_p_dp_mmx;
28 op_mul_span_funcs[SP_AN][SM_N][SC_N][DP][CPU_MMX] = _op_mul_pan_dp_mmx;
29 op_mul_span_funcs[SP_AS][SM_N][SC_N][DP][CPU_MMX] = _op_mul_pas_dp_mmx;
30
31 op_mul_span_funcs[SP][SM_N][SC_N][DP_AN][CPU_MMX] = _op_mul_p_dpan_mmx;
32 op_mul_span_funcs[SP_AN][SM_N][SC_N][DP_AN][CPU_MMX] = _op_mul_pan_dpan_mmx;
33 op_mul_span_funcs[SP_AS][SM_N][SC_N][DP_AN][CPU_MMX] = _op_mul_pas_dpan_mmx;
34}
35#endif
36
37#ifdef BUILD_MMX
38static void
39_op_mul_pt_p_dp_mmx(DATA32 s, DATA8 m __UNUSED__, DATA32 c __UNUSED__, DATA32 *d) {
40 pxor_r2r(mm0, mm0);
41 MOV_A2R(ALPHA_255, mm5)
42 MOV_P2R(*d, mm1, mm0)
43 MOV_P2R(s, mm2, mm0)
44 MUL4_SYM_R2R(mm2, mm1, mm5)
45 MOV_R2P(mm1, *d, mm0)
46}
47
48#define _op_mul_pt_pan_dp_mmx _op_mul_pt_p_dp_mmx
49#define _op_mul_pt_pas_dp_mmx _op_mul_pt_p_dp_mmx
50
51#define _op_mul_pt_p_dpan_mmx _op_mul_pt_p_dp_mmx
52#define _op_mul_pt_pan_dpan_mmx _op_mul_pt_pan_dp_mmx
53#define _op_mul_pt_pas_dpan_mmx _op_mul_pt_pas_dp_mmx
54
55static void
56init_mul_pixel_pt_funcs_mmx(void)
57{
58 op_mul_pt_funcs[SP][SM_N][SC_N][DP][CPU_MMX] = _op_mul_pt_p_dp_mmx;
59 op_mul_pt_funcs[SP_AN][SM_N][SC_N][DP][CPU_MMX] = _op_mul_pt_pan_dp_mmx;
60 op_mul_pt_funcs[SP_AS][SM_N][SC_N][DP][CPU_MMX] = _op_mul_pt_pas_dp_mmx;
61
62 op_mul_pt_funcs[SP][SM_N][SC_N][DP_AN][CPU_MMX] = _op_mul_pt_p_dpan_mmx;
63 op_mul_pt_funcs[SP_AN][SM_N][SC_N][DP_AN][CPU_MMX] = _op_mul_pt_pan_dpan_mmx;
64 op_mul_pt_funcs[SP_AS][SM_N][SC_N][DP_AN][CPU_MMX] = _op_mul_pt_pas_dpan_mmx;
65}
66#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_mul/op_mul_pixel_mask_.c b/libraries/evas/src/lib/engines/common/evas_op_mul/op_mul_pixel_mask_.c
new file mode 100644
index 0000000..37d0497
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_mul/op_mul_pixel_mask_.c
@@ -0,0 +1,117 @@
1/* mul pixel x mask --> dst */
2
3#ifdef BUILD_C
4static void
5_op_mul_p_mas_dp(DATA32 *s, DATA8 *m, DATA32 c, DATA32 *d, int l) {
6 DATA32 *e = d + l;
7 while (d < e)
8 {
9 c = *m;
10 switch(c)
11 {
12 case 0:
13 break;
14 case 255:
15 *d = MUL4_SYM(*s, *d);
16 break;
17 default:
18 c = ~(*s);
19 c = ~MUL_SYM(*m, c);
20 *d = MUL4_SYM(c, *d);
21 break;
22 }
23 m++; s++; d++;
24 }
25}
26
27static void
28_op_mul_pan_mas_dp(DATA32 *s, DATA8 *m, DATA32 c, DATA32 *d, int l) {
29 DATA32 *e = d + l;
30 while (d < e)
31 {
32 c = *m;
33 switch(c)
34 {
35 case 0:
36 break;
37 case 255:
38 *d = (*d & 0xff000000) + MUL3_SYM(*s, *d);
39 break;
40 default:
41 c = ~(*s);
42 c = ~MUL_SYM(*m, c);
43 *d = (*d & 0xff000000) + MUL3_SYM(c, *d);
44 break;
45 }
46 m++; s++; d++;
47 }
48}
49
50static void
51_op_mul_p_mas_dpan(DATA32 *s, DATA8 *m, DATA32 c, DATA32 *d, int l) {
52 DATA32 *e = d + l;
53 while (d < e)
54 {
55 c = *m;
56 switch(c)
57 {
58 case 0:
59 break;
60 case 255:
61 *d = (*s & 0xff000000) + MUL3_SYM(*s, *d);
62 break;
63 default:
64 c = ~(*s);
65 c = ~MUL_SYM(*m, c);
66 *d = (c & 0xff000000) + MUL3_SYM(c, *d);
67 break;
68 }
69 m++; d++;
70 }
71}
72
73#define _op_mul_pas_mas_dp _op_mul_p_mas_dp
74
75#define _op_mul_pan_mas_dpan _op_mul_p_mas_dpan
76#define _op_mul_pas_mas_dpan _op_mul_p_mas_dpan
77
78static void
79init_mul_pixel_mask_span_funcs_c(void)
80{
81 op_mul_span_funcs[SP][SM_AS][SC_N][DP][CPU_C] = _op_mul_p_mas_dp;
82 op_mul_span_funcs[SP_AS][SM_AS][SC_N][DP][CPU_C] = _op_mul_pas_mas_dp;
83 op_mul_span_funcs[SP_AN][SM_AS][SC_N][DP][CPU_C] = _op_mul_pan_mas_dp;
84
85 op_mul_span_funcs[SP][SM_AS][SC_N][DP_AN][CPU_C] = _op_mul_p_mas_dpan;
86 op_mul_span_funcs[SP_AS][SM_AS][SC_N][DP_AN][CPU_C] = _op_mul_pas_mas_dpan;
87 op_mul_span_funcs[SP_AN][SM_AS][SC_N][DP_AN][CPU_C] = _op_mul_pan_mas_dpan;
88}
89#endif
90
91#ifdef BUILD_C
92static void
93_op_mul_pt_p_mas_dp(DATA32 s, DATA8 m, DATA32 c __UNUSED__, DATA32 *d) {
94 s = ~s;
95 s = ~MUL_SYM(m, s);
96 *d = MUL4_SYM(s, *d);
97}
98
99#define _op_mul_pt_pas_mas_dp _op_mul_pt_p_mas_dp
100#define _op_mul_pt_pan_mas_dp _op_mul_pt_p_mas_dp
101
102#define _op_mul_pt_p_mas_dpan _op_mul_pt_p_mas_dp
103#define _op_mul_pt_pas_mas_dpan _op_mul_pt_p_mas_dp
104#define _op_mul_pt_pan_mas_dpan _op_mul_pt_p_mas_dp
105
106static void
107init_mul_pixel_mask_pt_funcs_c(void)
108{
109 op_mul_pt_funcs[SP][SM_AS][SC_N][DP][CPU_C] = _op_mul_pt_p_mas_dp;
110 op_mul_pt_funcs[SP_AS][SM_AS][SC_N][DP][CPU_C] = _op_mul_pt_pas_mas_dp;
111 op_mul_pt_funcs[SP_AN][SM_AS][SC_N][DP][CPU_C] = _op_mul_pt_pan_mas_dp;
112
113 op_mul_pt_funcs[SP][SM_AS][SC_N][DP_AN][CPU_C] = _op_mul_pt_p_mas_dpan;
114 op_mul_pt_funcs[SP_AS][SM_AS][SC_N][DP_AN][CPU_C] = _op_mul_pt_pas_mas_dpan;
115 op_mul_pt_funcs[SP_AN][SM_AS][SC_N][DP_AN][CPU_C] = _op_mul_pt_pan_mas_dpan;
116}
117#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_mul/op_mul_pixel_mask_i386.c b/libraries/evas/src/lib/engines/common/evas_op_mul/op_mul_pixel_mask_i386.c
new file mode 100644
index 0000000..ebbac01
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_mul/op_mul_pixel_mask_i386.c
@@ -0,0 +1,63 @@
1/* mul pixel x mask --> dst */
2
3#ifdef BUILD_MMX
4static void
5_op_mul_p_mas_dp_mmx(DATA32 *s, DATA8 *m, DATA32 c, DATA32 *d, int l) {
6 DATA32 *e = d + l;
7 MOV_A2R(ALPHA_255, mm5)
8 pxor_r2r(mm0, mm0);
9 while (d < e) {
10 c = *m;
11 switch(c)
12 {
13 case 0:
14 break;
15 case 255:
16 MOV_P2R(*d, mm1, mm0)
17 MOV_P2R(*s, mm2, mm0)
18 MUL4_SYM_R2R(mm2, mm1, mm5)
19 MOV_R2P(mm1, *d, mm0)
20 break;
21 default:
22 c++;
23 MOV_A2R(c, mm1)
24 c = ~(*s);
25 MOV_P2R(c, mm3, mm0)
26 MUL4_256_R2R(mm3, mm1)
27 movq_r2r(mm5, mm4);
28 psubw_r2r(mm1, mm4);
29 MOV_P2R(*d, mm1, mm0)
30 MUL4_SYM_R2R(mm4, mm1, mm5)
31 MOV_R2P(mm1, *d, mm0)
32 break;
33 }
34 s++; m++; d++;
35 }
36}
37
38#define _op_mul_pas_mas_dp_mmx _op_mul_p_mas_dp_mmx
39#define _op_mul_pan_mas_dp_mmx _op_mul_p_mas_dp_mmx
40
41#define _op_mul_p_mas_dpan_mmx _op_mul_p_mas_dp_mmx
42#define _op_mul_pas_mas_dpan_mmx _op_mul_pas_mas_dp_mmx
43#define _op_mul_pan_mas_dpan_mmx _op_mul_pan_mas_dp_mmx
44
45static void
46init_mul_pixel_mask_span_funcs_mmx(void)
47{
48 op_mul_span_funcs[SP][SM_AS][SC_N][DP][CPU_MMX] = _op_mul_p_mas_dp_mmx;
49 op_mul_span_funcs[SP_AS][SM_AS][SC_N][DP][CPU_MMX] = _op_mul_pas_mas_dp_mmx;
50 op_mul_span_funcs[SP_AN][SM_AS][SC_N][DP][CPU_MMX] = _op_mul_pan_mas_dp_mmx;
51
52 op_mul_span_funcs[SP][SM_AS][SC_N][DP_AN][CPU_MMX] = _op_mul_p_mas_dpan_mmx;
53 op_mul_span_funcs[SP_AS][SM_AS][SC_N][DP_AN][CPU_MMX] = _op_mul_pas_mas_dpan_mmx;
54 op_mul_span_funcs[SP_AN][SM_AS][SC_N][DP_AN][CPU_MMX] = _op_mul_pan_mas_dpan_mmx;
55}
56#endif
57
58#ifdef BUILD_MMX
59static void
60init_mul_pixel_mask_pt_funcs_mmx(void)
61{
62}
63#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_mul_main_.c b/libraries/evas/src/lib/engines/common/evas_op_mul_main_.c
new file mode 100644
index 0000000..25fa932
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_mul_main_.c
@@ -0,0 +1,308 @@
1#include "evas_common.h"
2
3static RGBA_Gfx_Func op_mul_span_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
4static RGBA_Gfx_Pt_Func op_mul_pt_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
5
6static void op_mul_init(void);
7static void op_mul_shutdown(void);
8
9static RGBA_Gfx_Func op_mul_pixel_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels);
10static RGBA_Gfx_Func op_mul_color_span_get(DATA32 col, RGBA_Image *dst, int pixels);
11static RGBA_Gfx_Func op_mul_pixel_color_span_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels);
12static RGBA_Gfx_Func op_mul_mask_color_span_get(DATA32 col, RGBA_Image *dst, int pixels);
13static RGBA_Gfx_Func op_mul_pixel_mask_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels);
14
15static RGBA_Gfx_Pt_Func op_mul_pixel_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst);
16static RGBA_Gfx_Pt_Func op_mul_color_pt_get(DATA32 col, RGBA_Image *dst);
17static RGBA_Gfx_Pt_Func op_mul_pixel_color_pt_get(Image_Entry_Flags src_flags, DATA32 col, RGBA_Image *dst);
18static RGBA_Gfx_Pt_Func op_mul_mask_color_pt_get(DATA32 col, RGBA_Image *dst);
19static RGBA_Gfx_Pt_Func op_mul_pixel_mask_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst);
20
21static RGBA_Gfx_Compositor _composite_mul = { "mul",
22 op_mul_init, op_mul_shutdown,
23 op_mul_pixel_span_get, op_mul_color_span_get,
24 op_mul_pixel_color_span_get, op_mul_mask_color_span_get,
25 op_mul_pixel_mask_span_get,
26 op_mul_pixel_pt_get, op_mul_color_pt_get,
27 op_mul_pixel_color_pt_get, op_mul_mask_color_pt_get,
28 op_mul_pixel_mask_pt_get
29 };
30
31RGBA_Gfx_Compositor *
32evas_common_gfx_compositor_mul_get(void)
33{
34 return &(_composite_mul);
35}
36
37
38# include "./evas_op_mul/op_mul_pixel_.c"
39# include "./evas_op_mul/op_mul_color_.c"
40# include "./evas_op_mul/op_mul_pixel_color_.c"
41# include "./evas_op_mul/op_mul_pixel_mask_.c"
42# include "./evas_op_mul/op_mul_mask_color_.c"
43//# include "./evas_op_mul/op_mul_pixel_mask_color_.c"
44
45# include "./evas_op_mul/op_mul_pixel_i386.c"
46# include "./evas_op_mul/op_mul_color_i386.c"
47# include "./evas_op_mul/op_mul_pixel_color_i386.c"
48# include "./evas_op_mul/op_mul_pixel_mask_i386.c"
49# include "./evas_op_mul/op_mul_mask_color_i386.c"
50// # include "./evas_op_mul/op_mul_pixel_mask_color_i386.c"
51
52static void
53op_mul_init(void)
54{
55 memset(op_mul_span_funcs, 0, sizeof(op_mul_span_funcs));
56 memset(op_mul_pt_funcs, 0, sizeof(op_mul_pt_funcs));
57#ifdef BUILD_MMX
58 init_mul_pixel_span_funcs_mmx();
59 init_mul_pixel_color_span_funcs_mmx();
60 init_mul_pixel_mask_span_funcs_mmx();
61 init_mul_color_span_funcs_mmx();
62 init_mul_mask_color_span_funcs_mmx();
63
64 init_mul_pixel_pt_funcs_mmx();
65 init_mul_pixel_color_pt_funcs_mmx();
66 init_mul_pixel_mask_pt_funcs_mmx();
67 init_mul_color_pt_funcs_mmx();
68 init_mul_mask_color_pt_funcs_mmx();
69#endif
70#ifdef BUILD_C
71 init_mul_pixel_span_funcs_c();
72 init_mul_pixel_color_span_funcs_c();
73 init_mul_pixel_mask_span_funcs_c();
74 init_mul_color_span_funcs_c();
75 init_mul_mask_color_span_funcs_c();
76
77 init_mul_pixel_pt_funcs_c();
78 init_mul_pixel_color_pt_funcs_c();
79 init_mul_pixel_mask_pt_funcs_c();
80 init_mul_color_pt_funcs_c();
81 init_mul_mask_color_pt_funcs_c();
82#endif
83}
84
85static void
86op_mul_shutdown(void)
87{
88}
89
90static RGBA_Gfx_Func
91mul_gfx_span_func_cpu(int s, int m, int c, int d)
92{
93 RGBA_Gfx_Func func = NULL;
94 int cpu = CPU_N;
95#ifdef BUILD_MMX
96 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
97 {
98 cpu = CPU_MMX;
99 func = op_mul_span_funcs[s][m][c][d][cpu];
100 if (func) return func;
101 }
102#endif
103#ifdef BUILD_C
104 cpu = CPU_C;
105 func = op_mul_span_funcs[s][m][c][d][cpu];
106 if (func) return func;
107#endif
108 return func;
109}
110
111static RGBA_Gfx_Func
112op_mul_pixel_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels __UNUSED__)
113{
114 int s = SP_AN, m = SM_N, c = SC_N, d = DP_AN;
115
116 if (src && src->cache_entry.flags.alpha)
117 {
118 dst->cache_entry.flags.alpha = 1;
119 s = SP;
120 }
121 if (dst && dst->cache_entry.flags.alpha)
122 d = DP;
123 return mul_gfx_span_func_cpu(s, m, c, d);
124}
125
126static RGBA_Gfx_Func
127op_mul_color_span_get(DATA32 col, RGBA_Image *dst, int pixels __UNUSED__)
128{
129 int s = SP_N, m = SM_N, c = SC_AN, d = DP_AN;
130
131 if ((col >> 24) < 255)
132 {
133 if (dst)
134 dst->cache_entry.flags.alpha = 1;
135 c = SC;
136 }
137 if (col == (col | 0x00ffffff))
138 c = SC_AA;
139 if (col == 0xffffffff)
140 c = SC_N;
141 if (dst && dst->cache_entry.flags.alpha)
142 d = DP;
143 return mul_gfx_span_func_cpu(s, m, c, d);
144}
145
146static RGBA_Gfx_Func
147op_mul_pixel_color_span_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels __UNUSED__)
148{
149 int s = SP_AN, m = SM_N, c = SC_AN, d = DP_AN;
150
151 if (src && src->cache_entry.flags.alpha)
152 {
153 if (dst)
154 dst->cache_entry.flags.alpha = 1;
155 s = SP;
156 }
157 if ((col >> 24) < 255)
158 {
159 if (dst)
160 dst->cache_entry.flags.alpha = 1;
161 c = SC;
162 }
163 if (col == (col | 0x00ffffff))
164 c = SC_AA;
165 if (col == 0xffffffff)
166 c = SC_N;
167 if (dst && dst->cache_entry.flags.alpha)
168 d = DP;
169 return mul_gfx_span_func_cpu(s, m, c, d);
170}
171
172static RGBA_Gfx_Func
173op_mul_mask_color_span_get(DATA32 col, RGBA_Image *dst, int pixels __UNUSED__)
174{
175 int s = SP_N, m = SM_AS, c = SC_AN, d = DP;
176
177 if (dst)
178 dst->cache_entry.flags.alpha = 1;
179 if ((col >> 24) < 255)
180 c = SC;
181 if (col == (col | 0x00ffffff))
182 c = SC_AA;
183 if (col == 0xffffffff)
184 c = SC_N;
185 return mul_gfx_span_func_cpu(s, m, c, d);
186}
187
188static RGBA_Gfx_Func
189op_mul_pixel_mask_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels __UNUSED__)
190{
191 int s = SP_AN, m = SM_AS, c = SC_N, d = DP;
192
193 if (dst)
194 dst->cache_entry.flags.alpha = 1;
195 if (src && src->cache_entry.flags.alpha)
196 s = SP;
197 return mul_gfx_span_func_cpu(s, m, c, d);
198}
199
200static RGBA_Gfx_Pt_Func
201mul_gfx_pt_func_cpu(int s, int m, int c, int d)
202{
203 RGBA_Gfx_Pt_Func func = NULL;
204 int cpu = CPU_N;
205#ifdef BUILD_MMX
206 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
207 {
208 cpu = CPU_MMX;
209 func = op_mul_pt_funcs[s][m][c][d][cpu];
210 if (func) return func;
211 }
212#endif
213#ifdef BUILD_C
214 cpu = CPU_C;
215 func = op_mul_pt_funcs[s][m][c][d][cpu];
216 if (func) return func;
217#endif
218 return func;
219}
220
221static RGBA_Gfx_Pt_Func
222op_mul_pixel_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst)
223{
224 int s = SP_AN, m = SM_N, c = SC_N, d = DP_AN;
225
226 if (src_flags.alpha)
227 {
228 dst->cache_entry.flags.alpha = 1;
229 s = SP;
230 }
231 if (dst && dst->cache_entry.flags.alpha)
232 d = DP;
233 return mul_gfx_pt_func_cpu(s, m, c, d);
234}
235
236static RGBA_Gfx_Pt_Func
237op_mul_color_pt_get(DATA32 col, RGBA_Image *dst)
238{
239 int s = SP_N, m = SM_N, c = SC_AN, d = DP_AN;
240
241 if ((col >> 24) < 255)
242 {
243 if (dst)
244 dst->cache_entry.flags.alpha = 1;
245 c = SC;
246 }
247 if (col == (col | 0x00ffffff))
248 c = SC_AA;
249 if (col == 0xffffffff)
250 c = SC_N;
251 if (dst && dst->cache_entry.flags.alpha)
252 d = DP;
253 return mul_gfx_pt_func_cpu(s, m, c, d);
254}
255
256static RGBA_Gfx_Pt_Func
257op_mul_pixel_color_pt_get(Image_Entry_Flags src_flags, DATA32 col, RGBA_Image *dst)
258{
259 int s = SP_AN, m = SM_N, c = SC_AN, d = DP_AN;
260
261 if (src_flags.alpha)
262 {
263 if (dst)
264 dst->cache_entry.flags.alpha = 1;
265 s = SP;
266 }
267 if ((col >> 24) < 255)
268 {
269 if (dst)
270 dst->cache_entry.flags.alpha = 1;
271 c = SC;
272 }
273 if (col == (col | 0x00ffffff))
274 c = SC_AA;
275 if (col == 0xffffffff)
276 c = SC_N;
277 if (dst && dst->cache_entry.flags.alpha)
278 d = DP;
279 return mul_gfx_pt_func_cpu(s, m, c, d);
280}
281
282static RGBA_Gfx_Pt_Func
283op_mul_mask_color_pt_get(DATA32 col, RGBA_Image *dst)
284{
285 int s = SP_N, m = SM_AS, c = SC_AN, d = DP;
286
287 if (dst)
288 dst->cache_entry.flags.alpha = 1;
289 if ((col >> 24) < 255)
290 c = SC;
291 if (col == (col | 0x00ffffff))
292 c = SC_AA;
293 if (col == 0xffffffff)
294 c = SC_N;
295 return mul_gfx_pt_func_cpu(s, m, c, d);
296}
297
298static RGBA_Gfx_Pt_Func
299op_mul_pixel_mask_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst)
300{
301 int s = SP_AN, m = SM_AS, c = SC_N, d = DP;
302
303 if (dst)
304 dst->cache_entry.flags.alpha = 1;
305 if (src_flags.alpha)
306 s = SP;
307 return mul_gfx_pt_func_cpu(s, m, c, d);
308}
diff --git a/libraries/evas/src/lib/engines/common/evas_op_sub/Makefile.am b/libraries/evas/src/lib/engines/common/evas_op_sub/Makefile.am
new file mode 100644
index 0000000..a8eca14
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_sub/Makefile.am
@@ -0,0 +1,14 @@
1MAINTAINERCLEANFILES = Makefile.in
2
3EXTRA_DIST = \
4op_sub_color_.c \
5op_sub_color_i386.c \
6op_sub_mask_color_.c \
7op_sub_mask_color_i386.c \
8op_sub_pixel_.c \
9op_sub_pixel_color_.c \
10op_sub_pixel_color_i386.c \
11op_sub_pixel_i386.c \
12op_sub_pixel_mask_.c \
13op_sub_pixel_mask_i386.c
14
diff --git a/libraries/evas/src/lib/engines/common/evas_op_sub/Makefile.in b/libraries/evas/src/lib/engines/common/evas_op_sub/Makefile.in
new file mode 100644
index 0000000..b68ed3b
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_sub/Makefile.in
@@ -0,0 +1,543 @@
1# Makefile.in generated by automake 1.11.1 from Makefile.am.
2# @configure_input@
3
4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
6# Inc.
7# This Makefile.in is free software; the Free Software Foundation
8# gives unlimited permission to copy and/or distribute it,
9# with or without modifications, as long as this notice is preserved.
10
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
13# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14# PARTICULAR PURPOSE.
15
16@SET_MAKE@
17VPATH = @srcdir@
18pkgdatadir = $(datadir)/@PACKAGE@
19pkgincludedir = $(includedir)/@PACKAGE@
20pkglibdir = $(libdir)/@PACKAGE@
21pkglibexecdir = $(libexecdir)/@PACKAGE@
22am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
23install_sh_DATA = $(install_sh) -c -m 644
24install_sh_PROGRAM = $(install_sh) -c
25install_sh_SCRIPT = $(install_sh) -c
26INSTALL_HEADER = $(INSTALL_DATA)
27transform = $(program_transform_name)
28NORMAL_INSTALL = :
29PRE_INSTALL = :
30POST_INSTALL = :
31NORMAL_UNINSTALL = :
32PRE_UNINSTALL = :
33POST_UNINSTALL = :
34build_triplet = @build@
35host_triplet = @host@
36subdir = src/lib/engines/common/evas_op_sub
37DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
38ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
39am__aclocal_m4_deps = $(top_srcdir)/m4/efl_attribute.m4 \
40 $(top_srcdir)/m4/efl_coverage.m4 \
41 $(top_srcdir)/m4/efl_doxygen.m4 \
42 $(top_srcdir)/m4/efl_fnmatch.m4 \
43 $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \
44 $(top_srcdir)/m4/evas_check_engine.m4 \
45 $(top_srcdir)/m4/evas_check_loader.m4 \
46 $(top_srcdir)/m4/evas_converter.m4 \
47 $(top_srcdir)/m4/evas_dither.m4 \
48 $(top_srcdir)/m4/evas_scaler.m4 $(top_srcdir)/m4/libtool.m4 \
49 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
50 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
51 $(top_srcdir)/configure.ac
52am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
53 $(ACLOCAL_M4)
54mkinstalldirs = $(install_sh) -d
55CONFIG_HEADER = $(top_builddir)/config.h
56CONFIG_CLEAN_FILES =
57CONFIG_CLEAN_VPATH_FILES =
58AM_V_GEN = $(am__v_GEN_$(V))
59am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
60am__v_GEN_0 = @echo " GEN " $@;
61AM_V_at = $(am__v_at_$(V))
62am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
63am__v_at_0 = @
64SOURCES =
65DIST_SOURCES =
66DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
67ACLOCAL = @ACLOCAL@
68ALLOCA = @ALLOCA@
69AMTAR = @AMTAR@
70AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
71AR = @AR@
72AS = @AS@
73AUTOCONF = @AUTOCONF@
74AUTOHEADER = @AUTOHEADER@
75AUTOMAKE = @AUTOMAKE@
76AWK = @AWK@
77CC = @CC@
78CCDEPMODE = @CCDEPMODE@
79CFLAGS = @CFLAGS@
80CHECK_CFLAGS = @CHECK_CFLAGS@
81CHECK_LIBS = @CHECK_LIBS@
82CPP = @CPP@
83CPPFLAGS = @CPPFLAGS@
84CXX = @CXX@
85CXXCPP = @CXXCPP@
86CXXDEPMODE = @CXXDEPMODE@
87CXXFLAGS = @CXXFLAGS@
88CYGPATH_W = @CYGPATH_W@
89DEFS = @DEFS@
90DEPDIR = @DEPDIR@
91DIRECTFB_CFLAGS = @DIRECTFB_CFLAGS@
92DIRECTFB_LIBS = @DIRECTFB_LIBS@
93DLLTOOL = @DLLTOOL@
94DSYMUTIL = @DSYMUTIL@
95DUMPBIN = @DUMPBIN@
96ECHO_C = @ECHO_C@
97ECHO_N = @ECHO_N@
98ECHO_T = @ECHO_T@
99ECORE_EVAS_CFLAGS = @ECORE_EVAS_CFLAGS@
100ECORE_EVAS_LIBS = @ECORE_EVAS_LIBS@
101EDB_CFLAGS = @EDB_CFLAGS@
102EDB_LIBS = @EDB_LIBS@
103EDJE_CFLAGS = @EDJE_CFLAGS@
104EDJE_LIBS = @EDJE_LIBS@
105EET_CFLAGS = @EET_CFLAGS@
106EET_LIBS = @EET_LIBS@
107EFL_COVERAGE_CFLAGS = @EFL_COVERAGE_CFLAGS@
108EFL_COVERAGE_LIBS = @EFL_COVERAGE_LIBS@
109EFL_FNMATCH_LIBS = @EFL_FNMATCH_LIBS@
110EGREP = @EGREP@
111EINA_CFLAGS = @EINA_CFLAGS@
112EINA_LIBS = @EINA_LIBS@
113EVAS_CFLAGS = @EVAS_CFLAGS@
114EVAS_LIBS = @EVAS_LIBS@
115EVAS_SSE3_CFLAGS = @EVAS_SSE3_CFLAGS@
116EVIL_CFLAGS = @EVIL_CFLAGS@
117EVIL_LIBS = @EVIL_LIBS@
118EXEEXT = @EXEEXT@
119FGREP = @FGREP@
120FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@
121FONTCONFIG_LIBS = @FONTCONFIG_LIBS@
122FREETYPE_CFLAGS = @FREETYPE_CFLAGS@
123FREETYPE_LIBS = @FREETYPE_LIBS@
124FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@
125FRIBIDI_LIBS = @FRIBIDI_LIBS@
126GL_EET_CFLAGS = @GL_EET_CFLAGS@
127GL_EET_LIBS = @GL_EET_LIBS@
128GREP = @GREP@
129HARFBUZZ_CFLAGS = @HARFBUZZ_CFLAGS@
130HARFBUZZ_LIBS = @HARFBUZZ_LIBS@
131INSTALL = @INSTALL@
132INSTALL_DATA = @INSTALL_DATA@
133INSTALL_PROGRAM = @INSTALL_PROGRAM@
134INSTALL_SCRIPT = @INSTALL_SCRIPT@
135INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
136LD = @LD@
137LDFLAGS = @LDFLAGS@
138LIBOBJS = @LIBOBJS@
139LIBS = @LIBS@
140LIBTOOL = @LIBTOOL@
141LINEBREAK_CFLAGS = @LINEBREAK_CFLAGS@
142LINEBREAK_LIBS = @LINEBREAK_LIBS@
143LIPO = @LIPO@
144LN_S = @LN_S@
145LTLIBOBJS = @LTLIBOBJS@
146MAKEINFO = @MAKEINFO@
147MKDIR_P = @MKDIR_P@
148MODULE_ARCH = @MODULE_ARCH@
149NM = @NM@
150NMEDIT = @NMEDIT@
151OBJC = @OBJC@
152OBJCDEPMODE = @OBJCDEPMODE@
153OBJCFLAGS = @OBJCFLAGS@
154OBJDUMP = @OBJDUMP@
155OBJEXT = @OBJEXT@
156OTOOL = @OTOOL@
157OTOOL64 = @OTOOL64@
158PACKAGE = @PACKAGE@
159PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
160PACKAGE_NAME = @PACKAGE_NAME@
161PACKAGE_STRING = @PACKAGE_STRING@
162PACKAGE_TARNAME = @PACKAGE_TARNAME@
163PACKAGE_URL = @PACKAGE_URL@
164PACKAGE_VERSION = @PACKAGE_VERSION@
165PATH_SEPARATOR = @PATH_SEPARATOR@
166PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
167PIXMAN_LIBS = @PIXMAN_LIBS@
168PKG_CONFIG = @PKG_CONFIG@
169PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
170PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
171PNG_CFLAGS = @PNG_CFLAGS@
172PNG_LIBS = @PNG_LIBS@
173RANLIB = @RANLIB@
174SDL_CFLAGS = @SDL_CFLAGS@
175SDL_LIBS = @SDL_LIBS@
176SED = @SED@
177SET_MAKE = @SET_MAKE@
178SHELL = @SHELL@
179SHM_OPEN_LINK = @SHM_OPEN_LINK@
180STRIP = @STRIP@
181SVG_CFLAGS = @SVG_CFLAGS@
182SVG_LIBS = @SVG_LIBS@
183VALGRIND_CFLAGS = @VALGRIND_CFLAGS@
184VALGRIND_LIBS = @VALGRIND_LIBS@
185VERSION = @VERSION@
186VMAJ = @VMAJ@
187WIN32_CFLAGS = @WIN32_CFLAGS@
188WIN32_CPPFLAGS = @WIN32_CPPFLAGS@
189XCB_CFLAGS = @XCB_CFLAGS@
190XCB_GL_CFLAGS = @XCB_GL_CFLAGS@
191XCB_GL_LIBS = @XCB_GL_LIBS@
192XCB_LIBS = @XCB_LIBS@
193XEXT_CFLAGS = @XEXT_CFLAGS@
194XEXT_LIBS = @XEXT_LIBS@
195XMKMF = @XMKMF@
196X_CFLAGS = @X_CFLAGS@
197X_EXTRA_LIBS = @X_EXTRA_LIBS@
198X_LIBS = @X_LIBS@
199X_PRE_LIBS = @X_PRE_LIBS@
200abs_builddir = @abs_builddir@
201abs_srcdir = @abs_srcdir@
202abs_top_builddir = @abs_top_builddir@
203abs_top_srcdir = @abs_top_srcdir@
204ac_ct_CC = @ac_ct_CC@
205ac_ct_CXX = @ac_ct_CXX@
206ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
207ac_ct_OBJC = @ac_ct_OBJC@
208altivec_cflags = @altivec_cflags@
209am__include = @am__include@
210am__leading_dot = @am__leading_dot@
211am__quote = @am__quote@
212am__tar = @am__tar@
213am__untar = @am__untar@
214bindir = @bindir@
215build = @build@
216build_alias = @build_alias@
217build_cpu = @build_cpu@
218build_os = @build_os@
219build_vendor = @build_vendor@
220builddir = @builddir@
221datadir = @datadir@
222datarootdir = @datarootdir@
223dlopen_libs = @dlopen_libs@
224docdir = @docdir@
225dvidir = @dvidir@
226edje_cc = @edje_cc@
227efl_doxygen = @efl_doxygen@
228efl_have_doxygen = @efl_have_doxygen@
229evas_engine_buffer_cflags = @evas_engine_buffer_cflags@
230evas_engine_buffer_libs = @evas_engine_buffer_libs@
231evas_engine_direct3d_cflags = @evas_engine_direct3d_cflags@
232evas_engine_direct3d_libs = @evas_engine_direct3d_libs@
233evas_engine_directfb_cflags = @evas_engine_directfb_cflags@
234evas_engine_directfb_libs = @evas_engine_directfb_libs@
235evas_engine_fb_cflags = @evas_engine_fb_cflags@
236evas_engine_fb_libs = @evas_engine_fb_libs@
237evas_engine_gl_cocoa_cflags = @evas_engine_gl_cocoa_cflags@
238evas_engine_gl_cocoa_libs = @evas_engine_gl_cocoa_libs@
239evas_engine_gl_common_libs = @evas_engine_gl_common_libs@
240evas_engine_gl_sdl_cflags = @evas_engine_gl_sdl_cflags@
241evas_engine_gl_sdl_libs = @evas_engine_gl_sdl_libs@
242evas_engine_gl_xcb_cflags = @evas_engine_gl_xcb_cflags@
243evas_engine_gl_xcb_libs = @evas_engine_gl_xcb_libs@
244evas_engine_gl_xlib_cflags = @evas_engine_gl_xlib_cflags@
245evas_engine_gl_xlib_libs = @evas_engine_gl_xlib_libs@
246evas_engine_psl1ght_cflags = @evas_engine_psl1ght_cflags@
247evas_engine_psl1ght_libs = @evas_engine_psl1ght_libs@
248evas_engine_software_16_ddraw_cflags = @evas_engine_software_16_ddraw_cflags@
249evas_engine_software_16_ddraw_libs = @evas_engine_software_16_ddraw_libs@
250evas_engine_software_16_sdl_cflags = @evas_engine_software_16_sdl_cflags@
251evas_engine_software_16_sdl_libs = @evas_engine_software_16_sdl_libs@
252evas_engine_software_16_wince_cflags = @evas_engine_software_16_wince_cflags@
253evas_engine_software_16_wince_libs = @evas_engine_software_16_wince_libs@
254evas_engine_software_16_x11_cflags = @evas_engine_software_16_x11_cflags@
255evas_engine_software_16_x11_libs = @evas_engine_software_16_x11_libs@
256evas_engine_software_8_x11_cflags = @evas_engine_software_8_x11_cflags@
257evas_engine_software_8_x11_libs = @evas_engine_software_8_x11_libs@
258evas_engine_software_ddraw_cflags = @evas_engine_software_ddraw_cflags@
259evas_engine_software_ddraw_libs = @evas_engine_software_ddraw_libs@
260evas_engine_software_gdi_cflags = @evas_engine_software_gdi_cflags@
261evas_engine_software_gdi_libs = @evas_engine_software_gdi_libs@
262evas_engine_software_sdl_cflags = @evas_engine_software_sdl_cflags@
263evas_engine_software_sdl_libs = @evas_engine_software_sdl_libs@
264evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@
265evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@
266evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@
267evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@
268evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@
269evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@
270evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@
271evas_image_loader_edb_libs = @evas_image_loader_edb_libs@
272evas_image_loader_eet_cflags = @evas_image_loader_eet_cflags@
273evas_image_loader_eet_libs = @evas_image_loader_eet_libs@
274evas_image_loader_generic_cflags = @evas_image_loader_generic_cflags@
275evas_image_loader_generic_libs = @evas_image_loader_generic_libs@
276evas_image_loader_gif_cflags = @evas_image_loader_gif_cflags@
277evas_image_loader_gif_libs = @evas_image_loader_gif_libs@
278evas_image_loader_ico_cflags = @evas_image_loader_ico_cflags@
279evas_image_loader_ico_libs = @evas_image_loader_ico_libs@
280evas_image_loader_jpeg_cflags = @evas_image_loader_jpeg_cflags@
281evas_image_loader_jpeg_libs = @evas_image_loader_jpeg_libs@
282evas_image_loader_pmaps_cflags = @evas_image_loader_pmaps_cflags@
283evas_image_loader_pmaps_libs = @evas_image_loader_pmaps_libs@
284evas_image_loader_png_cflags = @evas_image_loader_png_cflags@
285evas_image_loader_png_libs = @evas_image_loader_png_libs@
286evas_image_loader_psd_cflags = @evas_image_loader_psd_cflags@
287evas_image_loader_psd_libs = @evas_image_loader_psd_libs@
288evas_image_loader_svg_cflags = @evas_image_loader_svg_cflags@
289evas_image_loader_svg_libs = @evas_image_loader_svg_libs@
290evas_image_loader_tga_cflags = @evas_image_loader_tga_cflags@
291evas_image_loader_tga_libs = @evas_image_loader_tga_libs@
292evas_image_loader_tiff_cflags = @evas_image_loader_tiff_cflags@
293evas_image_loader_tiff_libs = @evas_image_loader_tiff_libs@
294evas_image_loader_wbmp_cflags = @evas_image_loader_wbmp_cflags@
295evas_image_loader_wbmp_libs = @evas_image_loader_wbmp_libs@
296evas_image_loader_xpm_cflags = @evas_image_loader_xpm_cflags@
297evas_image_loader_xpm_libs = @evas_image_loader_xpm_libs@
298exec_prefix = @exec_prefix@
299have_evas_engine_gl_x11 = @have_evas_engine_gl_x11@
300have_evas_engine_gl_xcb = @have_evas_engine_gl_xcb@
301have_evas_engine_gl_xlib = @have_evas_engine_gl_xlib@
302have_evas_engine_software_x11 = @have_evas_engine_software_x11@
303have_evas_engine_software_xcb = @have_evas_engine_software_xcb@
304have_evas_engine_software_xlib = @have_evas_engine_software_xlib@
305have_lcov = @have_lcov@
306host = @host@
307host_alias = @host_alias@
308host_cpu = @host_cpu@
309host_os = @host_os@
310host_vendor = @host_vendor@
311htmldir = @htmldir@
312includedir = @includedir@
313infodir = @infodir@
314install_sh = @install_sh@
315libdir = @libdir@
316libexecdir = @libexecdir@
317localedir = @localedir@
318localstatedir = @localstatedir@
319lt_ECHO = @lt_ECHO@
320lt_enable_auto_import = @lt_enable_auto_import@
321mandir = @mandir@
322mkdir_p = @mkdir_p@
323oldincludedir = @oldincludedir@
324pdfdir = @pdfdir@
325pkgconfig_requires_private = @pkgconfig_requires_private@
326prefix = @prefix@
327program_transform_name = @program_transform_name@
328psdir = @psdir@
329pthread_cflags = @pthread_cflags@
330pthread_libs = @pthread_libs@
331release_info = @release_info@
332requirement_evas = @requirement_evas@
333sbindir = @sbindir@
334sharedstatedir = @sharedstatedir@
335srcdir = @srcdir@
336sysconfdir = @sysconfdir@
337target_alias = @target_alias@
338top_build_prefix = @top_build_prefix@
339top_builddir = @top_builddir@
340top_srcdir = @top_srcdir@
341version_info = @version_info@
342MAINTAINERCLEANFILES = Makefile.in
343EXTRA_DIST = \
344op_sub_color_.c \
345op_sub_color_i386.c \
346op_sub_mask_color_.c \
347op_sub_mask_color_i386.c \
348op_sub_pixel_.c \
349op_sub_pixel_color_.c \
350op_sub_pixel_color_i386.c \
351op_sub_pixel_i386.c \
352op_sub_pixel_mask_.c \
353op_sub_pixel_mask_i386.c
354
355all: all-am
356
357.SUFFIXES:
358$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
359 @for dep in $?; do \
360 case '$(am__configure_deps)' in \
361 *$$dep*) \
362 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
363 && { if test -f $@; then exit 0; else break; fi; }; \
364 exit 1;; \
365 esac; \
366 done; \
367 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/engines/common/evas_op_sub/Makefile'; \
368 $(am__cd) $(top_srcdir) && \
369 $(AUTOMAKE) --gnu src/lib/engines/common/evas_op_sub/Makefile
370.PRECIOUS: Makefile
371Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
372 @case '$?' in \
373 *config.status*) \
374 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
375 *) \
376 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
377 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
378 esac;
379
380$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
381 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
382
383$(top_srcdir)/configure: $(am__configure_deps)
384 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
385$(ACLOCAL_M4): $(am__aclocal_m4_deps)
386 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
387$(am__aclocal_m4_deps):
388
389mostlyclean-libtool:
390 -rm -f *.lo
391
392clean-libtool:
393 -rm -rf .libs _libs
394tags: TAGS
395TAGS:
396
397ctags: CTAGS
398CTAGS:
399
400
401distdir: $(DISTFILES)
402 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
403 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
404 list='$(DISTFILES)'; \
405 dist_files=`for file in $$list; do echo $$file; done | \
406 sed -e "s|^$$srcdirstrip/||;t" \
407 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
408 case $$dist_files in \
409 */*) $(MKDIR_P) `echo "$$dist_files" | \
410 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
411 sort -u` ;; \
412 esac; \
413 for file in $$dist_files; do \
414 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
415 if test -d $$d/$$file; then \
416 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
417 if test -d "$(distdir)/$$file"; then \
418 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
419 fi; \
420 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
421 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
422 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
423 fi; \
424 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
425 else \
426 test -f "$(distdir)/$$file" \
427 || cp -p $$d/$$file "$(distdir)/$$file" \
428 || exit 1; \
429 fi; \
430 done
431check-am: all-am
432check: check-am
433all-am: Makefile
434installdirs:
435install: install-am
436install-exec: install-exec-am
437install-data: install-data-am
438uninstall: uninstall-am
439
440install-am: all-am
441 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
442
443installcheck: installcheck-am
444install-strip:
445 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
446 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
447 `test -z '$(STRIP)' || \
448 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
449mostlyclean-generic:
450
451clean-generic:
452
453distclean-generic:
454 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
455 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
456
457maintainer-clean-generic:
458 @echo "This command is intended for maintainers to use"
459 @echo "it deletes files that may require special tools to rebuild."
460 -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
461clean: clean-am
462
463clean-am: clean-generic clean-libtool mostlyclean-am
464
465distclean: distclean-am
466 -rm -f Makefile
467distclean-am: clean-am distclean-generic
468
469dvi: dvi-am
470
471dvi-am:
472
473html: html-am
474
475html-am:
476
477info: info-am
478
479info-am:
480
481install-data-am:
482
483install-dvi: install-dvi-am
484
485install-dvi-am:
486
487install-exec-am:
488
489install-html: install-html-am
490
491install-html-am:
492
493install-info: install-info-am
494
495install-info-am:
496
497install-man:
498
499install-pdf: install-pdf-am
500
501install-pdf-am:
502
503install-ps: install-ps-am
504
505install-ps-am:
506
507installcheck-am:
508
509maintainer-clean: maintainer-clean-am
510 -rm -f Makefile
511maintainer-clean-am: distclean-am maintainer-clean-generic
512
513mostlyclean: mostlyclean-am
514
515mostlyclean-am: mostlyclean-generic mostlyclean-libtool
516
517pdf: pdf-am
518
519pdf-am:
520
521ps: ps-am
522
523ps-am:
524
525uninstall-am:
526
527.MAKE: install-am install-strip
528
529.PHONY: all all-am check check-am clean clean-generic clean-libtool \
530 distclean distclean-generic distclean-libtool distdir dvi \
531 dvi-am html html-am info info-am install install-am \
532 install-data install-data-am install-dvi install-dvi-am \
533 install-exec install-exec-am install-html install-html-am \
534 install-info install-info-am install-man install-pdf \
535 install-pdf-am install-ps install-ps-am install-strip \
536 installcheck installcheck-am installdirs maintainer-clean \
537 maintainer-clean-generic mostlyclean mostlyclean-generic \
538 mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am
539
540
541# Tell versions [3.59,3.63) of GNU make to not export all variables.
542# Otherwise a system limit (for SysV at least) may be exceeded.
543.NOEXPORT:
diff --git a/libraries/evas/src/lib/engines/common/evas_op_sub/op_sub_color_.c b/libraries/evas/src/lib/engines/common/evas_op_sub/op_sub_color_.c
new file mode 100644
index 0000000..8490b68
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_sub/op_sub_color_.c
@@ -0,0 +1,33 @@
1/* sub color -> dst */
2
3#ifdef BUILD_C
4static void
5init_sub_color_span_funcs_c(void)
6{
7}
8#endif
9
10#ifdef BUILD_C
11static void
12init_sub_color_pt_funcs_c(void)
13{
14}
15#endif
16
17/*-----*/
18
19/* sub_rel color -> dst */
20
21#ifdef BUILD_C
22static void
23init_sub_rel_color_span_funcs_c(void)
24{
25}
26#endif
27
28#ifdef BUILD_C
29static void
30init_sub_rel_color_pt_funcs_c(void)
31{
32}
33#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_sub/op_sub_color_i386.c b/libraries/evas/src/lib/engines/common/evas_op_sub/op_sub_color_i386.c
new file mode 100644
index 0000000..d8fbbea
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_sub/op_sub_color_i386.c
@@ -0,0 +1,33 @@
1/* sub color -> dst */
2
3#ifdef BUILD_MMX
4static void
5init_sub_color_span_funcs_mmx(void)
6{
7}
8#endif
9
10#ifdef BUILD_MMX
11static void
12init_sub_color_pt_funcs_mmx(void)
13{
14}
15#endif
16
17/*-----*/
18
19/* sub_rel color -> dst */
20
21#ifdef BUILD_MMX
22static void
23init_sub_rel_color_span_funcs_mmx(void)
24{
25}
26#endif
27
28#ifdef BUILD_MMX
29static void
30init_sub_rel_color_pt_funcs_mmx(void)
31{
32}
33#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_sub/op_sub_mask_color_.c b/libraries/evas/src/lib/engines/common/evas_op_sub/op_sub_mask_color_.c
new file mode 100644
index 0000000..0584227
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_sub/op_sub_mask_color_.c
@@ -0,0 +1,33 @@
1/* sub mask x color -> dst */
2
3#ifdef BUILD_C
4static void
5init_sub_mask_color_span_funcs_c(void)
6{
7}
8#endif
9
10#ifdef BUILD_C
11static void
12init_sub_mask_color_pt_funcs_c(void)
13{
14}
15#endif
16
17/*-----*/
18
19/* sub_rel mask x color -> dst */
20
21#ifdef BUILD_C
22static void
23init_sub_rel_mask_color_span_funcs_c(void)
24{
25}
26#endif
27
28#ifdef BUILD_C
29static void
30init_sub_rel_mask_color_pt_funcs_c(void)
31{
32}
33#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_sub/op_sub_mask_color_i386.c b/libraries/evas/src/lib/engines/common/evas_op_sub/op_sub_mask_color_i386.c
new file mode 100644
index 0000000..972a2c9
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_sub/op_sub_mask_color_i386.c
@@ -0,0 +1,33 @@
1/* sub mask x color -> dst */
2
3#ifdef BUILD_MMX
4static void
5init_sub_mask_color_span_funcs_mmx(void)
6{
7}
8#endif
9
10#ifdef BUILD_MMX
11static void
12init_sub_mask_color_pt_funcs_mmx(void)
13{
14}
15#endif
16
17/*-----*/
18
19/* sub_rel mask x color -> dst */
20
21#ifdef BUILD_MMX
22static void
23init_sub_rel_mask_color_span_funcs_mmx(void)
24{
25}
26#endif
27
28#ifdef BUILD_MMX
29static void
30init_sub_rel_mask_color_pt_funcs_mmx(void)
31{
32}
33#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_sub/op_sub_pixel_.c b/libraries/evas/src/lib/engines/common/evas_op_sub/op_sub_pixel_.c
new file mode 100644
index 0000000..97001d4
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_sub/op_sub_pixel_.c
@@ -0,0 +1,33 @@
1/* sub pixel --> dst */
2
3#ifdef BUILD_C
4static void
5init_sub_pixel_span_funcs_c(void)
6{
7}
8#endif
9
10#ifdef BUILD_C
11static void
12init_sub_pixel_pt_funcs_c(void)
13{
14}
15#endif
16
17/*-----*/
18
19/* sub_rel pixel --> dst */
20
21#ifdef BUILD_C
22static void
23init_sub_rel_pixel_span_funcs_c(void)
24{
25}
26#endif
27
28#ifdef BUILD_C
29static void
30init_sub_rel_pixel_pt_funcs_c(void)
31{
32}
33#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_sub/op_sub_pixel_color_.c b/libraries/evas/src/lib/engines/common/evas_op_sub/op_sub_pixel_color_.c
new file mode 100644
index 0000000..13caa0b
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_sub/op_sub_pixel_color_.c
@@ -0,0 +1,33 @@
1/* sub pixel x color --> dst */
2
3#ifdef BUILD_C
4static void
5init_sub_pixel_color_span_funcs_c(void)
6{
7}
8#endif
9
10#ifdef BUILD_C
11static void
12init_sub_pixel_color_pt_funcs_c(void)
13{
14}
15#endif
16
17/*-----*/
18
19/* sub_rel pixel x color --> dst */
20
21#ifdef BUILD_C
22static void
23init_sub_rel_pixel_color_span_funcs_c(void)
24{
25}
26#endif
27
28#ifdef BUILD_C
29static void
30init_sub_rel_pixel_color_pt_funcs_c(void)
31{
32}
33#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_sub/op_sub_pixel_color_i386.c b/libraries/evas/src/lib/engines/common/evas_op_sub/op_sub_pixel_color_i386.c
new file mode 100644
index 0000000..e3c1793
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_sub/op_sub_pixel_color_i386.c
@@ -0,0 +1,29 @@
1/* sub pixel x color --> dst */
2
3#ifdef BUILD_MMX
4static void
5init_sub_pixel_color_span_funcs_mmx(void)
6{ }
7#endif
8
9#ifdef BUILD_MMX
10static void
11init_sub_pixel_color_pt_funcs_mmx(void)
12{ }
13#endif
14
15/*-----*/
16
17/* sub_rel pixel x color --> dst */
18
19#ifdef BUILD_MMX
20static void
21init_sub_rel_pixel_color_span_funcs_mmx(void)
22{ }
23#endif
24
25#ifdef BUILD_MMX
26static void
27init_sub_rel_pixel_color_pt_funcs_mmx(void)
28{ }
29#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_sub/op_sub_pixel_i386.c b/libraries/evas/src/lib/engines/common/evas_op_sub/op_sub_pixel_i386.c
new file mode 100644
index 0000000..95e2ab6
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_sub/op_sub_pixel_i386.c
@@ -0,0 +1,33 @@
1/* sub pixel --> dst */
2
3#ifdef BUILD_MMX
4static void
5init_sub_pixel_span_funcs_mmx(void)
6{
7}
8#endif
9
10#ifdef BUILD_MMX
11static void
12init_sub_pixel_pt_funcs_mmx(void)
13{
14}
15#endif
16
17/*-----*/
18
19/* sub_rel pixel --> dst */
20
21#ifdef BUILD_MMX
22static void
23init_sub_rel_pixel_span_funcs_mmx(void)
24{
25}
26#endif
27
28#ifdef BUILD_MMX
29static void
30init_sub_rel_pixel_pt_funcs_mmx(void)
31{
32}
33#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_sub/op_sub_pixel_mask_.c b/libraries/evas/src/lib/engines/common/evas_op_sub/op_sub_pixel_mask_.c
new file mode 100644
index 0000000..c0c67be
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_sub/op_sub_pixel_mask_.c
@@ -0,0 +1,37 @@
1/* sub pixel x mask --> dst */
2
3#ifdef BUILD_C
4/* XXX: not used
5static void
6init_sub_pixel_mask_span_funcs_c(void)
7{
8}
9*/
10#endif
11
12#ifdef BUILD_C
13/* XXX: not used
14static void
15init_sub_pixel_mask_pt_funcs_c(void)
16{
17}
18*/
19#endif
20
21/*-----*/
22
23/* sub_rel pixel x mask --> dst */
24
25#ifdef BUILD_C
26static void
27init_sub_rel_pixel_mask_span_funcs_c(void)
28{
29}
30#endif
31
32#ifdef BUILD_C
33static void
34init_sub_rel_pixel_mask_pt_funcs_c(void)
35{
36}
37#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_sub/op_sub_pixel_mask_i386.c b/libraries/evas/src/lib/engines/common/evas_op_sub/op_sub_pixel_mask_i386.c
new file mode 100644
index 0000000..bfd145e
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_sub/op_sub_pixel_mask_i386.c
@@ -0,0 +1,33 @@
1/* sub pixel x mask -> dst */
2
3#ifdef BUILD_MMX
4static void
5init_sub_pixel_mask_span_funcs_mmx(void)
6{
7}
8#endif
9
10#ifdef BUILD_MMX
11static void
12init_sub_pixel_mask_pt_funcs_mmx(void)
13{
14}
15#endif
16
17/*-----*/
18
19/* sub_rel pixel x mask -> dst */
20
21#ifdef BUILD_MMX
22static void
23init_sub_rel_pixel_mask_span_funcs_mmx(void)
24{
25}
26#endif
27
28#ifdef BUILD_MMX
29static void
30init_sub_rel_pixel_mask_pt_funcs_mmx(void)
31{
32}
33#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_op_sub_main_.c b/libraries/evas/src/lib/engines/common/evas_op_sub_main_.c
new file mode 100644
index 0000000..329c2e4
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_op_sub_main_.c
@@ -0,0 +1,542 @@
1#include "evas_common.h"
2
3static RGBA_Gfx_Func op_sub_span_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
4static RGBA_Gfx_Pt_Func op_sub_pt_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
5
6static void op_sub_init(void);
7static void op_sub_shutdown(void);
8
9static RGBA_Gfx_Func op_sub_pixel_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels);
10static RGBA_Gfx_Func op_sub_color_span_get(DATA32 col, RGBA_Image *dst, int pixels);
11static RGBA_Gfx_Func op_sub_pixel_color_span_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels);
12static RGBA_Gfx_Func op_sub_mask_color_span_get(DATA32 col, RGBA_Image *dst, int pixels);
13static RGBA_Gfx_Func op_sub_pixel_mask_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels);
14
15static RGBA_Gfx_Pt_Func op_sub_pixel_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst);
16static RGBA_Gfx_Pt_Func op_sub_color_pt_get(DATA32 col, RGBA_Image *dst);
17static RGBA_Gfx_Pt_Func op_sub_pixel_color_pt_get(Image_Entry_Flags src_flags, DATA32 col, RGBA_Image *dst);
18static RGBA_Gfx_Pt_Func op_sub_mask_color_pt_get(DATA32 col, RGBA_Image *dst);
19static RGBA_Gfx_Pt_Func op_sub_pixel_mask_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst);
20
21static RGBA_Gfx_Compositor _composite_sub = { "sub",
22 op_sub_init, op_sub_shutdown,
23 op_sub_pixel_span_get, op_sub_color_span_get,
24 op_sub_pixel_color_span_get, op_sub_mask_color_span_get,
25 op_sub_pixel_mask_span_get,
26 op_sub_pixel_pt_get, op_sub_color_pt_get,
27 op_sub_pixel_color_pt_get, op_sub_mask_color_pt_get,
28 op_sub_pixel_mask_pt_get
29 };
30
31RGBA_Gfx_Compositor *
32evas_common_gfx_compositor_sub_get(void)
33{
34 return &(_composite_sub);
35}
36
37static RGBA_Gfx_Func op_sub_rel_span_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
38static RGBA_Gfx_Pt_Func op_sub_rel_pt_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
39
40static void op_sub_rel_init(void);
41static void op_sub_rel_shutdown(void);
42
43static RGBA_Gfx_Func op_sub_rel_pixel_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels);
44static RGBA_Gfx_Func op_sub_rel_color_span_get(DATA32 col, RGBA_Image *dst, int pixels);
45static RGBA_Gfx_Func op_sub_rel_pixel_color_span_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels);
46static RGBA_Gfx_Func op_sub_rel_mask_color_span_get(DATA32 col, RGBA_Image *dst, int pixels);
47static RGBA_Gfx_Func op_sub_rel_pixel_mask_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels);
48
49static RGBA_Gfx_Pt_Func op_sub_rel_pixel_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst);
50static RGBA_Gfx_Pt_Func op_sub_rel_color_pt_get(DATA32 col, RGBA_Image *dst);
51static RGBA_Gfx_Pt_Func op_sub_rel_pixel_color_pt_get(Image_Entry_Flags src_flags, DATA32 col, RGBA_Image *dst);
52static RGBA_Gfx_Pt_Func op_sub_rel_mask_color_pt_get(DATA32 col, RGBA_Image *dst);
53static RGBA_Gfx_Pt_Func op_sub_rel_pixel_mask_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst);
54
55static RGBA_Gfx_Compositor _composite_sub_rel = { "sub_rel",
56 op_sub_rel_init, op_sub_rel_shutdown,
57 op_sub_rel_pixel_span_get, op_sub_rel_color_span_get,
58 op_sub_rel_pixel_color_span_get, op_sub_rel_mask_color_span_get,
59 op_sub_rel_pixel_mask_span_get,
60 op_sub_rel_pixel_pt_get, op_sub_rel_color_pt_get,
61 op_sub_rel_pixel_color_pt_get, op_sub_rel_mask_color_pt_get,
62 op_sub_rel_pixel_mask_pt_get
63 };
64
65RGBA_Gfx_Compositor *
66evas_common_gfx_compositor_sub_rel_get(void)
67{
68 return &(_composite_sub_rel);
69}
70
71
72# include "./evas_op_sub/op_sub_pixel_.c"
73# include "./evas_op_sub/op_sub_color_.c"
74# include "./evas_op_sub/op_sub_pixel_color_.c"
75# include "./evas_op_sub/op_sub_pixel_mask_.c"
76# include "./evas_op_sub/op_sub_mask_color_.c"
77//# include "./evas_op_sub/op_sub_pixel_mask_color_.c"
78
79# include "./evas_op_sub/op_sub_pixel_i386.c"
80# include "./evas_op_sub/op_sub_color_i386.c"
81# include "./evas_op_sub/op_sub_pixel_color_i386.c"
82# include "./evas_op_sub/op_sub_pixel_mask_i386.c"
83# include "./evas_op_sub/op_sub_mask_color_i386.c"
84//# include "./evas_op_sub/op_sub_pixel_mask_color_i386.c"
85
86static void
87op_sub_init(void)
88{
89 memset(op_sub_span_funcs, 0, sizeof(op_sub_span_funcs));
90 memset(op_sub_pt_funcs, 0, sizeof(op_sub_pt_funcs));
91#ifdef BUILD_MMX
92 init_sub_pixel_span_funcs_mmx();
93 init_sub_pixel_color_span_funcs_mmx();
94 init_sub_pixel_mask_span_funcs_mmx();
95 init_sub_color_span_funcs_mmx();
96 init_sub_mask_color_span_funcs_mmx();
97
98 init_sub_pixel_pt_funcs_mmx();
99 init_sub_pixel_color_pt_funcs_mmx();
100 init_sub_pixel_mask_pt_funcs_mmx();
101 init_sub_color_pt_funcs_mmx();
102 init_sub_mask_color_pt_funcs_mmx();
103#endif
104#ifdef BUILD_C
105 init_sub_pixel_span_funcs_c();
106 init_sub_pixel_color_span_funcs_c();
107 init_sub_rel_pixel_mask_span_funcs_c();
108 init_sub_color_span_funcs_c();
109 init_sub_mask_color_span_funcs_c();
110
111 init_sub_pixel_pt_funcs_c();
112 init_sub_pixel_color_pt_funcs_c();
113 init_sub_rel_pixel_mask_pt_funcs_c();
114 init_sub_color_pt_funcs_c();
115 init_sub_mask_color_pt_funcs_c();
116#endif
117}
118
119static void
120op_sub_shutdown(void)
121{
122}
123
124static RGBA_Gfx_Func
125sub_gfx_span_func_cpu(int s, int m, int c, int d)
126{
127 RGBA_Gfx_Func func = NULL;
128 int cpu = CPU_N;
129#ifdef BUILD_MMX
130 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
131 {
132 cpu = CPU_MMX;
133 func = op_sub_span_funcs[s][m][c][d][cpu];
134 if (func) return func;
135 }
136#endif
137#ifdef BUILD_C
138 cpu = CPU_C;
139 func = op_sub_span_funcs[s][m][c][d][cpu];
140 if (func) return func;
141#endif
142 return func;
143}
144
145static RGBA_Gfx_Func
146op_sub_pixel_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels __UNUSED__)
147{
148 int s = SP_AN, m = SM_N, c = SC_N, d = DP_AN;
149
150 if (src && src->cache_entry.flags.alpha)
151 s = SP;
152 if (dst && dst->cache_entry.flags.alpha)
153 d = DP;
154 return sub_gfx_span_func_cpu(s, m, c, d);
155}
156
157static RGBA_Gfx_Func
158op_sub_color_span_get(DATA32 col, RGBA_Image *dst, int pixels __UNUSED__)
159{
160 int s = SP_N, m = SM_N, c = SC_AN, d = DP_AN;
161
162 if ((col >> 24) < 255)
163 c = SC;
164 if (col == (col | 0x00ffffff))
165 c = SC_AA;
166 if (col == 0xffffffff)
167 c = SC_N;
168 if (dst && dst->cache_entry.flags.alpha)
169 d = DP;
170 return sub_gfx_span_func_cpu(s, m, c, d);
171}
172
173static RGBA_Gfx_Func
174op_sub_pixel_color_span_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels __UNUSED__)
175{
176 int s = SP_AN, m = SM_N, c = SC_AN, d = DP_AN;
177
178 if (src && src->cache_entry.flags.alpha)
179 s = SP;
180 if ((col >> 24) < 255)
181 c = SC;
182 if (col == (col | 0x00ffffff))
183 c = SC_AA;
184 if (col == 0xffffffff)
185 c = SC_N;
186 if (dst && dst->cache_entry.flags.alpha)
187 d = DP;
188 return sub_gfx_span_func_cpu(s, m, c, d);
189}
190
191static RGBA_Gfx_Func
192op_sub_mask_color_span_get(DATA32 col, RGBA_Image *dst, int pixels __UNUSED__)
193{
194 int s = SP_N, m = SM_AS, c = SC_AN, d = DP_AN;
195
196 if ((col >> 24) < 255)
197 c = SC;
198 if (col == (col | 0x00ffffff))
199 c = SC_AA;
200 if (col == 0xffffffff)
201 c = SC_N;
202 if (dst && dst->cache_entry.flags.alpha)
203 d = DP;
204 return sub_gfx_span_func_cpu(s, m, c, d);
205}
206
207static RGBA_Gfx_Func
208op_sub_pixel_mask_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels __UNUSED__)
209{
210 int s = SP_AN, m = SM_AS, c = SC_N, d = DP_AN;
211
212 if (src && src->cache_entry.flags.alpha)
213 s = SP;
214 if (dst && dst->cache_entry.flags.alpha)
215 d = DP;
216 return sub_gfx_span_func_cpu(s, m, c, d);
217}
218
219static RGBA_Gfx_Pt_Func
220sub_gfx_pt_func_cpu(int s, int m, int c, int d)
221{
222 RGBA_Gfx_Pt_Func func = NULL;
223 int cpu = CPU_N;
224#ifdef BUILD_MMX
225 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
226 {
227 cpu = CPU_MMX;
228 func = op_sub_pt_funcs[s][m][c][d][cpu];
229 if (func) return func;
230 }
231#endif
232#ifdef BUILD_C
233 cpu = CPU_C;
234 func = op_sub_pt_funcs[s][m][c][d][cpu];
235 if (func) return func;
236#endif
237 return func;
238}
239
240static RGBA_Gfx_Pt_Func
241op_sub_pixel_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst)
242{
243 int s = SP_AN, m = SM_N, c = SC_N, d = DP_AN;
244
245 if (src_flags.alpha)
246 s = SP;
247 if (dst && dst->cache_entry.flags.alpha)
248 d = DP;
249 return sub_gfx_pt_func_cpu(s, m, c, d);
250}
251
252static RGBA_Gfx_Pt_Func
253op_sub_color_pt_get(DATA32 col, RGBA_Image *dst)
254{
255 int s = SP_N, m = SM_N, c = SC_AN, d = DP_AN;
256
257 if ((col >> 24) < 255)
258 c = SC;
259 if (col == (col | 0x00ffffff))
260 c = SC_AA;
261 if (col == 0xffffffff)
262 c = SC_N;
263 if (dst && dst->cache_entry.flags.alpha)
264 d = DP;
265 return sub_gfx_pt_func_cpu(s, m, c, d);
266}
267
268static RGBA_Gfx_Pt_Func
269op_sub_pixel_color_pt_get(Image_Entry_Flags src_flags, DATA32 col, RGBA_Image *dst)
270{
271 int s = SP_AN, m = SM_N, c = SC_AN, d = DP_AN;
272
273 if (src_flags.alpha)
274 s = SP;
275 if ((col >> 24) < 255)
276 c = SC;
277 if (col == (col | 0x00ffffff))
278 c = SC_AA;
279 if (col == 0xffffffff)
280 c = SC_N;
281 if (dst && dst->cache_entry.flags.alpha)
282 d = DP;
283 return sub_gfx_pt_func_cpu(s, m, c, d);
284}
285
286static RGBA_Gfx_Pt_Func
287op_sub_mask_color_pt_get(DATA32 col, RGBA_Image *dst)
288{
289 int s = SP_N, m = SM_AS, c = SC_AN, d = DP_AN;
290
291 if ((col >> 24) < 255)
292 c = SC;
293 if (col == (col | 0x00ffffff))
294 c = SC_AA;
295 if (col == 0xffffffff)
296 c = SC_N;
297 if (dst && dst->cache_entry.flags.alpha)
298 d = DP;
299 return sub_gfx_pt_func_cpu(s, m, c, d);
300}
301
302static RGBA_Gfx_Pt_Func
303op_sub_pixel_mask_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst)
304{
305 int s = SP_AN, m = SM_AS, c = SC_N, d = DP_AN;
306
307 if (src_flags.alpha)
308 s = SP;
309 if (dst && dst->cache_entry.flags.alpha)
310 d = DP;
311 return sub_gfx_pt_func_cpu(s, m, c, d);
312}
313
314
315
316static void
317op_sub_rel_init(void)
318{
319 memset(op_sub_rel_span_funcs, 0, sizeof(op_sub_rel_span_funcs));
320 memset(op_sub_rel_pt_funcs, 0, sizeof(op_sub_rel_pt_funcs));
321#ifdef BUILD_MMX
322 init_sub_rel_pixel_span_funcs_mmx();
323 init_sub_rel_pixel_color_span_funcs_mmx();
324 init_sub_rel_pixel_mask_span_funcs_mmx();
325 init_sub_rel_color_span_funcs_mmx();
326 init_sub_rel_mask_color_span_funcs_mmx();
327
328 init_sub_rel_pixel_pt_funcs_mmx();
329 init_sub_rel_pixel_color_pt_funcs_mmx();
330 init_sub_rel_pixel_mask_pt_funcs_mmx();
331 init_sub_rel_color_pt_funcs_mmx();
332 init_sub_rel_mask_color_pt_funcs_mmx();
333#endif
334#ifdef BUILD_C
335 init_sub_rel_pixel_span_funcs_c();
336 init_sub_rel_pixel_color_span_funcs_c();
337 init_sub_rel_pixel_mask_span_funcs_c();
338 init_sub_rel_color_span_funcs_c();
339 init_sub_rel_mask_color_span_funcs_c();
340
341 init_sub_rel_pixel_pt_funcs_c();
342 init_sub_rel_pixel_color_pt_funcs_c();
343 init_sub_rel_pixel_mask_pt_funcs_c();
344 init_sub_rel_color_pt_funcs_c();
345 init_sub_rel_mask_color_pt_funcs_c();
346#endif
347}
348
349static void
350op_sub_rel_shutdown(void)
351{
352}
353
354static RGBA_Gfx_Func
355sub_rel_gfx_span_func_cpu(int s, int m, int c, int d)
356{
357 RGBA_Gfx_Func func = NULL;
358 int cpu = CPU_N;
359#ifdef BUILD_MMX
360 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
361 {
362 cpu = CPU_MMX;
363 func = op_sub_rel_span_funcs[s][m][c][d][cpu];
364 if (func) return func;
365 }
366#endif
367#ifdef BUILD_C
368 cpu = CPU_C;
369 func = op_sub_rel_span_funcs[s][m][c][d][cpu];
370 if (func) return func;
371#endif
372 return func;
373}
374
375static RGBA_Gfx_Func
376op_sub_rel_pixel_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels __UNUSED__)
377{
378 int s = SP_AN, m = SM_N, c = SC_N, d = DP_AN;
379
380 if (src && src->cache_entry.flags.alpha)
381 s = SP;
382 if (dst && dst->cache_entry.flags.alpha)
383 d = DP;
384 return sub_rel_gfx_span_func_cpu(s, m, c, d);
385}
386
387static RGBA_Gfx_Func
388op_sub_rel_color_span_get(DATA32 col, RGBA_Image *dst, int pixels __UNUSED__)
389{
390 int s = SP_N, m = SM_N, c = SC_AN, d = DP_AN;
391
392 if ((col >> 24) < 255)
393 c = SC;
394 if (col == (col | 0x00ffffff))
395 c = SC_AA;
396 if (col == 0xffffffff)
397 c = SC_N;
398 if (dst && dst->cache_entry.flags.alpha)
399 d = DP;
400 return sub_rel_gfx_span_func_cpu(s, m, c, d);
401}
402
403static RGBA_Gfx_Func
404op_sub_rel_pixel_color_span_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels __UNUSED__)
405{
406 int s = SP_AN, m = SM_N, c = SC_AN, d = DP_AN;
407
408 if (src && src->cache_entry.flags.alpha)
409 s = SP;
410 if ((col >> 24) < 255)
411 c = SC;
412 if (col == (col | 0x00ffffff))
413 c = SC_AA;
414 if (col == 0xffffffff)
415 c = SC_N;
416 if (dst && dst->cache_entry.flags.alpha)
417 d = DP;
418 return sub_rel_gfx_span_func_cpu(s, m, c, d);
419}
420
421static RGBA_Gfx_Func
422op_sub_rel_mask_color_span_get(DATA32 col, RGBA_Image *dst, int pixels __UNUSED__)
423{
424 int s = SP_N, m = SM_AS, c = SC_AN, d = DP_AN;
425
426 if ((col >> 24) < 255)
427 c = SC;
428 if (col == (col | 0x00ffffff))
429 c = SC_AA;
430 if (col == 0xffffffff)
431 c = SC_N;
432 if (dst && dst->cache_entry.flags.alpha)
433 d = DP;
434 return sub_rel_gfx_span_func_cpu(s, m, c, d);
435}
436
437static RGBA_Gfx_Func
438op_sub_rel_pixel_mask_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels __UNUSED__)
439{
440 int s = SP_AN, m = SM_AS, c = SC_N, d = DP_AN;
441
442 if (src && src->cache_entry.flags.alpha)
443 s = SP;
444 if (dst && dst->cache_entry.flags.alpha)
445 d = DP;
446 return sub_rel_gfx_span_func_cpu(s, m, c, d);
447}
448
449static RGBA_Gfx_Pt_Func
450sub_rel_gfx_pt_func_cpu(int s, int m, int c, int d)
451{
452 RGBA_Gfx_Pt_Func func = NULL;
453 int cpu = CPU_N;
454#ifdef BUILD_MMX
455 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
456 {
457 cpu = CPU_MMX;
458 func = op_sub_rel_pt_funcs[s][m][c][d][cpu];
459 if (func) return func;
460 }
461#endif
462#ifdef BUILD_C
463 cpu = CPU_C;
464 func = op_sub_rel_pt_funcs[s][m][c][d][cpu];
465 if (func) return func;
466#endif
467 return func;
468}
469
470static RGBA_Gfx_Pt_Func
471op_sub_rel_pixel_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst)
472{
473 int s = SP_AN, m = SM_N, c = SC_N, d = DP_AN;
474
475 if (src_flags.alpha)
476 s = SP;
477 if (dst && dst->cache_entry.flags.alpha)
478 d = DP;
479 return sub_rel_gfx_pt_func_cpu(s, m, c, d);
480}
481
482static RGBA_Gfx_Pt_Func
483op_sub_rel_color_pt_get(DATA32 col, RGBA_Image *dst)
484{
485 int s = SP_N, m = SM_N, c = SC_AN, d = DP_AN;
486
487 if ((col >> 24) < 255)
488 c = SC;
489 if (col == (col | 0x00ffffff))
490 c = SC_AA;
491 if (col == 0xffffffff)
492 c = SC_N;
493 if (dst && dst->cache_entry.flags.alpha)
494 d = DP;
495 return sub_rel_gfx_pt_func_cpu(s, m, c, d);
496}
497
498static RGBA_Gfx_Pt_Func
499op_sub_rel_pixel_color_pt_get(Image_Entry_Flags src_flags, DATA32 col, RGBA_Image *dst)
500{
501 int s = SP_AN, m = SM_N, c = SC_AN, d = DP_AN;
502
503 if (src_flags.alpha)
504 s = SP;
505 if ((col >> 24) < 255)
506 c = SC;
507 if (col == (col | 0x00ffffff))
508 c = SC_AA;
509 if (col == 0xffffffff)
510 c = SC_N;
511 if (dst && dst->cache_entry.flags.alpha)
512 d = DP;
513 return sub_rel_gfx_pt_func_cpu(s, m, c, d);
514}
515
516static RGBA_Gfx_Pt_Func
517op_sub_rel_mask_color_pt_get(DATA32 col, RGBA_Image *dst)
518{
519 int s = SP_N, m = SM_AS, c = SC_AN, d = DP_AN;
520
521 if ((col >> 24) < 255)
522 c = SC;
523 if (col == (col | 0x00ffffff))
524 c = SC_AA;
525 if (col == 0xffffffff)
526 c = SC_N;
527 if (dst && dst->cache_entry.flags.alpha)
528 d = DP;
529 return sub_rel_gfx_pt_func_cpu(s, m, c, d);
530}
531
532static RGBA_Gfx_Pt_Func
533op_sub_rel_pixel_mask_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst)
534{
535 int s = SP_AN, m = SM_AS, c = SC_N, d = DP_AN;
536
537 if (src_flags.alpha)
538 s = SP;
539 if (dst && dst->cache_entry.flags.alpha)
540 d = DP;
541 return sub_rel_gfx_pt_func_cpu(s, m, c, d);
542}
diff --git a/libraries/evas/src/lib/engines/common/evas_pipe.c b/libraries/evas/src/lib/engines/common/evas_pipe.c
new file mode 100644
index 0000000..66085c8
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_pipe.c
@@ -0,0 +1,1733 @@
1// THIS IS DEPRECATED. WILL GO EVENTUALLTY. NO NEED TO SUPPORT ANYMORE
2
3#include "evas_common.h"
4#include <unistd.h>
5
6#ifdef BUILD_PIPE_RENDER
7
8#ifdef EVAS_FRAME_QUEUING
9#define SCALECACHE
10static Evas_FrameQ gframeq; // global frameQ
11
12static Evas_Surface *
13evas_common_surface_alloc(void *surface, int x, int y, int w, int h)
14{
15 Evas_Surface *e_surface;
16
17 e_surface = calloc(1, sizeof(Evas_Surface));
18 e_surface->im = surface;
19 LKL(e_surface->im->cache_entry.ref_fq_add);
20 e_surface->im->cache_entry.ref_fq[0]++;
21 LKU(e_surface->im->cache_entry.ref_fq_add);
22 e_surface->x = x;
23 e_surface->y = y;
24 e_surface->w = w;
25 e_surface->h = h;
26
27 return e_surface;
28}
29
30static void
31evas_common_surface_dealloc(Evas_Surface *surface)
32{
33 Evas_Surface *d_surface;
34
35 while (surface)
36 {
37 d_surface = surface;
38 surface = (Evas_Surface *)eina_inlist_remove(EINA_INLIST_GET(surface), EINA_INLIST_GET(d_surface));
39 LKL(d_surface->im->cache_entry.ref_fq_del);
40 d_surface->im->cache_entry.ref_fq[1]++;
41 LKU(d_surface->im->cache_entry.ref_fq_del);
42 free(d_surface);
43 }
44}
45
46static void
47evas_common_surface_add(Evas_Frame *frame, Evas_Surface *surface)
48{
49 frame->surfaces = (Evas_Surface *)eina_inlist_append(EINA_INLIST_GET(frame->surfaces), EINA_INLIST_GET(surface));
50}
51
52static Evas_Frame *
53evas_common_frame_alloc(void)
54{
55 Evas_Frame *frame;
56
57 frame = calloc(1, sizeof(Evas_Frame));
58 frame->surfaces = NULL;
59 return frame;
60}
61
62static void
63evas_common_frame_dealloc(Evas_Frame *frame)
64{
65 evas_common_surface_dealloc(frame->surfaces);
66 free(frame);
67}
68
69static void
70evas_common_frame_add(Evas_FrameQ *frameq, Evas_Frame *frame)
71{
72 Evas_Frame *temp_frame;
73
74 LKL(frameq->mutex);
75 while ((int)eina_inlist_count(EINA_INLIST_GET(frameq->frames)) >= frameq->frameq_sz)
76 {
77 /* wait a worker thread finish previous frame */
78 eina_condition_wait(&(frameq->cond_done));
79 }
80 frameq->frames = (Evas_Frame *) eina_inlist_append(EINA_INLIST_GET(frameq->frames), EINA_INLIST_GET(frame));
81
82 // this frame need not to be scheduled for flushing time
83 EINA_INLIST_FOREACH(EINA_INLIST_GET(frameq->frames), temp_frame)
84 {
85 if (!temp_frame->ready)
86 {
87 break;
88 }
89 }
90 if (temp_frame && temp_frame == frame)
91 frame->dont_schedule = 1;
92
93 LKU(frameq->mutex);
94
95 eina_condition_signal(&(frameq->cond_new));
96}
97
98EAPI Evas_Surface *
99evas_common_frameq_new_surface(void *surface, int x, int y, int w, int h)
100{
101 return evas_common_surface_alloc(surface, x, y, w, h);
102}
103
104EAPI void
105evas_common_frameq_add_surface(Evas_Surface *surface)
106{
107 evas_common_surface_add(gframeq.cur_frame, surface);
108}
109
110EAPI void
111evas_common_frameq_set_frame_data(void *data,
112 void (*fn_output_redraws_next_update_push) (void *data, void *surface, int x, int y, int w, int h),
113 void (*fn_output_flush) (void *data),
114 void (*fn_output_set_priv)(void *data, void *cur, void *prev))
115{
116 if (gframeq.cur_frame)
117 {
118 gframeq.cur_frame->data = data;
119 gframeq.cur_frame->output_redraws_next_update_push = fn_output_redraws_next_update_push;
120 gframeq.cur_frame->output_flush = fn_output_flush;
121 gframeq.cur_frame->output_set_priv = fn_output_set_priv;
122 }
123}
124
125EAPI void
126evas_common_frameq_prepare_frame(void)
127{
128 if (!gframeq.cur_frame )
129 {
130 gframeq.cur_frame = evas_common_frame_alloc();
131 }
132}
133
134EAPI void
135evas_common_frameq_ready_frame(void)
136{
137 if (gframeq.cur_frame)
138 {
139 evas_common_frame_add(&gframeq, gframeq.cur_frame);
140 gframeq.cur_frame = NULL; // create a new frame for the next frame later
141 }
142}
143
144
145EAPI void
146evas_common_frameq_init(void)
147{
148 gframeq.frames = NULL;
149 LKI(gframeq.mutex);
150 eina_condition_new(&(gframeq.cond_new), &(gframeq.mutex));
151 eina_condition_new(&(gframeq.cond_ready), &(gframeq.mutex));
152 eina_condition_new(&(gframeq.cond_done), &(gframeq.mutex));
153 gframeq.initialised = 0; // worker thread are not created yet
154 gframeq.frameq_sz = 1; // this value ensures the first frame can be enqueued.
155}
156
157EAPI void
158evas_common_frameq_destroy(void)
159{
160#if 0 // let them destroyed indirectly with program exit
161 LKL(gframeq.mutex);
162 eina_condition_free(&(gframeq.cond_new));
163 eina_condition_free(&(gframeq.cond_ready));
164 eina_condition_free(&(gframeq.cond_done));
165 LKU(gframeq.mutex);
166#endif
167 LKD(gframeq.mutex);
168
169 gframeq.frames = NULL;
170 gframeq.initialised = 0;
171}
172
173EAPI void
174evas_common_frameq_flush(void)
175{
176 if (! evas_common_frameq_enabled())
177 return;
178
179 LKL(gframeq.mutex);
180 while(eina_inlist_count(EINA_INLIST_GET(gframeq.frames)) > 0)
181 {
182 /* wait a worker thread finish previous frame */
183 eina_condition_wait(&(gframeq.cond_done));
184 }
185 LKU(gframeq.mutex);
186}
187
188
189EAPI void
190evas_common_frameq_flush_ready(void)
191{
192 return;
193}
194
195EAPI int
196evas_common_frameq_get_frameq_sz(void)
197{
198 return gframeq.frameq_sz;
199}
200
201EAPI int
202evas_common_frameq_enabled(void)
203{
204 return gframeq.initialised;
205}
206#endif
207
208static RGBA_Pipe *evas_common_pipe_add(RGBA_Pipe *pipe, RGBA_Pipe_Op **op);
209static void evas_common_pipe_draw_context_copy(RGBA_Draw_Context *dc, RGBA_Pipe_Op *op);
210static void evas_common_pipe_op_free(RGBA_Pipe_Op *op);
211
212/* utils */
213static RGBA_Pipe *
214evas_common_pipe_add(RGBA_Pipe *rpipe, RGBA_Pipe_Op **op)
215{
216 RGBA_Pipe *p;
217 int first_pipe = 0;
218
219 if (!rpipe)
220 {
221 first_pipe = 1;
222 p = calloc(1, sizeof(RGBA_Pipe));
223 if (!p) return NULL;
224 rpipe = (RGBA_Pipe *)eina_inlist_append(EINA_INLIST_GET(rpipe), EINA_INLIST_GET(p));
225 }
226 p = (RGBA_Pipe *)(EINA_INLIST_GET(rpipe))->last;
227 if (p->op_num == PIPE_LEN)
228 {
229 p = calloc(1, sizeof(RGBA_Pipe));
230 if (!p) return NULL;
231 rpipe = (RGBA_Pipe *)eina_inlist_append(EINA_INLIST_GET(rpipe), EINA_INLIST_GET(p));
232 }
233 p->op_num++;
234 *op = &(p->op[p->op_num - 1]);
235 if (first_pipe)
236 {
237 /* FIXME: PTHREAD init any thread locks etc */
238 }
239 return rpipe;
240}
241
242static void
243evas_common_pipe_draw_context_copy(RGBA_Draw_Context *dc, RGBA_Pipe_Op *op)
244{
245 memcpy(&(op->context), dc, sizeof(RGBA_Draw_Context));
246 if (op->context.cutout.active > 0)
247 {
248 op->context.cutout.rects = malloc(sizeof(Cutout_Rect) * op->context.cutout.active);
249 memcpy(op->context.cutout.rects, dc->cutout.rects, sizeof(Cutout_Rect) * op->context.cutout.active);
250 }
251 else
252 {
253 op->context.cutout.rects = NULL;
254 }
255}
256
257static void
258evas_common_pipe_op_free(RGBA_Pipe_Op *op)
259{
260 evas_common_draw_context_apply_clean_cutouts(&op->context.cutout);
261}
262
263#ifdef BUILD_PTHREAD
264/* main api calls */
265static void *
266evas_common_pipe_thread(void *data)
267{
268 Thinfo *thinfo;
269
270// INF("TH [...........");
271 thinfo = data;
272 for (;;)
273 {
274 RGBA_Pipe_Thread_Info *info;
275 RGBA_Pipe *p;
276
277 /* wait for start signal */
278// INF(" TH %i START...", thinfo->thread_num);
279 pthread_barrier_wait(&(thinfo->barrier[0]));
280 info = thinfo->info;
281// if (info)
282// {
283// thinfo->info = NULL;
284// INF(" TH %i GO", thinfo->thread_num);
285 EINA_INLIST_FOREACH(EINA_INLIST_GET(info->im->cache_entry.pipe), p)
286 {
287 int i;
288
289 for (i = 0; i < p->op_num; i++)
290 {
291 if (p->op[i].op_func)
292 p->op[i].op_func(info->im, &(p->op[i]), info);
293 }
294 }
295 free(info);
296// }
297// INF(" TH %i DONE", thinfo->thread_num);
298 /* send finished signal */
299 pthread_barrier_wait(&(thinfo->barrier[1]));
300 }
301 return NULL;
302}
303
304#ifdef EVAS_FRAME_QUEUING
305static void
306evas_common_frameq_release(void *data)
307{
308 Evas_FrameQ *frameq;
309 Evas_Frameq_Thread_Info *fq_info;
310 Thinfo *thinfo;
311
312 thinfo = data;
313 fq_info = (Evas_Frameq_Thread_Info *)(thinfo->fq_info);
314 frameq = fq_info->frameq;
315
316 /* This thread may or may not own the mutex.
317 * But there's no way to determine the ownership of the mutex, so release it anyway
318 */
319 LKU(frameq->mutex);
320}
321
322static void *
323evas_common_frameq_thread(void *data)
324{
325 Evas_FrameQ *frameq;
326 Evas_Frame *frame;
327 Evas_Surface *surface;
328 RGBA_Pipe *p;
329 Thinfo *thinfo;
330 Evas_Frameq_Thread_Info *fq_info;
331 RGBA_Pipe_Thread_Info p_info;
332
333 thinfo = data;
334 fq_info = (Evas_Frameq_Thread_Info *)(thinfo->fq_info);
335 frameq = fq_info->frameq;
336
337 pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
338 pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
339 /* install thread cancelation cleanup handler */
340 pthread_cleanup_push(evas_common_frameq_release, data);
341
342 for (;;)
343 {
344 frame = NULL;
345
346 /* 1. pick a frame to draw */
347 LKL(frameq->mutex);
348 while(!frame)
349 {
350 EINA_INLIST_FOREACH(EINA_INLIST_GET(frameq->frames), frame)
351 {
352 if (!frame->in_process)
353 {
354 frame->in_process = 1;
355 break;
356 }
357 }
358 if (frame)
359 {
360 break;
361 }
362 pthread_testcancel();
363 eina_condition_wait(&(frameq->cond_new));
364 }
365 LKU(frameq->mutex);
366
367 /* 2. draw selected frame */
368 EINA_INLIST_FOREACH(EINA_INLIST_GET(frame->surfaces), surface)
369 {
370 p_info.im = surface->im;
371 p_info.x = 0;
372 p_info.y = 0;
373 p_info.w = surface->im->cache_entry.w;
374 p_info.h = surface->im->cache_entry.h;
375
376 EINA_INLIST_FOREACH(EINA_INLIST_GET(p_info.im->cache_entry.pipe), p)
377 {
378 int i;
379
380 for (i = 0; i < p->op_num; i++)
381 {
382 if (p->op[i].op_func)
383 {
384 p->op[i].op_func(p_info.im, &(p->op[i]), &p_info);
385 }
386 }
387 }
388
389 /* push surface out */
390 if (! surface->dontpush)
391 {
392 frame->output_redraws_next_update_push(frame->data,
393 surface->im, surface->x, surface->y, surface->w, surface->h);
394 }
395 }
396
397 // record frame ready time, will be used in post worker thread, evas_common_frameq_thread_post()
398 gettimeofday(&frame->ready_time, NULL);
399
400 LKL(frameq->mutex);
401 frame->ready = 1;
402 eina_condition_signal(&(frameq->cond_ready));
403 LKU(frameq->mutex);
404 }
405
406 // Remove cleanup handler
407 pthread_cleanup_pop(0);
408 return NULL;
409}
410
411
412#define INTERVAL_QSIZE 17 // Actual size is 'INTERVAL_QSIZE - 1' because of not using index
413#define SATISFACTION_THRESHOLD 4 // 4 ms --> 250 FPS
414#define RESET_RATIO 4 // RESET_RATIO * [Average Ready Gap | get_max_interval()] --> Reset Threshold
415#define DOUBLE_RESET_TIME_INTERVAL_THRESHOLD 16000 // make it double in case of less 16ms
416#define RESET_ABSOLUTE_INTERVAL 600000 // 600 msec
417
418struct iq_node
419{
420 long long rt;
421 long long ri;
422};
423
424static struct iq_node _IQ[INTERVAL_QSIZE];
425static int _IQ_head = 0, _IQ_tail = 0;
426static int _IQ_length = 0;
427static long long min_ready, max_ready;
428static long long average_interval;
429
430static int
431_IQ_next_index(int i)
432{
433 return (i + 1) % INTERVAL_QSIZE;
434}
435
436static int
437_IQ_previous_index(int i)
438{
439 if (--i < 0) i += INTERVAL_QSIZE;
440 return i;
441}
442
443static void
444_IQ_init(void)
445{
446 _IQ_length = _IQ_head = _IQ_tail = 0;
447 min_ready = LLONG_MAX, max_ready = LLONG_MIN;
448 average_interval = 0;
449}
450
451static int
452_IQ_empty(void)
453{
454 return (_IQ_head == _IQ_tail) ? 1 : 0;
455}
456
457static int
458_IQ_full(void)
459{
460 return (_IQ_head == ((_IQ_tail + 1) % INTERVAL_QSIZE)) ? 1 : 0;
461}
462
463static void
464_IQ_insert(long long ready_time, long long last_interval)
465{
466 if (_IQ_full()) return;
467
468 if (_IQ_empty())
469 {
470 if (last_interval < 0)
471 {
472 last_interval = -last_interval;
473 }
474 _IQ[_IQ_tail].rt = ready_time;
475 _IQ[_IQ_tail].ri = last_interval;
476 min_ready = ready_time - last_interval;
477 max_ready = ready_time;
478 _IQ_tail = _IQ_next_index(_IQ_tail);
479 _IQ_length++;
480 }
481 else
482 {
483 if (max_ready < ready_time)
484 {
485 _IQ[_IQ_tail].rt = ready_time;
486 _IQ[_IQ_tail].ri = ready_time - max_ready;
487 _IQ_tail = _IQ_next_index(_IQ_tail);
488 _IQ_length++;
489 max_ready = ready_time;
490 }
491 else if (ready_time < min_ready)
492 {
493 last_interval = _IQ[_IQ_head].ri;
494 _IQ[_IQ_head].ri = _IQ[_IQ_head].rt - ready_time;
495 _IQ_head = _IQ_previous_index(_IQ_head);
496 _IQ[_IQ_head].rt = ready_time;
497 _IQ[_IQ_head].ri = last_interval;
498 min_ready = ready_time;
499 _IQ_length++;
500 }
501 else
502 {
503 int i, j, k, l = 0;
504 for (i = _IQ_head; i != _IQ_tail; i = j)
505 {
506 j = _IQ_next_index(i);
507 if (_IQ[j].rt < ready_time)
508 {
509 continue;
510 }
511 break;
512 }
513 for (k = _IQ_tail; k != j; k = l)
514 {
515 l = _IQ_previous_index(k);
516 _IQ[k] = _IQ[l];
517 }
518 i = _IQ_next_index(j);
519 _IQ[j].ri -= (_IQ[j].rt - ready_time);
520 _IQ[j].rt = ready_time;
521 _IQ[i].ri = _IQ[i].rt - ready_time;
522 _IQ_tail = _IQ_next_index(_IQ_tail);
523 _IQ_length++;
524 }
525 }
526 average_interval = (max_ready - min_ready) / _IQ_length;
527}
528
529static long long
530_IQ_delete(void)
531{
532 struct iq_node oldest;
533
534 if (_IQ_empty()) return 0;
535 oldest = _IQ[_IQ_head];
536 _IQ_head = (_IQ_head + 1) % INTERVAL_QSIZE;
537 if ((--_IQ_length) == 0)
538 {
539 _IQ_init();
540 }
541 else
542 {
543 min_ready = _IQ[_IQ_head].rt;
544 average_interval = (max_ready - min_ready) / _IQ_length;
545 }
546
547 return oldest.ri;
548}
549
550static long long
551get_max_interval(void)
552{
553 int i;
554 long long max = LLONG_MIN;
555
556 for ( i= _IQ_head ; i != _IQ_tail ; i = _IQ_next_index(i))
557 {
558 if (_IQ[i].ri > max)
559 {
560 max = _IQ[i].ri;
561 }
562 }
563
564 return max;
565}
566
567static long long
568tv_to_long_long(struct timeval *tv)
569{
570 if (!tv)
571 {
572 return 0;
573 }
574
575 return tv->tv_sec * 1000000LL + tv->tv_usec;
576}
577
578static long long
579evas_common_frameq_schedule_flush_time(int frameq_sz, int thread_no,
580 long long last_ready_time, long long current_ready_time,
581 long long last_flush_time, int ready_frames_num,
582 int dont_schedule)
583{
584 // to get each time and to do others
585 long long current_time = 0LL;
586 long long current_ready_interval = 0LL;
587 long long theshold_time = SATISFACTION_THRESHOLD * 1000LL; // ms -> usec
588 long long reset_time_interval = 0LL;
589 long long sleep_time = 0LL;
590 long long saved_ready_time, saved_ready_interval;
591 long long time_slept = 0LL;
592 static long long time_lag = 0;
593 struct timeval now;
594 int frameq_full_threshold =0;
595 int need_reset = 0;
596 int need_schedule = 0;
597
598 frameq_full_threshold = frameq_sz -thread_no; // Qsize - threads#
599
600 /* 1.5 defer flush time of current frame if need */
601 // in case of the first time, just keep ready time only
602 if (last_ready_time == 0LL)
603 {
604 last_ready_time = current_ready_time;
605 }
606 else
607 {
608 /* 1.5.1 get current ready time & interval */
609 saved_ready_time = current_ready_time;
610 saved_ready_interval = current_ready_interval = current_ready_time - last_ready_time;
611 // compensate a case which current ready time is older than previous one,
612 // doesn't work on the interval queue
613 if (current_ready_interval < 0)
614 {
615 current_ready_time = last_ready_time;
616 current_ready_interval = 0;
617 }
618
619 /* 1.5.2 get the reset time interval before keeping a new one */
620 if (!_IQ_empty())
621 {
622 reset_time_interval = RESET_RATIO * average_interval;
623 if (average_interval < DOUBLE_RESET_TIME_INTERVAL_THRESHOLD)
624 {
625 reset_time_interval *= 2;
626 }
627 }
628
629 /* 1.5.3 reset - if too late, discard all saved interval and start from here */
630 if (current_ready_interval > RESET_ABSOLUTE_INTERVAL)
631 {
632 need_reset = 1;
633 }
634 else if (_IQ_length >= thread_no * 2 && current_ready_interval > reset_time_interval)
635 {
636 need_reset = 1;
637 }
638 else if (_IQ_length >= thread_no && _IQ_length < thread_no * 2
639 && current_ready_interval > get_max_interval() * RESET_RATIO)
640 {
641 need_reset = 1;
642 }
643
644 if (need_reset)
645 {
646 _IQ_init();
647 }
648 else
649 {
650 /* 1.5.4 enqueue - keep a new interval for next average interval */
651 if (_IQ_full())
652 {
653 _IQ_delete();
654 }
655 _IQ_insert(saved_ready_time, saved_ready_interval);
656
657 /* 1.5.5 schedule - if faster than average interval, figure out sleep time to meet it */
658 if (!dont_schedule)
659 {
660 need_schedule = 0;
661 sleep_time = 0;
662 if (_IQ_length >= thread_no * 2 && average_interval > theshold_time)
663 {
664 need_schedule = 1;
665 }
666 // compensate the case that postworker blocks the workers from getting a new fresh frame
667 // It's actually occurred when during the wait time of postworker, the frame queue is full
668 // Consequently check the number of currently ready frames and apply some time drop to average time according to the number
669 if (ready_frames_num >= frameq_full_threshold)
670 {
671 need_schedule = 0;
672 }
673 if (need_schedule)
674 {
675 gettimeofday(&now, NULL);
676 current_time = tv_to_long_long(&now);
677 time_lag += (current_time - last_flush_time);
678 sleep_time = (average_interval < time_lag) ? 0 : (average_interval - time_lag);
679 }
680 }
681
682 /* 1.5.6 sleep - actually sleep and get over-slept time (time_lag) for next frame */
683 if (sleep_time > 0)
684 {
685 sleep_time = sleep_time * 9 / 10;
686 usleep((unsigned int)sleep_time);
687 gettimeofday(&now, NULL);
688 time_slept = tv_to_long_long(&now) - current_time;
689 time_lag = time_slept - sleep_time;
690 }
691 else
692 {
693 time_lag = 0;
694 }
695 }
696 last_ready_time = current_ready_time;
697 }
698
699 return last_ready_time;
700}
701
702static void *
703evas_common_frameq_thread_post(void *data)
704{
705 Evas_FrameQ *frameq;
706 Evas_Frame *frame;
707 Evas_Surface *surface;
708 Thinfo *thinfo;
709 Evas_Frameq_Thread_Info *fq_info;
710 Eina_List *pending_writes = NULL;
711 Eina_List *prev_pending_writes = NULL;
712
713 long long last_ready_time = 0LL;
714 long long current_ready_time;
715 Evas_Frame *temp_frame = NULL;
716 int ready_frames_num;
717 long long last_flush_time = 0LL;
718 struct timeval now;
719 int dont_schedule = 0;
720
721 thinfo = data;
722 fq_info = (Evas_Frameq_Thread_Info *)(thinfo->fq_info);
723 frameq = fq_info->frameq;
724
725 pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
726 pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, NULL);
727 /* install thread cancelation cleanup handler */
728 pthread_cleanup_push(evas_common_frameq_release, data);
729
730 _IQ_init();
731
732 for (;;)
733 {
734 /* 1. wait the first frame being done */
735 LKL(frameq->mutex);
736 while(!frameq->frames || !frameq->frames->ready)
737 {
738 eina_condition_wait(&(frameq->cond_ready));
739 }
740 frame = frameq->frames;
741
742 /* 1.5. prepare to schedule flush time */
743 current_ready_time = tv_to_long_long(&frame->ready_time);
744 ready_frames_num = 0;
745 EINA_INLIST_FOREACH(EINA_INLIST_GET(frameq->frames), temp_frame)
746 {
747 if (temp_frame->ready == 1)
748 {
749 ready_frames_num++;
750 }
751 }
752 dont_schedule = (frame->dont_schedule)?1:0;
753 LKU(frameq->mutex);
754
755 /* 2. generate pending_writes */
756 EINA_INLIST_FOREACH(EINA_INLIST_GET(frame->surfaces), surface)
757 {
758 evas_common_pipe_flush(surface->im);
759 if (! surface->dontpush)
760 {
761 pending_writes = eina_list_append(pending_writes, surface->im);
762 }
763 }
764
765 /* 2.5. schedule flush time */
766 last_ready_time = evas_common_frameq_schedule_flush_time(
767 frameq->frameq_sz, frameq->thread_num,
768 last_ready_time, current_ready_time,
769 last_flush_time, ready_frames_num, dont_schedule);
770
771 /* 3. flush redraws */
772 frame->output_set_priv(frame->data, pending_writes, prev_pending_writes);
773 frame->output_flush(frame->data);
774 gettimeofday(&now, NULL);
775 // keep as the last flush time
776 last_flush_time = now.tv_sec * 1000000LL + now.tv_usec;
777
778 prev_pending_writes = pending_writes;
779 pending_writes = NULL;
780
781 /* 4. remove this frame from the frame queue */
782 LKL(frameq->mutex);
783 frameq->frames =
784 (Evas_Frame *)eina_inlist_remove(EINA_INLIST_GET(frameq->frames),
785 EINA_INLIST_GET(frame));
786
787 LKU(frameq->mutex);
788 eina_condition_broadcast(&frameq->cond_done);
789 evas_common_frame_dealloc(frame);
790 }
791
792 // Remove cleanup handler
793 pthread_cleanup_pop(0);
794 return NULL;
795}
796
797#endif /* EVAS_FRAME_QUEUING */
798#endif
799
800#ifdef BUILD_PTHREAD
801static int thread_num = 0;
802static Thinfo thinfo[TH_MAX];
803static pthread_barrier_t thbarrier[2];
804#endif
805
806static void
807evas_common_pipe_begin(RGBA_Image *im)
808{
809#ifdef BUILD_PTHREAD
810 int i, y, h;
811
812#ifdef EVAS_FRAME_QUEUING
813 return;
814#endif
815
816 if (!im->cache_entry.pipe) return;
817 if (thread_num == 1) return;
818 y = 0;
819 h = im->cache_entry.h / thread_num;
820 if (h < 1) h = 1;
821 for (i = 0; i < thread_num; i++)
822 {
823 RGBA_Pipe_Thread_Info *info;
824
825// if (y >= im->cache_entry.h) break;
826 info = calloc(1, sizeof(RGBA_Pipe_Thread_Info));
827 info->im = im;
828#ifdef EVAS_SLI
829 info->x = 0;
830 info->w = im->cache_entry.w;
831 info->y = i;
832 info->h = thread_num;
833#else
834 info->x = 0;
835 info->y = y;
836 info->w = im->cache_entry.w;
837 if (i == (thread_num - 1))
838 {
839 info->h = im->cache_entry.h - y;
840 }
841 else
842 {
843 info->h = h;
844 }
845 y += info->h;
846#endif
847 thinfo[i].info = info;
848 }
849 /* tell worker threads to start */
850 pthread_barrier_wait(&(thbarrier[0]));
851#endif
852}
853
854#ifdef EVAS_FRAME_QUEUING
855EAPI void
856evas_common_frameq_begin(void)
857{
858#ifdef BUILD_PTHREAD
859 int i;
860 Evas_Frameq_Thread_Info *fp_info;
861 pthread_attr_t attr;
862 cpu_set_t cpu;
863
864 if (!gframeq.initialised)
865 {
866 int cpunum, set_cpu_affinity = 0;
867
868 cpunum = eina_cpu_count();
869 gframeq.thread_num = cpunum;
870 gframeq.frameq_sz = cpunum * FRAMEQ_SZ_PER_THREAD;
871
872 eina_threads_init();
873
874 for (i = 0; i < gframeq.thread_num; i++)
875 {
876
877 fp_info = calloc(1, sizeof(Evas_Frameq_Thread_Info));
878 fp_info->frameq = &gframeq;
879
880 gframeq.thinfo[i].thread_num = i;
881 gframeq.thinfo[i].fq_info = fp_info;
882
883 pthread_attr_init(&attr);
884 if (set_cpu_affinity)
885 {
886 CPU_ZERO(&cpu);
887 CPU_SET((i+1) % cpunum, &cpu);
888 pthread_attr_setaffinity_np(&attr, sizeof(cpu), &cpu);
889 }
890
891 pthread_create(&(gframeq.thinfo[i].thread_id), &attr,
892 evas_common_frameq_thread, &(gframeq.thinfo[i]));
893
894 pthread_attr_destroy(&attr);
895 pthread_detach(gframeq.thinfo[i].thread_id);
896 }
897
898 {
899 fp_info = calloc(1, sizeof(Evas_Frameq_Thread_Info));
900 fp_info->frameq = &gframeq;
901
902 gframeq.thinfo[i].thread_num = i;
903 gframeq.thinfo[i].fq_info = fp_info;
904
905 pthread_attr_init(&attr);
906 if (set_cpu_affinity)
907 {
908 CPU_ZERO(&cpu);
909 CPU_SET((i+1) % cpunum, &cpu);
910 pthread_attr_setaffinity_np(&attr, sizeof(cpu), &cpu);
911 }
912
913 pthread_create(&(gframeq.thinfo[i].thread_id), &attr,
914 evas_common_frameq_thread_post, &(gframeq.thinfo[i]));
915 pthread_attr_destroy(&attr);
916 pthread_detach(gframeq.thinfo[i].thread_id);
917 }
918 gframeq.initialised = 1; // now worker threads are created.
919
920 INF("initialised");
921 DBG("%d cpus, set_cpu_affinity=%d, frameq_sz=%d",
922 cpunum, set_cpu_affinity, gframeq.frameq_sz);
923 }
924#endif /* BUILD_PTHREAD */
925}
926
927EAPI void
928evas_common_frameq_finish(void)
929{
930 int i;
931
932 /* 1. cancel all worker threads */
933 for (i = 0; i < gframeq.thread_num; i++)
934 {
935 pthread_cancel(gframeq.thinfo[i].thread_id);
936 }
937 // cancel post-worker thread
938 pthread_cancel(gframeq.thinfo[i].thread_id);
939
940 /* 2. send signal to worker threads so that they enter to the thread cancelation cleanup handler */
941 for (i = 0; i < gframeq.thread_num; i++)
942 {
943 eina_condition_signal(&(gframeq.cond_new));
944 }
945 // send signal to post-worker thread
946 eina_condition_signal(&(gframeq.cond_ready));
947
948 /* all the workers were created and detached before
949 * so don't need to join them here.
950 */
951
952}
953
954#endif /* EVAS_FRAME_QUEUING */
955
956EAPI void
957evas_common_pipe_flush(RGBA_Image *im)
958{
959 if (!im->cache_entry.pipe) return;
960#ifndef EVAS_FRAME_QUEUING
961#ifdef BUILD_PTHREAD
962 if (thread_num > 1)
963 {
964 /* sync worker threads */
965 pthread_barrier_wait(&(thbarrier[1]));
966 }
967 else
968#endif
969 {
970 RGBA_Pipe *p;
971 int i;
972
973 /* process pipe - 1 thead */
974 for (p = im->cache_entry.pipe; p; p = (RGBA_Pipe *)(EINA_INLIST_GET(p))->next)
975 {
976 for (i = 0; i < p->op_num; i++)
977 {
978 if (p->op[i].op_func)
979 {
980 p->op[i].op_func(im, &(p->op[i]), NULL);
981 }
982 }
983 }
984 }
985#endif /* !EVAS_FRAME_QUEUING */
986 evas_common_cpu_end_opt();
987 evas_common_pipe_free(im);
988}
989
990EAPI void
991evas_common_pipe_free(RGBA_Image *im)
992{
993
994 RGBA_Pipe *p;
995 int i;
996
997 if (!im->cache_entry.pipe) return;
998 /* FIXME: PTHREAD join all threads here (if not finished) */
999
1000 /* free pipe */
1001 while (im->cache_entry.pipe)
1002 {
1003 p = im->cache_entry.pipe;
1004 for (i = 0; i < p->op_num; i++)
1005 {
1006 if (p->op[i].free_func)
1007 {
1008 p->op[i].free_func(&(p->op[i]));
1009 }
1010 }
1011 im->cache_entry.pipe = (RGBA_Pipe *)eina_inlist_remove(EINA_INLIST_GET(im->cache_entry.pipe), EINA_INLIST_GET(p));
1012 free(p);
1013 }
1014}
1015
1016
1017
1018/* draw ops */
1019/**************** RECT ******************/
1020static void
1021evas_common_pipe_rectangle_draw_do(RGBA_Image *dst, RGBA_Pipe_Op *op, RGBA_Pipe_Thread_Info *info)
1022{
1023 if (info)
1024 {
1025 RGBA_Draw_Context context;
1026
1027 memcpy(&(context), &(op->context), sizeof(RGBA_Draw_Context));
1028#ifdef EVAS_SLI
1029 evas_common_draw_context_set_sli(&(context), info->y, info->h);
1030#else
1031 evas_common_draw_context_clip_clip(&(context), info->x, info->y, info->w, info->h);
1032#endif
1033 evas_common_rectangle_draw(dst, &(context),
1034 op->op.rect.x, op->op.rect.y,
1035 op->op.rect.w, op->op.rect.h);
1036 }
1037 else
1038 {
1039 evas_common_rectangle_draw(dst, &(op->context),
1040 op->op.rect.x, op->op.rect.y,
1041 op->op.rect.w, op->op.rect.h);
1042 }
1043}
1044
1045EAPI void
1046evas_common_pipe_rectangle_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, int w, int h)
1047{
1048 RGBA_Pipe_Op *op;
1049
1050 if ((w < 1) || (h < 1)) return;
1051 dst->cache_entry.pipe = evas_common_pipe_add(dst->cache_entry.pipe, &op);
1052 if (!dst->cache_entry.pipe) return;
1053 op->op.rect.x = x;
1054 op->op.rect.y = y;
1055 op->op.rect.w = w;
1056 op->op.rect.h = h;
1057 op->op_func = evas_common_pipe_rectangle_draw_do;
1058 op->free_func = evas_common_pipe_op_free;
1059 evas_common_pipe_draw_context_copy(dc, op);
1060}
1061
1062/**************** LINE ******************/
1063static void
1064evas_common_pipe_line_draw_do(RGBA_Image *dst, RGBA_Pipe_Op *op, RGBA_Pipe_Thread_Info *info)
1065{
1066 if (info)
1067 {
1068 RGBA_Draw_Context context;
1069
1070 memcpy(&(context), &(op->context), sizeof(RGBA_Draw_Context));
1071#ifdef EVAS_SLI
1072 evas_common_draw_context_set_sli(&(context), info->y, info->h);
1073#else
1074 evas_common_draw_context_clip_clip(&(context), info->x, info->y, info->w, info->h);
1075#endif
1076 evas_common_line_draw(dst, &(context),
1077 op->op.line.x0, op->op.line.y0,
1078 op->op.line.x1, op->op.line.y1);
1079 }
1080 else
1081 {
1082 evas_common_line_draw(dst, &(op->context),
1083 op->op.line.x0, op->op.line.y0,
1084 op->op.line.x1, op->op.line.y1);
1085 }
1086}
1087
1088EAPI void
1089evas_common_pipe_line_draw(RGBA_Image *dst, RGBA_Draw_Context *dc,
1090 int x0, int y0, int x1, int y1)
1091{
1092 RGBA_Pipe_Op *op;
1093
1094 dst->cache_entry.pipe = evas_common_pipe_add(dst->cache_entry.pipe, &op);
1095 if (!dst->cache_entry.pipe) return;
1096 op->op.line.x0 = x0;
1097 op->op.line.y0 = y0;
1098 op->op.line.x1 = x1;
1099 op->op.line.y1 = y1;
1100 op->op_func = evas_common_pipe_line_draw_do;
1101 op->free_func = evas_common_pipe_op_free;
1102 evas_common_pipe_draw_context_copy(dc, op);
1103}
1104
1105/**************** POLY ******************/
1106static void
1107evas_common_pipe_op_poly_free(RGBA_Pipe_Op *op)
1108{
1109 RGBA_Polygon_Point *p;
1110
1111 while (op->op.poly.points)
1112 {
1113 p = op->op.poly.points;
1114 op->op.poly.points = (RGBA_Polygon_Point *)eina_inlist_remove(EINA_INLIST_GET(op->op.poly.points),
1115 EINA_INLIST_GET(p));
1116 free(p);
1117 }
1118 evas_common_pipe_op_free(op);
1119}
1120
1121static void
1122evas_common_pipe_poly_draw_do(RGBA_Image *dst, RGBA_Pipe_Op *op, RGBA_Pipe_Thread_Info *info)
1123{
1124 if (info)
1125 {
1126 RGBA_Draw_Context context;
1127
1128 memcpy(&(context), &(op->context), sizeof(RGBA_Draw_Context));
1129#ifdef EVAS_SLI
1130 evas_common_draw_context_set_sli(&(context), info->y, info->h);
1131#else
1132 evas_common_draw_context_clip_clip(&(context), info->x, info->y, info->w, info->h);
1133#endif
1134 evas_common_polygon_draw(dst, &(context),
1135 op->op.poly.points, 0, 0);
1136 }
1137 else
1138 {
1139 evas_common_polygon_draw(dst, &(op->context),
1140 op->op.poly.points, 0, 0);
1141 }
1142}
1143
1144EAPI void
1145evas_common_pipe_poly_draw(RGBA_Image *dst, RGBA_Draw_Context *dc,
1146 RGBA_Polygon_Point *points, int x, int y)
1147{
1148 RGBA_Pipe_Op *op;
1149 RGBA_Polygon_Point *pts = NULL, *p, *pp;
1150
1151 if (!points) return;
1152 dst->cache_entry.pipe = evas_common_pipe_add(dst->cache_entry.pipe, &op);
1153 if (!dst->cache_entry.pipe) return;
1154 /* FIXME: copy points - maybe we should refcount? */
1155 for (p = points; p; p = (RGBA_Polygon_Point *)(EINA_INLIST_GET(p))->next)
1156 {
1157 pp = calloc(1, sizeof(RGBA_Polygon_Point));
1158 if (pp)
1159 {
1160 pp->x = p->x + x;
1161 pp->y = p->y + y;
1162 pts = (RGBA_Polygon_Point *)eina_inlist_append(EINA_INLIST_GET(pts), EINA_INLIST_GET(pp));
1163 }
1164 }
1165 op->op.poly.points = pts;
1166 op->op_func = evas_common_pipe_poly_draw_do;
1167 op->free_func = evas_common_pipe_op_poly_free;
1168 evas_common_pipe_draw_context_copy(dc, op);
1169}
1170
1171/**************** TEXT ******************/
1172static void
1173evas_common_pipe_op_text_free(RGBA_Pipe_Op *op)
1174{
1175#ifdef EVAS_FRAME_QUEUING
1176 LKL(op->op.text.font->ref_fq_del);
1177 op->op.text.font->ref_fq[1]++;
1178 LKU(op->op.text.font->ref_fq_del);
1179 eina_condition_signal(&(op->op.text.font->cond_fq_del));
1180#else
1181 evas_common_font_free(op->op.text.font);
1182#endif
1183 evas_common_text_props_content_unref(&(op->op.text.intl_props));
1184 evas_common_pipe_op_free(op);
1185}
1186
1187#ifdef EVAS_FRAME_QUEUING
1188/* flush all op using @fn */
1189EAPI void
1190evas_common_pipe_op_text_flush(RGBA_Font *fn)
1191{
1192 if (! evas_common_frameq_enabled())
1193 return;
1194
1195 LKL(fn->ref_fq_add);
1196 LKL(fn->ref_fq_del);
1197
1198 while (fn->ref_fq[0] != fn->ref_fq[1])
1199 eina_condition_wait(&(fn->cond_fq_del));
1200
1201 LKU(fn->ref_fq_del);
1202 LKU(fn->ref_fq_add);
1203}
1204#endif
1205
1206static void
1207evas_common_pipe_text_draw_do(RGBA_Image *dst, RGBA_Pipe_Op *op, RGBA_Pipe_Thread_Info *info)
1208{
1209 if (info)
1210 {
1211 RGBA_Draw_Context context;
1212
1213 memcpy(&(context), &(op->context), sizeof(RGBA_Draw_Context));
1214#ifdef EVAS_SLI
1215 evas_common_draw_context_set_sli(&(context), info->y, info->h);
1216#else
1217 evas_common_draw_context_clip_clip(&(context), info->x, info->y, info->w, info->h);
1218#endif
1219 evas_common_font_draw(dst, &(context),
1220 op->op.text.font, op->op.text.x, op->op.text.y,
1221 &op->op.text.intl_props);
1222 }
1223 else
1224 {
1225 evas_common_font_draw(dst, &(op->context),
1226 op->op.text.font, op->op.text.x, op->op.text.y,
1227 &op->op.text.intl_props);
1228 }
1229}
1230
1231EAPI void
1232evas_common_pipe_text_draw(RGBA_Image *dst, RGBA_Draw_Context *dc,
1233 RGBA_Font *fn, int x, int y, const Evas_Text_Props *intl_props)
1234{
1235 RGBA_Pipe_Op *op;
1236
1237 if (!fn) return;
1238 dst->cache_entry.pipe = evas_common_pipe_add(dst->cache_entry.pipe, &op);
1239 if (!dst->cache_entry.pipe) return;
1240 op->op.text.x = x;
1241 op->op.text.y = y;
1242 evas_common_text_props_content_copy_and_ref(&(op->op.text.intl_props),
1243 intl_props);
1244#ifdef EVAS_FRAME_QUEUING
1245 LKL(fn->ref_fq_add);
1246 fn->ref_fq[0]++;
1247 LKU(fn->ref_fq_add);
1248#else
1249 fn->references++;
1250#endif
1251 op->op.text.font = fn;
1252 op->op_func = evas_common_pipe_text_draw_do;
1253 op->free_func = evas_common_pipe_op_text_free;
1254 evas_common_pipe_draw_context_copy(dc, op);
1255}
1256
1257/**************** IMAGE *****************/
1258static void
1259evas_common_pipe_op_image_free(RGBA_Pipe_Op *op)
1260{
1261#ifdef EVAS_FRAME_QUEUING
1262 LKL(op->op.image.src->cache_entry.ref_fq_del);
1263 op->op.image.src->cache_entry.ref_fq[1]++;
1264 LKU(op->op.image.src->cache_entry.ref_fq_del);
1265 eina_condition_signal(&(op->op.image.src->cache_entry.cond_fq_del));
1266#else
1267 op->op.image.src->ref--;
1268 if (op->op.image.src->ref == 0)
1269 {
1270 evas_cache_image_drop(&op->op.image.src->cache_entry);
1271 }
1272#endif
1273 evas_common_pipe_op_free(op);
1274}
1275
1276#ifdef EVAS_FRAME_QUEUING
1277EAPI void
1278evas_common_pipe_op_image_flush(RGBA_Image *im)
1279{
1280 if (! evas_common_frameq_enabled())
1281 return;
1282
1283 LKL(im->cache_entry.ref_fq_add);
1284 LKL(im->cache_entry.ref_fq_del);
1285
1286 while (im->cache_entry.ref_fq[0] != im->cache_entry.ref_fq[1])
1287 eina_condition_wait(&(im->cache_entry.cond_fq_del));
1288
1289 LKU(im->cache_entry.ref_fq_del);
1290 LKU(im->cache_entry.ref_fq_add);
1291}
1292#endif
1293
1294static void
1295evas_common_pipe_image_draw_do(RGBA_Image *dst, RGBA_Pipe_Op *op, RGBA_Pipe_Thread_Info *info)
1296{
1297 if (info)
1298 {
1299 RGBA_Draw_Context context;
1300
1301 memcpy(&(context), &(op->context), sizeof(RGBA_Draw_Context));
1302#ifdef EVAS_SLI
1303 evas_common_draw_context_set_sli(&(context), info->y, info->h);
1304#else
1305 evas_common_draw_context_clip_clip(&(context), info->x, info->y, info->w, info->h);
1306#endif
1307
1308#ifdef SCALECACHE
1309 evas_common_rgba_image_scalecache_do((Image_Entry *)(op->op.image.src),
1310 dst, &(context),
1311 op->op.image.smooth,
1312 op->op.image.sx,
1313 op->op.image.sy,
1314 op->op.image.sw,
1315 op->op.image.sh,
1316 op->op.image.dx,
1317 op->op.image.dy,
1318 op->op.image.dw,
1319 op->op.image.dh);
1320#else
1321 if (op->op.image.smooth)
1322 {
1323 evas_common_scale_rgba_in_to_out_clip_smooth(op->op.image.src,
1324 dst, &(context),
1325 op->op.image.sx,
1326 op->op.image.sy,
1327 op->op.image.sw,
1328 op->op.image.sh,
1329 op->op.image.dx,
1330 op->op.image.dy,
1331 op->op.image.dw,
1332 op->op.image.dh);
1333 }
1334 else
1335 {
1336 evas_common_scale_rgba_in_to_out_clip_sample(op->op.image.src,
1337 dst, &(context),
1338 op->op.image.sx,
1339 op->op.image.sy,
1340 op->op.image.sw,
1341 op->op.image.sh,
1342 op->op.image.dx,
1343 op->op.image.dy,
1344 op->op.image.dw,
1345 op->op.image.dh);
1346 }
1347#endif
1348 }
1349 else
1350 {
1351#ifdef SCALECACHE
1352 evas_common_rgba_image_scalecache_do((Image_Entry *)(op->op.image.src),
1353 dst, &(op->context),
1354 op->op.image.smooth,
1355 op->op.image.sx,
1356 op->op.image.sy,
1357 op->op.image.sw,
1358 op->op.image.sh,
1359 op->op.image.dx,
1360 op->op.image.dy,
1361 op->op.image.dw,
1362 op->op.image.dh);
1363#else
1364 if (op->op.image.smooth)
1365 {
1366 evas_common_scale_rgba_in_to_out_clip_smooth(op->op.image.src,
1367 dst, &(op->context),
1368 op->op.image.sx,
1369 op->op.image.sy,
1370 op->op.image.sw,
1371 op->op.image.sh,
1372 op->op.image.dx,
1373 op->op.image.dy,
1374 op->op.image.dw,
1375 op->op.image.dh);
1376 }
1377 else
1378 {
1379 evas_common_scale_rgba_in_to_out_clip_sample(op->op.image.src,
1380 dst, &(op->context),
1381 op->op.image.sx,
1382 op->op.image.sy,
1383 op->op.image.sw,
1384 op->op.image.sh,
1385 op->op.image.dx,
1386 op->op.image.dy,
1387 op->op.image.dw,
1388 op->op.image.dh);
1389 }
1390#endif
1391 }
1392}
1393
1394EAPI void
1395evas_common_pipe_image_draw(RGBA_Image *src, RGBA_Image *dst,
1396 RGBA_Draw_Context *dc, int smooth,
1397 int src_region_x, int src_region_y,
1398 int src_region_w, int src_region_h,
1399 int dst_region_x, int dst_region_y,
1400 int dst_region_w, int dst_region_h)
1401{
1402 RGBA_Pipe_Op *op;
1403
1404 if (!src) return;
1405// evas_common_pipe_flush(src);
1406 dst->cache_entry.pipe = evas_common_pipe_add(dst->cache_entry.pipe, &op);
1407 if (!dst->cache_entry.pipe) return;
1408 op->op.image.smooth = smooth;
1409 op->op.image.sx = src_region_x;
1410 op->op.image.sy = src_region_y;
1411 op->op.image.sw = src_region_w;
1412 op->op.image.sh = src_region_h;
1413 op->op.image.dx = dst_region_x;
1414 op->op.image.dy = dst_region_y;
1415 op->op.image.dw = dst_region_w;
1416 op->op.image.dh = dst_region_h;
1417#ifdef EVAS_FRAME_QUEUING
1418 LKL(src->cache_entry.ref_fq_add);
1419 src->cache_entry.ref_fq[0]++;
1420 LKU(src->cache_entry.ref_fq_add);
1421#else
1422 src->ref++;
1423#endif
1424 op->op.image.src = src;
1425 op->op_func = evas_common_pipe_image_draw_do;
1426 op->free_func = evas_common_pipe_op_image_free;
1427 evas_common_pipe_draw_context_copy(dc, op);
1428
1429#ifdef EVAS_FRAME_QUEUING
1430 /* laod every src image here.
1431 * frameq utilize all cpu cores already by worker threads
1432 * so another threads and barrier waiting can't be of any benefit.
1433 * therefore, not instantiate loader threads.
1434 */
1435 if (src->cache_entry.space == EVAS_COLORSPACE_ARGB8888)
1436 evas_cache_image_load_data(&src->cache_entry);
1437 evas_common_image_colorspace_normalize(src);
1438#else
1439 evas_common_pipe_image_load(src);
1440#endif
1441}
1442
1443static void
1444evas_common_pipe_op_map_free(RGBA_Pipe_Op *op)
1445{
1446#ifdef EVAS_FRAME_QUEUING
1447 LKL(op->op.image.src->cache_entry.ref_fq_del);
1448 op->op.image.src->cache_entry.ref_fq[1]++;
1449 LKU(op->op.image.src->cache_entry.ref_fq_del);
1450#else
1451 op->op.map.src->ref--;
1452 if (op->op.map.src->ref == 0)
1453 evas_cache_image_drop(&op->op.map.src->cache_entry);
1454#endif
1455 free(op->op.map.p);
1456 evas_common_pipe_op_free(op);
1457}
1458
1459static void
1460evas_common_pipe_map_draw_do(RGBA_Image *dst, RGBA_Pipe_Op *op, RGBA_Pipe_Thread_Info *info)
1461{
1462 if (info)
1463 {
1464 RGBA_Draw_Context context;
1465
1466 memcpy(&(context), &(op->context), sizeof(RGBA_Draw_Context));
1467#ifdef EVAS_SLI
1468 evas_common_draw_context_set_sli(&(context), info->y, info->h);
1469#else
1470 evas_common_draw_context_clip_clip(&(context), info->x, info->y, info->w, info->h);
1471#endif
1472
1473 evas_common_map_rgba(op->op.map.src, dst,
1474 &context, op->op.map.npoints, op->op.map.p,
1475 op->op.map.smooth, op->op.map.level);
1476 }
1477 else
1478 {
1479 evas_common_map_rgba(op->op.map.src, dst,
1480 &(op->context), op->op.map.npoints, op->op.map.p,
1481 op->op.map.smooth, op->op.map.level);
1482 }
1483}
1484
1485EAPI void
1486evas_common_pipe_map_draw(RGBA_Image *src, RGBA_Image *dst,
1487 RGBA_Draw_Context *dc, int npoints, RGBA_Map_Point *p,
1488 int smooth, int level)
1489{
1490 RGBA_Pipe_Op *op;
1491 RGBA_Map_Point *pts_copy;
1492 int i;
1493
1494 if (!src) return;
1495 pts_copy = malloc(sizeof (RGBA_Map_Point) * 4);
1496 if (!pts_copy) return;
1497 dst->cache_entry.pipe = evas_common_pipe_add(dst->cache_entry.pipe, &op);
1498 if (!dst->cache_entry.pipe)
1499 {
1500 free(pts_copy);
1501 return;
1502 }
1503
1504 for (i = 0; i < 4; ++i)
1505 pts_copy[i] = p[i];
1506
1507 op->op.map.npoints = npoints;
1508 op->op.map.smooth = smooth;
1509 op->op.map.level = level;
1510#ifdef EVAS_FRAME_QUEUING
1511 LKL(src->cache_entry.ref_fq_add);
1512 src->cache_entry.ref_fq[0]++;
1513 LKU(src->cache_entry.ref_fq_add);
1514#else
1515 src->ref++;
1516#endif
1517 op->op.map.src = src;
1518 op->op.map.p = pts_copy;
1519 op->op_func = evas_common_pipe_map_draw_do;
1520 op->free_func = evas_common_pipe_op_map_free;
1521 evas_common_pipe_draw_context_copy(dc, op);
1522
1523#ifdef EVAS_FRAME_QUEUING
1524 /* laod every src image here.
1525 * frameq utilize all cpu cores already by worker threads
1526 * so another threads and barrier waiting can't be of any benefit.
1527 * therefore, not instantiate loader threads.
1528 */
1529 if (src->cache_entry.space == EVAS_COLORSPACE_ARGB8888)
1530 evas_cache_image_load_data(&src->cache_entry);
1531 evas_common_image_colorspace_normalize(src);
1532#else
1533 evas_common_pipe_image_load(src);
1534#endif
1535}
1536
1537static void
1538evas_common_pipe_map_render(RGBA_Image *root)
1539{
1540 RGBA_Pipe *p;
1541 int i;
1542
1543 /* Map imply that we need to process them recursively first. */
1544 for (p = root->cache_entry.pipe; p; p = (RGBA_Pipe *)(EINA_INLIST_GET(p))->next)
1545 {
1546 for (i = 0; i < p->op_num; i++)
1547 {
1548 if (p->op[i].op_func == evas_common_pipe_map_draw_do)
1549 {
1550 if (p->op[i].op.map.src->cache_entry.pipe)
1551 evas_common_pipe_map_render(p->op[i].op.map.src);
1552 }
1553 else if (p->op[i].op_func == evas_common_pipe_image_draw_do)
1554 {
1555 if (p->op[i].op.image.src->cache_entry.pipe)
1556 evas_common_pipe_map_render(p->op[i].op.image.src);
1557 }
1558 }
1559 }
1560
1561 evas_common_pipe_begin(root);
1562 evas_common_pipe_flush(root);
1563}
1564
1565#ifdef BUILD_PTHREAD
1566static Eina_List *task = NULL;
1567static Thinfo task_thinfo[TH_MAX];
1568static pthread_barrier_t task_thbarrier[2];
1569static LK(task_mutext);
1570#endif
1571
1572#ifdef BUILD_PTHREAD
1573static void*
1574evas_common_pipe_load(void *data)
1575{
1576 Thinfo *tinfo;
1577
1578 tinfo = data;
1579 for (;;)
1580 {
1581 /* wait for start signal */
1582 pthread_barrier_wait(&(tinfo->barrier[0]));
1583
1584 while (task)
1585 {
1586 RGBA_Image *im = NULL;
1587
1588 LKL(task_mutext);
1589 im = eina_list_data_get(task);
1590 task = eina_list_remove_list(task, task);
1591 LKU(task_mutext);
1592
1593 if (im)
1594 {
1595 if (im->cache_entry.space == EVAS_COLORSPACE_ARGB8888)
1596 evas_cache_image_load_data(&im->cache_entry);
1597 evas_common_image_colorspace_normalize(im);
1598
1599 im->flags &= ~RGBA_IMAGE_TODO_LOAD;
1600 }
1601 }
1602
1603 /* send finished signal */
1604 pthread_barrier_wait(&(tinfo->barrier[1]));
1605 }
1606
1607 return NULL;
1608}
1609#endif
1610
1611static volatile int bval = 0;
1612
1613static void
1614evas_common_pipe_image_load_do(void)
1615{
1616#ifdef BUILD_PTHREAD
1617 /* Notify worker thread. */
1618 pthread_barrier_wait(&(task_thbarrier[0]));
1619
1620 /* sync worker threads */
1621 pthread_barrier_wait(&(task_thbarrier[1]));
1622#endif
1623}
1624
1625static Eina_Bool
1626evas_common_pipe_init(void)
1627{
1628#ifdef BUILD_PTHREAD
1629 if (thread_num == 0)
1630 {
1631 int cpunum;
1632 int i;
1633
1634 cpunum = eina_cpu_count();
1635 thread_num = cpunum;
1636// on single cpu we still want this initted.. otherwise we block forever
1637// waiting onm pthread barriers for async rendering on a single core!
1638// if (thread_num == 1) return EINA_FALSE;
1639
1640 eina_threads_init();
1641
1642 LKI(task_mutext);
1643
1644 pthread_barrier_init(&(thbarrier[0]), NULL, thread_num + 1);
1645 pthread_barrier_init(&(thbarrier[1]), NULL, thread_num + 1);
1646 for (i = 0; i < thread_num; i++)
1647 {
1648 pthread_attr_t attr;
1649 cpu_set_t cpu;
1650
1651 pthread_attr_init(&attr);
1652 CPU_ZERO(&cpu);
1653 CPU_SET(i % cpunum, &cpu);
1654 pthread_attr_setaffinity_np(&attr, sizeof(cpu), &cpu);
1655 thinfo[i].thread_num = i;
1656 thinfo[i].info = NULL;
1657 thinfo[i].barrier = thbarrier;
1658 /* setup initial locks */
1659 pthread_create(&(thinfo[i].thread_id), &attr,
1660 evas_common_pipe_thread, &(thinfo[i]));
1661 pthread_attr_destroy(&attr);
1662 }
1663
1664 pthread_barrier_init(&(task_thbarrier[0]), NULL, thread_num + 1);
1665 pthread_barrier_init(&(task_thbarrier[1]), NULL, thread_num + 1);
1666 for (i = 0; i < thread_num; i++)
1667 {
1668 pthread_attr_t attr;
1669 cpu_set_t cpu;
1670
1671 pthread_attr_init(&attr);
1672 CPU_ZERO(&cpu);
1673 CPU_SET(i % cpunum, &cpu);
1674 pthread_attr_setaffinity_np(&attr, sizeof(cpu), &cpu);
1675 task_thinfo[i].thread_num = i;
1676 task_thinfo[i].info = NULL;
1677 task_thinfo[i].barrier = task_thbarrier;
1678 /* setup initial locks */
1679 pthread_create(&(task_thinfo[i].thread_id), &attr,
1680 evas_common_pipe_load, &(task_thinfo[i]));
1681 pthread_attr_destroy(&attr);
1682 }
1683 }
1684
1685 if (thread_num == 1) return EINA_FALSE;
1686 return EINA_TRUE;
1687#endif
1688 return EINA_FALSE;
1689}
1690
1691EAPI void
1692evas_common_pipe_image_load(RGBA_Image *im)
1693{
1694 if (im->flags & RGBA_IMAGE_TODO_LOAD)
1695 return ;
1696
1697 if (im->cache_entry.space == EVAS_COLORSPACE_ARGB8888
1698 && !evas_cache_image_is_loaded(&(im->cache_entry)))
1699 goto add_task;
1700
1701 if ((!im->cs.data) || ((!im->cs.dirty) && (!(im->flags & RGBA_IMAGE_IS_DIRTY))))
1702 goto add_task;
1703
1704 return ;
1705
1706 add_task:
1707 task = eina_list_append(task, im);
1708 im->flags |= RGBA_IMAGE_TODO_LOAD;
1709}
1710
1711EAPI void
1712evas_common_pipe_map_begin(RGBA_Image *root)
1713{
1714 if (!evas_common_pipe_init())
1715 {
1716 RGBA_Image *im;
1717
1718 EINA_LIST_FREE(task, im)
1719 {
1720 if (im->cache_entry.space == EVAS_COLORSPACE_ARGB8888)
1721 evas_cache_image_load_data(&im->cache_entry);
1722 evas_common_image_colorspace_normalize(im);
1723
1724 im->flags &= ~RGBA_IMAGE_TODO_LOAD;
1725 }
1726 }
1727
1728 evas_common_pipe_image_load_do();
1729
1730 evas_common_pipe_map_render(root);
1731}
1732
1733#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_pipe.h b/libraries/evas/src/lib/engines/common/evas_pipe.h
new file mode 100644
index 0000000..37b0136
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_pipe.h
@@ -0,0 +1,111 @@
1#ifndef _EVAS_PIPE_H
2#define _EVAS_PIPE_H
3
4#include <sys/time.h>
5#include "language/evas_bidi_utils.h"
6
7#ifdef BUILD_PTHREAD
8typedef struct _Thinfo
9{
10 int thread_num;
11 pthread_t thread_id;
12 pthread_barrier_t *barrier;
13 RGBA_Pipe_Thread_Info *info;
14# ifdef EVAS_FRAME_QUEUING
15 void *fq_info;
16#endif
17} Thinfo;
18#endif
19
20#ifdef EVAS_FRAME_QUEUING
21struct _Evas_Surface
22{
23 EINA_INLIST;
24 RGBA_Image *im;
25 int x, y, w, h;
26 int dontpush; // dont push the surface out after drawing done
27};
28typedef struct _Evas_Surface Evas_Surface;
29
30struct _Evas_Frame
31{
32 EINA_INLIST;
33 Evas_Surface *surfaces;
34 void *data;
35 int in_process;
36 int ready;
37 int dont_schedule;
38 struct timeval ready_time;
39
40 void (*output_redraws_next_update_push) (void *data, void *surface, int x, int y, int w, int h);
41 void (*output_flush) (void *data);
42 void (*output_set_priv)(void *data, void *cur, void *prev);
43};
44typedef struct _Evas_Frame Evas_Frame;
45
46
47struct _Evas_FrameQ
48{
49 int initialised;
50 Evas_Frame *frames;
51 Eina_Condition cond_new;
52 Eina_Condition cond_ready;
53 Eina_Condition cond_done;
54 LK(mutex);
55
56 int thread_num;
57 Thinfo thinfo[TH_MAX];
58 int frameq_sz;
59
60 Evas_Frame *cur_frame;
61};
62typedef struct _Evas_FrameQ Evas_FrameQ;
63#define FRAMEQ_SZ_PER_THREAD 2
64
65struct _Evas_Frameq_Thread_Info
66{
67 Evas_FrameQ *frameq;
68};
69typedef struct _Evas_Frameq_Thread_Info Evas_Frameq_Thread_Info;
70
71EAPI Evas_Surface *evas_common_frameq_new_surface(void *surface, int x, int y, int w, int h);
72EAPI void evas_common_frameq_add_surface(Evas_Surface *surface);
73EAPI void evas_common_frameq_set_frame_data(void *data,
74 void (*fn_output_redraws_next_update_push) (void *data, void *surface, int x, int y, int w, int h),
75 void (*fn_output_flush) (void *data),
76 void (*fn_output_set_priv)(void *data, void *cur, void *prev));
77EAPI void evas_common_frameq_prepare_frame(void);
78EAPI void evas_common_frameq_ready_frame(void);
79EAPI void evas_common_frameq_init(void);
80EAPI void evas_common_frameq_destroy(void);
81EAPI void evas_common_frameq_flush(void);
82EAPI void evas_common_frameq_flush_ready(void);
83EAPI int evas_common_frameq_get_frameq_sz(void);
84EAPI int evas_common_frameq_enabled(void);
85EAPI void evas_common_frameq_begin(void);
86EAPI void evas_common_frameq_finish(void);
87#endif
88
89/* image rendering pipelines... new optional system - non-immediate and
90 * threadable
91 */
92
93EAPI void evas_common_pipe_free(RGBA_Image *im);
94EAPI void evas_common_pipe_rectangle_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, int w, int h);
95EAPI void evas_common_pipe_line_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, int x1, int y1);
96EAPI void evas_common_pipe_poly_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Polygon_Point *points, int x, int y);
97EAPI void evas_common_pipe_text_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Font *fn, int x, int y, const Evas_Text_Props *intl_props);
98EAPI void evas_common_pipe_image_load(RGBA_Image *im);
99EAPI void evas_common_pipe_image_draw(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, int smooth, 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);
100EAPI void evas_common_pipe_map_begin(RGBA_Image *root);
101EAPI void evas_common_pipe_map_draw(RGBA_Image *src, RGBA_Image *dst,
102 RGBA_Draw_Context *dc, int npoints, RGBA_Map_Point *p,
103 int smooth, int level);
104EAPI void evas_common_pipe_flush(RGBA_Image *im);
105
106#ifdef EVAS_FRAME_QUEUING
107EAPI void evas_common_pipe_op_text_flush(RGBA_Font *fn);
108EAPI void evas_common_pipe_op_image_flush(RGBA_Image *im);
109#endif
110
111#endif /* _EVAS_PIPE_H */
diff --git a/libraries/evas/src/lib/engines/common/evas_polygon.h b/libraries/evas/src/lib/engines/common/evas_polygon.h
new file mode 100644
index 0000000..0695f54
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_polygon.h
@@ -0,0 +1,13 @@
1#ifndef _EVAS_POLYGON_H
2#define _EVAS_POLYGON_H
3
4
5EAPI void evas_common_polygon_init (void);
6
7EAPI RGBA_Polygon_Point *evas_common_polygon_point_add (RGBA_Polygon_Point *points, int x, int y);
8EAPI RGBA_Polygon_Point *evas_common_polygon_points_clear (RGBA_Polygon_Point *points);
9EAPI void evas_common_polygon_draw (RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Polygon_Point *points, int x, int y);
10
11
12#endif /* _EVAS_POLYGON_H */
13
diff --git a/libraries/evas/src/lib/engines/common/evas_polygon_main.c b/libraries/evas/src/lib/engines/common/evas_polygon_main.c
new file mode 100644
index 0000000..bca3f83
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_polygon_main.c
@@ -0,0 +1,293 @@
1#include <math.h>
2
3#include "evas_common.h"
4#include "evas_blend_private.h"
5
6typedef struct _RGBA_Span RGBA_Span;
7typedef struct _RGBA_Edge RGBA_Edge;
8typedef struct _RGBA_Vertex RGBA_Vertex;
9
10struct _RGBA_Span
11{
12 EINA_INLIST;
13 int x, y, w;
14};
15
16struct _RGBA_Edge
17{
18 double x, dx;
19 int i;
20};
21
22struct _RGBA_Vertex
23{
24 double x, y;
25 int i;
26};
27
28#define POLY_EDGE_DEL(_i) \
29{ \
30 int _j; \
31 \
32 for (_j = 0; (_j < num_active_edges) && (edges[_j].i != _i); _j++); \
33 if (_j < num_active_edges) \
34 { \
35 num_active_edges--; \
36 memmove(&(edges[_j]), &(edges[_j + 1]), \
37 (num_active_edges - _j) * sizeof(RGBA_Edge)); \
38 } \
39}
40
41#define POLY_EDGE_ADD(_i, _y) \
42{ \
43 int _j; \
44 float _dx; \
45 RGBA_Vertex *_p, *_q; \
46 if (_i < (n - 1)) _j = _i + 1; \
47 else _j = 0; \
48 if (point[_i].y < point[_j].y) \
49 { \
50 _p = &(point[_i]); \
51 _q = &(point[_j]); \
52 } \
53 else \
54 { \
55 _p = &(point[_j]); \
56 _q = &(point[_i]); \
57 } \
58 edges[num_active_edges].dx = _dx = (_q->x - _p->x) / (_q->y - _p->y); \
59 edges[num_active_edges].x = (_dx * ((float)_y + 0.5 - _p->y)) + _p->x; \
60 edges[num_active_edges].i = _i; \
61 num_active_edges++; \
62}
63
64EAPI void
65evas_common_polygon_init(void)
66{
67}
68
69EAPI RGBA_Polygon_Point *
70evas_common_polygon_point_add(RGBA_Polygon_Point *points, int x, int y)
71{
72 RGBA_Polygon_Point *pt;
73
74 pt = malloc(sizeof(RGBA_Polygon_Point));
75 if (!pt) return points;
76 pt->x = x;
77 pt->y = y;
78 points = (RGBA_Polygon_Point *)eina_inlist_append(EINA_INLIST_GET(points), EINA_INLIST_GET(pt));
79 return points;
80}
81
82EAPI RGBA_Polygon_Point *
83evas_common_polygon_points_clear(RGBA_Polygon_Point *points)
84{
85 if (points)
86 {
87 while (points)
88 {
89 RGBA_Polygon_Point *old_p;
90
91 old_p = points;
92 points = (RGBA_Polygon_Point *)eina_inlist_remove(EINA_INLIST_GET(points), EINA_INLIST_GET(points));
93 free(old_p);
94 }
95 }
96 return NULL;
97}
98
99static int
100polygon_point_sorter(const void *a, const void *b)
101{
102 RGBA_Vertex *p, *q;
103
104 p = (RGBA_Vertex *)a;
105 q = (RGBA_Vertex *)b;
106 if (p->y <= q->y) return -1;
107 return 1;
108}
109
110static int
111polygon_edge_sorter(const void *a, const void *b)
112{
113 RGBA_Edge *p, *q;
114
115 p = (RGBA_Edge *)a;
116 q = (RGBA_Edge *)b;
117 if (p->x <= q->x) return -1;
118 return 1;
119}
120
121EAPI void
122evas_common_polygon_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Polygon_Point *points, int x, int y)
123{
124 RGBA_Gfx_Func func;
125 RGBA_Polygon_Point *pt;
126 RGBA_Vertex *point;
127 RGBA_Edge *edges;
128 Eina_Inlist *spans;
129 int num_active_edges;
130 int n;
131 int i, j, k;
132 int y0, y1, yi;
133 int ext_x, ext_y, ext_w, ext_h;
134 int *sorted_index;
135
136 ext_x = 0;
137 ext_y = 0;
138 ext_w = dst->cache_entry.w;
139 ext_h = dst->cache_entry.h;
140 if (dc->clip.use)
141 {
142 if (dc->clip.x > ext_x)
143 {
144 ext_w += ext_x - dc->clip.x;
145 ext_x = dc->clip.x;
146 }
147 if ((ext_x + ext_w) > (dc->clip.x + dc->clip.w))
148 {
149 ext_w = (dc->clip.x + dc->clip.w) - ext_x;
150 }
151 if (dc->clip.y > ext_y)
152 {
153 ext_h += ext_y - dc->clip.y;
154 ext_y = dc->clip.y;
155 }
156 if ((ext_y + ext_h) > (dc->clip.y + dc->clip.h))
157 {
158 ext_h = (dc->clip.y + dc->clip.h) - ext_y;
159 }
160 }
161 if ((ext_w <= 0) || (ext_h <= 0)) return;
162
163 evas_common_cpu_end_opt();
164
165 n = 0; EINA_INLIST_FOREACH(points, pt) n++;
166 if (n < 3) return;
167 edges = malloc(sizeof(RGBA_Edge) * n);
168 if (!edges) return;
169 point = malloc(sizeof(RGBA_Vertex) * n);
170 if (!point)
171 {
172 free(edges);
173 return;
174 }
175 sorted_index = malloc(sizeof(int) * n);
176 if (!sorted_index)
177 {
178 free(edges);
179 free(point);
180 return;
181 }
182
183 k = 0;
184 EINA_INLIST_FOREACH(points, pt)
185 {
186 point[k].x = pt->x + x;
187 point[k].y = pt->y + y;
188 point[k].i = k;
189 k++;
190 }
191 qsort(point, n, sizeof(RGBA_Vertex), polygon_point_sorter);
192 for (k = 0; k < n; k++) sorted_index[k] = point[k].i;
193 k = 0;
194 EINA_INLIST_FOREACH(points, pt)
195 {
196 point[k].x = pt->x + x;
197 point[k].y = pt->y + y;
198 point[k].i = k;
199 k++;
200 }
201
202 y0 = MAX(ext_y, ceil(point[sorted_index[0]].y - 0.5));
203 y1 = MIN(ext_y + ext_h - 1, floor(point[sorted_index[n - 1]].y - 0.5));
204
205 k = 0;
206 num_active_edges = 0;
207 spans = NULL;
208
209 for (yi = y0; yi <= y1; yi++)
210 {
211 for (; (k < n) && (point[sorted_index[k]].y <= ((double)yi + 0.5)); k++)
212 {
213 i = sorted_index[k];
214
215 if (i > 0) j = i - 1;
216 else j = n - 1;
217 if (point[j].y <= ((double)yi - 0.5))
218 {
219 POLY_EDGE_DEL(j)
220 }
221 else if (point[j].y > ((double)yi + 0.5))
222 {
223 POLY_EDGE_ADD(j, yi)
224 }
225 if (i < (n - 1)) j = i + 1;
226 else j = 0;
227 if (point[j].y <= ((double)yi - 0.5))
228 {
229 POLY_EDGE_DEL(i)
230 }
231 else if (point[j].y > ((double)yi + 0.5))
232 {
233 POLY_EDGE_ADD(i, yi)
234 }
235 }
236
237 qsort(edges, num_active_edges, sizeof(RGBA_Edge), polygon_edge_sorter);
238
239 for (j = 0; j < num_active_edges; j += 2)
240 {
241 int x0, x1;
242
243 x0 = ceil(edges[j].x - 0.5);
244 if (j < (num_active_edges - 1))
245 x1 = floor(edges[j + 1].x - 0.5);
246 else
247 x1 = x0;
248 if ((x1 >= ext_x) && (x0 < (ext_x + ext_w)) && (x0 <= x1))
249 {
250 RGBA_Span *span;
251
252 if (x0 < ext_x) x0 = ext_x;
253 if (x1 >= (ext_x + ext_w)) x1 = ext_x + ext_w - 1;
254 span = malloc(sizeof(RGBA_Span));
255 spans = eina_inlist_append(spans, EINA_INLIST_GET(span));
256 span->y = yi;
257 span->x = x0;
258 span->w = (x1 - x0) + 1;
259 }
260 edges[j].x += edges[j].dx;
261 edges[j + 1].x += edges[j + 1].dx;
262 }
263 }
264
265 free(edges);
266 free(point);
267 free(sorted_index);
268
269 func = evas_common_gfx_func_composite_color_span_get(dc->col.col, dst, 1, dc->render_op);
270 if (spans)
271 {
272 RGBA_Span *span;
273
274 EINA_INLIST_FOREACH(spans, span)
275 {
276 DATA32 *ptr;
277
278#ifdef EVAS_SLI
279 if (((span->y) % dc->sli.h) == dc->sli.y)
280#endif
281 {
282 ptr = dst->image.data + (span->y * (dst->cache_entry.w)) + span->x;
283 func(NULL, NULL, dc->col.col, ptr, span->w);
284 }
285 }
286 while (spans)
287 {
288 span = (RGBA_Span *)spans;
289 spans = eina_inlist_remove(spans, spans);
290 free(span);
291 }
292 }
293}
diff --git a/libraries/evas/src/lib/engines/common/evas_rectangle.h b/libraries/evas/src/lib/engines/common/evas_rectangle.h
new file mode 100644
index 0000000..a653b04
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_rectangle.h
@@ -0,0 +1,11 @@
1#ifndef _EVAS_RECTANGLE_H
2#define _EVAS_RECTANGLE_H
3
4
5EAPI void evas_common_rectangle_init (void);
6
7EAPI void evas_common_rectangle_draw (RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, int w, int h);
8
9
10#endif /* _EVAS_RECTANGLE_H */
11
diff --git a/libraries/evas/src/lib/engines/common/evas_rectangle_main.c b/libraries/evas/src/lib/engines/common/evas_rectangle_main.c
new file mode 100644
index 0000000..28aaf16
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_rectangle_main.c
@@ -0,0 +1,73 @@
1#include "evas_common.h"
2#include "evas_blend_private.h"
3
4static void rectangle_draw_internal(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, int w, int h);
5
6EAPI void
7evas_common_rectangle_init(void)
8{
9}
10
11EAPI void
12evas_common_rectangle_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, int w, int h)
13{
14 Cutout_Rects *rects;
15 Cutout_Rect *r;
16 int c, cx, cy, cw, ch;
17 int i;
18 /* handle cutouts here! */
19
20 if ((w <= 0) || (h <= 0)) return;
21 if (!(RECTS_INTERSECT(x, y, w, h, 0, 0, dst->cache_entry.w, dst->cache_entry.h)))
22 return;
23 /* save out clip info */
24 c = dc->clip.use; cx = dc->clip.x; cy = dc->clip.y; cw = dc->clip.w; ch = dc->clip.h;
25 evas_common_draw_context_clip_clip(dc, 0, 0, dst->cache_entry.w, dst->cache_entry.h);
26 /* no cutouts - cut right to the chase */
27 if (!dc->cutout.rects)
28 {
29 rectangle_draw_internal(dst, dc, x, y, w, h);
30 }
31 else
32 {
33 evas_common_draw_context_clip_clip(dc, x, y, w, h);
34 /* our clip is 0 size.. abort */
35 if ((dc->clip.w > 0) && (dc->clip.h > 0))
36 {
37 rects = evas_common_draw_context_apply_cutouts(dc);
38 for (i = 0; i < rects->active; ++i)
39 {
40 r = rects->rects + i;
41 evas_common_draw_context_set_clip(dc, r->x, r->y, r->w, r->h);
42 rectangle_draw_internal(dst, dc, x, y, w, h);
43 }
44 evas_common_draw_context_apply_clear_cutouts(rects);
45 }
46 }
47 /* restore clip info */
48 dc->clip.use = c; dc->clip.x = cx; dc->clip.y = cy; dc->clip.w = cw; dc->clip.h = ch;
49}
50
51static void
52rectangle_draw_internal(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, int w, int h)
53{
54 RGBA_Gfx_Func func;
55 int yy;
56 DATA32 *ptr;
57
58 RECTS_CLIP_TO_RECT(x, y, w, h, dc->clip.x, dc->clip.y, dc->clip.w, dc->clip.h);
59 if ((w <= 0) || (h <= 0)) return;
60
61 func = evas_common_gfx_func_composite_color_span_get(dc->col.col, dst, w, dc->render_op);
62 ptr = dst->image.data + (y * dst->cache_entry.w) + x;
63 for (yy = 0; yy < h; yy++)
64 {
65#ifdef EVAS_SLI
66 if (((yy + y) % dc->sli.h) == dc->sli.y)
67#endif
68 {
69 func(NULL, NULL, dc->col.col, ptr, w);
70 }
71 ptr += dst->cache_entry.w;
72 }
73}
diff --git a/libraries/evas/src/lib/engines/common/evas_regionbuf.c b/libraries/evas/src/lib/engines/common/evas_regionbuf.c
new file mode 100644
index 0000000..f381da5
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_regionbuf.c
@@ -0,0 +1,357 @@
1#include "evas_common.h"
2
3#if 0
4Regionbuf *
5evas_common_regionbuf_new(int w, int h)
6{
7 Regionbuf *rb;
8
9 rb = calloc(1, sizeof(Regionbuf) + (h * sizeof(Regionspan)));
10 if (!rb) return NULL;
11 rb->spans = (Regionspan **)(rb + sizeof(Regionbuf));
12 rb->w = w;
13 rb->h = h;
14 return rb;
15}
16
17void
18evas_common_regionbuf_free(Regionbuf *rb)
19{
20 evas_common_regionbuf_clear(rb);
21 free(rb);
22}
23
24void
25evas_common_regionbuf_clear(Regionbuf *rb)
26{
27 int y;
28
29 for (y = 0; y < rb->h; y++)
30 {
31 while (rb->spans[y])
32 {
33 Regionspan *span;
34
35 span = rb->spans[y];
36 rb->spans[y] = eina_inlist_remove(rb->spans[y], rb->spans[y]);
37 free(span);
38 }
39 }
40}
41
42void
43evas_common_regionbuf_span_add(Regionbuf *rb, int x1, int x2, int y)
44{
45 Regionspan *span, *span2, *nspan, *sp_start, *sp_stop;
46
47 /* abort if outside */
48 if ((y < 0) ||
49 (y >= rb->h) ||
50 (x2 < 0) ||
51 (x1 >= rb->w)) return;
52 /* clip to horiz bounds */
53 if (x1 < 0) x1 = 0;
54 if (x2 < (rb->w - 1)) x2 = rb->w - 1;
55 sp_start = NULL;
56 sp_stop = NULL;
57 EINA_INLIST_FOREACH(rb->spans[y], span)
58 {
59 nspan = (Regionspan *)(EINA_INLIST_GET(span))->next;
60 /* we dont know what t do with the span yet */
61 if (!sp_start)
62 {
63 /* if new span starts before or on this span or just after
64 * with no gap */
65 if (x1 <= (span->x2 + 1))
66 sp_start = span;
67 /* if there is no next span */
68 if (!nspan)
69 {
70 sp_stop = span;
71 break;
72 }
73 /* if new span ends before the next span starts with a gap of
74 * 1 pixel (or more) */
75 else if (x2 < (nspan->x1 - 1))
76 {
77 sp_stop = span;
78 break;
79 }
80 }
81 /* we already know it already starts before or in sp_start */
82 else
83 {
84 /* there is no span after this one, so this has to be the stop */
85 if (!nspan)
86 {
87 sp_stop = span;
88 break;
89 }
90 /* if new span ends before the next span starts with a gap of
91 * 1 pixel (or more) */
92 else if (x2 < (nspan->x1 - 1))
93 {
94 sp_stop = span;
95 break;
96 }
97 }
98 }
99 /* sp_start is where the new span starts in or before */
100 /* sp_stop is where the new span stops in or after */
101 if ((sp_start) && (sp_stop))
102 {
103 /* same start and stop */
104 if (sp_start == sp_stop)
105 {
106 if (x2 < (sp_start->x1 - 1))
107 {
108 span2 = calloc(1, sizeof(Regionspan));
109 span2->x1 = x1;
110 span2->x2 = x2;
111 rb->spans[y] = eina_inlist_prepend_relative(rb->spans[y], span2, sp_start);
112 return;
113 }
114 if (x1 < sp_start->x1)
115 sp_start->x1 = x1;
116 if (x2 > sp_start->x2)
117 sp_start->x2 = x2;
118 return;
119 }
120 else
121 {
122 Eina_Inlist *l;
123
124 /* remove all nodes after sp_start and before_sp_stop because
125 * the new */
126 for (l = (EINA_INLIST_GET(sp_start))->next; l != EINA_INLIST_GET(sp_stop);)
127 {
128 span = (Regionspan *)l;
129 l = l->next;
130 rb->spans[y] = eina_inlist_remove(rb->spans[y], span);
131 free(span);
132 }
133 /* remove the end span */
134 rb->spans[y] = eina_inlist_remove(rb->spans[y], sp_stop);
135 /* if the new span is before the start span - extend */
136 if (x1 < sp_start->x1)
137 sp_start->x1 = x1;
138 /* if it goes beyond the stop span - extend stop span */
139 if (x2 > sp_stop->x2)
140 sp_stop->x2 = x2;
141 /* extend start span to stop span */
142 sp_start->x2 = sp_stop->x2;
143 /* don't need stop span anymore */
144 free(sp_stop);
145 return;
146 }
147 }
148 /* no start AND stop... just append */
149 span2 = calloc(1, sizeof(Regionspan));
150 span2->x1 = x1;
151 span2->x2 = x2;
152 rb->spans[y] = eina_inlist_append(rb->spans[y], span2);
153}
154
155void
156evas_common_regionbuf_span_del(Regionbuf *rb, int x1, int x2, int y)
157{
158 /* FIXME: del span */
159 Regionspan *span, *span2, *nspan, *sp_start, *sp_stop;
160
161 /* abort if outside */
162 if ((y < 0) ||
163 (y >= rb->h) ||
164 (x2 < 0) ||
165 (x1 >= rb->w)) return;
166 /* clip to horiz bounds */
167 if (x1 < 0) x1 = 0;
168 if (x2 < (rb->w - 1)) x2 = rb->w - 1;
169 sp_start = NULL;
170 sp_stop = NULL;
171 EINA_INLIST_FOREACH(rb->spans[y], span)
172 {
173 nspan = (Regionspan *)(EINA_INLIST_GET(l))->next;
174 /* we dont know what t do with the span yet */
175 if (!sp_start)
176 {
177 /* if new span starts before or on this span or just after
178 * with no gap */
179 if (x1 <= (span->x2))
180 sp_start = span;
181 /* if there is no next span */
182 if (!nspan)
183 {
184 sp_stop = span;
185 break;
186 }
187 /* if new span ends before the next span starts with a gap of
188 * 1 pixel (or more) */
189 else if (x2 < nspan->x1)
190 {
191 sp_stop = span;
192 break;
193 }
194 }
195 /* we already know it already starts before or in sp_start */
196 else
197 {
198 /* there is no span after this one, so this has to be the stop */
199 if (!nspan)
200 {
201 sp_stop = span;
202 break;
203 }
204 /* if new span ends before the next span starts with a gap of
205 * 1 pixel (or more) */
206 else if (x2 < nspan->x1)
207 {
208 sp_stop = span;
209 break;
210 }
211 }
212 }
213 /* sp_start is where the new span starts in or before */
214 /* sp_stop is where the new span stops in or after */
215 if ((sp_start) && (sp_stop))
216 {
217 /* same start and stop */
218 if (sp_start == sp_stop)
219 {
220 /* if it ends before this the span start starts... return */
221 if (x2 < sp_start->x1)
222 return;
223 /* it starts on or before this span */
224 else if (x1 <= sp_start->x1)
225 {
226 /* right edge is within the span */
227 if (x2 < sp_start->x2)
228 {
229 sp_start->x2 = x2;
230 return;
231 }
232 else
233 {
234 rb->spans[y] = eina_inlist_remove(rb->spans[y], sp_start);
235 return;
236 }
237 }
238 /* it ends on or after the end of this span */
239 else if (x2 >= sp_start->x2)
240 {
241 /* it starts after the start */
242 if (x1 > sp_start->x1)
243 {
244 sp_start->x1 = x1;
245 return;
246 }
247 /* remove it all */
248 else
249 {
250 rb->spans[y] = eina_inlist_remove(rb->spans[y], sp_start);
251 return;
252 }
253 return;
254 }
255 /* this breaks the span into 2 */
256 else
257 {
258 span2 = calloc(1, sizeof(Regionspan));
259 span2->x1 = sp_start->x1;
260 span2->x2 = x1 - 1;
261 rb->spans[y] = eina_inlist_prepend_relative(rb->spans[y], span2, sp_start);
262 sp_start->x1 = x2 + 1;
263 return;
264 }
265 }
266 else
267 {
268 Eina_Inlist *l;
269
270 /* remove all nodes after sp_start and before_sp_stop because
271 * the new */
272 for (l = (EINA_INLIST_GET(sp_start))->next; l != EINA_INLIST_GET(sp_stop);)
273 {
274 span = (Regionspan *)l;
275 l = l->next;
276 rb->spans[y] = eina_inlist_remove(rb->spans[y], span);
277 free(span);
278 }
279 /* all of the start span is cut out */
280 if (x1 <= sp_start->x1)
281 {
282 rb->spans[y] = eina_inlist_remove(rb->spans[y], sp_start);
283 free(sp_start);
284 }
285 /* chup it off at the new span start */
286 else
287 sp_start->x2 = x1 - 1;
288 /* all of the end span is cut out */
289 if (x2 >= sp_stop->x2)
290 {
291 rb->spans[y] = eina_inlist_remove(rb->spans[y], sp_stop);
292 free(sp_stop);
293 }
294 /* chop it up at the end */
295 else
296 sp_stop->x1 = x2 + 1;
297 return;
298 }
299 }
300}
301
302Tilebuf_Rect *
303evas_common_regionbuf_rects_get(Regionbuf *rb)
304{
305 Tilebuf_Rect *rects = NULL, *r;
306 int y;
307
308 /* FIXME: take spans, make rects */
309 for (y = 0; y < rb->h; y++)
310 {
311 Regionspan *sp_start;
312 Eina_Inlist *l, *ll;
313
314 for (l = EINA_INLIST_GET(rb->spans[y]); l;)
315 {
316 Regionspan *span;
317 int yy;
318
319 sp_start = (Regionspan *)l;
320 l = l->next;
321 rb->spans[y] = eina_inlist_remove(rb->spans[y], sp_start);
322 for (yy = y + 1; yy < rb->h; yy++)
323 {
324 int match = 0;
325
326 for (ll = EINA_INLIST_GET(rb->spans[yy]); ll;)
327 {
328 span = (Regionspan *)ll;
329 ll = ll->next;
330 if (span->x1 == sp_start->x1)
331 {
332 if ((span->x1 != sp_start->x1) ||
333 (span->x2 != sp_start->x2))
334 {
335 goto coallate;
336 }
337 match = 1;
338 rb->spans[yy] = eina_inlist_remove(rb->spans[yy], span);
339 free(span);
340 }
341 }
342 if (!match) goto coallate;
343 }
344 coallate:
345 r = calloc(1, sizeof(Tilebuf_Rect));
346 r->x = sp_start->x1;
347 r->y = y;
348 r->w = sp_start->x2 - sp_start->x1 + 1;
349 r->h = yy - y;
350 rects = eina_inlist_append(rects, r);
351 free(sp_start);
352 }
353 }
354 evas_common_regionbuf_clear(rb);
355 return rects;
356}
357#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_scale_main.c b/libraries/evas/src/lib/engines/common/evas_scale_main.c
new file mode 100644
index 0000000..959336c
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_scale_main.c
@@ -0,0 +1,6 @@
1#include "evas_common.h"
2
3EAPI void
4evas_common_scale_init(void)
5{
6}
diff --git a/libraries/evas/src/lib/engines/common/evas_scale_main.h b/libraries/evas/src/lib/engines/common/evas_scale_main.h
new file mode 100644
index 0000000..eafd9d2
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_scale_main.h
@@ -0,0 +1,13 @@
1#ifndef _EVAS_SCALE_MAIN_H
2#define _EVAS_SCALE_MAIN_H
3
4
5EAPI void evas_common_scale_init (void);
6
7EAPI void evas_common_scale_rgba_in_to_out_clip_smooth (RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, 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);
8
9EAPI void evas_common_scale_rgba_in_to_out_clip_sample (RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, 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);
10
11EAPI void evas_common_rgba_image_scalecache_dump(void);
12
13#endif /* _EVAS_SCALE_MAIN_H */
diff --git a/libraries/evas/src/lib/engines/common/evas_scale_sample.c b/libraries/evas/src/lib/engines/common/evas_scale_sample.c
new file mode 100644
index 0000000..54b8e92
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_scale_sample.c
@@ -0,0 +1,398 @@
1#include "evas_common.h"
2#include "evas_blend_private.h"
3
4void scale_rgba_in_to_out_clip_sample_internal(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, 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);
5
6#ifndef BUILD_SCALE_SMOOTH
7#ifdef BUILD_SCALE_SAMPLE
8EAPI void
9evas_common_scale_rgba_in_to_out_clip_smooth(RGBA_Image *src, RGBA_Image *dst,
10 RGBA_Draw_Context *dc,
11 int src_region_x, int src_region_y,
12 int src_region_w, int src_region_h,
13 int dst_region_x, int dst_region_y,
14 int dst_region_w, int dst_region_h)
15{
16 evas_common_scale_rgba_in_to_out_clip_sample(src, dst, dc,
17 src_region_x, src_region_y,
18 src_region_w, src_region_h,
19 dst_region_x, dst_region_y,
20 dst_region_w, dst_region_h);
21}
22#endif
23#endif
24
25#ifdef BUILD_SCALE_SAMPLE
26EAPI void
27evas_common_scale_rgba_in_to_out_clip_sample(RGBA_Image *src, RGBA_Image *dst,
28 RGBA_Draw_Context *dc,
29 int src_region_x, int src_region_y,
30 int src_region_w, int src_region_h,
31 int dst_region_x, int dst_region_y,
32 int dst_region_w, int dst_region_h)
33{
34 Cutout_Rects *rects;
35 Cutout_Rect *r;
36 int c, cx, cy, cw, ch;
37 int i;
38 /* handle cutouts here! */
39
40 if ((dst_region_w <= 0) || (dst_region_h <= 0)) return;
41 if (!(RECTS_INTERSECT(dst_region_x, dst_region_y, dst_region_w, dst_region_h, 0, 0, dst->cache_entry.w, dst->cache_entry.h)))
42 return;
43 /* no cutouts - cut right to the chase */
44 if (!dc->cutout.rects)
45 {
46 scale_rgba_in_to_out_clip_sample_internal(src, dst, dc,
47 src_region_x, src_region_y,
48 src_region_w, src_region_h,
49 dst_region_x, dst_region_y,
50 dst_region_w, dst_region_h);
51 return;
52 }
53 /* save out clip info */
54 c = dc->clip.use; cx = dc->clip.x; cy = dc->clip.y; cw = dc->clip.w; ch = dc->clip.h;
55 evas_common_draw_context_clip_clip(dc, 0, 0, dst->cache_entry.w, dst->cache_entry.h);
56 evas_common_draw_context_clip_clip(dc, dst_region_x, dst_region_y, dst_region_w, dst_region_h);
57 /* our clip is 0 size.. abort */
58 if ((dc->clip.w <= 0) || (dc->clip.h <= 0))
59 {
60 dc->clip.use = c; dc->clip.x = cx; dc->clip.y = cy; dc->clip.w = cw; dc->clip.h = ch;
61 return;
62 }
63 rects = evas_common_draw_context_apply_cutouts(dc);
64 for (i = 0; i < rects->active; ++i)
65 {
66 r = rects->rects + i;
67 evas_common_draw_context_set_clip(dc, r->x, r->y, r->w, r->h);
68 scale_rgba_in_to_out_clip_sample_internal(src, dst, dc,
69 src_region_x, src_region_y,
70 src_region_w, src_region_h,
71 dst_region_x, dst_region_y,
72 dst_region_w, dst_region_h);
73
74 }
75 evas_common_draw_context_apply_clear_cutouts(rects);
76 /* restore clip info */
77 dc->clip.use = c; dc->clip.x = cx; dc->clip.y = cy; dc->clip.w = cw; dc->clip.h = ch;
78}
79
80void
81scale_rgba_in_to_out_clip_sample_internal(RGBA_Image *src, RGBA_Image *dst,
82 RGBA_Draw_Context *dc,
83 int src_region_x, int src_region_y,
84 int src_region_w, int src_region_h,
85 int dst_region_x, int dst_region_y,
86 int dst_region_w, int dst_region_h)
87{
88 int x, y;
89 int *lin_ptr;
90 DATA32 *buf, *dptr;
91 DATA32 **row_ptr;
92 DATA32 *ptr, *dst_ptr, *src_data, *dst_data;
93 int dst_jump;
94 int dst_clip_x, dst_clip_y, dst_clip_w, dst_clip_h;
95 int m_clip_x = 0, m_clip_y = 0, m_clip_w = 0, m_clip_h = 0, mdx = 0, mdy = 0;
96 int src_w, src_h, dst_w, dst_h;
97 RGBA_Gfx_Func func;
98 RGBA_Image *maskobj = NULL;
99 DATA8 *mask = NULL;
100
101 if (!(RECTS_INTERSECT(dst_region_x, dst_region_y, dst_region_w, dst_region_h, 0, 0, dst->cache_entry.w, dst->cache_entry.h)))
102 return;
103 if (!(RECTS_INTERSECT(src_region_x, src_region_y, src_region_w, src_region_h, 0, 0, src->cache_entry.w, src->cache_entry.h)))
104 return;
105
106 src_w = src->cache_entry.w;
107 src_h = src->cache_entry.h;
108 dst_w = dst->cache_entry.w;
109 dst_h = dst->cache_entry.h;
110
111 src_data = src->image.data;
112 dst_data = dst->image.data;
113
114 if (dc->clip.use)
115 {
116 dst_clip_x = dc->clip.x;
117 dst_clip_y = dc->clip.y;
118 dst_clip_w = dc->clip.w;
119 dst_clip_h = dc->clip.h;
120 if (dst_clip_x < 0)
121 {
122 dst_clip_w += dst_clip_x;
123 dst_clip_x = 0;
124 }
125 if (dst_clip_y < 0)
126 {
127 dst_clip_h += dst_clip_y;
128 dst_clip_y = 0;
129 }
130 if ((dst_clip_x + dst_clip_w) > dst_w)
131 dst_clip_w = dst_w - dst_clip_x;
132 if ((dst_clip_y + dst_clip_h) > dst_h)
133 dst_clip_h = dst_h - dst_clip_y;
134 }
135 else
136 {
137 dst_clip_x = 0;
138 dst_clip_y = 0;
139 dst_clip_w = dst_w;
140 dst_clip_h = dst_h;
141 }
142
143 if (dc->mask.mask)
144 {
145 m_clip_x = dc->mask.x;
146 m_clip_y = dc->mask.y;
147 m_clip_w = dc->mask.mask->cache_entry.w;
148 m_clip_h = dc->mask.mask->cache_entry.h;
149 RECTS_CLIP_TO_RECT(m_clip_x, m_clip_y, m_clip_w, m_clip_h,
150 dst_clip_x, dst_clip_y, dst_clip_w, dst_clip_h);
151 if ((m_clip_w <= 0) || (m_clip_h <= 0)) return;
152 dst_clip_x = m_clip_x;
153 dst_clip_y = m_clip_y;
154 dst_clip_w = m_clip_w;
155 dst_clip_h = m_clip_h;
156 }
157
158 if (dst_clip_x < dst_region_x)
159 {
160 dst_clip_w += dst_clip_x - dst_region_x;
161 dst_clip_x = dst_region_x;
162 }
163 if ((dst_clip_x + dst_clip_w) > (dst_region_x + dst_region_w))
164 dst_clip_w = dst_region_x + dst_region_w - dst_clip_x;
165 if (dst_clip_y < dst_region_y)
166 {
167 dst_clip_h += dst_clip_y - dst_region_y;
168 dst_clip_y = dst_region_y;
169 }
170 if ((dst_clip_y + dst_clip_h) > (dst_region_y + dst_region_h))
171 dst_clip_h = dst_region_y + dst_region_h - dst_clip_y;
172
173 if ((src_region_w <= 0) || (src_region_h <= 0) ||
174 (dst_region_w <= 0) || (dst_region_h <= 0) ||
175 (dst_clip_w <= 0) || (dst_clip_h <= 0))
176 return;
177
178 /* sanitise x */
179 if (src_region_x < 0)
180 {
181 dst_region_x -= (src_region_x * dst_region_w) / src_region_w;
182 dst_region_w += (src_region_x * dst_region_w) / src_region_w;
183 src_region_w += src_region_x;
184 src_region_x = 0;
185 }
186 if (src_region_x >= src_w) return;
187 if ((src_region_x + src_region_w) > src_w)
188 {
189 dst_region_w = (dst_region_w * (src_w - src_region_x)) / (src_region_w);
190 src_region_w = src_w - src_region_x;
191 }
192 if (dst_region_w <= 0) return;
193 if (src_region_w <= 0) return;
194 if (dst_clip_x < 0)
195 {
196 dst_clip_w += dst_clip_x;
197 dst_clip_x = 0;
198 }
199 if (dst_clip_w <= 0) return;
200 if (dst_clip_x >= dst_w) return;
201 if (dst_clip_x < dst_region_x)
202 {
203 dst_clip_w += (dst_clip_x - dst_region_x);
204 dst_clip_x = dst_region_x;
205 }
206 if ((dst_clip_x + dst_clip_w) > dst_w)
207 {
208 dst_clip_w = dst_w - dst_clip_x;
209 }
210 if (dst_clip_w <= 0) return;
211
212 /* sanitise y */
213 if (src_region_y < 0)
214 {
215 dst_region_y -= (src_region_y * dst_region_h) / src_region_h;
216 dst_region_h += (src_region_y * dst_region_h) / src_region_h;
217 src_region_h += src_region_y;
218 src_region_y = 0;
219 }
220 if (src_region_y >= src_h) return;
221 if ((src_region_y + src_region_h) > src_h)
222 {
223 dst_region_h = (dst_region_h * (src_h - src_region_y)) / (src_region_h);
224 src_region_h = src_h - src_region_y;
225 }
226 if (dst_region_h <= 0) return;
227 if (src_region_h <= 0) return;
228 if (dst_clip_y < 0)
229 {
230 dst_clip_h += dst_clip_y;
231 dst_clip_y = 0;
232 }
233 if (dst_clip_h <= 0) return;
234 if (dst_clip_y >= dst_h) return;
235 if (dst_clip_y < dst_region_y)
236 {
237 dst_clip_h += (dst_clip_y - dst_region_y);
238 dst_clip_y = dst_region_y;
239 }
240 if ((dst_clip_y + dst_clip_h) > dst_h)
241 {
242 dst_clip_h = dst_h - dst_clip_y;
243 }
244 if (dst_clip_h <= 0) return;
245
246 /* allocate scale lookup tables */
247 lin_ptr = alloca(dst_clip_w * sizeof(int));
248 row_ptr = alloca(dst_clip_h * sizeof(DATA32 *));
249
250 /* figure out dst jump */
251 dst_jump = dst_w - dst_clip_w;
252
253 /* figure out dest start ptr */
254 dst_ptr = dst_data + dst_clip_x + (dst_clip_y * dst_w);
255
256 if (dc->mask.mask)
257 {
258 func = evas_common_gfx_func_composite_pixel_mask_span_get(src, dst, dst_clip_w, dc->render_op);
259 maskobj = dc->mask.mask;
260 mask = maskobj->mask.mask;
261/*
262 if (1 || dst_region_w > src_region_w || dst_region_h > src_region_h){
263 printf("Mask w/h: %d/%d\n",maskobj->cache_entry.w,
264 maskobj->cache_entry.h);
265 printf("Warning: Unscaled mask (%d/%d) // (%d/%d)\n",
266 dst_region_w,src_region_w,
267 dst_region_h,src_region_h);
268 }
269 */
270 }
271 else if (dc->mul.use)
272 func = evas_common_gfx_func_composite_pixel_color_span_get(src, dc->mul.col, dst, dst_clip_w, dc->render_op);
273 else
274 func = evas_common_gfx_func_composite_pixel_span_get(src, dst, dst_clip_w, dc->render_op);
275
276 if ((dst_region_w == src_region_w) && (dst_region_h == src_region_h))
277 {
278#ifdef HAVE_PIXMAN
279 if ((1) &&
280 (src->pixman.im) && (dst->pixman.im) &&
281 ((!dc->mul.use) ||
282 ((dc->mul.use) && (dc->mul.col == 0xffffffff))) &&
283 ((dc->render_op == _EVAS_RENDER_COPY) ||
284 (dc->render_op == _EVAS_RENDER_BLEND))
285 )
286 {
287 pixman_op_t op = PIXMAN_OP_SRC; // _EVAS_RENDER_COPY
288 if (dc->render_op == _EVAS_RENDER_BLEND) op = PIXMAN_OP_OVER;
289 pixman_image_composite(op,
290 src->pixman.im, NULL,
291 dst->pixman.im,
292 (dst_clip_x - dst_region_x) + src_region_x,
293 (dst_clip_y - dst_region_y) + src_region_y,
294 0, 0,
295 dst_clip_x, dst_clip_y,
296 dst_clip_w, dst_clip_h);
297 }
298 else
299#endif
300 {
301 ptr = src_data + ((dst_clip_y - dst_region_y + src_region_y) * src_w) + (dst_clip_x - dst_region_x) + src_region_x;
302 if (mask)
303 {
304 mdx = (m_clip_x - dc->mask.x) + (m_clip_x - dst_clip_x);
305 mdy = (m_clip_y - dc->mask.y) + (m_clip_y - dst_clip_y);
306 mask += mdx + (mdy * maskobj->cache_entry.w);
307 }
308 for (y = 0; y < dst_clip_h; y++)
309 {
310 /* * blend here [clip_w *] ptr -> dst_ptr * */
311#ifdef EVAS_SLI
312 if (((y + dst_clip_y) % dc->sli.h) == dc->sli.y)
313#endif
314 {
315 func(ptr, mask, dc->mul.col, dst_ptr, dst_clip_w);
316 }
317 ptr += src_w;
318 dst_ptr += dst_w;
319 if (mask) mask += maskobj->cache_entry.w;
320 }
321 }
322 }
323 else
324 {
325 /* fill scale tables */
326 for (x = 0; x < dst_clip_w; x++)
327 lin_ptr[x] = (((x + dst_clip_x - dst_region_x) * src_region_w) / dst_region_w) + src_region_x;
328 for (y = 0; y < dst_clip_h; y++)
329 row_ptr[y] = src_data + (((((y + dst_clip_y - dst_region_y) * src_region_h) / dst_region_h)
330 + src_region_y) * src_w);
331 /* scale to dst */
332 dptr = dst_ptr;
333#ifdef DIRECT_SCALE
334 if ((!src->cache_entry.flags.alpha) &&
335 (!dst->cache_entry.flags.alpha) &&
336 (!dc->mul.use))
337 {
338 for (y = 0; y < dst_clip_h; y++)
339 {
340#ifdef EVAS_SLI
341 if (((y + dst_clip_y) % dc->sli.h) == dc->sli.y)
342#endif
343 {
344 dst_ptr = dptr;
345 for (x = 0; x < dst_clip_w; x++)
346 {
347 ptr = row_ptr[y] + lin_ptr[x];
348 *dst_ptr = *ptr;
349 dst_ptr++;
350 }
351 }
352 dptr += dst_w;
353 }
354 }
355 else
356#endif
357 {
358 /* a scanline buffer */
359 buf = alloca(dst_clip_w * sizeof(DATA32));
360 for (y = 0; y < dst_clip_h; y++)
361 {
362#ifdef EVAS_SLI
363 if (((y + dst_clip_y) % dc->sli.h) == dc->sli.y)
364#endif
365 {
366 dst_ptr = buf;
367 for (x = 0; x < dst_clip_w; x++)
368 {
369 ptr = row_ptr[y] + lin_ptr[x];
370 *dst_ptr = *ptr;
371 dst_ptr++;
372 }
373 /* * blend here [clip_w *] buf -> dptr * */
374 func(buf, NULL, dc->mul.col, dptr, dst_clip_w);
375 }
376 dptr += dst_w;
377 }
378 }
379 }
380}
381#else
382#ifdef BUILD_SCALE_SMOOTH
383EAPI void
384evas_common_scale_rgba_in_to_out_clip_sample(RGBA_Image *src, RGBA_Image *dst,
385 RGBA_Draw_Context *dc,
386 int src_region_x, int src_region_y,
387 int src_region_w, int src_region_h,
388 int dst_region_x, int dst_region_y,
389 int dst_region_w, int dst_region_h)
390{
391 evas_common_scale_rgba_in_to_out_clip_smooth(src, dst, dc,
392 src_region_x, src_region_y,
393 src_region_w, src_region_h,
394 dst_region_x, dst_region_y,
395 dst_region_w, dst_region_h);
396}
397#endif
398#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_scale_smooth.c b/libraries/evas/src/lib/engines/common/evas_scale_smooth.c
new file mode 100644
index 0000000..d3aada6
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_scale_smooth.c
@@ -0,0 +1,532 @@
1#include "evas_common.h"
2#include "evas_scale_smooth.h"
3#include "evas_blend_private.h"
4
5#define SCALE_CALC_X_POINTS(P, SW, DW, CX, CW) \
6 P = alloca((CW + 1) * sizeof (int)); \
7 scale_calc_x_points(P, SW, DW, CX, CW);
8
9#define SCALE_CALC_Y_POINTS(P, SRC, SW, SH, DH, CY, CH) \
10 P = alloca((CH + 1) * sizeof (DATA32 *)); \
11 scale_calc_y_points(P, SRC, SW, SH, DH, CY, CH);
12
13#define SCALE_CALC_A_POINTS(P, S, D, C, CC) \
14 P = alloca(CC * sizeof (int)); \
15 scale_calc_a_points(P, S, D, C, CC);
16
17static void scale_calc_y_points(DATA32 **p, DATA32 *src, int sw, int sh, int dh, int cy, int ch);
18static void scale_calc_x_points(int *p, int sw, int dw, int cx, int cw);
19static void scale_calc_a_points(int *p, int s, int d, int c, int cc);
20
21static void
22scale_calc_y_points(DATA32** p, DATA32 *src, int sw, int sh, int dh, int cy, int ch)
23{
24 int i, val, inc;
25 if (sh > SCALE_SIZE_MAX) return;
26 val = 0;
27 inc = (sh << 16) / dh;
28 for (i = 0; i < dh; i++)
29 {
30 if ((i >= cy) && (i < (cy + ch)))
31 p[i - cy] = src + ((val >> 16) * sw);
32 val += inc;
33 }
34 if ((i >= cy) && (i < (cy + ch)))
35 p[i - cy] = p[i - cy - 1];
36}
37
38static void
39scale_calc_x_points(int *p, int sw, int dw, int cx, int cw)
40{
41 int i, val, inc;
42 if (sw > SCALE_SIZE_MAX) return;
43 val = 0;
44 inc = (sw << 16) / dw;
45 for (i = 0; i < dw; i++)
46 {
47 if ((i >= cx) && (i < (cx + cw)))
48 p[i - cx] = val >> 16;
49 val += inc;
50 }
51 if ((i >= cx) && (i < (cx + cw)))
52 p[i - cx] = p[i - cx - 1];
53}
54
55static void
56scale_calc_a_points(int *p, int s, int d, int c, int cc)
57{
58 int i, val, inc;
59
60 if (s > SCALE_SIZE_MAX) return;
61 if (d >= s)
62 {
63 val = 0;
64 inc = (s << 16) / d;
65 for (i = 0; i < d; i++)
66 {
67 if ((i >= c) && (i < (c + cc)))
68 {
69 p[i - c] = (val >> 8) - ((val >> 8) & 0xffffff00);
70 if ((val >> 16) >= (s - 1)) p[i - c] = 0;
71 }
72 val += inc;
73 }
74 }
75 else
76 {
77 int ap, Cp;
78
79 val = 0;
80 inc = (s << 16) / d;
81 Cp = ((d << 14) / s) + 1;
82 for (i = 0; i < d; i++)
83 {
84 ap = ((0x100 - ((val >> 8) & 0xff)) * Cp) >> 8;
85 if ((i >= c) && (i < (c + cc)))
86 p[i - c] = ap | (Cp << 16);
87 val += inc;
88 }
89 }
90}
91
92#ifdef BUILD_SCALE_SMOOTH
93#ifdef BUILD_C
94EAPI void
95evas_common_scale_rgba_mipmap_down_2x2_c(DATA32 *src, DATA32 *dst, int src_w, int src_h)
96{
97 int x, y, dst_w, dst_h;
98 DATA32 *src_ptr, *src_ptr2, *dst_ptr;
99
100 dst_w = src_w >> 1;
101 dst_h = src_h >> 1;
102
103 if (dst_w < 1) dst_w = 1;
104 if (dst_h < 1) dst_h = 1;
105
106 src_ptr = src;
107 src_ptr2 = src + src_w;
108 dst_ptr = dst;
109 for (y = 0; y < dst_h; y++)
110 {
111 src_ptr = src + (y * src_w * 2);
112 src_ptr2 = src_ptr + src_w;
113 for (x = 0; x < dst_w; x++)
114 {
115 R_VAL(dst_ptr) = (R_VAL(src_ptr) + R_VAL(src_ptr + 1) + R_VAL(src_ptr2) + R_VAL(src_ptr2 + 1)) >> 2;
116 G_VAL(dst_ptr) = (G_VAL(src_ptr) + G_VAL(src_ptr + 1) + G_VAL(src_ptr2) + G_VAL(src_ptr2 + 1)) >> 2;
117 B_VAL(dst_ptr) = (B_VAL(src_ptr) + B_VAL(src_ptr + 1) + B_VAL(src_ptr2) + B_VAL(src_ptr2 + 1)) >> 2;
118 A_VAL(dst_ptr) = (A_VAL(src_ptr) + A_VAL(src_ptr + 1) + A_VAL(src_ptr2) + A_VAL(src_ptr2 + 1)) >> 2;
119
120 src_ptr+=2;
121 src_ptr2+=2;
122 dst_ptr++;
123 }
124 }
125}
126#endif
127#endif
128
129#ifdef BUILD_SCALE_SMOOTH
130#ifdef BUILD_C
131EAPI void
132evas_common_scale_rgba_mipmap_down_2x1_c(DATA32 *src, DATA32 *dst, int src_w, int src_h)
133{
134 int x, y, dst_w, dst_h;
135 DATA32 *src_ptr, *dst_ptr;
136
137 dst_w = src_w >> 1;
138 dst_h = src_h >> 1;
139
140 if (dst_w < 1) dst_w = 1;
141 if (dst_h < 1) dst_h = 1;
142
143 src_ptr = src;
144 dst_ptr = dst;
145 for (y = 0; y < dst_h; y++)
146 {
147 src_ptr = src + (y * src_w * 2);
148 for (x = 0; x < dst_w; x++)
149 {
150 R_VAL(dst_ptr) = (R_VAL(src_ptr) + R_VAL(src_ptr + 1)) >> 1;
151 G_VAL(dst_ptr) = (G_VAL(src_ptr) + G_VAL(src_ptr + 1)) >> 1;
152 B_VAL(dst_ptr) = (B_VAL(src_ptr) + B_VAL(src_ptr + 1)) >> 1;
153 A_VAL(dst_ptr) = (A_VAL(src_ptr) + A_VAL(src_ptr + 1)) >> 1;
154
155 src_ptr+=2;
156 dst_ptr++;
157 }
158 }
159}
160#endif
161#endif
162
163#ifdef BUILD_SCALE_SMOOTH
164#ifdef BUILD_C
165EAPI void
166evas_common_scale_rgba_mipmap_down_1x2_c(DATA32 *src, DATA32 *dst, int src_w, int src_h)
167{
168 int x, y, dst_w, dst_h;
169 DATA32 *src_ptr, *src_ptr2, *dst_ptr;
170
171 dst_w = src_w >> 1;
172 dst_h = src_h >> 1;
173
174 if (dst_w < 1) dst_w = 1;
175 if (dst_h < 1) dst_h = 1;
176
177 src_ptr = src;
178 dst_ptr = dst;
179 for (y = 0; y < dst_h; y++)
180 {
181 src_ptr = src + (y * src_w * 2);
182 src_ptr2 = src_ptr + src_w;
183 for (x = 0; x < dst_w; x++)
184 {
185 R_VAL(dst_ptr) = (R_VAL(src_ptr) + R_VAL(src_ptr2)) >> 1;
186 G_VAL(dst_ptr) = (G_VAL(src_ptr) + G_VAL(src_ptr2)) >> 1;
187 B_VAL(dst_ptr) = (B_VAL(src_ptr) + B_VAL(src_ptr2)) >> 1;
188 A_VAL(dst_ptr) = (A_VAL(src_ptr) + A_VAL(src_ptr2)) >> 1;
189
190 src_ptr+=2;
191 src_ptr2+=2;
192 dst_ptr++;
193 }
194 }
195}
196#endif
197#endif
198
199#ifdef BUILD_SCALE_SMOOTH
200#ifdef BUILD_C
201EAPI void
202evas_common_scale_rgb_mipmap_down_2x2_c(DATA32 *src, DATA32 *dst, int src_w, int src_h)
203{
204 int x, y, dst_w, dst_h;
205 DATA32 *src_ptr, *src_ptr2, *dst_ptr;
206
207 dst_w = src_w >> 1;
208 dst_h = src_h >> 1;
209
210 if (dst_w < 1) dst_w = 1;
211 if (dst_h < 1) dst_h = 1;
212
213 src_ptr = src;
214 src_ptr2 = src + src_w;
215 dst_ptr = dst;
216 for (y = 0; y < dst_h; y++)
217 {
218 for (x = 0; x < dst_w; x++)
219 {
220 R_VAL(dst_ptr) = (R_VAL(src_ptr) + R_VAL(src_ptr + 1) + R_VAL(src_ptr2) + R_VAL(src_ptr2 + 1)) >> 2;
221 G_VAL(dst_ptr) = (G_VAL(src_ptr) + G_VAL(src_ptr + 1) + G_VAL(src_ptr2) + G_VAL(src_ptr2 + 1)) >> 2;
222 B_VAL(dst_ptr) = (B_VAL(src_ptr) + B_VAL(src_ptr + 1) + B_VAL(src_ptr2) + B_VAL(src_ptr2 + 1)) >> 2;
223 A_VAL(dst_ptr) = 0xff;
224
225 src_ptr+=2;
226 src_ptr2+=2;
227 dst_ptr++;
228 }
229 src_ptr += src_w;
230 src_ptr2 += src_w;
231 }
232}
233#endif
234#endif
235
236#ifdef BUILD_SCALE_SMOOTH
237#ifdef BUILD_C
238EAPI void
239evas_common_scale_rgb_mipmap_down_2x1_c(DATA32 *src, DATA32 *dst, int src_w, int src_h)
240{
241 int x, y, dst_w, dst_h;
242 DATA32 *src_ptr, *dst_ptr;
243
244 dst_w = src_w >> 1;
245 dst_h = src_h >> 1;
246
247 if (dst_w < 1) dst_w = 1;
248 if (dst_h < 1) dst_h = 1;
249
250 src_ptr = src;
251 dst_ptr = dst;
252 for (y = 0; y < dst_h; y++)
253 {
254 for (x = 0; x < dst_w; x++)
255 {
256 R_VAL(dst_ptr) = (R_VAL(src_ptr) + R_VAL(src_ptr + 1)) >> 1;
257 G_VAL(dst_ptr) = (G_VAL(src_ptr) + G_VAL(src_ptr + 1)) >> 1;
258 B_VAL(dst_ptr) = (B_VAL(src_ptr) + B_VAL(src_ptr + 1)) >> 1;
259 A_VAL(dst_ptr) = 0xff;
260
261 src_ptr+=2;
262 dst_ptr++;
263 }
264 src_ptr += src_w;
265 }
266}
267#endif
268#endif
269
270#ifdef BUILD_SCALE_SMOOTH
271#ifdef BUILD_C
272EAPI void
273evas_common_scale_rgb_mipmap_down_1x2_c(DATA32 *src, DATA32 *dst, int src_w, int src_h)
274{
275 int x, y, dst_w, dst_h;
276 DATA32 *src_ptr, *src_ptr2, *dst_ptr;
277
278 dst_w = src_w >> 1;
279 dst_h = src_h >> 1;
280
281 if (dst_w < 1) dst_w = 1;
282 if (dst_h < 1) dst_h = 1;
283
284 src_ptr = src;
285 src_ptr2 = src + src_w;
286 dst_ptr = dst;
287 for (y = 0; y < dst_h; y++)
288 {
289 for (x = 0; x < dst_w; x++)
290 {
291 R_VAL(dst_ptr) = (R_VAL(src_ptr) + R_VAL(src_ptr2)) >> 1;
292 G_VAL(dst_ptr) = (G_VAL(src_ptr) + G_VAL(src_ptr2)) >> 1;
293 B_VAL(dst_ptr) = (B_VAL(src_ptr) + B_VAL(src_ptr2)) >> 1;
294 A_VAL(dst_ptr) = 0xff;
295
296 src_ptr+=2;
297 src_ptr2+=2;
298 dst_ptr++;
299 }
300 src_ptr += src_w;
301 src_ptr2 += src_w;
302 }
303}
304#endif
305#endif
306
307#ifdef BUILD_SCALE_SMOOTH
308#ifdef BUILD_MMX
309EAPI void
310evas_common_scale_rgba_mipmap_down_2x2_mmx(DATA32 *src, DATA32 *dst, int src_w, int src_h)
311{
312 int x, y, dst_w, dst_h;
313 DATA32 *src_ptr, *src_ptr2, *dst_ptr;
314
315 dst_w = src_w >> 1;
316 dst_h = src_h >> 1;
317
318 if (dst_w < 1) dst_w = 1;
319 if (dst_h < 1) dst_h = 1;
320
321 /* NB: Dead assignments (reassigned to different values below)
322 src_ptr = src;
323 src_ptr2 = src + src_w;
324 */
325
326 dst_ptr = dst;
327 for (y = 0; y < dst_h; y++)
328 {
329 src_ptr = src + (y * src_w * 2);
330 src_ptr2 = src_ptr + src_w;
331 for (x = 0; x < dst_w; x++)
332 {
333 punpcklbw_m2r(src_ptr[0], mm0);
334 punpcklbw_m2r(src_ptr[1], mm1);
335 punpcklbw_m2r(src_ptr2[0], mm2);
336 punpcklbw_m2r(src_ptr2[1], mm3);
337 psrlw_i2r(8, mm0);
338 psrlw_i2r(8, mm1);
339 psrlw_i2r(8, mm2);
340 psrlw_i2r(8, mm3);
341 paddw_r2r(mm1, mm0);
342 paddw_r2r(mm2, mm0);
343 paddw_r2r(mm3, mm0);
344 psrlw_i2r(2, mm0);
345 packuswb_r2r(mm0, mm0);
346 movd_r2m(mm0, dst_ptr[0]);
347
348 src_ptr+=2;
349 src_ptr2+=2;
350 dst_ptr++;
351 }
352 }
353}
354#endif
355#endif
356
357#ifdef BUILD_SCALE_SMOOTH
358#ifdef BUILD_MMX
359EAPI void
360evas_common_scale_rgba_mipmap_down_2x1_mmx(DATA32 *src, DATA32 *dst, int src_w, int src_h)
361{
362 int x, y, dst_w, dst_h;
363 DATA32 *src_ptr, *dst_ptr;
364
365 dst_w = src_w >> 1;
366 dst_h = src_h >> 1;
367
368 if (dst_w < 1) dst_w = 1;
369 if (dst_h < 1) dst_h = 1;
370
371 src_ptr = src;
372 dst_ptr = dst;
373 for (y = 0; y < dst_h; y++)
374 {
375 src_ptr = src + (y * src_w * 2);
376 for (x = 0; x < dst_w; x++)
377 {
378 punpcklbw_m2r(src_ptr[0], mm0);
379 punpcklbw_m2r(src_ptr[1], mm1);
380 psrlw_i2r(8, mm0);
381 psrlw_i2r(8, mm1);
382 paddw_r2r(mm1, mm0);
383 psrlw_i2r(1, mm0);
384 packuswb_r2r(mm0, mm0);
385 movd_r2m(mm0, dst_ptr[0]);
386
387 src_ptr+=2;
388 dst_ptr++;
389 }
390 }
391}
392#endif
393#endif
394
395#ifdef BUILD_SCALE_SMOOTH
396#ifdef BUILD_MMX
397EAPI void
398evas_common_scale_rgba_mipmap_down_1x2_mmx(DATA32 *src, DATA32 *dst, int src_w, int src_h)
399{
400 int x, y, dst_w, dst_h;
401 DATA32 *src_ptr, *src_ptr2, *dst_ptr;
402
403 dst_w = src_w >> 1;
404 dst_h = src_h >> 1;
405
406 if (dst_w < 1) dst_w = 1;
407 if (dst_h < 1) dst_h = 1;
408
409 /* NB: Dead assignment (gets reassigned later) */
410// src_ptr = src;
411
412 src_ptr2 = src + src_w;
413 dst_ptr = dst;
414 for (y = 0; y < dst_h; y++)
415 {
416 src_ptr = src + (y * src_w * 2);
417 src_ptr2 = src_ptr + src_w;
418 for (x = 0; x < dst_w; x++)
419 {
420 punpcklbw_m2r(src_ptr[0], mm0);
421 punpcklbw_m2r(src_ptr2[0], mm1);
422 psrlw_i2r(8, mm0);
423 psrlw_i2r(8, mm1);
424 paddw_r2r(mm1, mm0);
425 psrlw_i2r(1, mm0);
426 packuswb_r2r(mm0, mm0);
427 movd_r2m(mm0, dst_ptr[0]);
428
429 src_ptr+=2;
430 src_ptr2+=2;
431 dst_ptr++;
432 }
433 }
434}
435#endif
436#endif
437
438#ifdef BUILD_SCALE_SMOOTH
439# ifdef BUILD_MMX
440# undef SCALE_FUNC
441# define SCALE_FUNC evas_common_scale_rgba_in_to_out_clip_smooth_mmx
442# undef SCALE_USING_MMX
443# define SCALE_USING_MMX
444# include "evas_scale_smooth_scaler.c"
445# endif
446# ifdef BUILD_C
447# undef SCALE_FUNC
448# define SCALE_FUNC evas_common_scale_rgba_in_to_out_clip_smooth_c
449# undef SCALE_USING_MMX
450# include "evas_scale_smooth_scaler.c"
451# endif
452EAPI void
453evas_common_scale_rgba_in_to_out_clip_smooth(RGBA_Image *src, RGBA_Image *dst,
454 RGBA_Draw_Context *dc,
455 int src_region_x, int src_region_y,
456 int src_region_w, int src_region_h,
457 int dst_region_x, int dst_region_y,
458 int dst_region_w, int dst_region_h)
459{
460# ifdef BUILD_MMX
461 int mmx, sse, sse2;
462# endif
463 Cutout_Rects *rects;
464 Cutout_Rect *r;
465 int c, cx, cy, cw, ch;
466 int i;
467 /* handle cutouts here! */
468
469 if ((dst_region_w <= 0) || (dst_region_h <= 0)) return;
470 if (!(RECTS_INTERSECT(dst_region_x, dst_region_y, dst_region_w, dst_region_h, 0, 0, dst->cache_entry.w, dst->cache_entry.h)))
471 return;
472# ifdef BUILD_MMX
473 evas_common_cpu_can_do(&mmx, &sse, &sse2);
474# endif
475 /* no cutouts - cut right to the chase */
476 if (!dc->cutout.rects)
477 {
478# ifdef BUILD_MMX
479 if (mmx)
480 evas_common_scale_rgba_in_to_out_clip_smooth_mmx(src, dst, dc,
481 src_region_x, src_region_y,
482 src_region_w, src_region_h,
483 dst_region_x, dst_region_y,
484 dst_region_w, dst_region_h);
485 else
486# endif
487# ifdef BUILD_C
488 evas_common_scale_rgba_in_to_out_clip_smooth_c(src, dst, dc,
489 src_region_x, src_region_y,
490 src_region_w, src_region_h,
491 dst_region_x, dst_region_y,
492 dst_region_w, dst_region_h);
493# endif
494 return;
495 }
496 /* save out clip info */
497 c = dc->clip.use; cx = dc->clip.x; cy = dc->clip.y; cw = dc->clip.w; ch = dc->clip.h;
498 evas_common_draw_context_clip_clip(dc, 0, 0, dst->cache_entry.w, dst->cache_entry.h);
499 evas_common_draw_context_clip_clip(dc, dst_region_x, dst_region_y, dst_region_w, dst_region_h);
500 /* our clip is 0 size.. abort */
501 if ((dc->clip.w <= 0) || (dc->clip.h <= 0))
502 {
503 dc->clip.use = c; dc->clip.x = cx; dc->clip.y = cy; dc->clip.w = cw; dc->clip.h = ch;
504 return;
505 }
506 rects = evas_common_draw_context_apply_cutouts(dc);
507 for (i = 0; i < rects->active; ++i)
508 {
509 r = rects->rects + i;
510 evas_common_draw_context_set_clip(dc, r->x, r->y, r->w, r->h);
511# ifdef BUILD_MMX
512 if (mmx)
513 evas_common_scale_rgba_in_to_out_clip_smooth_mmx(src, dst, dc,
514 src_region_x, src_region_y,
515 src_region_w, src_region_h,
516 dst_region_x, dst_region_y,
517 dst_region_w, dst_region_h);
518 else
519# endif
520# ifdef BUILD_C
521 evas_common_scale_rgba_in_to_out_clip_smooth_c(src, dst, dc,
522 src_region_x, src_region_y,
523 src_region_w, src_region_h,
524 dst_region_x, dst_region_y,
525 dst_region_w, dst_region_h);
526# endif
527 }
528 evas_common_draw_context_apply_clear_cutouts(rects);
529 /* restore clip info */
530 dc->clip.use = c; dc->clip.x = cx; dc->clip.y = cy; dc->clip.w = cw; dc->clip.h = ch;
531}
532#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_scale_smooth.h b/libraries/evas/src/lib/engines/common/evas_scale_smooth.h
new file mode 100644
index 0000000..63ced50
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_scale_smooth.h
@@ -0,0 +1,19 @@
1#ifndef _EVAS_SCALE_SMOOTH_H
2#define _EVAS_SCALE_SMOOTH_H
3
4EAPI void evas_common_scale_rgba_mipmap_down_2x2_c (DATA32 *src, DATA32 *dst, int src_w, int src_h);
5EAPI void evas_common_scale_rgba_mipmap_down_2x1_c (DATA32 *src, DATA32 *dst, int src_w, int src_h);
6EAPI void evas_common_scale_rgba_mipmap_down_1x2_c (DATA32 *src, DATA32 *dst, int src_w, int src_h);
7EAPI void evas_common_scale_rgb_mipmap_down_2x2_c (DATA32 *src, DATA32 *dst, int src_w, int src_h);
8EAPI void evas_common_scale_rgb_mipmap_down_2x1_c (DATA32 *src, DATA32 *dst, int src_w, int src_h);
9EAPI void evas_common_scale_rgb_mipmap_down_1x2_c (DATA32 *src, DATA32 *dst, int src_w, int src_h);
10
11EAPI void evas_common_scale_rgba_mipmap_down_2x2_mmx (DATA32 *src, DATA32 *dst, int src_w, int src_h);
12EAPI void evas_common_scale_rgba_mipmap_down_2x1_mmx (DATA32 *src, DATA32 *dst, int src_w, int src_h);
13EAPI void evas_common_scale_rgba_mipmap_down_1x2_mmx (DATA32 *src, DATA32 *dst, int src_w, int src_h);
14
15EAPI void evas_common_scale_rgba_in_to_out_clip_smooth_mmx (RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, 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);
16EAPI void evas_common_scale_rgba_in_to_out_clip_smooth_c (RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, 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);
17
18
19#endif /* _EVAS_SCALE_SMOOTH_H */
diff --git a/libraries/evas/src/lib/engines/common/evas_scale_smooth_scaler.c b/libraries/evas/src/lib/engines/common/evas_scale_smooth_scaler.c
new file mode 100644
index 0000000..599bfda
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_scale_smooth_scaler.c
@@ -0,0 +1,211 @@
1void
2SCALE_FUNC(RGBA_Image *src, RGBA_Image *dst,
3 RGBA_Draw_Context *dc,
4 int src_region_x, int src_region_y,
5 int src_region_w, int src_region_h,
6 int dst_region_x, int dst_region_y,
7 int dst_region_w, int dst_region_h)
8{
9 DATA32 *dst_ptr;
10 int dst_clip_x, dst_clip_y, dst_clip_w, dst_clip_h;
11 int src_w, src_h, dst_w, dst_h;
12
13 if (!(RECTS_INTERSECT(dst_region_x, dst_region_y, dst_region_w, dst_region_h, 0, 0, dst->cache_entry.w, dst->cache_entry.h)))
14 return;
15 if (!(RECTS_INTERSECT(src_region_x, src_region_y, src_region_w, src_region_h, 0, 0, src->cache_entry.w, src->cache_entry.h)))
16 return;
17
18 src_w = src->cache_entry.w;
19 src_h = src->cache_entry.h;
20 dst_w = dst->cache_entry.w;
21 dst_h = dst->cache_entry.h;
22
23 if (dc->clip.use)
24 {
25 dst_clip_x = dc->clip.x;
26 dst_clip_y = dc->clip.y;
27 dst_clip_w = dc->clip.w;
28 dst_clip_h = dc->clip.h;
29 if (dst_clip_x < 0)
30 {
31 dst_clip_w += dst_clip_x;
32 dst_clip_x = 0;
33 }
34 if (dst_clip_y < 0)
35 {
36 dst_clip_h += dst_clip_y;
37 dst_clip_y = 0;
38 }
39 if ((dst_clip_w <= 0) || (dst_clip_h <= 0)) return;
40 if ((dst_clip_x + dst_clip_w) > dst_w) dst_clip_w = dst_w - dst_clip_x;
41 if ((dst_clip_y + dst_clip_h) > dst_h) dst_clip_h = dst_h - dst_clip_y;
42 }
43 else
44 {
45 dst_clip_x = 0;
46 dst_clip_y = 0;
47 dst_clip_w = dst_w;
48 dst_clip_h = dst_h;
49 }
50
51 if (dst_clip_x < dst_region_x)
52 {
53 dst_clip_w += dst_clip_x - dst_region_x;
54 dst_clip_x = dst_region_x;
55 }
56 if ((dst_clip_x + dst_clip_w) > (dst_region_x + dst_region_w))
57 dst_clip_w = dst_region_x + dst_region_w - dst_clip_x;
58 if (dst_clip_y < dst_region_y)
59 {
60 dst_clip_h += dst_clip_y - dst_region_y;
61 dst_clip_y = dst_region_y;
62 }
63 if ((dst_clip_y + dst_clip_h) > (dst_region_y + dst_region_h))
64 dst_clip_h = dst_region_y + dst_region_h - dst_clip_y;
65
66 if ((src_region_w <= 0) || (src_region_h <= 0) ||
67 (dst_region_w <= 0) || (dst_region_h <= 0) ||
68 (dst_clip_w <= 0) || (dst_clip_h <= 0))
69 return;
70
71 /* sanitise x */
72 if (src_region_x < 0)
73 {
74 dst_region_x -= (src_region_x * dst_region_w) / src_region_w;
75 dst_region_w += (src_region_x * dst_region_w) / src_region_w;
76 src_region_w += src_region_x;
77 src_region_x = 0;
78 }
79 if (src_region_x >= src_w) return;
80 if ((src_region_x + src_region_w) > src_w)
81 {
82 dst_region_w = (dst_region_w * (src_w - src_region_x)) / (src_region_w);
83 src_region_w = src_w - src_region_x;
84 }
85 if (dst_region_w <= 0) return;
86 if (src_region_w <= 0) return;
87 if (dst_clip_x < 0)
88 {
89 dst_clip_w += dst_clip_x;
90 dst_clip_x = 0;
91 }
92 if (dst_clip_w <= 0) return;
93 if (dst_clip_x >= dst_w) return;
94 if (dst_clip_x < dst_region_x)
95 {
96 dst_clip_w += (dst_clip_x - dst_region_x);
97 dst_clip_x = dst_region_x;
98 }
99 if ((dst_clip_x + dst_clip_w) > dst_w)
100 {
101 dst_clip_w = dst_w - dst_clip_x;
102 }
103 if (dst_clip_w <= 0) return;
104
105 /* sanitise y */
106 if (src_region_y < 0)
107 {
108 dst_region_y -= (src_region_y * dst_region_h) / src_region_h;
109 dst_region_h += (src_region_y * dst_region_h) / src_region_h;
110 src_region_h += src_region_y;
111 src_region_y = 0;
112 }
113 if (src_region_y >= src_h) return;
114 if ((src_region_y + src_region_h) > src_h)
115 {
116 dst_region_h = (dst_region_h * (src_h - src_region_y)) / (src_region_h);
117 src_region_h = src_h - src_region_y;
118 }
119 if (dst_region_h <= 0) return;
120 if (src_region_h <= 0) return;
121 if (dst_clip_y < 0)
122 {
123 dst_clip_h += dst_clip_y;
124 dst_clip_y = 0;
125 }
126 if (dst_clip_h <= 0) return;
127 if (dst_clip_y >= dst_h) return;
128 if (dst_clip_y < dst_region_y)
129 {
130 dst_clip_h += (dst_clip_y - dst_region_y);
131 dst_clip_y = dst_region_y;
132 }
133 if ((dst_clip_y + dst_clip_h) > dst_h)
134 {
135 dst_clip_h = dst_h - dst_clip_y;
136 }
137 if (dst_clip_h <= 0) return;
138
139 /* some maximum region sizes to avoid insane calc point tables */
140 if (dst_clip_w > 65536) return;
141 if (dst_clip_h > 65536) return;
142 if (dst_region_w > (65536 * 1024)) return;
143 if (dst_region_h > (65536 * 1024)) return;
144
145 /* figure out dst jump
146 * NB: Unused currently, so commented out */
147// dst_jump = dst_w - dst_clip_w;
148
149 /* figure out dest start ptr */
150 dst_ptr = dst->image.data + dst_clip_x + (dst_clip_y * dst_w);
151
152/* FIXME:
153 *
154 * things to do later for speedups:
155 *
156 * break upscale into 3 cases (as listed below - up:up, 1:up, up:1)
157 *
158 * break downscale into more cases (as listed below)
159 *
160 * roll func (blend/copy/cultiply/cmod) code into inner loop of scaler.
161 * (578 fps vs 550 in mmx upscale in evas demo - this means probably
162 * a good 10-15% speedup over the func call, but means massively larger
163 * code)
164 *
165 * anything involving downscaling has no mmx equivalent code and maybe the
166 * C could do with a little work.
167 *
168 * ---------------------------------------------------------------------------
169 *
170 * (1 = no scaling (1:1 ratio), + = scale up, - = scale down)
171 * (* == fully optimised mmx, # = fully optimised C)
172 *
173 * h:v mmx C
174 *
175 * 1:1 * #
176 *
177 * +:+ * #
178 * 1:+ * #
179 * +:1 * #
180 *
181 * 1:-
182 * -:1
183 * +:-
184 * -:+
185 * -:-
186 *
187 */
188
189 /* if 1:1 scale */
190 if ((dst_region_w == src_region_w) &&
191 (dst_region_h == src_region_h))
192 {
193#include "evas_scale_smooth_scaler_noscale.c"
194 }
195 else
196 {
197 /* scaling up only - dont need anything except original */
198// if ((!dc->anti_alias) || ((dst_region_w >= src_region_w) && (dst_region_h >= src_region_h)))
199 if (((dst_region_w >= src_region_w) && (dst_region_h >= src_region_h)))
200 {
201#include "evas_scale_smooth_scaler_up.c"
202 return;
203 }
204 else
205 /* scaling down... funkiness */
206 {
207#include "evas_scale_smooth_scaler_down.c"
208 return;
209 }
210 }
211}
diff --git a/libraries/evas/src/lib/engines/common/evas_scale_smooth_scaler_down.c b/libraries/evas/src/lib/engines/common/evas_scale_smooth_scaler_down.c
new file mode 100644
index 0000000..357eb32
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_scale_smooth_scaler_down.c
@@ -0,0 +1,43 @@
1{
2 DATA32 **ypoints;
3 int *xpoints;
4 int *xapoints, *xapp;
5 int *yapoints, *yapp;
6 DATA32 *buf, *src_data;
7
8 RGBA_Gfx_Func func;
9
10 src_data = src->image.data;
11
12 /* some maximum region sizes to avoid insane calc point tables */
13 SCALE_CALC_X_POINTS(xpoints, src_region_w, dst_region_w, dst_clip_x - dst_region_x, dst_clip_w);
14 SCALE_CALC_Y_POINTS(ypoints, src_data, src_w, src_region_h, dst_region_h, dst_clip_y - dst_region_y, dst_clip_h);
15 SCALE_CALC_A_POINTS(xapoints, src_region_w, dst_region_w, dst_clip_x - dst_region_x, dst_clip_w);
16 SCALE_CALC_A_POINTS(yapoints, src_region_h, dst_region_h, dst_clip_y - dst_region_y, dst_clip_h);
17
18 /* a scanline buffer */
19 buf = alloca(dst_clip_w * sizeof(DATA32));
20
21 if (dc->mul.use)
22 func = evas_common_gfx_func_composite_pixel_color_span_get(src, dc->mul.col, dst, dst_clip_w, dc->render_op);
23 else
24 func = evas_common_gfx_func_composite_pixel_span_get(src, dst, dst_clip_w, dc->render_op);
25 /* scaling down vertically */
26 if ((dst_region_w >= src_region_w) &&
27 (dst_region_h < src_region_h))
28 {
29#include "evas_scale_smooth_scaler_downy.c"
30 }
31 /* scaling down horizontally */
32 else if ((dst_region_w < src_region_w) &&
33 (dst_region_h >= src_region_h))
34 {
35#include "evas_scale_smooth_scaler_downx.c"
36 }
37 /* scaling down both vertically & horizontally */
38 else if ((dst_region_w < src_region_w) &&
39 (dst_region_h < src_region_h))
40 {
41#include "evas_scale_smooth_scaler_downx_downy.c"
42 }
43}
diff --git a/libraries/evas/src/lib/engines/common/evas_scale_smooth_scaler_downx.c b/libraries/evas/src/lib/engines/common/evas_scale_smooth_scaler_downx.c
new file mode 100644
index 0000000..50b2e5c
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_scale_smooth_scaler_downx.c
@@ -0,0 +1,259 @@
1{
2 int Cx, j;
3 DATA32 *pix, *dptr, *pbuf, **yp;
4 int r, g, b, a, rr, gg, bb, aa;
5 int *xp, xap, yap, pos;
6 int dyy, dxx;
7 int w = dst_clip_w;
8#ifdef EVAS_SLI
9 int ysli = dst_clip_y;
10#endif
11
12 dptr = dst_ptr;
13 pos = (src_region_y * src_w) + src_region_x;
14 dyy = dst_clip_y - dst_region_y;
15 dxx = dst_clip_x - dst_region_x;
16
17 xp = xpoints;// + dxx;
18 yp = ypoints;// + dyy;
19 xapp = xapoints;// + dxx;
20 yapp = yapoints;// + dyy;
21 pbuf = buf;
22
23 if (src->cache_entry.flags.alpha)
24 {
25 while (dst_clip_h--)
26 {
27#ifdef EVAS_SLI
28 if (((ysli) % dc->sli.h) == dc->sli.y)
29#endif
30 {
31 while (dst_clip_w--)
32 {
33 Cx = *xapp >> 16;
34 xap = *xapp & 0xffff;
35 pix = *yp + *xp + pos;
36
37 a = (A_VAL(pix) * xap) >> 10;
38 r = (R_VAL(pix) * xap) >> 10;
39 g = (G_VAL(pix) * xap) >> 10;
40 b = (B_VAL(pix) * xap) >> 10;
41 for (j = (1 << 14) - xap; j > Cx; j -= Cx)
42 {
43 pix++;
44 a += (A_VAL(pix) * Cx) >> 10;
45 r += (R_VAL(pix) * Cx) >> 10;
46 g += (G_VAL(pix) * Cx) >> 10;
47 b += (B_VAL(pix) * Cx) >> 10;
48 }
49 if (j > 0)
50 {
51 pix++;
52 a += (A_VAL(pix) * j) >> 10;
53 r += (R_VAL(pix) * j) >> 10;
54 g += (G_VAL(pix) * j) >> 10;
55 b += (B_VAL(pix) * j) >> 10;
56 }
57 if ((yap = *yapp) > 0)
58 {
59 pix = *yp + *xp + src_w + pos;
60 aa = (A_VAL(pix) * xap) >> 10;
61 rr = (R_VAL(pix) * xap) >> 10;
62 gg = (G_VAL(pix) * xap) >> 10;
63 bb = (B_VAL(pix) * xap) >> 10;
64 for (j = (1 << 14) - xap; j > Cx; j -= Cx)
65 {
66 pix++;
67 aa += (A_VAL(pix) * Cx) >> 10;
68 rr += (R_VAL(pix) * Cx) >> 10;
69 gg += (G_VAL(pix) * Cx) >> 10;
70 bb += (B_VAL(pix) * Cx) >> 10;
71 }
72 if (j > 0)
73 {
74 pix++;
75 aa += (A_VAL(pix) * j) >> 10;
76 rr += (R_VAL(pix) * j) >> 10;
77 gg += (G_VAL(pix) * j) >> 10;
78 bb += (B_VAL(pix) * j) >> 10;
79 }
80 a += ((aa - a) * yap) >> 8;
81 r += ((rr - r) * yap) >> 8;
82 g += ((gg - g) * yap) >> 8;
83 b += ((bb - b) * yap) >> 8;
84 }
85 *pbuf++ = ARGB_JOIN(((a + (1 << 3)) >> 4),
86 ((r + (1 << 3)) >> 4),
87 ((g + (1 << 3)) >> 4),
88 ((b + (1 << 3)) >> 4));
89 xp++; xapp++;
90 }
91
92 func(buf, NULL, dc->mul.col, dptr, w);
93 }
94#ifdef EVAS_SLI
95 ysli++;
96#endif
97 pbuf = buf;
98 dptr += dst_w; dst_clip_w = w;
99 yp++; yapp++;
100 xp = xpoints;// + dxx;
101 xapp = xapoints;// + dxx;
102 }
103 }
104 else
105 {
106#ifdef DIRECT_SCALE
107 if ((!src->cache_entry.flags.alpha) &&
108 (!dst->cache_entry.flags.alpha) &&
109 (!dc->mul.use))
110 {
111 while (dst_clip_h--)
112 {
113 pbuf = dptr;
114#ifdef EVAS_SLI
115 if (((ysli) % dc->sli.h) == dc->sli.y)
116#endif
117 {
118 while (dst_clip_w--)
119 {
120 Cx = *xapp >> 16;
121 xap = *xapp & 0xffff;
122 pix = *yp + *xp + pos;
123
124 r = (R_VAL(pix) * xap) >> 10;
125 g = (G_VAL(pix) * xap) >> 10;
126 b = (B_VAL(pix) * xap) >> 10;
127 for (j = (1 << 14) - xap; j > Cx; j -= Cx)
128 {
129 pix++;
130 r += (R_VAL(pix) * Cx) >> 10;
131 g += (G_VAL(pix) * Cx) >> 10;
132 b += (B_VAL(pix) * Cx) >> 10;
133 }
134 if (j > 0)
135 {
136 pix++;
137 r += (R_VAL(pix) * j) >> 10;
138 g += (G_VAL(pix) * j) >> 10;
139 b += (B_VAL(pix) * j) >> 10;
140 }
141 if ((yap = *yapp) > 0)
142 {
143 pix = *yp + *xp + src_w + pos;
144 rr = (R_VAL(pix) * xap) >> 10;
145 gg = (G_VAL(pix) * xap) >> 10;
146 bb = (B_VAL(pix) * xap) >> 10;
147 for (j = (1 << 14) - xap; j > Cx; j -= Cx)
148 {
149 pix++;
150 rr += (R_VAL(pix) * Cx) >> 10;
151 gg += (G_VAL(pix) * Cx) >> 10;
152 bb += (B_VAL(pix) * Cx) >> 10;
153 }
154 if (j > 0)
155 {
156 pix++;
157 rr += (R_VAL(pix) * j) >> 10;
158 gg += (G_VAL(pix) * j) >> 10;
159 bb += (B_VAL(pix) * j) >> 10;
160 }
161 r += ((rr - r) * yap) >> 8;
162 g += ((gg - g) * yap) >> 8;
163 b += ((bb - b) * yap) >> 8;
164 }
165 *pbuf++ = ARGB_JOIN(0xff,
166 ((r + (1 << 3)) >> 4),
167 ((g + (1 << 3)) >> 4),
168 ((b + (1 << 3)) >> 4));
169 xp++; xapp++;
170 }
171 }
172#ifdef EVAS_SLI
173 ysli++;
174#endif
175
176 dptr += dst_w; dst_clip_w = w;
177 yp++; yapp++;
178 xp = xpoints;// + dxx;
179 xapp = xapoints;// + dxx;
180 }
181 }
182 else
183#endif
184 {
185 while (dst_clip_h--)
186 {
187#ifdef EVAS_SLI
188 if (((ysli) % dc->sli.h) == dc->sli.y)
189#endif
190 {
191 while (dst_clip_w--)
192 {
193 Cx = *xapp >> 16;
194 xap = *xapp & 0xffff;
195 pix = *yp + *xp + pos;
196
197 r = (R_VAL(pix) * xap) >> 10;
198 g = (G_VAL(pix) * xap) >> 10;
199 b = (B_VAL(pix) * xap) >> 10;
200 for (j = (1 << 14) - xap; j > Cx; j -= Cx)
201 {
202 pix++;
203 r += (R_VAL(pix) * Cx) >> 10;
204 g += (G_VAL(pix) * Cx) >> 10;
205 b += (B_VAL(pix) * Cx) >> 10;
206 }
207 if (j > 0)
208 {
209 pix++;
210 r += (R_VAL(pix) * j) >> 10;
211 g += (G_VAL(pix) * j) >> 10;
212 b += (B_VAL(pix) * j) >> 10;
213 }
214 if ((yap = *yapp) > 0)
215 {
216 pix = *yp + *xp + src_w + pos;
217 rr = (R_VAL(pix) * xap) >> 10;
218 gg = (G_VAL(pix) * xap) >> 10;
219 bb = (B_VAL(pix) * xap) >> 10;
220 for (j = (1 << 14) - xap; j > Cx; j -= Cx)
221 {
222 pix++;
223 rr += (R_VAL(pix) * Cx) >> 10;
224 gg += (G_VAL(pix) * Cx) >> 10;
225 bb += (B_VAL(pix) * Cx) >> 10;
226 }
227 if (j > 0)
228 {
229 pix++;
230 rr += (R_VAL(pix) * j) >> 10;
231 gg += (G_VAL(pix) * j) >> 10;
232 bb += (B_VAL(pix) * j) >> 10;
233 }
234 r += ((rr - r) * yap) >> 8;
235 g += ((gg - g) * yap) >> 8;
236 b += ((bb - b) * yap) >> 8;
237 }
238 *pbuf++ = ARGB_JOIN(0xff,
239 ((r + (1 << 3)) >> 4),
240 ((g + (1 << 3)) >> 4),
241 ((b + (1 << 3)) >> 4));
242 xp++; xapp++;
243 }
244
245 func(buf, NULL, dc->mul.col, dptr, w);
246 }
247#ifdef EVAS_SLI
248 ysli++;
249#endif
250
251 pbuf = buf;
252 dptr += dst_w; dst_clip_w = w;
253 yp++; yapp++;
254 xp = xpoints;// + dxx;
255 xapp = xapoints;// + dxx;
256 }
257 }
258 }
259}
diff --git a/libraries/evas/src/lib/engines/common/evas_scale_smooth_scaler_downx_downy.c b/libraries/evas/src/lib/engines/common/evas_scale_smooth_scaler_downx_downy.c
new file mode 100644
index 0000000..ab0c74e
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_scale_smooth_scaler_downx_downy.c
@@ -0,0 +1,387 @@
1{
2 int Cx, Cy, i, j;
3 DATA32 *dptr, *sptr, *pix, *pbuf;
4 int a, r, g, b, rx, gx, bx, ax;
5 int xap, yap, pos;
6 int dyy, dxx;
7#ifdef EVAS_SLI
8 int ysli = dst_clip_y;
9#endif
10
11 DATA32 **yp;
12 int *xp;
13 int w = dst_clip_w;
14
15 dptr = dst_ptr;
16 pos = (src_region_y * src_w) + src_region_x;
17 dyy = dst_clip_y - dst_region_y;
18 dxx = dst_clip_x - dst_region_x;
19
20 xp = xpoints;// + dxx;
21 yp = ypoints;// + dyy;
22 xapp = xapoints;// + dxx;
23 yapp = yapoints;// + dyy;
24 pbuf = buf;
25/*#ifndef SCALE_USING_MMX */
26/* for now there's no mmx down scaling - so C only */
27#if 1
28 if (src->cache_entry.flags.alpha)
29 {
30 while (dst_clip_h--)
31 {
32#ifdef EVAS_SLI
33 if (((ysli) % dc->sli.h) == dc->sli.y)
34#endif
35 {
36 Cy = *yapp >> 16;
37 yap = *yapp & 0xffff;
38
39 while (dst_clip_w--)
40 {
41 Cx = *xapp >> 16;
42 xap = *xapp & 0xffff;
43
44 sptr = *yp + *xp + pos;
45 pix = sptr;
46 sptr += src_w;
47
48 ax = (A_VAL(pix) * xap) >> 9;
49 rx = (R_VAL(pix) * xap) >> 9;
50 gx = (G_VAL(pix) * xap) >> 9;
51 bx = (B_VAL(pix) * xap) >> 9;
52 pix++;
53 for (i = (1 << 14) - xap; i > Cx; i -= Cx)
54 {
55 ax += (A_VAL(pix) * Cx) >> 9;
56 rx += (R_VAL(pix) * Cx) >> 9;
57 gx += (G_VAL(pix) * Cx) >> 9;
58 bx += (B_VAL(pix) * Cx) >> 9;
59 pix++;
60 }
61 if (i > 0)
62 {
63 ax += (A_VAL(pix) * i) >> 9;
64 rx += (R_VAL(pix) * i) >> 9;
65 gx += (G_VAL(pix) * i) >> 9;
66 bx += (B_VAL(pix) * i) >> 9;
67 }
68
69 a = (ax * yap) >> 14;
70 r = (rx * yap) >> 14;
71 g = (gx * yap) >> 14;
72 b = (bx * yap) >> 14;
73
74 for (j = (1 << 14) - yap; j > Cy; j -= Cy)
75 {
76 pix = sptr;
77 sptr += src_w;
78 ax = (A_VAL(pix) * xap) >> 9;
79 rx = (R_VAL(pix) * xap) >> 9;
80 gx = (G_VAL(pix) * xap) >> 9;
81 bx = (B_VAL(pix) * xap) >> 9;
82 pix++;
83 for (i = (1 << 14) - xap; i > Cx; i -= Cx)
84 {
85 ax += (A_VAL(pix) * Cx) >> 9;
86 rx += (R_VAL(pix) * Cx) >> 9;
87 gx += (G_VAL(pix) * Cx) >> 9;
88 bx += (B_VAL(pix) * Cx) >> 9;
89 pix++;
90 }
91 if (i > 0)
92 {
93 ax += (A_VAL(pix) * i) >> 9;
94 rx += (R_VAL(pix) * i) >> 9;
95 gx += (G_VAL(pix) * i) >> 9;
96 bx += (B_VAL(pix) * i) >> 9;
97 }
98
99 a += (ax * Cy) >> 14;
100 r += (rx * Cy) >> 14;
101 g += (gx * Cy) >> 14;
102 b += (bx * Cy) >> 14;
103 }
104 if (j > 0)
105 {
106 pix = sptr;
107 sptr += src_w;
108 ax = (A_VAL(pix) * xap) >> 9;
109 rx = (R_VAL(pix) * xap) >> 9;
110 gx = (G_VAL(pix) * xap) >> 9;
111 bx = (B_VAL(pix) * xap) >> 9;
112 pix++;
113 for (i = (1 << 14) - xap; i > Cx; i -= Cx)
114 {
115 ax += (A_VAL(pix) * Cx) >> 9;
116 rx += (R_VAL(pix) * Cx) >> 9;
117 gx += (G_VAL(pix) * Cx) >> 9;
118 bx += (B_VAL(pix) * Cx) >> 9;
119 pix++;
120 }
121 if (i > 0)
122 {
123 ax += (A_VAL(pix) * i) >> 9;
124 rx += (R_VAL(pix) * i) >> 9;
125 gx += (G_VAL(pix) * i) >> 9;
126 bx += (B_VAL(pix) * i) >> 9;
127 }
128
129 a += (ax * j) >> 14;
130 r += (rx * j) >> 14;
131 g += (gx * j) >> 14;
132 b += (bx * j) >> 14;
133 }
134 *pbuf++ = ARGB_JOIN(((a + (1 << 4)) >> 5),
135 ((r + (1 << 4)) >> 5),
136 ((g + (1 << 4)) >> 5),
137 ((b + (1 << 4)) >> 5));
138 xp++; xapp++;
139 }
140
141 func(buf, NULL, dc->mul.col, dptr, w);
142 }
143#ifdef EVAS_SLI
144 ysli++;
145#endif
146 pbuf = buf;
147 dptr += dst_w; dst_clip_w = w;
148 xp = xpoints;// + dxx;
149 xapp = xapoints;// + dxx;
150 yp++; yapp++;
151 }
152 }
153 else
154 {
155#ifdef DIRECT_SCALE
156 if ((!src->cache_entry.flags.alpha) &&
157 (!dst->cache_entry.flags.alpha) &&
158 (!dc->mul.use))
159 {
160 while (dst_clip_h--)
161 {
162#ifdef EVAS_SLI
163 if (((ysli) % dc->sli.h) == dc->sli.y)
164#endif
165 {
166 Cy = *yapp >> 16;
167 yap = *yapp & 0xffff;
168
169 pbuf = dptr;
170 while (dst_clip_w--)
171 {
172 Cx = *xapp >> 16;
173 xap = *xapp & 0xffff;
174
175 sptr = *yp + *xp + pos;
176 pix = sptr;
177 sptr += src_w;
178
179 rx = (R_VAL(pix) * xap) >> 9;
180 gx = (G_VAL(pix) * xap) >> 9;
181 bx = (B_VAL(pix) * xap) >> 9;
182 pix++;
183 for (i = (1 << 14) - xap; i > Cx; i -= Cx)
184 {
185 rx += (R_VAL(pix) * Cx) >> 9;
186 gx += (G_VAL(pix) * Cx) >> 9;
187 bx += (B_VAL(pix) * Cx) >> 9;
188 pix++;
189 }
190 if (i > 0)
191 {
192 rx += (R_VAL(pix) * i) >> 9;
193 gx += (G_VAL(pix) * i) >> 9;
194 bx += (B_VAL(pix) * i) >> 9;
195 }
196
197 r = (rx * yap) >> 14;
198 g = (gx * yap) >> 14;
199 b = (bx * yap) >> 14;
200
201 for (j = (1 << 14) - yap; j > Cy; j -= Cy)
202 {
203 pix = sptr;
204 sptr += src_w;
205 rx = (R_VAL(pix) * xap) >> 9;
206 gx = (G_VAL(pix) * xap) >> 9;
207 bx = (B_VAL(pix) * xap) >> 9;
208 pix++;
209 for (i = (1 << 14) - xap; i > Cx; i -= Cx)
210 {
211 rx += (R_VAL(pix) * Cx) >> 9;
212 gx += (G_VAL(pix) * Cx) >> 9;
213 bx += (B_VAL(pix) * Cx) >> 9;
214 pix++;
215 }
216 if (i > 0)
217 {
218 rx += (R_VAL(pix) * i) >> 9;
219 gx += (G_VAL(pix) * i) >> 9;
220 bx += (B_VAL(pix) * i) >> 9;
221 }
222
223 r += (rx * Cy) >> 14;
224 g += (gx * Cy) >> 14;
225 b += (bx * Cy) >> 14;
226 }
227 if (j > 0)
228 {
229 pix = sptr;
230 sptr += src_w;
231 rx = (R_VAL(pix) * xap) >> 9;
232 gx = (G_VAL(pix) * xap) >> 9;
233 bx = (B_VAL(pix) * xap) >> 9;
234 pix++;
235 for (i = (1 << 14) - xap; i > Cx; i -= Cx)
236 {
237 rx += (R_VAL(pix) * Cx) >> 9;
238 gx += (G_VAL(pix) * Cx) >> 9;
239 bx += (B_VAL(pix) * Cx) >> 9;
240 pix++;
241 }
242 if (i > 0)
243 {
244 rx += (R_VAL(pix) * i) >> 9;
245 gx += (G_VAL(pix) * i) >> 9;
246 bx += (B_VAL(pix) * i) >> 9;
247 }
248
249 r += (rx * j) >> 14;
250 g += (gx * j) >> 14;
251 b += (bx * j) >> 14;
252 }
253 *pbuf++ = ARGB_JOIN(0xff,
254 ((r + (1 << 4)) >> 5),
255 ((g + (1 << 4)) >> 5),
256 ((b + (1 << 4)) >> 5));
257 xp++; xapp++;
258 }
259 }
260#ifdef EVAS_SLI
261 ysli++;
262#endif
263 dptr += dst_w; dst_clip_w = w;
264 xp = xpoints;// + dxx;
265 xapp = xapoints;// + dxx;
266 yp++; yapp++;
267 }
268 }
269 else
270#endif
271 {
272 while (dst_clip_h--)
273 {
274#ifdef EVAS_SLI
275 if (((ysli) % dc->sli.h) == dc->sli.y)
276#endif
277 {
278 Cy = *yapp >> 16;
279 yap = *yapp & 0xffff;
280
281 while (dst_clip_w--)
282 {
283 Cx = *xapp >> 16;
284 xap = *xapp & 0xffff;
285
286 sptr = *yp + *xp + pos;
287 pix = sptr;
288 sptr += src_w;
289
290 rx = (R_VAL(pix) * xap) >> 9;
291 gx = (G_VAL(pix) * xap) >> 9;
292 bx = (B_VAL(pix) * xap) >> 9;
293 pix++;
294 for (i = (1 << 14) - xap; i > Cx; i -= Cx)
295 {
296 rx += (R_VAL(pix) * Cx) >> 9;
297 gx += (G_VAL(pix) * Cx) >> 9;
298 bx += (B_VAL(pix) * Cx) >> 9;
299 pix++;
300 }
301 if (i > 0)
302 {
303 rx += (R_VAL(pix) * i) >> 9;
304 gx += (G_VAL(pix) * i) >> 9;
305 bx += (B_VAL(pix) * i) >> 9;
306 }
307
308 r = (rx * yap) >> 14;
309 g = (gx * yap) >> 14;
310 b = (bx * yap) >> 14;
311
312 for (j = (1 << 14) - yap; j > Cy; j -= Cy)
313 {
314 pix = sptr;
315 sptr += src_w;
316 rx = (R_VAL(pix) * xap) >> 9;
317 gx = (G_VAL(pix) * xap) >> 9;
318 bx = (B_VAL(pix) * xap) >> 9;
319 pix++;
320 for (i = (1 << 14) - xap; i > Cx; i -= Cx)
321 {
322 rx += (R_VAL(pix) * Cx) >> 9;
323 gx += (G_VAL(pix) * Cx) >> 9;
324 bx += (B_VAL(pix) * Cx) >> 9;
325 pix++;
326 }
327 if (i > 0)
328 {
329 rx += (R_VAL(pix) * i) >> 9;
330 gx += (G_VAL(pix) * i) >> 9;
331 bx += (B_VAL(pix) * i) >> 9;
332 }
333
334 r += (rx * Cy) >> 14;
335 g += (gx * Cy) >> 14;
336 b += (bx * Cy) >> 14;
337 }
338 if (j > 0)
339 {
340 pix = sptr;
341 sptr += src_w;
342 rx = (R_VAL(pix) * xap) >> 9;
343 gx = (G_VAL(pix) * xap) >> 9;
344 bx = (B_VAL(pix) * xap) >> 9;
345 pix++;
346 for (i = (1 << 14) - xap; i > Cx; i -= Cx)
347 {
348 rx += (R_VAL(pix) * Cx) >> 9;
349 gx += (G_VAL(pix) * Cx) >> 9;
350 bx += (B_VAL(pix) * Cx) >> 9;
351 pix++;
352 }
353 if (i > 0)
354 {
355 rx += (R_VAL(pix) * i) >> 9;
356 gx += (G_VAL(pix) * i) >> 9;
357 bx += (B_VAL(pix) * i) >> 9;
358 }
359
360 r += (rx * j) >> 14;
361 g += (gx * j) >> 14;
362 b += (bx * j) >> 14;
363 }
364 *pbuf++ = ARGB_JOIN(0xff,
365 ((r + (1 << 4)) >> 5),
366 ((g + (1 << 4)) >> 5),
367 ((b + (1 << 4)) >> 5));
368 xp++; xapp++;
369 }
370
371 func(buf, NULL, dc->mul.col, dptr, w);
372 }
373#ifdef EVAS_SLI
374 ysli++;
375#endif
376 pbuf = buf;
377 dptr += dst_w; dst_clip_w = w;
378 xp = xpoints;// + dxx;
379 xapp = xapoints;// + dxx;
380 yp++; yapp++;
381 }
382 }
383 }
384#else
385 /* MMX scaling down would go here */
386#endif
387}
diff --git a/libraries/evas/src/lib/engines/common/evas_scale_smooth_scaler_downy.c b/libraries/evas/src/lib/engines/common/evas_scale_smooth_scaler_downy.c
new file mode 100644
index 0000000..4c5448e
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_scale_smooth_scaler_downy.c
@@ -0,0 +1,260 @@
1{
2 int Cy, j;
3 DATA32 *dptr, *pix, *pbuf, **yp;
4 int r, g, b, a, rr, gg, bb, aa;
5 int *xp, xap, yap, pos;
6 int dyy, dxx;
7 int w = dst_clip_w;
8#ifdef EVAS_SLI
9 int ysli = dst_clip_y;
10#endif
11
12 dptr = dst_ptr;
13 pos = (src_region_y * src_w) + src_region_x;
14 dyy = dst_clip_y - dst_region_y;
15 dxx = dst_clip_x - dst_region_x;
16
17 xp = xpoints;// + dxx;
18 yp = ypoints;// + dyy;
19 xapp = xapoints;// + dxx;
20 yapp = yapoints;// + dyy;
21 pbuf = buf;
22
23 if (src->cache_entry.flags.alpha)
24 {
25 while (dst_clip_h--)
26 {
27#ifdef EVAS_SLI
28 if (((ysli) % dc->sli.h) == dc->sli.y)
29#endif
30 {
31 Cy = *yapp >> 16;
32 yap = *yapp & 0xffff;
33
34 while (dst_clip_w--)
35 {
36 pix = *yp + *xp + pos;
37
38 a = (A_VAL(pix) * yap) >> 10;
39 r = (R_VAL(pix) * yap) >> 10;
40 g = (G_VAL(pix) * yap) >> 10;
41 b = (B_VAL(pix) * yap) >> 10;
42 for (j = (1 << 14) - yap; j > Cy; j -= Cy)
43 {
44 pix += src_w;
45 a += (A_VAL(pix) * Cy) >> 10;
46 r += (R_VAL(pix) * Cy) >> 10;
47 g += (G_VAL(pix) * Cy) >> 10;
48 b += (B_VAL(pix) * Cy) >> 10;
49 }
50 if (j > 0)
51 {
52 pix += src_w;
53 a += (A_VAL(pix) * j) >> 10;
54 r += (R_VAL(pix) * j) >> 10;
55 g += (G_VAL(pix) * j) >> 10;
56 b += (B_VAL(pix) * j) >> 10;
57 }
58 if ((xap = *xapp) > 0)
59 {
60 pix = *yp + *xp + 1 + pos;
61 aa = (A_VAL(pix) * yap) >> 10;
62 rr = (R_VAL(pix) * yap) >> 10;
63 gg = (G_VAL(pix) * yap) >> 10;
64 bb = (B_VAL(pix) * yap) >> 10;
65 for (j = (1 << 14) - yap; j > Cy; j -= Cy)
66 {
67 pix += src_w;
68 aa += (A_VAL(pix) * Cy) >> 10;
69 rr += (R_VAL(pix) * Cy) >> 10;
70 gg += (G_VAL(pix) * Cy) >> 10;
71 bb += (B_VAL(pix) * Cy) >> 10;
72 }
73 if (j > 0)
74 {
75 pix += src_w;
76 aa += (A_VAL(pix) * j) >> 10;
77 rr += (R_VAL(pix) * j) >> 10;
78 gg += (G_VAL(pix) * j) >> 10;
79 bb += (B_VAL(pix) * j) >> 10;
80 }
81 a += ((aa - a) * xap) >> 8;
82 r += ((rr - r) * xap) >> 8;
83 g += ((gg - g) * xap) >> 8;
84 b += ((bb - b) * xap) >> 8;
85 }
86 *pbuf++ = ARGB_JOIN(((a + (1 << 3)) >> 4),
87 ((r + (1 << 3)) >> 4),
88 ((g + (1 << 3)) >> 4),
89 ((b + (1 << 3)) >> 4));
90 xp++; xapp++;
91 }
92
93 func(buf, NULL, dc->mul.col, dptr, w);
94 }
95#ifdef EVAS_SLI
96 ysli++;
97#endif
98 pbuf = buf;
99 dptr += dst_w; dst_clip_w = w;
100 yp++; yapp++;
101 xp = xpoints;// + dxx;
102 xapp = xapoints;// + dxx;
103 }
104 }
105 else
106 {
107#ifdef DIRECT_SCALE
108 if ((!src->cache_entry.flags.alpha) &&
109 (!dst->cache_entry.flags.alpha) &&
110 (!dc->mul.use))
111 {
112 while (dst_clip_h--)
113 {
114#ifdef EVAS_SLI
115 if (((ysli) % dc->sli.h) == dc->sli.y)
116#endif
117 {
118 Cy = *yapp >> 16;
119 yap = *yapp & 0xffff;
120
121 pbuf = dptr;
122 while (dst_clip_w--)
123 {
124 pix = *yp + *xp + pos;
125
126 r = (R_VAL(pix) * yap) >> 10;
127 g = (G_VAL(pix) * yap) >> 10;
128 b = (B_VAL(pix) * yap) >> 10;
129 for (j = (1 << 14) - yap; j > Cy; j -= Cy)
130 {
131 pix += src_w;
132 r += (R_VAL(pix) * Cy) >> 10;
133 g += (G_VAL(pix) * Cy) >> 10;
134 b += (B_VAL(pix) * Cy) >> 10;
135 }
136 if (j > 0)
137 {
138 pix += src_w;
139 r += (R_VAL(pix) * j) >> 10;
140 g += (G_VAL(pix) * j) >> 10;
141 b += (B_VAL(pix) * j) >> 10;
142 }
143 if ((xap = *xapp) > 0)
144 {
145 pix = *yp + *xp + 1 + pos;
146 rr = (R_VAL(pix) * yap) >> 10;
147 gg = (G_VAL(pix) * yap) >> 10;
148 bb = (B_VAL(pix) * yap) >> 10;
149 for (j = (1 << 14) - yap; j > Cy; j -= Cy)
150 {
151 pix += src_w;
152 rr += (R_VAL(pix) * Cy) >> 10;
153 gg += (G_VAL(pix) * Cy) >> 10;
154 bb += (B_VAL(pix) * Cy) >> 10;
155 }
156 if (j > 0)
157 {
158 pix += src_w;
159 rr += (R_VAL(pix) * j) >> 10;
160 gg += (G_VAL(pix) * j) >> 10;
161 bb += (B_VAL(pix) * j) >> 10;
162 }
163 r += ((rr - r) * xap) >> 8;
164 g += ((gg - g) * xap) >> 8;
165 b += ((bb - b) * xap) >> 8;
166 }
167 *pbuf++ = ARGB_JOIN(0xff,
168 ((r + (1 << 3)) >> 4),
169 ((g + (1 << 3)) >> 4),
170 ((b + (1 << 3)) >> 4));
171 xp++; xapp++;
172 }
173 }
174#ifdef EVAS_SLI
175 ysli++;
176#endif
177 dptr += dst_w; dst_clip_w = w;
178 yp++; yapp++;
179 xp = xpoints;// + dxx;
180 xapp = xapoints;// + dxx;
181 }
182 }
183 else
184#endif
185 {
186 while (dst_clip_h--)
187 {
188#ifdef EVAS_SLI
189 if (((ysli) % dc->sli.h) == dc->sli.y)
190#endif
191 {
192 Cy = *yapp >> 16;
193 yap = *yapp & 0xffff;
194
195 while (dst_clip_w--)
196 {
197 pix = *yp + *xp + pos;
198
199 r = (R_VAL(pix) * yap) >> 10;
200 g = (G_VAL(pix) * yap) >> 10;
201 b = (B_VAL(pix) * yap) >> 10;
202 for (j = (1 << 14) - yap; j > Cy; j -= Cy)
203 {
204 pix += src_w;
205 r += (R_VAL(pix) * Cy) >> 10;
206 g += (G_VAL(pix) * Cy) >> 10;
207 b += (B_VAL(pix) * Cy) >> 10;
208 }
209 if (j > 0)
210 {
211 pix += src_w;
212 r += (R_VAL(pix) * j) >> 10;
213 g += (G_VAL(pix) * j) >> 10;
214 b += (B_VAL(pix) * j) >> 10;
215 }
216 if ((xap = *xapp) > 0)
217 {
218 pix = *yp + *xp + 1 + pos;
219 rr = (R_VAL(pix) * yap) >> 10;
220 gg = (G_VAL(pix) * yap) >> 10;
221 bb = (B_VAL(pix) * yap) >> 10;
222 for (j = (1 << 14) - yap; j > Cy; j -= Cy)
223 {
224 pix += src_w;
225 rr += (R_VAL(pix) * Cy) >> 10;
226 gg += (G_VAL(pix) * Cy) >> 10;
227 bb += (B_VAL(pix) * Cy) >> 10;
228 }
229 if (j > 0)
230 {
231 pix += src_w;
232 rr += (R_VAL(pix) * j) >> 10;
233 gg += (G_VAL(pix) * j) >> 10;
234 bb += (B_VAL(pix) * j) >> 10;
235 }
236 r += ((rr - r) * xap) >> 8;
237 g += ((gg - g) * xap) >> 8;
238 b += ((bb - b) * xap) >> 8;
239 }
240 *pbuf++ = ARGB_JOIN(0xff,
241 ((r + (1 << 3)) >> 4),
242 ((g + (1 << 3)) >> 4),
243 ((b + (1 << 3)) >> 4));
244 xp++; xapp++;
245 }
246
247 func(buf, NULL, dc->mul.col, dptr, w);
248 }
249#ifdef EVAS_SLI
250 ysli++;
251#endif
252 pbuf = buf;
253 dptr += dst_w; dst_clip_w = w;
254 yp++; yapp++;
255 xp = xpoints;// + dxx;
256 xapp = xapoints;// + dxx;
257 }
258 }
259 }
260}
diff --git a/libraries/evas/src/lib/engines/common/evas_scale_smooth_scaler_noscale.c b/libraries/evas/src/lib/engines/common/evas_scale_smooth_scaler_noscale.c
new file mode 100644
index 0000000..24529e5
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_scale_smooth_scaler_noscale.c
@@ -0,0 +1,62 @@
1{
2 DATA32 *ptr;
3 RGBA_Gfx_Func func;
4 RGBA_Image *maskobj;
5 DATA8 *mask = NULL;
6#ifdef EVAS_SLI
7 int ysli = dst_clip_y;
8#endif
9
10 ptr = src->image.data + ((dst_clip_y - dst_region_y + src_region_y) * src_w) + (dst_clip_x - dst_region_x) + src_region_x;
11 if (dc->mask.mask)
12 {
13 func = evas_common_gfx_func_composite_pixel_mask_span_get(NULL, NULL, dst_clip_w, dc->render_op);
14 maskobj = dc->mask.mask;
15 mask = maskobj->mask.mask;
16 }
17 else if (dc->mul.use)
18 func = evas_common_gfx_func_composite_pixel_color_span_get(src, dc->mul.col, dst, dst_clip_w, dc->render_op);
19 else
20 func = evas_common_gfx_func_composite_pixel_span_get(src, dst, dst_clip_w, dc->render_op);
21
22 if (mask)
23 {
24 // mask += dst_clip_x - dc->mask.x;
25 // mask += (dst_clip_y - dc->mask.y) * maskobj->cache_entry.w;
26 while (dst_clip_h--)
27 {
28
29#ifdef EVAS_SLI
30 if (((ysli) % dc->sli.h) == dc->sli.y)
31#endif
32 {
33 func(ptr, mask, dc->mul.col, dst_ptr, dst_clip_w);
34 }
35#ifdef EVAS_SLI
36 ysli++;
37#endif
38 ptr += src_w;
39 dst_ptr += dst_w;
40 mask += maskobj->cache_entry.w;
41 }
42 }
43 else
44 {
45 while (dst_clip_h--)
46 {
47#ifdef EVAS_SLI
48 if (((ysli) % dc->sli.h) == dc->sli.y)
49#endif
50 {
51 func(ptr, NULL, dc->mul.col, dst_ptr, dst_clip_w);
52 }
53#ifdef EVAS_SLI
54 ysli++;
55#endif
56 ptr += src_w;
57 dst_ptr += dst_w;
58 }
59 }
60}
61
62/* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/
diff --git a/libraries/evas/src/lib/engines/common/evas_scale_smooth_scaler_up.c b/libraries/evas/src/lib/engines/common/evas_scale_smooth_scaler_up.c
new file mode 100644
index 0000000..7327ac5
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_scale_smooth_scaler_up.c
@@ -0,0 +1,266 @@
1{
2 int srx = src_region_x, sry = src_region_y;
3 int srw = src_region_w, srh = src_region_h;
4 int drx = dst_region_x, dry = dst_region_y;
5 int drw = dst_region_w, drh = dst_region_h;
6
7 int dsxx, dsyy, sxx, syy, sx, sy;
8 int cx, cy;
9 int direct_scale = 0, buf_step = 0;
10
11 DATA32 *psrc, *pdst, *pdst_end;
12 DATA32 *buf, *pbuf, *pbuf_end;
13 RGBA_Gfx_Func func = NULL;
14
15 /* check value to make overflow(only check value related with overflow) */
16 if ((src_region_w > SCALE_SIZE_MAX) ||
17 (src_region_h > SCALE_SIZE_MAX)) return;
18
19 /* a scanline buffer */
20 pdst = dst_ptr; // it's been set at (dst_clip_x, dst_clip_y)
21 pdst_end = pdst + (dst_clip_h * dst_w);
22 if (!dc->mul.use)
23 {
24 if ((dc->render_op == _EVAS_RENDER_BLEND) && !src->cache_entry.flags.alpha)
25 { direct_scale = 1; buf_step = dst->cache_entry.w; }
26 else if (dc->render_op == _EVAS_RENDER_COPY)
27 {
28 direct_scale = 1; buf_step = dst->cache_entry.w;
29 if (src->cache_entry.flags.alpha)
30 dst->cache_entry.flags.alpha = 1;
31 }
32 }
33 if (!direct_scale)
34 {
35 buf = alloca(dst_clip_w * sizeof(DATA32));
36 if (dc->mul.use)
37 func = evas_common_gfx_func_composite_pixel_color_span_get(src, dc->mul.col, dst, dst_clip_w, dc->render_op);
38 else
39 func = evas_common_gfx_func_composite_pixel_span_get(src, dst, dst_clip_w, dc->render_op);
40 }
41 else
42 buf = pdst;
43
44 if ((srw > 1) && (drw > 1))
45 dsxx = ((srw - 1) << 16) / (drw - 1);
46 else
47 dsxx = (srw << 16) / drw;
48 if ((srh > 1) && (drh > 1))
49 dsyy = ((srh - 1) << 16) / (drh - 1);
50 else
51 dsyy = (srh << 16) / drh;
52
53 cx = dst_clip_x - drx;
54 cy = dst_clip_y - dry;
55
56 sxx = (dsxx * cx);
57 syy = (dsyy * cy);
58
59 sy = syy >> 16;
60
61 if (drh == srh)
62 {
63 int sxx0 = sxx;
64#ifdef EVAS_SLI
65 int ysli = dst_clip_y;
66#endif
67 psrc = src->image.data + (src_w * (sry + cy)) + srx;
68 while (pdst < pdst_end)
69 {
70#ifdef EVAS_SLI
71 if (((ysli) % dc->sli.h) == dc->sli.y)
72#endif
73 {
74 pbuf = buf; pbuf_end = buf + dst_clip_w;
75 sxx = sxx0;
76#ifdef SCALE_USING_MMX
77 pxor_r2r(mm0, mm0);
78 MOV_A2R(ALPHA_255, mm5)
79#endif
80 while (pbuf < pbuf_end)
81 {
82 DATA32 p0, p1;
83 int ax;
84
85 sx = (sxx >> 16);
86 ax = 1 + ((sxx - (sx << 16)) >> 8);
87 p0 = p1 = *(psrc + sx);
88 if ((sx + 1) < srw)
89 p1 = *(psrc + sx + 1);
90#ifdef SCALE_USING_MMX
91 MOV_P2R(p0, mm1, mm0)
92 if (p0 | p1)
93 {
94 MOV_A2R(ax, mm3)
95 MOV_P2R(p1, mm2, mm0)
96 INTERP_256_R2R(mm3, mm2, mm1, mm5)
97 }
98 MOV_R2P(mm1, *pbuf, mm0)
99 pbuf++;
100#else
101 if (p0 | p1)
102 p0 = INTERP_256(ax, p1, p0);
103 *pbuf++ = p0;
104#endif
105 sxx += dsxx;
106 }
107 /* * blend here [clip_w *] buf -> dptr * */
108 if (!direct_scale)
109 func(buf, NULL, dc->mul.col, pdst, dst_clip_w);
110 }
111#ifdef EVAS_SLI
112 ysli++;
113#endif
114 pdst += dst_w;
115 psrc += src_w;
116 buf += buf_step;
117 }
118
119 goto done_scale_up;
120 }
121 else if (drw == srw)
122 {
123 DATA32 *ps = src->image.data + (src_w * sry) + srx + cx;
124#ifdef EVAS_SLI
125 int ysli = dst_clip_y;
126#endif
127
128 while (pdst < pdst_end)
129 {
130#ifdef EVAS_SLI
131 if (((ysli) % dc->sli.h) == dc->sli.y)
132#endif
133 {
134 int ay;
135
136 sy = syy >> 16;
137 psrc = ps + (sy * src_w);
138 ay = 1 + ((syy - (sy << 16)) >> 8);
139#ifdef SCALE_USING_MMX
140 pxor_r2r(mm0, mm0);
141 MOV_A2R(ALPHA_255, mm5)
142 MOV_A2R(ay, mm4)
143#endif
144 pbuf = buf; pbuf_end = buf + dst_clip_w;
145 while (pbuf < pbuf_end)
146 {
147 DATA32 p0 = *psrc, p2 = p0;
148
149 if ((sy + 1) < srh)
150 p2 = *(psrc + src_w);
151#ifdef SCALE_USING_MMX
152 MOV_P2R(p0, mm1, mm0)
153 if (p0 | p2)
154 {
155 MOV_P2R(p2, mm2, mm0)
156 INTERP_256_R2R(mm4, mm2, mm1, mm5)
157 }
158 MOV_R2P(mm1, *pbuf, mm0)
159 pbuf++;
160#else
161 if (p0 | p2)
162 p0 = INTERP_256(ay, p2, p0);
163 *pbuf++ = p0;
164#endif
165 psrc++;
166 }
167 /* * blend here [clip_w *] buf -> dptr * */
168 if (!direct_scale)
169 func(buf, NULL, dc->mul.col, pdst, dst_clip_w);
170 }
171#ifdef EVAS_SLI
172 ysli++;
173#endif
174 pdst += dst_w;
175 syy += dsyy;
176 buf += buf_step;
177 }
178 goto done_scale_up;
179 }
180
181 {
182 DATA32 *ps = src->image.data + (src_w * sry) + srx;
183 int sxx0 = sxx;
184#ifdef EVAS_SLI
185 int ysli = dst_clip_y;
186#endif
187
188 while (pdst < pdst_end)
189 {
190#ifdef EVAS_SLI
191 if (((ysli) % dc->sli.h) == dc->sli.y)
192#endif
193 {
194 int ay;
195
196 sy = syy >> 16;
197 psrc = ps + (sy * src_w);
198 ay = 1 + ((syy - (sy << 16)) >> 8);
199#ifdef SCALE_USING_MMX
200 MOV_A2R(ay, mm4)
201 pxor_r2r(mm0, mm0);
202 MOV_A2R(ALPHA_255, mm5)
203#endif
204 pbuf = buf; pbuf_end = buf + dst_clip_w;
205 sxx = sxx0;
206 while (pbuf < pbuf_end)
207 {
208 int ax;
209 DATA32 *p, *q;
210 DATA32 p0, p1, p2, p3;
211
212 sx = sxx >> 16;
213 ax = 1 + ((sxx - (sx << 16)) >> 8);
214 p = psrc + sx; q = p + src_w;
215 p0 = p1 = p2 = p3 = *p;
216 if ((sx + 1) < srw)
217 p1 = *(p + 1);
218 if ((sy + 1) < srh)
219 {
220 p2 = *q; p3 = p2;
221 if ((sx + 1) < srw)
222 p3 = *(q + 1);
223 }
224#ifdef SCALE_USING_MMX
225 MOV_A2R(ax, mm6)
226 MOV_P2R(p0, mm1, mm0)
227 if (p0 | p1)
228 {
229 MOV_P2R(p1, mm2, mm0)
230 INTERP_256_R2R(mm6, mm2, mm1, mm5)
231 }
232 MOV_P2R(p2, mm2, mm0)
233 if (p2 | p3)
234 {
235 MOV_P2R(p3, mm3, mm0)
236 INTERP_256_R2R(mm6, mm3, mm2, mm5)
237 }
238 INTERP_256_R2R(mm4, mm2, mm1, mm5)
239 MOV_R2P(mm1, *pbuf, mm0)
240 pbuf++;
241#else
242 if (p0 | p1)
243 p0 = INTERP_256(ax, p1, p0);
244 if (p2 | p3)
245 p2 = INTERP_256(ax, p3, p2);
246 if (p0 | p2)
247 p0 = INTERP_256(ay, p2, p0);
248 *pbuf++ = p0;
249#endif
250 sxx += dsxx;
251 }
252 /* * blend here [clip_w *] buf -> dptr * */
253 if (!direct_scale)
254 func(buf, NULL, dc->mul.col, pdst, dst_clip_w);
255 }
256#ifdef EVAS_SLI
257 ysli++;
258#endif
259 pdst += dst_w;
260 syy += dsyy;
261 buf += buf_step;
262 }
263 }
264 done_scale_up:
265 return;
266}
diff --git a/libraries/evas/src/lib/engines/common/evas_scale_span.c b/libraries/evas/src/lib/engines/common/evas_scale_span.c
new file mode 100644
index 0000000..e0fefb2
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_scale_span.c
@@ -0,0 +1,653 @@
1#include "evas_common.h"
2#include "evas_convert_color.h"
3#include "evas_scale_span.h"
4
5static void
6evas_common_scale_rgba_span_(DATA32 *src, DATA8 *mask __UNUSED__, int src_len, DATA32 mul_col, DATA32 *dst, int dst_len, int dir)
7{
8 int mul = 0, step = 1;
9 DATA32 *pdst = dst;
10
11 if (!src || !dst) return;
12 if ((src_len < 1) || (dst_len < 1)) return;
13 if ((src_len > SCALE_SIZE_MAX) || (dst_len > SCALE_SIZE_MAX)) return;
14 if (mul_col != 0xffffffff)
15 mul = 1;
16 if (dir < 0)
17 {
18 pdst += dst_len - 1;
19 step = -1;
20 }
21
22 if ((src_len == 1) || (dst_len == 1))
23 {
24 DATA32 c = *src;
25
26 if (mul) c = MUL4_SYM(mul_col, c);
27 while (dst_len--)
28 *dst++ = c;
29 return;
30 }
31
32 if (src_len == dst_len)
33 {
34 if (mul)
35 {
36#ifdef BUILD_MMX
37 pxor_r2r(mm0, mm0);
38 MOV_A2R(ALPHA_255, mm5)
39 MOV_P2R(mul_col, mm7, mm0)
40#endif
41 while (dst_len--)
42 {
43#ifdef BUILD_MMX
44 MOV_P2R(*src, mm1, mm0)
45 MUL4_SYM_R2R(mm7, mm1, mm5)
46 MOV_R2P(mm1, *pdst, mm0)
47#else
48 *pdst = MUL4_SYM(mul_col, *src);
49#endif
50 src++; pdst += step;
51 }
52 return;
53 }
54 while (dst_len--)
55 {
56 *pdst = *src;
57 src++; pdst += step;
58 }
59 return;
60 }
61
62 {
63 DATA32 dsxx = (((src_len - 1) << 16) / (dst_len - 1));
64 DATA32 sxx = 0;
65 int sx = sxx >> 16;
66
67#ifdef BUILD_MMX
68 pxor_r2r(mm0, mm0);
69 MOV_A2R(ALPHA_255, mm5)
70 if (mul)
71 {
72 MOV_P2R(mul_col, mm7, mm0)
73 }
74#endif
75 while (dst_len--)
76 {
77 DATA32 p2, p1 = 0;
78 int a;
79
80 sx = (sxx >> 16);
81 if (sx < src_len)
82 p1 = *(src + sx);
83 p2 = p1;
84 if ((sx + 1) < src_len)
85 p2 = *(src + sx + 1);
86 a = 1 + ((sxx - (sx << 16)) >> 8);
87#ifdef BUILD_MMX
88 MOV_A2R(a, mm3)
89 MOV_P2R(p1, mm1, mm0)
90 MOV_P2R(p2, mm2, mm0)
91 INTERP_256_R2R(mm3, mm2, mm1, mm5)
92 if (mul)
93 {
94 MUL4_SYM_R2R(mm7, mm1, mm5)
95 }
96 MOV_R2P(mm1, *pdst, mm0)
97#else
98 p1 = INTERP_256(a, p2, p1);
99 if (mul)
100 p1 = MUL4_SYM(mul_col, p1);
101 *pdst = p1;
102#endif
103 pdst += step; sxx += dsxx;
104 }
105 return;
106 }
107}
108
109static void
110evas_common_scale_rgba_a8_span_(DATA32 *src, DATA8 *mask, int src_len, DATA32 mul_col, DATA32 *dst, int dst_len, int dir)
111{
112 int mul = 0, step = 1;
113 DATA32 *pdst = dst;
114
115 if (!src || !mask || !dst) return;
116 if ((src_len < 1) || (dst_len < 1)) return;
117 if ((src_len > SCALE_SIZE_MAX) || (dst_len > SCALE_SIZE_MAX)) return;
118 if (mul_col != 0xffffffff)
119 mul = 1;
120 if (dir < 0)
121 {
122 pdst += dst_len - 1;
123 step = -1;
124 }
125
126 if ((src_len == 1) || (dst_len == 1))
127 {
128 DATA32 c = MUL_SYM(*mask, *src);
129
130 if (mul) c = MUL4_SYM(mul_col, c);
131 while (dst_len--)
132 *dst++ = c;
133 return;
134 }
135
136 if (src_len == dst_len)
137 {
138#ifdef BUILD_MMX
139 pxor_r2r(mm0, mm0);
140 MOV_A2R(ALPHA_255, mm5)
141#endif
142 if (mul)
143 {
144#ifdef BUILD_MMX
145 MOV_P2R(mul_col, mm7, mm0)
146#endif
147 while (dst_len--)
148 {
149#ifdef BUILD_MMX
150 MOV_P2R(*src, mm1, mm0)
151 MOV_A2R(*mask, mm3)
152 MUL4_SYM_R2R(mm3, mm1, mm5)
153 MUL4_SYM_R2R(mm7, mm1, mm5)
154 MOV_R2P(mm1, *pdst, mm0)
155#else
156 DATA32 c = MUL_SYM(*mask, *src);
157 *pdst = MUL4_SYM(mul_col, c);
158#endif
159 src++; mask++; pdst += step;
160 }
161 return;
162 }
163 while (dst_len--)
164 {
165#ifdef BUILD_MMX
166 MOV_P2R(*src, mm1, mm0)
167 MOV_A2R(*mask, mm3)
168 MUL4_SYM_R2R(mm3, mm1, mm5)
169 MOV_R2P(mm1, *pdst, mm0)
170#else
171 *pdst = MUL_SYM(*mask, *src);
172#endif
173 src++; mask++; pdst += step;
174 }
175 return;
176 }
177
178 {
179 DATA32 dsxx = (((src_len - 1) << 16) / (dst_len - 1));
180 DATA32 sxx = 0;
181 int sx = sxx >> 16;
182
183#ifdef BUILD_MMX
184 pxor_r2r(mm0, mm0);
185 MOV_A2R(ALPHA_255, mm5)
186 if (mul)
187 {
188 MOV_P2R(mul_col, mm7, mm0)
189 }
190#endif
191 while (dst_len--)
192 {
193 DATA32 p2, p1 = 0;
194 int a, a2, a1 = 0;
195
196 sx = (sxx >> 16);
197 if (sx < src_len)
198 {
199 p1 = *(src + sx);
200 a1 = *(mask + sx);
201 }
202 p2 = p1; a2 = a1;
203 if ((sx + 1) < src_len)
204 {
205 p2 = *(src + sx + 1);
206 a2 = *(mask + sx + 1);
207 }
208 a = 1 + ((sxx - (sx << 16)) >> 8);
209#ifdef BUILD_MMX
210 MOV_A2R(a, mm3)
211 MOV_P2R(p1, mm1, mm0)
212 MOV_P2R(p2, mm2, mm0)
213 INTERP_256_R2R(mm3, mm2, mm1, mm5)
214 a1 += 1 + ((a * (a2 - a1)) >> 8);
215 MOV_A2R(a1, mm3)
216 MUL4_256_R2R(mm3, mm1)
217 if (mul)
218 {
219 MUL4_SYM_R2R(mm7, mm1, mm5)
220 }
221 MOV_R2P(mm1, *pdst, mm0)
222#else
223 p1 = INTERP_256(a, p2, p1);
224 a1 += 1 + ((a * (a2 - a1)) >> 8);
225 p1 = MUL_256(a1, p1);
226 if (mul)
227 p1 = MUL4_SYM(mul_col, p1);
228 *pdst = p1;
229#endif
230 pdst += step; sxx += dsxx;
231 }
232 return;
233 }
234}
235
236static void
237evas_common_scale_a8_span_(DATA32 *src __UNUSED__, DATA8 *mask, int src_len, DATA32 mul_col, DATA32 *dst, int dst_len, int dir)
238{
239 int step = 1;
240 DATA32 *pdst = dst;
241
242 if (!mask || !dst) return;
243 if ((src_len < 1) || (dst_len < 1)) return;
244 if ((src_len > SCALE_SIZE_MAX) || (dst_len > SCALE_SIZE_MAX)) return;
245 if (dir < 0)
246 {
247 pdst += dst_len - 1;
248 step = -1;
249 }
250
251 if ((src_len == 1) || (dst_len == 1))
252 {
253 DATA32 c = MUL_SYM(*mask, mul_col);
254
255 while (dst_len--)
256 *dst++ = c;
257 return;
258 }
259
260#ifdef BUILD_MMX
261 pxor_r2r(mm0, mm0);
262 MOV_A2R(ALPHA_255, mm5)
263 MOV_P2R(mul_col, mm7, mm0)
264#endif
265 if (src_len == dst_len)
266 {
267 while (dst_len--)
268 {
269#ifdef BUILD_MMX
270 MOV_A2R(*mask, mm3)
271 MUL4_SYM_R2R(mm7, mm3, mm5)
272 MOV_R2P(mm3, *pdst, mm0)
273#else
274 *pdst = MUL_SYM(*mask, mul_col);
275#endif
276 mask++; pdst += step;
277 }
278 return;
279 }
280
281 {
282 DATA32 dsxx = (((src_len - 1) << 16) / (dst_len - 1));
283 DATA32 sxx = 0;
284 int sx = sxx >> 16;
285
286 while (dst_len--)
287 {
288 int a, a2, a1 = 0;
289
290 sx = (sxx >> 16);
291 if (sx < src_len)
292 a1 = *(mask + sx);
293 a2 = a1;
294 if ((sx + 1) < src_len)
295 a2 = *(mask + sx + 1);
296 a = 1 + ((sxx - (sx << 16)) >> 8);
297 a1 += 1 + ((a * (a2 - a1)) >> 8);
298#ifdef BUILD_MMX
299 MOV_A2R(a1, mm3)
300 MUL4_256_R2R(mm7, mm3)
301 MOV_R2P(mm3, *pdst, mm0)
302#else
303 *pdst = MUL_256(a1, mul_col);
304#endif
305 pdst += step; sxx += dsxx;
306 }
307 return;
308 }
309}
310
311static void
312evas_common_scale_clip_a8_span_(DATA32 *src __UNUSED__, DATA8 *mask, int src_len, DATA32 mul_col, DATA32 *dst, int dst_len, int dir)
313{
314 int mul = 0, step = 1;
315 DATA32 *pdst = dst;
316
317 if (!mask || !dst) return;
318 if ((src_len < 1) || (dst_len < 1)) return;
319 if ((src_len > SCALE_SIZE_MAX) || (dst_len > SCALE_SIZE_MAX)) return;
320 if (mul_col != 0xffffffff)
321 mul = 1;
322 if (dir < 0)
323 {
324 pdst += dst_len - 1;
325 step = -1;
326 }
327
328#ifdef BUILD_MMX
329 pxor_r2r(mm0, mm0);
330 MOV_A2R(ALPHA_255, mm5)
331 if (mul)
332 {
333 MOV_P2R(mul_col, mm7, mm0)
334 }
335#endif
336 if ((src_len == 1) || (dst_len == 1))
337 {
338#ifdef BUILD_MMX
339 MOV_A2R(*mask, mm3)
340#else
341 DATA32 c = *mask;
342#endif
343 if (mul)
344 {
345#ifdef BUILD_MMX
346 MUL4_SYM_R2R(mm7, mm3, mm5)
347#else
348 c = MUL_SYM(c, mul_col);
349#endif
350 while (dst_len--)
351 {
352#ifdef BUILD_MMX
353 MOV_P2R(*dst, mm1, mm0)
354 MUL4_SYM_R2R(mm3, mm1, mm5)
355 MOV_R2P(mm1, *dst, mm0)
356#else
357 *dst = MUL4_SYM(c, *dst);
358#endif
359 dst++;
360 }
361 return;
362 }
363 while (dst_len--)
364 {
365#ifdef BUILD_MMX
366 MOV_P2R(*dst, mm1, mm0)
367 MUL4_SYM_R2R(mm3, mm1, mm5)
368 MOV_R2P(mm1, *dst, mm0)
369#else
370 *dst = MUL_SYM(c, *dst);
371#endif
372 dst++;
373 }
374 return;
375 }
376
377 if (src_len == dst_len)
378 {
379 if (mul)
380 {
381 while (dst_len--)
382 {
383#ifdef BUILD_MMX
384 MOV_A2R(*mask, mm3)
385 MUL4_SYM_R2R(mm7, mm3, mm5)
386 MOV_P2R(*pdst, mm1, mm0)
387 MUL4_SYM_R2R(mm3, mm1, mm5)
388 MOV_R2P(mm1, *pdst, mm0)
389#else
390 DATA32 c = MUL_SYM(*mask, mul_col);
391
392 *pdst = MUL4_SYM(c, *pdst);
393#endif
394 mask++; pdst += step;
395 }
396 return;
397 }
398 while (dst_len--)
399 {
400#ifdef BUILD_MMX
401 MOV_A2R(*mask, mm3)
402 MOV_P2R(*pdst, mm1, mm0)
403 MUL4_SYM_R2R(mm3, mm1, mm5)
404 MOV_R2P(mm1, *pdst, mm0)
405#else
406 *pdst = MUL_SYM(*mask, *pdst);
407#endif
408 mask++; pdst += step;
409 }
410 return;
411 }
412
413 {
414 DATA32 dsxx = (((src_len - 1) << 16) / (dst_len - 1));
415 DATA32 sxx = 0;
416 int sx = sxx >> 16;
417
418 while (dst_len--)
419 {
420 int a, a2, a1 = 0;
421
422 sx = (sxx >> 16);
423 if (sx < src_len)
424 a1 = *(mask + sx);
425 a2 = a1;
426 if ((sx + 1) < src_len)
427 a2 = *(mask + sx + 1);
428 a = 1 + ((sxx - (sx << 16)) >> 8);
429 a1 += 1 + ((a * (a2 - a1)) >> 8);
430#ifdef BUILD_MMX
431 MOV_A2R(a1, mm3)
432 MOV_P2R(*pdst, mm1, mm0)
433 MUL4_256_R2R(mm3, mm1)
434 if (mul)
435 {
436 MUL4_SYM_R2R(mm7, mm1, mm5)
437 }
438 MOV_R2P(mm1, *pdst, mm0)
439#else
440 *pdst = MUL_256(a1, *pdst);
441 if (mul)
442 *pdst = MUL4_SYM(mul_col, *pdst);
443#endif
444 pdst += step; sxx += dsxx;
445 }
446 return;
447 }
448}
449
450EAPI void
451evas_common_scale_rgba_span(DATA32 *src, DATA8 *mask, int src_len, DATA32 mul_col, DATA32 *dst, int dst_len, int dir)
452{
453 evas_common_scale_rgba_span_(src, mask, src_len, mul_col, dst, dst_len, dir);
454 evas_common_cpu_end_opt();
455}
456
457EAPI void
458evas_common_scale_rgba_a8_span(DATA32 *src, DATA8 *mask, int src_len, DATA32 mul_col, DATA32 *dst, int dst_len, int dir)
459{
460 evas_common_scale_rgba_a8_span_(src, mask, src_len, mul_col, dst, dst_len, dir);
461 evas_common_cpu_end_opt();
462}
463
464EAPI void
465evas_common_scale_a8_span(DATA32 *src, DATA8 *mask, int src_len, DATA32 mul_col, DATA32 *dst, int dst_len, int dir)
466{
467 evas_common_scale_a8_span_(src, mask, src_len, mul_col, dst, dst_len, dir);
468 evas_common_cpu_end_opt();
469}
470
471EAPI void
472evas_common_scale_clip_a8_span(DATA32 *src, DATA8 *mask, int src_len, DATA32 mul_col, DATA32 *dst, int dst_len, int dir)
473{
474 evas_common_scale_clip_a8_span_(src, mask, src_len, mul_col, dst, dst_len, dir);
475 evas_common_cpu_end_opt();
476}
477
478EAPI void
479evas_common_scale_hsva_span(DATA32 *src, DATA8 *mask __UNUSED__, int src_len, DATA32 mul_col, DATA32 *dst, int dst_len, int dir)
480{
481 int mul = 0, step = 1;
482 DATA32 *pdst = dst;
483
484 if (!src || !dst) return;
485 if ((src_len < 1) || (dst_len < 1)) return;
486 if ((src_len > SCALE_SIZE_MAX) || (dst_len > SCALE_SIZE_MAX)) return;
487 if (mul_col != 0xffffffff)
488 mul = 1;
489 if (dir < 0)
490 {
491 pdst += dst_len - 1;
492 step = -1;
493 }
494
495 if ((src_len == 1) || (dst_len == 1))
496 {
497 DATA32 c = *src;
498
499 if (mul) c = MUL4_SYM(mul_col, c);
500 while (dst_len--)
501 *dst++ = c;
502 return;
503 }
504
505 if (src_len == dst_len)
506 {
507 if (mul)
508 {
509 while (dst_len--)
510 {
511 *pdst = MUL4_SYM(mul_col, *src);
512 src++; pdst += step;
513 }
514 return;
515 }
516 while (dst_len--)
517 {
518 *pdst = *src;
519 src++; pdst += step;
520 }
521 return;
522 }
523
524 {
525 DATA32 dsxx = (((src_len - 1) << 16) / (dst_len - 1));
526 DATA32 sxx = 0;
527 int sx = sxx >> 16;
528
529 while (dst_len--)
530 {
531 DATA32 p2, p1 = 0;
532 int a, h1, s1, v1, h2, s2, v2;
533
534 sx = (sxx >> 16);
535 if (sx < src_len)
536 p1 = *(src + sx);
537 evas_common_convert_color_rgb_to_hsv_int((p1 >> 16) & 0xff, (p1 >> 8) & 0xff, p1 & 0xff,
538 &h1, &s1, &v1);
539 p2 = p1;
540 if ((sx + 1) < src_len)
541 p2 = *(src + sx + 1);
542 evas_common_convert_color_rgb_to_hsv_int((p2 >> 16) & 0xff, (p2 >> 8) & 0xff, p2 & 0xff,
543 &h2, &s2, &v2);
544 a = 1 + ((sxx - (sx << 16)) >> 8);
545 h1 += (a * (h2 - h1)) >> 8;
546 s1 += (a * (s2 - s1)) >> 8;
547 v1 += (a * (v2 - v1)) >> 8;
548 a = (((((p2 >> 8) & 0xff0000) - ((p1 >> 8) & 0xff0000)) * a) +
549 (p1 & 0xff000000)) & 0xff000000;
550 evas_common_convert_color_hsv_to_rgb_int(h1, s1, v1, &h2, &s2, &v2);
551 p1 = a + RGB_JOIN(h2,s2,v2);
552 if (mul)
553 p1 = MUL4_SYM(mul_col, p1);
554 *pdst = p1;
555 pdst += step; sxx += dsxx;
556 }
557 return;
558 }
559}
560
561EAPI void
562evas_common_scale_hsva_a8_span(DATA32 *src, DATA8 *mask, int src_len, DATA32 mul_col, DATA32 *dst, int dst_len, int dir)
563{
564 int mul = 0, step = 1;
565 DATA32 *pdst = dst;
566
567 if (!src || !mask || !dst) return;
568 if ((src_len < 1) || (dst_len < 1)) return;
569 if ((src_len > SCALE_SIZE_MAX) || (dst_len > SCALE_SIZE_MAX)) return;
570 if (mul_col != 0xffffffff)
571 mul = 1;
572 if (dir < 0)
573 {
574 pdst += dst_len - 1;
575 step = -1;
576 }
577
578 if ((src_len == 1) || (dst_len == 1))
579 {
580 DATA32 c = MUL_SYM(*mask, *src);
581
582 if (mul) c = MUL4_SYM(mul_col, c);
583 while (dst_len--)
584 *dst++ = c;
585 return;
586 }
587
588 if (src_len == dst_len)
589 {
590 if (mul)
591 {
592 while (dst_len--)
593 {
594 DATA32 c = MUL_SYM(*mask, *src);
595 *pdst = MUL4_SYM(mul_col, c);
596 src++; mask++; pdst += step;
597 }
598 return;
599 }
600 while (dst_len--)
601 {
602 *pdst = MUL_SYM(*mask, *src);
603 src++; mask++; pdst += step;
604 }
605 return;
606 }
607
608 {
609 DATA32 dsxx = (((src_len - 1) << 16) / (dst_len - 1));
610 DATA32 sxx = 0;
611 int sx = sxx >> 16;
612
613 while (dst_len--)
614 {
615 DATA32 p2, p1 = 0;
616 int a, a2, a1 = 0;
617 int h1, s1, v1, h2, s2, v2;
618
619 sx = (sxx >> 16);
620 if (sx < src_len)
621 {
622 p1 = *(src + sx);
623 a1 = *(mask + sx);
624 }
625 p2 = p1; a2 = a1;
626 if ((sx + 1) < src_len)
627 {
628 p2 = *(src + sx + 1);
629 a2 = *(mask + sx + 1);
630 }
631 evas_common_convert_color_rgb_to_hsv_int((p1 >> 16) & 0xff, (p1 >> 8) & 0xff, p1 & 0xff,
632 &h1, &s1, &v1);
633 evas_common_convert_color_rgb_to_hsv_int((p2 >> 16) & 0xff, (p2 >> 8) & 0xff, p2 & 0xff,
634 &h2, &s2, &v2);
635 a = 1 + ((sxx - (sx << 16)) >> 8);
636 a1 += (a * (a2 - a1)) >> 8;
637 h1 += (a * (h2 - h1)) >> 8;
638 s1 += (a * (s2 - s1)) >> 8;
639 v1 += (a * (v2 - v1)) >> 8;
640 a = (((((p2 >> 8) & 0xff0000) - ((p1 >> 8) & 0xff0000)) * a) +
641 (p1 & 0xff000000)) & 0xff000000;
642
643 evas_common_convert_color_hsv_to_rgb_int(h1, s1, v1, &h2, &s2, &v2);
644 p1 = a + RGB_JOIN(h2,s2,v2);
645 p1 = MUL_SYM(a1, p1);
646 if (mul)
647 p1 = MUL4_SYM(mul_col, p1);
648 *pdst = p1;
649 pdst += step; sxx += dsxx;
650 }
651 return;
652 }
653}
diff --git a/libraries/evas/src/lib/engines/common/evas_scale_span.h b/libraries/evas/src/lib/engines/common/evas_scale_span.h
new file mode 100644
index 0000000..874c594
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_scale_span.h
@@ -0,0 +1,14 @@
1#ifndef _EVAS_SCALE_SPAN_H
2#define _EVAS_SCALE_SPAN_H
3
4
5EAPI void evas_common_scale_rgba_span (DATA32 *src, DATA8 *mask, int src_len, DATA32 mul_col, DATA32 *dst, int dst_len, int dir);
6EAPI void evas_common_scale_rgba_a8_span (DATA32 *src, DATA8 *mask, int src_len, DATA32 mul_col, DATA32 *dst, int dst_len, int dir);
7EAPI void evas_common_scale_a8_span (DATA32 *src, DATA8 *mask, int src_len, DATA32 mul_col, DATA32 *dst, int dst_len, int dir);
8EAPI void evas_common_scale_clip_a8_span (DATA32 *src, DATA8 *mask, int src_len, DATA32 mul_col, DATA32 *dst, int dst_len, int dir);
9
10EAPI void evas_common_scale_hsva_span (DATA32 *src, DATA8 *mask, int src_len, DATA32 mul_col, DATA32 *dst, int dst_len, int dir);
11EAPI void evas_common_scale_hsva_a8_span (DATA32 *src, DATA8 *mask, int src_len, DATA32 mul_col, DATA32 *dst, int dst_len, int dir);
12
13
14#endif /* _EVAS_SCALE_SPAN_H */
diff --git a/libraries/evas/src/lib/engines/common/evas_text_utils.c b/libraries/evas/src/lib/engines/common/evas_text_utils.c
new file mode 100644
index 0000000..a00df91
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_text_utils.c
@@ -0,0 +1,472 @@
1#include "evas_common.h"
2#include "evas_font_private.h"
3#include "evas_text_utils.h"
4#include "language/evas_bidi_utils.h"
5#include "language/evas_language_utils.h"
6#include "evas_font_ot.h"
7
8void
9evas_common_text_props_bidi_set(Evas_Text_Props *props,
10 Evas_BiDi_Paragraph_Props *bidi_par_props, size_t start)
11{
12#ifdef BIDI_SUPPORT
13 props->bidi.dir = (evas_bidi_is_rtl_char(
14 bidi_par_props,
15 0,
16 start)) ? EVAS_BIDI_DIRECTION_RTL : EVAS_BIDI_DIRECTION_LTR;
17#else
18 (void) start;
19 (void) bidi_par_props;
20 props->bidi.dir = EVAS_BIDI_DIRECTION_LTR;
21#endif
22}
23
24void
25evas_common_text_props_script_set(Evas_Text_Props *props, Evas_Script_Type scr)
26{
27 props->script = scr;
28}
29
30void
31evas_common_text_props_content_copy_and_ref(Evas_Text_Props *dst,
32 const Evas_Text_Props *src)
33{
34 memcpy(dst, src, sizeof(Evas_Text_Props));
35 evas_common_text_props_content_ref(dst);
36}
37
38void
39evas_common_text_props_content_ref(Evas_Text_Props *props)
40{
41 /* No content in this case */
42 if (!props->info)
43 return;
44
45 props->info->refcount++;
46}
47
48void
49evas_common_text_props_content_unref(Evas_Text_Props *props)
50{
51 /* No content in this case */
52 if (!props->info)
53 return;
54
55 if (--(props->info->refcount) == 0)
56 {
57 if (props->info->glyph)
58 free(props->info->glyph);
59#ifdef OT_SUPPORT
60 if (props->info->ot)
61 free(props->info->ot);
62#endif
63 free(props->info);
64 props->info = NULL;
65 }
66}
67
68static int
69_evas_common_text_props_cluster_move(const Evas_Text_Props *props, int pos,
70 Eina_Bool right)
71{
72 int prop_pos = evas_common_text_props_index_find(props, pos);
73 if (!right && (prop_pos > 0))
74 {
75#ifdef OT_SUPPORT
76 return props->info->ot[props->start + prop_pos - 1].source_cluster -
77 props->text_offset;
78#else
79 return props->start + prop_pos - 1 - props->text_offset;
80#endif
81 }
82 else if (right && (prop_pos < (int) (props->len - 1)))
83 {
84#ifdef OT_SUPPORT
85 return props->info->ot[props->start + prop_pos + 1].source_cluster -
86 props->text_offset;
87#else
88 return props->start + prop_pos + 1 - props->text_offset;
89#endif
90 }
91
92 return pos;
93}
94
95EAPI int
96evas_common_text_props_cluster_next(const Evas_Text_Props *props, int pos)
97{
98 Eina_Bool right;
99 /* Move right if we are in a non-rtl text */
100 right = (props->bidi.dir != EVAS_BIDI_DIRECTION_RTL);
101 return _evas_common_text_props_cluster_move(props, pos, right);
102}
103
104EAPI int
105evas_common_text_props_cluster_prev(const Evas_Text_Props *props, int pos)
106{
107 Eina_Bool right;
108 /* Move right if we are in an rtl text */
109 right = (props->bidi.dir == EVAS_BIDI_DIRECTION_RTL);
110 return _evas_common_text_props_cluster_move(props, pos, right);
111}
112
113/* Returns the index of the logical char in the props. */
114EAPI int
115evas_common_text_props_index_find(const Evas_Text_Props *props, int _cutoff)
116{
117#ifdef OT_SUPPORT
118 Evas_Font_OT_Info *ot_info;
119 int min = 0;
120 int max = props->len - 1;
121 int mid;
122
123 _cutoff += props->text_offset;
124 ot_info = props->info->ot + props->start;
125 /* Should get us closer to the right place. */
126 if ((min <= _cutoff) && (_cutoff <= max))
127 mid = _cutoff;
128 else
129 mid = (min + max) / 2;
130
131 if (props->bidi.dir == EVAS_BIDI_DIRECTION_RTL)
132 {
133 /* Monotonic in a descending order */
134 do
135 {
136 if (_cutoff > (int) ot_info[mid].source_cluster)
137 max = mid - 1;
138 else if (_cutoff < (int) ot_info[mid].source_cluster)
139 min = mid + 1;
140 else
141 break;
142
143 mid = (min + max) / 2;
144 }
145 while (min <= max);
146 }
147 else
148 {
149 /* Monotonic in an ascending order */
150 do
151 {
152 if (_cutoff < (int) ot_info[mid].source_cluster)
153 max = mid - 1;
154 else if (_cutoff > (int) ot_info[mid].source_cluster)
155 min = mid + 1;
156 else
157 break;
158
159 mid = (min + max) / 2;
160 }
161 while (min <= max);
162 }
163
164 /* If we didn't find, abort */
165 if (min > max)
166 return -1;
167
168 ot_info += mid;
169 if (props->bidi.dir == EVAS_BIDI_DIRECTION_RTL)
170 {
171 /* Walk to the last one of the same cluster */
172 for ( ; mid < (int) props->len ; mid++, ot_info++)
173 {
174 if (ot_info->source_cluster != (size_t) _cutoff)
175 break;
176 }
177 mid--;
178 }
179 else
180 {
181 /* Walk to the last one of the same cluster */
182 for ( ; mid >= 0 ; mid--, ot_info--)
183 {
184 if (ot_info->source_cluster != (size_t) _cutoff)
185 break;
186 }
187 mid++;
188 }
189
190 return mid;
191#else
192 return _cutoff;
193 (void) props;
194#endif
195}
196
197/* Won't work in the middle of ligatures, assumes cutoff < len.
198 * Also won't work in the middle of indic words, should handle that in a
199 * smart way. */
200EAPI void
201evas_common_text_props_split(Evas_Text_Props *base,
202 Evas_Text_Props *ext, int _cutoff)
203{
204 size_t cutoff;
205
206 /* Translate text cutoff pos to string object cutoff point */
207#ifdef OT_SUPPORT
208 _cutoff = evas_common_text_props_index_find(base, _cutoff);
209
210 if (_cutoff >= 0)
211 {
212 cutoff = (size_t) _cutoff;
213 }
214 else
215 {
216 ERR("Couldn't find the cutoff position. Is it inside a cluster?");
217 return;
218 }
219#else
220 cutoff = (size_t) _cutoff;
221#endif
222
223 evas_common_text_props_content_copy_and_ref(ext, base);
224 if (base->bidi.dir == EVAS_BIDI_DIRECTION_RTL)
225 {
226 ext->start = base->start;
227 ext->len = cutoff + 1;
228 base->start = base->start + ext->len;
229 base->len = base->len - ext->len;
230
231#ifdef OT_SUPPORT
232 ext->text_offset =
233 ext->info->ot[ext->start + ext->len - 1].source_cluster;
234#else
235 ext->text_offset = base->text_offset + base->len;
236#endif
237 }
238 else
239 {
240 ext->start = base->start + cutoff;
241 ext->len = base->len - cutoff;
242 base->len = cutoff;
243
244#ifdef OT_SUPPORT
245 ext->text_offset = ext->info->ot[ext->start].source_cluster;
246#else
247 ext->text_offset = base->text_offset + base->len;
248#endif
249 }
250 ext->text_len = base->text_len - (ext->text_offset - base->text_offset);
251 base->text_len = (ext->text_offset - base->text_offset);
252}
253
254/* Won't work in the middle of ligatures */
255EAPI void
256evas_common_text_props_merge(Evas_Text_Props *item1,
257 const Evas_Text_Props *item2)
258{
259 if (item1->info != item2->info)
260 {
261 ERR("tried merge back items that weren't together in the first place.");
262 return;
263 }
264 if (item1->bidi.dir == EVAS_BIDI_DIRECTION_RTL)
265 {
266 item1->start = item2->start;
267 }
268
269 item1->len += item2->len;
270 item1->text_len += item2->text_len;
271}
272
273EAPI Eina_Bool
274evas_common_text_props_content_create(void *_fi, const Eina_Unicode *text,
275 Evas_Text_Props *text_props, const Evas_BiDi_Paragraph_Props *par_props,
276 size_t par_pos, int len)
277{
278 RGBA_Font_Int *fi = (RGBA_Font_Int *) _fi;
279
280 if (text_props->info)
281 {
282 evas_common_text_props_content_unref(text_props);
283 }
284 if (len == 0)
285 {
286 text_props->info = NULL;
287 text_props->start = text_props->len = text_props->text_offset = 0;
288 }
289 text_props->info = calloc(1, sizeof(Evas_Text_Props_Info));
290
291 text_props->font_instance = fi;
292
293 evas_common_font_int_reload(fi);
294 if (fi->src->current_size != fi->size)
295 {
296 FTLOCK();
297 FT_Activate_Size(fi->ft.size);
298 FTUNLOCK();
299 fi->src->current_size = fi->size;
300 }
301
302#ifdef OT_SUPPORT
303 size_t char_index;
304 Evas_Font_Glyph_Info *gl_itr;
305 Evas_Coord pen_x = 0, adjust_x = 0;
306 (void) par_props;
307 (void) par_pos;
308
309 evas_common_font_ot_populate_text_props(text, text_props, len);
310
311 gl_itr = text_props->info->glyph;
312 for (char_index = 0 ; char_index < text_props->len ; char_index++)
313 {
314 FT_UInt idx;
315 RGBA_Font_Glyph *fg;
316 Eina_Bool is_replacement = EINA_FALSE;
317 /* If we got a malformed index, show the replacement char instead */
318 if (gl_itr->index == 0)
319 {
320 gl_itr->index = evas_common_get_char_index(fi, REPLACEMENT_CHAR);
321 is_replacement = EINA_TRUE;
322 }
323 idx = gl_itr->index;
324 LKL(fi->ft_mutex);
325 fg = evas_common_font_int_cache_glyph_get(fi, idx);
326 if (!fg)
327 {
328 LKU(fi->ft_mutex);
329 continue;
330 }
331 LKU(fi->ft_mutex);
332
333 gl_itr->x_bear = fg->glyph_out->left;
334 gl_itr->width = fg->glyph_out->bitmap.width;
335 /* text_props->info->glyph[char_index].advance =
336 * text_props->info->glyph[char_index].index =
337 * already done by the ot function */
338 if (EVAS_FONT_CHARACTER_IS_INVISIBLE(
339 text[text_props->info->ot[char_index].source_cluster]))
340 {
341 gl_itr->index = 0;
342 /* Reduce the current advance */
343 if (gl_itr > text_props->info->glyph)
344 {
345 adjust_x -= gl_itr->pen_after - (gl_itr - 1)->pen_after;
346 }
347 else
348 {
349 adjust_x -= gl_itr->pen_after;
350 }
351 }
352 else
353 {
354 if (is_replacement)
355 {
356 /* Update the advance accordingly */
357 adjust_x += (pen_x + (fg->glyph->advance.x >> 16)) -
358 gl_itr->pen_after;
359 }
360 pen_x = gl_itr->pen_after;
361 }
362 gl_itr->pen_after += adjust_x;
363
364 fi = text_props->font_instance;
365 gl_itr++;
366 }
367#else
368 /* We are walking the string in visual ordering */
369 Evas_Font_Glyph_Info *gl_itr;
370 Eina_Bool use_kerning;
371 FT_UInt prev_index;
372 FT_Face pface = NULL;
373 Evas_Coord pen_x = 0;
374 int adv_d, i;
375#if !defined(OT_SUPPORT) && defined(BIDI_SUPPORT)
376 Eina_Unicode *base_str = NULL;
377 if (text_props->bidi.dir == EVAS_BIDI_DIRECTION_RTL)
378 {
379 text = base_str = eina_unicode_strndup(text, len);
380 evas_bidi_shape_string(base_str, par_props, par_pos, len);
381 }
382#else
383 (void) par_props;
384 (void) par_pos;
385#endif
386
387 FTLOCK();
388 use_kerning = FT_HAS_KERNING(fi->src->ft.face);
389 FTUNLOCK();
390 prev_index = 0;
391
392 i = len;
393 text_props->info->glyph = calloc(len,
394 sizeof(Evas_Font_Glyph_Info));
395
396 if (text_props->bidi.dir == EVAS_BIDI_DIRECTION_RTL)
397 {
398 text += len - 1;
399 adv_d = -1;
400 }
401 else
402 {
403 adv_d = 1;
404 }
405
406 gl_itr = text_props->info->glyph;
407 for ( ; i > 0 ; gl_itr++, text += adv_d, i--)
408 {
409 FT_UInt idx;
410 RGBA_Font_Glyph *fg;
411 int _gl, kern;
412 Evas_Coord adv;
413 _gl = *text;
414 if (_gl == 0) break;
415
416 idx = evas_common_get_char_index(fi, _gl);
417 if (idx == 0)
418 {
419 idx = evas_common_get_char_index(fi, REPLACEMENT_CHAR);
420 }
421
422 LKL(fi->ft_mutex);
423 fg = evas_common_font_int_cache_glyph_get(fi, idx);
424 if (!fg)
425 {
426 LKU(fi->ft_mutex);
427 continue;
428 }
429 kern = 0;
430
431 if ((use_kerning) && (prev_index) && (idx) &&
432 (pface == fi->src->ft.face))
433 {
434 if (evas_common_font_query_kerning(fi, prev_index, idx, &kern))
435 {
436 pen_x += kern;
437 (gl_itr - 1)->pen_after +=
438 EVAS_FONT_ROUND_26_6_TO_INT(kern);
439 }
440 }
441
442 pface = fi->src->ft.face;
443 LKU(fi->ft_mutex);
444
445 gl_itr->index = idx;
446 gl_itr->x_bear = fg->glyph_out->left;
447 adv = fg->glyph->advance.x >> 10;
448 gl_itr->width = fg->glyph_out->bitmap.width;
449
450 if (EVAS_FONT_CHARACTER_IS_INVISIBLE(_gl))
451 {
452 gl_itr->index = 0;
453 }
454 else
455 {
456 pen_x += adv;
457 }
458
459 gl_itr->pen_after = EVAS_FONT_ROUND_26_6_TO_INT(pen_x);
460
461 prev_index = idx;
462 }
463 text_props->len = len;
464# if !defined(OT_SUPPORT) && defined(BIDI_SUPPORT)
465 if (base_str)
466 free(base_str);
467# endif
468#endif
469 text_props->text_len = len;
470 text_props->info->refcount = 1;
471 return EINA_TRUE;
472}
diff --git a/libraries/evas/src/lib/engines/common/evas_text_utils.h b/libraries/evas/src/lib/engines/common/evas_text_utils.h
new file mode 100644
index 0000000..7f1c802
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_text_utils.h
@@ -0,0 +1,89 @@
1#ifndef _EVAS_TEXT_UTILS_H
2# define _EVAS_TEXT_UTILS_H
3
4typedef struct _Evas_Text_Props Evas_Text_Props;
5typedef struct _Evas_Text_Props_Info Evas_Text_Props_Info;
6typedef struct _Evas_Font_Glyph_Info Evas_Font_Glyph_Info;
7
8# include "evas_font_ot.h"
9# include "language/evas_bidi_utils.h"
10# include "language/evas_language_utils.h"
11
12/* Used for showing "malformed" or missing chars */
13#define REPLACEMENT_CHAR 0xFFFD
14
15struct _Evas_Text_Props
16{
17 /* Start and len represent the start offset and the length in the
18 * glyphs_info and ot_data fields, they are both internal */
19 size_t start;
20 size_t len;
21 size_t text_offset; /* The text offset from the start of the info */
22 size_t text_len; /* The length of the original text */
23 Evas_BiDi_Props bidi;
24 Evas_Script_Type script;
25 Evas_Text_Props_Info *info;
26 void *font_instance;
27};
28
29struct _Evas_Text_Props_Info
30{
31 unsigned int refcount;
32 Evas_Font_Glyph_Info *glyph;
33 Evas_Font_OT_Info *ot;
34};
35
36/* Sorted in visual order when created */
37struct _Evas_Font_Glyph_Info
38{
39 unsigned int index; /* Should conform to FT */
40 Evas_Coord x_bear;
41#if 0
42 /* This one is rarely used, only in draw, in which we already get the glyph
43 * so it doesn't really save time. Leaving it here just so no one will
44 * add it thinking it was accidentally skipped */
45 Evas_Coord y_bear;
46#endif
47 Evas_Coord width;
48 Evas_Coord pen_after;
49};
50
51
52void
53evas_common_text_props_bidi_set(Evas_Text_Props *props,
54 Evas_BiDi_Paragraph_Props *bidi_par_props, size_t start);
55
56void
57evas_common_text_props_script_set(Evas_Text_Props *props, Evas_Script_Type scr);
58
59EAPI Eina_Bool
60evas_common_text_props_content_create(void *_fi, const Eina_Unicode *text,
61 Evas_Text_Props *text_props, const Evas_BiDi_Paragraph_Props *par_props,
62 size_t par_pos, int len);
63
64void
65evas_common_text_props_content_copy_and_ref(Evas_Text_Props *dst,
66 const Evas_Text_Props *src);
67
68void
69evas_common_text_props_content_ref(Evas_Text_Props *props);
70
71void
72evas_common_text_props_content_unref(Evas_Text_Props *props);
73
74EAPI int
75evas_common_text_props_cluster_next(const Evas_Text_Props *props, int pos);
76
77EAPI int
78evas_common_text_props_cluster_prev(const Evas_Text_Props *props, int pos);
79
80EAPI int
81evas_common_text_props_index_find(const Evas_Text_Props *props, int _cutoff);
82
83EAPI void
84evas_common_text_props_split(Evas_Text_Props *base, Evas_Text_Props *ext,
85 int cutoff);
86EAPI void
87evas_common_text_props_merge(Evas_Text_Props *item1, const Evas_Text_Props *item2);
88
89#endif
diff --git a/libraries/evas/src/lib/engines/common/evas_tiler.c b/libraries/evas/src/lib/engines/common/evas_tiler.c
new file mode 100644
index 0000000..0bbe811
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/evas_tiler.c
@@ -0,0 +1,1391 @@
1#include "evas_common.h"
2#ifdef EVAS_RECT_SPLIT
3
4static inline void rect_list_node_pool_set_max(int max);
5static inline void rect_list_node_pool_flush(void);
6static inline list_node_t *rect_list_node_pool_get(void);
7static inline void rect_list_node_pool_put(list_node_t *node);
8static inline void rect_init(rect_t *r, int x, int y, int w, int h);
9static inline void rect_list_append_node(list_t *rects, list_node_t *node);
10static inline void rect_list_append(list_t *rects, const rect_t r);
11static inline void rect_list_append_xywh(list_t *rects, int x, int y, int w, int h);
12static inline void rect_list_concat(list_t *rects, list_t *other);
13static inline list_node_t *rect_list_unlink_next(list_t *rects, list_node_t *parent_node);
14static inline void rect_list_del_next(list_t *rects, list_node_t *parent_node);
15static inline void rect_list_clear(list_t *rects);
16static inline void rect_list_del_split_strict(list_t *rects, const rect_t del_r);
17static inline void rect_list_add_split_strict(list_t *rects, list_node_t *node);
18static inline list_node_t *rect_list_add_split_fuzzy(list_t *rects, list_node_t *node, int accepted_error);
19static inline void rect_list_merge_rects(list_t *rects, list_t *to_merge, int accepted_error);
20static inline void rect_list_add_split_fuzzy_and_merge(list_t *rects, list_node_t *node, int split_accepted_error, int merge_accepted_error);
21static inline void rect_print(const rect_t r);
22static inline void rect_list_print(const list_t rects);
23
24static const list_node_t list_node_zeroed = { NULL };
25static const list_t list_zeroed = { NULL, NULL };
26
27typedef struct list_node_pool
28{
29 list_node_t *node;
30 int len;
31 int max;
32} list_node_pool_t;
33
34static list_node_pool_t list_node_pool = { NULL, 0, 1024 };
35
36static inline void
37rect_list_node_pool_set_max(int max)
38{
39 int diff;
40
41 diff = list_node_pool.len - max;
42 for (; diff > 0 && list_node_pool.node; diff--)
43 {
44 list_node_t *node;
45
46 node = list_node_pool.node;
47 list_node_pool.node = node->next;
48 list_node_pool.len--;
49
50 free(node);
51 }
52
53 list_node_pool.max = max;
54}
55
56static inline void
57rect_list_node_pool_flush(void)
58{
59 while (list_node_pool.node)
60 {
61 list_node_t *node;
62
63 node = list_node_pool.node;
64 list_node_pool.node = node->next;
65 list_node_pool.len--;
66
67 free(node);
68 }
69}
70
71static inline list_node_t *
72rect_list_node_pool_get(void)
73{
74 if (list_node_pool.node)
75 {
76 list_node_t *node;
77
78 node = list_node_pool.node;
79 list_node_pool.node = node->next;
80 list_node_pool.len--;
81
82 return node;
83 }
84 else return malloc(sizeof(rect_node_t));
85}
86
87static inline void
88rect_list_node_pool_put(list_node_t *node)
89{
90 if (list_node_pool.len < list_node_pool.max)
91 {
92 node->next = list_node_pool.node;
93 list_node_pool.node = node;
94 list_node_pool.len++;
95 }
96 else free(node);
97}
98
99static inline void
100rect_init(rect_t *r, int x, int y, int w, int h)
101{
102 r->area = w * h;
103
104 r->left = x;
105 r->top = y;
106
107 r->right = x + w;
108 r->bottom = y + h;
109
110 r->width = w;
111 r->height = h;
112}
113
114static inline void
115rect_print(const rect_t r)
116{
117 INF("<rect(%d, %d, %d, %d)>", r.left, r.top, r.width, r.height);
118}
119
120static inline void
121rect_list_print(const list_t rects)
122{
123 list_node_t *node;
124 int len;
125
126 len = 0;
127 for (node = rects.head; node; node = node->next) len++;
128
129 putchar('[');
130 for (node = rects.head; node; node = node->next)
131 {
132 rect_print(((rect_node_t *)node)->rect);
133 if (node->next)
134 {
135 putchar(',');
136 if (len < 4) putchar(' ');
137 else
138 {
139 putchar('\n');
140 putchar(' ');
141 }
142 }
143 }
144 putchar(']');
145}
146
147static inline void
148rect_list_append_node(list_t *rects, list_node_t *node)
149{
150 if (rects->tail)
151 {
152 rects->tail->next = node;
153 rects->tail = node;
154 }
155 else
156 {
157 rects->head = node;
158 rects->tail = node;
159 }
160}
161
162static inline void
163rect_list_append(list_t *rects, const rect_t r)
164{
165 rect_node_t *rect_node;
166
167 rect_node = (rect_node_t *)rect_list_node_pool_get();
168 rect_node->rect = r;
169 rect_node->_lst = list_node_zeroed;
170
171 rect_list_append_node(rects, (list_node_t *)rect_node);
172}
173
174static inline void
175rect_list_append_xywh(list_t *rects, int x, int y, int w, int h)
176{
177 rect_t r;
178
179 rect_init(&r, x, y, w, h);
180 rect_list_append(rects, r);
181}
182
183static inline void
184rect_list_concat(list_t *rects, list_t *other)
185{
186 if (!other->head)
187 return;
188
189 if (rects->tail)
190 {
191 rects->tail->next = other->head;
192 rects->tail = other->tail;
193 }
194 else
195 {
196 rects->head = other->head;
197 rects->tail = other->tail;
198 }
199 *other = list_zeroed;
200}
201
202static inline list_node_t *
203rect_list_unlink_next(list_t *rects, list_node_t *parent_node)
204{
205 list_node_t *node;
206
207 if (parent_node)
208 {
209 node = parent_node->next;
210 parent_node->next = node->next;
211 }
212 else
213 {
214 node = rects->head;
215 rects->head = node->next;
216 }
217
218 if (rects->tail == node) rects->tail = parent_node;
219 *node = list_node_zeroed;
220 return node;
221}
222
223static inline void
224rect_list_del_next(list_t *rects, list_node_t *parent_node)
225{
226 list_node_t *node;
227
228 node = rect_list_unlink_next(rects, parent_node);
229 rect_list_node_pool_put(node);
230}
231
232static inline void
233rect_list_clear(list_t *rects)
234{
235 list_node_t *node;
236
237 node = rects->head;
238 while (node)
239 {
240 list_node_t *aux;
241
242 aux = node->next;
243 rect_list_node_pool_put(node);
244 node = aux;
245 }
246 *rects = list_zeroed;
247}
248
249static inline void
250_calc_intra_rect_area(const rect_t a, const rect_t b, int *width, int *height)
251{
252 int max_left, min_right, max_top, min_bottom;
253
254 if (a.left < b.left) max_left = b.left;
255 else max_left = a.left;
256
257 if (a.right < b.right) min_right = a.right;
258 else min_right = b.right;
259
260 *width = min_right - max_left;
261
262 if (a.top < b.top) max_top = b.top;
263 else max_top = a.top;
264
265 if (a.bottom < b.bottom) min_bottom = a.bottom;
266 else min_bottom = b.bottom;
267
268 *height = min_bottom - max_top;
269}
270
271static inline void
272_split_strict(list_t *dirty, const rect_t current, rect_t r)
273{
274 int h_1, h_2, w_1, w_2;
275
276 h_1 = current.top - r.top;
277 h_2 = r.bottom - current.bottom;
278 w_1 = current.left - r.left;
279 w_2 = r.right - current.right;
280
281 if (h_1 > 0)
282 {
283 /* .--.r (b) .---.r2
284 * | | | |
285 * .-------.cur (a) .---.r '---'
286 * | | | | -> | | +
287 * | `--' | `---'
288 * `-------'
289 */
290 rect_list_append_xywh(dirty, r.left, r.top, r.width, h_1);
291 r.height -= h_1;
292 r.top = current.top;
293 }
294
295 if (h_2 > 0)
296 {
297 /* .-------.cur (a)
298 * | .---. | .---.r
299 * | | | | -> | |
300 * `-------' `---' + .---.r2
301 * | | | |
302 * `---'r (b) `---'
303 */
304 rect_list_append_xywh(dirty, r.left, current.bottom, r.width, h_2);
305 r.height -= h_2;
306 }
307
308 if (w_1 > 0)
309 {
310 /* (b) r .----.cur (a)
311 * .--|-. | .--.r2 .-.r
312 * | | | | -> | | + | |
313 * `--|-' | `--' `-'
314 * `----'
315 */
316 rect_list_append_xywh(dirty, r.left, r.top, w_1, r.height);
317 /* not necessary to keep these, r (b) will be destroyed */
318 /* r.width -= w_1; */
319 /* r.left = current.left; */
320 }
321
322 if (w_2 > 0)
323 {
324 /* .----.cur (a)
325 * | |
326 * | .-|--.r (b) .-.r .--.r2
327 * | | | | -> | | + | |
328 * | `-|--' `-' `--'
329 * `----'
330 */
331 rect_list_append_xywh(dirty, current.right, r.top, w_2, r.height);
332 /* not necessary to keep this, r (b) will be destroyed */
333 /* r.width -= w_2; */
334 }
335}
336
337static inline void
338rect_list_del_split_strict(list_t *rects, const rect_t del_r)
339{
340 list_t modified = list_zeroed;
341 list_node_t *cur_node, *prev_node;
342
343 prev_node = NULL;
344 cur_node = rects->head;
345 while (cur_node)
346 {
347 int intra_width, intra_height;
348 rect_t current;
349
350 current = ((rect_node_t*)cur_node)->rect;
351
352 _calc_intra_rect_area(del_r, current, &intra_width, &intra_height);
353 if ((intra_width <= 0) || (intra_height <= 0))
354 {
355 /* .---.current .---.del_r
356 * | | | |
357 * `---+---.del_r `---+---.current
358 * | | | |
359 * `---' `---'
360 * no interception, nothing to do
361 */
362 prev_node = cur_node;
363 cur_node = cur_node->next;
364 }
365 else if ((intra_width == current.width) &&
366 (intra_height == current.height))
367 {
368 /* .-------.del_r
369 * | .---. |
370 * | | | |
371 * | `---'current
372 * `-------'
373 * current is contained, remove from rects
374 */
375 cur_node = cur_node->next;
376 rect_list_del_next(rects, prev_node);
377 }
378 else
379 {
380 _split_strict(&modified, del_r, current);
381 cur_node = cur_node->next;
382 rect_list_del_next(rects, prev_node);
383 }
384 }
385
386 rect_list_concat(rects, &modified);
387}
388
389static inline void
390rect_list_add_split_strict(list_t *rects, list_node_t *node)
391{
392 list_t dirty = list_zeroed;
393 list_t new_dirty = list_zeroed;
394 list_node_t *cur_node;
395
396 if (!rects->head)
397 {
398 rect_list_append_node(rects, node);
399 return;
400 }
401
402 rect_list_append_node(&dirty, node);
403
404 cur_node = rects->head;
405 while (dirty.head)
406 {
407 rect_t current;
408
409 if (!cur_node)
410 {
411 rect_list_concat(rects, &dirty);
412 break;
413 }
414
415 current = ((rect_node_t*)cur_node)->rect;
416
417 while (dirty.head)
418 {
419 int intra_width, intra_height;
420 rect_t r;
421
422 r = ((rect_node_t *)dirty.head)->rect;
423 _calc_intra_rect_area(r, current, &intra_width, &intra_height);
424 if ((intra_width == r.width) && (intra_height == r.height))
425 /* .-------.cur
426 * | .---.r|
427 * | | | |
428 * | `---' |
429 * `-------'
430 */
431 rect_list_del_next(&dirty, NULL);
432 else if ((intra_width <= 0) || (intra_height <= 0))
433 {
434 /* .---.cur .---.r
435 * | | | |
436 * `---+---.r `---+---.cur
437 * | | | |
438 * `---' `---'
439 */
440 list_node_t *tmp;
441 tmp = rect_list_unlink_next(&dirty, NULL);
442 rect_list_append_node(&new_dirty, tmp);
443 }
444 else
445 {
446 _split_strict(&new_dirty, current, r);
447 rect_list_del_next(&dirty, NULL);
448 }
449 }
450 dirty = new_dirty;
451 new_dirty = list_zeroed;
452
453 cur_node = cur_node->next;
454 }
455}
456
457static inline void
458_calc_intra_outer_rect_area(const rect_t a, const rect_t b,
459 rect_t *intra, rect_t *outer)
460{
461 int min_left, max_left, min_right, max_right;
462 int min_top, max_top, min_bottom, max_bottom;
463
464 if (a.left < b.left)
465 {
466 max_left = b.left;
467 min_left = a.left;
468 }
469 else
470 {
471 max_left = a.left;
472 min_left = b.left;
473 }
474
475 if (a.right < b.right)
476 {
477 min_right = a.right;
478 max_right = b.right;
479 }
480 else
481 {
482 min_right = b.right;
483 max_right = a.right;
484 }
485
486 intra->left = max_left;
487 intra->right = min_right;
488 intra->width = min_right - max_left;
489
490 outer->left = min_left;
491 outer->right = max_right;
492 outer->width = max_right - min_left;
493
494 if (a.top < b.top)
495 {
496 max_top = b.top;
497 min_top = a.top;
498 }
499 else
500 {
501 max_top = a.top;
502 min_top = b.top;
503 }
504
505 if (a.bottom < b.bottom)
506 {
507 min_bottom = a.bottom;
508 max_bottom = b.bottom;
509 }
510 else
511 {
512 min_bottom = b.bottom;
513 max_bottom = a.bottom;
514 }
515
516 intra->top = max_top;
517 intra->bottom = min_bottom;
518 intra->height = min_bottom - max_top;
519 if ((intra->width > 0) && (intra->height > 0))
520 intra->area = intra->width * intra->height;
521 else
522 intra->area = 0;
523
524 outer->top = min_top;
525 outer->bottom = max_bottom;
526 outer->height = max_bottom - min_top;
527 outer->area = outer->width * outer->height;
528}
529
530enum
531{
532 SPLIT_FUZZY_ACTION_NONE,
533 SPLIT_FUZZY_ACTION_SPLIT,
534 SPLIT_FUZZY_ACTION_MERGE
535};
536
537static inline int
538_split_fuzzy(list_t *dirty, const rect_t a, rect_t *b)
539{
540 int h_1, h_2, w_1, w_2, action;
541
542 h_1 = a.top - b->top;
543 h_2 = b->bottom - a.bottom;
544 w_1 = a.left - b->left;
545 w_2 = b->right - a.right;
546
547 action = SPLIT_FUZZY_ACTION_NONE;
548
549 if (h_1 > 0)
550 {
551 /* .--.r (b) .---.r2
552 * | | | |
553 * .-------.cur (a) .---.r '---'
554 * | | | | -> | | +
555 * | `--' | `---'
556 * `-------'
557 */
558 rect_list_append_xywh(dirty, b->left, b->top, b->width, h_1);
559 b->height -= h_1;
560 b->top = a.top;
561 action = SPLIT_FUZZY_ACTION_SPLIT;
562 }
563
564 if (h_2 > 0)
565 {
566 /* .-------.cur (a)
567 * | .---. | .---.r
568 * | | | | -> | |
569 * `-------' `---' + .---.r2
570 * | | | |
571 * `---'r (b) `---'
572 */
573 rect_list_append_xywh(dirty, b->left, a.bottom, b->width, h_2);
574 b->height -= h_2;
575 action = SPLIT_FUZZY_ACTION_SPLIT;
576 }
577
578 if (((w_1 > 0) || (w_2 > 0)) && (a.height == b->height))
579 return SPLIT_FUZZY_ACTION_MERGE;
580
581 if (w_1 > 0)
582 {
583 /* (b) r .----.cur (a)
584 * .--|-. | .--.r2 .-.r
585 * | | | | -> | | + | |
586 * `--|-' | `--' `-'
587 * `----'
588 */
589 rect_list_append_xywh(dirty, b->left, b->top, w_1, b->height);
590 /* not necessary to keep these, r (b) will be destroyed */
591 /* b->width -= w_1; */
592 /* b->left = a.left; */
593 action = SPLIT_FUZZY_ACTION_SPLIT;
594 }
595
596 if (w_2 > 0)
597 {
598 /* .----.cur (a)
599 * | |
600 * | .-|--.r (b) .-.r .--.r2
601 * | | | | -> | | + | |
602 * | `-|--' `-' `--'
603 * `----'
604 */
605 rect_list_append_xywh(dirty, a.right, b->top, w_2, b->height);
606 /* not necessary to keep these, r (b) will be destroyed */
607 /* b->width -= w_2; */
608 action = SPLIT_FUZZY_ACTION_SPLIT;
609 }
610
611 return action;
612}
613
614static inline list_node_t *
615rect_list_add_split_fuzzy(list_t *rects, list_node_t *node, int accepted_error)
616{
617 list_t dirty = list_zeroed;
618 list_node_t *old_last;
619
620 old_last = rects->tail;
621
622 if (!rects->head)
623 {
624 rect_list_append_node(rects, node);
625 return old_last;
626 }
627
628 rect_list_append_node(&dirty, node);
629 while (dirty.head)
630 {
631 list_node_t *d_node, *cur_node, *prev_cur_node;
632 int keep_dirty;
633 rect_t r;
634
635 d_node = rect_list_unlink_next(&dirty, NULL);
636 r = ((rect_node_t *)d_node)->rect;
637
638 prev_cur_node = NULL;
639 cur_node = rects->head;
640 keep_dirty = 1;
641 while (cur_node)
642 {
643 int area, action;
644 rect_t current, intra, outer;
645
646 current = ((rect_node_t *)cur_node)->rect;
647
648 _calc_intra_outer_rect_area(r, current, &intra, &outer);
649 area = current.area + r.area - intra.area;
650
651 if ((intra.width == r.width) && (intra.height == r.height))
652 {
653 /* .-------.cur
654 * | .---.r|
655 * | | | |
656 * | `---' |
657 * `-------'
658 */
659 keep_dirty = 0;
660 break;
661 }
662 else if ((intra.width == current.width) &&
663 (intra.height == current.height))
664 {
665 /* .-------.r
666 * | .---.cur
667 * | | | |
668 * | `---' |
669 * `-------'
670 */
671 if (old_last == cur_node)
672 old_last = prev_cur_node;
673 cur_node = cur_node->next;
674 rect_list_del_next(rects, prev_cur_node);
675 }
676 else if ((outer.area - area) <= accepted_error)
677 {
678 /* .-----------. bounding box (outer)
679 * |.---. .---.|
680 * ||cur| |r ||
681 * || | | ||
682 * |`---' `---'|
683 * `-----------'
684 * merge them, remove both and add merged
685 */
686 rect_node_t *n;
687
688 if (old_last == cur_node)
689 old_last = prev_cur_node;
690
691 n = (rect_node_t *)rect_list_unlink_next(rects, prev_cur_node);
692 n->rect = outer;
693 rect_list_append_node(&dirty, (list_node_t *)n);
694
695 keep_dirty = 0;
696 break;
697 }
698 else if (intra.area <= accepted_error)
699 {
700 /* .---.cur .---.r
701 * | | | |
702 * `---+---.r `---+---.cur
703 * | | | |
704 * `---' `---'
705 * no split, no merge
706 */
707 prev_cur_node = cur_node;
708 cur_node = cur_node->next;
709 }
710 else
711 {
712 /* split is required */
713 action = _split_fuzzy(&dirty, current, &r);
714 if (action == SPLIT_FUZZY_ACTION_MERGE)
715 {
716 /* horizontal merge is possible: remove both, add merged */
717 rect_node_t *n;
718
719 if (old_last == cur_node)
720 old_last = prev_cur_node;
721
722 n = (rect_node_t *)
723 rect_list_unlink_next(rects, prev_cur_node);
724
725 n->rect.left = outer.left;
726 n->rect.width = outer.width;
727 n->rect.right = outer.right;
728 n->rect.area = outer.width * r.height;
729 rect_list_append_node(&dirty, (list_node_t *)n);
730 }
731 else if (action == SPLIT_FUZZY_ACTION_NONE)
732 {
733 /*
734 * this rect check was totally useless,
735 * should never happen
736 */
737 /* prev_cur_node = cur_node; */
738 /* cur_node = cur_node->next; */
739 WRN("Should not get here!");
740 abort();
741 }
742
743 keep_dirty = 0;
744 break;
745 }
746 }
747
748 if (UNLIKELY(keep_dirty)) rect_list_append_node(rects, d_node);
749 else rect_list_node_pool_put(d_node);
750 }
751
752 return old_last;
753}
754
755static inline void
756_calc_outer_rect_area(const rect_t a, const rect_t b, rect_t *outer)
757{
758 int min_left, max_right;
759 int min_top, max_bottom;
760
761 if (a.left < b.left) min_left = a.left;
762 else min_left = b.left;
763
764 if (a.right < b.right) max_right = b.right;
765 else max_right = a.right;
766
767 outer->left = min_left;
768 outer->right = max_right;
769 outer->width = max_right - min_left;
770
771 if (a.top < b.top) min_top = a.top;
772 else min_top = b.top;
773
774 if (a.bottom < b.bottom) max_bottom = b.bottom;
775 else max_bottom = a.bottom;
776
777 outer->top = min_top;
778 outer->bottom = max_bottom;
779 outer->height = max_bottom - min_top;
780
781 outer->area = outer->width * outer->height;
782}
783
784static inline void
785rect_list_merge_rects(list_t *rects, list_t *to_merge, int accepted_error)
786{
787 while (to_merge->head)
788 {
789 list_node_t *node, *parent_node;
790 rect_t r1;
791 int merged;
792
793 r1 = ((rect_node_t *)to_merge->head)->rect;
794
795 merged = 0;
796 parent_node = NULL;
797 node = rects->head;
798 while (node)
799 {
800 rect_t r2, outer;
801 int area;
802
803 r2 = ((rect_node_t *)node)->rect;
804
805 _calc_outer_rect_area(r1, r2, &outer);
806 area = r1.area + r2.area; /* intra area is taken as 0 */
807 if (outer.area - area <= accepted_error)
808 {
809 /*
810 * remove both r1 and r2, create r3
811 * actually r3 uses r2 instance, saves memory
812 */
813 rect_node_t *n;
814
815 n = (rect_node_t *)rect_list_unlink_next(rects, parent_node);
816 n->rect = outer;
817 rect_list_append_node(to_merge, (list_node_t *)n);
818 merged = 1;
819 break;
820 }
821
822 parent_node = node;
823 node = node->next;
824 }
825
826 if (!merged)
827 {
828 list_node_t *n;
829 n = rect_list_unlink_next(to_merge, NULL);
830 rect_list_append_node(rects, n);
831 }
832 else
833 rect_list_del_next(to_merge, NULL);
834 }
835}
836
837static inline void
838rect_list_add_split_fuzzy_and_merge(list_t *rects,
839 list_node_t *node,
840 int split_accepted_error,
841 int merge_accepted_error)
842{
843 list_node_t *n;
844
845 n = rect_list_add_split_fuzzy(rects, node, split_accepted_error);
846 if (n && n->next)
847 {
848 list_t to_merge;
849
850 /* split list into 2 segments, already merged and to merge */
851 to_merge.head = n->next;
852 to_merge.tail = rects->tail;
853 rects->tail = n;
854 n->next = NULL;
855
856 rect_list_merge_rects(rects, &to_merge, merge_accepted_error);
857 }
858}
859#endif /* EVAS_RECT_SPLIT */
860
861#define TILE(tb, x, y) ((tb)->tiles.tiles[((y) * (tb)->tiles.w) + (x)])
862
863#ifdef RECTUPDATE
864#elif defined(EVAS_RECT_SPLIT)
865#else
866/*
867static int tilebuf_x_intersect(Tilebuf *tb, int x, int w, int *x1, int *x2, int *x1_fill, int *x2_fill);
868static int tilebuf_y_intersect(Tilebuf *tb, int y, int h, int *y1, int *y2, int *y1_fill, int *y2_fill);
869static int tilebuf_intersect(int tsize, int tlen, int tnum, int x, int w, int *x1, int *x2, int *x1_fill, int *x2_fill);
870 */
871#endif
872/*
873static void tilebuf_setup(Tilebuf *tb);
874 */
875
876EAPI void
877evas_common_tilebuf_init(void)
878{
879}
880
881EAPI Tilebuf *
882evas_common_tilebuf_new(int w, int h)
883{
884 Tilebuf *tb;
885
886 tb = calloc(1, sizeof(Tilebuf));
887 if (!tb) return NULL;
888
889 tb->tile_size.w = 8;
890 tb->tile_size.h = 8;
891 tb->outbuf_w = w;
892 tb->outbuf_h = h;
893
894 return tb;
895}
896
897EAPI void
898evas_common_tilebuf_free(Tilebuf *tb)
899{
900#ifdef RECTUPDATE
901/*
902 evas_common_regionbuf_free(tb->rb);
903 */
904#elif defined(EVAS_RECT_SPLIT)
905 rect_list_clear(&tb->rects);
906 rect_list_node_pool_flush();
907#else
908/*
909 if (tb->tiles.tiles) free(tb->tiles.tiles);
910 */
911#endif
912 free(tb);
913}
914
915EAPI void
916evas_common_tilebuf_set_tile_size(Tilebuf *tb, int tw, int th)
917{
918 tb->tile_size.w = tw;
919 tb->tile_size.h = th;
920/*
921 tilebuf_setup(tb);
922 */
923}
924
925EAPI void
926evas_common_tilebuf_get_tile_size(Tilebuf *tb, int *tw, int *th)
927{
928 if (tw) *tw = tb->tile_size.w;
929 if (th) *th = tb->tile_size.h;
930}
931
932#ifdef EVAS_RECT_SPLIT
933static inline int
934_add_redraw(list_t *rects, int x, int y, int w, int h)
935{
936 rect_node_t *rn;
937/* we dont need to do this fuzz stuff - it actually creates overdraw bugs
938 * when evas shouldnt draw at all.
939 x >>= 1;
940 y >>= 1;
941 w += 2;
942 w >>= 1;
943 h += 2;
944 h >>= 1;
945 */
946 rn = (rect_node_t *)rect_list_node_pool_get();
947 rn->_lst = list_node_zeroed;
948 rect_init(&rn->rect, x, y, w, h);
949 //INF("ACCOUNTING: add_redraw: %4d,%4d %3dx%3d", x, y, w, h);
950 //testing on my core2 duo desktop - fuzz of 32 or 48 is best.
951#define FUZZ 32
952 rect_list_add_split_fuzzy_and_merge(rects, (list_node_t *)rn,
953 FUZZ * FUZZ, FUZZ * FUZZ);
954 return 1;
955}
956#endif
957
958EAPI int
959evas_common_tilebuf_add_redraw(Tilebuf *tb, int x, int y, int w, int h)
960{
961#ifdef RECTUPDATE
962/*
963 int i;
964
965 if ((w <= 0) || (h <= 0)) return 0;
966 RECTS_CLIP_TO_RECT(x, y, w, h, 0, 0, tb->outbuf_w, tb->outbuf_h);
967 if ((w <= 0) || (h <= 0)) return 0;
968 for (i = 0; i < h; i++)
969 evas_common_regionbuf_span_add(tb->rb, x, x + w - 1, y + i);
970 return 1;
971 */
972#elif defined(EVAS_RECT_SPLIT)
973 if ((w <= 0) || (h <= 0)) return 0;
974 RECTS_CLIP_TO_RECT(x, y, w, h, 0, 0, tb->outbuf_w, tb->outbuf_h);
975 if ((w <= 0) || (h <= 0)) return 0;
976 // optimize a common case -> adding the exact same rect 2x in a row
977 if ((tb->prev_add.x == x) && (tb->prev_add.y == y) &&
978 (tb->prev_add.w == w) && (tb->prev_add.h == h)) return 1;
979 tb->prev_add.x = x; tb->prev_add.y = y;
980 tb->prev_add.w = w; tb->prev_add.h = h;
981 tb->prev_del.w = 0; tb->prev_del.h = 0;
982 return _add_redraw(&tb->rects, x, y, w, h);
983#else
984/*
985 int tx1, tx2, ty1, ty2, tfx1, tfx2, tfy1, tfy2, xx, yy;
986 int num;
987
988 if ((w <= 0) || (h <= 0)) return 0;
989 RECTS_CLIP_TO_RECT(x, y, w, h, 0, 0, tb->outbuf_w, tb->outbuf_h);
990 if ((w <= 0) || (h <= 0)) return 0;
991 num = 0;
992 // wipes out any motion vectors in tiles it touches into redraws
993 if (tilebuf_x_intersect(tb, x, w, &tx1, &tx2, &tfx1, &tfx2) &&
994 tilebuf_y_intersect(tb, y, h, &ty1, &ty2, &tfy1, &tfy2))
995 {
996 Tilebuf_Tile *tbt;
997 int delta_x;
998 int delta_y;
999
1000 tbt = &(TILE(tb, tx1, ty1));
1001 delta_x = tx2 - tx1 + 1;
1002 delta_y = ty2 - ty1 + 1;
1003 for (yy = delta_y; yy > 0; yy--)
1004 {
1005 Tilebuf_Tile *tbti;
1006
1007 tbti = tbt;
1008 for (xx = delta_x; xx > 0; xx--)
1009 {
1010 tbti->redraw = 1;
1011 tbti++;
1012 }
1013 tbt += tb->tiles.w;
1014 }
1015 num = (tx2 - tx1 + 1) * (ty2 - ty1 + 1);
1016 }
1017 return num;
1018 */
1019#endif
1020}
1021
1022EAPI int
1023evas_common_tilebuf_del_redraw(Tilebuf *tb, int x, int y, int w, int h)
1024{
1025#ifdef RECTUPDATE
1026/*
1027 int i;
1028
1029 for (i = 0; i < h; i++)
1030 evas_common_regionbuf_span_del(tb->rb, x, x + w - 1, y + i);
1031 */
1032#elif defined(EVAS_RECT_SPLIT)
1033 rect_t r;
1034
1035 if (!tb->rects.head) return 0;
1036 if ((w <= 0) || (h <= 0)) return 0;
1037 RECTS_CLIP_TO_RECT(x, y, w, h, 0, 0, tb->outbuf_w, tb->outbuf_h);
1038 if ((w <= 0) || (h <= 0)) return 0;
1039
1040/* we dont need to do this fuzz stuff - it actually creates overdraw bugs
1041 * when evas shouldnt draw at all.
1042 x += 1;
1043 y += 1;
1044 x >>= 1;
1045 y >>= 1;
1046 w -= 1;
1047 w >>= 1;
1048 h -= 1;
1049 h >>= 1;
1050
1051 if ((w <= 0) || (h <= 0)) return 0;
1052 */
1053
1054 // optimize a common case -> deleting the exact same rect 2x in a row
1055 if ((tb->prev_del.x == x) && (tb->prev_del.y == y) &&
1056 (tb->prev_del.w == w) && (tb->prev_del.h == h)) return 1;
1057 tb->prev_del.x = x; tb->prev_del.y = y;
1058 tb->prev_del.w = w; tb->prev_del.h = h;
1059 tb->prev_add.w = 0; tb->prev_add.h = 0;
1060 rect_init(&r, x, y, w, h);
1061
1062 rect_list_del_split_strict(&tb->rects, r);
1063 tb->need_merge = 1;
1064 return 0;
1065#else
1066/*
1067 int tx1, tx2, ty1, ty2, tfx1, tfx2, tfy1, tfy2, xx, yy;
1068 int num;
1069
1070 num = 0;
1071 // wipes out any motion vectors in tiles it touches into redraws
1072 if (tilebuf_x_intersect(tb, x, w, &tx1, &tx2, &tfx1, &tfx2) &&
1073 tilebuf_y_intersect(tb, y, h, &ty1, &ty2, &tfy1, &tfy2))
1074 {
1075 Tilebuf_Tile *tbt;
1076 int delta_y;
1077 int delta_x;
1078
1079 if (!tfx1) tx1++;
1080 if (!tfx2) tx2--;
1081 if (!tfy1) ty1++;
1082 if (!tfy2) ty2--;
1083
1084 tbt = &(TILE(tb, tx1, ty1));
1085 delta_x = tx2 - tx1 + 1;
1086 delta_y = ty2 - ty1 + 1;
1087 for (yy = delta_y; yy > 0; yy--)
1088 {
1089 Tilebuf_Tile *tbti;
1090
1091 tbti = tbt;
1092 for (xx = delta_x; xx > 0; xx--)
1093 {
1094 tbti->redraw = 0;
1095 tbti++;
1096 }
1097 tbt += tb->tiles.w;
1098 }
1099 num = (tx2 - tx1 + 1) * (ty2 - ty1 + 1);
1100 }
1101 return num;
1102 */
1103#endif
1104}
1105
1106EAPI int
1107evas_common_tilebuf_add_motion_vector(Tilebuf *tb __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__, int dx __UNUSED__, int dy __UNUSED__, int alpha __UNUSED__)
1108{
1109#ifdef EVAS_RECT_SPLIT
1110/* motion vector handling never has been used -> disable it
1111 list_t lr = list_zeroed;
1112 int num;
1113
1114 num = _add_redraw(&lr, x, y, w, h);
1115 num += _add_redraw(&lr, x + dx, y + dy, w, h);
1116 while (lr.head)
1117 {
1118 list_node_t *node = rect_list_unlink_next(&lr, NULL);
1119 rect_list_add_split_fuzzy_and_merge(&tb->rects, node,
1120 FUZZ * FUZZ, FUZZ * FUZZ);
1121 }
1122 return num;
1123 */
1124 return 0;
1125#else
1126/*
1127 int num;
1128
1129 num = evas_common_tilebuf_add_redraw(tb, x, y, w, h);
1130 num += evas_common_tilebuf_add_redraw(tb, x + dx, y + dy, w, h);
1131 return num;
1132 */
1133#endif
1134}
1135
1136EAPI void
1137evas_common_tilebuf_clear(Tilebuf *tb)
1138{
1139#ifdef RECTUPDATE
1140/*
1141 evas_common_regionbuf_clear(tb->rb);
1142 */
1143#elif defined(EVAS_RECT_SPLIT)
1144 tb->prev_add.x = tb->prev_add.y = tb->prev_add.w = tb->prev_add.h = 0;
1145 tb->prev_del.x = tb->prev_del.y = tb->prev_del.w = tb->prev_del.h = 0;
1146 rect_list_clear(&tb->rects);
1147 tb->need_merge = 0;
1148#else
1149/*
1150 if (!tb->tiles.tiles) return;
1151 memset(tb->tiles.tiles, 0, tb->tiles.w * tb->tiles.h * sizeof(Tilebuf_Tile));
1152 */
1153#endif
1154}
1155
1156EAPI Tilebuf_Rect *
1157evas_common_tilebuf_get_render_rects(Tilebuf *tb)
1158{
1159#ifdef RECTUPDATE
1160/*
1161 return evas_common_regionbuf_rects_get(tb->rb);
1162 */
1163#elif defined(EVAS_RECT_SPLIT)
1164 list_node_t *n;
1165 Tilebuf_Rect *rects = NULL;
1166
1167 if (tb->need_merge) {
1168 list_t to_merge;
1169 to_merge = tb->rects;
1170 tb->rects = list_zeroed;
1171 rect_list_merge_rects(&tb->rects, &to_merge, FUZZ * FUZZ);
1172 tb->need_merge = 0;
1173 }
1174
1175 for (n = tb->rects.head; n; n = n->next) {
1176 rect_t cur;
1177
1178 cur = ((rect_node_t *)n)->rect;
1179/* disable fuzz - created bugs.
1180 cur.left <<= 1;
1181 cur.top <<= 1;
1182 cur.width <<= 1;
1183 cur.height <<= 1;
1184 */
1185 RECTS_CLIP_TO_RECT(cur.left, cur.top, cur.width, cur.height,
1186 0, 0, tb->outbuf_w, tb->outbuf_h);
1187 if ((cur.width > 0) && (cur.height > 0))
1188 {
1189 Tilebuf_Rect *r;
1190
1191 r = malloc(sizeof(Tilebuf_Rect));
1192 r->x = cur.left;
1193 r->y = cur.top;
1194 r->w = cur.width;
1195 r->h = cur.height;
1196
1197 rects = (Tilebuf_Rect *)eina_inlist_append(EINA_INLIST_GET(rects), EINA_INLIST_GET(r));
1198 }
1199 }
1200 return rects;
1201
1202#else
1203/*
1204 Tilebuf_Rect *rects = NULL;
1205 Tilebuf_Tile *tbt;
1206 int x, y;
1207
1208 tbt = &(TILE(tb, 0, 0));
1209 for (y = 0; y < tb->tiles.h; y++)
1210 {
1211 for (x = 0; x < tb->tiles.w; x++, tbt++)
1212 {
1213 if (tbt->redraw)
1214 {
1215 Tilebuf_Tile *tbti;
1216 int can_expand_x = 1, can_expand_y = 1;
1217 Tilebuf_Rect *r = NULL;
1218 int xx = 0, yy = 0;
1219 r = malloc(sizeof(Tilebuf_Rect));
1220 r->_list_data.next = NULL;
1221 r->_list_data.prev = NULL;
1222 r->_list_data.last = NULL;
1223
1224 // amalgamate tiles
1225#if 1
1226 tbti = tbt;
1227 while (can_expand_x)
1228 {
1229 tbti++;
1230 xx++;
1231 if ((x + xx) >= tb->tiles.w)
1232 can_expand_x = 0;
1233 else if (!(tbti->redraw))
1234 can_expand_x = 0;
1235 if (can_expand_x)
1236 tbti->redraw = 0;
1237 }
1238 tbti = tbt;
1239 while (can_expand_y)
1240 {
1241 int i;
1242
1243 tbti += tb->tiles.w;
1244 yy++;
1245 if ((y + yy) >= tb->tiles.h)
1246 can_expand_y = 0;
1247 if (can_expand_y)
1248 {
1249 Tilebuf_Tile *tbtj;
1250
1251 tbtj = tbti;
1252 for (i = x; i < x + xx; i++, tbtj++)
1253 {
1254 if (!(tbtj->redraw))
1255 {
1256 can_expand_y = 0;
1257 break;
1258 }
1259 }
1260 }
1261 if (can_expand_y)
1262 {
1263 Tilebuf_Tile *tbtj;
1264
1265 tbtj = tbti;
1266 for (i = x; i < x + xx; i++, tbtj++)
1267 tbtj->redraw = 0;
1268 }
1269 }
1270 tbt->redraw = 0;
1271#else
1272 xx = 1;
1273 yy = 1;
1274#endif
1275 r->x = x * tb->tile_size.w;
1276 r->y = y * tb->tile_size.h;
1277 r->w = (xx) * tb->tile_size.w;
1278 r->h = (yy) * tb->tile_size.h;
1279 rects = eina_inlist_append(rects, r);
1280 x = x + (xx - 1);
1281 tbt += xx - 1;
1282 }
1283 }
1284 }
1285 return rects;
1286 */
1287#endif
1288}
1289
1290EAPI void
1291evas_common_tilebuf_free_render_rects(Tilebuf_Rect *rects)
1292{
1293 while (rects)
1294 {
1295 Tilebuf_Rect *r;
1296
1297 r = rects;
1298 rects = (Tilebuf_Rect *)eina_inlist_remove(EINA_INLIST_GET(rects), EINA_INLIST_GET(r));
1299 free(r);
1300 }
1301}
1302
1303/* need a way of getting rectangles to: blit, re-render */
1304
1305
1306
1307
1308
1309/* internal usage */
1310/*
1311static void
1312tilebuf_setup(Tilebuf *tb)
1313{
1314 if ((tb->outbuf_w <= 0) || (tb->outbuf_h <= 0)) return;
1315#ifdef RECTUPDATE
1316 tb->rb = evas_common_regionbuf_new(tb->outbuf_w, tb->outbuf_h);
1317#elif defined(EVAS_RECT_SPLIT)
1318 tb->rects = list_zeroed;
1319#else
1320 if (tb->tiles.tiles) free(tb->tiles.tiles);
1321 tb->tiles.tiles = NULL;
1322
1323 tb->tiles.w = (tb->outbuf_w + (tb->tile_size.w - 1)) / tb->tile_size.w;
1324 tb->tiles.h = (tb->outbuf_h + (tb->tile_size.h - 1)) / tb->tile_size.h;
1325
1326 tb->tiles.tiles = malloc(tb->tiles.w * tb->tiles.h * sizeof(Tilebuf_Tile));
1327
1328 if (!tb->tiles.tiles)
1329 {
1330 tb->tiles.w = 0;
1331 tb->tiles.h = 0;
1332 return;
1333 }
1334 memset(tb->tiles.tiles, 0, tb->tiles.w * tb->tiles.h * sizeof(Tilebuf_Tile));
1335#endif
1336}
1337*/
1338
1339#ifdef RECTUPDATE
1340#elif defined(EVAS_RECT_SPLIT)
1341#else
1342/*
1343static int
1344tilebuf_x_intersect(Tilebuf *tb, int x, int w, int *x1, int *x2, int *x1_fill, int *x2_fill)
1345{
1346 return tilebuf_intersect(tb->tile_size.w, tb->outbuf_w, tb->tiles.w,
1347 x, w, x1, x2, x1_fill, x2_fill);
1348}
1349
1350static int
1351tilebuf_y_intersect(Tilebuf *tb, int y, int h, int *y1, int *y2, int *y1_fill, int *y2_fill)
1352{
1353 return tilebuf_intersect(tb->tile_size.h, tb->outbuf_h, tb->tiles.h,
1354 y, h, y1, y2, y1_fill, y2_fill);
1355}
1356
1357static int
1358tilebuf_intersect(int tsize, int tlen, int tnum, int x, int w, int *x1, int *x2, int *x1_fill, int *x2_fill)
1359{
1360 int p1, p2;
1361
1362 // initial clip out of region
1363 if ((x + w) <= 0) return 0;
1364 if (x >= tlen) return 0;
1365
1366 // adjust x & w so it all fits in region
1367 if (x < 0)
1368 {
1369 w += x;
1370 x = 0;
1371 }
1372 if (w < 0) return 0;
1373 if ((x + w) > tlen) w = tlen - x;
1374
1375 // now figure if the first edge is fully filling its tile
1376 p1 = (x) / tsize;
1377 if ((p1 * tsize) == (x)) *x1_fill = 1;
1378 else *x1_fill = 0;
1379 *x1 = p1;
1380
1381 // now figure if the last edge is fully filling its tile
1382 p2 = (x + w - 1) / tsize;
1383 if (((p2 + 1) * tsize) == (x + w)) *x2_fill = 1;
1384 else *x2_fill = 0;
1385 *x2 = p2;
1386
1387 return 1;
1388 tnum = 0;
1389}
1390*/
1391#endif
diff --git a/libraries/evas/src/lib/engines/common/language/evas_bidi_utils.c b/libraries/evas/src/lib/engines/common/language/evas_bidi_utils.c
new file mode 100644
index 0000000..9f7859b
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/language/evas_bidi_utils.c
@@ -0,0 +1,641 @@
1#include <string.h>
2#include <stdlib.h>
3
4#include "evas_common.h"
5#include "evas_bidi_utils.h"
6
7#include "evas_font_private.h"
8
9#ifdef BIDI_SUPPORT
10#include <fribidi/fribidi.h>
11/**
12 * @internal
13 * @addtogroup Evas_Utils
14 *
15 * @{
16 */
17/**
18 * @internal
19 * @addtogroup Evas_BiDi
20 *
21 * @{
22 */
23
24/**
25 * @internal
26 * @def _SAFE_FREE(x)
27 * checks if x is not NULL, if it's not, it's freed and set to NULL.
28 */
29#define _SAFE_FREE(x) \
30 do { \
31 if (x) \
32 { \
33 free(x); \
34 x = NULL; \
35 } \
36 } while(0)
37
38#if SIZEOF_FRIBIDICHAR != SIZEOF_EINA_UNICODE
39# define EVAS_FRIBIDI_EINA_UNICODE_UNEQUAL
40#endif
41
42#ifdef EVAS_FRIBIDI_EINA_UNICODE_UNEQUAL
43/* Convert bidichar to eina_unicode assume both are valid pointers */
44static Eina_Unicode *
45_evas_bidi_fribidichar_to_unicode(Eina_Unicode *dest, const FriBidiChar *src)
46{
47 Eina_Unicode *ret = dest;
48
49 while (*src)
50 *dest++ = *src++;
51 *dest = 0;
52 return ret;
53}
54
55/* Convert eina_unicode to bidi_char assume both are valid pointers */
56static FriBidiChar *
57_evas_bidi_unicode_to_fribidichar(FriBidiChar *dest, const Eina_Unicode *src)
58{
59 FriBidiChar *ret = dest;
60
61 while (*src)
62 *dest++ = *src++;
63 *dest = 0;
64 return ret;
65}
66#endif
67
68/**
69 * @internal
70 * Checks if the string has RTL characters.
71 *
72 * @param str The string to be checked
73 * @return #EINA_TRUE if true, #EINA_FALSE otherwise.
74 */
75Eina_Bool
76evas_bidi_is_rtl_str(const Eina_Unicode *str)
77{
78 EvasBiDiCharType type;
79
80 if (!str)
81 return EINA_FALSE;
82
83 for ( ; *str ; str++)
84 {
85 type = fribidi_get_bidi_type((FriBidiChar) *str);
86 if (FRIBIDI_IS_LETTER(type) && FRIBIDI_IS_RTL(type))
87 {
88 return EINA_TRUE;
89 }
90 }
91 return EINA_FALSE;
92}
93
94/**
95 * @internal
96 * Shapes the string ustr according to the bidi properties.
97 *
98 * @param str The string to shape
99 * @param bidi_props the bidi props to shaped according.
100 * @param start the start of the string to shape (offset in bidi_props)
101 * @param len the length of th string.
102 * @return #EINA_TRUE on success, #EINA_FALSE otherwise.
103 */
104EAPI Eina_Bool
105evas_bidi_shape_string(Eina_Unicode *eina_ustr, const Evas_BiDi_Paragraph_Props *bidi_props, size_t start, size_t len)
106{
107 FriBidiChar *ustr, *base_ustr = NULL;
108
109 if (!bidi_props)
110 return EINA_FALSE;
111
112 /* The size of fribidichar is different than eina_unicode, convert */
113#ifdef EVAS_FRIBIDI_EINA_UNICODE_UNEQUAL
114 base_ustr = ustr = calloc(len + 1, sizeof(FriBidiChar));
115 ustr = _evas_bidi_unicode_to_fribidichar(ustr, eina_ustr);
116#else
117 (void) base_ustr;
118 ustr = (FriBidiChar *) eina_ustr;
119#endif
120
121
122 EvasBiDiJoiningType *join_types = NULL;
123 join_types = (EvasBiDiJoiningType *) malloc(sizeof(EvasBiDiJoiningType) * len);
124 if (!join_types)
125 {
126 return EINA_FALSE;
127 }
128 fribidi_get_joining_types(ustr, len, join_types);
129
130 fribidi_join_arabic(bidi_props->char_types + start, len,
131 bidi_props->embedding_levels + start, join_types);
132
133
134 /* Actually modify the string */
135 fribidi_shape(FRIBIDI_FLAGS_DEFAULT | FRIBIDI_FLAGS_ARABIC,
136 bidi_props->embedding_levels + start, len, join_types, ustr);
137
138 if (join_types) free(join_types);
139
140 /* Convert back */
141#ifdef EVAS_FRIBIDI_EINA_UNICODE_UNEQUAL
142 eina_ustr = _evas_bidi_fribidichar_to_unicode(eina_ustr, ustr);
143 if (base_ustr) free(base_ustr);
144#endif
145 return EINA_TRUE;
146}
147
148/**
149 * @internal
150 * Return a -1 terminated array of the indexes of the delimiters (passed in
151 * delim) found in the string. This result should be used with par_props_get.
152 *
153 * @param str The string to parse
154 * @param delim a list of delimiters to work with.
155 * @return returns a -1 terminated array of indexes according to positions of the delimiters found. NULL if there were none.
156 */
157int *
158evas_bidi_segment_idxs_get(const Eina_Unicode *str, const char *delim)
159{
160 Eina_Unicode *udelim;
161 const Eina_Unicode *str_base = str;
162 int *ret, *tmp_ret;
163 int ret_idx = 0, ret_len = 10; /* arbitrary choice */
164 udelim = eina_unicode_utf8_to_unicode(delim, NULL);
165 ret = malloc(ret_len * sizeof(int));
166 for ( ; *str ; str++)
167 {
168 const Eina_Unicode *del;
169 for (del = udelim ; *del ; del++)
170 {
171 if (*str == *del)
172 {
173 if (ret_idx >= ret_len)
174 {
175 /* arbitrary choice */
176 ret_len += 20;
177 tmp_ret = realloc(ret, ret_len * sizeof(int));
178 if (!tmp_ret)
179 {
180 free(ret);
181 return NULL;
182 }
183 }
184 ret[ret_idx++] = str - str_base;
185 break;
186 }
187 }
188 }
189 free(udelim);
190
191 /* If no indexes were found return NULL */
192 if (ret_idx == 0)
193 {
194 free(ret);
195 return NULL;
196 }
197
198 ret[ret_idx] = -1;
199 tmp_ret = realloc(ret, (ret_idx + 1) * sizeof(int));
200
201 return (tmp_ret) ? tmp_ret : ret;
202}
203
204/**
205 * @internal
206 * Allocates bidi properties according to ustr. First checks to see if the
207 * passed has rtl chars, if not, it returns NULL.
208 *
209 * Assumes all the segment_idxs are either -1 or legal, and > 0 indexes.
210 * Also assumes that the characters at the override points are of weak/neutral
211 * bidi type, otherwise unexpected results may occur.
212 *
213 * @param ustr The string to update according to.
214 * @param len The length of the string
215 * @param segment_idxs A -1 terminated array of points to start a new bidi analysis at (used for section high level bidi overrides). - NULL means none.
216 * @return returns allocated paragraph props on success, NULL otherwise.
217 */
218Evas_BiDi_Paragraph_Props *
219evas_bidi_paragraph_props_get(const Eina_Unicode *eina_ustr, size_t len,
220 int *segment_idxs)
221{
222 Evas_BiDi_Paragraph_Props *bidi_props = NULL;
223 EvasBiDiCharType *char_types = NULL;
224 EvasBiDiLevel *embedding_levels = NULL;
225 const FriBidiChar *ustr;
226 FriBidiChar *base_ustr = NULL;
227
228 if (!eina_ustr)
229 return NULL;
230
231
232 if (!evas_bidi_is_rtl_str(eina_ustr)) /* No need to handle bidi */
233 {
234 len = -1;
235 goto cleanup;
236 }
237
238 len = eina_unicode_strlen(eina_ustr);
239 /* The size of fribidichar s different than eina_unicode, convert */
240#ifdef EVAS_FRIBIDI_EINA_UNICODE_UNEQUAL
241 base_ustr = calloc(len + 1, sizeof(FriBidiChar));
242 base_ustr = _evas_bidi_unicode_to_fribidichar(base_ustr, eina_ustr);
243 ustr = base_ustr;
244#else
245 ustr = (const FriBidiChar *) eina_ustr;
246#endif
247
248 bidi_props = evas_bidi_paragraph_props_new();
249
250 /* Prep work for reordering */
251 char_types = (EvasBiDiCharType *) malloc(sizeof(EvasBiDiCharType) * len);
252 if (!char_types)
253 {
254 len = -2;
255 goto cleanup;
256 }
257 fribidi_get_bidi_types(ustr, len, char_types);
258
259 embedding_levels = (EvasBiDiLevel *)malloc(sizeof(EvasBiDiLevel) * len);
260 if (!embedding_levels)
261 {
262 len = -2;
263 goto cleanup;
264 }
265
266 if (segment_idxs)
267 {
268 size_t pos = 0;
269 int *itr;
270 EvasBiDiLevel base_level = 0;
271 EvasBiDiParType direction;
272
273 for (itr = segment_idxs ; *itr > 0 ; itr++)
274 {
275 direction = EVAS_BIDI_PARAGRAPH_NEUTRAL;
276 if (!fribidi_get_par_embedding_levels(char_types + pos,
277 *itr - pos,
278 &direction,
279 embedding_levels + pos))
280 {
281 len = -2;
282 goto cleanup;
283 }
284
285 /* Only on the first run */
286 if (itr == segment_idxs)
287 {
288 bidi_props->direction = direction;
289 /* adjust base_level to be 1 for rtl paragraphs, and 0 for
290 * ltr paragraphs. */
291 base_level =
292 EVAS_BIDI_PARAGRAPH_DIRECTION_IS_RTL(bidi_props) ? 1 : 0;
293 }
294
295 /* We want those chars at the override points to be on the base
296 * level and we also remove -2 cause we later increment them,
297 * just for simpler code paths */
298 embedding_levels[*itr] = base_level - 2;
299 pos = *itr + 1;
300 }
301
302 direction = EVAS_BIDI_PARAGRAPH_NEUTRAL;
303 if (!fribidi_get_par_embedding_levels(char_types + pos,
304 len - pos,
305 &direction,
306 embedding_levels + pos))
307 {
308 len = -2;
309 goto cleanup;
310 }
311
312 /* Increment all levels by 2 to emulate embedding. */
313 {
314 EvasBiDiLevel *bitr = embedding_levels, *end;
315 end = bitr + len;
316 for ( ; bitr < end ; bitr++)
317 {
318 *bitr += 2;
319 }
320 }
321 }
322 else
323 {
324 if (!fribidi_get_par_embedding_levels(char_types, len,
325 &bidi_props->direction, embedding_levels))
326 {
327 len = -2;
328 goto cleanup;
329 }
330 }
331
332
333 /* clean up */
334 if (bidi_props->embedding_levels)
335 {
336 free(bidi_props->embedding_levels);
337 }
338 bidi_props->embedding_levels = embedding_levels;
339
340 /* clean up */
341
342 if (bidi_props->char_types)
343 {
344 free(bidi_props->char_types);
345 }
346 bidi_props->char_types = char_types;
347
348 if (base_ustr) free(base_ustr);
349
350
351 return bidi_props;
352
353/* Cleanup */
354cleanup:
355 if (char_types) free(char_types);
356 if (embedding_levels) free(embedding_levels);
357 if (base_ustr) free(base_ustr);
358 if (bidi_props) evas_bidi_paragraph_props_unref(bidi_props); /* Clean up the bidi props */
359 return NULL;
360}
361
362/**
363 * @internal
364 * Copies dst to src and refs (doesn't copy) the paragraph props.
365 *
366 * @param src the props to copy
367 * @param dst the props to copy to.
368 */
369void
370evas_bidi_props_copy_and_ref(const Evas_BiDi_Props *src, Evas_BiDi_Props *dst)
371{
372 dst->dir = src->dir;
373}
374
375/**
376 * @internal
377 * Reorders ustr according to the bidi props.
378 *
379 * @param ustr the string to reorder. - Null is ok, will just populate the map.
380 * @param start the start of the line
381 * @param len the length of the line
382 * @param props the paragraph props to reorder according to
383 * @param _v_to_l The visual to logical map to populate - if NULL it won't populate it.
384 * @return #EINA_FALSE on success, #EINA_TRUE on error.
385 */
386Eina_Bool
387evas_bidi_props_reorder_line(Eina_Unicode *eina_ustr, size_t start, size_t len, const Evas_BiDi_Paragraph_Props *props, EvasBiDiStrIndex **_v_to_l)
388{
389 EvasBiDiStrIndex *v_to_l = NULL;
390 FriBidiChar *ustr = NULL, *base_ustr = NULL;
391
392 if (!props)
393 return EINA_FALSE;
394
395 if (eina_ustr)
396 {
397 /* The size of fribidichar is different than eina_unicode, convert */
398#ifdef EVAS_FRIBIDI_EINA_UNICODE_UNEQUAL
399 base_ustr = ustr = calloc(len + 1, sizeof(FriBidiChar));
400 ustr = _evas_bidi_unicode_to_fribidichar(ustr, eina_ustr);
401#else
402 ustr = (FriBidiChar *) eina_ustr;
403#endif
404 }
405
406
407 if (_v_to_l) {
408 size_t i;
409 v_to_l = *_v_to_l = calloc(len, sizeof(EvasBiDiStrIndex));
410 if (!v_to_l)
411 {
412 goto error;
413 }
414 /* init the array for fribidi */
415 for (i = 0 ; i < len ; i++)
416 {
417 v_to_l[i] = i;
418 }
419 }
420
421 {
422 EvasBiDiLevel *emb_lvl;
423 emb_lvl = malloc((start + len) * sizeof(EvasBiDiLevel));
424 memcpy(emb_lvl, props->embedding_levels,
425 (start + len) * sizeof(EvasBiDiLevel));
426 /* We pass v_to_l - start, because fribidi assumes start is the offset
427 * from the start of v_to_l as well, not just the props. */
428 if (!fribidi_reorder_line (FRIBIDI_FLAGS_DEFAULT, props->char_types,
429 len, start, props->direction, emb_lvl, ustr, v_to_l - start))
430 {
431 free(emb_lvl);
432 goto error;
433 }
434 free(emb_lvl);
435 }
436
437
438 /* The size of fribidichar is different than eina_unicode, convert */
439#ifdef EVAS_FRIBIDI_EINA_UNICODE_UNEQUAL
440 _evas_bidi_fribidichar_to_unicode(eina_ustr, base_ustr);
441 free(base_ustr);
442#endif
443 return EINA_FALSE;
444/* ERROR HANDLING */
445error:
446 if (base_ustr) free(base_ustr);
447 _SAFE_FREE(v_to_l);
448 return EINA_TRUE;
449}
450
451/**
452 * @internal
453 * Returns the end of the current run of text
454 *
455 * @param bidi_props the paragraph properties
456 * @param start where to start looking from
457 * @param len the length of the string
458 * @return the position of the end of the run (offset from
459 * bidi_props->props->start), 0 when there is no end (i.e all the text)
460 */
461int
462evas_bidi_end_of_run_get(const Evas_BiDi_Paragraph_Props *bidi_props,
463 size_t start, int len)
464{
465 EvasBiDiLevel *i;
466 EvasBiDiLevel base;
467
468 if (!bidi_props || (len <= 0))
469 return 0;
470
471 i = bidi_props->embedding_levels + start;
472 base = *i;
473 for ( ; (len > 0) && (base == *i) ; len--, i++)
474 ;
475
476 if (len == 0)
477 {
478 return 0;
479 }
480 return i - (bidi_props->embedding_levels + start);
481}
482
483/**
484 * @internal
485 * Returns the visual string index from the logical string index.
486 *
487 * @param v_to_l the visual to logical map
488 * @param len the length of the map.
489 * @param position the position to convert.
490 * @return on success the visual position, on failure the same position.
491 */
492EvasBiDiStrIndex
493evas_bidi_position_logical_to_visual(EvasBiDiStrIndex *v_to_l, int len, EvasBiDiStrIndex position)
494{
495 int i;
496 EvasBiDiStrIndex *ind;
497 if (position >= len || !v_to_l)
498 return position;
499
500 for (i = 0, ind = v_to_l ; i < len ; i++, ind++)
501 {
502 if (*ind == position)
503 {
504 return i;
505 }
506 }
507 return position;
508}
509
510/**
511 * @internal
512 * Returns the reversed pos of the index.
513 *
514 * @param dir the direction of the string
515 * @param len the length of the map.
516 * @param position the position to convert.
517 * @return on success the visual position, on failure the same position.
518 */
519EvasBiDiStrIndex
520evas_bidi_position_reverse(const Evas_BiDi_Props *props, int len, EvasBiDiStrIndex position)
521{
522 if (!props || position >= len)
523 return position;
524
525 return (props->dir == EVAS_BIDI_DIRECTION_RTL) ? (len - 1) - position : position;
526}
527
528/**
529 * @internal
530 * Checks if the char is rtl oriented. I.e even a neutral char can become rtl
531 * if surrounded by rtl chars.
532 *
533 * @param bidi_props The bidi paragraph properties
534 * @param start the base position
535 * @param index the offset from the base position.
536 * @return #EINA_TRUE if true, #EINA_FALSE otherwise.
537 */
538Eina_Bool
539evas_bidi_is_rtl_char(const Evas_BiDi_Paragraph_Props *bidi_props, size_t start, EvasBiDiStrIndex ind)
540{
541 if(!bidi_props || ind < 0)
542 return EINA_FALSE;
543 return (FRIBIDI_IS_RTL(
544 bidi_props->embedding_levels[ind + start]))
545 ? EINA_TRUE : EINA_FALSE;
546}
547
548Evas_BiDi_Paragraph_Props *
549evas_bidi_paragraph_props_new(void)
550{
551 Evas_BiDi_Paragraph_Props *ret;
552 ret = calloc(1, sizeof(Evas_BiDi_Paragraph_Props));
553 ret->direction = EVAS_BIDI_PARAGRAPH_NEUTRAL;
554 ret->refcount = 1;
555
556 return ret;
557}
558
559/**
560 * @internal
561 * Refs the bidi props.
562 *
563 * @param bidi_props the props to ref.
564 */
565Evas_BiDi_Paragraph_Props *
566evas_bidi_paragraph_props_ref(Evas_BiDi_Paragraph_Props *bidi_props)
567{
568 if (!bidi_props) return NULL;
569 BIDILOCK();
570
571 bidi_props->refcount++;
572 BIDIUNLOCK();
573 return bidi_props;
574}
575
576/**
577 * @internal
578 * Unrefs and potentially frees the props.
579 *
580 * @param bidi_props the properties to unref
581 */
582void
583evas_bidi_paragraph_props_unref(Evas_BiDi_Paragraph_Props *bidi_props)
584{
585 if (!bidi_props) return;
586 BIDILOCK();
587
588 if (--bidi_props->refcount == 0)
589 {
590 evas_bidi_paragraph_props_clean(bidi_props);
591 free(bidi_props);
592 }
593 BIDIUNLOCK();
594}
595
596
597/**
598 * @internal
599 * Cleans the paragraph properties.
600 *
601 * @param bidi_props the properties to clean.
602 */
603void
604evas_bidi_paragraph_props_clean(Evas_BiDi_Paragraph_Props *bidi_props)
605{
606 _SAFE_FREE(bidi_props->embedding_levels);
607 _SAFE_FREE(bidi_props->char_types);
608}
609
610/**
611 * @internal
612 * Cleans the bidi properties.
613 *
614 * @param bidi_props the properties to clean.
615 */
616void
617evas_bidi_props_clean(Evas_BiDi_Props *bidi_props)
618{
619 if (!bidi_props) return;
620 bidi_props->dir = EVAS_BIDI_DIRECTION_NEUTRAL;
621}
622/**
623 * @}
624 */
625/**
626 * @}
627 */
628#endif
629
630#if 0
631/* Good for debugging */
632static void
633dump_levels(Eina_Unicode *ustr, EvasBiDiLevel *emb)
634{
635 for ( ; *ustr ; ustr++, emb++)
636 {
637 printf("%lc %d\n", *ustr, *emb);
638 }
639}
640#endif
641
diff --git a/libraries/evas/src/lib/engines/common/language/evas_bidi_utils.h b/libraries/evas/src/lib/engines/common/language/evas_bidi_utils.h
new file mode 100644
index 0000000..f1a374b
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/language/evas_bidi_utils.h
@@ -0,0 +1,157 @@
1#ifndef _EVAS_BIDI_UTILS
2#define _EVAS_BIDI_UTILS
3
4/**
5 * @internal
6 * @addtogroup Evas_Utils
7 *
8 * @{
9 */
10/**
11 * @internal
12 * @defgroup Evas_BiDi Evas BiDi utility functions
13 *
14 * This set of functions and types helps evas handle BiDi strings correctly.
15 * @todo Document types, structures and macros.
16 *
17 * @{
18 */
19#ifdef HAVE_CONFIG_H
20# include "config.h"
21#endif
22
23#ifdef HAVE_FRIBIDI
24# define USE_FRIBIDI
25# define BIDI_SUPPORT
26#endif
27
28#include <Eina.h>
29
30#ifdef USE_FRIBIDI
31# include <fribidi/fribidi.h>
32#endif
33
34/* abstract fribidi - we statically define sizes here because otherwise we would
35 * have to ifdef everywhere (because function decorations may change with/without
36 * bidi support)
37 * These types should only be passed as pointers! i.e do not directely use any of
38 * these types in function declarations. Defining as void should help ensuring that.
39 */
40
41/* Evas_BiDi_Direction is defined in evas.h */
42
43#ifdef USE_FRIBIDI
44# define _EVAS_BIDI_TYPEDEF(type) \
45 typedef FriBidi ## type EvasBiDi ## type
46#else
47# define _EVAS_BIDI_TYPEDEF(type) \
48 typedef void EvasBiDi ## type
49#endif
50
51#if 0 /* We are using Eina_Unicode instead */
52_EVAS_BIDI_TYPEDEF(Char);
53#endif
54_EVAS_BIDI_TYPEDEF(CharType);
55_EVAS_BIDI_TYPEDEF(ParType);
56_EVAS_BIDI_TYPEDEF(StrIndex);
57_EVAS_BIDI_TYPEDEF(Level);
58_EVAS_BIDI_TYPEDEF(JoiningType);
59
60typedef struct _Evas_BiDi_Paragraph_Props Evas_BiDi_Paragraph_Props;
61typedef struct _Evas_BiDi_Props Evas_BiDi_Props;
62
63/* This structure defines a set of properties of a BiDi string. In case of a
64 * non-bidi string, all values should be NULL.
65 * To check if a structure describes a bidi string or not, use the macro
66 * EVAS_BIDI_IS_BIDI_PROP. RTL-only strings are also treated as bidi ATM.
67 */
68struct _Evas_BiDi_Paragraph_Props {
69 EvasBiDiCharType *char_types; /* BiDi char types */
70 EvasBiDiLevel *embedding_levels; /* BiDi embedding levels */
71 int refcount; /* The number of references to this object */
72#ifdef USE_FRIBIDI
73 EvasBiDiParType direction;
74#endif
75};
76
77#include "Evas.h"
78struct _Evas_BiDi_Props
79{
80 Evas_BiDi_Direction dir;
81};
82
83
84
85#ifdef USE_FRIBIDI
86
87#define EVAS_BIDI_PARAGRAPH_NEUTRAL FRIBIDI_PAR_ON
88#define EVAS_BIDI_PARAGRAPH_LTR FRIBIDI_PAR_LTR
89#define EVAS_BIDI_PARAGRAPH_RTL FRIBIDI_PAR_RTL
90#define EVAS_BIDI_PARAGRAPH_WLTR FRIBIDI_PAR_WLTR
91#define EVAS_BIDI_PARAGRAPH_WRTL FRIBIDI_PAR_WRTL
92
93#define EVAS_BIDI_PARAGRAPH_DIRECTION_IS_RTL(x) \
94 (((x) && \
95 ((x->direction == EVAS_BIDI_PARAGRAPH_RTL) || \
96 (x->direction == EVAS_BIDI_PARAGRAPH_WRTL))) ? \
97 EINA_TRUE : EINA_FALSE)
98
99
100# define evas_bidi_position_visual_to_logical(list, position) \
101 (list) ? list[position] : position;
102
103EvasBiDiStrIndex
104evas_bidi_position_logical_to_visual(EvasBiDiStrIndex *v_to_l, int len, EvasBiDiStrIndex position);
105
106EvasBiDiStrIndex
107evas_bidi_position_reverse(const Evas_BiDi_Props *props, int len, EvasBiDiStrIndex position);
108
109Eina_Bool
110evas_bidi_is_rtl_str(const Eina_Unicode *str);
111
112Eina_Bool
113evas_bidi_is_rtl_char(const Evas_BiDi_Paragraph_Props *bidi_props, size_t start, EvasBiDiStrIndex index);
114
115int
116evas_bidi_end_of_run_get(const Evas_BiDi_Paragraph_Props *bidi_props, size_t start, int len);
117
118Eina_Bool
119evas_bidi_props_reorder_line(Eina_Unicode *eina_ustr, size_t start, size_t len, const Evas_BiDi_Paragraph_Props *props, EvasBiDiStrIndex **_v_to_l);
120
121Evas_BiDi_Paragraph_Props *
122evas_bidi_paragraph_props_get(const Eina_Unicode *eina_ustr, size_t len, int *segment_idxs) EINA_ARG_NONNULL(1) EINA_MALLOC EINA_WARN_UNUSED_RESULT;
123
124void
125evas_bidi_props_copy_and_ref(const Evas_BiDi_Props *src, Evas_BiDi_Props *dst);
126
127EAPI Eina_Bool
128evas_bidi_shape_string(Eina_Unicode *eina_ustr, const Evas_BiDi_Paragraph_Props *bidi_props, size_t start, size_t len);
129
130void
131evas_bidi_props_clean(Evas_BiDi_Props *intl_props) EINA_ARG_NONNULL(1);
132
133void
134evas_bidi_paragraph_props_clean(Evas_BiDi_Paragraph_Props *bidi_props) EINA_ARG_NONNULL(1);
135
136Evas_BiDi_Paragraph_Props *
137evas_bidi_paragraph_props_ref(Evas_BiDi_Paragraph_Props *bidi_props) EINA_ARG_NONNULL(1);
138
139void
140evas_bidi_paragraph_props_unref(Evas_BiDi_Paragraph_Props *bidi_props) EINA_ARG_NONNULL(1);
141
142Evas_BiDi_Paragraph_Props *
143evas_bidi_paragraph_props_new(void) EINA_MALLOC EINA_WARN_UNUSED_RESULT;
144
145int *
146evas_bidi_segment_idxs_get(const Eina_Unicode *str, const char *delim) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT EINA_MALLOC;
147
148#endif
149/**
150 * @}
151 */
152/**
153 * @}
154 */
155
156#endif
157
diff --git a/libraries/evas/src/lib/engines/common/language/evas_language_utils.c b/libraries/evas/src/lib/engines/common/language/evas_language_utils.c
new file mode 100644
index 0000000..9c9b3e3
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/language/evas_language_utils.c
@@ -0,0 +1,146 @@
1/**
2 * @internal
3 * @addtogroup Evas_Utils
4 *
5 * @{
6 */
7/**
8 * @internal
9 * @defgroup Evas_Script Evas Script (language) utility functions
10 *
11 * This set of functions and types helps evas handle scripts correctly.
12 * @todo Document types, structures and macros.
13 *
14 * @{
15 */
16#include <Eina.h>
17
18#include "evas_language_utils.h"
19#include "evas_bidi_utils.h" /* Used for splitting according to bidi */
20#include "../evas_font_ot.h" /* Used for harfbuzz info */
21
22#ifdef USE_HARFBUZZ
23# include <hb.h>
24#endif
25
26#include "evas_script_table.h"
27
28static Evas_Script_Type
29_evas_common_language_char_script_search(Eina_Unicode unicode)
30{
31 int min = 0;
32 int max = (sizeof(_evas_script_slow_table) /
33 sizeof(_evas_script_slow_table[0])) - 1;
34 int mid;
35
36 do
37 {
38 mid = (min + max) / 2;
39
40 if (unicode < _evas_script_slow_table[mid].start)
41 max = mid - 1;
42 else if (unicode >= _evas_script_slow_table[mid].start +
43 _evas_script_slow_table[mid].len)
44 min = mid + 1;
45 else
46 return _evas_script_slow_table[mid].script;
47 }
48 while (min <= max);
49
50 return EVAS_SCRIPT_UNKNOWN;
51}
52
53Evas_Script_Type
54evas_common_language_char_script_get(Eina_Unicode unicode)
55{
56 if ((unicode >= 0) && (unicode < EVAS_SCRIPT_DIRECT_TABLE_LIMIT))
57 return _evas_script_fast_table[unicode];
58 else
59 return _evas_common_language_char_script_search(unicode);
60}
61
62int
63evas_common_language_script_end_of_run_get(const Eina_Unicode *str,
64 const Evas_BiDi_Paragraph_Props *bidi_props, size_t start, int len)
65{
66 /* FIXME: Use the standard segmentation instead */
67 Evas_Script_Type first = EVAS_SCRIPT_UNKNOWN;
68 int i;
69 for (i = 0 ; i < len ; i++, str++)
70 {
71 Evas_Script_Type tmp;
72 tmp = evas_common_language_char_script_get(*str);
73 /* Arabic is the first script in the array that's not
74 * common/inherited. */
75 if ((first == EVAS_SCRIPT_UNKNOWN) && (tmp >= EVAS_SCRIPT_ARABIC))
76 {
77 first = tmp;
78 continue;
79 }
80 if ((first != tmp) && (tmp >= EVAS_SCRIPT_ARABIC))
81 {
82 break;
83 }
84 }
85#ifdef BIDI_SUPPORT
86 {
87 int bidi_end;
88 bidi_end = evas_bidi_end_of_run_get(bidi_props, start, len);
89 if (bidi_end > 0)
90 {
91 i = (i < bidi_end) ? i : bidi_end;
92 }
93 }
94#else
95 (void) bidi_props;
96 (void) start;
97#endif
98 return (i < len) ? i : 0;
99}
100
101Evas_Script_Type
102evas_common_language_script_type_get(const Eina_Unicode *str, size_t len)
103{
104 Evas_Script_Type script = EVAS_SCRIPT_COMMON;
105 const Eina_Unicode *end = str + len;
106 /* Arabic is the first script in the array that's not a common/inherited */
107 for ( ; str < end && ((script = evas_common_language_char_script_get(*str)) < EVAS_SCRIPT_ARABIC) ; str++)
108 ;
109 return script;
110}
111
112const char *
113evas_common_language_from_locale_get(void)
114{
115 static char lang[6]; /* FIXME: Maximum length I know about */
116 if (*lang) return lang;
117
118 const char *locale;
119 locale = getenv("LANG");
120 if (locale && *locale)
121 {
122 char *itr;
123 strncpy(lang, locale, 5);
124 lang[5] = '\0';
125 itr = lang;
126 while (*itr)
127 {
128 if (*itr == '_')
129 {
130 *itr = '\0';
131 }
132 itr++;
133 }
134 return lang;
135 }
136
137 return "";
138}
139
140/*
141 * @}
142 */
143/*
144 * @}
145 */
146
diff --git a/libraries/evas/src/lib/engines/common/language/evas_language_utils.h b/libraries/evas/src/lib/engines/common/language/evas_language_utils.h
new file mode 100644
index 0000000..fa795ec
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/language/evas_language_utils.h
@@ -0,0 +1,132 @@
1#ifndef _EVAS_LANGUAGE_UTILS
2#define _EVAS_LANGUAGE_UTILS
3
4#include <Eina.h>
5#include "evas_bidi_utils.h"
6
7/* Unicode Script property */
8typedef enum
9{
10 EVAS_SCRIPT_COMMON = 0, /* Zyyy */
11 EVAS_SCRIPT_INHERITED, /* Qaai */
12 EVAS_SCRIPT_ARABIC, /* Arab */
13 EVAS_SCRIPT_ARMENIAN, /* Armn */
14 EVAS_SCRIPT_BENGALI, /* Beng */
15 EVAS_SCRIPT_BOPOMOFO, /* Bopo */
16 EVAS_SCRIPT_CHEROKEE, /* Cher */
17 EVAS_SCRIPT_COPTIC, /* Qaac */
18 EVAS_SCRIPT_CYRILLIC, /* Cyrl (Cyrs) */
19 EVAS_SCRIPT_DESERET, /* Dsrt */
20 EVAS_SCRIPT_DEVANAGARI, /* Deva */
21 EVAS_SCRIPT_ETHIOPIC, /* Ethi */
22 EVAS_SCRIPT_GEORGIAN, /* Geor (Geon, Geoa) */
23 EVAS_SCRIPT_GOTHIC, /* Goth */
24 EVAS_SCRIPT_GREEK, /* Grek */
25 EVAS_SCRIPT_GUJARATI, /* Gujr */
26 EVAS_SCRIPT_GURMUKHI, /* Guru */
27 EVAS_SCRIPT_HAN, /* Hani */
28 EVAS_SCRIPT_HANGUL, /* Hang */
29 EVAS_SCRIPT_HEBREW, /* Hebr */
30 EVAS_SCRIPT_HIRAGANA, /* Hira */
31 EVAS_SCRIPT_KANNADA, /* Knda */
32 EVAS_SCRIPT_KATAKANA, /* Kana */
33 EVAS_SCRIPT_KHMER, /* Khmr */
34 EVAS_SCRIPT_LAO, /* Laoo */
35 EVAS_SCRIPT_LATIN, /* Latn (Latf, Latg) */
36 EVAS_SCRIPT_MALAYALAM, /* Mlym */
37 EVAS_SCRIPT_MONGOLIAN, /* Mong */
38 EVAS_SCRIPT_MYANMAR, /* Mymr */
39 EVAS_SCRIPT_OGHAM, /* Ogam */
40 EVAS_SCRIPT_OLD_ITALIC, /* Ital */
41 EVAS_SCRIPT_ORIYA, /* Orya */
42 EVAS_SCRIPT_RUNIC, /* Runr */
43 EVAS_SCRIPT_SINHALA, /* Sinh */
44 EVAS_SCRIPT_SYRIAC, /* Syrc (Syrj, Syrn, Syre) */
45 EVAS_SCRIPT_TAMIL, /* Taml */
46 EVAS_SCRIPT_TELUGU, /* Telu */
47 EVAS_SCRIPT_THAANA, /* Thaa */
48 EVAS_SCRIPT_THAI, /* Thai */
49 EVAS_SCRIPT_TIBETAN, /* Tibt */
50 EVAS_SCRIPT_CANADIAN_ABORIGINAL, /* Cans */
51 EVAS_SCRIPT_YI, /* Yiii */
52 EVAS_SCRIPT_TAGALOG, /* Tglg */
53 EVAS_SCRIPT_HANUNOO, /* Hano */
54 EVAS_SCRIPT_BUHID, /* Buhd */
55 EVAS_SCRIPT_TAGBANWA, /* Tagb */
56
57 /* Unicode-4.0 additions */
58 EVAS_SCRIPT_BRAILLE, /* Brai */
59 EVAS_SCRIPT_CYPRIOT, /* Cprt */
60 EVAS_SCRIPT_LIMBU, /* Limb */
61 EVAS_SCRIPT_OSMANYA, /* Osma */
62 EVAS_SCRIPT_SHAVIAN, /* Shaw */
63 EVAS_SCRIPT_LINEAR_B, /* Linb */
64 EVAS_SCRIPT_TAI_LE, /* Tale */
65 EVAS_SCRIPT_UGARITIC, /* Ugar */
66
67 /* Unicode-4.1 additions */
68 EVAS_SCRIPT_NEW_TAI_LUE, /* Talu */
69 EVAS_SCRIPT_BUGINESE, /* Bugi */
70 EVAS_SCRIPT_GLAGOLITIC, /* Glag */
71 EVAS_SCRIPT_TIFINAGH, /* Tfng */
72 EVAS_SCRIPT_SYLOTI_NAGRI, /* Sylo */
73 EVAS_SCRIPT_OLD_PERSIAN, /* Xpeo */
74 EVAS_SCRIPT_KHAROSHTHI, /* Khar */
75
76 /* Unicode-5.0 additions */
77 EVAS_SCRIPT_UNKNOWN, /* Zzzz */
78 EVAS_SCRIPT_BALINESE, /* Bali */
79 EVAS_SCRIPT_CUNEIFORM, /* Xsux */
80 EVAS_SCRIPT_PHOENICIAN, /* Phnx */
81 EVAS_SCRIPT_PHAGS_PA, /* Phag */
82 EVAS_SCRIPT_NKO, /* Nkoo */
83
84 /* Unicode-5.1 additions */
85 EVAS_SCRIPT_KAYAH_LI, /* Kali */
86 EVAS_SCRIPT_LEPCHA, /* Lepc */
87 EVAS_SCRIPT_REJANG, /* Rjng */
88 EVAS_SCRIPT_SUNDANESE, /* Sund */
89 EVAS_SCRIPT_SAURASHTRA, /* Saur */
90 EVAS_SCRIPT_CHAM, /* Cham */
91 EVAS_SCRIPT_OL_CHIKI, /* Olck */
92 EVAS_SCRIPT_VAI, /* Vaii */
93 EVAS_SCRIPT_CARIAN, /* Cari */
94 EVAS_SCRIPT_LYCIAN, /* Lyci */
95 EVAS_SCRIPT_LYDIAN, /* Lydi */
96
97 /* Unicode-5.2 additions */
98 EVAS_SCRIPT_AVESTAN, /* Avst */
99 EVAS_SCRIPT_BAMUM, /* Bamu */
100 EVAS_SCRIPT_EGYPTIAN_HIEROGLYPHS, /* Egyp */
101 EVAS_SCRIPT_IMPERIAL_ARAMAIC, /* Armi */
102 EVAS_SCRIPT_INSCRIPTIONAL_PAHLAVI, /* Phli */
103 EVAS_SCRIPT_INSCRIPTIONAL_PARTHIAN, /* Prti */
104 EVAS_SCRIPT_JAVANESE, /* Java */
105 EVAS_SCRIPT_KAITHI, /* Kthi */
106 EVAS_SCRIPT_LISU, /* Lisu */
107 EVAS_SCRIPT_MEETEI_MAYEK, /* Mtei */
108 EVAS_SCRIPT_OLD_SOUTH_ARABIAN, /* Sarb */
109 EVAS_SCRIPT_OLD_TURKIC, /* Orkh */
110 EVAS_SCRIPT_SAMARITAN, /* Samr */
111 EVAS_SCRIPT_TAI_THAM, /* Lana */
112 EVAS_SCRIPT_TAI_VIET, /* Tavt */
113
114 /* Unicode-6.0 additions */
115 EVAS_SCRIPT_BATAK, /* Batk */
116 EVAS_SCRIPT_BRAHMI, /* Brah */
117 EVAS_SCRIPT_MANDAIC, /* Mand */
118} Evas_Script_Type;
119
120int
121evas_common_language_script_end_of_run_get(const Eina_Unicode *str, const Evas_BiDi_Paragraph_Props *bidi_props, size_t start, int len);
122
123Evas_Script_Type
124evas_common_language_script_type_get(const Eina_Unicode *str, size_t len);
125
126Evas_Script_Type
127evas_common_language_char_script_get(Eina_Unicode unicode);
128
129const char *
130evas_common_language_from_locale_get(void);
131#endif
132
diff --git a/libraries/evas/src/lib/engines/common/language/evas_script_table.h b/libraries/evas/src/lib/engines/common/language/evas_script_table.h
new file mode 100644
index 0000000..dd77db0
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common/language/evas_script_table.h
@@ -0,0 +1,3087 @@
1/* evas_script_table.h: Mostly based on output by gen-script-table.pl
2 * which is available in glib's tools.
3 *
4 * NOTICE: This is temporary and will only stay here until there will be
5 * a nice "UNICODE DATA" library to use. From my understanding it's already
6 * being worked on.
7 *
8 * Date: Sun May 1 15:48:56 2011
9 * Source: Scripts-6.0.0.txt
10 *
11 * Do not edit.
12 */
13
14#define EVAS_SCRIPT_DIRECT_TABLE_LIMIT 8192
15
16static const
17Eina_Unicode _evas_script_fast_table[EVAS_SCRIPT_DIRECT_TABLE_LIMIT] = {
18 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
19 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
20 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
21 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
22 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
23 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
24 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
25 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
26 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
27 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
28 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
29 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
30 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
31 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
32 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
33 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
34 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
35 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
36 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
37 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
38 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
39 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_LATIN,
40 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
41 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
42 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
43 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
44 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
45 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
46 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
47 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
48 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
49 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
50 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
51 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
52 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
53 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
54 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
55 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
56 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
57 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
58 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
59 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
60 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
61 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
62 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
63 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
64 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
65 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
66 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
67 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
68 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
69 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
70 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
71 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
72 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
73 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
74 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_LATIN,
75 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
76 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
77 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
78 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
79 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
80 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
81 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
82 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
83 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
84 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
85 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
86 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
87 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
88 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
89 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_COMMON,
90 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
91 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
92 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
93 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
94 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
95 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
96 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
97 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
98 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
99 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
100 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_LATIN,
101 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
102 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
103 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
104 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
105 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
106 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
107 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
108 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
109 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
110 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
111 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
112 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
113 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
114 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
115 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
116 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
117 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
118 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
119 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
120 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
121 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
122 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
123 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
124 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
125 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
126 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
127 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
128 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
129 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
130 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
131 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
132 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
133 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
134 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
135 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
136 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
137 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
138 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
139 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
140 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
141 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
142 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
143 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
144 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
145 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
146 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
147 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
148 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
149 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
150 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
151 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
152 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
153 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
154 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
155 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
156 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
157 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
158 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
159 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
160 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
161 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
162 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
163 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
164 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
165 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
166 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
167 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
168 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
169 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
170 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
171 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
172 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
173 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
174 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
175 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
176 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
177 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
178 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
179 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
180 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
181 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
182 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
183 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
184 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
185 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
186 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
187 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
188 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
189 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
190 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
191 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
192 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
193 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
194 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
195 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
196 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
197 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
198 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
199 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
200 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
201 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
202 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
203 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
204 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
205 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
206 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
207 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
208 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
209 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
210 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
211 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
212 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
213 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
214 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
215 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
216 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
217 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
218 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
219 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
220 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
221 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
222 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
223 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
224 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
225 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
226 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
227 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
228 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
229 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
230 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
231 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
232 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
233 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
234 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
235 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
236 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
237 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
238 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
239 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
240 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
241 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
242 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
243 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
244 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
245 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
246 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
247 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
248 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
249 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
250 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
251 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
252 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
253 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
254 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
255 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
256 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
257 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
258 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
259 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
260 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
261 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
262 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
263 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
264 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
265 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
266 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_BOPOMOFO,
267 EVAS_SCRIPT_BOPOMOFO, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
268 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
269 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
270 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
271 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
272 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
273 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
274 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
275 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
276 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
277 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
278 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
279 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
280 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
281 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
282 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
283 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
284 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
285 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
286 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
287 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
288 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
289 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
290 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
291 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
292 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
293 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
294 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
295 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
296 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
297 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
298 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
299 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
300 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
301 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
302 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
303 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
304 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
305 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
306 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
307 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
308 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
309 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
310 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
311 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
312 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_COMMON,
313 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
314 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_GREEK,
315 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
316 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
317 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
318 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_GREEK,
319 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
320 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_GREEK,
321 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
322 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
323 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
324 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
325 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
326 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
327 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
328 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
329 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
330 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
331 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
332 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
333 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
334 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
335 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
336 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
337 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
338 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
339 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
340 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
341 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
342 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
343 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
344 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
345 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
346 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
347 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
348 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
349 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_COPTIC, EVAS_SCRIPT_COPTIC,
350 EVAS_SCRIPT_COPTIC, EVAS_SCRIPT_COPTIC, EVAS_SCRIPT_COPTIC,
351 EVAS_SCRIPT_COPTIC, EVAS_SCRIPT_COPTIC, EVAS_SCRIPT_COPTIC,
352 EVAS_SCRIPT_COPTIC, EVAS_SCRIPT_COPTIC, EVAS_SCRIPT_COPTIC,
353 EVAS_SCRIPT_COPTIC, EVAS_SCRIPT_COPTIC, EVAS_SCRIPT_COPTIC,
354 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
355 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
356 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
357 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
358 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
359 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
360 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
361 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
362 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
363 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
364 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
365 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
366 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
367 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
368 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
369 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
370 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
371 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
372 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
373 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
374 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
375 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
376 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
377 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
378 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
379 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
380 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
381 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
382 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
383 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
384 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
385 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
386 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
387 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
388 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
389 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
390 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
391 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
392 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
393 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
394 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
395 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
396 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
397 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
398 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
399 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
400 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
401 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
402 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
403 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_INHERITED,
404 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
405 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
406 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
407 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
408 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
409 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
410 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
411 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
412 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
413 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
414 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
415 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
416 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
417 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
418 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
419 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
420 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
421 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
422 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
423 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
424 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
425 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
426 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
427 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
428 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
429 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
430 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
431 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
432 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
433 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
434 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
435 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
436 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
437 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
438 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
439 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
440 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
441 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
442 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
443 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
444 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
445 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
446 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
447 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
448 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
449 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
450 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
451 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
452 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
453 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
454 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
455 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
456 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
457 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_CYRILLIC,
458 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
459 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
460 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
461 EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN,
462 EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN,
463 EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN,
464 EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN,
465 EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN,
466 EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN,
467 EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN,
468 EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN,
469 EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN,
470 EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN,
471 EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN,
472 EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN,
473 EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_UNKNOWN,
474 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN,
475 EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN,
476 EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_UNKNOWN,
477 EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN,
478 EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN,
479 EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN,
480 EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN,
481 EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN,
482 EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN,
483 EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN,
484 EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN,
485 EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN,
486 EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN,
487 EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN,
488 EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN,
489 EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN, EVAS_SCRIPT_ARMENIAN,
490 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_ARMENIAN,
491 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
492 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
493 EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW,
494 EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW,
495 EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW,
496 EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW,
497 EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW,
498 EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW,
499 EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW,
500 EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW,
501 EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW,
502 EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW,
503 EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW,
504 EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW,
505 EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW,
506 EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW,
507 EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW,
508 EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW,
509 EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW,
510 EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW,
511 EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
512 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
513 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
514 EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW,
515 EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW,
516 EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW,
517 EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW,
518 EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW,
519 EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW,
520 EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW,
521 EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW,
522 EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW,
523 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
524 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_HEBREW,
525 EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_HEBREW,
526 EVAS_SCRIPT_HEBREW, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
527 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
528 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
529 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
530 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
531 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
532 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
533 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
534 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
535 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
536 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
537 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
538 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
539 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
540 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_ARABIC,
541 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
542 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
543 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
544 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
545 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
546 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
547 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
548 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
549 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
550 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
551 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_ARABIC,
552 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
553 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
554 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
555 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
556 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
557 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
558 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_ARABIC,
559 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
560 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
561 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_INHERITED,
562 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
563 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
564 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
565 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
566 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
567 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_ARABIC,
568 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
569 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
570 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
571 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
572 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
573 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
574 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
575 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
576 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
577 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
578 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
579 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
580 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
581 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
582 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
583 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
584 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
585 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
586 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
587 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
588 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
589 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
590 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
591 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
592 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
593 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
594 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
595 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
596 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
597 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
598 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
599 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
600 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
601 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
602 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
603 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_COMMON,
604 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
605 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
606 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
607 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
608 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
609 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
610 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
611 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
612 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
613 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
614 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
615 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_SYRIAC, EVAS_SCRIPT_SYRIAC,
616 EVAS_SCRIPT_SYRIAC, EVAS_SCRIPT_SYRIAC, EVAS_SCRIPT_SYRIAC,
617 EVAS_SCRIPT_SYRIAC, EVAS_SCRIPT_SYRIAC, EVAS_SCRIPT_SYRIAC,
618 EVAS_SCRIPT_SYRIAC, EVAS_SCRIPT_SYRIAC, EVAS_SCRIPT_SYRIAC,
619 EVAS_SCRIPT_SYRIAC, EVAS_SCRIPT_SYRIAC, EVAS_SCRIPT_SYRIAC,
620 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_SYRIAC, EVAS_SCRIPT_SYRIAC,
621 EVAS_SCRIPT_SYRIAC, EVAS_SCRIPT_SYRIAC, EVAS_SCRIPT_SYRIAC,
622 EVAS_SCRIPT_SYRIAC, EVAS_SCRIPT_SYRIAC, EVAS_SCRIPT_SYRIAC,
623 EVAS_SCRIPT_SYRIAC, EVAS_SCRIPT_SYRIAC, EVAS_SCRIPT_SYRIAC,
624 EVAS_SCRIPT_SYRIAC, EVAS_SCRIPT_SYRIAC, EVAS_SCRIPT_SYRIAC,
625 EVAS_SCRIPT_SYRIAC, EVAS_SCRIPT_SYRIAC, EVAS_SCRIPT_SYRIAC,
626 EVAS_SCRIPT_SYRIAC, EVAS_SCRIPT_SYRIAC, EVAS_SCRIPT_SYRIAC,
627 EVAS_SCRIPT_SYRIAC, EVAS_SCRIPT_SYRIAC, EVAS_SCRIPT_SYRIAC,
628 EVAS_SCRIPT_SYRIAC, EVAS_SCRIPT_SYRIAC, EVAS_SCRIPT_SYRIAC,
629 EVAS_SCRIPT_SYRIAC, EVAS_SCRIPT_SYRIAC, EVAS_SCRIPT_SYRIAC,
630 EVAS_SCRIPT_SYRIAC, EVAS_SCRIPT_SYRIAC, EVAS_SCRIPT_SYRIAC,
631 EVAS_SCRIPT_SYRIAC, EVAS_SCRIPT_SYRIAC, EVAS_SCRIPT_SYRIAC,
632 EVAS_SCRIPT_SYRIAC, EVAS_SCRIPT_SYRIAC, EVAS_SCRIPT_SYRIAC,
633 EVAS_SCRIPT_SYRIAC, EVAS_SCRIPT_SYRIAC, EVAS_SCRIPT_SYRIAC,
634 EVAS_SCRIPT_SYRIAC, EVAS_SCRIPT_SYRIAC, EVAS_SCRIPT_SYRIAC,
635 EVAS_SCRIPT_SYRIAC, EVAS_SCRIPT_SYRIAC, EVAS_SCRIPT_SYRIAC,
636 EVAS_SCRIPT_SYRIAC, EVAS_SCRIPT_SYRIAC, EVAS_SCRIPT_SYRIAC,
637 EVAS_SCRIPT_SYRIAC, EVAS_SCRIPT_SYRIAC, EVAS_SCRIPT_SYRIAC,
638 EVAS_SCRIPT_SYRIAC, EVAS_SCRIPT_SYRIAC, EVAS_SCRIPT_SYRIAC,
639 EVAS_SCRIPT_SYRIAC, EVAS_SCRIPT_SYRIAC, EVAS_SCRIPT_SYRIAC,
640 EVAS_SCRIPT_SYRIAC, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
641 EVAS_SCRIPT_SYRIAC, EVAS_SCRIPT_SYRIAC, EVAS_SCRIPT_SYRIAC,
642 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
643 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
644 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
645 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
646 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
647 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
648 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
649 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
650 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
651 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
652 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
653 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
654 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
655 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
656 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
657 EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC, EVAS_SCRIPT_ARABIC,
658 EVAS_SCRIPT_THAANA, EVAS_SCRIPT_THAANA, EVAS_SCRIPT_THAANA,
659 EVAS_SCRIPT_THAANA, EVAS_SCRIPT_THAANA, EVAS_SCRIPT_THAANA,
660 EVAS_SCRIPT_THAANA, EVAS_SCRIPT_THAANA, EVAS_SCRIPT_THAANA,
661 EVAS_SCRIPT_THAANA, EVAS_SCRIPT_THAANA, EVAS_SCRIPT_THAANA,
662 EVAS_SCRIPT_THAANA, EVAS_SCRIPT_THAANA, EVAS_SCRIPT_THAANA,
663 EVAS_SCRIPT_THAANA, EVAS_SCRIPT_THAANA, EVAS_SCRIPT_THAANA,
664 EVAS_SCRIPT_THAANA, EVAS_SCRIPT_THAANA, EVAS_SCRIPT_THAANA,
665 EVAS_SCRIPT_THAANA, EVAS_SCRIPT_THAANA, EVAS_SCRIPT_THAANA,
666 EVAS_SCRIPT_THAANA, EVAS_SCRIPT_THAANA, EVAS_SCRIPT_THAANA,
667 EVAS_SCRIPT_THAANA, EVAS_SCRIPT_THAANA, EVAS_SCRIPT_THAANA,
668 EVAS_SCRIPT_THAANA, EVAS_SCRIPT_THAANA, EVAS_SCRIPT_THAANA,
669 EVAS_SCRIPT_THAANA, EVAS_SCRIPT_THAANA, EVAS_SCRIPT_THAANA,
670 EVAS_SCRIPT_THAANA, EVAS_SCRIPT_THAANA, EVAS_SCRIPT_THAANA,
671 EVAS_SCRIPT_THAANA, EVAS_SCRIPT_THAANA, EVAS_SCRIPT_THAANA,
672 EVAS_SCRIPT_THAANA, EVAS_SCRIPT_THAANA, EVAS_SCRIPT_THAANA,
673 EVAS_SCRIPT_THAANA, EVAS_SCRIPT_THAANA, EVAS_SCRIPT_THAANA,
674 EVAS_SCRIPT_THAANA, EVAS_SCRIPT_THAANA, EVAS_SCRIPT_UNKNOWN,
675 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
676 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
677 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
678 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
679 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_NKO, EVAS_SCRIPT_NKO,
680 EVAS_SCRIPT_NKO, EVAS_SCRIPT_NKO, EVAS_SCRIPT_NKO,
681 EVAS_SCRIPT_NKO, EVAS_SCRIPT_NKO, EVAS_SCRIPT_NKO,
682 EVAS_SCRIPT_NKO, EVAS_SCRIPT_NKO, EVAS_SCRIPT_NKO,
683 EVAS_SCRIPT_NKO, EVAS_SCRIPT_NKO, EVAS_SCRIPT_NKO,
684 EVAS_SCRIPT_NKO, EVAS_SCRIPT_NKO, EVAS_SCRIPT_NKO,
685 EVAS_SCRIPT_NKO, EVAS_SCRIPT_NKO, EVAS_SCRIPT_NKO,
686 EVAS_SCRIPT_NKO, EVAS_SCRIPT_NKO, EVAS_SCRIPT_NKO,
687 EVAS_SCRIPT_NKO, EVAS_SCRIPT_NKO, EVAS_SCRIPT_NKO,
688 EVAS_SCRIPT_NKO, EVAS_SCRIPT_NKO, EVAS_SCRIPT_NKO,
689 EVAS_SCRIPT_NKO, EVAS_SCRIPT_NKO, EVAS_SCRIPT_NKO,
690 EVAS_SCRIPT_NKO, EVAS_SCRIPT_NKO, EVAS_SCRIPT_NKO,
691 EVAS_SCRIPT_NKO, EVAS_SCRIPT_NKO, EVAS_SCRIPT_NKO,
692 EVAS_SCRIPT_NKO, EVAS_SCRIPT_NKO, EVAS_SCRIPT_NKO,
693 EVAS_SCRIPT_NKO, EVAS_SCRIPT_NKO, EVAS_SCRIPT_NKO,
694 EVAS_SCRIPT_NKO, EVAS_SCRIPT_NKO, EVAS_SCRIPT_NKO,
695 EVAS_SCRIPT_NKO, EVAS_SCRIPT_NKO, EVAS_SCRIPT_NKO,
696 EVAS_SCRIPT_NKO, EVAS_SCRIPT_NKO, EVAS_SCRIPT_NKO,
697 EVAS_SCRIPT_NKO, EVAS_SCRIPT_NKO, EVAS_SCRIPT_NKO,
698 EVAS_SCRIPT_NKO, EVAS_SCRIPT_NKO, EVAS_SCRIPT_NKO,
699 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
700 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_SAMARITAN,
701 EVAS_SCRIPT_SAMARITAN, EVAS_SCRIPT_SAMARITAN, EVAS_SCRIPT_SAMARITAN,
702 EVAS_SCRIPT_SAMARITAN, EVAS_SCRIPT_SAMARITAN, EVAS_SCRIPT_SAMARITAN,
703 EVAS_SCRIPT_SAMARITAN, EVAS_SCRIPT_SAMARITAN, EVAS_SCRIPT_SAMARITAN,
704 EVAS_SCRIPT_SAMARITAN, EVAS_SCRIPT_SAMARITAN, EVAS_SCRIPT_SAMARITAN,
705 EVAS_SCRIPT_SAMARITAN, EVAS_SCRIPT_SAMARITAN, EVAS_SCRIPT_SAMARITAN,
706 EVAS_SCRIPT_SAMARITAN, EVAS_SCRIPT_SAMARITAN, EVAS_SCRIPT_SAMARITAN,
707 EVAS_SCRIPT_SAMARITAN, EVAS_SCRIPT_SAMARITAN, EVAS_SCRIPT_SAMARITAN,
708 EVAS_SCRIPT_SAMARITAN, EVAS_SCRIPT_SAMARITAN, EVAS_SCRIPT_SAMARITAN,
709 EVAS_SCRIPT_SAMARITAN, EVAS_SCRIPT_SAMARITAN, EVAS_SCRIPT_SAMARITAN,
710 EVAS_SCRIPT_SAMARITAN, EVAS_SCRIPT_SAMARITAN, EVAS_SCRIPT_SAMARITAN,
711 EVAS_SCRIPT_SAMARITAN, EVAS_SCRIPT_SAMARITAN, EVAS_SCRIPT_SAMARITAN,
712 EVAS_SCRIPT_SAMARITAN, EVAS_SCRIPT_SAMARITAN, EVAS_SCRIPT_SAMARITAN,
713 EVAS_SCRIPT_SAMARITAN, EVAS_SCRIPT_SAMARITAN, EVAS_SCRIPT_SAMARITAN,
714 EVAS_SCRIPT_SAMARITAN, EVAS_SCRIPT_SAMARITAN, EVAS_SCRIPT_SAMARITAN,
715 EVAS_SCRIPT_SAMARITAN, EVAS_SCRIPT_SAMARITAN, EVAS_SCRIPT_SAMARITAN,
716 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_SAMARITAN,
717 EVAS_SCRIPT_SAMARITAN, EVAS_SCRIPT_SAMARITAN, EVAS_SCRIPT_SAMARITAN,
718 EVAS_SCRIPT_SAMARITAN, EVAS_SCRIPT_SAMARITAN, EVAS_SCRIPT_SAMARITAN,
719 EVAS_SCRIPT_SAMARITAN, EVAS_SCRIPT_SAMARITAN, EVAS_SCRIPT_SAMARITAN,
720 EVAS_SCRIPT_SAMARITAN, EVAS_SCRIPT_SAMARITAN, EVAS_SCRIPT_SAMARITAN,
721 EVAS_SCRIPT_SAMARITAN, EVAS_SCRIPT_SAMARITAN, EVAS_SCRIPT_UNKNOWN,
722 EVAS_SCRIPT_MANDAIC, EVAS_SCRIPT_MANDAIC, EVAS_SCRIPT_MANDAIC,
723 EVAS_SCRIPT_MANDAIC, EVAS_SCRIPT_MANDAIC, EVAS_SCRIPT_MANDAIC,
724 EVAS_SCRIPT_MANDAIC, EVAS_SCRIPT_MANDAIC, EVAS_SCRIPT_MANDAIC,
725 EVAS_SCRIPT_MANDAIC, EVAS_SCRIPT_MANDAIC, EVAS_SCRIPT_MANDAIC,
726 EVAS_SCRIPT_MANDAIC, EVAS_SCRIPT_MANDAIC, EVAS_SCRIPT_MANDAIC,
727 EVAS_SCRIPT_MANDAIC, EVAS_SCRIPT_MANDAIC, EVAS_SCRIPT_MANDAIC,
728 EVAS_SCRIPT_MANDAIC, EVAS_SCRIPT_MANDAIC, EVAS_SCRIPT_MANDAIC,
729 EVAS_SCRIPT_MANDAIC, EVAS_SCRIPT_MANDAIC, EVAS_SCRIPT_MANDAIC,
730 EVAS_SCRIPT_MANDAIC, EVAS_SCRIPT_MANDAIC, EVAS_SCRIPT_MANDAIC,
731 EVAS_SCRIPT_MANDAIC, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
732 EVAS_SCRIPT_MANDAIC, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
733 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
734 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
735 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
736 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
737 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
738 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
739 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
740 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
741 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
742 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
743 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
744 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
745 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
746 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
747 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
748 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
749 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
750 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
751 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
752 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
753 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
754 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
755 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
756 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
757 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
758 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
759 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
760 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
761 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
762 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
763 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
764 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
765 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
766 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
767 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
768 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
769 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
770 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
771 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
772 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
773 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
774 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
775 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
776 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
777 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
778 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
779 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
780 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
781 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
782 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
783 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
784 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
785 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
786 EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI,
787 EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI,
788 EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI,
789 EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI,
790 EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI,
791 EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI,
792 EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI,
793 EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI,
794 EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI,
795 EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI,
796 EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI,
797 EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI,
798 EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI,
799 EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI,
800 EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI,
801 EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI,
802 EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI,
803 EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI,
804 EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI,
805 EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI,
806 EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI,
807 EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI,
808 EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI,
809 EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI,
810 EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI,
811 EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI,
812 EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI,
813 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_DEVANAGARI,
814 EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI,
815 EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI,
816 EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI,
817 EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI,
818 EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI,
819 EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
820 EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI,
821 EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI,
822 EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI,
823 EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_DEVANAGARI,
824 EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI,
825 EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI,
826 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI,
827 EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI,
828 EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_DEVANAGARI, EVAS_SCRIPT_UNKNOWN,
829 EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_BENGALI,
830 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_BENGALI,
831 EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_BENGALI,
832 EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_BENGALI,
833 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_BENGALI,
834 EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
835 EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_BENGALI,
836 EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_BENGALI,
837 EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_BENGALI,
838 EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_BENGALI,
839 EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_BENGALI,
840 EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_BENGALI,
841 EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_BENGALI,
842 EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_BENGALI,
843 EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_BENGALI,
844 EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_BENGALI,
845 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_UNKNOWN,
846 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_BENGALI,
847 EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_BENGALI,
848 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_BENGALI,
849 EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_BENGALI,
850 EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_BENGALI,
851 EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_UNKNOWN,
852 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_BENGALI,
853 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_BENGALI,
854 EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_BENGALI,
855 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
856 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
857 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_BENGALI,
858 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
859 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_BENGALI,
860 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_BENGALI,
861 EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_BENGALI,
862 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_BENGALI,
863 EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_BENGALI,
864 EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_BENGALI,
865 EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_BENGALI,
866 EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_BENGALI,
867 EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_BENGALI,
868 EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_BENGALI,
869 EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_BENGALI, EVAS_SCRIPT_BENGALI,
870 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
871 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_GURMUKHI,
872 EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_UNKNOWN,
873 EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_GURMUKHI,
874 EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_GURMUKHI,
875 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
876 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_GURMUKHI,
877 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_GURMUKHI,
878 EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_GURMUKHI,
879 EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_GURMUKHI,
880 EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_GURMUKHI,
881 EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_GURMUKHI,
882 EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_GURMUKHI,
883 EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_GURMUKHI,
884 EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_GURMUKHI,
885 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_GURMUKHI,
886 EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_GURMUKHI,
887 EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_UNKNOWN,
888 EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_UNKNOWN,
889 EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_UNKNOWN,
890 EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_UNKNOWN,
891 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_UNKNOWN,
892 EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_GURMUKHI,
893 EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_UNKNOWN,
894 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
895 EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_UNKNOWN,
896 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_GURMUKHI,
897 EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
898 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_UNKNOWN,
899 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
900 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
901 EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_GURMUKHI,
902 EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_GURMUKHI,
903 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
904 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
905 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_GURMUKHI,
906 EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_GURMUKHI,
907 EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_GURMUKHI,
908 EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_GURMUKHI,
909 EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_GURMUKHI,
910 EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_GURMUKHI, EVAS_SCRIPT_UNKNOWN,
911 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
912 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
913 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
914 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_GUJARATI,
915 EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_GUJARATI,
916 EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_GUJARATI,
917 EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_GUJARATI,
918 EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_UNKNOWN,
919 EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_GUJARATI,
920 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_GUJARATI,
921 EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_GUJARATI,
922 EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_GUJARATI,
923 EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_GUJARATI,
924 EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_GUJARATI,
925 EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_GUJARATI,
926 EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_GUJARATI,
927 EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_UNKNOWN,
928 EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_GUJARATI,
929 EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_GUJARATI,
930 EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_GUJARATI,
931 EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_GUJARATI,
932 EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_GUJARATI,
933 EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
934 EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_GUJARATI,
935 EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_GUJARATI,
936 EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_GUJARATI,
937 EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_GUJARATI,
938 EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_UNKNOWN,
939 EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_GUJARATI,
940 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_GUJARATI,
941 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
942 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
943 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
944 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
945 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
946 EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_GUJARATI,
947 EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
948 EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_GUJARATI,
949 EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_GUJARATI,
950 EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_GUJARATI,
951 EVAS_SCRIPT_GUJARATI, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_GUJARATI,
952 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
953 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
954 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
955 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
956 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
957 EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_ORIYA,
958 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_ORIYA,
959 EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_ORIYA,
960 EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_ORIYA,
961 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_ORIYA,
962 EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
963 EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_ORIYA,
964 EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_ORIYA,
965 EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_ORIYA,
966 EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_ORIYA,
967 EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_ORIYA,
968 EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_ORIYA,
969 EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_ORIYA,
970 EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_ORIYA,
971 EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_ORIYA,
972 EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_ORIYA,
973 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_ORIYA,
974 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_ORIYA,
975 EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_ORIYA,
976 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_ORIYA,
977 EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_ORIYA,
978 EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_ORIYA,
979 EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_UNKNOWN,
980 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_ORIYA,
981 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_ORIYA,
982 EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_UNKNOWN,
983 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
984 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
985 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_ORIYA,
986 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
987 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_ORIYA,
988 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_ORIYA,
989 EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_ORIYA,
990 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_ORIYA,
991 EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_ORIYA,
992 EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_ORIYA,
993 EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_ORIYA,
994 EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_ORIYA,
995 EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_ORIYA,
996 EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_ORIYA, EVAS_SCRIPT_UNKNOWN,
997 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
998 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
999 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1000 EVAS_SCRIPT_TAMIL, EVAS_SCRIPT_TAMIL, EVAS_SCRIPT_UNKNOWN,
1001 EVAS_SCRIPT_TAMIL, EVAS_SCRIPT_TAMIL, EVAS_SCRIPT_TAMIL,
1002 EVAS_SCRIPT_TAMIL, EVAS_SCRIPT_TAMIL, EVAS_SCRIPT_TAMIL,
1003 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1004 EVAS_SCRIPT_TAMIL, EVAS_SCRIPT_TAMIL, EVAS_SCRIPT_TAMIL,
1005 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_TAMIL, EVAS_SCRIPT_TAMIL,
1006 EVAS_SCRIPT_TAMIL, EVAS_SCRIPT_TAMIL, EVAS_SCRIPT_UNKNOWN,
1007 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_TAMIL,
1008 EVAS_SCRIPT_TAMIL, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_TAMIL,
1009 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_TAMIL, EVAS_SCRIPT_TAMIL,
1010 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1011 EVAS_SCRIPT_TAMIL, EVAS_SCRIPT_TAMIL, EVAS_SCRIPT_UNKNOWN,
1012 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_TAMIL,
1013 EVAS_SCRIPT_TAMIL, EVAS_SCRIPT_TAMIL, EVAS_SCRIPT_UNKNOWN,
1014 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_TAMIL,
1015 EVAS_SCRIPT_TAMIL, EVAS_SCRIPT_TAMIL, EVAS_SCRIPT_TAMIL,
1016 EVAS_SCRIPT_TAMIL, EVAS_SCRIPT_TAMIL, EVAS_SCRIPT_TAMIL,
1017 EVAS_SCRIPT_TAMIL, EVAS_SCRIPT_TAMIL, EVAS_SCRIPT_TAMIL,
1018 EVAS_SCRIPT_TAMIL, EVAS_SCRIPT_TAMIL, EVAS_SCRIPT_UNKNOWN,
1019 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1020 EVAS_SCRIPT_TAMIL, EVAS_SCRIPT_TAMIL, EVAS_SCRIPT_TAMIL,
1021 EVAS_SCRIPT_TAMIL, EVAS_SCRIPT_TAMIL, EVAS_SCRIPT_UNKNOWN,
1022 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_TAMIL,
1023 EVAS_SCRIPT_TAMIL, EVAS_SCRIPT_TAMIL, EVAS_SCRIPT_UNKNOWN,
1024 EVAS_SCRIPT_TAMIL, EVAS_SCRIPT_TAMIL, EVAS_SCRIPT_TAMIL,
1025 EVAS_SCRIPT_TAMIL, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1026 EVAS_SCRIPT_TAMIL, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1027 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1028 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_TAMIL, EVAS_SCRIPT_UNKNOWN,
1029 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1030 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1031 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1032 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1033 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_TAMIL, EVAS_SCRIPT_TAMIL,
1034 EVAS_SCRIPT_TAMIL, EVAS_SCRIPT_TAMIL, EVAS_SCRIPT_TAMIL,
1035 EVAS_SCRIPT_TAMIL, EVAS_SCRIPT_TAMIL, EVAS_SCRIPT_TAMIL,
1036 EVAS_SCRIPT_TAMIL, EVAS_SCRIPT_TAMIL, EVAS_SCRIPT_TAMIL,
1037 EVAS_SCRIPT_TAMIL, EVAS_SCRIPT_TAMIL, EVAS_SCRIPT_TAMIL,
1038 EVAS_SCRIPT_TAMIL, EVAS_SCRIPT_TAMIL, EVAS_SCRIPT_TAMIL,
1039 EVAS_SCRIPT_TAMIL, EVAS_SCRIPT_TAMIL, EVAS_SCRIPT_TAMIL,
1040 EVAS_SCRIPT_TAMIL, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1041 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1042 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_TELUGU,
1043 EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_TELUGU,
1044 EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_TELUGU,
1045 EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_TELUGU,
1046 EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_TELUGU,
1047 EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_UNKNOWN,
1048 EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_TELUGU,
1049 EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_TELUGU,
1050 EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_TELUGU,
1051 EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_TELUGU,
1052 EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_TELUGU,
1053 EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_TELUGU,
1054 EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_TELUGU,
1055 EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_UNKNOWN,
1056 EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_TELUGU,
1057 EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_TELUGU,
1058 EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_TELUGU,
1059 EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_TELUGU,
1060 EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_TELUGU,
1061 EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1062 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_TELUGU,
1063 EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_TELUGU,
1064 EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_TELUGU,
1065 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_TELUGU,
1066 EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_TELUGU,
1067 EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_TELUGU,
1068 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1069 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1070 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_TELUGU,
1071 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_TELUGU,
1072 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1073 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1074 EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_TELUGU,
1075 EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1076 EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_TELUGU,
1077 EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_TELUGU,
1078 EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_TELUGU,
1079 EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1080 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1081 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1082 EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_TELUGU,
1083 EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_TELUGU,
1084 EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_TELUGU, EVAS_SCRIPT_UNKNOWN,
1085 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_KANNADA,
1086 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_KANNADA,
1087 EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_KANNADA,
1088 EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_KANNADA,
1089 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_KANNADA,
1090 EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_KANNADA,
1091 EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_KANNADA,
1092 EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_KANNADA,
1093 EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_KANNADA,
1094 EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_KANNADA,
1095 EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_KANNADA,
1096 EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_KANNADA,
1097 EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_KANNADA,
1098 EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_KANNADA,
1099 EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_KANNADA,
1100 EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_KANNADA,
1101 EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_KANNADA,
1102 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_KANNADA,
1103 EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_KANNADA,
1104 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_KANNADA,
1105 EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_KANNADA,
1106 EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_KANNADA,
1107 EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_UNKNOWN,
1108 EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_KANNADA,
1109 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_KANNADA,
1110 EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_UNKNOWN,
1111 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1112 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1113 EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_UNKNOWN,
1114 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1115 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1116 EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_KANNADA,
1117 EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_KANNADA,
1118 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_KANNADA,
1119 EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_KANNADA,
1120 EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_KANNADA,
1121 EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_KANNADA,
1122 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_KANNADA, EVAS_SCRIPT_KANNADA,
1123 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1124 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1125 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1126 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1127 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1128 EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_UNKNOWN,
1129 EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM,
1130 EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM,
1131 EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_UNKNOWN,
1132 EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM,
1133 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM,
1134 EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM,
1135 EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM,
1136 EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM,
1137 EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM,
1138 EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM,
1139 EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM,
1140 EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM,
1141 EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM,
1142 EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM,
1143 EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM,
1144 EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM,
1145 EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM,
1146 EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM,
1147 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_MALAYALAM,
1148 EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM,
1149 EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM,
1150 EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_MALAYALAM,
1151 EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_UNKNOWN,
1152 EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM,
1153 EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_UNKNOWN,
1154 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1155 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1156 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_UNKNOWN,
1157 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1158 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1159 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM,
1160 EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_UNKNOWN,
1161 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM,
1162 EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM,
1163 EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM,
1164 EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM,
1165 EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM,
1166 EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_UNKNOWN,
1167 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_MALAYALAM,
1168 EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM,
1169 EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM, EVAS_SCRIPT_MALAYALAM,
1170 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_SINHALA,
1171 EVAS_SCRIPT_SINHALA, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_SINHALA,
1172 EVAS_SCRIPT_SINHALA, EVAS_SCRIPT_SINHALA, EVAS_SCRIPT_SINHALA,
1173 EVAS_SCRIPT_SINHALA, EVAS_SCRIPT_SINHALA, EVAS_SCRIPT_SINHALA,
1174 EVAS_SCRIPT_SINHALA, EVAS_SCRIPT_SINHALA, EVAS_SCRIPT_SINHALA,
1175 EVAS_SCRIPT_SINHALA, EVAS_SCRIPT_SINHALA, EVAS_SCRIPT_SINHALA,
1176 EVAS_SCRIPT_SINHALA, EVAS_SCRIPT_SINHALA, EVAS_SCRIPT_SINHALA,
1177 EVAS_SCRIPT_SINHALA, EVAS_SCRIPT_SINHALA, EVAS_SCRIPT_UNKNOWN,
1178 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_SINHALA,
1179 EVAS_SCRIPT_SINHALA, EVAS_SCRIPT_SINHALA, EVAS_SCRIPT_SINHALA,
1180 EVAS_SCRIPT_SINHALA, EVAS_SCRIPT_SINHALA, EVAS_SCRIPT_SINHALA,
1181 EVAS_SCRIPT_SINHALA, EVAS_SCRIPT_SINHALA, EVAS_SCRIPT_SINHALA,
1182 EVAS_SCRIPT_SINHALA, EVAS_SCRIPT_SINHALA, EVAS_SCRIPT_SINHALA,
1183 EVAS_SCRIPT_SINHALA, EVAS_SCRIPT_SINHALA, EVAS_SCRIPT_SINHALA,
1184 EVAS_SCRIPT_SINHALA, EVAS_SCRIPT_SINHALA, EVAS_SCRIPT_SINHALA,
1185 EVAS_SCRIPT_SINHALA, EVAS_SCRIPT_SINHALA, EVAS_SCRIPT_SINHALA,
1186 EVAS_SCRIPT_SINHALA, EVAS_SCRIPT_SINHALA, EVAS_SCRIPT_UNKNOWN,
1187 EVAS_SCRIPT_SINHALA, EVAS_SCRIPT_SINHALA, EVAS_SCRIPT_SINHALA,
1188 EVAS_SCRIPT_SINHALA, EVAS_SCRIPT_SINHALA, EVAS_SCRIPT_SINHALA,
1189 EVAS_SCRIPT_SINHALA, EVAS_SCRIPT_SINHALA, EVAS_SCRIPT_SINHALA,
1190 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_SINHALA, EVAS_SCRIPT_UNKNOWN,
1191 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_SINHALA, EVAS_SCRIPT_SINHALA,
1192 EVAS_SCRIPT_SINHALA, EVAS_SCRIPT_SINHALA, EVAS_SCRIPT_SINHALA,
1193 EVAS_SCRIPT_SINHALA, EVAS_SCRIPT_SINHALA, EVAS_SCRIPT_UNKNOWN,
1194 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_SINHALA,
1195 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1196 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_SINHALA, EVAS_SCRIPT_SINHALA,
1197 EVAS_SCRIPT_SINHALA, EVAS_SCRIPT_SINHALA, EVAS_SCRIPT_SINHALA,
1198 EVAS_SCRIPT_SINHALA, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_SINHALA,
1199 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_SINHALA, EVAS_SCRIPT_SINHALA,
1200 EVAS_SCRIPT_SINHALA, EVAS_SCRIPT_SINHALA, EVAS_SCRIPT_SINHALA,
1201 EVAS_SCRIPT_SINHALA, EVAS_SCRIPT_SINHALA, EVAS_SCRIPT_SINHALA,
1202 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1203 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1204 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1205 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1206 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1207 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1208 EVAS_SCRIPT_SINHALA, EVAS_SCRIPT_SINHALA, EVAS_SCRIPT_SINHALA,
1209 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1210 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1211 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1212 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1213 EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI,
1214 EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI,
1215 EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI,
1216 EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI,
1217 EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI,
1218 EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI,
1219 EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI,
1220 EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI,
1221 EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI,
1222 EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI,
1223 EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI,
1224 EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI,
1225 EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI,
1226 EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI,
1227 EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI,
1228 EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI,
1229 EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI,
1230 EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI,
1231 EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI,
1232 EVAS_SCRIPT_THAI, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1233 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_COMMON,
1234 EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI,
1235 EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI,
1236 EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI,
1237 EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI,
1238 EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI,
1239 EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI,
1240 EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI,
1241 EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI,
1242 EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI, EVAS_SCRIPT_THAI,
1243 EVAS_SCRIPT_THAI, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1244 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1245 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1246 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1247 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1248 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1249 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1250 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1251 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1252 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1253 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1254 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1255 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_LAO,
1256 EVAS_SCRIPT_LAO, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_LAO,
1257 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_LAO,
1258 EVAS_SCRIPT_LAO, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_LAO,
1259 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_LAO,
1260 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1261 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1262 EVAS_SCRIPT_LAO, EVAS_SCRIPT_LAO, EVAS_SCRIPT_LAO,
1263 EVAS_SCRIPT_LAO, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_LAO,
1264 EVAS_SCRIPT_LAO, EVAS_SCRIPT_LAO, EVAS_SCRIPT_LAO,
1265 EVAS_SCRIPT_LAO, EVAS_SCRIPT_LAO, EVAS_SCRIPT_LAO,
1266 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_LAO, EVAS_SCRIPT_LAO,
1267 EVAS_SCRIPT_LAO, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_LAO,
1268 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_LAO, EVAS_SCRIPT_UNKNOWN,
1269 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_LAO, EVAS_SCRIPT_LAO,
1270 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_LAO, EVAS_SCRIPT_LAO,
1271 EVAS_SCRIPT_LAO, EVAS_SCRIPT_LAO, EVAS_SCRIPT_LAO,
1272 EVAS_SCRIPT_LAO, EVAS_SCRIPT_LAO, EVAS_SCRIPT_LAO,
1273 EVAS_SCRIPT_LAO, EVAS_SCRIPT_LAO, EVAS_SCRIPT_LAO,
1274 EVAS_SCRIPT_LAO, EVAS_SCRIPT_LAO, EVAS_SCRIPT_UNKNOWN,
1275 EVAS_SCRIPT_LAO, EVAS_SCRIPT_LAO, EVAS_SCRIPT_LAO,
1276 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_LAO,
1277 EVAS_SCRIPT_LAO, EVAS_SCRIPT_LAO, EVAS_SCRIPT_LAO,
1278 EVAS_SCRIPT_LAO, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_LAO,
1279 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_LAO, EVAS_SCRIPT_LAO,
1280 EVAS_SCRIPT_LAO, EVAS_SCRIPT_LAO, EVAS_SCRIPT_LAO,
1281 EVAS_SCRIPT_LAO, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1282 EVAS_SCRIPT_LAO, EVAS_SCRIPT_LAO, EVAS_SCRIPT_LAO,
1283 EVAS_SCRIPT_LAO, EVAS_SCRIPT_LAO, EVAS_SCRIPT_LAO,
1284 EVAS_SCRIPT_LAO, EVAS_SCRIPT_LAO, EVAS_SCRIPT_LAO,
1285 EVAS_SCRIPT_LAO, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1286 EVAS_SCRIPT_LAO, EVAS_SCRIPT_LAO, EVAS_SCRIPT_UNKNOWN,
1287 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1288 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1289 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1290 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1291 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1292 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1293 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1294 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1295 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1296 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1297 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1298 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1299 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1300 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1301 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1302 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1303 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1304 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1305 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1306 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1307 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1308 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1309 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1310 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1311 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1312 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1313 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1314 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1315 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1316 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1317 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1318 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1319 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1320 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1321 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1322 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1323 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1324 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1325 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1326 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1327 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1328 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1329 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1330 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1331 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1332 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1333 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1334 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1335 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_TIBETAN,
1336 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1337 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1338 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1339 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1340 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1341 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1342 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1343 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1344 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1345 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1346 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1347 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1348 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_UNKNOWN,
1349 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1350 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1351 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1352 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1353 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1354 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1355 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1356 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1357 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1358 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1359 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1360 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1361 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1362 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1363 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1364 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1365 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1366 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_TIBETAN,
1367 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1368 EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1369 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
1370 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_TIBETAN, EVAS_SCRIPT_TIBETAN,
1371 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1372 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1373 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1374 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1375 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1376 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1377 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1378 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1379 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1380 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1381 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1382 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1383 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR,
1384 EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR,
1385 EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR,
1386 EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR,
1387 EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR,
1388 EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR,
1389 EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR,
1390 EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR,
1391 EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR,
1392 EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR,
1393 EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR,
1394 EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR,
1395 EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR,
1396 EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR,
1397 EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR,
1398 EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR,
1399 EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR,
1400 EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR,
1401 EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR,
1402 EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR,
1403 EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR,
1404 EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR,
1405 EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR,
1406 EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR,
1407 EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR,
1408 EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR,
1409 EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR,
1410 EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR,
1411 EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR,
1412 EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR,
1413 EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR,
1414 EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR,
1415 EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR,
1416 EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR,
1417 EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR,
1418 EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR,
1419 EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR,
1420 EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR,
1421 EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR,
1422 EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR,
1423 EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR,
1424 EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR,
1425 EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR,
1426 EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR,
1427 EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR,
1428 EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR,
1429 EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR,
1430 EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR,
1431 EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR,
1432 EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR,
1433 EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR,
1434 EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR,
1435 EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR,
1436 EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_MYANMAR, EVAS_SCRIPT_GEORGIAN,
1437 EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_GEORGIAN,
1438 EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_GEORGIAN,
1439 EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_GEORGIAN,
1440 EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_GEORGIAN,
1441 EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_GEORGIAN,
1442 EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_GEORGIAN,
1443 EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_GEORGIAN,
1444 EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_GEORGIAN,
1445 EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_GEORGIAN,
1446 EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_GEORGIAN,
1447 EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_GEORGIAN,
1448 EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_GEORGIAN,
1449 EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1450 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1451 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1452 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_GEORGIAN,
1453 EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_GEORGIAN,
1454 EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_GEORGIAN,
1455 EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_GEORGIAN,
1456 EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_GEORGIAN,
1457 EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_GEORGIAN,
1458 EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_GEORGIAN,
1459 EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_GEORGIAN,
1460 EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_GEORGIAN,
1461 EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_GEORGIAN,
1462 EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_GEORGIAN,
1463 EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_GEORGIAN,
1464 EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_GEORGIAN,
1465 EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_GEORGIAN,
1466 EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_GEORGIAN,
1467 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_GEORGIAN, EVAS_SCRIPT_UNKNOWN,
1468 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_HANGUL,
1469 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1470 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1471 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1472 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1473 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1474 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1475 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1476 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1477 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1478 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1479 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1480 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1481 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1482 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1483 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1484 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1485 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1486 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1487 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1488 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1489 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1490 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1491 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1492 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1493 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1494 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1495 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1496 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1497 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1498 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1499 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1500 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1501 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1502 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1503 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1504 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1505 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1506 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1507 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1508 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1509 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1510 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1511 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1512 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1513 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1514 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1515 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1516 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1517 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1518 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1519 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1520 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1521 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1522 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1523 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1524 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1525 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1526 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1527 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1528 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1529 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1530 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1531 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1532 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1533 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1534 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1535 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1536 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1537 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1538 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1539 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1540 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1541 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1542 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1543 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1544 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1545 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1546 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1547 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1548 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1549 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1550 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1551 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1552 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1553 EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL, EVAS_SCRIPT_HANGUL,
1554 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1555 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1556 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1557 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1558 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1559 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1560 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1561 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1562 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1563 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1564 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1565 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1566 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1567 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1568 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1569 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1570 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1571 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1572 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1573 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1574 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1575 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1576 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1577 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1578 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_ETHIOPIC,
1579 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1580 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_ETHIOPIC,
1581 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1582 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1583 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_UNKNOWN,
1584 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1585 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1586 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1587 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1588 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1589 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1590 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1591 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1592 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1593 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1594 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1595 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1596 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1597 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1598 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1599 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_UNKNOWN,
1600 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1601 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1602 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1603 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1604 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1605 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1606 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1607 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1608 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1609 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1610 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1611 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1612 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1613 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1614 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_UNKNOWN,
1615 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1616 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1617 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_UNKNOWN,
1618 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_ETHIOPIC,
1619 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1620 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_ETHIOPIC,
1621 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1622 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1623 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1624 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1625 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_UNKNOWN,
1626 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1627 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1628 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1629 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1630 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1631 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1632 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1633 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1634 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1635 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1636 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1637 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1638 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1639 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1640 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1641 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1642 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1643 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1644 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1645 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1646 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_UNKNOWN,
1647 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1648 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1649 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1650 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1651 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1652 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1653 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1654 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1655 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1656 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1657 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1658 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1659 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1660 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1661 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1662 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1663 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1664 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1665 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1666 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1667 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1668 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1669 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_UNKNOWN,
1670 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1671 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1672 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1673 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1674 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1675 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1676 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1677 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1678 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1679 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1680 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1681 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1682 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1683 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1684 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1685 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1686 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1687 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1688 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1689 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC,
1690 EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_ETHIOPIC, EVAS_SCRIPT_UNKNOWN,
1691 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1692 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_CHEROKEE,
1693 EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE,
1694 EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE,
1695 EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE,
1696 EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE,
1697 EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE,
1698 EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE,
1699 EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE,
1700 EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE,
1701 EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE,
1702 EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE,
1703 EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE,
1704 EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE,
1705 EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE,
1706 EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE,
1707 EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE,
1708 EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE,
1709 EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE,
1710 EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE,
1711 EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE,
1712 EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE,
1713 EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE,
1714 EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE,
1715 EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE,
1716 EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE,
1717 EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE,
1718 EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE,
1719 EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE,
1720 EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE, EVAS_SCRIPT_CHEROKEE,
1721 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1722 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1723 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1724 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1725 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1726 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1727 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1728 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1729 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1730 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1731 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1732 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1733 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1734 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1735 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1736 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1737 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1738 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1739 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1740 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1741 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1742 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1743 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1744 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1745 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1746 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1747 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1748 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1749 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1750 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1751 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1752 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1753 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1754 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1755 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1756 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1757 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1758 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1759 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1760 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1761 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1762 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1763 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1764 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1765 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1766 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1767 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1768 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1769 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1770 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1771 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1772 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1773 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1774 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1775 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1776 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1777 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1778 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1779 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1780 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1781 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1782 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1783 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1784 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1785 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1786 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1787 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1788 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1789 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1790 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1791 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1792 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1793 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1794 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1795 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1796 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1797 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1798 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1799 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1800 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1801 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1802 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1803 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1804 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1805 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1806 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1807 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1808 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1809 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1810 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1811 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1812 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1813 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1814 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1815 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1816 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1817 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1818 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1819 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1820 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1821 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1822 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1823 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1824 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1825 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1826 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1827 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1828 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1829 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1830 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1831 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1832 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1833 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1834 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1835 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1836 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1837 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1838 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1839 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1840 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1841 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1842 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1843 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1844 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1845 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1846 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1847 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1848 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1849 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1850 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1851 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1852 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1853 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1854 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1855 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1856 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1857 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1858 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1859 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1860 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1861 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1862 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1863 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1864 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1865 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1866 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1867 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1868 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1869 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1870 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1871 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1872 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1873 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1874 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1875 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1876 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1877 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1878 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1879 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1880 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1881 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1882 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1883 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1884 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1885 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1886 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1887 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1888 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1889 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1890 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1891 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1892 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1893 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1894 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1895 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1896 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1897 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1898 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1899 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1900 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1901 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1902 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1903 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1904 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1905 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1906 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1907 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1908 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1909 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1910 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1911 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1912 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1913 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1914 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1915 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1916 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1917 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1918 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1919 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1920 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1921 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1922 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1923 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1924 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1925 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1926 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1927 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1928 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1929 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1930 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1931 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1932 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1933 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1934 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1935 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1936 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1937 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
1938 EVAS_SCRIPT_OGHAM, EVAS_SCRIPT_OGHAM, EVAS_SCRIPT_OGHAM,
1939 EVAS_SCRIPT_OGHAM, EVAS_SCRIPT_OGHAM, EVAS_SCRIPT_OGHAM,
1940 EVAS_SCRIPT_OGHAM, EVAS_SCRIPT_OGHAM, EVAS_SCRIPT_OGHAM,
1941 EVAS_SCRIPT_OGHAM, EVAS_SCRIPT_OGHAM, EVAS_SCRIPT_OGHAM,
1942 EVAS_SCRIPT_OGHAM, EVAS_SCRIPT_OGHAM, EVAS_SCRIPT_OGHAM,
1943 EVAS_SCRIPT_OGHAM, EVAS_SCRIPT_OGHAM, EVAS_SCRIPT_OGHAM,
1944 EVAS_SCRIPT_OGHAM, EVAS_SCRIPT_OGHAM, EVAS_SCRIPT_OGHAM,
1945 EVAS_SCRIPT_OGHAM, EVAS_SCRIPT_OGHAM, EVAS_SCRIPT_OGHAM,
1946 EVAS_SCRIPT_OGHAM, EVAS_SCRIPT_OGHAM, EVAS_SCRIPT_OGHAM,
1947 EVAS_SCRIPT_OGHAM, EVAS_SCRIPT_OGHAM, EVAS_SCRIPT_UNKNOWN,
1948 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_RUNIC,
1949 EVAS_SCRIPT_RUNIC, EVAS_SCRIPT_RUNIC, EVAS_SCRIPT_RUNIC,
1950 EVAS_SCRIPT_RUNIC, EVAS_SCRIPT_RUNIC, EVAS_SCRIPT_RUNIC,
1951 EVAS_SCRIPT_RUNIC, EVAS_SCRIPT_RUNIC, EVAS_SCRIPT_RUNIC,
1952 EVAS_SCRIPT_RUNIC, EVAS_SCRIPT_RUNIC, EVAS_SCRIPT_RUNIC,
1953 EVAS_SCRIPT_RUNIC, EVAS_SCRIPT_RUNIC, EVAS_SCRIPT_RUNIC,
1954 EVAS_SCRIPT_RUNIC, EVAS_SCRIPT_RUNIC, EVAS_SCRIPT_RUNIC,
1955 EVAS_SCRIPT_RUNIC, EVAS_SCRIPT_RUNIC, EVAS_SCRIPT_RUNIC,
1956 EVAS_SCRIPT_RUNIC, EVAS_SCRIPT_RUNIC, EVAS_SCRIPT_RUNIC,
1957 EVAS_SCRIPT_RUNIC, EVAS_SCRIPT_RUNIC, EVAS_SCRIPT_RUNIC,
1958 EVAS_SCRIPT_RUNIC, EVAS_SCRIPT_RUNIC, EVAS_SCRIPT_RUNIC,
1959 EVAS_SCRIPT_RUNIC, EVAS_SCRIPT_RUNIC, EVAS_SCRIPT_RUNIC,
1960 EVAS_SCRIPT_RUNIC, EVAS_SCRIPT_RUNIC, EVAS_SCRIPT_RUNIC,
1961 EVAS_SCRIPT_RUNIC, EVAS_SCRIPT_RUNIC, EVAS_SCRIPT_RUNIC,
1962 EVAS_SCRIPT_RUNIC, EVAS_SCRIPT_RUNIC, EVAS_SCRIPT_RUNIC,
1963 EVAS_SCRIPT_RUNIC, EVAS_SCRIPT_RUNIC, EVAS_SCRIPT_RUNIC,
1964 EVAS_SCRIPT_RUNIC, EVAS_SCRIPT_RUNIC, EVAS_SCRIPT_RUNIC,
1965 EVAS_SCRIPT_RUNIC, EVAS_SCRIPT_RUNIC, EVAS_SCRIPT_RUNIC,
1966 EVAS_SCRIPT_RUNIC, EVAS_SCRIPT_RUNIC, EVAS_SCRIPT_RUNIC,
1967 EVAS_SCRIPT_RUNIC, EVAS_SCRIPT_RUNIC, EVAS_SCRIPT_RUNIC,
1968 EVAS_SCRIPT_RUNIC, EVAS_SCRIPT_RUNIC, EVAS_SCRIPT_RUNIC,
1969 EVAS_SCRIPT_RUNIC, EVAS_SCRIPT_RUNIC, EVAS_SCRIPT_RUNIC,
1970 EVAS_SCRIPT_RUNIC, EVAS_SCRIPT_RUNIC, EVAS_SCRIPT_RUNIC,
1971 EVAS_SCRIPT_RUNIC, EVAS_SCRIPT_RUNIC, EVAS_SCRIPT_RUNIC,
1972 EVAS_SCRIPT_RUNIC, EVAS_SCRIPT_RUNIC, EVAS_SCRIPT_RUNIC,
1973 EVAS_SCRIPT_RUNIC, EVAS_SCRIPT_RUNIC, EVAS_SCRIPT_COMMON,
1974 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_RUNIC,
1975 EVAS_SCRIPT_RUNIC, EVAS_SCRIPT_RUNIC, EVAS_SCRIPT_UNKNOWN,
1976 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1977 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1978 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1979 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1980 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_TAGALOG,
1981 EVAS_SCRIPT_TAGALOG, EVAS_SCRIPT_TAGALOG, EVAS_SCRIPT_TAGALOG,
1982 EVAS_SCRIPT_TAGALOG, EVAS_SCRIPT_TAGALOG, EVAS_SCRIPT_TAGALOG,
1983 EVAS_SCRIPT_TAGALOG, EVAS_SCRIPT_TAGALOG, EVAS_SCRIPT_TAGALOG,
1984 EVAS_SCRIPT_TAGALOG, EVAS_SCRIPT_TAGALOG, EVAS_SCRIPT_TAGALOG,
1985 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_TAGALOG, EVAS_SCRIPT_TAGALOG,
1986 EVAS_SCRIPT_TAGALOG, EVAS_SCRIPT_TAGALOG, EVAS_SCRIPT_TAGALOG,
1987 EVAS_SCRIPT_TAGALOG, EVAS_SCRIPT_TAGALOG, EVAS_SCRIPT_UNKNOWN,
1988 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1989 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1990 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
1991 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_HANUNOO, EVAS_SCRIPT_HANUNOO,
1992 EVAS_SCRIPT_HANUNOO, EVAS_SCRIPT_HANUNOO, EVAS_SCRIPT_HANUNOO,
1993 EVAS_SCRIPT_HANUNOO, EVAS_SCRIPT_HANUNOO, EVAS_SCRIPT_HANUNOO,
1994 EVAS_SCRIPT_HANUNOO, EVAS_SCRIPT_HANUNOO, EVAS_SCRIPT_HANUNOO,
1995 EVAS_SCRIPT_HANUNOO, EVAS_SCRIPT_HANUNOO, EVAS_SCRIPT_HANUNOO,
1996 EVAS_SCRIPT_HANUNOO, EVAS_SCRIPT_HANUNOO, EVAS_SCRIPT_HANUNOO,
1997 EVAS_SCRIPT_HANUNOO, EVAS_SCRIPT_HANUNOO, EVAS_SCRIPT_HANUNOO,
1998 EVAS_SCRIPT_HANUNOO, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
1999 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2000 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2001 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2002 EVAS_SCRIPT_BUHID, EVAS_SCRIPT_BUHID, EVAS_SCRIPT_BUHID,
2003 EVAS_SCRIPT_BUHID, EVAS_SCRIPT_BUHID, EVAS_SCRIPT_BUHID,
2004 EVAS_SCRIPT_BUHID, EVAS_SCRIPT_BUHID, EVAS_SCRIPT_BUHID,
2005 EVAS_SCRIPT_BUHID, EVAS_SCRIPT_BUHID, EVAS_SCRIPT_BUHID,
2006 EVAS_SCRIPT_BUHID, EVAS_SCRIPT_BUHID, EVAS_SCRIPT_BUHID,
2007 EVAS_SCRIPT_BUHID, EVAS_SCRIPT_BUHID, EVAS_SCRIPT_BUHID,
2008 EVAS_SCRIPT_BUHID, EVAS_SCRIPT_BUHID, EVAS_SCRIPT_UNKNOWN,
2009 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2010 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2011 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2012 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_TAGBANWA,
2013 EVAS_SCRIPT_TAGBANWA, EVAS_SCRIPT_TAGBANWA, EVAS_SCRIPT_TAGBANWA,
2014 EVAS_SCRIPT_TAGBANWA, EVAS_SCRIPT_TAGBANWA, EVAS_SCRIPT_TAGBANWA,
2015 EVAS_SCRIPT_TAGBANWA, EVAS_SCRIPT_TAGBANWA, EVAS_SCRIPT_TAGBANWA,
2016 EVAS_SCRIPT_TAGBANWA, EVAS_SCRIPT_TAGBANWA, EVAS_SCRIPT_TAGBANWA,
2017 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_TAGBANWA, EVAS_SCRIPT_TAGBANWA,
2018 EVAS_SCRIPT_TAGBANWA, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_TAGBANWA,
2019 EVAS_SCRIPT_TAGBANWA, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2020 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2021 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2022 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2023 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER,
2024 EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER,
2025 EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER,
2026 EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER,
2027 EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER,
2028 EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER,
2029 EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER,
2030 EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER,
2031 EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER,
2032 EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER,
2033 EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER,
2034 EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER,
2035 EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER,
2036 EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER,
2037 EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER,
2038 EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER,
2039 EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER,
2040 EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER,
2041 EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER,
2042 EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER,
2043 EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER,
2044 EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER,
2045 EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER,
2046 EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER,
2047 EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER,
2048 EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER,
2049 EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER,
2050 EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER,
2051 EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER,
2052 EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER,
2053 EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER,
2054 EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER, EVAS_SCRIPT_UNKNOWN,
2055 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER,
2056 EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER,
2057 EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER,
2058 EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER, EVAS_SCRIPT_UNKNOWN,
2059 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2060 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_KHMER,
2061 EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER,
2062 EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER,
2063 EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER,
2064 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2065 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2066 EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_COMMON,
2067 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_COMMON,
2068 EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN,
2069 EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN,
2070 EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN,
2071 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN,
2072 EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN,
2073 EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN,
2074 EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_UNKNOWN,
2075 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2076 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_MONGOLIAN,
2077 EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN,
2078 EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN,
2079 EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN,
2080 EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN,
2081 EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN,
2082 EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN,
2083 EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN,
2084 EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN,
2085 EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN,
2086 EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN,
2087 EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN,
2088 EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN,
2089 EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN,
2090 EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN,
2091 EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN,
2092 EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN,
2093 EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN,
2094 EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN,
2095 EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN,
2096 EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN,
2097 EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN,
2098 EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN,
2099 EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN,
2100 EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN,
2101 EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN,
2102 EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN,
2103 EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN,
2104 EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN,
2105 EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN,
2106 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2107 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2108 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_MONGOLIAN,
2109 EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN,
2110 EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN,
2111 EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN,
2112 EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN,
2113 EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN,
2114 EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN,
2115 EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN,
2116 EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN,
2117 EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN,
2118 EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN,
2119 EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN,
2120 EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN,
2121 EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN,
2122 EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN, EVAS_SCRIPT_MONGOLIAN,
2123 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2124 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
2125 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
2126 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
2127 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
2128 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
2129 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
2130 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
2131 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
2132 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
2133 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
2134 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
2135 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
2136 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
2137 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
2138 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
2139 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
2140 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
2141 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
2142 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
2143 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
2144 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
2145 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
2146 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
2147 EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL, EVAS_SCRIPT_CANADIAN_ABORIGINAL,
2148 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2149 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2150 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2151 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_LIMBU, EVAS_SCRIPT_LIMBU,
2152 EVAS_SCRIPT_LIMBU, EVAS_SCRIPT_LIMBU, EVAS_SCRIPT_LIMBU,
2153 EVAS_SCRIPT_LIMBU, EVAS_SCRIPT_LIMBU, EVAS_SCRIPT_LIMBU,
2154 EVAS_SCRIPT_LIMBU, EVAS_SCRIPT_LIMBU, EVAS_SCRIPT_LIMBU,
2155 EVAS_SCRIPT_LIMBU, EVAS_SCRIPT_LIMBU, EVAS_SCRIPT_LIMBU,
2156 EVAS_SCRIPT_LIMBU, EVAS_SCRIPT_LIMBU, EVAS_SCRIPT_LIMBU,
2157 EVAS_SCRIPT_LIMBU, EVAS_SCRIPT_LIMBU, EVAS_SCRIPT_LIMBU,
2158 EVAS_SCRIPT_LIMBU, EVAS_SCRIPT_LIMBU, EVAS_SCRIPT_LIMBU,
2159 EVAS_SCRIPT_LIMBU, EVAS_SCRIPT_LIMBU, EVAS_SCRIPT_LIMBU,
2160 EVAS_SCRIPT_LIMBU, EVAS_SCRIPT_LIMBU, EVAS_SCRIPT_LIMBU,
2161 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2162 EVAS_SCRIPT_LIMBU, EVAS_SCRIPT_LIMBU, EVAS_SCRIPT_LIMBU,
2163 EVAS_SCRIPT_LIMBU, EVAS_SCRIPT_LIMBU, EVAS_SCRIPT_LIMBU,
2164 EVAS_SCRIPT_LIMBU, EVAS_SCRIPT_LIMBU, EVAS_SCRIPT_LIMBU,
2165 EVAS_SCRIPT_LIMBU, EVAS_SCRIPT_LIMBU, EVAS_SCRIPT_LIMBU,
2166 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2167 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_LIMBU, EVAS_SCRIPT_LIMBU,
2168 EVAS_SCRIPT_LIMBU, EVAS_SCRIPT_LIMBU, EVAS_SCRIPT_LIMBU,
2169 EVAS_SCRIPT_LIMBU, EVAS_SCRIPT_LIMBU, EVAS_SCRIPT_LIMBU,
2170 EVAS_SCRIPT_LIMBU, EVAS_SCRIPT_LIMBU, EVAS_SCRIPT_LIMBU,
2171 EVAS_SCRIPT_LIMBU, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2172 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_LIMBU,
2173 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2174 EVAS_SCRIPT_LIMBU, EVAS_SCRIPT_LIMBU, EVAS_SCRIPT_LIMBU,
2175 EVAS_SCRIPT_LIMBU, EVAS_SCRIPT_LIMBU, EVAS_SCRIPT_LIMBU,
2176 EVAS_SCRIPT_LIMBU, EVAS_SCRIPT_LIMBU, EVAS_SCRIPT_LIMBU,
2177 EVAS_SCRIPT_LIMBU, EVAS_SCRIPT_LIMBU, EVAS_SCRIPT_LIMBU,
2178 EVAS_SCRIPT_TAI_LE, EVAS_SCRIPT_TAI_LE, EVAS_SCRIPT_TAI_LE,
2179 EVAS_SCRIPT_TAI_LE, EVAS_SCRIPT_TAI_LE, EVAS_SCRIPT_TAI_LE,
2180 EVAS_SCRIPT_TAI_LE, EVAS_SCRIPT_TAI_LE, EVAS_SCRIPT_TAI_LE,
2181 EVAS_SCRIPT_TAI_LE, EVAS_SCRIPT_TAI_LE, EVAS_SCRIPT_TAI_LE,
2182 EVAS_SCRIPT_TAI_LE, EVAS_SCRIPT_TAI_LE, EVAS_SCRIPT_TAI_LE,
2183 EVAS_SCRIPT_TAI_LE, EVAS_SCRIPT_TAI_LE, EVAS_SCRIPT_TAI_LE,
2184 EVAS_SCRIPT_TAI_LE, EVAS_SCRIPT_TAI_LE, EVAS_SCRIPT_TAI_LE,
2185 EVAS_SCRIPT_TAI_LE, EVAS_SCRIPT_TAI_LE, EVAS_SCRIPT_TAI_LE,
2186 EVAS_SCRIPT_TAI_LE, EVAS_SCRIPT_TAI_LE, EVAS_SCRIPT_TAI_LE,
2187 EVAS_SCRIPT_TAI_LE, EVAS_SCRIPT_TAI_LE, EVAS_SCRIPT_TAI_LE,
2188 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_TAI_LE,
2189 EVAS_SCRIPT_TAI_LE, EVAS_SCRIPT_TAI_LE, EVAS_SCRIPT_TAI_LE,
2190 EVAS_SCRIPT_TAI_LE, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2191 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2192 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2193 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2194 EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_NEW_TAI_LUE,
2195 EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_NEW_TAI_LUE,
2196 EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_NEW_TAI_LUE,
2197 EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_NEW_TAI_LUE,
2198 EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_NEW_TAI_LUE,
2199 EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_NEW_TAI_LUE,
2200 EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_NEW_TAI_LUE,
2201 EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_NEW_TAI_LUE,
2202 EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_NEW_TAI_LUE,
2203 EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_NEW_TAI_LUE,
2204 EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_NEW_TAI_LUE,
2205 EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_NEW_TAI_LUE,
2206 EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_NEW_TAI_LUE,
2207 EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_NEW_TAI_LUE,
2208 EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_UNKNOWN,
2209 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2210 EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_NEW_TAI_LUE,
2211 EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_NEW_TAI_LUE,
2212 EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_NEW_TAI_LUE,
2213 EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_NEW_TAI_LUE,
2214 EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_NEW_TAI_LUE,
2215 EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_NEW_TAI_LUE,
2216 EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_NEW_TAI_LUE,
2217 EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_NEW_TAI_LUE,
2218 EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_UNKNOWN,
2219 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2220 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_NEW_TAI_LUE,
2221 EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_NEW_TAI_LUE,
2222 EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_NEW_TAI_LUE,
2223 EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_NEW_TAI_LUE,
2224 EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2225 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_NEW_TAI_LUE, EVAS_SCRIPT_NEW_TAI_LUE,
2226 EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER,
2227 EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER,
2228 EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER,
2229 EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER,
2230 EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER,
2231 EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER,
2232 EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER,
2233 EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER,
2234 EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER,
2235 EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER,
2236 EVAS_SCRIPT_KHMER, EVAS_SCRIPT_KHMER, EVAS_SCRIPT_BUGINESE,
2237 EVAS_SCRIPT_BUGINESE, EVAS_SCRIPT_BUGINESE, EVAS_SCRIPT_BUGINESE,
2238 EVAS_SCRIPT_BUGINESE, EVAS_SCRIPT_BUGINESE, EVAS_SCRIPT_BUGINESE,
2239 EVAS_SCRIPT_BUGINESE, EVAS_SCRIPT_BUGINESE, EVAS_SCRIPT_BUGINESE,
2240 EVAS_SCRIPT_BUGINESE, EVAS_SCRIPT_BUGINESE, EVAS_SCRIPT_BUGINESE,
2241 EVAS_SCRIPT_BUGINESE, EVAS_SCRIPT_BUGINESE, EVAS_SCRIPT_BUGINESE,
2242 EVAS_SCRIPT_BUGINESE, EVAS_SCRIPT_BUGINESE, EVAS_SCRIPT_BUGINESE,
2243 EVAS_SCRIPT_BUGINESE, EVAS_SCRIPT_BUGINESE, EVAS_SCRIPT_BUGINESE,
2244 EVAS_SCRIPT_BUGINESE, EVAS_SCRIPT_BUGINESE, EVAS_SCRIPT_BUGINESE,
2245 EVAS_SCRIPT_BUGINESE, EVAS_SCRIPT_BUGINESE, EVAS_SCRIPT_BUGINESE,
2246 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_BUGINESE,
2247 EVAS_SCRIPT_BUGINESE, EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM,
2248 EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM,
2249 EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM,
2250 EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM,
2251 EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM,
2252 EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM,
2253 EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM,
2254 EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM,
2255 EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM,
2256 EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM,
2257 EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM,
2258 EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM,
2259 EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM,
2260 EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM,
2261 EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM,
2262 EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM,
2263 EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM,
2264 EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM,
2265 EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM,
2266 EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM,
2267 EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM,
2268 EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_TAI_THAM,
2269 EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM,
2270 EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM,
2271 EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM,
2272 EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM,
2273 EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM,
2274 EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM,
2275 EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM,
2276 EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM,
2277 EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM,
2278 EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2279 EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM,
2280 EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM,
2281 EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM,
2282 EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_UNKNOWN,
2283 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2284 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_TAI_THAM,
2285 EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM,
2286 EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM,
2287 EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM,
2288 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2289 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2290 EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM,
2291 EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM,
2292 EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM,
2293 EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM,
2294 EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_TAI_THAM, EVAS_SCRIPT_UNKNOWN,
2295 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2296 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2297 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2298 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2299 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2300 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2301 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2302 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2303 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2304 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2305 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2306 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2307 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2308 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2309 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2310 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2311 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2312 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2313 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2314 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2315 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2316 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2317 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2318 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2319 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2320 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2321 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2322 EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE,
2323 EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE,
2324 EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE,
2325 EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE,
2326 EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE,
2327 EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE,
2328 EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE,
2329 EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE,
2330 EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE,
2331 EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE,
2332 EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE,
2333 EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE,
2334 EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE,
2335 EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE,
2336 EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE,
2337 EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE,
2338 EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE,
2339 EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE,
2340 EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE,
2341 EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE,
2342 EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE,
2343 EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE,
2344 EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE,
2345 EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE,
2346 EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE,
2347 EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2348 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_BALINESE,
2349 EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE,
2350 EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE,
2351 EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE,
2352 EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE,
2353 EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE,
2354 EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE,
2355 EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE,
2356 EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE,
2357 EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE,
2358 EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE,
2359 EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE,
2360 EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE,
2361 EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE,
2362 EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE,
2363 EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_BALINESE, EVAS_SCRIPT_UNKNOWN,
2364 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_SUNDANESE,
2365 EVAS_SCRIPT_SUNDANESE, EVAS_SCRIPT_SUNDANESE, EVAS_SCRIPT_SUNDANESE,
2366 EVAS_SCRIPT_SUNDANESE, EVAS_SCRIPT_SUNDANESE, EVAS_SCRIPT_SUNDANESE,
2367 EVAS_SCRIPT_SUNDANESE, EVAS_SCRIPT_SUNDANESE, EVAS_SCRIPT_SUNDANESE,
2368 EVAS_SCRIPT_SUNDANESE, EVAS_SCRIPT_SUNDANESE, EVAS_SCRIPT_SUNDANESE,
2369 EVAS_SCRIPT_SUNDANESE, EVAS_SCRIPT_SUNDANESE, EVAS_SCRIPT_SUNDANESE,
2370 EVAS_SCRIPT_SUNDANESE, EVAS_SCRIPT_SUNDANESE, EVAS_SCRIPT_SUNDANESE,
2371 EVAS_SCRIPT_SUNDANESE, EVAS_SCRIPT_SUNDANESE, EVAS_SCRIPT_SUNDANESE,
2372 EVAS_SCRIPT_SUNDANESE, EVAS_SCRIPT_SUNDANESE, EVAS_SCRIPT_SUNDANESE,
2373 EVAS_SCRIPT_SUNDANESE, EVAS_SCRIPT_SUNDANESE, EVAS_SCRIPT_SUNDANESE,
2374 EVAS_SCRIPT_SUNDANESE, EVAS_SCRIPT_SUNDANESE, EVAS_SCRIPT_SUNDANESE,
2375 EVAS_SCRIPT_SUNDANESE, EVAS_SCRIPT_SUNDANESE, EVAS_SCRIPT_SUNDANESE,
2376 EVAS_SCRIPT_SUNDANESE, EVAS_SCRIPT_SUNDANESE, EVAS_SCRIPT_SUNDANESE,
2377 EVAS_SCRIPT_SUNDANESE, EVAS_SCRIPT_SUNDANESE, EVAS_SCRIPT_SUNDANESE,
2378 EVAS_SCRIPT_SUNDANESE, EVAS_SCRIPT_SUNDANESE, EVAS_SCRIPT_SUNDANESE,
2379 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2380 EVAS_SCRIPT_SUNDANESE, EVAS_SCRIPT_SUNDANESE, EVAS_SCRIPT_SUNDANESE,
2381 EVAS_SCRIPT_SUNDANESE, EVAS_SCRIPT_SUNDANESE, EVAS_SCRIPT_SUNDANESE,
2382 EVAS_SCRIPT_SUNDANESE, EVAS_SCRIPT_SUNDANESE, EVAS_SCRIPT_SUNDANESE,
2383 EVAS_SCRIPT_SUNDANESE, EVAS_SCRIPT_SUNDANESE, EVAS_SCRIPT_SUNDANESE,
2384 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2385 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2386 EVAS_SCRIPT_BATAK, EVAS_SCRIPT_BATAK, EVAS_SCRIPT_BATAK,
2387 EVAS_SCRIPT_BATAK, EVAS_SCRIPT_BATAK, EVAS_SCRIPT_BATAK,
2388 EVAS_SCRIPT_BATAK, EVAS_SCRIPT_BATAK, EVAS_SCRIPT_BATAK,
2389 EVAS_SCRIPT_BATAK, EVAS_SCRIPT_BATAK, EVAS_SCRIPT_BATAK,
2390 EVAS_SCRIPT_BATAK, EVAS_SCRIPT_BATAK, EVAS_SCRIPT_BATAK,
2391 EVAS_SCRIPT_BATAK, EVAS_SCRIPT_BATAK, EVAS_SCRIPT_BATAK,
2392 EVAS_SCRIPT_BATAK, EVAS_SCRIPT_BATAK, EVAS_SCRIPT_BATAK,
2393 EVAS_SCRIPT_BATAK, EVAS_SCRIPT_BATAK, EVAS_SCRIPT_BATAK,
2394 EVAS_SCRIPT_BATAK, EVAS_SCRIPT_BATAK, EVAS_SCRIPT_BATAK,
2395 EVAS_SCRIPT_BATAK, EVAS_SCRIPT_BATAK, EVAS_SCRIPT_BATAK,
2396 EVAS_SCRIPT_BATAK, EVAS_SCRIPT_BATAK, EVAS_SCRIPT_BATAK,
2397 EVAS_SCRIPT_BATAK, EVAS_SCRIPT_BATAK, EVAS_SCRIPT_BATAK,
2398 EVAS_SCRIPT_BATAK, EVAS_SCRIPT_BATAK, EVAS_SCRIPT_BATAK,
2399 EVAS_SCRIPT_BATAK, EVAS_SCRIPT_BATAK, EVAS_SCRIPT_BATAK,
2400 EVAS_SCRIPT_BATAK, EVAS_SCRIPT_BATAK, EVAS_SCRIPT_BATAK,
2401 EVAS_SCRIPT_BATAK, EVAS_SCRIPT_BATAK, EVAS_SCRIPT_BATAK,
2402 EVAS_SCRIPT_BATAK, EVAS_SCRIPT_BATAK, EVAS_SCRIPT_BATAK,
2403 EVAS_SCRIPT_BATAK, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2404 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2405 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2406 EVAS_SCRIPT_BATAK, EVAS_SCRIPT_BATAK, EVAS_SCRIPT_BATAK,
2407 EVAS_SCRIPT_BATAK, EVAS_SCRIPT_LEPCHA, EVAS_SCRIPT_LEPCHA,
2408 EVAS_SCRIPT_LEPCHA, EVAS_SCRIPT_LEPCHA, EVAS_SCRIPT_LEPCHA,
2409 EVAS_SCRIPT_LEPCHA, EVAS_SCRIPT_LEPCHA, EVAS_SCRIPT_LEPCHA,
2410 EVAS_SCRIPT_LEPCHA, EVAS_SCRIPT_LEPCHA, EVAS_SCRIPT_LEPCHA,
2411 EVAS_SCRIPT_LEPCHA, EVAS_SCRIPT_LEPCHA, EVAS_SCRIPT_LEPCHA,
2412 EVAS_SCRIPT_LEPCHA, EVAS_SCRIPT_LEPCHA, EVAS_SCRIPT_LEPCHA,
2413 EVAS_SCRIPT_LEPCHA, EVAS_SCRIPT_LEPCHA, EVAS_SCRIPT_LEPCHA,
2414 EVAS_SCRIPT_LEPCHA, EVAS_SCRIPT_LEPCHA, EVAS_SCRIPT_LEPCHA,
2415 EVAS_SCRIPT_LEPCHA, EVAS_SCRIPT_LEPCHA, EVAS_SCRIPT_LEPCHA,
2416 EVAS_SCRIPT_LEPCHA, EVAS_SCRIPT_LEPCHA, EVAS_SCRIPT_LEPCHA,
2417 EVAS_SCRIPT_LEPCHA, EVAS_SCRIPT_LEPCHA, EVAS_SCRIPT_LEPCHA,
2418 EVAS_SCRIPT_LEPCHA, EVAS_SCRIPT_LEPCHA, EVAS_SCRIPT_LEPCHA,
2419 EVAS_SCRIPT_LEPCHA, EVAS_SCRIPT_LEPCHA, EVAS_SCRIPT_LEPCHA,
2420 EVAS_SCRIPT_LEPCHA, EVAS_SCRIPT_LEPCHA, EVAS_SCRIPT_LEPCHA,
2421 EVAS_SCRIPT_LEPCHA, EVAS_SCRIPT_LEPCHA, EVAS_SCRIPT_LEPCHA,
2422 EVAS_SCRIPT_LEPCHA, EVAS_SCRIPT_LEPCHA, EVAS_SCRIPT_LEPCHA,
2423 EVAS_SCRIPT_LEPCHA, EVAS_SCRIPT_LEPCHA, EVAS_SCRIPT_LEPCHA,
2424 EVAS_SCRIPT_LEPCHA, EVAS_SCRIPT_LEPCHA, EVAS_SCRIPT_LEPCHA,
2425 EVAS_SCRIPT_LEPCHA, EVAS_SCRIPT_LEPCHA, EVAS_SCRIPT_LEPCHA,
2426 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2427 EVAS_SCRIPT_LEPCHA, EVAS_SCRIPT_LEPCHA, EVAS_SCRIPT_LEPCHA,
2428 EVAS_SCRIPT_LEPCHA, EVAS_SCRIPT_LEPCHA, EVAS_SCRIPT_LEPCHA,
2429 EVAS_SCRIPT_LEPCHA, EVAS_SCRIPT_LEPCHA, EVAS_SCRIPT_LEPCHA,
2430 EVAS_SCRIPT_LEPCHA, EVAS_SCRIPT_LEPCHA, EVAS_SCRIPT_LEPCHA,
2431 EVAS_SCRIPT_LEPCHA, EVAS_SCRIPT_LEPCHA, EVAS_SCRIPT_LEPCHA,
2432 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2433 EVAS_SCRIPT_LEPCHA, EVAS_SCRIPT_LEPCHA, EVAS_SCRIPT_LEPCHA,
2434 EVAS_SCRIPT_OL_CHIKI, EVAS_SCRIPT_OL_CHIKI, EVAS_SCRIPT_OL_CHIKI,
2435 EVAS_SCRIPT_OL_CHIKI, EVAS_SCRIPT_OL_CHIKI, EVAS_SCRIPT_OL_CHIKI,
2436 EVAS_SCRIPT_OL_CHIKI, EVAS_SCRIPT_OL_CHIKI, EVAS_SCRIPT_OL_CHIKI,
2437 EVAS_SCRIPT_OL_CHIKI, EVAS_SCRIPT_OL_CHIKI, EVAS_SCRIPT_OL_CHIKI,
2438 EVAS_SCRIPT_OL_CHIKI, EVAS_SCRIPT_OL_CHIKI, EVAS_SCRIPT_OL_CHIKI,
2439 EVAS_SCRIPT_OL_CHIKI, EVAS_SCRIPT_OL_CHIKI, EVAS_SCRIPT_OL_CHIKI,
2440 EVAS_SCRIPT_OL_CHIKI, EVAS_SCRIPT_OL_CHIKI, EVAS_SCRIPT_OL_CHIKI,
2441 EVAS_SCRIPT_OL_CHIKI, EVAS_SCRIPT_OL_CHIKI, EVAS_SCRIPT_OL_CHIKI,
2442 EVAS_SCRIPT_OL_CHIKI, EVAS_SCRIPT_OL_CHIKI, EVAS_SCRIPT_OL_CHIKI,
2443 EVAS_SCRIPT_OL_CHIKI, EVAS_SCRIPT_OL_CHIKI, EVAS_SCRIPT_OL_CHIKI,
2444 EVAS_SCRIPT_OL_CHIKI, EVAS_SCRIPT_OL_CHIKI, EVAS_SCRIPT_OL_CHIKI,
2445 EVAS_SCRIPT_OL_CHIKI, EVAS_SCRIPT_OL_CHIKI, EVAS_SCRIPT_OL_CHIKI,
2446 EVAS_SCRIPT_OL_CHIKI, EVAS_SCRIPT_OL_CHIKI, EVAS_SCRIPT_OL_CHIKI,
2447 EVAS_SCRIPT_OL_CHIKI, EVAS_SCRIPT_OL_CHIKI, EVAS_SCRIPT_OL_CHIKI,
2448 EVAS_SCRIPT_OL_CHIKI, EVAS_SCRIPT_OL_CHIKI, EVAS_SCRIPT_OL_CHIKI,
2449 EVAS_SCRIPT_OL_CHIKI, EVAS_SCRIPT_OL_CHIKI, EVAS_SCRIPT_OL_CHIKI,
2450 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2451 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2452 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2453 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2454 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2455 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2456 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2457 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2458 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2459 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2460 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2461 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2462 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2463 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2464 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2465 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2466 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2467 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2468 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2469 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2470 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2471 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2472 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2473 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2474 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2475 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2476 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_INHERITED,
2477 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_COMMON,
2478 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
2479 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
2480 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
2481 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
2482 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_INHERITED,
2483 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
2484 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
2485 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
2486 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_COMMON,
2487 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON,
2488 EVAS_SCRIPT_COMMON, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2489 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2490 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2491 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2492 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_LATIN,
2493 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2494 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2495 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2496 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2497 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2498 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2499 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2500 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2501 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2502 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2503 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2504 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2505 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2506 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2507 EVAS_SCRIPT_CYRILLIC, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2508 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2509 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2510 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2511 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2512 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2513 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2514 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2515 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2516 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2517 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2518 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2519 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2520 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2521 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2522 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2523 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_GREEK,
2524 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2525 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2526 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_GREEK,
2527 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2528 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2529 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2530 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2531 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2532 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_CYRILLIC,
2533 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2534 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2535 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2536 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2537 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2538 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2539 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2540 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2541 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2542 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2543 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2544 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2545 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2546 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2547 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2548 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2549 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2550 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2551 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2552 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2553 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2554 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2555 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2556 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_INHERITED,
2557 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
2558 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
2559 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
2560 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
2561 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
2562 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
2563 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
2564 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
2565 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
2566 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
2567 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
2568 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
2569 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_UNKNOWN,
2570 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2571 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2572 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2573 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2574 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2575 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2576 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_INHERITED,
2577 EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED, EVAS_SCRIPT_INHERITED,
2578 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2579 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2580 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2581 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2582 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2583 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2584 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2585 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2586 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2587 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2588 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2589 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2590 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2591 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2592 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2593 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2594 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2595 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2596 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2597 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2598 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2599 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2600 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2601 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2602 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2603 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2604 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2605 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2606 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2607 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2608 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2609 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2610 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2611 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2612 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2613 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2614 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2615 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2616 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2617 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2618 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2619 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2620 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2621 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2622 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2623 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2624 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2625 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2626 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2627 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2628 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2629 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2630 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2631 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2632 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2633 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2634 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2635 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2636 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2637 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2638 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2639 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2640 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2641 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2642 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2643 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2644 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2645 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2646 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2647 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2648 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2649 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2650 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2651 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2652 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2653 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2654 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2655 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2656 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2657 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2658 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2659 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2660 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2661 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2662 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN, EVAS_SCRIPT_LATIN,
2663 EVAS_SCRIPT_LATIN, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2664 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2665 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2666 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2667 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2668 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2669 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2670 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_UNKNOWN,
2671 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2672 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2673 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2674 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2675 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2676 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2677 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2678 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2679 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2680 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2681 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2682 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2683 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2684 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2685 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2686 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_UNKNOWN,
2687 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2688 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2689 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2690 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2691 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2692 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_UNKNOWN,
2693 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_GREEK,
2694 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_UNKNOWN,
2695 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2696 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2697 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2698 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2699 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2700 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2701 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2702 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2703 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2704 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2705 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2706 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2707 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2708 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2709 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2710 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2711 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2712 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2713 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2714 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2715 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2716 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2717 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2718 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2719 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2720 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2721 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2722 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2723 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_UNKNOWN,
2724 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2725 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2726 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2727 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2728 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2729 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2730 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2731 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2732 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2733 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2734 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_GREEK,
2735 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2736 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_UNKNOWN,
2737 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2738 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2739 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2740 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2741 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2742 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2743 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_UNKNOWN,
2744 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2745 EVAS_SCRIPT_UNKNOWN, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2746 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2747 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK, EVAS_SCRIPT_GREEK,
2748 EVAS_SCRIPT_GREEK, EVAS_SCRIPT_UNKNOWN,
2749};
2750
2751static const struct {
2752 Eina_Unicode start;
2753 short len;
2754 Evas_Script_Type script;
2755} _evas_script_slow_table[] = {
2756 { 0x2000, 12, EVAS_SCRIPT_COMMON },
2757 { 0x200c, 2, EVAS_SCRIPT_INHERITED },
2758 { 0x200e, 87, EVAS_SCRIPT_COMMON },
2759 { 0x206a, 7, EVAS_SCRIPT_COMMON },
2760 { 0x2071, 1, EVAS_SCRIPT_LATIN },
2761 { 0x2074, 11, EVAS_SCRIPT_COMMON },
2762 { 0x207f, 1, EVAS_SCRIPT_LATIN },
2763 { 0x2080, 15, EVAS_SCRIPT_COMMON },
2764 { 0x2090, 13, EVAS_SCRIPT_LATIN },
2765 { 0x20a0, 26, EVAS_SCRIPT_COMMON },
2766 { 0x20d0, 33, EVAS_SCRIPT_INHERITED },
2767 { 0x2100, 38, EVAS_SCRIPT_COMMON },
2768 { 0x2126, 1, EVAS_SCRIPT_GREEK },
2769 { 0x2127, 3, EVAS_SCRIPT_COMMON },
2770 { 0x212a, 2, EVAS_SCRIPT_LATIN },
2771 { 0x212c, 6, EVAS_SCRIPT_COMMON },
2772 { 0x2132, 1, EVAS_SCRIPT_LATIN },
2773 { 0x2133, 27, EVAS_SCRIPT_COMMON },
2774 { 0x214e, 1, EVAS_SCRIPT_LATIN },
2775 { 0x214f, 17, EVAS_SCRIPT_COMMON },
2776 { 0x2160, 41, EVAS_SCRIPT_LATIN },
2777 { 0x2189, 1, EVAS_SCRIPT_COMMON },
2778 { 0x2190, 612, EVAS_SCRIPT_COMMON },
2779 { 0x2400, 39, EVAS_SCRIPT_COMMON },
2780 { 0x2440, 11, EVAS_SCRIPT_COMMON },
2781 { 0x2460, 672, EVAS_SCRIPT_COMMON },
2782 { 0x2701, 202, EVAS_SCRIPT_COMMON },
2783 { 0x27cc, 1, EVAS_SCRIPT_COMMON },
2784 { 0x27ce, 50, EVAS_SCRIPT_COMMON },
2785 { 0x2800, 256, EVAS_SCRIPT_BRAILLE },
2786 { 0x2900, 589, EVAS_SCRIPT_COMMON },
2787 { 0x2b50, 10, EVAS_SCRIPT_COMMON },
2788 { 0x2c00, 47, EVAS_SCRIPT_GLAGOLITIC },
2789 { 0x2c30, 47, EVAS_SCRIPT_GLAGOLITIC },
2790 { 0x2c60, 32, EVAS_SCRIPT_LATIN },
2791 { 0x2c80, 114, EVAS_SCRIPT_COPTIC },
2792 { 0x2cf9, 7, EVAS_SCRIPT_COPTIC },
2793 { 0x2d00, 38, EVAS_SCRIPT_GEORGIAN },
2794 { 0x2d30, 54, EVAS_SCRIPT_TIFINAGH },
2795 { 0x2d6f, 2, EVAS_SCRIPT_TIFINAGH },
2796 { 0x2d7f, 1, EVAS_SCRIPT_TIFINAGH },
2797 { 0x2d80, 23, EVAS_SCRIPT_ETHIOPIC },
2798 { 0x2da0, 7, EVAS_SCRIPT_ETHIOPIC },
2799 { 0x2da8, 7, EVAS_SCRIPT_ETHIOPIC },
2800 { 0x2db0, 7, EVAS_SCRIPT_ETHIOPIC },
2801 { 0x2db8, 7, EVAS_SCRIPT_ETHIOPIC },
2802 { 0x2dc0, 7, EVAS_SCRIPT_ETHIOPIC },
2803 { 0x2dc8, 7, EVAS_SCRIPT_ETHIOPIC },
2804 { 0x2dd0, 7, EVAS_SCRIPT_ETHIOPIC },
2805 { 0x2dd8, 7, EVAS_SCRIPT_ETHIOPIC },
2806 { 0x2de0, 32, EVAS_SCRIPT_CYRILLIC },
2807 { 0x2e00, 50, EVAS_SCRIPT_COMMON },
2808 { 0x2e80, 26, EVAS_SCRIPT_HAN },
2809 { 0x2e9b, 89, EVAS_SCRIPT_HAN },
2810 { 0x2f00, 214, EVAS_SCRIPT_HAN },
2811 { 0x2ff0, 12, EVAS_SCRIPT_COMMON },
2812 { 0x3000, 5, EVAS_SCRIPT_COMMON },
2813 { 0x3005, 1, EVAS_SCRIPT_HAN },
2814 { 0x3006, 1, EVAS_SCRIPT_COMMON },
2815 { 0x3007, 1, EVAS_SCRIPT_HAN },
2816 { 0x3008, 25, EVAS_SCRIPT_COMMON },
2817 { 0x3021, 9, EVAS_SCRIPT_HAN },
2818 { 0x302a, 4, EVAS_SCRIPT_INHERITED },
2819 { 0x302e, 2, EVAS_SCRIPT_HANGUL },
2820 { 0x3030, 8, EVAS_SCRIPT_COMMON },
2821 { 0x3038, 4, EVAS_SCRIPT_HAN },
2822 { 0x303c, 4, EVAS_SCRIPT_COMMON },
2823 { 0x3041, 86, EVAS_SCRIPT_HIRAGANA },
2824 { 0x3099, 2, EVAS_SCRIPT_INHERITED },
2825 { 0x309b, 2, EVAS_SCRIPT_COMMON },
2826 { 0x309d, 3, EVAS_SCRIPT_HIRAGANA },
2827 { 0x30a0, 1, EVAS_SCRIPT_COMMON },
2828 { 0x30a1, 90, EVAS_SCRIPT_KATAKANA },
2829 { 0x30fb, 2, EVAS_SCRIPT_COMMON },
2830 { 0x30fd, 3, EVAS_SCRIPT_KATAKANA },
2831 { 0x3105, 41, EVAS_SCRIPT_BOPOMOFO },
2832 { 0x3131, 94, EVAS_SCRIPT_HANGUL },
2833 { 0x3190, 16, EVAS_SCRIPT_COMMON },
2834 { 0x31a0, 27, EVAS_SCRIPT_BOPOMOFO },
2835 { 0x31c0, 36, EVAS_SCRIPT_COMMON },
2836 { 0x31f0, 16, EVAS_SCRIPT_KATAKANA },
2837 { 0x3200, 31, EVAS_SCRIPT_HANGUL },
2838 { 0x3220, 64, EVAS_SCRIPT_COMMON },
2839 { 0x3260, 31, EVAS_SCRIPT_HANGUL },
2840 { 0x327f, 81, EVAS_SCRIPT_COMMON },
2841 { 0x32d0, 47, EVAS_SCRIPT_KATAKANA },
2842 { 0x3300, 88, EVAS_SCRIPT_KATAKANA },
2843 { 0x3358, 168, EVAS_SCRIPT_COMMON },
2844 { 0x3400, 6582, EVAS_SCRIPT_HAN },
2845 { 0x4dc0, 64, EVAS_SCRIPT_COMMON },
2846 { 0x4e00, 20940, EVAS_SCRIPT_HAN },
2847 { 0xa000, 1165, EVAS_SCRIPT_YI },
2848 { 0xa490, 55, EVAS_SCRIPT_YI },
2849 { 0xa4d0, 48, EVAS_SCRIPT_LISU },
2850 { 0xa500, 300, EVAS_SCRIPT_VAI },
2851 { 0xa640, 52, EVAS_SCRIPT_CYRILLIC },
2852 { 0xa67c, 28, EVAS_SCRIPT_CYRILLIC },
2853 { 0xa6a0, 88, EVAS_SCRIPT_BAMUM },
2854 { 0xa700, 34, EVAS_SCRIPT_COMMON },
2855 { 0xa722, 102, EVAS_SCRIPT_LATIN },
2856 { 0xa788, 3, EVAS_SCRIPT_COMMON },
2857 { 0xa78b, 4, EVAS_SCRIPT_LATIN },
2858 { 0xa790, 2, EVAS_SCRIPT_LATIN },
2859 { 0xa7a0, 10, EVAS_SCRIPT_LATIN },
2860 { 0xa7fa, 6, EVAS_SCRIPT_LATIN },
2861 { 0xa800, 44, EVAS_SCRIPT_SYLOTI_NAGRI },
2862 { 0xa830, 10, EVAS_SCRIPT_COMMON },
2863 { 0xa840, 56, EVAS_SCRIPT_PHAGS_PA },
2864 { 0xa880, 69, EVAS_SCRIPT_SAURASHTRA },
2865 { 0xa8ce, 12, EVAS_SCRIPT_SAURASHTRA },
2866 { 0xa8e0, 28, EVAS_SCRIPT_DEVANAGARI },
2867 { 0xa900, 48, EVAS_SCRIPT_KAYAH_LI },
2868 { 0xa930, 36, EVAS_SCRIPT_REJANG },
2869 { 0xa95f, 1, EVAS_SCRIPT_REJANG },
2870 { 0xa960, 29, EVAS_SCRIPT_HANGUL },
2871 { 0xa980, 78, EVAS_SCRIPT_JAVANESE },
2872 { 0xa9cf, 11, EVAS_SCRIPT_JAVANESE },
2873 { 0xa9de, 2, EVAS_SCRIPT_JAVANESE },
2874 { 0xaa00, 55, EVAS_SCRIPT_CHAM },
2875 { 0xaa40, 14, EVAS_SCRIPT_CHAM },
2876 { 0xaa50, 10, EVAS_SCRIPT_CHAM },
2877 { 0xaa5c, 4, EVAS_SCRIPT_CHAM },
2878 { 0xaa60, 28, EVAS_SCRIPT_MYANMAR },
2879 { 0xaa80, 67, EVAS_SCRIPT_TAI_VIET },
2880 { 0xaadb, 5, EVAS_SCRIPT_TAI_VIET },
2881 { 0xab01, 6, EVAS_SCRIPT_ETHIOPIC },
2882 { 0xab09, 6, EVAS_SCRIPT_ETHIOPIC },
2883 { 0xab11, 6, EVAS_SCRIPT_ETHIOPIC },
2884 { 0xab20, 7, EVAS_SCRIPT_ETHIOPIC },
2885 { 0xab28, 7, EVAS_SCRIPT_ETHIOPIC },
2886 { 0xabc0, 46, EVAS_SCRIPT_MEETEI_MAYEK },
2887 { 0xabf0, 10, EVAS_SCRIPT_MEETEI_MAYEK },
2888 { 0xac00, 11172, EVAS_SCRIPT_HANGUL },
2889 { 0xd7b0, 23, EVAS_SCRIPT_HANGUL },
2890 { 0xd7cb, 49, EVAS_SCRIPT_HANGUL },
2891 { 0xf900, 302, EVAS_SCRIPT_HAN },
2892 { 0xfa30, 62, EVAS_SCRIPT_HAN },
2893 { 0xfa70, 106, EVAS_SCRIPT_HAN },
2894 { 0xfb00, 7, EVAS_SCRIPT_LATIN },
2895 { 0xfb13, 5, EVAS_SCRIPT_ARMENIAN },
2896 { 0xfb1d, 26, EVAS_SCRIPT_HEBREW },
2897 { 0xfb38, 5, EVAS_SCRIPT_HEBREW },
2898 { 0xfb3e, 1, EVAS_SCRIPT_HEBREW },
2899 { 0xfb40, 2, EVAS_SCRIPT_HEBREW },
2900 { 0xfb43, 2, EVAS_SCRIPT_HEBREW },
2901 { 0xfb46, 10, EVAS_SCRIPT_HEBREW },
2902 { 0xfb50, 114, EVAS_SCRIPT_ARABIC },
2903 { 0xfbd3, 363, EVAS_SCRIPT_ARABIC },
2904 { 0xfd3e, 2, EVAS_SCRIPT_COMMON },
2905 { 0xfd50, 64, EVAS_SCRIPT_ARABIC },
2906 { 0xfd92, 54, EVAS_SCRIPT_ARABIC },
2907 { 0xfdf0, 13, EVAS_SCRIPT_ARABIC },
2908 { 0xfdfd, 1, EVAS_SCRIPT_COMMON },
2909 { 0xfe00, 16, EVAS_SCRIPT_INHERITED },
2910 { 0xfe10, 10, EVAS_SCRIPT_COMMON },
2911 { 0xfe20, 7, EVAS_SCRIPT_INHERITED },
2912 { 0xfe30, 35, EVAS_SCRIPT_COMMON },
2913 { 0xfe54, 19, EVAS_SCRIPT_COMMON },
2914 { 0xfe68, 4, EVAS_SCRIPT_COMMON },
2915 { 0xfe70, 5, EVAS_SCRIPT_ARABIC },
2916 { 0xfe76, 135, EVAS_SCRIPT_ARABIC },
2917 { 0xfeff, 1, EVAS_SCRIPT_COMMON },
2918 { 0xff01, 32, EVAS_SCRIPT_COMMON },
2919 { 0xff21, 26, EVAS_SCRIPT_LATIN },
2920 { 0xff3b, 6, EVAS_SCRIPT_COMMON },
2921 { 0xff41, 26, EVAS_SCRIPT_LATIN },
2922 { 0xff5b, 11, EVAS_SCRIPT_COMMON },
2923 { 0xff66, 10, EVAS_SCRIPT_KATAKANA },
2924 { 0xff70, 1, EVAS_SCRIPT_COMMON },
2925 { 0xff71, 45, EVAS_SCRIPT_KATAKANA },
2926 { 0xff9e, 2, EVAS_SCRIPT_COMMON },
2927 { 0xffa0, 31, EVAS_SCRIPT_HANGUL },
2928 { 0xffc2, 6, EVAS_SCRIPT_HANGUL },
2929 { 0xffca, 6, EVAS_SCRIPT_HANGUL },
2930 { 0xffd2, 6, EVAS_SCRIPT_HANGUL },
2931 { 0xffda, 3, EVAS_SCRIPT_HANGUL },
2932 { 0xffe0, 7, EVAS_SCRIPT_COMMON },
2933 { 0xffe8, 7, EVAS_SCRIPT_COMMON },
2934 { 0xfff9, 5, EVAS_SCRIPT_COMMON },
2935 { 0x10000, 12, EVAS_SCRIPT_LINEAR_B },
2936 { 0x1000d, 26, EVAS_SCRIPT_LINEAR_B },
2937 { 0x10028, 19, EVAS_SCRIPT_LINEAR_B },
2938 { 0x1003c, 2, EVAS_SCRIPT_LINEAR_B },
2939 { 0x1003f, 15, EVAS_SCRIPT_LINEAR_B },
2940 { 0x10050, 14, EVAS_SCRIPT_LINEAR_B },
2941 { 0x10080, 123, EVAS_SCRIPT_LINEAR_B },
2942 { 0x10100, 3, EVAS_SCRIPT_COMMON },
2943 { 0x10107, 45, EVAS_SCRIPT_COMMON },
2944 { 0x10137, 9, EVAS_SCRIPT_COMMON },
2945 { 0x10140, 75, EVAS_SCRIPT_GREEK },
2946 { 0x10190, 12, EVAS_SCRIPT_COMMON },
2947 { 0x101d0, 45, EVAS_SCRIPT_COMMON },
2948 { 0x101fd, 1, EVAS_SCRIPT_INHERITED },
2949 { 0x10280, 29, EVAS_SCRIPT_LYCIAN },
2950 { 0x102a0, 49, EVAS_SCRIPT_CARIAN },
2951 { 0x10300, 31, EVAS_SCRIPT_OLD_ITALIC },
2952 { 0x10320, 4, EVAS_SCRIPT_OLD_ITALIC },
2953 { 0x10330, 27, EVAS_SCRIPT_GOTHIC },
2954 { 0x10380, 30, EVAS_SCRIPT_UGARITIC },
2955 { 0x1039f, 1, EVAS_SCRIPT_UGARITIC },
2956 { 0x103a0, 36, EVAS_SCRIPT_OLD_PERSIAN },
2957 { 0x103c8, 14, EVAS_SCRIPT_OLD_PERSIAN },
2958 { 0x10400, 80, EVAS_SCRIPT_DESERET },
2959 { 0x10450, 48, EVAS_SCRIPT_SHAVIAN },
2960 { 0x10480, 30, EVAS_SCRIPT_OSMANYA },
2961 { 0x104a0, 10, EVAS_SCRIPT_OSMANYA },
2962 { 0x10800, 6, EVAS_SCRIPT_CYPRIOT },
2963 { 0x10808, 1, EVAS_SCRIPT_CYPRIOT },
2964 { 0x1080a, 44, EVAS_SCRIPT_CYPRIOT },
2965 { 0x10837, 2, EVAS_SCRIPT_CYPRIOT },
2966 { 0x1083c, 1, EVAS_SCRIPT_CYPRIOT },
2967 { 0x1083f, 1, EVAS_SCRIPT_CYPRIOT },
2968 { 0x10840, 22, EVAS_SCRIPT_IMPERIAL_ARAMAIC },
2969 { 0x10857, 9, EVAS_SCRIPT_IMPERIAL_ARAMAIC },
2970 { 0x10900, 28, EVAS_SCRIPT_PHOENICIAN },
2971 { 0x1091f, 1, EVAS_SCRIPT_PHOENICIAN },
2972 { 0x10920, 26, EVAS_SCRIPT_LYDIAN },
2973 { 0x1093f, 1, EVAS_SCRIPT_LYDIAN },
2974 { 0x10a00, 4, EVAS_SCRIPT_KHAROSHTHI },
2975 { 0x10a05, 2, EVAS_SCRIPT_KHAROSHTHI },
2976 { 0x10a0c, 8, EVAS_SCRIPT_KHAROSHTHI },
2977 { 0x10a15, 3, EVAS_SCRIPT_KHAROSHTHI },
2978 { 0x10a19, 27, EVAS_SCRIPT_KHAROSHTHI },
2979 { 0x10a38, 3, EVAS_SCRIPT_KHAROSHTHI },
2980 { 0x10a3f, 9, EVAS_SCRIPT_KHAROSHTHI },
2981 { 0x10a50, 9, EVAS_SCRIPT_KHAROSHTHI },
2982 { 0x10a60, 32, EVAS_SCRIPT_OLD_SOUTH_ARABIAN },
2983 { 0x10b00, 54, EVAS_SCRIPT_AVESTAN },
2984 { 0x10b39, 7, EVAS_SCRIPT_AVESTAN },
2985 { 0x10b40, 22, EVAS_SCRIPT_INSCRIPTIONAL_PARTHIAN },
2986 { 0x10b58, 8, EVAS_SCRIPT_INSCRIPTIONAL_PARTHIAN },
2987 { 0x10b60, 19, EVAS_SCRIPT_INSCRIPTIONAL_PAHLAVI },
2988 { 0x10b78, 8, EVAS_SCRIPT_INSCRIPTIONAL_PAHLAVI },
2989 { 0x10c00, 73, EVAS_SCRIPT_OLD_TURKIC },
2990 { 0x10e60, 31, EVAS_SCRIPT_ARABIC },
2991 { 0x11000, 78, EVAS_SCRIPT_BRAHMI },
2992 { 0x11052, 30, EVAS_SCRIPT_BRAHMI },
2993 { 0x11080, 66, EVAS_SCRIPT_KAITHI },
2994 { 0x12000, 879, EVAS_SCRIPT_CUNEIFORM },
2995 { 0x12400, 99, EVAS_SCRIPT_CUNEIFORM },
2996 { 0x12470, 4, EVAS_SCRIPT_CUNEIFORM },
2997 { 0x13000, 1071, EVAS_SCRIPT_EGYPTIAN_HIEROGLYPHS },
2998 { 0x16800, 569, EVAS_SCRIPT_BAMUM },
2999 { 0x1b000, 1, EVAS_SCRIPT_KATAKANA },
3000 { 0x1b001, 1, EVAS_SCRIPT_HIRAGANA },
3001 { 0x1d000, 246, EVAS_SCRIPT_COMMON },
3002 { 0x1d100, 39, EVAS_SCRIPT_COMMON },
3003 { 0x1d129, 62, EVAS_SCRIPT_COMMON },
3004 { 0x1d167, 3, EVAS_SCRIPT_INHERITED },
3005 { 0x1d16a, 17, EVAS_SCRIPT_COMMON },
3006 { 0x1d17b, 8, EVAS_SCRIPT_INHERITED },
3007 { 0x1d183, 2, EVAS_SCRIPT_COMMON },
3008 { 0x1d185, 7, EVAS_SCRIPT_INHERITED },
3009 { 0x1d18c, 30, EVAS_SCRIPT_COMMON },
3010 { 0x1d1aa, 4, EVAS_SCRIPT_INHERITED },
3011 { 0x1d1ae, 48, EVAS_SCRIPT_COMMON },
3012 { 0x1d200, 70, EVAS_SCRIPT_GREEK },
3013 { 0x1d300, 87, EVAS_SCRIPT_COMMON },
3014 { 0x1d360, 18, EVAS_SCRIPT_COMMON },
3015 { 0x1d400, 85, EVAS_SCRIPT_COMMON },
3016 { 0x1d456, 71, EVAS_SCRIPT_COMMON },
3017 { 0x1d49e, 2, EVAS_SCRIPT_COMMON },
3018 { 0x1d4a2, 1, EVAS_SCRIPT_COMMON },
3019 { 0x1d4a5, 2, EVAS_SCRIPT_COMMON },
3020 { 0x1d4a9, 4, EVAS_SCRIPT_COMMON },
3021 { 0x1d4ae, 12, EVAS_SCRIPT_COMMON },
3022 { 0x1d4bb, 1, EVAS_SCRIPT_COMMON },
3023 { 0x1d4bd, 7, EVAS_SCRIPT_COMMON },
3024 { 0x1d4c5, 65, EVAS_SCRIPT_COMMON },
3025 { 0x1d507, 4, EVAS_SCRIPT_COMMON },
3026 { 0x1d50d, 8, EVAS_SCRIPT_COMMON },
3027 { 0x1d516, 7, EVAS_SCRIPT_COMMON },
3028 { 0x1d51e, 28, EVAS_SCRIPT_COMMON },
3029 { 0x1d53b, 4, EVAS_SCRIPT_COMMON },
3030 { 0x1d540, 5, EVAS_SCRIPT_COMMON },
3031 { 0x1d546, 1, EVAS_SCRIPT_COMMON },
3032 { 0x1d54a, 7, EVAS_SCRIPT_COMMON },
3033 { 0x1d552, 340, EVAS_SCRIPT_COMMON },
3034 { 0x1d6a8, 292, EVAS_SCRIPT_COMMON },
3035 { 0x1d7ce, 50, EVAS_SCRIPT_COMMON },
3036 { 0x1f000, 44, EVAS_SCRIPT_COMMON },
3037 { 0x1f030, 100, EVAS_SCRIPT_COMMON },
3038 { 0x1f0a0, 15, EVAS_SCRIPT_COMMON },
3039 { 0x1f0b1, 14, EVAS_SCRIPT_COMMON },
3040 { 0x1f0c1, 15, EVAS_SCRIPT_COMMON },
3041 { 0x1f0d1, 15, EVAS_SCRIPT_COMMON },
3042 { 0x1f100, 11, EVAS_SCRIPT_COMMON },
3043 { 0x1f110, 31, EVAS_SCRIPT_COMMON },
3044 { 0x1f130, 58, EVAS_SCRIPT_COMMON },
3045 { 0x1f170, 43, EVAS_SCRIPT_COMMON },
3046 { 0x1f1e6, 26, EVAS_SCRIPT_COMMON },
3047 { 0x1f200, 1, EVAS_SCRIPT_HIRAGANA },
3048 { 0x1f201, 2, EVAS_SCRIPT_COMMON },
3049 { 0x1f210, 43, EVAS_SCRIPT_COMMON },
3050 { 0x1f240, 9, EVAS_SCRIPT_COMMON },
3051 { 0x1f250, 2, EVAS_SCRIPT_COMMON },
3052 { 0x1f300, 33, EVAS_SCRIPT_COMMON },
3053 { 0x1f330, 6, EVAS_SCRIPT_COMMON },
3054 { 0x1f337, 70, EVAS_SCRIPT_COMMON },
3055 { 0x1f380, 20, EVAS_SCRIPT_COMMON },
3056 { 0x1f3a0, 37, EVAS_SCRIPT_COMMON },
3057 { 0x1f3c6, 5, EVAS_SCRIPT_COMMON },
3058 { 0x1f3e0, 17, EVAS_SCRIPT_COMMON },
3059 { 0x1f400, 63, EVAS_SCRIPT_COMMON },
3060 { 0x1f440, 1, EVAS_SCRIPT_COMMON },
3061 { 0x1f442, 182, EVAS_SCRIPT_COMMON },
3062 { 0x1f4f9, 4, EVAS_SCRIPT_COMMON },
3063 { 0x1f500, 62, EVAS_SCRIPT_COMMON },
3064 { 0x1f550, 24, EVAS_SCRIPT_COMMON },
3065 { 0x1f5fb, 5, EVAS_SCRIPT_COMMON },
3066 { 0x1f601, 16, EVAS_SCRIPT_COMMON },
3067 { 0x1f612, 3, EVAS_SCRIPT_COMMON },
3068 { 0x1f616, 1, EVAS_SCRIPT_COMMON },
3069 { 0x1f618, 1, EVAS_SCRIPT_COMMON },
3070 { 0x1f61a, 1, EVAS_SCRIPT_COMMON },
3071 { 0x1f61c, 3, EVAS_SCRIPT_COMMON },
3072 { 0x1f620, 6, EVAS_SCRIPT_COMMON },
3073 { 0x1f628, 4, EVAS_SCRIPT_COMMON },
3074 { 0x1f62d, 1, EVAS_SCRIPT_COMMON },
3075 { 0x1f630, 4, EVAS_SCRIPT_COMMON },
3076 { 0x1f635, 12, EVAS_SCRIPT_COMMON },
3077 { 0x1f645, 11, EVAS_SCRIPT_COMMON },
3078 { 0x1f680, 70, EVAS_SCRIPT_COMMON },
3079 { 0x1f700, 116, EVAS_SCRIPT_COMMON },
3080 { 0x20000, 42711, EVAS_SCRIPT_HAN },
3081 { 0x2a700, 4149, EVAS_SCRIPT_HAN },
3082 { 0x2b740, 222, EVAS_SCRIPT_HAN },
3083 { 0x2f800, 542, EVAS_SCRIPT_HAN },
3084 { 0xe0001, 1, EVAS_SCRIPT_COMMON },
3085 { 0xe0020, 96, EVAS_SCRIPT_COMMON },
3086 { 0xe0100, 240, EVAS_SCRIPT_INHERITED },
3087};
diff --git a/libraries/evas/src/lib/engines/common_16/Makefile.am b/libraries/evas/src/lib/engines/common_16/Makefile.am
new file mode 100644
index 0000000..ef2ab30
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common_16/Makefile.am
@@ -0,0 +1,32 @@
1
2MAINTAINERCLEANFILES = Makefile.in
3
4AM_CPPFLAGS = \
5-I. \
6-I$(top_srcdir)/src/lib \
7-I$(top_srcdir)/src/lib/include \
8@FREETYPE_CFLAGS@ \
9@PIXMAN_CFLAGS@ \
10@VALGRIND_CFLAGS@ \
11@EINA_CFLAGS@ \
12@EET_CFLAGS@ \
13@pthread_cflags@
14
15noinst_LTLIBRARIES = libevas_engine_common_16.la
16
17libevas_engine_common_16_la_SOURCES = \
18evas_soft16_dither_mask.c \
19evas_soft16_font.c \
20evas_soft16_image_scaled_sampled.c \
21evas_soft16_image_unscaled.c \
22evas_soft16_main.c \
23evas_soft16_rectangle.c \
24evas_soft16_line.c \
25evas_soft16_polygon.c
26
27libevas_engine_common_16_la_DEPENDENCIES = $(top_builddir)/config.h
28
29EXTRA_DIST = \
30evas_soft16_point_blend.c \
31evas_soft16_scanline_blend.c \
32evas_soft16_scanline_fill.c
diff --git a/libraries/evas/src/lib/engines/common_16/Makefile.in b/libraries/evas/src/lib/engines/common_16/Makefile.in
new file mode 100644
index 0000000..9097a8d
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common_16/Makefile.in
@@ -0,0 +1,698 @@
1# Makefile.in generated by automake 1.11.1 from Makefile.am.
2# @configure_input@
3
4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
6# Inc.
7# This Makefile.in is free software; the Free Software Foundation
8# gives unlimited permission to copy and/or distribute it,
9# with or without modifications, as long as this notice is preserved.
10
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
13# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14# PARTICULAR PURPOSE.
15
16@SET_MAKE@
17
18VPATH = @srcdir@
19pkgdatadir = $(datadir)/@PACKAGE@
20pkgincludedir = $(includedir)/@PACKAGE@
21pkglibdir = $(libdir)/@PACKAGE@
22pkglibexecdir = $(libexecdir)/@PACKAGE@
23am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
24install_sh_DATA = $(install_sh) -c -m 644
25install_sh_PROGRAM = $(install_sh) -c
26install_sh_SCRIPT = $(install_sh) -c
27INSTALL_HEADER = $(INSTALL_DATA)
28transform = $(program_transform_name)
29NORMAL_INSTALL = :
30PRE_INSTALL = :
31POST_INSTALL = :
32NORMAL_UNINSTALL = :
33PRE_UNINSTALL = :
34POST_UNINSTALL = :
35build_triplet = @build@
36host_triplet = @host@
37subdir = src/lib/engines/common_16
38DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
39ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
40am__aclocal_m4_deps = $(top_srcdir)/m4/efl_attribute.m4 \
41 $(top_srcdir)/m4/efl_coverage.m4 \
42 $(top_srcdir)/m4/efl_doxygen.m4 \
43 $(top_srcdir)/m4/efl_fnmatch.m4 \
44 $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \
45 $(top_srcdir)/m4/evas_check_engine.m4 \
46 $(top_srcdir)/m4/evas_check_loader.m4 \
47 $(top_srcdir)/m4/evas_converter.m4 \
48 $(top_srcdir)/m4/evas_dither.m4 \
49 $(top_srcdir)/m4/evas_scaler.m4 $(top_srcdir)/m4/libtool.m4 \
50 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
51 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
52 $(top_srcdir)/configure.ac
53am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
54 $(ACLOCAL_M4)
55mkinstalldirs = $(install_sh) -d
56CONFIG_HEADER = $(top_builddir)/config.h
57CONFIG_CLEAN_FILES =
58CONFIG_CLEAN_VPATH_FILES =
59LTLIBRARIES = $(noinst_LTLIBRARIES)
60libevas_engine_common_16_la_LIBADD =
61am_libevas_engine_common_16_la_OBJECTS = evas_soft16_dither_mask.lo \
62 evas_soft16_font.lo evas_soft16_image_scaled_sampled.lo \
63 evas_soft16_image_unscaled.lo evas_soft16_main.lo \
64 evas_soft16_rectangle.lo evas_soft16_line.lo \
65 evas_soft16_polygon.lo
66libevas_engine_common_16_la_OBJECTS = \
67 $(am_libevas_engine_common_16_la_OBJECTS)
68AM_V_lt = $(am__v_lt_$(V))
69am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
70am__v_lt_0 = --silent
71DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
72depcomp = $(SHELL) $(top_srcdir)/depcomp
73am__depfiles_maybe = depfiles
74am__mv = mv -f
75COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
76 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
77LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
78 $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
79 $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
80 $(AM_CFLAGS) $(CFLAGS)
81AM_V_CC = $(am__v_CC_$(V))
82am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
83am__v_CC_0 = @echo " CC " $@;
84AM_V_at = $(am__v_at_$(V))
85am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
86am__v_at_0 = @
87CCLD = $(CC)
88LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
89 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
90 $(AM_LDFLAGS) $(LDFLAGS) -o $@
91AM_V_CCLD = $(am__v_CCLD_$(V))
92am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
93am__v_CCLD_0 = @echo " CCLD " $@;
94AM_V_GEN = $(am__v_GEN_$(V))
95am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
96am__v_GEN_0 = @echo " GEN " $@;
97SOURCES = $(libevas_engine_common_16_la_SOURCES)
98DIST_SOURCES = $(libevas_engine_common_16_la_SOURCES)
99ETAGS = etags
100CTAGS = ctags
101DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
102ACLOCAL = @ACLOCAL@
103ALLOCA = @ALLOCA@
104AMTAR = @AMTAR@
105AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
106AR = @AR@
107AS = @AS@
108AUTOCONF = @AUTOCONF@
109AUTOHEADER = @AUTOHEADER@
110AUTOMAKE = @AUTOMAKE@
111AWK = @AWK@
112CC = @CC@
113CCDEPMODE = @CCDEPMODE@
114CFLAGS = @CFLAGS@
115CHECK_CFLAGS = @CHECK_CFLAGS@
116CHECK_LIBS = @CHECK_LIBS@
117CPP = @CPP@
118CPPFLAGS = @CPPFLAGS@
119CXX = @CXX@
120CXXCPP = @CXXCPP@
121CXXDEPMODE = @CXXDEPMODE@
122CXXFLAGS = @CXXFLAGS@
123CYGPATH_W = @CYGPATH_W@
124DEFS = @DEFS@
125DEPDIR = @DEPDIR@
126DIRECTFB_CFLAGS = @DIRECTFB_CFLAGS@
127DIRECTFB_LIBS = @DIRECTFB_LIBS@
128DLLTOOL = @DLLTOOL@
129DSYMUTIL = @DSYMUTIL@
130DUMPBIN = @DUMPBIN@
131ECHO_C = @ECHO_C@
132ECHO_N = @ECHO_N@
133ECHO_T = @ECHO_T@
134ECORE_EVAS_CFLAGS = @ECORE_EVAS_CFLAGS@
135ECORE_EVAS_LIBS = @ECORE_EVAS_LIBS@
136EDB_CFLAGS = @EDB_CFLAGS@
137EDB_LIBS = @EDB_LIBS@
138EDJE_CFLAGS = @EDJE_CFLAGS@
139EDJE_LIBS = @EDJE_LIBS@
140EET_CFLAGS = @EET_CFLAGS@
141EET_LIBS = @EET_LIBS@
142EFL_COVERAGE_CFLAGS = @EFL_COVERAGE_CFLAGS@
143EFL_COVERAGE_LIBS = @EFL_COVERAGE_LIBS@
144EFL_FNMATCH_LIBS = @EFL_FNMATCH_LIBS@
145EGREP = @EGREP@
146EINA_CFLAGS = @EINA_CFLAGS@
147EINA_LIBS = @EINA_LIBS@
148EVAS_CFLAGS = @EVAS_CFLAGS@
149EVAS_LIBS = @EVAS_LIBS@
150EVAS_SSE3_CFLAGS = @EVAS_SSE3_CFLAGS@
151EVIL_CFLAGS = @EVIL_CFLAGS@
152EVIL_LIBS = @EVIL_LIBS@
153EXEEXT = @EXEEXT@
154FGREP = @FGREP@
155FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@
156FONTCONFIG_LIBS = @FONTCONFIG_LIBS@
157FREETYPE_CFLAGS = @FREETYPE_CFLAGS@
158FREETYPE_LIBS = @FREETYPE_LIBS@
159FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@
160FRIBIDI_LIBS = @FRIBIDI_LIBS@
161GL_EET_CFLAGS = @GL_EET_CFLAGS@
162GL_EET_LIBS = @GL_EET_LIBS@
163GREP = @GREP@
164HARFBUZZ_CFLAGS = @HARFBUZZ_CFLAGS@
165HARFBUZZ_LIBS = @HARFBUZZ_LIBS@
166INSTALL = @INSTALL@
167INSTALL_DATA = @INSTALL_DATA@
168INSTALL_PROGRAM = @INSTALL_PROGRAM@
169INSTALL_SCRIPT = @INSTALL_SCRIPT@
170INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
171LD = @LD@
172LDFLAGS = @LDFLAGS@
173LIBOBJS = @LIBOBJS@
174LIBS = @LIBS@
175LIBTOOL = @LIBTOOL@
176LINEBREAK_CFLAGS = @LINEBREAK_CFLAGS@
177LINEBREAK_LIBS = @LINEBREAK_LIBS@
178LIPO = @LIPO@
179LN_S = @LN_S@
180LTLIBOBJS = @LTLIBOBJS@
181MAKEINFO = @MAKEINFO@
182MKDIR_P = @MKDIR_P@
183MODULE_ARCH = @MODULE_ARCH@
184NM = @NM@
185NMEDIT = @NMEDIT@
186OBJC = @OBJC@
187OBJCDEPMODE = @OBJCDEPMODE@
188OBJCFLAGS = @OBJCFLAGS@
189OBJDUMP = @OBJDUMP@
190OBJEXT = @OBJEXT@
191OTOOL = @OTOOL@
192OTOOL64 = @OTOOL64@
193PACKAGE = @PACKAGE@
194PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
195PACKAGE_NAME = @PACKAGE_NAME@
196PACKAGE_STRING = @PACKAGE_STRING@
197PACKAGE_TARNAME = @PACKAGE_TARNAME@
198PACKAGE_URL = @PACKAGE_URL@
199PACKAGE_VERSION = @PACKAGE_VERSION@
200PATH_SEPARATOR = @PATH_SEPARATOR@
201PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
202PIXMAN_LIBS = @PIXMAN_LIBS@
203PKG_CONFIG = @PKG_CONFIG@
204PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
205PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
206PNG_CFLAGS = @PNG_CFLAGS@
207PNG_LIBS = @PNG_LIBS@
208RANLIB = @RANLIB@
209SDL_CFLAGS = @SDL_CFLAGS@
210SDL_LIBS = @SDL_LIBS@
211SED = @SED@
212SET_MAKE = @SET_MAKE@
213SHELL = @SHELL@
214SHM_OPEN_LINK = @SHM_OPEN_LINK@
215STRIP = @STRIP@
216SVG_CFLAGS = @SVG_CFLAGS@
217SVG_LIBS = @SVG_LIBS@
218VALGRIND_CFLAGS = @VALGRIND_CFLAGS@
219VALGRIND_LIBS = @VALGRIND_LIBS@
220VERSION = @VERSION@
221VMAJ = @VMAJ@
222WIN32_CFLAGS = @WIN32_CFLAGS@
223WIN32_CPPFLAGS = @WIN32_CPPFLAGS@
224XCB_CFLAGS = @XCB_CFLAGS@
225XCB_GL_CFLAGS = @XCB_GL_CFLAGS@
226XCB_GL_LIBS = @XCB_GL_LIBS@
227XCB_LIBS = @XCB_LIBS@
228XEXT_CFLAGS = @XEXT_CFLAGS@
229XEXT_LIBS = @XEXT_LIBS@
230XMKMF = @XMKMF@
231X_CFLAGS = @X_CFLAGS@
232X_EXTRA_LIBS = @X_EXTRA_LIBS@
233X_LIBS = @X_LIBS@
234X_PRE_LIBS = @X_PRE_LIBS@
235abs_builddir = @abs_builddir@
236abs_srcdir = @abs_srcdir@
237abs_top_builddir = @abs_top_builddir@
238abs_top_srcdir = @abs_top_srcdir@
239ac_ct_CC = @ac_ct_CC@
240ac_ct_CXX = @ac_ct_CXX@
241ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
242ac_ct_OBJC = @ac_ct_OBJC@
243altivec_cflags = @altivec_cflags@
244am__include = @am__include@
245am__leading_dot = @am__leading_dot@
246am__quote = @am__quote@
247am__tar = @am__tar@
248am__untar = @am__untar@
249bindir = @bindir@
250build = @build@
251build_alias = @build_alias@
252build_cpu = @build_cpu@
253build_os = @build_os@
254build_vendor = @build_vendor@
255builddir = @builddir@
256datadir = @datadir@
257datarootdir = @datarootdir@
258dlopen_libs = @dlopen_libs@
259docdir = @docdir@
260dvidir = @dvidir@
261edje_cc = @edje_cc@
262efl_doxygen = @efl_doxygen@
263efl_have_doxygen = @efl_have_doxygen@
264evas_engine_buffer_cflags = @evas_engine_buffer_cflags@
265evas_engine_buffer_libs = @evas_engine_buffer_libs@
266evas_engine_direct3d_cflags = @evas_engine_direct3d_cflags@
267evas_engine_direct3d_libs = @evas_engine_direct3d_libs@
268evas_engine_directfb_cflags = @evas_engine_directfb_cflags@
269evas_engine_directfb_libs = @evas_engine_directfb_libs@
270evas_engine_fb_cflags = @evas_engine_fb_cflags@
271evas_engine_fb_libs = @evas_engine_fb_libs@
272evas_engine_gl_cocoa_cflags = @evas_engine_gl_cocoa_cflags@
273evas_engine_gl_cocoa_libs = @evas_engine_gl_cocoa_libs@
274evas_engine_gl_common_libs = @evas_engine_gl_common_libs@
275evas_engine_gl_sdl_cflags = @evas_engine_gl_sdl_cflags@
276evas_engine_gl_sdl_libs = @evas_engine_gl_sdl_libs@
277evas_engine_gl_xcb_cflags = @evas_engine_gl_xcb_cflags@
278evas_engine_gl_xcb_libs = @evas_engine_gl_xcb_libs@
279evas_engine_gl_xlib_cflags = @evas_engine_gl_xlib_cflags@
280evas_engine_gl_xlib_libs = @evas_engine_gl_xlib_libs@
281evas_engine_psl1ght_cflags = @evas_engine_psl1ght_cflags@
282evas_engine_psl1ght_libs = @evas_engine_psl1ght_libs@
283evas_engine_software_16_ddraw_cflags = @evas_engine_software_16_ddraw_cflags@
284evas_engine_software_16_ddraw_libs = @evas_engine_software_16_ddraw_libs@
285evas_engine_software_16_sdl_cflags = @evas_engine_software_16_sdl_cflags@
286evas_engine_software_16_sdl_libs = @evas_engine_software_16_sdl_libs@
287evas_engine_software_16_wince_cflags = @evas_engine_software_16_wince_cflags@
288evas_engine_software_16_wince_libs = @evas_engine_software_16_wince_libs@
289evas_engine_software_16_x11_cflags = @evas_engine_software_16_x11_cflags@
290evas_engine_software_16_x11_libs = @evas_engine_software_16_x11_libs@
291evas_engine_software_8_x11_cflags = @evas_engine_software_8_x11_cflags@
292evas_engine_software_8_x11_libs = @evas_engine_software_8_x11_libs@
293evas_engine_software_ddraw_cflags = @evas_engine_software_ddraw_cflags@
294evas_engine_software_ddraw_libs = @evas_engine_software_ddraw_libs@
295evas_engine_software_gdi_cflags = @evas_engine_software_gdi_cflags@
296evas_engine_software_gdi_libs = @evas_engine_software_gdi_libs@
297evas_engine_software_sdl_cflags = @evas_engine_software_sdl_cflags@
298evas_engine_software_sdl_libs = @evas_engine_software_sdl_libs@
299evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@
300evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@
301evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@
302evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@
303evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@
304evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@
305evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@
306evas_image_loader_edb_libs = @evas_image_loader_edb_libs@
307evas_image_loader_eet_cflags = @evas_image_loader_eet_cflags@
308evas_image_loader_eet_libs = @evas_image_loader_eet_libs@
309evas_image_loader_generic_cflags = @evas_image_loader_generic_cflags@
310evas_image_loader_generic_libs = @evas_image_loader_generic_libs@
311evas_image_loader_gif_cflags = @evas_image_loader_gif_cflags@
312evas_image_loader_gif_libs = @evas_image_loader_gif_libs@
313evas_image_loader_ico_cflags = @evas_image_loader_ico_cflags@
314evas_image_loader_ico_libs = @evas_image_loader_ico_libs@
315evas_image_loader_jpeg_cflags = @evas_image_loader_jpeg_cflags@
316evas_image_loader_jpeg_libs = @evas_image_loader_jpeg_libs@
317evas_image_loader_pmaps_cflags = @evas_image_loader_pmaps_cflags@
318evas_image_loader_pmaps_libs = @evas_image_loader_pmaps_libs@
319evas_image_loader_png_cflags = @evas_image_loader_png_cflags@
320evas_image_loader_png_libs = @evas_image_loader_png_libs@
321evas_image_loader_psd_cflags = @evas_image_loader_psd_cflags@
322evas_image_loader_psd_libs = @evas_image_loader_psd_libs@
323evas_image_loader_svg_cflags = @evas_image_loader_svg_cflags@
324evas_image_loader_svg_libs = @evas_image_loader_svg_libs@
325evas_image_loader_tga_cflags = @evas_image_loader_tga_cflags@
326evas_image_loader_tga_libs = @evas_image_loader_tga_libs@
327evas_image_loader_tiff_cflags = @evas_image_loader_tiff_cflags@
328evas_image_loader_tiff_libs = @evas_image_loader_tiff_libs@
329evas_image_loader_wbmp_cflags = @evas_image_loader_wbmp_cflags@
330evas_image_loader_wbmp_libs = @evas_image_loader_wbmp_libs@
331evas_image_loader_xpm_cflags = @evas_image_loader_xpm_cflags@
332evas_image_loader_xpm_libs = @evas_image_loader_xpm_libs@
333exec_prefix = @exec_prefix@
334have_evas_engine_gl_x11 = @have_evas_engine_gl_x11@
335have_evas_engine_gl_xcb = @have_evas_engine_gl_xcb@
336have_evas_engine_gl_xlib = @have_evas_engine_gl_xlib@
337have_evas_engine_software_x11 = @have_evas_engine_software_x11@
338have_evas_engine_software_xcb = @have_evas_engine_software_xcb@
339have_evas_engine_software_xlib = @have_evas_engine_software_xlib@
340have_lcov = @have_lcov@
341host = @host@
342host_alias = @host_alias@
343host_cpu = @host_cpu@
344host_os = @host_os@
345host_vendor = @host_vendor@
346htmldir = @htmldir@
347includedir = @includedir@
348infodir = @infodir@
349install_sh = @install_sh@
350libdir = @libdir@
351libexecdir = @libexecdir@
352localedir = @localedir@
353localstatedir = @localstatedir@
354lt_ECHO = @lt_ECHO@
355lt_enable_auto_import = @lt_enable_auto_import@
356mandir = @mandir@
357mkdir_p = @mkdir_p@
358oldincludedir = @oldincludedir@
359pdfdir = @pdfdir@
360pkgconfig_requires_private = @pkgconfig_requires_private@
361prefix = @prefix@
362program_transform_name = @program_transform_name@
363psdir = @psdir@
364pthread_cflags = @pthread_cflags@
365pthread_libs = @pthread_libs@
366release_info = @release_info@
367requirement_evas = @requirement_evas@
368sbindir = @sbindir@
369sharedstatedir = @sharedstatedir@
370srcdir = @srcdir@
371sysconfdir = @sysconfdir@
372target_alias = @target_alias@
373top_build_prefix = @top_build_prefix@
374top_builddir = @top_builddir@
375top_srcdir = @top_srcdir@
376version_info = @version_info@
377MAINTAINERCLEANFILES = Makefile.in
378AM_CPPFLAGS = \
379-I. \
380-I$(top_srcdir)/src/lib \
381-I$(top_srcdir)/src/lib/include \
382@FREETYPE_CFLAGS@ \
383@PIXMAN_CFLAGS@ \
384@VALGRIND_CFLAGS@ \
385@EINA_CFLAGS@ \
386@EET_CFLAGS@ \
387@pthread_cflags@
388
389noinst_LTLIBRARIES = libevas_engine_common_16.la
390libevas_engine_common_16_la_SOURCES = \
391evas_soft16_dither_mask.c \
392evas_soft16_font.c \
393evas_soft16_image_scaled_sampled.c \
394evas_soft16_image_unscaled.c \
395evas_soft16_main.c \
396evas_soft16_rectangle.c \
397evas_soft16_line.c \
398evas_soft16_polygon.c
399
400libevas_engine_common_16_la_DEPENDENCIES = $(top_builddir)/config.h
401EXTRA_DIST = \
402evas_soft16_point_blend.c \
403evas_soft16_scanline_blend.c \
404evas_soft16_scanline_fill.c
405
406all: all-am
407
408.SUFFIXES:
409.SUFFIXES: .c .lo .o .obj
410$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
411 @for dep in $?; do \
412 case '$(am__configure_deps)' in \
413 *$$dep*) \
414 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
415 && { if test -f $@; then exit 0; else break; fi; }; \
416 exit 1;; \
417 esac; \
418 done; \
419 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/engines/common_16/Makefile'; \
420 $(am__cd) $(top_srcdir) && \
421 $(AUTOMAKE) --gnu src/lib/engines/common_16/Makefile
422.PRECIOUS: Makefile
423Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
424 @case '$?' in \
425 *config.status*) \
426 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
427 *) \
428 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
429 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
430 esac;
431
432$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
433 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
434
435$(top_srcdir)/configure: $(am__configure_deps)
436 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
437$(ACLOCAL_M4): $(am__aclocal_m4_deps)
438 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
439$(am__aclocal_m4_deps):
440
441clean-noinstLTLIBRARIES:
442 -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
443 @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
444 dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
445 test "$$dir" != "$$p" || dir=.; \
446 echo "rm -f \"$${dir}/so_locations\""; \
447 rm -f "$${dir}/so_locations"; \
448 done
449libevas_engine_common_16.la: $(libevas_engine_common_16_la_OBJECTS) $(libevas_engine_common_16_la_DEPENDENCIES)
450 $(AM_V_CCLD)$(LINK) $(libevas_engine_common_16_la_OBJECTS) $(libevas_engine_common_16_la_LIBADD) $(LIBS)
451
452mostlyclean-compile:
453 -rm -f *.$(OBJEXT)
454
455distclean-compile:
456 -rm -f *.tab.c
457
458@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_soft16_dither_mask.Plo@am__quote@
459@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_soft16_font.Plo@am__quote@
460@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_soft16_image_scaled_sampled.Plo@am__quote@
461@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_soft16_image_unscaled.Plo@am__quote@
462@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_soft16_line.Plo@am__quote@
463@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_soft16_main.Plo@am__quote@
464@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_soft16_polygon.Plo@am__quote@
465@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_soft16_rectangle.Plo@am__quote@
466
467.c.o:
468@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
469@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
470@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
471@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
472@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
473@am__fastdepCC_FALSE@ $(COMPILE) -c $<
474
475.c.obj:
476@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
477@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
478@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
479@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
480@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
481@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
482
483.c.lo:
484@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
485@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
486@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
487@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
488@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
489@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
490
491mostlyclean-libtool:
492 -rm -f *.lo
493
494clean-libtool:
495 -rm -rf .libs _libs
496
497ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
498 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
499 unique=`for i in $$list; do \
500 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
501 done | \
502 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
503 END { if (nonempty) { for (i in files) print i; }; }'`; \
504 mkid -fID $$unique
505tags: TAGS
506
507TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
508 $(TAGS_FILES) $(LISP)
509 set x; \
510 here=`pwd`; \
511 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
512 unique=`for i in $$list; do \
513 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
514 done | \
515 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
516 END { if (nonempty) { for (i in files) print i; }; }'`; \
517 shift; \
518 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
519 test -n "$$unique" || unique=$$empty_fix; \
520 if test $$# -gt 0; then \
521 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
522 "$$@" $$unique; \
523 else \
524 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
525 $$unique; \
526 fi; \
527 fi
528ctags: CTAGS
529CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
530 $(TAGS_FILES) $(LISP)
531 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
532 unique=`for i in $$list; do \
533 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
534 done | \
535 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
536 END { if (nonempty) { for (i in files) print i; }; }'`; \
537 test -z "$(CTAGS_ARGS)$$unique" \
538 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
539 $$unique
540
541GTAGS:
542 here=`$(am__cd) $(top_builddir) && pwd` \
543 && $(am__cd) $(top_srcdir) \
544 && gtags -i $(GTAGS_ARGS) "$$here"
545
546distclean-tags:
547 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
548
549distdir: $(DISTFILES)
550 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
551 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
552 list='$(DISTFILES)'; \
553 dist_files=`for file in $$list; do echo $$file; done | \
554 sed -e "s|^$$srcdirstrip/||;t" \
555 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
556 case $$dist_files in \
557 */*) $(MKDIR_P) `echo "$$dist_files" | \
558 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
559 sort -u` ;; \
560 esac; \
561 for file in $$dist_files; do \
562 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
563 if test -d $$d/$$file; then \
564 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
565 if test -d "$(distdir)/$$file"; then \
566 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
567 fi; \
568 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
569 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
570 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
571 fi; \
572 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
573 else \
574 test -f "$(distdir)/$$file" \
575 || cp -p $$d/$$file "$(distdir)/$$file" \
576 || exit 1; \
577 fi; \
578 done
579check-am: all-am
580check: check-am
581all-am: Makefile $(LTLIBRARIES)
582installdirs:
583install: install-am
584install-exec: install-exec-am
585install-data: install-data-am
586uninstall: uninstall-am
587
588install-am: all-am
589 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
590
591installcheck: installcheck-am
592install-strip:
593 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
594 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
595 `test -z '$(STRIP)' || \
596 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
597mostlyclean-generic:
598
599clean-generic:
600
601distclean-generic:
602 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
603 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
604
605maintainer-clean-generic:
606 @echo "This command is intended for maintainers to use"
607 @echo "it deletes files that may require special tools to rebuild."
608 -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
609clean: clean-am
610
611clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
612 mostlyclean-am
613
614distclean: distclean-am
615 -rm -rf ./$(DEPDIR)
616 -rm -f Makefile
617distclean-am: clean-am distclean-compile distclean-generic \
618 distclean-tags
619
620dvi: dvi-am
621
622dvi-am:
623
624html: html-am
625
626html-am:
627
628info: info-am
629
630info-am:
631
632install-data-am:
633
634install-dvi: install-dvi-am
635
636install-dvi-am:
637
638install-exec-am:
639
640install-html: install-html-am
641
642install-html-am:
643
644install-info: install-info-am
645
646install-info-am:
647
648install-man:
649
650install-pdf: install-pdf-am
651
652install-pdf-am:
653
654install-ps: install-ps-am
655
656install-ps-am:
657
658installcheck-am:
659
660maintainer-clean: maintainer-clean-am
661 -rm -rf ./$(DEPDIR)
662 -rm -f Makefile
663maintainer-clean-am: distclean-am maintainer-clean-generic
664
665mostlyclean: mostlyclean-am
666
667mostlyclean-am: mostlyclean-compile mostlyclean-generic \
668 mostlyclean-libtool
669
670pdf: pdf-am
671
672pdf-am:
673
674ps: ps-am
675
676ps-am:
677
678uninstall-am:
679
680.MAKE: install-am install-strip
681
682.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
683 clean-libtool clean-noinstLTLIBRARIES ctags distclean \
684 distclean-compile distclean-generic distclean-libtool \
685 distclean-tags distdir dvi dvi-am html html-am info info-am \
686 install install-am install-data install-data-am install-dvi \
687 install-dvi-am install-exec install-exec-am install-html \
688 install-html-am install-info install-info-am install-man \
689 install-pdf install-pdf-am install-ps install-ps-am \
690 install-strip installcheck installcheck-am installdirs \
691 maintainer-clean maintainer-clean-generic mostlyclean \
692 mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
693 pdf pdf-am ps ps-am tags uninstall uninstall-am
694
695
696# Tell versions [3.59,3.63) of GNU make to not export all variables.
697# Otherwise a system limit (for SysV at least) may be exceeded.
698.NOEXPORT:
diff --git a/libraries/evas/src/lib/engines/common_16/evas_soft16_dither_mask.c b/libraries/evas/src/lib/engines/common_16/evas_soft16_dither_mask.c
new file mode 100644
index 0000000..566efac
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common_16/evas_soft16_dither_mask.c
@@ -0,0 +1,293 @@
1#include "evas_common_soft16.h"
2
3#define S16_DM_SIZE 128
4#define S16_DM_BITS 6
5#define S16_DM_DIV 64
6#define S16_DM_MSK (S16_DM_SIZE - 1)
7#define S16_DM_SHF(_b) (S16_DM_BITS - (8 - _b))
8
9static const DATA8 dither_table[S16_DM_SIZE][S16_DM_SIZE] =
10{
11 { 0, 41, 23, 5, 17, 39, 7, 15, 62, 23, 40, 51, 31, 47, 9, 32, 52, 27, 57, 25, 6, 61, 27, 52, 37, 7, 40, 63, 18, 36, 10, 42, 25, 62, 45, 34, 20, 42, 37, 14, 35, 29, 50, 10, 61, 2, 40, 8, 37, 12, 58, 22, 5, 41, 10, 39, 0, 60, 11, 46, 2, 55, 38, 17, 36, 59, 13, 54, 37, 56, 8, 29, 16, 13, 63, 22, 41, 55, 7, 20, 49, 14, 23, 55, 37, 23, 19, 36, 15, 49, 23, 63, 30, 14, 38, 27, 53, 13, 22, 41, 19, 31, 7, 19, 50, 30, 49, 16, 3, 32, 56, 40, 29, 34, 8, 48, 19, 45, 4, 51, 12, 46, 35, 49, 16, 42, 12, 62 },
12 { 30, 57, 36, 54, 47, 34, 52, 27, 43, 4, 28, 7, 17, 36, 62, 13, 44, 7, 18, 48, 33, 21, 44, 14, 30, 47, 12, 33, 5, 55, 31, 58, 13, 30, 4, 17, 52, 10, 60, 26, 46, 0, 39, 27, 42, 22, 47, 25, 60, 32, 9, 38, 48, 17, 59, 30, 49, 18, 34, 25, 51, 19, 5, 48, 21, 8, 28, 46, 1, 32, 41, 19, 54, 47, 37, 18, 28, 11, 44, 30, 39, 56, 2, 33, 8, 42, 61, 28, 58, 8, 46, 9, 41, 4, 58, 7, 21, 48, 59, 10, 52, 14, 42, 57, 12, 25, 7, 53, 42, 24, 11, 50, 17, 59, 42, 2, 36, 60, 32, 17, 63, 29, 21, 7, 59, 32, 24, 39 },
13 { 22, 8, 16, 32, 3, 25, 13, 57, 18, 45, 58, 39, 55, 20, 5, 42, 23, 34, 63, 1, 51, 10, 58, 4, 60, 23, 53, 27, 44, 21, 3, 48, 8, 50, 43, 54, 27, 32, 5, 55, 21, 58, 12, 53, 6, 36, 14, 50, 17, 29, 53, 15, 24, 52, 7, 36, 13, 42, 4, 53, 9, 35, 61, 26, 56, 32, 49, 15, 62, 23, 6, 60, 2, 31, 4, 48, 58, 38, 15, 61, 5, 25, 47, 28, 50, 15, 7, 40, 3, 32, 33, 52, 25, 50, 35, 42, 61, 3, 28, 36, 23, 63, 4, 33, 46, 62, 36, 23, 60, 6, 54, 28, 4, 37, 23, 55, 25, 8, 42, 54, 14, 6, 56, 38, 19, 52, 4, 46 },
14 { 48, 53, 43, 12, 45, 63, 30, 37, 9, 34, 21, 1, 25, 47, 29, 58, 3, 54, 15, 39, 29, 17, 38, 35, 20, 43, 1, 49, 15, 59, 29, 39, 22, 35, 16, 23, 1, 47, 39, 18, 8, 44, 25, 31, 57, 19, 63, 4, 45, 3, 42, 61, 1, 31, 45, 20, 57, 29, 62, 21, 32, 41, 14, 44, 3, 39, 5, 34, 10, 43, 51, 35, 23, 52, 40, 10, 21, 1, 53, 18, 51, 43, 12, 62, 18, 54, 26, 51, 20, 57, 14, 1, 62, 16, 11, 18, 32, 39, 17, 44, 1, 48, 26, 37, 18, 2, 51, 14, 28, 45, 35, 18, 57, 13, 47, 11, 51, 20, 2, 39, 31, 47, 25, 1, 50, 11, 60, 7 },
15 { 18, 28, 1, 56, 21, 10, 51, 2, 46, 54, 14, 61, 11, 50, 13, 38, 19, 31, 45, 9, 55, 24, 47, 5, 54, 9, 62, 11, 35, 8, 51, 14, 57, 6, 63, 40, 58, 14, 51, 28, 62, 34, 15, 48, 1, 41, 30, 35, 55, 21, 34, 11, 49, 37, 8, 52, 4, 23, 15, 43, 1, 58, 11, 23, 53, 16, 55, 26, 58, 18, 27, 12, 45, 14, 25, 63, 42, 33, 27, 35, 9, 31, 21, 38, 1, 44, 34, 12, 48, 38, 21, 44, 29, 47, 26, 53, 1, 46, 54, 8, 59, 29, 11, 55, 22, 41, 33, 20, 39, 1, 48, 9, 44, 32, 5, 62, 29, 44, 57, 23, 10, 58, 34, 43, 15, 37, 26, 33 },
16 { 51, 38, 59, 24, 35, 42, 19, 60, 5, 32, 41, 26, 43, 33, 7, 53, 48, 11, 59, 23, 42, 2, 61, 30, 16, 40, 32, 24, 56, 41, 19, 33, 37, 26, 47, 9, 31, 22, 2, 45, 9, 54, 4, 37, 21, 52, 11, 23, 7, 57, 16, 25, 55, 18, 63, 27, 46, 39, 56, 10, 50, 37, 29, 47, 19, 63, 24, 9, 46, 2, 39, 60, 9, 57, 30, 7, 49, 11, 59, 3, 45, 57, 5, 60, 29, 22, 5, 60, 30, 9, 59, 18, 40, 6, 57, 36, 30, 12, 24, 34, 15, 40, 52, 6, 49, 9, 58, 4, 63, 12, 26, 61, 22, 53, 38, 16, 35, 14, 28, 50, 42, 17, 5, 28, 62, 20, 54, 12 },
17 { 26, 6, 31, 15, 49, 6, 38, 27, 22, 49, 16, 56, 2, 62, 30, 21, 0, 36, 28, 6, 49, 32, 13, 52, 26, 50, 19, 46, 3, 26, 62, 0, 53, 12, 29, 3, 53, 41, 60, 24, 38, 13, 58, 16, 43, 9, 59, 39, 46, 28, 44, 40, 2, 33, 13, 41, 16, 6, 47, 31, 26, 17, 57, 6, 38, 0, 42, 36, 29, 52, 20, 31, 48, 0, 34, 56, 20, 36, 23, 54, 14, 41, 24, 37, 10, 55, 46, 25, 16, 45, 36, 4, 55, 23, 15, 8, 50, 62, 5, 56, 44, 20, 13, 28, 59, 31, 24, 47, 31, 52, 37, 17, 40, 0, 26, 49, 3, 60, 7, 33, 0, 61, 53, 40, 8, 45, 2, 41 },
18 { 16, 63, 43, 4, 61, 24, 56, 13, 53, 8, 36, 12, 24, 41, 16, 46, 60, 26, 52, 39, 14, 57, 21, 37, 0, 45, 7, 59, 38, 17, 43, 10, 45, 20, 61, 43, 19, 11, 33, 17, 50, 32, 23, 61, 28, 49, 26, 0, 18, 51, 5, 60, 22, 58, 29, 0, 59, 34, 19, 62, 3, 52, 7, 44, 30, 59, 13, 50, 15, 62, 7, 17, 38, 22, 44, 15, 40, 4, 47, 28, 33, 17, 49, 16, 51, 40, 10, 56, 0, 53, 13, 49, 28, 38, 60, 21, 43, 19, 37, 27, 3, 51, 34, 39, 0, 45, 15, 43, 10, 21, 3, 55, 8, 33, 59, 10, 41, 18, 52, 24, 46, 20, 30, 13, 58, 22, 36, 57 },
19 { 50, 34, 11, 47, 29, 17, 44, 0, 33, 63, 28, 46, 52, 5, 57, 10, 42, 18, 4, 63, 20, 8, 44, 10, 56, 34, 14, 29, 5, 54, 23, 59, 32, 49, 7, 34, 49, 27, 56, 0, 42, 7, 46, 3, 40, 6, 54, 32, 62, 13, 36, 10, 47, 8, 35, 49, 24, 51, 12, 40, 22, 35, 60, 12, 22, 51, 33, 4, 40, 25, 43, 55, 5, 54, 12, 61, 26, 51, 8, 62, 0, 53, 7, 63, 2, 32, 19, 34, 42, 24, 31, 63, 2, 10, 45, 33, 0, 48, 9, 61, 22, 47, 8, 62, 18, 56, 7, 54, 27, 57, 46, 30, 50, 19, 45, 30, 56, 36, 22, 47, 11, 38, 3, 51, 32, 48, 18, 9 },
20 { 0, 21, 40, 19, 52, 9, 37, 48, 20, 40, 3, 18, 27, 38, 35, 22, 31, 56, 13, 35, 46, 28, 60, 40, 27, 18, 61, 50, 41, 30, 7, 36, 2, 25, 16, 57, 5, 15, 47, 29, 55, 19, 30, 52, 15, 34, 20, 12, 43, 30, 20, 54, 25, 44, 53, 12, 38, 5, 55, 27, 48, 15, 33, 27, 45, 8, 19, 28, 56, 11, 33, 49, 18, 36, 29, 2, 45, 16, 39, 19, 31, 43, 27, 35, 20, 52, 26, 6, 61, 11, 41, 17, 29, 51, 20, 56, 25, 32, 41, 17, 53, 31, 25, 14, 42, 23, 35, 16, 38, 6, 34, 12, 15, 62, 6, 21, 13, 1, 63, 9, 55, 27, 43, 25, 14, 4, 31, 55 },
21 { 44, 29, 61, 2, 35, 58, 26, 15, 60, 10, 51, 59, 14, 55, 8, 50, 2, 44, 25, 51, 1, 33, 16, 4, 48, 36, 2, 21, 12, 57, 48, 13, 51, 55, 40, 28, 37, 62, 8, 39, 12, 63, 36, 10, 59, 24, 56, 47, 9, 50, 41, 1, 32, 17, 6, 21, 61, 30, 9, 43, 1, 54, 41, 2, 54, 37, 48, 61, 1, 46, 21, 3, 58, 24, 50, 32, 60, 10, 57, 25, 46, 12, 59, 4, 45, 13, 57, 47, 27, 39, 5, 58, 47, 14, 35, 4, 52, 13, 60, 6, 36, 10, 45, 55, 4, 50, 29, 2, 61, 50, 25, 58, 44, 24, 36, 42, 54, 28, 40, 32, 16, 56, 6, 62, 46, 39, 60, 23 },
22 { 7, 48, 14, 54, 23, 40, 4, 45, 30, 22, 42, 32, 1, 44, 20, 29, 58, 8, 37, 19, 41, 54, 24, 58, 9, 53, 25, 46, 34, 16, 23, 38, 27, 11, 18, 1, 52, 21, 35, 22, 48, 5, 25, 45, 18, 38, 2, 27, 35, 4, 57, 15, 62, 39, 57, 28, 42, 16, 36, 60, 24, 18, 10, 63, 20, 5, 16, 23, 37, 14, 59, 27, 41, 8, 13, 42, 21, 35, 6, 50, 3, 38, 15, 48, 30, 39, 17, 3, 49, 14, 53, 33, 24, 7, 61, 44, 11, 39, 23, 49, 19, 58, 1, 32, 36, 12, 60, 41, 20, 13, 41, 4, 39, 1, 48, 8, 18, 51, 14, 44, 5, 37, 21, 34, 1, 26, 10, 37 },
23 { 53, 36, 27, 9, 50, 12, 32, 55, 2, 57, 7, 17, 48, 34, 63, 15, 40, 26, 62, 11, 49, 6, 31, 39, 22, 42, 6, 63, 1, 39, 60, 4, 42, 61, 32, 45, 24, 44, 2, 60, 16, 41, 53, 1, 33, 61, 49, 17, 63, 23, 45, 26, 33, 3, 23, 46, 2, 50, 20, 4, 45, 34, 49, 30, 39, 58, 44, 31, 53, 34, 6, 52, 30, 47, 63, 1, 53, 22, 42, 31, 58, 23, 54, 22, 61, 8, 36, 59, 22, 35, 21, 1, 55, 40, 27, 16, 30, 54, 2, 29, 43, 16, 39, 63, 21, 46, 26, 10, 48, 32, 19, 53, 30, 56, 26, 60, 33, 4, 61, 23, 49, 59, 15, 53, 19, 58, 42, 16 },
24 { 20, 5, 59, 46, 25, 62, 7, 19, 43, 25, 37, 61, 11, 24, 4, 54, 12, 52, 3, 32, 17, 61, 12, 47, 15, 55, 18, 31, 53, 28, 9, 50, 21, 6, 55, 9, 58, 14, 54, 26, 33, 7, 31, 58, 13, 21, 8, 42, 29, 6, 37, 11, 48, 52, 14, 60, 11, 39, 56, 32, 14, 58, 7, 26, 17, 4, 42, 8, 11, 47, 19, 38, 10, 17, 26, 37, 9, 55, 28, 13, 18, 40, 6, 33, 1, 43, 25, 11, 51, 7, 62, 43, 18, 37, 3, 57, 45, 9, 38, 58, 5, 52, 27, 7, 17, 53, 5, 57, 37, 2, 63, 9, 22, 15, 11, 38, 25, 45, 35, 0, 28, 10, 41, 30, 50, 8, 31, 57 },
25 { 49, 33, 16, 38, 1, 42, 51, 34, 53, 14, 28, 49, 30, 56, 36, 23, 43, 20, 38, 56, 22, 45, 28, 0, 62, 35, 26, 44, 11, 19, 52, 35, 44, 15, 30, 38, 10, 31, 40, 4, 46, 50, 20, 40, 27, 44, 51, 14, 56, 53, 19, 59, 7, 29, 41, 19, 35, 25, 8, 52, 22, 44, 13, 53, 50, 32, 61, 24, 56, 25, 63, 0, 45, 57, 33, 59, 16, 46, 4, 62, 50, 11, 60, 37, 52, 19, 55, 29, 37, 46, 13, 26, 48, 10, 50, 34, 21, 63, 26, 13, 42, 33, 22, 55, 35, 28, 43, 15, 24, 51, 27, 34, 46, 49, 58, 3, 52, 9, 57, 19, 48, 55, 3, 35, 12, 45, 24, 3 },
26 { 41, 11, 56, 28, 18, 31, 22, 10, 37, 6, 47, 13, 3, 41, 9, 46, 0, 48, 29, 6, 34, 10, 55, 37, 20, 8, 49, 3, 41, 59, 14, 25, 0, 63, 19, 47, 27, 51, 17, 57, 23, 10, 61, 6, 54, 3, 38, 31, 0, 22, 34, 43, 20, 55, 31, 0, 49, 63, 29, 38, 3, 62, 28, 40, 0, 22, 14, 35, 2, 48, 15, 43, 23, 14, 3, 29, 49, 20, 39, 34, 0, 44, 29, 9, 15, 47, 5, 42, 0, 31, 58, 5, 31, 61, 23, 15, 0, 47, 19, 50, 24, 3, 59, 11, 44, 0, 31, 59, 6, 42, 17, 60, 0, 39, 20, 31, 43, 17, 29, 40, 12, 25, 60, 22, 52, 15, 63, 29 },
27 { 20, 52, 8, 44, 62, 4, 59, 49, 17, 63, 21, 39, 60, 18, 52, 27, 33, 59, 14, 51, 59, 43, 24, 5, 51, 30, 57, 17, 32, 5, 37, 56, 48, 34, 42, 3, 60, 5, 36, 13, 43, 37, 18, 34, 25, 12, 59, 24, 47, 36, 11, 50, 3, 38, 9, 58, 16, 5, 43, 18, 47, 10, 37, 18, 59, 46, 29, 52, 40, 12, 34, 28, 56, 36, 53, 7, 43, 8, 24, 52, 26, 17, 56, 43, 24, 32, 63, 20, 57, 16, 22, 52, 36, 8, 41, 56, 29, 32, 54, 7, 35, 57, 14, 48, 20, 62, 13, 39, 53, 29, 8, 45, 13, 29, 7, 61, 14, 54, 6, 63, 38, 32, 18, 43, 2, 39, 6, 47 },
28 { 0, 58, 23, 35, 13, 46, 12, 39, 0, 31, 55, 24, 5, 35, 15, 61, 17, 5, 39, 25, 18, 2, 50, 33, 41, 13, 39, 23, 62, 46, 29, 12, 22, 8, 56, 25, 20, 49, 32, 62, 0, 56, 11, 46, 63, 42, 9, 16, 55, 5, 60, 15, 62, 26, 45, 21, 36, 51, 13, 57, 31, 24, 55, 6, 35, 9, 57, 5, 20, 60, 7, 51, 5, 19, 40, 25, 61, 32, 56, 12, 36, 48, 21, 2, 58, 12, 39, 28, 9, 50, 40, 12, 44, 18, 25, 49, 6, 38, 11, 62, 18, 46, 30, 9, 40, 25, 49, 19, 10, 36, 55, 22, 33, 52, 41, 18, 37, 27, 49, 21, 2, 46, 7, 53, 33, 61, 27, 35 },
29 { 41, 31, 5, 39, 51, 26, 33, 57, 27, 41, 9, 44, 54, 29, 48, 7, 44, 36, 57, 10, 31, 63, 16, 45, 11, 60, 1, 47, 7, 20, 43, 3, 58, 36, 13, 52, 39, 7, 15, 28, 22, 48, 30, 21, 1, 29, 49, 44, 27, 17, 40, 30, 24, 42, 12, 53, 33, 7, 47, 20, 1, 42, 11, 49, 25, 43, 17, 32, 45, 27, 41, 21, 31, 62, 11, 49, 2, 15, 42, 5, 63, 7, 41, 27, 49, 6, 54, 23, 46, 34, 2, 28, 54, 3, 59, 12, 46, 17, 42, 28, 40, 1, 37, 51, 5, 55, 2, 34, 47, 16, 3, 62, 47, 5, 23, 56, 1, 44, 12, 34, 51, 16, 57, 11, 25, 17, 54, 13 },
30 { 60, 26, 55, 18, 3, 60, 20, 6, 52, 15, 50, 19, 32, 11, 23, 53, 26, 21, 1, 47, 42, 27, 8, 58, 21, 27, 53, 36, 26, 54, 31, 50, 17, 30, 45, 1, 29, 59, 44, 53, 41, 4, 35, 58, 51, 19, 32, 4, 52, 34, 48, 8, 51, 5, 56, 2, 25, 61, 27, 38, 54, 27, 62, 21, 51, 1, 39, 62, 10, 50, 1, 58, 13, 47, 38, 18, 35, 54, 22, 51, 30, 19, 59, 34, 14, 32, 44, 4, 60, 15, 52, 62, 20, 43, 30, 35, 21, 60, 4, 52, 12, 24, 61, 18, 30, 42, 23, 61, 25, 50, 27, 38, 11, 59, 12, 35, 50, 30, 59, 24, 8, 42, 28, 37, 48, 9, 44, 21 },
31 { 10, 47, 15, 50, 30, 43, 8, 45, 29, 2, 36, 59, 1, 58, 41, 3, 63, 31, 54, 20, 13, 55, 35, 38, 4, 44, 15, 9, 61, 2, 14, 38, 61, 10, 23, 54, 18, 12, 24, 2, 14, 55, 16, 8, 38, 14, 41, 60, 10, 23, 1, 58, 32, 17, 28, 37, 41, 15, 3, 60, 15, 33, 4, 36, 16, 59, 28, 14, 23, 55, 37, 18, 44, 28, 2, 57, 30, 10, 27, 46, 14, 38, 3, 53, 21, 61, 17, 35, 10, 41, 26, 7, 33, 9, 57, 1, 53, 37, 26, 20, 56, 48, 9, 33, 58, 16, 37, 7, 45, 1, 57, 15, 32, 26, 42, 23, 7, 20, 4, 54, 31, 62, 22, 1, 59, 30, 4, 51 },
32 { 36, 2, 38, 11, 24, 36, 54, 22, 62, 47, 25, 8, 28, 45, 16, 38, 12, 43, 9, 37, 49, 3, 23, 52, 18, 30, 50, 33, 19, 42, 49, 26, 6, 40, 47, 35, 63, 38, 50, 33, 60, 26, 36, 47, 24, 57, 6, 26, 39, 63, 19, 44, 14, 46, 61, 9, 50, 30, 45, 23, 10, 50, 44, 8, 31, 54, 6, 46, 36, 4, 30, 54, 8, 52, 22, 41, 4, 60, 40, 0, 58, 24, 45, 10, 37, 1, 48, 30, 56, 17, 38, 48, 24, 47, 19, 39, 14, 8, 45, 32, 2, 34, 27, 44, 4, 52, 11, 56, 31, 21, 40, 19, 44, 51, 2, 63, 46, 58, 36, 43, 14, 5, 50, 38, 14, 56, 40, 23 },
33 { 61, 46, 32, 63, 54, 1, 14, 34, 12, 40, 18, 49, 37, 10, 61, 30, 51, 24, 60, 7, 29, 40, 62, 11, 46, 58, 6, 56, 24, 10, 34, 52, 21, 59, 16, 3, 27, 5, 20, 46, 9, 40, 7, 62, 2, 30, 53, 15, 48, 10, 28, 35, 54, 6, 21, 34, 18, 55, 7, 40, 57, 19, 26, 60, 41, 13, 24, 51, 19, 61, 9, 25, 34, 15, 63, 11, 45, 17, 20, 47, 33, 8, 31, 62, 43, 26, 53, 7, 24, 59, 0, 13, 55, 4, 62, 27, 51, 31, 63, 15, 58, 7, 54, 14, 46, 22, 28, 43, 12, 63, 8, 54, 5, 17, 39, 33, 15, 10, 27, 17, 47, 34, 19, 45, 27, 12, 33, 17 },
34 { 5, 28, 21, 7, 17, 48, 42, 58, 23, 4, 63, 14, 55, 21, 34, 5, 19, 0, 45, 17, 52, 15, 25, 32, 0, 22, 40, 13, 45, 62, 18, 0, 43, 11, 33, 55, 30, 42, 57, 19, 51, 31, 22, 43, 18, 45, 34, 0, 43, 31, 56, 3, 23, 40, 59, 0, 44, 13, 48, 35, 2, 32, 46, 0, 21, 48, 35, 3, 40, 32, 43, 59, 0, 48, 33, 26, 53, 36, 55, 12, 51, 16, 55, 5, 18, 29, 11, 39, 51, 19, 45, 31, 42, 21, 35, 6, 22, 47, 10, 38, 23, 50, 20, 36, 0, 60, 38, 4, 50, 35, 48, 34, 24, 57, 9, 53, 28, 48, 61, 0, 56, 24, 53, 3, 63, 6, 42, 57 },
35 { 13, 53, 45, 40, 58, 27, 6, 16, 38, 51, 33, 30, 43, 2, 47, 56, 40, 50, 33, 57, 27, 5, 47, 42, 60, 36, 16, 54, 28, 4, 37, 57, 28, 51, 22, 8, 45, 14, 6, 39, 0, 54, 11, 59, 28, 12, 50, 21, 61, 13, 19, 38, 49, 11, 25, 37, 58, 29, 22, 63, 14, 56, 12, 53, 30, 63, 9, 57, 26, 12, 47, 16, 23, 39, 50, 6, 31, 2, 25, 6, 28, 41, 36, 22, 50, 57, 42, 3, 34, 8, 28, 61, 11, 50, 16, 54, 41, 0, 55, 43, 5, 29, 41, 63, 25, 16, 53, 18, 26, 10, 21, 0, 61, 30, 41, 22, 3, 38, 20, 39, 29, 8, 41, 16, 36, 52, 22, 19 },
36 { 55, 34, 0, 25, 10, 32, 56, 44, 28, 0, 57, 7, 26, 53, 23, 8, 13, 35, 22, 12, 36, 60, 20, 8, 14, 29, 48, 2, 41, 49, 23, 13, 39, 7, 48, 58, 25, 53, 34, 62, 28, 16, 48, 4, 37, 56, 27, 5, 36, 52, 46, 7, 62, 33, 52, 11, 17, 53, 5, 28, 41, 24, 38, 17, 5, 39, 20, 45, 15, 56, 5, 38, 60, 8, 14, 57, 21, 48, 62, 39, 59, 13, 1, 60, 9, 32, 16, 63, 44, 25, 52, 15, 36, 2, 60, 29, 12, 33, 25, 17, 59, 45, 13, 8, 49, 32, 6, 40, 59, 29, 45, 37, 13, 47, 6, 55, 30, 45, 9, 52, 13, 59, 25, 47, 32, 1, 49, 30 },
37 { 9, 39, 14, 61, 49, 37, 3, 20, 50, 13, 41, 19, 46, 17, 38, 59, 28, 62, 4, 44, 54, 1, 34, 51, 55, 7, 63, 32, 21, 8, 56, 31, 62, 19, 36, 1, 41, 17, 24, 12, 42, 35, 25, 52, 20, 8, 44, 59, 25, 2, 22, 42, 16, 29, 4, 46, 20, 36, 43, 9, 51, 8, 49, 26, 58, 33, 54, 1, 37, 29, 52, 20, 27, 45, 19, 35, 42, 16, 10, 32, 20, 49, 46, 27, 40, 4, 47, 22, 13, 55, 4, 47, 26, 44, 23, 40, 58, 19, 48, 13, 31, 2, 57, 34, 42, 19, 61, 32, 14, 55, 5, 51, 26, 19, 58, 16, 49, 14, 62, 5, 33, 44, 21, 7, 60, 26, 11, 41 },
38 { 62, 24, 47, 29, 8, 19, 53, 11, 60, 24, 32, 61, 4, 55, 31, 2, 49, 16, 39, 9, 31, 24, 43, 17, 26, 38, 11, 25, 58, 43, 12, 35, 3, 46, 15, 32, 63, 4, 49, 56, 2, 60, 10, 32, 63, 17, 39, 12, 55, 30, 57, 9, 48, 55, 39, 24, 60, 2, 58, 31, 19, 61, 34, 3, 42, 11, 22, 46, 7, 61, 10, 42, 3, 55, 32, 1, 58, 28, 44, 54, 4, 34, 23, 15, 56, 20, 37, 58, 6, 30, 38, 18, 63, 9, 32, 5, 51, 3, 62, 37, 52, 18, 39, 23, 3, 51, 9, 47, 1, 23, 43, 15, 60, 35, 11, 40, 1, 36, 31, 26, 57, 2, 37, 54, 18, 44, 58, 16 },
39 { 5, 51, 3, 33, 43, 62, 21, 42, 35, 9, 48, 15, 36, 10, 22, 42, 20, 46, 26, 56, 50, 12, 59, 3, 48, 19, 45, 53, 1, 27, 47, 17, 52, 24, 56, 11, 51, 21, 37, 30, 20, 46, 14, 41, 1, 47, 33, 7, 41, 17, 35, 27, 20, 1, 14, 54, 26, 33, 18, 47, 1, 44, 14, 59, 16, 52, 28, 18, 49, 31, 25, 34, 63, 13, 51, 24, 9, 50, 3, 23, 38, 63, 7, 52, 29, 46, 11, 33, 50, 22, 57, 36, 1, 57, 49, 17, 39, 28, 9, 35, 6, 27, 53, 15, 55, 30, 24, 58, 36, 41, 11, 52, 32, 3, 44, 25, 62, 23, 51, 15, 42, 22, 50, 10, 39, 4, 31, 35 },
40 { 46, 22, 57, 17, 12, 39, 26, 5, 31, 59, 1, 45, 27, 62, 52, 7, 58, 33, 6, 18, 39, 22, 33, 41, 57, 5, 35, 18, 40, 16, 60, 5, 29, 42, 7, 39, 27, 44, 9, 47, 8, 26, 54, 22, 51, 29, 24, 49, 15, 61, 4, 51, 31, 63, 43, 6, 50, 8, 39, 12, 53, 37, 23, 30, 40, 6, 62, 43, 14, 53, 2, 49, 7, 36, 17, 41, 61, 37, 18, 56, 11, 18, 44, 35, 2, 19, 61, 0, 41, 14, 8, 30, 43, 12, 24, 46, 14, 54, 42, 21, 44, 61, 10, 46, 37, 11, 44, 7, 18, 63, 20, 29, 7, 49, 28, 54, 8, 43, 4, 48, 18, 63, 12, 29, 48, 24, 59, 20 },
41 { 13, 36, 28, 54, 35, 2, 56, 46, 16, 49, 22, 40, 11, 34, 14, 43, 29, 12, 63, 48, 2, 61, 7, 15, 28, 30, 50, 9, 61, 33, 38, 23, 54, 13, 61, 33, 3, 59, 16, 35, 58, 40, 5, 38, 13, 57, 3, 58, 37, 21, 45, 12, 39, 7, 35, 30, 13, 56, 22, 62, 27, 6, 55, 10, 48, 21, 33, 2, 38, 23, 40, 20, 44, 29, 59, 4, 26, 12, 33, 47, 28, 53, 31, 13, 59, 41, 27, 49, 26, 54, 45, 16, 53, 21, 35, 7, 59, 26, 11, 56, 1, 24, 33, 4, 28, 62, 21, 49, 31, 2, 56, 39, 24, 58, 13, 17, 37, 21, 56, 10, 38, 0, 34, 55, 15, 43, 1, 52 },
42 { 42, 9, 50, 6, 25, 60, 14, 38, 10, 29, 53, 18, 57, 3, 25, 51, 0, 53, 25, 17, 29, 37, 52, 46, 0, 62, 14, 37, 4, 50, 10, 44, 0, 46, 20, 25, 50, 19, 55, 0, 23, 31, 62, 34, 11, 45, 19, 32, 0, 53, 10, 59, 23, 47, 18, 60, 42, 28, 37, 3, 50, 15, 35, 44, 0, 51, 27, 60, 9, 57, 16, 58, 11, 22, 46, 15, 53, 48, 7, 42, 0, 60, 5, 49, 24, 54, 9, 17, 39, 5, 34, 62, 3, 40, 60, 31, 0, 47, 29, 16, 49, 39, 59, 17, 50, 0, 40, 13, 53, 38, 16, 46, 0, 42, 34, 60, 2, 53, 29, 31, 58, 46, 27, 6, 61, 8, 37, 28 },
43 { 0, 63, 21, 40, 45, 18, 51, 23, 63, 34, 6, 43, 28, 38, 55, 19, 40, 35, 8, 41, 54, 10, 21, 32, 39, 23, 53, 26, 55, 28, 22, 63, 30, 34, 9, 48, 6, 38, 29, 43, 49, 6, 18, 52, 27, 61, 9, 43, 28, 42, 33, 26, 56, 3, 51, 23, 0, 48, 16, 45, 32, 25, 63, 20, 57, 17, 42, 12, 35, 47, 5, 31, 39, 56, 6, 30, 34, 21, 61, 25, 14, 40, 22, 38, 15, 6, 36, 56, 20, 60, 25, 12, 51, 27, 10, 56, 42, 20, 36, 63, 32, 6, 21, 41, 12, 34, 60, 26, 5, 48, 27, 10, 62, 19, 6, 47, 39, 14, 45, 7, 24, 17, 41, 32, 23, 51, 19, 56 },
44 { 45, 31, 15, 59, 4, 33, 7, 47, 0, 41, 13, 61, 4, 47, 9, 23, 60, 14, 57, 31, 4, 45, 59, 6, 58, 10, 44, 20, 8, 42, 15, 6, 55, 17, 58, 31, 53, 12, 61, 10, 15, 57, 43, 2, 23, 35, 48, 14, 54, 6, 18, 49, 15, 38, 11, 34, 62, 9, 21, 58, 11, 41, 4, 31, 38, 8, 29, 55, 19, 36, 27, 52, 0, 25, 50, 43, 1, 39, 8, 55, 35, 51, 10, 30, 45, 62, 29, 2, 46, 10, 32, 48, 18, 38, 5, 22, 33, 8, 51, 3, 14, 44, 54, 25, 57, 30, 18, 52, 33, 22, 59, 28, 36, 52, 32, 21, 26, 50, 5, 55, 35, 60, 14, 54, 4, 40, 16, 33 },
45 { 27, 3, 49, 10, 30, 40, 55, 27, 57, 24, 52, 21, 32, 17, 60, 30, 5, 44, 27, 49, 19, 34, 13, 24, 43, 36, 3, 49, 31, 59, 37, 48, 26, 41, 2, 41, 14, 36, 21, 32, 40, 26, 13, 49, 55, 5, 16, 40, 25, 60, 36, 1, 63, 29, 17, 44, 25, 40, 52, 5, 29, 47, 54, 13, 46, 24, 60, 4, 51, 22, 63, 14, 45, 18, 12, 62, 17, 57, 19, 42, 3, 26, 58, 48, 1, 21, 40, 52, 23, 37, 44, 1, 29, 58, 43, 50, 15, 61, 19, 45, 58, 28, 7, 48, 2, 46, 8, 42, 3, 55, 8, 50, 12, 4, 55, 10, 63, 33, 20, 40, 11, 3, 46, 20, 48, 26, 61, 11 },
46 { 44, 56, 24, 36, 53, 19, 12, 37, 16, 44, 7, 36, 49, 54, 11, 37, 48, 21, 15, 1, 62, 25, 47, 56, 16, 18, 51, 12, 40, 1, 24, 11, 52, 16, 23, 59, 28, 1, 45, 53, 4, 60, 37, 21, 39, 30, 63, 20, 52, 10, 30, 45, 8, 41, 54, 4, 57, 7, 34, 55, 36, 18, 23, 59, 2, 48, 11, 32, 44, 1, 41, 8, 33, 54, 38, 23, 30, 46, 6, 29, 62, 18, 32, 16, 55, 34, 14, 11, 61, 7, 55, 16, 53, 13, 23, 2, 55, 37, 26, 10, 33, 23, 36, 16, 38, 22, 56, 15, 24, 43, 35, 17, 44, 40, 25, 46, 16, 1, 57, 25, 49, 36, 28, 62, 9, 35, 7, 53 },
47 { 17, 38, 8, 61, 1, 50, 26, 62, 3, 31, 56, 15, 1, 26, 40, 2, 34, 51, 56, 36, 42, 9, 38, 2, 29, 60, 32, 57, 19, 62, 34, 47, 4, 57, 39, 7, 44, 63, 24, 18, 46, 28, 8, 54, 1, 34, 7, 46, 3, 37, 50, 23, 57, 21, 13, 46, 31, 20, 43, 15, 1, 61, 8, 33, 37, 17, 56, 26, 15, 49, 24, 59, 28, 3, 56, 9, 52, 32, 13, 49, 10, 43, 5, 45, 8, 25, 59, 42, 28, 33, 19, 40, 8, 63, 35, 47, 25, 4, 40, 52, 1, 60, 12, 53, 63, 9, 29, 60, 37, 19, 1, 62, 31, 20, 58, 12, 41, 30, 43, 9, 18, 52, 22, 1, 39, 30, 58, 21 },
48 { 13, 47, 29, 18, 43, 34, 5, 48, 20, 42, 10, 45, 30, 58, 20, 63, 24, 11, 6, 28, 54, 14, 22, 52, 41, 7, 26, 5, 45, 15, 53, 13, 35, 27, 18, 50, 12, 33, 5, 56, 10, 17, 45, 24, 59, 15, 50, 26, 56, 13, 19, 5, 32, 52, 27, 36, 2, 61, 12, 26, 49, 40, 27, 52, 13, 50, 6, 39, 61, 34, 10, 37, 48, 20, 41, 27, 2, 36, 59, 24, 54, 33, 63, 20, 38, 50, 3, 17, 52, 4, 58, 27, 45, 21, 32, 11, 48, 17, 57, 20, 46, 38, 25, 43, 4, 34, 51, 6, 13, 45, 57, 26, 6, 48, 2, 35, 53, 23, 61, 34, 59, 6, 42, 56, 13, 51, 2, 41 },
49 { 32, 5, 55, 23, 58, 14, 22, 52, 29, 15, 61, 25, 51, 8, 43, 13, 53, 41, 46, 20, 3, 33, 63, 11, 48, 21, 54, 38, 28, 3, 30, 43, 21, 62, 9, 31, 55, 22, 51, 29, 37, 62, 32, 12, 42, 29, 41, 9, 33, 44, 62, 28, 43, 1, 59, 19, 48, 30, 51, 39, 24, 4, 58, 19, 42, 29, 22, 43, 3, 18, 53, 5, 13, 50, 16, 60, 45, 21, 7, 40, 15, 0, 26, 53, 13, 31, 43, 24, 47, 31, 15, 49, 2, 41, 6, 59, 29, 42, 9, 30, 14, 7, 49, 18, 31, 47, 20, 39, 49, 32, 11, 41, 54, 15, 61, 18, 7, 38, 4, 13, 44, 28, 15, 32, 45, 19, 27, 49 },
50 { 63, 34, 11, 39, 2, 45, 37, 8, 59, 39, 33, 4, 36, 17, 48, 5, 29, 18, 32, 61, 39, 50, 5, 27, 35, 0, 46, 12, 22, 49, 60, 6, 54, 0, 38, 49, 2, 42, 15, 40, 0, 47, 20, 51, 3, 57, 18, 61, 22, 0, 39, 16, 55, 12, 35, 8, 41, 22, 6, 59, 16, 45, 10, 36, 0, 62, 9, 54, 30, 58, 21, 43, 63, 31, 7, 35, 12, 48, 58, 28, 47, 37, 41, 9, 57, 20, 61, 0, 36, 11, 57, 35, 23, 52, 37, 18, 0, 62, 22, 55, 35, 62, 27, 54, 0, 15, 61, 28, 2, 59, 22, 9, 37, 27, 33, 51, 29, 48, 19, 50, 25, 37, 10, 57, 5, 37, 60, 8 },
51 { 20, 25, 46, 52, 31, 60, 12, 55, 0, 19, 11, 46, 62, 35, 23, 38, 57, 0, 55, 10, 16, 30, 58, 44, 17, 59, 29, 63, 42, 8, 36, 20, 33, 46, 16, 61, 25, 35, 8, 54, 26, 7, 58, 22, 34, 6, 47, 14, 53, 31, 48, 9, 37, 25, 49, 63, 16, 55, 45, 14, 34, 63, 21, 53, 25, 33, 46, 16, 35, 7, 46, 29, 0, 39, 25, 55, 22, 34, 18, 4, 56, 11, 23, 51, 28, 6, 39, 14, 62, 44, 19, 8, 60, 12, 56, 28, 50, 34, 39, 5, 51, 3, 41, 12, 57, 35, 10, 53, 25, 17, 52, 30, 47, 0, 43, 14, 5, 57, 31, 55, 0, 63, 47, 23, 54, 24, 14, 43 },
52 { 0, 57, 16, 6, 26, 19, 35, 28, 49, 42, 54, 26, 21, 1, 59, 27, 9, 47, 26, 44, 50, 22, 13, 40, 8, 37, 10, 34, 17, 56, 25, 58, 13, 27, 44, 9, 20, 58, 31, 17, 60, 36, 10, 41, 53, 25, 36, 39, 4, 24, 58, 17, 60, 4, 22, 38, 10, 32, 0, 50, 31, 7, 28, 47, 12, 57, 5, 26, 52, 23, 14, 40, 57, 17, 47, 5, 53, 1, 44, 31, 19, 60, 46, 2, 35, 48, 30, 54, 22, 5, 51, 39, 25, 31, 4, 43, 14, 9, 45, 16, 24, 44, 19, 29, 40, 23, 44, 7, 38, 42, 4, 63, 12, 54, 23, 59, 22, 42, 8, 15, 40, 21, 8, 34, 3, 41, 30, 50 },
53 { 39, 10, 48, 33, 41, 54, 5, 47, 23, 13, 32, 7, 52, 44, 14, 39, 58, 18, 35, 6, 37, 2, 60, 24, 55, 19, 53, 2, 51, 32, 1, 41, 51, 4, 40, 29, 47, 3, 52, 44, 13, 49, 28, 16, 1, 62, 11, 27, 52, 35, 5, 42, 29, 47, 14, 56, 28, 53, 26, 38, 9, 56, 40, 3, 38, 15, 41, 60, 1, 37, 50, 25, 11, 28, 61, 19, 42, 62, 10, 52, 39, 6, 32, 14, 58, 17, 7, 26, 42, 34, 27, 10, 54, 40, 20, 63, 26, 53, 21, 61, 32, 7, 59, 48, 3, 56, 18, 31, 58, 14, 49, 21, 36, 16, 45, 9, 36, 24, 62, 45, 27, 31, 53, 17, 49, 12, 62, 18 },
54 { 28, 59, 21, 58, 2, 16, 38, 9, 62, 3, 56, 41, 10, 31, 50, 4, 32, 52, 12, 63, 23, 46, 33, 31, 4, 48, 25, 43, 14, 23, 47, 11, 22, 55, 14, 60, 23, 37, 11, 39, 23, 2, 45, 56, 31, 43, 19, 55, 16, 46, 21, 51, 11, 33, 44, 2, 41, 18, 5, 52, 23, 44, 17, 60, 27, 49, 11, 32, 44, 10, 54, 2, 56, 33, 8, 38, 13, 29, 36, 16, 24, 63, 27, 51, 21, 43, 56, 12, 49, 3, 59, 48, 1, 15, 46, 7, 36, 2, 47, 11, 50, 27, 37, 13, 33, 8, 51, 46, 1, 34, 28, 40, 3, 33, 60, 29, 47, 1, 35, 11, 59, 42, 2, 60, 26, 46, 6, 35 },
55 { 4, 43, 9, 29, 36, 63, 24, 44, 20, 50, 30, 17, 60, 22, 16, 43, 25, 3, 42, 19, 51, 15, 8, 54, 42, 15, 61, 5, 39, 57, 18, 61, 31, 48, 34, 2, 50, 19, 57, 5, 63, 33, 19, 38, 13, 27, 48, 7, 32, 61, 2, 26, 58, 6, 24, 50, 13, 61, 42, 20, 62, 2, 35, 20, 51, 4, 62, 18, 23, 58, 20, 31, 43, 15, 51, 45, 26, 50, 4, 55, 45, 3, 35, 9, 38, 1, 32, 61, 20, 45, 17, 33, 24, 57, 29, 51, 22, 58, 38, 30, 15, 1, 54, 21, 63, 43, 26, 12, 24, 56, 8, 60, 50, 19, 5, 52, 13, 54, 17, 50, 4, 16, 36, 12, 32, 56, 22, 54 },
56 { 51, 25, 40, 53, 12, 49, 15, 57, 34, 7, 38, 47, 2, 36, 55, 8, 61, 30, 56, 7, 28, 59, 48, 11, 27, 35, 21, 45, 28, 36, 9, 38, 6, 16, 24, 63, 10, 32, 28, 43, 21, 53, 5, 60, 8, 57, 3, 45, 11, 37, 15, 54, 40, 20, 62, 36, 27, 34, 11, 48, 30, 15, 54, 8, 30, 42, 22, 34, 48, 13, 35, 63, 4, 37, 22, 2, 59, 9, 41, 23, 13, 41, 49, 18, 59, 24, 40, 5, 37, 30, 9, 61, 44, 6, 37, 11, 33, 17, 5, 55, 41, 60, 23, 39, 17, 5, 30, 62, 41, 16, 46, 25, 11, 56, 39, 26, 20, 38, 29, 39, 22, 52, 44, 20, 48, 1, 38, 14 },
57 { 15, 33, 2, 18, 44, 6, 27, 0, 32, 61, 25, 12, 58, 28, 40, 20, 47, 13, 34, 43, 38, 1, 23, 62, 40, 0, 51, 10, 63, 3, 52, 26, 44, 30, 45, 6, 41, 54, 0, 51, 12, 30, 46, 24, 49, 22, 40, 33, 63, 23, 43, 30, 9, 47, 0, 17, 54, 7, 57, 3, 37, 47, 24, 46, 13, 55, 7, 52, 2, 42, 6, 26, 49, 18, 60, 34, 16, 57, 33, 20, 61, 30, 8, 54, 14, 46, 12, 53, 16, 55, 38, 13, 22, 53, 18, 59, 46, 27, 43, 19, 32, 10, 45, 6, 49, 36, 52, 2, 20, 55, 6, 39, 32, 15, 44, 3, 58, 10, 63, 6, 56, 30, 7, 58, 9, 40, 19, 63 },
58 { 10, 47, 61, 23, 55, 31, 52, 42, 17, 45, 4, 51, 27, 6, 15, 53, 0, 49, 26, 10, 56, 18, 36, 6, 20, 58, 32, 30, 13, 49, 19, 56, 0, 59, 12, 53, 27, 17, 38, 25, 48, 9, 15, 36, 14, 30, 59, 17, 0, 50, 8, 58, 18, 56, 31, 45, 21, 41, 29, 19, 60, 6, 32, 59, 0, 36, 29, 39, 19, 59, 46, 12, 55, 30, 10, 47, 24, 3, 28, 48, 0, 55, 44, 27, 33, 4, 63, 29, 49, 0, 26, 50, 34, 2, 42, 14, 0, 62, 9, 56, 3, 52, 28, 34, 58, 9, 20, 48, 37, 32, 22, 53, 0, 62, 27, 49, 34, 46, 21, 33, 41, 14, 25, 37, 53, 29, 31, 45 },
59 { 56, 28, 7, 37, 11, 36, 20, 9, 54, 14, 39, 19, 34, 63, 45, 37, 24, 17, 60, 31, 21, 45, 53, 29, 47, 15, 7, 55, 40, 23, 34, 14, 42, 20, 37, 35, 15, 59, 7, 62, 34, 40, 59, 1, 51, 42, 10, 28, 54, 21, 35, 5, 38, 13, 36, 4, 59, 12, 39, 53, 15, 43, 9, 21, 39, 62, 16, 56, 25, 9, 32, 38, 0, 41, 14, 51, 40, 53, 43, 11, 37, 17, 5, 22, 57, 39, 19, 7, 42, 21, 60, 10, 31, 63, 25, 52, 30, 49, 36, 25, 48, 17, 61, 14, 22, 42, 29, 13, 60, 11, 47, 18, 35, 41, 7, 23, 4, 16, 51, 11, 0, 48, 61, 3, 17, 50, 5, 24 },
60 { 0, 42, 21, 49, 60, 3, 57, 40, 29, 48, 23, 56, 42, 11, 22, 5, 59, 39, 4, 50, 3, 41, 12, 57, 25, 50, 44, 18, 4, 46, 7, 62, 33, 50, 4, 56, 21, 32, 43, 18, 3, 23, 55, 34, 20, 4, 53, 38, 12, 46, 29, 52, 25, 61, 23, 51, 26, 46, 1, 34, 25, 57, 28, 51, 26, 11, 50, 3, 44, 28, 53, 21, 57, 27, 62, 6, 31, 19, 8, 63, 26, 59, 36, 47, 15, 29, 50, 25, 35, 47, 18, 41, 4, 48, 8, 40, 12, 23, 6, 44, 13, 40, 1, 31, 55, 0, 61, 43, 4, 50, 26, 58, 9, 53, 24, 61, 42, 55, 31, 43, 57, 20, 34, 27, 43, 8, 59, 39 },
61 { 18, 51, 30, 13, 26, 16, 46, 22, 2, 59, 8, 30, 1, 48, 33, 51, 29, 9, 46, 16, 62, 14, 33, 2, 38, 9, 27, 60, 37, 26, 53, 17, 28, 10, 24, 46, 2, 49, 8, 57, 29, 45, 6, 26, 62, 44, 18, 25, 61, 3, 42, 14, 49, 10, 43, 6, 17, 32, 63, 10, 49, 4, 40, 14, 45, 33, 22, 37, 12, 61, 5, 17, 43, 7, 23, 37, 15, 58, 49, 13, 39, 21, 10, 52, 1, 62, 9, 56, 12, 2, 58, 28, 36, 16, 56, 28, 56, 35, 20, 63, 24, 37, 51, 8, 45, 25, 16, 33, 27, 38, 2, 44, 13, 30, 17, 36, 12, 26, 5, 18, 28, 47, 13, 60, 23, 45, 13, 33 },
62 { 55, 4, 62, 34, 52, 38, 7, 63, 32, 37, 13, 53, 25, 62, 18, 12, 55, 41, 27, 35, 24, 49, 31, 52, 17, 63, 34, 1, 56, 12, 41, 2, 48, 58, 39, 16, 61, 27, 41, 52, 13, 19, 50, 39, 11, 31, 57, 6, 32, 40, 20, 55, 1, 28, 33, 57, 48, 8, 37, 22, 44, 18, 53, 1, 61, 5, 54, 16, 47, 36, 50, 24, 55, 34, 48, 45, 1, 30, 33, 46, 2, 50, 32, 42, 25, 34, 43, 21, 38, 52, 23, 45, 14, 54, 21, 4, 44, 16, 53, 29, 10, 47, 19, 57, 12, 54, 39, 10, 51, 15, 63, 21, 57, 40, 51, 1, 48, 57, 37, 62, 2, 38, 9, 52, 1, 35, 58, 22 },
63 { 36, 46, 10, 42, 1, 27, 43, 15, 50, 21, 45, 16, 41, 3, 35, 44, 20, 1, 57, 11, 55, 7, 43, 8, 22, 42, 13, 46, 21, 39, 31, 60, 22, 5, 29, 44, 11, 35, 20, 4, 36, 58, 32, 15, 47, 2, 36, 48, 16, 60, 8, 35, 44, 63, 16, 2, 40, 26, 55, 14, 58, 35, 24, 31, 19, 42, 31, 58, 1, 29, 10, 40, 2, 19, 12, 54, 22, 61, 7, 24, 56, 5, 28, 16, 54, 3, 15, 58, 6, 30, 8, 62, 1, 43, 31, 47, 7, 59, 1, 38, 58, 4, 34, 27, 38, 5, 31, 59, 7, 46, 30, 3, 34, 6, 28, 59, 20, 8, 32, 15, 53, 24, 55, 31, 19, 49, 11, 26 },
64 { 2, 24, 16, 58, 19, 55, 5, 35, 10, 61, 4, 28, 57, 24, 58, 7, 31, 47, 22, 38, 19, 28, 61, 36, 54, 5, 59, 29, 6, 52, 15, 11, 43, 36, 8, 54, 52, 1, 62, 25, 47, 9, 1, 60, 28, 53, 24, 14, 46, 27, 51, 22, 12, 24, 38, 53, 20, 11, 51, 3, 29, 7, 48, 63, 8, 49, 9, 21, 52, 14, 63, 32, 46, 60, 35, 4, 41, 16, 52, 35, 18, 42, 59, 7, 36, 61, 45, 27, 33, 51, 19, 39, 34, 11, 61, 18, 33, 41, 28, 15, 54, 22, 42, 3, 49, 21, 47, 18, 36, 23, 55, 19, 48, 24, 45, 10, 33, 44, 50, 40, 7, 35, 15, 41, 63, 6, 40, 54 },
65 { 62, 41, 32, 8, 47, 28, 60, 24, 44, 30, 38, 49, 9, 33, 14, 40, 50, 14, 60, 2, 54, 40, 0, 20, 25, 39, 16, 49, 24, 35, 57, 47, 19, 61, 33, 18, 23, 37, 13, 55, 31, 43, 22, 41, 17, 8, 42, 58, 0, 37, 5, 56, 31, 54, 7, 30, 60, 33, 42, 17, 59, 39, 12, 27, 38, 17, 35, 41, 27, 45, 20, 7, 25, 15, 29, 58, 27, 47, 11, 40, 14, 54, 23, 46, 19, 31, 11, 40, 13, 49, 5, 58, 24, 51, 26, 6, 50, 20, 49, 9, 32, 46, 17, 60, 14, 63, 24, 1, 57, 41, 9, 43, 14, 62, 16, 52, 3, 27, 14, 22, 61, 45, 4, 28, 9, 47, 29, 17 },
66 { 5, 50, 12, 53, 38, 18, 11, 51, 0, 55, 17, 6, 47, 54, 19, 63, 5, 26, 34, 45, 13, 30, 47, 58, 10, 48, 32, 3, 62, 9, 26, 0, 25, 14, 50, 3, 47, 30, 42, 16, 6, 63, 12, 49, 33, 55, 21, 10, 34, 63, 18, 41, 3, 47, 19, 43, 0, 49, 8, 28, 46, 20, 52, 0, 56, 24, 60, 3, 59, 5, 39, 57, 48, 52, 9, 38, 3, 21, 26, 60, 0, 32, 12, 38, 4, 48, 53, 0, 60, 15, 29, 44, 18, 10, 38, 57, 13, 60, 2, 26, 62, 7, 50, 29, 35, 8, 40, 53, 28, 12, 60, 33, 38, 5, 37, 29, 60, 39, 56, 0, 30, 18, 50, 34, 59, 25, 14, 44 },
67 { 20, 31, 60, 22, 3, 49, 33, 25, 40, 13, 34, 59, 22, 36, 0, 28, 37, 56, 8, 18, 51, 16, 4, 45, 27, 12, 53, 42, 18, 44, 51, 31, 55, 40, 28, 58, 7, 60, 10, 51, 27, 37, 24, 56, 5, 26, 44, 29, 50, 23, 45, 11, 34, 15, 59, 27, 13, 23, 62, 37, 4, 57, 15, 32, 42, 6, 47, 11, 30, 43, 23, 13, 0, 36, 18, 44, 63, 51, 37, 29, 49, 20, 57, 27, 62, 9, 24, 35, 23, 53, 37, 3, 42, 55, 0, 36, 23, 39, 31, 43, 17, 37, 24, 11, 52, 43, 19, 32, 5, 50, 26, 0, 56, 21, 54, 11, 19, 6, 47, 25, 59, 42, 12, 54, 21, 3, 38, 57 },
68 { 48, 0, 35, 27, 44, 14, 59, 7, 57, 46, 26, 2, 42, 12, 52, 43, 10, 27, 53, 42, 32, 62, 37, 21, 34, 61, 7, 23, 36, 4, 38, 12, 41, 5, 17, 45, 22, 27, 39, 21, 59, 0, 45, 18, 39, 62, 3, 38, 14, 7, 54, 26, 61, 39, 9, 52, 45, 36, 18, 50, 10, 34, 44, 22, 50, 14, 36, 55, 17, 34, 53, 62, 33, 26, 56, 6, 31, 12, 6, 53, 9, 44, 2, 50, 20, 40, 55, 17, 47, 7, 26, 63, 22, 32, 48, 16, 46, 8, 52, 12, 57, 41, 0, 56, 25, 3, 61, 14, 45, 35, 18, 44, 12, 46, 23, 42, 32, 51, 35, 10, 17, 36, 23, 1, 45, 52, 32, 10 },
69 { 37, 15, 43, 8, 63, 39, 21, 31, 16, 37, 19, 62, 30, 46, 17, 60, 21, 48, 1, 23, 6, 25, 11, 56, 1, 40, 30, 58, 15, 54, 21, 59, 9, 63, 35, 56, 11, 51, 2, 46, 34, 14, 53, 7, 30, 11, 51, 19, 60, 40, 30, 1, 24, 50, 20, 32, 3, 56, 5, 25, 31, 13, 61, 2, 29, 60, 25, 20, 51, 2, 27, 8, 18, 42, 10, 45, 21, 34, 43, 17, 62, 29, 41, 14, 34, 6, 30, 43, 2, 57, 33, 13, 45, 12, 27, 62, 4, 55, 21, 35, 5, 27, 45, 33, 16, 47, 30, 54, 22, 10, 51, 27, 63, 7, 49, 1, 58, 22, 15, 43, 53, 7, 57, 39, 27, 12, 61, 24 },
70 { 56, 51, 26, 56, 19, 2, 41, 54, 5, 52, 9, 48, 6, 23, 39, 4, 32, 15, 63, 35, 59, 49, 43, 15, 52, 19, 50, 9, 46, 33, 1, 29, 48, 20, 32, 1, 38, 33, 19, 54, 9, 32, 24, 48, 58, 35, 16, 48, 4, 52, 13, 57, 33, 5, 45, 59, 15, 29, 41, 55, 47, 39, 23, 53, 9, 40, 4, 57, 10, 44, 48, 40, 50, 14, 61, 24, 55, 1, 59, 22, 33, 8, 51, 25, 58, 46, 11, 59, 20, 41, 17, 51, 6, 56, 35, 25, 42, 30, 15, 58, 48, 18, 61, 9, 58, 39, 13, 2, 37, 59, 40, 2, 31, 16, 34, 41, 8, 30, 62, 3, 29, 48, 33, 5, 63, 16, 41, 7 },
71 { 22, 4, 46, 11, 33, 51, 29, 10, 62, 24, 43, 27, 15, 58, 50, 25, 54, 44, 9, 38, 18, 3, 29, 57, 32, 5, 26, 43, 17, 61, 24, 52, 8, 42, 23, 53, 15, 61, 7, 28, 57, 43, 4, 40, 20, 2, 43, 25, 32, 35, 21, 43, 17, 48, 10, 22, 38, 54, 11, 21, 1, 58, 16, 30, 48, 18, 46, 32, 38, 13, 22, 4, 59, 35, 2, 51, 30, 39, 15, 47, 4, 56, 13, 37, 1, 28, 16, 52, 32, 9, 61, 29, 38, 19, 3, 52, 10, 48, 1, 32, 11, 40, 20, 36, 6, 22, 49, 29, 55, 6, 20, 56, 36, 52, 19, 60, 26, 46, 18, 54, 40, 13, 20, 46, 35, 19, 49, 29 },
72 { 61, 17, 34, 53, 23, 6, 48, 35, 20, 40, 1, 56, 36, 29, 11, 34, 7, 41, 14, 30, 55, 20, 46, 8, 24, 38, 63, 2, 37, 10, 45, 14, 34, 49, 6, 13, 44, 25, 49, 41, 21, 12, 61, 15, 54, 29, 63, 12, 56, 8, 49, 2, 62, 36, 28, 61, 0, 25, 41, 63, 35, 8, 44, 6, 37, 62, 7, 21, 63, 28, 55, 31, 16, 24, 41, 19, 9, 57, 27, 36, 18, 42, 31, 62, 22, 55, 38, 4, 27, 47, 1, 40, 14, 54, 43, 20, 60, 23, 38, 63, 25, 51, 2, 53, 26, 63, 10, 42, 17, 34, 47, 25, 13, 5, 44, 11, 55, 2, 38, 27, 6, 60, 52, 25, 9, 55, 1, 40 },
73 { 8, 30, 58, 3, 42, 61, 17, 38, 13, 59, 32, 10, 54, 3, 51, 20, 61, 26, 57, 2, 46, 33, 12, 60, 41, 13, 48, 29, 55, 20, 39, 27, 57, 18, 62, 29, 55, 2, 31, 16, 37, 50, 26, 36, 6, 46, 9, 41, 27, 57, 23, 39, 26, 6, 51, 12, 31, 46, 7, 16, 27, 52, 19, 56, 26, 12, 33, 53, 1, 41, 8, 57, 46, 7, 54, 32, 47, 5, 49, 11, 60, 23, 5, 48, 10, 43, 19, 63, 35, 24, 49, 21, 59, 5, 31, 37, 14, 44, 7, 42, 6, 30, 46, 13, 44, 32, 19, 50, 4, 58, 8, 30, 62, 38, 28, 53, 21, 36, 13, 50, 21, 33, 15, 2, 44, 31, 14, 47 },
74 { 37, 13, 39, 16, 28, 9, 57, 0, 25, 49, 21, 45, 18, 47, 12, 42, 0, 49, 22, 39, 16, 53, 25, 36, 0, 52, 22, 16, 6, 60, 4, 51, 0, 26, 37, 47, 10, 36, 63, 5, 57, 0, 18, 59, 23, 33, 51, 19, 0, 44, 15, 11, 54, 17, 42, 35, 53, 18, 58, 33, 49, 4, 34, 42, 0, 50, 43, 25, 16, 49, 34, 20, 37, 28, 12, 63, 16, 38, 25, 44, 0, 40, 52, 17, 35, 3, 50, 14, 8, 53, 11, 36, 25, 45, 9, 62, 0, 54, 28, 17, 50, 55, 15, 24, 57, 0, 53, 34, 23, 41, 15, 45, 0, 49, 16, 4, 48, 9, 63, 45, 0, 42, 58, 37, 61, 22, 54, 26 },
75 { 0, 50, 21, 47, 54, 36, 27, 45, 52, 4, 34, 15, 63, 29, 37, 59, 17, 31, 6, 61, 28, 5, 48, 18, 59, 27, 34, 56, 44, 31, 35, 12, 41, 59, 16, 3, 40, 20, 50, 22, 30, 40, 52, 10, 45, 3, 59, 22, 37, 61, 29, 46, 31, 58, 2, 22, 9, 43, 3, 39, 14, 61, 24, 54, 15, 29, 11, 60, 39, 17, 5, 61, 0, 44, 50, 3, 31, 14, 58, 21, 54, 28, 15, 45, 60, 26, 33, 58, 44, 22, 60, 2, 57, 34, 49, 27, 18, 34, 21, 59, 29, 4, 36, 41, 8, 39, 28, 11, 62, 26, 53, 20, 35, 24, 59, 32, 29, 39, 24, 31, 57, 23, 11, 28, 5, 36, 11, 59 },
76 { 44, 32, 63, 5, 20, 12, 41, 7, 30, 61, 42, 8, 39, 5, 33, 8, 24, 53, 45, 11, 37, 58, 7, 44, 10, 50, 3, 40, 8, 22, 53, 19, 46, 9, 33, 52, 24, 58, 8, 44, 13, 47, 8, 34, 38, 30, 14, 47, 7, 34, 4, 55, 9, 19, 40, 49, 56, 26, 60, 21, 30, 45, 10, 19, 40, 58, 23, 36, 3, 52, 45, 23, 54, 13, 22, 42, 53, 45, 7, 33, 10, 36, 57, 6, 29, 12, 41, 0, 30, 15, 41, 30, 17, 7, 16, 53, 40, 56, 2, 39, 12, 61, 10, 52, 31, 60, 16, 45, 1, 37, 7, 61, 40, 10, 43, 17, 58, 7, 54, 14, 4, 51, 39, 49, 18, 56, 42, 20 },
77 { 14, 6, 24, 36, 56, 49, 22, 60, 18, 14, 23, 51, 26, 57, 21, 52, 41, 14, 35, 50, 19, 31, 40, 23, 33, 14, 63, 17, 32, 47, 7, 62, 23, 30, 56, 11, 42, 27, 14, 60, 35, 19, 28, 61, 17, 55, 25, 39, 53, 17, 42, 21, 38, 63, 25, 5, 14, 36, 12, 50, 1, 37, 59, 32, 2, 51, 6, 56, 27, 32, 11, 30, 38, 26, 60, 8, 26, 19, 62, 39, 50, 2, 21, 39, 53, 23, 56, 19, 49, 39, 5, 46, 55, 23, 42, 4, 31, 11, 47, 26, 45, 22, 48, 18, 21, 5, 48, 25, 57, 14, 47, 30, 3, 56, 12, 50, 1, 42, 19, 47, 35, 17, 8, 30, 45, 25, 4, 51 },
78 { 28, 58, 43, 1, 31, 8, 33, 2, 44, 55, 32, 1, 60, 12, 46, 27, 4, 62, 23, 1, 56, 13, 62, 2, 54, 36, 25, 51, 1, 57, 26, 42, 3, 49, 17, 38, 1, 48, 31, 4, 54, 3, 50, 24, 1, 49, 5, 63, 13, 27, 52, 1, 48, 13, 45, 33, 52, 30, 46, 20, 55, 28, 6, 48, 24, 38, 20, 47, 14, 62, 48, 9, 58, 4, 36, 30, 56, 1, 34, 12, 18, 63, 25, 48, 4, 16, 37, 7, 62, 10, 52, 28, 13, 50, 36, 63, 24, 51, 15, 58, 8, 33, 1, 38, 56, 35, 42, 9, 33, 51, 22, 18, 48, 32, 27, 37, 23, 61, 33, 11, 59, 29, 62, 1, 53, 10, 60, 33 },
79 { 12, 39, 17, 52, 26, 46, 53, 38, 25, 11, 48, 36, 16, 43, 2, 35, 55, 17, 39, 29, 43, 9, 28, 45, 20, 5, 46, 12, 42, 28, 13, 52, 36, 6, 60, 22, 54, 17, 62, 39, 25, 42, 15, 55, 44, 20, 31, 10, 35, 57, 24, 32, 29, 6, 59, 18, 7, 62, 3, 41, 10, 44, 16, 54, 13, 62, 31, 9, 41, 1, 21, 43, 18, 47, 15, 40, 11, 49, 28, 55, 46, 30, 8, 43, 32, 61, 28, 47, 25, 34, 21, 61, 32, 1, 20, 9, 46, 6, 35, 19, 41, 54, 27, 63, 14, 3, 51, 20, 62, 2, 38, 55, 8, 21, 63, 6, 46, 9, 26, 51, 3, 24, 43, 34, 16, 41, 18, 48 },
80 { 62, 23, 55, 9, 15, 62, 19, 13, 58, 40, 6, 30, 54, 19, 50, 31, 10, 44, 6, 59, 21, 47, 51, 15, 60, 39, 30, 54, 21, 61, 19, 33, 14, 29, 43, 11, 34, 45, 7, 21, 10, 56, 36, 6, 38, 11, 58, 42, 2, 47, 11, 60, 50, 16, 41, 28, 38, 23, 47, 17, 35, 63, 22, 33, 42, 5, 45, 17, 53, 35, 25, 56, 33, 6, 51, 19, 60, 23, 43, 15, 5, 40, 58, 13, 51, 1, 45, 11, 54, 3, 43, 8, 37, 48, 59, 29, 39, 21, 61, 43, 3, 31, 10, 44, 24, 29, 60, 12, 28, 40, 11, 25, 43, 52, 14, 41, 16, 57, 44, 20, 40, 55, 12, 21, 57, 27, 35, 2 },
81 { 37, 6, 31, 42, 40, 4, 29, 50, 0, 20, 63, 28, 9, 58, 14, 24, 63, 26, 48, 16, 34, 4, 32, 38, 23, 11, 58, 4, 37, 9, 45, 5, 63, 48, 26, 57, 2, 28, 32, 51, 46, 29, 13, 62, 27, 46, 28, 18, 50, 15, 40, 4, 19, 34, 54, 0, 53, 9, 26, 58, 28, 5, 49, 0, 57, 27, 19, 60, 29, 8, 59, 12, 37, 63, 24, 46, 3, 37, 6, 52, 26, 32, 20, 36, 9, 22, 59, 18, 35, 51, 14, 57, 17, 24, 12, 44, 56, 0, 30, 13, 59, 20, 49, 17, 54, 43, 6, 34, 46, 17, 58, 36, 0, 34, 29, 54, 25, 2, 36, 15, 60, 6, 37, 46, 4, 50, 9, 45 },
82 { 19, 59, 48, 3, 24, 60, 44, 22, 34, 51, 15, 45, 41, 5, 33, 47, 0, 37, 12, 55, 25, 54, 8, 57, 0, 47, 18, 34, 49, 15, 55, 24, 40, 20, 8, 35, 53, 13, 41, 18, 0, 59, 22, 33, 4, 52, 8, 60, 24, 36, 31, 56, 45, 26, 10, 43, 15, 56, 36, 4, 51, 14, 39, 30, 12, 55, 36, 2, 39, 49, 4, 44, 17, 0, 32, 13, 53, 35, 59, 17, 62, 0, 55, 24, 52, 38, 31, 6, 42, 19, 29, 40, 4, 54, 33, 5, 16, 27, 52, 37, 23, 55, 7, 37, 0, 39, 23, 49, 4, 53, 31, 15, 59, 10, 50, 4, 60, 34, 48, 7, 31, 49, 27, 14, 62, 22, 53, 29 },
83 { 46, 21, 14, 51, 36, 17, 7, 57, 10, 32, 3, 37, 22, 60, 39, 18, 56, 20, 42, 3, 36, 10, 44, 26, 41, 29, 53, 27, 2, 39, 30, 52, 0, 59, 15, 48, 23, 61, 6, 58, 37, 12, 40, 49, 16, 39, 20, 44, 0, 62, 8, 21, 3, 59, 23, 32, 49, 31, 12, 44, 22, 59, 18, 50, 24, 7, 43, 52, 15, 23, 41, 26, 51, 28, 55, 39, 21, 27, 10, 42, 12, 45, 27, 47, 3, 15, 63, 26, 55, 0, 60, 26, 45, 18, 62, 38, 58, 49, 8, 47, 4, 33, 46, 29, 57, 13, 56, 16, 59, 21, 5, 47, 23, 39, 18, 44, 13, 22, 28, 53, 19, 0, 58, 32, 41, 7, 26, 13 },
84 { 0, 56, 34, 28, 11, 55, 31, 47, 26, 41, 56, 13, 53, 28, 11, 49, 7, 52, 32, 61, 50, 22, 63, 17, 13, 56, 7, 19, 43, 62, 10, 21, 37, 32, 43, 4, 38, 19, 44, 25, 31, 54, 5, 23, 61, 30, 53, 12, 35, 22, 43, 53, 37, 48, 7, 62, 20, 2, 61, 41, 8, 34, 47, 9, 63, 34, 28, 10, 55, 33, 14, 57, 7, 47, 9, 61, 4, 49, 31, 50, 21, 38, 8, 16, 57, 44, 33, 5, 49, 36, 12, 50, 7, 34, 10, 25, 2, 22, 36, 15, 26, 61, 18, 9, 22, 46, 32, 8, 27, 37, 44, 30, 55, 3, 62, 24, 38, 56, 5, 45, 38, 24, 43, 10, 19, 54, 39, 61 },
85 { 41, 30, 8, 63, 43, 23, 38, 3, 62, 19, 8, 49, 25, 1, 58, 30, 23, 40, 9, 28, 18, 40, 6, 38, 49, 22, 35, 59, 8, 27, 50, 5, 56, 17, 11, 50, 30, 9, 55, 2, 51, 19, 34, 47, 9, 41, 6, 26, 48, 57, 14, 28, 17, 12, 39, 13, 37, 46, 25, 19, 54, 27, 1, 37, 16, 45, 20, 60, 1, 48, 20, 38, 31, 22, 42, 15, 19, 44, 1, 61, 6, 34, 56, 40, 29, 10, 20, 46, 13, 22, 41, 23, 59, 42, 30, 51, 45, 13, 63, 53, 42, 12, 51, 38, 62, 2, 26, 41, 50, 1, 61, 10, 19, 42, 31, 8, 49, 32, 12, 63, 9, 52, 16, 56, 36, 2, 31, 16 },
86 { 52, 5, 47, 20, 1, 53, 12, 50, 16, 35, 43, 21, 33, 43, 16, 44, 3, 59, 14, 46, 1, 30, 60, 33, 2, 45, 12, 42, 31, 47, 14, 33, 46, 25, 55, 27, 60, 36, 16, 42, 14, 46, 26, 1, 55, 15, 63, 32, 2, 38, 5, 47, 33, 61, 30, 52, 4, 57, 6, 38, 11, 43, 61, 24, 52, 3, 31, 22, 42, 10, 62, 3, 59, 11, 35, 57, 33, 54, 24, 14, 29, 48, 18, 2, 60, 41, 53, 24, 32, 62, 3, 53, 15, 1, 55, 17, 32, 40, 6, 31, 1, 40, 28, 5, 35, 52, 19, 63, 13, 33, 17, 41, 52, 26, 15, 57, 1, 20, 42, 17, 35, 27, 48, 5, 25, 50, 44, 11 },
87 { 35, 25, 38, 57, 33, 17, 40, 6, 59, 27, 54, 5, 61, 10, 52, 26, 36, 19, 51, 35, 57, 48, 11, 20, 54, 25, 61, 16, 1, 58, 24, 61, 3, 39, 7, 47, 1, 22, 49, 28, 63, 10, 58, 32, 17, 36, 45, 19, 51, 29, 59, 10, 50, 1, 23, 42, 18, 29, 51, 21, 56, 32, 14, 5, 40, 58, 47, 13, 54, 35, 29, 45, 18, 52, 26, 2, 38, 8, 46, 36, 58, 11, 52, 35, 17, 28, 1, 58, 9, 39, 17, 28, 37, 48, 20, 9, 57, 24, 50, 19, 58, 16, 48, 25, 43, 11, 35, 6, 45, 24, 56, 4, 36, 7, 47, 35, 52, 28, 59, 30, 2, 61, 21, 33, 63, 12, 18, 59 },
88 { 3, 49, 15, 10, 27, 61, 25, 45, 30, 0, 14, 47, 31, 38, 17, 62, 7, 55, 27, 4, 15, 24, 42, 52, 10, 34, 5, 51, 36, 18, 41, 11, 35, 21, 62, 13, 33, 57, 8, 35, 5, 40, 21, 43, 52, 3, 24, 56, 11, 16, 33, 25, 41, 20, 55, 8, 60, 35, 15, 48, 2, 57, 30, 49, 18, 25, 6, 39, 17, 57, 7, 25, 43, 5, 49, 16, 62, 22, 55, 4, 25, 43, 23, 7, 50, 11, 37, 48, 14, 51, 33, 57, 7, 27, 39, 46, 4, 29, 11, 43, 34, 56, 7, 60, 20, 54, 30, 57, 22, 49, 9, 33, 54, 14, 63, 23, 6, 43, 10, 40, 50, 13, 44, 8, 38, 33, 46, 23 },
89 { 55, 39, 22, 50, 44, 4, 36, 9, 52, 23, 37, 59, 21, 2, 46, 13, 31, 41, 11, 45, 62, 29, 6, 37, 19, 48, 30, 23, 44, 7, 53, 28, 54, 16, 41, 29, 44, 18, 52, 24, 60, 15, 48, 7, 27, 59, 9, 34, 42, 54, 7, 63, 4, 46, 31, 27, 45, 0, 40, 26, 34, 17, 37, 10, 53, 29, 36, 50, 2, 27, 51, 11, 61, 37, 23, 41, 30, 7, 18, 50, 39, 14, 63, 32, 45, 61, 19, 30, 25, 44, 2, 47, 23, 63, 11, 34, 59, 37, 60, 3, 22, 14, 44, 30, 15, 0, 47, 15, 3, 38, 61, 20, 27, 45, 11, 39, 51, 16, 55, 3, 22, 54, 29, 58, 1, 57, 6, 29 },
90 { 9, 17, 60, 2, 34, 56, 20, 62, 39, 12, 49, 6, 29, 56, 34, 48, 0, 58, 22, 38, 18, 43, 56, 0, 63, 14, 55, 3, 59, 31, 15, 45, 0, 49, 6, 58, 3, 38, 12, 45, 0, 37, 29, 57, 13, 39, 30, 49, 0, 23, 44, 36, 16, 57, 13, 54, 11, 24, 63, 9, 53, 7, 62, 42, 0, 59, 15, 23, 63, 34, 40, 16, 32, 0, 53, 12, 48, 28, 59, 33, 0, 53, 9, 27, 3, 22, 54, 5, 56, 9, 61, 13, 42, 14, 52, 19, 0, 21, 47, 27, 53, 36, 3, 50, 39, 58, 25, 40, 53, 28, 12, 50, 0, 59, 32, 2, 21, 34, 26, 46, 37, 7, 18, 47, 24, 14, 53, 42 },
91 { 61, 32, 13, 54, 29, 7, 46, 13, 28, 57, 18, 41, 53, 15, 9, 39, 24, 49, 33, 3, 53, 9, 26, 32, 40, 28, 46, 39, 25, 9, 56, 21, 63, 37, 26, 22, 51, 27, 17, 56, 31, 53, 4, 43, 22, 46, 12, 18, 60, 40, 20, 26, 50, 21, 39, 5, 49, 33, 16, 44, 22, 46, 20, 32, 24, 45, 8, 43, 12, 46, 4, 48, 56, 20, 29, 58, 3, 40, 10, 42, 31, 21, 47, 41, 56, 38, 15, 42, 36, 27, 20, 33, 55, 3, 26, 44, 31, 54, 12, 35, 9, 63, 28, 10, 21, 32, 9, 60, 17, 8, 43, 29, 40, 16, 36, 48, 60, 7, 57, 14, 62, 31, 42, 15, 36, 40, 20, 26 },
92 { 0, 37, 47, 23, 41, 18, 32, 48, 1, 35, 8, 25, 4, 26, 63, 20, 54, 8, 16, 61, 35, 23, 51, 15, 58, 7, 12, 20, 50, 34, 42, 4, 38, 10, 32, 47, 8, 60, 41, 20, 9, 25, 50, 19, 62, 1, 37, 56, 28, 8, 53, 11, 3, 58, 34, 43, 19, 60, 38, 4, 58, 31, 3, 51, 11, 55, 38, 30, 21, 58, 19, 26, 9, 44, 36, 13, 46, 20, 62, 24, 13, 60, 5, 28, 12, 34, 7, 59, 0, 53, 45, 6, 38, 30, 50, 7, 62, 16, 41, 5, 46, 18, 55, 42, 51, 5, 45, 23, 34, 48, 19, 58, 5, 25, 54, 19, 13, 41, 28, 21, 0, 49, 10, 60, 4, 51, 9, 45 },
93 { 19, 28, 6, 58, 10, 51, 4, 22, 55, 42, 60, 45, 34, 51, 42, 5, 30, 45, 27, 40, 13, 47, 4, 49, 21, 38, 60, 29, 2, 57, 17, 27, 52, 19, 61, 14, 30, 34, 2, 44, 63, 33, 11, 35, 16, 51, 25, 6, 14, 47, 31, 61, 37, 29, 18, 8, 52, 2, 28, 54, 13, 41, 15, 62, 35, 18, 2, 60, 6, 33, 41, 61, 31, 6, 56, 17, 34, 50, 6, 52, 44, 35, 16, 51, 59, 24, 48, 18, 31, 40, 16, 49, 21, 60, 17, 39, 10, 49, 32, 57, 24, 39, 1, 25, 18, 62, 37, 12, 56, 1, 37, 11, 52, 44, 9, 30, 47, 4, 51, 40, 55, 25, 34, 27, 56, 30, 32, 54 },
94 { 63, 40, 49, 15, 43, 26, 63, 38, 16, 20, 30, 12, 57, 14, 19, 60, 36, 12, 59, 2, 57, 17, 42, 31, 1, 44, 16, 35, 47, 11, 32, 48, 13, 43, 1, 39, 51, 12, 57, 23, 6, 40, 53, 3, 55, 31, 39, 60, 35, 44, 5, 15, 45, 1, 62, 41, 26, 14, 47, 22, 36, 27, 50, 9, 26, 47, 52, 28, 54, 16, 1, 13, 51, 39, 23, 63, 1, 30, 15, 26, 2, 57, 19, 37, 1, 44, 21, 50, 13, 63, 8, 24, 56, 1, 35, 25, 58, 20, 2, 28, 14, 51, 33, 59, 13, 30, 4, 49, 31, 24, 63, 26, 33, 3, 58, 38, 62, 24, 32, 8, 17, 45, 5, 48, 18, 3, 43, 11 },
95 { 21, 4, 24, 34, 59, 1, 37, 11, 53, 5, 47, 2, 22, 40, 32, 1, 24, 50, 21, 29, 38, 25, 63, 8, 55, 24, 53, 6, 62, 23, 59, 3, 54, 20, 58, 24, 5, 46, 15, 38, 48, 14, 27, 42, 23, 7, 46, 10, 17, 58, 25, 52, 23, 32, 49, 12, 55, 30, 40, 7, 59, 1, 56, 21, 39, 4, 23, 15, 37, 46, 55, 42, 21, 4, 48, 8, 45, 54, 37, 55, 32, 8, 46, 10, 30, 54, 4, 41, 25, 29, 36, 48, 11, 43, 14, 47, 5, 43, 53, 36, 61, 10, 45, 6, 41, 54, 27, 43, 16, 55, 6, 46, 18, 42, 23, 15, 1, 45, 12, 60, 37, 22, 62, 12, 39, 59, 16, 52 },
96 { 47, 35, 56, 7, 19, 46, 31, 50, 33, 24, 61, 35, 50, 7, 53, 44, 55, 6, 46, 10, 52, 5, 21, 43, 36, 10, 18, 41, 26, 37, 8, 29, 40, 36, 9, 49, 34, 26, 61, 21, 7, 59, 18, 62, 29, 54, 20, 32, 51, 0, 40, 10, 55, 6, 20, 36, 9, 61, 5, 51, 44, 19, 33, 43, 13, 57, 40, 63, 8, 24, 29, 10, 60, 34, 27, 40, 25, 18, 10, 42, 21, 49, 26, 62, 38, 12, 33, 61, 5, 57, 2, 19, 54, 28, 62, 22, 38, 31, 16, 7, 22, 47, 29, 17, 35, 8, 20, 51, 2, 40, 22, 50, 13, 61, 28, 53, 35, 20, 56, 30, 2, 53, 14, 41, 23, 34, 8, 31 },
97 { 12, 2, 42, 29, 52, 13, 21, 8, 55, 14, 41, 17, 28, 58, 23, 11, 17, 36, 31, 62, 17, 34, 50, 14, 28, 61, 33, 52, 2, 51, 17, 45, 7, 25, 62, 30, 18, 55, 0, 42, 30, 35, 45, 1, 12, 48, 3, 63, 21, 36, 30, 48, 19, 59, 43, 27, 46, 17, 34, 25, 12, 29, 53, 6, 48, 31, 11, 34, 49, 3, 36, 50, 19, 47, 14, 61, 11, 36, 58, 4, 60, 14, 39, 22, 6, 52, 15, 35, 17, 46, 31, 42, 9, 34, 3, 52, 12, 60, 26, 56, 40, 2, 53, 23, 57, 38, 62, 14, 36, 59, 10, 31, 39, 6, 49, 9, 41, 26, 5, 48, 43, 27, 33, 58, 1, 50, 25, 57 },
98 { 61, 37, 15, 61, 3, 39, 58, 43, 26, 0, 44, 10, 47, 3, 37, 63, 28, 43, 13, 39, 3, 57, 30, 59, 0, 48, 5, 43, 13, 22, 60, 33, 55, 15, 42, 4, 52, 10, 45, 13, 54, 4, 24, 49, 37, 26, 41, 14, 42, 9, 61, 13, 38, 23, 3, 53, 0, 58, 21, 42, 63, 10, 17, 61, 25, 0, 58, 28, 17, 44, 57, 12, 27, 0, 55, 5, 52, 28, 23, 47, 29, 0, 43, 17, 58, 28, 47, 23, 55, 10, 58, 23, 51, 40, 18, 33, 45, 0, 49, 8, 32, 61, 19, 48, 0, 26, 7, 47, 29, 18, 44, 0, 56, 34, 20, 59, 15, 51, 37, 18, 10, 52, 7, 20, 46, 9, 38, 17 },
99 { 6, 27, 48, 23, 45, 29, 5, 18, 38, 62, 27, 56, 20, 32, 15, 9, 48, 0, 54, 22, 45, 20, 7, 41, 23, 39, 19, 27, 58, 31, 44, 0, 12, 50, 23, 56, 20, 39, 32, 59, 16, 52, 33, 9, 57, 22, 6, 58, 28, 50, 24, 2, 56, 35, 16, 45, 32, 38, 15, 54, 2, 38, 46, 22, 35, 45, 20, 5, 52, 25, 7, 35, 59, 32, 22, 43, 38, 3, 51, 16, 34, 53, 32, 50, 3, 40, 8, 43, 0, 39, 27, 4, 14, 61, 8, 55, 15, 41, 20, 44, 27, 13, 39, 11, 46, 42, 54, 33, 4, 52, 23, 61, 14, 25, 43, 2, 33, 11, 63, 29, 61, 17, 40, 55, 22, 62, 28, 44 },
100 { 20, 54, 8, 56, 35, 10, 63, 31, 52, 12, 48, 6, 59, 41, 52, 33, 19, 58, 25, 49, 11, 37, 47, 12, 54, 15, 56, 35, 7, 47, 16, 53, 28, 34, 5, 37, 28, 8, 48, 3, 28, 38, 18, 61, 16, 43, 53, 32, 4, 17, 47, 27, 44, 8, 63, 10, 25, 49, 6, 37, 24, 52, 32, 3, 50, 12, 41, 56, 38, 14, 62, 20, 40, 16, 53, 31, 18, 63, 41, 9, 59, 7, 13, 25, 57, 20, 63, 26, 53, 18, 48, 62, 30, 46, 21, 25, 58, 29, 36, 4, 55, 34, 6, 60, 31, 16, 21, 12, 58, 38, 9, 29, 47, 7, 52, 30, 57, 44, 22, 0, 35, 45, 3, 31, 14, 36, 0, 51 },
101 { 42, 14, 33, 24, 16, 49, 40, 2, 22, 33, 16, 36, 25, 1, 21, 61, 38, 8, 33, 4, 62, 26, 29, 60, 6, 46, 30, 11, 63, 4, 36, 40, 19, 57, 46, 11, 41, 63, 22, 25, 58, 10, 46, 2, 34, 27, 11, 38, 56, 34, 12, 53, 18, 33, 41, 51, 13, 28, 60, 20, 47, 14, 29, 59, 16, 62, 8, 22, 32, 47, 9, 49, 2, 44, 7, 12, 45, 6, 20, 27, 45, 24, 62, 42, 36, 11, 33, 15, 37, 7, 32, 10, 37, 1, 35, 50, 6, 11, 63, 24, 52, 15, 50, 24, 3, 37, 56, 27, 34, 22, 49, 16, 36, 62, 17, 39, 4, 15, 54, 24, 50, 8, 58, 26, 49, 54, 11, 30 },
102 { 4, 59, 41, 1, 53, 12, 25, 45, 59, 7, 51, 39, 54, 14, 46, 4, 27, 53, 16, 44, 18, 51, 1, 32, 25, 2, 50, 40, 20, 54, 24, 9, 62, 2, 27, 60, 1, 17, 36, 50, 6, 40, 30, 55, 41, 19, 49, 1, 21, 60, 40, 5, 62, 1, 22, 30, 57, 4, 43, 31, 1, 55, 40, 7, 27, 37, 30, 54, 1, 19, 42, 30, 56, 26, 62, 49, 24, 57, 37, 56, 2, 39, 16, 5, 30, 55, 3, 49, 60, 23, 56, 44, 17, 52, 13, 42, 28, 48, 18, 45, 9, 37, 21, 41, 58, 10, 48, 1, 63, 5, 41, 57, 2, 24, 12, 48, 27, 42, 32, 46, 13, 38, 19, 34, 5, 41, 25, 60 },
103 { 39, 28, 21, 46, 32, 57, 36, 9, 19, 42, 4, 29, 11, 43, 30, 49, 13, 42, 35, 56, 9, 39, 15, 52, 36, 61, 18, 26, 45, 14, 31, 48, 21, 43, 14, 33, 49, 54, 14, 44, 21, 62, 13, 23, 8, 62, 15, 51, 44, 7, 30, 37, 20, 42, 56, 7, 39, 18, 50, 11, 61, 9, 19, 43, 57, 2, 48, 11, 39, 60, 28, 4, 37, 17, 35, 1, 33, 11, 31, 14, 48, 19, 35, 51, 46, 21, 44, 29, 12, 41, 2, 22, 58, 26, 54, 4, 59, 38, 2, 33, 57, 1, 63, 13, 28, 51, 15, 40, 18, 45, 8, 30, 43, 37, 54, 19, 8, 59, 21, 6, 60, 29, 55, 10, 63, 15, 47, 17 },
104 { 3, 50, 10, 62, 18, 5, 27, 49, 60, 23, 55, 18, 62, 24, 56, 10, 59, 28, 2, 23, 34, 59, 43, 20, 10, 42, 8, 49, 1, 37, 57, 6, 51, 29, 53, 7, 23, 31, 5, 32, 51, 0, 35, 54, 45, 31, 5, 26, 36, 24, 55, 15, 48, 29, 14, 48, 26, 60, 21, 41, 36, 26, 50, 33, 14, 44, 17, 24, 52, 15, 46, 23, 54, 6, 47, 21, 60, 50, 4, 53, 29, 61, 8, 23, 1, 60, 19, 6, 53, 16, 47, 34, 6, 39, 16, 31, 12, 20, 53, 22, 30, 43, 25, 46, 35, 6, 44, 32, 53, 26, 55, 19, 11, 59, 5, 33, 51, 1, 35, 53, 25, 3, 42, 23, 44, 32, 7, 53 },
105 { 22, 44, 37, 6, 26, 51, 38, 0, 34, 13, 31, 46, 3, 37, 6, 19, 40, 21, 47, 63, 12, 5, 29, 55, 22, 58, 34, 28, 60, 22, 11, 41, 17, 38, 9, 44, 59, 39, 56, 19, 11, 47, 25, 15, 3, 39, 57, 17, 61, 11, 46, 3, 58, 9, 54, 35, 2, 34, 8, 45, 15, 56, 5, 23, 53, 33, 63, 35, 4, 59, 10, 51, 13, 61, 29, 41, 15, 25, 43, 19, 40, 10, 54, 33, 41, 12, 38, 51, 31, 26, 61, 9, 30, 45, 24, 62, 49, 40, 10, 61, 14, 49, 5, 17, 54, 20, 60, 23, 3, 13, 35, 50, 32, 23, 46, 27, 38, 63, 16, 12, 39, 48, 18, 51, 1, 27, 56, 35 },
106 { 63, 15, 30, 55, 43, 14, 57, 17, 53, 44, 7, 48, 26, 50, 32, 60, 0, 53, 14, 31, 50, 24, 46, 0, 38, 13, 4, 52, 16, 45, 30, 59, 0, 25, 55, 35, 16, 10, 26, 42, 58, 29, 60, 38, 50, 22, 28, 47, 0, 50, 28, 19, 33, 39, 11, 44, 16, 52, 24, 59, 3, 38, 27, 51, 0, 21, 7, 42, 26, 34, 21, 40, 33, 18, 39, 3, 54, 38, 8, 59, 0, 44, 27, 15, 58, 28, 57, 9, 43, 0, 36, 50, 20, 59, 8, 34, 0, 27, 47, 7, 36, 19, 56, 32, 0, 38, 11, 29, 62, 47, 6, 61, 0, 41, 14, 56, 10, 23, 45, 31, 57, 8, 36, 13, 58, 38, 11, 19 },
107 { 0, 34, 12, 47, 21, 2, 40, 30, 11, 25, 61, 20, 40, 15, 35, 22, 45, 36, 7, 41, 17, 57, 9, 48, 32, 62, 44, 24, 35, 3, 54, 13, 33, 63, 19, 4, 48, 22, 62, 2, 37, 8, 33, 6, 20, 52, 9, 32, 43, 13, 39, 63, 25, 4, 49, 23, 62, 32, 9, 30, 48, 18, 63, 12, 46, 29, 58, 13, 48, 8, 57, 31, 0, 51, 9, 58, 12, 22, 47, 29, 35, 22, 49, 5, 46, 4, 34, 20, 63, 24, 56, 11, 41, 3, 51, 19, 56, 35, 17, 58, 28, 42, 9, 45, 59, 26, 51, 42, 17, 36, 25, 15, 53, 21, 44, 3, 30, 55, 5, 50, 21, 28, 61, 32, 6, 49, 28, 46 },
108 { 58, 42, 60, 4, 31, 59, 22, 63, 35, 38, 9, 54, 1, 57, 8, 51, 16, 58, 27, 53, 3, 38, 30, 15, 27, 6, 19, 56, 10, 50, 21, 36, 47, 5, 43, 28, 51, 32, 13, 46, 18, 54, 16, 43, 63, 12, 36, 59, 22, 34, 5, 52, 17, 59, 27, 41, 0, 19, 55, 37, 13, 43, 6, 34, 41, 10, 36, 55, 19, 44, 3, 16, 58, 27, 49, 25, 32, 62, 17, 55, 13, 63, 18, 52, 25, 37, 17, 48, 13, 32, 5, 46, 28, 37, 14, 43, 25, 5, 51, 39, 3, 52, 33, 22, 8, 40, 12, 4, 57, 9, 46, 39, 28, 58, 13, 62, 17, 42, 19, 36, 0, 47, 16, 43, 24, 21, 54, 13 },
109 { 25, 9, 23, 50, 36, 8, 45, 14, 3, 51, 16, 28, 44, 12, 42, 29, 4, 26, 10, 47, 22, 61, 18, 54, 51, 39, 46, 13, 41, 26, 58, 7, 18, 39, 12, 57, 15, 1, 52, 27, 41, 23, 48, 1, 27, 45, 18, 2, 57, 26, 55, 8, 43, 31, 6, 58, 14, 51, 40, 5, 61, 31, 24, 54, 17, 60, 22, 1, 39, 30, 53, 45, 36, 13, 43, 5, 45, 2, 37, 6, 34, 42, 2, 39, 10, 62, 7, 54, 40, 18, 60, 15, 52, 21, 63, 8, 55, 46, 15, 30, 23, 13, 62, 16, 50, 24, 58, 31, 48, 21, 34, 2, 49, 7, 31, 37, 26, 48, 9, 61, 40, 11, 52, 2, 60, 40, 4, 37 },
110 { 52, 28, 39, 16, 54, 19, 29, 55, 42, 20, 58, 33, 24, 63, 18, 55, 39, 62, 43, 34, 12, 40, 6, 35, 2, 25, 8, 62, 34, 1, 31, 42, 61, 27, 53, 24, 40, 61, 34, 8, 59, 4, 30, 56, 40, 6, 53, 42, 10, 48, 16, 37, 12, 46, 21, 36, 47, 11, 28, 45, 22, 10, 57, 2, 49, 31, 14, 44, 61, 11, 25, 6, 23, 63, 18, 36, 28, 56, 20, 51, 11, 48, 27, 56, 32, 22, 45, 30, 2, 42, 27, 39, 1, 44, 23, 31, 38, 22, 11, 61, 43, 54, 4, 47, 35, 2, 44, 16, 28, 54, 12, 62, 18, 43, 10, 52, 1, 58, 33, 15, 29, 56, 20, 34, 9, 30, 48, 17 },
111 { 46, 2, 56, 11, 41, 1, 49, 6, 27, 47, 2, 48, 5, 32, 37, 3, 13, 19, 32, 1, 55, 28, 60, 17, 43, 59, 32, 20, 49, 16, 55, 23, 14, 46, 2, 36, 6, 30, 20, 49, 12, 47, 35, 14, 21, 60, 29, 14, 35, 24, 46, 1, 56, 29, 53, 8, 33, 23, 56, 1, 35, 46, 20, 39, 26, 4, 53, 28, 17, 38, 60, 34, 48, 9, 55, 15, 46, 7, 41, 31, 60, 24, 16, 36, 1, 59, 19, 52, 35, 6, 55, 11, 59, 33, 7, 57, 4, 29, 48, 1, 19, 26, 37, 30, 18, 63, 37, 6, 59, 1, 40, 24, 56, 33, 46, 22, 35, 7, 24, 53, 39, 5, 26, 45, 55, 18, 62, 7 },
112 { 20, 60, 29, 34, 20, 62, 33, 52, 10, 36, 13, 60, 41, 21, 50, 27, 56, 49, 8, 51, 21, 45, 11, 48, 8, 23, 53, 3, 29, 44, 5, 52, 9, 32, 50, 17, 43, 56, 3, 38, 24, 10, 62, 25, 51, 9, 33, 49, 61, 7, 30, 62, 22, 19, 2, 42, 63, 5, 49, 18, 60, 15, 52, 7, 43, 56, 23, 50, 5, 50, 2, 20, 41, 30, 1, 52, 22, 61, 14, 26, 3, 43, 53, 7, 47, 28, 11, 14, 23, 58, 33, 25, 47, 13, 50, 17, 40, 54, 34, 60, 41, 6, 59, 14, 50, 7, 25, 55, 20, 42, 51, 8, 27, 4, 16, 60, 28, 50, 44, 3, 22, 49, 63, 12, 33, 1, 43, 31 },
113 { 36, 5, 46, 8, 44, 24, 13, 39, 25, 57, 31, 18, 8, 52, 10, 45, 6, 30, 36, 24, 63, 4, 33, 26, 57, 40, 15, 56, 37, 12, 40, 25, 37, 58, 11, 63, 21, 45, 16, 60, 31, 53, 18, 33, 3, 45, 23, 0, 20, 54, 40, 15, 50, 38, 60, 16, 25, 42, 29, 38, 7, 41, 25, 62, 18, 33, 8, 35, 42, 16, 32, 56, 12, 39, 59, 19, 34, 9, 49, 38, 57, 12, 21, 50, 14, 40, 61, 44, 50, 9, 49, 19, 3, 29, 35, 62, 12, 24, 7, 18, 52, 32, 10, 46, 21, 41, 32, 11, 36, 29, 14, 34, 60, 38, 54, 11, 41, 14, 19, 57, 32, 16, 7, 41, 51, 25, 14, 57 },
114 { 53, 18, 26, 50, 15, 58, 4, 63, 17, 43, 7, 40, 61, 35, 15, 41, 23, 60, 16, 38, 14, 42, 19, 50, 0, 31, 10, 46, 27, 63, 18, 60, 0, 20, 29, 39, 8, 26, 37, 5, 42, 0, 44, 39, 57, 17, 58, 41, 28, 37, 4, 32, 9, 44, 12, 31, 54, 10, 59, 14, 27, 53, 12, 36, 0, 47, 13, 63, 21, 58, 10, 24, 50, 27, 4, 26, 44, 53, 31, 0, 18, 42, 29, 33, 57, 4, 32, 26, 0, 38, 16, 61, 41, 53, 20, 0, 42, 44, 49, 27, 10, 56, 39, 0, 57, 15, 53, 49, 3, 61, 22, 47, 17, 5, 49, 26, 2, 63, 39, 10, 47, 27, 37, 23, 4, 59, 38, 10 },
115 { 23, 39, 61, 3, 37, 28, 48, 31, 0, 34, 51, 23, 2, 26, 58, 0, 53, 11, 46, 1, 57, 29, 52, 14, 37, 61, 21, 35, 2, 49, 7, 34, 47, 55, 4, 33, 54, 13, 58, 52, 19, 50, 22, 7, 13, 29, 36, 11, 51, 17, 60, 25, 55, 4, 34, 51, 0, 35, 20, 48, 32, 3, 51, 30, 59, 28, 40, 3, 46, 29, 54, 43, 7, 62, 47, 11, 39, 4, 23, 46, 55, 8, 63, 5, 25, 37, 18, 46, 21, 56, 31, 5, 36, 8, 45, 58, 26, 15, 2, 36, 47, 21, 29, 44, 25, 34, 3, 27, 43, 10, 52, 0, 45, 30, 24, 36, 43, 18, 34, 59, 0, 52, 61, 15, 44, 19, 30, 49 },
116 { 0, 27, 12, 43, 54, 9, 22, 53, 21, 46, 15, 55, 29, 47, 20, 33, 39, 28, 59, 35, 9, 44, 5, 24, 47, 7, 52, 17, 56, 22, 30, 42, 14, 26, 45, 18, 49, 1, 24, 34, 11, 27, 55, 32, 61, 47, 2, 56, 6, 44, 13, 47, 36, 27, 58, 22, 16, 47, 40, 4, 57, 38, 21, 45, 16, 9, 56, 26, 11, 38, 0, 22, 36, 17, 33, 57, 16, 30, 62, 15, 35, 40, 20, 45, 59, 10, 54, 8, 63, 13, 52, 27, 22, 57, 28, 12, 32, 51, 55, 22, 63, 4, 16, 54, 12, 62, 45, 19, 58, 13, 32, 40, 20, 56, 7, 57, 9, 54, 6, 29, 42, 21, 8, 55, 35, 47, 6, 41 },
117 { 56, 33, 58, 32, 19, 35, 42, 6, 59, 11, 38, 5, 49, 12, 62, 7, 52, 17, 5, 25, 54, 20, 61, 31, 54, 27, 41, 11, 44, 5, 59, 12, 36, 51, 10, 61, 28, 41, 48, 9, 43, 63, 5, 40, 20, 8, 49, 26, 34, 21, 58, 1, 18, 45, 7, 39, 61, 26, 8, 50, 23, 10, 63, 5, 55, 37, 19, 49, 52, 15, 59, 47, 13, 54, 1, 25, 42, 58, 10, 48, 3, 27, 50, 1, 17, 48, 34, 41, 16, 40, 2, 45, 10, 39, 17, 61, 5, 38, 19, 9, 41, 31, 60, 38, 5, 23, 36, 8, 30, 55, 24, 63, 12, 48, 14, 51, 31, 20, 45, 25, 12, 50, 32, 2, 28, 11, 62, 14 },
118 { 44, 16, 7, 48, 1, 62, 16, 50, 27, 33, 61, 25, 17, 44, 31, 14, 22, 43, 32, 48, 18, 40, 8, 36, 3, 16, 33, 62, 23, 38, 25, 53, 2, 21, 41, 6, 22, 15, 59, 29, 16, 37, 26, 15, 52, 42, 23, 15, 54, 39, 10, 30, 53, 11, 49, 24, 2, 43, 55, 17, 34, 44, 15, 31, 24, 44, 2, 32, 7, 35, 25, 5, 40, 45, 29, 51, 6, 21, 37, 52, 24, 60, 13, 31, 53, 23, 2, 28, 49, 24, 31, 60, 20, 51, 1, 34, 48, 14, 59, 33, 50, 1, 18, 33, 48, 60, 17, 51, 39, 6, 38, 2, 35, 29, 40, 23, 1, 62, 15, 53, 37, 17, 46, 57, 40, 51, 24, 22 },
119 { 5, 37, 52, 24, 45, 13, 40, 3, 45, 9, 19, 42, 56, 4, 37, 46, 56, 2, 63, 11, 51, 1, 49, 13, 59, 45, 39, 1, 48, 15, 58, 9, 46, 31, 54, 35, 57, 38, 3, 46, 56, 4, 47, 57, 1, 30, 38, 63, 3, 46, 28, 63, 41, 14, 33, 62, 19, 32, 13, 28, 61, 1, 53, 42, 11, 60, 22, 62, 27, 42, 61, 31, 19, 8, 61, 12, 32, 55, 2, 18, 33, 12, 43, 36, 9, 62, 30, 55, 6, 58, 35, 7, 43, 29, 54, 23, 43, 30, 3, 25, 11, 45, 52, 28, 7, 14, 42, 1, 22, 50, 16, 53, 19, 59, 4, 46, 33, 41, 4, 35, 58, 5, 26, 13, 20, 2, 34, 54 },
120 { 30, 63, 21, 10, 26, 55, 29, 59, 23, 39, 53, 1, 36, 24, 59, 27, 10, 34, 23, 38, 30, 60, 22, 42, 28, 19, 9, 57, 30, 19, 43, 33, 13, 63, 3, 19, 11, 50, 31, 20, 14, 34, 10, 35, 17, 59, 7, 31, 19, 25, 50, 5, 20, 57, 29, 6, 52, 41, 4, 46, 20, 37, 26, 17, 49, 6, 39, 18, 53, 14, 3, 49, 57, 23, 34, 48, 14, 41, 28, 38, 56, 6, 58, 25, 39, 19, 43, 15, 37, 11, 47, 18, 53, 4, 37, 9, 62, 21, 53, 40, 57, 24, 13, 40, 56, 26, 47, 31, 59, 25, 45, 27, 10, 43, 21, 61, 13, 27, 48, 9, 23, 43, 31, 62, 38, 59, 9, 47 },
121 { 25, 4, 40, 60, 34, 6, 18, 36, 8, 57, 12, 30, 49, 14, 6, 54, 41, 16, 50, 6, 43, 15, 34, 4, 53, 24, 50, 35, 4, 51, 7, 55, 28, 24, 39, 44, 60, 7, 25, 62, 42, 53, 24, 61, 28, 45, 52, 12, 48, 37, 9, 35, 43, 3, 37, 48, 12, 58, 30, 52, 9, 59, 6, 57, 33, 29, 48, 4, 37, 45, 20, 34, 10, 39, 0, 60, 22, 45, 8, 63, 21, 42, 14, 49, 3, 56, 11, 46, 21, 61, 0, 42, 25, 13, 63, 17, 36, 8, 46, 16, 6, 35, 63, 0, 21, 37, 4, 57, 9, 34, 5, 61, 48, 32, 8, 37, 54, 17, 56, 30, 60, 0, 50, 16, 7, 29, 42, 17 },
122 { 32, 50, 15, 48, 2, 43, 52, 25, 47, 16, 32, 63, 21, 52, 40, 19, 0, 61, 29, 58, 20, 56, 26, 46, 12, 55, 6, 22, 62, 32, 17, 40, 0, 49, 34, 8, 27, 32, 48, 0, 21, 39, 5, 44, 12, 6, 22, 40, 0, 57, 16, 60, 23, 17, 54, 22, 36, 15, 24, 39, 19, 34, 47, 23, 0, 54, 13, 51, 24, 9, 55, 16, 52, 27, 44, 20, 4, 54, 26, 49, 0, 30, 46, 16, 29, 51, 34, 4, 52, 28, 33, 15, 57, 39, 26, 49, 0, 56, 27, 31, 48, 20, 43, 29, 53, 11, 46, 19, 41, 13, 55, 18, 0, 57, 26, 51, 2, 44, 6, 38, 14, 40, 22, 45, 36, 53, 3, 57 },
123 { 44, 12, 37, 28, 22, 57, 11, 38, 0, 51, 9, 41, 4, 29, 11, 47, 33, 45, 12, 26, 3, 36, 9, 63, 31, 16, 38, 44, 14, 47, 25, 61, 20, 58, 15, 47, 17, 57, 13, 36, 9, 51, 18, 29, 50, 36, 54, 20, 61, 27, 32, 13, 53, 44, 9, 27, 0, 63, 45, 2, 56, 10, 14, 43, 41, 28, 58, 11, 35, 60, 30, 41, 6, 63, 11, 51, 37, 32, 15, 10, 35, 53, 5, 61, 22, 7, 26, 59, 23, 9, 44, 48, 21, 3, 51, 32, 24, 41, 12, 61, 2, 55, 9, 15, 35, 58, 28, 15, 62, 30, 37, 23, 42, 29, 11, 17, 35, 24, 63, 20, 52, 28, 8, 55, 11, 23, 47, 19 },
124 { 0, 56, 8, 53, 14, 31, 61, 20, 55, 28, 62, 18, 35, 60, 25, 57, 7, 23, 39, 54, 47, 17, 43, 0, 40, 59, 29, 2, 56, 10, 37, 5, 43, 11, 29, 52, 1, 23, 54, 41, 59, 30, 55, 1, 62, 15, 33, 4, 43, 10, 47, 39, 1, 31, 40, 60, 49, 33, 7, 55, 26, 50, 31, 61, 8, 18, 21, 32, 44, 1, 25, 47, 18, 36, 30, 23, 59, 7, 40, 59, 27, 19, 38, 32, 44, 54, 40, 17, 38, 60, 27, 6, 35, 55, 10, 14, 44, 5, 50, 17, 38, 26, 42, 50, 18, 3, 44, 52, 2, 49, 7, 52, 15, 46, 62, 39, 55, 10, 31, 48, 3, 58, 33, 18, 61, 34, 13, 59 },
125 { 39, 27, 63, 20, 35, 41, 4, 45, 26, 5, 38, 13, 44, 2, 50, 17, 37, 52, 2, 13, 28, 58, 24, 51, 21, 8, 34, 48, 27, 42, 18, 51, 31, 56, 5, 36, 38, 44, 4, 17, 26, 11, 38, 23, 42, 8, 56, 39, 24, 51, 5, 56, 21, 59, 14, 6, 18, 42, 22, 35, 16, 37, 3, 25, 39, 46, 63, 5, 50, 17, 58, 8, 55, 3, 50, 12, 43, 17, 47, 2, 51, 9, 62, 12, 1, 35, 13, 50, 1, 37, 12, 51, 19, 29, 46, 59, 22, 58, 33, 45, 22, 60, 10, 32, 61, 39, 8, 33, 25, 36, 20, 60, 38, 4, 21, 5, 28, 45, 12, 18, 42, 11, 49, 1, 27, 40, 6, 30 },
126 { 24, 16, 42, 1, 50, 10, 48, 17, 33, 43, 24, 48, 21, 55, 31, 42, 10, 21, 63, 35, 49, 6, 33, 13, 41, 53, 10, 20, 60, 6, 53, 26, 12, 41, 22, 60, 14, 28, 63, 33, 49, 3, 45, 16, 48, 26, 14, 46, 18, 30, 35, 26, 8, 50, 29, 51, 25, 57, 12, 47, 53, 9, 62, 20, 54, 2, 36, 15, 40, 28, 33, 13, 38, 24, 46, 1, 29, 56, 33, 20, 44, 24, 41, 26, 57, 20, 63, 8, 30, 55, 5, 41, 62, 8, 34, 2, 37, 10, 19, 6, 37, 1, 53, 23, 5, 27, 58, 22, 43, 12, 50, 26, 9, 34, 54, 32, 49, 1, 59, 37, 22, 46, 25, 36, 51, 15, 54, 46 },
127 { 52, 7, 45, 33, 26, 58, 14, 60, 7, 54, 3, 58, 8, 34, 14, 5, 59, 30, 18, 44, 8, 22, 48, 62, 3, 26, 55, 38, 23, 16, 39, 1, 62, 24, 49, 9, 53, 19, 46, 7, 19, 60, 31, 58, 2, 34, 53, 7, 59, 2, 62, 42, 46, 19, 36, 11, 44, 4, 38, 28, 1, 43, 32, 51, 12, 29, 56, 22, 52, 2, 62, 49, 22, 60, 14, 35, 63, 5, 25, 57, 14, 53, 4, 46, 18, 31, 42, 22, 47, 20, 58, 31, 16, 43, 23, 54, 30, 42, 52, 57, 29, 49, 30, 13, 45, 48, 16, 55, 6, 63, 1, 44, 14, 58, 19, 47, 15, 24, 51, 34, 6, 55, 5, 63, 20, 41, 21, 9 },
128 { 30, 62, 18, 55, 5, 23, 39, 29, 49, 30, 15, 36, 28, 46, 60, 25, 39, 46, 4, 32, 61, 40, 15, 30, 36, 45, 14, 2, 49, 33, 57, 45, 18, 32, 3, 45, 30, 2, 35, 52, 40, 27, 13, 21, 38, 63, 20, 28, 37, 23, 16, 10, 13, 55, 2, 62, 21, 32, 60, 17, 58, 23, 5, 40, 16, 48, 7, 45, 10, 26, 43, 19, 6, 31, 52, 21, 39, 16, 48, 9, 37, 28, 36, 55, 7, 48, 3, 59, 15, 45, 25, 1, 53, 13, 47, 7, 62, 15, 4, 25, 12, 41, 18, 60, 38, 11, 34, 19, 39, 31, 29, 56, 23, 42, 3, 27, 60, 41, 8, 16, 61, 29, 43, 9, 32, 2, 60, 34 },
129 { 3, 38, 13, 37, 52, 44, 2, 19, 12, 42, 63, 19, 40, 1, 20, 50, 12, 55, 15, 56, 27, 1, 54, 11, 57, 18, 32, 63, 44, 4, 29, 13, 37, 61, 35, 16, 42, 57, 12, 22, 6, 55, 43, 10, 50, 5, 44, 11, 48, 52, 34, 58, 28, 41, 38, 30, 7, 52, 11, 49, 30, 14, 45, 27, 59, 34, 21, 38, 32, 58, 11, 36, 56, 42, 9, 41, 3, 54, 31, 42, 0, 60, 16, 11, 39, 24, 52, 33, 6, 36, 10, 40, 32, 60, 26, 20, 39, 28, 47, 34, 63, 8, 54, 3, 24, 56, 0, 51, 13, 47, 16, 40, 7, 35, 52, 11, 36, 4, 57, 30, 39, 13, 18, 50, 58, 28, 12, 48 },
130 { 57, 24, 49, 21, 10, 31, 61, 36, 56, 0, 22, 53, 11, 56, 32, 7, 36, 27, 41, 9, 46, 19, 34, 42, 25, 7, 50, 9, 28, 21, 54, 8, 50, 7, 27, 59, 10, 25, 48, 62, 37, 0, 33, 58, 25, 18, 32, 61, 0, 15, 45, 5, 50, 3, 23, 55, 47, 17, 40, 6, 60, 34, 53, 8, 41, 0, 61, 13, 54, 4, 46, 28, 0, 17, 48, 27, 58, 13, 23, 61, 33, 21, 50, 30, 62, 8, 14, 29, 56, 27, 61, 49, 17, 2, 44, 11, 51, 0, 59, 17, 40, 20, 32, 47, 36, 21, 42, 28, 60, 4, 54, 10, 59, 17, 30, 62, 21, 43, 26, 48, 0, 56, 36, 25, 8, 44, 39, 17 },
131 { 10, 42, 4, 59, 27, 47, 8, 23, 51, 32, 45, 6, 37, 26, 48, 43, 62, 0, 21, 53, 38, 12, 51, 5, 60, 47, 24, 37, 59, 15, 35, 47, 22, 55, 0, 50, 21, 40, 6, 29, 15, 52, 24, 8, 41, 55, 13, 29, 40, 56, 24, 31, 19, 33, 61, 15, 0, 35, 24, 42, 21, 2, 19, 57, 24, 15, 30, 50, 20, 25, 40, 16, 57, 34, 61, 8, 29, 45, 6, 49, 11, 47, 2, 44, 19, 57, 38, 50, 12, 42, 21, 4, 35, 52, 28, 56, 23, 36, 13, 45, 4, 52, 27, 14, 6, 62, 9, 45, 21, 37, 25, 46, 33, 49, 0, 44, 7, 53, 13, 19, 53, 31, 3, 47, 15, 56, 22, 51 },
132 { 35, 28, 53, 32, 1, 16, 54, 40, 9, 17, 25, 58, 14, 59, 3, 22, 16, 51, 31, 5, 23, 58, 28, 17, 35, 20, 0, 42, 11, 52, 3, 31, 41, 17, 43, 13, 32, 54, 18, 60, 32, 45, 17, 49, 2, 36, 51, 22, 7, 36, 9, 63, 48, 12, 46, 26, 43, 28, 63, 13, 48, 37, 51, 33, 5, 47, 55, 9, 42, 63, 7, 51, 24, 12, 37, 19, 55, 34, 18, 38, 15, 28, 54, 34, 5, 43, 22, 0, 48, 14, 54, 24, 58, 9, 38, 5, 32, 55, 21, 30, 49, 9, 59, 43, 30, 51, 35, 26, 7, 53, 2, 22, 14, 27, 57, 18, 38, 24, 33, 45, 10, 41, 20, 60, 37, 5, 32, 0 },
133 { 63, 19, 15, 40, 62, 35, 14, 28, 46, 61, 4, 49, 35, 10, 29, 54, 33, 8, 45, 62, 37, 1, 43, 55, 10, 52, 61, 30, 19, 40, 25, 62, 11, 38, 27, 58, 36, 3, 46, 8, 39, 4, 62, 28, 47, 20, 4, 54, 47, 27, 43, 1, 21, 38, 8, 58, 10, 54, 4, 56, 9, 26, 12, 39, 60, 27, 18, 37, 1, 31, 35, 5, 45, 50, 2, 43, 26, 1, 59, 23, 56, 40, 7, 26, 58, 17, 32, 63, 25, 39, 7, 31, 45, 19, 63, 15, 48, 8, 37, 61, 16, 34, 1, 56, 18, 3, 15, 58, 49, 32, 63, 41, 55, 5, 40, 22, 50, 6, 59, 2, 63, 23, 52, 11, 26, 61, 44, 23 },
134 { 11, 56, 46, 6, 22, 43, 58, 3, 34, 21, 38, 30, 18, 44, 52, 13, 41, 57, 17, 28, 14, 49, 25, 7, 33, 39, 26, 6, 56, 48, 1, 20, 56, 5, 46, 9, 19, 51, 30, 25, 56, 21, 35, 14, 57, 42, 16, 33, 10, 57, 17, 59, 41, 25, 53, 37, 20, 40, 30, 18, 31, 62, 44, 22, 3, 44, 11, 48, 23, 53, 18, 60, 29, 22, 62, 15, 53, 47, 10, 41, 3, 19, 52, 36, 13, 46, 10, 35, 3, 61, 41, 16, 1, 50, 26, 42, 18, 46, 2, 25, 54, 20, 39, 23, 47, 31, 41, 12, 38, 17, 8, 19, 31, 48, 12, 61, 9, 54, 29, 35, 15, 38, 6, 43, 34, 14, 7, 47 },
135 { 39, 2, 33, 26, 53, 8, 18, 50, 41, 12, 53, 1, 63, 24, 19, 39, 2, 24, 47, 10, 60, 38, 19, 63, 48, 4, 15, 45, 32, 14, 60, 36, 29, 53, 23, 63, 34, 12, 61, 1, 43, 11, 53, 30, 1, 26, 60, 45, 23, 39, 3, 29, 12, 50, 4, 16, 51, 3, 45, 36, 50, 1, 16, 54, 35, 14, 57, 30, 58, 9, 46, 14, 41, 10, 32, 38, 4, 30, 21, 51, 32, 63, 25, 1, 60, 27, 53, 18, 51, 22, 28, 55, 34, 12, 40, 3, 60, 29, 57, 41, 6, 44, 11, 53, 8, 61, 24, 57, 1, 28, 44, 59, 36, 3, 34, 25, 41, 31, 16, 44, 22, 47, 28, 58, 1, 49, 54, 29 },
136 { 58, 25, 50, 13, 38, 30, 60, 24, 6, 57, 27, 42, 9, 45, 6, 61, 30, 50, 4, 34, 29, 3, 46, 13, 22, 42, 58, 28, 9, 39, 23, 44, 7, 15, 44, 2, 40, 15, 47, 41, 23, 37, 7, 59, 38, 11, 34, 6, 62, 14, 52, 35, 55, 19, 32, 61, 33, 24, 57, 6, 22, 59, 29, 7, 49, 25, 40, 3, 17, 39, 27, 52, 0, 55, 16, 57, 24, 61, 36, 6, 29, 12, 48, 39, 20, 44, 6, 40, 33, 5, 48, 10, 57, 36, 22, 51, 33, 9, 24, 12, 62, 29, 50, 35, 14, 43, 5, 33, 47, 52, 13, 23, 10, 51, 56, 16, 46, 1, 49, 4, 61, 9, 52, 18, 31, 21, 36, 17 },
137 { 19, 42, 9, 48, 2, 44, 11, 37, 48, 20, 33, 16, 55, 35, 49, 15, 37, 20, 59, 16, 53, 22, 56, 31, 50, 11, 34, 54, 16, 51, 4, 49, 33, 53, 21, 28, 56, 24, 31, 9, 52, 16, 48, 24, 44, 13, 51, 20, 31, 49, 18, 6, 34, 2, 44, 14, 47, 8, 15, 43, 13, 41, 33, 52, 20, 61, 7, 51, 34, 62, 4, 20, 36, 33, 43, 8, 46, 13, 53, 17, 45, 42, 9, 31, 52, 11, 30, 56, 13, 59, 17, 44, 27, 6, 62, 11, 43, 17, 49, 38, 26, 2, 16, 27, 58, 21, 54, 18, 26, 5, 35, 61, 43, 27, 7, 39, 14, 58, 37, 55, 20, 33, 13, 40, 62, 10, 55, 5 },
138 { 51, 14, 61, 29, 59, 20, 55, 31, 0, 49, 11, 60, 3, 26, 22, 56, 0, 40, 12, 43, 41, 8, 36, 0, 17, 57, 24, 2, 46, 26, 61, 18, 0, 38, 12, 59, 6, 49, 3, 57, 19, 63, 5, 33, 18, 54, 28, 56, 0, 43, 26, 46, 63, 27, 56, 22, 27, 54, 38, 28, 63, 24, 10, 45, 0, 31, 42, 21, 12, 25, 44, 49, 59, 6, 26, 50, 3, 34, 27, 59, 0, 35, 62, 16, 4, 58, 47, 0, 43, 24, 37, 2, 54, 20, 46, 31, 0, 56, 34, 5, 55, 45, 60, 37, 0, 40, 10, 38, 63, 46, 15, 20, 0, 53, 21, 62, 30, 11, 24, 27, 40, 0, 57, 26, 3, 45, 27, 35 }
139};
140
141EFL_ALWAYS_INLINE void
142_soft16_convert_from_rgba_pt(const DATA32 *src, DATA16 *dst, DATA8 *alpha,
143 const int x, const int y)
144{
145 DATA8 orig_r, orig_g, orig_b, orig_a;
146
147 orig_r = R_VAL(src);
148 orig_g = G_VAL(src);
149 orig_b = B_VAL(src);
150 orig_a = A_VAL(src);
151
152 if (orig_a == 255)
153 {
154 DATA8 dith5, dith6, dith, r, g, b;
155
156 dith = dither_table[x & S16_DM_MSK][y & S16_DM_MSK];
157 dith5 = dith >> S16_DM_SHF(5);
158 dith6 = dith >> S16_DM_SHF(6);
159
160 r = orig_r >> 3;
161 g = orig_g >> 2;
162 b = orig_b >> 3;
163
164 if (((orig_r - (r << 3)) >= dith5) && (r < 0x1f)) r++;
165 if (((orig_g - (g << 2)) >= dith6) && (g < 0x3f)) g++;
166 if (((orig_b - (b << 3)) >= dith5) && (b < 0x1f)) b++;
167
168 *dst = (r << 11) | (g << 5) | b;
169 *alpha = 31;
170 }
171 else if (orig_a == 0)
172 {
173 *dst = 0;
174 *alpha = 0;
175 }
176 else
177 {
178 DATA8 r, g, b, a;
179 r = orig_r >> 3;
180 g = orig_g >> 2;
181 b = orig_b >> 3;
182 a = (orig_a >> 3) + 1;
183
184 *dst = (r << 11) | (g << 5) | b;
185 *alpha = a;
186 }
187}
188
189static inline void
190_soft16_convert_from_rgba_scanline(const DATA32 *src, DATA16 *dst,
191 DATA8 *alpha, const int y, const int w)
192{
193 int x, m;
194
195 m = (w & ~7);
196 x = 0;
197 pld(src, 0);
198
199 while (x < m)
200 {
201 pld(src, 32);
202 UNROLL8({
203 _soft16_convert_from_rgba_pt(src, dst, alpha, x, y);
204 src++;
205 dst++;
206 alpha++;
207 x++;
208 });
209 }
210
211 for (; x < w; x++, src++, dst++, alpha++)
212 _soft16_convert_from_rgba_pt(src, dst, alpha, x, y);
213}
214
215void
216evas_common_soft16_image_convert_from_rgba(Soft16_Image *im, const DATA32 *src)
217{
218 const DATA32 *sp;
219 DATA16 *dp;
220 DATA8 *ap;
221 unsigned int y;
222
223 sp = src;
224 dp = im->pixels;
225 ap = im->alpha;
226
227 for (y = 0; y < im->cache_entry.h; y++, sp += im->cache_entry.w, dp += im->stride, ap += im->stride)
228 _soft16_convert_from_rgba_scanline(sp, dp, ap, y, im->cache_entry.w);
229}
230
231EFL_ALWAYS_INLINE void
232_soft16_convert_from_rgb_pt(const DATA32 *src, DATA16 *dst,
233 const int x, const int y)
234{
235 DATA8 orig_r, orig_g, orig_b, r, g, b, dith5, dith6, dith;
236
237 orig_r = R_VAL(src);
238 orig_g = G_VAL(src);
239 orig_b = B_VAL(src);
240
241 r = orig_r >> 3;
242 g = orig_g >> 2;
243 b = orig_b >> 3;
244
245 dith = dither_table[x & S16_DM_MSK][y & S16_DM_MSK];
246 dith5 = dith >> S16_DM_SHF(5);
247 dith6 = dith >> S16_DM_SHF(6);
248
249 if (((orig_r - (r << 3)) >= dith5) && (r < 0x1f)) r++;
250 if (((orig_g - (g << 2)) >= dith6) && (g < 0x3f)) g++;
251 if (((orig_b - (b << 3)) >= dith5) && (b < 0x1f)) b++;
252
253 *dst = (r << 11) | (g << 5) | b;
254}
255
256static inline void
257_soft16_convert_from_rgb_scanline(const DATA32 *src, DATA16 *dst, const int y,
258 const int w)
259{
260 int x, m;
261
262 m = (w & ~7);
263 x = 0;
264 pld(src, 0);
265
266 while (x < m)
267 {
268 pld(src, 32);
269 UNROLL8({
270 _soft16_convert_from_rgb_pt(src, dst, x, y);
271 src++;
272 dst++;
273 x++;
274 });
275 }
276
277 for (; x < w; x++, src++, dst++)
278 _soft16_convert_from_rgb_pt(src, dst, x, y);
279}
280
281void
282evas_common_soft16_image_convert_from_rgb(Soft16_Image *im, const DATA32 *src)
283{
284 const DATA32 *sp;
285 DATA16 *dp;
286 unsigned int y;
287
288 sp = src;
289 dp = im->pixels;
290
291 for (y = 0; y < im->cache_entry.h; y++, sp += im->cache_entry.w, dp += im->stride)
292 _soft16_convert_from_rgb_scanline(sp, dp, y, im->cache_entry.w);
293}
diff --git a/libraries/evas/src/lib/engines/common_16/evas_soft16_font.c b/libraries/evas/src/lib/engines/common_16/evas_soft16_font.c
new file mode 100644
index 0000000..fbad4d2
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common_16/evas_soft16_font.c
@@ -0,0 +1,295 @@
1#include "evas_common_soft16.h"
2
3EFL_ALWAYS_INLINE void
4_glyph_pt_mask_solid_solid(DATA16 *dst,
5 const DATA16 rgb565,
6 const DATA32 rgb565_unpack,
7 const DATA8 *mask)
8{
9 DATA8 alpha = *mask >> 3;
10
11 if (alpha == 31) *dst = rgb565;
12 else if (alpha > 0)
13 {
14 DATA32 d;
15
16 d = RGB_565_UNPACK(*dst);
17 d = RGB_565_UNPACKED_BLEND_UNMUL(rgb565_unpack, d, alpha);
18 *dst = RGB_565_PACK(d);
19 }
20}
21
22static void
23_glyph_scanline_mask_solid_solid(DATA16 *dst,
24 int size,
25 const DATA16 rgb565,
26 const DATA32 rgb565_unpack,
27 const DATA8 *mask)
28{
29 DATA16 *start, *end;
30
31 start = dst;
32 pld(start, 0);
33 pld(mask, 0);
34 end = start + (size & ~3);
35
36 while (start < end)
37 {
38 pld(start, 16);
39 pld(mask, 4);
40 UNROLL4({
41 _glyph_pt_mask_solid_solid(start, rgb565, rgb565_unpack, mask);
42 start++;
43 mask++;
44 });
45 }
46
47 end = start + (size & 3);
48 for (; start < end; start++, mask++)
49 _glyph_pt_mask_solid_solid(start, rgb565, rgb565_unpack, mask);
50}
51
52EFL_ALWAYS_INLINE void
53_glyph_pt_mask_transp_solid(DATA16 *dst,
54 DATA32 rgb565_unpack,
55 DATA8 alpha,
56 const DATA8 *mask)
57{
58 DATA32 a, b;
59 int rel_alpha;
60
61 rel_alpha = *mask >> 3;
62 alpha = (alpha * rel_alpha) >> 5;
63 if (alpha == 0)
64 return;
65
66 alpha++;
67
68 a = ((rgb565_unpack * rel_alpha) >> 5) & RGB_565_UNPACKED_MASK;
69 b = RGB_565_UNPACK(*dst);
70 b = RGB_565_UNPACKED_BLEND(a, b, alpha);
71 *dst = RGB_565_PACK(b);
72}
73
74static void
75_glyph_scanline_mask_transp_solid(DATA16 *dst,
76 int size,
77 const DATA32 rgb565_unpack,
78 const DATA8 rel_alpha,
79 const DATA8 *mask)
80{
81 DATA16 *start, *end;
82
83 start = dst;
84 pld(start, 0);
85 pld(mask, 0);
86 end = start + (size & ~3);
87
88 while (start < end)
89 {
90 pld(start, 16);
91 pld(mask, 4);
92 UNROLL4({
93 _glyph_pt_mask_transp_solid(start, rgb565_unpack, rel_alpha, mask);
94 start++;
95 mask++;
96 });
97 }
98
99 end = start + (size & 3);
100 for (; start < end; start++, mask++)
101 _glyph_pt_mask_transp_solid(start, rgb565_unpack, rel_alpha, mask);
102}
103
104static inline void
105_calc_ext(const Soft16_Image *dst, const RGBA_Draw_Context *dc,
106 Eina_Rectangle *ext)
107{
108 EINA_RECTANGLE_SET(ext, 0, 0, dst->cache_entry.w, dst->cache_entry.h);
109
110 if (dc->clip.use)
111 {
112 int v;
113
114 EINA_RECTANGLE_SET(ext, dc->clip.x, dc->clip.y, dc->clip.w, dc->clip.h);
115 if (ext->x < 0)
116 {
117 ext->w += ext->x;
118 ext->x = 0;
119 }
120 if (ext->y < 0)
121 {
122 ext->h += ext->y;
123 ext->y = 0;
124 }
125
126 v = dst->cache_entry.w - ext->x;
127 if (ext->w > v) ext->w = v;
128
129 v = dst->cache_entry.h - ext->y;
130 if (ext->h > v) ext->h = v;
131 }
132}
133
134static inline void
135_glyph_scanline(Soft16_Image *dst, const DATA8 *p_mask,
136 const Eina_Rectangle ext, int dx, int dy, int max_x, int max_y,
137 int w, DATA8 alpha, const DATA16 rgb565,
138 const DATA32 rgb565_unpack)
139{
140 int size, in_x, in_w;
141 DATA16 *p_pixels;
142
143 if ((dx >= max_x) || (dy < ext.y) || (dy >= max_y)) return;
144
145 in_x = 0;
146 in_w = 0;
147
148 if (dx + w > max_x) in_w += (dx + w) - max_x;
149
150 if (dx < ext.x)
151 {
152 in_w += ext.x - dx;
153 in_x = ext.x - dx;
154 dx = ext.x;
155 }
156
157 size = w - in_w;
158 p_pixels = dst->pixels + (dy * dst->stride) + dx;
159 p_mask += in_x;
160
161 if (size > 1)
162 {
163 if (alpha == 31)
164 _glyph_scanline_mask_solid_solid
165 (p_pixels, size, rgb565, rgb565_unpack, p_mask);
166 else if (alpha != 0)
167 _glyph_scanline_mask_transp_solid
168 (p_pixels, size, rgb565_unpack, alpha, p_mask);
169 }
170 else if (size == 1)
171 {
172 if (alpha == 31)
173 _glyph_pt_mask_solid_solid(p_pixels, rgb565, rgb565_unpack, p_mask);
174 else if (alpha != 0)
175 _glyph_pt_mask_transp_solid(p_pixels, rgb565_unpack, alpha, p_mask);
176 }
177}
178
179static void
180_soft16_font_glyph_draw_grayscale(Soft16_Image *dst,
181 RGBA_Draw_Context *dc __UNUSED__, RGBA_Font_Glyph *fg __UNUSED__,
182 int x, int y, DATA8 alpha, DATA16 rgb565,
183 const Eina_Rectangle ext, int bw, int bh,
184 int bpitch, const DATA8 *bitmap)
185{
186 const DATA32 rgb565_unpack = RGB_565_UNPACK(rgb565);
187 int i, max_x, max_y;
188
189 max_x = ext.x + ext.w;
190 max_y = ext.y + ext.h;
191
192 for (i = 0; i < bh; i++, bitmap += bpitch)
193 _glyph_scanline(dst, bitmap, ext, x, y + i, max_x, max_y, bw,
194 alpha, rgb565, rgb565_unpack);
195}
196
197static inline void
198_glyph_create_mask_line(DATA8 *mask, const DATA8 *bitmap, int w)
199{
200 const DATA8 bitrepl[2] = {0x0, 0xff};
201 int i;
202
203 for (i = 0; i < w; i += 8, bitmap++)
204 {
205 int j, size;
206 DATA32 bits;
207
208 if (i + 8 < w) size = 8;
209 else size = w - i;
210
211 bits = *bitmap;
212
213 for (j = size - 1; j >= 0; j--, mask++)
214 *mask = bitrepl[(bits >> j) & 0x1];
215 }
216}
217
218static void
219_soft16_font_glyph_draw_mono(Soft16_Image *dst,
220 RGBA_Draw_Context *dc __UNUSED__, RGBA_Font_Glyph *fg __UNUSED__,
221 int x, int y, DATA8 alpha, DATA16 rgb565,
222 const Eina_Rectangle ext, int bw, int bh,
223 int bpitch, const DATA8 *bitmap)
224{
225 const DATA32 rgb565_unpack = RGB_565_UNPACK(rgb565);
226 DATA8 *mask;
227 int i, max_x, max_y;
228
229 max_x = ext.x + ext.w;
230 max_y = ext.y + ext.h;
231
232 mask = alloca(bpitch);
233 for (i = 0; i < bh; i++, bitmap += bpitch)
234 {
235 _glyph_create_mask_line(mask, bitmap, bw);
236 _glyph_scanline(dst, mask, ext, x, y + i, max_x, max_y, bw,
237 alpha, rgb565, rgb565_unpack);
238 }
239}
240
241void
242evas_common_soft16_font_glyph_draw(void *data, void *dest __UNUSED__, void *context,
243 RGBA_Font_Glyph *fg, int x, int y)
244{
245 Soft16_Image *dst;
246 RGBA_Draw_Context *dc;
247 const DATA8 *bitmap;
248 DATA8 alpha, r, g, b;
249 DATA16 rgb565;
250 Eina_Rectangle ext;
251 int bpitch, bw, bh;
252
253 dst = data;
254 dc = context;
255
256 alpha = A_VAL(&dc->col.col) >> 3;
257 if (alpha == 0) return; /* precision is 5 bits, 3 bits lost */
258
259 r = R_VAL(&dc->col.col) >> 3;
260 g = G_VAL(&dc->col.col) >> 2;
261 b = B_VAL(&dc->col.col) >> 3;
262
263 if (r > alpha) r = alpha;
264 if (g > (alpha << 1)) g = (alpha << 1);
265 if (b > alpha) b = alpha;
266
267 rgb565 = (r << 11) | (g << 5) | b;
268
269 bitmap = fg->glyph_out->bitmap.buffer;
270 bh = fg->glyph_out->bitmap.rows;
271 bw = fg->glyph_out->bitmap.width;
272 bpitch = fg->glyph_out->bitmap.pitch;
273 if (bpitch < bw) bpitch = bw;
274
275 _calc_ext(dst, dc, &ext);
276
277 if ((fg->glyph_out->bitmap.num_grays == 256) &&
278 (fg->glyph_out->bitmap.pixel_mode == ft_pixel_mode_grays))
279 _soft16_font_glyph_draw_grayscale(dst, dc, fg, x, y, alpha, rgb565,
280 ext, bw, bh, bpitch, bitmap);
281 else
282 _soft16_font_glyph_draw_mono(dst, dc, fg, x, y, alpha, rgb565,
283 ext, bw, bh, bpitch, bitmap);
284}
285
286void *
287evas_common_soft16_font_glyph_new(void *data __UNUSED__, RGBA_Font_Glyph *fg __UNUSED__)
288{
289 return (void *)1; /* core requires != NULL to work */
290}
291
292void
293evas_common_soft16_font_glyph_free(void *ext_dat __UNUSED__)
294{
295}
diff --git a/libraries/evas/src/lib/engines/common_16/evas_soft16_image_scaled_sampled.c b/libraries/evas/src/lib/engines/common_16/evas_soft16_image_scaled_sampled.c
new file mode 100644
index 0000000..9c9f03c
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common_16/evas_soft16_image_scaled_sampled.c
@@ -0,0 +1,471 @@
1#include "evas_common_soft16.h"
2#include "evas_soft16_point_blend.c"
3
4static void
5_soft16_image_draw_scaled_solid_solid(Soft16_Image *src,
6 Soft16_Image *dst,
7 RGBA_Draw_Context *dc __UNUSED__,
8 int dst_offset, int w, int h,
9 int *offset_x, int *offset_y)
10{
11 DATA16 *dst_itr;
12 int y, w_align;
13
14 w_align = w & ~7;
15
16 dst_itr = dst->pixels + dst_offset;
17 for (y = 0; y < h; y++, dst_itr += dst->stride)
18 {
19 DATA16 *d, *s;
20 int x;
21
22 s = src->pixels + offset_y[y];
23 pld(s, 0);
24 pld(offset_x, 0);
25
26 d = dst_itr;
27 x = 0;
28 while (x < w_align)
29 {
30 pld(s, 32);
31 pld(offset_x + x, 32);
32
33 UNROLL8({
34 _soft16_pt_blend_solid_solid(d, s[offset_x[x]]);
35 x++;
36 d++;
37 });
38 }
39
40 for (; x < w; x++, d++)
41 _soft16_pt_blend_solid_solid(d, s[offset_x[x]]);
42 }
43}
44static void
45_soft16_image_draw_scaled_transp_solid(Soft16_Image *src,
46 Soft16_Image *dst,
47 RGBA_Draw_Context *dc __UNUSED__,
48 int dst_offset, int w, int h,
49 int *offset_x, int *offset_y)
50{
51 DATA16 *dst_itr;
52 int y, w_align;
53
54 w_align = w & ~7;
55
56 dst_itr = dst->pixels + dst_offset;
57 for (y = 0; y < h; y++, dst_itr += dst->stride)
58 {
59 DATA16 *d, *s;
60 DATA8 *a;
61 int x;
62
63 s = src->pixels + offset_y[y];
64 a = src->alpha + offset_y[y];
65 pld(s, 0);
66 pld(a, 0);
67 pld(offset_x, 0);
68
69 d = dst_itr;
70 x = 0;
71 while (x < w_align)
72 {
73 pld(s, 32);
74 pld(a, 8);
75 pld(offset_x + x, 32);
76
77 UNROLL8({
78 int off_x = offset_x[x];
79 _soft16_pt_blend_transp_solid(d, s[off_x], a[off_x]);
80 x++;
81 d++;
82 });
83 }
84
85 for (; x < w; x++, d++)
86 _soft16_pt_blend_transp_solid(d, s[offset_x[x]], a[offset_x[x]]);
87 }
88}
89
90static inline void
91_soft16_image_draw_scaled_no_mul(Soft16_Image *src, Soft16_Image *dst,
92 RGBA_Draw_Context *dc,
93 int dst_offset, int w, int h,
94 int *offset_x, int *offset_y)
95{
96 if ((src->cache_entry.flags.alpha && src->alpha) &&
97 (!dst->cache_entry.flags.alpha))
98 _soft16_image_draw_scaled_transp_solid
99 (src, dst, dc, dst_offset, w, h, offset_x, offset_y);
100 else if (!dst->cache_entry.flags.alpha)
101 _soft16_image_draw_scaled_solid_solid
102 (src, dst, dc, dst_offset, w, h, offset_x, offset_y);
103 else
104 ERR("Unsupported draw of scaled images src->cache_entry.flags.alpha=%d, "
105 "dst->cache_entry.flags.alpha=%d, WITHOUT COLOR MUL",
106 src->cache_entry.flags.alpha, dst->cache_entry.flags.alpha);
107}
108
109static void
110_soft16_image_draw_scaled_solid_solid_mul_alpha(Soft16_Image *src,
111 Soft16_Image *dst,
112 RGBA_Draw_Context *dc __UNUSED__,
113 int dst_offset, int w, int h,
114 int *offset_x, int *offset_y,
115 DATA8 alpha)
116{
117 DATA16 *dst_itr;
118 int y, w_align;
119
120 w_align = w & ~7;
121
122 dst_itr = dst->pixels + dst_offset;
123 for (y = 0; y < h; y++, dst_itr += dst->stride)
124 {
125 DATA16 *d, *s;
126 int x;
127
128 s = src->pixels + offset_y[y];
129 pld(s, 0);
130 pld(offset_x, 0);
131
132 d = dst_itr;
133 x = 0;
134 while (x < w_align)
135 {
136 pld(s, 32);
137 pld(offset_x + x, 32);
138
139 UNROLL8({
140 _soft16_pt_blend_solid_solid_mul_alpha
141 (d, s[offset_x[x]], alpha);
142 x++;
143 d++;
144 });
145 }
146
147 for (; x < w; x++, d++)
148 _soft16_pt_blend_solid_solid_mul_alpha
149 (d, s[offset_x[x]], alpha);
150 }
151}
152
153static void
154_soft16_image_draw_scaled_transp_solid_mul_alpha(Soft16_Image *src,
155 Soft16_Image *dst,
156 RGBA_Draw_Context *dc __UNUSED__,
157 int dst_offset, int w, int h,
158 int *offset_x, int *offset_y,
159 DATA8 alpha)
160{
161 DATA16 *dst_itr;
162 int y, w_align;
163
164 w_align = w & ~7;
165
166 dst_itr = dst->pixels + dst_offset;
167 for (y = 0; y < h; y++, dst_itr += dst->stride)
168 {
169 DATA16 *d, *s;
170 DATA8 *a;
171 int x;
172
173 s = src->pixels + offset_y[y];
174 a = src->alpha + offset_y[y];
175 pld(s, 0);
176 pld(a, 0);
177 pld(offset_x, 0);
178
179 d = dst_itr;
180 x = 0;
181 while (x < w_align)
182 {
183 pld(s, 32);
184 pld(a, 8);
185 pld(offset_x + x, 32);
186
187 UNROLL8({
188 int off_x = offset_x[x];
189 _soft16_pt_blend_transp_solid_mul_alpha
190 (d, s[off_x], a[off_x], alpha);
191 x++;
192 d++;
193 });
194 }
195
196 for (; x < w; x++, d++)
197 _soft16_pt_blend_transp_solid_mul_alpha
198 (d, s[offset_x[x]], a[offset_x[x]], alpha);
199 }
200}
201
202static inline void
203_soft16_image_draw_scaled_mul_alpha(Soft16_Image *src, Soft16_Image *dst,
204 RGBA_Draw_Context *dc,
205 int dst_offset, int w, int h,
206 int *offset_x, int *offset_y, DATA8 a)
207{
208 if ((src->cache_entry.flags.alpha && src->alpha) &&
209 (!dst->cache_entry.flags.alpha))
210 _soft16_image_draw_scaled_transp_solid_mul_alpha
211 (src, dst, dc, dst_offset, w, h, offset_x, offset_y, a);
212 else if (!dst->cache_entry.flags.alpha)
213 _soft16_image_draw_scaled_solid_solid_mul_alpha
214 (src, dst, dc, dst_offset, w, h, offset_x, offset_y, a);
215 else
216 ERR("Unsupported draw of scaled images src->cache_entry.flags.alpha=%d, "
217 "dst->cache_entry.flags.alpha=%d, WITH ALPHA MUL %d",
218 src->cache_entry.flags.alpha, dst->cache_entry.flags.alpha, A_VAL(&dc->mul.col));
219}
220
221static void
222_soft16_image_draw_scaled_solid_solid_mul_color(Soft16_Image *src,
223 Soft16_Image *dst,
224 RGBA_Draw_Context *dc __UNUSED__,
225 int dst_offset, int w, int h,
226 int *offset_x, int *offset_y,
227 DATA8 r, DATA8 g, DATA8 b,
228 DATA8 alpha)
229{
230 DATA16 *dst_itr;
231 int y, w_align;
232
233 w_align = w & ~7;
234
235 dst_itr = dst->pixels + dst_offset;
236
237 if (alpha == 31)
238 for (y = 0; y < h; y++, dst_itr += dst->stride)
239 {
240 DATA16 *d, *s;
241 int x;
242
243 s = src->pixels + offset_y[y];
244 pld(s, 0);
245 pld(offset_x, 0);
246
247 d = dst_itr;
248 x = 0;
249 while (x < w_align)
250 {
251 pld(s, 32);
252 pld(offset_x + x, 32);
253
254 UNROLL8({
255 _soft16_pt_blend_solid_solid_mul_color_solid
256 (d, s[offset_x[x]], r, g, b);
257 x++;
258 d++;
259 });
260 }
261
262 for (; x < w; x++, d++)
263 _soft16_pt_blend_solid_solid_mul_color_solid
264 (d, s[offset_x[x]], r, g, b);
265 }
266 else
267 for (y = 0; y < h; y++, dst_itr += dst->stride)
268 {
269 DATA16 *d, *s;
270 int x;
271
272 s = src->pixels + offset_y[y];
273 pld(s, 0);
274 pld(offset_x, 0);
275
276 d = dst_itr;
277 x = 0;
278 while (x < w_align)
279 {
280 pld(s, 32);
281 pld(offset_x + x, 32);
282
283 UNROLL8({
284 _soft16_pt_blend_solid_solid_mul_color_transp
285 (d, s[offset_x[x]], alpha, r, g, b);
286 x++;
287 d++;
288 });
289 }
290
291 for (; x < w; x++, d++)
292 _soft16_pt_blend_solid_solid_mul_color_transp
293 (d, s[offset_x[x]], alpha, r, g, b);
294 }
295}
296
297static void
298_soft16_image_draw_scaled_transp_solid_mul_color(Soft16_Image *src,
299 Soft16_Image *dst,
300 RGBA_Draw_Context *dc __UNUSED__,
301 int dst_offset, int w, int h,
302 int *offset_x, int *offset_y,
303 DATA8 r, DATA8 g, DATA8 b,
304 DATA8 alpha)
305{
306 DATA16 *dst_itr;
307 int y, w_align;
308
309 w_align = w & ~7;
310
311 dst_itr = dst->pixels + dst_offset;
312
313 if (alpha == 31)
314 for (y = 0; y < h; y++, dst_itr += dst->stride)
315 {
316 DATA16 *d, *s;
317 DATA8 *a;
318 int x;
319
320 s = src->pixels + offset_y[y];
321 a = src->alpha + offset_y[y];
322 pld(s, 0);
323 pld(a, 0);
324 pld(offset_x, 0);
325
326 d = dst_itr;
327 x = 0;
328 while (x < w_align)
329 {
330 pld(s, 32);
331 pld(a, 8);
332 pld(offset_x + x, 32);
333
334 UNROLL8({
335 int off_x = offset_x[x];
336 _soft16_pt_blend_transp_solid_mul_color_solid
337 (d, s[off_x], a[off_x], r, g, b);
338 x++;
339 d++;
340 });
341 }
342
343 for (; x < w; x++, d++)
344 _soft16_pt_blend_transp_solid_mul_color_solid
345 (d, s[offset_x[x]], a[offset_x[x]], r, g, b);
346 }
347 else
348 for (y = 0; y < h; y++, dst_itr += dst->stride)
349 {
350 DATA16 *d, *s;
351 DATA8 *a;
352 int x;
353
354 s = src->pixels + offset_y[y];
355 a = src->alpha + offset_y[y];
356 pld(s, 0);
357 pld(a, 0);
358 pld(offset_x, 0);
359
360 d = dst_itr;
361 x = 0;
362 while (x < w_align)
363 {
364 pld(s, 32);
365 pld(a, 8);
366 pld(offset_x + x, 32);
367
368 UNROLL8({
369 int off_x = offset_x[x];
370 _soft16_pt_blend_transp_solid_mul_color_transp
371 (d, s[off_x], a[off_x], alpha, r, g, b);
372 x++;
373 d++;
374 });
375 }
376
377 for (; x < w; x++, d++)
378 _soft16_pt_blend_transp_solid_mul_color_transp
379 (d, s[offset_x[x]], a[offset_x[x]], alpha, r, g, b);
380 }
381}
382
383static inline void
384_soft16_image_draw_scaled_mul_color(Soft16_Image *src, Soft16_Image *dst,
385 RGBA_Draw_Context *dc,
386 int dst_offset, int w, int h,
387 int *offset_x, int *offset_y,
388 DATA8 r, DATA8 g, DATA8 b, DATA8 a)
389{
390 if ((src->cache_entry.flags.alpha && src->alpha) &&
391 (!dst->cache_entry.flags.alpha))
392 _soft16_image_draw_scaled_transp_solid_mul_color
393 (src, dst, dc, dst_offset, w, h, offset_x, offset_y, r, g, b, a);
394 else if (!dst->cache_entry.flags.alpha)
395 _soft16_image_draw_scaled_solid_solid_mul_color
396 (src, dst, dc, dst_offset, w, h, offset_x, offset_y, r, g, b, a);
397 else
398 ERR("Unsupported draw of scaled images src->cache_entry.flags.alpha=%d, "
399 "dst->cache_entry.flags.alpha=%d, WITH COLOR MUL 0x%08x",
400 src->cache_entry.flags.alpha, dst->cache_entry.flags.alpha, dc->mul.col);
401}
402
403static inline void
404_soft16_image_draw_scaled_mul(Soft16_Image *src, Soft16_Image *dst,
405 RGBA_Draw_Context *dc,
406 int dst_offset, int w, int h,
407 int *offset_x, int *offset_y, DATA8 r, DATA8 g,
408 DATA8 b, DATA8 a)
409{
410 if ((a == r) && (a == (g >> 1)) && (a == b))
411 _soft16_image_draw_scaled_mul_alpha
412 (src, dst, dc, dst_offset, w, h, offset_x, offset_y, a);
413 else
414 _soft16_image_draw_scaled_mul_color
415 (src, dst, dc, dst_offset, w, h, offset_x, offset_y, r, g, b, a);
416}
417
418void
419evas_common_soft16_image_draw_scaled_sampled(Soft16_Image *src, Soft16_Image *dst,
420 RGBA_Draw_Context *dc,
421 const Eina_Rectangle sr,
422 const Eina_Rectangle dr,
423 const Eina_Rectangle cr)
424{
425 int x, y, dst_offset, *offset_x, *offset_y;
426 DATA16 mul_rgb565;
427 DATA8 r, g, b, a;
428
429 if (!dc->mul.use)
430 {
431 r = b = a = 31;
432 g = 63;
433 mul_rgb565 = 0xffff;
434 }
435 else
436 {
437 a = A_VAL(&dc->mul.col) >> 3;
438 if (a == 0)
439 return;
440
441 r = R_VAL(&dc->mul.col) >> 3;
442 g = G_VAL(&dc->mul.col) >> 2;
443 b = B_VAL(&dc->mul.col) >> 3;
444
445 if (r > a) r = a;
446 if (g > (a << 1)) g = (a << 1);
447 if (b > a) b = a;
448
449 mul_rgb565 = (r << 11) || (g << 5) | b;
450 }
451
452 /* pre-calculated scale tables */
453 offset_x = alloca(cr.w * sizeof(*offset_x));
454 for (x = 0; x < cr.w; x++)
455 offset_x[x] = (((x + cr.x - dr.x) * sr.w) / dr.w) + sr.x;
456
457 offset_y = alloca(cr.h * sizeof(*offset_y));
458 for (y = 0; y < cr.h; y++)
459 offset_y[y] = (((((y + cr.y - dr.y) * sr.h) / dr.h) + sr.y)
460 * src->stride);
461
462 dst_offset = cr.x + (cr.y * dst->stride);
463
464
465 if (mul_rgb565 == 0xffff)
466 _soft16_image_draw_scaled_no_mul
467 (src, dst, dc, dst_offset, cr.w, cr.h, offset_x, offset_y);
468 else
469 _soft16_image_draw_scaled_mul
470 (src, dst, dc, dst_offset, cr.w, cr.h, offset_x, offset_y, r, g, b, a);
471}
diff --git a/libraries/evas/src/lib/engines/common_16/evas_soft16_image_unscaled.c b/libraries/evas/src/lib/engines/common_16/evas_soft16_image_unscaled.c
new file mode 100644
index 0000000..f53fdf0
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common_16/evas_soft16_image_unscaled.c
@@ -0,0 +1,287 @@
1#include "evas_common_soft16.h"
2#include "evas_soft16_scanline_blend.c"
3
4static void
5_soft16_image_draw_unscaled_solid_solid(Soft16_Image *src, Soft16_Image *dst,
6 RGBA_Draw_Context *dc __UNUSED__,
7 int src_offset, int dst_offset,
8 int w, int h)
9{
10 DATA16 *src_itr, *dst_itr;
11 int y;
12
13 src_itr = src->pixels + src_offset;
14 dst_itr = dst->pixels + dst_offset;
15
16 for (y = 0; y < h; y++)
17 {
18 _soft16_scanline_blend_solid_solid(src_itr, dst_itr, w);
19 src_itr += src->stride;
20 dst_itr += dst->stride;
21 }
22}
23
24static void
25_soft16_image_draw_unscaled_transp_solid(Soft16_Image *src, Soft16_Image *dst,
26 RGBA_Draw_Context *dc __UNUSED__,
27 int src_offset, int dst_offset,
28 int w, int h)
29
30{
31 DATA16 *src_itr, *dst_itr;
32 DATA8 *alpha_itr;
33 int y;
34
35 src_itr = src->pixels + src_offset;
36 alpha_itr = src->alpha + src_offset;
37 dst_itr = dst->pixels + dst_offset;
38
39 for (y = 0; y < h; y++)
40 {
41 _soft16_scanline_blend_transp_solid(src_itr, alpha_itr, dst_itr, w);
42 src_itr += src->stride;
43 alpha_itr += src->stride;
44 dst_itr += dst->stride;
45 }
46}
47
48static inline void
49_soft16_image_draw_unscaled_no_mul(Soft16_Image *src, Soft16_Image *dst,
50 RGBA_Draw_Context *dc,
51 int src_offset, int dst_offset,
52 int width, int height)
53{
54 if (src->cache_entry.flags.alpha && (!dst->cache_entry.flags.alpha))
55 _soft16_image_draw_unscaled_transp_solid(src, dst, dc,
56 src_offset, dst_offset,
57 width, height);
58 else if ((!src->cache_entry.flags.alpha) && (!dst->cache_entry.flags.alpha))
59 _soft16_image_draw_unscaled_solid_solid(src, dst, dc,
60 src_offset, dst_offset,
61 width, height);
62 else
63 ERR("Unsupported draw of unscaled images src->cache_entry.flags.alpha=%d, "
64 "dst->cache_entry.flags.alpha=%d, WITHOUT COLOR MUL",
65 src->cache_entry.flags.alpha, dst->cache_entry.flags.alpha);
66}
67
68static void
69_soft16_image_draw_unscaled_solid_solid_mul_alpha(Soft16_Image *src,
70 Soft16_Image *dst,
71 RGBA_Draw_Context *dc __UNUSED__,
72 int src_offset,
73 int dst_offset,
74 int w, int h, DATA8 a)
75{
76 DATA16 *src_itr, *dst_itr;
77 int y;
78
79 src_itr = src->pixels + src_offset;
80 dst_itr = dst->pixels + dst_offset;
81
82 for (y = 0; y < h; y++)
83 {
84 _soft16_scanline_blend_solid_solid_mul_alpha(src_itr, dst_itr, w, a);
85 src_itr += src->stride;
86 dst_itr += dst->stride;
87 }
88}
89
90static void
91_soft16_image_draw_unscaled_transp_solid_mul_alpha(Soft16_Image *src,
92 Soft16_Image *dst,
93 RGBA_Draw_Context *dc __UNUSED__,
94 int src_offset,
95 int dst_offset,
96 int w, int h, DATA8 a)
97
98{
99 DATA16 *src_itr, *dst_itr;
100 DATA8 *alpha_itr;
101 int y;
102
103 src_itr = src->pixels + src_offset;
104 alpha_itr = src->alpha + src_offset;
105 dst_itr = dst->pixels + dst_offset;
106
107 for (y = 0; y < h; y++)
108 {
109 _soft16_scanline_blend_transp_solid_mul_alpha(src_itr, alpha_itr,
110 dst_itr, w, a);
111 src_itr += src->stride;
112 alpha_itr += src->stride;
113 dst_itr += dst->stride;
114 }
115}
116
117static inline void
118_soft16_image_draw_unscaled_mul_alpha(Soft16_Image *src, Soft16_Image *dst,
119 RGBA_Draw_Context *dc,
120 int src_offset, int dst_offset,
121 int width, int height, DATA8 a)
122{
123 if (src->cache_entry.flags.alpha && (!dst->cache_entry.flags.alpha))
124 _soft16_image_draw_unscaled_transp_solid_mul_alpha
125 (src, dst, dc, src_offset, dst_offset, width, height, a);
126 else if ((!src->cache_entry.flags.alpha) && (!dst->cache_entry.flags.alpha))
127 _soft16_image_draw_unscaled_solid_solid_mul_alpha
128 (src, dst, dc, src_offset, dst_offset, width, height, a);
129 else
130 ERR("Unsupported draw of unscaled images src->cache_entry.flags.alpha=%d, "
131 "dst->cache_entry.flags.alpha=%d, WITH ALPHA MUL %d",
132 src->cache_entry.flags.alpha, dst->cache_entry.flags.alpha, A_VAL(&dc->mul.col));
133}
134
135static void
136_soft16_image_draw_unscaled_solid_solid_mul_color(Soft16_Image *src,
137 Soft16_Image *dst,
138 RGBA_Draw_Context *dc __UNUSED__,
139 int src_offset,
140 int dst_offset,
141 int w, int h, DATA8 r,
142 DATA8 g, DATA8 b, DATA8 a)
143{
144 DATA16 *src_itr, *dst_itr;
145 int y;
146
147 src_itr = src->pixels + src_offset;
148 dst_itr = dst->pixels + dst_offset;
149
150 if (a == 31)
151 for (y = 0; y < h; y++)
152 {
153 _soft16_scanline_blend_solid_solid_mul_color_solid
154 (src_itr, dst_itr, w, r, g, b);
155 src_itr += src->stride;
156 dst_itr += dst->stride;
157 }
158 else
159 for (y = 0; y < h; y++)
160 {
161 _soft16_scanline_blend_solid_solid_mul_color_transp
162 (src_itr, dst_itr, w, a, r, g, b);
163 src_itr += src->stride;
164 dst_itr += dst->stride;
165 }
166}
167
168static void
169_soft16_image_draw_unscaled_transp_solid_mul_color(Soft16_Image *src,
170 Soft16_Image *dst,
171 RGBA_Draw_Context *dc __UNUSED__,
172 int src_offset,
173 int dst_offset,
174 int w, int h, DATA8 r,
175 DATA8 g, DATA8 b, DATA8 a)
176
177{
178 DATA16 *src_itr, *dst_itr;
179 DATA8 *alpha_itr;
180 int y;
181
182 src_itr = src->pixels + src_offset;
183 alpha_itr = src->alpha + src_offset;
184 dst_itr = dst->pixels + dst_offset;
185
186 if (a == 31)
187 for (y = 0; y < h; y++)
188 {
189 _soft16_scanline_blend_transp_solid_mul_color_solid
190 (src_itr, alpha_itr, dst_itr, w, r, g, b);
191 src_itr += src->stride;
192 alpha_itr += src->stride;
193 dst_itr += dst->stride;
194 }
195 else
196 for (y = 0; y < h; y++)
197 {
198 _soft16_scanline_blend_transp_solid_mul_color_transp
199 (src_itr, alpha_itr, dst_itr, w, a, r, g, b);
200 src_itr += src->stride;
201 alpha_itr += src->stride;
202 dst_itr += dst->stride;
203 }
204}
205
206static inline void
207_soft16_image_draw_unscaled_mul_color(Soft16_Image *src, Soft16_Image *dst,
208 RGBA_Draw_Context *dc,
209 int src_offset, int dst_offset,
210 int width, int height,
211 DATA8 r, DATA8 g, DATA8 b, DATA8 a)
212{
213 if (src->cache_entry.flags.alpha && (!dst->cache_entry.flags.alpha))
214 _soft16_image_draw_unscaled_transp_solid_mul_color
215 (src, dst, dc, src_offset, dst_offset, width, height, r, g, b, a);
216 else if ((!src->cache_entry.flags.alpha) && (!dst->cache_entry.flags.alpha))
217 _soft16_image_draw_unscaled_solid_solid_mul_color
218 (src, dst, dc, src_offset, dst_offset, width, height, r, g, b, a);
219 else
220 ERR("Unsupported draw of unscaled images src->cache_entry.flags.alpha=%d, "
221 "dst->cache_entry.flags.alpha=%d, WITH COLOR MUL 0x%08x",
222 src->cache_entry.flags.alpha, dst->cache_entry.flags.alpha, dc->mul.col);
223}
224
225static inline void
226_soft16_image_draw_unscaled_mul(Soft16_Image *src, Soft16_Image *dst,
227 RGBA_Draw_Context *dc,
228 int src_offset, int dst_offset,
229 int width, int height, DATA8 r, DATA8 g,
230 DATA8 b, DATA8 a)
231{
232 if ((a == r) && (a == (g >> 1)) && (a == b))
233 _soft16_image_draw_unscaled_mul_alpha(src, dst, dc, src_offset,
234 dst_offset, width, height, a);
235 else
236 _soft16_image_draw_unscaled_mul_color(src, dst, dc, src_offset,
237 dst_offset, width, height,
238 r, g, b, a);
239}
240
241void
242evas_common_soft16_image_draw_unscaled(Soft16_Image *src, Soft16_Image *dst,
243 RGBA_Draw_Context *dc,
244 const Eina_Rectangle sr,
245 const Eina_Rectangle dr,
246 const Eina_Rectangle cr)
247{
248 int src_offset_rows, src_offset, dst_offset;
249 DATA16 mul_rgb565;
250 DATA8 r, g, b, a;
251
252 if (!dc->mul.use)
253 {
254 r = b = a = 31;
255 g = 63;
256 mul_rgb565 = 0xffff;
257 }
258 else
259 {
260 a = A_VAL(&dc->mul.col) >> 3;
261 if (a == 0)
262 return;
263
264 r = R_VAL(&dc->mul.col) >> 3;
265 g = G_VAL(&dc->mul.col) >> 2;
266 b = B_VAL(&dc->mul.col) >> 3;
267
268 if (r > a) r = a;
269 if (g > (a << 1)) g = (a << 1);
270 if (b > a) b = a;
271
272 mul_rgb565 = (r << 11) || (g << 5) | b;
273 }
274
275
276 src_offset_rows = (cr.y - dr.y) + sr.y;
277 src_offset = (src_offset_rows * src->stride) + (cr.x - dr.x) + sr.x;
278
279 dst_offset = cr.x + (cr.y * dst->stride);
280
281 if (mul_rgb565 == 0xffff)
282 _soft16_image_draw_unscaled_no_mul(src, dst, dc, src_offset, dst_offset,
283 cr.w, cr.h);
284 else
285 _soft16_image_draw_unscaled_mul(src, dst, dc, src_offset, dst_offset,
286 cr.w, cr.h, r, g, b, a);
287}
diff --git a/libraries/evas/src/lib/engines/common_16/evas_soft16_line.c b/libraries/evas/src/lib/engines/common_16/evas_soft16_line.c
new file mode 100644
index 0000000..92e14af
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common_16/evas_soft16_line.c
@@ -0,0 +1,444 @@
1#include "evas_common_soft16.h"
2#include "evas_soft16_scanline_fill.c"
3
4/*
5 * All functions except by evas_common_soft16_line_draw() expect x0 <= x1.
6 */
7
8static inline int
9_in_range(int value, int min, int max)
10{
11 return min <= value && value <= max;
12}
13
14static inline int
15_is_xy_inside_clip(int x, int y, const struct RGBA_Draw_Context_clip clip)
16{
17 if (!clip.use)
18 return 1;
19
20 if (!_in_range(x, clip.x, clip.x + clip.w - 1))
21 return 0;
22
23 if (!_in_range(y, clip.y, clip.y + clip.h - 1))
24 return 0;
25
26 return 1;
27}
28
29static inline int
30_is_x_inside_clip(int x, const struct RGBA_Draw_Context_clip clip)
31{
32 if (!clip.use)
33 return 1;
34
35 return _in_range(x, clip.x, clip.x + clip.w - 1);
36}
37
38static inline int
39_is_y_inside_clip(int y, const struct RGBA_Draw_Context_clip clip)
40{
41 if (!clip.use)
42 return 1;
43
44 return _in_range(y, clip.y, clip.y + clip.h - 1);
45}
46
47static inline int
48_is_xy_inside_rect(int x, int y, int w, int h)
49{
50 return _in_range(x, 0, w - 1) && _in_range(y, 0, h - 1);
51}
52
53static inline int
54_is_empty_clip(const struct RGBA_Draw_Context_clip clip)
55{
56 return clip.w < 1 || clip.h < 1;
57}
58
59static void
60_soft16_line_point(Soft16_Image *dst, RGBA_Draw_Context *dc, int x, int y)
61{
62 DATA16 rgb565, *dst_itr;
63 DATA8 alpha;
64
65 if (!_is_xy_inside_rect(x, y, dst->cache_entry.w, dst->cache_entry.h))
66 return;
67
68 if (!_is_xy_inside_clip(x, y, dc->clip))
69 return;
70
71 dst_itr = dst->pixels + (dst->stride * y) + x;
72 alpha = A_VAL(&dc->col.col) >> 3;
73 rgb565 = RGB_565_FROM_COMPONENTS(R_VAL(&dc->col.col),
74 G_VAL(&dc->col.col),
75 B_VAL(&dc->col.col));
76
77 if (alpha == 31)
78 _soft16_pt_fill_solid_solid(dst_itr, rgb565);
79 else if (alpha > 0)
80 {
81 DATA32 rgb565_unpack;
82
83 rgb565_unpack = RGB_565_UNPACK(rgb565);
84 alpha++;
85 _soft16_pt_fill_transp_solid(dst_itr, rgb565_unpack, alpha);
86 }
87}
88
89static void
90_soft16_line_horiz(Soft16_Image *dst, RGBA_Draw_Context *dc, int x0, int x1, int y)
91{
92 DATA16 rgb565, *dst_itr;
93 DATA8 alpha;
94 int w;
95
96 if (!_is_y_inside_clip(y, dc->clip))
97 return;
98
99 if (x0 < dc->clip.x)
100 x0 = dc->clip.x;
101
102 if (x1 >= dc->clip.x + dc->clip.w)
103 x1 = dc->clip.x + dc->clip.w - 1;
104
105 w = x1 - x0;
106 if (w < 1)
107 return;
108
109 dst_itr = dst->pixels + (dst->stride * y) + x0;
110 alpha = A_VAL(&dc->col.col) >> 3;
111 rgb565 = RGB_565_FROM_COMPONENTS(R_VAL(&dc->col.col),
112 G_VAL(&dc->col.col),
113 B_VAL(&dc->col.col));
114
115 if (alpha == 31)
116 _soft16_scanline_fill_solid_solid(dst_itr, w, rgb565);
117 else if (alpha > 0)
118 {
119 DATA32 rgb565_unpack;
120
121 rgb565_unpack = RGB_565_UNPACK(rgb565);
122 alpha++;
123 _soft16_scanline_fill_transp_solid(dst_itr, w, rgb565_unpack, alpha);
124 }
125}
126
127static void
128_soft16_line_vert(Soft16_Image *dst, RGBA_Draw_Context *dc, int x, int y0, int y1)
129{
130 DATA16 rgb565, *dst_itr;
131 DATA8 alpha;
132 int h;
133
134 if (!_is_x_inside_clip(x, dc->clip))
135 return;
136
137 if (y1 < y0)
138 {
139 int t;
140 t = y0;
141 y0 = y1;
142 y1 = t;
143 }
144
145 if (y0 < dc->clip.y)
146 y0 = dc->clip.y;
147
148 if (y1 >= dc->clip.y + dc->clip.h)
149 y1 = dc->clip.y + dc->clip.h - 1;
150
151 h = y1 - y0;
152 if (h < 1)
153 return;
154
155 dst_itr = dst->pixels + (dst->stride * y0) + x;
156 alpha = A_VAL(&dc->col.col) >> 3;
157 rgb565 = RGB_565_FROM_COMPONENTS(R_VAL(&dc->col.col),
158 G_VAL(&dc->col.col),
159 B_VAL(&dc->col.col));
160
161 if (alpha == 31)
162 {
163 for (; h > 0; h--, dst_itr += dst->stride)
164 _soft16_pt_fill_solid_solid(dst_itr, rgb565);
165 }
166 else if (alpha > 0)
167 {
168 DATA32 rgb565_unpack;
169
170 rgb565_unpack = RGB_565_UNPACK(rgb565);
171 alpha++;
172
173 for (; h > 0; h--, dst_itr += dst->stride)
174 _soft16_pt_fill_transp_solid(dst_itr, rgb565_unpack, alpha);
175 }
176}
177
178static inline void
179_soft16_line_45deg_adjust_boundaries(const struct RGBA_Draw_Context_clip clip, int *p_x0, int *p_y0, int *p_x1, int *p_y1)
180{
181 int diff, dy, x0, y0, x1, y1;
182
183 x0 = *p_x0;
184 y0 = *p_y0;
185 x1 = *p_x1;
186 y1 = *p_y1;
187
188 dy = y1 - y0;
189
190 diff = clip.x - x0;
191 if (diff > 0)
192 {
193 x0 = clip.x;
194 y0 += (dy > 0) ? diff : -diff;
195 }
196
197 diff = x1 - (clip.x + clip.w);
198 if (diff > 0)
199 {
200 x1 = clip.x + clip.w;
201 y1 += (dy > 0) ? -diff : diff;
202 }
203
204 if (dy > 0)
205 {
206 diff = clip.y - y0;
207 if (diff > 0)
208 {
209 y0 = clip.y;
210 x0 += diff;
211 }
212
213 diff = y1 - (clip.y + clip.h);
214 if (diff > 0)
215 {
216 y1 = clip.y + clip.h;
217 x1 -= diff;
218 }
219 }
220 else
221 {
222 diff = clip.y - y1;
223 if (diff > 0)
224 {
225 y1 = clip.y;
226 x1 -= diff;
227 }
228
229 diff = y0 - (clip.y + clip.h - 1);
230 if (diff > 0)
231 {
232 y0 = clip.y + clip.h - 1;
233 x0 += diff;
234 }
235 }
236
237 *p_x0 = x0;
238 *p_y0 = y0;
239 *p_x1 = x1;
240 *p_y1 = y1;
241}
242
243static void
244_soft16_line_45deg(Soft16_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, int x1, int y1)
245{
246 int dy, step_dst_itr, len;
247 DATA8 alpha;
248 DATA16 *dst_itr, rgb565;
249
250 alpha = A_VAL(&dc->col.col) >> 3;
251 if (alpha < 1)
252 return;
253
254 rgb565 = RGB_565_FROM_COMPONENTS(R_VAL(&dc->col.col),
255 G_VAL(&dc->col.col),
256 B_VAL(&dc->col.col));
257
258 dy = y1 - y0;
259 step_dst_itr = 1 + ((dy > 0) ? dst->stride : -dst->stride);
260
261 _soft16_line_45deg_adjust_boundaries(dc->clip, &x0, &y0, &x1, &y1);
262
263 len = (dy > 0) ? (y1 - y0) : (y0 - y1);
264 if (len < 1)
265 return;
266
267 dst_itr = dst->pixels + dst->stride * y0 + x0;
268 if (alpha == 31)
269 {
270 for (; len > 0; len--, dst_itr += step_dst_itr)
271 _soft16_pt_fill_solid_solid(dst_itr, rgb565);
272 }
273 else
274 {
275 DATA32 rgb565_unpack;
276
277 rgb565_unpack = RGB_565_UNPACK(rgb565);
278 alpha++;
279 for (; len > 0; len--, dst_itr += step_dst_itr)
280 _soft16_pt_fill_transp_solid(dst_itr, rgb565_unpack, alpha);
281 }
282}
283
284EFL_ALWAYS_INLINE void
285_soft16_line_aliased_pt(DATA16 *dst_itr, DATA16 rgb565, DATA32 rgb565_unpack, DATA8 alpha)
286{
287 if (alpha == 32)
288 _soft16_pt_fill_solid_solid(dst_itr, rgb565);
289 else
290 _soft16_pt_fill_transp_solid(dst_itr, rgb565_unpack, alpha);
291}
292
293static void
294_soft16_line_aliased(Soft16_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, int x1, int y1)
295{
296 int dx, dy, step_y, step_dst_itr;
297 DATA32 rgb565_unpack;
298 DATA16 rgb565;
299 DATA8 alpha;
300
301 alpha = A_VAL(&dc->col.col) >> 3;
302 if (alpha == 0)
303 return;
304 alpha++;
305
306 rgb565 = RGB_565_FROM_COMPONENTS(R_VAL(&dc->col.col),
307 G_VAL(&dc->col.col),
308 B_VAL(&dc->col.col));
309 rgb565_unpack = RGB_565_UNPACK(rgb565);
310
311 dx = x1 - x0;
312 dy = y1 - y0;
313
314 if (dy >= 0)
315 {
316 step_y = 1;
317 step_dst_itr = dst->stride;
318 }
319 else
320 {
321 dy = -dy;
322 step_y = -1;
323 step_dst_itr = -dst->stride;
324 }
325
326 if (dx > dy)
327 {
328 DATA16 *dst_itr;
329 int e, x, y;
330
331 e = - (dx / 2);
332 y = y0;
333 dst_itr = dst->pixels + dst->stride * y0 + x0;
334 for (x=x0; x <= x1; x++, dst_itr++)
335 {
336 if (_is_xy_inside_clip(x, y, dc->clip))
337 _soft16_line_aliased_pt(dst_itr, rgb565, rgb565_unpack, alpha);
338
339 e += dy;
340 if (e >= 0)
341 {
342 dst_itr += step_dst_itr;
343 y += step_y;
344 e -= dx;
345 }
346 }
347 }
348 else
349 {
350 DATA16 *dst_itr;
351 int e, x, y;
352
353 e = - (dy / 2);
354 x = x0;
355 dst_itr = dst->pixels + dst->stride * y0 + x0;
356 for (y=y0; y != y1; y += step_y, dst_itr += step_dst_itr)
357 {
358 if (_is_xy_inside_clip(x, y, dc->clip))
359 _soft16_line_aliased_pt(dst_itr, rgb565, rgb565_unpack, alpha);
360
361 e += dx;
362 if (e >= 0)
363 {
364 dst_itr++;
365 x++;
366 e -= dy;
367 }
368 }
369 }
370}
371
372void
373evas_common_soft16_line_draw(Soft16_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, int x1, int y1)
374{
375 struct RGBA_Draw_Context_clip c_bkp, c_tmp;
376 int dx, dy;
377 int x, y, w, h;
378
379 c_tmp.use = 1;
380 c_tmp.x = 0;
381 c_tmp.y = 0;
382 c_tmp.w = dst->cache_entry.w;
383 c_tmp.h = dst->cache_entry.h;
384
385 /* save out clip info */
386 c_bkp = dc->clip;
387 if (c_bkp.use)
388 {
389 RECTS_CLIP_TO_RECT(c_tmp.x, c_tmp.y, c_tmp.w, c_tmp.h,
390 c_bkp.x, c_bkp.y, c_bkp.w, c_bkp.h);
391 if (_is_empty_clip(c_tmp))
392 return;
393 }
394
395 x = MIN(x0, x1);
396 y = MIN(y0, y1);
397 w = MAX(x0, x1) - x + 1;
398 h = MAX(y0, y1) - y + 1;
399
400 RECTS_CLIP_TO_RECT(c_tmp.x, c_tmp.y, c_tmp.w, c_tmp.h, x, y, w, h);
401 if (_is_empty_clip(c_tmp))
402 return;
403
404 /* Check if the line doesn't cross the clip area */
405 if (x0 < c_tmp.x && x1 < c_tmp.x)
406 return;
407 if (x0 >= c_tmp.x + c_tmp.w && x1 >= c_tmp.x + c_tmp.w)
408 return;
409 if (y0 < c_tmp.y && y1 < c_tmp.y)
410 return;
411 if (y0 >= c_tmp.y + c_tmp.h && y1 >= c_tmp.y + c_tmp.h)
412 return;
413
414 dc->clip = c_tmp;
415 dx = x1 - x0;
416 dy = y1 - y0;
417
418 if (dx < 0)
419 {
420 int t;
421
422 t = x0;
423 x0 = x1;
424 x1 = t;
425
426 t = y0;
427 y0 = y1;
428 y1 = t;
429 }
430
431 if (dx == 0 && dy == 0)
432 _soft16_line_point(dst, dc, x0, y0);
433 else if (dx == 0)
434 _soft16_line_vert(dst, dc, x0, y0, y1);
435 else if (dy == 0)
436 _soft16_line_horiz(dst, dc, x0, x1, y0);
437 else if (dy == dx || dy == -dx)
438 _soft16_line_45deg(dst, dc, x0, y0, x1, y1);
439 else
440 _soft16_line_aliased(dst, dc, x0, y0, x1, y1);
441
442 /* restore clip info */
443 dc->clip = c_bkp;
444}
diff --git a/libraries/evas/src/lib/engines/common_16/evas_soft16_main.c b/libraries/evas/src/lib/engines/common_16/evas_soft16_main.c
new file mode 100644
index 0000000..6028744
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common_16/evas_soft16_main.c
@@ -0,0 +1,594 @@
1#include "evas_common_soft16.h"
2
3static Evas_Cache_Image *eci = NULL;
4static int reference = 0;
5
6static Image_Entry *_evas_common_soft16_image_new(void);
7static void _evas_common_soft16_image_delete(Image_Entry *ie);
8
9static int _evas_common_soft16_image_surface_alloc(Image_Entry *ie, unsigned int w, unsigned int h);
10static void _evas_common_soft16_image_surface_delete(Image_Entry *ie);
11static DATA32 *_evas_common_soft16_image_surface_pixels(Image_Entry *ie);
12
13static int _evas_common_load_soft16_image_from_file(Image_Entry *ie);
14static void _evas_common_soft16_image_unload(Image_Entry *ie);
15
16static void _evas_common_soft16_image_dirty_region(Image_Entry *im, unsigned int x, unsigned int y, unsigned int w, unsigned int h);
17static int _evas_common_soft16_image_dirty(Image_Entry *ie_dst, const Image_Entry *ie_src);
18
19static int _evas_common_soft16_image_ram_usage(Image_Entry *ie);
20
21static int _evas_common_soft16_image_size_set(Image_Entry *ie_dst, const Image_Entry *ie_im, unsigned int w, unsigned int h);
22static int _evas_common_soft16_image_from_copied_data(Image_Entry* ie_dst, unsigned int w, unsigned int h, DATA32 *image_data, int alpha, int cspace);
23static int _evas_common_soft16_image_from_data(Image_Entry* ie_dst, unsigned int w, unsigned int h, DATA32 *image_data, int alpha, int cspace);
24static int _evas_common_soft16_image_colorspace_set(Image_Entry* ie_dst, int cspace);
25
26static int _evas_common_load_soft16_image_data_from_file(Image_Entry *ie);
27
28/* static void */
29/* _evas_common_soft16_image_debug(const char* context, Image_Entry *eim) */
30/* { */
31/* DBG("[16] %p = [%s] {%s,%s} %i [%i|%i]", eim, context, eim->file, eim->key, eim->references, eim->w, eim->h); */
32/* } */
33
34static const Evas_Cache_Image_Func _evas_common_soft16_image_func =
35{
36 _evas_common_soft16_image_new,
37 _evas_common_soft16_image_delete,
38 _evas_common_soft16_image_surface_alloc,
39 _evas_common_soft16_image_surface_delete,
40 _evas_common_soft16_image_surface_pixels,
41 _evas_common_load_soft16_image_from_file,
42 _evas_common_soft16_image_unload,
43 _evas_common_soft16_image_dirty_region,
44 _evas_common_soft16_image_dirty,
45 _evas_common_soft16_image_size_set,
46 _evas_common_soft16_image_from_copied_data,
47 _evas_common_soft16_image_from_data,
48 _evas_common_soft16_image_colorspace_set,
49 _evas_common_load_soft16_image_data_from_file,
50 _evas_common_soft16_image_ram_usage,
51/* _evas_common_soft16_image_debug */
52 NULL
53};
54
55EAPI void
56evas_common_soft16_image_init(void)
57{
58 if (!eci)
59 eci = evas_cache_image_init(&_evas_common_soft16_image_func);
60 reference++;
61}
62
63EAPI void
64evas_common_soft16_image_shutdown(void)
65{
66 if (--reference == 0)
67 {
68// DISABLE for now - something wrong with cache shutdown freeing things
69// still in use - rage_thumb segv's now.
70//
71// actually - i think i see it. cache ref goes to 0 (and thus gets freed)
72// because in eng_setup() when a buffer changes size it is FIRST freed
73// THEN allocated again - thus brignhjing ref to 0 then back to 1 immediately
74// where it should stay at 1. - see evas_engine.c in the buffer enigne for
75// example. eng_output_free() is called BEFORE _output_setup(). although this
76// is only a SIGNE of the problem. we can patch this up with either freeing
77// after the setup (so we just pt a ref of 2 then back to 1), or just
78// evas_common_image_init() at the start and evas_common_image_shutdown()
79// after it all. really ref 0 should only be reached when no more canvases
80// with no more objects exist anywhere.
81
82// ENABLE IT AGAIN, hope it is fixed. Gustavo @ January 22nd, 2009.
83 evas_cache_image_shutdown(eci);
84 eci = NULL;
85 }
86}
87
88EAPI Evas_Cache_Image *
89evas_common_soft16_image_cache_get(void)
90{
91 return eci;
92}
93
94static Image_Entry *
95_evas_common_soft16_image_new(void)
96{
97 Soft16_Image *im;
98
99 im = calloc(1, sizeof(Soft16_Image));
100 if (!im) return NULL;
101
102 im->stride = -1;
103
104 return (Image_Entry *) im;
105}
106
107static void
108_evas_common_soft16_image_delete(Image_Entry *ie)
109{
110 memset(ie, 0xFF, sizeof (Soft16_Image));
111 free(ie);
112}
113
114static int
115_evas_common_soft16_image_surface_alloc(Image_Entry *ie, unsigned int w, unsigned int h)
116{
117 Soft16_Image *im = (Soft16_Image *) ie;
118
119 if (im->stride < 0) im->stride = _calc_stride(w);
120
121 im->pixels = realloc(im->pixels, IMG_BYTE_SIZE(im->stride, h, ie->flags.alpha));
122 if (!im->pixels) return -1;
123
124 if (ie->flags.alpha)
125 {
126 im->alpha = (DATA8 *)(im->pixels + (im->stride * h));
127 im->flags.free_alpha = 0;
128 }
129 im->flags.free_pixels = 1;
130
131 return 0;
132}
133
134static void
135_evas_common_soft16_image_surface_delete(Image_Entry *ie)
136{
137 Soft16_Image *im = (Soft16_Image *) ie;
138
139 if (im->flags.free_pixels)
140 free(im->pixels);
141 im->pixels = NULL;
142 im->flags.free_pixels = 0;
143
144 if (im->flags.free_alpha)
145 free(im->alpha);
146 im->alpha = NULL;
147 im->flags.free_alpha = 0;
148}
149
150static DATA32 *
151_evas_common_soft16_image_surface_pixels(Image_Entry *ie __UNUSED__)
152{
153 abort();
154
155 return NULL;
156}
157
158static int
159_evas_common_load_soft16_image_from_file(Image_Entry *ie)
160{
161 Soft16_Image *sim = (Soft16_Image *) ie;
162 RGBA_Image *im;
163 int error = 0;
164
165 im = (RGBA_Image *) evas_cache_image_request(evas_common_image_cache_get(), sim->cache_entry.file, sim->cache_entry.key, &sim->cache_entry.load_opts, &error);
166 sim->source = im;
167 if (!sim->source) return -1;
168
169 sim->cache_entry.w = sim->source->cache_entry.w;
170 sim->cache_entry.h = sim->source->cache_entry.h;
171 ie->flags.alpha = im->cache_entry.flags.alpha;
172 sim->cache_entry.info = im->cache_entry.info;
173 if (sim->stride < 0) sim->stride = _calc_stride(sim->cache_entry.w);
174
175 return 0;
176}
177
178static void
179_evas_common_soft16_image_unload(Image_Entry *ie __UNUSED__)
180{
181}
182
183static void
184_evas_common_soft16_image_dirty_region(Image_Entry *im __UNUSED__, unsigned int x __UNUSED__, unsigned int y __UNUSED__, unsigned int w __UNUSED__, unsigned int h __UNUSED__)
185{
186}
187
188static int
189_evas_common_soft16_image_dirty(Image_Entry *ie_dst, const Image_Entry *ie_src)
190{
191 Soft16_Image *dst = (Soft16_Image *) ie_dst;
192 Soft16_Image *src = (Soft16_Image *) ie_src;
193
194 evas_cache_image_load_data(&src->cache_entry);
195 evas_cache_image_surface_alloc(&dst->cache_entry,
196 src->cache_entry.w, src->cache_entry.h);
197
198/* evas_common_blit_rectangle(src, dst, 0, 0, src->cache_entry.w, src->cache_entry.h, 0, 0); */
199
200 return 0;
201}
202
203static int
204_evas_common_soft16_image_ram_usage(Image_Entry *ie)
205{
206 Soft16_Image *im = (Soft16_Image *) ie;
207
208 if (im->pixels && im->flags.free_pixels)
209 return IMG_BYTE_SIZE(im->stride, im->cache_entry.h, ie->flags.alpha);
210 return 0;
211}
212
213static int
214_evas_common_soft16_image_size_set(Image_Entry *ie_dst, const Image_Entry *ie_im, unsigned int w __UNUSED__, unsigned int h __UNUSED__)
215{
216 Soft16_Image *dst = (Soft16_Image *) ie_dst;
217 Soft16_Image *im = (Soft16_Image *) ie_im;
218
219 dst->flags = im->flags;
220
221 return 0;
222}
223
224static int
225_evas_common_soft16_image_from_data(Image_Entry* ie_dst, unsigned int w, unsigned int h, DATA32 *image_data, int alpha, int cspace __UNUSED__)
226{
227 Soft16_Image *im = (Soft16_Image *) ie_dst;
228
229 /* FIXME: handle colorspace */
230 ie_dst->w = w;
231 ie_dst->h = h;
232 ie_dst->flags.alpha = alpha;
233
234 im->flags.free_pixels = 0;
235 im->flags.free_alpha = 0;
236 if (im->stride < 0)
237 im->stride = _calc_stride(w);
238
239 /* FIXME: That's bad, the application must be aware of the engine internal. */
240 im->pixels = (DATA16 *) image_data;
241 if (ie_dst->flags.alpha)
242 im->alpha = (DATA8 *)(im->pixels + (im->stride * h));
243
244 return 0;
245}
246
247static int
248_evas_common_soft16_image_from_copied_data(Image_Entry* ie_dst, unsigned int w __UNUSED__, unsigned int h, DATA32 *image_data, int alpha __UNUSED__, int cspace __UNUSED__)
249{
250 Soft16_Image *im = (Soft16_Image *) ie_dst;
251
252 /* FIXME: handle colorspace */
253 if (image_data)
254 memcpy(im->pixels, image_data, IMG_BYTE_SIZE(im->stride, h, ie_dst->flags.alpha));
255 else
256 memset(im->pixels, 0, IMG_BYTE_SIZE(im->stride, h, ie_dst->flags.alpha));
257
258 return 0;
259}
260
261static int
262_evas_common_soft16_image_colorspace_set(Image_Entry* ie_dst __UNUSED__, int cspace __UNUSED__)
263{
264 /* FIXME: handle colorspace */
265 return 0;
266}
267
268static int
269_evas_common_load_soft16_image_data_from_file(Image_Entry *ie)
270{
271 Soft16_Image *im = (Soft16_Image *) ie;
272
273 if (im->pixels) return 0;
274 if (!im->source) return -1;
275
276 evas_cache_image_load_data(&im->source->cache_entry);
277 if (im->source->image.data)
278 {
279 DATA32 *sp;
280
281 evas_cache_image_surface_alloc(&im->cache_entry,
282 im->source->cache_entry.w,
283 im->source->cache_entry.h);
284
285 sp = im->source->image.data;
286 if (im->alpha)
287 evas_common_soft16_image_convert_from_rgba(im, sp);
288 else
289 evas_common_soft16_image_convert_from_rgb(im, sp);
290 }
291 evas_cache_image_drop(&im->source->cache_entry);
292 im->cache_entry.info.module = NULL;
293 im->cache_entry.info.loader = NULL;
294 im->source = NULL;
295
296 return 0;
297}
298
299/* Soft16_Image * */
300/* evas_common_soft16_image_new(int w, int h, int stride, int have_alpha, DATA16 *pixels, */
301/* int copy) */
302/* { */
303/* Soft16_Image *im; */
304
305/* if (stride < 0) stride = _calc_stride(w); */
306
307/* im = evas_common_soft16_image_alloc(w, h, stride, have_alpha, copy); */
308/* if (!im) return NULL; */
309
310/* if (pixels) */
311/* { */
312/* if (copy) */
313/* memcpy(im->pixels, pixels, IMG_BYTE_SIZE(stride, h, have_alpha)); */
314/* else */
315/* { */
316/* im->pixels = pixels; */
317/* if (have_alpha) im->alpha = (DATA8 *)(im->pixels + (stride * h)); */
318/* } */
319/* } */
320/* return im; */
321/* } */
322
323static inline void
324_get_clip(const RGBA_Draw_Context *dc, const Soft16_Image *im,
325 Eina_Rectangle *clip)
326{
327 if (dc->clip.use)
328 {
329 EINA_RECTANGLE_SET(clip, dc->clip.x, dc->clip.y, dc->clip.w, dc->clip.h);
330 if (clip->x < 0)
331 {
332 clip->w += clip->x;
333 clip->x = 0;
334 }
335 if (clip->y < 0)
336 {
337 clip->h += clip->y;
338 clip->y = 0;
339 }
340 if ((clip->x + clip->w) > (int)im->cache_entry.w) clip->w = im->cache_entry.w - clip->x;
341 if ((clip->y + clip->h) > (int)im->cache_entry.h) clip->h = im->cache_entry.h - clip->y;
342 }
343 else
344 {
345 EINA_RECTANGLE_SET(clip, 0, 0, im->cache_entry.w, im->cache_entry.h);
346 }
347}
348
349static inline int
350_is_empty_rectangle(const Eina_Rectangle *r)
351{
352 return (r->w < 1) || (r->h < 1);
353}
354
355static inline void
356_shrink(int *s_pos, int *s_size, int pos, int size)
357{
358 int d;
359
360 d = (*s_pos) - pos;
361 if (d < 0)
362 {
363 (*s_size) += d;
364 (*s_pos) = pos;
365 }
366
367 d = size + pos - (*s_pos);
368 if ((*s_size) > d)
369 (*s_size) = d;
370}
371
372static int
373_soft16_adjust_areas(Eina_Rectangle *src,
374 int src_max_x, int src_max_y,
375 Eina_Rectangle *dst,
376 int dst_max_x, int dst_max_y,
377 Eina_Rectangle *dst_clip)
378{
379 if (_is_empty_rectangle(src) ||
380 _is_empty_rectangle(dst) ||
381 _is_empty_rectangle(dst_clip))
382 return 0;
383
384 /* shrink clip */
385 _shrink(&dst_clip->x, &dst_clip->w, dst->x, dst->w);
386 _shrink(&dst_clip->y, &dst_clip->h, dst->y, dst->h);
387 if (_is_empty_rectangle(dst_clip)) return 0;
388
389 /* sanitise x */
390 if (src->x < 0)
391 {
392 dst->x -= (src->x * dst->w) / src->w;
393 dst->w += (src->x * dst->w) / src->w;
394 src->w += src->x;
395 src->x = 0;
396 }
397 if (src->x >= src_max_x) return 0;
398 if ((src->x + src->w) > src_max_x)
399 {
400 dst->w = (dst->w * (src_max_x - src->x)) / (src->w);
401 src->w = src_max_x - src->x;
402 }
403 if (dst->w <= 0) return 0;
404 if (src->w <= 0) return 0;
405 if (dst_clip->x < 0)
406 {
407 dst_clip->w += dst_clip->x;
408 dst_clip->x = 0;
409 }
410 if (dst_clip->w <= 0) return 0;
411 if (dst_clip->x >= dst_max_x) return 0;
412
413 _shrink(&dst_clip->x, &dst_clip->w, 0, dst_max_x);
414 if (dst_clip->w <= 0) return 0;
415
416 /* sanitise y */
417 if (src->y < 0)
418 {
419 dst->y -= (src->y * dst->h) / src->h;
420 dst->h += (src->y * dst->h) / src->h;
421 src->h += src->y;
422 src->y = 0;
423 }
424 if (src->y >= src_max_y) return 0;
425 if ((src->y + src->h) > src_max_y)
426 {
427 dst->h = (dst->h * (src_max_y - src->y)) / (src->h);
428 src->h = src_max_y - src->y;
429 }
430 if (dst->h <= 0) return 0;
431 if (src->h <= 0) return 0;
432 if (dst_clip->y < 0)
433 {
434 dst_clip->h += dst_clip->y;
435 dst_clip->y = 0;
436 }
437 if (dst_clip->h <= 0) return 0;
438 if (dst_clip->y >= dst_max_y) return 0;
439
440 _shrink(&dst_clip->y, &dst_clip->h, 0, dst_max_y);
441 if (dst_clip->h <= 0) return 0;
442
443 return 1;
444}
445
446static void
447_soft16_image_draw_sampled_int(Soft16_Image *src, Soft16_Image *dst,
448 RGBA_Draw_Context *dc,
449 Eina_Rectangle sr, Eina_Rectangle dr)
450{
451 Eina_Rectangle cr;
452
453 if (!(RECTS_INTERSECT(dr.x, dr.y, dr.w, dr.h, 0, 0, dst->cache_entry.w, dst->cache_entry.h)))
454 return;
455 if (!(RECTS_INTERSECT(sr.x, sr.y, sr.w, sr.h, 0, 0, src->cache_entry.w, src->cache_entry.h)))
456 return;
457
458 _get_clip(dc, dst, &cr);
459 if (!_soft16_adjust_areas(&sr, src->cache_entry.w, src->cache_entry.h, &dr, dst->cache_entry.w, dst->cache_entry.h, &cr))
460 return;
461
462 if ((dr.w == sr.w) && (dr.h == sr.h))
463 evas_common_soft16_image_draw_unscaled(src, dst, dc, sr, dr, cr);
464 else
465 evas_common_soft16_image_draw_scaled_sampled(src, dst, dc, sr, dr, cr);
466}
467
468EAPI void
469evas_common_soft16_image_draw(Soft16_Image *src, Soft16_Image *dst,
470 RGBA_Draw_Context *dc,
471 int src_region_x, int src_region_y,
472 int src_region_w, int src_region_h,
473 int dst_region_x, int dst_region_y,
474 int dst_region_w, int dst_region_h,
475 int smooth __UNUSED__)
476{
477 Eina_Rectangle sr, dr;
478 Cutout_Rects *rects;
479 Cutout_Rect *r;
480 struct RGBA_Draw_Context_clip clip_bkp;
481 int i;
482
483 /* handle cutouts here! */
484 EINA_RECTANGLE_SET(&dr, dst_region_x, dst_region_y, dst_region_w, dst_region_h);
485
486 if (_is_empty_rectangle(&dr)) return;
487 if (!(RECTS_INTERSECT(dr.x, dr.y, dr.w, dr.h, 0, 0, dst->cache_entry.w, dst->cache_entry.h)))
488 return;
489
490 EINA_RECTANGLE_SET(&sr, src_region_x, src_region_y, src_region_w, src_region_h);
491
492 if (_is_empty_rectangle(&sr)) return;
493 if (!(RECTS_INTERSECT(sr.x, sr.y, sr.w, sr.h, 0, 0, src->cache_entry.w, src->cache_entry.h)))
494 return;
495
496 /* no cutouts - cut right to the chase */
497 if (!dc->cutout.rects)
498 {
499 _soft16_image_draw_sampled_int(src, dst, dc, sr, dr);
500 return;
501 }
502
503 /* save out clip info */
504 clip_bkp = dc->clip;
505 evas_common_draw_context_clip_clip(dc, 0, 0, dst->cache_entry.w, dst->cache_entry.h);
506 evas_common_draw_context_clip_clip(dc, dst_region_x, dst_region_y, dst_region_w, dst_region_h);
507 /* our clip is 0 size.. abort */
508 if ((dc->clip.w <= 0) || (dc->clip.h <= 0))
509 {
510 dc->clip = clip_bkp;
511 return;
512 }
513 rects = evas_common_draw_context_apply_cutouts(dc);
514 for (i = 0; i < rects->active; i++)
515 {
516 r = rects->rects + i;
517 evas_common_draw_context_set_clip(dc, r->x, r->y, r->w, r->h);
518 _soft16_image_draw_sampled_int(src, dst, dc, sr, dr);
519 }
520 evas_common_draw_context_apply_clear_cutouts(rects);
521 dc->clip = clip_bkp;
522}
523
524EAPI Soft16_Image *
525evas_common_soft16_image_alpha_set(Soft16_Image *im, int have_alpha)
526{
527 Soft16_Image *new_im;
528
529 if (im->cache_entry.flags.alpha == have_alpha) return im;
530
531 new_im = (Soft16_Image *) evas_cache_image_alone(&im->cache_entry);
532
533 new_im->cache_entry.flags.alpha = have_alpha;
534
535 if (im->cache_entry.w > 0
536 && im->cache_entry.h)
537 new_im = (Soft16_Image *) evas_cache_image_size_set(&new_im->cache_entry, im->cache_entry.w, im->cache_entry.h);
538
539 return new_im;
540}
541
542/* Soft16_Image * */
543/* evas_common_soft16_image_size_set(Soft16_Image *old_im, int w, int h) */
544/* { */
545/* Soft16_Image *new_im; */
546/* DATA16 *dp, *sp; */
547/* int i, cw, ch, ew; */
548
549/* if ((old_im->cache_entry.w == w) && (old_im->cache_entry.h == h)) return old_im; */
550
551/* new_im = evas_common_soft16_image_new(w, h, -1, old_im->flags.have_alpha, NULL, 1); */
552
553/* if (old_im->cache_entry.w < new_im->cache_entry.w) */
554/* cw = old_im->cache_entry.w; */
555/* else */
556/* cw = new_im->cache_entry.w; */
557
558/* ew = new_im->cache_entry.w - cw; */
559
560/* if (old_im->cache_entry.h < new_im->cache_entry.h) */
561/* ch = old_im->cache_entry.h; */
562/* else */
563/* ch = new_im->cache_entry.h; */
564
565/* dp = new_im->pixels; */
566/* sp = old_im->pixels; */
567/* for (i = 0; i < ch; i++) */
568/* { */
569/* memcpy(dp, sp, cw * sizeof(DATA16)); */
570/* if (ew > 0) memset(dp, 0, ew * sizeof(DATA16)); */
571
572/* dp += new_im->stride; */
573/* sp += old_im->stride; */
574/* } */
575
576/* if (old_im->flags.have_alpha) */
577/* { */
578/* DATA8 *dp, *sp; */
579
580/* dp = new_im->alpha; */
581/* sp = old_im->alpha; */
582/* for (i = 0; i < ch; i++) */
583/* { */
584/* memcpy(dp, sp, cw * sizeof(DATA8)); */
585/* if (ew > 0) memset(dp, 0, ew * sizeof(DATA8)); */
586
587/* dp += new_im->stride; */
588/* sp += old_im->stride; */
589/* } */
590/* } */
591
592/* evas_cache_image_drop(&old_im->cache_entry); */
593/* return new_im; */
594/* } */
diff --git a/libraries/evas/src/lib/engines/common_16/evas_soft16_point_blend.c b/libraries/evas/src/lib/engines/common_16/evas_soft16_point_blend.c
new file mode 100644
index 0000000..8cd02d5
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common_16/evas_soft16_point_blend.c
@@ -0,0 +1,149 @@
1/** NOTE: This file is meant to be included by users **/
2
3/** NOTE2: r, g, b parameters are 16bits, so you can pass 0 to 256 inclusive.
4 ** this is due our division by 256 when multiplying the color.
5 **/
6
7/*****************************************************************************
8 * Scanline processing
9 *
10 * _soft16_pt_<description>_<src>_<dst>[_<modifier>]()
11 *
12 ****************************************************************************/
13
14/***********************************************************************
15 * Regular blend operations
16 */
17
18EFL_ALWAYS_INLINE void
19_soft16_pt_blend_transp_solid(DATA16 *p_dst, DATA16 src, DATA8 alpha)
20{
21 if (alpha == 31) *p_dst = src;
22 else if (alpha != 0)
23 {
24 DATA32 a, b;
25
26 a = RGB_565_UNPACK(src);
27 b = RGB_565_UNPACK(*p_dst);
28 b = RGB_565_UNPACKED_BLEND(a, b, alpha);
29 *p_dst = RGB_565_PACK(b);
30 }
31}
32
33EFL_ALWAYS_INLINE void
34_soft16_pt_blend_solid_solid(DATA16 *p_dst, DATA16 src)
35{
36 *p_dst = src;
37}
38
39/***********************************************************************
40 * Blend operations taking an extra alpha (fade in, out)
41 */
42
43EFL_ALWAYS_INLINE void
44_soft16_pt_blend_transp_solid_mul_alpha(DATA16 *p_dst, DATA16 src, DATA8 alpha, DATA8 rel_alpha)
45{
46 DATA32 a, b;
47
48 alpha = (alpha * rel_alpha) >> 5;
49 if (alpha == 0)
50 return;
51
52 alpha++;
53
54 a = ((RGB_565_UNPACK(src) * rel_alpha) >> 5) & RGB_565_UNPACKED_MASK;
55 b = RGB_565_UNPACK(*p_dst);
56 b = RGB_565_UNPACKED_BLEND(a, b, alpha);
57 *p_dst = RGB_565_PACK(b);
58}
59
60EFL_ALWAYS_INLINE void
61_soft16_pt_blend_solid_solid_mul_alpha(DATA16 *p_dst, DATA16 src, DATA8 rel_alpha)
62{
63 DATA32 a, b;
64 a = RGB_565_UNPACK(src);
65 b = RGB_565_UNPACK(*p_dst);
66 b = RGB_565_UNPACKED_BLEND_UNMUL(a, b, rel_alpha);
67 *p_dst = RGB_565_PACK(b);
68}
69
70/***********************************************************************
71 * Blend operations with extra alpha and multiply color
72 */
73
74EFL_ALWAYS_INLINE void
75_soft16_pt_blend_transp_solid_mul_color_transp(DATA16 *p_dst, DATA16 src, DATA8 alpha, DATA8 rel_alpha, DATA16 r, DATA16 g, DATA16 b)
76{
77 DATA32 rgb, d;
78 int r1, g1, b1;
79
80 alpha = (alpha * rel_alpha) >> 5;
81 if (alpha == 0)
82 return;
83
84 alpha++;
85
86 r1 = ((((src) >> 11) & 0x1f) * r) >> 5;
87 g1 = ((((src) >> 5) & 0x3f) * g) >> 6;
88 b1 = (((src) & 0x1f) * b) >> 5;
89 rgb = ((r1 << 11) | (g1 << 21) | b1) & RGB_565_UNPACKED_MASK;
90 d = RGB_565_UNPACK(*p_dst);
91 d = RGB_565_UNPACKED_BLEND(rgb, d, alpha);
92
93 *p_dst = RGB_565_PACK(d);
94}
95
96EFL_ALWAYS_INLINE void
97_soft16_pt_blend_solid_solid_mul_color_transp(DATA16 *p_dst, DATA16 src, DATA8 rel_alpha, DATA16 r, DATA16 g, DATA16 b)
98{
99 int r1, g1, b1;
100 DATA32 rgb, d;
101
102 r1 = ((((src) >> 11) & 0x1f) * r) >> 5;
103 g1 = ((((src) >> 5) & 0x3f) * g) >> 6;
104 b1 = (((src) & 0x1f) * b) >> 5;
105
106 rgb = ((r1 << 11) | (g1 << 21) | b1) & RGB_565_UNPACKED_MASK;
107 d = RGB_565_UNPACK(*p_dst);
108 d = RGB_565_UNPACKED_BLEND(rgb, d, rel_alpha);
109 *p_dst = RGB_565_PACK(d);
110}
111
112/***********************************************************************
113 * Blend operations with extra multiply color
114 */
115
116EFL_ALWAYS_INLINE void
117_soft16_pt_blend_transp_solid_mul_color_solid(DATA16 *p_dst, DATA16 src, DATA8 alpha, DATA8 r, DATA8 g, DATA8 b)
118{
119 int r1, g1, b1;
120
121 if (alpha == 0) return;
122
123 r1 = ((((src >> 11) & 0x1f) * r) >> 5) & 0x1f;
124 g1 = ((((src >> 5) & 0x3f) * g) >> 6) & 0x3f;
125 b1 = (((src & 0x1f) * b) >> 5) & 0x1f;
126
127 if (alpha == 31) *p_dst = (r1 << 11) | (g1 << 5) | b1;
128 else
129 {
130 DATA32 rgb_unpack, d;
131
132 rgb_unpack = ((r1 << 11) | (g1 << 21) | b1) & RGB_565_UNPACKED_MASK;
133 d = RGB_565_UNPACK(*p_dst);
134 d = RGB_565_UNPACKED_BLEND(rgb_unpack, d, alpha);
135 *p_dst = RGB_565_PACK(d);
136 }
137}
138
139EFL_ALWAYS_INLINE void
140_soft16_pt_blend_solid_solid_mul_color_solid(DATA16 *p_dst, DATA16 src, DATA16 r, DATA16 g, DATA16 b)
141{
142 int r1, g1, b1;
143
144 r1 = ((((src >> 11) & 0x1f) * r) >> 5) & 0x1f;
145 g1 = ((((src >> 5) & 0x3f) * g) >> 6) & 0x3f;
146 b1 = (((src & 0x1f) * b) >> 5) & 0x1f;
147
148 *p_dst = (r1 << 11) | (g1 << 5) | b1;
149}
diff --git a/libraries/evas/src/lib/engines/common_16/evas_soft16_polygon.c b/libraries/evas/src/lib/engines/common_16/evas_soft16_polygon.c
new file mode 100644
index 0000000..ca18bef
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common_16/evas_soft16_polygon.c
@@ -0,0 +1,231 @@
1#include <math.h>
2#include <evas_common_soft16.h>
3#include "evas_soft16_scanline_fill.c"
4
5typedef struct _RGBA_Edge RGBA_Edge;
6typedef struct _RGBA_Vertex RGBA_Vertex;
7
8struct _RGBA_Edge
9{
10 float x, dx;
11 int i;
12};
13
14struct _RGBA_Vertex
15{
16 float x, y;
17 int i;
18};
19
20#define POLY_EDGE_DEL(_i) \
21{ \
22 int _j; \
23 \
24 for (_j = 0; (_j < num_active_edges) && (edges[_j].i != _i); _j++); \
25 if (_j < num_active_edges) \
26 { \
27 num_active_edges--; \
28 memmove(&(edges[_j]), &(edges[_j + 1]), \
29 (num_active_edges - _j) * sizeof(RGBA_Edge)); \
30 } \
31}
32
33#define POLY_EDGE_ADD(_i, _y) \
34{ \
35 int _j; \
36 float _dx; \
37 RGBA_Vertex *_p, *_q; \
38 if (_i < (n - 1)) _j = _i + 1; \
39 else _j = 0; \
40 if (point[_i].y < point[_j].y) \
41 { \
42 _p = &(point[_i]); \
43 _q = &(point[_j]); \
44 } \
45 else \
46 { \
47 _p = &(point[_j]); \
48 _q = &(point[_i]); \
49 } \
50 edges[num_active_edges].dx = _dx = (_q->x - _p->x) / (_q->y - _p->y); \
51 edges[num_active_edges].x = (_dx * ((float)_y + 0.5 - _p->y)) + _p->x; \
52 edges[num_active_edges].i = _i; \
53 num_active_edges++; \
54}
55
56static int
57polygon_point_sorter(const void *a, const void *b)
58{
59 RGBA_Vertex *p, *q;
60
61 p = (RGBA_Vertex *)a;
62 q = (RGBA_Vertex *)b;
63 if (p->y <= q->y) return -1;
64 return 1;
65}
66
67static int
68polygon_edge_sorter(const void *a, const void *b)
69{
70 RGBA_Edge *p, *q;
71
72 p = (RGBA_Edge *)a;
73 q = (RGBA_Edge *)b;
74 if (p->x <= q->x) return -1;
75 return 1;
76}
77
78void
79evas_common_soft16_polygon_draw(Soft16_Image *dst, RGBA_Draw_Context *dc, RGBA_Polygon_Point *points, int x, int y)
80{
81 RGBA_Polygon_Point *pt;
82 RGBA_Vertex *point;
83 RGBA_Edge *edges;
84 int num_active_edges;
85 int n;
86 int i, j, k;
87 int y0, y1, yi;
88 int ext_x, ext_y, ext_w, ext_h;
89 int *sorted_index;
90 DATA8 alpha;
91 DATA16 rgb565;
92 DATA32 rgb565_unpack;
93
94 alpha = A_VAL(&dc->col.col) >> 3;
95 if (alpha == 0)
96 return;
97 alpha++;
98
99 rgb565 = RGB_565_FROM_COMPONENTS(R_VAL(&dc->col.col),
100 G_VAL(&dc->col.col),
101 B_VAL(&dc->col.col));
102 rgb565_unpack = RGB_565_UNPACK(rgb565);
103
104 ext_x = 0;
105 ext_y = 0;
106 ext_w = dst->cache_entry.w;
107 ext_h = dst->cache_entry.h;
108 if (dc->clip.use)
109 RECTS_CLIP_TO_RECT(ext_x, ext_y, ext_w, ext_h,
110 dc->clip.x, dc->clip.y, dc->clip.w, dc->clip.h);
111
112 if ((ext_w <= 0) || (ext_h <= 0))
113 return;
114
115 n = 0;
116 EINA_INLIST_FOREACH(points, pt) n++;
117
118 if (n < 3)
119 return;
120
121 edges = malloc(sizeof(RGBA_Edge) * n);
122 if (!edges)
123 return;
124
125 point = malloc(sizeof(RGBA_Vertex) * n);
126 if (!point)
127 {
128 free(edges);
129 return;
130 }
131
132 sorted_index = malloc(sizeof(int) * n);
133 if (!sorted_index)
134 {
135 free(edges);
136 free(point);
137 return;
138 }
139
140 k = 0;
141 EINA_INLIST_FOREACH(points, pt)
142 {
143 point[k].x = pt->x + x;
144 point[k].y = pt->y + y;
145 point[k].i = k;
146 k++;
147 }
148 qsort(point, n, sizeof(RGBA_Vertex), polygon_point_sorter);
149
150 for (k = 0; k < n; k++)
151 sorted_index[k] = point[k].i;
152
153 k = 0;
154 EINA_INLIST_FOREACH(points, pt)
155 {
156 point[k].x = pt->x + x;
157 point[k].y = pt->y + y;
158 point[k].i = k;
159 k++;
160 }
161
162 y0 = MAX(ext_y, ceil(point[sorted_index[0]].y - 0.5));
163 y1 = MIN(ext_y + ext_h - 1, floor(point[sorted_index[n - 1]].y - 0.5));
164
165 k = 0;
166 num_active_edges = 0;
167
168 for (yi = y0; yi <= y1; yi++)
169 {
170 for (; (k < n) && (point[sorted_index[k]].y <= ((float)yi + 0.5)); k++)
171 {
172 i = sorted_index[k];
173
174 if (i > 0) j = i - 1;
175 else j = n - 1;
176 if (point[j].y <= ((float)yi - 0.5))
177 {
178 POLY_EDGE_DEL(j)
179 }
180 else if (point[j].y > ((float)yi + 0.5))
181 {
182 POLY_EDGE_ADD(j, yi)
183 }
184 if (i < (n - 1)) j = i + 1;
185 else j = 0;
186 if (point[j].y <= ((float)yi - 0.5))
187 {
188 POLY_EDGE_DEL(i)
189 }
190 else if (point[j].y > ((float)yi + 0.5))
191 {
192 POLY_EDGE_ADD(i, yi)
193 }
194 }
195
196 qsort(edges, num_active_edges, sizeof(RGBA_Edge), polygon_edge_sorter);
197
198 for (j = 0; j < num_active_edges; j += 2)
199 {
200 int x0, x1;
201
202 x0 = ceil(edges[j].x - 0.5);
203 if (j < (num_active_edges - 1))
204 x1 = floor(edges[j + 1].x - 0.5);
205 else
206 x1 = x0;
207 if ((x1 >= ext_x) && (x0 < (ext_x + ext_w)) && (x0 <= x1))
208 {
209 DATA16 *dst_itr;
210 int w;
211
212 if (x0 < ext_x) x0 = ext_x;
213 if (x1 >= (ext_x + ext_w)) x1 = ext_x + ext_w - 1;
214
215 w = (x1 - x0) + 1;
216 dst_itr = dst->pixels + (yi * dst->stride) + x0;
217
218 if (alpha == 32)
219 _soft16_scanline_fill_solid_solid(dst_itr, w, rgb565);
220 else
221 _soft16_scanline_fill_transp_solid(dst_itr, w, rgb565_unpack, alpha);
222 }
223 edges[j].x += edges[j].dx;
224 edges[j + 1].x += edges[j + 1].dx;
225 }
226 }
227
228 free(edges);
229 free(point);
230 free(sorted_index);
231}
diff --git a/libraries/evas/src/lib/engines/common_16/evas_soft16_rectangle.c b/libraries/evas/src/lib/engines/common_16/evas_soft16_rectangle.c
new file mode 100644
index 0000000..bd38fce
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common_16/evas_soft16_rectangle.c
@@ -0,0 +1,121 @@
1#include "evas_common_soft16.h"
2#include "evas_soft16_scanline_fill.c"
3
4static inline int
5_is_empty_rectangle(const Eina_Rectangle *r)
6{
7 return (r->w < 1) || (r->h < 1);
8}
9
10static inline void
11_soft16_rectangle_draw_solid_solid(Soft16_Image *dst, int offset, int w, int h,
12 DATA16 rgb565)
13{
14 DATA16 *dst_itr;
15 int i;
16
17 dst_itr = dst->pixels + offset;
18
19 for (i = 0; i < h; i++, dst_itr += dst->stride)
20 _soft16_scanline_fill_solid_solid(dst_itr, w, rgb565);
21}
22
23static inline void
24_soft16_rectangle_draw_transp_solid(Soft16_Image *dst, int offset, int w, int h,
25 DATA16 rgb565, DATA8 alpha)
26{
27 DATA16 *dst_itr;
28 DATA32 rgb565_unpack;
29 int i;
30
31 dst_itr = dst->pixels + offset;
32 rgb565_unpack = RGB_565_UNPACK(rgb565);
33 alpha++;
34
35 for (i = 0; i < h; i++, dst_itr += dst->stride)
36 _soft16_scanline_fill_transp_solid(dst_itr, w, rgb565_unpack, alpha);
37}
38
39static void
40_soft16_rectangle_draw_int(Soft16_Image *dst, RGBA_Draw_Context *dc,
41 Eina_Rectangle dr)
42{
43 int dst_offset;
44
45 if (_is_empty_rectangle(&dr)) return;
46 RECTS_CLIP_TO_RECT(dr.x, dr.y, dr.w, dr.h, 0, 0, dst->cache_entry.w, dst->cache_entry.h);
47 if (_is_empty_rectangle(&dr)) return;
48
49 if (dc->clip.use)
50 RECTS_CLIP_TO_RECT(dr.x, dr.y, dr.w, dr.h, dc->clip.x,
51 dc->clip.y, dc->clip.w, dc->clip.h);
52 if (_is_empty_rectangle(&dr)) return;
53 if (A_VAL(&dc->col.col) == 0) return;
54
55 dst_offset = dr.x + (dr.y * dst->cache_entry.w);
56
57 if (!dst->cache_entry.flags.alpha)
58 {
59 DATA16 rgb565;
60 DATA8 alpha;
61
62 alpha = A_VAL(&dc->col.col) >> 3;
63 rgb565 = RGB_565_FROM_COMPONENTS(R_VAL(&dc->col.col),
64 G_VAL(&dc->col.col),
65 B_VAL(&dc->col.col));
66 if (alpha == 31)
67 _soft16_rectangle_draw_solid_solid
68 (dst, dst_offset, dr.w, dr.h, rgb565);
69 else if (alpha > 0)
70 _soft16_rectangle_draw_transp_solid
71 (dst, dst_offset, dr.w, dr.h, rgb565, alpha);
72 }
73 else
74 ERR("Unsupported feature: drawing rectangle to non-opaque destination.");
75}
76
77void
78evas_common_soft16_rectangle_draw(Soft16_Image *dst, RGBA_Draw_Context *dc,
79 int x, int y, int w, int h)
80{
81 Eina_Rectangle dr;
82 Cutout_Rects *rects;
83 Cutout_Rect *r;
84 struct RGBA_Draw_Context_clip c_bkp;
85 int i;
86
87 /* handle cutouts here! */
88 EINA_RECTANGLE_SET(&dr, x, y, w, h);
89
90 if (_is_empty_rectangle(&dr)) return;
91 if (!(RECTS_INTERSECT(dr.x, dr.y, dr.w, dr.h, 0, 0, dst->cache_entry.w, dst->cache_entry.h)))
92 return;
93
94 /* no cutouts - cut right to the chase */
95 if (!dc->cutout.rects)
96 {
97 _soft16_rectangle_draw_int(dst, dc, dr);
98 return;
99 }
100
101 c_bkp = dc->clip;
102
103 evas_common_draw_context_clip_clip(dc, 0, 0, dst->cache_entry.w, dst->cache_entry.h);
104 evas_common_draw_context_clip_clip(dc, x, y, w, h);
105 /* our clip is 0 size.. abort */
106 if ((dc->clip.w <= 0) || (dc->clip.h <= 0))
107 {
108 dc->clip = c_bkp;
109 return;
110 }
111 rects = evas_common_draw_context_apply_cutouts(dc);
112 for (i = 0; i < rects->active; ++i)
113 {
114 r = rects->rects + i;
115 evas_common_draw_context_set_clip(dc, r->x, r->y, r->w, r->h);
116 _soft16_rectangle_draw_int(dst, dc, dr);
117 }
118 evas_common_draw_context_apply_clear_cutouts(rects);
119 dc->clip = c_bkp;
120}
121
diff --git a/libraries/evas/src/lib/engines/common_16/evas_soft16_scanline_blend.c b/libraries/evas/src/lib/engines/common_16/evas_soft16_scanline_blend.c
new file mode 100644
index 0000000..c89eeaa
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common_16/evas_soft16_scanline_blend.c
@@ -0,0 +1,353 @@
1/** NOTE: This file is meant to be included by users **/
2
3/** NOTE2: r, g, b parameters are 16bits, so you can pass 0 to 256 inclusive.
4 ** this is due our division by 256 when multiplying the color.
5 **/
6
7/*****************************************************************************
8 * Scanline processing
9 *
10 * _soft16_scanline_<description>_<src>_<dst>[_<modifier>]()
11 *
12 ****************************************************************************/
13
14#include "evas_soft16_point_blend.c"
15
16/***********************************************************************
17 * Regular blend operations
18 */
19static void
20_soft16_scanline_blend_transp_solid(DATA16 *src, DATA8 *alpha, DATA16 *dst, int size)
21{
22 DATA16 *start, *end;
23
24 start = dst;
25 end = start + (size & ~7);
26
27 pld(alpha, 0);
28 pld(src, 0);
29
30 /* work on 8 pixels per time, do data preload */
31 while (start < end)
32 {
33 DATA8 alpha1, alpha2;
34
35 alpha1 = alpha[0];
36 alpha += 8;
37
38 /* empirical tests show these give the best performance */
39 pld(alpha, 8);
40 pld(src, 32);
41
42 src += 8;
43 start += 8;
44
45 alpha2 = alpha[-7];
46 _soft16_pt_blend_transp_solid(start - 8, src[-8], alpha1);
47
48 alpha1 = alpha[-6];
49 _soft16_pt_blend_transp_solid(start - 7, src[-7], alpha2);
50
51 alpha2 = alpha[-5];
52 _soft16_pt_blend_transp_solid(start - 6, src[-6], alpha1);
53
54 alpha1 = alpha[-4];
55 _soft16_pt_blend_transp_solid(start - 5, src[-5], alpha2);
56
57 alpha2 = alpha[-3];
58 _soft16_pt_blend_transp_solid(start - 4, src[-4], alpha1);
59
60 alpha1 = alpha[-2];
61 _soft16_pt_blend_transp_solid(start - 3, src[-3], alpha2);
62
63 alpha2 = alpha[-1];
64 _soft16_pt_blend_transp_solid(start - 2, src[-2], alpha1);
65
66 _soft16_pt_blend_transp_solid(start - 1, src[-1], alpha2);
67 }
68
69 /* remaining pixels (up to 7) */
70 end = start + (size & 7);
71 for (; start < end; start++, src++, alpha++)
72 _soft16_pt_blend_transp_solid(start, *src, *alpha);
73}
74
75static inline void
76_soft16_scanline_blend_solid_solid(DATA16 *src, DATA16 *dst, int size)
77{
78 memcpy(dst, src, size * sizeof(DATA16));
79}
80
81/***********************************************************************
82 * Blend operations taking an extra alpha (fade in, out)
83 */
84
85static void
86_soft16_scanline_blend_transp_solid_mul_alpha(DATA16 *src, DATA8 *alpha, DATA16 *dst, int size, const DATA8 rel_alpha)
87{
88 DATA16 *start, *end;
89
90 start = dst;
91 end = start + (size & ~7);
92
93 pld(alpha, 0);
94 pld(src, 0);
95
96 while (start < end)
97 {
98 DATA8 alpha1, alpha2;
99
100 alpha1 = alpha[0];
101 alpha += 8;
102
103 pld(alpha, 8);
104 pld(src, 32);
105
106 src += 8;
107 start += 8;
108
109 alpha2 = alpha[-7];
110 _soft16_pt_blend_transp_solid_mul_alpha
111 (start - 8, src[-8], alpha1, rel_alpha);
112
113 alpha1 = alpha[-6];
114 _soft16_pt_blend_transp_solid_mul_alpha
115 (start - 7, src[-7], alpha2, rel_alpha);
116
117 alpha2 = alpha[-5];
118 _soft16_pt_blend_transp_solid_mul_alpha
119 (start - 6, src[-6], alpha1, rel_alpha);
120
121 alpha1 = alpha[-4];
122 _soft16_pt_blend_transp_solid_mul_alpha
123 (start - 5, src[-5], alpha2, rel_alpha);
124
125 alpha2 = alpha[-3];
126 _soft16_pt_blend_transp_solid_mul_alpha
127 (start - 4, src[-4], alpha1, rel_alpha);
128
129 alpha1 = alpha[-2];
130 _soft16_pt_blend_transp_solid_mul_alpha
131 (start - 3, src[-3], alpha2, rel_alpha);
132
133 alpha2 = alpha[-1];
134 _soft16_pt_blend_transp_solid_mul_alpha
135 (start - 2, src[-2], alpha1, rel_alpha);
136
137 _soft16_pt_blend_transp_solid_mul_alpha
138 (start - 1, src[-1], alpha2, rel_alpha);
139 }
140
141 end = start + (size & 7);
142 for (; start < end; start++, src++, alpha++)
143 _soft16_pt_blend_transp_solid_mul_alpha(start, *src, *alpha, rel_alpha);
144}
145
146static void
147_soft16_scanline_blend_solid_solid_mul_alpha(DATA16 *src, DATA16 *dst, int size, DATA8 rel_alpha)
148{
149 DATA16 *start, *end;
150
151 start = dst;
152 end = start + (size & ~7);
153
154 pld(src, 0);
155
156 while (start < end)
157 {
158 pld(src, 32);
159 UNROLL8({
160 _soft16_pt_blend_solid_solid_mul_alpha(start, *src, rel_alpha);
161 start++;
162 src++;
163 });
164 }
165
166 end = start + (size & 7);
167 for (; start < end; start++, src++)
168 _soft16_pt_blend_solid_solid_mul_alpha(start, *src, rel_alpha);
169}
170
171/***********************************************************************
172 * Blend operations with extra alpha and multiply color
173 */
174
175static void
176_soft16_scanline_blend_transp_solid_mul_color_transp(DATA16 *src, DATA8 *alpha, DATA16 *dst, int size, DATA8 rel_alpha, DATA16 r, DATA16 g, DATA16 b)
177{
178 DATA16 *start, *end;
179
180 start = dst;
181 end = start + (size & ~7);
182
183 pld(alpha, 0);
184 pld(src, 0);
185
186 while (start < end)
187 {
188 DATA8 alpha1, alpha2;
189
190 alpha1 = alpha[0];
191 alpha += 8;
192
193 pld(src, 32);
194 pld(start, 32);
195
196 src += 8;
197 start += 8;
198
199 alpha2 = alpha[-7];
200 _soft16_pt_blend_transp_solid_mul_color_transp
201 (start - 8, src[-8], alpha1, rel_alpha, r, g, b);
202
203 alpha1 = alpha[-6];
204 _soft16_pt_blend_transp_solid_mul_color_transp
205 (start - 7, src[-7], alpha2, rel_alpha, r, g, b);
206
207 alpha2 = alpha[-5];
208 _soft16_pt_blend_transp_solid_mul_color_transp
209 (start - 6, src[-6], alpha1, rel_alpha, r, g, b);
210
211 alpha1 = alpha[-4];
212 _soft16_pt_blend_transp_solid_mul_color_transp
213 (start - 5, src[-5], alpha2, rel_alpha, r, g, b);
214
215 alpha2 = alpha[-3];
216 _soft16_pt_blend_transp_solid_mul_color_transp
217 (start - 4, src[-4], alpha1, rel_alpha, r, g, b);
218
219 alpha1 = alpha[-2];
220 _soft16_pt_blend_transp_solid_mul_color_transp
221 (start - 3, src[-3], alpha2, rel_alpha, r, g, b);
222
223 alpha2 = alpha[-1];
224 _soft16_pt_blend_transp_solid_mul_color_transp
225 (start - 2, src[-2], alpha1, rel_alpha, r, g, b);
226
227 _soft16_pt_blend_transp_solid_mul_color_transp
228 (start - 1, src[-1], alpha2, rel_alpha, r, g, b);
229 }
230
231 end = start + (size & 7);
232 for (; start < end; start++, src++, alpha++)
233 _soft16_pt_blend_transp_solid_mul_color_transp
234 (start, *src, *alpha, rel_alpha, r, g, b);
235}
236
237static void
238_soft16_scanline_blend_solid_solid_mul_color_transp(DATA16 *src, DATA16 *dst, int size, DATA8 rel_alpha, DATA16 r, DATA16 g, DATA16 b)
239{
240 DATA16 *start, *end;
241
242 start = dst;
243 end = start + (size & ~7);
244
245 pld(src, 0);
246
247 while (start < end)
248 {
249 pld(src, 32);
250 UNROLL8({
251 _soft16_pt_blend_solid_solid_mul_color_transp
252 (start, *src, rel_alpha, r, g, b);
253 start++;
254 src++;
255 });
256 }
257
258 end = start + (size & 7);
259 for (; start < end; start++, src++)
260 _soft16_pt_blend_solid_solid_mul_color_transp
261 (start, *src, rel_alpha, r, g, b);
262}
263
264/***********************************************************************
265 * Blend operations with extra multiply color
266 */
267
268static void
269_soft16_scanline_blend_transp_solid_mul_color_solid(DATA16 *src, DATA8 *alpha, DATA16 *dst, int size, DATA16 r, DATA16 g, DATA16 b)
270{
271 DATA16 *start, *end;
272
273 start = dst;
274 end = start + (size & ~7);
275
276 pld(alpha, 0);
277 pld(src, 0);
278
279 while (start < end)
280 {
281 DATA8 alpha1, alpha2;
282
283 alpha1 = alpha[0];
284 alpha += 8;
285
286 pld(alpha, 8);
287 pld(src, 32);
288
289 src += 8;
290 start += 8;
291
292 alpha2 = alpha[-7];
293 _soft16_pt_blend_transp_solid_mul_color_solid
294 (start - 8, src[-8], alpha1, r, g, b);
295
296 alpha1 = alpha[-6];
297 _soft16_pt_blend_transp_solid_mul_color_solid
298 (start - 7, src[-7], alpha2, r, g, b);
299
300 alpha2 = alpha[-5];
301 _soft16_pt_blend_transp_solid_mul_color_solid
302 (start - 6, src[-6], alpha1, r, g, b);
303
304 alpha1 = alpha[-4];
305 _soft16_pt_blend_transp_solid_mul_color_solid
306 (start - 5, src[-5], alpha2, r, g, b);
307
308 alpha2 = alpha[-3];
309 _soft16_pt_blend_transp_solid_mul_color_solid
310 (start - 4, src[-4], alpha1, r, g, b);
311
312 alpha1 = alpha[-2];
313 _soft16_pt_blend_transp_solid_mul_color_solid
314 (start - 3, src[-3], alpha2, r, g, b);
315
316 alpha2 = alpha[-1];
317 _soft16_pt_blend_transp_solid_mul_color_solid
318 (start - 2, src[-2], alpha1, r, g, b);
319
320 _soft16_pt_blend_transp_solid_mul_color_solid
321 (start - 1, src[-1], alpha2, r, g, b);
322 }
323
324 end = start + (size & 7);
325 for (; start < end; start++, src++, alpha++)
326 _soft16_pt_blend_transp_solid_mul_color_solid
327 (start, *src, *alpha, r, g, b);
328}
329
330static void
331_soft16_scanline_blend_solid_solid_mul_color_solid(DATA16 *src, DATA16 *dst, int size, DATA8 r, DATA8 g, DATA8 b)
332{
333 DATA16 *start, *end;
334
335 start = dst;
336 end = start + (size & ~7);
337
338 pld(src, 0);
339
340 while (start < end)
341 {
342 pld(src, 32);
343 UNROLL8({
344 _soft16_pt_blend_solid_solid_mul_color_solid(start, *src, r, g, b);
345 start++;
346 src++;
347 });
348 }
349
350 end = start + (size & 7);
351 for (; start < end; start++, src++)
352 _soft16_pt_blend_solid_solid_mul_color_solid(start, *src, r, g, b);
353}
diff --git a/libraries/evas/src/lib/engines/common_16/evas_soft16_scanline_fill.c b/libraries/evas/src/lib/engines/common_16/evas_soft16_scanline_fill.c
new file mode 100644
index 0000000..d31bef8
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common_16/evas_soft16_scanline_fill.c
@@ -0,0 +1,86 @@
1/** NOTE: This file is meant to be included by users **/
2
3/*****************************************************************************
4 * Point processing
5 *
6 * _soft16_pt_<description>_<src>_<dst>[_<modifier>]()
7 *
8 * Scanline processing
9 *
10 * _soft16_scanline_<description>_<src>_<dst>[_<modifier>]()
11 *
12 ****************************************************************************/
13EFL_ALWAYS_INLINE void
14_soft16_pt_fill_solid_solid(DATA16 *dst, DATA16 rgb565)
15{
16 *dst = rgb565;
17}
18
19static void
20_soft16_scanline_fill_solid_solid(DATA16 *dst, int size, DATA16 rgb565)
21{
22 DATA16 *start, *end;
23 DATA32 rgb565_double;
24
25 start = dst;
26
27 if ((long)start & 0x2)
28 {
29 *start = rgb565;
30 start++;
31 size--;
32 }
33
34 end = start + (size & ~7);
35
36 rgb565_double = (rgb565 << 16) | rgb565;
37
38 while (start < end)
39 {
40 DATA32 *p = (DATA32 *)start;
41
42 p[0] = rgb565_double;
43 p[1] = rgb565_double;
44 p[2] = rgb565_double;
45 p[3] = rgb565_double;
46
47 start += 8;
48 }
49
50 end = start + (size & 7);
51 for (; start < end; start++)
52 *start = rgb565;
53}
54
55EFL_ALWAYS_INLINE void
56_soft16_pt_fill_transp_solid(DATA16 *dst, DATA32 rgb565_unpack, DATA8 alpha)
57{
58 DATA32 d;
59
60 d = RGB_565_UNPACK(*dst);
61 d = RGB_565_UNPACKED_BLEND(rgb565_unpack, d, alpha);
62 *dst = RGB_565_PACK(d);
63}
64
65static void
66_soft16_scanline_fill_transp_solid(DATA16 *dst, int size, DATA32 rgb565_unpack, DATA8 alpha)
67{
68 DATA16 *start, *end;
69
70 start = dst;
71 pld(start, 0);
72 end = start + (size & ~7);
73
74 while (start < end)
75 {
76 pld(start, 32);
77 UNROLL8({
78 _soft16_pt_fill_transp_solid(start, rgb565_unpack, alpha);
79 start++;
80 });
81 }
82
83 end = start + (size & 7);
84 for (; start < end; start++)
85 _soft16_pt_fill_transp_solid(start, rgb565_unpack, alpha);
86}
diff --git a/libraries/evas/src/lib/engines/common_8/Makefile.am b/libraries/evas/src/lib/engines/common_8/Makefile.am
new file mode 100644
index 0000000..58a1b1f
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common_8/Makefile.am
@@ -0,0 +1,32 @@
1
2MAINTAINERCLEANFILES = Makefile.in
3
4AM_CPPFLAGS = \
5-I. \
6-I$(top_srcdir)/src/lib \
7-I$(top_srcdir)/src/lib/include \
8@FREETYPE_CFLAGS@ \
9@PIXMAN_CFLAGS@ \
10@VALGRIND_CFLAGS@ \
11@EINA_CFLAGS@ \
12@EET_CFLAGS@ \
13@pthread_cflags@
14
15noinst_LTLIBRARIES = libevas_engine_common_8.la
16
17libevas_engine_common_8_la_SOURCES = \
18evas_soft8_dither_mask.c \
19evas_soft8_font.c \
20evas_soft8_image_unscaled.c \
21evas_soft8_main.c \
22evas_soft8_rectangle.c \
23evas_soft8_line.c \
24evas_soft8_polygon.c \
25evas_soft8_image_scaled_sampled.c
26
27
28libevas_engine_common_8_la_DEPENDENCIES = $(top_builddir)/config.h
29
30EXTRA_DIST = \
31evas_soft8_scanline_blend.c \
32evas_soft8_scanline_fill.c
diff --git a/libraries/evas/src/lib/engines/common_8/Makefile.in b/libraries/evas/src/lib/engines/common_8/Makefile.in
new file mode 100644
index 0000000..06c13de
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common_8/Makefile.in
@@ -0,0 +1,696 @@
1# Makefile.in generated by automake 1.11.1 from Makefile.am.
2# @configure_input@
3
4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
6# Inc.
7# This Makefile.in is free software; the Free Software Foundation
8# gives unlimited permission to copy and/or distribute it,
9# with or without modifications, as long as this notice is preserved.
10
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
13# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14# PARTICULAR PURPOSE.
15
16@SET_MAKE@
17
18VPATH = @srcdir@
19pkgdatadir = $(datadir)/@PACKAGE@
20pkgincludedir = $(includedir)/@PACKAGE@
21pkglibdir = $(libdir)/@PACKAGE@
22pkglibexecdir = $(libexecdir)/@PACKAGE@
23am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
24install_sh_DATA = $(install_sh) -c -m 644
25install_sh_PROGRAM = $(install_sh) -c
26install_sh_SCRIPT = $(install_sh) -c
27INSTALL_HEADER = $(INSTALL_DATA)
28transform = $(program_transform_name)
29NORMAL_INSTALL = :
30PRE_INSTALL = :
31POST_INSTALL = :
32NORMAL_UNINSTALL = :
33PRE_UNINSTALL = :
34POST_UNINSTALL = :
35build_triplet = @build@
36host_triplet = @host@
37subdir = src/lib/engines/common_8
38DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
39ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
40am__aclocal_m4_deps = $(top_srcdir)/m4/efl_attribute.m4 \
41 $(top_srcdir)/m4/efl_coverage.m4 \
42 $(top_srcdir)/m4/efl_doxygen.m4 \
43 $(top_srcdir)/m4/efl_fnmatch.m4 \
44 $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \
45 $(top_srcdir)/m4/evas_check_engine.m4 \
46 $(top_srcdir)/m4/evas_check_loader.m4 \
47 $(top_srcdir)/m4/evas_converter.m4 \
48 $(top_srcdir)/m4/evas_dither.m4 \
49 $(top_srcdir)/m4/evas_scaler.m4 $(top_srcdir)/m4/libtool.m4 \
50 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
51 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
52 $(top_srcdir)/configure.ac
53am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
54 $(ACLOCAL_M4)
55mkinstalldirs = $(install_sh) -d
56CONFIG_HEADER = $(top_builddir)/config.h
57CONFIG_CLEAN_FILES =
58CONFIG_CLEAN_VPATH_FILES =
59LTLIBRARIES = $(noinst_LTLIBRARIES)
60libevas_engine_common_8_la_LIBADD =
61am_libevas_engine_common_8_la_OBJECTS = evas_soft8_dither_mask.lo \
62 evas_soft8_font.lo evas_soft8_image_unscaled.lo \
63 evas_soft8_main.lo evas_soft8_rectangle.lo evas_soft8_line.lo \
64 evas_soft8_polygon.lo evas_soft8_image_scaled_sampled.lo
65libevas_engine_common_8_la_OBJECTS = \
66 $(am_libevas_engine_common_8_la_OBJECTS)
67AM_V_lt = $(am__v_lt_$(V))
68am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
69am__v_lt_0 = --silent
70DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
71depcomp = $(SHELL) $(top_srcdir)/depcomp
72am__depfiles_maybe = depfiles
73am__mv = mv -f
74COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
75 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
76LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
77 $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
78 $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
79 $(AM_CFLAGS) $(CFLAGS)
80AM_V_CC = $(am__v_CC_$(V))
81am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
82am__v_CC_0 = @echo " CC " $@;
83AM_V_at = $(am__v_at_$(V))
84am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
85am__v_at_0 = @
86CCLD = $(CC)
87LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
88 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
89 $(AM_LDFLAGS) $(LDFLAGS) -o $@
90AM_V_CCLD = $(am__v_CCLD_$(V))
91am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
92am__v_CCLD_0 = @echo " CCLD " $@;
93AM_V_GEN = $(am__v_GEN_$(V))
94am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
95am__v_GEN_0 = @echo " GEN " $@;
96SOURCES = $(libevas_engine_common_8_la_SOURCES)
97DIST_SOURCES = $(libevas_engine_common_8_la_SOURCES)
98ETAGS = etags
99CTAGS = ctags
100DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
101ACLOCAL = @ACLOCAL@
102ALLOCA = @ALLOCA@
103AMTAR = @AMTAR@
104AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
105AR = @AR@
106AS = @AS@
107AUTOCONF = @AUTOCONF@
108AUTOHEADER = @AUTOHEADER@
109AUTOMAKE = @AUTOMAKE@
110AWK = @AWK@
111CC = @CC@
112CCDEPMODE = @CCDEPMODE@
113CFLAGS = @CFLAGS@
114CHECK_CFLAGS = @CHECK_CFLAGS@
115CHECK_LIBS = @CHECK_LIBS@
116CPP = @CPP@
117CPPFLAGS = @CPPFLAGS@
118CXX = @CXX@
119CXXCPP = @CXXCPP@
120CXXDEPMODE = @CXXDEPMODE@
121CXXFLAGS = @CXXFLAGS@
122CYGPATH_W = @CYGPATH_W@
123DEFS = @DEFS@
124DEPDIR = @DEPDIR@
125DIRECTFB_CFLAGS = @DIRECTFB_CFLAGS@
126DIRECTFB_LIBS = @DIRECTFB_LIBS@
127DLLTOOL = @DLLTOOL@
128DSYMUTIL = @DSYMUTIL@
129DUMPBIN = @DUMPBIN@
130ECHO_C = @ECHO_C@
131ECHO_N = @ECHO_N@
132ECHO_T = @ECHO_T@
133ECORE_EVAS_CFLAGS = @ECORE_EVAS_CFLAGS@
134ECORE_EVAS_LIBS = @ECORE_EVAS_LIBS@
135EDB_CFLAGS = @EDB_CFLAGS@
136EDB_LIBS = @EDB_LIBS@
137EDJE_CFLAGS = @EDJE_CFLAGS@
138EDJE_LIBS = @EDJE_LIBS@
139EET_CFLAGS = @EET_CFLAGS@
140EET_LIBS = @EET_LIBS@
141EFL_COVERAGE_CFLAGS = @EFL_COVERAGE_CFLAGS@
142EFL_COVERAGE_LIBS = @EFL_COVERAGE_LIBS@
143EFL_FNMATCH_LIBS = @EFL_FNMATCH_LIBS@
144EGREP = @EGREP@
145EINA_CFLAGS = @EINA_CFLAGS@
146EINA_LIBS = @EINA_LIBS@
147EVAS_CFLAGS = @EVAS_CFLAGS@
148EVAS_LIBS = @EVAS_LIBS@
149EVAS_SSE3_CFLAGS = @EVAS_SSE3_CFLAGS@
150EVIL_CFLAGS = @EVIL_CFLAGS@
151EVIL_LIBS = @EVIL_LIBS@
152EXEEXT = @EXEEXT@
153FGREP = @FGREP@
154FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@
155FONTCONFIG_LIBS = @FONTCONFIG_LIBS@
156FREETYPE_CFLAGS = @FREETYPE_CFLAGS@
157FREETYPE_LIBS = @FREETYPE_LIBS@
158FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@
159FRIBIDI_LIBS = @FRIBIDI_LIBS@
160GL_EET_CFLAGS = @GL_EET_CFLAGS@
161GL_EET_LIBS = @GL_EET_LIBS@
162GREP = @GREP@
163HARFBUZZ_CFLAGS = @HARFBUZZ_CFLAGS@
164HARFBUZZ_LIBS = @HARFBUZZ_LIBS@
165INSTALL = @INSTALL@
166INSTALL_DATA = @INSTALL_DATA@
167INSTALL_PROGRAM = @INSTALL_PROGRAM@
168INSTALL_SCRIPT = @INSTALL_SCRIPT@
169INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
170LD = @LD@
171LDFLAGS = @LDFLAGS@
172LIBOBJS = @LIBOBJS@
173LIBS = @LIBS@
174LIBTOOL = @LIBTOOL@
175LINEBREAK_CFLAGS = @LINEBREAK_CFLAGS@
176LINEBREAK_LIBS = @LINEBREAK_LIBS@
177LIPO = @LIPO@
178LN_S = @LN_S@
179LTLIBOBJS = @LTLIBOBJS@
180MAKEINFO = @MAKEINFO@
181MKDIR_P = @MKDIR_P@
182MODULE_ARCH = @MODULE_ARCH@
183NM = @NM@
184NMEDIT = @NMEDIT@
185OBJC = @OBJC@
186OBJCDEPMODE = @OBJCDEPMODE@
187OBJCFLAGS = @OBJCFLAGS@
188OBJDUMP = @OBJDUMP@
189OBJEXT = @OBJEXT@
190OTOOL = @OTOOL@
191OTOOL64 = @OTOOL64@
192PACKAGE = @PACKAGE@
193PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
194PACKAGE_NAME = @PACKAGE_NAME@
195PACKAGE_STRING = @PACKAGE_STRING@
196PACKAGE_TARNAME = @PACKAGE_TARNAME@
197PACKAGE_URL = @PACKAGE_URL@
198PACKAGE_VERSION = @PACKAGE_VERSION@
199PATH_SEPARATOR = @PATH_SEPARATOR@
200PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
201PIXMAN_LIBS = @PIXMAN_LIBS@
202PKG_CONFIG = @PKG_CONFIG@
203PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
204PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
205PNG_CFLAGS = @PNG_CFLAGS@
206PNG_LIBS = @PNG_LIBS@
207RANLIB = @RANLIB@
208SDL_CFLAGS = @SDL_CFLAGS@
209SDL_LIBS = @SDL_LIBS@
210SED = @SED@
211SET_MAKE = @SET_MAKE@
212SHELL = @SHELL@
213SHM_OPEN_LINK = @SHM_OPEN_LINK@
214STRIP = @STRIP@
215SVG_CFLAGS = @SVG_CFLAGS@
216SVG_LIBS = @SVG_LIBS@
217VALGRIND_CFLAGS = @VALGRIND_CFLAGS@
218VALGRIND_LIBS = @VALGRIND_LIBS@
219VERSION = @VERSION@
220VMAJ = @VMAJ@
221WIN32_CFLAGS = @WIN32_CFLAGS@
222WIN32_CPPFLAGS = @WIN32_CPPFLAGS@
223XCB_CFLAGS = @XCB_CFLAGS@
224XCB_GL_CFLAGS = @XCB_GL_CFLAGS@
225XCB_GL_LIBS = @XCB_GL_LIBS@
226XCB_LIBS = @XCB_LIBS@
227XEXT_CFLAGS = @XEXT_CFLAGS@
228XEXT_LIBS = @XEXT_LIBS@
229XMKMF = @XMKMF@
230X_CFLAGS = @X_CFLAGS@
231X_EXTRA_LIBS = @X_EXTRA_LIBS@
232X_LIBS = @X_LIBS@
233X_PRE_LIBS = @X_PRE_LIBS@
234abs_builddir = @abs_builddir@
235abs_srcdir = @abs_srcdir@
236abs_top_builddir = @abs_top_builddir@
237abs_top_srcdir = @abs_top_srcdir@
238ac_ct_CC = @ac_ct_CC@
239ac_ct_CXX = @ac_ct_CXX@
240ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
241ac_ct_OBJC = @ac_ct_OBJC@
242altivec_cflags = @altivec_cflags@
243am__include = @am__include@
244am__leading_dot = @am__leading_dot@
245am__quote = @am__quote@
246am__tar = @am__tar@
247am__untar = @am__untar@
248bindir = @bindir@
249build = @build@
250build_alias = @build_alias@
251build_cpu = @build_cpu@
252build_os = @build_os@
253build_vendor = @build_vendor@
254builddir = @builddir@
255datadir = @datadir@
256datarootdir = @datarootdir@
257dlopen_libs = @dlopen_libs@
258docdir = @docdir@
259dvidir = @dvidir@
260edje_cc = @edje_cc@
261efl_doxygen = @efl_doxygen@
262efl_have_doxygen = @efl_have_doxygen@
263evas_engine_buffer_cflags = @evas_engine_buffer_cflags@
264evas_engine_buffer_libs = @evas_engine_buffer_libs@
265evas_engine_direct3d_cflags = @evas_engine_direct3d_cflags@
266evas_engine_direct3d_libs = @evas_engine_direct3d_libs@
267evas_engine_directfb_cflags = @evas_engine_directfb_cflags@
268evas_engine_directfb_libs = @evas_engine_directfb_libs@
269evas_engine_fb_cflags = @evas_engine_fb_cflags@
270evas_engine_fb_libs = @evas_engine_fb_libs@
271evas_engine_gl_cocoa_cflags = @evas_engine_gl_cocoa_cflags@
272evas_engine_gl_cocoa_libs = @evas_engine_gl_cocoa_libs@
273evas_engine_gl_common_libs = @evas_engine_gl_common_libs@
274evas_engine_gl_sdl_cflags = @evas_engine_gl_sdl_cflags@
275evas_engine_gl_sdl_libs = @evas_engine_gl_sdl_libs@
276evas_engine_gl_xcb_cflags = @evas_engine_gl_xcb_cflags@
277evas_engine_gl_xcb_libs = @evas_engine_gl_xcb_libs@
278evas_engine_gl_xlib_cflags = @evas_engine_gl_xlib_cflags@
279evas_engine_gl_xlib_libs = @evas_engine_gl_xlib_libs@
280evas_engine_psl1ght_cflags = @evas_engine_psl1ght_cflags@
281evas_engine_psl1ght_libs = @evas_engine_psl1ght_libs@
282evas_engine_software_16_ddraw_cflags = @evas_engine_software_16_ddraw_cflags@
283evas_engine_software_16_ddraw_libs = @evas_engine_software_16_ddraw_libs@
284evas_engine_software_16_sdl_cflags = @evas_engine_software_16_sdl_cflags@
285evas_engine_software_16_sdl_libs = @evas_engine_software_16_sdl_libs@
286evas_engine_software_16_wince_cflags = @evas_engine_software_16_wince_cflags@
287evas_engine_software_16_wince_libs = @evas_engine_software_16_wince_libs@
288evas_engine_software_16_x11_cflags = @evas_engine_software_16_x11_cflags@
289evas_engine_software_16_x11_libs = @evas_engine_software_16_x11_libs@
290evas_engine_software_8_x11_cflags = @evas_engine_software_8_x11_cflags@
291evas_engine_software_8_x11_libs = @evas_engine_software_8_x11_libs@
292evas_engine_software_ddraw_cflags = @evas_engine_software_ddraw_cflags@
293evas_engine_software_ddraw_libs = @evas_engine_software_ddraw_libs@
294evas_engine_software_gdi_cflags = @evas_engine_software_gdi_cflags@
295evas_engine_software_gdi_libs = @evas_engine_software_gdi_libs@
296evas_engine_software_sdl_cflags = @evas_engine_software_sdl_cflags@
297evas_engine_software_sdl_libs = @evas_engine_software_sdl_libs@
298evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@
299evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@
300evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@
301evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@
302evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@
303evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@
304evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@
305evas_image_loader_edb_libs = @evas_image_loader_edb_libs@
306evas_image_loader_eet_cflags = @evas_image_loader_eet_cflags@
307evas_image_loader_eet_libs = @evas_image_loader_eet_libs@
308evas_image_loader_generic_cflags = @evas_image_loader_generic_cflags@
309evas_image_loader_generic_libs = @evas_image_loader_generic_libs@
310evas_image_loader_gif_cflags = @evas_image_loader_gif_cflags@
311evas_image_loader_gif_libs = @evas_image_loader_gif_libs@
312evas_image_loader_ico_cflags = @evas_image_loader_ico_cflags@
313evas_image_loader_ico_libs = @evas_image_loader_ico_libs@
314evas_image_loader_jpeg_cflags = @evas_image_loader_jpeg_cflags@
315evas_image_loader_jpeg_libs = @evas_image_loader_jpeg_libs@
316evas_image_loader_pmaps_cflags = @evas_image_loader_pmaps_cflags@
317evas_image_loader_pmaps_libs = @evas_image_loader_pmaps_libs@
318evas_image_loader_png_cflags = @evas_image_loader_png_cflags@
319evas_image_loader_png_libs = @evas_image_loader_png_libs@
320evas_image_loader_psd_cflags = @evas_image_loader_psd_cflags@
321evas_image_loader_psd_libs = @evas_image_loader_psd_libs@
322evas_image_loader_svg_cflags = @evas_image_loader_svg_cflags@
323evas_image_loader_svg_libs = @evas_image_loader_svg_libs@
324evas_image_loader_tga_cflags = @evas_image_loader_tga_cflags@
325evas_image_loader_tga_libs = @evas_image_loader_tga_libs@
326evas_image_loader_tiff_cflags = @evas_image_loader_tiff_cflags@
327evas_image_loader_tiff_libs = @evas_image_loader_tiff_libs@
328evas_image_loader_wbmp_cflags = @evas_image_loader_wbmp_cflags@
329evas_image_loader_wbmp_libs = @evas_image_loader_wbmp_libs@
330evas_image_loader_xpm_cflags = @evas_image_loader_xpm_cflags@
331evas_image_loader_xpm_libs = @evas_image_loader_xpm_libs@
332exec_prefix = @exec_prefix@
333have_evas_engine_gl_x11 = @have_evas_engine_gl_x11@
334have_evas_engine_gl_xcb = @have_evas_engine_gl_xcb@
335have_evas_engine_gl_xlib = @have_evas_engine_gl_xlib@
336have_evas_engine_software_x11 = @have_evas_engine_software_x11@
337have_evas_engine_software_xcb = @have_evas_engine_software_xcb@
338have_evas_engine_software_xlib = @have_evas_engine_software_xlib@
339have_lcov = @have_lcov@
340host = @host@
341host_alias = @host_alias@
342host_cpu = @host_cpu@
343host_os = @host_os@
344host_vendor = @host_vendor@
345htmldir = @htmldir@
346includedir = @includedir@
347infodir = @infodir@
348install_sh = @install_sh@
349libdir = @libdir@
350libexecdir = @libexecdir@
351localedir = @localedir@
352localstatedir = @localstatedir@
353lt_ECHO = @lt_ECHO@
354lt_enable_auto_import = @lt_enable_auto_import@
355mandir = @mandir@
356mkdir_p = @mkdir_p@
357oldincludedir = @oldincludedir@
358pdfdir = @pdfdir@
359pkgconfig_requires_private = @pkgconfig_requires_private@
360prefix = @prefix@
361program_transform_name = @program_transform_name@
362psdir = @psdir@
363pthread_cflags = @pthread_cflags@
364pthread_libs = @pthread_libs@
365release_info = @release_info@
366requirement_evas = @requirement_evas@
367sbindir = @sbindir@
368sharedstatedir = @sharedstatedir@
369srcdir = @srcdir@
370sysconfdir = @sysconfdir@
371target_alias = @target_alias@
372top_build_prefix = @top_build_prefix@
373top_builddir = @top_builddir@
374top_srcdir = @top_srcdir@
375version_info = @version_info@
376MAINTAINERCLEANFILES = Makefile.in
377AM_CPPFLAGS = \
378-I. \
379-I$(top_srcdir)/src/lib \
380-I$(top_srcdir)/src/lib/include \
381@FREETYPE_CFLAGS@ \
382@PIXMAN_CFLAGS@ \
383@VALGRIND_CFLAGS@ \
384@EINA_CFLAGS@ \
385@EET_CFLAGS@ \
386@pthread_cflags@
387
388noinst_LTLIBRARIES = libevas_engine_common_8.la
389libevas_engine_common_8_la_SOURCES = \
390evas_soft8_dither_mask.c \
391evas_soft8_font.c \
392evas_soft8_image_unscaled.c \
393evas_soft8_main.c \
394evas_soft8_rectangle.c \
395evas_soft8_line.c \
396evas_soft8_polygon.c \
397evas_soft8_image_scaled_sampled.c
398
399libevas_engine_common_8_la_DEPENDENCIES = $(top_builddir)/config.h
400EXTRA_DIST = \
401evas_soft8_scanline_blend.c \
402evas_soft8_scanline_fill.c
403
404all: all-am
405
406.SUFFIXES:
407.SUFFIXES: .c .lo .o .obj
408$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
409 @for dep in $?; do \
410 case '$(am__configure_deps)' in \
411 *$$dep*) \
412 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
413 && { if test -f $@; then exit 0; else break; fi; }; \
414 exit 1;; \
415 esac; \
416 done; \
417 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/engines/common_8/Makefile'; \
418 $(am__cd) $(top_srcdir) && \
419 $(AUTOMAKE) --gnu src/lib/engines/common_8/Makefile
420.PRECIOUS: Makefile
421Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
422 @case '$?' in \
423 *config.status*) \
424 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
425 *) \
426 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
427 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
428 esac;
429
430$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
431 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
432
433$(top_srcdir)/configure: $(am__configure_deps)
434 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
435$(ACLOCAL_M4): $(am__aclocal_m4_deps)
436 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
437$(am__aclocal_m4_deps):
438
439clean-noinstLTLIBRARIES:
440 -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
441 @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
442 dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
443 test "$$dir" != "$$p" || dir=.; \
444 echo "rm -f \"$${dir}/so_locations\""; \
445 rm -f "$${dir}/so_locations"; \
446 done
447libevas_engine_common_8.la: $(libevas_engine_common_8_la_OBJECTS) $(libevas_engine_common_8_la_DEPENDENCIES)
448 $(AM_V_CCLD)$(LINK) $(libevas_engine_common_8_la_OBJECTS) $(libevas_engine_common_8_la_LIBADD) $(LIBS)
449
450mostlyclean-compile:
451 -rm -f *.$(OBJEXT)
452
453distclean-compile:
454 -rm -f *.tab.c
455
456@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_soft8_dither_mask.Plo@am__quote@
457@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_soft8_font.Plo@am__quote@
458@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_soft8_image_scaled_sampled.Plo@am__quote@
459@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_soft8_image_unscaled.Plo@am__quote@
460@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_soft8_line.Plo@am__quote@
461@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_soft8_main.Plo@am__quote@
462@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_soft8_polygon.Plo@am__quote@
463@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_soft8_rectangle.Plo@am__quote@
464
465.c.o:
466@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
467@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
468@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
469@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
470@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
471@am__fastdepCC_FALSE@ $(COMPILE) -c $<
472
473.c.obj:
474@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
475@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
476@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
477@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
478@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
479@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
480
481.c.lo:
482@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
483@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
484@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
485@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
486@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
487@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
488
489mostlyclean-libtool:
490 -rm -f *.lo
491
492clean-libtool:
493 -rm -rf .libs _libs
494
495ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
496 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
497 unique=`for i in $$list; do \
498 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
499 done | \
500 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
501 END { if (nonempty) { for (i in files) print i; }; }'`; \
502 mkid -fID $$unique
503tags: TAGS
504
505TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
506 $(TAGS_FILES) $(LISP)
507 set x; \
508 here=`pwd`; \
509 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
510 unique=`for i in $$list; do \
511 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
512 done | \
513 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
514 END { if (nonempty) { for (i in files) print i; }; }'`; \
515 shift; \
516 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
517 test -n "$$unique" || unique=$$empty_fix; \
518 if test $$# -gt 0; then \
519 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
520 "$$@" $$unique; \
521 else \
522 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
523 $$unique; \
524 fi; \
525 fi
526ctags: CTAGS
527CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
528 $(TAGS_FILES) $(LISP)
529 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
530 unique=`for i in $$list; do \
531 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
532 done | \
533 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
534 END { if (nonempty) { for (i in files) print i; }; }'`; \
535 test -z "$(CTAGS_ARGS)$$unique" \
536 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
537 $$unique
538
539GTAGS:
540 here=`$(am__cd) $(top_builddir) && pwd` \
541 && $(am__cd) $(top_srcdir) \
542 && gtags -i $(GTAGS_ARGS) "$$here"
543
544distclean-tags:
545 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
546
547distdir: $(DISTFILES)
548 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
549 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
550 list='$(DISTFILES)'; \
551 dist_files=`for file in $$list; do echo $$file; done | \
552 sed -e "s|^$$srcdirstrip/||;t" \
553 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
554 case $$dist_files in \
555 */*) $(MKDIR_P) `echo "$$dist_files" | \
556 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
557 sort -u` ;; \
558 esac; \
559 for file in $$dist_files; do \
560 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
561 if test -d $$d/$$file; then \
562 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
563 if test -d "$(distdir)/$$file"; then \
564 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
565 fi; \
566 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
567 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
568 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
569 fi; \
570 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
571 else \
572 test -f "$(distdir)/$$file" \
573 || cp -p $$d/$$file "$(distdir)/$$file" \
574 || exit 1; \
575 fi; \
576 done
577check-am: all-am
578check: check-am
579all-am: Makefile $(LTLIBRARIES)
580installdirs:
581install: install-am
582install-exec: install-exec-am
583install-data: install-data-am
584uninstall: uninstall-am
585
586install-am: all-am
587 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
588
589installcheck: installcheck-am
590install-strip:
591 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
592 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
593 `test -z '$(STRIP)' || \
594 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
595mostlyclean-generic:
596
597clean-generic:
598
599distclean-generic:
600 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
601 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
602
603maintainer-clean-generic:
604 @echo "This command is intended for maintainers to use"
605 @echo "it deletes files that may require special tools to rebuild."
606 -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
607clean: clean-am
608
609clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
610 mostlyclean-am
611
612distclean: distclean-am
613 -rm -rf ./$(DEPDIR)
614 -rm -f Makefile
615distclean-am: clean-am distclean-compile distclean-generic \
616 distclean-tags
617
618dvi: dvi-am
619
620dvi-am:
621
622html: html-am
623
624html-am:
625
626info: info-am
627
628info-am:
629
630install-data-am:
631
632install-dvi: install-dvi-am
633
634install-dvi-am:
635
636install-exec-am:
637
638install-html: install-html-am
639
640install-html-am:
641
642install-info: install-info-am
643
644install-info-am:
645
646install-man:
647
648install-pdf: install-pdf-am
649
650install-pdf-am:
651
652install-ps: install-ps-am
653
654install-ps-am:
655
656installcheck-am:
657
658maintainer-clean: maintainer-clean-am
659 -rm -rf ./$(DEPDIR)
660 -rm -f Makefile
661maintainer-clean-am: distclean-am maintainer-clean-generic
662
663mostlyclean: mostlyclean-am
664
665mostlyclean-am: mostlyclean-compile mostlyclean-generic \
666 mostlyclean-libtool
667
668pdf: pdf-am
669
670pdf-am:
671
672ps: ps-am
673
674ps-am:
675
676uninstall-am:
677
678.MAKE: install-am install-strip
679
680.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
681 clean-libtool clean-noinstLTLIBRARIES ctags distclean \
682 distclean-compile distclean-generic distclean-libtool \
683 distclean-tags distdir dvi dvi-am html html-am info info-am \
684 install install-am install-data install-data-am install-dvi \
685 install-dvi-am install-exec install-exec-am install-html \
686 install-html-am install-info install-info-am install-man \
687 install-pdf install-pdf-am install-ps install-ps-am \
688 install-strip installcheck installcheck-am installdirs \
689 maintainer-clean maintainer-clean-generic mostlyclean \
690 mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
691 pdf pdf-am ps ps-am tags uninstall uninstall-am
692
693
694# Tell versions [3.59,3.63) of GNU make to not export all variables.
695# Otherwise a system limit (for SysV at least) may be exceeded.
696.NOEXPORT:
diff --git a/libraries/evas/src/lib/engines/common_8/evas_soft8_dither_mask.c b/libraries/evas/src/lib/engines/common_8/evas_soft8_dither_mask.c
new file mode 100644
index 0000000..c1f3c14
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common_8/evas_soft8_dither_mask.c
@@ -0,0 +1,100 @@
1#include "evas_common_soft8.h"
2
3EFL_ALWAYS_INLINE void
4_soft8_convert_from_rgba_pt(const DATA32 * src, DATA8 * dst, DATA8 * alpha)
5{
6 if (A_VAL(src) == 0)
7 {
8 *dst = 0;
9 *alpha = 0;
10 }
11 else
12 {
13 *dst = GRY_8_FROM_RGB(src);
14 *alpha = A_VAL(src);
15 }
16}
17
18static inline void
19_soft8_convert_from_rgba_scanline(const DATA32 * src, DATA8 * dst,
20 DATA8 * alpha, const int w)
21{
22 int x, m;
23
24 m = (w & ~7);
25 x = 0;
26 pld(src, 0);
27
28 while (x < m)
29 {
30 pld(src, 32);
31 UNROLL8(
32 {
33 _soft8_convert_from_rgba_pt(src, dst, alpha);
34 src++; dst++; alpha++; x++;}
35 );
36 }
37
38 for (; x < w; x++, src++, dst++, alpha++)
39 _soft8_convert_from_rgba_pt(src, dst, alpha);
40}
41
42void
43evas_common_soft8_image_convert_from_rgba(Soft8_Image * im, const DATA32 * src)
44{
45 const DATA32 *sp;
46 DATA8 *dp;
47 DATA8 *ap;
48 unsigned int y;
49
50 sp = src;
51 dp = im->pixels;
52 ap = im->alpha;
53
54 for (y = 0; y < im->cache_entry.h;
55 y++, sp += im->cache_entry.w, dp += im->stride, ap += im->stride)
56 _soft8_convert_from_rgba_scanline(sp, dp, ap, im->cache_entry.w);
57}
58
59EFL_ALWAYS_INLINE void
60_soft8_convert_from_rgb_pt(const DATA32 * src, DATA8 * dst)
61{
62 *dst = GRY_8_FROM_RGB(src);
63}
64
65static inline void
66_soft8_convert_from_rgb_scanline(const DATA32 * src, DATA8 * dst, const int w)
67{
68 int x, m;
69
70 m = (w & ~7);
71 x = 0;
72 pld(src, 0);
73
74 while (x < m)
75 {
76 pld(src, 32);
77 UNROLL8(
78 {
79 _soft8_convert_from_rgb_pt(src, dst); src++; dst++; x++;}
80 );
81 }
82
83 for (; x < w; x++, src++, dst++)
84 _soft8_convert_from_rgb_pt(src, dst);
85}
86
87void
88evas_common_soft8_image_convert_from_rgb(Soft8_Image * im, const DATA32 * src)
89{
90 const DATA32 *sp;
91 DATA8 *dp;
92 unsigned int y;
93
94 sp = src;
95 dp = im->pixels;
96
97 for (y = 0; y < im->cache_entry.h;
98 y++, sp += im->cache_entry.w, dp += im->stride)
99 _soft8_convert_from_rgb_scanline(sp, dp, im->cache_entry.w);
100}
diff --git a/libraries/evas/src/lib/engines/common_8/evas_soft8_font.c b/libraries/evas/src/lib/engines/common_8/evas_soft8_font.c
new file mode 100644
index 0000000..8f69b86
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common_8/evas_soft8_font.c
@@ -0,0 +1,285 @@
1#include "evas_common_soft8.h"
2#include "evas_soft8_scanline_blend.c"
3
4EFL_ALWAYS_INLINE void
5_glyph_pt_mask_solid_solid(DATA8 * dst, const DATA8 gry8, const DATA8 * mask)
6{
7 DATA8 alpha = *mask;
8
9 if (alpha == 0xff)
10 *dst = gry8;
11 else if (alpha > 0)
12 {
13 *dst = GRY_8_BLEND_UNMUL(gry8, *dst, alpha);
14 }
15}
16
17static void
18_glyph_scanline_mask_solid_solid(DATA8 * dst,
19 int size, const DATA8 gry8, const DATA8 * mask)
20{
21 DATA8 *start, *end;
22
23 start = dst;
24 pld(start, 0);
25 pld(mask, 0);
26 end = start + (size & ~3);
27
28 while (start < end)
29 {
30 pld(start, 8);
31 pld(mask, 4);
32 UNROLL4(
33 {
34 _glyph_pt_mask_solid_solid(start, gry8, mask);
35 start++; mask++;}
36 );
37 }
38
39 end = start + (size & 3);
40 for (; start < end; start++, mask++)
41 _glyph_pt_mask_solid_solid(start, gry8, mask);
42}
43
44EFL_ALWAYS_INLINE void
45_glyph_pt_mask_transp_solid(DATA8 * dst,
46 DATA8 gry8, DATA8 alpha, const DATA8 * mask)
47{
48 int rel_alpha;
49
50 rel_alpha = *mask;
51 alpha = (alpha * rel_alpha) >> 8;
52 if (alpha == 0)
53 return;
54
55 alpha++;
56
57 *dst = GRY_8_BLEND((gry8 * rel_alpha) >> 8, *dst, alpha);
58}
59
60static void
61_glyph_scanline_mask_transp_solid(DATA8 * dst,
62 int size,
63 const DATA8 gry8,
64 const DATA8 rel_alpha, const DATA8 * mask)
65{
66 DATA8 *start, *end;
67
68 start = dst;
69 pld(start, 0);
70 pld(mask, 0);
71 end = start + (size & ~3);
72
73 while (start < end)
74 {
75 pld(start, 8);
76 pld(mask, 4);
77 UNROLL4(
78 {
79 _glyph_pt_mask_transp_solid(start, gry8, rel_alpha, mask);
80 start++; mask++;}
81 );
82 }
83
84 end = start + (size & 3);
85 for (; start < end; start++, mask++)
86 _glyph_pt_mask_transp_solid(start, gry8, rel_alpha, mask);
87}
88
89static inline void
90_calc_ext(const Soft8_Image * dst, const RGBA_Draw_Context * dc,
91 Eina_Rectangle * ext)
92{
93 EINA_RECTANGLE_SET(ext, 0, 0, dst->cache_entry.w, dst->cache_entry.h);
94
95 if (dc->clip.use)
96 {
97 int v;
98
99 EINA_RECTANGLE_SET(ext, dc->clip.x, dc->clip.y, dc->clip.w, dc->clip.h);
100 if (ext->x < 0)
101 {
102 ext->w += ext->x;
103 ext->x = 0;
104 }
105 if (ext->y < 0)
106 {
107 ext->h += ext->y;
108 ext->y = 0;
109 }
110
111 v = dst->cache_entry.w - ext->x;
112 if (ext->w > v)
113 ext->w = v;
114
115 v = dst->cache_entry.h - ext->y;
116 if (ext->h > v)
117 ext->h = v;
118 }
119}
120
121static inline void
122_glyph_scanline(Soft8_Image * dst, const DATA8 * p_mask,
123 const Eina_Rectangle ext, int dx, int dy, int max_x, int max_y,
124 int w, DATA8 alpha, const DATA8 gry8)
125{
126 int size, in_x, in_w;
127 DATA8 *p_pixels;
128
129 if ((dx >= max_x) || (dy < ext.y) || (dy >= max_y))
130 return;
131
132 in_x = 0;
133 in_w = 0;
134
135 if (dx + w > max_x)
136 in_w += (dx + w) - max_x;
137
138 if (dx < ext.x)
139 {
140 in_w += ext.x - dx;
141 in_x = ext.x - dx;
142 dx = ext.x;
143 }
144
145 size = w - in_w;
146 p_pixels = dst->pixels + (dy * dst->stride) + dx;
147 p_mask += in_x;
148
149 if (size > 1)
150 {
151 if (alpha == 0xff)
152 _glyph_scanline_mask_solid_solid(p_pixels, size, gry8, p_mask);
153 else if (alpha != 0)
154 _glyph_scanline_mask_transp_solid
155 (p_pixels, size, gry8, alpha, p_mask);
156 }
157 else if (size == 1)
158 {
159 if (alpha == 0xff)
160 _glyph_pt_mask_solid_solid(p_pixels, gry8, p_mask);
161 else if (alpha != 0)
162 _glyph_pt_mask_transp_solid(p_pixels, gry8, alpha, p_mask);
163 }
164}
165
166static void
167_soft8_font_glyph_draw_grayscale(Soft8_Image * dst,
168 RGBA_Draw_Context * dc __UNUSED__,
169 RGBA_Font_Glyph * fg __UNUSED__, int x, int y,
170 DATA8 alpha, DATA8 gry8,
171 const Eina_Rectangle ext, int bw, int bh,
172 int bpitch, const DATA8 * bitmap)
173{
174 int i, max_x, max_y;
175
176 max_x = ext.x + ext.w;
177 max_y = ext.y + ext.h;
178
179 for (i = 0; i < bh; i++, bitmap += bpitch)
180 _glyph_scanline(dst, bitmap, ext, x, y + i, max_x, max_y, bw,
181 alpha, gry8);
182}
183
184static inline void
185_glyph_create_mask_line(DATA8 * mask, const DATA8 * bitmap, int w)
186{
187 const DATA8 bitrepl[2] = { 0x0, 0xff };
188 int i;
189
190 for (i = 0; i < w; i += 8, bitmap++)
191 {
192 int j, size;
193 DATA32 bits;
194
195 if (i + 8 < w)
196 size = 8;
197 else
198 size = w - i;
199
200 bits = *bitmap;
201
202 for (j = size - 1; j >= 0; j--, mask++)
203 *mask = bitrepl[(bits >> j) & 0x1];
204 }
205}
206
207static void
208_soft8_font_glyph_draw_mono(Soft8_Image * dst,
209 RGBA_Draw_Context * dc __UNUSED__,
210 RGBA_Font_Glyph * fg __UNUSED__, int x, int y,
211 DATA8 alpha, DATA8 gry8, const Eina_Rectangle ext,
212 int bw, int bh, int bpitch, const DATA8 * bitmap)
213{
214 DATA8 *mask;
215 int i, max_x, max_y;
216
217 max_x = ext.x + ext.w;
218 max_y = ext.y + ext.h;
219
220 mask = alloca(bpitch);
221 for (i = 0; i < bh; i++, bitmap += bpitch)
222 {
223 _glyph_create_mask_line(mask, bitmap, bw);
224 _glyph_scanline(dst, mask, ext, x, y + i, max_x, max_y, bw,
225 alpha, gry8);
226 }
227}
228
229void
230evas_common_soft8_font_glyph_draw(void *data, void *dest __UNUSED__, void *context,
231 RGBA_Font_Glyph * fg, int x, int y)
232{
233 Soft8_Image *dst;
234 RGBA_Draw_Context *dc;
235 const DATA8 *bitmap;
236 DATA8 alpha; // r, g, b
237 DATA8 gry8;
238 Eina_Rectangle ext;
239 int bpitch, bw, bh;
240
241 dst = data;
242 dc = context;
243
244 alpha = A_VAL(&dc->col.col);
245 if (alpha == 0)
246 return;
247
248 gry8 = GRY_8_FROM_RGB(&dc->col.col);
249
250 /*
251 * if (r > alpha) r = alpha;
252 * if (g > alpha) g = alpha;
253 * if (b > alpha) b = alpha;
254 *
255 * gry8 = GRY_8_FROM_COMPONENTS(r, g, b);
256 */
257
258 bitmap = fg->glyph_out->bitmap.buffer;
259 bh = fg->glyph_out->bitmap.rows;
260 bw = fg->glyph_out->bitmap.width;
261 bpitch = fg->glyph_out->bitmap.pitch;
262 if (bpitch < bw)
263 bpitch = bw;
264
265 _calc_ext(dst, dc, &ext);
266
267 if ((fg->glyph_out->bitmap.num_grays == 256) &&
268 (fg->glyph_out->bitmap.pixel_mode == ft_pixel_mode_grays))
269 _soft8_font_glyph_draw_grayscale(dst, dc, fg, x, y, alpha, gry8,
270 ext, bw, bh, bpitch, bitmap);
271 else
272 _soft8_font_glyph_draw_mono(dst, dc, fg, x, y, alpha, gry8,
273 ext, bw, bh, bpitch, bitmap);
274}
275
276void *
277evas_common_soft8_font_glyph_new(void *data __UNUSED__, RGBA_Font_Glyph * fg __UNUSED__)
278{
279 return (void *)1; /* core requires != NULL to work */
280}
281
282void
283evas_common_soft8_font_glyph_free(void *ext_dat __UNUSED__)
284{
285}
diff --git a/libraries/evas/src/lib/engines/common_8/evas_soft8_image_scaled_sampled.c b/libraries/evas/src/lib/engines/common_8/evas_soft8_image_scaled_sampled.c
new file mode 100644
index 0000000..7344263
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common_8/evas_soft8_image_scaled_sampled.c
@@ -0,0 +1,463 @@
1#include "evas_common_soft8.h"
2#include "evas_soft8_scanline_blend.c"
3
4static void
5_soft8_image_draw_scaled_solid_solid(Soft8_Image * src,
6 Soft8_Image * dst,
7 RGBA_Draw_Context * dc __UNUSED__,
8 int dst_offset, int w, int h,
9 int *offset_x, int *offset_y)
10{
11 DATA8 *dst_itr;
12 int y, w_align;
13
14 w_align = w & ~7;
15
16 dst_itr = dst->pixels + dst_offset;
17 for (y = 0; y < h; y++, dst_itr += dst->stride)
18 {
19 DATA8 *d, *s;
20 int x;
21
22 s = src->pixels + offset_y[y];
23 pld(s, 0);
24 pld(offset_x, 0);
25
26 d = dst_itr;
27 x = 0;
28 while (x < w_align)
29 {
30 pld(s, 32);
31 pld(offset_x + x, 32);
32
33 UNROLL8(
34 {
35 _soft8_pt_blend_solid_solid(d, s[offset_x[x]]); x++; d++;}
36 );
37 }
38
39 for (; x < w; x++, d++)
40 _soft8_pt_blend_solid_solid(d, s[offset_x[x]]);
41 }
42}
43static void
44_soft8_image_draw_scaled_transp_solid(Soft8_Image * src,
45 Soft8_Image * dst,
46 RGBA_Draw_Context * dc __UNUSED__,
47 int dst_offset, int w, int h,
48 int *offset_x, int *offset_y)
49{
50 DATA8 *dst_itr;
51 int y, w_align;
52
53 w_align = w & ~7;
54
55 dst_itr = dst->pixels + dst_offset;
56 for (y = 0; y < h; y++, dst_itr += dst->stride)
57 {
58 DATA8 *d, *s;
59 DATA8 *a;
60 int x;
61
62 s = src->pixels + offset_y[y];
63 a = src->alpha + offset_y[y];
64 pld(s, 0);
65 pld(a, 0);
66 pld(offset_x, 0);
67
68 d = dst_itr;
69 x = 0;
70 while (x < w_align)
71 {
72 pld(s, 32);
73 pld(a, 8);
74 pld(offset_x + x, 32);
75
76 UNROLL8(
77 {
78 int off_x = offset_x[x];
79 _soft8_pt_blend_transp_solid(d, s[off_x], a[off_x]);
80 x++; d++;});
81 }
82
83 for (; x < w; x++, d++)
84 _soft8_pt_blend_transp_solid(d, s[offset_x[x]], a[offset_x[x]]);
85 }
86}
87
88static inline void
89_soft8_image_draw_scaled_no_mul(Soft8_Image * src, Soft8_Image * dst,
90 RGBA_Draw_Context * dc,
91 int dst_offset, int w, int h,
92 int *offset_x, int *offset_y)
93{
94 if ((src->cache_entry.flags.alpha && src->alpha) &&
95 (!dst->cache_entry.flags.alpha))
96 _soft8_image_draw_scaled_transp_solid
97 (src, dst, dc, dst_offset, w, h, offset_x, offset_y);
98 else if (!dst->cache_entry.flags.alpha)
99 _soft8_image_draw_scaled_solid_solid
100 (src, dst, dc, dst_offset, w, h, offset_x, offset_y);
101 else
102 ERR("Unsupported draw of scaled images src->cache_entry.flags.alpha=%d, "
103 "dst->cache_entry.flags.alpha=%d, WITHOUT COLOR MUL",
104 src->cache_entry.flags.alpha, dst->cache_entry.flags.alpha);
105}
106
107static void
108_soft8_image_draw_scaled_solid_solid_mul_alpha(Soft8_Image * src,
109 Soft8_Image * dst,
110 RGBA_Draw_Context *
111 dc __UNUSED__, int dst_offset,
112 int w, int h, int *offset_x,
113 int *offset_y, DATA8 alpha)
114{
115 DATA8 *dst_itr;
116 int y, w_align;
117
118 w_align = w & ~7;
119
120 dst_itr = dst->pixels + dst_offset;
121 for (y = 0; y < h; y++, dst_itr += dst->stride)
122 {
123 DATA8 *d, *s;
124 int x;
125
126 s = src->pixels + offset_y[y];
127 pld(s, 0);
128 pld(offset_x, 0);
129
130 d = dst_itr;
131 x = 0;
132 while (x < w_align)
133 {
134 pld(s, 32);
135 pld(offset_x + x, 32);
136
137 UNROLL8(
138 {
139 _soft8_pt_blend_solid_solid_mul_alpha
140 (d, s[offset_x[x]], alpha); x++; d++;}
141 );
142 }
143
144 for (; x < w; x++, d++)
145 _soft8_pt_blend_solid_solid_mul_alpha(d, s[offset_x[x]], alpha);
146 }
147}
148
149static void
150_soft8_image_draw_scaled_transp_solid_mul_alpha(Soft8_Image * src,
151 Soft8_Image * dst,
152 RGBA_Draw_Context *
153 dc __UNUSED__, int dst_offset,
154 int w, int h, int *offset_x,
155 int *offset_y, DATA8 alpha)
156{
157 DATA8 *dst_itr;
158 int y, w_align;
159
160 w_align = w & ~7;
161
162 dst_itr = dst->pixels + dst_offset;
163 for (y = 0; y < h; y++, dst_itr += dst->stride)
164 {
165 DATA8 *d, *s;
166 DATA8 *a;
167 int x;
168
169 s = src->pixels + offset_y[y];
170 a = src->alpha + offset_y[y];
171 pld(s, 0);
172 pld(a, 0);
173 pld(offset_x, 0);
174
175 d = dst_itr;
176 x = 0;
177 while (x < w_align)
178 {
179 pld(s, 32);
180 pld(a, 8);
181 pld(offset_x + x, 32);
182
183 UNROLL8(
184 {
185 int off_x = offset_x[x];
186 _soft8_pt_blend_transp_solid_mul_alpha
187 (d, s[off_x], a[off_x], alpha); x++; d++;});
188 }
189
190 for (; x < w; x++, d++)
191 _soft8_pt_blend_transp_solid_mul_alpha
192 (d, s[offset_x[x]], a[offset_x[x]], alpha);
193 }
194}
195
196static inline void
197_soft8_image_draw_scaled_mul_alpha(Soft8_Image * src, Soft8_Image * dst,
198 RGBA_Draw_Context * dc,
199 int dst_offset, int w, int h,
200 int *offset_x, int *offset_y, DATA8 a)
201{
202 if ((src->cache_entry.flags.alpha && src->alpha) &&
203 (!dst->cache_entry.flags.alpha))
204 _soft8_image_draw_scaled_transp_solid_mul_alpha
205 (src, dst, dc, dst_offset, w, h, offset_x, offset_y, a);
206 else if (!dst->cache_entry.flags.alpha)
207 _soft8_image_draw_scaled_solid_solid_mul_alpha
208 (src, dst, dc, dst_offset, w, h, offset_x, offset_y, a);
209 else
210 ERR("Unsupported draw of scaled images src->cache_entry.flags.alpha=%d, "
211 "dst->cache_entry.flags.alpha=%d, WITH ALPHA MUL %d",
212 src->cache_entry.flags.alpha, dst->cache_entry.flags.alpha,
213 A_VAL(&dc->mul.col));
214}
215
216static void
217_soft8_image_draw_scaled_solid_solid_mul_color(Soft8_Image * src,
218 Soft8_Image * dst,
219 RGBA_Draw_Context *
220 dc __UNUSED__, int dst_offset,
221 int w, int h, int *offset_x,
222 int *offset_y, DATA8 r, DATA8 g,
223 DATA8 b, DATA8 alpha)
224{
225 DATA8 *dst_itr;
226 int y, w_align;
227
228 w_align = w & ~7;
229
230 dst_itr = dst->pixels + dst_offset;
231
232 if (alpha == 0xff)
233 for (y = 0; y < h; y++, dst_itr += dst->stride)
234 {
235 DATA8 *d, *s;
236 int x;
237
238 s = src->pixels + offset_y[y];
239 pld(s, 0);
240 pld(offset_x, 0);
241
242 d = dst_itr;
243 x = 0;
244 while (x < w_align)
245 {
246 pld(s, 32);
247 pld(offset_x + x, 32);
248
249 UNROLL8(
250 {
251 _soft8_pt_blend_solid_solid_mul_color_solid
252 (d, s[offset_x[x]], r, g, b); x++; d++;}
253 );
254 }
255
256 for (; x < w; x++, d++)
257 _soft8_pt_blend_solid_solid_mul_color_solid
258 (d, s[offset_x[x]], r, g, b);
259 }
260 else
261 for (y = 0; y < h; y++, dst_itr += dst->stride)
262 {
263 DATA8 *d, *s;
264 int x;
265
266 s = src->pixels + offset_y[y];
267 pld(s, 0);
268 pld(offset_x, 0);
269
270 d = dst_itr;
271 x = 0;
272 while (x < w_align)
273 {
274 pld(s, 32);
275 pld(offset_x + x, 32);
276
277 UNROLL8(
278 {
279 _soft8_pt_blend_solid_solid_mul_color_transp
280 (d, s[offset_x[x]], alpha, r, g, b); x++; d++;}
281 );
282 }
283
284 for (; x < w; x++, d++)
285 _soft8_pt_blend_solid_solid_mul_color_transp
286 (d, s[offset_x[x]], alpha, r, g, b);
287 }
288}
289
290static void
291_soft8_image_draw_scaled_transp_solid_mul_color(Soft8_Image * src,
292 Soft8_Image * dst,
293 RGBA_Draw_Context *
294 dc __UNUSED__, int dst_offset,
295 int w, int h, int *offset_x,
296 int *offset_y, DATA8 r, DATA8 g,
297 DATA8 b, DATA8 alpha)
298{
299 DATA8 *dst_itr;
300 int y, w_align;
301
302 w_align = w & ~7;
303
304 dst_itr = dst->pixels + dst_offset;
305
306 if (alpha == 0xff)
307 for (y = 0; y < h; y++, dst_itr += dst->stride)
308 {
309 DATA8 *d, *s;
310 DATA8 *a;
311 int x;
312
313 s = src->pixels + offset_y[y];
314 a = src->alpha + offset_y[y];
315 pld(s, 0);
316 pld(a, 0);
317 pld(offset_x, 0);
318
319 d = dst_itr;
320 x = 0;
321 while (x < w_align)
322 {
323 pld(s, 32);
324 pld(a, 8);
325 pld(offset_x + x, 32);
326
327 UNROLL8(
328 {
329 int off_x = offset_x[x];
330 _soft8_pt_blend_transp_solid_mul_color_solid
331 (d, s[off_x], a[off_x], r, g, b); x++; d++;});
332 }
333
334 for (; x < w; x++, d++)
335 _soft8_pt_blend_transp_solid_mul_color_solid
336 (d, s[offset_x[x]], a[offset_x[x]], r, g, b);
337 }
338 else
339 for (y = 0; y < h; y++, dst_itr += dst->stride)
340 {
341 DATA8 *d, *s;
342 DATA8 *a;
343 int x;
344
345 s = src->pixels + offset_y[y];
346 a = src->alpha + offset_y[y];
347 pld(s, 0);
348 pld(a, 0);
349 pld(offset_x, 0);
350
351 d = dst_itr;
352 x = 0;
353 while (x < w_align)
354 {
355 pld(s, 32);
356 pld(a, 8);
357 pld(offset_x + x, 32);
358
359 UNROLL8(
360 {
361 int off_x = offset_x[x];
362 _soft8_pt_blend_transp_solid_mul_color_transp
363 (d, s[off_x], a[off_x], alpha, r, g, b); x++; d++;});
364 }
365
366 for (; x < w; x++, d++)
367 _soft8_pt_blend_transp_solid_mul_color_transp
368 (d, s[offset_x[x]], a[offset_x[x]], alpha, r, g, b);
369 }
370}
371
372static inline void
373_soft8_image_draw_scaled_mul_color(Soft8_Image * src, Soft8_Image * dst,
374 RGBA_Draw_Context * dc,
375 int dst_offset, int w, int h,
376 int *offset_x, int *offset_y,
377 DATA8 r, DATA8 g, DATA8 b, DATA8 a)
378{
379 if ((src->cache_entry.flags.alpha && src->alpha) &&
380 (!dst->cache_entry.flags.alpha))
381 _soft8_image_draw_scaled_transp_solid_mul_color
382 (src, dst, dc, dst_offset, w, h, offset_x, offset_y, r, g, b, a);
383 else if (!dst->cache_entry.flags.alpha)
384 _soft8_image_draw_scaled_solid_solid_mul_color
385 (src, dst, dc, dst_offset, w, h, offset_x, offset_y, r, g, b, a);
386 else
387 ERR("Unsupported draw of scaled images src->cache_entry.flags.alpha=%d, "
388 "dst->cache_entry.flags.alpha=%d, WITH COLOR MUL 0x%08x",
389 src->cache_entry.flags.alpha, dst->cache_entry.flags.alpha,
390 dc->mul.col);
391}
392
393static inline void
394_soft8_image_draw_scaled_mul(Soft8_Image * src, Soft8_Image * dst,
395 RGBA_Draw_Context * dc,
396 int dst_offset, int w, int h,
397 int *offset_x, int *offset_y, DATA8 r, DATA8 g,
398 DATA8 b, DATA8 a)
399{
400 if ((a == r) && (a == g) && (a == b))
401 _soft8_image_draw_scaled_mul_alpha
402 (src, dst, dc, dst_offset, w, h, offset_x, offset_y, a);
403 else
404 _soft8_image_draw_scaled_mul_color
405 (src, dst, dc, dst_offset, w, h, offset_x, offset_y, r, g, b, a);
406}
407
408void
409evas_common_soft8_image_draw_scaled_sampled(Soft8_Image * src, Soft8_Image * dst,
410 RGBA_Draw_Context * dc,
411 const Eina_Rectangle sr,
412 const Eina_Rectangle dr,
413 const Eina_Rectangle cr)
414{
415 int x, y, dst_offset, *offset_x, *offset_y;
416 DATA8 mul_gry8;
417 DATA8 r, g, b, a;
418
419 if (!dc->mul.use)
420 {
421 r = g = b = a = 0xff;
422 mul_gry8 = 0xff;
423 }
424 else
425 {
426 a = A_VAL(&dc->mul.col);
427 if (a == 0)
428 return;
429
430 r = R_VAL(&dc->mul.col);
431 g = G_VAL(&dc->mul.col);
432 b = B_VAL(&dc->mul.col);
433
434 if (r > a)
435 r = a;
436 if (g > a)
437 g = a;
438 if (b > a)
439 b = a;
440
441 mul_gry8 = GRY_8_FROM_COMPONENTS(r, g, b);
442 }
443
444 /* pre-calculated scale tables */
445 offset_x = alloca(cr.w * sizeof(*offset_x));
446 for (x = 0; x < cr.w; x++)
447 offset_x[x] = (((x + cr.x - dr.x) * sr.w) / dr.w) + sr.x;
448
449 offset_y = alloca(cr.h * sizeof(*offset_y));
450 for (y = 0; y < cr.h; y++)
451 offset_y[y] = (((((y + cr.y - dr.y) * sr.h) / dr.h) + sr.y)
452 * src->stride);
453
454 dst_offset = cr.x + (cr.y * dst->stride);
455
456 if (mul_gry8 == 0xff)
457 _soft8_image_draw_scaled_no_mul
458 (src, dst, dc, dst_offset, cr.w, cr.h, offset_x, offset_y);
459 else
460 _soft8_image_draw_scaled_mul
461 (src, dst, dc, dst_offset, cr.w, cr.h, offset_x, offset_y, r, g, b,
462 a);
463}
diff --git a/libraries/evas/src/lib/engines/common_8/evas_soft8_image_unscaled.c b/libraries/evas/src/lib/engines/common_8/evas_soft8_image_unscaled.c
new file mode 100644
index 0000000..6f4e76b
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common_8/evas_soft8_image_unscaled.c
@@ -0,0 +1,284 @@
1#include "evas_common_soft8.h"
2#include "evas_soft8_scanline_blend.c"
3
4static void
5_soft8_image_draw_unscaled_solid_solid(Soft8_Image * src, Soft8_Image * dst,
6 RGBA_Draw_Context * dc __UNUSED__,
7 int src_offset, int dst_offset,
8 int w, int h)
9{
10 DATA8 *src_itr, *dst_itr;
11 int y;
12
13 src_itr = src->pixels + src_offset;
14 dst_itr = dst->pixels + dst_offset;
15
16 for (y = 0; y < h; y++)
17 {
18 _soft8_scanline_blend_solid_solid(src_itr, dst_itr, w);
19 src_itr += src->stride;
20 dst_itr += dst->stride;
21 }
22}
23
24static void
25_soft8_image_draw_unscaled_transp_solid(Soft8_Image * src, Soft8_Image * dst,
26 RGBA_Draw_Context * dc __UNUSED__,
27 int src_offset, int dst_offset,
28 int w, int h)
29{
30 DATA8 *src_itr, *dst_itr;
31 DATA8 *alpha_itr;
32 int y;
33
34 src_itr = src->pixels + src_offset;
35 alpha_itr = src->alpha + src_offset;
36 dst_itr = dst->pixels + dst_offset;
37
38 for (y = 0; y < h; y++)
39 {
40 _soft8_scanline_blend_transp_solid(src_itr, alpha_itr, dst_itr, w);
41 src_itr += src->stride;
42 alpha_itr += src->stride;
43 dst_itr += dst->stride;
44 }
45}
46
47static inline void
48_soft8_image_draw_unscaled_no_mul(Soft8_Image * src, Soft8_Image * dst,
49 RGBA_Draw_Context * dc,
50 int src_offset, int dst_offset,
51 int width, int height)
52{
53 if (src->cache_entry.flags.alpha && (!dst->cache_entry.flags.alpha))
54 _soft8_image_draw_unscaled_transp_solid(src, dst, dc,
55 src_offset, dst_offset,
56 width, height);
57 else if ((!src->cache_entry.flags.alpha) && (!dst->cache_entry.flags.alpha))
58 _soft8_image_draw_unscaled_solid_solid(src, dst, dc,
59 src_offset, dst_offset,
60 width, height);
61 else
62 ERR("Unsupported draw of unscaled images src->cache_entry.flags.alpha=%d, "
63 "dst->cache_entry.flags.alpha=%d, WITHOUT COLOR MUL",
64 src->cache_entry.flags.alpha, dst->cache_entry.flags.alpha);
65}
66
67static void
68_soft8_image_draw_unscaled_solid_solid_mul_alpha(Soft8_Image * src,
69 Soft8_Image * dst,
70 RGBA_Draw_Context *
71 dc __UNUSED__, int src_offset,
72 int dst_offset, int w, int h,
73 DATA8 a)
74{
75 DATA8 *src_itr, *dst_itr;
76 int y;
77
78 src_itr = src->pixels + src_offset;
79 dst_itr = dst->pixels + dst_offset;
80
81 for (y = 0; y < h; y++)
82 {
83 _soft8_scanline_blend_solid_solid_mul_alpha(src_itr, dst_itr, w, a);
84 src_itr += src->stride;
85 dst_itr += dst->stride;
86 }
87}
88
89static void
90_soft8_image_draw_unscaled_transp_solid_mul_alpha(Soft8_Image * src,
91 Soft8_Image * dst,
92 RGBA_Draw_Context *
93 dc __UNUSED__, int src_offset,
94 int dst_offset, int w, int h,
95 DATA8 a)
96{
97 DATA8 *src_itr, *dst_itr;
98 DATA8 *alpha_itr;
99 int y;
100
101 src_itr = src->pixels + src_offset;
102 alpha_itr = src->alpha + src_offset;
103 dst_itr = dst->pixels + dst_offset;
104
105 for (y = 0; y < h; y++)
106 {
107 _soft8_scanline_blend_transp_solid_mul_alpha(src_itr, alpha_itr,
108 dst_itr, w, a);
109 src_itr += src->stride;
110 alpha_itr += src->stride;
111 dst_itr += dst->stride;
112 }
113}
114
115static inline void
116_soft8_image_draw_unscaled_mul_alpha(Soft8_Image * src, Soft8_Image * dst,
117 RGBA_Draw_Context * dc,
118 int src_offset, int dst_offset,
119 int width, int height, DATA8 a)
120{
121 if (src->cache_entry.flags.alpha && (!dst->cache_entry.flags.alpha))
122 _soft8_image_draw_unscaled_transp_solid_mul_alpha
123 (src, dst, dc, src_offset, dst_offset, width, height, a);
124 else if ((!src->cache_entry.flags.alpha) && (!dst->cache_entry.flags.alpha))
125 _soft8_image_draw_unscaled_solid_solid_mul_alpha
126 (src, dst, dc, src_offset, dst_offset, width, height, a);
127 else
128 ERR("Unsupported draw of unscaled images src->cache_entry.flags.alpha=%d, "
129 "dst->cache_entry.flags.alpha=%d, WITH ALPHA MUL %d",
130 src->cache_entry.flags.alpha, dst->cache_entry.flags.alpha, A_VAL(&dc->mul.col));
131}
132
133static void
134_soft8_image_draw_unscaled_solid_solid_mul_color(Soft8_Image * src,
135 Soft8_Image * dst,
136 RGBA_Draw_Context *
137 dc __UNUSED__, int src_offset,
138 int dst_offset, int w, int h,
139 DATA8 r, DATA8 g, DATA8 b,
140 DATA8 a)
141{
142 DATA8 *src_itr, *dst_itr;
143 int y;
144
145 src_itr = src->pixels + src_offset;
146 dst_itr = dst->pixels + dst_offset;
147
148 if (a == 0xff)
149 for (y = 0; y < h; y++)
150 {
151 _soft8_scanline_blend_solid_solid_mul_color_solid
152 (src_itr, dst_itr, w, r, g, b);
153 src_itr += src->stride;
154 dst_itr += dst->stride;
155 }
156 else
157 for (y = 0; y < h; y++)
158 {
159 _soft8_scanline_blend_solid_solid_mul_color_transp
160 (src_itr, dst_itr, w, a, r, g, b);
161 src_itr += src->stride;
162 dst_itr += dst->stride;
163 }
164}
165
166static void
167_soft8_image_draw_unscaled_transp_solid_mul_color(Soft8_Image * src,
168 Soft8_Image * dst,
169 RGBA_Draw_Context *
170 dc __UNUSED__, int src_offset,
171 int dst_offset, int w, int h,
172 DATA8 r, DATA8 g, DATA8 b,
173 DATA8 a)
174{
175 DATA8 *src_itr, *dst_itr;
176 DATA8 *alpha_itr;
177 int y;
178
179 src_itr = src->pixels + src_offset;
180 alpha_itr = src->alpha + src_offset;
181 dst_itr = dst->pixels + dst_offset;
182
183 if (a == 0xff)
184 for (y = 0; y < h; y++)
185 {
186 _soft8_scanline_blend_transp_solid_mul_color_solid
187 (src_itr, alpha_itr, dst_itr, w, r, g, b);
188 src_itr += src->stride;
189 alpha_itr += src->stride;
190 dst_itr += dst->stride;
191 }
192 else
193 for (y = 0; y < h; y++)
194 {
195 _soft8_scanline_blend_transp_solid_mul_color_transp
196 (src_itr, alpha_itr, dst_itr, w, a, r, g, b);
197 src_itr += src->stride;
198 alpha_itr += src->stride;
199 dst_itr += dst->stride;
200 }
201}
202
203static inline void
204_soft8_image_draw_unscaled_mul_color(Soft8_Image * src, Soft8_Image * dst,
205 RGBA_Draw_Context * dc,
206 int src_offset, int dst_offset,
207 int width, int height,
208 DATA8 r, DATA8 g, DATA8 b, DATA8 a)
209{
210 if (src->cache_entry.flags.alpha && (!dst->cache_entry.flags.alpha))
211 _soft8_image_draw_unscaled_transp_solid_mul_color
212 (src, dst, dc, src_offset, dst_offset, width, height, r, g, b, a);
213 else if ((!src->cache_entry.flags.alpha) && (!dst->cache_entry.flags.alpha))
214 _soft8_image_draw_unscaled_solid_solid_mul_color
215 (src, dst, dc, src_offset, dst_offset, width, height, r, g, b, a);
216 else
217 ERR("Unsupported draw of unscaled images src->cache_entry.flags.alpha=%d, "
218 "dst->cache_entry.flags.alpha=%d, WITH COLOR MUL 0x%08x",
219 src->cache_entry.flags.alpha, dst->cache_entry.flags.alpha, dc->mul.col);
220}
221
222static inline void
223_soft8_image_draw_unscaled_mul(Soft8_Image * src, Soft8_Image * dst,
224 RGBA_Draw_Context * dc,
225 int src_offset, int dst_offset,
226 int width, int height, DATA8 r, DATA8 g,
227 DATA8 b, DATA8 a)
228{
229 if ((a == r) && (a == g) && (a == b))
230 _soft8_image_draw_unscaled_mul_alpha(src, dst, dc, src_offset,
231 dst_offset, width, height, a);
232 else
233 _soft8_image_draw_unscaled_mul_color(src, dst, dc, src_offset,
234 dst_offset, width, height,
235 r, g, b, a);
236}
237
238void
239evas_common_soft8_image_draw_unscaled(Soft8_Image * src, Soft8_Image * dst,
240 RGBA_Draw_Context * dc,
241 const Eina_Rectangle sr,
242 const Eina_Rectangle dr, const Eina_Rectangle cr)
243{
244 int src_offset_rows, src_offset, dst_offset;
245 DATA8 mul_gry8;
246 DATA8 r, g, b, a;
247
248 if (!dc->mul.use)
249 {
250 r = g = b = a = 0xff;
251 mul_gry8 = 0xff;
252 }
253 else
254 {
255 a = A_VAL(&dc->mul.col);
256 if (a == 0)
257 return;
258
259 r = R_VAL(&dc->mul.col);
260 g = G_VAL(&dc->mul.col);
261 b = B_VAL(&dc->mul.col);
262
263 if (r > a)
264 r = a;
265 if (g > a)
266 g = a;
267 if (b > a)
268 b = a;
269
270 mul_gry8 = GRY_8_FROM_COMPONENTS(r, g, b);
271 }
272
273 src_offset_rows = (cr.y - dr.y) + sr.y;
274 src_offset = (src_offset_rows * src->stride) + (cr.x - dr.x) + sr.x;
275
276 dst_offset = cr.x + (cr.y * dst->stride);
277
278 if (mul_gry8 == 0xff)
279 _soft8_image_draw_unscaled_no_mul(src, dst, dc, src_offset, dst_offset,
280 cr.w, cr.h);
281 else
282 _soft8_image_draw_unscaled_mul(src, dst, dc, src_offset, dst_offset,
283 cr.w, cr.h, r, g, b, a);
284}
diff --git a/libraries/evas/src/lib/engines/common_8/evas_soft8_line.c b/libraries/evas/src/lib/engines/common_8/evas_soft8_line.c
new file mode 100644
index 0000000..6ec2d22
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common_8/evas_soft8_line.c
@@ -0,0 +1,426 @@
1#include "evas_common_soft8.h"
2#include "evas_soft8_scanline_fill.c"
3
4/*
5 * All functions except by evas_common_soft8_line_draw() expect x0 <= x1.
6 */
7
8static inline int
9_in_range(int value, int min, int max)
10{
11 return min <= value && value <= max;
12}
13
14static inline int
15_is_xy_inside_clip(int x, int y, const struct RGBA_Draw_Context_clip clip)
16{
17 if (!clip.use)
18 return 1;
19
20 if (!_in_range(x, clip.x, clip.x + clip.w - 1))
21 return 0;
22
23 if (!_in_range(y, clip.y, clip.y + clip.h - 1))
24 return 0;
25
26 return 1;
27}
28
29static inline int
30_is_x_inside_clip(int x, const struct RGBA_Draw_Context_clip clip)
31{
32 if (!clip.use)
33 return 1;
34
35 return _in_range(x, clip.x, clip.x + clip.w - 1);
36}
37
38static inline int
39_is_y_inside_clip(int y, const struct RGBA_Draw_Context_clip clip)
40{
41 if (!clip.use)
42 return 1;
43
44 return _in_range(y, clip.y, clip.y + clip.h - 1);
45}
46
47static inline int
48_is_xy_inside_rect(int x, int y, int w, int h)
49{
50 return _in_range(x, 0, w - 1) && _in_range(y, 0, h - 1);
51}
52
53static inline int
54_is_empty_clip(const struct RGBA_Draw_Context_clip clip)
55{
56 return clip.w < 1 || clip.h < 1;
57}
58
59static void
60_soft8_line_point(Soft8_Image * dst, RGBA_Draw_Context * dc, int x, int y)
61{
62 DATA8 gry8, *dst_itr;
63 DATA8 alpha;
64
65 if (!_is_xy_inside_rect(x, y, dst->cache_entry.w, dst->cache_entry.h))
66 return;
67
68 if (!_is_xy_inside_clip(x, y, dc->clip))
69 return;
70
71 dst_itr = dst->pixels + (dst->stride * y) + x;
72 alpha = A_VAL(&dc->col.col);
73 gry8 = GRY_8_FROM_RGB(&dc->col.col);
74
75 if (alpha == 0xff)
76 _soft8_pt_fill_solid_solid(dst_itr, gry8);
77 else if (alpha > 0)
78 {
79 alpha++;
80 _soft8_pt_fill_transp_solid(dst_itr, gry8, alpha);
81 }
82}
83
84static void
85_soft8_line_horiz(Soft8_Image * dst, RGBA_Draw_Context * dc, int x0, int x1,
86 int y)
87{
88 DATA8 gry8, *dst_itr;
89 DATA8 alpha;
90 int w;
91
92 if (!_is_y_inside_clip(y, dc->clip))
93 return;
94
95 if (x0 < dc->clip.x)
96 x0 = dc->clip.x;
97
98 if (x1 >= dc->clip.x + dc->clip.w)
99 x1 = dc->clip.x + dc->clip.w - 1;
100
101 w = x1 - x0;
102 if (w < 1)
103 return;
104
105 dst_itr = dst->pixels + (dst->stride * y) + x0;
106 alpha = A_VAL(&dc->col.col);
107 gry8 = GRY_8_FROM_RGB(&dc->col.col);
108
109 if (alpha == 0xff)
110 _soft8_scanline_fill_solid_solid(dst_itr, w, gry8);
111 else if (alpha > 0)
112 {
113 alpha++;
114 _soft8_scanline_fill_transp_solid(dst_itr, w, gry8, alpha);
115 }
116}
117
118static void
119_soft8_line_vert(Soft8_Image * dst, RGBA_Draw_Context * dc, int x, int y0,
120 int y1)
121{
122 DATA8 gry8, *dst_itr;
123 DATA8 alpha;
124 int h;
125
126 if (!_is_x_inside_clip(x, dc->clip))
127 return;
128
129 if (y1 < y0)
130 {
131 int t;
132 t = y0;
133 y0 = y1;
134 y1 = t;
135 }
136
137 if (y0 < dc->clip.y)
138 y0 = dc->clip.y;
139
140 if (y1 >= dc->clip.y + dc->clip.h)
141 y1 = dc->clip.y + dc->clip.h - 1;
142
143 h = y1 - y0;
144 if (h < 1)
145 return;
146
147 dst_itr = dst->pixels + (dst->stride * y0) + x;
148 alpha = A_VAL(&dc->col.col);
149 gry8 = GRY_8_FROM_RGB(&dc->col.col);
150
151 if (alpha == 0xff)
152 {
153 for (; h > 0; h--, dst_itr += dst->stride)
154 _soft8_pt_fill_solid_solid(dst_itr, gry8);
155 }
156 else if (alpha > 0)
157 {
158 alpha++;
159
160 for (; h > 0; h--, dst_itr += dst->stride)
161 _soft8_pt_fill_transp_solid(dst_itr, gry8, alpha);
162 }
163}
164
165static inline void
166_soft8_line_45deg_adjust_boundaries(const struct RGBA_Draw_Context_clip clip,
167 int *p_x0, int *p_y0, int *p_x1, int *p_y1)
168{
169 int diff, dy, x0, y0, x1, y1;
170
171 x0 = *p_x0;
172 y0 = *p_y0;
173 x1 = *p_x1;
174 y1 = *p_y1;
175
176 dy = y1 - y0;
177
178 diff = clip.x - x0;
179 if (diff > 0)
180 {
181 x0 = clip.x;
182 y0 += (dy > 0) ? diff : -diff;
183 }
184
185 diff = x1 - (clip.x + clip.w);
186 if (diff > 0)
187 {
188 x1 = clip.x + clip.w;
189 y1 += (dy > 0) ? -diff : diff;
190 }
191
192 if (dy > 0)
193 {
194 diff = clip.y - y0;
195 if (diff > 0)
196 {
197 y0 = clip.y;
198 x0 += diff;
199 }
200
201 diff = y1 - (clip.y + clip.h);
202 if (diff > 0)
203 {
204 y1 = clip.y + clip.h;
205 x1 -= diff;
206 }
207 }
208 else
209 {
210 diff = clip.y - y1;
211 if (diff > 0)
212 {
213 y1 = clip.y;
214 x1 -= diff;
215 }
216
217 diff = y0 - (clip.y + clip.h - 1);
218 if (diff > 0)
219 {
220 y0 = clip.y + clip.h - 1;
221 x0 += diff;
222 }
223 }
224
225 *p_x0 = x0;
226 *p_y0 = y0;
227 *p_x1 = x1;
228 *p_y1 = y1;
229}
230
231static void
232_soft8_line_45deg(Soft8_Image * dst, RGBA_Draw_Context * dc, int x0, int y0,
233 int x1, int y1)
234{
235 int dy, step_dst_itr, len;
236 DATA8 alpha;
237 DATA8 *dst_itr, gry8;
238
239 alpha = A_VAL(&dc->col.col);
240 if (alpha < 1)
241 return;
242
243 gry8 = GRY_8_FROM_RGB(&dc->col.col);
244
245 dy = y1 - y0;
246 step_dst_itr = 1 + ((dy > 0) ? dst->stride : -dst->stride);
247
248 _soft8_line_45deg_adjust_boundaries(dc->clip, &x0, &y0, &x1, &y1);
249
250 len = (dy > 0) ? (y1 - y0) : (y0 - y1);
251 if (len < 1)
252 return;
253
254 dst_itr = dst->pixels + dst->stride * y0 + x0;
255 if (alpha == 0xff)
256 {
257 for (; len > 0; len--, dst_itr += step_dst_itr)
258 _soft8_pt_fill_solid_solid(dst_itr, gry8);
259 }
260 else
261 {
262 alpha++;
263 for (; len > 0; len--, dst_itr += step_dst_itr)
264 _soft8_pt_fill_transp_solid(dst_itr, gry8, alpha);
265 }
266}
267
268EFL_ALWAYS_INLINE void
269_soft8_line_aliased_pt(DATA8 * dst_itr, DATA8 gry8, DATA8 alpha)
270{
271 if (alpha == 32)
272 _soft8_pt_fill_solid_solid(dst_itr, gry8);
273 else
274 _soft8_pt_fill_transp_solid(dst_itr, gry8, alpha);
275}
276
277static void
278_soft8_line_aliased(Soft8_Image * dst, RGBA_Draw_Context * dc, int x0, int y0,
279 int x1, int y1)
280{
281 int dx, dy, step_y, step_dst_itr;
282 DATA8 gry8;
283 DATA8 alpha;
284
285 alpha = A_VAL(&dc->col.col);
286 if (alpha == 0)
287 return;
288 alpha++;
289
290 gry8 = GRY_8_FROM_RGB(&dc->col.col);
291
292 dx = x1 - x0;
293 dy = y1 - y0;
294
295 if (dy >= 0)
296 {
297 step_y = 1;
298 step_dst_itr = dst->stride;
299 }
300 else
301 {
302 dy = -dy;
303 step_y = -1;
304 step_dst_itr = -dst->stride;
305 }
306
307 if (dx > dy)
308 {
309 DATA8 *dst_itr;
310 int e, x, y;
311
312 e = -(dx / 2);
313 y = y0;
314 dst_itr = dst->pixels + dst->stride * y0 + x0;
315 for (x = x0; x <= x1; x++, dst_itr++)
316 {
317 if (_is_xy_inside_clip(x, y, dc->clip))
318 _soft8_line_aliased_pt(dst_itr, gry8, alpha);
319
320 e += dy;
321 if (e >= 0)
322 {
323 dst_itr += step_dst_itr;
324 y += step_y;
325 e -= dx;
326 }
327 }
328 }
329 else
330 {
331 DATA8 *dst_itr;
332 int e, x, y;
333
334 e = -(dy / 2);
335 x = x0;
336 dst_itr = dst->pixels + dst->stride * y0 + x0;
337 for (y = y0; y != y1; y += step_y, dst_itr += step_dst_itr)
338 {
339 if (_is_xy_inside_clip(x, y, dc->clip))
340 _soft8_line_aliased_pt(dst_itr, gry8, alpha);
341
342 e += dx;
343 if (e >= 0)
344 {
345 dst_itr++;
346 x++;
347 e -= dy;
348 }
349 }
350 }
351}
352
353void
354evas_common_soft8_line_draw(Soft8_Image * dst, RGBA_Draw_Context * dc, int x0, int y0,
355 int x1, int y1)
356{
357 struct RGBA_Draw_Context_clip c_bkp, c_tmp;
358 int dx, dy;
359 int x, y, w, h;
360
361 c_tmp.use = 1;
362 c_tmp.x = 0;
363 c_tmp.y = 0;
364 c_tmp.w = dst->cache_entry.w;
365 c_tmp.h = dst->cache_entry.h;
366
367 /* save out clip info */
368 c_bkp = dc->clip;
369 if (c_bkp.use)
370 {
371 RECTS_CLIP_TO_RECT(c_tmp.x, c_tmp.y, c_tmp.w, c_tmp.h,
372 c_bkp.x, c_bkp.y, c_bkp.w, c_bkp.h);
373 if (_is_empty_clip(c_tmp))
374 return;
375 }
376
377 x = MIN(x0, x1);
378 y = MIN(y0, y1);
379 w = MAX(x0, x1) - x + 1;
380 h = MAX(y0, y1) - y + 1;
381
382 RECTS_CLIP_TO_RECT(c_tmp.x, c_tmp.y, c_tmp.w, c_tmp.h, x, y, w, h);
383 if (_is_empty_clip(c_tmp))
384 return;
385
386 /* Check if the line doesn't cross the clip area */
387 if (x0 < c_tmp.x && x1 < c_tmp.x)
388 return;
389 if (x0 >= c_tmp.x + c_tmp.w && x1 >= c_tmp.x + c_tmp.w)
390 return;
391 if (y0 < c_tmp.y && y1 < c_tmp.y)
392 return;
393 if (y0 >= c_tmp.y + c_tmp.h && y1 >= c_tmp.y + c_tmp.h)
394 return;
395
396 dc->clip = c_tmp;
397 dx = x1 - x0;
398 dy = y1 - y0;
399
400 if (dx < 0)
401 {
402 int t;
403
404 t = x0;
405 x0 = x1;
406 x1 = t;
407
408 t = y0;
409 y0 = y1;
410 y1 = t;
411 }
412
413 if (dx == 0 && dy == 0)
414 _soft8_line_point(dst, dc, x0, y0);
415 else if (dx == 0)
416 _soft8_line_vert(dst, dc, x0, y0, y1);
417 else if (dy == 0)
418 _soft8_line_horiz(dst, dc, x0, x1, y0);
419 else if (dy == dx || dy == -dx)
420 _soft8_line_45deg(dst, dc, x0, y0, x1, y1);
421 else
422 _soft8_line_aliased(dst, dc, x0, y0, x1, y1);
423
424 /* restore clip info */
425 dc->clip = c_bkp;
426}
diff --git a/libraries/evas/src/lib/engines/common_8/evas_soft8_main.c b/libraries/evas/src/lib/engines/common_8/evas_soft8_main.c
new file mode 100644
index 0000000..cc4ce25
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common_8/evas_soft8_main.c
@@ -0,0 +1,656 @@
1#include "evas_common_soft8.h"
2
3static Evas_Cache_Image *eci = NULL;
4static int reference = 0;
5
6static Image_Entry *_evas_common_soft8_image_new(void);
7static void _evas_common_soft8_image_delete(Image_Entry * ie);
8
9static int _evas_common_soft8_image_surface_alloc(Image_Entry * ie, unsigned int w, unsigned int h);
10static void _evas_common_soft8_image_surface_delete(Image_Entry * ie);
11static DATA32 *_evas_common_soft8_image_surface_pixels(Image_Entry * ie);
12
13static int _evas_common_load_soft8_image_from_file(Image_Entry * ie);
14static void _evas_common_soft8_image_unload(Image_Entry * ie);
15
16static void _evas_common_soft8_image_dirty_region(Image_Entry * im, unsigned int x, unsigned int y, unsigned int w, unsigned int h);
17static int _evas_common_soft8_image_dirty(Image_Entry * ie_dst,
18 const Image_Entry * ie_src);
19
20static int _evas_common_soft8_image_ram_usage(Image_Entry * ie);
21
22static int _evas_common_soft8_image_size_set(Image_Entry * ie_dst,
23 const Image_Entry * ie_im, unsigned int w, unsigned int h);
24static int _evas_common_soft8_image_from_copied_data(Image_Entry * ie_dst, unsigned int w, unsigned int h, DATA32 * image_data, int alpha, int cspace);
25static int _evas_common_soft8_image_from_data(Image_Entry * ie_dst, unsigned int w, unsigned int h, DATA32 * image_data, int alpha, int cspace);
26static int _evas_common_soft8_image_colorspace_set(Image_Entry * ie_dst,
27 int cspace);
28
29static int _evas_common_load_soft8_image_data_from_file(Image_Entry * ie);
30
31/*
32static void
33_evas_common_soft8_image_debug(const char* context, Image_Entry *eim)
34{
35 DBG("[8] %p = [%s] {%s,%s} %i [%i|%i]", eim, context, eim->file, eim->key, eim->references, eim->w, eim->h);
36}
37*/
38
39static const Evas_Cache_Image_Func _evas_common_soft8_image_func = {
40 _evas_common_soft8_image_new,
41 _evas_common_soft8_image_delete,
42 _evas_common_soft8_image_surface_alloc,
43 _evas_common_soft8_image_surface_delete,
44 _evas_common_soft8_image_surface_pixels,
45 _evas_common_load_soft8_image_from_file,
46 _evas_common_soft8_image_unload,
47 _evas_common_soft8_image_dirty_region,
48 _evas_common_soft8_image_dirty,
49 _evas_common_soft8_image_size_set,
50 _evas_common_soft8_image_from_copied_data,
51 _evas_common_soft8_image_from_data,
52 _evas_common_soft8_image_colorspace_set,
53 _evas_common_load_soft8_image_data_from_file,
54 _evas_common_soft8_image_ram_usage,
55/* _evas_common_soft8_image_debug */
56 NULL
57};
58
59EAPI void
60evas_common_soft8_image_init(void)
61{
62 if (!eci)
63 eci = evas_cache_image_init(&_evas_common_soft8_image_func);
64 reference++;
65}
66
67EAPI void
68evas_common_soft8_image_shutdown(void)
69{
70 if (--reference == 0)
71 {
72// DISABLE for now - something wrong with cache shutdown freeing things
73// still in use - rage_thumb segv's now.
74//
75// actually - i think i see it. cache ref goes to 0 (and thus gets freed)
76// because in eng_setup() when a buffer changes size it is FIRST freed
77// THEN allocated again - thus brignhjing ref to 0 then back to 1 immediately
78// where it should stay at 1. - see evas_engine.c in the buffer enigne for
79// example. eng_output_free() is called BEFORE _output_setup(). although this
80// is only a SIGNE of the problem. we can patch this up with either freeing
81// after the setup (so we just pt a ref of 2 then back to 1), or just
82// evas_common_image_init() at the start and evas_common_image_shutdown()
83// after it all. really ref 0 should only be reached when no more canvases
84// with no more objects exist anywhere.
85
86// ENABLE IT AGAIN, hope it is fixed. Gustavo @ January 22nd, 2009.
87 //evas_cache_image_shutdown(eci);
88 //eci = NULL;
89 }
90}
91
92EAPI Evas_Cache_Image *
93evas_common_soft8_image_cache_get(void)
94{
95 return eci;
96}
97
98static Image_Entry *
99_evas_common_soft8_image_new(void)
100{
101 Soft8_Image *im;
102
103 im = calloc(1, sizeof(Soft8_Image));
104 if (!im)
105 return NULL;
106
107 im->stride = -1;
108
109 return (Image_Entry *) im;
110}
111
112static void
113_evas_common_soft8_image_delete(Image_Entry * ie)
114{
115 memset(ie, 0xFF, sizeof(Soft8_Image));
116 free(ie);
117}
118
119static int
120_evas_common_soft8_image_surface_alloc(Image_Entry * ie, unsigned int w, unsigned int h)
121{
122 Soft8_Image *im = (Soft8_Image *) ie;
123
124 if (im->stride < 0)
125 im->stride = _calc_stride(w);
126
127 im->pixels =
128 realloc(im->pixels, IMG_BYTE_SIZE(im->stride, h, ie->flags.alpha));
129 if (!im->pixels)
130 return -1;
131
132 if (ie->flags.alpha)
133 {
134 im->alpha = (DATA8 *) (im->pixels + (im->stride * h));
135 im->flags.free_alpha = 0;
136 }
137 im->flags.free_pixels = 1;
138
139 return 0;
140}
141
142static void
143_evas_common_soft8_image_surface_delete(Image_Entry * ie)
144{
145 Soft8_Image *im = (Soft8_Image *) ie;
146
147 if (im->flags.free_pixels)
148 free(im->pixels);
149 im->pixels = NULL;
150 im->flags.free_pixels = 0;
151
152 if (im->flags.free_alpha)
153 free(im->alpha);
154 im->alpha = NULL;
155 im->flags.free_alpha = 0;
156}
157
158static DATA32 *
159_evas_common_soft8_image_surface_pixels(Image_Entry * ie __UNUSED__)
160{
161 abort();
162
163 return NULL;
164}
165
166static int
167_evas_common_load_soft8_image_from_file(Image_Entry * ie)
168{
169 Soft8_Image *sim = (Soft8_Image *) ie;
170 RGBA_Image *im;
171 int error = 0;
172
173 im = (RGBA_Image *) evas_cache_image_request(evas_common_image_cache_get(),
174 sim->cache_entry.file,
175 sim->cache_entry.key,
176 &sim->cache_entry.load_opts,
177 &error);
178 sim->source = im;
179 if (!sim->source)
180 return -1;
181
182 sim->cache_entry.w = sim->source->cache_entry.w;
183 sim->cache_entry.h = sim->source->cache_entry.h;
184 ie->flags.alpha = im->cache_entry.flags.alpha;
185 if (sim->stride < 0)
186 sim->stride = _calc_stride(sim->cache_entry.w);
187
188 return 0;
189}
190
191static void
192_evas_common_soft8_image_unload(Image_Entry * ie __UNUSED__)
193{
194}
195
196static void
197_evas_common_soft8_image_dirty_region(Image_Entry * im __UNUSED__,
198 unsigned int x __UNUSED__,
199 unsigned int y __UNUSED__,
200 unsigned int w __UNUSED__,
201 unsigned int h __UNUSED__)
202{
203}
204
205static int
206_evas_common_soft8_image_dirty(Image_Entry * ie_dst, const Image_Entry * ie_src)
207{
208 Soft8_Image *dst = (Soft8_Image *) ie_dst;
209 Soft8_Image *src = (Soft8_Image *) ie_src;
210
211 evas_cache_image_load_data(&src->cache_entry);
212 evas_cache_image_surface_alloc(&dst->cache_entry,
213 src->cache_entry.w, src->cache_entry.h);
214
215/* evas_common_blit_rectangle(src, dst, 0, 0, src->cache_entry.w, src->cache_entry.h, 0, 0); */
216
217 return 0;
218}
219
220static int
221_evas_common_soft8_image_ram_usage(Image_Entry * ie)
222{
223 Soft8_Image *im = (Soft8_Image *) ie;
224
225 if (im->pixels && im->flags.free_pixels)
226 return IMG_BYTE_SIZE(im->stride, im->cache_entry.h, ie->flags.alpha);
227 return 0;
228}
229
230static int
231_evas_common_soft8_image_size_set(Image_Entry * ie_dst,
232 const Image_Entry * ie_im,
233 unsigned int w __UNUSED__,
234 unsigned int h __UNUSED__)
235{
236 Soft8_Image *dst = (Soft8_Image *) ie_dst;
237 Soft8_Image *im = (Soft8_Image *) ie_im;
238
239 dst->flags = im->flags;
240
241 return 0;
242}
243
244static int
245_evas_common_soft8_image_from_data(Image_Entry * ie_dst,
246 unsigned int w, unsigned int h,
247 DATA32 * image_data, int alpha,
248 int cspace __UNUSED__)
249{
250 Soft8_Image *im = (Soft8_Image *) ie_dst;
251
252 /* FIXME: handle colorspace */
253 ie_dst->w = w;
254 ie_dst->h = h;
255 ie_dst->flags.alpha = alpha;
256
257 im->flags.free_pixels = 0;
258 im->flags.free_alpha = 0;
259 if (im->stride < 0)
260 im->stride = _calc_stride(w);
261
262 /* FIXME: That's bad, the application must be aware of the engine internal. */
263 im->pixels = (DATA8 *) image_data;
264 if (ie_dst->flags.alpha)
265 im->alpha = (DATA8 *) (im->pixels + (im->stride * h));
266
267 return 0;
268}
269
270static int
271_evas_common_soft8_image_from_copied_data(Image_Entry * ie_dst,
272 unsigned int w __UNUSED__,
273 unsigned int h,
274 DATA32 * image_data,
275 int alpha __UNUSED__,
276 int cspace __UNUSED__)
277{
278 Soft8_Image *im = (Soft8_Image *) ie_dst;
279
280 /* FIXME: handle colorspace */
281 if (image_data)
282 memcpy(im->pixels, image_data,
283 IMG_BYTE_SIZE(im->stride, h, ie_dst->flags.alpha));
284 else
285 memset(im->pixels, 0, IMG_BYTE_SIZE(im->stride, h, ie_dst->flags.alpha));
286
287 return 0;
288}
289
290static int
291_evas_common_soft8_image_colorspace_set(Image_Entry * ie_dst __UNUSED__,
292 int cspace __UNUSED__)
293{
294 /* FIXME: handle colorspace */
295 return 0;
296}
297
298static int
299_evas_common_load_soft8_image_data_from_file(Image_Entry * ie)
300{
301 Soft8_Image *im = (Soft8_Image *) ie;
302
303 if (im->pixels)
304 return 0;
305 if (!im->source)
306 return -1;
307
308 evas_cache_image_load_data(&im->source->cache_entry);
309 if (im->source->image.data)
310 {
311 DATA32 *sp;
312
313 evas_cache_image_surface_alloc(&im->cache_entry,
314 im->source->cache_entry.w,
315 im->source->cache_entry.h);
316
317 sp = im->source->image.data;
318 if (im->alpha)
319 evas_common_soft8_image_convert_from_rgba(im, sp);
320 else
321 evas_common_soft8_image_convert_from_rgb(im, sp);
322 }
323 evas_cache_image_drop(&im->source->cache_entry);
324 im->source = NULL;
325
326 return 0;
327}
328
329/* Soft16_Image * */
330/* evas_common_soft16_image_new(int w, unsigned int h, unsigned int stride, int have_alpha, DATA16 *pixels, */
331/* int copy) */
332/* { */
333/* Soft16_Image *im; */
334
335/* if (stride < 0) stride = _calc_stride(w); */
336
337/* im = evas_common_soft16_image_alloc(w, h, stride, have_alpha, copy); */
338/* if (!im) return NULL; */
339
340/* if (pixels) */
341/* { */
342/* if (copy) */
343/* memcpy(im->pixels, pixels, IMG_BYTE_SIZE(stride, h, have_alpha)); */
344/* else */
345/* { */
346/* im->pixels = pixels; */
347/* if (have_alpha) im->alpha = (DATA8 *)(im->pixels + (stride * h)); */
348/* } */
349/* } */
350/* return im; */
351/* } */
352
353static inline void
354_get_clip(const RGBA_Draw_Context * dc, const Soft8_Image * im,
355 Eina_Rectangle * clip)
356{
357 if (dc->clip.use)
358 {
359 EINA_RECTANGLE_SET(clip, dc->clip.x, dc->clip.y, dc->clip.w,
360 dc->clip.h);
361 if (clip->x < 0)
362 {
363 clip->w += clip->x;
364 clip->x = 0;
365 }
366 if (clip->y < 0)
367 {
368 clip->h += clip->y;
369 clip->y = 0;
370 }
371 if ((clip->x + clip->w) > (int)im->cache_entry.w)
372 clip->w = im->cache_entry.w - clip->x;
373 if ((clip->y + clip->h) > (int)im->cache_entry.h)
374 clip->h = im->cache_entry.h - clip->y;
375 }
376 else
377 {
378 EINA_RECTANGLE_SET(clip, 0, 0, im->cache_entry.w, im->cache_entry.h);
379 }
380}
381
382static inline int
383_is_empty_rectangle(const Eina_Rectangle * r)
384{
385 return (r->w < 1) || (r->h < 1);
386}
387
388static inline void
389_shrink(int *s_pos, int *s_size, int pos, int size)
390{
391 int d;
392
393 d = (*s_pos) - pos;
394 if (d < 0)
395 {
396 (*s_size) += d;
397 (*s_pos) = pos;
398 }
399
400 d = size + pos - (*s_pos);
401 if ((*s_size) > d)
402 (*s_size) = d;
403}
404
405static int
406_soft8_adjust_areas(Eina_Rectangle * src,
407 int src_max_x, int src_max_y, Eina_Rectangle * dst,
408 int dst_max_x, int dst_max_y, Eina_Rectangle * dst_clip)
409{
410 if (_is_empty_rectangle(src) ||
411 _is_empty_rectangle(dst) || _is_empty_rectangle(dst_clip))
412 return 0;
413
414 /* shrink clip */
415 _shrink(&dst_clip->x, &dst_clip->w, dst->x, dst->w);
416 _shrink(&dst_clip->y, &dst_clip->h, dst->y, dst->h);
417 if (_is_empty_rectangle(dst_clip))
418 return 0;
419
420 /* sanitise x */
421 if (src->x < 0)
422 {
423 dst->x -= (src->x * dst->w) / src->w;
424 dst->w += (src->x * dst->w) / src->w;
425 src->w += src->x;
426 src->x = 0;
427 }
428 if (src->x >= src_max_x)
429 return 0;
430 if ((src->x + src->w) > src_max_x)
431 {
432 dst->w = (dst->w * (src_max_x - src->x)) / (src->w);
433 src->w = src_max_x - src->x;
434 }
435 if (dst->w <= 0)
436 return 0;
437 if (src->w <= 0)
438 return 0;
439 if (dst_clip->x < 0)
440 {
441 dst_clip->w += dst_clip->x;
442 dst_clip->x = 0;
443 }
444 if (dst_clip->w <= 0)
445 return 0;
446 if (dst_clip->x >= dst_max_x)
447 return 0;
448
449 _shrink(&dst_clip->x, &dst_clip->w, 0, dst_max_x);
450 if (dst_clip->w <= 0)
451 return 0;
452
453 /* sanitise y */
454 if (src->y < 0)
455 {
456 dst->y -= (src->y * dst->h) / src->h;
457 dst->h += (src->y * dst->h) / src->h;
458 src->h += src->y;
459 src->y = 0;
460 }
461 if (src->y >= src_max_y)
462 return 0;
463 if ((src->y + src->h) > src_max_y)
464 {
465 dst->h = (dst->h * (src_max_y - src->y)) / (src->h);
466 src->h = src_max_y - src->y;
467 }
468 if (dst->h <= 0)
469 return 0;
470 if (src->h <= 0)
471 return 0;
472 if (dst_clip->y < 0)
473 {
474 dst_clip->h += dst_clip->y;
475 dst_clip->y = 0;
476 }
477 if (dst_clip->h <= 0)
478 return 0;
479 if (dst_clip->y >= dst_max_y)
480 return 0;
481
482 _shrink(&dst_clip->y, &dst_clip->h, 0, dst_max_y);
483 if (dst_clip->h <= 0)
484 return 0;
485
486 return 1;
487}
488
489static void
490_soft8_image_draw_sampled_int(Soft8_Image * src, Soft8_Image * dst,
491 RGBA_Draw_Context * dc,
492 Eina_Rectangle sr, Eina_Rectangle dr)
493{
494 Eina_Rectangle cr;
495
496 if (!
497 (RECTS_INTERSECT
498 (dr.x, dr.y, dr.w, dr.h, 0, 0, dst->cache_entry.w, dst->cache_entry.h)))
499 return;
500 if (!
501 (RECTS_INTERSECT
502 (sr.x, sr.y, sr.w, sr.h, 0, 0, src->cache_entry.w, src->cache_entry.h)))
503 return;
504
505 _get_clip(dc, dst, &cr);
506 if (!_soft8_adjust_areas
507 (&sr, src->cache_entry.w, src->cache_entry.h, &dr, dst->cache_entry.w,
508 dst->cache_entry.h, &cr))
509 return;
510
511 if ((dr.w == sr.w) && (dr.h == sr.h))
512 evas_common_soft8_image_draw_unscaled(src, dst, dc, sr, dr, cr);
513 else
514 evas_common_soft8_image_draw_scaled_sampled(src, dst, dc, sr, dr, cr);
515}
516
517EAPI void
518evas_common_soft8_image_draw(Soft8_Image * src, Soft8_Image * dst,
519 RGBA_Draw_Context * dc,
520 int src_region_x, int src_region_y,
521 int src_region_w, int src_region_h,
522 int dst_region_x, int dst_region_y,
523 int dst_region_w, int dst_region_h,
524 int smooth __UNUSED__)
525{
526 Eina_Rectangle sr, dr;
527 Cutout_Rects *rects;
528 Cutout_Rect *r;
529 struct RGBA_Draw_Context_clip clip_bkp;
530 int i;
531
532 /* handle cutouts here! */
533 EINA_RECTANGLE_SET(&dr, dst_region_x, dst_region_y, dst_region_w,
534 dst_region_h);
535
536 if (_is_empty_rectangle(&dr))
537 return;
538 if (!
539 (RECTS_INTERSECT
540 (dr.x, dr.y, dr.w, dr.h, 0, 0, dst->cache_entry.w, dst->cache_entry.h)))
541 return;
542
543 EINA_RECTANGLE_SET(&sr, src_region_x, src_region_y, src_region_w,
544 src_region_h);
545
546 if (_is_empty_rectangle(&sr))
547 return;
548 if (!
549 (RECTS_INTERSECT
550 (sr.x, sr.y, sr.w, sr.h, 0, 0, src->cache_entry.w, src->cache_entry.h)))
551 return;
552
553 /* no cutouts - cut right to the chase */
554 if (!dc->cutout.rects)
555 {
556 _soft8_image_draw_sampled_int(src, dst, dc, sr, dr);
557 return;
558 }
559
560 /* save out clip info */
561 clip_bkp = dc->clip;
562 evas_common_draw_context_clip_clip(dc, 0, 0, dst->cache_entry.w,
563 dst->cache_entry.h);
564 evas_common_draw_context_clip_clip(dc, dst_region_x, dst_region_y,
565 dst_region_w, dst_region_h);
566 /* our clip is 0 size.. abort */
567 if ((dc->clip.w <= 0) || (dc->clip.h <= 0))
568 {
569 dc->clip = clip_bkp;
570 return;
571 }
572 rects = evas_common_draw_context_apply_cutouts(dc);
573 for (i = 0; i < rects->active; i++)
574 {
575 r = rects->rects + i;
576 evas_common_draw_context_set_clip(dc, r->x, r->y, r->w, r->h);
577 _soft8_image_draw_sampled_int(src, dst, dc, sr, dr);
578 }
579 evas_common_draw_context_apply_clear_cutouts(rects);
580 dc->clip = clip_bkp;
581}
582
583EAPI Soft8_Image *
584evas_common_soft8_image_alpha_set(Soft8_Image * im, int have_alpha)
585{
586 Soft8_Image *new_im;
587
588 if (im->cache_entry.flags.alpha == have_alpha)
589 return im;
590
591 new_im = (Soft8_Image *) evas_cache_image_alone(&im->cache_entry);
592
593 new_im->cache_entry.flags.alpha = have_alpha;
594
595 if (im->cache_entry.w > 0 && im->cache_entry.h)
596 new_im =
597 (Soft8_Image *) evas_cache_image_size_set(&new_im->cache_entry,
598 im->cache_entry.w,
599 im->cache_entry.h);
600
601 return new_im;
602}
603
604/* Soft16_Image * */
605/* evas_common_soft16_image_size_set(Soft16_Image *old_im, unsigned int w, unsigned int h) */
606/* { */
607/* Soft16_Image *new_im; */
608/* DATA16 *dp, *sp; */
609/* int i, cw, ch, ew; */
610
611/* if ((old_im->cache_entry.w == w) && (old_im->cache_entry.h == h)) return old_im; */
612
613/* new_im = evas_common_soft16_image_new(w, h, -1, old_im->flags.have_alpha, NULL, 1); */
614
615/* if (old_im->cache_entry.w < new_im->cache_entry.w) */
616/* cw = old_im->cache_entry.w; */
617/* else */
618/* cw = new_im->cache_entry.w; */
619
620/* ew = new_im->cache_entry.w - cw; */
621
622/* if (old_im->cache_entry.h < new_im->cache_entry.h) */
623/* ch = old_im->cache_entry.h; */
624/* else */
625/* ch = new_im->cache_entry.h; */
626
627/* dp = new_im->pixels; */
628/* sp = old_im->pixels; */
629/* for (i = 0; i < ch; i++) */
630/* { */
631/* memcpy(dp, sp, cw * sizeof(DATA16)); */
632/* if (ew > 0) memset(dp, 0, ew * sizeof(DATA16)); */
633
634/* dp += new_im->stride; */
635/* sp += old_im->stride; */
636/* } */
637
638/* if (old_im->flags.have_alpha) */
639/* { */
640/* DATA8 *dp, *sp; */
641
642/* dp = new_im->alpha; */
643/* sp = old_im->alpha; */
644/* for (i = 0; i < ch; i++) */
645/* { */
646/* memcpy(dp, sp, cw * sizeof(DATA8)); */
647/* if (ew > 0) memset(dp, 0, ew * sizeof(DATA8)); */
648
649/* dp += new_im->stride; */
650/* sp += old_im->stride; */
651/* } */
652/* } */
653
654/* evas_cache_image_drop(&old_im->cache_entry); */
655/* return new_im; */
656/* } */
diff --git a/libraries/evas/src/lib/engines/common_8/evas_soft8_polygon.c b/libraries/evas/src/lib/engines/common_8/evas_soft8_polygon.c
new file mode 100644
index 0000000..fb7027e
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common_8/evas_soft8_polygon.c
@@ -0,0 +1,230 @@
1#include <evas_common_soft8.h>
2#include "evas_soft8_scanline_fill.c"
3#include <math.h>
4
5typedef struct _RGBA_Edge RGBA_Edge;
6typedef struct _RGBA_Vertex RGBA_Vertex;
7
8struct _RGBA_Edge {
9 float x, dx;
10 int i;
11};
12
13struct _RGBA_Vertex {
14 float x, y;
15 int i;
16};
17
18#define POLY_EDGE_DEL(_i) \
19{ \
20 int _j; \
21 \
22 for (_j = 0; (_j < num_active_edges) && (edges[_j].i != _i); _j++); \
23 if (_j < num_active_edges) \
24 { \
25 num_active_edges--; \
26 memmove(&(edges[_j]), &(edges[_j + 1]), \
27 (num_active_edges - _j) * sizeof(RGBA_Edge)); \
28 } \
29}
30
31#define POLY_EDGE_ADD(_i, _y) \
32{ \
33 int _j; \
34 float _dx; \
35 RGBA_Vertex *_p, *_q; \
36 if (_i < (n - 1)) _j = _i + 1; \
37 else _j = 0; \
38 if (point[_i].y < point[_j].y) \
39 { \
40 _p = &(point[_i]); \
41 _q = &(point[_j]); \
42 } \
43 else \
44 { \
45 _p = &(point[_j]); \
46 _q = &(point[_i]); \
47 } \
48 edges[num_active_edges].dx = _dx = (_q->x - _p->x) / (_q->y - _p->y); \
49 edges[num_active_edges].x = (_dx * ((float)_y + 0.5 - _p->y)) + _p->x; \
50 edges[num_active_edges].i = _i; \
51 num_active_edges++; \
52}
53
54static int
55polygon_point_sorter(const void *a, const void *b)
56{
57 RGBA_Vertex *p, *q;
58
59 p = (RGBA_Vertex *) a;
60 q = (RGBA_Vertex *) b;
61 if (p->y <= q->y)
62 return -1;
63 return 1;
64}
65
66static int
67polygon_edge_sorter(const void *a, const void *b)
68{
69 RGBA_Edge *p, *q;
70
71 p = (RGBA_Edge *) a;
72 q = (RGBA_Edge *) b;
73 if (p->x <= q->x)
74 return -1;
75 return 1;
76}
77
78void
79evas_common_soft8_polygon_draw(Soft8_Image * dst, RGBA_Draw_Context * dc,
80 RGBA_Polygon_Point * points, int x, int y)
81{
82 RGBA_Polygon_Point *pt;
83 RGBA_Vertex *point;
84 RGBA_Edge *edges;
85 int num_active_edges;
86 int n;
87 int i, j, k;
88 int y0, y1, yi;
89 int ext_x, ext_y, ext_w, ext_h;
90 int *sorted_index;
91 DATA8 alpha;
92 DATA8 gry8;
93
94 alpha = A_VAL(&dc->col.col);
95 if (alpha == 0)
96 return;
97 alpha++;
98
99 gry8 = GRY_8_FROM_RGB(&dc->col.col);
100
101 ext_x = 0;
102 ext_y = 0;
103 ext_w = dst->cache_entry.w;
104 ext_h = dst->cache_entry.h;
105 if (dc->clip.use)
106 RECTS_CLIP_TO_RECT(ext_x, ext_y, ext_w, ext_h,
107 dc->clip.x, dc->clip.y, dc->clip.w, dc->clip.h);
108
109 if ((ext_w <= 0) || (ext_h <= 0))
110 return;
111
112 n = 0;
113 EINA_INLIST_FOREACH(points, pt) n++;
114
115 if (n < 3)
116 return;
117
118 edges = malloc(sizeof(RGBA_Edge) * n);
119 if (!edges)
120 return;
121
122 point = malloc(sizeof(RGBA_Vertex) * n);
123 if (!point)
124 {
125 free(edges);
126 return;
127 }
128
129 sorted_index = malloc(sizeof(int) * n);
130 if (!sorted_index)
131 {
132 free(edges);
133 free(point);
134 return;
135 }
136
137 k = 0;
138 EINA_INLIST_FOREACH(points, pt)
139 {
140 point[k].x = pt->x + x;
141 point[k].y = pt->y + y;
142 point[k].i = k;
143 k++;
144 }
145 qsort(point, n, sizeof(RGBA_Vertex), polygon_point_sorter);
146
147 for (k = 0; k < n; k++)
148 sorted_index[k] = point[k].i;
149
150 k = 0;
151 EINA_INLIST_FOREACH(points, pt)
152 {
153 point[k].x = pt->x + x;
154 point[k].y = pt->y + y;
155 point[k].i = k;
156 k++;
157 }
158
159 y0 = MAX(ext_y, ceil(point[sorted_index[0]].y - 0.5));
160 y1 = MIN(ext_y + ext_h - 1, floor(point[sorted_index[n - 1]].y - 0.5));
161
162 k = 0;
163 num_active_edges = 0;
164
165 for (yi = y0; yi <= y1; yi++)
166 {
167 for (; (k < n) && (point[sorted_index[k]].y <= ((float)yi + 0.5)); k++)
168 {
169 i = sorted_index[k];
170
171 if (i > 0)
172 j = i - 1;
173 else
174 j = n - 1;
175 if (point[j].y <= ((float)yi - 0.5))
176 {
177 POLY_EDGE_DEL(j)}
178 else if (point[j].y > ((float)yi + 0.5))
179 {
180 POLY_EDGE_ADD(j, yi)}
181 if (i < (n - 1))
182 j = i + 1;
183 else
184 j = 0;
185 if (point[j].y <= ((float)yi - 0.5))
186 {
187 POLY_EDGE_DEL(i)}
188 else if (point[j].y > ((float)yi + 0.5))
189 {
190 POLY_EDGE_ADD(i, yi)}
191 }
192
193 qsort(edges, num_active_edges, sizeof(RGBA_Edge), polygon_edge_sorter);
194
195 for (j = 0; j < num_active_edges; j += 2)
196 {
197 int x0, x1;
198
199 x0 = ceil(edges[j].x - 0.5);
200 if (j < (num_active_edges - 1))
201 x1 = floor(edges[j + 1].x - 0.5);
202 else
203 x1 = x0;
204 if ((x1 >= ext_x) && (x0 < (ext_x + ext_w)) && (x0 <= x1))
205 {
206 DATA8 *dst_itr;
207 int w;
208
209 if (x0 < ext_x)
210 x0 = ext_x;
211 if (x1 >= (ext_x + ext_w))
212 x1 = ext_x + ext_w - 1;
213
214 w = (x1 - x0) + 1;
215 dst_itr = dst->pixels + (yi * dst->stride) + x0;
216
217 if (alpha == 0xff)
218 _soft8_scanline_fill_solid_solid(dst_itr, w, gry8);
219 else
220 _soft8_scanline_fill_transp_solid(dst_itr, w, gry8, alpha);
221 }
222 edges[j].x += edges[j].dx;
223 edges[j + 1].x += edges[j + 1].dx;
224 }
225 }
226
227 free(edges);
228 free(point);
229 free(sorted_index);
230}
diff --git a/libraries/evas/src/lib/engines/common_8/evas_soft8_rectangle.c b/libraries/evas/src/lib/engines/common_8/evas_soft8_rectangle.c
new file mode 100644
index 0000000..150f262
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common_8/evas_soft8_rectangle.c
@@ -0,0 +1,125 @@
1#include "evas_common_soft8.h"
2#include "evas_soft8_scanline_fill.c"
3
4static inline int
5_is_empty_rectangle(const Eina_Rectangle * r)
6{
7 return (r->w < 1) || (r->h < 1);
8}
9
10static inline void
11_soft8_rectangle_draw_solid_solid(Soft8_Image * dst, int offset, int w, int h,
12 DATA8 gry8)
13{
14 DATA8 *dst_itr;
15 int i;
16
17 dst_itr = dst->pixels + offset;
18
19 for (i = 0; i < h; i++, dst_itr += dst->stride)
20 _soft8_scanline_fill_solid_solid(dst_itr, w, gry8);
21}
22
23static inline void
24_soft8_rectangle_draw_transp_solid(Soft8_Image * dst, int offset, int w, int h,
25 DATA8 gry8, DATA8 alpha)
26{
27 DATA8 *dst_itr;
28 int i;
29
30 dst_itr = dst->pixels + offset;
31 alpha++;
32
33 for (i = 0; i < h; i++, dst_itr += dst->stride)
34 _soft8_scanline_fill_transp_solid(dst_itr, w, gry8, alpha);
35}
36
37static void
38_soft8_rectangle_draw_int(Soft8_Image * dst, RGBA_Draw_Context * dc,
39 Eina_Rectangle dr)
40{
41 int dst_offset;
42
43 if (_is_empty_rectangle(&dr))
44 return;
45 RECTS_CLIP_TO_RECT(dr.x, dr.y, dr.w, dr.h, 0, 0, dst->cache_entry.w,
46 dst->cache_entry.h);
47 if (_is_empty_rectangle(&dr))
48 return;
49
50 if (dc->clip.use)
51 RECTS_CLIP_TO_RECT(dr.x, dr.y, dr.w, dr.h, dc->clip.x,
52 dc->clip.y, dc->clip.w, dc->clip.h);
53 if (_is_empty_rectangle(&dr))
54 return;
55 if (A_VAL(&dc->col.col) == 0)
56 return;
57
58 dst_offset = dr.x + (dr.y * dst->stride);
59
60 if (!dst->cache_entry.flags.alpha)
61 {
62 DATA8 gry8;
63 DATA8 alpha;
64
65 alpha = A_VAL(&dc->col.col);
66 gry8 = GRY_8_FROM_RGB(&dc->col.col);
67
68 if (alpha == 0xff)
69 _soft8_rectangle_draw_solid_solid(dst, dst_offset, dr.w, dr.h, gry8);
70 else if (alpha > 0)
71 _soft8_rectangle_draw_transp_solid
72 (dst, dst_offset, dr.w, dr.h, gry8, alpha);
73 }
74 else
75 ERR("Unsupported feature: drawing rectangle to non-opaque destination.");
76}
77
78void
79evas_common_soft8_rectangle_draw(Soft8_Image * dst, RGBA_Draw_Context * dc,
80 int x, int y, int w, int h)
81{
82 Eina_Rectangle dr;
83 Cutout_Rects *rects;
84 Cutout_Rect *r;
85 struct RGBA_Draw_Context_clip c_bkp;
86 int i;
87
88 /* handle cutouts here! */
89 EINA_RECTANGLE_SET(&dr, x, y, w, h);
90
91 if (_is_empty_rectangle(&dr))
92 return;
93 if (!
94 (RECTS_INTERSECT
95 (dr.x, dr.y, dr.w, dr.h, 0, 0, dst->cache_entry.w, dst->cache_entry.h)))
96 return;
97
98 /* no cutouts - cut right to the chase */
99 if (!dc->cutout.rects)
100 {
101 _soft8_rectangle_draw_int(dst, dc, dr);
102 return;
103 }
104
105 c_bkp = dc->clip;
106
107 evas_common_draw_context_clip_clip(dc, 0, 0, dst->cache_entry.w,
108 dst->cache_entry.h);
109 evas_common_draw_context_clip_clip(dc, x, y, w, h);
110 /* our clip is 0 size.. abort */
111 if ((dc->clip.w <= 0) || (dc->clip.h <= 0))
112 {
113 dc->clip = c_bkp;
114 return;
115 }
116 rects = evas_common_draw_context_apply_cutouts(dc);
117 for (i = 0; i < rects->active; ++i)
118 {
119 r = rects->rects + i;
120 evas_common_draw_context_set_clip(dc, r->x, r->y, r->w, r->h);
121 _soft8_rectangle_draw_int(dst, dc, dr);
122 }
123 evas_common_draw_context_apply_clear_cutouts(rects);
124 dc->clip = c_bkp;
125}
diff --git a/libraries/evas/src/lib/engines/common_8/evas_soft8_scanline_blend.c b/libraries/evas/src/lib/engines/common_8/evas_soft8_scanline_blend.c
new file mode 100644
index 0000000..5fc62c2
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common_8/evas_soft8_scanline_blend.c
@@ -0,0 +1,447 @@
1/** NOTE: This file is meant to be included by users **/
2
3/** NOTE2: r, g, b parameters are 16bits, so you can pass 0 to 256 inclusive.
4 ** this is due our division by 256 when multiplying the color.
5 **/
6
7/*****************************************************************************
8 * Scanline processing
9 *
10 * _soft8_scanline_<description>_<src>_<dst>[_<modifier>]()
11 *
12 ****************************************************************************/
13
14EFL_ALWAYS_INLINE void
15_soft8_pt_blend_transp_solid(DATA8 * p_dst, DATA8 src, DATA8 alpha)
16{
17 if (alpha == 0xff)
18 *p_dst = src;
19 else if (alpha != 0)
20 {
21 *p_dst = GRY_8_BLEND(src, *p_dst, alpha);
22 }
23}
24
25/***********************************************************************
26 * Regular blend operations
27 */
28static void
29_soft8_scanline_blend_transp_solid(DATA8 * src, DATA8 * alpha, DATA8 * dst,
30 int size)
31{
32 DATA8 *start, *end;
33
34 start = dst;
35 end = start + (size & ~7);
36
37 pld(alpha, 0);
38 pld(src, 0);
39
40 /* work on 8 pixels per time, do data preload */
41 while (start < end)
42 {
43 DATA8 alpha1, alpha2;
44
45 alpha1 = alpha[0];
46 alpha += 8;
47
48 /* empirical tests show these give the best performance */
49 pld(alpha, 8);
50 pld(src, 32);
51
52 src += 8;
53 start += 8;
54
55 alpha2 = alpha[-7];
56 _soft8_pt_blend_transp_solid(start - 8, src[-8], alpha1);
57
58 alpha1 = alpha[-6];
59 _soft8_pt_blend_transp_solid(start - 7, src[-7], alpha2);
60
61 alpha2 = alpha[-5];
62 _soft8_pt_blend_transp_solid(start - 6, src[-6], alpha1);
63
64 alpha1 = alpha[-4];
65 _soft8_pt_blend_transp_solid(start - 5, src[-5], alpha2);
66
67 alpha2 = alpha[-3];
68 _soft8_pt_blend_transp_solid(start - 4, src[-4], alpha1);
69
70 alpha1 = alpha[-2];
71 _soft8_pt_blend_transp_solid(start - 3, src[-3], alpha2);
72
73 alpha2 = alpha[-1];
74 _soft8_pt_blend_transp_solid(start - 2, src[-2], alpha1);
75
76 _soft8_pt_blend_transp_solid(start - 1, src[-1], alpha2);
77 }
78
79 /* remaining pixels (up to 7) */
80 end = start + (size & 7);
81 for (; start < end; start++, src++, alpha++)
82 _soft8_pt_blend_transp_solid(start, *src, *alpha);
83}
84
85EFL_ALWAYS_INLINE void
86_soft8_pt_blend_solid_solid(DATA8 * p_dst, DATA8 src)
87{
88 *p_dst = src;
89}
90
91static inline void
92_soft8_scanline_blend_solid_solid(DATA8 * src, DATA8 * dst, int size)
93{
94 memcpy(dst, src, size * sizeof(DATA8));
95}
96
97/***********************************************************************
98 * Blend operations taking an extra alpha (fade in, out)
99 */
100
101static inline void
102_soft8_pt_blend_transp_solid_mul_alpha(DATA8 * p_dst, DATA8 src, DATA8 alpha,
103 DATA8 rel_alpha)
104{
105 alpha = alpha * rel_alpha;
106 if (alpha == 0)
107 return;
108
109 alpha++;
110 *p_dst = GRY_8_BLEND((src * rel_alpha) & 0xff, *p_dst, alpha);
111}
112
113static void
114_soft8_scanline_blend_transp_solid_mul_alpha(DATA8 * src, DATA8 * alpha,
115 DATA8 * dst, int size,
116 const DATA8 rel_alpha)
117{
118 DATA8 *start, *end;
119
120 start = dst;
121 end = start + (size & ~7);
122
123 pld(alpha, 0);
124 pld(src, 0);
125
126 while (start < end)
127 {
128 DATA8 alpha1, alpha2;
129
130 alpha1 = alpha[0];
131 alpha += 8;
132
133 pld(alpha, 8);
134 pld(src, 32);
135
136 src += 8;
137 start += 8;
138
139 alpha2 = alpha[-7];
140 _soft8_pt_blend_transp_solid_mul_alpha
141 (start - 8, src[-8], alpha1, rel_alpha);
142
143 alpha1 = alpha[-6];
144 _soft8_pt_blend_transp_solid_mul_alpha
145 (start - 7, src[-7], alpha2, rel_alpha);
146
147 alpha2 = alpha[-5];
148 _soft8_pt_blend_transp_solid_mul_alpha
149 (start - 6, src[-6], alpha1, rel_alpha);
150
151 alpha1 = alpha[-4];
152 _soft8_pt_blend_transp_solid_mul_alpha
153 (start - 5, src[-5], alpha2, rel_alpha);
154
155 alpha2 = alpha[-3];
156 _soft8_pt_blend_transp_solid_mul_alpha
157 (start - 4, src[-4], alpha1, rel_alpha);
158
159 alpha1 = alpha[-2];
160 _soft8_pt_blend_transp_solid_mul_alpha
161 (start - 3, src[-3], alpha2, rel_alpha);
162
163 alpha2 = alpha[-1];
164 _soft8_pt_blend_transp_solid_mul_alpha
165 (start - 2, src[-2], alpha1, rel_alpha);
166
167 _soft8_pt_blend_transp_solid_mul_alpha
168 (start - 1, src[-1], alpha2, rel_alpha);
169 }
170
171 end = start + (size & 7);
172 for (; start < end; start++, src++, alpha++)
173 _soft8_pt_blend_transp_solid_mul_alpha(start, *src, *alpha, rel_alpha);
174}
175
176EFL_ALWAYS_INLINE void
177_soft8_pt_blend_solid_solid_mul_alpha(DATA8 * p_dst, DATA8 src, DATA8 rel_alpha)
178{
179 *p_dst = GRY_8_BLEND_UNMUL(src, *p_dst, rel_alpha);
180}
181
182static void
183_soft8_scanline_blend_solid_solid_mul_alpha(DATA8 * src, DATA8 * dst, int size,
184 DATA8 rel_alpha)
185{
186 DATA8 *start, *end;
187
188 start = dst;
189 end = start + (size & ~7);
190
191 pld(src, 0);
192
193 while (start < end)
194 {
195 pld(src, 32);
196 UNROLL8(
197 {
198 _soft8_pt_blend_solid_solid_mul_alpha(start, *src, rel_alpha);
199 start++; src++;}
200 );
201 }
202
203 end = start + (size & 7);
204 for (; start < end; start++, src++)
205 _soft8_pt_blend_solid_solid_mul_alpha(start, *src, rel_alpha);
206}
207
208/***********************************************************************
209 * Blend operations with extra alpha and multiply color
210 */
211
212EFL_ALWAYS_INLINE void
213_soft8_pt_blend_transp_solid_mul_color_transp(DATA8 * p_dst, DATA8 src,
214 DATA8 alpha, DATA8 rel_alpha,
215 DATA8 r, DATA8 g, DATA8 b)
216{
217 alpha = alpha * rel_alpha;
218 if (alpha == 0)
219 return;
220
221 alpha++;
222
223 DATA8 gry8 = (src * GRY_8_FROM_COMPONENTS(r, g, b)) >> 8;
224 *p_dst = GRY_8_BLEND(gry8, *p_dst, alpha);
225}
226
227static void
228_soft8_scanline_blend_transp_solid_mul_color_transp(DATA8 * src, DATA8 * alpha,
229 DATA8 * dst, int size,
230 DATA8 rel_alpha, DATA8 r,
231 DATA8 g, DATA8 b)
232{
233 DATA8 *start, *end;
234
235 start = dst;
236 end = start + (size & ~7);
237
238 pld(alpha, 0);
239 pld(src, 0);
240
241 while (start < end)
242 {
243 DATA8 alpha1, alpha2;
244
245 alpha1 = alpha[0];
246 alpha += 8;
247
248 pld(src, 32);
249 pld(start, 32);
250
251 src += 8;
252 start += 8;
253
254 alpha2 = alpha[-7];
255 _soft8_pt_blend_transp_solid_mul_color_transp
256 (start - 8, src[-8], alpha1, rel_alpha, r, g, b);
257
258 alpha1 = alpha[-6];
259 _soft8_pt_blend_transp_solid_mul_color_transp
260 (start - 7, src[-7], alpha2, rel_alpha, r, g, b);
261
262 alpha2 = alpha[-5];
263 _soft8_pt_blend_transp_solid_mul_color_transp
264 (start - 6, src[-6], alpha1, rel_alpha, r, g, b);
265
266 alpha1 = alpha[-4];
267 _soft8_pt_blend_transp_solid_mul_color_transp
268 (start - 5, src[-5], alpha2, rel_alpha, r, g, b);
269
270 alpha2 = alpha[-3];
271 _soft8_pt_blend_transp_solid_mul_color_transp
272 (start - 4, src[-4], alpha1, rel_alpha, r, g, b);
273
274 alpha1 = alpha[-2];
275 _soft8_pt_blend_transp_solid_mul_color_transp
276 (start - 3, src[-3], alpha2, rel_alpha, r, g, b);
277
278 alpha2 = alpha[-1];
279 _soft8_pt_blend_transp_solid_mul_color_transp
280 (start - 2, src[-2], alpha1, rel_alpha, r, g, b);
281
282 _soft8_pt_blend_transp_solid_mul_color_transp
283 (start - 1, src[-1], alpha2, rel_alpha, r, g, b);
284 }
285
286 end = start + (size & 7);
287 for (; start < end; start++, src++, alpha++)
288 _soft8_pt_blend_transp_solid_mul_color_transp
289 (start, *src, *alpha, rel_alpha, r, g, b);
290}
291
292EFL_ALWAYS_INLINE void
293_soft8_pt_blend_solid_solid_mul_color_transp(DATA8 * p_dst, DATA8 src,
294 DATA8 rel_alpha, DATA8 r, DATA8 g,
295 DATA8 b)
296{
297 DATA8 gry8 = (src * GRY_8_FROM_COMPONENTS(r, g, b)) >> 8;
298 *p_dst = GRY_8_BLEND(gry8, *p_dst, rel_alpha);
299}
300
301static void
302_soft8_scanline_blend_solid_solid_mul_color_transp(DATA8 * src, DATA8 * dst,
303 int size, DATA8 rel_alpha,
304 DATA8 r, DATA8 g, DATA8 b)
305{
306 DATA8 *start, *end;
307
308 start = dst;
309 end = start + (size & ~7);
310
311 pld(src, 0);
312
313 while (start < end)
314 {
315 pld(src, 32);
316 UNROLL8(
317 {
318 _soft8_pt_blend_solid_solid_mul_color_transp
319 (start, *src, rel_alpha, r, g, b); start++; src++;}
320 );
321 }
322
323 end = start + (size & 7);
324 for (; start < end; start++, src++)
325 _soft8_pt_blend_solid_solid_mul_color_transp
326 (start, *src, rel_alpha, r, g, b);
327}
328
329/***********************************************************************
330 * Blend operations with extra multiply color
331 */
332EFL_ALWAYS_INLINE void
333_soft8_pt_blend_transp_solid_mul_color_solid(DATA8 * p_dst, DATA8 src,
334 DATA8 alpha, DATA8 r, DATA8 g,
335 DATA8 b)
336{
337 if (alpha == 0)
338 return;
339
340 DATA8 gry8 = (src * GRY_8_FROM_COMPONENTS(r, g, b)) >> 8;
341
342 if (alpha == 0xff)
343 *p_dst = gry8;
344 else
345 {
346 *p_dst = GRY_8_BLEND(gry8, *p_dst, alpha);
347 }
348}
349
350static void
351_soft8_scanline_blend_transp_solid_mul_color_solid(DATA8 * src, DATA8 * alpha,
352 DATA8 * dst, int size,
353 DATA8 r, DATA8 g, DATA8 b)
354{
355 DATA8 *start, *end;
356
357 start = dst;
358 end = start + (size & ~7);
359
360 pld(alpha, 0);
361 pld(src, 0);
362
363 while (start < end)
364 {
365 DATA8 alpha1, alpha2;
366
367 alpha1 = alpha[0];
368 alpha += 8;
369
370 pld(alpha, 8);
371 pld(src, 32);
372
373 src += 8;
374 start += 8;
375
376 alpha2 = alpha[-7];
377 _soft8_pt_blend_transp_solid_mul_color_solid
378 (start - 8, src[-8], alpha1, r, g, b);
379
380 alpha1 = alpha[-6];
381 _soft8_pt_blend_transp_solid_mul_color_solid
382 (start - 7, src[-7], alpha2, r, g, b);
383
384 alpha2 = alpha[-5];
385 _soft8_pt_blend_transp_solid_mul_color_solid
386 (start - 6, src[-6], alpha1, r, g, b);
387
388 alpha1 = alpha[-4];
389 _soft8_pt_blend_transp_solid_mul_color_solid
390 (start - 5, src[-5], alpha2, r, g, b);
391
392 alpha2 = alpha[-3];
393 _soft8_pt_blend_transp_solid_mul_color_solid
394 (start - 4, src[-4], alpha1, r, g, b);
395
396 alpha1 = alpha[-2];
397 _soft8_pt_blend_transp_solid_mul_color_solid
398 (start - 3, src[-3], alpha2, r, g, b);
399
400 alpha2 = alpha[-1];
401 _soft8_pt_blend_transp_solid_mul_color_solid
402 (start - 2, src[-2], alpha1, r, g, b);
403
404 _soft8_pt_blend_transp_solid_mul_color_solid
405 (start - 1, src[-1], alpha2, r, g, b);
406 }
407
408 end = start + (size & 7);
409 for (; start < end; start++, src++, alpha++)
410 _soft8_pt_blend_transp_solid_mul_color_solid
411 (start, *src, *alpha, r, g, b);
412}
413
414EFL_ALWAYS_INLINE void
415_soft8_pt_blend_solid_solid_mul_color_solid(DATA8 * p_dst, DATA8 src, DATA8 r,
416 DATA8 g, DATA8 b)
417{
418 *p_dst = (src * GRY_8_FROM_COMPONENTS(r, g, b)) >> 8;
419}
420
421static void
422_soft8_scanline_blend_solid_solid_mul_color_solid(DATA8 * src, DATA8 * dst,
423 int size, DATA8 r, DATA8 g,
424 DATA8 b)
425{
426 DATA8 *start, *end;
427
428 start = dst;
429 end = start + (size & ~7);
430
431 pld(src, 0);
432
433 while (start < end)
434 {
435 pld(src, 32);
436 UNROLL8(
437 {
438 _soft8_pt_blend_solid_solid_mul_color_solid(start, *src, r, g,
439 b); start++;
440 src++;}
441 );
442 }
443
444 end = start + (size & 7);
445 for (; start < end; start++, src++)
446 _soft8_pt_blend_solid_solid_mul_color_solid(start, *src, r, g, b);
447}
diff --git a/libraries/evas/src/lib/engines/common_8/evas_soft8_scanline_fill.c b/libraries/evas/src/lib/engines/common_8/evas_soft8_scanline_fill.c
new file mode 100644
index 0000000..f1f3b8f
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common_8/evas_soft8_scanline_fill.c
@@ -0,0 +1,53 @@
1/** NOTE: This file is meant to be included by users **/
2
3/*****************************************************************************
4 * Point processing
5 *
6 * _soft8_pt_<description>_<src>_<dst>[_<modifier>]()
7 *
8 * Scanline processing
9 *
10 * _soft8_scanline_<description>_<src>_<dst>[_<modifier>]()
11 *
12 ****************************************************************************/
13EFL_ALWAYS_INLINE void
14_soft8_pt_fill_solid_solid(DATA8 * dst, DATA8 gry8)
15{
16 *dst = gry8;
17}
18
19EFL_ALWAYS_INLINE void
20_soft8_scanline_fill_solid_solid(DATA8 * dst, int size, DATA8 gry8)
21{
22 memset(dst, gry8, size);
23}
24
25EFL_ALWAYS_INLINE void
26_soft8_pt_fill_transp_solid(DATA8 * dst, DATA8 gry8, DATA8 alpha)
27{
28 *dst = GRY_8_BLEND(gry8, *dst, alpha);
29}
30
31static void
32_soft8_scanline_fill_transp_solid(DATA8 * dst, int size, DATA8 gry8,
33 DATA8 alpha)
34{
35 DATA8 *start, *end;
36
37 start = dst;
38 pld(start, 0);
39 end = start + (size & ~7);
40
41 while (start < end)
42 {
43 pld(start, 32);
44 UNROLL8(
45 {
46 _soft8_pt_fill_transp_solid(start, gry8, alpha); start++;}
47 );
48 }
49
50 end = start + (size & 7);
51 for (; start < end; start++)
52 _soft8_pt_fill_transp_solid(start, gry8, alpha);
53}
diff --git a/libraries/evas/src/lib/file/Makefile.am b/libraries/evas/src/lib/file/Makefile.am
new file mode 100644
index 0000000..7875fbe
--- /dev/null
+++ b/libraries/evas/src/lib/file/Makefile.am
@@ -0,0 +1,25 @@
1
2MAINTAINERCLEANFILES = Makefile.in
3
4AM_CPPFLAGS = \
5-I. \
6-I$(top_srcdir)/src/lib \
7-I$(top_srcdir)/src/lib/include \
8-DPACKAGE_BIN_DIR=\"$(bindir)\" \
9-DPACKAGE_LIB_DIR=\"$(libdir)\" \
10-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
11@FREETYPE_CFLAGS@ \
12@EINA_CFLAGS@ \
13@EVIL_CFLAGS@ \
14@WIN32_CPPFLAGS@ \
15@PIXMAN_CFLAGS@
16
17AM_CFLAGS = @WIN32_CFLAGS@
18
19noinst_LTLIBRARIES = libevas_file.la
20libevas_file_la_SOURCES = \
21evas_path.c \
22evas_module.c
23libevas_file_la_LIBADD = @EINA_LIBS@ @EVIL_LIBS@
24
25EXTRA_DIST = evas_module.h evas_path.h
diff --git a/libraries/evas/src/lib/file/Makefile.in b/libraries/evas/src/lib/file/Makefile.in
new file mode 100644
index 0000000..599d980
--- /dev/null
+++ b/libraries/evas/src/lib/file/Makefile.in
@@ -0,0 +1,680 @@
1# Makefile.in generated by automake 1.11.1 from Makefile.am.
2# @configure_input@
3
4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
6# Inc.
7# This Makefile.in is free software; the Free Software Foundation
8# gives unlimited permission to copy and/or distribute it,
9# with or without modifications, as long as this notice is preserved.
10
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
13# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14# PARTICULAR PURPOSE.
15
16@SET_MAKE@
17
18VPATH = @srcdir@
19pkgdatadir = $(datadir)/@PACKAGE@
20pkgincludedir = $(includedir)/@PACKAGE@
21pkglibdir = $(libdir)/@PACKAGE@
22pkglibexecdir = $(libexecdir)/@PACKAGE@
23am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
24install_sh_DATA = $(install_sh) -c -m 644
25install_sh_PROGRAM = $(install_sh) -c
26install_sh_SCRIPT = $(install_sh) -c
27INSTALL_HEADER = $(INSTALL_DATA)
28transform = $(program_transform_name)
29NORMAL_INSTALL = :
30PRE_INSTALL = :
31POST_INSTALL = :
32NORMAL_UNINSTALL = :
33PRE_UNINSTALL = :
34POST_UNINSTALL = :
35build_triplet = @build@
36host_triplet = @host@
37subdir = src/lib/file
38DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
39ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
40am__aclocal_m4_deps = $(top_srcdir)/m4/efl_attribute.m4 \
41 $(top_srcdir)/m4/efl_coverage.m4 \
42 $(top_srcdir)/m4/efl_doxygen.m4 \
43 $(top_srcdir)/m4/efl_fnmatch.m4 \
44 $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \
45 $(top_srcdir)/m4/evas_check_engine.m4 \
46 $(top_srcdir)/m4/evas_check_loader.m4 \
47 $(top_srcdir)/m4/evas_converter.m4 \
48 $(top_srcdir)/m4/evas_dither.m4 \
49 $(top_srcdir)/m4/evas_scaler.m4 $(top_srcdir)/m4/libtool.m4 \
50 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
51 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
52 $(top_srcdir)/configure.ac
53am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
54 $(ACLOCAL_M4)
55mkinstalldirs = $(install_sh) -d
56CONFIG_HEADER = $(top_builddir)/config.h
57CONFIG_CLEAN_FILES =
58CONFIG_CLEAN_VPATH_FILES =
59LTLIBRARIES = $(noinst_LTLIBRARIES)
60libevas_file_la_DEPENDENCIES =
61am_libevas_file_la_OBJECTS = evas_path.lo evas_module.lo
62libevas_file_la_OBJECTS = $(am_libevas_file_la_OBJECTS)
63AM_V_lt = $(am__v_lt_$(V))
64am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
65am__v_lt_0 = --silent
66DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
67depcomp = $(SHELL) $(top_srcdir)/depcomp
68am__depfiles_maybe = depfiles
69am__mv = mv -f
70COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
71 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
72LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
73 $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
74 $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
75 $(AM_CFLAGS) $(CFLAGS)
76AM_V_CC = $(am__v_CC_$(V))
77am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
78am__v_CC_0 = @echo " CC " $@;
79AM_V_at = $(am__v_at_$(V))
80am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
81am__v_at_0 = @
82CCLD = $(CC)
83LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
84 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
85 $(AM_LDFLAGS) $(LDFLAGS) -o $@
86AM_V_CCLD = $(am__v_CCLD_$(V))
87am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
88am__v_CCLD_0 = @echo " CCLD " $@;
89AM_V_GEN = $(am__v_GEN_$(V))
90am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
91am__v_GEN_0 = @echo " GEN " $@;
92SOURCES = $(libevas_file_la_SOURCES)
93DIST_SOURCES = $(libevas_file_la_SOURCES)
94ETAGS = etags
95CTAGS = ctags
96DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
97ACLOCAL = @ACLOCAL@
98ALLOCA = @ALLOCA@
99AMTAR = @AMTAR@
100AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
101AR = @AR@
102AS = @AS@
103AUTOCONF = @AUTOCONF@
104AUTOHEADER = @AUTOHEADER@
105AUTOMAKE = @AUTOMAKE@
106AWK = @AWK@
107CC = @CC@
108CCDEPMODE = @CCDEPMODE@
109CFLAGS = @CFLAGS@
110CHECK_CFLAGS = @CHECK_CFLAGS@
111CHECK_LIBS = @CHECK_LIBS@
112CPP = @CPP@
113CPPFLAGS = @CPPFLAGS@
114CXX = @CXX@
115CXXCPP = @CXXCPP@
116CXXDEPMODE = @CXXDEPMODE@
117CXXFLAGS = @CXXFLAGS@
118CYGPATH_W = @CYGPATH_W@
119DEFS = @DEFS@
120DEPDIR = @DEPDIR@
121DIRECTFB_CFLAGS = @DIRECTFB_CFLAGS@
122DIRECTFB_LIBS = @DIRECTFB_LIBS@
123DLLTOOL = @DLLTOOL@
124DSYMUTIL = @DSYMUTIL@
125DUMPBIN = @DUMPBIN@
126ECHO_C = @ECHO_C@
127ECHO_N = @ECHO_N@
128ECHO_T = @ECHO_T@
129ECORE_EVAS_CFLAGS = @ECORE_EVAS_CFLAGS@
130ECORE_EVAS_LIBS = @ECORE_EVAS_LIBS@
131EDB_CFLAGS = @EDB_CFLAGS@
132EDB_LIBS = @EDB_LIBS@
133EDJE_CFLAGS = @EDJE_CFLAGS@
134EDJE_LIBS = @EDJE_LIBS@
135EET_CFLAGS = @EET_CFLAGS@
136EET_LIBS = @EET_LIBS@
137EFL_COVERAGE_CFLAGS = @EFL_COVERAGE_CFLAGS@
138EFL_COVERAGE_LIBS = @EFL_COVERAGE_LIBS@
139EFL_FNMATCH_LIBS = @EFL_FNMATCH_LIBS@
140EGREP = @EGREP@
141EINA_CFLAGS = @EINA_CFLAGS@
142EINA_LIBS = @EINA_LIBS@
143EVAS_CFLAGS = @EVAS_CFLAGS@
144EVAS_LIBS = @EVAS_LIBS@
145EVAS_SSE3_CFLAGS = @EVAS_SSE3_CFLAGS@
146EVIL_CFLAGS = @EVIL_CFLAGS@
147EVIL_LIBS = @EVIL_LIBS@
148EXEEXT = @EXEEXT@
149FGREP = @FGREP@
150FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@
151FONTCONFIG_LIBS = @FONTCONFIG_LIBS@
152FREETYPE_CFLAGS = @FREETYPE_CFLAGS@
153FREETYPE_LIBS = @FREETYPE_LIBS@
154FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@
155FRIBIDI_LIBS = @FRIBIDI_LIBS@
156GL_EET_CFLAGS = @GL_EET_CFLAGS@
157GL_EET_LIBS = @GL_EET_LIBS@
158GREP = @GREP@
159HARFBUZZ_CFLAGS = @HARFBUZZ_CFLAGS@
160HARFBUZZ_LIBS = @HARFBUZZ_LIBS@
161INSTALL = @INSTALL@
162INSTALL_DATA = @INSTALL_DATA@
163INSTALL_PROGRAM = @INSTALL_PROGRAM@
164INSTALL_SCRIPT = @INSTALL_SCRIPT@
165INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
166LD = @LD@
167LDFLAGS = @LDFLAGS@
168LIBOBJS = @LIBOBJS@
169LIBS = @LIBS@
170LIBTOOL = @LIBTOOL@
171LINEBREAK_CFLAGS = @LINEBREAK_CFLAGS@
172LINEBREAK_LIBS = @LINEBREAK_LIBS@
173LIPO = @LIPO@
174LN_S = @LN_S@
175LTLIBOBJS = @LTLIBOBJS@
176MAKEINFO = @MAKEINFO@
177MKDIR_P = @MKDIR_P@
178MODULE_ARCH = @MODULE_ARCH@
179NM = @NM@
180NMEDIT = @NMEDIT@
181OBJC = @OBJC@
182OBJCDEPMODE = @OBJCDEPMODE@
183OBJCFLAGS = @OBJCFLAGS@
184OBJDUMP = @OBJDUMP@
185OBJEXT = @OBJEXT@
186OTOOL = @OTOOL@
187OTOOL64 = @OTOOL64@
188PACKAGE = @PACKAGE@
189PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
190PACKAGE_NAME = @PACKAGE_NAME@
191PACKAGE_STRING = @PACKAGE_STRING@
192PACKAGE_TARNAME = @PACKAGE_TARNAME@
193PACKAGE_URL = @PACKAGE_URL@
194PACKAGE_VERSION = @PACKAGE_VERSION@
195PATH_SEPARATOR = @PATH_SEPARATOR@
196PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
197PIXMAN_LIBS = @PIXMAN_LIBS@
198PKG_CONFIG = @PKG_CONFIG@
199PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
200PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
201PNG_CFLAGS = @PNG_CFLAGS@
202PNG_LIBS = @PNG_LIBS@
203RANLIB = @RANLIB@
204SDL_CFLAGS = @SDL_CFLAGS@
205SDL_LIBS = @SDL_LIBS@
206SED = @SED@
207SET_MAKE = @SET_MAKE@
208SHELL = @SHELL@
209SHM_OPEN_LINK = @SHM_OPEN_LINK@
210STRIP = @STRIP@
211SVG_CFLAGS = @SVG_CFLAGS@
212SVG_LIBS = @SVG_LIBS@
213VALGRIND_CFLAGS = @VALGRIND_CFLAGS@
214VALGRIND_LIBS = @VALGRIND_LIBS@
215VERSION = @VERSION@
216VMAJ = @VMAJ@
217WIN32_CFLAGS = @WIN32_CFLAGS@
218WIN32_CPPFLAGS = @WIN32_CPPFLAGS@
219XCB_CFLAGS = @XCB_CFLAGS@
220XCB_GL_CFLAGS = @XCB_GL_CFLAGS@
221XCB_GL_LIBS = @XCB_GL_LIBS@
222XCB_LIBS = @XCB_LIBS@
223XEXT_CFLAGS = @XEXT_CFLAGS@
224XEXT_LIBS = @XEXT_LIBS@
225XMKMF = @XMKMF@
226X_CFLAGS = @X_CFLAGS@
227X_EXTRA_LIBS = @X_EXTRA_LIBS@
228X_LIBS = @X_LIBS@
229X_PRE_LIBS = @X_PRE_LIBS@
230abs_builddir = @abs_builddir@
231abs_srcdir = @abs_srcdir@
232abs_top_builddir = @abs_top_builddir@
233abs_top_srcdir = @abs_top_srcdir@
234ac_ct_CC = @ac_ct_CC@
235ac_ct_CXX = @ac_ct_CXX@
236ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
237ac_ct_OBJC = @ac_ct_OBJC@
238altivec_cflags = @altivec_cflags@
239am__include = @am__include@
240am__leading_dot = @am__leading_dot@
241am__quote = @am__quote@
242am__tar = @am__tar@
243am__untar = @am__untar@
244bindir = @bindir@
245build = @build@
246build_alias = @build_alias@
247build_cpu = @build_cpu@
248build_os = @build_os@
249build_vendor = @build_vendor@
250builddir = @builddir@
251datadir = @datadir@
252datarootdir = @datarootdir@
253dlopen_libs = @dlopen_libs@
254docdir = @docdir@
255dvidir = @dvidir@
256edje_cc = @edje_cc@
257efl_doxygen = @efl_doxygen@
258efl_have_doxygen = @efl_have_doxygen@
259evas_engine_buffer_cflags = @evas_engine_buffer_cflags@
260evas_engine_buffer_libs = @evas_engine_buffer_libs@
261evas_engine_direct3d_cflags = @evas_engine_direct3d_cflags@
262evas_engine_direct3d_libs = @evas_engine_direct3d_libs@
263evas_engine_directfb_cflags = @evas_engine_directfb_cflags@
264evas_engine_directfb_libs = @evas_engine_directfb_libs@
265evas_engine_fb_cflags = @evas_engine_fb_cflags@
266evas_engine_fb_libs = @evas_engine_fb_libs@
267evas_engine_gl_cocoa_cflags = @evas_engine_gl_cocoa_cflags@
268evas_engine_gl_cocoa_libs = @evas_engine_gl_cocoa_libs@
269evas_engine_gl_common_libs = @evas_engine_gl_common_libs@
270evas_engine_gl_sdl_cflags = @evas_engine_gl_sdl_cflags@
271evas_engine_gl_sdl_libs = @evas_engine_gl_sdl_libs@
272evas_engine_gl_xcb_cflags = @evas_engine_gl_xcb_cflags@
273evas_engine_gl_xcb_libs = @evas_engine_gl_xcb_libs@
274evas_engine_gl_xlib_cflags = @evas_engine_gl_xlib_cflags@
275evas_engine_gl_xlib_libs = @evas_engine_gl_xlib_libs@
276evas_engine_psl1ght_cflags = @evas_engine_psl1ght_cflags@
277evas_engine_psl1ght_libs = @evas_engine_psl1ght_libs@
278evas_engine_software_16_ddraw_cflags = @evas_engine_software_16_ddraw_cflags@
279evas_engine_software_16_ddraw_libs = @evas_engine_software_16_ddraw_libs@
280evas_engine_software_16_sdl_cflags = @evas_engine_software_16_sdl_cflags@
281evas_engine_software_16_sdl_libs = @evas_engine_software_16_sdl_libs@
282evas_engine_software_16_wince_cflags = @evas_engine_software_16_wince_cflags@
283evas_engine_software_16_wince_libs = @evas_engine_software_16_wince_libs@
284evas_engine_software_16_x11_cflags = @evas_engine_software_16_x11_cflags@
285evas_engine_software_16_x11_libs = @evas_engine_software_16_x11_libs@
286evas_engine_software_8_x11_cflags = @evas_engine_software_8_x11_cflags@
287evas_engine_software_8_x11_libs = @evas_engine_software_8_x11_libs@
288evas_engine_software_ddraw_cflags = @evas_engine_software_ddraw_cflags@
289evas_engine_software_ddraw_libs = @evas_engine_software_ddraw_libs@
290evas_engine_software_gdi_cflags = @evas_engine_software_gdi_cflags@
291evas_engine_software_gdi_libs = @evas_engine_software_gdi_libs@
292evas_engine_software_sdl_cflags = @evas_engine_software_sdl_cflags@
293evas_engine_software_sdl_libs = @evas_engine_software_sdl_libs@
294evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@
295evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@
296evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@
297evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@
298evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@
299evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@
300evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@
301evas_image_loader_edb_libs = @evas_image_loader_edb_libs@
302evas_image_loader_eet_cflags = @evas_image_loader_eet_cflags@
303evas_image_loader_eet_libs = @evas_image_loader_eet_libs@
304evas_image_loader_generic_cflags = @evas_image_loader_generic_cflags@
305evas_image_loader_generic_libs = @evas_image_loader_generic_libs@
306evas_image_loader_gif_cflags = @evas_image_loader_gif_cflags@
307evas_image_loader_gif_libs = @evas_image_loader_gif_libs@
308evas_image_loader_ico_cflags = @evas_image_loader_ico_cflags@
309evas_image_loader_ico_libs = @evas_image_loader_ico_libs@
310evas_image_loader_jpeg_cflags = @evas_image_loader_jpeg_cflags@
311evas_image_loader_jpeg_libs = @evas_image_loader_jpeg_libs@
312evas_image_loader_pmaps_cflags = @evas_image_loader_pmaps_cflags@
313evas_image_loader_pmaps_libs = @evas_image_loader_pmaps_libs@
314evas_image_loader_png_cflags = @evas_image_loader_png_cflags@
315evas_image_loader_png_libs = @evas_image_loader_png_libs@
316evas_image_loader_psd_cflags = @evas_image_loader_psd_cflags@
317evas_image_loader_psd_libs = @evas_image_loader_psd_libs@
318evas_image_loader_svg_cflags = @evas_image_loader_svg_cflags@
319evas_image_loader_svg_libs = @evas_image_loader_svg_libs@
320evas_image_loader_tga_cflags = @evas_image_loader_tga_cflags@
321evas_image_loader_tga_libs = @evas_image_loader_tga_libs@
322evas_image_loader_tiff_cflags = @evas_image_loader_tiff_cflags@
323evas_image_loader_tiff_libs = @evas_image_loader_tiff_libs@
324evas_image_loader_wbmp_cflags = @evas_image_loader_wbmp_cflags@
325evas_image_loader_wbmp_libs = @evas_image_loader_wbmp_libs@
326evas_image_loader_xpm_cflags = @evas_image_loader_xpm_cflags@
327evas_image_loader_xpm_libs = @evas_image_loader_xpm_libs@
328exec_prefix = @exec_prefix@
329have_evas_engine_gl_x11 = @have_evas_engine_gl_x11@
330have_evas_engine_gl_xcb = @have_evas_engine_gl_xcb@
331have_evas_engine_gl_xlib = @have_evas_engine_gl_xlib@
332have_evas_engine_software_x11 = @have_evas_engine_software_x11@
333have_evas_engine_software_xcb = @have_evas_engine_software_xcb@
334have_evas_engine_software_xlib = @have_evas_engine_software_xlib@
335have_lcov = @have_lcov@
336host = @host@
337host_alias = @host_alias@
338host_cpu = @host_cpu@
339host_os = @host_os@
340host_vendor = @host_vendor@
341htmldir = @htmldir@
342includedir = @includedir@
343infodir = @infodir@
344install_sh = @install_sh@
345libdir = @libdir@
346libexecdir = @libexecdir@
347localedir = @localedir@
348localstatedir = @localstatedir@
349lt_ECHO = @lt_ECHO@
350lt_enable_auto_import = @lt_enable_auto_import@
351mandir = @mandir@
352mkdir_p = @mkdir_p@
353oldincludedir = @oldincludedir@
354pdfdir = @pdfdir@
355pkgconfig_requires_private = @pkgconfig_requires_private@
356prefix = @prefix@
357program_transform_name = @program_transform_name@
358psdir = @psdir@
359pthread_cflags = @pthread_cflags@
360pthread_libs = @pthread_libs@
361release_info = @release_info@
362requirement_evas = @requirement_evas@
363sbindir = @sbindir@
364sharedstatedir = @sharedstatedir@
365srcdir = @srcdir@
366sysconfdir = @sysconfdir@
367target_alias = @target_alias@
368top_build_prefix = @top_build_prefix@
369top_builddir = @top_builddir@
370top_srcdir = @top_srcdir@
371version_info = @version_info@
372MAINTAINERCLEANFILES = Makefile.in
373AM_CPPFLAGS = \
374-I. \
375-I$(top_srcdir)/src/lib \
376-I$(top_srcdir)/src/lib/include \
377-DPACKAGE_BIN_DIR=\"$(bindir)\" \
378-DPACKAGE_LIB_DIR=\"$(libdir)\" \
379-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
380@FREETYPE_CFLAGS@ \
381@EINA_CFLAGS@ \
382@EVIL_CFLAGS@ \
383@WIN32_CPPFLAGS@ \
384@PIXMAN_CFLAGS@
385
386AM_CFLAGS = @WIN32_CFLAGS@
387noinst_LTLIBRARIES = libevas_file.la
388libevas_file_la_SOURCES = \
389evas_path.c \
390evas_module.c
391
392libevas_file_la_LIBADD = @EINA_LIBS@ @EVIL_LIBS@
393EXTRA_DIST = evas_module.h evas_path.h
394all: all-am
395
396.SUFFIXES:
397.SUFFIXES: .c .lo .o .obj
398$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
399 @for dep in $?; do \
400 case '$(am__configure_deps)' in \
401 *$$dep*) \
402 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
403 && { if test -f $@; then exit 0; else break; fi; }; \
404 exit 1;; \
405 esac; \
406 done; \
407 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/file/Makefile'; \
408 $(am__cd) $(top_srcdir) && \
409 $(AUTOMAKE) --gnu src/lib/file/Makefile
410.PRECIOUS: Makefile
411Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
412 @case '$?' in \
413 *config.status*) \
414 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
415 *) \
416 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
417 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
418 esac;
419
420$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
421 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
422
423$(top_srcdir)/configure: $(am__configure_deps)
424 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
425$(ACLOCAL_M4): $(am__aclocal_m4_deps)
426 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
427$(am__aclocal_m4_deps):
428
429clean-noinstLTLIBRARIES:
430 -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
431 @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
432 dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
433 test "$$dir" != "$$p" || dir=.; \
434 echo "rm -f \"$${dir}/so_locations\""; \
435 rm -f "$${dir}/so_locations"; \
436 done
437libevas_file.la: $(libevas_file_la_OBJECTS) $(libevas_file_la_DEPENDENCIES)
438 $(AM_V_CCLD)$(LINK) $(libevas_file_la_OBJECTS) $(libevas_file_la_LIBADD) $(LIBS)
439
440mostlyclean-compile:
441 -rm -f *.$(OBJEXT)
442
443distclean-compile:
444 -rm -f *.tab.c
445
446@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_module.Plo@am__quote@
447@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_path.Plo@am__quote@
448
449.c.o:
450@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
451@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
452@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
453@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
454@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
455@am__fastdepCC_FALSE@ $(COMPILE) -c $<
456
457.c.obj:
458@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
459@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
460@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
461@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
462@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
463@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
464
465.c.lo:
466@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
467@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
468@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
469@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
470@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
471@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
472
473mostlyclean-libtool:
474 -rm -f *.lo
475
476clean-libtool:
477 -rm -rf .libs _libs
478
479ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
480 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
481 unique=`for i in $$list; do \
482 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
483 done | \
484 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
485 END { if (nonempty) { for (i in files) print i; }; }'`; \
486 mkid -fID $$unique
487tags: TAGS
488
489TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
490 $(TAGS_FILES) $(LISP)
491 set x; \
492 here=`pwd`; \
493 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
494 unique=`for i in $$list; do \
495 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
496 done | \
497 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
498 END { if (nonempty) { for (i in files) print i; }; }'`; \
499 shift; \
500 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
501 test -n "$$unique" || unique=$$empty_fix; \
502 if test $$# -gt 0; then \
503 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
504 "$$@" $$unique; \
505 else \
506 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
507 $$unique; \
508 fi; \
509 fi
510ctags: CTAGS
511CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
512 $(TAGS_FILES) $(LISP)
513 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
514 unique=`for i in $$list; do \
515 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
516 done | \
517 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
518 END { if (nonempty) { for (i in files) print i; }; }'`; \
519 test -z "$(CTAGS_ARGS)$$unique" \
520 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
521 $$unique
522
523GTAGS:
524 here=`$(am__cd) $(top_builddir) && pwd` \
525 && $(am__cd) $(top_srcdir) \
526 && gtags -i $(GTAGS_ARGS) "$$here"
527
528distclean-tags:
529 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
530
531distdir: $(DISTFILES)
532 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
533 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
534 list='$(DISTFILES)'; \
535 dist_files=`for file in $$list; do echo $$file; done | \
536 sed -e "s|^$$srcdirstrip/||;t" \
537 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
538 case $$dist_files in \
539 */*) $(MKDIR_P) `echo "$$dist_files" | \
540 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
541 sort -u` ;; \
542 esac; \
543 for file in $$dist_files; do \
544 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
545 if test -d $$d/$$file; then \
546 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
547 if test -d "$(distdir)/$$file"; then \
548 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
549 fi; \
550 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
551 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
552 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
553 fi; \
554 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
555 else \
556 test -f "$(distdir)/$$file" \
557 || cp -p $$d/$$file "$(distdir)/$$file" \
558 || exit 1; \
559 fi; \
560 done
561check-am: all-am
562check: check-am
563all-am: Makefile $(LTLIBRARIES)
564installdirs:
565install: install-am
566install-exec: install-exec-am
567install-data: install-data-am
568uninstall: uninstall-am
569
570install-am: all-am
571 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
572
573installcheck: installcheck-am
574install-strip:
575 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
576 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
577 `test -z '$(STRIP)' || \
578 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
579mostlyclean-generic:
580
581clean-generic:
582
583distclean-generic:
584 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
585 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
586
587maintainer-clean-generic:
588 @echo "This command is intended for maintainers to use"
589 @echo "it deletes files that may require special tools to rebuild."
590 -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
591clean: clean-am
592
593clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
594 mostlyclean-am
595
596distclean: distclean-am
597 -rm -rf ./$(DEPDIR)
598 -rm -f Makefile
599distclean-am: clean-am distclean-compile distclean-generic \
600 distclean-tags
601
602dvi: dvi-am
603
604dvi-am:
605
606html: html-am
607
608html-am:
609
610info: info-am
611
612info-am:
613
614install-data-am:
615
616install-dvi: install-dvi-am
617
618install-dvi-am:
619
620install-exec-am:
621
622install-html: install-html-am
623
624install-html-am:
625
626install-info: install-info-am
627
628install-info-am:
629
630install-man:
631
632install-pdf: install-pdf-am
633
634install-pdf-am:
635
636install-ps: install-ps-am
637
638install-ps-am:
639
640installcheck-am:
641
642maintainer-clean: maintainer-clean-am
643 -rm -rf ./$(DEPDIR)
644 -rm -f Makefile
645maintainer-clean-am: distclean-am maintainer-clean-generic
646
647mostlyclean: mostlyclean-am
648
649mostlyclean-am: mostlyclean-compile mostlyclean-generic \
650 mostlyclean-libtool
651
652pdf: pdf-am
653
654pdf-am:
655
656ps: ps-am
657
658ps-am:
659
660uninstall-am:
661
662.MAKE: install-am install-strip
663
664.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
665 clean-libtool clean-noinstLTLIBRARIES ctags distclean \
666 distclean-compile distclean-generic distclean-libtool \
667 distclean-tags distdir dvi dvi-am html html-am info info-am \
668 install install-am install-data install-data-am install-dvi \
669 install-dvi-am install-exec install-exec-am install-html \
670 install-html-am install-info install-info-am install-man \
671 install-pdf install-pdf-am install-ps install-ps-am \
672 install-strip installcheck installcheck-am installdirs \
673 maintainer-clean maintainer-clean-generic mostlyclean \
674 mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
675 pdf pdf-am ps ps-am tags uninstall uninstall-am
676
677
678# Tell versions [3.59,3.63) of GNU make to not export all variables.
679# Otherwise a system limit (for SysV at least) may be exceeded.
680.NOEXPORT:
diff --git a/libraries/evas/src/lib/file/evas_module.c b/libraries/evas/src/lib/file/evas_module.c
new file mode 100644
index 0000000..6b4d4f6
--- /dev/null
+++ b/libraries/evas/src/lib/file/evas_module.c
@@ -0,0 +1,586 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#include <string.h>
6
7#include <evas_common.h>
8#include <evas_private.h>
9#include <evas_module.h>
10
11
12static Eina_Hash *evas_modules[4] = {
13 NULL,
14 NULL,
15 NULL,
16 NULL
17};
18
19static Eina_List *eina_evas_modules = NULL;
20static Eina_List *evas_module_paths = NULL;
21static Eina_Array *evas_engines = NULL;
22
23static Eina_List *
24_evas_module_append(Eina_List *list, char *path)
25{
26 if (path)
27 {
28 if (evas_file_path_exists(path))
29 list = eina_list_append(list, path);
30 else
31 free(path);
32 }
33 return list;
34}
35
36/* this will alloc a list of paths to search for the modules */
37/* by now these are: */
38/* 1. ~/.evas/modules/ */
39/* 2. $(EVAS_MODULE_DIR)/evas/modules/ */
40/* 3. dladdr/evas/modules/ */
41/* 4. PREFIX/evas/modules/ */
42void
43evas_module_paths_init(void)
44{
45 char *path;
46
47 /* 1. ~/.evas/modules/ */
48 path = eina_module_environment_path_get("HOME", "/.evas/modules");
49 evas_module_paths = _evas_module_append(evas_module_paths, path);
50
51 /* 2. $(EVAS_MODULE_DIR)/evas/modules/ */
52 path = eina_module_environment_path_get("EVAS_MODULES_DIR", "/evas/modules");
53 if (eina_list_search_unsorted(evas_module_paths, (Eina_Compare_Cb) strcmp, path))
54 free(path);
55 else
56 evas_module_paths = _evas_module_append(evas_module_paths, path);
57
58 /* 3. libevas.so/../evas/modules/ */
59 path = eina_module_symbol_path_get(evas_module_paths_init, "/evas/modules");
60 if (eina_list_search_unsorted(evas_module_paths, (Eina_Compare_Cb) strcmp, path))
61 free(path);
62 else
63 evas_module_paths = _evas_module_append(evas_module_paths, path);
64
65 /* 4. PREFIX/evas/modules/ */
66#ifndef _MSC_VER
67 path = PACKAGE_LIB_DIR "/evas/modules";
68 if (!eina_list_search_unsorted(evas_module_paths, (Eina_Compare_Cb) strcmp, path))
69 {
70 path = strdup(path);
71 if (path)
72 evas_module_paths = _evas_module_append(evas_module_paths, path);
73 }
74#endif
75}
76
77#define EVAS_EINA_STATIC_MODULE_DEFINE(Tn, Name) \
78 Eina_Bool evas_##Tn##_##Name##_init(void); \
79 void evas_##Tn##_##Name##_shutdown(void);
80
81#define EVAS_EINA_STATIC_MODULE_USE(Tn, Name) \
82 { evas_##Tn##_##Name##_init, evas_##Tn##_##Name##_shutdown }
83
84EVAS_EINA_STATIC_MODULE_DEFINE(engine, buffer);
85EVAS_EINA_STATIC_MODULE_DEFINE(engine, direct3d);
86EVAS_EINA_STATIC_MODULE_DEFINE(engine, directfb);
87EVAS_EINA_STATIC_MODULE_DEFINE(engine, fb);
88EVAS_EINA_STATIC_MODULE_DEFINE(engine, gl_x11);
89EVAS_EINA_STATIC_MODULE_DEFINE(engine, gl_sdl);
90EVAS_EINA_STATIC_MODULE_DEFINE(engine, psl1ght);
91EVAS_EINA_STATIC_MODULE_DEFINE(engine, software_16);
92EVAS_EINA_STATIC_MODULE_DEFINE(engine, software_16_ddraw);
93EVAS_EINA_STATIC_MODULE_DEFINE(engine, software_16_sdl);
94EVAS_EINA_STATIC_MODULE_DEFINE(engine, software_16_wince);
95EVAS_EINA_STATIC_MODULE_DEFINE(engine, software_16_x11);
96EVAS_EINA_STATIC_MODULE_DEFINE(engine, software_8);
97EVAS_EINA_STATIC_MODULE_DEFINE(engine, software_8_x11);
98EVAS_EINA_STATIC_MODULE_DEFINE(engine, software_ddraw);
99EVAS_EINA_STATIC_MODULE_DEFINE(engine, software_gdi);
100EVAS_EINA_STATIC_MODULE_DEFINE(engine, software_generic);
101EVAS_EINA_STATIC_MODULE_DEFINE(engine, software_sdl);
102EVAS_EINA_STATIC_MODULE_DEFINE(engine, software_x11);
103EVAS_EINA_STATIC_MODULE_DEFINE(image_loader, bmp);
104EVAS_EINA_STATIC_MODULE_DEFINE(image_loader, edb);
105EVAS_EINA_STATIC_MODULE_DEFINE(image_loader, eet);
106EVAS_EINA_STATIC_MODULE_DEFINE(image_loader, generic);
107EVAS_EINA_STATIC_MODULE_DEFINE(image_loader, gif);
108EVAS_EINA_STATIC_MODULE_DEFINE(image_loader, ico);
109EVAS_EINA_STATIC_MODULE_DEFINE(image_loader, jpeg);
110EVAS_EINA_STATIC_MODULE_DEFINE(image_loader, pmaps);
111EVAS_EINA_STATIC_MODULE_DEFINE(image_loader, png);
112EVAS_EINA_STATIC_MODULE_DEFINE(image_loader, psd);
113EVAS_EINA_STATIC_MODULE_DEFINE(image_loader, svg);
114EVAS_EINA_STATIC_MODULE_DEFINE(image_loader, tga);
115EVAS_EINA_STATIC_MODULE_DEFINE(image_loader, tiff);
116EVAS_EINA_STATIC_MODULE_DEFINE(image_loader, wbmp);
117EVAS_EINA_STATIC_MODULE_DEFINE(image_loader, xpm);
118EVAS_EINA_STATIC_MODULE_DEFINE(image_saver, edb);
119EVAS_EINA_STATIC_MODULE_DEFINE(image_saver, eet);
120EVAS_EINA_STATIC_MODULE_DEFINE(image_saver, jpeg);
121EVAS_EINA_STATIC_MODULE_DEFINE(image_saver, png);
122EVAS_EINA_STATIC_MODULE_DEFINE(image_saver, tiff);
123
124static const struct {
125 Eina_Bool (*init)(void);
126 void (*shutdown)(void);
127} evas_static_module[] = {
128#ifdef EVAS_STATIC_BUILD_BUFFER
129 EVAS_EINA_STATIC_MODULE_USE(engine, buffer),
130#endif
131#ifdef EVAS_STATIC_BUILD_DIRECT3D
132 EVAS_EINA_STATIC_MODULE_USE(engine, direct3d),
133#endif
134#ifdef EVAS_STATIC_BUILD_DIRECTFB
135 EVAS_EINA_STATIC_MODULE_USE(engine, directfb),
136#endif
137#ifdef EVAS_STATIC_BUILD_FB
138 EVAS_EINA_STATIC_MODULE_USE(engine, fb),
139#endif
140#ifdef EVAS_STATIC_BUILD_GL_X11
141 EVAS_EINA_STATIC_MODULE_USE(engine, gl_x11),
142#endif
143#ifdef EVAS_STATIC_BUILD_GL_SDL
144 EVAS_EINA_STATIC_MODULE_USE(engine, gl_sdl),
145#endif
146#ifdef EVAS_STATIC_BUILD_PSL1GHT
147 EVAS_EINA_STATIC_MODULE_USE(engine, psl1ght),
148#endif
149#ifdef EVAS_STATIC_BUILD_SOFTWARE_16
150 EVAS_EINA_STATIC_MODULE_USE(engine, software_16),
151#endif
152#ifdef EVAS_STATIC_BUILD_SOFTWARE_16_DDRAW
153 EVAS_EINA_STATIC_MODULE_USE(engine, software_16_ddraw),
154#endif
155#ifdef EVAS_STATIC_BUILD_SOFTWARE_16_SDL
156 EVAS_EINA_STATIC_MODULE_USE(engine, software_16_sdl),
157#endif
158#ifdef EVAS_STATIC_BUILD_SOFTWARE_16_WINCE
159 EVAS_EINA_STATIC_MODULE_USE(engine, software_16_wince),
160#endif
161#ifdef EVAS_STATIC_BUILD_SOFTWARE_16_X11
162 EVAS_EINA_STATIC_MODULE_USE(engine, software_16_x11),
163#endif
164#ifdef EVAS_STATIC_BUILD_SOFTWARE_16_DDRAW
165 EVAS_EINA_STATIC_MODULE_USE(engine, software_ddraw),
166#endif
167#ifdef EVAS_STATIC_BUILD_SOFTWARE_16_GDI
168 EVAS_EINA_STATIC_MODULE_USE(engine, software_gdi),
169#endif
170#ifdef EVAS_STATIC_BUILD_SOFTWARE_8
171 EVAS_EINA_STATIC_MODULE_USE(engine, software_8),
172#endif
173#ifdef EVAS_STATIC_BUILD_SOFTWARE_8_X11
174 EVAS_EINA_STATIC_MODULE_USE(engine, software_8_x11),
175#endif
176#ifdef EVAS_STATIC_BUILD_SOFTWARE_GENERIC
177 EVAS_EINA_STATIC_MODULE_USE(engine, software_generic),
178#endif
179#ifdef EVAS_STATIC_BUILD_SOFTWARE_SDL
180 EVAS_EINA_STATIC_MODULE_USE(engine, software_sdl),
181#endif
182#ifdef EVAS_STATIC_BUILD_SOFTWARE_X11
183 EVAS_EINA_STATIC_MODULE_USE(engine, software_x11),
184#endif
185#ifdef EVAS_STATIC_BUILD_BMP
186 EVAS_EINA_STATIC_MODULE_USE(image_loader, bmp),
187#endif
188#ifdef EVAS_STATIC_BUILD_EDB
189 EVAS_EINA_STATIC_MODULE_USE(image_loader, edb),
190#endif
191#ifdef EVAS_STATIC_BUILD_EET
192 EVAS_EINA_STATIC_MODULE_USE(image_loader, eet),
193#endif
194#ifdef EVAS_STATIC_BUILD_GENERIC
195 EVAS_EINA_STATIC_MODULE_USE(image_loader, generic),
196#endif
197#ifdef EVAS_STATIC_BUILD_GIF
198 EVAS_EINA_STATIC_MODULE_USE(image_loader, gif),
199#endif
200#ifdef EVAS_STATIC_BUILD_ICO
201 EVAS_EINA_STATIC_MODULE_USE(image_loader, ico),
202#endif
203#ifdef EVAS_STATIC_BUILD_JPEG
204 EVAS_EINA_STATIC_MODULE_USE(image_loader, jpeg),
205#endif
206#ifdef EVAS_STATIC_BUILD_PMAPS
207 EVAS_EINA_STATIC_MODULE_USE(image_loader, pmaps),
208#endif
209#ifdef EVAS_STATIC_BUILD_PNG
210 EVAS_EINA_STATIC_MODULE_USE(image_loader, png),
211#endif
212#ifdef EVAS_STATIC_BUILD_PSD
213 EVAS_EINA_STATIC_MODULE_USE(image_loader, psd),
214#endif
215#ifdef EVAS_STATIC_BUILD_SVG
216 EVAS_EINA_STATIC_MODULE_USE(image_loader, svg),
217#endif
218#ifdef EVAS_STATIC_BUILD_TGA
219 EVAS_EINA_STATIC_MODULE_USE(image_loader, tga),
220#endif
221#ifdef EVAS_STATIC_BUILD_TIFF
222 EVAS_EINA_STATIC_MODULE_USE(image_loader, tiff),
223#endif
224#ifdef EVAS_STATIC_BUILD_WBMP
225 EVAS_EINA_STATIC_MODULE_USE(image_loader, wbmp),
226#endif
227#ifdef EVAS_STATIC_BUILD_XPM
228 EVAS_EINA_STATIC_MODULE_USE(image_loader, xpm),
229#endif
230#ifdef EVAS_STATIC_BUILD_EDB
231 EVAS_EINA_STATIC_MODULE_USE(image_saver, edb),
232#endif
233#ifdef EVAS_STATIC_BUILD_EET
234 EVAS_EINA_STATIC_MODULE_USE(image_saver, eet),
235#endif
236#if defined (EVAS_BUILD_SAVER_JPEG) && defined (EVAS_STATIC_BUILD_JPEG)
237 EVAS_EINA_STATIC_MODULE_USE(image_saver, jpeg),
238#endif
239#ifdef EVAS_STATIC_BUILD_PNG
240 EVAS_EINA_STATIC_MODULE_USE(image_saver, png),
241#endif
242#ifdef EVAS_STATIC_BUILD_TIFF
243 EVAS_EINA_STATIC_MODULE_USE(image_saver, tiff),
244#endif
245 { NULL, NULL }
246};
247
248/* this will alloc an Evas_Module struct for each module
249 * it finds on the paths */
250void
251evas_module_init(void)
252{
253 int i;
254
255 evas_module_paths_init();
256
257 evas_modules[EVAS_MODULE_TYPE_ENGINE] = eina_hash_string_small_new(/* FIXME: Add a function to cleanup stuff. */ NULL);
258 evas_modules[EVAS_MODULE_TYPE_IMAGE_LOADER] = eina_hash_string_small_new(/* FIXME: Add a function to cleanup stuff. */ NULL);
259 evas_modules[EVAS_MODULE_TYPE_IMAGE_SAVER] = eina_hash_string_small_new(/* FIXME: Add a function to cleanup stuff. */ NULL);
260 evas_modules[EVAS_MODULE_TYPE_OBJECT] = eina_hash_string_small_new(/* FIXME: Add a function to cleanup stuff. */ NULL);
261
262 evas_engines = eina_array_new(4);
263
264 for (i = 0; evas_static_module[i].init; ++i)
265 evas_static_module[i].init();
266}
267
268Eina_Bool
269evas_module_register(const Evas_Module_Api *module, Evas_Module_Type type)
270{
271 Evas_Module *em;
272
273 if ((unsigned int)type > 3) return EINA_FALSE;
274 if (!module) return EINA_FALSE;
275 if (module->version != EVAS_MODULE_API_VERSION) return EINA_FALSE;
276
277 em = eina_hash_find(evas_modules[type], module->name);
278 if (em) return EINA_FALSE;
279
280 em = calloc(1, sizeof (Evas_Module));
281 if (!em) return EINA_FALSE;
282
283 em->definition = module;
284
285 if (type == EVAS_MODULE_TYPE_ENGINE)
286 {
287 eina_array_push(evas_engines, em);
288 em->id_engine = eina_array_count_get(evas_engines);
289 }
290
291 eina_hash_direct_add(evas_modules[type], module->name, em);
292
293 return EINA_TRUE;
294}
295
296Eina_List *
297evas_module_engine_list(void)
298{
299 Evas_Module *em;
300 Eina_List *r = NULL;
301 Eina_Array_Iterator iterator;
302 unsigned int i;
303
304 EINA_ARRAY_ITER_NEXT(evas_engines, i, em, iterator)
305 r = eina_list_append(r, em->definition->name);
306
307 return r;
308}
309
310Eina_Bool
311evas_module_unregister(const Evas_Module_Api *module, Evas_Module_Type type)
312{
313 Evas_Module *em;
314
315 if ((unsigned int)type > 3) return EINA_FALSE;
316 if (!module) return EINA_FALSE;
317
318 em = eina_hash_find(evas_modules[type], module->name);
319 if (!em || em->definition != module) return EINA_FALSE;
320
321 if (type == EVAS_MODULE_TYPE_ENGINE)
322 eina_array_data_set(evas_engines, em->id_engine, NULL);
323
324 eina_hash_del(evas_modules[type], module->name, em);
325 free(em);
326
327 return EINA_TRUE;
328}
329
330#if defined(__CEGCC__) || defined(__MINGW32CE__)
331# define EVAS_MODULE_NAME_IMAGE_SAVER "saver_%s.dll"
332# define EVAS_MODULE_NAME_IMAGE_LOADER "loader_%s.dll"
333# define EVAS_MODULE_NAME_ENGINE "engine_%s.dll"
334# define EVAS_MODULE_NAME_OBJECT "object_%s.dll"
335#elif _WIN32
336# define EVAS_MODULE_NAME_IMAGE_SAVER "module.dll"
337# define EVAS_MODULE_NAME_IMAGE_LOADER "module.dll"
338# define EVAS_MODULE_NAME_ENGINE "module.dll"
339# define EVAS_MODULE_NAME_OBJECT "module.dll"
340#else
341# define EVAS_MODULE_NAME_IMAGE_SAVER "module.so"
342# define EVAS_MODULE_NAME_IMAGE_LOADER "module.so"
343# define EVAS_MODULE_NAME_ENGINE "module.so"
344# define EVAS_MODULE_NAME_OBJECT "module.so"
345#endif
346
347Evas_Module *
348evas_module_find_type(Evas_Module_Type type, const char *name)
349{
350 const char *path;
351 const char *format = NULL;
352 char buffer[4096];
353 Evas_Module *em;
354 Eina_Module *en;
355 Eina_List *l;
356
357 if ((unsigned int)type > 3) return NULL;
358
359 em = eina_hash_find(evas_modules[type], name);
360 if (em) return em;
361
362 EINA_LIST_FOREACH(evas_module_paths, l, path)
363 {
364 switch (type)
365 {
366 case EVAS_MODULE_TYPE_ENGINE: format = "%s/engines/%s/%s/" EVAS_MODULE_NAME_ENGINE; break;
367 case EVAS_MODULE_TYPE_IMAGE_LOADER: format = "%s/loaders/%s/%s/" EVAS_MODULE_NAME_IMAGE_LOADER; break;
368 case EVAS_MODULE_TYPE_IMAGE_SAVER: format = "%s/savers/%s/%s/" EVAS_MODULE_NAME_IMAGE_SAVER; break;
369 case EVAS_MODULE_TYPE_OBJECT: format = "%s/object/%s/%s/" EVAS_MODULE_NAME_OBJECT; break;
370 }
371
372 snprintf(buffer, sizeof (buffer), format, path, name, MODULE_ARCH, name);
373 if (!evas_file_path_is_file(buffer)) continue;
374
375 en = eina_module_new(buffer);
376 if (!en) continue;
377
378 if (!eina_module_load(en))
379 {
380 eina_module_free(en);
381 continue;
382 }
383
384 em = eina_hash_find(evas_modules[type], name);
385 if (em)
386 {
387 eina_evas_modules = eina_list_append(eina_evas_modules, en);
388 return em;
389 }
390
391 eina_module_free(en);
392 }
393
394 return NULL;
395}
396
397Evas_Module *
398evas_module_engine_get(int render_method)
399{
400 if ((render_method <= 0) ||
401 ((unsigned int)render_method > eina_array_count_get(evas_engines)))
402 return NULL;
403 return eina_array_data_get(evas_engines, render_method - 1);
404}
405
406void
407evas_module_foreach_image_loader(Eina_Hash_Foreach cb, const void *fdata)
408{
409 eina_hash_foreach(evas_modules[EVAS_MODULE_TYPE_IMAGE_LOADER], cb, fdata);
410}
411
412int
413evas_module_load(Evas_Module *em)
414{
415 if (em->loaded) return 1;
416 if (!em->definition) return 0;
417
418 if (!em->definition->func.open(em)) return 0;
419 em->loaded = 1;
420
421#ifdef BUILD_ASYNC_PRELOAD
422 LKI(em->lock);
423#endif
424 return 1;
425}
426
427void
428evas_module_unload(Evas_Module *em)
429{
430 if (!em->loaded)
431 return;
432 if (!em->definition)
433 return ;
434
435// for now lets not unload modules - they may still be in use.
436// em->definition->func.close(em);
437// em->loaded = 0;
438
439#ifdef BUILD_ASYNC_PRELOAD
440 LKD(em->lock);
441#endif
442}
443
444void
445evas_module_ref(Evas_Module *em)
446{
447#ifdef BUILD_ASYNC_PRELOAD
448 LKL(em->lock);
449#endif
450 em->ref++;
451#ifdef BUILD_ASYNC_PRELOAD
452 LKU(em->lock);
453#endif
454}
455
456void
457evas_module_unref(Evas_Module *em)
458{
459#ifdef BUILD_ASYNC_PRELOAD
460 LKL(em->lock);
461#endif
462 em->ref--;
463#ifdef BUILD_ASYNC_PRELOAD
464 LKU(em->lock);
465#endif
466}
467
468static int use_count = 0;
469
470void
471evas_module_use(Evas_Module *em)
472{
473 em->last_used = use_count;
474}
475
476void
477evas_module_clean(void)
478{
479 static int call_count = 0;
480/* int ago; */
481 int noclean = -1;
482/* Eina_List *l; */
483/* Evas_Module *em; */
484
485 /* only clean modules every 256 calls */
486 call_count++;
487 if (call_count <= 256) return;
488 call_count = 0;
489
490 if (noclean == -1)
491 {
492 if (getenv("EVAS_NOCLEAN"))
493 noclean = 1;
494 else
495 noclean = 0;
496 }
497 if (noclean == 1) return;
498
499 /* disable module cleaning for now - may cause instability with some modules */
500 return;
501
502 /* FIXME: Don't know what it is supposed to do. */
503/* /\* incriment use counter = 28bits *\/ */
504/* use_count++; */
505/* if (use_count > 0x0fffffff) use_count = 0; */
506
507/* /\* printf("CLEAN!\n"); *\/ */
508/* /\* go through all modules *\/ */
509/* EINA_LIST_FOREACH(evas_modules, l, em) */
510/* { */
511/* /\* printf("M %s %i %i\n", em->name, em->ref, em->loaded); *\/ */
512/* /\* if the module is refernced - skip *\/ */
513/* if ((em->ref > 0) || (!em->loaded)) continue; */
514/* /\* how many clean cycles ago was this module last used *\/ */
515/* ago = use_count - em->last_used; */
516/* if (em->last_used > use_count) ago += 0x10000000; */
517/* /\* if it was used last more than N clean cycles ago - unload *\/ */
518/* if (ago > 5) */
519/* { */
520/* /\* printf(" UNLOAD %s\n", em->name); *\/ */
521/* evas_module_unload(em); */
522/* } */
523/* } */
524}
525
526/* will dlclose all the modules loaded and free all the structs */
527void
528evas_module_shutdown(void)
529{
530 Eina_Module *en;
531 char *path;
532 int i;
533
534 for (i = 0; evas_static_module[i].shutdown; ++i)
535 evas_static_module[i].shutdown();
536
537 EINA_LIST_FREE(eina_evas_modules, en)
538 eina_module_free(en);
539
540 eina_hash_free(evas_modules[EVAS_MODULE_TYPE_ENGINE]);
541 evas_modules[EVAS_MODULE_TYPE_ENGINE] = NULL;
542 eina_hash_free(evas_modules[EVAS_MODULE_TYPE_IMAGE_LOADER]);
543 evas_modules[EVAS_MODULE_TYPE_IMAGE_LOADER] = NULL;
544 eina_hash_free(evas_modules[EVAS_MODULE_TYPE_IMAGE_SAVER]);
545 evas_modules[EVAS_MODULE_TYPE_IMAGE_SAVER] = NULL;
546 eina_hash_free(evas_modules[EVAS_MODULE_TYPE_OBJECT]);
547 evas_modules[EVAS_MODULE_TYPE_OBJECT] = NULL;
548
549 EINA_LIST_FREE(evas_module_paths, path)
550 free(path);
551
552 eina_array_free(evas_engines);
553 evas_engines = NULL;
554}
555
556EAPI int
557_evas_module_engine_inherit(Evas_Func *funcs, char *name)
558{
559 Evas_Module *em;
560
561 em = evas_module_find_type(EVAS_MODULE_TYPE_ENGINE, name);
562 if (em)
563 {
564 if (evas_module_load(em))
565 {
566 /* FIXME: no way to unref */
567 evas_module_ref(em);
568 evas_module_use(em);
569 *funcs = *((Evas_Func *)(em->functions));
570 return 1;
571 }
572 }
573 return 0;
574}
575
576static Eina_Prefix *pfx = NULL;
577
578EAPI const char *
579_evas_module_libdir_get(void)
580{
581 if (!pfx) pfx = eina_prefix_new
582 (NULL, _evas_module_libdir_get, "EVAS", "evas", NULL,
583 PACKAGE_BIN_DIR, PACKAGE_LIB_DIR, PACKAGE_DATA_DIR, PACKAGE_DATA_DIR);
584 if (!pfx) return NULL;
585 return eina_prefix_lib_get(pfx);
586}
diff --git a/libraries/evas/src/lib/file/evas_module.h b/libraries/evas/src/lib/file/evas_module.h
new file mode 100644
index 0000000..8699b6b
--- /dev/null
+++ b/libraries/evas/src/lib/file/evas_module.h
@@ -0,0 +1,94 @@
1#ifndef _EVAS_MODULE_H
2#define _EVAS_MODULE_H
3
4
5/* the module api version */
6#define EVAS_MODULE_API_VERSION 2
7
8
9/* the module types */
10typedef enum _Evas_Module_Type
11{
12 EVAS_MODULE_TYPE_ENGINE = 0,
13 EVAS_MODULE_TYPE_IMAGE_LOADER = 1,
14 EVAS_MODULE_TYPE_IMAGE_SAVER = 2,
15 EVAS_MODULE_TYPE_OBJECT = 3
16} Evas_Module_Type;
17
18
19typedef struct _Evas_Module_Api Evas_Module_Api;
20typedef struct _Evas_Module Evas_Module;
21typedef struct _Evas_Module_Path Evas_Module_Path;
22typedef struct _Evas_Module_Engine Evas_Module_Engine;
23typedef struct _Evas_Module_Public Evas_Module_Public;
24
25/* the module api structure, all modules should define this struct */
26struct _Evas_Module_Api
27{
28 int version;
29 const char *name;
30 const char *author;
31
32 struct
33 {
34 int (*open)(Evas_Module *);
35 void (*close)(Evas_Module *);
36 } func;
37};
38
39/* the module structure */
40struct _Evas_Module
41{
42 const Evas_Module_Api *definition;
43
44 void *functions; /* this are the functions exported by the module */
45 int id_engine; /* some internal data for the module i.e the id for engines */
46
47 int ref; /* how many refs */
48 int last_used; /* the cycle count when it was last used */
49
50 LK(lock);
51
52 unsigned char loaded : 1;
53};
54
55
56/* the internals of the module api use this struct to reference a path with a module type
57 * instead of deduce the type from the path.
58 * */
59struct _Evas_Module_Path
60{
61 Evas_Module_Type type;
62 char *path;
63};
64
65void evas_module_paths_init (void);
66void evas_module_init (void);
67Evas_Module *evas_module_find_type (Evas_Module_Type type, const char *name);
68Evas_Module *evas_module_engine_get(int render_method);
69void evas_module_foreach_image_loader(Eina_Hash_Foreach cb, const void *fdata);
70int evas_module_load (Evas_Module *em);
71void evas_module_unload (Evas_Module *em);
72void evas_module_ref (Evas_Module *em);
73void evas_module_unref (Evas_Module *em);
74void evas_module_use (Evas_Module *em);
75void evas_module_clean (void);
76void evas_module_shutdown (void);
77EAPI Eina_Bool evas_module_register (const Evas_Module_Api *module, Evas_Module_Type type);
78EAPI Eina_Bool evas_module_unregister (const Evas_Module_Api *module, Evas_Module_Type type);
79
80#define EVAS_MODULE_DEFINE(Type, Tn, Name) \
81 Eina_Bool evas_##Tn##_##Name##_init(void) \
82 { \
83 return evas_module_register(&evas_modapi, Type); \
84 } \
85 void evas_##Tn##_##Name##_shutdown(void) \
86 { \
87 evas_module_unregister(&evas_modapi, Type); \
88 }
89
90#define EVAS_EINA_MODULE_DEFINE(Tn, Name) \
91 EINA_MODULE_INIT(evas_##Tn##_##Name##_init); \
92 EINA_MODULE_SHUTDOWN(evas_##Tn##_##Name##_shutdown);
93
94#endif /* _EVAS_MODULE_H */
diff --git a/libraries/evas/src/lib/file/evas_path.c b/libraries/evas/src/lib/file/evas_path.c
new file mode 100644
index 0000000..ff13e20
--- /dev/null
+++ b/libraries/evas/src/lib/file/evas_path.c
@@ -0,0 +1,154 @@
1/* os dependent file code. for unix-y like fs's only for now */
2/* if your os doesn't use unix-like fs starting with "/" for the root and */
3/* the file path separator isn't "/" then you may need to help out by */
4/* adding in a new set of functions here */
5
6#ifdef HAVE_CONFIG_H
7# include <config.h>
8#endif
9
10#include <limits.h>
11#include <stdlib.h>
12#include <sys/types.h>
13#include <sys/stat.h>
14/* get the casefold feature! */
15#include <fnmatch.h>
16#ifndef _MSC_VER
17# include <unistd.h>
18# include <sys/param.h>
19#endif
20
21#ifdef HAVE_EVIL
22# include <Evil.h>
23#endif
24
25#include "evas_common.h"
26#include "evas_private.h"
27
28#ifdef _WIN32
29# define EVAS_PATH_SEPARATOR "\\"
30#else
31# define EVAS_PATH_SEPARATOR "/"
32#endif
33
34int
35evas_file_path_is_full_path(const char *path)
36{
37 if (!path) return 0;
38#if defined _WIN32_WCE
39 if (path[0] == '\\') return 1;
40#elif defined _WIN32
41 if ((path[0] == '\0') || (path[1] == '\0'))
42 return 0;
43 if (path[1] == ':') return 1;
44#else
45 if (path[0] == '/') return 1;
46#endif
47 return 0;
48}
49
50char *
51evas_file_path_join(const char *path, const char *end)
52{
53 char *res = NULL;
54 size_t len;
55
56 if ((!path) && (!end)) return NULL;
57 if (!path) return strdup(end);
58 if (!end) return strdup(path);
59 len = strlen(path);
60 len += strlen(end);
61 len += strlen(EVAS_PATH_SEPARATOR);
62 res = malloc(len + 1);
63 if (!res) return NULL;
64 strcpy(res, path);
65 strcat(res, EVAS_PATH_SEPARATOR);
66 strcat(res, end);
67 return res;
68}
69
70int
71evas_file_path_exists(const char *path)
72{
73 struct stat st;
74
75 if (!stat(path, &st)) return 1;
76 return 0;
77}
78
79int
80evas_file_path_is_file(const char *path)
81{
82 struct stat st;
83
84 if (stat(path, &st) == -1) return 0;
85 if (S_ISREG(st.st_mode)) return 1;
86 return 0;
87}
88
89int
90evas_file_path_is_dir(const char *path)
91{
92 struct stat st;
93
94 if (stat(path, &st) == -1) return 0;
95 if (S_ISDIR(st.st_mode)) return 1;
96 return 0;
97}
98
99Eina_List *
100evas_file_path_list(char *path, const char *match, int match_case)
101{
102 Eina_File_Direct_Info *info;
103 Eina_Iterator *it;
104 Eina_List *files = NULL;
105 int flags;
106
107 flags = FNM_PATHNAME;
108#ifdef FNM_CASEFOLD
109 if (!match_case)
110 flags |= FNM_CASEFOLD;
111#else
112/*#warning "Your libc does not provide case-insensitive matching!"*/
113#endif
114
115 it = eina_file_direct_ls(path);
116 EINA_ITERATOR_FOREACH(it, info)
117 {
118 if (match)
119 {
120 if (fnmatch(match, info->path + info->name_start, flags) == 0)
121 files = eina_list_append(files, strdup(info->path + info->name_start));
122 }
123 else
124 files = eina_list_append(files, strdup(info->path + info->name_start));
125 }
126 eina_iterator_free(it);
127 return files;
128}
129
130DATA64
131evas_file_modified_time(const char *file)
132{
133 struct stat st;
134
135 if (stat(file, &st) < 0) return 0;
136 if (st.st_ctime > st.st_mtime) return (DATA64)st.st_ctime;
137 else return (DATA64)st.st_mtime;
138 return 0;
139}
140
141char *
142evas_file_path_resolve(const char *file)
143{
144#if 0
145 char buf[PATH_MAX], *buf2;
146#endif
147
148 return strdup(file);
149#if 0
150 if (!realpath(file, buf)) return NULL;
151 buf2 = strdup(buf);
152 return buf2;
153#endif
154}
diff --git a/libraries/evas/src/lib/file/evas_path.h b/libraries/evas/src/lib/file/evas_path.h
new file mode 100644
index 0000000..e0aa6bb
--- /dev/null
+++ b/libraries/evas/src/lib/file/evas_path.h
@@ -0,0 +1,15 @@
1#ifndef _EVAS_PATH_H
2#define _EVAS_PATH_H
3
4
5int evas_file_path_is_full_path (const char *path);
6char *evas_file_path_join (const char *path, const char *end);
7int evas_file_path_exists (const char *path);
8int evas_file_path_is_file (const char *path);
9int evas_file_path_is_dir (const char *path);
10Eina_List *evas_file_path_list (char *path, const char *match, int match_case);
11DATA64 evas_file_modified_time (const char *file);
12char *evas_file_path_resolve (const char *file);
13
14
15#endif /* _EVAS_PATH_H */
diff --git a/libraries/evas/src/lib/include/Makefile.am b/libraries/evas/src/lib/include/Makefile.am
new file mode 100644
index 0000000..5c986c2
--- /dev/null
+++ b/libraries/evas/src/lib/include/Makefile.am
@@ -0,0 +1,13 @@
1
2MAINTAINERCLEANFILES = Makefile.in
3
4EXTRA_DIST = \
5evas_inline.x \
6evas_private.h \
7evas_options.h \
8evas_macros.h \
9evas_mmx.h \
10evas_common.h \
11evas_common_soft8.h \
12evas_common_soft16.h \
13evas_blend_ops.h
diff --git a/libraries/evas/src/lib/include/Makefile.in b/libraries/evas/src/lib/include/Makefile.in
new file mode 100644
index 0000000..9d5c371
--- /dev/null
+++ b/libraries/evas/src/lib/include/Makefile.in
@@ -0,0 +1,542 @@
1# Makefile.in generated by automake 1.11.1 from Makefile.am.
2# @configure_input@
3
4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
6# Inc.
7# This Makefile.in is free software; the Free Software Foundation
8# gives unlimited permission to copy and/or distribute it,
9# with or without modifications, as long as this notice is preserved.
10
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
13# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14# PARTICULAR PURPOSE.
15
16@SET_MAKE@
17VPATH = @srcdir@
18pkgdatadir = $(datadir)/@PACKAGE@
19pkgincludedir = $(includedir)/@PACKAGE@
20pkglibdir = $(libdir)/@PACKAGE@
21pkglibexecdir = $(libexecdir)/@PACKAGE@
22am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
23install_sh_DATA = $(install_sh) -c -m 644
24install_sh_PROGRAM = $(install_sh) -c
25install_sh_SCRIPT = $(install_sh) -c
26INSTALL_HEADER = $(INSTALL_DATA)
27transform = $(program_transform_name)
28NORMAL_INSTALL = :
29PRE_INSTALL = :
30POST_INSTALL = :
31NORMAL_UNINSTALL = :
32PRE_UNINSTALL = :
33POST_UNINSTALL = :
34build_triplet = @build@
35host_triplet = @host@
36subdir = src/lib/include
37DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
38ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
39am__aclocal_m4_deps = $(top_srcdir)/m4/efl_attribute.m4 \
40 $(top_srcdir)/m4/efl_coverage.m4 \
41 $(top_srcdir)/m4/efl_doxygen.m4 \
42 $(top_srcdir)/m4/efl_fnmatch.m4 \
43 $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \
44 $(top_srcdir)/m4/evas_check_engine.m4 \
45 $(top_srcdir)/m4/evas_check_loader.m4 \
46 $(top_srcdir)/m4/evas_converter.m4 \
47 $(top_srcdir)/m4/evas_dither.m4 \
48 $(top_srcdir)/m4/evas_scaler.m4 $(top_srcdir)/m4/libtool.m4 \
49 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
50 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
51 $(top_srcdir)/configure.ac
52am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
53 $(ACLOCAL_M4)
54mkinstalldirs = $(install_sh) -d
55CONFIG_HEADER = $(top_builddir)/config.h
56CONFIG_CLEAN_FILES =
57CONFIG_CLEAN_VPATH_FILES =
58AM_V_GEN = $(am__v_GEN_$(V))
59am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
60am__v_GEN_0 = @echo " GEN " $@;
61AM_V_at = $(am__v_at_$(V))
62am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
63am__v_at_0 = @
64SOURCES =
65DIST_SOURCES =
66DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
67ACLOCAL = @ACLOCAL@
68ALLOCA = @ALLOCA@
69AMTAR = @AMTAR@
70AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
71AR = @AR@
72AS = @AS@
73AUTOCONF = @AUTOCONF@
74AUTOHEADER = @AUTOHEADER@
75AUTOMAKE = @AUTOMAKE@
76AWK = @AWK@
77CC = @CC@
78CCDEPMODE = @CCDEPMODE@
79CFLAGS = @CFLAGS@
80CHECK_CFLAGS = @CHECK_CFLAGS@
81CHECK_LIBS = @CHECK_LIBS@
82CPP = @CPP@
83CPPFLAGS = @CPPFLAGS@
84CXX = @CXX@
85CXXCPP = @CXXCPP@
86CXXDEPMODE = @CXXDEPMODE@
87CXXFLAGS = @CXXFLAGS@
88CYGPATH_W = @CYGPATH_W@
89DEFS = @DEFS@
90DEPDIR = @DEPDIR@
91DIRECTFB_CFLAGS = @DIRECTFB_CFLAGS@
92DIRECTFB_LIBS = @DIRECTFB_LIBS@
93DLLTOOL = @DLLTOOL@
94DSYMUTIL = @DSYMUTIL@
95DUMPBIN = @DUMPBIN@
96ECHO_C = @ECHO_C@
97ECHO_N = @ECHO_N@
98ECHO_T = @ECHO_T@
99ECORE_EVAS_CFLAGS = @ECORE_EVAS_CFLAGS@
100ECORE_EVAS_LIBS = @ECORE_EVAS_LIBS@
101EDB_CFLAGS = @EDB_CFLAGS@
102EDB_LIBS = @EDB_LIBS@
103EDJE_CFLAGS = @EDJE_CFLAGS@
104EDJE_LIBS = @EDJE_LIBS@
105EET_CFLAGS = @EET_CFLAGS@
106EET_LIBS = @EET_LIBS@
107EFL_COVERAGE_CFLAGS = @EFL_COVERAGE_CFLAGS@
108EFL_COVERAGE_LIBS = @EFL_COVERAGE_LIBS@
109EFL_FNMATCH_LIBS = @EFL_FNMATCH_LIBS@
110EGREP = @EGREP@
111EINA_CFLAGS = @EINA_CFLAGS@
112EINA_LIBS = @EINA_LIBS@
113EVAS_CFLAGS = @EVAS_CFLAGS@
114EVAS_LIBS = @EVAS_LIBS@
115EVAS_SSE3_CFLAGS = @EVAS_SSE3_CFLAGS@
116EVIL_CFLAGS = @EVIL_CFLAGS@
117EVIL_LIBS = @EVIL_LIBS@
118EXEEXT = @EXEEXT@
119FGREP = @FGREP@
120FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@
121FONTCONFIG_LIBS = @FONTCONFIG_LIBS@
122FREETYPE_CFLAGS = @FREETYPE_CFLAGS@
123FREETYPE_LIBS = @FREETYPE_LIBS@
124FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@
125FRIBIDI_LIBS = @FRIBIDI_LIBS@
126GL_EET_CFLAGS = @GL_EET_CFLAGS@
127GL_EET_LIBS = @GL_EET_LIBS@
128GREP = @GREP@
129HARFBUZZ_CFLAGS = @HARFBUZZ_CFLAGS@
130HARFBUZZ_LIBS = @HARFBUZZ_LIBS@
131INSTALL = @INSTALL@
132INSTALL_DATA = @INSTALL_DATA@
133INSTALL_PROGRAM = @INSTALL_PROGRAM@
134INSTALL_SCRIPT = @INSTALL_SCRIPT@
135INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
136LD = @LD@
137LDFLAGS = @LDFLAGS@
138LIBOBJS = @LIBOBJS@
139LIBS = @LIBS@
140LIBTOOL = @LIBTOOL@
141LINEBREAK_CFLAGS = @LINEBREAK_CFLAGS@
142LINEBREAK_LIBS = @LINEBREAK_LIBS@
143LIPO = @LIPO@
144LN_S = @LN_S@
145LTLIBOBJS = @LTLIBOBJS@
146MAKEINFO = @MAKEINFO@
147MKDIR_P = @MKDIR_P@
148MODULE_ARCH = @MODULE_ARCH@
149NM = @NM@
150NMEDIT = @NMEDIT@
151OBJC = @OBJC@
152OBJCDEPMODE = @OBJCDEPMODE@
153OBJCFLAGS = @OBJCFLAGS@
154OBJDUMP = @OBJDUMP@
155OBJEXT = @OBJEXT@
156OTOOL = @OTOOL@
157OTOOL64 = @OTOOL64@
158PACKAGE = @PACKAGE@
159PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
160PACKAGE_NAME = @PACKAGE_NAME@
161PACKAGE_STRING = @PACKAGE_STRING@
162PACKAGE_TARNAME = @PACKAGE_TARNAME@
163PACKAGE_URL = @PACKAGE_URL@
164PACKAGE_VERSION = @PACKAGE_VERSION@
165PATH_SEPARATOR = @PATH_SEPARATOR@
166PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
167PIXMAN_LIBS = @PIXMAN_LIBS@
168PKG_CONFIG = @PKG_CONFIG@
169PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
170PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
171PNG_CFLAGS = @PNG_CFLAGS@
172PNG_LIBS = @PNG_LIBS@
173RANLIB = @RANLIB@
174SDL_CFLAGS = @SDL_CFLAGS@
175SDL_LIBS = @SDL_LIBS@
176SED = @SED@
177SET_MAKE = @SET_MAKE@
178SHELL = @SHELL@
179SHM_OPEN_LINK = @SHM_OPEN_LINK@
180STRIP = @STRIP@
181SVG_CFLAGS = @SVG_CFLAGS@
182SVG_LIBS = @SVG_LIBS@
183VALGRIND_CFLAGS = @VALGRIND_CFLAGS@
184VALGRIND_LIBS = @VALGRIND_LIBS@
185VERSION = @VERSION@
186VMAJ = @VMAJ@
187WIN32_CFLAGS = @WIN32_CFLAGS@
188WIN32_CPPFLAGS = @WIN32_CPPFLAGS@
189XCB_CFLAGS = @XCB_CFLAGS@
190XCB_GL_CFLAGS = @XCB_GL_CFLAGS@
191XCB_GL_LIBS = @XCB_GL_LIBS@
192XCB_LIBS = @XCB_LIBS@
193XEXT_CFLAGS = @XEXT_CFLAGS@
194XEXT_LIBS = @XEXT_LIBS@
195XMKMF = @XMKMF@
196X_CFLAGS = @X_CFLAGS@
197X_EXTRA_LIBS = @X_EXTRA_LIBS@
198X_LIBS = @X_LIBS@
199X_PRE_LIBS = @X_PRE_LIBS@
200abs_builddir = @abs_builddir@
201abs_srcdir = @abs_srcdir@
202abs_top_builddir = @abs_top_builddir@
203abs_top_srcdir = @abs_top_srcdir@
204ac_ct_CC = @ac_ct_CC@
205ac_ct_CXX = @ac_ct_CXX@
206ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
207ac_ct_OBJC = @ac_ct_OBJC@
208altivec_cflags = @altivec_cflags@
209am__include = @am__include@
210am__leading_dot = @am__leading_dot@
211am__quote = @am__quote@
212am__tar = @am__tar@
213am__untar = @am__untar@
214bindir = @bindir@
215build = @build@
216build_alias = @build_alias@
217build_cpu = @build_cpu@
218build_os = @build_os@
219build_vendor = @build_vendor@
220builddir = @builddir@
221datadir = @datadir@
222datarootdir = @datarootdir@
223dlopen_libs = @dlopen_libs@
224docdir = @docdir@
225dvidir = @dvidir@
226edje_cc = @edje_cc@
227efl_doxygen = @efl_doxygen@
228efl_have_doxygen = @efl_have_doxygen@
229evas_engine_buffer_cflags = @evas_engine_buffer_cflags@
230evas_engine_buffer_libs = @evas_engine_buffer_libs@
231evas_engine_direct3d_cflags = @evas_engine_direct3d_cflags@
232evas_engine_direct3d_libs = @evas_engine_direct3d_libs@
233evas_engine_directfb_cflags = @evas_engine_directfb_cflags@
234evas_engine_directfb_libs = @evas_engine_directfb_libs@
235evas_engine_fb_cflags = @evas_engine_fb_cflags@
236evas_engine_fb_libs = @evas_engine_fb_libs@
237evas_engine_gl_cocoa_cflags = @evas_engine_gl_cocoa_cflags@
238evas_engine_gl_cocoa_libs = @evas_engine_gl_cocoa_libs@
239evas_engine_gl_common_libs = @evas_engine_gl_common_libs@
240evas_engine_gl_sdl_cflags = @evas_engine_gl_sdl_cflags@
241evas_engine_gl_sdl_libs = @evas_engine_gl_sdl_libs@
242evas_engine_gl_xcb_cflags = @evas_engine_gl_xcb_cflags@
243evas_engine_gl_xcb_libs = @evas_engine_gl_xcb_libs@
244evas_engine_gl_xlib_cflags = @evas_engine_gl_xlib_cflags@
245evas_engine_gl_xlib_libs = @evas_engine_gl_xlib_libs@
246evas_engine_psl1ght_cflags = @evas_engine_psl1ght_cflags@
247evas_engine_psl1ght_libs = @evas_engine_psl1ght_libs@
248evas_engine_software_16_ddraw_cflags = @evas_engine_software_16_ddraw_cflags@
249evas_engine_software_16_ddraw_libs = @evas_engine_software_16_ddraw_libs@
250evas_engine_software_16_sdl_cflags = @evas_engine_software_16_sdl_cflags@
251evas_engine_software_16_sdl_libs = @evas_engine_software_16_sdl_libs@
252evas_engine_software_16_wince_cflags = @evas_engine_software_16_wince_cflags@
253evas_engine_software_16_wince_libs = @evas_engine_software_16_wince_libs@
254evas_engine_software_16_x11_cflags = @evas_engine_software_16_x11_cflags@
255evas_engine_software_16_x11_libs = @evas_engine_software_16_x11_libs@
256evas_engine_software_8_x11_cflags = @evas_engine_software_8_x11_cflags@
257evas_engine_software_8_x11_libs = @evas_engine_software_8_x11_libs@
258evas_engine_software_ddraw_cflags = @evas_engine_software_ddraw_cflags@
259evas_engine_software_ddraw_libs = @evas_engine_software_ddraw_libs@
260evas_engine_software_gdi_cflags = @evas_engine_software_gdi_cflags@
261evas_engine_software_gdi_libs = @evas_engine_software_gdi_libs@
262evas_engine_software_sdl_cflags = @evas_engine_software_sdl_cflags@
263evas_engine_software_sdl_libs = @evas_engine_software_sdl_libs@
264evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@
265evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@
266evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@
267evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@
268evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@
269evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@
270evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@
271evas_image_loader_edb_libs = @evas_image_loader_edb_libs@
272evas_image_loader_eet_cflags = @evas_image_loader_eet_cflags@
273evas_image_loader_eet_libs = @evas_image_loader_eet_libs@
274evas_image_loader_generic_cflags = @evas_image_loader_generic_cflags@
275evas_image_loader_generic_libs = @evas_image_loader_generic_libs@
276evas_image_loader_gif_cflags = @evas_image_loader_gif_cflags@
277evas_image_loader_gif_libs = @evas_image_loader_gif_libs@
278evas_image_loader_ico_cflags = @evas_image_loader_ico_cflags@
279evas_image_loader_ico_libs = @evas_image_loader_ico_libs@
280evas_image_loader_jpeg_cflags = @evas_image_loader_jpeg_cflags@
281evas_image_loader_jpeg_libs = @evas_image_loader_jpeg_libs@
282evas_image_loader_pmaps_cflags = @evas_image_loader_pmaps_cflags@
283evas_image_loader_pmaps_libs = @evas_image_loader_pmaps_libs@
284evas_image_loader_png_cflags = @evas_image_loader_png_cflags@
285evas_image_loader_png_libs = @evas_image_loader_png_libs@
286evas_image_loader_psd_cflags = @evas_image_loader_psd_cflags@
287evas_image_loader_psd_libs = @evas_image_loader_psd_libs@
288evas_image_loader_svg_cflags = @evas_image_loader_svg_cflags@
289evas_image_loader_svg_libs = @evas_image_loader_svg_libs@
290evas_image_loader_tga_cflags = @evas_image_loader_tga_cflags@
291evas_image_loader_tga_libs = @evas_image_loader_tga_libs@
292evas_image_loader_tiff_cflags = @evas_image_loader_tiff_cflags@
293evas_image_loader_tiff_libs = @evas_image_loader_tiff_libs@
294evas_image_loader_wbmp_cflags = @evas_image_loader_wbmp_cflags@
295evas_image_loader_wbmp_libs = @evas_image_loader_wbmp_libs@
296evas_image_loader_xpm_cflags = @evas_image_loader_xpm_cflags@
297evas_image_loader_xpm_libs = @evas_image_loader_xpm_libs@
298exec_prefix = @exec_prefix@
299have_evas_engine_gl_x11 = @have_evas_engine_gl_x11@
300have_evas_engine_gl_xcb = @have_evas_engine_gl_xcb@
301have_evas_engine_gl_xlib = @have_evas_engine_gl_xlib@
302have_evas_engine_software_x11 = @have_evas_engine_software_x11@
303have_evas_engine_software_xcb = @have_evas_engine_software_xcb@
304have_evas_engine_software_xlib = @have_evas_engine_software_xlib@
305have_lcov = @have_lcov@
306host = @host@
307host_alias = @host_alias@
308host_cpu = @host_cpu@
309host_os = @host_os@
310host_vendor = @host_vendor@
311htmldir = @htmldir@
312includedir = @includedir@
313infodir = @infodir@
314install_sh = @install_sh@
315libdir = @libdir@
316libexecdir = @libexecdir@
317localedir = @localedir@
318localstatedir = @localstatedir@
319lt_ECHO = @lt_ECHO@
320lt_enable_auto_import = @lt_enable_auto_import@
321mandir = @mandir@
322mkdir_p = @mkdir_p@
323oldincludedir = @oldincludedir@
324pdfdir = @pdfdir@
325pkgconfig_requires_private = @pkgconfig_requires_private@
326prefix = @prefix@
327program_transform_name = @program_transform_name@
328psdir = @psdir@
329pthread_cflags = @pthread_cflags@
330pthread_libs = @pthread_libs@
331release_info = @release_info@
332requirement_evas = @requirement_evas@
333sbindir = @sbindir@
334sharedstatedir = @sharedstatedir@
335srcdir = @srcdir@
336sysconfdir = @sysconfdir@
337target_alias = @target_alias@
338top_build_prefix = @top_build_prefix@
339top_builddir = @top_builddir@
340top_srcdir = @top_srcdir@
341version_info = @version_info@
342MAINTAINERCLEANFILES = Makefile.in
343EXTRA_DIST = \
344evas_inline.x \
345evas_private.h \
346evas_options.h \
347evas_macros.h \
348evas_mmx.h \
349evas_common.h \
350evas_common_soft8.h \
351evas_common_soft16.h \
352evas_blend_ops.h
353
354all: all-am
355
356.SUFFIXES:
357$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
358 @for dep in $?; do \
359 case '$(am__configure_deps)' in \
360 *$$dep*) \
361 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
362 && { if test -f $@; then exit 0; else break; fi; }; \
363 exit 1;; \
364 esac; \
365 done; \
366 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/include/Makefile'; \
367 $(am__cd) $(top_srcdir) && \
368 $(AUTOMAKE) --gnu src/lib/include/Makefile
369.PRECIOUS: Makefile
370Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
371 @case '$?' in \
372 *config.status*) \
373 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
374 *) \
375 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
376 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
377 esac;
378
379$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
380 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
381
382$(top_srcdir)/configure: $(am__configure_deps)
383 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
384$(ACLOCAL_M4): $(am__aclocal_m4_deps)
385 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
386$(am__aclocal_m4_deps):
387
388mostlyclean-libtool:
389 -rm -f *.lo
390
391clean-libtool:
392 -rm -rf .libs _libs
393tags: TAGS
394TAGS:
395
396ctags: CTAGS
397CTAGS:
398
399
400distdir: $(DISTFILES)
401 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
402 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
403 list='$(DISTFILES)'; \
404 dist_files=`for file in $$list; do echo $$file; done | \
405 sed -e "s|^$$srcdirstrip/||;t" \
406 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
407 case $$dist_files in \
408 */*) $(MKDIR_P) `echo "$$dist_files" | \
409 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
410 sort -u` ;; \
411 esac; \
412 for file in $$dist_files; do \
413 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
414 if test -d $$d/$$file; then \
415 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
416 if test -d "$(distdir)/$$file"; then \
417 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
418 fi; \
419 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
420 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
421 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
422 fi; \
423 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
424 else \
425 test -f "$(distdir)/$$file" \
426 || cp -p $$d/$$file "$(distdir)/$$file" \
427 || exit 1; \
428 fi; \
429 done
430check-am: all-am
431check: check-am
432all-am: Makefile
433installdirs:
434install: install-am
435install-exec: install-exec-am
436install-data: install-data-am
437uninstall: uninstall-am
438
439install-am: all-am
440 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
441
442installcheck: installcheck-am
443install-strip:
444 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
445 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
446 `test -z '$(STRIP)' || \
447 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
448mostlyclean-generic:
449
450clean-generic:
451
452distclean-generic:
453 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
454 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
455
456maintainer-clean-generic:
457 @echo "This command is intended for maintainers to use"
458 @echo "it deletes files that may require special tools to rebuild."
459 -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
460clean: clean-am
461
462clean-am: clean-generic clean-libtool mostlyclean-am
463
464distclean: distclean-am
465 -rm -f Makefile
466distclean-am: clean-am distclean-generic
467
468dvi: dvi-am
469
470dvi-am:
471
472html: html-am
473
474html-am:
475
476info: info-am
477
478info-am:
479
480install-data-am:
481
482install-dvi: install-dvi-am
483
484install-dvi-am:
485
486install-exec-am:
487
488install-html: install-html-am
489
490install-html-am:
491
492install-info: install-info-am
493
494install-info-am:
495
496install-man:
497
498install-pdf: install-pdf-am
499
500install-pdf-am:
501
502install-ps: install-ps-am
503
504install-ps-am:
505
506installcheck-am:
507
508maintainer-clean: maintainer-clean-am
509 -rm -f Makefile
510maintainer-clean-am: distclean-am maintainer-clean-generic
511
512mostlyclean: mostlyclean-am
513
514mostlyclean-am: mostlyclean-generic mostlyclean-libtool
515
516pdf: pdf-am
517
518pdf-am:
519
520ps: ps-am
521
522ps-am:
523
524uninstall-am:
525
526.MAKE: install-am install-strip
527
528.PHONY: all all-am check check-am clean clean-generic clean-libtool \
529 distclean distclean-generic distclean-libtool distdir dvi \
530 dvi-am html html-am info info-am install install-am \
531 install-data install-data-am install-dvi install-dvi-am \
532 install-exec install-exec-am install-html install-html-am \
533 install-info install-info-am install-man install-pdf \
534 install-pdf-am install-ps install-ps-am install-strip \
535 installcheck installcheck-am installdirs maintainer-clean \
536 maintainer-clean-generic mostlyclean mostlyclean-generic \
537 mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am
538
539
540# Tell versions [3.59,3.63) of GNU make to not export all variables.
541# Otherwise a system limit (for SysV at least) may be exceeded.
542.NOEXPORT:
diff --git a/libraries/evas/src/lib/include/evas_blend_ops.h b/libraries/evas/src/lib/include/evas_blend_ops.h
new file mode 100644
index 0000000..1ada384
--- /dev/null
+++ b/libraries/evas/src/lib/include/evas_blend_ops.h
@@ -0,0 +1,378 @@
1#ifndef EVAS_BLEND_OPS_H
2#define EVAS_BLEND_OPS_H
3
4#if defined BUILD_MMX || defined BUILD_SSE
5#include "evas_mmx.h"
6#endif
7
8#include "config.h"
9
10#ifdef NEED_SSE3
11# if defined BUILD_SSE3
12# include <immintrin.h>
13# endif
14#endif
15
16/* src pixel flags: */
17
18/* pixels none */
19#define SP_N 0
20/* pixels (argb default) */
21#define SP 1
22/* pixels are rgb (ie. alphas == 255) */
23#define SP_AN 2
24/* pixels alpha are sparse */
25#define SP_AS 3
26/* src pixels flags count */
27#define SP_LAST 4
28
29/* src mask flags: */
30
31/* mask none */
32#define SM_N 0
33/* mask (alpha) */
34#define SM 1
35/* mask alphas are 'trivial - ie. only 0 or 255 */
36#define SM_AT 2
37/* mask alphas are sparse */
38#define SM_AS 3
39/* src mask flags count */
40#define SM_LAST 4
41
42/* src color flags: */
43
44/* color is 0xffffffff */
45#define SC_N 0
46/* color (argb default) */
47#define SC 1
48/* color is rgb (ie. 0xffrrggbb) */
49#define SC_AN 2
50/* color is 'alpha' (ie. 0xaaaaaaaa) */
51#define SC_AA 3
52/* src color flags count */
53#define SC_LAST 4
54
55/* dst pixels flags: */
56
57/* pixels (argb default) */
58#define DP 0
59/* pixels are rgb (ie. alphas == 255) */
60#define DP_AN 1
61/* dst pixels flags count */
62#define DP_LAST 2
63
64/* cpu types flags */
65
66/* none, bad news */
67#define CPU_N 0
68/* cpu C */
69#define CPU_C 1
70/* cpu MMX */
71#define CPU_MMX 2
72/* cpu SSE */
73#define CPU_SSE 3
74/* cpu SSE2 */
75#define CPU_SSE2 4
76/* cpu flags count */
77#define CPU_NEON 5
78/* CPU SSE3 */
79#define CPU_SSE3 6
80/* cpu flags count */
81#define CPU_LAST 7
82
83
84/* some useful constants */
85
86extern const DATA32 ALPHA_255;
87extern const DATA32 ALPHA_256;
88
89/* some useful C macros */
90
91#define MUL4_256(a, r, g, b, c) \
92 ( (((((c) >> 8) & 0xff0000) * (a)) & 0xff000000) + \
93 (((((c) & 0xff0000) * (r)) >> 8) & 0xff0000) + \
94 (((((c) & 0xff00) * (g)) >> 8) & 0xff00) + \
95 ((((c) & 0xff) * (b)) >> 8) )
96
97#define MUL3_256(r, g, b, c) \
98 ( (((((c) & 0xff0000) * (r)) >> 8) & 0xff0000) + \
99 (((((c) & 0xff00) * (g)) >> 8) & 0xff00) + \
100 ((((c) & 0xff) * (b)) >> 8) )
101
102#define MUL_256(a, c) \
103 ( (((((c) >> 8) & 0x00ff00ff) * (a)) & 0xff00ff00) + \
104 (((((c) & 0x00ff00ff) * (a)) >> 8) & 0x00ff00ff) )
105
106#define MUL4_SYM(x, y) \
107 ( ((((((x) >> 16) & 0xff00) * (((y) >> 16) & 0xff00)) + 0xff0000) & 0xff000000) + \
108 ((((((x) >> 8) & 0xff00) * (((y) >> 16) & 0xff)) + 0xff00) & 0xff0000) + \
109 ((((((x) & 0xff00) * ((y) & 0xff00)) + 0xff00) >> 16) & 0xff00) + \
110 (((((x) & 0xff) * ((y) & 0xff)) + 0xff) >> 8) )
111
112#define MUL3_SYM(x, y) \
113 ( ((((((x) >> 8) & 0xff00) * (((y) >> 16) & 0xff)) + 0xff00) & 0xff0000) + \
114 ((((((x) & 0xff00) * ((y) & 0xff00)) + 0xff00) >> 16) & 0xff00) + \
115 (((((x) & 0xff) * ((y) & 0xff)) + 0xff) >> 8) )
116
117#define MUL_SYM(a, x) \
118 ( (((((x) >> 8) & 0x00ff00ff) * (a) + 0xff00ff) & 0xff00ff00) + \
119 (((((x) & 0x00ff00ff) * (a) + 0xff00ff) >> 8) & 0x00ff00ff) )
120
121#define MUL_A_256(a, c) \
122 ( ((((c) >> 8) & 0x00ff0000) * (a)) & 0xff000000 )
123
124#define MUL_A_SYM(a, c) \
125 ( (((((c) >> 8) & 0x00ff0000) * (a)) + 0x00ff0000) & 0xff000000 )
126
127#define INTERP_256(a, c0, c1) \
128 ( (((((((c0) >> 8) & 0xff00ff) - (((c1) >> 8) & 0xff00ff)) * (a)) \
129 + ((c1) & 0xff00ff00)) & 0xff00ff00) + \
130 (((((((c0) & 0xff00ff) - ((c1) & 0xff00ff)) * (a)) >> 8) \
131 + ((c1) & 0xff00ff)) & 0xff00ff) )
132
133#define INTERP_RGB_256(a, c0, c1) \
134 ( (((((((c0) >> 8) & 0xff) - (((c1) >> 8) & 0xff)) * (a)) \
135 + ((c1) & 0xff00)) & 0xff00) + \
136 (((((((c0) & 0xff00ff) - ((c1) & 0xff00ff)) * (a)) >> 8) \
137 + ((c1) & 0xff00ff)) & 0xff00ff) )
138
139#define INTERP_A_256(a, c0, c1) \
140 ( (((((((c0) >> 8) & 0xff0000) - (((c1) >> 8) & 0xff0000)) * (a)) \
141 + ((c1) & 0xff000000)) & 0xff000000) )
142
143
144/* some useful MMX macros */
145
146#ifdef BUILD_MMX
147#define MOV_A2R(a, mma) \
148 movd_m2r(a, mma); \
149 punpcklwd_r2r(mma, mma); \
150 punpckldq_r2r(mma, mma);
151
152#define MOV_P2R(c, mmc, mmz) \
153 movd_m2r(c, mmc); \
154 punpcklbw_r2r(mmz, mmc);
155
156#define MOV_R2P(mmc, c, mmz) \
157 packuswb_r2r(mmz, mmc); \
158 movd_r2m(mmc, c);
159
160#define MUL4_256_R2R(mmx, mmy) \
161 pmullw_r2r(mmx, mmy); \
162 psrlw_i2r(8, mmy);
163
164#define MUL4_SYM_R2R(mmx, mmy, mm255) \
165 pmullw_r2r(mmx, mmy); \
166 paddw_r2r(mm255, mmy); \
167 psrlw_i2r(8, mmy);
168
169#define MOV_RA2R(mmx, mma) \
170 movq_r2r(mmx, mma); \
171 punpckhwd_r2r(mma, mma); \
172 punpckhdq_r2r(mma, mma);
173
174#define MOV_PA2R(c, mma) \
175 movd_m2r(c, mma); \
176 punpcklbw_r2r(mma, mma); \
177 punpckhwd_r2r(mma, mma); \
178 punpckhdq_r2r(mma, mma);
179
180#define INTERP_256_R2R(mma, mmx, mmy, mm255) \
181 psubw_r2r(mmy, mmx); \
182 pmullw_r2r(mma, mmx); \
183 psrlw_i2r(8, mmx); \
184 paddw_r2r(mmx, mmy); \
185 pand_r2r(mm255, mmy);
186
187#endif
188
189
190/* some useful SSE3 inline functions */
191
192#ifdef NEED_SSE3
193#ifdef BUILD_SSE3
194
195static __m128i GA_MASK_SSE3;
196static __m128i RB_MASK_SSE3;
197static __m128i SYM4_MASK_SSE3;
198static __m128i RGB_MASK_SSE3;
199//static __m128i A_MASK_SSE3;
200
201static __m128i ALPHA_SSE3;
202
203EFL_ALWAYS_INLINE __m128i
204mul_256_sse3(__m128i a, __m128i c) {
205
206 /* prepare alpha for word multiplication */
207 __m128i a_l = a;
208 __m128i a_h = a;
209 a_l = _mm_unpacklo_epi16(a_l, a_l);
210 a_h = _mm_unpackhi_epi16(a_h, a_h);
211 __m128i a0 = (__m128i) _mm_shuffle_ps( (__m128)a_l, (__m128)a_h, 0x88);
212
213 /* first half of calc */
214 __m128i c0 = c;
215 c0 = _mm_srli_epi32(c0, 8);
216 c0 = _mm_and_si128(GA_MASK_SSE3, c0);
217 c0 = _mm_mullo_epi16(a0, c0);
218 c0 = _mm_and_si128(RB_MASK_SSE3, c0);
219
220 /* second half of calc */
221 __m128i c1 = c;
222 c1 = _mm_and_si128(GA_MASK_SSE3, c1);
223 c1 = _mm_mullo_epi16(a0, c1);
224 c1 = _mm_srli_epi32(c1, 8);
225 c1 = _mm_and_si128(GA_MASK_SSE3, c1);
226
227 /* combine */
228 return _mm_add_epi32(c0, c1);
229}
230
231EFL_ALWAYS_INLINE __m128i
232sub4_alpha_sse3(__m128i c) {
233
234 __m128i c0 = c;
235
236 c0 = _mm_srli_epi32(c0, 24);
237 return _mm_sub_epi32(ALPHA_SSE3, c0);
238}
239
240EFL_ALWAYS_INLINE __m128i
241interp4_256_sse3(__m128i a, __m128i c0, __m128i c1)
242{
243 const __m128i zero = _mm_setzero_si128();
244
245 __m128i a_l = a;
246 __m128i a_h = a;
247 a_l = _mm_unpacklo_epi16(a_l, a_l);
248 a_h = _mm_unpackhi_epi16(a_h, a_h);
249
250 __m128i a_t = _mm_slli_epi64(a_l, 32);
251 __m128i a_t0 = _mm_slli_epi64(a_h, 32);
252
253 a_l = _mm_add_epi32(a_l, a_t);
254 a_h = _mm_add_epi32(a_h, a_t0);
255
256 __m128i c0_l = c0;
257 __m128i c0_h = c0;
258
259 c0_l = _mm_unpacklo_epi8(c0_l, zero);
260 c0_h = _mm_unpackhi_epi8(c0_h, zero);
261
262 __m128i c1_l = c1;
263 __m128i c1_h = c1;
264
265 c1_l = _mm_unpacklo_epi8(c1_l, zero);
266 c1_h = _mm_unpackhi_epi8(c1_h, zero);
267
268 __m128i cl_sub = _mm_sub_epi16(c0_l, c1_l);
269 __m128i ch_sub = _mm_sub_epi16(c0_h, c1_h);
270
271 cl_sub = _mm_mullo_epi16(cl_sub, a_l);
272 ch_sub = _mm_mullo_epi16(ch_sub, a_h);
273
274 __m128i c1ls = _mm_slli_epi16(c1_l, 8);
275 __m128i c1hs = _mm_slli_epi16(c1_h, 8);
276
277 cl_sub = _mm_add_epi16(cl_sub, c1ls);
278 ch_sub = _mm_add_epi16(ch_sub, c1hs);
279
280 cl_sub = _mm_and_si128(cl_sub, RB_MASK_SSE3);
281 ch_sub = _mm_and_si128(ch_sub, RB_MASK_SSE3);
282
283 cl_sub = _mm_srli_epi64(cl_sub, 8);
284 ch_sub = _mm_srli_epi64(ch_sub, 8);
285
286 cl_sub = _mm_packus_epi16(cl_sub, cl_sub);
287 ch_sub = _mm_packus_epi16(ch_sub, ch_sub);
288
289 return (__m128i) _mm_shuffle_ps( (__m128)cl_sub, (__m128)ch_sub, 0x44);
290}
291
292EFL_ALWAYS_INLINE __m128i
293mul_sym_sse3(__m128i a, __m128i c) {
294
295 /* Prepare alpha for word mult */
296 __m128i a_l = a;
297 __m128i a_h = a;
298 a_l = _mm_unpacklo_epi16(a_l, a_l);
299 a_h = _mm_unpackhi_epi16(a_h, a_h);
300 __m128i a0 = (__m128i) _mm_shuffle_ps( (__m128)a_l, (__m128)a_h, 0x88);
301
302 /* first part */
303 __m128i c0 = c;
304 c0 = _mm_srli_epi32(c0, 8);
305 c0 = _mm_and_si128(GA_MASK_SSE3, c0);
306 c0 = _mm_mullo_epi16(a0, c0);
307 c0 = _mm_add_epi32(c0, GA_MASK_SSE3);
308 c0 = _mm_and_si128(RB_MASK_SSE3, c0);
309
310 /* second part */
311 __m128i c1 = c;
312 c1 = _mm_and_si128(GA_MASK_SSE3, c1);
313 c1 = _mm_mullo_epi16(a0, c1);
314 c1 = _mm_add_epi32(c1, GA_MASK_SSE3);
315 c1 = _mm_srli_epi32(c1, 8);
316 c1 = _mm_and_si128(GA_MASK_SSE3, c1);
317
318 return _mm_add_epi32(c0, c1);
319}
320
321EFL_ALWAYS_INLINE __m128i
322mul4_sym_sse3(__m128i x, __m128i y) {
323
324 const __m128i zero = _mm_setzero_si128();
325
326 __m128i x_l = _mm_unpacklo_epi8(x, zero);
327 __m128i x_h = _mm_unpackhi_epi8(x, zero);
328
329 __m128i y_l = _mm_unpacklo_epi8(y, zero);
330 __m128i y_h = _mm_unpackhi_epi8(y, zero);
331
332 __m128i r_l = _mm_mullo_epi16(x_l, y_l);
333 __m128i r_h = _mm_mullo_epi16(x_h, y_h);
334
335 r_l = _mm_add_epi16(r_l, SYM4_MASK_SSE3);
336 r_h = _mm_add_epi16(r_h, SYM4_MASK_SSE3);
337
338 r_l = _mm_srli_epi16(r_l, 8);
339 r_h = _mm_srli_epi16(r_h, 8);
340
341 return _mm_packus_epi16(r_l, r_h);
342}
343
344EFL_ALWAYS_INLINE __m128i
345mul3_sym_sse3(__m128i x, __m128i y) {
346
347 __m128i res = mul4_sym_sse3(x, y);
348 return _mm_and_si128(res, RGB_MASK_SSE3);
349}
350
351#define LOOP_ALIGNED_U1_A48_SSE3(DEST, LENGTH, UOP, A4OP, A8OP) \
352 { \
353 while((uintptr_t)DEST & 0xF && LENGTH) UOP \
354 \
355 while(LENGTH) { \
356 switch(LENGTH) { \
357 case 3: UOP \
358 case 2: UOP \
359 case 1: UOP \
360 break; \
361 case 7: \
362 case 6: \
363 case 5: \
364 case 4: \
365 A4OP \
366 break; \
367 default: \
368 A8OP \
369 break; \
370 } \
371 } \
372 }
373
374
375#endif
376#endif
377
378#endif
diff --git a/libraries/evas/src/lib/include/evas_common.h b/libraries/evas/src/lib/include/evas_common.h
new file mode 100644
index 0000000..f817202
--- /dev/null
+++ b/libraries/evas/src/lib/include/evas_common.h
@@ -0,0 +1,1242 @@
1#ifndef EVAS_COMMON_H
2#define EVAS_COMMON_H
3
4#ifdef HAVE_CONFIG_H
5# include "config.h" /* so that EAPI in Evas.h is correctly defined */
6#endif
7
8#ifdef HAVE_EVIL
9# include <Evil.h>
10#endif
11
12#ifdef HAVE_ESCAPE
13# include <Escape.h>
14#endif
15
16#include <Eina.h>
17#include "Evas.h"
18//#include "Evas_GL.h"
19
20#ifdef HAVE_PIXMAN
21#include <pixman.h>
22#endif
23
24#include <sys/types.h>
25#include <sys/stat.h>
26#include <unistd.h>
27
28#ifndef HAVE_LROUND
29/* right now i dont care about rendering bugs on platforms without lround
30 (e.g. windows/vc++... yay!)
31 FIXME: http://cgit.freedesktop.org/cairo/tree/src/cairo-misc.c#n487
32*/
33#define lround(x) (((x) < 0) ? (long int)ceil((x) - 0.5) : (long int)floor((x) + 0.5))
34#endif
35
36/* macros needed to log message through eina_log */
37extern EAPI int _evas_log_dom_global;
38#ifdef _EVAS_DEFAULT_LOG_DOM
39# undef _EVAS_DEFAULT_LOG_DOM
40#endif
41#define _EVAS_DEFAULT_LOG_DOM _evas_log_dom_global
42
43#ifdef EVAS_DEFAULT_LOG_COLOR
44# undef EVAS_DEFAULT_LOG_COLOR
45#endif
46#define EVAS_DEFAULT_LOG_COLOR EINA_COLOR_BLUE
47
48#ifdef ERR
49# undef ERR
50#endif
51#define ERR(...) EINA_LOG_DOM_ERR(_EVAS_DEFAULT_LOG_DOM, __VA_ARGS__)
52
53#ifdef DBG
54# undef DBG
55#endif
56#define DBG(...) EINA_LOG_DOM_DBG(_EVAS_DEFAULT_LOG_DOM, __VA_ARGS__)
57
58#ifdef INF
59# undef INF
60#endif
61#define INF(...) EINA_LOG_DOM_INFO(_EVAS_DEFAULT_LOG_DOM, __VA_ARGS__)
62
63#ifdef WRN
64# undef WRN
65#endif
66#define WRN(...) EINA_LOG_DOM_WARN(_EVAS_DEFAULT_LOG_DOM, __VA_ARGS__)
67
68#ifdef CRIT
69# undef CRIT
70#endif
71#define CRIT(...) EINA_LOG_DOM_CRIT(_EVAS_DEFAULT_LOG_DOM, __VA_ARGS__)
72
73#include "evas_options.h"
74
75#if defined(__ARM_ARCH_3M__)
76# define __ARM_ARCH__ 40
77#endif
78#if defined(__ARM_ARCH_4__)
79# define __ARM_ARCH__ 40
80#endif
81#if defined(__ARM_ARCH_4T__)
82# define __ARM_ARCH__ 41
83#endif
84
85#if defined(__ARM_ARCH_5__)
86# define __ARM_ARCH__ 50
87#endif
88#if defined(__ARM_ARCH_5T__)
89# define __ARM_ARCH__ 51
90#endif
91#if defined(__ARM_ARCH_5E__)
92# define __ARM_ARCH__ 52
93#endif
94#if defined(__ARM_ARCH_5TE__)
95# define __ARM_ARCH__ 53
96#endif
97#if defined(__ARM_ARCH_5TEJ__)
98# define __ARM_ARCH__ 54
99#endif
100
101#if defined(__ARM_ARCH_6__)
102# define __ARM_ARCH__ 60
103#endif
104#if defined(__ARM_ARCH_6J__)
105# define __ARM_ARCH__ 61
106#endif
107#if defined(__ARM_ARCH_6K__)
108# define __ARM_ARCH__ 62
109#endif
110#if defined(__ARM_ARCH_6Z__)
111# define __ARM_ARCH__ 63
112#endif
113#if defined(__ARM_ARCH_6ZK__)
114# define __ARM_ARCH__ 64
115#endif
116#if defined(__ARM_ARCH_6T2__)
117# define __ARM_ARCH__ 65
118#endif
119
120#if defined(__ARM_ARCH_7__)
121# define __ARM_ARCH__ 70
122#endif
123#if defined(__ARM_ARCH_7A__)
124# define __ARM_ARCH__ 71
125#endif
126#if defined(__ARM_ARCH_7R__)
127# define __ARM_ARCH__ 72
128#endif
129#if defined(__ARM_ARCH_7M__)
130# define __ARM_ARCH__ 73
131#endif
132
133#ifndef BUILD_PTHREAD
134# undef BUILD_PIPE_RENDER
135#endif
136
137#if defined(BUILD_ASYNC_PRELOAD) && !defined(BUILD_PTHREAD)
138# define BUILD_PTHREAD
139#endif
140
141#ifdef BUILD_PTHREAD
142
143#define LK(x) Eina_Lock x
144#define LKI(x) eina_lock_new(&(x))
145#define LKD(x) eina_lock_free(&(x))
146#define LKL(x) eina_lock_take(&(x))
147#define LKT(x) eina_lock_take_try(&(x))
148#define LKU(x) eina_lock_release(&(x))
149#define LKDBG(x) eina_lock_debug(&(x))
150
151# define TH(x) pthread_t x
152# define THI(x) int x
153# define TH_MAX 8
154
155/* for rwlocks */
156#define RWLK(x) pthread_rwlock_t x
157#define RWLKI(x) pthread_rwlock_init(&(x), NULL)
158#define RWLKD(x) pthread_rwlock_destroy(&(x))
159#define RDLKL(x) pthread_rwlock_rdlock(&(x))
160#define WRLKL(x) pthread_rwlock_wrlock(&(x))
161#define RWLKU(x) pthread_rwlock_unlock(&(x))
162
163
164// even though in theory having every Nth rendered line done by a different
165// thread might even out load across threads - it actually slows things down.
166//#define EVAS_SLI 1
167
168#else
169# define LK(x)
170# define LKI(x)
171# define LKD(x)
172# define LKL(x)
173# define LKT(x) 1
174# define LKU(x)
175# define TH(x)
176# define THI(x)
177# define TH_MAX 0
178# define LKDBG(x)
179
180/* for rwlocks */
181#define RWLK(x)
182#define RWLKI(x)
183#define RWLKD(x)
184#define RDLKL(x)
185#define WRLKL(x)
186#define RWLKU(x)
187
188#endif
189
190#ifdef HAVE_ALLOCA_H
191# include <alloca.h>
192#elif defined __GNUC__
193# define alloca __builtin_alloca
194#elif defined _AIX
195# define alloca __alloca
196#elif defined _MSC_VER
197# include <malloc.h>
198# define alloca _alloca
199#else
200# include <stddef.h>
201# ifdef __cplusplus
202extern "C"
203# endif
204void *alloca (size_t);
205#endif
206
207#include <stdio.h>
208#include <stdlib.h>
209#include <string.h>
210#include <sys/types.h>
211#include <sys/stat.h>
212#include <time.h>
213#include <ctype.h>
214
215#ifndef _MSC_VER
216# include <stdint.h>
217#endif
218
219#include <ft2build.h>
220#include FT_FREETYPE_H
221#include FT_GLYPH_H
222#include FT_SIZES_H
223#include FT_MODULE_H
224
225#ifdef __GNUC__
226# if __GNUC__ >= 4
227// BROKEN in gcc 4 on amd64
228//# pragma GCC visibility push(hidden)
229# endif
230#define LIKELY(x) __builtin_expect(!!(x), 1)
231#define UNLIKELY(x) __builtin_expect(!!(x), 0)
232#else
233#define LIKELY(x) (x)
234#define UNLIKELY(x) (x)
235#endif
236
237/*****************************************************************************/
238
239/* use exact rects for updates not tiles */
240/* #define RECTUPDATE */
241#define TILESIZE 8
242#define IMG_MAX_SIZE 65000
243
244#define IMG_TOO_BIG(w, h) \
245 ((((unsigned long long)w) * ((unsigned long long)h)) >= \
246 ((1ULL << (29 * (sizeof(void *) / 4))) - 2048))
247
248#ifdef BUILD_SMALL_DITHER_MASK
249# define DM_TABLE _evas_dither_44
250# define DM_SIZE 4
251# define DM_BITS 4
252# define DM_DIV 16
253# define USE_DITHER_44 1
254#else
255# define DM_TABLE _evas_dither_128128
256# define DM_SIZE 128
257# define DM_BITS 6
258# define DM_DIV 64
259# define USE_DITHER_128128 1
260#endif
261
262#define DM_MSK (DM_SIZE - 1)
263#define DM_SHF(_b) (DM_BITS - (8 - _b))
264/* Supports negative right shifts */
265#define DM_SHR(x, _b) ((DM_SHF(_b) >= 0) ? \
266 ((x) >> DM_SHF(_b)) : ((x) << -DM_SHF(_b)))
267
268/* if more than 1/ALPHA_SPARSE_INV_FRACTION is "alpha" (1-254) then sparse
269 * alpha flag gets set */
270#define ALPHA_SPARSE_INV_FRACTION 3
271
272/*****************************************************************************/
273
274#if defined(__ARM_ARCH_3M__)
275# define __ARM_ARCH__ 40
276#endif
277#if defined(__ARM_ARCH_4__)
278# define __ARM_ARCH__ 40
279#endif
280#if defined(__ARM_ARCH_4T__)
281# define __ARM_ARCH__ 41
282#endif
283
284#if defined(__ARM_ARCH_5__)
285# define __ARM_ARCH__ 50
286#endif
287#if defined(__ARM_ARCH_5T__)
288# define __ARM_ARCH__ 51
289#endif
290#if defined(__ARM_ARCH_5E__)
291# define __ARM_ARCH__ 52
292#endif
293#if defined(__ARM_ARCH_5TE__)
294# define __ARM_ARCH__ 53
295#endif
296#if defined(__ARM_ARCH_5TEJ__)
297# define __ARM_ARCH__ 54
298#endif
299
300#if defined(__ARM_ARCH_6__)
301# define __ARM_ARCH__ 60
302#endif
303#if defined(__ARM_ARCH_6J__)
304# define __ARM_ARCH__ 61
305#endif
306#if defined(__ARM_ARCH_6K__)
307# define __ARM_ARCH__ 62
308#endif
309#if defined(__ARM_ARCH_6Z__)
310# define __ARM_ARCH__ 63
311#endif
312#if defined(__ARM_ARCH_6ZK__)
313# define __ARM_ARCH__ 64
314#endif
315#if defined(__ARM_ARCH_6T2__)
316# define __ARM_ARCH__ 65
317#endif
318
319#if defined(__ARM_ARCH_7__)
320# define __ARM_ARCH__ 70
321#endif
322#if defined(__ARM_ARCH_7A__)
323# define __ARM_ARCH__ 71
324#endif
325#if defined(__ARM_ARCH_7R__)
326# define __ARM_ARCH__ 72
327#endif
328#if defined(__ARM_ARCH_7M__)
329# define __ARM_ARCH__ 73
330#endif
331
332#if defined(__ARM_ARCH__) && (__ARM_ARCH__ >= 52)
333/* tested on ARMv6 (arm1136j-s), Nokia N800 CPU */
334#define pld(addr, off) \
335 __asm__("pld [%[address], %[offset]]":: \
336 [address] "r" (addr), [offset] "i" (off))
337#else
338#define pld(addr, off)
339#endif /* __ARMEL__ */
340
341/*****************************************************************************/
342
343#define UNROLL2(op...) op op
344#define UNROLL4(op...) UNROLL2(op) UNROLL2(op)
345#define UNROLL8(op...) UNROLL4(op) UNROLL4(op)
346#define UNROLL16(op...) UNROLL8(op) UNROLL8(op)
347
348#define UNROLL8_PLD_WHILE(start, size, end, op) \
349 pld(start, 0); \
350 end = start + (size & ~7); \
351 while (start < end) \
352 { \
353 pld(start, 32); \
354 UNROLL8(op); \
355 } \
356 end += (size & 7); \
357 pld(start, 32); \
358 while (start < end) \
359 { \
360 op; \
361 }
362
363/*****************************************************************************/
364
365typedef unsigned long long DATA64;
366typedef unsigned int DATA32;
367typedef unsigned short DATA16;
368typedef unsigned char DATA8;
369
370typedef struct _Image_Entry Image_Entry;
371typedef struct _Image_Entry_Flags Image_Entry_Flags;
372typedef struct _Image_Entry_Frame Image_Entry_Frame;
373typedef struct _Image_Timestamp Image_Timestamp;
374typedef struct _Engine_Image_Entry Engine_Image_Entry;
375typedef struct _Evas_Cache_Target Evas_Cache_Target;
376typedef struct _Evas_Preload_Pthread Evas_Preload_Pthread;
377
378typedef struct _RGBA_Image_Loadopts RGBA_Image_Loadopts;
379#ifdef BUILD_PIPE_RENDER
380typedef struct _RGBA_Pipe_Op RGBA_Pipe_Op;
381typedef struct _RGBA_Pipe RGBA_Pipe;
382typedef struct _RGBA_Pipe_Thread_Info RGBA_Pipe_Thread_Info;
383#endif
384typedef struct _RGBA_Image RGBA_Image;
385typedef struct _RGBA_Image_Span RGBA_Image_Span;
386typedef struct _RGBA_Draw_Context RGBA_Draw_Context;
387typedef struct _RGBA_Polygon_Point RGBA_Polygon_Point;
388typedef struct _RGBA_Map_Point RGBA_Map_Point;
389typedef struct _RGBA_Font RGBA_Font;
390typedef struct _RGBA_Font_Int RGBA_Font_Int;
391typedef struct _RGBA_Font_Source RGBA_Font_Source;
392typedef struct _RGBA_Font_Glyph RGBA_Font_Glyph;
393typedef struct _RGBA_Gfx_Compositor RGBA_Gfx_Compositor;
394
395typedef struct _Cutout_Rect Cutout_Rect;
396typedef struct _Cutout_Rects Cutout_Rects;
397
398typedef struct _Convert_Pal Convert_Pal;
399
400typedef struct _Tilebuf Tilebuf;
401typedef struct _Tilebuf_Tile Tilebuf_Tile;
402typedef struct _Tilebuf_Rect Tilebuf_Rect;
403
404typedef struct _Evas_Common_Transform Evas_Common_Transform;
405
406// RGBA_Map_Point
407// all coords are 20.12
408// fp type - an int for now
409typedef int FPc;
410// fp # of bits of float accuracy
411#define FP 8
412// fp half (half of an fp unit)
413#define FPH (1 << (FP - 1))
414// one fp unit
415#define FP1 (1 << (FP))
416
417/*
418typedef struct _Regionbuf Regionbuf;
419typedef struct _Regionspan Regionspan;
420*/
421
422typedef void (*RGBA_Gfx_Func) (DATA32 *src, DATA8 *mask, DATA32 col, DATA32 *dst, int len);
423typedef void (*RGBA_Gfx_Pt_Func) (DATA32 src, DATA8 mask, DATA32 col, DATA32 *dst);
424typedef void (*Gfx_Func_Copy) (DATA32 *src, DATA32 *dst, int len);
425
426typedef void (*Gfx_Func_Convert) (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
427
428#include "../cache/evas_cache.h"
429
430/*****************************************************************************/
431
432typedef enum _RGBA_Image_Flags
433{
434 RGBA_IMAGE_NOTHING = (0),
435/* RGBA_IMAGE_HAS_ALPHA = (1 << 0), */
436 RGBA_IMAGE_IS_DIRTY = (1 << 1),
437 RGBA_IMAGE_INDEXED = (1 << 2),
438 RGBA_IMAGE_ALPHA_ONLY = (1 << 3),
439 RGBA_IMAGE_ALPHA_TILES = (1 << 4),
440/* RGBA_IMAGE_ALPHA_SPARSE = (1 << 5), */
441/* RGBA_IMAGE_LOADED = (1 << 6), */
442/* RGBA_IMAGE_NEED_DATA = (1 << 7) */
443 RGBA_IMAGE_TODO_LOAD = (1 << 8),
444} RGBA_Image_Flags;
445
446typedef enum _Convert_Pal_Mode
447{
448 PAL_MODE_NONE,
449 PAL_MODE_MONO,
450 PAL_MODE_GRAY4,
451 PAL_MODE_GRAY16,
452 PAL_MODE_GRAY64,
453 PAL_MODE_GRAY256,
454 PAL_MODE_RGB111,
455 PAL_MODE_RGB121,
456 PAL_MODE_RGB221,
457 PAL_MODE_RGB222,
458 PAL_MODE_RGB232,
459 PAL_MODE_RGB332,
460 PAL_MODE_RGB666,
461 PAL_MODE_LAST
462} Convert_Pal_Mode;
463
464typedef enum _CPU_Features
465{
466 CPU_FEATURE_C = 0,
467 CPU_FEATURE_MMX = (1 << 0),
468 CPU_FEATURE_MMX2 = (1 << 1),
469 CPU_FEATURE_SSE = (1 << 2),
470 CPU_FEATURE_ALTIVEC = (1 << 3),
471 CPU_FEATURE_VIS = (1 << 4),
472 CPU_FEATURE_VIS2 = (1 << 5),
473 CPU_FEATURE_NEON = (1 << 6),
474 CPU_FEATURE_SSE3 = (1 << 7)
475} CPU_Features;
476
477typedef enum _Font_Hint_Flags
478{
479 FONT_NO_HINT,
480 FONT_AUTO_HINT,
481 FONT_BYTECODE_HINT
482} Font_Hint_Flags;
483
484typedef enum _Font_Rend_Flags
485{
486 FONT_REND_REGULAR = 0,
487 FONT_REND_SLANT = (1 << 0),
488 FONT_REND_WEIGHT = (1 << 1),
489} Font_Rend_Flags;
490
491/*****************************************************************************/
492
493#if 0 // filtering disabled
494typedef struct _Filtered_Image Filtered_Image;
495#endif
496
497struct _RGBA_Image_Loadopts
498{
499 int scale_down_by; // if > 1 then use this
500 double dpi; // if > 0.0 use this
501 unsigned int w, h; // if > 0 use this
502 unsigned int degree;//if>0 there is some info related with rotation
503 struct {
504 unsigned int x, y, w, h;
505 } region;
506
507 Eina_Bool orientation; // if EINA_TRUE => should honor orientation information provided by file (like jpeg exif info)
508};
509
510struct _Image_Entry_Flags
511{
512 Eina_Bool loaded : 1;
513 Eina_Bool in_progress : 1;
514 Eina_Bool dirty : 1;
515 Eina_Bool activ : 1;
516
517 Eina_Bool need_data : 1;
518 Eina_Bool lru_nodata : 1;
519 Eina_Bool cached : 1;
520 Eina_Bool alpha : 1;
521
522 Eina_Bool lru : 1;
523 Eina_Bool alpha_sparse : 1;
524#ifdef BUILD_ASYNC_PRELOAD
525 Eina_Bool preload_done : 1;
526 Eina_Bool delete_me : 1;
527 Eina_Bool pending : 1;
528#endif
529 Eina_Bool animated : 1;
530 Eina_Bool rotated : 1;
531};
532
533struct _Image_Entry_Frame
534{
535 int index;
536 DATA32 *data; /* frame decoding data */
537 void *info; /* special image type info */
538 Eina_Bool loaded : 1;
539};
540
541struct _Evas_Cache_Target
542{
543 EINA_INLIST;
544 const void *target;
545 void *data;
546};
547
548struct _Image_Timestamp
549{
550 time_t mtime;
551 off_t size;
552 ino_t ino;
553#ifdef _STAT_VER_LINUX
554 unsigned long int mtime_nsec;
555#endif
556};
557
558struct _Image_Entry
559{
560 EINA_INLIST;
561
562 Evas_Cache_Image *cache;
563
564 const char *cache_key;
565
566 const char *file;
567 const char *key;
568
569 Evas_Cache_Target *targets;
570 Evas_Preload_Pthread *preload;
571
572 Image_Timestamp tstamp;
573
574 int references;
575#ifdef EVAS_FRAME_QUEUING
576 LK(lock_references); // needed for accessing references
577#endif
578
579#ifdef BUILD_PIPE_RENDER
580 RGBA_Pipe *pipe;
581#ifdef EVAS_FRAME_QUEUING
582 LK(ref_fq_add);
583 LK(ref_fq_del);
584 Eina_Condition cond_fq_del;
585 int ref_fq[2]; // ref_fq[0] is for addition, ref_fq[1] is for deletion
586#endif
587#endif
588
589 unsigned char scale;
590
591 RGBA_Image_Loadopts load_opts;
592 int space;
593 unsigned int w;
594 unsigned int h;
595
596 struct
597 {
598 unsigned int w;
599 unsigned int h;
600 } allocated;
601
602 struct
603 {
604 void *module;
605 void *loader;
606 } info;
607
608#ifdef BUILD_ASYNC_PRELOAD
609 LK(lock);
610 LK(lock_cancel);
611 Eina_Bool unload_cancel : 1;
612#endif
613
614 Image_Entry_Flags flags;
615 Evas_Image_Scale_Hint scale_hint;
616 void *data1, *data2;
617 int server_id;
618 int connect_num;
619 int channel;
620 int load_error;
621
622 /* for animation feature */
623 int frame_count;
624 Evas_Image_Animated_Loop_Hint loop_hint;
625 int loop_count;
626 int cur_frame;
627 Eina_List *frames;
628};
629
630struct _Engine_Image_Entry
631{
632 EINA_INLIST;
633
634 /* Upper Engine data. */
635 Image_Entry *src;
636
637 /* Cache stuff. */
638 Evas_Cache_Engine_Image *cache;
639 const char *cache_key;
640
641 struct
642 {
643 Eina_Bool cached : 1;
644 Eina_Bool activ : 1;
645 Eina_Bool dirty : 1;
646 Eina_Bool loaded : 1;
647 Eina_Bool need_parent : 1;
648 } flags;
649
650 int references;
651 int w;
652 int h;
653};
654
655struct _Cutout_Rect
656{
657 int x, y, w, h;
658};
659
660struct _Cutout_Rects
661{
662 Cutout_Rect* rects;
663 int active;
664 int max;
665};
666
667struct _Evas_Common_Transform
668{
669 float mxx, mxy, mxz;
670 float myx, myy, myz;
671 float mzx, mzy, mzz;
672};
673
674struct _RGBA_Draw_Context
675{
676 struct {
677 Eina_Bool use : 1;
678 DATA32 col;
679 } mul;
680 struct {
681 DATA32 col;
682 } col;
683 struct RGBA_Draw_Context_clip {
684 int x, y, w, h;
685 Eina_Bool use : 1;
686 } clip;
687 struct {
688 int x, y, w, h;
689 RGBA_Image *mask;
690 } mask;
691 Cutout_Rects cutout;
692 struct {
693 struct {
694 void *(*gl_new) (void *data, RGBA_Font_Glyph *fg);
695 void (*gl_free) (void *ext_dat);
696 void (*gl_draw) (void *data, void *dest, void *context, RGBA_Font_Glyph *fg, int x, int y);
697 } func;
698 void *data;
699 } font_ext;
700 struct {
701 int color_space;
702 } interpolation;
703 struct {
704 int y, h;
705 } sli;
706 int render_op;
707 Eina_Bool anti_alias : 1;
708};
709
710#ifdef BUILD_PIPE_RENDER
711#include "../engines/common/evas_map_image.h"
712#include "../engines/common/evas_text_utils.h"
713
714struct _RGBA_Pipe_Op
715{
716 RGBA_Draw_Context context;
717 void (*op_func) (RGBA_Image *dst, RGBA_Pipe_Op *op, RGBA_Pipe_Thread_Info *info);
718 void (*free_func) (RGBA_Pipe_Op *op);
719
720 union {
721 struct {
722 int x, y, w, h;
723 } rect;
724 struct {
725 int x0, y0, x1, y1;
726 } line;
727 struct {
728 RGBA_Polygon_Point *points;
729 } poly;
730 struct {
731 RGBA_Font *font;
732 int x, y;
733 Evas_Text_Props intl_props;
734 } text;
735 struct {
736 RGBA_Image *src;
737 int sx, sy, sw, sh, dx, dy, dw, dh;
738 int smooth;
739 char *text;
740 } image;
741 struct {
742 RGBA_Image *src;
743 RGBA_Map_Point *p;
744 int npoints;
745 int smooth;
746 int level;
747 } map;
748 } op;
749};
750
751#define PIPE_LEN 256
752
753struct _RGBA_Pipe
754{
755 EINA_INLIST;
756 int op_num;
757 RGBA_Pipe_Op op[PIPE_LEN];
758};
759
760struct _RGBA_Pipe_Thread_Info
761{
762 RGBA_Image *im;
763 int x, y, w, h;
764};
765#endif
766
767struct _RGBA_Image
768{
769 Image_Entry cache_entry;
770
771 RGBA_Image_Flags flags;
772 struct
773 {
774/* void *module; */
775/* void *loader; */
776/* char *real_file; */
777 char *comment;
778// int format;
779 } info;
780
781 void *extended_info;
782 int ref;
783
784/* unsigned char scale; */
785
786 /* Colorspace stuff. */
787 struct {
788 void *data;
789 Eina_Bool no_free : 1;
790 Eina_Bool dirty : 1;
791 } cs;
792
793 /* RGBA stuff */
794 struct {
795 DATA32 *data;
796 Eina_Bool no_free : 1;
797 } image;
798
799 struct {
800 DATA8 *mask;
801 Eina_Bool dirty: 1;
802 } mask;
803
804#if 0 // filtering disabled
805 Eina_List *filtered;
806#endif
807
808 struct {
809 LK(lock);
810 Eina_List *list;
811 unsigned long long orig_usage;
812 unsigned long long usage_count;
813 int populate_count;
814 unsigned long long newest_usage;
815 unsigned long long newest_usage_count;
816 } cache;
817
818#ifdef HAVE_PIXMAN
819 struct {
820 pixman_image_t *im;
821 } pixman;
822#endif
823};
824
825struct _RGBA_Polygon_Point
826{
827 EINA_INLIST;
828 int x, y;
829};
830
831struct _RGBA_Map_Point
832{
833 FPc x, y; // x, y screenspace
834 float fx, fy, fz; // x, y, z in floats
835// FPc x3, y3; // x, y 3d space
836 FPc z; // z in world space. optional
837 FPc u, v; // u, v in tex coords
838 DATA32 col; // color at this point
839 // for perspective correctness - only point 0 has relevant info
840 FPc px, py, z0, foc;
841};
842
843#if 0 // filtering disabled
844struct _Filtered_Image
845{
846 void *key;
847 size_t keylen;
848 RGBA_Image *image;
849 int ref;
850};
851#endif
852
853// for fonts...
854/////
855typedef struct _Fash_Item_Index_Map Fash_Item_Index_Map;
856typedef struct _Fash_Int_Map Fash_Int_Map;
857typedef struct _Fash_Int_Map2 Fash_Int_Map2;
858typedef struct _Fash_Int Fash_Int;
859struct _Fash_Item_Index_Map
860{
861 RGBA_Font_Int *fint;
862 int index;
863};
864struct _Fash_Int_Map
865{
866 Fash_Item_Index_Map item[256];
867};
868struct _Fash_Int_Map2
869{
870 Fash_Int_Map *bucket[256];
871};
872struct _Fash_Int
873{
874 Fash_Int_Map2 *bucket[256];
875 void (*freeme) (Fash_Int *fash);
876};
877
878/////
879typedef struct _Fash_Glyph_Map Fash_Glyph_Map;
880typedef struct _Fash_Glyph_Map2 Fash_Glyph_Map2;
881typedef struct _Fash_Glyph Fash_Glyph;
882struct _Fash_Glyph_Map
883{
884 RGBA_Font_Glyph *item[256];
885};
886struct _Fash_Glyph_Map2
887{
888 Fash_Glyph_Map *bucket[256];
889};
890struct _Fash_Glyph
891{
892 Fash_Glyph_Map2 *bucket[256];
893 void (*freeme) (Fash_Glyph *fash);
894};
895/////
896
897struct _RGBA_Font
898{
899 Eina_List *fonts;
900 Fash_Int *fash;
901 Font_Hint_Flags hinting;
902 int references;
903#ifdef EVAS_FRAME_QUEUING
904 int ref_fq[2]; //ref_fq[0] is for addition, ref_fq[1] is for deletion
905 Eina_Condition cond_fq_del;
906 LK(ref_fq_add);
907 LK(ref_fq_del);
908#endif
909 LK(lock);
910 unsigned char sizeok : 1;
911};
912
913#include "../engines/common/evas_font_ot.h"
914
915struct _RGBA_Font_Int
916{
917 EINA_INLIST;
918 RGBA_Font_Source *src;
919 Eina_Hash *kerning;
920 Fash_Glyph *fash;
921 unsigned int size;
922 int real_size;
923 int max_h;
924 int references;
925 int usage;
926 struct {
927 FT_Size size;
928#ifdef USE_HARFBUZZ
929 void *hb_font;
930#endif
931 } ft;
932 LK(ft_mutex);
933 Font_Hint_Flags hinting;
934 Font_Rend_Flags wanted_rend; /* The wanted rendering style */
935 Font_Rend_Flags runtime_rend; /* The rendering we need to do on runtime
936 in order to comply with the wanted_rend. */
937 unsigned char sizeok : 1;
938 unsigned char inuse : 1;
939};
940
941struct _RGBA_Font_Source
942{
943 const char *name;
944 const char *file;
945 void *data;
946 unsigned int current_size;
947 int data_size;
948 int references;
949 struct {
950 int orig_upem;
951 FT_Face face;
952 } ft;
953};
954
955struct _RGBA_Font_Glyph
956{
957 FT_UInt index;
958 FT_Glyph glyph;
959 FT_BitmapGlyph glyph_out;
960 /* this is a problem - only 1 engine at a time can extend such a font... grrr */
961 void *ext_dat;
962 void (*ext_dat_free) (void *ext_dat);
963 RGBA_Font_Int *fi;
964};
965
966struct _RGBA_Gfx_Compositor
967{
968 const char *name;
969
970 void (*init)(void);
971 void (*shutdown)(void);
972
973 RGBA_Gfx_Func (*composite_pixel_span_get)(RGBA_Image *src, RGBA_Image *dst, int pixels);
974 RGBA_Gfx_Func (*composite_color_span_get)(DATA32 col, RGBA_Image *dst, int pixels);
975 RGBA_Gfx_Func (*composite_pixel_color_span_get)(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels);
976 RGBA_Gfx_Func (*composite_mask_color_span_get)(DATA32 col, RGBA_Image *dst, int pixels);
977 RGBA_Gfx_Func (*composite_pixel_mask_span_get)(RGBA_Image *src, RGBA_Image *dst, int pixels);
978
979 RGBA_Gfx_Pt_Func (*composite_pixel_pt_get)(Image_Entry_Flags src_flags, RGBA_Image *dst);
980 RGBA_Gfx_Pt_Func (*composite_color_pt_get)(DATA32 col, RGBA_Image *dst);
981 RGBA_Gfx_Pt_Func (*composite_pixel_color_pt_get)(Image_Entry_Flags src_flags, DATA32 col, RGBA_Image *dst);
982 RGBA_Gfx_Pt_Func (*composite_mask_color_pt_get)(DATA32 col, RGBA_Image *dst);
983 RGBA_Gfx_Pt_Func (*composite_pixel_mask_pt_get)(Image_Entry_Flags src_flags, RGBA_Image *dst);
984};
985
986#define EVAS_RECT_SPLIT 1
987#ifdef EVAS_RECT_SPLIT
988typedef struct list_node list_node_t;
989typedef struct list list_t;
990typedef struct rect rect_t;
991typedef struct rect_node rect_node_t;
992
993struct list_node
994{
995 struct list_node *next;
996};
997
998struct list
999{
1000 struct list_node *head;
1001 struct list_node *tail;
1002};
1003
1004struct rect
1005{
1006 short left;
1007 short top;
1008 short right;
1009 short bottom;
1010 short width;
1011 short height;
1012 int area;
1013};
1014
1015struct rect_node
1016{
1017 struct list_node _lst;
1018 struct rect rect;
1019};
1020#endif /* EVAS_RECT_SPLIT */
1021
1022struct _Tilebuf
1023{
1024 int outbuf_w;
1025 int outbuf_h;
1026
1027 struct {
1028 int w, h;
1029 } tile_size;
1030
1031 struct {
1032 int x, y, w, h;
1033 } prev_add, prev_del;
1034#ifdef RECTUPDATE
1035/*
1036 Regionbuf *rb;
1037 */
1038#elif defined(EVAS_RECT_SPLIT)
1039 int need_merge;
1040 list_t rects;
1041#else
1042/*
1043 struct {
1044 int w, h;
1045 Tilebuf_Tile *tiles;
1046 } tiles;
1047 */
1048#endif
1049};
1050
1051struct _Tilebuf_Tile
1052{
1053 Eina_Bool redraw : 1;
1054/* FIXME: need these flags later - but not now */
1055/*
1056 Eina_Bool done : 1;
1057 Eina_Bool edge : 1;
1058 Eina_Bool from : 1;
1059
1060 struct {
1061 int dx, dy;
1062 } vector;
1063 */
1064};
1065
1066struct _Tilebuf_Rect
1067{
1068 EINA_INLIST;
1069 int x, y, w, h;
1070};
1071/*
1072struct _Regionbuf
1073{
1074 int w, h;
1075 Regionspan **spans;
1076};
1077
1078struct _Regionspan
1079{
1080 EINA_INLIST;
1081 int x1, x2;
1082};
1083*/
1084
1085struct _Convert_Pal
1086{
1087 int references;
1088 int count;
1089 Convert_Pal_Mode colors;
1090 DATA8 *lookup;
1091 void *data;
1092};
1093
1094/****/
1095
1096/*****************************************************************************/
1097#include "evas_macros.h"
1098
1099#ifndef WORDS_BIGENDIAN
1100/* x86 */
1101#define A_VAL(p) (((DATA8 *)(p))[3])
1102#define R_VAL(p) (((DATA8 *)(p))[2])
1103#define G_VAL(p) (((DATA8 *)(p))[1])
1104#define B_VAL(p) (((DATA8 *)(p))[0])
1105#define AR_VAL(p) ((DATA16 *)(p)[1])
1106#define GB_VAL(p) ((DATA16 *)(p)[0])
1107#else
1108/* ppc */
1109#define A_VAL(p) (((DATA8 *)(p))[0])
1110#define R_VAL(p) (((DATA8 *)(p))[1])
1111#define G_VAL(p) (((DATA8 *)(p))[2])
1112#define B_VAL(p) (((DATA8 *)(p))[3])
1113#define AR_VAL(p) ((DATA16 *)(p)[0])
1114#define GB_VAL(p) ((DATA16 *)(p)[1])
1115#endif
1116
1117#define RGB_JOIN(r,g,b) \
1118 (((r) << 16) + ((g) << 8) + (b))
1119
1120#define ARGB_JOIN(a,r,g,b) \
1121 (((a) << 24) + ((r) << 16) + ((g) << 8) + (b))
1122
1123#include "evas_blend_ops.h"
1124
1125#define _EVAS_RENDER_FILL -1
1126#define _EVAS_RENDER_BLEND 0
1127#define _EVAS_RENDER_BLEND_REL 1
1128#define _EVAS_RENDER_COPY 2
1129#define _EVAS_RENDER_COPY_REL 3
1130#define _EVAS_RENDER_ADD 4
1131#define _EVAS_RENDER_ADD_REL 5
1132#define _EVAS_RENDER_SUB 6
1133#define _EVAS_RENDER_SUB_REL 7
1134#define _EVAS_RENDER_TINT 8
1135#define _EVAS_RENDER_TINT_REL 9
1136#define _EVAS_RENDER_MASK 10
1137#define _EVAS_RENDER_MUL 11
1138#define _EVAS_RENDER_CLIP 12
1139
1140#define _EVAS_TEXTURE_REFLECT 0
1141#define _EVAS_TEXTURE_REPEAT 1
1142#define _EVAS_TEXTURE_RESTRICT 2
1143#define _EVAS_TEXTURE_RESTRICT_REFLECT 3
1144#define _EVAS_TEXTURE_RESTRICT_REPEAT 4
1145#define _EVAS_TEXTURE_PAD 5
1146
1147#define _EVAS_COLOR_SPACE_ARGB 0
1148#define _EVAS_COLOR_SPACE_AHSV 1
1149
1150/*****************************************************************************/
1151
1152#define SCALE_SIZE_MAX ((1 << 15) - 1)
1153
1154#ifdef __cplusplus
1155extern "C" {
1156#endif
1157
1158/****/
1159void evas_common_init (void);
1160void evas_common_shutdown (void);
1161
1162EAPI void evas_common_cpu_init (void);
1163
1164int evas_common_cpu_have_cpuid (void);
1165int evas_common_cpu_has_feature (unsigned int feature);
1166EAPI void evas_common_cpu_can_do (int *mmx, int *sse, int *sse2);
1167EAPI void evas_common_cpu_end_opt (void);
1168
1169/****/
1170#include "../engines/common/evas_blend.h"
1171
1172EAPI Gfx_Func_Copy evas_common_draw_func_copy_get (int pixels, int reverse);
1173
1174/****/
1175#include "../engines/common/evas_convert_color.h"
1176#include "../engines/common/evas_convert_colorspace.h"
1177#include "../engines/common/evas_convert_main.h"
1178#include "../engines/common/evas_convert_yuv.h"
1179#include "../engines/common/evas_scale_main.h"
1180#include "../engines/common/evas_scale_smooth.h"
1181#include "../engines/common/evas_scale_span.h"
1182
1183/****/
1184#include "../engines/common/evas_image.h"
1185
1186/****/
1187#include "../engines/common/evas_line.h"
1188#include "../engines/common/evas_polygon.h"
1189#include "../engines/common/evas_rectangle.h"
1190
1191/****/
1192EAPI void evas_common_blit_init (void);
1193
1194EAPI void evas_common_blit_rectangle (const RGBA_Image *src, RGBA_Image *dst, int src_x, int src_y, int w, int h, int dst_x, int dst_y);
1195
1196/****/
1197#include "../engines/common/evas_font.h"
1198
1199/****/
1200EAPI void evas_common_tilebuf_init (void);
1201
1202EAPI Tilebuf *evas_common_tilebuf_new (int w, int h);
1203EAPI void evas_common_tilebuf_free (Tilebuf *tb);
1204EAPI void evas_common_tilebuf_set_tile_size (Tilebuf *tb, int tw, int th);
1205EAPI void evas_common_tilebuf_get_tile_size (Tilebuf *tb, int *tw, int *th);
1206EAPI int evas_common_tilebuf_add_redraw (Tilebuf *tb, int x, int y, int w, int h);
1207EAPI int evas_common_tilebuf_del_redraw (Tilebuf *tb, int x, int y, int w, int h);
1208EAPI int evas_common_tilebuf_add_motion_vector (Tilebuf *tb, int x, int y, int w, int h, int dx, int dy, int alpha);
1209EAPI void evas_common_tilebuf_clear (Tilebuf *tb);
1210EAPI Tilebuf_Rect *evas_common_tilebuf_get_render_rects (Tilebuf *tb);
1211EAPI void evas_common_tilebuf_free_render_rects (Tilebuf_Rect *rects);
1212
1213/*
1214Regionbuf *evas_common_regionbuf_new (int w, int h);
1215void evas_common_regionbuf_free (Regionbuf *rb);
1216void evas_common_regionbuf_clear (Regionbuf *rb);
1217void evas_common_regionbuf_span_add (Regionbuf *rb, int x1, int x2, int y);
1218void evas_common_regionbuf_span_del (Regionbuf *rb, int x1, int x2, int y);
1219Tilebuf_Rect *evas_common_regionbuf_rects_get (Regionbuf *rb);
1220*/
1221
1222/****/
1223#include "../engines/common/evas_draw.h"
1224
1225#include "../engines/common/evas_map_image.h"
1226
1227/****/
1228#ifdef BUILD_PIPE_RENDER
1229# include "../engines/common/evas_pipe.h"
1230#endif
1231
1232void evas_font_dir_cache_free(void);
1233
1234/****/
1235
1236/*****************************************************************************/
1237
1238#ifdef __cplusplus
1239}
1240#endif
1241
1242#endif
diff --git a/libraries/evas/src/lib/include/evas_common_soft16.h b/libraries/evas/src/lib/include/evas_common_soft16.h
new file mode 100644
index 0000000..446319e
--- /dev/null
+++ b/libraries/evas/src/lib/include/evas_common_soft16.h
@@ -0,0 +1,100 @@
1#ifndef EVAS_COMMON_SOFT16_H
2#define EVAS_COMMON_SOFT16_H
3
4#include "evas_common.h"
5#include "evas_private.h"
6
7#ifdef __cplusplus
8extern "C" {
9#endif
10
11#define RGB_565_UNPACKED_MASK 0x07e0f81f
12#define RGB_565_UNPACK(rgb) \
13 (((rgb) | ((rgb) << 16)) & RGB_565_UNPACKED_MASK)
14#define RGB_565_PACK(rgb) \
15 ((((rgb) & RGB_565_UNPACKED_MASK) | \
16 ((rgb) & RGB_565_UNPACKED_MASK) >> 16) & 0xffff)
17#define RGB_565_UNPACKED_BLEND(a, b, alpha) \
18 ((b) + (a) - ((((b) * (alpha)) >> 5) & RGB_565_UNPACKED_MASK))
19#define RGB_565_UNPACKED_BLEND_UNMUL(a, b, alpha) \
20 ((b) + ((((a) - (b)) * (alpha)) >> 5))
21
22#define RGB_565_FROM_COMPONENTS(r, g, b) \
23 (((((r) >> 3) & 0x1f) << 11) | \
24 ((((g) >> 2) & 0x3f) << 5) | \
25 (((b) >> 3) & 0x1f))
26
27static inline unsigned int
28_calc_stride(unsigned int w)
29{
30 unsigned int pad = w % 4;
31 if (!pad) return w;
32 else return w + 4 - pad;
33}
34
35#define IMG_BYTE_SIZE(stride, height, has_alpha) \
36 ((stride) * (height) * (!(has_alpha) ? 2 : 3))
37
38typedef struct _Soft16_Image Soft16_Image;
39struct _Soft16_Image
40{
41 Image_Entry cache_entry;
42
43 RGBA_Image *source;
44
45 int stride; // pixel stride - likely a multiple of 2
46 DATA16 *pixels; // 16bpp pixels rgb565
47 DATA8 *alpha; // 8bit alpha mask - optional. points into pixels
48
49 struct
50 {
51/* unsigned char have_alpha : 1; // 1 if we have halpha */
52 unsigned char free_pixels : 1; // 1 if pixels should be freed
53 unsigned char free_alpha : 1; // 1 if alpha mask should be freed
54 } flags;
55};
56
57/**
58 * Image (evas_soft16_main.c)
59 */
60EAPI void evas_common_soft16_image_init(void);
61EAPI void evas_common_soft16_image_shutdown(void);
62EAPI Evas_Cache_Image *evas_common_soft16_image_cache_get(void);
63
64EAPI void evas_common_soft16_image_draw(Soft16_Image *src, Soft16_Image *dst, RGBA_Draw_Context *dc, 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, int smooth);
65EAPI Soft16_Image *evas_common_soft16_image_alpha_set(Soft16_Image *im, int have_alpha);
66
67void evas_common_soft16_image_draw_unscaled(Soft16_Image *src, Soft16_Image *dst, RGBA_Draw_Context *dc, const Eina_Rectangle sr, const Eina_Rectangle dr, const Eina_Rectangle cr);
68void evas_common_soft16_image_draw_scaled_sampled(Soft16_Image *src, Soft16_Image *dst, RGBA_Draw_Context *dc, const Eina_Rectangle sr, const Eina_Rectangle dr, const Eina_Rectangle cr);
69
70/* convert/dither functions */
71void evas_common_soft16_image_convert_from_rgb(Soft16_Image *im, const DATA32 *src);
72void evas_common_soft16_image_convert_from_rgba(Soft16_Image *im, const DATA32 *src);
73
74/**
75 * Rectangle (evas_soft16_rectangle.c)
76 */
77EAPI void evas_common_soft16_rectangle_draw(Soft16_Image *dst, RGBA_Draw_Context *dc, int x, int y, int w, int h);
78
79/**
80 * Polygon (evas_soft16_polygon.c)
81 */
82 EAPI void evas_common_soft16_polygon_draw(Soft16_Image *dst, RGBA_Draw_Context *dc, RGBA_Polygon_Point *points, int x, int y);
83
84/**
85 * Line (evas_soft16_line.c)
86 */
87EAPI void evas_common_soft16_line_draw(Soft16_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, int x1, int y1);
88
89/**
90 * Font (evas_soft16_font.c)
91 */
92EAPI void *evas_common_soft16_font_glyph_new(void *data, RGBA_Font_Glyph *fg);
93EAPI void evas_common_soft16_font_glyph_free(void *ext_dat);
94EAPI void evas_common_soft16_font_glyph_draw(void *data, void *dest, void *context, RGBA_Font_Glyph *fg, int x, int y);
95
96#ifdef __cplusplus
97}
98#endif
99
100#endif
diff --git a/libraries/evas/src/lib/include/evas_common_soft8.h b/libraries/evas/src/lib/include/evas_common_soft8.h
new file mode 100644
index 0000000..d701842
--- /dev/null
+++ b/libraries/evas/src/lib/include/evas_common_soft8.h
@@ -0,0 +1,184 @@
1#ifndef EVAS_COMMON_SOFT8_H
2#define EVAS_COMMON_SOFT8_H
3
4#include "evas_common.h"
5#include "evas_private.h"
6
7#ifdef __cplusplus
8extern "C" {
9#endif
10
11#define GRY_8_BLEND(a, b, alpha) \
12 ((b) + (a) - ((((b) * ((alpha) + 1)) >> 8) & 0xff))
13
14#define GRY_8_BLEND_UNMUL(a, b, alpha) \
15 ((b) + ((((a) - (b)) * ((alpha) + 1)) >> 8))
16
17#if 0
18#define GRY_8_FROM_COMPONENTS(r, g, b) \
19 (((307 * (r)) + \
20 (604 * (g)) + \
21 (113 * (b))) >> 10)
22
23#define GRY_8_FROM_RGB(rgb) \
24 GRY_8_FROM_COMPONENTS(R_VAL(rgb), G_VAL(rgb), B_VAL(rgb))
25#endif
26
27//Y = R * 0.2126 + G * 0.7152 + B * 0.0722
28
29#define GRY_8_FROM_COMPONENTS(r, g, b) \
30 (((218 * (r)) + \
31 (732 * (g)) + \
32 (74 * (b))) >> 10)
33
34#define GRY_8_FROM_RGB(rgb) \
35 GRY_8_FROM_COMPONENTS(R_VAL(rgb), G_VAL(rgb), B_VAL(rgb))
36
37#define UNROLL2(op...) op op
38#define UNROLL4(op...) UNROLL2(op) UNROLL2(op)
39#define UNROLL8(op...) UNROLL4(op) UNROLL4(op)
40#define UNROLL16(op...) UNROLL8(op) UNROLL8(op)
41
42#if defined(__ARM_ARCH_3M__)
43# define __ARM_ARCH__ 40
44#endif
45#if defined(__ARM_ARCH_4__)
46# define __ARM_ARCH__ 40
47#endif
48#if defined(__ARM_ARCH_4T__)
49# define __ARM_ARCH__ 41
50#endif
51
52#if defined(__ARM_ARCH_5__)
53# define __ARM_ARCH__ 50
54#endif
55#if defined(__ARM_ARCH_5T__)
56# define __ARM_ARCH__ 51
57#endif
58#if defined(__ARM_ARCH_5E__)
59# define __ARM_ARCH__ 52
60#endif
61#if defined(__ARM_ARCH_5TE__)
62# define __ARM_ARCH__ 53
63#endif
64#if defined(__ARM_ARCH_5TEJ__)
65# define __ARM_ARCH__ 54
66#endif
67
68#if defined(__ARM_ARCH_6__)
69# define __ARM_ARCH__ 60
70#endif
71#if defined(__ARM_ARCH_6J__)
72# define __ARM_ARCH__ 61
73#endif
74#if defined(__ARM_ARCH_6K__)
75# define __ARM_ARCH__ 62
76#endif
77#if defined(__ARM_ARCH_6Z__)
78# define __ARM_ARCH__ 63
79#endif
80#if defined(__ARM_ARCH_6ZK__)
81# define __ARM_ARCH__ 64
82#endif
83#if defined(__ARM_ARCH_6T2__)
84# define __ARM_ARCH__ 65
85#endif
86
87#if defined(__ARM_ARCH_7__)
88# define __ARM_ARCH__ 70
89#endif
90#if defined(__ARM_ARCH_7A__)
91# define __ARM_ARCH__ 71
92#endif
93#if defined(__ARM_ARCH_7R__)
94# define __ARM_ARCH__ 72
95#endif
96#if defined(__ARM_ARCH_7M__)
97# define __ARM_ARCH__ 73
98#endif
99
100#if defined(__ARM_ARCH__) && (__ARM_ARCH__ >= 52)
101/* tested on ARMv6 (arm1136j-s), Nokia N800 CPU */
102#define pld(addr, off) \
103 __asm__("pld [%[address], %[offset]]":: \
104 [address] "r" (addr), [offset] "i" (off))
105#else
106#define pld(addr, off)
107#endif /* __ARMEL__ */
108
109static inline unsigned int
110_calc_stride(unsigned int w)
111{
112 unsigned int pad = w % 4;
113 if (!pad) return w;
114 else return w + 4 - pad;
115}
116
117#define IMG_BYTE_SIZE(stride, height, has_alpha) \
118 ((stride) * (height) * (!(has_alpha) ? 1 : 2))
119
120typedef struct _Soft8_Image Soft8_Image;
121struct _Soft8_Image
122{
123 Image_Entry cache_entry;
124
125 RGBA_Image *source;
126
127 int stride; // pixel stride
128 DATA8 *pixels; // 8bpp pixels gry8
129 DATA8 *alpha; // 8bit alpha mask - optional. points into pixels
130
131 void *extended_info;
132
133 struct
134 {
135/* unsigned char have_alpha : 1; // 1 if we have halpha */
136 unsigned char free_pixels : 1; // 1 if pixels should be freed
137 unsigned char free_alpha : 1; // 1 if alpha mask should be freed
138 } flags;
139};
140
141/**
142 * Image (evas_soft8_main.c)
143 */
144EAPI void evas_common_soft8_image_init(void);
145EAPI void evas_common_soft8_image_shutdown(void);
146EAPI Evas_Cache_Image *evas_common_soft8_image_cache_get(void);
147
148EAPI void evas_common_soft8_image_draw(Soft8_Image *src, Soft8_Image *dst, RGBA_Draw_Context *dc, 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, int smooth);
149EAPI Soft8_Image *evas_common_soft8_image_alpha_set(Soft8_Image *im, int have_alpha);
150
151void evas_common_soft8_image_draw_unscaled(Soft8_Image *src, Soft8_Image *dst, RGBA_Draw_Context *dc, const Eina_Rectangle sr, const Eina_Rectangle dr, const Eina_Rectangle cr);
152void evas_common_soft8_image_draw_scaled_sampled(Soft8_Image *src, Soft8_Image *dst, RGBA_Draw_Context *dc, const Eina_Rectangle sr, const Eina_Rectangle dr, const Eina_Rectangle cr);
153
154/* convert/dither functions */
155void evas_common_soft8_image_convert_from_rgb(Soft8_Image *im, const DATA32 *src);
156void evas_common_soft8_image_convert_from_rgba(Soft8_Image *im, const DATA32 *src);
157
158/**
159 * Rectangle (evas_soft8_rectangle.c)
160 */
161EAPI void evas_common_soft8_rectangle_draw(Soft8_Image *dst, RGBA_Draw_Context *dc, int x, int y, int w, int h);
162
163/**
164 * Polygon (evas_soft8_polygon.c)
165 */
166EAPI void evas_common_soft8_polygon_draw(Soft8_Image *dst, RGBA_Draw_Context *dc, RGBA_Polygon_Point *points, int x, int y);
167
168/**
169 * Line (evas_soft8_line.c)
170 */
171EAPI void evas_common_soft8_line_draw(Soft8_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, int x1, int y1);
172
173/**
174 * Font (evas_soft8_font.c)
175 */
176EAPI void *evas_common_soft8_font_glyph_new(void *data, RGBA_Font_Glyph *fg);
177EAPI void evas_common_soft8_font_glyph_free(void *ext_dat);
178EAPI void evas_common_soft8_font_glyph_draw(void *data, void *dest, void *context, RGBA_Font_Glyph *fg, int x, int y);
179
180#ifdef __cplusplus
181}
182#endif
183
184#endif
diff --git a/libraries/evas/src/lib/include/evas_inline.x b/libraries/evas/src/lib/include/evas_inline.x
new file mode 100644
index 0000000..45f2b1f
--- /dev/null
+++ b/libraries/evas/src/lib/include/evas_inline.x
@@ -0,0 +1,259 @@
1#ifndef EVAS_INLINE_H
2#define EVAS_INLINE_H
3
4static inline void
5_evas_object_event_new(void)
6{
7 _evas_event_counter++;
8}
9
10static inline int
11evas_object_was_visible(Evas_Object *obj)
12{
13 if ((obj->prev.visible) &&
14 ((obj->prev.cache.clip.visible) || (obj->smart.smart)) &&
15 ((obj->prev.cache.clip.a > 0 && obj->prev.render_op == EVAS_RENDER_BLEND)
16 || obj->prev.render_op != EVAS_RENDER_BLEND))
17 {
18 if (obj->func->was_visible)
19 return obj->func->was_visible(obj);
20 return 1;
21 }
22 return 0;
23}
24
25static inline void
26evas_add_rect(Eina_Array *rects, int x, int y, int w, int h)
27{
28 Eina_Rectangle *r;
29
30 NEW_RECT(r, x, y, w, h);
31 if (r) eina_array_push(rects, r);
32}
33
34static inline Cutout_Rect*
35evas_common_draw_context_cutouts_add(Cutout_Rects* rects,
36 int x, int y, int w, int h)
37{
38 Cutout_Rect* rect;
39
40 if (rects->max < (rects->active + 1))
41 {
42 rects->max += 128;
43 rects->rects = (Cutout_Rect *)realloc(rects->rects, sizeof(Cutout_Rect) * rects->max);
44 }
45
46 rect = rects->rects + rects->active;
47 rect->x = x;
48 rect->y = y;
49 rect->w = w;
50 rect->h = h;
51 rects->active++;
52
53 return rect;
54}
55
56static inline int
57evas_object_is_opaque(Evas_Object *obj)
58{
59 if (obj->smart.smart) return 0;
60 /* If a mask: Assume alpha */
61 if (obj->cur.mask) return 0;
62 if (obj->cur.cache.clip.a == 255)
63 {
64 if (obj->func->is_opaque)
65 return obj->func->is_opaque(obj);
66 return 1;
67 }
68 if (obj->cur.render_op == EVAS_RENDER_COPY)
69 return 1;
70 return 0;
71}
72
73static inline int
74evas_event_freezes_through(Evas_Object *obj)
75{
76 if (obj->freeze_events) return 1;
77 if (obj->parent_cache.freeze_events_valid)
78 return obj->parent_cache.freeze_events;
79 if (!obj->smart.parent) return 0;
80 obj->parent_cache.freeze_events =
81 evas_event_freezes_through(obj->smart.parent);
82 obj->parent_cache.freeze_events_valid = EINA_TRUE;
83 return obj->parent_cache.freeze_events;
84}
85
86static inline int
87evas_event_passes_through(Evas_Object *obj)
88{
89 if (obj->pass_events) return 1;
90 if (obj->parent_cache.pass_events_valid)
91 return obj->parent_cache.pass_events;
92 if (!obj->smart.parent) return 0;
93 obj->parent_cache.pass_events =
94 evas_event_passes_through(obj->smart.parent);
95 obj->parent_cache.pass_events_valid = EINA_TRUE;
96 return obj->parent_cache.pass_events;
97}
98
99static inline int
100evas_object_is_visible(Evas_Object *obj)
101{ /* post 1.0 -> enable? */
102 if ((obj->cur.visible)/* && (obj->cur.color.a > 0)*/ &&
103 ((obj->cur.cache.clip.visible) || (obj->smart.smart)) &&
104 ((obj->cur.cache.clip.a > 0 && obj->cur.render_op == EVAS_RENDER_BLEND)
105 || obj->cur.render_op != EVAS_RENDER_BLEND))
106 {
107 if (obj->func->is_visible)
108 return obj->func->is_visible(obj);
109 return 1;
110 }
111 return 0;
112}
113
114static inline int
115evas_object_clippers_is_visible(Evas_Object *obj)
116{
117 if (obj->cur.visible)
118 {
119 if (obj->cur.clipper)
120 return evas_object_clippers_is_visible(obj->cur.clipper);
121 return 1;
122 }
123 return 0;
124}
125
126static inline int
127evas_object_is_in_output_rect(Evas_Object *obj, int x, int y, int w, int h)
128{
129 /* assumes coords have been recalced */
130 if ((RECTS_INTERSECT(x, y, w, h,
131 obj->cur.cache.clip.x,
132 obj->cur.cache.clip.y,
133 obj->cur.cache.clip.w,
134 obj->cur.cache.clip.h)))
135 return 1;
136 return 0;
137}
138
139static inline int
140evas_object_is_active(Evas_Object *obj)
141{
142 if (evas_object_is_visible(obj) || evas_object_was_visible(obj))
143 {
144 if (obj->smart.smart)
145 {
146 int mapsmt = 0;
147 if (obj->smart.smart && (obj->cur.map && obj->cur.usemap)) mapsmt = 1;
148 if (!mapsmt) return 1;
149 if (evas_object_is_in_output_rect(obj, 0, 0, obj->layer->evas->output.w,
150 obj->layer->evas->output.h) ||
151 evas_object_was_in_output_rect(obj, 0, 0, obj->layer->evas->output.w,
152 obj->layer->evas->output.h))
153 return 1;
154 }
155 else
156 {
157 if (evas_object_is_in_output_rect(obj, 0, 0, obj->layer->evas->output.w,
158 obj->layer->evas->output.h) ||
159 evas_object_was_in_output_rect(obj, 0, 0, obj->layer->evas->output.w,
160 obj->layer->evas->output.h))
161 return 1;
162 }
163 }
164 return 0;
165}
166
167static inline void
168evas_object_coords_recalc(Evas_Object *obj)
169{
170//// if (obj->cur.cache.geometry.validity == obj->layer->evas->output_validity)
171//// return;
172//// obj->cur.cache.geometry.x =
173//// evas_coord_world_x_to_screen(obj->layer->evas, obj->cur.geometry.x);
174//// obj->cur.cache.geometry.y =
175//// evas_coord_world_y_to_screen(obj->layer->evas, obj->cur.geometry.y);
176//// obj->cur.cache.geometry.w =
177//// evas_coord_world_x_to_screen(obj->layer->evas, obj->cur.geometry.w) -
178//// evas_coord_world_x_to_screen(obj->layer->evas, 0);
179//// obj->cur.cache.geometry.h =
180//// evas_coord_world_y_to_screen(obj->layer->evas, obj->cur.geometry.h) -
181//// evas_coord_world_y_to_screen(obj->layer->evas, 0);
182 if (obj->func->coords_recalc) obj->func->coords_recalc(obj);
183//// obj->cur.cache.geometry.validity = obj->layer->evas->output_validity;
184}
185
186static inline void
187evas_object_clip_recalc(Evas_Object *obj)
188{
189 int cx, cy, cw, ch, cvis, cr, cg, cb, ca;
190 int nx, ny, nw, nh, nvis, nr, ng, nb, na;
191
192 if ((!obj->cur.cache.clip.dirty) &&
193 !(!obj->cur.clipper || obj->cur.clipper->cur.cache.clip.dirty))
194 return;
195 if (obj->layer->evas->events_frozen > 0) return;
196 evas_object_coords_recalc(obj);
197 if ((obj->cur.map) && (obj->cur.usemap))
198 {
199 cx = obj->cur.map->normal_geometry.x;
200 cy = obj->cur.map->normal_geometry.y;
201 cw = obj->cur.map->normal_geometry.w;
202 ch = obj->cur.map->normal_geometry.h;
203 }
204 else
205 {
206 cx = obj->cur.geometry.x;
207 cy = obj->cur.geometry.y;
208 cw = obj->cur.geometry.w;
209 ch = obj->cur.geometry.h;
210 }
211//// cx = obj->cur.cache.geometry.x; cy = obj->cur.cache.geometry.y;
212//// cw = obj->cur.cache.geometry.w; ch = obj->cur.cache.geometry.h;
213 if (obj->cur.color.a == 0 && obj->cur.render_op == EVAS_RENDER_BLEND) cvis = 0;
214 else cvis = obj->cur.visible;
215 cr = obj->cur.color.r; cg = obj->cur.color.g;
216 cb = obj->cur.color.b; ca = obj->cur.color.a;
217 if (obj->cur.clipper)
218 {
219// this causes problems... hmmm ?????
220 if (obj->cur.clipper->cur.cache.clip.dirty)
221 evas_object_clip_recalc(obj->cur.clipper);
222
223 // I don't know why this test was here in the first place. As I have
224 // no issue showing up due to this, I keep it and move color out of it.
225// breaks cliping of mapped images!!!
226 if (obj->cur.clipper->cur.map_parent == obj->cur.map_parent)
227 {
228 nx = obj->cur.clipper->cur.cache.clip.x;
229 ny = obj->cur.clipper->cur.cache.clip.y;
230 nw = obj->cur.clipper->cur.cache.clip.w;
231 nh = obj->cur.clipper->cur.cache.clip.h;
232 RECTS_CLIP_TO_RECT(cx, cy, cw, ch, nx, ny, nw, nh);
233 }
234
235 nvis = obj->cur.clipper->cur.cache.clip.visible;
236 nr = obj->cur.clipper->cur.cache.clip.r;
237 ng = obj->cur.clipper->cur.cache.clip.g;
238 nb = obj->cur.clipper->cur.cache.clip.b;
239 na = obj->cur.clipper->cur.cache.clip.a;
240 cvis = cvis * nvis;
241 cr = (cr * (nr + 1)) >> 8;
242 cg = (cg * (ng + 1)) >> 8;
243 cb = (cb * (nb + 1)) >> 8;
244 ca = (ca * (na + 1)) >> 8;
245 }
246 if ((ca == 0 && obj->cur.render_op == EVAS_RENDER_BLEND) || (cw <= 0) || (ch <= 0)) cvis = 0;
247 obj->cur.cache.clip.x = cx;
248 obj->cur.cache.clip.y = cy;
249 obj->cur.cache.clip.w = cw;
250 obj->cur.cache.clip.h = ch;
251 obj->cur.cache.clip.visible = cvis;
252 obj->cur.cache.clip.r = cr;
253 obj->cur.cache.clip.g = cg;
254 obj->cur.cache.clip.b = cb;
255 obj->cur.cache.clip.a = ca;
256 obj->cur.cache.clip.dirty = 0;
257}
258
259#endif
diff --git a/libraries/evas/src/lib/include/evas_macros.h b/libraries/evas/src/lib/include/evas_macros.h
new file mode 100644
index 0000000..ed29dbd
--- /dev/null
+++ b/libraries/evas/src/lib/include/evas_macros.h
@@ -0,0 +1,217 @@
1#ifndef EVAS_MACROS_H
2#define EVAS_MACROS_H
3
4#undef ABS
5#define ABS(x) (((x) < 0) ? -(x) : (x))
6
7#undef SGN
8#define SGN(x) (((x) < 0) ? -1 : 1)
9
10#undef MIN
11#define MIN(x, y) (((x) < (y)) ? (x) : (y))
12
13#undef MAX
14#define MAX(x, y) (((x) > (y)) ? (x) : (y))
15
16#define SWAP32(x) (x) = \
17 ((((x) & 0x000000ff ) << 24) | \
18 (((x) & 0x0000ff00 ) << 8) | \
19 (((x) & 0x00ff0000 ) >> 8) | \
20 (((x) & 0xff000000 ) >> 24))
21
22#define SWAP16(x) (x) = \
23 ((((x) & 0x00ff ) << 8) | \
24 (((x) & 0xff00 ) >> 8))
25
26#define SPANS_COMMON(x1, w1, x2, w2) \
27(!(( (int)((x2) + (int)(w2)) <= (int)(x1)) || (int)((x2) >= (int)((x1) + (int)(w1)))))
28
29#define RECTS_INTERSECT(x, y, w, h, xx, yy, ww, hh) \
30((SPANS_COMMON((x), (w), (xx), (ww))) && (SPANS_COMMON((y), (h), (yy), (hh))))
31
32#define RECTS_CLIP_TO_RECT(_x, _y, _w, _h, _cx, _cy, _cw, _ch) \
33{ \
34 if (RECTS_INTERSECT(_x, _y, _w, _h, _cx, _cy, _cw, _ch)) \
35 { \
36 if ((int)_x < (int)(_cx)) \
37 { \
38 if ((int)_w + ((int)_x - (int)(_cx)) < 0) _w = 0; \
39 else _w += ((int)_x - (int)(_cx)); \
40 _x = (_cx); \
41 } \
42 if ((int)(_x + _w) > (int)((_cx) + (_cw))) \
43 _w = (_cx) + (_cw) - _x; \
44 if ((int)_y < (int)(_cy)) \
45 { \
46 if ((int)_h + ((int)_y - (int)(_cy)) < 0) _h = 0; \
47 else _h += ((int)_y - (int)(_cy)); \
48 _y = (_cy); \
49 } \
50 if ((int)(_y + _h) > (int)((_cy) + (_ch))) \
51 _h = (_cy) + (_ch) - _y; \
52 } \
53 else \
54 { \
55 _w = 0; _h = 0; \
56 } \
57}
58
59
60#define INTERP_VAL(out, in1, in2, in3, in4, interp_x, interp_y) \
61 { \
62 int _v, _vv; \
63 \
64 _v = (256 - (interp_x)) * (in1); \
65 if ((interp_x) > 0) _v += (interp_x) * (in2); \
66 _v *= (256 - (interp_y)); \
67 if ((interp_y) > 0) \
68 { \
69 _vv = (256 - (interp_x)) * (in3); \
70 if ((interp_x) > 0) _vv += (interp_x) * (in4); \
71 _vv *= (interp_y); \
72 (out) = ((_v + _vv) >> 16); \
73 } \
74 else (out) = (_v >> 16); \
75 }
76
77#define INTERP_2(in1, in2, interp, interp_inv) \
78 ((in1 * interp_inv) + (in2 * interp)) >> 8
79
80
81#define CONVERT_LOOP_START_ROT_0() \
82 src_ptr = src; \
83 for (y = 0; y < h; y++) \
84 { \
85 for (x = 0; x < w; x++) \
86 {
87
88#define CONVERT_LOOP_END_ROT_0() \
89 dst_ptr++; \
90 src_ptr++; \
91 } \
92 src_ptr += src_jump; \
93 dst_ptr += dst_jump; \
94 }
95
96#define CONVERT_LOOP_START_ROT_180() \
97 src_ptr = src + (w - 1) + ((h - 1) * (w + src_jump)); \
98 for (y = 0; y < h; y++) \
99 { \
100 for (x = 0; x < w; x++) \
101 {
102
103#define CONVERT_LOOP_END_ROT_180() \
104 dst_ptr++; \
105 src_ptr--; \
106 } \
107 src_ptr = src + (w - 1) + ((h - y - 2) * (w + src_jump)); \
108 dst_ptr += dst_jump; \
109 }
110
111#define CONVERT_LOOP_START_ROT_270() \
112 src_ptr = src + ((w - 1) * (h + src_jump)); \
113 for (y = 0; y < h; y++) \
114 { \
115 for (x = 0; x < w; x++) \
116 {
117
118#define CONVERT_LOOP_END_ROT_270() \
119 dst_ptr++; \
120 src_ptr -= (h + src_jump); \
121 } \
122 src_ptr = src + ((w - 1) * (h + src_jump)) + (y + 1); \
123 dst_ptr += dst_jump; \
124 }
125
126#define CONVERT_LOOP_START_ROT_90() \
127 src_ptr = src + (h - 1); \
128 for (y = 0; y < h; y++) \
129 { \
130 for (x = 0; x < w; x++) \
131 {
132
133#define CONVERT_LOOP_END_ROT_90() \
134 dst_ptr++; \
135 src_ptr += (h + src_jump); \
136 } \
137 src_ptr = src + (h - 1) - y - 1; \
138 dst_ptr += dst_jump; \
139 }
140
141#define CONVERT_LOOP2_START_ROT_0() \
142 src_ptr = src; \
143 for (y = 0; y < h; y++) \
144 { \
145 for (x = 0; x < w; x++) \
146 {
147
148#define CONVERT_LOOP2_INC_ROT_0() \
149src_ptr++; \
150x++;
151
152#define CONVERT_LOOP2_END_ROT_0() \
153 dst_ptr+=2; \
154 src_ptr++; \
155 } \
156 src_ptr += src_jump; \
157 dst_ptr += dst_jump; \
158 }
159
160#define CONVERT_LOOP2_START_ROT_180() \
161 src_ptr = src + (w - 1) + ((h - 1) * (w + src_jump)); \
162 for (y = 0; y < h; y++) \
163 { \
164 for (x = 0; x < w; x++) \
165 {
166
167#define CONVERT_LOOP2_INC_ROT_180() \
168src_ptr--; \
169x++;
170
171#define CONVERT_LOOP2_END_ROT_180() \
172 dst_ptr+=2; \
173 src_ptr--; \
174 } \
175 src_ptr = src + (w - 1) + ((h - y - 2) * (w + src_jump)); \
176 dst_ptr += dst_jump; \
177 }
178
179#define CONVERT_LOOP2_START_ROT_270() \
180 src_ptr = src + ((w - 1) * (h + src_jump)); \
181 for (y = 0; y < h; y++) \
182 { \
183 for (x = 0; x < w; x++) \
184 {
185
186#define CONVERT_LOOP2_INC_ROT_270() \
187src_ptr -= (h + src_jump); \
188x++;
189
190#define CONVERT_LOOP2_END_ROT_270() \
191 dst_ptr+=2; \
192 src_ptr -= (h + src_jump); \
193 } \
194 src_ptr = src + ((w - 1) * (h + src_jump)) + (y + 1); \
195 dst_ptr += dst_jump; \
196 }
197
198#define CONVERT_LOOP2_START_ROT_90() \
199 src_ptr = src + (h - 1); \
200 for (y = 0; y < h; y++) \
201 { \
202 for (x = 0; x < w; x++) \
203 {
204
205#define CONVERT_LOOP2_INC_ROT_90() \
206src_ptr += (h + src_jump); \
207x++;
208
209#define CONVERT_LOOP2_END_ROT_90() \
210 dst_ptr+=2; \
211 src_ptr += (h + src_jump); \
212 } \
213 src_ptr = src + (h - 1) - y - 1; \
214 dst_ptr += dst_jump; \
215 }
216
217#endif
diff --git a/libraries/evas/src/lib/include/evas_mmx.h b/libraries/evas/src/lib/include/evas_mmx.h
new file mode 100644
index 0000000..e1095e1
--- /dev/null
+++ b/libraries/evas/src/lib/include/evas_mmx.h
@@ -0,0 +1,735 @@
1/* mmx.h
2
3 MultiMedia eXtensions GCC interface library for IA32.
4
5 To use this library, simply include this header file
6 and compile with GCC. You MUST have inlining enabled
7 in order for mmx_ok() to work; this can be done by
8 simply using -O on the GCC command line.
9
10 Compiling with -DMMX_TRACE will cause detailed trace
11 output to be sent to stderr for each mmx operation.
12 This adds lots of code, and obviously slows execution to
13 a crawl, but can be very useful for debugging.
14
15 THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY
16 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
17 LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY
18 AND FITNESS FOR ANY PARTICULAR PURPOSE.
19
20 1997-98 by H. Dietz and R. Fisher
21
22 History:
23 97-98* R.Fisher Early versions
24 980501 R.Fisher Original Release
25 980611* H.Dietz Rewrite, correctly implementing inlines, and
26 R.Fisher including direct register accesses.
27 980616 R.Fisher Release of 980611 as 980616.
28 980714 R.Fisher Minor corrections to Makefile, etc.
29 980715 R.Fisher mmx_ok() now prevents optimizer from using
30 clobbered values.
31 mmx_ok() now checks if cpuid instruction is
32 available before trying to use it.
33 980726* R.Fisher mm_support() searches for AMD 3DNow, Cyrix
34 Extended MMX, and standard MMX. It returns a
35 value which is positive if any of these are
36 supported, and can be masked with constants to
37 see which. mmx_ok() is now a call to this
38 980726* R.Fisher Added i2r support for shift functions
39 980919 R.Fisher Fixed AMD extended feature recognition bug.
40 980921 R.Fisher Added definition/check for _MMX_H.
41 Added "float s[2]" to mmx_t for use with
42 3DNow and EMMX. So same mmx_t can be used.
43 981013 R.Fisher Fixed cpuid function 1 bug (looked at wrong reg)
44 Fixed psllq_i2r error in mmxtest.c
45
46 * Unreleased (internal or interim) versions
47
48 Notes:
49 It appears that the latest gas has the pand problem fixed, therefore
50 I'll undefine BROKEN_PAND by default.
51 String compares may be quicker than the multiple test/jumps in vendor
52 test sequence in mmx_ok(), but I'm not concerned with that right now.
53
54 Acknowledgments:
55 Jussi Laako for pointing out the errors ultimately found to be
56 connected to the failure to notify the optimizer of clobbered values.
57 Roger Hardiman for reminding us that CPUID isn't everywhere, and that
58 someone may actually try to use this on a machine without CPUID.
59 Also for suggesting code for checking this.
60 Robert Dale for pointing out the AMD recognition bug.
61 Jimmy Mayfield and Carl Witty for pointing out the Intel recognition
62 bug.
63 Carl Witty for pointing out the psllq_i2r test bug.
64*/
65
66#ifndef _MMX_H
67#define _MMX_H
68
69/* Warning: at this writing, the version of GAS packaged
70 with most Linux distributions does not handle the
71 parallel AND operation mnemonic correctly. If the
72 symbol BROKEN_PAND is defined, a slower alternative
73 coding will be used. If execution of mmxtest results
74 in an illegal instruction fault, define this symbol.
75*/
76#undef BROKEN_PAND
77
78
79/* The type of an value that fits in an MMX register
80 (note that long long constant values MUST be suffixed
81 by LL and unsigned long long values by ULL, lest
82 they be truncated by the compiler)
83*/
84typedef union {
85 long long q; /* Quadword (64-bit) value */
86 unsigned long long uq; /* Unsigned Quadword */
87 int d[2]; /* 2 Doubleword (32-bit) values */
88 unsigned int ud[2]; /* 2 Unsigned Doubleword */
89 short w[4]; /* 4 Word (16-bit) values */
90 unsigned short uw[4]; /* 4 Unsigned Word */
91 char b[8]; /* 8 Byte (8-bit) values */
92 unsigned char ub[8]; /* 8 Unsigned Byte */
93 float s[2]; /* Single-precision (32-bit) value */
94} __attribute__ ((aligned (8))) mmx_t;
95
96/* Helper functions for the instruction macros that follow...
97 (note that memory-to-register, m2r, instructions are nearly
98 as efficient as register-to-register, r2r, instructions;
99 however, memory-to-memory instructions are really simulated
100 as a convenience, and are only 1/3 as efficient)
101*/
102
103/* These macros are a lot simpler without the tracing...
104*/
105
106#define mmx_i2r(op, imm, reg) \
107 __asm__ __volatile__ (#op " $" #imm ", %%" #reg \
108 : /* nothing */ \
109 : /* nothing */);
110
111#define mmx_m2r(op, mem, reg) \
112 __asm__ __volatile__ (#op " %0, %%" #reg \
113 : /* nothing */ \
114 : "m" (mem))
115
116#define mmx_r2m(op, reg, mem) \
117 __asm__ __volatile__ (#op " %%" #reg ", %0" \
118 : "=m" (mem) \
119 : /* nothing */ )
120
121#define mmx_a2r(op, mem, reg) \
122 __asm__ __volatile__ (#op " %0, %%" #reg \
123 : /* nothing */ \
124 : "m" (mem))
125
126#define mmx_r2a(op, reg, mem) \
127 __asm__ __volatile__ (#op " %%" #reg ", %0" \
128 : "=m" (mem) \
129 : /* nothing */ )
130
131#define mmx_r2r(op, regs, regd) \
132 __asm__ __volatile__ (#op " %" #regs ", %" #regd)
133
134#define mmx_m2m(op, mems, memd) \
135 __asm__ __volatile__ ("movq %0, %%mm0\n\t" \
136 #op " %1, %%mm0\n\t" \
137 "movq %%mm0, %0" \
138 : "=X" (memd) \
139 : "X" (mems))
140
141/* 1x64 MOVE Quadword
142 (this is both a load and a store...
143 in fact, it is the only way to store)
144*/
145#define movq_m2r(var, reg) mmx_m2r(movq, var, reg)
146#define movq_r2m(reg, var) mmx_r2m(movq, reg, var)
147#define movq_r2r(regs, regd) mmx_r2r(movq, regs, regd)
148#define movq(vars, vard) \
149 __asm__ __volatile__ ("movq %1, %%mm0\n\t" \
150 "movq %%mm0, %0" \
151 : "=X" (vard) \
152 : "X" (vars))
153#define movntq_r2m(reg, var) mmx_r2m(movntq, reg, var)
154
155
156/* 1x32 MOVE Doubleword
157 (like movq, this is both load and store...
158 but is most useful for moving things between
159 mmx registers and ordinary registers)
160*/
161#define movd_m2r(var, reg) mmx_a2r(movd, var, reg)
162#define movd_r2m(reg, var) mmx_r2a(movd, reg, var)
163#define movd_r2r(regs, regd) mmx_r2r(movd, regs, regd)
164#define movd(vars, vard) \
165 __asm__ __volatile__ ("movd %1, %%mm0\n\t" \
166 "movd %%mm0, %0" \
167 : "=X" (vard) \
168 : "X" (vars))
169
170
171/* 2x32, 4x16, and 8x8 Parallel ADDs
172*/
173#define paddd_m2r(var, reg) mmx_m2r(paddd, var, reg)
174#define paddd_r2r(regs, regd) mmx_r2r(paddd, regs, regd)
175#define paddd(vars, vard) mmx_m2m(paddd, vars, vard)
176
177#define paddw_m2r(var, reg) mmx_m2r(paddw, var, reg)
178#define paddw_r2r(regs, regd) mmx_r2r(paddw, regs, regd)
179#define paddw(vars, vard) mmx_m2m(paddw, vars, vard)
180
181#define paddb_m2r(var, reg) mmx_m2r(paddb, var, reg)
182#define paddb_r2r(regs, regd) mmx_r2r(paddb, regs, regd)
183#define paddb(vars, vard) mmx_m2m(paddb, vars, vard)
184
185
186/* 4x16 and 8x8 Parallel ADDs using Saturation arithmetic
187*/
188#define paddsw_m2r(var, reg) mmx_m2r(paddsw, var, reg)
189#define paddsw_r2r(regs, regd) mmx_r2r(paddsw, regs, regd)
190#define paddsw(vars, vard) mmx_m2m(paddsw, vars, vard)
191
192#define paddsb_m2r(var, reg) mmx_m2r(paddsb, var, reg)
193#define paddsb_r2r(regs, regd) mmx_r2r(paddsb, regs, regd)
194#define paddsb(vars, vard) mmx_m2m(paddsb, vars, vard)
195
196
197/* 4x16 and 8x8 Parallel ADDs using Unsigned Saturation arithmetic
198*/
199#define paddusw_m2r(var, reg) mmx_m2r(paddusw, var, reg)
200#define paddusw_r2r(regs, regd) mmx_r2r(paddusw, regs, regd)
201#define paddusw(vars, vard) mmx_m2m(paddusw, vars, vard)
202
203#define paddusb_m2r(var, reg) mmx_m2r(paddusb, var, reg)
204#define paddusb_r2r(regs, regd) mmx_r2r(paddusb, regs, regd)
205#define paddusb(vars, vard) mmx_m2m(paddusb, vars, vard)
206
207
208/* 2x32, 4x16, and 8x8 Parallel SUBs
209*/
210#define psubd_m2r(var, reg) mmx_m2r(psubd, var, reg)
211#define psubd_r2r(regs, regd) mmx_r2r(psubd, regs, regd)
212#define psubd(vars, vard) mmx_m2m(psubd, vars, vard)
213
214#define psubw_m2r(var, reg) mmx_m2r(psubw, var, reg)
215#define psubw_r2r(regs, regd) mmx_r2r(psubw, regs, regd)
216#define psubw(vars, vard) mmx_m2m(psubw, vars, vard)
217
218#define psubb_m2r(var, reg) mmx_m2r(psubb, var, reg)
219#define psubb_r2r(regs, regd) mmx_r2r(psubb, regs, regd)
220#define psubb(vars, vard) mmx_m2m(psubb, vars, vard)
221
222
223/* 4x16 and 8x8 Parallel SUBs using Saturation arithmetic
224*/
225#define psubsw_m2r(var, reg) mmx_m2r(psubsw, var, reg)
226#define psubsw_r2r(regs, regd) mmx_r2r(psubsw, regs, regd)
227#define psubsw(vars, vard) mmx_m2m(psubsw, vars, vard)
228
229#define psubsb_m2r(var, reg) mmx_m2r(psubsb, var, reg)
230#define psubsb_r2r(regs, regd) mmx_r2r(psubsb, regs, regd)
231#define psubsb(vars, vard) mmx_m2m(psubsb, vars, vard)
232
233
234/* 4x16 and 8x8 Parallel SUBs using Unsigned Saturation arithmetic
235*/
236#define psubusw_m2r(var, reg) mmx_m2r(psubusw, var, reg)
237#define psubusw_r2r(regs, regd) mmx_r2r(psubusw, regs, regd)
238#define psubusw(vars, vard) mmx_m2m(psubusw, vars, vard)
239
240#define psubusb_m2r(var, reg) mmx_m2r(psubusb, var, reg)
241#define psubusb_r2r(regs, regd) mmx_r2r(psubusb, regs, regd)
242#define psubusb(vars, vard) mmx_m2m(psubusb, vars, vard)
243
244
245/* 4x16 Parallel MULs giving Low 4x16 portions of results
246*/
247#define pmullw_m2r(var, reg) mmx_m2r(pmullw, var, reg)
248#define pmullw_r2r(regs, regd) mmx_r2r(pmullw, regs, regd)
249#define pmullw(vars, vard) mmx_m2m(pmullw, vars, vard)
250
251
252/* 4x16 Parallel MULs giving High 4x16 portions of results
253*/
254#define pmulhw_m2r(var, reg) mmx_m2r(pmulhw, var, reg)
255#define pmulhw_r2r(regs, regd) mmx_r2r(pmulhw, regs, regd)
256#define pmulhw(vars, vard) mmx_m2m(pmulhw, vars, vard)
257
258
259/* 4x16->2x32 Parallel Mul-ADD
260 (muls like pmullw, then adds adjacent 16-bit fields
261 in the multiply result to make the final 2x32 result)
262*/
263#define pmaddwd_m2r(var, reg) mmx_m2r(pmaddwd, var, reg)
264#define pmaddwd_r2r(regs, regd) mmx_r2r(pmaddwd, regs, regd)
265#define pmaddwd(vars, vard) mmx_m2m(pmaddwd, vars, vard)
266
267
268/* 1x64 bitwise AND
269*/
270#ifdef BROKEN_PAND
271#define pand_m2r(var, reg) \
272 { \
273 mmx_m2r(pandn, (mmx_t) -1LL, reg); \
274 mmx_m2r(pandn, var, reg); \
275 }
276#define pand_r2r(regs, regd) \
277 { \
278 mmx_m2r(pandn, (mmx_t) -1LL, regd); \
279 mmx_r2r(pandn, regs, regd) \
280 }
281#define pand(vars, vard) \
282 { \
283 movq_m2r(vard, mm0); \
284 mmx_m2r(pandn, (mmx_t) -1LL, mm0); \
285 mmx_m2r(pandn, vars, mm0); \
286 movq_r2m(mm0, vard); \
287 }
288#else
289#define pand_m2r(var, reg) mmx_m2r(pand, var, reg)
290#define pand_r2r(regs, regd) mmx_r2r(pand, regs, regd)
291#define pand(vars, vard) mmx_m2m(pand, vars, vard)
292#endif
293
294
295/* 1x64 bitwise AND with Not the destination
296*/
297#define pandn_m2r(var, reg) mmx_m2r(pandn, var, reg)
298#define pandn_r2r(regs, regd) mmx_r2r(pandn, regs, regd)
299#define pandn(vars, vard) mmx_m2m(pandn, vars, vard)
300
301
302/* 1x64 bitwise OR
303*/
304#define por_m2r(var, reg) mmx_m2r(por, var, reg)
305#define por_r2r(regs, regd) mmx_r2r(por, regs, regd)
306#define por(vars, vard) mmx_m2m(por, vars, vard)
307
308
309/* 1x64 bitwise eXclusive OR
310*/
311#define pxor_m2r(var, reg) mmx_m2r(pxor, var, reg)
312#define pxor_r2r(regs, regd) mmx_r2r(pxor, regs, regd)
313#define pxor(vars, vard) mmx_m2m(pxor, vars, vard)
314
315
316/* 2x32, 4x16, and 8x8 Parallel CoMPare for EQuality
317 (resulting fields are either 0 or -1)
318*/
319#define pcmpeqd_m2r(var, reg) mmx_m2r(pcmpeqd, var, reg)
320#define pcmpeqd_r2r(regs, regd) mmx_r2r(pcmpeqd, regs, regd)
321#define pcmpeqd(vars, vard) mmx_m2m(pcmpeqd, vars, vard)
322
323#define pcmpeqw_m2r(var, reg) mmx_m2r(pcmpeqw, var, reg)
324#define pcmpeqw_r2r(regs, regd) mmx_r2r(pcmpeqw, regs, regd)
325#define pcmpeqw(vars, vard) mmx_m2m(pcmpeqw, vars, vard)
326
327#define pcmpeqb_m2r(var, reg) mmx_m2r(pcmpeqb, var, reg)
328#define pcmpeqb_r2r(regs, regd) mmx_r2r(pcmpeqb, regs, regd)
329#define pcmpeqb(vars, vard) mmx_m2m(pcmpeqb, vars, vard)
330
331
332/* 2x32, 4x16, and 8x8 Parallel CoMPare for Greater Than
333 (resulting fields are either 0 or -1)
334*/
335#define pcmpgtd_m2r(var, reg) mmx_m2r(pcmpgtd, var, reg)
336#define pcmpgtd_r2r(regs, regd) mmx_r2r(pcmpgtd, regs, regd)
337#define pcmpgtd(vars, vard) mmx_m2m(pcmpgtd, vars, vard)
338
339#define pcmpgtw_m2r(var, reg) mmx_m2r(pcmpgtw, var, reg)
340#define pcmpgtw_r2r(regs, regd) mmx_r2r(pcmpgtw, regs, regd)
341#define pcmpgtw(vars, vard) mmx_m2m(pcmpgtw, vars, vard)
342
343#define pcmpgtb_m2r(var, reg) mmx_m2r(pcmpgtb, var, reg)
344#define pcmpgtb_r2r(regs, regd) mmx_r2r(pcmpgtb, regs, regd)
345#define pcmpgtb(vars, vard) mmx_m2m(pcmpgtb, vars, vard)
346
347
348/* 1x64, 2x32, and 4x16 Parallel Shift Left Logical
349*/
350#define psllq_i2r(imm, reg) mmx_i2r(psllq, imm, reg)
351#define psllq_m2r(var, reg) mmx_m2r(psllq, var, reg)
352#define psllq_r2r(regs, regd) mmx_r2r(psllq, regs, regd)
353#define psllq(vars, vard) mmx_m2m(psllq, vars, vard)
354
355#define pslld_i2r(imm, reg) mmx_i2r(pslld, imm, reg)
356#define pslld_m2r(var, reg) mmx_m2r(pslld, var, reg)
357#define pslld_r2r(regs, regd) mmx_r2r(pslld, regs, regd)
358#define pslld(vars, vard) mmx_m2m(pslld, vars, vard)
359
360#define psllw_i2r(imm, reg) mmx_i2r(psllw, imm, reg)
361#define psllw_m2r(var, reg) mmx_m2r(psllw, var, reg)
362#define psllw_r2r(regs, regd) mmx_r2r(psllw, regs, regd)
363#define psllw(vars, vard) mmx_m2m(psllw, vars, vard)
364
365
366/* 1x64, 2x32, and 4x16 Parallel Shift Right Logical
367*/
368#define psrlq_i2r(imm, reg) mmx_i2r(psrlq, imm, reg)
369#define psrlq_m2r(var, reg) mmx_m2r(psrlq, var, reg)
370#define psrlq_r2r(regs, regd) mmx_r2r(psrlq, regs, regd)
371#define psrlq(vars, vard) mmx_m2m(psrlq, vars, vard)
372
373#define psrld_i2r(imm, reg) mmx_i2r(psrld, imm, reg)
374#define psrld_m2r(var, reg) mmx_m2r(psrld, var, reg)
375#define psrld_r2r(regs, regd) mmx_r2r(psrld, regs, regd)
376#define psrld(vars, vard) mmx_m2m(psrld, vars, vard)
377
378#define psrlw_i2r(imm, reg) mmx_i2r(psrlw, imm, reg)
379#define psrlw_m2r(var, reg) mmx_m2r(psrlw, var, reg)
380#define psrlw_r2r(regs, regd) mmx_r2r(psrlw, regs, regd)
381#define psrlw(vars, vard) mmx_m2m(psrlw, vars, vard)
382
383
384/* 2x32 and 4x16 Parallel Shift Right Arithmetic
385*/
386#define psrad_i2r(imm, reg) mmx_i2r(psrad, imm, reg)
387#define psrad_m2r(var, reg) mmx_m2r(psrad, var, reg)
388#define psrad_r2r(regs, regd) mmx_r2r(psrad, regs, regd)
389#define psrad(vars, vard) mmx_m2m(psrad, vars, vard)
390
391#define psraw_i2r(imm, reg) mmx_i2r(psraw, imm, reg)
392#define psraw_m2r(var, reg) mmx_m2r(psraw, var, reg)
393#define psraw_r2r(regs, regd) mmx_r2r(psraw, regs, regd)
394#define psraw(vars, vard) mmx_m2m(psraw, vars, vard)
395
396
397/* 2x32->4x16 and 4x16->8x8 PACK and Signed Saturate
398 (packs source and dest fields into dest in that order)
399*/
400#define packssdw_m2r(var, reg) mmx_m2r(packssdw, var, reg)
401#define packssdw_r2r(regs, regd) mmx_r2r(packssdw, regs, regd)
402#define packssdw(vars, vard) mmx_m2m(packssdw, vars, vard)
403
404#define packsswb_m2r(var, reg) mmx_m2r(packsswb, var, reg)
405#define packsswb_r2r(regs, regd) mmx_r2r(packsswb, regs, regd)
406#define packsswb(vars, vard) mmx_m2m(packsswb, vars, vard)
407
408
409/* 4x16->8x8 PACK and Unsigned Saturate
410 (packs source and dest fields into dest in that order)
411*/
412#define packuswb_m2r(var, reg) mmx_m2r(packuswb, var, reg)
413#define packuswb_r2r(regs, regd) mmx_r2r(packuswb, regs, regd)
414#define packuswb(vars, vard) mmx_m2m(packuswb, vars, vard)
415
416
417/* 2x32->1x64, 4x16->2x32, and 8x8->4x16 UNPaCK Low
418 (interleaves low half of dest with low half of source
419 as padding in each result field)
420*/
421#define punpckldq_m2r(var, reg) mmx_m2r(punpckldq, var, reg)
422#define punpckldq_r2r(regs, regd) mmx_r2r(punpckldq, regs, regd)
423#define punpckldq(vars, vard) mmx_m2m(punpckldq, vars, vard)
424
425#define punpcklwd_m2r(var, reg) mmx_m2r(punpcklwd, var, reg)
426#define punpcklwd_r2r(regs, regd) mmx_r2r(punpcklwd, regs, regd)
427#define punpcklwd(vars, vard) mmx_m2m(punpcklwd, vars, vard)
428
429#define punpcklbw_m2r(var, reg) mmx_m2r(punpcklbw, var, reg)
430#define punpcklbw_r2r(regs, regd) mmx_r2r(punpcklbw, regs, regd)
431#define punpcklbw(vars, vard) mmx_m2m(punpcklbw, vars, vard)
432
433
434/* 2x32->1x64, 4x16->2x32, and 8x8->4x16 UNPaCK High
435 (interleaves high half of dest with high half of source
436 as padding in each result field)
437*/
438#define punpckhdq_m2r(var, reg) mmx_m2r(punpckhdq, var, reg)
439#define punpckhdq_r2r(regs, regd) mmx_r2r(punpckhdq, regs, regd)
440#define punpckhdq(vars, vard) mmx_m2m(punpckhdq, vars, vard)
441
442#define punpckhwd_m2r(var, reg) mmx_m2r(punpckhwd, var, reg)
443#define punpckhwd_r2r(regs, regd) mmx_r2r(punpckhwd, regs, regd)
444#define punpckhwd(vars, vard) mmx_m2m(punpckhwd, vars, vard)
445
446#define punpckhbw_m2r(var, reg) mmx_m2r(punpckhbw, var, reg)
447#define punpckhbw_r2r(regs, regd) mmx_r2r(punpckhbw, regs, regd)
448#define punpckhbw(vars, vard) mmx_m2m(punpckhbw, vars, vard)
449
450#define MOVE_8DWORDS_MMX(src,dst) \
451 __asm__ ( \
452 "movq (%1), %%mm0 \n" \
453 "movq 0x8(%1), %%mm1 \n" \
454 "movq 0x10(%1), %%mm2 \n" \
455 "movq 0x18(%1), %%mm3 \n" \
456 "movq %%mm0, (%0) \n" \
457 "movq %%mm1, 0x8(%0) \n" \
458 "movq %%mm2, 0x10(%0) \n" \
459 "movq %%mm3, 0x18(%0) \n" \
460 : \
461 : "q" (dst), "r" (src) \
462 : "memory", "st");
463
464#define MOVE_10DWORDS_MMX(src,dst) \
465 __asm__ ( \
466 "movq (%1), %%mm0 \n" \
467 "movq 0x8(%1), %%mm1 \n" \
468 "movq 0x10(%1), %%mm2 \n" \
469 "movq 0x18(%1), %%mm3 \n" \
470 "movq 0x20(%1), %%mm4 \n" \
471 "movq %%mm0, (%0) \n" \
472 "movq %%mm1, 0x8(%0) \n" \
473 "movq %%mm2, 0x10(%0) \n" \
474 "movq %%mm3, 0x18(%0) \n" \
475 "movq %%mm4, 0x20(%0) \n" \
476 : \
477 : "q" (dst), "r" (src) \
478 : "memory", "st");
479
480#define MOVE_16DWORDS_MMX(src,dst) \
481 __asm__ ( \
482 "movq (%1), %%mm0 \n" \
483 "movq 0x8(%1), %%mm1 \n" \
484 "movq 0x10(%1), %%mm2 \n" \
485 "movq 0x18(%1), %%mm3 \n" \
486 "movq 0x20(%1), %%mm4 \n" \
487 "movq 0x28(%1), %%mm5 \n" \
488 "movq 0x30(%1), %%mm6 \n" \
489 "movq 0x38(%1), %%mm7 \n" \
490 "movq %%mm0, (%0) \n" \
491 "movq %%mm1, 0x8(%0) \n" \
492 "movq %%mm2, 0x10(%0) \n" \
493 "movq %%mm3, 0x18(%0) \n" \
494 "movq %%mm4, 0x20(%0) \n" \
495 "movq %%mm5, 0x28(%0) \n" \
496 "movq %%mm6, 0x30(%0) \n" \
497 "movq %%mm7, 0x38(%0) \n" \
498 : \
499 : "q" (dst), "r" (src) \
500 : "memory", "st");
501
502#define MOVE_16DWORDS_MMX2(src,dst) \
503 __asm__ ( \
504 "movq (%1), %%mm0 \n" \
505 "movq 0x8(%1), %%mm1 \n" \
506 "movq 0x10(%1), %%mm2 \n" \
507 "movq 0x18(%1), %%mm3 \n" \
508 "movq 0x20(%1), %%mm4 \n" \
509 "movq 0x28(%1), %%mm5 \n" \
510 "movq 0x30(%1), %%mm6 \n" \
511 "movq 0x38(%1), %%mm7 \n" \
512 "movntq %%mm0, (%0) \n" \
513 "movntq %%mm1, 0x8(%0) \n" \
514 "movntq %%mm2, 0x10(%0) \n" \
515 "movntq %%mm3, 0x18(%0) \n" \
516 "movntq %%mm4, 0x20(%0) \n" \
517 "movntq %%mm5, 0x28(%0) \n" \
518 "movntq %%mm6, 0x30(%0) \n" \
519 "movntq %%mm7, 0x38(%0) \n" \
520 : \
521 : "q" (dst), "r" (src) \
522 : "memory", "st");
523
524#define MOVE_32DWORDS_SSE2(src,dst) \
525 __asm__ ( \
526 "movdqu (%1), %%xmm0 \n" \
527 "movdqu 0x10(%1), %%xmm1 \n" \
528 "movdqu 0x20(%1), %%xmm2 \n" \
529 "movdqu 0x30(%1), %%xmm3 \n" \
530 "movdqu 0x40(%1), %%xmm4 \n" \
531 "movdqu 0x50(%1), %%xmm5 \n" \
532 "movdqu 0x60(%1), %%xmm6 \n" \
533 "movdqu 0x70(%1), %%xmm7 \n" \
534 "movntdq %%xmm0, (%0) \n" \
535 "movntdq %%xmm1, 0x10(%0) \n" \
536 "movntdq %%xmm2, 0x20(%0) \n" \
537 "movntdq %%xmm3, 0x30(%0) \n" \
538 "movntdq %%xmm4, 0x40(%0) \n" \
539 "movntdq %%xmm5, 0x50(%0) \n" \
540 "movntdq %%xmm6, 0x60(%0) \n" \
541 "movntdq %%xmm7, 0x70(%0) \n" \
542 : \
543 : "q" (dst), "r" (src) \
544 : "memory", "st");
545
546#define MOVE_32DWORDS_ALIGNED_SSE2(src,dst) \
547 __asm__ ( \
548 "movdqa (%1), %%xmm0 \n" \
549 "movdqa 0x10(%1), %%xmm1 \n" \
550 "movdqa 0x20(%1), %%xmm2 \n" \
551 "movdqa 0x30(%1), %%xmm3 \n" \
552 "movdqa 0x40(%1), %%xmm4 \n" \
553 "movdqa 0x50(%1), %%xmm5 \n" \
554 "movdqa 0x60(%1), %%xmm6 \n" \
555 "movdqa 0x70(%1), %%xmm7 \n" \
556 "movntdq %%xmm0, (%0) \n" \
557 "movntdq %%xmm1, 0x10(%0) \n" \
558 "movntdq %%xmm2, 0x20(%0) \n" \
559 "movntdq %%xmm3, 0x30(%0) \n" \
560 "movntdq %%xmm4, 0x40(%0) \n" \
561 "movntdq %%xmm5, 0x50(%0) \n" \
562 "movntdq %%xmm6, 0x60(%0) \n" \
563 "movntdq %%xmm7, 0x70(%0) \n" \
564 : \
565 : "q" (dst), "r" (src) \
566 : "memory", "st");
567
568/* Empty MMx State
569 (used to clean-up when going from mmx to float use
570 of the registers that are shared by both; note that
571 there is no float-to-mmx operation needed, because
572 only the float tag word info is corruptible)
573*/
574
575#define emms() __asm__ __volatile__ ("emms":::"memory")
576#define sfence() __asm__ __volatile__ ("sfence":::"memory")
577
578/* additions to detect mmx - */
579/* Raster <raster@rasterman.com> */
580
581#define CPUID_MMX (1 << 23) /* flags: mmx */
582#define CPUID_SSE (1 << 25) /* flags: xmm */
583#define CPUID_SSE2 (1 << 26) /* flags: ? */
584
585/*
586#ifdef __amd64
587#define have_cpuid(cpuid_ret) \
588 __asm__ __volatile__ ( \
589 ".align 32 \n" \
590 " pushq %%rbx \n" \
591 " pushfq \n" \
592 " popq %%rax \n" \
593 " movq %%rax, %%rbx \n" \
594 " xorq $0x200000, %%rax \n" \
595 " pushq %%rax \n" \
596 " popfq \n" \
597 " pushfq \n" \
598 " popq %%rax \n" \
599 " cmpq %%rax, %%rbx \n" \
600 " je 1f \n" \
601 " movl $1, %0 \n" \
602 " jmp 2f \n" \
603 "1: \n" \
604 " movl $0, %0 \n" \
605 "2: \n" \
606 " popq %%rbx \n" \
607 : "=m" (cpuid_ret) \
608 );
609
610#define get_cpuid(cpuid_ret) \
611 __asm__ __volatile__ ( \
612 ".align 32 \n" \
613 " pushq %%rax \n" \
614 " movl $1, %%eax \n" \
615 " cpuid \n" \
616 " test $0x00800000, %%edx\n" \
617 "1: \n" \
618 " movl %%edx, %0 \n" \
619 " jmp 2f \n" \
620 "2: \n" \
621 " movl $0, %0 \n" \
622 " popq %%rax \n" \
623 : "=m" (cpuid_ret) \
624 );
625#else
626#define have_cpuid(cpuid_ret) \
627 __asm__ __volatile__ ( \
628 ".align 32 \n" \
629 " pushl %%ebx \n" \
630 " pushfl \n" \
631 " popl %%eax \n" \
632 " movl %%eax, %%ebx \n" \
633 " xorl $0x200000, %%eax \n" \
634 " pushl %%eax \n" \
635 " popfl \n" \
636 " pushfl \n" \
637 " popl %%eax \n" \
638 " cmpl %%eax, %%ebx \n" \
639 " je 1f \n" \
640 " movl $1, %0 \n" \
641 " jmp 2f \n" \
642 "1: \n" \
643 " movl $0, %0 \n" \
644 "2: \n" \
645 " popl %%ebx \n" \
646 : "=m" (cpuid_ret) \
647 );
648
649#define get_cpuid(cpuid_ret) \
650 __asm__ __volatile__ ( \
651 ".align 32 \n" \
652 " pushl %%eax \n" \
653 " movl $1, %%eax \n" \
654 " cpuid \n" \
655 " test $0x00800000, %%edx\n" \
656 "1: \n" \
657 " movl %%edx, %0 \n" \
658 " jmp 2f \n" \
659 "2: \n" \
660 " movl $0, %0 \n" \
661 " popl %%eax \n" \
662 : "=m" (cpuid_ret) \
663 );
664#endif
665 */
666
667#define prefetch(var) \
668 __asm__ __volatile__ ( \
669 "prefetchnta (%0) \n" \
670 : \
671 : "r" (var) \
672 );
673#define prefetch0(var) \
674 __asm__ __volatile__ ( \
675 "prefetcht0 (%0) \n" \
676 : \
677 : "r" (var) \
678 );
679#define prefetch1(var) \
680 __asm__ __volatile__ ( \
681 "prefetcht1 (%0) \n" \
682 : \
683 : "r" (var) \
684 );
685#define prefetch2(var) \
686 __asm__ __volatile__ ( \
687 "prefetcht2 (%0) \n" \
688 : \
689 : "r" (var) \
690 );
691#define pshufw(r1, r2, imm) \
692 __asm__ __volatile__ ( \
693 "pshufw $" #imm ", %" #r1 ", %" #r2 " \n" \
694 );
695
696#define pshufhw(r1, r2, imm) \
697 __asm__ __volatile__ ( \
698 "pshufhw $" #imm ", %" #r1 ", %" #r2 " \n" \
699 );
700
701#define pshuflw(r1, r2, imm) \
702 __asm__ __volatile__ ( \
703 "pshuflw $" #imm ", %" #r1 ", %" #r2 " \n" \
704 );
705#define pshufd(r1, r2, imm) \
706 __asm__ __volatile__ ( \
707 "pshufd $" #imm ", %" #r1 ", %" #r2 " \n" \
708 );
709
710/* 1x238 MOVE Doouble Quadword
711 (this is both a load and a store...
712 in fact, it is the only way to store)
713*/
714#define movdqu_m2r(var, reg) mmx_m2r(movdqu, var, reg)
715#define movdqu_r2m(reg, var) mmx_r2m(movdqu, reg, var)
716#define movdqu_r2r(regs, regd) mmx_r2r(movdqu, regs, regd)
717#define movdqu(vars, vard) \
718 __asm__ __volatile__ ("movdqu %1, %%xmm0\n\t" \
719 "movdqu %%xmm0, %0" \
720 : "=X" (vard) \
721 : "X" (vars))
722#define movdqa_m2r(var, reg) mmx_m2r(movdqa, var, reg)
723#define movdqa_r2m(reg, var) mmx_r2m(movdqa, reg, var)
724#define movdqa_r2r(regs, regd) mmx_r2r(movdqa, regs, regd)
725#define movdqa(vars, vard) \
726 __asm__ __volatile__ ("movdqa %1, %%xmm0\n\t" \
727 "movdqa %%xmm0, %0" \
728 : "=X" (vard) \
729 : "X" (vars))
730#define movntdq_r2m(reg, var) mmx_r2m(movntdq, reg, var)
731
732
733/* end additions */
734
735#endif
diff --git a/libraries/evas/src/lib/include/evas_options.h b/libraries/evas/src/lib/include/evas_options.h
new file mode 100644
index 0000000..f6739c0
--- /dev/null
+++ b/libraries/evas/src/lib/include/evas_options.h
@@ -0,0 +1,69 @@
1#ifndef EVAS_OPTIONS_H
2#define EVAS_OPTIONS_H 1
3
4/* these may vary per OS */
5
6/* what to build *//* small dither table is MUCH faster on ipaq */
7/*#define BUILD_SMALL_DITHER_MASK*/
8
9/*#define HARD_CODED_P3*/
10/*#define HARD_CODED_P2*/
11
12/*#define BUILD_CONVERT_1_GRY_1*/
13/*#define BUILD_CONVERT_4_GRY_1*/
14/*#define BUILD_CONVERT_4_GRY_4*/
15/*#define BUILD_CONVERT_8_GRY_1*/
16/*#define BUILD_CONVERT_8_GRY_4*/
17/*#define BUILD_CONVERT_8_GRY_16*/
18/*#define BUILD_CONVERT_8_GRY_64*/
19/*#define BUILD_CONVERT_8_GRY_256*/
20/*#define BUILD_CONVERT_8_RGB_332*/
21/*#define BUILD_CONVERT_8_RGB_666*/
22/*#define BUILD_CONVERT_8_RGB_232*/
23/*#define BUILD_CONVERT_8_RGB_222*/
24/*#define BUILD_CONVERT_8_RGB_221*/
25/*#define BUILD_CONVERT_8_RGB_121*/
26/*#define BUILD_CONVERT_8_RGB_111*/
27/*#define BUILD_CONVERT_16_RGB_565*/
28/*#define BUILD_CONVERT_16_RGB_555*/
29/*#define BUILD_CONVERT_16_RGB_444*/
30/*#define BUILD_CONVERT_16_RGB_454645*/
31/*#define BUILD_CONVERT_16_RGB_ROT0*/
32/*#define BUILD_CONVERT_16_RGB_ROT270*/
33/*#define BUILD_CONVERT_24_RGB_888*/
34/*#define BUILD_CONVERT_24_BGR_888*/
35/*#define BUILD_CONVERT_32_RGB_8888*/
36/*#define BUILD_CONVERT_32_BGR_8888*/
37/*#define BUILD_CONVERT_32_RGB_ROT0*/
38/*#define BUILD_CONVERT_32_RGB_ROT270*/
39
40/*#define BUILD_SCALE_SAMPLE*/
41/*#define BUILD_SCALE_SMOOTH*/
42/*#define BUILD_SCALE_TRILINEAR*/
43
44/*#define BUILD_MMX*/
45/*#define BUILD_SSE*/
46/*#define BUILD_SSE3*/
47/*#define BUILD_C*/
48
49/*#define BUILD_LOADER_PNG*/
50/*#define BUILD_LOADER_JPEG*/
51/*#define BUILD_LOADER_EET*/
52/*#define BUILD_LOADER_EDB*/
53
54/*#define BUILD_FMEMOPEN*/
55
56/* check in that the user configured it right */
57#ifndef BUILD_MMX
58# ifndef BUILD_SSE3
59# ifndef BUILD_SSE
60# ifndef BUILD_C
61# error "Please Read the README"
62 #endif
63# endif
64# endif
65#endif
66
67#define DIRECT_SCALE
68
69#endif
diff --git a/libraries/evas/src/lib/include/evas_private.h b/libraries/evas/src/lib/include/evas_private.h
new file mode 100644
index 0000000..90498d0
--- /dev/null
+++ b/libraries/evas/src/lib/include/evas_private.h
@@ -0,0 +1,1107 @@
1#ifndef EVAS_PRIVATE_H
2#define EVAS_PRIVATE_H
3
4#ifdef HAVE_CONFIG_H
5# include <config.h>
6#endif
7
8#include <Eina.h>
9#include <eina_safety_checks.h>
10#include "Evas.h"
11
12#include "../file/evas_module.h"
13#include "../file/evas_path.h"
14#include "../engines/common/evas_text_utils.h"
15#include "../engines/common/language/evas_bidi_utils.h"
16#include "../engines/common/language/evas_language_utils.h"
17
18#ifdef EVAS_MAGIC_DEBUG
19/* complain when peole pass in wrong object types etc. */
20# define MAGIC_DEBUG
21#endif
22
23#define RENDER_METHOD_INVALID 0x00000000
24
25typedef struct _Evas_Layer Evas_Layer;
26typedef struct _Evas_Size Evas_Size;
27typedef struct _Evas_Aspect Evas_Aspect;
28typedef struct _Evas_Border Evas_Border;
29typedef struct _Evas_Double_Pair Evas_Double_Pair;
30typedef struct _Evas_Size_Hints Evas_Size_Hints;
31typedef struct _Evas_Font_Dir Evas_Font_Dir;
32typedef struct _Evas_Font Evas_Font;
33typedef struct _Evas_Font_Alias Evas_Font_Alias;
34typedef struct _Evas_Font_Description Evas_Font_Description;
35typedef struct _Evas_Data_Node Evas_Data_Node;
36typedef struct _Evas_Func_Node Evas_Func_Node;
37typedef RGBA_Image_Loadopts Evas_Image_Load_Opts;
38typedef struct _Evas_Func Evas_Func;
39typedef struct _Evas_Image_Load_Func Evas_Image_Load_Func;
40typedef struct _Evas_Image_Save_Func Evas_Image_Save_Func;
41typedef struct _Evas_Object_Func Evas_Object_Func;
42typedef struct _Evas_Intercept_Func Evas_Intercept_Func;
43typedef struct _Evas_Key_Grab Evas_Key_Grab;
44typedef struct _Evas_Callbacks Evas_Callbacks;
45typedef struct _Evas_Format Evas_Format;
46typedef struct _Evas_Map_Point Evas_Map_Point;
47typedef struct _Evas_Smart_Cb_Description_Array Evas_Smart_Cb_Description_Array;
48typedef struct _Evas_Post_Callback Evas_Post_Callback;
49typedef struct _Evas_Coord_Touch_Point Evas_Coord_Touch_Point;
50
51enum _Evas_Font_Style
52{
53 EVAS_FONT_STYLE_SLANT,
54 EVAS_FONT_STYLE_WEIGHT,
55 EVAS_FONT_STYLE_WIDTH
56};
57
58enum _Evas_Font_Slant
59{
60 EVAS_FONT_SLANT_NORMAL,
61 EVAS_FONT_SLANT_OBLIQUE,
62 EVAS_FONT_SLANT_ITALIC
63};
64
65enum _Evas_Font_Weight
66{
67 EVAS_FONT_WEIGHT_NORMAL,
68 EVAS_FONT_WEIGHT_THIN,
69 EVAS_FONT_WEIGHT_ULTRALIGHT,
70 EVAS_FONT_WEIGHT_LIGHT,
71 EVAS_FONT_WEIGHT_BOOK,
72 EVAS_FONT_WEIGHT_MEDIUM,
73 EVAS_FONT_WEIGHT_SEMIBOLD,
74 EVAS_FONT_WEIGHT_BOLD,
75 EVAS_FONT_WEIGHT_ULTRABOLD,
76 EVAS_FONT_WEIGHT_BLACK,
77 EVAS_FONT_WEIGHT_EXTRABLACK
78};
79
80enum _Evas_Font_Width
81{
82 EVAS_FONT_WIDTH_NORMAL,
83 EVAS_FONT_WIDTH_ULTRACONDENSED,
84 EVAS_FONT_WIDTH_EXTRACONDENSED,
85 EVAS_FONT_WIDTH_CONDENSED,
86 EVAS_FONT_WIDTH_SEMICONDENSED,
87 EVAS_FONT_WIDTH_SEMIEXPANDED,
88 EVAS_FONT_WIDTH_EXPANDED,
89 EVAS_FONT_WIDTH_EXTRAEXPANDED,
90 EVAS_FONT_WIDTH_ULTRAEXPANDED
91};
92
93typedef enum _Evas_Font_Style Evas_Font_Style;
94typedef enum _Evas_Font_Slant Evas_Font_Slant;
95typedef enum _Evas_Font_Weight Evas_Font_Weight;
96typedef enum _Evas_Font_Width Evas_Font_Width;
97
98/* General types - used for script type chceking */
99#define OPAQUE_TYPE(type) struct __##type { int a; }; \
100 typedef struct __##type type
101
102OPAQUE_TYPE(Evas_Font_Set); /* General type for RGBA_Font */
103OPAQUE_TYPE(Evas_Font_Instance); /* General type for RGBA_Font_Int */
104/* End of general types */
105
106#define MAGIC_EVAS 0x70777770
107#define MAGIC_OBJ 0x71777770
108#define MAGIC_OBJ_RECTANGLE 0x71777771
109#define MAGIC_OBJ_LINE 0x71777772
110#define MAGIC_OBJ_POLYGON 0x71777774
111#define MAGIC_OBJ_IMAGE 0x71777775
112#define MAGIC_OBJ_TEXT 0x71777776
113#define MAGIC_OBJ_SMART 0x71777777
114#define MAGIC_OBJ_TEXTBLOCK 0x71777778
115#define MAGIC_SMART 0x72777770
116#define MAGIC_OBJ_SHAPE 0x72777773
117#define MAGIC_OBJ_CONTAINER 0x72777774
118#define MAGIC_OBJ_CUSTOM 0x72777775
119#define MAGIC_EVAS_GL 0x72777776
120#define MAGIC_MAP 0x72777777
121
122#ifdef MAGIC_DEBUG
123# define MAGIC_CHECK_FAILED(o, t, m) \
124{evas_debug_error(); \
125 if (!o) evas_debug_input_null(); \
126 else if (((t *)o)->magic == 0) evas_debug_magic_null(); \
127 else evas_debug_magic_wrong((m), ((t *)o)->magic); \
128}
129# define MAGIC_CHECK(o, t, m) \
130{if ((!o) || (!(((t *)o)->magic == (m)))) { \
131MAGIC_CHECK_FAILED(o, t, m)
132# define MAGIC_CHECK_END() }}
133#else
134# define MAGIC_CHECK_FAILED(o, t, m)
135# define MAGIC_CHECK(o, t, m) { if (!o) {
136# define MAGIC_CHECK_END() }}
137#endif
138
139#define NEW_RECT(_r, _x, _y, _w, _h) (_r) = eina_rectangle_new(_x, _y, _w, _h);
140
141#define MERR_NONE() _evas_alloc_error = EVAS_ALLOC_ERROR_NONE
142#define MERR_FATAL() _evas_alloc_error = EVAS_ALLOC_ERROR_FATAL
143#define MERR_BAD() _evas_alloc_error = EVAS_ALLOC_ERROR_RECOVERED
144
145#define EVAS_OBJECT_IMAGE_FREE_FILE_AND_KEY(o) \
146 if ((o)->cur.file) \
147 { \
148 eina_stringshare_del((o)->cur.file); \
149 if ((o)->prev.file == (o)->cur.file) \
150 (o)->prev.file = NULL; \
151 (o)->cur.file = NULL; \
152 } \
153 if ((o)->cur.key) \
154 { \
155 eina_stringshare_del((o)->cur.key); \
156 if ((o)->prev.key == (o)->cur.key) \
157 (o)->prev.key = NULL; \
158 (o)->cur.key = NULL; \
159 } \
160 if ((o)->prev.file) \
161 { \
162 eina_stringshare_del((o)->prev.file); \
163 (o)->prev.file = NULL; \
164 } \
165 if ((o)->prev.key) \
166 { \
167 eina_stringshare_del((o)->prev.key); \
168 (o)->prev.key = NULL; \
169 }
170
171struct _Evas_Coord_Touch_Point
172{
173 Evas_Coord x, y; // point's x, y position
174 int id; // id in order to distinguish each point
175 Evas_Touch_Point_State state;
176};
177
178struct _Evas_Key_Grab
179{
180 char *keyname;
181 Evas_Modifier_Mask modifiers;
182 Evas_Modifier_Mask not_modifiers;
183 Evas_Object *object;
184 Eina_Bool exclusive : 1;
185 Eina_Bool just_added : 1;
186 Eina_Bool delete_me : 1;
187};
188
189struct _Evas_Intercept_Func
190{
191 struct {
192 Evas_Object_Intercept_Show_Cb func;
193 void *data;
194 } show;
195 struct {
196 Evas_Object_Intercept_Hide_Cb func;
197 void *data;
198 } hide;
199 struct {
200 Evas_Object_Intercept_Move_Cb func;
201 void *data;
202 } move;
203 struct {
204 Evas_Object_Intercept_Resize_Cb func;
205 void *data;
206 } resize;
207 struct {
208 Evas_Object_Intercept_Raise_Cb func;
209 void *data;
210 } raise;
211 struct {
212 Evas_Object_Intercept_Lower_Cb func;
213 void *data;
214 } lower;
215 struct {
216 Evas_Object_Intercept_Stack_Above_Cb func;
217 void *data;
218 } stack_above;
219 struct {
220 Evas_Object_Intercept_Stack_Below_Cb func;
221 void *data;
222 } stack_below;
223 struct {
224 Evas_Object_Intercept_Layer_Set_Cb func;
225 void *data;
226 } layer_set;
227 struct {
228 Evas_Object_Intercept_Color_Set_Cb func;
229 void *data;
230 } color_set;
231 struct {
232 Evas_Object_Intercept_Clip_Set_Cb func;
233 void *data;
234 } clip_set;
235 struct {
236 Evas_Object_Intercept_Clip_Unset_Cb func;
237 void *data;
238 } clip_unset;
239};
240
241struct _Evas_Smart_Cb_Description_Array
242{
243 unsigned int size;
244 const Evas_Smart_Cb_Description **array;
245};
246
247struct _Evas_Smart
248{
249 DATA32 magic;
250
251 int usage;
252
253 const Evas_Smart_Class *smart_class;
254
255 Evas_Smart_Cb_Description_Array callbacks;
256
257 unsigned char delete_me : 1;
258 unsigned char class_allocated : 1;
259
260};
261
262struct _Evas_Modifier
263{
264 struct {
265 int count;
266 char **list;
267 } mod;
268 Evas_Modifier_Mask mask; /* ok we have a max of 64 modifiers */
269};
270
271struct _Evas_Lock
272{
273 struct {
274 int count;
275 char **list;
276 } lock;
277 Evas_Modifier_Mask mask; /* we have a max of 64 locks */
278};
279
280struct _Evas_Post_Callback
281{
282 Evas_Object *obj;
283 Evas_Object_Event_Post_Cb func;
284 const void *data;
285 unsigned char delete_me : 1;
286};
287
288struct _Evas_Callbacks
289{
290 Eina_Inlist *callbacks;
291 int walking_list;
292 unsigned char deletions_waiting : 1;
293};
294
295struct _Evas
296{
297 EINA_INLIST;
298
299 DATA32 magic;
300
301 struct {
302 unsigned char inside : 1;
303 int mouse_grabbed;
304 DATA32 button;
305 Evas_Coord x, y;
306 struct {
307 Eina_List *in;
308 } object;
309
310 } pointer;
311
312 struct {
313 Evas_Coord x, y, w, h;
314 unsigned char changed : 1;
315 } viewport;
316
317 struct {
318 int w, h;
319 DATA32 render_method;
320 unsigned char changed : 1;
321 } output;
322
323 Eina_List *damages;
324 Eina_List *obscures;
325
326 Evas_Layer *layers;
327
328 Eina_Hash *name_hash;
329
330 int output_validity;
331
332 int walking_list;
333 int events_frozen;
334
335 struct {
336 Evas_Module *module;
337 Evas_Func *func;
338 struct {
339 void *output;
340
341 void *context;
342 } data;
343
344 void *info;
345 int info_magic;
346 } engine;
347
348 Eina_Array delete_objects;
349 Eina_Array active_objects;
350 Eina_Array restack_objects;
351 Eina_Array render_objects;
352 Eina_Array pending_objects;
353 Eina_Array obscuring_objects;
354 Eina_Array temporary_objects;
355 Eina_Array calculate_objects;
356 Eina_Array clip_changes;
357
358 Eina_Clist calc_list;
359 Eina_Clist calc_done;
360 Eina_List *video_objects;
361
362 Eina_List *post_events; // free me on evas_free
363
364 Evas_Callbacks *callbacks;
365
366 int delete_grabs;
367 int walking_grabs;
368 Eina_List *grabs;
369
370 Eina_List *font_path;
371
372 int in_smart_calc;
373 int smart_calc_count;
374
375 Evas_Object *focused;
376 void *attach_data;
377 Evas_Modifier modifiers;
378 Evas_Lock locks;
379 unsigned int last_timestamp;
380 int last_mouse_down_counter;
381 int last_mouse_up_counter;
382 int nochange;
383 Evas_Font_Hinting_Flags hinting;
384 unsigned char changed : 1;
385 unsigned char delete_me : 1;
386 unsigned char invalidate : 1;
387 unsigned char cleanup : 1;
388 unsigned char focus : 1;
389
390 Eina_List *touch_points;
391};
392
393struct _Evas_Layer
394{
395 EINA_INLIST;
396
397 short layer;
398 Evas_Object *objects;
399
400 Evas *evas;
401
402 void *engine_data;
403 int usage;
404 unsigned char delete_me : 1;
405};
406
407struct _Evas_Size
408{
409 Evas_Coord w, h;
410};
411
412struct _Evas_Aspect
413{
414 Evas_Aspect_Control mode;
415 Evas_Size size;
416};
417
418struct _Evas_Border
419{
420 Evas_Coord l, r, t, b;
421};
422
423struct _Evas_Double_Pair
424{
425 double x, y;
426};
427
428struct _Evas_Size_Hints
429{
430 Evas_Size min, max, request;
431 Evas_Aspect aspect;
432 Evas_Double_Pair align, weight;
433 Evas_Border padding;
434};
435
436struct _Evas_Map_Point
437{
438 double x, y, z, px, py;
439 double u, v;
440 unsigned char r, g, b, a;
441};
442
443struct _Evas_Map
444{
445 DATA32 magic;
446 int count; // num of points
447 Evas_Coord_Rectangle normal_geometry; // bounding box of map geom actually
448 void *surface; // surface holding map if needed
449 int surface_w, surface_h; // current surface w & h alloc
450 Evas_Coord mx, my; // mouse x, y after conversion to map space
451 struct {
452 Evas_Coord px, py, z0, foc;
453 } persp;
454 Eina_Bool alpha : 1;
455 Eina_Bool smooth : 1;
456 Evas_Map_Point points[]; // actual points
457};
458
459#if 0 // filtering disabled
460/* nash: Split into two bits */
461typedef struct Evas_Filter_Info
462{
463 Evas_Filter filter;
464 Evas_Filter_Mode mode;
465
466 Eina_Bool dirty : 1;
467
468 int datalen;
469 void *data;
470 void (*data_free)(void *);
471
472 uint8_t *key;
473 uint32_t len;
474 Filtered_Image *cached;
475} Evas_Filter_Info;
476
477typedef Eina_Bool (*Evas_Software_Filter_Fn)(Evas_Filter_Info *, RGBA_Image *, RGBA_Image *);
478
479int evas_filter_get_size(Evas_Filter_Info *info, int inw, int inh,
480 int *outw, int *outh, Eina_Bool inv);
481Eina_Bool evas_filter_always_alpha(Evas_Filter_Info *info);
482uint8_t *evas_filter_key_get(const Evas_Filter_Info *info, uint32_t *lenp);
483// expose for use in engines
484EAPI Evas_Software_Filter_Fn evas_filter_software_get(Evas_Filter_Info *info);
485void evas_filter_free(Evas_Object *o);
486#endif
487
488struct _Evas_Object
489{
490 EINA_INLIST;
491
492 DATA32 magic;
493
494 const char *type;
495 Evas_Layer *layer;
496
497 struct {
498 Evas_Map *map;
499 Evas_Object *clipper;
500 Evas_Object *mask;
501 Evas_Object *map_parent;
502 double scale;
503 Evas_Coord_Rectangle geometry;
504 struct {
505 struct {
506 Evas_Coord x, y, w, h;
507 unsigned char r, g, b, a;
508 Eina_Bool visible : 1;
509 Eina_Bool dirty : 1;
510 } clip;
511 } cache;
512 short layer;
513 struct {
514 unsigned char r, g, b, a;
515 } color;
516 Eina_Bool usemap : 1;
517 Eina_Bool visible : 1;
518 Eina_Bool have_clipees : 1;
519 Eina_Bool anti_alias : 1;
520 Evas_Render_Op render_op : 4;
521 } cur, prev;
522
523 char *name;
524
525 Evas_Intercept_Func *interceptors;
526
527 struct {
528 Eina_List *elements;
529 } data;
530
531 Eina_List *grabs;
532
533 Evas_Callbacks *callbacks;
534
535 struct {
536 Eina_List *clipees;
537 Eina_List *changes;
538 } clip;
539
540 const Evas_Object_Func *func;
541
542 void *object_data;
543
544 struct {
545 Evas_Smart *smart;
546 Evas_Object *parent;
547 } smart;
548
549 struct {
550 Eina_List *proxies;
551 void *surface;
552 int w,h;
553 Eina_Bool redraw;
554 } proxy;
555
556#if 0 // filtering disabled
557 Evas_Filter_Info *filter;
558#endif
559
560 Evas_Size_Hints *size_hints;
561
562 int last_mouse_down_counter;
563 int last_mouse_up_counter;
564 int mouse_grabbed;
565
566 int last_event;
567 Evas_Callback_Type last_event_type;
568
569 struct {
570 int in_move, in_resize;
571 } doing;
572
573 unsigned int ref;
574
575 unsigned char delete_me;
576
577 unsigned char recalculate_cycle;
578 Eina_Clist calc_entry;
579
580 Evas_Object_Pointer_Mode pointer_mode : 1;
581
582 Eina_Bool store : 1;
583 Eina_Bool pass_events : 1;
584 Eina_Bool freeze_events : 1;
585 Eina_Bool repeat_events : 1;
586 struct {
587 Eina_Bool pass_events : 1;
588 Eina_Bool pass_events_valid : 1;
589 Eina_Bool freeze_events : 1;
590 Eina_Bool freeze_events_valid : 1;
591 } parent_cache;
592 Eina_Bool restack : 1;
593 Eina_Bool is_active : 1;
594 Eina_Bool precise_is_inside : 1;
595 Eina_Bool is_static_clip : 1;
596
597 Eina_Bool render_pre : 1;
598 Eina_Bool rect_del : 1;
599 Eina_Bool mouse_in : 1;
600 Eina_Bool pre_render_done : 1;
601 Eina_Bool intercepted : 1;
602 Eina_Bool focused : 1;
603 Eina_Bool in_layer : 1;
604 Eina_Bool no_propagate : 1;
605
606 Eina_Bool changed : 1;
607 Eina_Bool changed_move : 1;
608 Eina_Bool changed_move_only : 1;
609 Eina_Bool changed_nomove : 1;
610 Eina_Bool del_ref : 1;
611};
612
613struct _Evas_Func_Node
614{
615 EINA_INLIST;
616 void (*func) ();
617 void *data;
618 Evas_Callback_Type type;
619 Evas_Callback_Priority priority;
620 unsigned char delete_me : 1;
621};
622
623struct _Evas_Data_Node
624{
625 char *key;
626 void *data;
627};
628
629struct _Evas_Font_Dir
630{
631 Eina_Hash *lookup;
632 Eina_List *fonts;
633 Eina_List *aliases;
634 DATA64 dir_mod_time;
635 DATA64 fonts_dir_mod_time;
636 DATA64 fonts_alias_mod_time;
637};
638
639struct _Evas_Font
640{
641 struct {
642 const char *prop[14];
643 } x;
644 struct {
645 const char *name;
646 } simple;
647 const char *path;
648 char type;
649};
650
651struct _Evas_Font_Alias
652{
653 const char *alias;
654 Evas_Font *fn;
655};
656
657struct _Evas_Font_Description
658{
659 int ref;
660 /* We assume everywhere this is stringshared */
661 const char *name;
662 const char *fallbacks;
663 const char *lang;
664
665 Evas_Font_Slant slant;
666 Evas_Font_Weight weight;
667 Evas_Font_Width width;
668
669 Eina_Bool is_new : 1;
670};
671
672struct _Evas_Object_Func
673{
674 void (*free) (Evas_Object *obj);
675 void (*render) (Evas_Object *obj, void *output, void *context, void *surface, int x, int y);
676 void (*render_pre) (Evas_Object *obj);
677 void (*render_post) (Evas_Object *obj);
678
679 unsigned int (*type_id_get) (Evas_Object *obj);
680 unsigned int (*visual_id_get) (Evas_Object *obj);
681 void *(*engine_data_get) (Evas_Object *obj);
682
683 void (*store) (Evas_Object *obj);
684 void (*unstore) (Evas_Object *obj);
685
686 int (*is_visible) (Evas_Object *obj);
687 int (*was_visible) (Evas_Object *obj);
688
689 int (*is_opaque) (Evas_Object *obj);
690 int (*was_opaque) (Evas_Object *obj);
691
692 int (*is_inside) (Evas_Object *obj, Evas_Coord x, Evas_Coord y);
693 int (*was_inside) (Evas_Object *obj, Evas_Coord x, Evas_Coord y);
694
695 void (*coords_recalc) (Evas_Object *obj);
696
697 void (*scale_update) (Evas_Object *obj);
698
699 int (*has_opaque_rect) (Evas_Object *obj);
700 int (*get_opaque_rect) (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h);
701
702 int (*can_map) (Evas_Object *obj);
703};
704
705struct _Evas_Func
706{
707 void *(*info) (Evas *e);
708 void (*info_free) (Evas *e, void *info);
709 int (*setup) (Evas *e, void *info);
710
711 void (*output_free) (void *data);
712 void (*output_resize) (void *data, int w, int h);
713 void (*output_tile_size_set) (void *data, int w, int h);
714 void (*output_redraws_rect_add) (void *data, int x, int y, int w, int h);
715 void (*output_redraws_rect_del) (void *data, int x, int y, int w, int h);
716 void (*output_redraws_clear) (void *data);
717 void *(*output_redraws_next_update_get) (void *data, int *x, int *y, int *w, int *h, int *cx, int *cy, int *cw, int *ch);
718 void (*output_redraws_next_update_push) (void *data, void *surface, int x, int y, int w, int h);
719 void (*output_flush) (void *data);
720 void (*output_idle_flush) (void *data);
721 void (*output_dump) (void *data);
722
723 void *(*context_new) (void *data);
724 Eina_Bool (*canvas_alpha_get) (void *data, void *context);
725 void (*context_free) (void *data, void *context);
726 void (*context_clip_set) (void *data, void *context, int x, int y, int w, int h);
727 void (*context_clip_clip) (void *data, void *context, int x, int y, int w, int h);
728 void (*context_clip_unset) (void *data, void *context);
729 int (*context_clip_get) (void *data, void *context, int *x, int *y, int *w, int *h);
730 void (*context_mask_set) (void *data, void *context, void *mask, int x, int y, int w, int h);
731 void (*context_mask_unset) (void *data, void *context);
732 void (*context_color_set) (void *data, void *context, int r, int g, int b, int a);
733 int (*context_color_get) (void *data, void *context, int *r, int *g, int *b, int *a);
734 void (*context_multiplier_set) (void *data, void *context, int r, int g, int b, int a);
735 void (*context_multiplier_unset) (void *data, void *context);
736 int (*context_multiplier_get) (void *data, void *context, int *r, int *g, int *b, int *a);
737 void (*context_cutout_add) (void *data, void *context, int x, int y, int w, int h);
738 void (*context_cutout_clear) (void *data, void *context);
739 void (*context_anti_alias_set) (void *data, void *context, unsigned char aa);
740 unsigned char (*context_anti_alias_get) (void *data, void *context);
741 void (*context_color_interpolation_set) (void *data, void *context, int color_space);
742 int (*context_color_interpolation_get) (void *data, void *context);
743 void (*context_render_op_set) (void *data, void *context, int render_op);
744 int (*context_render_op_get) (void *data, void *context);
745
746 void (*rectangle_draw) (void *data, void *context, void *surface, int x, int y, int w, int h);
747
748 void (*line_draw) (void *data, void *context, void *surface, int x1, int y1, int x2, int y2);
749
750 void *(*polygon_point_add) (void *data, void *context, void *polygon, int x, int y);
751 void *(*polygon_points_clear) (void *data, void *context, void *polygon);
752 void (*polygon_draw) (void *data, void *context, void *surface, void *polygon, int x, int y);
753
754 void *(*image_load) (void *data, const char *file, const char *key, int *error, Evas_Image_Load_Opts *lo);
755 void *(*image_new_from_data) (void *data, int w, int h, DATA32 *image_data, int alpha, int cspace);
756 void *(*image_new_from_copied_data) (void *data, int w, int h, DATA32 *image_data, int alpha, int cspace);
757 void (*image_free) (void *data, void *image);
758 void (*image_size_get) (void *data, void *image, int *w, int *h);
759 void *(*image_size_set) (void *data, void *image, int w, int h);
760 void (*image_stride_get) (void *data, void *image, int *stride);
761 void *(*image_dirty_region) (void *data, void *image, int x, int y, int w, int h);
762 void *(*image_data_get) (void *data, void *image, int to_write, DATA32 **image_data, int *err);
763 void *(*image_data_put) (void *data, void *image, DATA32 *image_data);
764 void (*image_data_preload_request) (void *data, void *image, const void *target);
765 void (*image_data_preload_cancel) (void *data, void *image, const void *target);
766 void *(*image_alpha_set) (void *data, void *image, int has_alpha);
767 int (*image_alpha_get) (void *data, void *image);
768 void *(*image_border_set) (void *data, void *image, int l, int r, int t, int b);
769 void (*image_border_get) (void *data, void *image, int *l, int *r, int *t, int *b);
770 void (*image_draw) (void *data, void *context, void *surface, void *image, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int dst_h, int smooth);
771 char *(*image_comment_get) (void *data, void *image, char *key);
772 char *(*image_format_get) (void *data, void *image);
773 void (*image_colorspace_set) (void *data, void *image, int cspace);
774 int (*image_colorspace_get) (void *data, void *image);
775 void (*image_mask_create) (void *data, void *image);
776 void *(*image_native_set) (void *data, void *image, void *native);
777 void *(*image_native_get) (void *data, void *image);
778
779 void (*image_cache_flush) (void *data);
780 void (*image_cache_set) (void *data, int bytes);
781 int (*image_cache_get) (void *data);
782
783 Evas_Font_Set *(*font_load) (void *data, const char *name, int size, Font_Rend_Flags wanted_rend);
784 Evas_Font_Set *(*font_memory_load) (void *data, char *name, int size, const void *fdata, int fdata_size, Font_Rend_Flags wanted_rend);
785 Evas_Font_Set *(*font_add) (void *data, Evas_Font_Set *font, const char *name, int size, Font_Rend_Flags wanted_rend);
786 Evas_Font_Set *(*font_memory_add) (void *data, Evas_Font_Set *font, char *name, int size, const void *fdata, int fdata_size, Font_Rend_Flags wanted_rend);
787 void (*font_free) (void *data, Evas_Font_Set *font);
788 int (*font_ascent_get) (void *data, Evas_Font_Set *font);
789 int (*font_descent_get) (void *data, Evas_Font_Set *font);
790 int (*font_max_ascent_get) (void *data, Evas_Font_Set *font);
791 int (*font_max_descent_get) (void *data, Evas_Font_Set *font);
792 void (*font_string_size_get) (void *data, Evas_Font_Set *font, const Evas_Text_Props *intl_props, int *w, int *h);
793 int (*font_inset_get) (void *data, Evas_Font_Set *font, const Evas_Text_Props *text_props);
794 int (*font_h_advance_get) (void *data, Evas_Font_Set *font, const Evas_Text_Props *intl_props);
795 int (*font_v_advance_get) (void *data, Evas_Font_Set *font, const Evas_Text_Props *intl_props);
796 int (*font_char_coords_get) (void *data, Evas_Font_Set *font, const Evas_Text_Props *intl_props, int pos, int *cx, int *cy, int *cw, int *ch);
797 int (*font_char_at_coords_get) (void *data, Evas_Font_Set *font, const Evas_Text_Props *intl_props, int x, int y, int *cx, int *cy, int *cw, int *ch);
798 void (*font_draw) (void *data, void *context, void *surface, Evas_Font_Set *font, int x, int y, int w, int h, int ow, int oh, const Evas_Text_Props *intl_props);
799
800 void (*font_cache_flush) (void *data);
801 void (*font_cache_set) (void *data, int bytes);
802 int (*font_cache_get) (void *data);
803
804 /* Engine functions will over time expand from here */
805
806 void (*font_hinting_set) (void *data, Evas_Font_Set *font, int hinting);
807 int (*font_hinting_can_hint) (void *data, int hinting);
808
809/* void (*image_rotation_set) (void *data, void *image); */
810
811 void (*image_scale_hint_set) (void *data, void *image, int hint);
812 int (*image_scale_hint_get) (void *data, void *image);
813 int (*font_last_up_to_pos) (void *data, Evas_Font_Set *font, const Evas_Text_Props *intl_props, int x, int y);
814
815 void (*image_map_draw) (void *data, void *context, void *surface, void *image, int npoints, RGBA_Map_Point *p, int smooth, int level);
816 void *(*image_map_surface_new) (void *data, int w, int h, int alpha);
817 void (*image_map_surface_free) (void *data, void *surface);
818
819 void (*image_content_hint_set) (void *data, void *surface, int hint);
820 int (*image_content_hint_get) (void *data, void *surface);
821 int (*font_pen_coords_get) (void *data, Evas_Font_Set *font, const Evas_Text_Props *intl_props, int pos, int *cpen_x, int *cy, int *cadv, int *ch);
822 Eina_Bool (*font_text_props_info_create) (void *data __UNUSED__, Evas_Font_Instance *fi, const Eina_Unicode *text, Evas_Text_Props *intl_props, const Evas_BiDi_Paragraph_Props *par_props, size_t pos, size_t len);
823 int (*font_right_inset_get) (void *data, Evas_Font_Set *font, const Evas_Text_Props *text_props);
824
825#if 0 // filtering disabled
826 void (*image_draw_filtered) (void *data, void *context, void *surface, void *image, Evas_Filter_Info *filter);
827 Filtered_Image *(*image_filtered_get) (void *image, uint8_t *key, size_t len);
828 Filtered_Image *(*image_filtered_save) (void *image, void *filtered, uint8_t *key, size_t len);
829 void (*image_filtered_free) (void *image, Filtered_Image *);
830#endif
831
832 /* EFL-GL Glue Layer */
833 void *(*gl_surface_create) (void *data, void *config, int w, int h);
834 int (*gl_surface_destroy) (void *data, void *surface);
835 void *(*gl_context_create) (void *data, void *share_context);
836 int (*gl_context_destroy) (void *data, void *context);
837 int (*gl_make_current) (void *data, void *surface, void *context);
838 void *(*gl_string_query) (void *data, int name);
839 void *(*gl_proc_address_get) (void *data, const char *name);
840 int (*gl_native_surface_get) (void *data, void *surface, void *native_surface);
841 void *(*gl_api_get) (void *data);
842
843 int (*image_load_error_get) (void *data, void *image);
844 int (*font_run_end_get) (void *data, Evas_Font_Set *font, Evas_Font_Instance **script_fi, Evas_Font_Instance **cur_fi, Evas_Script_Type script, const Eina_Unicode *text, int run_len);
845
846 /* animated feature */
847 Eina_Bool (*image_animated_get) (void *data, void *image);
848 int (*image_animated_frame_count_get) (void *data, void *image);
849 Evas_Image_Animated_Loop_Hint (*image_animated_loop_type_get) (void *data, void *image);
850 int (*image_animated_loop_count_get) (void *data, void *image);
851 double (*image_animated_frame_duration_get) (void *data, void *image, int start_frame, int frame_num);
852 Eina_Bool (*image_animated_frame_set) (void *data, void *image, int frame_index);
853
854 /* max size query */
855 void (*image_max_size_get) (void *data, int *maxw, int *maxh);
856};
857
858struct _Evas_Image_Load_Func
859{
860 Eina_Bool threadable;
861 Eina_Bool (*file_head) (Image_Entry *ie, const char *file, const char *key, int *error);
862 Eina_Bool (*file_data) (Image_Entry *ie, const char *file, const char *key, int *error);
863 double (*frame_duration) (Image_Entry *ie, const char *file, const int start, const int frame_num);
864};
865
866struct _Evas_Image_Save_Func
867{
868 int (*image_save) (RGBA_Image *im, const char *file, const char *key, int quality, int compress);
869};
870
871#ifdef __cplusplus
872extern "C" {
873#endif
874
875Evas_Object *evas_object_new(Evas *e);
876void evas_object_free(Evas_Object *obj, int clean_layer);
877void evas_object_inject(Evas_Object *obj, Evas *e);
878void evas_object_release(Evas_Object *obj, int clean_layer);
879void evas_object_change(Evas_Object *obj);
880void evas_object_clip_changes_clean(Evas_Object *obj);
881void evas_object_render_pre_visible_change(Eina_Array *rects, Evas_Object *obj, int is_v, int was_v);
882void evas_object_render_pre_clipper_change(Eina_Array *rects, Evas_Object *obj);
883void evas_object_render_pre_prev_cur_add(Eina_Array *rects, Evas_Object *obj);
884void evas_object_render_pre_effect_updates(Eina_Array *rects, Evas_Object *obj, int is_v, int was_v);
885void evas_rects_return_difference_rects(Eina_Array *rects, int x, int y, int w, int h, int xx, int yy, int ww, int hh);
886
887void evas_object_clip_dirty(Evas_Object *obj);
888void evas_object_recalc_clippees(Evas_Object *obj);
889Evas_Layer *evas_layer_new(Evas *e);
890void evas_layer_pre_free(Evas_Layer *lay);
891void evas_layer_free_objects(Evas_Layer *lay);
892void evas_layer_clean(Evas *e);
893Evas_Layer *evas_layer_find(Evas *e, short layer_num);
894void evas_layer_add(Evas_Layer *lay);
895void evas_layer_del(Evas_Layer *lay);
896
897int evas_object_was_in_output_rect(Evas_Object *obj, int x, int y, int w, int h);
898
899int evas_object_was_opaque(Evas_Object *obj);
900int evas_object_is_inside(Evas_Object *obj, Evas_Coord x, Evas_Coord y);
901int evas_object_was_inside(Evas_Object *obj, Evas_Coord x, Evas_Coord y);
902int evas_object_clippers_was_visible(Evas_Object *obj);
903void evas_object_clip_across_check(Evas_Object *obj);
904void evas_object_clip_across_clippees_check(Evas_Object *obj);
905void evas_object_mapped_clip_across_mark(Evas_Object *obj);
906void evas_event_callback_call(Evas *e, Evas_Callback_Type type, void *event_info);
907void evas_object_event_callback_call(Evas_Object *obj, Evas_Callback_Type type, void *event_info);
908Eina_List *evas_event_objects_event_list(Evas *e, Evas_Object *stop, int x, int y);
909int evas_mem_free(int mem_required);
910int evas_mem_degrade(int mem_required);
911void evas_debug_error(void);
912void evas_debug_input_null(void);
913void evas_debug_magic_null(void);
914void evas_debug_magic_wrong(DATA32 expected, DATA32 supplied);
915void evas_debug_generic(const char *str);
916const char *evas_debug_magic_string_get(DATA32 magic);
917void evas_object_smart_use(Evas_Smart *s);
918void evas_object_smart_unuse(Evas_Smart *s);
919void evas_smart_cb_descriptions_fix(Evas_Smart_Cb_Description_Array *a) EINA_ARG_NONNULL(1);
920Eina_Bool evas_smart_cb_descriptions_resize(Evas_Smart_Cb_Description_Array *a, unsigned int size) EINA_ARG_NONNULL(1);
921const Evas_Smart_Cb_Description *evas_smart_cb_description_find(const Evas_Smart_Cb_Description_Array *a, const char *name) EINA_ARG_NONNULL(1, 2) EINA_PURE;
922
923Eina_Bool _evas_object_image_preloading_get(const Evas_Object *obj);
924void _evas_object_image_preloading_set(Evas_Object *obj, Eina_Bool preloading);
925void _evas_object_image_preloading_check(Evas_Object *obj);
926Evas_Object *_evas_object_image_video_parent_get(Evas_Object *obj);
927void _evas_object_image_video_overlay_show(Evas_Object *obj);
928void _evas_object_image_video_overlay_hide(Evas_Object *obj);
929void evas_object_smart_del(Evas_Object *obj);
930void evas_object_smart_cleanup(Evas_Object *obj);
931void evas_object_smart_member_raise(Evas_Object *member);
932void evas_object_smart_member_lower(Evas_Object *member);
933void evas_object_smart_member_stack_above(Evas_Object *member, Evas_Object *other);
934void evas_object_smart_member_stack_below(Evas_Object *member, Evas_Object *other);
935const Eina_Inlist *evas_object_smart_members_get_direct(const Evas_Object *obj);
936void _evas_object_smart_members_all_del(Evas_Object *obj);
937void evas_call_smarts_calculate(Evas *e);
938void *evas_mem_calloc(int size);
939void _evas_post_event_callback_call(Evas *e);
940void _evas_post_event_callback_free(Evas *e);
941void evas_event_callback_list_post_free(Eina_Inlist **list);
942void evas_object_event_callback_all_del(Evas_Object *obj);
943void evas_object_event_callback_cleanup(Evas_Object *obj);
944void evas_event_callback_all_del(Evas *e);
945void evas_event_callback_cleanup(Evas *e);
946void evas_object_inform_call_show(Evas_Object *obj);
947void evas_object_inform_call_hide(Evas_Object *obj);
948void evas_object_inform_call_move(Evas_Object *obj);
949void evas_object_inform_call_resize(Evas_Object *obj);
950void evas_object_inform_call_restack(Evas_Object *obj);
951void evas_object_inform_call_changed_size_hints(Evas_Object *obj);
952void evas_object_inform_call_image_preloaded(Evas_Object *obj);
953void evas_object_inform_call_image_unloaded(Evas_Object *obj);
954void evas_object_intercept_cleanup(Evas_Object *obj);
955int evas_object_intercept_call_show(Evas_Object *obj);
956int evas_object_intercept_call_hide(Evas_Object *obj);
957int evas_object_intercept_call_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y);
958int evas_object_intercept_call_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h);
959int evas_object_intercept_call_raise(Evas_Object *obj);
960int evas_object_intercept_call_lower(Evas_Object *obj);
961int evas_object_intercept_call_stack_above(Evas_Object *obj, Evas_Object *above);
962int evas_object_intercept_call_stack_below(Evas_Object *obj, Evas_Object *below);
963int evas_object_intercept_call_layer_set(Evas_Object *obj, int l);
964int evas_object_intercept_call_color_set(Evas_Object *obj, int r, int g, int b, int a);
965int evas_object_intercept_call_clip_set(Evas_Object *obj, Evas_Object *clip);
966int evas_object_intercept_call_clip_unset(Evas_Object *obj);
967void evas_object_grabs_cleanup(Evas_Object *obj);
968void evas_key_grab_free(Evas_Object *obj, const char *keyname, Evas_Modifier_Mask modifiers, Evas_Modifier_Mask not_modifiers);
969void evas_font_dir_cache_free(void);
970const char *evas_font_dir_cache_find(char *dir, char *font);
971Eina_List *evas_font_dir_available_list(const Evas* evas);
972void evas_font_dir_available_list_free(Eina_List *available);
973void evas_font_free(Evas *evas, void *font);
974void evas_fonts_zero_free(Evas *evas);
975void evas_fonts_zero_presure(Evas *evas);
976void evas_font_name_parse(Evas_Font_Description *fdesc, const char *name);
977int evas_font_style_find(const char *start, const char *end, Evas_Font_Style style);
978Evas_Font_Description *evas_font_desc_new(void);
979Evas_Font_Description *evas_font_desc_dup(const Evas_Font_Description *fdesc);
980void evas_font_desc_unref(Evas_Font_Description *fdesc);
981int evas_font_desc_cmp(const Evas_Font_Description *a, const Evas_Font_Description *b);
982Evas_Font_Description *evas_font_desc_ref(Evas_Font_Description *fdesc);
983void * evas_font_load(Evas *evas, Evas_Font_Description *fdesc, const char *source, Evas_Font_Size size);
984void evas_font_load_hinting_set(Evas *evas, void *font, int hinting);
985void evas_object_smart_member_cache_invalidate(Evas_Object *obj, Eina_Bool pass_events, Eina_Bool freeze_events);
986void evas_text_style_pad_get(Evas_Text_Style_Type style, int *l, int *r, int *t, int *b);
987void _evas_object_text_rehint(Evas_Object *obj);
988void _evas_object_textblock_rehint(Evas_Object *obj);
989
990extern int _evas_alloc_error;
991extern int _evas_event_counter;
992
993struct _Evas_Imaging_Image
994{
995 RGBA_Image *image;
996};
997
998struct _Evas_Imaging_Font
999{
1000 RGBA_Font *font;
1001};
1002
1003int evas_async_events_init(void);
1004int evas_async_events_shutdown(void);
1005int evas_async_target_del(const void *target);
1006
1007void _evas_preload_thread_init(void);
1008void _evas_preload_thread_shutdown(void);
1009Evas_Preload_Pthread *evas_preload_thread_run(void (*func_heavy)(void *data),
1010 void (*func_end)(void *data),
1011 void (*func_cancel)(void *data),
1012 const void *data);
1013Eina_Bool evas_preload_thread_cancel(Evas_Preload_Pthread *thread);
1014
1015void _evas_walk(Evas *e);
1016void _evas_unwalk(Evas *e);
1017
1018// expose for use in engines
1019EAPI int _evas_module_engine_inherit(Evas_Func *funcs, char *name);
1020EAPI const char *_evas_module_libdir_get(void);
1021
1022Eina_Bool evas_render_mapped(Evas *e, Evas_Object *obj,
1023 void *context, void *surface,
1024 int off_x, int off_y, int mapped,
1025 int ecx, int ecy, int ecw, int ech);
1026void evas_render_invalidate(Evas *e);
1027void evas_render_object_recalc(Evas_Object *obj);
1028
1029Eina_Bool evas_map_inside_get(const Evas_Map *m, Evas_Coord x, Evas_Coord y);
1030Eina_Bool evas_map_coords_get(const Evas_Map *m, Evas_Coord x, Evas_Coord y, Evas_Coord *mx, Evas_Coord *my, int grab);
1031
1032Eina_List *evas_module_engine_list(void);
1033
1034/* for updating touch point list */
1035void _evas_touch_point_append(Evas *e, int id, Evas_Coord x, Evas_Coord y);
1036void _evas_touch_point_update(Evas *e, int id, Evas_Coord x, Evas_Coord y, Evas_Touch_Point_State state);
1037void _evas_touch_point_remove(Evas *e, int id);
1038
1039/****************************************************************************/
1040/*****************************************/
1041/********************/
1042#define MPOOL 1
1043
1044#ifdef MPOOL
1045typedef struct _Evas_Mempool Evas_Mempool;
1046
1047struct _Evas_Mempool
1048{
1049 int count;
1050 int num_allocs;
1051 int num_frees;
1052 Eina_Mempool *mp;
1053};
1054# define EVAS_MEMPOOL(x) \
1055 static Evas_Mempool x = {0, 0, 0, NULL}
1056# define EVAS_MEMPOOL_INIT(x, nam, siz, cnt, ret) \
1057 do { \
1058 if (!x.mp) { \
1059 x.mp = eina_mempool_add("chained_mempool", nam, NULL, sizeof(siz), cnt); \
1060 if (!x.mp) { \
1061 return ret; \
1062 } \
1063 } \
1064 } while (0)
1065# define EVAS_MEMPOOL_ALLOC(x, siz) \
1066 eina_mempool_malloc(x.mp, sizeof(siz))
1067# define EVAS_MEMPOOL_PREP(x, p, siz) \
1068 do { \
1069 x.count++; \
1070 x.num_allocs++; \
1071 memset(p, 0, sizeof(siz)); \
1072 } while (0)
1073# define EVAS_MEMPOOL_FREE(x, p) \
1074 do { \
1075 eina_mempool_free(x.mp, p); \
1076 x.count--; \
1077 x.num_frees++; \
1078 if (x.count <= 0) { \
1079 eina_mempool_del(x.mp); \
1080 x.mp = NULL; \
1081 x.count = 0; \
1082 } \
1083 } while (0)
1084#else
1085# define EVAS_MEMPOOL(x)
1086# define EVAS_MEMPOOL_INIT(x, nam, siz, cnt, ret)
1087# define EVAS_MEMPOOL_PREP(x, p, siz)
1088# define EVAS_MEMPOOL_ALLOC(x, siz) \
1089 calloc(1, sizeof(siz))
1090# define EVAS_MEMPOOL_FREE(x, p) \
1091 free(p)
1092#endif
1093/********************/
1094/*****************************************/
1095/****************************************************************************/
1096
1097#define EVAS_API_OVERRIDE(func, api, prefix) \
1098 (api)->func = prefix##func
1099#define EVAS_API_RESET(func, api) \
1100 (api)->func = NULL
1101
1102#include "evas_inline.x"
1103
1104#ifdef __cplusplus
1105}
1106#endif
1107#endif
diff --git a/libraries/evas/src/lib/main.c b/libraries/evas/src/lib/main.c
new file mode 100644
index 0000000..f999889
--- /dev/null
+++ b/libraries/evas/src/lib/main.c
@@ -0,0 +1,150 @@
1#include "evas_common.h"
2#include "evas_private.h"
3
4static Evas_Version _version = { VMAJ, VMIN, VMIC, VREV };
5EAPI Evas_Version *evas_version = &_version;
6
7int _evas_alloc_error = 0;
8static int _evas_debug_init = 0;
9static int _evas_debug_show = 0;
10static int _evas_debug_abort = 0;
11
12EAPI Evas_Alloc_Error
13evas_alloc_error(void)
14{
15 return _evas_alloc_error;
16}
17
18/* free cached items only in ram for speed reasons. return 0 if can't free */
19int
20evas_mem_free(int mem_required __UNUSED__)
21{
22 return 0;
23}
24
25/* start reducing quality of images etc. return 0 if can't free anything */
26int
27evas_mem_degrade(int mem_required __UNUSED__)
28{
29 return 0;
30}
31
32void *
33evas_mem_calloc(int size)
34{
35 void *ptr;
36
37 ptr = calloc(1, size);
38 if (ptr) return ptr;
39 MERR_BAD();
40 while ((!ptr) && (evas_mem_free(size))) ptr = calloc(1, size);
41 if (ptr) return ptr;
42 while ((!ptr) && (evas_mem_degrade(size))) ptr = calloc(1, size);
43 if (ptr) return ptr;
44 MERR_FATAL();
45 return NULL;
46}
47
48void
49evas_debug_error(void)
50{
51 if (!_evas_debug_init)
52 {
53 if (getenv("EVAS_DEBUG_SHOW")) _evas_debug_show = 1;
54 if (getenv("EVAS_DEBUG_ABORT")) _evas_debug_abort = 1;
55 _evas_debug_init = 1;
56 }
57 if (_evas_debug_show)
58 CRIT("Evas Magic Check Failed!!!");
59}
60
61void
62evas_debug_input_null(void)
63{
64 if (!_evas_debug_init)
65 {
66 if (getenv("EVAS_DEBUG_SHOW")) _evas_debug_show = 1;
67 if (getenv("EVAS_DEBUG_ABORT")) _evas_debug_abort = 1;
68 _evas_debug_init = 1;
69 }
70 if (_evas_debug_show)
71 CRIT("Input object pointer is NULL!");
72 if (_evas_debug_abort) abort();
73}
74
75void
76evas_debug_magic_null(void)
77{
78 if (!_evas_debug_init)
79 {
80 if (getenv("EVAS_DEBUG_SHOW")) _evas_debug_show = 1;
81 if (getenv("EVAS_DEBUG_ABORT")) _evas_debug_abort = 1;
82 _evas_debug_init = 1;
83 }
84 if (_evas_debug_show)
85 CRIT("Input object is zero'ed out (maybe a freed object or zero-filled RAM)!");
86 if (_evas_debug_abort) abort();
87}
88
89void
90evas_debug_magic_wrong(DATA32 expected, DATA32 supplied)
91{
92 if (!_evas_debug_init)
93 {
94 if (getenv("EVAS_DEBUG_SHOW")) _evas_debug_show = 1;
95 if (getenv("EVAS_DEBUG_ABORT")) _evas_debug_abort = 1;
96 _evas_debug_init = 1;
97 }
98 if (_evas_debug_show)
99 CRIT("Input object is wrong type\n"
100 " Expected: %08x - %s\n"
101 " Supplied: %08x - %s",
102 expected, evas_debug_magic_string_get(expected),
103 supplied, evas_debug_magic_string_get(supplied));
104 if (_evas_debug_abort) abort();
105}
106
107void
108evas_debug_generic(const char *str)
109{
110 if (!_evas_debug_init)
111 {
112 if (getenv("EVAS_DEBUG_SHOW")) _evas_debug_show = 1;
113 if (getenv("EVAS_DEBUG_ABORT")) _evas_debug_abort = 1;
114 _evas_debug_init = 1;
115 }
116 if (_evas_debug_show)
117 CRIT("%s", str);
118 if (_evas_debug_abort) abort();
119}
120
121const char *
122evas_debug_magic_string_get(DATA32 magic)
123{
124 switch (magic)
125 {
126 case MAGIC_EVAS:
127 return "Evas";
128 case MAGIC_OBJ:
129 return "Evas_Object";
130 case MAGIC_OBJ_RECTANGLE:
131 return "Evas_Object (Rectangle)";
132 case MAGIC_OBJ_LINE:
133 return "Evas_Object (Line)";
134 case MAGIC_OBJ_POLYGON:
135 return "Evas_Object (Polygon)";
136 case MAGIC_OBJ_IMAGE:
137 return "Evas_Object (Image)";
138 case MAGIC_OBJ_TEXT:
139 return "Evas_Object (Text)";
140 case MAGIC_OBJ_SMART:
141 return "Evas_Object (Smart)";
142 case MAGIC_EVAS_GL:
143 return "Evas_GL";
144 case MAGIC_MAP:
145 return "Evas_Map";
146 default:
147 return "<UNKNOWN>";
148 };
149 return "<UNKNOWN>";
150}