summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/benchmarks/eo/class_simple.c2
-rw-r--r--src/benchmarks/eo/eo_bench_callbacks.c6
-rw-r--r--src/benchmarks/eo/eo_bench_eo_do.c12
-rw-r--r--src/examples/ecore/ecore_audio_custom.c14
-rw-r--r--src/examples/ecore/ecore_audio_playback.c82
-rw-r--r--src/examples/ecore/ecore_audio_to_ogg.c14
-rw-r--r--src/examples/ecore/ecore_idler_example.c2
-rw-r--r--src/examples/ecore/ecore_poller_example.c11
-rw-r--r--src/examples/edje/edje-text.c6
-rw-r--r--src/examples/eldbus/dbusmodel.c26
-rw-r--r--src/examples/emotion/emotion_basic_example.c4
-rw-r--r--src/examples/emotion/emotion_border_example.c5
-rw-r--r--src/examples/emotion/emotion_generic_example.c10
-rw-r--r--src/examples/emotion/emotion_generic_subtitle_example.c4
-rw-r--r--src/examples/emotion/emotion_signals_example.c10
-rw-r--r--src/examples/eo/evas/evas_elw_box.c2
-rw-r--r--src/examples/eo/evas/evas_elw_boxedbutton.c10
-rw-r--r--src/examples/eo/evas/evas_elw_button.c8
-rw-r--r--src/examples/eo/evas/evas_elw_win.c2
-rw-r--r--src/examples/eo/evas/evas_evas_obj.c6
-rw-r--r--src/examples/eo/evas/evas_evas_obj.h4
-rw-r--r--src/examples/eo/evas/evas_test.c29
-rw-r--r--src/examples/eo/isa/eo_isa_mixin.c2
-rw-r--r--src/examples/eo/simple/simple_main.c8
-rw-r--r--src/examples/eo/simple/simple_mixin.c2
-rw-r--r--src/examples/eolian_cxx/colourable.c6
-rw-r--r--src/examples/eolian_cxx/colourablesquare.c2
-rw-r--r--src/examples/evas/evas-3d-aabb.c157
-rw-r--r--src/examples/evas/evas-3d-blending.c128
-rw-r--r--src/examples/evas/evas-3d-colorpick.c156
-rw-r--r--src/examples/evas/evas-3d-cube-rotate.c91
-rw-r--r--src/examples/evas/evas-3d-cube.c123
-rw-r--r--src/examples/evas/evas-3d-cube2.c150
-rw-r--r--src/examples/evas/evas-3d-eet.c136
-rw-r--r--src/examples/evas/evas-3d-fog.c127
-rw-r--r--src/examples/evas/evas-3d-frustum.c229
-rw-r--r--src/examples/evas/evas-3d-hull.c242
-rw-r--r--src/examples/evas/evas-3d-md2.c120
-rw-r--r--src/examples/evas/evas-3d-mmap-set.c137
-rw-r--r--src/examples/evas/evas-3d-obj.c129
-rw-r--r--src/examples/evas/evas-3d-parallax-occlusion.c186
-rw-r--r--src/examples/evas/evas-3d-pick.c97
-rw-r--r--src/examples/evas/evas-3d-ply.c132
-rw-r--r--src/examples/evas/evas-3d-proxy.c131
-rw-r--r--src/examples/evas/evas-3d-shadows.c470
-rw-r--r--src/examples/evas/evas-object-manipulation-eo.c75
-rw-r--r--src/examples/evas/evas-vg-simple.c46
-rw-r--r--src/examples/evas/shooter/evas-3d-shooter-header.c95
-rw-r--r--src/examples/evas/shooter/evas-3d-shooter-macros.h109
-rw-r--r--src/examples/evas/shooter/evas-3d-shooter.c527
-rw-r--r--src/lib/ecore/ecore_anim.c18
-rw-r--r--src/lib/ecore/ecore_exe.c12
-rw-r--r--src/lib/ecore/ecore_exe_posix.c2
-rw-r--r--src/lib/ecore/ecore_exe_win32.c4
-rw-r--r--src/lib/ecore/ecore_idle_enterer.c12
-rw-r--r--src/lib/ecore/ecore_idle_exiter.c10
-rw-r--r--src/lib/ecore/ecore_idler.c10
-rw-r--r--src/lib/ecore/ecore_job.c10
-rw-r--r--src/lib/ecore/ecore_poller.c13
-rw-r--r--src/lib/ecore/ecore_timer.c24
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj.c2
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_in.c22
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_in_sndfile.c2
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_in_tone.c6
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_out.c10
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_out_core_audio.c20
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_out_pulse.c46
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_out_sndfile.c16
-rw-r--r--src/lib/ecore_con/ecore_con.c75
-rw-r--r--src/lib/ecore_con/ecore_con_eet.c38
-rw-r--r--src/lib/ecore_con/ecore_con_legacy.c4
-rw-r--r--src/lib/ecore_con/ecore_con_url.c23
-rw-r--r--src/lib/ecore_evas/ecore_evas.c4
-rw-r--r--src/lib/ector/cairo/ector_cairo_private.h2
-rw-r--r--src/lib/ector/cairo/ector_cairo_software_surface.c13
-rw-r--r--src/lib/ector/cairo/ector_cairo_surface.c13
-rw-r--r--src/lib/ector/cairo/ector_renderer_cairo_base.c6
-rw-r--r--src/lib/ector/cairo/ector_renderer_cairo_gradient_linear.c14
-rw-r--r--src/lib/ector/cairo/ector_renderer_cairo_gradient_radial.c14
-rw-r--r--src/lib/ector/cairo/ector_renderer_cairo_shape.c34
-rw-r--r--src/lib/ector/ector_private.h2
-rw-r--r--src/lib/ector/ector_renderer_generic_base.c6
-rw-r--r--src/lib/ector/ector_renderer_generic_buffer.c2
-rw-r--r--src/lib/ector/gl/ector_gl_surface.c15
-rw-r--r--src/lib/ector/gl/ector_renderer_gl_base.c5
-rw-r--r--src/lib/ector/gl/ector_renderer_gl_gradient_linear.c11
-rw-r--r--src/lib/ector/gl/ector_renderer_gl_gradient_radial.c11
-rw-r--r--src/lib/ector/gl/ector_renderer_gl_shape.c21
-rw-r--r--src/lib/ector/software/ector_renderer_software_buffer.c4
-rw-r--r--src/lib/ector/software/ector_renderer_software_gradient_linear.c10
-rw-r--r--src/lib/ector/software/ector_renderer_software_gradient_radial.c10
-rw-r--r--src/lib/ector/software/ector_renderer_software_shape.c28
-rw-r--r--src/lib/ector/software/ector_software_buffer.c6
-rw-r--r--src/lib/ector/software/ector_software_rasterizer.c4
-rw-r--r--src/lib/ector/software/ector_software_surface.c16
-rw-r--r--src/lib/edje/edje_callbacks.c8
-rw-r--r--src/lib/edje/edje_edit.c8
-rw-r--r--src/lib/edje/edje_load.c36
-rw-r--r--src/lib/edje/edje_multisense.c24
-rw-r--r--src/lib/edje/edje_program.c8
-rw-r--r--src/lib/edje/edje_smart.c30
-rw-r--r--src/lib/edje/edje_util.c5
-rw-r--r--src/lib/efl/interfaces/efl_gfx_shape.c80
-rw-r--r--src/lib/efl/interfaces/efl_model_common.c8
-rw-r--r--src/lib/eio/eio_model.c24
-rw-r--r--src/lib/eldbus/eldbus_model_arguments.c10
-rw-r--r--src/lib/eldbus/eldbus_model_connection.c9
-rw-r--r--src/lib/eldbus/eldbus_model_method.c6
-rw-r--r--src/lib/eldbus/eldbus_model_object.c9
-rw-r--r--src/lib/eldbus/eldbus_model_proxy.c16
-rw-r--r--src/lib/eldbus/eldbus_model_signal.c10
-rw-r--r--src/lib/emotion/emotion_smart.c88
-rw-r--r--src/lib/eo/eo_base_class.c28
-rw-r--r--src/lib/evas/Evas_Legacy.h9
-rw-r--r--src/lib/evas/canvas/evas_callbacks.c26
-rw-r--r--src/lib/evas/canvas/evas_canvas3d_camera.c16
-rw-r--r--src/lib/evas/canvas/evas_canvas3d_light.c32
-rw-r--r--src/lib/evas/canvas/evas_canvas3d_material.c14
-rw-r--r--src/lib/evas/canvas/evas_canvas3d_mesh.c48
-rw-r--r--src/lib/evas/canvas/evas_canvas3d_node.c146
-rw-r--r--src/lib/evas/canvas/evas_canvas3d_object.c16
-rw-r--r--src/lib/evas/canvas/evas_canvas3d_primitive.c6
-rw-r--r--src/lib/evas/canvas/evas_canvas3d_scene.c40
-rw-r--r--src/lib/evas/canvas/evas_canvas3d_texture.c42
-rw-r--r--src/lib/evas/canvas/evas_clip.c12
-rw-r--r--src/lib/evas/canvas/evas_data.c7
-rw-r--r--src/lib/evas/canvas/evas_events.c14
-rw-r--r--src/lib/evas/canvas/evas_filter_mixin.c28
-rw-r--r--src/lib/evas/canvas/evas_focus.c2
-rw-r--r--src/lib/evas/canvas/evas_layer.c4
-rw-r--r--src/lib/evas/canvas/evas_main.c4
-rw-r--r--src/lib/evas/canvas/evas_object_box.c61
-rw-r--r--src/lib/evas/canvas/evas_object_grid.c4
-rw-r--r--src/lib/evas/canvas/evas_object_image.c58
-rw-r--r--src/lib/evas/canvas/evas_object_line.c2
-rw-r--r--src/lib/evas/canvas/evas_object_main.c101
-rw-r--r--src/lib/evas/canvas/evas_object_polygon.c4
-rw-r--r--src/lib/evas/canvas/evas_object_rectangle.c2
-rw-r--r--src/lib/evas/canvas/evas_object_smart.c36
-rw-r--r--src/lib/evas/canvas/evas_object_smart_clipped.c6
-rw-r--r--src/lib/evas/canvas/evas_object_table.c14
-rw-r--r--src/lib/evas/canvas/evas_object_text.c48
-rw-r--r--src/lib/evas/canvas/evas_object_textblock.c29
-rw-r--r--src/lib/evas/canvas/evas_object_textgrid.c20
-rw-r--r--src/lib/evas/canvas/evas_object_vg.c8
-rw-r--r--src/lib/evas/canvas/evas_out.c12
-rw-r--r--src/lib/evas/canvas/evas_render.c8
-rw-r--r--src/lib/evas/canvas/evas_stack.c12
-rw-r--r--src/lib/evas/canvas/evas_vg_container.c16
-rw-r--r--src/lib/evas/canvas/evas_vg_gradient.c17
-rw-r--r--src/lib/evas/canvas/evas_vg_gradient_linear.c42
-rw-r--r--src/lib/evas/canvas/evas_vg_gradient_radial.c50
-rw-r--r--src/lib/evas/canvas/evas_vg_node.c65
-rw-r--r--src/lib/evas/canvas/evas_vg_private.h2
-rw-r--r--src/lib/evas/canvas/evas_vg_root_node.c11
-rw-r--r--src/lib/evas/canvas/evas_vg_shape.c153
-rw-r--r--src/lib/evas/canvas/render2/evas_render2.c6
-rw-r--r--src/lib/evas/canvas/render2/evas_render2_old.c6
-rw-r--r--src/lib/evas/common3d/primitives/primitive_common.c30
-rw-r--r--src/lib/evas/common3d/primitives/primitive_common.h26
-rw-r--r--src/lib/evas/common3d/save_load/evas_model_load_save_common.c24
-rw-r--r--src/lib/evas/filters/evas_filter.c2
-rw-r--r--src/lib/evas/filters/evas_filter_blend.c8
-rw-r--r--src/lib/evas/filters/evas_filter_blur.c8
-rw-r--r--src/lib/evas/filters/evas_filter_bump.c12
-rw-r--r--src/lib/evas/filters/evas_filter_curve.c8
-rw-r--r--src/lib/evas/filters/evas_filter_displace.c12
-rw-r--r--src/lib/evas/filters/evas_filter_fill.c2
-rw-r--r--src/lib/evas/filters/evas_filter_mask.c24
-rw-r--r--src/lib/evas/filters/evas_filter_parser.c27
-rw-r--r--src/lib/evas/filters/evas_filter_private.h4
-rw-r--r--src/lib/evas/filters/evas_filter_transform.c4
-rw-r--r--src/lib/evas/filters/evas_filter_utils.c4
-rw-r--r--src/modules/ethumb/emotion/emotion.c24
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_preload.c8
-rw-r--r--src/modules/evas/engines/gl_generic/evas_ector_gl_image_buffer.c14
-rw-r--r--src/modules/evas/engines/gl_generic/evas_ector_gl_rgbaimage_buffer.c13
-rw-r--r--src/modules/evas/engines/gl_generic/evas_engine.c26
-rw-r--r--src/modules/evas/engines/software_generic/evas_ector_software_buffer.c13
-rw-r--r--src/modules/evas/engines/software_generic/evas_engine.c26
-rw-r--r--src/modules/evas/model_loaders/eet/evas_model_load_eet.c71
-rw-r--r--src/modules/evas/model_loaders/md2/evas_model_load_md2.c42
-rw-r--r--src/modules/evas/model_loaders/obj/evas_model_load_obj.c33
-rw-r--r--src/tests/ecore/ecore_test_animator.c4
-rw-r--r--src/tests/ecore/ecore_test_ecore_audio.c222
-rw-r--r--src/tests/edje/edje_test_edje.c18
-rw-r--r--src/tests/eina_cxx/simple.c2
-rw-r--r--src/tests/eio/eio_model_test_file.c26
-rw-r--r--src/tests/eio/eio_model_test_monitor_add.c26
-rw-r--r--src/tests/eldbus/eldbus_test_eldbus_model.c58
-rw-r--r--src/tests/eldbus/eldbus_test_eldbus_model_connection.c30
-rw-r--r--src/tests/eldbus/eldbus_test_eldbus_model_method.c31
-rw-r--r--src/tests/eldbus/eldbus_test_eldbus_model_object.c30
-rw-r--r--src/tests/eldbus/eldbus_test_eldbus_model_proxy.c24
-rw-r--r--src/tests/eldbus/eldbus_test_eldbus_model_signal.c29
-rw-r--r--src/tests/eldbus/eldbus_test_fake_server_eldbus_model_proxy.c35
-rw-r--r--src/tests/emotion/emotion_test_main-eo.c150
-rw-r--r--src/tests/eo/access/access_main.c3
-rw-r--r--src/tests/eo/access/access_simple.c2
-rw-r--r--src/tests/eo/children/children_main.c8
-rw-r--r--src/tests/eo/composite_objects/composite_objects_comp.c14
-rw-r--r--src/tests/eo/composite_objects/composite_objects_main.c34
-rw-r--r--src/tests/eo/composite_objects/composite_objects_simple.c2
-rw-r--r--src/tests/eo/constructors/constructors_main.c16
-rw-r--r--src/tests/eo/constructors/constructors_mixin.c7
-rw-r--r--src/tests/eo/constructors/constructors_simple.c6
-rw-r--r--src/tests/eo/constructors/constructors_simple2.c2
-rw-r--r--src/tests/eo/constructors/constructors_simple6.c2
-rw-r--r--src/tests/eo/constructors/constructors_simple7.c2
-rw-r--r--src/tests/eo/function_overrides/function_overrides_inherit2.c12
-rw-r--r--src/tests/eo/function_overrides/function_overrides_inherit3.c2
-rw-r--r--src/tests/eo/function_overrides/function_overrides_main.c27
-rw-r--r--src/tests/eo/function_overrides/function_overrides_simple.c4
-rw-r--r--src/tests/eo/interface/interface_main.c13
-rw-r--r--src/tests/eo/interface/interface_simple.c6
-rw-r--r--src/tests/eo/mixin/mixin_inherit.c2
-rw-r--r--src/tests/eo/mixin/mixin_main.c13
-rw-r--r--src/tests/eo/mixin/mixin_mixin.c7
-rw-r--r--src/tests/eo/mixin/mixin_mixin2.c9
-rw-r--r--src/tests/eo/mixin/mixin_mixin3.c9
-rw-r--r--src/tests/eo/signals/signals_main.c108
-rw-r--r--src/tests/eo/signals/signals_simple.c10
-rw-r--r--src/tests/eo/suite/eo_test_call_errors.c6
-rw-r--r--src/tests/eo/suite/eo_test_class_behaviour_errors.c2
-rw-r--r--src/tests/eo/suite/eo_test_class_simple.c6
-rw-r--r--src/tests/eo/suite/eo_test_general.c182
-rw-r--r--src/tests/eo/suite/eo_test_threaded_calls.c5
-rw-r--r--src/tests/eo/suite/eo_test_value.c2
-rw-r--r--src/tests/eolian/data/object_impl_add_ref.c2
-rw-r--r--src/tests/eolian/data/object_impl_ref.c2
-rw-r--r--src/tests/eolian_cxx/a.c2
-rw-r--r--src/tests/eolian_cxx/b.c2
-rw-r--r--src/tests/eolian_cxx/c.c2
-rw-r--r--src/tests/eolian_cxx/callback.c2
-rw-r--r--src/tests/eolian_cxx/d.c2
-rw-r--r--src/tests/eolian_cxx/generic.c2
-rw-r--r--src/tests/eolian_cxx/simple.c2
-rw-r--r--src/tests/eolian_js/eolian_js_test_constructor_method_impl.c8
-rw-r--r--src/tests/eolian_js/eolian_js_test_test_object_impl.c12
-rw-r--r--src/tests/evas/evas_test_filters.c16
-rw-r--r--src/tests/evas/evas_test_mesh.c12
241 files changed, 3584 insertions, 4533 deletions
diff --git a/src/benchmarks/eo/class_simple.c b/src/benchmarks/eo/class_simple.c
index 0a57e28..a448272 100644
--- a/src/benchmarks/eo/class_simple.c
+++ b/src/benchmarks/eo/class_simple.c
@@ -15,7 +15,7 @@ _other_call(Eo *obj EINA_UNUSED, void *class_data EINA_UNUSED, Eo *other, int ti
15{ 15{
16 if (times > 0) 16 if (times > 0)
17 { 17 {
18 eo_do(other, simple_other_call(obj, times-1)); 18 simple_other_call(other, obj, times-1);
19 } 19 }
20} 20}
21 21
diff --git a/src/benchmarks/eo/eo_bench_callbacks.c b/src/benchmarks/eo/eo_bench_callbacks.c
index 5f67559..ab779f8 100644
--- a/src/benchmarks/eo/eo_bench_callbacks.c
+++ b/src/benchmarks/eo/eo_bench_callbacks.c
@@ -21,7 +21,7 @@ bench_eo_callbacks_add(int request)
21 21
22 for (i = 0 ; i < request ; i++) 22 for (i = 0 ; i < request ; i++)
23 { 23 {
24 eo_do(obj, eo_event_callback_priority_add(SIMPLE_FOO, (short) i, _cb, NULL)); 24 eo_event_callback_priority_add(obj, SIMPLE_FOO, (short) i, _cb, NULL);
25 } 25 }
26 26
27 eo_unref(obj); 27 eo_unref(obj);
@@ -57,7 +57,7 @@ bench_eo_callbacks_call(int request)
57 57
58 for (j = 0 ; j < i ; j++) 58 for (j = 0 ; j < i ; j++)
59 { 59 {
60 eo_do(obj[i], eo_event_callback_priority_add(SIMPLE_FOO, (short) j, _cb, NULL)); 60 eo_event_callback_priority_add(obj[i], SIMPLE_FOO, (short) j, _cb, NULL);
61 } 61 }
62 } 62 }
63 63
@@ -66,7 +66,7 @@ bench_eo_callbacks_call(int request)
66 for (j = 0 ; j < (int) (distribution[i] * request) ; j++) 66 for (j = 0 ; j < (int) (distribution[i] * request) ; j++)
67 { 67 {
68 /* Miss finding the callbacks on purpose, so we measure worst case scenario. */ 68 /* Miss finding the callbacks on purpose, so we measure worst case scenario. */
69 eo_do(obj[i], eo_event_callback_call(SIMPLE_BAR, NULL)); 69 eo_event_callback_call(obj[i], SIMPLE_BAR, NULL);
70 } 70 }
71 } 71 }
72 72
diff --git a/src/benchmarks/eo/eo_bench_eo_do.c b/src/benchmarks/eo/eo_bench_eo_do.c
index 2bcdc42..9f84535 100644
--- a/src/benchmarks/eo/eo_bench_eo_do.c
+++ b/src/benchmarks/eo/eo_bench_eo_do.c
@@ -13,7 +13,7 @@ bench_eo_do_simple(int request)
13 Eo *obj = eo_add(SIMPLE_CLASS, NULL); 13 Eo *obj = eo_add(SIMPLE_CLASS, NULL);
14 for (i = 0 ; i < request ; i++) 14 for (i = 0 ; i < request ; i++)
15 { 15 {
16 eo_do(obj, simple_a_set(i)); 16 simple_a_set(obj, i);
17 } 17 }
18 18
19 eo_unref(obj); 19 eo_unref(obj);
@@ -27,8 +27,8 @@ bench_eo_do_two_objs(int request)
27 Eo *obj2 = eo_add(SIMPLE_CLASS, NULL); 27 Eo *obj2 = eo_add(SIMPLE_CLASS, NULL);
28 for (i = 0 ; i < request ; i++) 28 for (i = 0 ; i < request ; i++)
29 { 29 {
30 eo_do(obj, simple_a_set(i)); 30 simple_a_set(obj, i);
31 eo_do(obj2, simple_a_set(i)); 31 simple_a_set(obj2, i);
32 } 32 }
33 33
34 eo_unref(obj); 34 eo_unref(obj);
@@ -43,7 +43,7 @@ bench_eo_do_two_objs_growing_stack(int request)
43 Eo *obj2 = eo_add(SIMPLE_CLASS, NULL); 43 Eo *obj2 = eo_add(SIMPLE_CLASS, NULL);
44 for (i = 0 ; i < request ; i++) 44 for (i = 0 ; i < request ; i++)
45 { 45 {
46 eo_do(obj, simple_other_call(obj2, 20)); 46 simple_other_call(obj, obj2, 20);
47 } 47 }
48 48
49 eo_unref(obj); 49 eo_unref(obj);
@@ -55,7 +55,7 @@ static const Eo_Class *cur_klass;
55static void 55static void
56_a_set(Eo *obj, void *class_data EINA_UNUSED, int a) 56_a_set(Eo *obj, void *class_data EINA_UNUSED, int a)
57{ 57{
58 eo_do_super(obj, cur_klass, simple_a_set(a)); 58 simple_a_set(eo_super(obj, cur_klass), a);
59} 59}
60 60
61static Eo_Op_Description op_desc[] = { 61static Eo_Op_Description op_desc[] = {
@@ -81,7 +81,7 @@ bench_eo_do_super(int request)
81 Eo *obj = eo_add(cur_klass, NULL); 81 Eo *obj = eo_add(cur_klass, NULL);
82 for (i = 0 ; i < request ; i++) 82 for (i = 0 ; i < request ; i++)
83 { 83 {
84 eo_do(obj, simple_a_set(i)); 84 simple_a_set(obj, i);
85 } 85 }
86 86
87 eo_unref(obj); 87 eo_unref(obj);
diff --git a/src/examples/ecore/ecore_audio_custom.c b/src/examples/ecore/ecore_audio_custom.c
index 7355335..2570a9e 100644
--- a/src/examples/ecore/ecore_audio_custom.c
+++ b/src/examples/ecore/ecore_audio_custom.c
@@ -25,7 +25,7 @@ int read_cb(void *data EINA_UNUSED, Eo *eo_obj, void *buf, int len)
25 float *val = buf; 25 float *val = buf;
26 int i; 26 int i;
27 27
28 eo_do(eo_obj, ecore_audio_obj_volume_get(&volume)); 28 ecore_audio_obj_volume_get(eo_obj, &volume);
29 29
30 for(i=0; i<len/4; i++, phase1++) 30 for(i=0; i<len/4; i++, phase1++)
31 { 31 {
@@ -64,13 +64,13 @@ main(int argc, const char *argv[])
64 printf("error when creating ecore audio source.\n"); 64 printf("error when creating ecore audio source.\n");
65 goto end; 65 goto end;
66 } 66 }
67 eo_do(in, ecore_audio_obj_name_set("wail")); 67 ecore_audio_obj_name_set(in, "wail");
68 eo_do(in, ecore_audio_obj_in_samplerate_set(44100)); 68 ecore_audio_obj_in_samplerate_set(in, 44100);
69 eo_do(in, ecore_audio_obj_in_channels_set(1)); 69 ecore_audio_obj_in_channels_set(in, 1);
70 eo_do(in, ecore_audio_obj_volume_set(0.7)); 70 ecore_audio_obj_volume_set(in, 0.7);
71 eo_do(in, ecore_audio_obj_vio_set(&vio, NULL, NULL)); 71 ecore_audio_obj_vio_set(in, &vio, NULL, NULL);
72 72
73 eo_do(out, ret = ecore_audio_obj_out_input_attach(in)); 73 ret = ecore_audio_obj_out_input_attach(out, in);
74 if (!ret) { 74 if (!ret) {
75 printf("Could not attach input"); 75 printf("Could not attach input");
76 goto end; 76 goto end;
diff --git a/src/examples/ecore/ecore_audio_playback.c b/src/examples/ecore/ecore_audio_playback.c
index 95ab90a..f1624e0 100644
--- a/src/examples/ecore/ecore_audio_playback.c
+++ b/src/examples/ecore/ecore_audio_playback.c
@@ -30,19 +30,19 @@ handle_cmd(char *cmd, size_t bread)
30 if (!out) 30 if (!out)
31 return; 31 return;
32 32
33 eo_do(out, ecore_audio_obj_out_inputs_get(&out_inputs)); 33 ecore_audio_obj_out_inputs_get(out, &out_inputs);
34 EINA_LIST_FOREACH(out_inputs, input, in) 34 EINA_LIST_FOREACH(out_inputs, input, in)
35 { 35 {
36 eo_do(in, ecore_audio_obj_in_seek(0, SEEK_CUR, &pos)); 36 ecore_audio_obj_in_seek(in, 0, SEEK_CUR, &pos);
37 if (!strncmp(cmd, "<", bread)) 37 if (!strncmp(cmd, "<", bread))
38 eo_do(in, ecore_audio_obj_in_seek(-10, SEEK_CUR, &pos)); 38 ecore_audio_obj_in_seek(in, -10, SEEK_CUR, &pos);
39 else if (!strncmp(cmd, ">", bread)) 39 else if (!strncmp(cmd, ">", bread))
40 eo_do(in, ecore_audio_obj_in_seek(10, SEEK_CUR, &pos)); 40 ecore_audio_obj_in_seek(in, 10, SEEK_CUR, &pos);
41 41
42 min = pos / 60; 42 min = pos / 60;
43 43
44 eo_do(in, ecore_audio_obj_name_get(&name)); 44 ecore_audio_obj_name_get(in, &name);
45 eo_do(in, ecore_audio_obj_in_length_get(&length)); 45 ecore_audio_obj_in_length_get(in, &length);
46 printf("Position: %2im %5.02fs (%0.2f%%) - %s\n", min, pos - min * 60, pos/length*100, name); 46 printf("Position: %2im %5.02fs (%0.2f%%) - %s\n", min, pos - min * 60, pos/length*100, name);
47 47
48 } 48 }
@@ -53,7 +53,7 @@ handle_cmd(char *cmd, size_t bread)
53 else if (!strncmp(cmd, "n", bread)) 53 else if (!strncmp(cmd, "n", bread))
54 { 54 {
55 in = eina_list_data_get(out_inputs); 55 in = eina_list_data_get(out_inputs);
56 eo_do(out, ret = ecore_audio_obj_out_input_detach(in)); 56 ret = ecore_audio_obj_out_input_detach(out, in);
57 if (!ret) 57 if (!ret)
58 printf("Could not detach input\n"); 58 printf("Could not detach input\n");
59 59
@@ -63,11 +63,11 @@ handle_cmd(char *cmd, size_t bread)
63 { 63 {
64 in = (Eo *)eina_list_data_get(inputs); 64 in = (Eo *)eina_list_data_get(inputs);
65 65
66 eo_do(in, ecore_audio_obj_name_get(&name), 66 ecore_audio_obj_name_get(in, &name);
67 ecore_audio_obj_in_length_get(&length)); 67 ecore_audio_obj_in_length_get(in, &length);
68 68
69 printf("Start: %s (%0.2fs)\n", name, length); 69 printf("Start: %s (%0.2fs)\n", name, length);
70 eo_do(out, ret = ecore_audio_obj_out_input_attach(in)); 70 ret = ecore_audio_obj_out_input_attach(out, in);
71 if (!ret) 71 if (!ret)
72 printf("Could not attach input %s\n", name); 72 printf("Could not attach input %s\n", name);
73 } 73 }
@@ -84,11 +84,11 @@ handle_cmd(char *cmd, size_t bread)
84 { 84 {
85 in = (Eo *)eina_list_data_get(inputs); 85 in = (Eo *)eina_list_data_get(inputs);
86 86
87 eo_do(in, ecore_audio_obj_name_get(&name), 87 ecore_audio_obj_name_get(in, &name);
88 ecore_audio_obj_in_length_get(&length)); 88 ecore_audio_obj_in_length_get(in, &length);
89 89
90 printf("Start: %s (%0.2fs)\n", name, length); 90 printf("Start: %s (%0.2fs)\n", name, length);
91 eo_do(out, ret = ecore_audio_obj_out_input_attach(in)); 91 ret = ecore_audio_obj_out_input_attach(out, in);
92 if (!ret) 92 if (!ret)
93 printf("Could not attach input %s\n", name); 93 printf("Could not attach input %s\n", name);
94 } 94 }
@@ -98,25 +98,25 @@ handle_cmd(char *cmd, size_t bread)
98 EINA_LIST_FOREACH(out_inputs, input, in) 98 EINA_LIST_FOREACH(out_inputs, input, in)
99 { 99 {
100 Eina_Bool loop; 100 Eina_Bool loop;
101 eo_do(in, ecore_audio_obj_in_looped_get(&loop), 101 ecore_audio_obj_in_looped_get(in, &loop);
102 ecore_audio_obj_name_get(&name)); 102 ecore_audio_obj_name_get(in, &name);
103 103
104 printf("%s song %s\n", !loop?"Looping":"Not looping", name); 104 printf("%s song %s\n", !loop?"Looping":"Not looping", name);
105 eo_do(in, ecore_audio_obj_in_looped_set(!loop)); 105 ecore_audio_obj_in_looped_set(in, !loop);
106 } 106 }
107 } 107 }
108 else if (!strncmp(cmd, "+", bread)) 108 else if (!strncmp(cmd, "+", bread))
109 { 109 {
110 if (volume < 1.5) 110 if (volume < 1.5)
111 volume += 0.01; 111 volume += 0.01;
112 eo_do(out, ecore_audio_obj_volume_set(volume)); 112 ecore_audio_obj_volume_set(out, volume);
113 printf("Volume: %3.0f%%\n", volume * 100); 113 printf("Volume: %3.0f%%\n", volume * 100);
114 } 114 }
115 else if (!strncmp(cmd, "-", bread)) 115 else if (!strncmp(cmd, "-", bread))
116 { 116 {
117 if (volume > 0) 117 if (volume > 0)
118 volume -= 0.01; 118 volume -= 0.01;
119 eo_do(out, ecore_audio_obj_volume_set(volume)); 119 ecore_audio_obj_volume_set(out, volume);
120 printf("Volume: %3.0f%%\n", volume * 100); 120 printf("Volume: %3.0f%%\n", volume * 100);
121 } 121 }
122 else if (!strncmp(cmd, "*", bread)) 122 else if (!strncmp(cmd, "*", bread))
@@ -124,11 +124,11 @@ handle_cmd(char *cmd, size_t bread)
124 double speed; 124 double speed;
125 EINA_LIST_FOREACH(out_inputs, input, in) 125 EINA_LIST_FOREACH(out_inputs, input, in)
126 { 126 {
127 eo_do(in, ecore_audio_obj_in_speed_get(&speed)); 127 ecore_audio_obj_in_speed_get(in, &speed);
128 if (speed < 2.0) 128 if (speed < 2.0)
129 speed += 0.01; 129 speed += 0.01;
130 eo_do(in, ecore_audio_obj_in_speed_set(speed), 130 ecore_audio_obj_in_speed_set(in, speed);
131 ecore_audio_obj_name_get(&name)); 131 ecore_audio_obj_name_get(in, &name);
132 printf("Speed: %3.0f%% (%s)\n", speed * 100, name); 132 printf("Speed: %3.0f%% (%s)\n", speed * 100, name);
133 } 133 }
134 } 134 }
@@ -137,11 +137,11 @@ handle_cmd(char *cmd, size_t bread)
137 double speed; 137 double speed;
138 EINA_LIST_FOREACH(out_inputs, input, in) 138 EINA_LIST_FOREACH(out_inputs, input, in)
139 { 139 {
140 eo_do(in, ecore_audio_obj_in_speed_get(&speed)); 140 ecore_audio_obj_in_speed_get(in, &speed);
141 if (speed > 0.5) 141 if (speed > 0.5)
142 speed -= 0.01; 142 speed -= 0.01;
143 eo_do(in, ecore_audio_obj_in_speed_set(speed), 143 ecore_audio_obj_in_speed_set(in, speed);
144 ecore_audio_obj_name_get(&name)); 144 ecore_audio_obj_name_get(in, &name);
145 printf("Speed: %3.0f%% (%s)\n", speed * 100, name); 145 printf("Speed: %3.0f%% (%s)\n", speed * 100, name);
146 } 146 }
147 } 147 }
@@ -149,11 +149,11 @@ handle_cmd(char *cmd, size_t bread)
149 { 149 {
150 EINA_LIST_FOREACH(out_inputs, input, in) 150 EINA_LIST_FOREACH(out_inputs, input, in)
151 { 151 {
152 eo_do(in, ecore_audio_obj_paused_get(&paused), 152 ecore_audio_obj_paused_get(in, &paused);
153 ecore_audio_obj_name_get(&name), 153 ecore_audio_obj_name_get(in, &name);
154 ecore_audio_obj_in_remaining_get(&length)); 154 ecore_audio_obj_in_remaining_get(in, &length);
155 printf("%s %s\n%0.2f remaining\n", !paused ? "Paused" : "Unpaused", name, length); 155 printf("%s %s\n%0.2f remaining\n", !paused ? "Paused" : "Unpaused", name, length);
156 eo_do(in, ecore_audio_obj_paused_set(!paused)); 156 ecore_audio_obj_paused_set(in, !paused);
157 } 157 }
158 } 158 }
159 else if (!strncmp(cmd, "q", bread)) 159 else if (!strncmp(cmd, "q", bread))
@@ -196,11 +196,11 @@ static Eina_Bool _play_finished(void *data EINA_UNUSED, const Eo_Event *event)
196 const char *name; 196 const char *name;
197 Eina_Bool ret; 197 Eina_Bool ret;
198 198
199 eo_do(event->obj, ecore_audio_obj_name_get(&name)); 199 ecore_audio_obj_name_get(event->obj, &name);
200 printf("Done: %s\n", name); 200 printf("Done: %s\n", name);
201 201
202 inputs = eina_list_remove(inputs, event->obj); 202 inputs = eina_list_remove(inputs, event->obj);
203 eo_do(out, ret = ecore_audio_obj_out_input_detach(event->obj)); 203 ret = ecore_audio_obj_out_input_detach(out, event->obj);
204 eo_del(event->obj); 204 eo_del(event->obj);
205 205
206 if (!ret) 206 if (!ret)
@@ -212,9 +212,9 @@ static Eina_Bool _play_finished(void *data EINA_UNUSED, const Eo_Event *event)
212 const char *name; 212 const char *name;
213 Eo *in = (Eo *)eina_list_data_get(inputs); 213 Eo *in = (Eo *)eina_list_data_get(inputs);
214 214
215 eo_do(in, ecore_audio_obj_name_get(&name)); 215 ecore_audio_obj_name_get(in, &name);
216 printf("Start: %s\n", name); 216 printf("Start: %s\n", name);
217 eo_do(out, ret = ecore_audio_obj_out_input_attach(in)); 217 ret = ecore_audio_obj_out_input_attach(out, in);
218 if (!ret) 218 if (!ret)
219 printf("Could not attach input %s\n", name); 219 printf("Could not attach input %s\n", name);
220 } 220 }
@@ -266,13 +266,13 @@ main(int argc, const char *argv[])
266 { 266 {
267 if (!strncmp(val, "freq=", 5)) { 267 if (!strncmp(val, "freq=", 5)) {
268 freq = atoi(&val[5]); 268 freq = atoi(&val[5]);
269 eo_do(in, eo_key_data_set(ECORE_AUDIO_ATTR_TONE_FREQ, &freq)); 269 eo_key_data_set(in, ECORE_AUDIO_ATTR_TONE_FREQ, &freq);
270 } else if (!strncmp(val, "duration=", 9)) { 270 } else if (!strncmp(val, "duration=", 9)) {
271 eo_do(in, ecore_audio_obj_in_length_set(atof(&val[9]))); 271 ecore_audio_obj_in_length_set(in, atof(&val[9]));
272 } 272 }
273 } 273 }
274 free(tmp); 274 free(tmp);
275 eo_do(in, ecore_audio_obj_name_set(argv[i])); 275 ecore_audio_obj_name_set(in, argv[i]);
276 } 276 }
277 else 277 else
278 { 278 {
@@ -283,15 +283,15 @@ main(int argc, const char *argv[])
283 goto end; 283 goto end;
284 } 284 }
285 tmp = strdup(argv[i]); 285 tmp = strdup(argv[i]);
286 eo_do(in, ecore_audio_obj_name_set(basename(tmp))); 286 ecore_audio_obj_name_set(in, basename(tmp));
287 free(tmp); 287 free(tmp);
288 eo_do(in, ret = ecore_audio_obj_source_set(argv[i])); 288 ret = ecore_audio_obj_source_set(in, argv[i]);
289 if (!ret) { 289 if (!ret) {
290 printf("Could not set %s as input\n", argv[i]); 290 printf("Could not set %s as input\n", argv[i]);
291 continue; 291 continue;
292 } 292 }
293 } 293 }
294 eo_do(in, eo_event_callback_add(ECORE_AUDIO_EV_IN_STOPPED, _play_finished, NULL)); 294 eo_event_callback_add(in, ECORE_AUDIO_EV_IN_STOPPED, _play_finished, NULL);
295 inputs = eina_list_append(inputs, in); 295 inputs = eina_list_append(inputs, in);
296 } 296 }
297 297
@@ -302,13 +302,13 @@ main(int argc, const char *argv[])
302 if (!in) 302 if (!in)
303 return 1; 303 return 1;
304 304
305 eo_do(in, ecore_audio_obj_name_get(&name), 305 ecore_audio_obj_name_get(in, &name);
306 ecore_audio_obj_in_length_get(&length)); 306 ecore_audio_obj_in_length_get(in, &length);
307 307
308 printf("Start: %s (%0.2fs)\n", name, length); 308 printf("Start: %s (%0.2fs)\n", name, length);
309 309
310 out = eo_add(ECORE_AUDIO_OBJ_OUT_PULSE_CLASS, NULL); 310 out = eo_add(ECORE_AUDIO_OBJ_OUT_PULSE_CLASS, NULL);
311 eo_do(out, ret = ecore_audio_obj_out_input_attach(in)); 311 ret = ecore_audio_obj_out_input_attach(out, in);
312 if (!ret) 312 if (!ret)
313 printf("Could not attach input %s\n", name); 313 printf("Could not attach input %s\n", name);
314 314
diff --git a/src/examples/ecore/ecore_audio_to_ogg.c b/src/examples/ecore/ecore_audio_to_ogg.c
index 9d3162a..fceed59 100644
--- a/src/examples/ecore/ecore_audio_to_ogg.c
+++ b/src/examples/ecore/ecore_audio_to_ogg.c
@@ -20,10 +20,10 @@ static Eina_Bool _play_finished(void *data EINA_UNUSED, const Eo_Event *event)
20 const char *name; 20 const char *name;
21 Eo *out; 21 Eo *out;
22 22
23 eo_do(event->obj, ecore_audio_obj_name_get(&name)); 23 ecore_audio_obj_name_get(event->obj, &name);
24 printf("Done: %s\n", name); 24 printf("Done: %s\n", name);
25 25
26 eo_do(event->obj, ecore_audio_obj_in_output_get(&out)); 26 ecore_audio_obj_in_output_get(event->obj, &out);
27 eo_del(event->obj); 27 eo_del(event->obj);
28 eo_del(out); 28 eo_del(out);
29 29
@@ -50,18 +50,18 @@ main(int argc, char *argv[])
50 50
51 51
52 in = eo_add(ECORE_AUDIO_OBJ_IN_SNDFILE_CLASS, NULL); 52 in = eo_add(ECORE_AUDIO_OBJ_IN_SNDFILE_CLASS, NULL);
53 eo_do(in, ecore_audio_obj_name_set(basename(argv[1]))); 53 ecore_audio_obj_name_set(in, basename(argv[1]));
54 eo_do(in, ret = ecore_audio_obj_source_set(argv[1])); 54 ret = ecore_audio_obj_source_set(in, argv[1]);
55 if (!ret) { 55 if (!ret) {
56 printf("Could not set %s as input\n", argv[1]); 56 printf("Could not set %s as input\n", argv[1]);
57 eo_del(in); 57 eo_del(in);
58 return 1; 58 return 1;
59 } 59 }
60 60
61 eo_do(in, eo_event_callback_add(ECORE_AUDIO_EV_IN_STOPPED, _play_finished, NULL)); 61 eo_event_callback_add(in, ECORE_AUDIO_EV_IN_STOPPED, _play_finished, NULL);
62 62
63 out = eo_add(ECORE_AUDIO_OBJ_OUT_SNDFILE_CLASS, NULL); 63 out = eo_add(ECORE_AUDIO_OBJ_OUT_SNDFILE_CLASS, NULL);
64 eo_do(out, ret = ecore_audio_obj_source_set(argv[2])); 64 ret = ecore_audio_obj_source_set(out, argv[2]);
65 if (!ret) { 65 if (!ret) {
66 printf("Could not set %s as output\n", argv[2]); 66 printf("Could not set %s as output\n", argv[2]);
67 eo_del(in); 67 eo_del(in);
@@ -69,7 +69,7 @@ main(int argc, char *argv[])
69 return 1; 69 return 1;
70 } 70 }
71 71
72 eo_do(out, ret = ecore_audio_obj_out_input_attach(in)); 72 ret = ecore_audio_obj_out_input_attach(out, in);
73 if (!ret) { 73 if (!ret) {
74 printf("Could not attach input\n"); 74 printf("Could not attach input\n");
75 eo_del(out); 75 eo_del(out);
diff --git a/src/examples/ecore/ecore_idler_example.c b/src/examples/ecore/ecore_idler_example.c
index 681d95f..aa749d9 100644
--- a/src/examples/ecore/ecore_idler_example.c
+++ b/src/examples/ecore/ecore_idler_example.c
@@ -110,7 +110,7 @@ main(void)
110 ctxt.enterer = ecore_idle_enterer_add(_enterer_cb, &ctxt); 110 ctxt.enterer = ecore_idle_enterer_add(_enterer_cb, &ctxt);
111 ctxt.exiter = ecore_idle_exiter_add(_exiter_cb, &ctxt); 111 ctxt.exiter = ecore_idle_exiter_add(_exiter_cb, &ctxt);
112 ctxt.idler = ecore_idler_add(_idler_cb, &ctxt); 112 ctxt.idler = ecore_idler_add(_idler_cb, &ctxt);
113// ctxt.idler = eo_add(ECORE_IDLER_CLASS, NULL, ecore_idler_constructor(_idler_cb, &ctxt)); 113// ctxt.idler = eo_add(ECORE_IDLER_CLASS, NULL, ecore_idler_constructor(eoid, _idler_cb, &ctxt));
114 ctxt.handler = ecore_event_handler_add(_event_type, 114 ctxt.handler = ecore_event_handler_add(_event_type,
115 _event_handler_cb, 115 _event_handler_cb,
116 &ctxt); 116 &ctxt);
diff --git a/src/examples/ecore/ecore_poller_example.c b/src/examples/ecore/ecore_poller_example.c
index c3d8f69..e60c20a 100644
--- a/src/examples/ecore/ecore_poller_example.c
+++ b/src/examples/ecore/ecore_poller_example.c
@@ -48,12 +48,9 @@ main(void)
48 poller2 = ecore_poller_add(ECORE_POLLER_CORE, 8, _poller_print_cb, str2); 48 poller2 = ecore_poller_add(ECORE_POLLER_CORE, 8, _poller_print_cb, str2);
49 poller3 = ecore_poller_add(ECORE_POLLER_CORE, 30, _poller_quit_cb, str3); 49 poller3 = ecore_poller_add(ECORE_POLLER_CORE, 30, _poller_quit_cb, str3);
50 50
51// poller1 = eo_add(ECORE_POLLER_CLASS, NULL, 51// poller1 = eo_add(ECORE_POLLER_CLASS, NULL, // ecore_poller_constructor(eoid, ECORE_POLLER_CORE, 4, _poller_print_cb, str1));
52// ecore_poller_constructor(ECORE_POLLER_CORE, 4, _poller_print_cb, str1)); 52// poller2 = eo_add(ECORE_POLLER_CLASS, NULL, // ecore_poller_constructor(eoid, ECORE_POLLER_CORE, 8, _poller_print_cb, str2));
53// poller2 = eo_add(ECORE_POLLER_CLASS, NULL, 53// poller3 = eo_add(ECORE_POLLER_CLASS, NULL, // ecore_poller_constructor(eoid, ECORE_POLLER_CORE, 20, _poller_quit_cb, str3));
54// ecore_poller_constructor(ECORE_POLLER_CORE, 8, _poller_print_cb, str2));
55// poller3 = eo_add(ECORE_POLLER_CLASS, NULL,
56// ecore_poller_constructor(ECORE_POLLER_CORE, 20, _poller_quit_cb, str3));
57 54
58 55
59 ecore_main_loop_begin(); 56 ecore_main_loop_begin();
@@ -61,7 +58,7 @@ main(void)
61 printf("changing poller2 interval to 16\n"); 58 printf("changing poller2 interval to 16\n");
62 59
63 ecore_poller_poller_interval_set(poller2, 16); 60 ecore_poller_poller_interval_set(poller2, 16);
64// eo_do(poller2, ecore_poller_interval_set(16, NULL)); 61// ecore_poller_interval_set(poller2, 16, NULL);
65 ecore_main_loop_begin(); 62 ecore_main_loop_begin();
66 63
67// eo_unref(poller1); 64// eo_unref(poller1);
diff --git a/src/examples/edje/edje-text.c b/src/examples/edje/edje-text.c
index 7fc830c..21efb05 100644
--- a/src/examples/edje/edje-text.c
+++ b/src/examples/edje/edje-text.c
@@ -55,7 +55,7 @@ _on_mouse_down(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *o EINA_
55 fprintf(stderr, "Setting lang of this edje object to '%s'\n", lang[lang_idx]); 55 fprintf(stderr, "Setting lang of this edje object to '%s'\n", lang[lang_idx]);
56 env = getenv("LANGUAGE"); 56 env = getenv("LANGUAGE");
57 setenv("LANGUAGE", lang[lang_idx], 1); 57 setenv("LANGUAGE", lang[lang_idx], 1);
58 eo_do(o, edje_obj_language_set(lang[lang_idx])); 58 edje_obj_language_set(o, lang[lang_idx]);
59 setenv("LANGUAGE", env, 1); 59 setenv("LANGUAGE", env, 1);
60} 60}
61 61
@@ -108,7 +108,7 @@ main(int argc EINA_UNUSED, char *argv[] EINA_UNUSED)
108 evas_object_resize(edje_obj, WIDTH - 40, HEIGHT - 40); 108 evas_object_resize(edje_obj, WIDTH - 40, HEIGHT - 40);
109 evas_object_show(edje_obj); 109 evas_object_show(edje_obj);
110 setenv("LANGUAGE", "en_IN", 1); 110 setenv("LANGUAGE", "en_IN", 1);
111 eo_do(edje_obj, edje_obj_language_set("en_IN")); 111 edje_obj_language_set(edje_obj, "en_IN");
112 edje_object_text_change_cb_set(edje_obj, _on_text_change, NULL); 112 edje_object_text_change_cb_set(edje_obj, _on_text_change, NULL);
113 edje_object_part_text_set(edje_obj, "part_two", "<b>Click here"); 113 edje_object_part_text_set(edje_obj, "part_two", "<b>Click here");
114 edje_object_part_text_select_allow_set(edje_obj, "part_two", EINA_TRUE); 114 edje_object_part_text_select_allow_set(edje_obj, "part_two", EINA_TRUE);
@@ -123,7 +123,7 @@ main(int argc EINA_UNUSED, char *argv[] EINA_UNUSED)
123 evas_object_move(edje_obj_one, 0, 50); 123 evas_object_move(edje_obj_one, 0, 50);
124 evas_object_resize(edje_obj_one, WIDTH - 40, HEIGHT - 40); 124 evas_object_resize(edje_obj_one, WIDTH - 40, HEIGHT - 40);
125 evas_object_show(edje_obj_one); 125 evas_object_show(edje_obj_one);
126 eo_do(edje_obj_one, edje_obj_language_set("en_IN")); 126 edje_obj_language_set(edje_obj_one, "en_IN");
127 edje_object_text_change_cb_set(edje_obj_one, _on_text_change, NULL); 127 edje_object_text_change_cb_set(edje_obj_one, _on_text_change, NULL);
128 edje_object_part_text_set(edje_obj_one, "part_two", "<b>Click here"); 128 edje_object_part_text_set(edje_obj_one, "part_two", "<b>Click here");
129 edje_object_part_text_select_allow_set(edje_obj_one, "part_two", EINA_TRUE); 129 edje_object_part_text_select_allow_set(edje_obj_one, "part_two", EINA_TRUE);
diff --git a/src/examples/eldbus/dbusmodel.c b/src/examples/eldbus/dbusmodel.c
index a3e77e3..b34799b 100644
--- a/src/examples/eldbus/dbusmodel.c
+++ b/src/examples/eldbus/dbusmodel.c
@@ -29,9 +29,8 @@ _event_interface_load_status_cb(void *data EINA_UNUSED, Eo *model,
29 if (EFL_MODEL_LOAD_STATUS_LOADED != actual_load->status) 29 if (EFL_MODEL_LOAD_STATUS_LOADED != actual_load->status)
30 return EINA_TRUE; 30 return EINA_TRUE;
31 31
32 eo_do(model, 32 name = eldbus_model_proxy_name_get(model);
33 name = eldbus_model_proxy_name_get(), 33 efl_model_properties_get(model, &properties_list);
34 efl_model_properties_get(&properties_list));
35 34
36 printf(" -> %s\n", name); 35 printf(" -> %s\n", name);
37 if (eina_array_count(properties_list)) 36 if (eina_array_count(properties_list))
@@ -39,7 +38,7 @@ _event_interface_load_status_cb(void *data EINA_UNUSED, Eo *model,
39 38
40 EINA_ARRAY_ITER_NEXT(properties_list, i, property, iterator) 39 EINA_ARRAY_ITER_NEXT(properties_list, i, property, iterator)
41 { 40 {
42 eo_do(model, efl_model_property_get(property, &property_value)); 41 efl_model_property_get(model, property, &property_value);
43 if (property_value) 42 if (property_value)
44 { 43 {
45 prop_str = eina_value_to_string(property_value); 44 prop_str = eina_value_to_string(property_value);
@@ -70,7 +69,7 @@ _event_load_status_cb(void *data EINA_UNUSED, Eo *model,
70 if (EFL_MODEL_LOAD_STATUS_LOADED != actual_load->status) 69 if (EFL_MODEL_LOAD_STATUS_LOADED != actual_load->status)
71 return EINA_TRUE; 70 return EINA_TRUE;
72 71
73 eo_do(model, efl_model_children_count_get(&children_count)); 72 efl_model_children_count_get(model, &children_count);
74 if (children_count == 0) 73 if (children_count == 0)
75 { 74 {
76 printf("Don't find Interfaces\n"); 75 printf("Don't find Interfaces\n");
@@ -78,12 +77,12 @@ _event_load_status_cb(void *data EINA_UNUSED, Eo *model,
78 return EINA_FALSE; 77 return EINA_FALSE;
79 } 78 }
80 79
81 eo_do(model, efl_model_children_slice_get(0, 0, &accessor)); 80 efl_model_children_slice_get(model, 0, 0, &accessor);
82 printf("\nInterfaces:\n"); 81 printf("\nInterfaces:\n");
83 EINA_ACCESSOR_FOREACH(accessor, i, child) 82 EINA_ACCESSOR_FOREACH(accessor, i, child)
84 { 83 {
85 eo_do(child, eo_event_callback_add(EFL_MODEL_BASE_EVENT_LOAD_STATUS, _event_interface_load_status_cb, NULL)); 84 eo_event_callback_add(child, EFL_MODEL_BASE_EVENT_LOAD_STATUS, _event_interface_load_status_cb, NULL);
86 eo_do(child, efl_model_load()); 85 efl_model_load(child);
87 } 86 }
88 87
89 return EINA_FALSE; 88 return EINA_FALSE;
@@ -103,17 +102,14 @@ main(int argc, char **argv EINA_UNUSED)
103 if (argc > 1) bus = argv[1]; 102 if (argc > 1) bus = argv[1];
104 if (argc > 2) path = argv[2]; 103 if (argc > 2) path = argv[2];
105 104
106 root = eo_add_ref(ELDBUS_MODEL_OBJECT_CLASS, NULL, 105 root = eo_add_ref(ELDBUS_MODEL_OBJECT_CLASS, NULL, eldbus_model_object_constructor(eoid, ELDBUS_CONNECTION_TYPE_SESSION, NULL, EINA_FALSE, bus, path));
107 eldbus_model_object_constructor(ELDBUS_CONNECTION_TYPE_SESSION,
108 NULL, EINA_FALSE, bus, path));
109 106
110 eo_do(root, 107 eo_event_callback_add(root, EFL_MODEL_BASE_EVENT_LOAD_STATUS, _event_load_status_cb, NULL);
111 eo_event_callback_add(EFL_MODEL_BASE_EVENT_LOAD_STATUS, _event_load_status_cb, NULL), 108 efl_model_load(root);
112 efl_model_load());
113 109
114 ecore_main_loop_begin(); 110 ecore_main_loop_begin();
115 111
116 eo_do(root, eo_event_callback_del(EFL_MODEL_BASE_EVENT_LOAD_STATUS, _event_load_status_cb, NULL)); 112 eo_event_callback_del(root, EFL_MODEL_BASE_EVENT_LOAD_STATUS, _event_load_status_cb, NULL);
117 113
118 eo_unref(root); 114 eo_unref(root);
119} 115}
diff --git a/src/examples/emotion/emotion_basic_example.c b/src/examples/emotion/emotion_basic_example.c
index 2e7abea..9675f6b 100644
--- a/src/examples/emotion/emotion_basic_example.c
+++ b/src/examples/emotion/emotion_basic_example.c
@@ -65,8 +65,8 @@ main(int argc, const char *argv[])
65 em = emotion_object_add(e); 65 em = emotion_object_add(e);
66 emotion_object_init(em, NULL); 66 emotion_object_init(em, NULL);
67 67
68 eo_do(em, eo_event_callback_add 68 eo_event_callback_add
69 (EMOTION_OBJECT_EVENT_PLAYBACK_STARTED, _playback_started_cb, NULL)); 69 (em, EMOTION_OBJECT_EVENT_PLAYBACK_STARTED, _playback_started_cb, NULL);
70 70
71 emotion_object_file_set(em, filename); 71 emotion_object_file_set(em, filename);
72 72
diff --git a/src/examples/emotion/emotion_border_example.c b/src/examples/emotion/emotion_border_example.c
index 22eca25..ea3c07d 100644
--- a/src/examples/emotion/emotion_border_example.c
+++ b/src/examples/emotion/emotion_border_example.c
@@ -33,8 +33,7 @@ _create_emotion_object(Evas *e)
33 33
34 emotion_object_init(em, "gstreamer1"); 34 emotion_object_init(em, "gstreamer1");
35 35
36 eo_do(em, eo_event_callback_add( 36 eo_event_callback_add(em, EMOTION_OBJECT_EVENT_PLAYBACK_STARTED, _playback_started_cb, NULL);
37 EMOTION_OBJECT_EVENT_PLAYBACK_STARTED, _playback_started_cb, NULL));
38 37
39 return em; 38 return em;
40} 39}
@@ -241,7 +240,7 @@ main(int argc, const char *argv[])
241 240
242 ecore_evas_data_set(ee, "emotion", em); 241 ecore_evas_data_set(ee, "emotion", em);
243 242
244 eo_do(em, eo_event_callback_array_add(emotion_object_example_callbacks, NULL)); 243 eo_event_callback_array_add(em, emotion_object_example_callbacks, NULL);
245 244
246 evas_object_event_callback_add(bg, EVAS_CALLBACK_KEY_DOWN, _on_key_down, em); 245 evas_object_event_callback_add(bg, EVAS_CALLBACK_KEY_DOWN, _on_key_down, em);
247 evas_object_focus_set(bg, EINA_TRUE); 246 evas_object_focus_set(bg, EINA_TRUE);
diff --git a/src/examples/emotion/emotion_generic_example.c b/src/examples/emotion/emotion_generic_example.c
index 6ea7dd9..cdbfe6e 100644
--- a/src/examples/emotion/emotion_generic_example.c
+++ b/src/examples/emotion/emotion_generic_example.c
@@ -45,10 +45,10 @@ _create_emotion_object(Evas *e)
45 45
46 emotion_object_init(em, "generic"); 46 emotion_object_init(em, "generic");
47 47
48 eo_do(em, eo_event_callback_add 48 eo_event_callback_add
49 (EMOTION_OBJECT_EVENT_PLAYBACK_STARTED, _playback_started_cb, NULL)); 49 (em, EMOTION_OBJECT_EVENT_PLAYBACK_STARTED, _playback_started_cb, NULL);
50 eo_do(em, eo_event_callback_add 50 eo_event_callback_add
51 (EMOTION_OBJECT_EVENT_PLAYBACK_FINISHED, _playback_stopped_cb, NULL)); 51 (em, EMOTION_OBJECT_EVENT_PLAYBACK_FINISHED, _playback_stopped_cb, NULL);
52 52
53 return em; 53 return em;
54} 54}
@@ -227,7 +227,7 @@ main(int argc, const char *argv[])
227 evas_object_resize(em, WIDTH, HEIGHT); 227 evas_object_resize(em, WIDTH, HEIGHT);
228 evas_object_show(em); 228 evas_object_show(em);
229 229
230 eo_do(em, eo_event_callback_array_add(emotion_object_example_callbacks, NULL)); 230 eo_event_callback_array_add(em, emotion_object_example_callbacks, NULL);
231 231
232 evas_object_event_callback_add(bg, EVAS_CALLBACK_KEY_DOWN, _on_key_down, em); 232 evas_object_event_callback_add(bg, EVAS_CALLBACK_KEY_DOWN, _on_key_down, em);
233 evas_object_focus_set(bg, EINA_TRUE); 233 evas_object_focus_set(bg, EINA_TRUE);
diff --git a/src/examples/emotion/emotion_generic_subtitle_example.c b/src/examples/emotion/emotion_generic_subtitle_example.c
index 03b8aab..1d32f77 100644
--- a/src/examples/emotion/emotion_generic_subtitle_example.c
+++ b/src/examples/emotion/emotion_generic_subtitle_example.c
@@ -80,8 +80,8 @@ main(int argc, const char *argv[])
80 if (subtitle_filename) 80 if (subtitle_filename)
81 emotion_object_video_subtitle_file_set(em, subtitle_filename); 81 emotion_object_video_subtitle_file_set(em, subtitle_filename);
82 82
83 eo_do(em, eo_event_callback_add 83 eo_event_callback_add
84 (EMOTION_OBJECT_EVENT_PLAYBACK_STARTED, _playback_started_cb, NULL)); 84 (em, EMOTION_OBJECT_EVENT_PLAYBACK_STARTED, _playback_started_cb, NULL);
85 85
86 emotion_object_file_set(em, filename); 86 emotion_object_file_set(em, filename);
87 87
diff --git a/src/examples/emotion/emotion_signals_example.c b/src/examples/emotion/emotion_signals_example.c
index 3c56c40..b84c47d 100644
--- a/src/examples/emotion/emotion_signals_example.c
+++ b/src/examples/emotion/emotion_signals_example.c
@@ -68,8 +68,7 @@ _position_update_cb(void *data EINA_UNUSED,
68 Eo *o, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED) 68 Eo *o, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
69{ 69{
70 printf(">>> Emotion object first position update.\n"); 70 printf(">>> Emotion object first position update.\n");
71 eo_do(o, eo_event_callback_del(EMOTION_OBJECT_EVENT_POSITION_UPDATE, 71 eo_event_callback_del(o, EMOTION_OBJECT_EVENT_POSITION_UPDATE, _position_update_cb, NULL);
72 _position_update_cb, NULL));
73 _display_info(o); 72 _display_info(o);
74 73
75 return EINA_TRUE; 74 return EINA_TRUE;
@@ -80,8 +79,7 @@ _frame_decode_cb(void *data EINA_UNUSED,
80 Eo *o, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED) 79 Eo *o, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
81{ 80{
82 printf(">>> Emotion object first frame decode.\n"); 81 printf(">>> Emotion object first frame decode.\n");
83 eo_do(o, eo_event_callback_del(EMOTION_OBJECT_EVENT_FRAME_DECODE, 82 eo_event_callback_del(o, EMOTION_OBJECT_EVENT_FRAME_DECODE, _frame_decode_cb, NULL);
84 _frame_decode_cb, NULL));
85 _display_info(o); 83 _display_info(o);
86 84
87 return EINA_TRUE; 85 return EINA_TRUE;
@@ -121,8 +119,8 @@ static const Eo_Callback_Array_Item emotion_object_example_callbacks[] = {
121static void 119static void
122_setup_emotion_callbacks(Evas_Object *o) 120_setup_emotion_callbacks(Evas_Object *o)
123{ 121{
124 eo_do(o, eo_event_callback_add 122 eo_event_callback_add
125 (EMOTION_OBJECT_EVENT_PLAYBACK_STARTED, _playback_started_cb, NULL)); 123 (o, EMOTION_OBJECT_EVENT_PLAYBACK_STARTED, _playback_started_cb, NULL);
126} 124}
127 125
128int 126int
diff --git a/src/examples/eo/evas/evas_elw_box.c b/src/examples/eo/evas/evas_elw_box.c
index 96df326..c352027 100644
--- a/src/examples/eo/evas/evas_elw_box.c
+++ b/src/examples/eo/evas/evas_elw_box.c
@@ -30,7 +30,7 @@ _pack_end(Eo *obj EINA_UNUSED, void *class_data, va_list *list)
30static void 30static void
31_constructor(Eo *obj, void *class_data, va_list *list EINA_UNUSED) 31_constructor(Eo *obj, void *class_data, va_list *list EINA_UNUSED)
32{ 32{
33 eo_do_super(obj, MY_CLASS, eo_constructor()); 33 eo_constructor(eo_super(obj, MY_CLASS));
34 34
35 Widget_Data *wd = class_data; 35 Widget_Data *wd = class_data;
36 36
diff --git a/src/examples/eo/evas/evas_elw_boxedbutton.c b/src/examples/eo/evas/evas_elw_boxedbutton.c
index 44fc260..6284277 100644
--- a/src/examples/eo/evas/evas_elw_boxedbutton.c
+++ b/src/examples/eo/evas/evas_elw_boxedbutton.c
@@ -20,14 +20,14 @@ typedef struct
20static void 20static void
21_constructor(Eo *obj, void *class_data EINA_UNUSED, va_list *list EINA_UNUSED) 21_constructor(Eo *obj, void *class_data EINA_UNUSED, va_list *list EINA_UNUSED)
22{ 22{
23 eo_do_super(obj, MY_CLASS, eo_constructor()); 23 eo_constructor(eo_super(obj, MY_CLASS));
24 24
25 Eo *bt = eo_add(ELW_BUTTON_CLASS, obj); 25 Eo *bt = eo_add(ELW_BUTTON_CLASS, obj);
26 eo_do(obj, eo_composite_attach(bt)); 26 eo_composite_attach(obj, bt);
27 eo_do(bt, eo_event_callback_forwarder_add(EV_CLICKED, obj)); 27 eo_event_callback_forwarder_add(bt, EV_CLICKED, obj);
28 eo_do(bt, exevas_obj_visibility_set(EINA_TRUE)); 28 exevas_obj_visibility_set(bt, EINA_TRUE);
29 29
30 eo_do(obj, elw_box_pack_end(bt)); 30 elw_box_pack_end(obj, bt);
31 eo_unref(bt); 31 eo_unref(bt);
32} 32}
33 33
diff --git a/src/examples/eo/evas/evas_elw_button.c b/src/examples/eo/evas/evas_elw_button.c
index 7067171..7dee7bb 100644
--- a/src/examples/eo/evas/evas_elw_button.c
+++ b/src/examples/eo/evas/evas_elw_button.c
@@ -28,7 +28,7 @@ _position_set(Eo *obj, void *class_data EINA_UNUSED, va_list *list)
28 x = va_arg(*list, Evas_Coord); 28 x = va_arg(*list, Evas_Coord);
29 y = va_arg(*list, Evas_Coord); 29 y = va_arg(*list, Evas_Coord);
30 printf("But set position %d,%d\n", x, y); 30 printf("But set position %d,%d\n", x, y);
31 eo_do_super(obj, MY_CLASS, exevas_obj_position_set(x, y)); 31 exevas_obj_position_set(eo_super(obj, MY_CLASS), x, y);
32} 32}
33 33
34static void 34static void
@@ -46,13 +46,13 @@ _btn_clicked(void *data, Evas_Object *evas_obj, void *event_info)
46 (void) evas_obj; 46 (void) evas_obj;
47 (void) event_info; 47 (void) event_info;
48 Eo *obj = data; 48 Eo *obj = data;
49 eo_do(obj, eo_event_callback_call(EV_CLICKED, NULL, NULL)); 49 eo_event_callback_call(obj, EV_CLICKED, NULL, NULL);
50} 50}
51 51
52static void 52static void
53_constructor(Eo *obj, void *class_data, va_list *list EINA_UNUSED) 53_constructor(Eo *obj, void *class_data, va_list *list EINA_UNUSED)
54{ 54{
55 eo_do_super(obj, MY_CLASS, eo_constructor()); 55 eo_constructor(eo_super(obj, MY_CLASS));
56 56
57 Widget_Data *wd = class_data; 57 Widget_Data *wd = class_data;
58 58
@@ -68,7 +68,7 @@ _constructor(Eo *obj, void *class_data, va_list *list EINA_UNUSED)
68static void 68static void
69_destructor(Eo *obj, void *class_data EINA_UNUSED, va_list *list EINA_UNUSED) 69_destructor(Eo *obj, void *class_data EINA_UNUSED, va_list *list EINA_UNUSED)
70{ 70{
71 eo_do_super(obj, MY_CLASS, eo_destructor()); 71 eo_destructor(eo_super(obj, MY_CLASS));
72 72
73 //Widget_Data *wd = class_data; 73 //Widget_Data *wd = class_data;
74 /* FIXME: Commented out because it's automatically done because our tree 74 /* FIXME: Commented out because it's automatically done because our tree
diff --git a/src/examples/eo/evas/evas_elw_win.c b/src/examples/eo/evas/evas_elw_win.c
index e5a917d..d4e830f 100644
--- a/src/examples/eo/evas/evas_elw_win.c
+++ b/src/examples/eo/evas/evas_elw_win.c
@@ -29,7 +29,7 @@ my_win_del(void *data, Evas_Object *obj, void *event_info)
29static void 29static void
30_constructor(Eo *obj, void *class_data, va_list *list EINA_UNUSED) 30_constructor(Eo *obj, void *class_data, va_list *list EINA_UNUSED)
31{ 31{
32 eo_do_super(obj, MY_CLASS, eo_constructor()); 32 eo_constructor(eo_super(obj, MY_CLASS));
33 33
34 Widget_Data *wd = class_data; 34 Widget_Data *wd = class_data;
35 35
diff --git a/src/examples/eo/evas/evas_evas_obj.c b/src/examples/eo/evas/evas_evas_obj.c
index 768d3d4..1a26ddf 100644
--- a/src/examples/eo/evas/evas_evas_obj.c
+++ b/src/examples/eo/evas/evas_evas_obj.c
@@ -82,18 +82,18 @@ _child_add(Eo *obj, void *class_data, va_list *list)
82static void 82static void
83_constructor(Eo *obj, void *class_data EINA_UNUSED, va_list *list EINA_UNUSED) 83_constructor(Eo *obj, void *class_data EINA_UNUSED, va_list *list EINA_UNUSED)
84{ 84{
85 eo_do_super(obj, MY_CLASS, eo_constructor()); 85 eo_constructor(eo_super(obj, MY_CLASS));
86 86
87 /* Add type check. */ 87 /* Add type check. */
88 Eo *parent = eo_parent_get(obj); 88 Eo *parent = eo_parent_get(obj);
89 if (parent) 89 if (parent)
90 eo_do(parent, exevas_obj_child_add(obj)); 90 exevas_obj_child_add(parent, obj);
91} 91}
92 92
93static void 93static void
94_destructor(Eo *obj, void *class_data, va_list *list EINA_UNUSED) 94_destructor(Eo *obj, void *class_data, va_list *list EINA_UNUSED)
95{ 95{
96 eo_do_super(obj, MY_CLASS, eo_destructor()); 96 eo_destructor(eo_super(obj, MY_CLASS));
97 97
98 Widget_Data *wd = class_data; 98 Widget_Data *wd = class_data;
99 99
diff --git a/src/examples/eo/evas/evas_evas_obj.h b/src/examples/eo/evas/evas_evas_obj.h
index 61cf720..5490c69 100644
--- a/src/examples/eo/evas/evas_evas_obj.h
+++ b/src/examples/eo/evas/evas_evas_obj.h
@@ -76,7 +76,7 @@ static inline Evas_Object *
76eo_evas_object_get(const Eo *obj) 76eo_evas_object_get(const Eo *obj)
77{ 77{
78 void *data; 78 void *data;
79 eo_do((Eo *) obj, eo_key_data_get(EXEVAS_OBJ_STR, &data)); 79 eo_key_data_get((Eo *) obj, EXEVAS_OBJ_STR, &data);
80 return data; 80 return data;
81} 81}
82 82
@@ -84,7 +84,7 @@ eo_evas_object_get(const Eo *obj)
84static inline void 84static inline void
85eo_evas_object_set(Eo *obj, Evas_Object *evas_obj) 85eo_evas_object_set(Eo *obj, Evas_Object *evas_obj)
86{ 86{
87 eo_do(obj, eo_key_data_set(EXEVAS_OBJ_STR, evas_obj)); 87 eo_key_data_set(obj, EXEVAS_OBJ_STR, evas_obj);
88} 88}
89 89
90#endif 90#endif
diff --git a/src/examples/eo/evas/evas_test.c b/src/examples/eo/evas/evas_test.c
index dca7a94..50691e6 100644
--- a/src/examples/eo/evas/evas_test.c
+++ b/src/examples/eo/evas/evas_test.c
@@ -32,27 +32,28 @@ main(int argc, char *argv[])
32 eo_init(); 32 eo_init();
33 33
34 Eo *win = eo_add(ELW_WIN_CLASS, NULL); 34 Eo *win = eo_add(ELW_WIN_CLASS, NULL);
35 eo_do(win, exevas_obj_size_set(winw, winh), exevas_obj_visibility_set(EINA_TRUE)); 35 exevas_obj_size_set(win, winw, winh);
36 exevas_obj_visibility_set(win, EINA_TRUE);
36 37
37 Eo *bt = eo_add(ELW_BUTTON_CLASS, win); 38 Eo *bt = eo_add(ELW_BUTTON_CLASS, win);
38 eo_do(bt, exevas_obj_position_set(25, 25), 39 exevas_obj_position_set(bt, 25, 25);
39 exevas_obj_size_set(50, 50), 40 exevas_obj_size_set(bt, 50, 50);
40 exevas_obj_color_set(255, 0, 0, 255), 41 exevas_obj_color_set(bt, 255, 0, 0, 255);
41 elw_button_text_set("Click"), 42 elw_button_text_set(bt, "Click");
42 exevas_obj_visibility_set(EINA_TRUE)); 43 exevas_obj_visibility_set(bt, EINA_TRUE);
43 eo_do(bt, eo_event_callback_add(EV_CLICKED, _btn_clicked_cb, "btn")); 44 eo_event_callback_add(bt, EV_CLICKED, _btn_clicked_cb, "btn");
44 45
45 int r, g, b, a; 46 int r, g, b, a;
46 eo_do(bt, exevas_obj_color_get(&r, &g, &b, &a)); 47 exevas_obj_color_get(bt, &r, &g, &b, &a);
47 printf("RGBa(%d, %d, %d, %d)\n", r, g, b, a); 48 printf("RGBa(%d, %d, %d, %d)\n", r, g, b, a);
48 49
49 Eo *bx = eo_add(ELW_BOXEDBUTTON_CLASS, win); 50 Eo *bx = eo_add(ELW_BOXEDBUTTON_CLASS, win);
50 eo_do(bx, exevas_obj_position_set(100, 100), 51 exevas_obj_position_set(bx, 100, 100);
51 exevas_obj_size_set(70, 70), 52 exevas_obj_size_set(bx, 70, 70);
52 exevas_obj_color_set(0, 0, 255, 255), 53 exevas_obj_color_set(bx, 0, 0, 255, 255);
53 elw_button_text_set("Click2"), 54 elw_button_text_set(bx, "Click2");
54 exevas_obj_visibility_set(EINA_TRUE)); 55 exevas_obj_visibility_set(bx, EINA_TRUE);
55 eo_do(bx, eo_event_callback_add(EV_CLICKED, _btn_clicked_cb, "bxedbtn")); 56 eo_event_callback_add(bx, EV_CLICKED, _btn_clicked_cb, "bxedbtn");
56 57
57 elm_run(); 58 elm_run();
58 59
diff --git a/src/examples/eo/isa/eo_isa_mixin.c b/src/examples/eo/isa/eo_isa_mixin.c
index ce45601..2a5c13b 100644
--- a/src/examples/eo/isa/eo_isa_mixin.c
+++ b/src/examples/eo/isa/eo_isa_mixin.c
@@ -13,7 +13,7 @@ _a_square_get(Eo *obj, void *class_data EINA_UNUSED)
13{ 13{
14 int a; 14 int a;
15 15
16 eo_do(obj, a = simple_a_get()); 16 a = simple_a_get(obj);
17 printf("%s %s\n", eo_class_name_get(MY_CLASS), __func__); 17 printf("%s %s\n", eo_class_name_get(MY_CLASS), __func__);
18 return a * a; 18 return a * a;
19} 19}
diff --git a/src/examples/eo/simple/simple_main.c b/src/examples/eo/simple/simple_main.c
index 2ee7ee4..fc6d060 100644
--- a/src/examples/eo/simple/simple_main.c
+++ b/src/examples/eo/simple/simple_main.c
@@ -14,13 +14,13 @@ main(int argc, char *argv[])
14 14
15 Eo *obj = eo_add(SIMPLE_CLASS, NULL); 15 Eo *obj = eo_add(SIMPLE_CLASS, NULL);
16 16
17 eo_do(obj, simple_a_set(4)); 17 simple_a_set(obj, 4);
18 18
19 int a = 0, a2 = 0, a3 = 0; 19 int a = 0, a2 = 0, a3 = 0;
20 20
21 eo_do(obj, a = simple_a_get(), 21 a = simple_a_get(obj);
22 a3 = interface_a_power_3_get(), 22 a3 = interface_a_power_3_get(obj);
23 a2 = mixin_a_square_get()); 23 a2 = mixin_a_square_get(obj);
24 24
25 printf("Got %d %d %d\n", a, a2, a3); 25 printf("Got %d %d %d\n", a, a2, a3);
26 26
diff --git a/src/examples/eo/simple/simple_mixin.c b/src/examples/eo/simple/simple_mixin.c
index 5831ce0..db5b90e 100644
--- a/src/examples/eo/simple/simple_mixin.c
+++ b/src/examples/eo/simple/simple_mixin.c
@@ -13,7 +13,7 @@ _a_square_get(Eo *obj, void *class_data EINA_UNUSED)
13{ 13{
14 int a; 14 int a;
15 15
16 eo_do(obj, a = simple_a_get()); 16 a = simple_a_get(obj);
17 printf("%s %s\n", eo_class_name_get(MY_CLASS), __func__); 17 printf("%s %s\n", eo_class_name_get(MY_CLASS), __func__);
18 return a * a; 18 return a * a;
19} 19}
diff --git a/src/examples/eolian_cxx/colourable.c b/src/examples/eolian_cxx/colourable.c
index 655d63c..0c132c4 100644
--- a/src/examples/eolian_cxx/colourable.c
+++ b/src/examples/eolian_cxx/colourable.c
@@ -35,7 +35,7 @@ _colourable_eo_base_constructor(Eo *obj, Colourable_Data *self EINA_UNUSED)
35 = eina_log_domain_register("colourable", EINA_COLOR_BLUE); 35 = eina_log_domain_register("colourable", EINA_COLOR_BLUE);
36 } 36 }
37 DBG("_colourable_constructor(%p, %p)\n", obj, MY_CLASS); 37 DBG("_colourable_constructor(%p, %p)\n", obj, MY_CLASS);
38 return eo_do_super_ret(obj, MY_CLASS, obj, eo_constructor()); 38 return eo_constructor(eo_super(obj, MY_CLASS));
39} 39}
40 40
41void 41void
@@ -47,7 +47,7 @@ _colourable_eo_base_destructor(Eo *obj, Colourable_Data *self EINA_UNUSED)
47 _colourable_impl_logdomain = 0; 47 _colourable_impl_logdomain = 0;
48 } 48 }
49 DBG("_colourable_destructor()\n"); 49 DBG("_colourable_destructor()\n");
50 eo_do_super(obj, MY_CLASS, eo_destructor()); 50 eo_destructor(eo_super(obj, MY_CLASS));
51} 51}
52 52
53void 53void
@@ -63,7 +63,7 @@ _colourable_rgb_24bits_constructor(Eo *obj, Colourable_Data *self, int rgb)
63 self->g = (rgb & 0x0000ff00) >> 8; 63 self->g = (rgb & 0x0000ff00) >> 8;
64 self->b = rgb & 0x000000ff; 64 self->b = rgb & 0x000000ff;
65 DBG("_colourable_rgb_24bits_constructor(0x%.6x)\n", (int)rgb); 65 DBG("_colourable_rgb_24bits_constructor(0x%.6x)\n", (int)rgb);
66 eo_do_super(obj, MY_CLASS, eo_constructor()); 66 eo_constructor(eo_super(obj, MY_CLASS));
67} 67}
68 68
69void 69void
diff --git a/src/examples/eolian_cxx/colourablesquare.c b/src/examples/eolian_cxx/colourablesquare.c
index 87bc419..0804d36 100644
--- a/src/examples/eolian_cxx/colourablesquare.c
+++ b/src/examples/eolian_cxx/colourablesquare.c
@@ -35,7 +35,7 @@ _colourablesquare_size_constructor(Eo *obj, ColourableSquare_Data *self, int siz
35 } 35 }
36 self->size = size; 36 self->size = size;
37 DBG("_colourablesquare_constructor(%d)\n", size); 37 DBG("_colourablesquare_constructor(%d)\n", size);
38 eo_do_super(obj, MY_CLASS, eo_constructor()); 38 eo_constructor(eo_super(obj, MY_CLASS));
39} 39}
40 40
41static int 41static int
diff --git a/src/examples/evas/evas-3d-aabb.c b/src/examples/evas/evas-3d-aabb.c
index c8d906c..d02668b 100644
--- a/src/examples/evas/evas-3d-aabb.c
+++ b/src/examples/evas/evas-3d-aabb.c
@@ -57,7 +57,7 @@ _animate_scene(void *data)
57{ 57{
58 static int frame = 0; 58 static int frame = 0;
59 59
60 eo_do((Evas_Canvas3D_Node *)data, evas_canvas3d_node_mesh_frame_set(mesh, frame)); 60 evas_canvas3d_node_mesh_frame_set((Evas_Canvas3D_Node *)data, mesh, frame);
61 61
62 _redraw_aabb(); 62 _redraw_aabb();
63 63
@@ -84,22 +84,22 @@ _on_key_down(void *data, Evas *e EINA_UNUSED, Evas_Object *eo EINA_UNUSED, void
84 { 84 {
85 case 1: 85 case 1:
86 { 86 {
87 eo_do(node, evas_canvas3d_node_orientation_angle_axis_set(90, 1.0, 0.0, 0.0)); 87 evas_canvas3d_node_orientation_angle_axis_set(node, 90, 1.0, 0.0, 0.0);
88 break; 88 break;
89 } 89 }
90 case 2: 90 case 2:
91 { 91 {
92 eo_do(node, evas_canvas3d_node_orientation_angle_axis_set(90, 0.0, 1.0, 0.0)); 92 evas_canvas3d_node_orientation_angle_axis_set(node, 90, 0.0, 1.0, 0.0);
93 break; 93 break;
94 } 94 }
95 case 3: 95 case 3:
96 { 96 {
97 eo_do(node, evas_canvas3d_node_orientation_angle_axis_set(90, 0.0, 0.0, 1.0)); 97 evas_canvas3d_node_orientation_angle_axis_set(node, 90, 0.0, 0.0, 1.0);
98 break; 98 break;
99 } 99 }
100 case 4: 100 case 4:
101 { 101 {
102 eo_do(node, evas_canvas3d_node_orientation_angle_axis_set(90, 1.0, 1.0, 0.0)); 102 evas_canvas3d_node_orientation_angle_axis_set(node, 90, 1.0, 1.0, 0.0);
103 break; 103 break;
104 } 104 }
105 } 105 }
@@ -111,8 +111,8 @@ _on_canvas_resize(Ecore_Evas *ee)
111 int w, h; 111 int w, h;
112 112
113 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); 113 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
114 eo_do(background, efl_gfx_size_set(w, h)); 114 efl_gfx_size_set(background, w, h);
115 eo_do(image, efl_gfx_size_set(w, h)); 115 efl_gfx_size_set(image, w, h);
116} 116}
117 117
118static Eina_Bool 118static Eina_Bool
@@ -120,9 +120,9 @@ _redraw_aabb()
120{ 120{
121 Evas_Real x0, y0, z0, x1, y1, z1; 121 Evas_Real x0, y0, z0, x1, y1, z1;
122 122
123 eo_do(mesh_node, evas_canvas3d_node_bounding_box_get(&x0, &y0, &z0, &x1, &y1, &z1)); 123 evas_canvas3d_node_bounding_box_get(mesh_node, &x0, &y0, &z0, &x1, &y1, &z1);
124 eo_do(mesh_box_node, evas_canvas3d_node_position_set((x0 + x1)/2, (y0 + y1)/2, (z0 + z1)/2), 124 evas_canvas3d_node_position_set(mesh_box_node, (x0 + x1)/2, (y0 + y1)/2, (z0 + z1)/2);
125 evas_canvas3d_node_scale_set(x1 - x0, y1 - y0, z1 - z0)); 125 evas_canvas3d_node_scale_set(mesh_box_node, x1 - x0, y1 - y0, z1 - z0);
126 126
127 return EINA_TRUE; 127 return EINA_TRUE;
128} 128}
@@ -144,118 +144,87 @@ main(void)
144 144
145 scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas); 145 scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas);
146 146
147 root_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 147 root_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_NODE));
148 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_NODE));
149 148
150 camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas); 149 camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas);
151 eo_do(camera, 150 evas_canvas3d_camera_projection_perspective_set(camera, 60.0, 1.0, 1.0, 500.0);
152 evas_canvas3d_camera_projection_perspective_set(60.0, 1.0, 1.0, 500.0));
153 151
154 camera_node = 152 camera_node =
155 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 153 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
156 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_CAMERA)); 154 evas_canvas3d_node_camera_set(camera_node, camera);
157 eo_do(camera_node, 155 evas_canvas3d_node_member_add(root_node, camera_node);
158 evas_canvas3d_node_camera_set(camera)); 156 evas_canvas3d_node_position_set(camera_node, 100.0, 50.0, 20.0);
159 eo_do(root_node, 157 evas_canvas3d_node_look_at_set(camera_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 20.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 1.0);
160 evas_canvas3d_node_member_add(camera_node));
161 eo_do(camera_node,
162 evas_canvas3d_node_position_set(100.0, 50.0, 20.0),
163 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 20.0,
164 EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 1.0));
165 light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas); 158 light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas);
166 eo_do(light, 159 evas_canvas3d_light_ambient_set(light, 1.0, 1.0, 1.0, 1.0);
167 evas_canvas3d_light_ambient_set(1.0, 1.0, 1.0, 1.0), 160 evas_canvas3d_light_diffuse_set(light, 1.0, 1.0, 1.0, 1.0);
168 evas_canvas3d_light_diffuse_set(1.0, 1.0, 1.0, 1.0), 161 evas_canvas3d_light_specular_set(light, 1.0, 1.0, 1.0, 1.0);
169 evas_canvas3d_light_specular_set(1.0, 1.0, 1.0, 1.0), 162 evas_canvas3d_light_directional_set(light, EINA_TRUE);
170 evas_canvas3d_light_directional_set(EINA_TRUE));
171 163
172 light_node = 164 light_node =
173 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 165 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
174 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_LIGHT)); 166 evas_canvas3d_node_light_set(light_node, light);
175 eo_do(light_node, 167 evas_canvas3d_node_position_set(light_node, 1000.0, 0.0, 1000.0);
176 evas_canvas3d_node_light_set(light), 168 evas_canvas3d_node_look_at_set(light_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
177 evas_canvas3d_node_position_set(1000.0, 0.0, 1000.0), 169 evas_canvas3d_node_member_add(root_node, light_node);
178 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0,
179 EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0));
180 eo_do(root_node,
181 evas_canvas3d_node_member_add(light_node));
182 170
183 mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); 171 mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas);
184 material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); 172 material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
185 173
186 eo_do(mesh, 174 efl_file_set(mesh, model_path, NULL);
187 efl_file_set(model_path, NULL), 175 evas_canvas3d_mesh_frame_material_set(mesh, 0, material);
188 evas_canvas3d_mesh_frame_material_set(0, material), 176 evas_canvas3d_mesh_shade_mode_set(mesh, EVAS_CANVAS3D_SHADE_MODE_PHONG);
189 evas_canvas3d_mesh_shade_mode_set(EVAS_CANVAS3D_SHADE_MODE_PHONG));
190 177
191 texture = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); 178 texture = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas);
192 eo_do(texture, 179 evas_canvas3d_texture_file_set(texture, image_path, NULL);
193 evas_canvas3d_texture_file_set(image_path, NULL), 180 evas_canvas3d_texture_filter_set(texture, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST);
194 evas_canvas3d_texture_filter_set(EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST, 181 evas_canvas3d_texture_wrap_set(texture, EVAS_CANVAS3D_WRAP_MODE_REPEAT, EVAS_CANVAS3D_WRAP_MODE_REPEAT);
195 EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST), 182 evas_canvas3d_material_texture_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, texture);
196 evas_canvas3d_texture_wrap_set(EVAS_CANVAS3D_WRAP_MODE_REPEAT, 183 evas_canvas3d_material_enable_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE);
197 EVAS_CANVAS3D_WRAP_MODE_REPEAT)); 184 evas_canvas3d_material_enable_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE);
198 eo_do(material, 185 evas_canvas3d_material_enable_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE);
199 evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, texture), 186 evas_canvas3d_material_enable_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE);
200 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE), 187 evas_canvas3d_material_color_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.01, 0.01, 0.01, 1.0);
201 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE), 188 evas_canvas3d_material_color_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 1.0, 1.0, 1.0, 1.0);
202 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE), 189 evas_canvas3d_material_color_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0);
203 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE), 190 evas_canvas3d_material_shininess_set(material, 50.0);
204 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 191
205 0.01, 0.01, 0.01, 1.0), 192 mesh_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH));
206 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 193 mesh_box_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH));
207 1.0, 1.0, 1.0, 1.0),
208 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR,
209 1.0, 1.0, 1.0, 1.0),
210 evas_canvas3d_material_shininess_set(50.0));
211
212 mesh_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas,
213 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_MESH));
214 mesh_box_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas,
215 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_MESH));
216 194
217 material_box = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); 195 material_box = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
218 eo_do(material_box, evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE)); 196 evas_canvas3d_material_enable_set(material_box, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE);
219 197
220 cube = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); 198 cube = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas);
221 eo_do(cube, 199 evas_canvas3d_primitive_form_set(cube, EVAS_CANVAS3D_MESH_PRIMITIVE_CUBE);
222 evas_canvas3d_primitive_form_set(EVAS_CANVAS3D_MESH_PRIMITIVE_CUBE));
223 200
224 mesh_box = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); 201 mesh_box = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas);
225 eo_do(mesh_box, 202 evas_canvas3d_mesh_from_primitive_set(mesh_box, 0, cube);
226 evas_canvas3d_mesh_from_primitive_set(0, cube), 203 evas_canvas3d_mesh_vertex_assembly_set(mesh_box, EVAS_CANVAS3D_VERTEX_ASSEMBLY_LINES);
227 evas_canvas3d_mesh_vertex_assembly_set(EVAS_CANVAS3D_VERTEX_ASSEMBLY_LINES), 204 evas_canvas3d_mesh_shade_mode_set(mesh_box, EVAS_CANVAS3D_SHADE_MODE_VERTEX_COLOR);
228 evas_canvas3d_mesh_shade_mode_set(EVAS_CANVAS3D_SHADE_MODE_VERTEX_COLOR), 205 evas_canvas3d_mesh_frame_material_set(mesh_box, 0, material_box);
229 evas_canvas3d_mesh_frame_material_set(0, material_box));
230 _redraw_aabb(); 206 _redraw_aabb();
231 207
232 eo_do(root_node, 208 evas_canvas3d_node_member_add(root_node, mesh_box_node);
233 evas_canvas3d_node_member_add(mesh_box_node)); 209 evas_canvas3d_node_mesh_add(mesh_box_node, mesh_box);
234 eo_do(mesh_box_node,
235 evas_canvas3d_node_mesh_add(mesh_box));
236 210
237 eo_do(root_node, 211 evas_canvas3d_node_member_add(root_node, mesh_node);
238 evas_canvas3d_node_member_add(mesh_node)); 212 evas_canvas3d_node_mesh_add(mesh_node, mesh);
239 eo_do(mesh_node,
240 evas_canvas3d_node_mesh_add(mesh));
241 213
242 eo_do(scene, 214 evas_canvas3d_scene_root_node_set(scene, root_node);
243 evas_canvas3d_scene_root_node_set(root_node), 215 evas_canvas3d_scene_camera_node_set(scene, camera_node);
244 evas_canvas3d_scene_camera_node_set(camera_node), 216 evas_canvas3d_scene_size_set(scene, WIDTH, HEIGHT);
245 evas_canvas3d_scene_size_set(WIDTH, HEIGHT));
246 217
247 background = eo_add(EVAS_RECTANGLE_CLASS, evas); 218 background = eo_add(EVAS_RECTANGLE_CLASS, evas);
248 eo_do(background, 219 efl_gfx_color_set(background, 0, 0, 0, 255);
249 efl_gfx_color_set(0, 0, 0, 255), 220 efl_gfx_size_set(background, WIDTH, HEIGHT);
250 efl_gfx_size_set(WIDTH, HEIGHT), 221 efl_gfx_visible_set(background, EINA_TRUE);
251 efl_gfx_visible_set(EINA_TRUE));
252 222
253 image = evas_object_image_filled_add(evas); 223 image = evas_object_image_filled_add(evas);
254 eo_do(image, 224 efl_gfx_size_set(image, WIDTH, HEIGHT);
255 efl_gfx_size_set(WIDTH, HEIGHT), 225 efl_gfx_visible_set(image, EINA_TRUE);
256 efl_gfx_visible_set(EINA_TRUE));
257 evas_object_focus_set(image, EINA_TRUE); 226 evas_object_focus_set(image, EINA_TRUE);
258 eo_do(image, evas_obj_image_scene_set(scene)); 227 evas_obj_image_scene_set(image, scene);
259 228
260 evas_object_event_callback_add(image, EVAS_CALLBACK_KEY_DOWN, _on_key_down, mesh_node); 229 evas_object_event_callback_add(image, EVAS_CALLBACK_KEY_DOWN, _on_key_down, mesh_node);
261 230
diff --git a/src/examples/evas/evas-3d-blending.c b/src/examples/evas/evas-3d-blending.c
index 98bd74a..db7c7a1 100644
--- a/src/examples/evas/evas-3d-blending.c
+++ b/src/examples/evas/evas-3d-blending.c
@@ -102,7 +102,7 @@ _on_key_down(void *data, Evas *e EINA_UNUSED, Evas_Object *eo EINA_UNUSED, void
102 func2 = EVAS_CANVAS3D_BLEND_FUNC_SRC_ALPHA_SATURATE; 102 func2 = EVAS_CANVAS3D_BLEND_FUNC_SRC_ALPHA_SATURATE;
103 if(func2 > EVAS_CANVAS3D_BLEND_FUNC_SRC_ALPHA_SATURATE) 103 if(func2 > EVAS_CANVAS3D_BLEND_FUNC_SRC_ALPHA_SATURATE)
104 func2 = EVAS_CANVAS3D_BLEND_FUNC_ZERO; 104 func2 = EVAS_CANVAS3D_BLEND_FUNC_ZERO;
105 eo_do(scene->mesh1, evas_canvas3d_mesh_blending_func_set(func1, func2)); 105 evas_canvas3d_mesh_blending_func_set(scene->mesh1, func1, func2);
106 printf("sfactor = %s, dfactor = %s\n", blend_func_names[func1], blend_func_names[func2]); 106 printf("sfactor = %s, dfactor = %s\n", blend_func_names[func1], blend_func_names[func2]);
107} 107}
108 108
@@ -121,8 +121,8 @@ _on_canvas_resize(Ecore_Evas *ee)
121 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); 121 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
122 122
123 evas_object_resize(background, w, h); 123 evas_object_resize(background, w, h);
124 eo_do(background, efl_gfx_size_set(w, h)); 124 efl_gfx_size_set(background, w, h);
125 eo_do(image, efl_gfx_size_set(w, h)); 125 efl_gfx_size_set(image, w, h);
126} 126}
127 127
128static Eina_Bool 128static Eina_Bool
@@ -133,8 +133,7 @@ _animate_scene(void *data)
133 133
134 angle += 0.02; 134 angle += 0.02;
135 135
136 eo_do(scene->mesh_node, 136 evas_canvas3d_node_position_set(scene->mesh_node, 3 * sin(angle), 0.0, 3 * cos(angle));
137 evas_canvas3d_node_position_set(3 * sin(angle), 0.0, 3 * cos(angle)));
138 137
139 if (angle > 2 * M_PI) angle = 0; 138 if (angle > 2 * M_PI) angle = 0;
140 139
@@ -146,49 +145,40 @@ _camera_setup(Scene_Data *data)
146{ 145{
147 data->camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas); 146 data->camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas);
148 147
149 eo_do(data->camera, 148 evas_canvas3d_camera_projection_perspective_set(data->camera, 60.0, 1.0, 2.0, 50.0);
150 evas_canvas3d_camera_projection_perspective_set(60.0, 1.0, 2.0, 50.0));
151 149
152 data->camera_node = 150 data->camera_node =
153 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 151 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
154 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_CAMERA));
155 152
156 eo_do(data->camera_node, 153 evas_canvas3d_node_camera_set(data->camera_node, data->camera);
157 evas_canvas3d_node_camera_set(data->camera), 154 evas_canvas3d_node_position_set(data->camera_node, 0.0, 0.0, 10.0);
158 evas_canvas3d_node_position_set(0.0, 0.0, 10.0), 155 evas_canvas3d_node_look_at_set(data->camera_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
159 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0,
160 EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0));
161 156
162 eo_do(data->root_node, evas_canvas3d_node_member_add(data->camera_node)); 157 evas_canvas3d_node_member_add(data->root_node, data->camera_node);
163} 158}
164 159
165static void 160static void
166_light_setup(Scene_Data *data) 161_light_setup(Scene_Data *data)
167{ 162{
168 data->light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas); 163 data->light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas);
169 eo_do(data->light, 164 evas_canvas3d_light_ambient_set(data->light, 0.2, 0.2, 0.2, 1.0);
170 evas_canvas3d_light_ambient_set(0.2, 0.2, 0.2, 1.0), 165 evas_canvas3d_light_diffuse_set(data->light, 1.0, 1.0, 1.0, 1.0);
171 evas_canvas3d_light_diffuse_set(1.0, 1.0, 1.0, 1.0), 166 evas_canvas3d_light_specular_set(data->light, 1.0, 1.0, 1.0, 1.0);
172 evas_canvas3d_light_specular_set(1.0, 1.0, 1.0, 1.0));
173 167
174 data->light_node = 168 data->light_node =
175 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 169 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
176 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_LIGHT)); 170 evas_canvas3d_node_light_set(data->light_node, data->light);
177 eo_do(data->light_node, 171 evas_canvas3d_node_position_set(data->light_node, 0.0, 0.0, 10.0);
178 evas_canvas3d_node_light_set(data->light), 172 evas_canvas3d_node_look_at_set(data->light_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
179 evas_canvas3d_node_position_set(0.0, 0.0, 10.0), 173 evas_canvas3d_node_member_add(data->root_node, data->light_node);
180 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0,
181 EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0));
182 eo_do(data->root_node, evas_canvas3d_node_member_add(data->light_node));
183} 174}
184 175
185static void 176static void
186_set_ball(Eo *mesh, Eo *sphere, Evas_Canvas3D_Material *material) 177_set_ball(Eo *mesh, Eo *sphere, Evas_Canvas3D_Material *material)
187{ 178{
188 eo_do(mesh, 179 evas_canvas3d_mesh_from_primitive_set(mesh, 0, sphere);
189 evas_canvas3d_mesh_from_primitive_set(0, sphere), 180 evas_canvas3d_mesh_frame_material_set(mesh, 0, material);
190 evas_canvas3d_mesh_frame_material_set(0, material), 181 evas_canvas3d_mesh_shade_mode_set(mesh, EVAS_CANVAS3D_SHADE_MODE_PHONG);
191 evas_canvas3d_mesh_shade_mode_set(EVAS_CANVAS3D_SHADE_MODE_PHONG));
192} 182}
193 183
194static void 184static void
@@ -196,32 +186,27 @@ _mesh_setup(Scene_Data *data)
196{ 186{
197 data->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); 187 data->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
198 188
199 eo_do(data->material, 189 evas_canvas3d_material_enable_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE);
200 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE), 190 evas_canvas3d_material_enable_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE);
201 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE), 191 evas_canvas3d_material_enable_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE);
202 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE), 192 evas_canvas3d_material_color_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 1.0, 0.2, 0.2, 0.2);
203 193 evas_canvas3d_material_color_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 1.0, 0.0, 0.0, 0.2);
204 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 1.0, 0.2, 0.2, 0.2), 194 evas_canvas3d_material_color_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 0.2);
205 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 1.0, 0.0, 0.0, 0.2), 195 evas_canvas3d_material_shininess_set(data->material, 100.0);
206 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 0.2),
207 evas_canvas3d_material_shininess_set(100.0));
208 196
209 data->material1 = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); 197 data->material1 = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
210 198
211 eo_do(data->material1, 199 evas_canvas3d_material_enable_set(data->material1, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE);
212 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE), 200 evas_canvas3d_material_enable_set(data->material1, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE);
213 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE), 201 evas_canvas3d_material_enable_set(data->material1, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE);
214 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE), 202 evas_canvas3d_material_color_set(data->material1, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.0, 0.2, 0.2, 0.2);
215 203 evas_canvas3d_material_color_set(data->material1, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.0, 0.0, 1.0, 0.2);
216 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.0, 0.2, 0.2, 0.2), 204 evas_canvas3d_material_color_set(data->material1, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 0.2);
217 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.0, 0.0, 1.0, 0.2), 205 evas_canvas3d_material_shininess_set(data->material1, 100.0);
218 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 0.2),
219 evas_canvas3d_material_shininess_set(100.0));
220 206
221 data->sphere = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); 207 data->sphere = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas);
222 eo_do(data->sphere, 208 evas_canvas3d_primitive_form_set(data->sphere, EVAS_CANVAS3D_MESH_PRIMITIVE_SPHERE);
223 evas_canvas3d_primitive_form_set(EVAS_CANVAS3D_MESH_PRIMITIVE_SPHERE), 209 evas_canvas3d_primitive_precision_set(data->sphere, 50);
224 evas_canvas3d_primitive_precision_set(50));
225 210
226 data->mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); 211 data->mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas);
227 data->mesh1 = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); 212 data->mesh1 = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas);
@@ -230,27 +215,23 @@ _mesh_setup(Scene_Data *data)
230 _set_ball(data->mesh1, data->sphere, data->material1); 215 _set_ball(data->mesh1, data->sphere, data->material1);
231 216
232 data->mesh_node = 217 data->mesh_node =
233 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 218 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH));
234 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_MESH));
235 219
236 eo_do(data->root_node, evas_canvas3d_node_member_add(data->mesh_node)); 220 evas_canvas3d_node_member_add(data->root_node, data->mesh_node);
237 eo_do(data->mesh_node, evas_canvas3d_node_mesh_add(data->mesh)); 221 evas_canvas3d_node_mesh_add(data->mesh_node, data->mesh);
238 222
239 data->mesh_node1 = 223 data->mesh_node1 =
240 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 224 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH));
241 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_MESH));
242 225
243 eo_do(data->root_node, evas_canvas3d_node_member_add(data->mesh_node1)); 226 evas_canvas3d_node_member_add(data->root_node, data->mesh_node1);
244 eo_do(data->mesh_node1, evas_canvas3d_node_mesh_add(data->mesh1)); 227 evas_canvas3d_node_mesh_add(data->mesh_node1, data->mesh1);
245 228
246 eo_do(data->mesh1, evas_canvas3d_mesh_blending_enable_set(EINA_TRUE), 229 evas_canvas3d_mesh_blending_enable_set(data->mesh1, EINA_TRUE);
247 evas_canvas3d_mesh_blending_func_set(func1, func2)); 230 evas_canvas3d_mesh_blending_func_set(data->mesh1, func1, func2);
248 231
249 eo_do(data->mesh_node, 232 evas_canvas3d_node_scale_set(data->mesh_node, 2.0, 2.0, 2.0);
250 evas_canvas3d_node_scale_set(2.0, 2.0, 2.0));
251 233
252 eo_do(data->mesh_node1, 234 evas_canvas3d_node_scale_set(data->mesh_node1, 5.0, 5.0, 5.0);
253 evas_canvas3d_node_scale_set(5.0, 5.0, 5.0));
254} 235}
255 236
256static void 237static void
@@ -258,21 +239,18 @@ _scene_setup(Scene_Data *data)
258{ 239{
259 data->scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas); 240 data->scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas);
260 241
261 eo_do(data->scene, 242 evas_canvas3d_scene_size_set(data->scene, WIDTH, HEIGHT);
262 evas_canvas3d_scene_size_set(WIDTH, HEIGHT); 243 evas_canvas3d_scene_background_color_set(data->scene, 0.5, 0.5, 0.5, 1);
263 evas_canvas3d_scene_background_color_set(0.5, 0.5, 0.5, 1));
264 244
265 data->root_node = 245 data->root_node =
266 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 246 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_NODE));
267 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_NODE));
268 247
269 _camera_setup(data); 248 _camera_setup(data);
270 _light_setup(data); 249 _light_setup(data);
271 _mesh_setup(data); 250 _mesh_setup(data);
272 251
273 eo_do(data->scene, 252 evas_canvas3d_scene_root_node_set(data->scene, data->root_node);
274 evas_canvas3d_scene_root_node_set(data->root_node), 253 evas_canvas3d_scene_camera_node_set(data->scene, data->camera_node);
275 evas_canvas3d_scene_camera_node_set(data->camera_node));
276} 254}
277 255
278int 256int
@@ -312,7 +290,7 @@ main(void)
312 evas_object_focus_set(image, EINA_TRUE); 290 evas_object_focus_set(image, EINA_TRUE);
313 291
314 /* Set the image object as render target for 3D scene. */ 292 /* Set the image object as render target for 3D scene. */
315 eo_do(image, evas_obj_image_scene_set(data.scene)); 293 evas_obj_image_scene_set(image, data.scene);
316 294
317 295
318 /* Add animation timer callback. */ 296 /* Add animation timer callback. */
diff --git a/src/examples/evas/evas-3d-colorpick.c b/src/examples/evas/evas-3d-colorpick.c
index f3cf3b4..885a53b 100644
--- a/src/examples/evas/evas-3d-colorpick.c
+++ b/src/examples/evas/evas-3d-colorpick.c
@@ -119,8 +119,8 @@ _on_canvas_resize(Ecore_Evas *ee)
119 int w, h; 119 int w, h;
120 120
121 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); 121 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
122 eo_do(bg, efl_gfx_size_set(w, h)); 122 efl_gfx_size_set(bg, w, h);
123 eo_do(image, efl_gfx_size_set(w, h)); 123 efl_gfx_size_set(image, w, h);
124} 124}
125 125
126static Eina_Bool 126static Eina_Bool
@@ -129,7 +129,7 @@ _animate_sphere(void *data)
129 static int angle = 0.0; 129 static int angle = 0.0;
130 Eo *n = (Eo*)(((Test_object *)data)->node); 130 Eo *n = (Eo*)(((Test_object *)data)->node);
131 Evas_Real s = ((Test_object *)data)->speed; 131 Evas_Real s = ((Test_object *)data)->speed;
132 eo_do(n, evas_canvas3d_node_orientation_angle_axis_set(angle, s, s - 1, s + 1)); 132 evas_canvas3d_node_orientation_angle_axis_set(n, angle, s, s - 1, s + 1);
133 angle++; 133 angle++;
134 if (angle > 360) angle = 0.0; 134 if (angle > 360) angle = 0.0;
135 return EINA_TRUE; 135 return EINA_TRUE;
@@ -141,9 +141,8 @@ void _recalculate_position()
141 Evas_Real x1, y1, shiftx = 0, shifty = 0; 141 Evas_Real x1, y1, shiftx = 0, shifty = 0;
142 Test_object *m; 142 Test_object *m;
143 143
144 eo_do(((Test_object *)eina_list_nth(globalscene.spheres, 0))->node, 144 evas_canvas3d_object_update(((Test_object *)eina_list_nth(globalscene.spheres, 0))->node);
145 evas_canvas3d_object_update(), 145 evas_canvas3d_node_bounding_box_get(((Test_object *)eina_list_nth(globalscene.spheres, 0))->node, NULL, NULL, NULL, &x1, &y1, NULL);
146 evas_canvas3d_node_bounding_box_get(NULL, NULL, NULL, &x1, &y1, NULL));
147 146
148 for (i = 0; i < globalscene.row; ++i) 147 for (i = 0; i < globalscene.row; ++i)
149 { 148 {
@@ -152,7 +151,7 @@ void _recalculate_position()
152 { 151 {
153 shifty = (j * 2 - globalscene.col) * y1; 152 shifty = (j * 2 - globalscene.col) * y1;
154 m = (Test_object *)eina_list_nth(globalscene.spheres, count); 153 m = (Test_object *)eina_list_nth(globalscene.spheres, count);
155 eo_do(m->node, evas_canvas3d_node_position_set(shifty, 0.0, shiftx)); 154 evas_canvas3d_node_position_set(m->node, shifty, 0.0, shiftx);
156 count++; 155 count++;
157 } 156 }
158 } 157 }
@@ -167,31 +166,29 @@ _on_key_down(void *data EINA_UNUSED, Evas *e EINA_UNUSED,
167 Test_object * item; 166 Test_object * item;
168 if (!strcmp(ev->key, "Down")) 167 if (!strcmp(ev->key, "Down"))
169 { 168 {
170 eo_do(globalscene.camera_node, evas_canvas3d_node_position_get(EVAS_CANVAS3D_SPACE_PARENT, &x, &y, &z), 169 evas_canvas3d_node_position_get(globalscene.camera_node, EVAS_CANVAS3D_SPACE_PARENT, &x, &y, &z);
171 evas_canvas3d_node_position_set(x, y, (z - 5))); 170 evas_canvas3d_node_position_set(globalscene.camera_node, x, y, (z - 5));
172 } 171 }
173 else if (!strcmp(ev->key, "Up")) 172 else if (!strcmp(ev->key, "Up"))
174 { 173 {
175 eo_do(globalscene.camera_node, evas_canvas3d_node_position_get(EVAS_CANVAS3D_SPACE_PARENT, &x, &y, &z), 174 evas_canvas3d_node_position_get(globalscene.camera_node, EVAS_CANVAS3D_SPACE_PARENT, &x, &y, &z);
176 evas_canvas3d_node_position_set(x, y, (z + 5))); 175 evas_canvas3d_node_position_set(globalscene.camera_node, x, y, (z + 5));
177 } 176 }
178 else if (!strcmp(ev->key, "Left")) 177 else if (!strcmp(ev->key, "Left"))
179 { 178 {
180 eo_do(((Test_object *)eina_list_nth(globalscene.spheres, 0))->node, 179 evas_canvas3d_node_scale_get(((Test_object *)eina_list_nth(globalscene.spheres, 0))->node, EVAS_CANVAS3D_SPACE_PARENT, &x, &y, &z);
181 evas_canvas3d_node_scale_get(EVAS_CANVAS3D_SPACE_PARENT, &x, &y, &z));
182 EINA_LIST_FOREACH(globalscene.spheres, l, item) 180 EINA_LIST_FOREACH(globalscene.spheres, l, item)
183 { 181 {
184 eo_do(item->node, evas_canvas3d_node_scale_set((x - SCALE_UNIT), (y - SCALE_UNIT), (z - SCALE_UNIT))); 182 evas_canvas3d_node_scale_set(item->node, (x - SCALE_UNIT), (y - SCALE_UNIT), (z - SCALE_UNIT));
185 } 183 }
186 _recalculate_position(); 184 _recalculate_position();
187 } 185 }
188 else if (!strcmp(ev->key, "Right")) 186 else if (!strcmp(ev->key, "Right"))
189 { 187 {
190 eo_do(((Test_object *)eina_list_nth(globalscene.spheres, 0))->node, 188 evas_canvas3d_node_scale_get(((Test_object *)eina_list_nth(globalscene.spheres, 0))->node, EVAS_CANVAS3D_SPACE_PARENT, &x, &y, &z);
191 evas_canvas3d_node_scale_get(EVAS_CANVAS3D_SPACE_PARENT, &x, &y, &z));
192 EINA_LIST_FOREACH(globalscene.spheres, l, item) 189 EINA_LIST_FOREACH(globalscene.spheres, l, item)
193 { 190 {
194 eo_do(item->node, evas_canvas3d_node_scale_set((x + SCALE_UNIT), (y + SCALE_UNIT), (z + SCALE_UNIT))); 191 evas_canvas3d_node_scale_set(item->node, (x + SCALE_UNIT), (y + SCALE_UNIT), (z + SCALE_UNIT));
195 } 192 }
196 _recalculate_position(); 193 _recalculate_position();
197 } 194 }
@@ -212,27 +209,26 @@ _on_mouse_down(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *eo EINA
212 Eina_Bool flag; 209 Eina_Bool flag;
213 if (ev->button == 1) 210 if (ev->button == 1)
214 { 211 {
215 eo_do(globalscene.scene, evas_canvas3d_scene_color_pick_enable_set(EINA_TRUE)); 212 evas_canvas3d_scene_color_pick_enable_set(globalscene.scene, EINA_TRUE);
216 eo_do(globalscene.scene, 213 flag = evas_canvas3d_scene_pick(globalscene.scene, ev->canvas.x, ev->canvas.y, &n, &m, NULL, NULL);
217 flag = evas_canvas3d_scene_pick(ev->canvas.x, ev->canvas.y, &n, &m, NULL, NULL));
218 time = clock() - time; 214 time = clock() - time;
219 diff_sec = ((float)time) / CLOCKS_PER_SEC / 10; 215 diff_sec = ((float)time) / CLOCKS_PER_SEC / 10;
220 if (flag) 216 if (flag)
221 { 217 {
222 fprintf(stdout, "Boom! Time expended for color pick: %2.7f .\n", diff_sec); 218 fprintf(stdout, "Boom! Time expended for color pick: %2.7f .\n", diff_sec);
223 eo_do(n, evas_canvas3d_node_scale_set(VEC_3(SMALL_SCALE))); 219 evas_canvas3d_node_scale_set(n, VEC_3(SMALL_SCALE));
224 } 220 }
225 } 221 }
226 else 222 else
227 { 223 {
228 eo_do(globalscene.scene, evas_canvas3d_scene_color_pick_enable_set(EINA_FALSE)); 224 evas_canvas3d_scene_color_pick_enable_set(globalscene.scene, EINA_FALSE);
229 eo_do(globalscene.scene, flag = evas_canvas3d_scene_pick(ev->canvas.x, ev->canvas.y, &n, &m, &s, &t)); 225 flag = evas_canvas3d_scene_pick(globalscene.scene, ev->canvas.x, ev->canvas.y, &n, &m, &s, &t);
230 time = clock() - time; 226 time = clock() - time;
231 diff_sec = ((float)time) / CLOCKS_PER_SEC / 10; 227 diff_sec = ((float)time) / CLOCKS_PER_SEC / 10;
232 if (flag) 228 if (flag)
233 { 229 {
234 fprintf(stdout, "Boom! Time expended for geometry pick: %2.7f .\n", diff_sec); 230 fprintf(stdout, "Boom! Time expended for geometry pick: %2.7f .\n", diff_sec);
235 eo_do(n, evas_canvas3d_node_scale_set(VEC_3(BIG_SCALE))); 231 evas_canvas3d_node_scale_set(n, VEC_3(BIG_SCALE));
236 } 232 }
237 } 233 }
238} 234}
@@ -244,36 +240,27 @@ _init_sphere(void *this, const char *texture)
244 sphere->primitive = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); 240 sphere->primitive = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas);
245 sphere->mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); 241 sphere->mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas);
246 sphere->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); 242 sphere->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
247 eo_do(sphere->primitive, 243 evas_canvas3d_primitive_form_set(sphere->primitive, EVAS_CANVAS3D_MESH_PRIMITIVE_SPHERE);
248 evas_canvas3d_primitive_form_set(EVAS_CANVAS3D_MESH_PRIMITIVE_SPHERE), 244 evas_canvas3d_primitive_precision_set(sphere->primitive, 50);
249 evas_canvas3d_primitive_precision_set(50)); 245 evas_canvas3d_mesh_from_primitive_set(sphere->mesh, 0, sphere->primitive);
250 eo_do(sphere->mesh, 246 evas_canvas3d_mesh_frame_material_set(sphere->mesh, 0, sphere->material);
251 evas_canvas3d_mesh_from_primitive_set(0, sphere->primitive), 247 evas_canvas3d_mesh_shade_mode_set(sphere->mesh, EVAS_CANVAS3D_SHADE_MODE_PHONG);
252 evas_canvas3d_mesh_frame_material_set(0, sphere->material),
253 evas_canvas3d_mesh_shade_mode_set(EVAS_CANVAS3D_SHADE_MODE_PHONG));
254 248
255 eo_do(sphere->mesh, evas_canvas3d_mesh_color_pick_enable_set(EINA_TRUE)); 249 evas_canvas3d_mesh_color_pick_enable_set(sphere->mesh, EINA_TRUE);
256 250
257 sphere->texture = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); 251 sphere->texture = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas);
258 eo_do(sphere->texture, 252 evas_canvas3d_texture_file_set(sphere->texture, texture, NULL);
259 evas_canvas3d_texture_file_set(texture, NULL), 253 evas_canvas3d_texture_filter_set(sphere->texture, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST);
260 evas_canvas3d_texture_filter_set(EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST, 254 evas_canvas3d_texture_wrap_set(sphere->texture, EVAS_CANVAS3D_WRAP_MODE_REPEAT, EVAS_CANVAS3D_WRAP_MODE_REPEAT);
261 EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST), 255 evas_canvas3d_material_texture_set(sphere->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, sphere->texture);
262 evas_canvas3d_texture_wrap_set(EVAS_CANVAS3D_WRAP_MODE_REPEAT, 256 evas_canvas3d_material_enable_set(sphere->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE);
263 EVAS_CANVAS3D_WRAP_MODE_REPEAT)); 257 evas_canvas3d_material_enable_set(sphere->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE);
264 eo_do(sphere->material, 258 evas_canvas3d_material_enable_set(sphere->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE);
265 evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, sphere->texture), 259 evas_canvas3d_material_enable_set(sphere->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE);
266 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE), 260 evas_canvas3d_material_color_set(sphere->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.01, 0.01, 0.01, 1.0);
267 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE), 261 evas_canvas3d_material_color_set(sphere->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 1.0, 1.0, 1.0, 1.0);
268 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE), 262 evas_canvas3d_material_color_set(sphere->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0);
269 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE), 263 evas_canvas3d_material_shininess_set(sphere->material, 50.0);
270 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT,
271 0.01, 0.01, 0.01, 1.0),
272 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE,
273 1.0, 1.0, 1.0, 1.0),
274 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR,
275 1.0, 1.0, 1.0, 1.0),
276 evas_canvas3d_material_shininess_set(50.0));
277 return EINA_TRUE; 264 return EINA_TRUE;
278} 265}
279 266
@@ -287,41 +274,29 @@ _init_scene(const char *texture)
287 274
288 globalscene.scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas); 275 globalscene.scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas);
289 276
290 globalscene.root_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 277 globalscene.root_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_NODE));
291 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_NODE));
292 278
293 globalscene.camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas); 279 globalscene.camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas);
294 eo_do(globalscene.camera, 280 evas_canvas3d_camera_projection_perspective_set(globalscene.camera, 30.0, 1.0, 1.0, 1000.0);
295 evas_canvas3d_camera_projection_perspective_set(30.0, 1.0, 1.0, 1000.0));
296 281
297 globalscene.camera_node = 282 globalscene.camera_node =
298 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 283 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
299 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_CAMERA)); 284 evas_canvas3d_node_camera_set(globalscene.camera_node, globalscene.camera);
300 eo_do(globalscene.camera_node, 285 evas_canvas3d_node_member_add(globalscene.root_node, globalscene.camera_node);
301 evas_canvas3d_node_camera_set(globalscene.camera)); 286 evas_canvas3d_node_position_set(globalscene.camera_node, 0.0, 30.0, 800.0);
302 eo_do(globalscene.root_node, 287 evas_canvas3d_node_look_at_set(globalscene.camera_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, -1000.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
303 evas_canvas3d_node_member_add(globalscene.camera_node));
304 eo_do(globalscene.camera_node,
305 evas_canvas3d_node_position_set(0.0, 30.0, 800.0),
306 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, -1000.0,
307 EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0));
308 globalscene.light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas); 288 globalscene.light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas);
309 eo_do(globalscene.light, 289 evas_canvas3d_light_ambient_set(globalscene.light, 1.0, 1.0, 1.0, 1.0);
310 evas_canvas3d_light_ambient_set(1.0, 1.0, 1.0, 1.0), 290 evas_canvas3d_light_diffuse_set(globalscene.light, 1.0, 1.0, 1.0, 1.0);
311 evas_canvas3d_light_diffuse_set(1.0, 1.0, 1.0, 1.0), 291 evas_canvas3d_light_specular_set(globalscene.light, 1.0, 1.0, 1.0, 1.0);
312 evas_canvas3d_light_specular_set(1.0, 1.0, 1.0, 1.0), 292 evas_canvas3d_light_directional_set(globalscene.light, EINA_TRUE);
313 evas_canvas3d_light_directional_set(EINA_TRUE));
314 293
315 globalscene.light_node = 294 globalscene.light_node =
316 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 295 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
317 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_LIGHT)); 296 evas_canvas3d_node_light_set(globalscene.light_node, globalscene.light);
318 eo_do(globalscene.light_node, 297 evas_canvas3d_node_position_set(globalscene.light_node, 100.0, 50.0, 300.0);
319 evas_canvas3d_node_light_set(globalscene.light), 298 evas_canvas3d_node_look_at_set(globalscene.light_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 1.0, 1.0, 1.0);
320 evas_canvas3d_node_position_set(100.0, 50.0, 300.0), 299 evas_canvas3d_node_member_add(globalscene.root_node, globalscene.light_node);
321 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0,
322 EVAS_CANVAS3D_SPACE_PARENT, 1.0, 1.0, 1.0));
323 eo_do(globalscene.root_node,
324 evas_canvas3d_node_member_add(globalscene.light_node));
325 300
326 tmp = 0.01; 301 tmp = 0.01;
327 for (i = 0; i < globalscene.col * globalscene.row; i++) 302 for (i = 0; i < globalscene.col * globalscene.row; i++)
@@ -338,24 +313,22 @@ _init_scene(const char *texture)
338 m->material = spheretmp->material; 313 m->material = spheretmp->material;
339 m->texture = spheretmp->texture; 314 m->texture = spheretmp->texture;
340 } 315 }
341 m->node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 316 m->node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH));
342 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_MESH));
343 m->speed = tmp; 317 m->speed = tmp;
344 m->sphere_animate = _animate_sphere; 318 m->sphere_animate = _animate_sphere;
345 m->animate = ecore_timer_add(m->speed, m->sphere_animate, m); 319 m->animate = ecore_timer_add(m->speed, m->sphere_animate, m);
346 eo_do(globalscene.root_node, evas_canvas3d_node_member_add(m->node)); 320 evas_canvas3d_node_member_add(globalscene.root_node, m->node);
347 eo_do(m->node, evas_canvas3d_node_mesh_add(m->mesh), 321 evas_canvas3d_node_mesh_add(m->node, m->mesh);
348 evas_canvas3d_node_scale_set(VEC_3(INIT_SCALE))); 322 evas_canvas3d_node_scale_set(m->node, VEC_3(INIT_SCALE));
349 globalscene.spheres = eina_list_append(globalscene.spheres, m); 323 globalscene.spheres = eina_list_append(globalscene.spheres, m);
350 tmp += 0.01; 324 tmp += 0.01;
351 } 325 }
352 326
353 _recalculate_position(); 327 _recalculate_position();
354 328
355 eo_do(globalscene.scene, 329 evas_canvas3d_scene_root_node_set(globalscene.scene, globalscene.root_node);
356 evas_canvas3d_scene_root_node_set(globalscene.root_node), 330 evas_canvas3d_scene_camera_node_set(globalscene.scene, globalscene.camera_node);
357 evas_canvas3d_scene_camera_node_set(globalscene.camera_node), 331 evas_canvas3d_scene_size_set(globalscene.scene, WIDTH, HEIGHT);
358 evas_canvas3d_scene_size_set(WIDTH, HEIGHT));
359 return EINA_TRUE; 332 return EINA_TRUE;
360} 333}
361 334
@@ -410,11 +383,10 @@ int main(int argc, char **argv)
410 383
411 image = evas_object_image_filled_add(evas); 384 image = evas_object_image_filled_add(evas);
412 385
413 eo_do(image, 386 efl_gfx_size_set(image, WIDTH, HEIGHT);
414 efl_gfx_size_set(WIDTH, HEIGHT), 387 efl_gfx_visible_set(image, EINA_TRUE);
415 efl_gfx_visible_set(EINA_TRUE));
416 evas_object_focus_set(image, EINA_TRUE); 388 evas_object_focus_set(image, EINA_TRUE);
417 eo_do(image, evas_obj_image_scene_set(globalscene.scene)); 389 evas_obj_image_scene_set(image, globalscene.scene);
418 390
419 r = evas_object_key_grab(image, "Down", 0, 0, EINA_TRUE); 391 r = evas_object_key_grab(image, "Down", 0, 0, EINA_TRUE);
420 r = evas_object_key_grab(image, "Up", 0, 0, EINA_TRUE); 392 r = evas_object_key_grab(image, "Up", 0, 0, EINA_TRUE);
diff --git a/src/examples/evas/evas-3d-cube-rotate.c b/src/examples/evas/evas-3d-cube-rotate.c
index eec0234..e393c14 100644
--- a/src/examples/evas/evas-3d-cube-rotate.c
+++ b/src/examples/evas/evas-3d-cube-rotate.c
@@ -89,7 +89,7 @@ _rotate_x_reload(Evas_Canvas3D_Scene *eo_scene, Evas_Event_Mouse_Down *ev, Evas_
89 Evas_Real s, t; 89 Evas_Real s, t;
90 int mouse_diff; 90 int mouse_diff;
91 91
92 eo_do(eo_scene, evas_canvas3d_scene_pick(ev->canvas.x, ev->canvas.y, &n, &m, &s, &t)); 92 evas_canvas3d_scene_pick(eo_scene, ev->canvas.x, ev->canvas.y, &n, &m, &s, &t);
93 93
94 if ((n == node) && (m == mesh)) 94 if ((n == node) && (m == mesh))
95 { 95 {
@@ -140,7 +140,7 @@ _animate_scene(void *data)
140 140
141 angle += sc->angle; 141 angle += sc->angle;
142 142
143 eo_do(sc->mesh_node, evas_canvas3d_node_orientation_angle_axis_set(angle, 0, 1.0, 0.0)); 143 evas_canvas3d_node_orientation_angle_axis_set(sc->mesh_node, angle, 0, 1.0, 0.0);
144 144
145 return EINA_TRUE; 145 return EINA_TRUE;
146} 146}
@@ -149,39 +149,32 @@ static void
149_camera_setup(Scene_Data *data) 149_camera_setup(Scene_Data *data)
150{ 150{
151 data->camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas); 151 data->camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas);
152 eo_do(data->camera, 152 evas_canvas3d_camera_projection_perspective_set(data->camera, 20.0, 1.0, 2.0, 50.0);
153 evas_canvas3d_camera_projection_perspective_set(20.0, 1.0, 2.0, 50.0));
154 153
155 data->camera_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 154 data->camera_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
156 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_CAMERA)); 155 evas_canvas3d_node_camera_set(data->camera_node, data->camera);
157 eo_do(data->camera_node, 156 evas_canvas3d_node_position_set(data->camera_node, 3.0, 3.0, 10.0);
158 evas_canvas3d_node_camera_set(data->camera), 157 evas_canvas3d_node_look_at_set(data->camera_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
159 evas_canvas3d_node_position_set(3.0, 3.0, 10.0),
160 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0));
161 158
162 eo_do(data->root_node, evas_canvas3d_node_member_add(data->camera_node)); 159 evas_canvas3d_node_member_add(data->root_node, data->camera_node);
163} 160}
164 161
165static void 162static void
166_light_setup(Scene_Data *data) 163_light_setup(Scene_Data *data)
167{ 164{
168 data->light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS,evas); 165 data->light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas);
169 166
170 eo_do(data->light, 167 evas_canvas3d_light_ambient_set(data->light, 0.2, 0.2, 0.2, 1.0);
171 evas_canvas3d_light_ambient_set(0.2, 0.2, 0.2, 1.0), 168 evas_canvas3d_light_diffuse_set(data->light, 1.0, 1.0, 1.0, 1.0);
172 evas_canvas3d_light_diffuse_set(1.0, 1.0, 1.0, 1.0), 169 evas_canvas3d_light_specular_set(data->light, 1.0, 1.0, 1.0, 1.0);
173 evas_canvas3d_light_specular_set(1.0, 1.0, 1.0, 1.0));
174 170
175 data->light_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 171 data->light_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
176 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_LIGHT));
177 172
178 eo_do(data->light_node, 173 evas_canvas3d_node_light_set(data->light_node, data->light);
179 evas_canvas3d_node_light_set(data->light), 174 evas_canvas3d_node_position_set(data->light_node, 5.0, 5.0, 10.0);
180 evas_canvas3d_node_position_set(5.0, 5.0, 10.0), 175 evas_canvas3d_node_look_at_set(data->light_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
181 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0,
182 EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0));
183 176
184 eo_do(data->root_node, evas_canvas3d_node_member_add(data->light_node)); 177 evas_canvas3d_node_member_add(data->root_node, data->light_node);
185} 178}
186 179
187static void 180static void
@@ -190,51 +183,44 @@ _mesh_setup(Scene_Data *data)
190 /* Setup material. */ 183 /* Setup material. */
191 data->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); 184 data->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
192 185
193 eo_do(data->material, 186 evas_canvas3d_material_enable_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE);
194 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE), 187 evas_canvas3d_material_enable_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE);
195 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE), 188 evas_canvas3d_material_enable_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE);
196 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE), 189 evas_canvas3d_material_color_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.2, 0.2, 0.2, 1.0);
197 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.2, 0.2, 0.2, 1.0), 190 evas_canvas3d_material_color_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.8, 0.8, 0.8, 1.0);
198 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.8, 0.8, 0.8, 1.0), 191 evas_canvas3d_material_color_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0);
199 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0), 192 evas_canvas3d_material_shininess_set(data->material, 100.0);
200 evas_canvas3d_material_shininess_set(100.0));
201 193
202 /* Setup primitive */ 194 /* Setup primitive */
203 data->cube = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); 195 data->cube = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas);
204 eo_do(data->cube, 196 evas_canvas3d_primitive_form_set(data->cube, EVAS_CANVAS3D_MESH_PRIMITIVE_CUBE);
205 evas_canvas3d_primitive_form_set(EVAS_CANVAS3D_MESH_PRIMITIVE_CUBE));
206 197
207 /* Setup mesh. */ 198 /* Setup mesh. */
208 data->mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); 199 data->mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas);
209 eo_do(data->mesh, 200 evas_canvas3d_mesh_from_primitive_set(data->mesh, 0, data->cube);
210 evas_canvas3d_mesh_from_primitive_set(0, data->cube), 201 evas_canvas3d_mesh_shade_mode_set(data->mesh, EVAS_CANVAS3D_SHADE_MODE_PHONG);
211 evas_canvas3d_mesh_shade_mode_set(EVAS_CANVAS3D_SHADE_MODE_PHONG), 202 evas_canvas3d_mesh_frame_material_set(data->mesh, 0, data->material);
212 evas_canvas3d_mesh_frame_material_set(0, data->material)); 203
213 204 data->mesh_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH));
214 data->mesh_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_MESH)); 205 evas_canvas3d_node_member_add(data->root_node, data->mesh_node);
215 eo_do(data->root_node, 206 evas_canvas3d_node_mesh_add(data->mesh_node, data->mesh);
216 evas_canvas3d_node_member_add(data->mesh_node));
217 eo_do(data->mesh_node, evas_canvas3d_node_mesh_add(data->mesh));
218} 207}
219 208
220static void 209static void
221_scene_setup(Scene_Data *data) 210_scene_setup(Scene_Data *data)
222{ 211{
223 scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas); 212 scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas);
224 data->root_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 213 data->root_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_NODE));
225 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_NODE));
226 214
227 eo_do(scene, 215 evas_canvas3d_scene_size_set(scene, WIDTH, HEIGHT);
228 evas_canvas3d_scene_size_set(WIDTH, HEIGHT), 216 evas_canvas3d_scene_background_color_set(scene, 0.0, 0.0, 0.0, 0.0);
229 evas_canvas3d_scene_background_color_set(0.0, 0.0, 0.0, 0.0));
230 217
231 _camera_setup(data); 218 _camera_setup(data);
232 _light_setup(data); 219 _light_setup(data);
233 _mesh_setup(data); 220 _mesh_setup(data);
234 221
235 eo_do(scene, 222 evas_canvas3d_scene_root_node_set(scene, data->root_node);
236 evas_canvas3d_scene_root_node_set(data->root_node), 223 evas_canvas3d_scene_camera_node_set(scene, data->camera_node);
237 evas_canvas3d_scene_camera_node_set(data->camera_node));
238 224
239 data->mouse_old_x = 0; 225 data->mouse_old_x = 0;
240 data->mouse_diff_x = 0; 226 data->mouse_diff_x = 0;
@@ -276,8 +262,7 @@ main(void)
276 evas_object_show(image); 262 evas_object_show(image);
277 263
278 /* Set the image object as render target for 3D scene. */ 264 /* Set the image object as render target for 3D scene. */
279 eo_do(image, 265 evas_obj_image_scene_set(image, scene);
280 evas_obj_image_scene_set(scene));
281 266
282 evas_object_focus_set(image, EINA_TRUE); 267 evas_object_focus_set(image, EINA_TRUE);
283 268
diff --git a/src/examples/evas/evas-3d-cube.c b/src/examples/evas/evas-3d-cube.c
index d3bcbbe..6f6f420 100644
--- a/src/examples/evas/evas-3d-cube.c
+++ b/src/examples/evas/evas-3d-cube.c
@@ -110,8 +110,8 @@ _on_canvas_resize(Ecore_Evas *ee)
110 int w, h; 110 int w, h;
111 111
112 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); 112 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
113 eo_do(background, efl_gfx_size_set(w, h)); 113 efl_gfx_size_set(background, w, h);
114 eo_do(image, efl_gfx_size_set(w, h)); 114 efl_gfx_size_set(image, w, h);
115} 115}
116 116
117static Eina_Bool 117static Eina_Bool
@@ -122,8 +122,7 @@ _animate_scene(void *data)
122 122
123 angle += 0.5; 123 angle += 0.5;
124 124
125 eo_do(scene->mesh_node, 125 evas_canvas3d_node_orientation_angle_axis_set(scene->mesh_node, angle, 1.0, 1.0, 1.0);
126 evas_canvas3d_node_orientation_angle_axis_set(angle, 1.0, 1.0, 1.0));
127 126
128 /* Rotate */ 127 /* Rotate */
129 if (angle > 360.0) angle -= 360.0f; 128 if (angle > 360.0) angle -= 360.0f;
@@ -136,38 +135,30 @@ _camera_setup(Scene_Data *data)
136{ 135{
137 data->camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas); 136 data->camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas);
138 137
139 eo_do(data->camera, 138 evas_canvas3d_camera_projection_perspective_set(data->camera, 60.0, 1.0, 2.0, 50.0);
140 evas_canvas3d_camera_projection_perspective_set(60.0, 1.0, 2.0, 50.0));
141 139
142 data->camera_node = 140 data->camera_node =
143 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 141 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
144 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_CAMERA)); 142 evas_canvas3d_node_camera_set(data->camera_node, data->camera);
145 eo_do(data->camera_node, 143 evas_canvas3d_node_position_set(data->camera_node, 0.0, 0.0, 10.0);
146 evas_canvas3d_node_camera_set(data->camera), 144 evas_canvas3d_node_look_at_set(data->camera_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
147 evas_canvas3d_node_position_set(0.0, 0.0, 10.0), 145 evas_canvas3d_node_member_add(data->root_node, data->camera_node);
148 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0,
149 EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0));
150 eo_do(data->root_node, evas_canvas3d_node_member_add(data->camera_node));
151} 146}
152 147
153static void 148static void
154_light_setup(Scene_Data *data) 149_light_setup(Scene_Data *data)
155{ 150{
156 data->light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas); 151 data->light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas);
157 eo_do(data->light, 152 evas_canvas3d_light_ambient_set(data->light, 0.2, 0.2, 0.2, 1.0);
158 evas_canvas3d_light_ambient_set(0.2, 0.2, 0.2, 1.0), 153 evas_canvas3d_light_diffuse_set(data->light, 1.0, 1.0, 1.0, 1.0);
159 evas_canvas3d_light_diffuse_set(1.0, 1.0, 1.0, 1.0), 154 evas_canvas3d_light_specular_set(data->light, 1.0, 1.0, 1.0, 1.0);
160 evas_canvas3d_light_specular_set(1.0, 1.0, 1.0, 1.0));
161 155
162 data->light_node = 156 data->light_node =
163 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 157 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
164 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_LIGHT)); 158 evas_canvas3d_node_light_set(data->light_node, data->light);
165 eo_do(data->light_node, 159 evas_canvas3d_node_position_set(data->light_node, 0.0, 0.0, 10.0);
166 evas_canvas3d_node_light_set(data->light), 160 evas_canvas3d_node_look_at_set(data->light_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
167 evas_canvas3d_node_position_set(0.0, 0.0, 10.0), 161 evas_canvas3d_node_member_add(data->root_node, data->light_node);
168 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0,
169 EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0));
170 eo_do(data->root_node, evas_canvas3d_node_member_add(data->light_node));
171} 162}
172static void 163static void
173_mesh_setup(Scene_Data *data) 164_mesh_setup(Scene_Data *data)
@@ -175,65 +166,49 @@ _mesh_setup(Scene_Data *data)
175 /* Setup material. */ 166 /* Setup material. */
176 data->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); 167 data->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
177 168
178 eo_do(data->material, 169 evas_canvas3d_material_enable_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE);
179 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE), 170 evas_canvas3d_material_enable_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE);
180 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE), 171 evas_canvas3d_material_enable_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE);
181 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE), 172 evas_canvas3d_material_color_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.2, 0.2, 0.2, 1.0);
182 173 evas_canvas3d_material_color_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.8, 0.8, 0.8, 1.0);
183 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.2, 0.2, 0.2, 1.0), 174 evas_canvas3d_material_color_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0);
184 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.8, 0.8, 0.8, 1.0), 175 evas_canvas3d_material_shininess_set(data->material, 100.0);
185 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0),
186 evas_canvas3d_material_shininess_set(100.0));
187 176
188 /* Setup mesh. */ 177 /* Setup mesh. */
189 data->mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); 178 data->mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas);
190 eo_do(data->mesh, 179 evas_canvas3d_mesh_vertex_count_set(data->mesh, 24);
191 evas_canvas3d_mesh_vertex_count_set(24), 180 evas_canvas3d_mesh_frame_add(data->mesh, 0);
192 evas_canvas3d_mesh_frame_add(0), 181 evas_canvas3d_mesh_frame_vertex_data_set(data->mesh, 0, EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION, 12 * sizeof(float), &cube_vertices[ 0]);
193 182 evas_canvas3d_mesh_frame_vertex_data_set(data->mesh, 0, EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL, 12 * sizeof(float), &cube_vertices[ 3]);
194 evas_canvas3d_mesh_frame_vertex_data_set(0, EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION, 183 evas_canvas3d_mesh_frame_vertex_data_set(data->mesh, 0, EVAS_CANVAS3D_VERTEX_ATTRIB_COLOR, 12 * sizeof(float), &cube_vertices[ 6]);
195 12 * sizeof(float), &cube_vertices[ 0]), 184 evas_canvas3d_mesh_frame_vertex_data_set(data->mesh, 0, EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD, 12 * sizeof(float), &cube_vertices[10]);
196 evas_canvas3d_mesh_frame_vertex_data_set(0, EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL, 185 evas_canvas3d_mesh_index_data_set(data->mesh, EVAS_CANVAS3D_INDEX_FORMAT_UNSIGNED_SHORT, 36, &cube_indices[0]);
197 12 * sizeof(float), &cube_vertices[ 3]), 186 evas_canvas3d_mesh_vertex_assembly_set(data->mesh, EVAS_CANVAS3D_VERTEX_ASSEMBLY_TRIANGLES);
198 evas_canvas3d_mesh_frame_vertex_data_set(0, EVAS_CANVAS3D_VERTEX_ATTRIB_COLOR, 187 evas_canvas3d_mesh_shade_mode_set(data->mesh, EVAS_CANVAS3D_SHADE_MODE_PHONG);
199 12 * sizeof(float), &cube_vertices[ 6]), 188 evas_canvas3d_mesh_frame_material_set(data->mesh, 0, data->material);
200 evas_canvas3d_mesh_frame_vertex_data_set(0, EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD,
201 12 * sizeof(float), &cube_vertices[10]),
202
203 evas_canvas3d_mesh_index_data_set(EVAS_CANVAS3D_INDEX_FORMAT_UNSIGNED_SHORT,
204 36, &cube_indices[0]),
205 evas_canvas3d_mesh_vertex_assembly_set(EVAS_CANVAS3D_VERTEX_ASSEMBLY_TRIANGLES),
206
207 evas_canvas3d_mesh_shade_mode_set(EVAS_CANVAS3D_SHADE_MODE_PHONG),
208
209 evas_canvas3d_mesh_frame_material_set(0, data->material));
210 189
211 data->mesh_node = 190 data->mesh_node =
212 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 191 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH));
213 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_MESH)); 192 evas_canvas3d_node_member_add(data->root_node, data->mesh_node);
214 eo_do(data->root_node, evas_canvas3d_node_member_add(data->mesh_node)); 193 evas_canvas3d_node_mesh_add(data->mesh_node, data->mesh);
215 eo_do(data->mesh_node, evas_canvas3d_node_mesh_add(data->mesh));
216} 194}
217 195
218static void 196static void
219_scene_setup(Scene_Data *data) 197_scene_setup(Scene_Data *data)
220{ 198{
221 data->scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas); 199 data->scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas);
222 eo_do(data->scene, 200 evas_canvas3d_scene_size_set(data->scene, WIDTH, HEIGHT);
223 evas_canvas3d_scene_size_set(WIDTH, HEIGHT); 201 evas_canvas3d_scene_background_color_set(data->scene, 0.0, 0.0, 0.0, 0.0);
224 evas_canvas3d_scene_background_color_set(0.0, 0.0, 0.0, 0.0));
225 202
226 data->root_node = 203 data->root_node =
227 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 204 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_NODE));
228 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_NODE));
229 205
230 _camera_setup(data); 206 _camera_setup(data);
231 _light_setup(data); 207 _light_setup(data);
232 _mesh_setup(data); 208 _mesh_setup(data);
233 209
234 eo_do(data->scene, 210 evas_canvas3d_scene_root_node_set(data->scene, data->root_node);
235 evas_canvas3d_scene_root_node_set(data->root_node), 211 evas_canvas3d_scene_camera_node_set(data->scene, data->camera_node);
236 evas_canvas3d_scene_camera_node_set(data->camera_node));
237} 212}
238 213
239int 214int
@@ -259,19 +234,17 @@ main(void)
259 234
260 /* Add a background rectangle objects. */ 235 /* Add a background rectangle objects. */
261 background = eo_add(EVAS_RECTANGLE_CLASS, evas); 236 background = eo_add(EVAS_RECTANGLE_CLASS, evas);
262 eo_do(background, 237 efl_gfx_color_set(background, 0, 0, 0, 255);
263 efl_gfx_color_set(0, 0, 0, 255), 238 efl_gfx_size_set(background, WIDTH, HEIGHT);
264 efl_gfx_size_set(WIDTH, HEIGHT), 239 efl_gfx_visible_set(background, EINA_TRUE);
265 efl_gfx_visible_set(EINA_TRUE));
266 240
267 /* Add an image object for 3D scene rendering. */ 241 /* Add an image object for 3D scene rendering. */
268 image = evas_object_image_filled_add(evas); 242 image = evas_object_image_filled_add(evas);
269 eo_do(image, 243 efl_gfx_size_set(image, WIDTH, HEIGHT);
270 efl_gfx_size_set(WIDTH, HEIGHT), 244 efl_gfx_visible_set(image, EINA_TRUE);
271 efl_gfx_visible_set(EINA_TRUE));
272 245
273 /* Set the image object as render target for 3D scene. */ 246 /* Set the image object as render target for 3D scene. */
274 eo_do(image, evas_obj_image_scene_set(data.scene)); 247 evas_obj_image_scene_set(image, data.scene);
275 248
276 /* Add animation timer callback. */ 249 /* Add animation timer callback. */
277 ecore_timer_add(0.016, _animate_scene, &data); 250 ecore_timer_add(0.016, _animate_scene, &data);
diff --git a/src/examples/evas/evas-3d-cube2.c b/src/examples/evas/evas-3d-cube2.c
index a2dd1fe..e46c2f7 100644
--- a/src/examples/evas/evas-3d-cube2.c
+++ b/src/examples/evas/evas-3d-cube2.c
@@ -79,8 +79,8 @@ _on_canvas_resize(Ecore_Evas *ee)
79 int w, h; 79 int w, h;
80 80
81 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); 81 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
82 eo_do(background, efl_gfx_size_set(w, h)); 82 efl_gfx_size_set(background, w, h);
83 eo_do(image, efl_gfx_size_set(w, h)); 83 efl_gfx_size_set(image, w, h);
84} 84}
85 85
86static Eina_Bool 86static Eina_Bool
@@ -93,8 +93,7 @@ _animate_scene(void *data)
93 93
94 angle += 0.2; 94 angle += 0.2;
95 95
96 eo_do(scene->mesh_node, 96 evas_canvas3d_node_orientation_angle_axis_set(scene->mesh_node, angle, 1.0, 1.0, 1.0);
97 evas_canvas3d_node_orientation_angle_axis_set(angle, 1.0, 1.0, 1.0));
98 97
99 /* Rotate */ 98 /* Rotate */
100 if (angle > 360.0) angle -= 360.0f; 99 if (angle > 360.0) angle -= 360.0f;
@@ -104,7 +103,7 @@ _animate_scene(void *data)
104 if (frame >= 20) inc = -1; 103 if (frame >= 20) inc = -1;
105 else if (frame <= 0) inc = 1; 104 else if (frame <= 0) inc = 1;
106 105
107 eo_do(scene->mesh_node, evas_canvas3d_node_mesh_frame_set(scene->mesh, frame)); 106 evas_canvas3d_node_mesh_frame_set(scene->mesh_node, scene->mesh, frame);
108 107
109 return EINA_TRUE; 108 return EINA_TRUE;
110} 109}
@@ -113,39 +112,30 @@ static void
113_camera_setup(Scene_Data *data) 112_camera_setup(Scene_Data *data)
114{ 113{
115 data->camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas); 114 data->camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas);
116 eo_do(data->camera, 115 evas_canvas3d_camera_projection_perspective_set(data->camera, 60.0, 1.0, 2.0, 50.0);
117 evas_canvas3d_camera_projection_perspective_set(60.0, 1.0, 2.0, 50.0));
118 116
119 data->camera_node = 117 data->camera_node =
120 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 118 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
121 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_CAMERA)); 119 evas_canvas3d_node_camera_set(data->camera_node, data->camera);
122 eo_do(data->camera_node, 120 evas_canvas3d_node_position_set(data->camera_node, 0.0, 0.0, 3.0);
123 evas_canvas3d_node_camera_set(data->camera), 121 evas_canvas3d_node_look_at_set(data->camera_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
124 evas_canvas3d_node_position_set(0.0, 0.0, 3.0), 122 evas_canvas3d_node_member_add(data->root_node, data->camera_node);
125 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0,
126 EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0));
127 eo_do(data->root_node,
128 evas_canvas3d_node_member_add(data->camera_node));
129} 123}
130 124
131static void 125static void
132_light_setup(Scene_Data *data) 126_light_setup(Scene_Data *data)
133{ 127{
134 data->light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas); 128 data->light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas);
135 eo_do(data->light, 129 evas_canvas3d_light_ambient_set(data->light, 0.2, 0.2, 0.2, 1.0);
136 evas_canvas3d_light_ambient_set(0.2, 0.2, 0.2, 1.0), 130 evas_canvas3d_light_diffuse_set(data->light, 1.0, 1.0, 1.0, 1.0);
137 evas_canvas3d_light_diffuse_set(1.0, 1.0, 1.0, 1.0), 131 evas_canvas3d_light_specular_set(data->light, 1.0, 1.0, 1.0, 1.0);
138 evas_canvas3d_light_specular_set(1.0, 1.0, 1.0, 1.0));
139 132
140 data->light_node = 133 data->light_node =
141 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 134 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
142 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_LIGHT)); 135 evas_canvas3d_node_light_set(data->light_node, data->light);
143 eo_do(data->light_node, 136 evas_canvas3d_node_position_set(data->light_node, 0.0, 0.0, 10.0);
144 evas_canvas3d_node_light_set(data->light), 137 evas_canvas3d_node_look_at_set(data->light_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
145 evas_canvas3d_node_position_set(0.0, 0.0, 10.0), 138 evas_canvas3d_node_member_add(data->root_node, data->light_node);
146 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0,
147 EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0));
148 eo_do(data->root_node, evas_canvas3d_node_member_add(data->light_node));
149} 139}
150 140
151static void 141static void
@@ -155,86 +145,70 @@ _mesh_setup(Scene_Data *data)
155 data->material0 = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); 145 data->material0 = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
156 data->material1 = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); 146 data->material1 = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
157 147
158 eo_do(data->material0, 148 evas_canvas3d_material_enable_set(data->material0, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE);
159 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE), 149 evas_canvas3d_material_enable_set(data->material0, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE);
160 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE), 150 evas_canvas3d_material_enable_set(data->material0, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE);
161 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE), 151 evas_canvas3d_material_enable_set(data->material0, EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE);
162 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE), 152 evas_canvas3d_material_color_set(data->material0, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.2, 0.2, 0.2, 1.0);
163 153 evas_canvas3d_material_color_set(data->material0, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.8, 0.8, 0.8, 1.0);
164 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.2, 0.2, 0.2, 1.0), 154 evas_canvas3d_material_color_set(data->material0, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0);
165 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.8, 0.8, 0.8, 1.0), 155 evas_canvas3d_material_shininess_set(data->material0, 100.0);
166 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0), 156
167 evas_canvas3d_material_shininess_set(100.0)); 157 evas_canvas3d_material_enable_set(data->material1, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE);
168 158 evas_canvas3d_material_enable_set(data->material1, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE);
169 eo_do(data->material1, 159 evas_canvas3d_material_enable_set(data->material1, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE);
170 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE), 160 evas_canvas3d_material_enable_set(data->material1, EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE);
171 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE), 161 evas_canvas3d_material_color_set(data->material1, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.2, 0.2, 0.2, 1.0);
172 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE), 162 evas_canvas3d_material_color_set(data->material1, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.8, 0.8, 0.8, 1.0);
173 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE), 163 evas_canvas3d_material_color_set(data->material1, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0);
174 164 evas_canvas3d_material_shininess_set(data->material1, 100.0);
175 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.2, 0.2, 0.2, 1.0),
176 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.8, 0.8, 0.8, 1.0),
177 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0),
178 evas_canvas3d_material_shininess_set(100.0));
179 165
180 data->texture0 = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); 166 data->texture0 = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas);
181 data->texture1 = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); 167 data->texture1 = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas);
182 data->texture_normal = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); 168 data->texture_normal = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas);
183 169
184 eo_do(data->texture0, 170 evas_canvas3d_texture_data_set(data->texture0, EVAS_COLORSPACE_ARGB8888, 4, 4, &pixels0[0]);
185 evas_canvas3d_texture_data_set(EVAS_COLORSPACE_ARGB8888, 4, 4, &pixels0[0])); 171 evas_canvas3d_texture_data_set(data->texture1, EVAS_COLORSPACE_ARGB8888, 4, 4, &pixels1[0]);
186 eo_do(data->texture1, 172 evas_canvas3d_texture_file_set(data->texture_normal, normal_map_path, NULL);
187 evas_canvas3d_texture_data_set(EVAS_COLORSPACE_ARGB8888, 4, 4, &pixels1[0]));
188 eo_do(data->texture_normal,
189 evas_canvas3d_texture_file_set(normal_map_path, NULL));
190 173
191 eo_do(data->material0, 174 evas_canvas3d_material_texture_set(data->material0, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, data->texture0);
192 evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, data->texture0)); 175 evas_canvas3d_material_texture_set(data->material1, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, data->texture1);
193 eo_do(data->material1, 176 evas_canvas3d_material_texture_set(data->material1, EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, data->texture_normal);
194 evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, data->texture1));
195 eo_do(data->material1,
196 evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, data->texture_normal));
197 177
198 /* Set data of primitive */ 178 /* Set data of primitive */
199 data->cube = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); 179 data->cube = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas);
200 eo_do(data->cube, 180 evas_canvas3d_primitive_form_set(data->cube, EVAS_CANVAS3D_MESH_PRIMITIVE_CUBE);
201 evas_canvas3d_primitive_form_set(EVAS_CANVAS3D_MESH_PRIMITIVE_CUBE));
202 181
203 /* Setup mesh. */ 182 /* Setup mesh. */
204 data->mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); 183 data->mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas);
205 eo_do(data->mesh, 184 evas_canvas3d_mesh_from_primitive_set(data->mesh, 0, data->cube);
206 evas_canvas3d_mesh_from_primitive_set(0, data->cube), 185 evas_canvas3d_mesh_frame_material_set(data->mesh, 0, data->material0);
207 evas_canvas3d_mesh_frame_material_set(0, data->material0), 186 evas_canvas3d_mesh_frame_add(data->mesh, 20);
208 evas_canvas3d_mesh_frame_add(20), 187 evas_canvas3d_mesh_frame_material_set(data->mesh, 20, data->material1);
209 evas_canvas3d_mesh_frame_material_set(20, data->material1), 188 evas_canvas3d_mesh_shade_mode_set(data->mesh, EVAS_CANVAS3D_SHADE_MODE_NORMAL_MAP);
210 evas_canvas3d_mesh_shade_mode_set(EVAS_CANVAS3D_SHADE_MODE_NORMAL_MAP));
211 189
212 data->mesh_node = 190 data->mesh_node =
213 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 191 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH));
214 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_MESH)); 192 evas_canvas3d_node_member_add(data->root_node, data->mesh_node);
215 eo_do(data->root_node, evas_canvas3d_node_member_add(data->mesh_node)); 193 evas_canvas3d_node_mesh_add(data->mesh_node, data->mesh);
216 eo_do(data->mesh_node, evas_canvas3d_node_mesh_add(data->mesh));
217} 194}
218 195
219static void 196static void
220_scene_setup(Scene_Data *data) 197_scene_setup(Scene_Data *data)
221{ 198{
222 data->scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas); 199 data->scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas);
223 eo_do(data->scene, 200 evas_canvas3d_scene_size_set(data->scene, WIDTH, HEIGHT);
224 evas_canvas3d_scene_size_set(WIDTH, HEIGHT), 201 evas_canvas3d_scene_background_color_set(data->scene, 0.0, 0.0, 0.0, 0.0);
225 evas_canvas3d_scene_background_color_set(0.0, 0.0, 0.0, 0.0));
226 202
227 data->root_node = 203 data->root_node =
228 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 204 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_NODE));
229 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_NODE));
230 205
231 _camera_setup(data); 206 _camera_setup(data);
232 _light_setup(data); 207 _light_setup(data);
233 _mesh_setup(data); 208 _mesh_setup(data);
234 209
235 eo_do(data->scene, 210 evas_canvas3d_scene_root_node_set(data->scene, data->root_node);
236 evas_canvas3d_scene_root_node_set(data->root_node), 211 evas_canvas3d_scene_camera_node_set(data->scene, data->camera_node);
237 evas_canvas3d_scene_camera_node_set(data->camera_node));
238} 212}
239 213
240int 214int
@@ -261,19 +235,17 @@ main(void)
261 235
262 /* Add a background rectangle objects. */ 236 /* Add a background rectangle objects. */
263 background = eo_add(EVAS_RECTANGLE_CLASS, evas); 237 background = eo_add(EVAS_RECTANGLE_CLASS, evas);
264 eo_do(background, 238 efl_gfx_color_set(background, 0, 0, 0, 255);
265 efl_gfx_color_set(0, 0, 0, 255), 239 efl_gfx_size_set(background, WIDTH, HEIGHT);
266 efl_gfx_size_set(WIDTH, HEIGHT), 240 efl_gfx_visible_set(background, EINA_TRUE);
267 efl_gfx_visible_set(EINA_TRUE));
268 241
269 /* Add an image object for 3D scene rendering. */ 242 /* Add an image object for 3D scene rendering. */
270 image = evas_object_image_filled_add(evas); 243 image = evas_object_image_filled_add(evas);
271 eo_do(image, 244 efl_gfx_size_set(image, WIDTH, HEIGHT);
272 efl_gfx_size_set(WIDTH, HEIGHT), 245 efl_gfx_visible_set(image, EINA_TRUE);
273 efl_gfx_visible_set(EINA_TRUE));
274 246
275 /* Set the image object as render target for 3D scene. */ 247 /* Set the image object as render target for 3D scene. */
276 eo_do(image, evas_obj_image_scene_set(data.scene)); 248 evas_obj_image_scene_set(image, data.scene);
277 249
278 /* Add animation timer callback. */ 250 /* Add animation timer callback. */
279 ecore_timer_add(0.01, _animate_scene, &data); 251 ecore_timer_add(0.01, _animate_scene, &data);
diff --git a/src/examples/evas/evas-3d-eet.c b/src/examples/evas/evas-3d-eet.c
index 9067825..dc09191 100644
--- a/src/examples/evas/evas-3d-eet.c
+++ b/src/examples/evas/evas-3d-eet.c
@@ -58,8 +58,7 @@ _animate_eet(void *data)
58{ 58{
59 angle += 0.5; 59 angle += 0.5;
60 60
61 eo_do((Evas_Canvas3D_Node *)data, 61 evas_canvas3d_node_orientation_angle_axis_set((Evas_Canvas3D_Node *)data, angle, 1.0, 1.0, 1.0);
62 evas_canvas3d_node_orientation_angle_axis_set(angle, 1.0, 1.0, 1.0));
63 62
64 /* Rotate */ 63 /* Rotate */
65 if (angle > 360.0) angle -= 360.0f; 64 if (angle > 360.0) angle -= 360.0f;
@@ -72,7 +71,7 @@ _animate_md2(void *data)
72{ 71{
73 static int frame = 0; 72 static int frame = 0;
74 73
75 eo_do((Evas_Canvas3D_Node *)data, evas_canvas3d_node_mesh_frame_set(mesh, frame)); 74 evas_canvas3d_node_mesh_frame_set((Evas_Canvas3D_Node *)data, mesh, frame);
76 75
77 frame += 32; 76 frame += 32;
78 77
@@ -93,8 +92,8 @@ _on_canvas_resize(Ecore_Evas *ee)
93 int w, h; 92 int w, h;
94 93
95 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); 94 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
96 eo_do(background, efl_gfx_size_set(w, h)); 95 efl_gfx_size_set(background, w, h);
97 eo_do(image, efl_gfx_size_set(w, h)); 96 efl_gfx_size_set(image, w, h);
98} 97}
99 98
100int 99int
@@ -119,113 +118,86 @@ main(void)
119 scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas); 118 scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas);
120 119
121 /* Add the root node for the scene. */ 120 /* Add the root node for the scene. */
122 root_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 121 root_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_NODE));
123 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_NODE));
124 122
125 /* Add the camera. */ 123 /* Add the camera. */
126 camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas); 124 camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas);
127 eo_do(camera, 125 evas_canvas3d_camera_projection_perspective_set(camera, 60.0, 1.0, 1.0, 500.0);
128 evas_canvas3d_camera_projection_perspective_set(60.0, 1.0, 1.0, 500.0)); 126
129 127 camera_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
130 camera_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 128 evas_canvas3d_node_camera_set(camera_node, camera);
131 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_CAMERA)); 129 evas_canvas3d_node_member_add(root_node, camera_node);
132 eo_do(camera_node, 130 evas_canvas3d_node_position_set(camera_node, 200.0, 0.0, 40.0);
133 evas_canvas3d_node_camera_set(camera)); 131 evas_canvas3d_node_look_at_set(camera_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 20.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 1.0);
134 eo_do(root_node,
135 evas_canvas3d_node_member_add(camera_node));
136 eo_do(camera_node,
137 evas_canvas3d_node_position_set(200.0, 0.0, 40.0),
138 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 20.0,
139 EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 1.0));
140 /* Add the light. */ 132 /* Add the light. */
141 light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas); 133 light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas);
142 eo_do(light, 134 evas_canvas3d_light_ambient_set(light, 1.0, 1.0, 1.0, 1.0);
143 evas_canvas3d_light_ambient_set(1.0, 1.0, 1.0, 1.0), 135 evas_canvas3d_light_diffuse_set(light, 1.0, 1.0, 1.0, 1.0);
144 evas_canvas3d_light_diffuse_set(1.0, 1.0, 1.0, 1.0), 136 evas_canvas3d_light_specular_set(light, 1.0, 1.0, 1.0, 1.0);
145 evas_canvas3d_light_specular_set(1.0, 1.0, 1.0, 1.0), 137 evas_canvas3d_light_directional_set(light, EINA_TRUE);
146 evas_canvas3d_light_directional_set(EINA_TRUE)); 138
147 139 light_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
148 light_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 140 evas_canvas3d_node_light_set(light_node, light);
149 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_LIGHT)); 141 evas_canvas3d_node_position_set(light_node, 1000.0, 0.0, 1000.0);
150 eo_do(light_node, 142 evas_canvas3d_node_look_at_set(light_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
151 evas_canvas3d_node_light_set(light), 143 evas_canvas3d_node_member_add(root_node, light_node);
152 evas_canvas3d_node_position_set(1000.0, 0.0, 1000.0),
153 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0,
154 EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0));
155 eo_do(root_node,
156 evas_canvas3d_node_member_add(light_node));
157 144
158 /* Add the meshes. */ 145 /* Add the meshes. */
159 mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); 146 mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas);
160 mesh2 = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); 147 mesh2 = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas);
161 material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); 148 material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
162 149
163 eo_do(mesh, 150 efl_file_set(mesh, input_model_path, NULL);
164 efl_file_set(input_model_path, NULL), 151 evas_canvas3d_mesh_frame_material_set(mesh, 0, material);
165 evas_canvas3d_mesh_frame_material_set(0, material), 152 evas_canvas3d_mesh_shade_mode_set(mesh, EVAS_CANVAS3D_SHADE_MODE_PHONG);
166 evas_canvas3d_mesh_shade_mode_set(EVAS_CANVAS3D_SHADE_MODE_PHONG)); 153
167 154 evas_canvas3d_material_enable_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE);
168 eo_do(material, 155 evas_canvas3d_material_enable_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE);
169 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE), 156 evas_canvas3d_material_enable_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE);
170 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE), 157 evas_canvas3d_material_enable_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE);
171 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE), 158 evas_canvas3d_material_color_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.50, 0.50, 0.00, 0.30);
172 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE), 159 evas_canvas3d_material_color_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.00, 0.50, 0.50, 0.30);
173 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 160 evas_canvas3d_material_color_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 0.50, 0.00, 0.50, 0.30);
174 0.50, 0.50, 0.00, 0.30), 161 evas_canvas3d_material_shininess_set(material, 50.0);
175 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE,
176 0.00, 0.50, 0.50, 0.30),
177 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR,
178 0.50, 0.00, 0.50, 0.30),
179 evas_canvas3d_material_shininess_set(50.0));
180 162
181 if (!ecore_file_mkpath(PACKAGE_EXAMPLES_DIR EVAS_SAVED_FILES)) 163 if (!ecore_file_mkpath(PACKAGE_EXAMPLES_DIR EVAS_SAVED_FILES))
182 fprintf(stderr, "Failed to create folder %s\n\n", 164 fprintf(stderr, "Failed to create folder %s\n\n",
183 PACKAGE_EXAMPLES_DIR EVAS_SAVED_FILES); 165 PACKAGE_EXAMPLES_DIR EVAS_SAVED_FILES);
184 166
185 eo_do(mesh, efl_file_save(output_model_path, NULL, NULL)); 167 efl_file_save(mesh, output_model_path, NULL, NULL);
186 168
187 eo_do(mesh2, 169 efl_file_set(mesh2, output_model_path, NULL);
188 efl_file_set(output_model_path, NULL), 170 evas_canvas3d_mesh_shade_mode_set(mesh2, EVAS_CANVAS3D_SHADE_MODE_PHONG);
189 evas_canvas3d_mesh_shade_mode_set(EVAS_CANVAS3D_SHADE_MODE_PHONG));
190 171
191 mesh_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 172 mesh_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH));
192 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_MESH));
193 173
194 eo_do(root_node, 174 evas_canvas3d_node_member_add(root_node, mesh_node);
195 evas_canvas3d_node_member_add(mesh_node)); 175 evas_canvas3d_node_mesh_add(mesh_node, mesh);
196 eo_do(mesh_node, 176 evas_canvas3d_node_position_set(mesh_node, 0.0, -40.0, 0.0);
197 evas_canvas3d_node_mesh_add(mesh),
198 evas_canvas3d_node_position_set(0.0, -40.0, 0.0));
199 177
200 mesh_node2 = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 178 mesh_node2 = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH));
201 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_MESH)); 179 evas_canvas3d_node_member_add(root_node, mesh_node2);
202 eo_do(root_node, 180 evas_canvas3d_node_mesh_add(mesh_node2, mesh2);
203 evas_canvas3d_node_member_add(mesh_node2)); 181 evas_canvas3d_node_position_set(mesh_node2, 0.0, 40.0, 0.0);
204 eo_do(mesh_node2,
205 evas_canvas3d_node_mesh_add(mesh2),
206 evas_canvas3d_node_position_set(0.0, 40.0, 0.0));
207 182
208 /* Set up scene. */ 183 /* Set up scene. */
209 eo_do(scene, 184 evas_canvas3d_scene_root_node_set(scene, root_node);
210 evas_canvas3d_scene_root_node_set(root_node), 185 evas_canvas3d_scene_camera_node_set(scene, camera_node);
211 evas_canvas3d_scene_camera_node_set(camera_node), 186 evas_canvas3d_scene_size_set(scene, WIDTH, HEIGHT);
212 evas_canvas3d_scene_size_set(WIDTH, HEIGHT));
213 187
214 /* Add a background rectangle objects. */ 188 /* Add a background rectangle objects. */
215 background = eo_add(EVAS_RECTANGLE_CLASS, evas); 189 background = eo_add(EVAS_RECTANGLE_CLASS, evas);
216 eo_do(background, 190 efl_gfx_color_set(background, 0, 0, 0, 255);
217 efl_gfx_color_set(0, 0, 0, 255), 191 efl_gfx_size_set(background, WIDTH, HEIGHT);
218 efl_gfx_size_set(WIDTH, HEIGHT), 192 efl_gfx_visible_set(background, EINA_TRUE);
219 efl_gfx_visible_set(EINA_TRUE));
220 193
221 /* Add an image object for 3D scene rendering. */ 194 /* Add an image object for 3D scene rendering. */
222 image = evas_object_image_filled_add(evas); 195 image = evas_object_image_filled_add(evas);
223 eo_do(image, 196 efl_gfx_size_set(image, WIDTH, HEIGHT);
224 efl_gfx_size_set(WIDTH, HEIGHT), 197 efl_gfx_visible_set(image, EINA_TRUE);
225 efl_gfx_visible_set(EINA_TRUE));
226 198
227 /* Set the image object as render target for 3D scene. */ 199 /* Set the image object as render target for 3D scene. */
228 eo_do(image, evas_obj_image_scene_set(scene)); 200 evas_obj_image_scene_set(image, scene);
229 201
230 ecore_timer_add(0.01, _animate_md2, mesh_node); 202 ecore_timer_add(0.01, _animate_md2, mesh_node);
231 ecore_timer_add(0.01, _animate_eet, mesh_node2); 203 ecore_timer_add(0.01, _animate_eet, mesh_node2);
diff --git a/src/examples/evas/evas-3d-fog.c b/src/examples/evas/evas-3d-fog.c
index 5d191e8..33bd05c 100644
--- a/src/examples/evas/evas-3d-fog.c
+++ b/src/examples/evas/evas-3d-fog.c
@@ -59,8 +59,8 @@ _on_canvas_resize(Ecore_Evas *ee)
59 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); 59 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
60 60
61 evas_object_resize(background, w, h); 61 evas_object_resize(background, w, h);
62 eo_do(background, efl_gfx_size_set(w, h)); 62 efl_gfx_size_set(background, w, h);
63 eo_do(image, efl_gfx_size_set(w, h)); 63 efl_gfx_size_set(image, w, h);
64} 64}
65 65
66static Eina_Bool 66static Eina_Bool
@@ -71,8 +71,7 @@ _animate_scene(void *data)
71 71
72 angle += 0.5; 72 angle += 0.5;
73 73
74 eo_do(scene->animation_node, 74 evas_canvas3d_node_orientation_angle_axis_set(scene->animation_node, angle, 0.0, 1.0, 0.0);
75 evas_canvas3d_node_orientation_angle_axis_set(angle, 0.0, 1.0, 0.0));
76 75
77 if (angle > 360.0) angle -= 360.0f; 76 if (angle > 360.0) angle -= 360.0f;
78 77
@@ -84,49 +83,40 @@ _camera_setup(Scene_Data *data)
84{ 83{
85 data->camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas); 84 data->camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas);
86 85
87 eo_do(data->camera, 86 evas_canvas3d_camera_projection_perspective_set(data->camera, 60.0, 1.0, 2.0, 50.0);
88 evas_canvas3d_camera_projection_perspective_set(60.0, 1.0, 2.0, 50.0));
89 87
90 data->camera_node = 88 data->camera_node =
91 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 89 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
92 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_CAMERA));
93 90
94 eo_do(data->camera_node, 91 evas_canvas3d_node_camera_set(data->camera_node, data->camera);
95 evas_canvas3d_node_camera_set(data->camera), 92 evas_canvas3d_node_position_set(data->camera_node, 0.0, 0.0, 7.0);
96 evas_canvas3d_node_position_set(0.0, 0.0, 7.0), 93 evas_canvas3d_node_look_at_set(data->camera_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
97 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0,
98 EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0));
99 94
100 eo_do(data->root_node, evas_canvas3d_node_member_add(data->camera_node)); 95 evas_canvas3d_node_member_add(data->root_node, data->camera_node);
101} 96}
102 97
103static void 98static void
104_light_setup(Scene_Data *data) 99_light_setup(Scene_Data *data)
105{ 100{
106 data->light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas); 101 data->light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas);
107 eo_do(data->light, 102 evas_canvas3d_light_ambient_set(data->light, 0.2, 0.2, 0.2, 1.0);
108 evas_canvas3d_light_ambient_set(0.2, 0.2, 0.2, 1.0), 103 evas_canvas3d_light_diffuse_set(data->light, 1.0, 1.0, 1.0, 1.0);
109 evas_canvas3d_light_diffuse_set(1.0, 1.0, 1.0, 1.0), 104 evas_canvas3d_light_specular_set(data->light, 1.0, 1.0, 1.0, 1.0);
110 evas_canvas3d_light_specular_set(1.0, 1.0, 1.0, 1.0));
111 105
112 data->light_node = 106 data->light_node =
113 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 107 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
114 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_LIGHT)); 108 evas_canvas3d_node_light_set(data->light_node, data->light);
115 eo_do(data->light_node, 109 evas_canvas3d_node_position_set(data->light_node, 0.0, 0.0, 10.0);
116 evas_canvas3d_node_light_set(data->light), 110 evas_canvas3d_node_look_at_set(data->light_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
117 evas_canvas3d_node_position_set(0.0, 0.0, 10.0), 111 evas_canvas3d_node_member_add(data->root_node, data->light_node);
118 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0,
119 EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0));
120 eo_do(data->root_node, evas_canvas3d_node_member_add(data->light_node));
121} 112}
122 113
123static void 114static void
124_set_ball(Eo *mesh, Eo *sphere, Evas_Canvas3D_Material *material) 115_set_ball(Eo *mesh, Eo *sphere, Evas_Canvas3D_Material *material)
125{ 116{
126 eo_do(mesh, 117 evas_canvas3d_mesh_from_primitive_set(mesh, 0, sphere);
127 evas_canvas3d_mesh_from_primitive_set(0, sphere), 118 evas_canvas3d_mesh_shade_mode_set(mesh, EVAS_CANVAS3D_SHADE_MODE_PHONG);
128 evas_canvas3d_mesh_shade_mode_set(EVAS_CANVAS3D_SHADE_MODE_PHONG), 119 evas_canvas3d_mesh_frame_material_set(mesh, 0, material);
129 evas_canvas3d_mesh_frame_material_set(0, material));
130} 120}
131 121
132 122
@@ -135,20 +125,17 @@ _mesh_setup(Scene_Data *data)
135{ 125{
136 data->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); 126 data->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
137 127
138 eo_do(data->material, 128 evas_canvas3d_material_enable_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE);
139 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE), 129 evas_canvas3d_material_enable_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE);
140 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE), 130 evas_canvas3d_material_enable_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE);
141 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE), 131 evas_canvas3d_material_color_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.2, 0.2, 0.2, 1.0);
142 132 evas_canvas3d_material_color_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.8, 0.8, 0.8, 1.0);
143 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.2, 0.2, 0.2, 1.0), 133 evas_canvas3d_material_color_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0);
144 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.8, 0.8, 0.8, 1.0), 134 evas_canvas3d_material_shininess_set(data->material, 100.0);
145 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0),
146 evas_canvas3d_material_shininess_set(100.0));
147 135
148 data->sphere = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); 136 data->sphere = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas);
149 eo_do(data->sphere, 137 evas_canvas3d_primitive_form_set(data->sphere, EVAS_CANVAS3D_MESH_PRIMITIVE_SPHERE);
150 evas_canvas3d_primitive_form_set(EVAS_CANVAS3D_MESH_PRIMITIVE_SPHERE), 138 evas_canvas3d_primitive_precision_set(data->sphere, 50);
151 evas_canvas3d_primitive_precision_set(50));
152 139
153 data->mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); 140 data->mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas);
154 data->mesh1 = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); 141 data->mesh1 = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas);
@@ -157,28 +144,27 @@ _mesh_setup(Scene_Data *data)
157 _set_ball(data->mesh1, data->sphere, data->material); 144 _set_ball(data->mesh1, data->sphere, data->material);
158 145
159 data->animation_node = 146 data->animation_node =
160 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 147 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_NODE));
161 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_NODE));
162 148
163 data->mesh_node = 149 data->mesh_node =
164 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 150 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH));
165 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_MESH));
166 151
167 eo_do(data->animation_node, evas_canvas3d_node_member_add(data->mesh_node)); 152 evas_canvas3d_node_member_add(data->animation_node, data->mesh_node);
168 eo_do(data->root_node, evas_canvas3d_node_member_add(data->animation_node)); 153 evas_canvas3d_node_member_add(data->root_node, data->animation_node);
169 eo_do(data->mesh_node, evas_canvas3d_node_mesh_add(data->mesh), 154 evas_canvas3d_node_mesh_add(data->mesh_node, data->mesh);
170 evas_canvas3d_node_position_set(0.0, 0.0, 3.0)); 155 evas_canvas3d_node_position_set(data->mesh_node, 0.0, 0.0, 3.0);
171 156
172 data->mesh_node1 = 157 data->mesh_node1 =
173 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 158 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH));
174 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_MESH));
175 159
176 eo_do(data->root_node, evas_canvas3d_node_member_add(data->mesh_node1)); 160 evas_canvas3d_node_member_add(data->root_node, data->mesh_node1);
177 eo_do(data->mesh_node1, evas_canvas3d_node_mesh_add(data->mesh1), 161 evas_canvas3d_node_mesh_add(data->mesh_node1, data->mesh1);
178 evas_canvas3d_node_scale_set(3, 3, 3)); 162 evas_canvas3d_node_scale_set(data->mesh_node1, 3, 3, 3);
179 163
180 eo_do(data->mesh, evas_canvas3d_mesh_fog_enable_set(EINA_TRUE), evas_canvas3d_mesh_fog_color_set(FOG_COLOR, FOG_FACTOR)); 164 evas_canvas3d_mesh_fog_enable_set(data->mesh, EINA_TRUE);
181 eo_do(data->mesh1, evas_canvas3d_mesh_fog_enable_set(EINA_TRUE), evas_canvas3d_mesh_fog_color_set(FOG_COLOR, FOG_FACTOR)); 165 evas_canvas3d_mesh_fog_color_set(data->mesh, FOG_COLOR, FOG_FACTOR);
166 evas_canvas3d_mesh_fog_enable_set(data->mesh1, EINA_TRUE);
167 evas_canvas3d_mesh_fog_color_set(data->mesh1, FOG_COLOR, FOG_FACTOR);
182} 168}
183 169
184static void 170static void
@@ -186,21 +172,18 @@ _scene_setup(Scene_Data *data)
186{ 172{
187 data->scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas); 173 data->scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas);
188 174
189 eo_do(data->scene, 175 evas_canvas3d_scene_size_set(data->scene, WIDTH, HEIGHT);
190 evas_canvas3d_scene_size_set(WIDTH, HEIGHT); 176 evas_canvas3d_scene_background_color_set(data->scene, FOG_COLOR, 1);
191 evas_canvas3d_scene_background_color_set(FOG_COLOR, 1));
192 177
193 data->root_node = 178 data->root_node =
194 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 179 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_NODE));
195 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_NODE));
196 180
197 _camera_setup(data); 181 _camera_setup(data);
198 _light_setup(data); 182 _light_setup(data);
199 _mesh_setup(data); 183 _mesh_setup(data);
200 184
201 eo_do(data->scene, 185 evas_canvas3d_scene_root_node_set(data->scene, data->root_node);
202 evas_canvas3d_scene_root_node_set(data->root_node), 186 evas_canvas3d_scene_camera_node_set(data->scene, data->camera_node);
203 evas_canvas3d_scene_camera_node_set(data->camera_node));
204} 187}
205 188
206int 189int
@@ -227,20 +210,18 @@ main(void)
227 210
228 /* Add a background rectangle objects. */ 211 /* Add a background rectangle objects. */
229 background = eo_add(EVAS_RECTANGLE_CLASS, evas); 212 background = eo_add(EVAS_RECTANGLE_CLASS, evas);
230 eo_do(background, 213 efl_gfx_color_set(background, 0, 0, 0, 255);
231 efl_gfx_color_set(0, 0, 0, 255), 214 efl_gfx_size_set(background, WIDTH, HEIGHT);
232 efl_gfx_size_set(WIDTH, HEIGHT), 215 efl_gfx_visible_set(background, EINA_TRUE);
233 efl_gfx_visible_set(EINA_TRUE));
234 216
235 /* Add an image object for 3D scene rendering. */ 217 /* Add an image object for 3D scene rendering. */
236 image = evas_object_image_filled_add(evas); 218 image = evas_object_image_filled_add(evas);
237 219
238 eo_do(image, 220 efl_gfx_size_set(image, WIDTH, HEIGHT);
239 efl_gfx_size_set(WIDTH, HEIGHT), 221 efl_gfx_visible_set(image, EINA_TRUE);
240 efl_gfx_visible_set(EINA_TRUE));
241 222
242 /* Set the image object as render target for 3D scene. */ 223 /* Set the image object as render target for 3D scene. */
243 eo_do(image, evas_obj_image_scene_set(data.scene)); 224 evas_obj_image_scene_set(image, data.scene);
244 225
245 /* Add animation timer callback. */ 226 /* Add animation timer callback. */
246 ecore_animator_frametime_set(0.008); 227 ecore_animator_frametime_set(0.008);
diff --git a/src/examples/evas/evas-3d-frustum.c b/src/examples/evas/evas-3d-frustum.c
index 94d43f2..4e1323f 100644
--- a/src/examples/evas/evas-3d-frustum.c
+++ b/src/examples/evas/evas-3d-frustum.c
@@ -100,18 +100,17 @@ _redraw_bounding_object(void *data)
100 Eo *current_mesh; 100 Eo *current_mesh;
101 Eina_List *meshes = NULL, *l; 101 Eina_List *meshes = NULL, *l;
102 102
103 eo_do(scene->mesh_node, meshes = (Eina_List *)evas_canvas3d_node_mesh_list_get()); 103 meshes = (Eina_List *)evas_canvas3d_node_mesh_list_get(scene->mesh_node);
104 EINA_LIST_FOREACH(meshes, l, current_mesh) 104 EINA_LIST_FOREACH(meshes, l, current_mesh)
105 { 105 {
106 eo_do(scene->mesh_node, evas_canvas3d_node_mesh_del(current_mesh)); 106 evas_canvas3d_node_mesh_del(scene->mesh_node, current_mesh);
107 } 107 }
108 108
109 switch (key) 109 switch (key)
110 { 110 {
111 case EVAS_CANVAS3D_FRUSTUM_MODE_BSPHERE: 111 case EVAS_CANVAS3D_FRUSTUM_MODE_BSPHERE:
112 { 112 {
113 eo_do(scene->mesh_node_model, 113 evas_canvas3d_node_bounding_sphere_get(scene->mesh_node_model, &x0, &y0, &z0, &rad);
114 evas_canvas3d_node_bounding_sphere_get(&x0, &y0, &z0, &rad));
115 current_mesh = scene->mesh_sphere; 114 current_mesh = scene->mesh_sphere;
116 px = x0; 115 px = x0;
117 py = y0; 116 py = y0;
@@ -121,9 +120,7 @@ _redraw_bounding_object(void *data)
121 } 120 }
122 case EVAS_CANVAS3D_FRUSTUM_MODE_AABB: 121 case EVAS_CANVAS3D_FRUSTUM_MODE_AABB:
123 { 122 {
124 eo_do(scene->mesh_node_model, 123 evas_canvas3d_node_bounding_box_get(scene->mesh_node_model, &x0, &y0, &z0, &x1, &y1, &z1);
125 evas_canvas3d_node_bounding_box_get(&x0, &y0, &z0,
126 &x1, &y1, &z1));
127 current_mesh = scene->mesh_aabb; 124 current_mesh = scene->mesh_aabb;
128 px = (x1 + x0) / 2; 125 px = (x1 + x0) / 2;
129 py = (y1 + y0) / 2; 126 py = (y1 + y0) / 2;
@@ -135,8 +132,7 @@ _redraw_bounding_object(void *data)
135 } 132 }
136 case EVAS_CANVAS3D_FRUSTUM_MODE_CENTRAL_POINT: 133 case EVAS_CANVAS3D_FRUSTUM_MODE_CENTRAL_POINT:
137 { 134 {
138 eo_do(scene->mesh_node_model, 135 evas_canvas3d_node_bounding_sphere_get(scene->mesh_node_model, &x0, &y0, &z0, &rad);
139 evas_canvas3d_node_bounding_sphere_get(&x0, &y0, &z0, &rad));
140 current_mesh = scene->mesh_sphere; 136 current_mesh = scene->mesh_sphere;
141 px = x0; 137 px = x0;
142 py = y0; 138 py = y0;
@@ -148,10 +144,9 @@ _redraw_bounding_object(void *data)
148 return ECORE_CALLBACK_RENEW; 144 return ECORE_CALLBACK_RENEW;
149 } 145 }
150 146
151 eo_do(scene->mesh_node, 147 evas_canvas3d_node_mesh_add(scene->mesh_node, current_mesh);
152 evas_canvas3d_node_mesh_add(current_mesh), 148 evas_canvas3d_node_position_set(scene->mesh_node, px, py, pz);
153 evas_canvas3d_node_position_set(px, py, pz), 149 evas_canvas3d_node_scale_set(scene->mesh_node, sx, sy, sz);
154 evas_canvas3d_node_scale_set(sx, sy, sz));
155 150
156 return ECORE_CALLBACK_RENEW; 151 return ECORE_CALLBACK_RENEW;
157} 152}
@@ -166,109 +161,97 @@ _on_key_down(void *data, Evas *e EINA_UNUSED, Evas_Object *eo EINA_UNUSED, void
166 if (!strcmp("w", ev->key)) 161 if (!strcmp("w", ev->key))
167 { 162 {
168 ffar += 20; 163 ffar += 20;
169 eo_do(scene->camera, evas_canvas3d_camera_projection_frustum_set(fleft, fright, fbottom, fup, fnear, ffar)); 164 evas_canvas3d_camera_projection_frustum_set(scene->camera, fleft, fright, fbottom, fup, fnear, ffar);
170 } 165 }
171 else if(!strcmp("s", ev->key)) 166 else if(!strcmp("s", ev->key))
172 { 167 {
173 ffar -= 20; 168 ffar -= 20;
174 eo_do(scene->camera, evas_canvas3d_camera_projection_frustum_set(fleft, fright, fbottom, fup, fnear, ffar)); 169 evas_canvas3d_camera_projection_frustum_set(scene->camera, fleft, fright, fbottom, fup, fnear, ffar);
175 } 170 }
176 else if(!strcmp("t", ev->key)) 171 else if(!strcmp("t", ev->key))
177 { 172 {
178 fnear += 2; 173 fnear += 2;
179 eo_do(scene->camera, evas_canvas3d_camera_projection_frustum_set(fleft, fright, fbottom, fup, fnear, ffar)); 174 evas_canvas3d_camera_projection_frustum_set(scene->camera, fleft, fright, fbottom, fup, fnear, ffar);
180 } 175 }
181 else if(!strcmp("g", ev->key)) 176 else if(!strcmp("g", ev->key))
182 { 177 {
183 fnear -= 2; 178 fnear -= 2;
184 eo_do(scene->camera, evas_canvas3d_camera_projection_frustum_set(fleft, fright, fbottom, fup, fnear, ffar)); 179 evas_canvas3d_camera_projection_frustum_set(scene->camera, fleft, fright, fbottom, fup, fnear, ffar);
185 } 180 }
186 else if(!strcmp("i", ev->key)) 181 else if(!strcmp("i", ev->key))
187 { 182 {
188 obj_y++; 183 obj_y++;
189 eo_do(scene->mesh_node_model, 184 evas_canvas3d_node_position_set(scene->mesh_node_model, obj_x, obj_y, obj_z);
190 evas_canvas3d_node_position_set(obj_x, obj_y, obj_z));
191 } 185 }
192 else if(!strcmp("k", ev->key)) 186 else if(!strcmp("k", ev->key))
193 { 187 {
194 obj_y--; 188 obj_y--;
195 eo_do(scene->mesh_node_model, 189 evas_canvas3d_node_position_set(scene->mesh_node_model, obj_x, obj_y, obj_z);
196 evas_canvas3d_node_position_set(obj_x, obj_y, obj_z));
197 } 190 }
198 else if(!strcmp("o", ev->key)) 191 else if(!strcmp("o", ev->key))
199 { 192 {
200 obj_z++; 193 obj_z++;
201 eo_do(scene->mesh_node_model, 194 evas_canvas3d_node_position_set(scene->mesh_node_model, obj_x, obj_y, obj_z);
202 evas_canvas3d_node_position_set(obj_x, obj_y, obj_z));
203 } 195 }
204 else if(!strcmp("u", ev->key)) 196 else if(!strcmp("u", ev->key))
205 { 197 {
206 obj_z--; 198 obj_z--;
207 eo_do(scene->mesh_node_model, 199 evas_canvas3d_node_position_set(scene->mesh_node_model, obj_x, obj_y, obj_z);
208 evas_canvas3d_node_position_set(obj_x, obj_y, obj_z));
209 } 200 }
210 else if(!strcmp("l", ev->key)) 201 else if(!strcmp("l", ev->key))
211 { 202 {
212 obj_x++; 203 obj_x++;
213 eo_do(scene->mesh_node_model, 204 evas_canvas3d_node_position_set(scene->mesh_node_model, obj_x, obj_y, obj_z);
214 evas_canvas3d_node_position_set(obj_x, obj_y, obj_z));
215 } 205 }
216 else if(!strcmp("j", ev->key)) 206 else if(!strcmp("j", ev->key))
217 { 207 {
218 obj_x--; 208 obj_x--;
219 eo_do(scene->mesh_node_model, 209 evas_canvas3d_node_position_set(scene->mesh_node_model, obj_x, obj_y, obj_z);
220 evas_canvas3d_node_position_set(obj_x, obj_y, obj_z));
221 } 210 }
222 else if(!strcmp("z", ev->key)) 211 else if(!strcmp("z", ev->key))
223 { 212 {
224 obj_sc_y+=0.02; 213 obj_sc_y+=0.02;
225 eo_do(scene->mesh_node_model, 214 evas_canvas3d_node_scale_set(scene->mesh_node_model, obj_sc_x, obj_sc_y, obj_sc_z);
226 evas_canvas3d_node_scale_set(obj_sc_x, obj_sc_y, obj_sc_z));
227 } 215 }
228 else if(!strcmp("Z", ev->key)) 216 else if(!strcmp("Z", ev->key))
229 { 217 {
230 obj_sc_y-=0.02; 218 obj_sc_y-=0.02;
231 eo_do(scene->mesh_node_model, 219 evas_canvas3d_node_scale_set(scene->mesh_node_model, obj_sc_x, obj_sc_y, obj_sc_z);
232 evas_canvas3d_node_scale_set(obj_sc_x, obj_sc_y, obj_sc_z));
233 } 220 }
234 else if(!strcmp("x", ev->key)) 221 else if(!strcmp("x", ev->key))
235 { 222 {
236 obj_sc_z+=0.02; 223 obj_sc_z+=0.02;
237 eo_do(scene->mesh_node_model, 224 evas_canvas3d_node_scale_set(scene->mesh_node_model, obj_sc_x, obj_sc_y, obj_sc_z);
238 evas_canvas3d_node_scale_set(obj_sc_x, obj_sc_y, obj_sc_z));
239 } 225 }
240 else if(!strcmp("X", ev->key)) 226 else if(!strcmp("X", ev->key))
241 { 227 {
242 obj_sc_z-=0.02; 228 obj_sc_z-=0.02;
243 eo_do(scene->mesh_node_model, 229 evas_canvas3d_node_scale_set(scene->mesh_node_model, obj_sc_x, obj_sc_y, obj_sc_z);
244 evas_canvas3d_node_scale_set(obj_sc_x, obj_sc_y, obj_sc_z));
245 } 230 }
246 else if(!strcmp("c", ev->key)) 231 else if(!strcmp("c", ev->key))
247 { 232 {
248 obj_sc_x+=0.02; 233 obj_sc_x+=0.02;
249 eo_do(scene->mesh_node_model, 234 evas_canvas3d_node_scale_set(scene->mesh_node_model, obj_sc_x, obj_sc_y, obj_sc_z);
250 evas_canvas3d_node_scale_set(obj_sc_x, obj_sc_y, obj_sc_z));
251 } 235 }
252 else if(!strcmp("C", ev->key)) 236 else if(!strcmp("C", ev->key))
253 { 237 {
254 obj_sc_x-=0.02; 238 obj_sc_x-=0.02;
255 eo_do(scene->mesh_node_model, 239 evas_canvas3d_node_scale_set(scene->mesh_node_model, obj_sc_x, obj_sc_y, obj_sc_z);
256 evas_canvas3d_node_scale_set(obj_sc_x, obj_sc_y, obj_sc_z));
257 } 240 }
258 else if(!strcmp("Return", ev->key)) 241 else if(!strcmp("Return", ev->key))
259 { 242 {
260 eo_do(scene->camera, evas_canvas3d_camera_projection_frustum_set(fleft, fright, fbottom, fup, fnear, ffar)); 243 evas_canvas3d_camera_projection_frustum_set(scene->camera, fleft, fright, fbottom, fup, fnear, ffar);
261 } 244 }
262 else if (!strcmp("1", ev->key)) 245 else if (!strcmp("1", ev->key))
263 { 246 {
264 eo_do(scene->camera_node, evas_canvas3d_node_position_set(0.0, 0.0, 300.0), 247 evas_canvas3d_node_position_set(scene->camera_node, 0.0, 0.0, 300.0);
265 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0)); 248 evas_canvas3d_node_look_at_set(scene->camera_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
266 fprintf(stdout, "Changed position and view of camera\n"); 249 fprintf(stdout, "Changed position and view of camera\n");
267 } 250 }
268 else if (!strcmp("2", ev->key)) 251 else if (!strcmp("2", ev->key))
269 { 252 {
270 eo_do(scene->camera_node, evas_canvas3d_node_position_set(300.0, 300.0, 300.0); 253 evas_canvas3d_node_position_set(scene->camera_node, 300.0, 300.0, 300.0);
271 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0)); 254 evas_canvas3d_node_look_at_set(scene->camera_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
272 fprintf(stdout, "Changed position and view of camera\n"); 255 fprintf(stdout, "Changed position and view of camera\n");
273 } 256 }
274 else if (!strcmp("3", ev->key)) 257 else if (!strcmp("3", ev->key))
@@ -289,7 +272,7 @@ _on_key_down(void *data, Evas *e EINA_UNUSED, Evas_Object *eo EINA_UNUSED, void
289 } 272 }
290 273
291 _redraw_bounding_object(data); 274 _redraw_bounding_object(data);
292 eo_do(scene->camera, frustum = evas_canvas3d_camera_node_visible_get(scene->camera_node, scene->mesh_node_model, key)); 275 frustum = evas_canvas3d_camera_node_visible_get(scene->camera, scene->camera_node, scene->mesh_node_model, key);
293 fprintf(stdout, "far - %f frustum - %d radius - %f\n", ffar, frustum, radius); 276 fprintf(stdout, "far - %f frustum - %d radius - %f\n", ffar, frustum, radius);
294} 277}
295