diff options
Diffstat (limited to 'src')
105 files changed, 507 insertions, 477 deletions
diff --git a/src/benchmarks/eo/eo_bench_callbacks.c b/src/benchmarks/eo/eo_bench_callbacks.c index ab779f8417..2114234411 100644 --- a/src/benchmarks/eo/eo_bench_callbacks.c +++ b/src/benchmarks/eo/eo_bench_callbacks.c @@ -17,7 +17,8 @@ static void bench_eo_callbacks_add(int request) { int i; - Eo *obj = eo_add(SIMPLE_CLASS, NULL); + Eo *obj = NULL; + eo_add(&obj, SIMPLE_CLASS, NULL); for (i = 0 ; i < request ; i++) { diff --git a/src/benchmarks/eo/eo_bench_eo_do.c b/src/benchmarks/eo/eo_bench_eo_do.c index 9f84535254..9160507c75 100644 --- a/src/benchmarks/eo/eo_bench_eo_do.c +++ b/src/benchmarks/eo/eo_bench_eo_do.c @@ -10,7 +10,8 @@ static void bench_eo_do_simple(int request) { int i; - Eo *obj = eo_add(SIMPLE_CLASS, NULL); + Eo *obj = NULL; + eo_add(&obj, SIMPLE_CLASS, NULL); for (i = 0 ; i < request ; i++) { simple_a_set(obj, i); @@ -23,8 +24,10 @@ static void bench_eo_do_two_objs(int request) { int i; - Eo *obj = eo_add(SIMPLE_CLASS, NULL); - Eo *obj2 = eo_add(SIMPLE_CLASS, NULL); + Eo *obj = NULL; + eo_add(&obj, SIMPLE_CLASS, NULL); + Eo *obj2 = NULL; + eo_add(&obj2, SIMPLE_CLASS, NULL); for (i = 0 ; i < request ; i++) { simple_a_set(obj, i); @@ -39,8 +42,10 @@ static void bench_eo_do_two_objs_growing_stack(int request) { int i; - Eo *obj = eo_add(SIMPLE_CLASS, NULL); - Eo *obj2 = eo_add(SIMPLE_CLASS, NULL); + Eo *obj = NULL; + eo_add(&obj, SIMPLE_CLASS, NULL); + Eo *obj2 = NULL; + eo_add(&obj2, SIMPLE_CLASS, NULL); for (i = 0 ; i < request ; i++) { simple_other_call(obj, obj2, 20); @@ -78,7 +83,8 @@ bench_eo_do_super(int request) cur_klass = eo_class_new(&class_desc, SIMPLE_CLASS, NULL); int i; - Eo *obj = eo_add(cur_klass, NULL); + Eo *obj = NULL; + eo_add(&obj, cur_klass, NULL); for (i = 0 ; i < request ; i++) { simple_a_set(obj, i); diff --git a/src/examples/ecore/ecore_audio_custom.c b/src/examples/ecore/ecore_audio_custom.c index 2570a9e20d..6eb1add105 100644 --- a/src/examples/ecore/ecore_audio_custom.c +++ b/src/examples/ecore/ecore_audio_custom.c @@ -56,9 +56,9 @@ main(int argc, const char *argv[]) ecore_app_args_set(argc, argv); - out = eo_add(ECORE_AUDIO_OBJ_OUT_PULSE_CLASS, NULL); + eo_add(&out, ECORE_AUDIO_OBJ_OUT_PULSE_CLASS, NULL); - in = eo_add(ECORE_AUDIO_OBJ_IN_CLASS, NULL); + eo_add(&in, ECORE_AUDIO_OBJ_IN_CLASS, NULL); if (!in) { printf("error when creating ecore audio source.\n"); diff --git a/src/examples/ecore/ecore_audio_playback.c b/src/examples/ecore/ecore_audio_playback.c index f1624e0e67..a6e6c5e20a 100644 --- a/src/examples/ecore/ecore_audio_playback.c +++ b/src/examples/ecore/ecore_audio_playback.c @@ -252,7 +252,7 @@ main(int argc, const char *argv[]) { if (!strncmp(argv[i], "tone:", 5)) { - in = eo_add(ECORE_AUDIO_OBJ_IN_TONE_CLASS, NULL); + eo_add(&in, ECORE_AUDIO_OBJ_IN_TONE_CLASS, NULL); if (!in) { printf("error when creating ecore audio source.\n"); @@ -276,7 +276,7 @@ main(int argc, const char *argv[]) } else { - in = eo_add(ECORE_AUDIO_OBJ_IN_SNDFILE_CLASS, NULL); + eo_add(&in, ECORE_AUDIO_OBJ_IN_SNDFILE_CLASS, NULL); if (!in) { printf("error when creating ecore audio source.\n"); @@ -307,7 +307,7 @@ main(int argc, const char *argv[]) printf("Start: %s (%0.2fs)\n", name, length); - out = eo_add(ECORE_AUDIO_OBJ_OUT_PULSE_CLASS, NULL); + eo_add(&out, ECORE_AUDIO_OBJ_OUT_PULSE_CLASS, NULL); ret = ecore_audio_obj_out_input_attach(out, in); if (!ret) printf("Could not attach input %s\n", name); diff --git a/src/examples/ecore/ecore_audio_to_ogg.c b/src/examples/ecore/ecore_audio_to_ogg.c index fceed59045..62e721b061 100644 --- a/src/examples/ecore/ecore_audio_to_ogg.c +++ b/src/examples/ecore/ecore_audio_to_ogg.c @@ -49,7 +49,7 @@ main(int argc, char *argv[]) ecore_audio_init(); - in = eo_add(ECORE_AUDIO_OBJ_IN_SNDFILE_CLASS, NULL); + eo_add(&in, ECORE_AUDIO_OBJ_IN_SNDFILE_CLASS, NULL); ecore_audio_obj_name_set(in, basename(argv[1])); ret = ecore_audio_obj_source_set(in, argv[1]); if (!ret) { @@ -60,7 +60,7 @@ main(int argc, char *argv[]) eo_event_callback_add(in, ECORE_AUDIO_EV_IN_STOPPED, _play_finished, NULL); - out = eo_add(ECORE_AUDIO_OBJ_OUT_SNDFILE_CLASS, NULL); + eo_add(&out, ECORE_AUDIO_OBJ_OUT_SNDFILE_CLASS, NULL); ret = ecore_audio_obj_source_set(out, argv[2]); if (!ret) { printf("Could not set %s as output\n", argv[2]); diff --git a/src/examples/eldbus/dbusmodel.c b/src/examples/eldbus/dbusmodel.c index b34799b4c5..3e4063ea6a 100644 --- a/src/examples/eldbus/dbusmodel.c +++ b/src/examples/eldbus/dbusmodel.c @@ -102,7 +102,7 @@ main(int argc, char **argv EINA_UNUSED) if (argc > 1) bus = argv[1]; if (argc > 2) path = argv[2]; - root = eo_add_ref(ELDBUS_MODEL_OBJECT_CLASS, NULL, eldbus_model_object_constructor(eoid, ELDBUS_CONNECTION_TYPE_SESSION, NULL, EINA_FALSE, bus, path)); + eo_add_ref(&root, ELDBUS_MODEL_OBJECT_CLASS, NULL, eldbus_model_object_constructor(root, ELDBUS_CONNECTION_TYPE_SESSION, NULL, EINA_FALSE, bus, path)); eo_event_callback_add(root, EFL_MODEL_BASE_EVENT_LOAD_STATUS, _event_load_status_cb, NULL); efl_model_load(root); diff --git a/src/examples/evas/evas-3d-aabb.c b/src/examples/evas/evas-3d-aabb.c index d02668bed0..a6761855f6 100644 --- a/src/examples/evas/evas-3d-aabb.c +++ b/src/examples/evas/evas-3d-aabb.c @@ -142,40 +142,38 @@ main(void) evas = ecore_evas_get(ecore_evas); - scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas); + eo_add(&scene, EVAS_CANVAS3D_SCENE_CLASS, evas); - root_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_NODE)); + eo_add(&root_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(root_node, EVAS_CANVAS3D_NODE_TYPE_NODE)); - camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas); + eo_add(&camera, EVAS_CANVAS3D_CAMERA_CLASS, evas); evas_canvas3d_camera_projection_perspective_set(camera, 60.0, 1.0, 1.0, 500.0); - camera_node = - eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_CAMERA)); + eo_add(&camera_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(camera_node, EVAS_CANVAS3D_NODE_TYPE_CAMERA)); evas_canvas3d_node_camera_set(camera_node, camera); evas_canvas3d_node_member_add(root_node, camera_node); evas_canvas3d_node_position_set(camera_node, 100.0, 50.0, 20.0); 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); - light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas); + eo_add(&light, EVAS_CANVAS3D_LIGHT_CLASS, evas); evas_canvas3d_light_ambient_set(light, 1.0, 1.0, 1.0, 1.0); evas_canvas3d_light_diffuse_set(light, 1.0, 1.0, 1.0, 1.0); evas_canvas3d_light_specular_set(light, 1.0, 1.0, 1.0, 1.0); evas_canvas3d_light_directional_set(light, EINA_TRUE); - light_node = - eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_LIGHT)); + eo_add(&light_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(light_node, EVAS_CANVAS3D_NODE_TYPE_LIGHT)); evas_canvas3d_node_light_set(light_node, light); evas_canvas3d_node_position_set(light_node, 1000.0, 0.0, 1000.0); 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); evas_canvas3d_node_member_add(root_node, light_node); - mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); - material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); + eo_add(&mesh, EVAS_CANVAS3D_MESH_CLASS, evas); + eo_add(&material, EVAS_CANVAS3D_MATERIAL_CLASS, evas); efl_file_set(mesh, model_path, NULL); evas_canvas3d_mesh_frame_material_set(mesh, 0, material); evas_canvas3d_mesh_shade_mode_set(mesh, EVAS_CANVAS3D_SHADE_MODE_PHONG); - texture = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); + eo_add(&texture, EVAS_CANVAS3D_TEXTURE_CLASS, evas); evas_canvas3d_texture_file_set(texture, image_path, NULL); evas_canvas3d_texture_filter_set(texture, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST); evas_canvas3d_texture_wrap_set(texture, EVAS_CANVAS3D_WRAP_MODE_REPEAT, EVAS_CANVAS3D_WRAP_MODE_REPEAT); @@ -189,16 +187,16 @@ main(void) evas_canvas3d_material_color_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0); evas_canvas3d_material_shininess_set(material, 50.0); - mesh_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH)); - mesh_box_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH)); + eo_add(&mesh_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(mesh_node, EVAS_CANVAS3D_NODE_TYPE_MESH)); + eo_add(&mesh_box_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(mesh_box_node, EVAS_CANVAS3D_NODE_TYPE_MESH)); - material_box = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); + eo_add(&material_box, EVAS_CANVAS3D_MATERIAL_CLASS, evas); evas_canvas3d_material_enable_set(material_box, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE); - cube = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); + eo_add(&cube, EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); evas_canvas3d_primitive_form_set(cube, EVAS_CANVAS3D_MESH_PRIMITIVE_CUBE); - mesh_box = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); + eo_add(&mesh_box, EVAS_CANVAS3D_MESH_CLASS, evas); evas_canvas3d_mesh_from_primitive_set(mesh_box, 0, cube); evas_canvas3d_mesh_vertex_assembly_set(mesh_box, EVAS_CANVAS3D_VERTEX_ASSEMBLY_LINES); evas_canvas3d_mesh_shade_mode_set(mesh_box, EVAS_CANVAS3D_SHADE_MODE_VERTEX_COLOR); @@ -215,7 +213,7 @@ main(void) evas_canvas3d_scene_camera_node_set(scene, camera_node); evas_canvas3d_scene_size_set(scene, WIDTH, HEIGHT); - background = eo_add(EVAS_RECTANGLE_CLASS, evas); + eo_add(&background, EVAS_RECTANGLE_CLASS, evas); efl_gfx_color_set(background, 0, 0, 0, 255); efl_gfx_size_set(background, WIDTH, HEIGHT); efl_gfx_visible_set(background, EINA_TRUE); diff --git a/src/examples/evas/evas-3d-blending.c b/src/examples/evas/evas-3d-blending.c index db7c7a1590..90ee461389 100644 --- a/src/examples/evas/evas-3d-blending.c +++ b/src/examples/evas/evas-3d-blending.c @@ -143,12 +143,11 @@ _animate_scene(void *data) static void _camera_setup(Scene_Data *data) { - data->camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas); + eo_add(&data->camera, EVAS_CANVAS3D_CAMERA_CLASS, evas); evas_canvas3d_camera_projection_perspective_set(data->camera, 60.0, 1.0, 2.0, 50.0); - data->camera_node = - eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_CAMERA)); + eo_add(&data->camera_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->camera_node, EVAS_CANVAS3D_NODE_TYPE_CAMERA)); evas_canvas3d_node_camera_set(data->camera_node, data->camera); evas_canvas3d_node_position_set(data->camera_node, 0.0, 0.0, 10.0); @@ -160,13 +159,12 @@ _camera_setup(Scene_Data *data) static void _light_setup(Scene_Data *data) { - data->light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas); + eo_add(&data->light, EVAS_CANVAS3D_LIGHT_CLASS, evas); evas_canvas3d_light_ambient_set(data->light, 0.2, 0.2, 0.2, 1.0); evas_canvas3d_light_diffuse_set(data->light, 1.0, 1.0, 1.0, 1.0); evas_canvas3d_light_specular_set(data->light, 1.0, 1.0, 1.0, 1.0); - data->light_node = - eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_LIGHT)); + eo_add(&data->light_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->light_node, EVAS_CANVAS3D_NODE_TYPE_LIGHT)); evas_canvas3d_node_light_set(data->light_node, data->light); evas_canvas3d_node_position_set(data->light_node, 0.0, 0.0, 10.0); 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); @@ -184,7 +182,7 @@ _set_ball(Eo *mesh, Eo *sphere, Evas_Canvas3D_Material *material) static void _mesh_setup(Scene_Data *data) { - data->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); + eo_add(&data->material, EVAS_CANVAS3D_MATERIAL_CLASS, evas); evas_canvas3d_material_enable_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE); evas_canvas3d_material_enable_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE); @@ -194,7 +192,7 @@ _mesh_setup(Scene_Data *data) evas_canvas3d_material_color_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 0.2); evas_canvas3d_material_shininess_set(data->material, 100.0); - data->material1 = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); + eo_add(&data->material1, EVAS_CANVAS3D_MATERIAL_CLASS, evas); evas_canvas3d_material_enable_set(data->material1, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE); evas_canvas3d_material_enable_set(data->material1, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE); @@ -204,24 +202,22 @@ _mesh_setup(Scene_Data *data) evas_canvas3d_material_color_set(data->material1, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 0.2); evas_canvas3d_material_shininess_set(data->material1, 100.0); - data->sphere = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); + eo_add(&data->sphere, EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); evas_canvas3d_primitive_form_set(data->sphere, EVAS_CANVAS3D_MESH_PRIMITIVE_SPHERE); evas_canvas3d_primitive_precision_set(data->sphere, 50); - data->mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); - data->mesh1 = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); + eo_add(&data->mesh, EVAS_CANVAS3D_MESH_CLASS, evas); + eo_add(&data->mesh1, EVAS_CANVAS3D_MESH_CLASS, evas); _set_ball(data->mesh, data->sphere, data->material); _set_ball(data->mesh1, data->sphere, data->material1); - data->mesh_node = - eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH)); + eo_add(&data->mesh_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->mesh_node, EVAS_CANVAS3D_NODE_TYPE_MESH)); evas_canvas3d_node_member_add(data->root_node, data->mesh_node); evas_canvas3d_node_mesh_add(data->mesh_node, data->mesh); - data->mesh_node1 = - eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH)); + eo_add(&data->mesh_node1, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->mesh_node1, EVAS_CANVAS3D_NODE_TYPE_MESH)); evas_canvas3d_node_member_add(data->root_node, data->mesh_node1); evas_canvas3d_node_mesh_add(data->mesh_node1, data->mesh1); @@ -237,13 +233,12 @@ _mesh_setup(Scene_Data *data) static void _scene_setup(Scene_Data *data) { - data->scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas); + eo_add(&data->scene, EVAS_CANVAS3D_SCENE_CLASS, evas); evas_canvas3d_scene_size_set(data->scene, WIDTH, HEIGHT); evas_canvas3d_scene_background_color_set(data->scene, 0.5, 0.5, 0.5, 1); - data->root_node = - eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_NODE)); + eo_add(&data->root_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->root_node, EVAS_CANVAS3D_NODE_TYPE_NODE)); _camera_setup(data); _light_setup(data); diff --git a/src/examples/evas/evas-3d-colorpick.c b/src/examples/evas/evas-3d-colorpick.c index 885a53bd81..4a7594bd6d 100644 --- a/src/examples/evas/evas-3d-colorpick.c +++ b/src/examples/evas/evas-3d-colorpick.c @@ -237,9 +237,9 @@ Eina_Bool _init_sphere(void *this, const char *texture) { Test_object *sphere = (Test_object *)this; - sphere->primitive = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); - sphere->mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); - sphere->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); + eo_add(&sphere->primitive, EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); + eo_add(&sphere->mesh, EVAS_CANVAS3D_MESH_CLASS, evas); + eo_add(&sphere->material, EVAS_CANVAS3D_MATERIAL_CLASS, evas); evas_canvas3d_primitive_form_set(sphere->primitive, EVAS_CANVAS3D_MESH_PRIMITIVE_SPHERE); evas_canvas3d_primitive_precision_set(sphere->primitive, 50); evas_canvas3d_mesh_from_primitive_set(sphere->mesh, 0, sphere->primitive); @@ -248,7 +248,7 @@ _init_sphere(void *this, const char *texture) evas_canvas3d_mesh_color_pick_enable_set(sphere->mesh, EINA_TRUE); - sphere->texture = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); + eo_add(&sphere->texture, EVAS_CANVAS3D_TEXTURE_CLASS, evas); evas_canvas3d_texture_file_set(sphere->texture, texture, NULL); evas_canvas3d_texture_filter_set(sphere->texture, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST); evas_canvas3d_texture_wrap_set(sphere->texture, EVAS_CANVAS3D_WRAP_MODE_REPEAT, EVAS_CANVAS3D_WRAP_MODE_REPEAT); @@ -313,7 +313,7 @@ _init_scene(const char *texture) m->material = spheretmp->material; m->texture = spheretmp->texture; } - m->node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH)); + eo_add(&m->node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(m->node, EVAS_CANVAS3D_NODE_TYPE_MESH)); m->speed = tmp; m->sphere_animate = _animate_sphere; m->animate = ecore_timer_add(m->speed, m->sphere_animate, m); diff --git a/src/examples/evas/evas-3d-cube-rotate.c b/src/examples/evas/evas-3d-cube-rotate.c index e393c14deb..74525cc014 100644 --- a/src/examples/evas/evas-3d-cube-rotate.c +++ b/src/examples/evas/evas-3d-cube-rotate.c @@ -148,10 +148,10 @@ _animate_scene(void *data) static void _camera_setup(Scene_Data *data) { - data->camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas); + eo_add(&data->camera, EVAS_CANVAS3D_CAMERA_CLASS, evas); evas_canvas3d_camera_projection_perspective_set(data->camera, 20.0, 1.0, 2.0, 50.0); - data->camera_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_CAMERA)); + eo_add(&data->camera_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->camera_node, EVAS_CANVAS3D_NODE_TYPE_CAMERA)); evas_canvas3d_node_camera_set(data->camera_node, data->camera); evas_canvas3d_node_position_set(data->camera_node, 3.0, 3.0, 10.0); 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); @@ -162,13 +162,13 @@ _camera_setup(Scene_Data *data) static void _light_setup(Scene_Data *data) { - data->light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas); + eo_add(&data->light, EVAS_CANVAS3D_LIGHT_CLASS, evas); evas_canvas3d_light_ambient_set(data->light, 0.2, 0.2, 0.2, 1.0); evas_canvas3d_light_diffuse_set(data->light, 1.0, 1.0, 1.0, 1.0); evas_canvas3d_light_specular_set(data->light, 1.0, 1.0, 1.0, 1.0); - data->light_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_LIGHT)); + eo_add(&data->light_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->light_node, EVAS_CANVAS3D_NODE_TYPE_LIGHT)); evas_canvas3d_node_light_set(data->light_node, data->light); evas_canvas3d_node_position_set(data->light_node, 5.0, 5.0, 10.0); @@ -181,7 +181,7 @@ static void _mesh_setup(Scene_Data *data) { /* Setup material. */ - data->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); + eo_add(&data->material, EVAS_CANVAS3D_MATERIAL_CLASS, evas); evas_canvas3d_material_enable_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE); evas_canvas3d_material_enable_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE); @@ -192,16 +192,16 @@ _mesh_setup(Scene_Data *data) evas_canvas3d_material_shininess_set(data->material, 100.0); /* Setup primitive */ - data->cube = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); + eo_add(&data->cube, EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); evas_canvas3d_primitive_form_set(data->cube, EVAS_CANVAS3D_MESH_PRIMITIVE_CUBE); /* Setup mesh. */ - data->mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); + eo_add(&data->mesh, EVAS_CANVAS3D_MESH_CLASS, evas); evas_canvas3d_mesh_from_primitive_set(data->mesh, 0, data->cube); evas_canvas3d_mesh_shade_mode_set(data->mesh, EVAS_CANVAS3D_SHADE_MODE_PHONG); evas_canvas3d_mesh_frame_material_set(data->mesh, 0, data->material); - data->mesh_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH)); + eo_add(&data->mesh_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->mesh_node, EVAS_CANVAS3D_NODE_TYPE_MESH)); evas_canvas3d_node_member_add(data->root_node, data->mesh_node); evas_canvas3d_node_mesh_add(data->mesh_node, data->mesh); } @@ -209,8 +209,8 @@ _mesh_setup(Scene_Data *data) static void _scene_setup(Scene_Data *data) { - scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas); - data->root_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_NODE)); + eo_add(&scene, EVAS_CANVAS3D_SCENE_CLASS, evas); + eo_add(&data->root_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->root_node, EVAS_CANVAS3D_NODE_TYPE_NODE)); evas_canvas3d_scene_size_set(scene, WIDTH, HEIGHT); evas_canvas3d_scene_background_color_set(scene, 0.0, 0.0, 0.0, 0.0); diff --git a/src/examples/evas/evas-3d-cube.c b/src/examples/evas/evas-3d-cube.c index 6f6f4208c2..be29e046c5 100644 --- a/src/examples/evas/evas-3d-cube.c +++ b/src/examples/evas/evas-3d-cube.c @@ -133,12 +133,11 @@ _animate_scene(void *data) static void _camera_setup(Scene_Data *data) { - data->camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas); + eo_add(&data->camera, EVAS_CANVAS3D_CAMERA_CLASS, evas); evas_canvas3d_camera_projection_perspective_set(data->camera, 60.0, 1.0, 2.0, 50.0); - data->camera_node = - eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_CAMERA)); + eo_add(&data->camera_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->camera_node, EVAS_CANVAS3D_NODE_TYPE_CAMERA)); evas_canvas3d_node_camera_set(data->camera_node, data->camera); evas_canvas3d_node_position_set(data->camera_node, 0.0, 0.0, 10.0); 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); @@ -148,13 +147,12 @@ _camera_setup(Scene_Data *data) static void _light_setup(Scene_Data *data) { - data->light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas); + eo_add(&data->light, EVAS_CANVAS3D_LIGHT_CLASS, evas); evas_canvas3d_light_ambient_set(data->light, 0.2, 0.2, 0.2, 1.0); evas_canvas3d_light_diffuse_set(data->light, 1.0, 1.0, 1.0, 1.0); evas_canvas3d_light_specular_set(data->light, 1.0, 1.0, 1.0, 1.0); - data->light_node = - eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_LIGHT)); + eo_add(&data->light_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->light_node, EVAS_CANVAS3D_NODE_TYPE_LIGHT)); evas_canvas3d_node_light_set(data->light_node, data->light); evas_canvas3d_node_position_set(data->light_node, 0.0, 0.0, 10.0); 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); @@ -164,7 +162,7 @@ static void _mesh_setup(Scene_Data *data) { /* Setup material. */ - data->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); + eo_add(&data->material, EVAS_CANVAS3D_MATERIAL_CLASS, evas); evas_canvas3d_material_enable_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE); evas_canvas3d_material_enable_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE); @@ -175,7 +173,7 @@ _mesh_setup(Scene_Data *data) evas_canvas3d_material_shininess_set(data->material, 100.0); /* Setup mesh. */ - data->mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); + eo_add(&data->mesh, EVAS_CANVAS3D_MESH_CLASS, evas); evas_canvas3d_mesh_vertex_count_set(data->mesh, 24); evas_canvas3d_mesh_frame_add(data->mesh, 0); evas_canvas3d_mesh_frame_vertex_data_set(data->mesh, 0, EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION, 12 * sizeof(float), &cube_vertices[ 0]); @@ -187,8 +185,7 @@ _mesh_setup(Scene_Data *data) evas_canvas3d_mesh_shade_mode_set(data->mesh, EVAS_CANVAS3D_SHADE_MODE_PHONG); evas_canvas3d_mesh_frame_material_set(data->mesh, 0, data->material); - data->mesh_node = - eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH)); + eo_add(&data->mesh_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->mesh_node, EVAS_CANVAS3D_NODE_TYPE_MESH)); evas_canvas3d_node_member_add(data->root_node, data->mesh_node); evas_canvas3d_node_mesh_add(data->mesh_node, data->mesh); } @@ -196,12 +193,11 @@ _mesh_setup(Scene_Data *data) static void _scene_setup(Scene_Data *data) { - data->scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas); + eo_add(&data->scene, EVAS_CANVAS3D_SCENE_CLASS, evas); evas_canvas3d_scene_size_set(data->scene, WIDTH, HEIGHT); evas_canvas3d_scene_background_color_set(data->scene, 0.0, 0.0, 0.0, 0.0); - data->root_node = - eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_NODE)); + eo_add(&data->root_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->root_node, EVAS_CANVAS3D_NODE_TYPE_NODE)); _camera_setup(data); _light_setup(data); @@ -233,7 +229,7 @@ main(void) _scene_setup(&data); /* Add a background rectangle objects. */ - background = eo_add(EVAS_RECTANGLE_CLASS, evas); + eo_add(&background, EVAS_RECTANGLE_CLASS, evas); efl_gfx_color_set(background, 0, 0, 0, 255); efl_gfx_size_set(background, WIDTH, HEIGHT); efl_gfx_visible_set(background, EINA_TRUE); diff --git a/src/examples/evas/evas-3d-cube2.c b/src/examples/evas/evas-3d-cube2.c index e46c2f7c64..387edd8cea 100644 --- a/src/examples/evas/evas-3d-cube2.c +++ b/src/examples/evas/evas-3d-cube2.c @@ -111,11 +111,10 @@ _animate_scene(void *data) static void _camera_setup(Scene_Data *data) { - data->camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas); + eo_add(&data->camera, EVAS_CANVAS3D_CAMERA_CLASS, evas); evas_canvas3d_camera_projection_perspective_set(data->camera, 60.0, 1.0, 2.0, 50.0); - data->camera_node = - eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_CAMERA)); + eo_add(&data->camera_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->camera_node, EVAS_CANVAS3D_NODE_TYPE_CAMERA)); evas_canvas3d_node_camera_set(data->camera_node, data->camera); evas_canvas3d_node_position_set(data->camera_node, 0.0, 0.0, 3.0); 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); @@ -125,13 +124,12 @@ _camera_setup(Scene_Data *data) static void _light_setup(Scene_Data *data) { - data->light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas); + eo_add(&data->light, EVAS_CANVAS3D_LIGHT_CLASS, evas); evas_canvas3d_light_ambient_set(data->light, 0.2, 0.2, 0.2, 1.0); evas_canvas3d_light_diffuse_set(data->light, 1.0, 1.0, 1.0, 1.0); evas_canvas3d_light_specular_set(data->light, 1.0, 1.0, 1.0, 1.0); - data->light_node = - eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_LIGHT)); + eo_add(&data->light_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->light_node, EVAS_CANVAS3D_NODE_TYPE_LIGHT)); evas_canvas3d_node_light_set(data->light_node, data->light); evas_canvas3d_node_position_set(data->light_node, 0.0, 0.0, 10.0); 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); @@ -142,8 +140,8 @@ static void _mesh_setup(Scene_Data *data) { /* Setup material. */ - data->material0 = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); - data->material1 = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); + eo_add(&data->material0, EVAS_CANVAS3D_MATERIAL_CLASS, evas); + eo_add(&data->material1, EVAS_CANVAS3D_MATERIAL_CLASS, evas); evas_canvas3d_material_enable_set(data->material0, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE); evas_canvas3d_material_enable_set(data->material0, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE); @@ -163,9 +161,9 @@ _mesh_setup(Scene_Data *data) evas_canvas3d_material_color_set(data->material1, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0); evas_canvas3d_material_shininess_set(data->material1, 100.0); - data->texture0 = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); - data->texture1 = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); - data->texture_normal = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); + eo_add(&data->texture0, EVAS_CANVAS3D_TEXTURE_CLASS, evas); + eo_add(&data->texture1, EVAS_CANVAS3D_TEXTURE_CLASS, evas); + eo_add(&data->texture_normal, EVAS_CANVAS3D_TEXTURE_CLASS, evas); evas_canvas3d_texture_data_set(data->texture0, EVAS_COLORSPACE_ARGB8888, 4, 4, &pixels0[0]); evas_canvas3d_texture_data_set(data->texture1, EVAS_COLORSPACE_ARGB8888, 4, 4, &pixels1[0]); @@ -176,19 +174,18 @@ _mesh_setup(Scene_Data *data) evas_canvas3d_material_texture_set(data->material1, EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, data->texture_normal); /* Set data of primitive */ - data->cube = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); + eo_add(&data->cube, EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); evas_canvas3d_primitive_form_set(data->cube, EVAS_CANVAS3D_MESH_PRIMITIVE_CUBE); /* Setup mesh. */ - data->mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); + eo_add(&data->mesh, EVAS_CANVAS3D_MESH_CLASS, evas); evas_canvas3d_mesh_from_primitive_set(data->mesh, 0, data->cube); evas_canvas3d_mesh_frame_material_set(data->mesh, 0, data->material0); evas_canvas3d_mesh_frame_add(data->mesh, 20); evas_canvas3d_mesh_frame_material_set(data->mesh, 20, data->material1); evas_canvas3d_mesh_shade_mode_set(data->mesh, EVAS_CANVAS3D_SHADE_MODE_NORMAL_MAP); - data->mesh_node = - eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH)); + eo_add(&data->mesh_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->mesh_node, EVAS_CANVAS3D_NODE_TYPE_MESH)); evas_canvas3d_node_member_add(data->root_node, data->mesh_node); evas_canvas3d_node_mesh_add(data->mesh_node, data->mesh); } @@ -196,12 +193,11 @@ _mesh_setup(Scene_Data *data) static void _scene_setup(Scene_Data *data) { - data->scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas); + eo_add(&data->scene, EVAS_CANVAS3D_SCENE_CLASS, evas); evas_canvas3d_scene_size_set(data->scene, WIDTH, HEIGHT); evas_canvas3d_scene_background_color_set(data->scene, 0.0, 0.0, 0.0, 0.0); - data->root_node = - eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_NODE)); + eo_add(&data->root_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->root_node, EVAS_CANVAS3D_NODE_TYPE_NODE)); _camera_setup(data); _light_setup(data); @@ -234,7 +230,7 @@ main(void) _scene_setup(&data); /* Add a background rectangle objects. */ - background = eo_add(EVAS_RECTANGLE_CLASS, evas); + eo_add(&background, EVAS_RECTANGLE_CLASS, evas); efl_gfx_color_set(background, 0, 0, 0, 255); efl_gfx_size_set(background, WIDTH, HEIGHT); efl_gfx_visible_set(background, EINA_TRUE); diff --git a/src/examples/evas/evas-3d-eet.c b/src/examples/evas/evas-3d-eet.c index dc09191e05..69fca120e8 100644 --- a/src/examples/evas/evas-3d-eet.c +++ b/src/examples/evas/evas-3d-eet.c @@ -115,37 +115,37 @@ main(void) evas = ecore_evas_get(ecore_evas); /* Add a scene object .*/ - scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas); + eo_add(&scene, EVAS_CANVAS3D_SCENE_CLASS, evas); /* Add the root node for the scene. */ - root_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_NODE)); + eo_add(&root_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(root_node, EVAS_CANVAS3D_NODE_TYPE_NODE)); /* Add the camera. */ - camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas); + eo_add(&camera, EVAS_CANVAS3D_CAMERA_CLASS, evas); evas_canvas3d_camera_projection_perspective_set(camera, 60.0, 1.0, 1.0, 500.0); - camera_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_CAMERA)); + eo_add(&camera_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(camera_node, EVAS_CANVAS3D_NODE_TYPE_CAMERA)); evas_canvas3d_node_camera_set(camera_node, camera); evas_canvas3d_node_member_add(root_node, camera_node); evas_canvas3d_node_position_set(camera_node, 200.0, 0.0, 40.0); 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); /* Add the light. */ - light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas); + eo_add(&light, EVAS_CANVAS3D_LIGHT_CLASS, evas); evas_canvas3d_light_ambient_set(light, 1.0, 1.0, 1.0, 1.0); evas_canvas3d_light_diffuse_set(light, 1.0, 1.0, 1.0, 1.0); evas_canvas3d_light_specular_set(light, 1.0, 1.0, 1.0, 1.0); evas_canvas3d_light_directional_set(light, EINA_TRUE); - light_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_LIGHT)); + eo_add(&light_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(light_node, EVAS_CANVAS3D_NODE_TYPE_LIGHT)); evas_canvas3d_node_light_set(light_node, light); evas_canvas3d_node_position_set(light_node, 1000.0, 0.0, 1000.0); 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); evas_canvas3d_node_member_add(root_node, light_node); /* Add the meshes. */ - mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); - mesh2 = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); - material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); + eo_add(&mesh, EVAS_CANVAS3D_MESH_CLASS, evas); + eo_add(&mesh2, EVAS_CANVAS3D_MESH_CLASS, evas); + eo_add(&material, EVAS_CANVAS3D_MATERIAL_CLASS, evas); efl_file_set(mesh, input_model_path, NULL); evas_canvas3d_mesh_frame_material_set(mesh, 0, material); @@ -169,13 +169,13 @@ main(void) efl_file_set(mesh2, output_model_path, NULL); evas_canvas3d_mesh_shade_mode_set(mesh2, EVAS_CANVAS3D_SHADE_MODE_PHONG); - mesh_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH)); + eo_add(&mesh_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(mesh_node, EVAS_CANVAS3D_NODE_TYPE_MESH)); evas_canvas3d_node_member_add(root_node, mesh_node); evas_canvas3d_node_mesh_add(mesh_node, mesh); evas_canvas3d_node_position_set(mesh_node, 0.0, -40.0, 0.0); - mesh_node2 = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH)); + eo_add(&mesh_node2, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(mesh_node2, EVAS_CANVAS3D_NODE_TYPE_MESH)); evas_canvas3d_node_member_add(root_node, mesh_node2); evas_canvas3d_node_mesh_add(mesh_node2, mesh2); evas_canvas3d_node_position_set(mesh_node2, 0.0, 40.0, 0.0); @@ -186,7 +186,7 @@ main(void) evas_canvas3d_scene_size_set(scene, WIDTH, HEIGHT); /* Add a background rectangle objects. */ - background = eo_add(EVAS_RECTANGLE_CLASS, evas); + eo_add(&background, EVAS_RECTANGLE_CLASS, evas); efl_gfx_color_set(background, 0, 0, 0, 255); efl_gfx_size_set(background, WIDTH, HEIGHT); efl_gfx_visible_set(background, EINA_TRUE); diff --git a/src/examples/evas/evas-3d-fog.c b/src/examples/evas/evas-3d-fog.c index 33bd05cc8c..bc33f92c48 100644 --- a/src/examples/evas/evas-3d-fog.c +++ b/src/examples/evas/evas-3d-fog.c @@ -81,12 +81,11 @@ _animate_scene(void *data) static void _camera_setup(Scene_Data *data) { - data->camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas); + eo_add(&data->camera, EVAS_CANVAS3D_CAMERA_CLASS, evas); evas_canvas3d_camera_projection_perspective_set(data->camera, 60.0, 1.0, 2.0, 50.0); - data->camera_node = - eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_CAMERA)); + eo_add(&data->camera_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->camera_node, EVAS_CANVAS3D_NODE_TYPE_CAMERA)); evas_canvas3d_node_camera_set(data->camera_node, data->camera); evas_canvas3d_node_position_set(data->camera_node, 0.0, 0.0, 7.0); @@ -98,13 +97,12 @@ _camera_setup(Scene_Data *data) static void _light_setup(Scene_Data *data) { - data->light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas); + eo_add(&data->light, EVAS_CANVAS3D_LIGHT_CLASS, evas); evas_canvas3d_light_ambient_set(data->light, 0.2, 0.2, 0.2, 1.0); evas_canvas3d_light_diffuse_set(data->light, 1.0, 1.0, 1.0, 1.0); evas_canvas3d_light_specular_set(data->light, 1.0, 1.0, 1.0, 1.0); - data->light_node = - eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_LIGHT)); + eo_add(&data->light_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->light_node, EVAS_CANVAS3D_NODE_TYPE_LIGHT)); evas_canvas3d_node_light_set(data->light_node, data->light); evas_canvas3d_node_position_set(data->light_node, 0.0, 0.0, 10.0); 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); @@ -123,7 +121,7 @@ _set_ball(Eo *mesh, Eo *sphere, Evas_Canvas3D_Material *material) static void _mesh_setup(Scene_Data *data) { - data->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); + eo_add(&data->material, EVAS_CANVAS3D_MATERIAL_CLASS, evas); evas_canvas3d_material_enable_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE); evas_canvas3d_material_enable_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE); @@ -133,29 +131,26 @@ _mesh_setup(Scene_Data *data) evas_canvas3d_material_color_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0); evas_canvas3d_material_shininess_set(data->material, 100.0); - data->sphere = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); + eo_add(&data->sphere, EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); evas_canvas3d_primitive_form_set(data->sphere, EVAS_CANVAS3D_MESH_PRIMITIVE_SPHERE); evas_canvas3d_primitive_precision_set(data->sphere, 50); - data->mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); - data->mesh1 = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); + eo_add(&data->mesh, EVAS_CANVAS3D_MESH_CLASS, evas); + eo_add(&data->mesh1, EVAS_CANVAS3D_MESH_CLASS, evas); _set_ball(data->mesh, data->sphere, data->material); _set_ball(data->mesh1, data->sphere, data->material); - data->animation_node = - eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_NODE)); + eo_add(&data->animation_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->animation_node, EVAS_CANVAS3D_NODE_TYPE_NODE)); - data->mesh_node = - eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH)); + eo_add(&data->mesh_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->mesh_node, EVAS_CANVAS3D_NODE_TYPE_MESH)); evas_canvas3d_node_member_add(data->animation_node, data->mesh_node); evas_canvas3d_node_member_add(data->root_node, data->animation_node); evas_canvas3d_node_mesh_add(data->mesh_node, data->mesh); evas_canvas3d_node_position_set(data->mesh_node, 0.0, 0.0, 3.0); - data->mesh_node1 = - eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH)); + eo_add(&data->mesh_node1, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->mesh_node1, EVAS_CANVAS3D_NODE_TYPE_MESH)); evas_canvas3d_node_member_add(data->root_node, data->mesh_node1); evas_canvas3d_node_mesh_add(data->mesh_node1, data->mesh1); @@ -170,13 +165,12 @@ _mesh_setup(Scene_Data *data) static void _scene_setup(Scene_Data *data) { - data->scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas); + eo_add(&data->scene, EVAS_CANVAS3D_SCENE_CLASS, evas); evas_canvas3d_scene_size_set(data->scene, WIDTH, HEIGHT); evas_canvas3d_scene_background_color_set(data->scene, FOG_COLOR, 1); - data->root_node = - eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_NODE)); + eo_add(&data->root_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->root_node, EVAS_CANVAS3D_NODE_TYPE_NODE)); _camera_setup(data); _light_setup(data); @@ -209,7 +203,7 @@ main(void) _scene_setup(&data); /* Add a background rectangle objects. */ - background = eo_add(EVAS_RECTANGLE_CLASS, evas); + eo_add(&background, EVAS_RECTANGLE_CLASS, evas); efl_gfx_color_set(background, 0, 0, 0, 255); efl_gfx_size_set(background, WIDTH, HEIGHT); efl_gfx_visible_set(background, EINA_TRUE); diff --git a/src/examples/evas/evas-3d-frustum.c b/src/examples/evas/evas-3d-frustum.c index 4e1323f5b4..25cfc5b8d4 100644 --- a/src/examples/evas/evas-3d-frustum.c +++ b/src/examples/evas/evas-3d-frustum.c @@ -279,8 +279,8 @@ _on_key_down(void *data, Evas *e EINA_UNUSED, Evas_Object *eo EINA_UNUSED, void static void _camera_setup(Scene_Data *data) { - data->camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas); - data->camera_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_CAMERA)); + eo_add(&data->camera, EVAS_CANVAS3D_CAMERA_CLASS, evas); + eo_add(&data->camera_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->camera_node, EVAS_CANVAS3D_NODE_TYPE_CAMERA)); evas_canvas3d_node_camera_set(data->camera_node, data->camera); evas_canvas3d_node_position_set(data->camera_node, 0.0, 0.0, 300.0); 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); @@ -293,12 +293,12 @@ _camera_setup(Scene_Data *data) static void _light_setup(Scene_Data *data) { - data->light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas); + eo_add(&data->light, EVAS_CANVAS3D_LIGHT_CLASS, evas); evas_canvas3d_light_ambient_set(data->light, 0.2, 0.2, 0.2, 1.0); evas_canvas3d_light_diffuse_set(data->light, 1.0, 1.0, 1.0, 1.0); evas_canvas3d_light_specular_set(data->light, 1.0, 1.0, 1.0, 1.0); - data->light_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_LIGHT)); + eo_add(&data->light_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->light_node, EVAS_CANVAS3D_NODE_TYPE_LIGHT)); evas_canvas3d_node_light_set(data->light_node, data->light); evas_canvas3d_node_position_set(data->light_node, 0.0, 0.0, 200.0); 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, 0.0, 1.0); @@ -309,7 +309,7 @@ _light_setup(Scene_Data *data) static void _mesh_setup(Scene_Data *data) { - data->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); + eo_add(&data->material, EVAS_CANVAS3D_MATERIAL_CLASS, evas); evas_canvas3d_material_enable_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE); evas_canvas3d_material_enable_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE); @@ -319,27 +319,26 @@ _mesh_setup(Scene_Data *data) evas_canvas3d_material_color_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0); evas_canvas3d_material_shininess_set(data->material, 100.0); - data->cube = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); + eo_add(&data->cube, EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); evas_canvas3d_primitive_form_set(data->cube, EVAS_CANVAS3D_MESH_PRIMITIVE_CUBE); - data->sphere = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); + eo_add(&data->sphere, EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); evas_canvas3d_primitive_form_set(data->sphere, EVAS_CANVAS3D_MESH_PRIMITIVE_SPHERE); evas_canvas3d_primitive_precision_set(data->sphere, 20); - data->mesh_aabb = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); + eo_add(&data->mesh_aabb, EVAS_CANVAS3D_MESH_CLASS, evas); evas_canvas3d_mesh_from_primitive_set(data->mesh_aabb, 0, data->cube); evas_canvas3d_mesh_vertex_assembly_set(data->mesh_aabb, EVAS_CANVAS3D_VERTEX_ASSEMBLY_LINES); evas_canvas3d_mesh_shade_mode_set(data->mesh_aabb, EVAS_CANVAS3D_SHADE_MODE_DIFFUSE); evas_canvas3d_mesh_frame_material_set(data->mesh_aabb, 0, data->material); - data->mesh_sphere = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); + eo_add(&data->mesh_sphere, EVAS_CANVAS3D_MESH_CLASS, evas); evas_canvas3d_mesh_from_primitive_set(data->mesh_sphere, 0, data->sphere); evas_canvas3d_mesh_vertex_assembly_set(data->mesh_sphere, EVAS_CANVAS3D_VERTEX_ASSEMBLY_LINES); evas_canvas3d_mesh_shade_mode_set(data->mesh_sphere, EVAS_CANVAS3D_SHADE_MODE_DIFFUSE); evas_canvas3d_mesh_frame_material_set(data->mesh_sphere, 0, data->material); - data->mesh_node = - eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH)); + eo_add(&data->mesh_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->mesh_node, EVAS_CANVAS3D_NODE_TYPE_MESH)); evas_canvas3d_node_member_add(data->root_node, data->mesh_node); evas_canvas3d_node_mesh_add(data->mesh_node, data->mesh_aabb); } @@ -347,9 +346,9 @@ _mesh_setup(Scene_Data *data) static void _mesh_setup_model(Scene_Data *data) { - data->mesh_model = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); - data->material_model = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); - data->texture_model = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); + eo_add(&data->mesh_model, EVAS_CANVAS3D_MESH_CLASS, evas); + eo_add(&data->material_model, EVAS_CANVAS3D_MATERIAL_CLASS, evas); + eo_add(&data->texture_model, EVAS_CANVAS3D_TEXTURE_CLASS, evas); evas_canvas3d_texture_file_set(data->texture_model, texture_path, NULL); evas_canvas3d_texture_filter_set(data->texture_model, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST); @@ -374,15 +373,15 @@ _mesh_setup_model(Scene_Data *data) static void _scene_setup(Scene_Data *data) { - data->scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas); + eo_add(&data->scene, EVAS_CANVAS3D_SCENE_CLASS, evas); - data->root_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_NODE)); + eo_add(&data->root_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->root_node, EVAS_CANVAS3D_NODE_TYPE_NODE)); _light_setup(data); _mesh_setup_model(data); _camera_setup(data); - data->mesh_node_model = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH)); + eo_add(&data->mesh_node_model, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->mesh_node_model, EVAS_CANVAS3D_NODE_TYPE_MESH)); evas_canvas3d_node_position_set(data->mesh_node_model, obj_x, obj_y, obj_z); evas_canvas3d_node_orientation_angle_axis_set(data->mesh_node_model, -90, 1.0, 0.0, 0.0); evas_canvas3d_node_scale_set(data->mesh_node_model, obj_sc_x, obj_sc_y, obj_sc_z); diff --git a/src/examples/evas/evas-3d-hull.c b/src/examples/evas/evas-3d-hull.c index 57602b6988..130ad3742e 100644 --- a/src/examples/evas/evas-3d-hull.c +++ b/src/examples/evas/evas-3d-hull.c @@ -255,12 +255,11 @@ _key_down(void *data, static void _camera_setup(Scene_Data *data) { - data->camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas); + eo_add(&data->camera, EVAS_CANVAS3D_CAMERA_CLASS, evas); evas_canvas3d_camera_projection_perspective_set(data->camera, 60.0, 1.0, 2.0, 50.0); - data->camera_node = - eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_CAMERA)); + eo_add(&data->camera_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->camera_node, EVAS_CANVAS3D_NODE_TYPE_CAMERA)); evas_canvas3d_node_camera_set(data->camera_node, data->camera); evas_canvas3d_node_position_set(data->camera_node, 0.0, 0.0, 10.0); 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); @@ -270,13 +269,12 @@ _camera_setup(Scene_Data *data) static void _light_setup(Scene_Data *data) { - data->light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas); + eo_add(&data->light, EVAS_CANVAS3D_LIGHT_CLASS, evas); evas_canvas3d_light_ambient_set(data->light, 0.2, 0.2, 0.2, 1.0); evas_canvas3d_light_diffuse_set(data->light, 1.0, 1.0, 1.0, 1.0); evas_canvas3d_light_specular_set(data->light, 1.0, 1.0, 1.0, 1.0); - data->light_node = - eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_LIGHT)); + eo_add(&data->light_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->light_node, EVAS_CANVAS3D_NODE_TYPE_LIGHT)); evas_canvas3d_node_light_set(data->light_node, data->light); evas_canvas3d_node_position_set(data->light_node, 0.0, 0.0, 10.0); 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); @@ -292,7 +290,7 @@ _mesh_setup(Scene_Data *data) Eo *primitive = NULL; /* Setup material. */ - data->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); + eo_add(&data->material, EVAS_CANVAS3D_MATERIAL_CLASS, evas); evas_canvas3d_material_enable_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE); evas_canvas3d_material_enable_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE); evas_canvas3d_material_enable_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE); @@ -302,17 +300,17 @@ _mesh_setup(Scene_Data *data) evas_canvas3d_material_shininess_set(data->material, 100.0); /* Setup mesh sphere */ - primitive = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); + eo_add(&primitive, EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); evas_canvas3d_primitive_form_set(primitive, EVAS_CANVAS3D_MESH_PRIMITIVE_SPHERE); evas_canvas3d_primitive_precision_set(primitive, 10); - data->mesh_sphere = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); + eo_add(&data->mesh_sphere, EVAS_CANVAS3D_MESH_CLASS, evas); evas_canvas3d_mesh_from_primitive_set(data->mesh_sphere, 0, primitive); evas_canvas3d_mesh_vertex_assembly_set(data->mesh_sphere, EVAS_CANVAS3D_VERTEX_ASSEMBLY_TRIANGLES); evas_canvas3d_mesh_shade_mode_set(data->mesh_sphere, EVAS_CANVAS3D_SHADE_MODE_PHONG); evas_canvas3d_mesh_frame_material_set(data->mesh_sphere, 0, data->material); /* Setup mesh torus */ - data->mesh_torus = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); + eo_add(&data->mesh_torus, EVAS_CANVAS3D_MESH_CLASS, evas); evas_canvas3d_primitive_form_set(primitive, EVAS_CANVAS3D_MESH_PRIMITIVE_TORUS); evas_canvas3d_primitive_precision_set(primitive, 50); evas_canvas3d_mesh_from_primitive_set(data->mesh_torus, 0, primitive); @@ -321,7 +319,7 @@ _mesh_setup(Scene_Data *data) evas_canvas3d_mesh_frame_material_set(data->mesh_torus, 0, data->material); /* Setup mesh cube */ - data->mesh_cube = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); + eo_add(&data->mesh_cube, EVAS_CANVAS3D_MESH_CLASS, evas); evas_canvas3d_primitive_form_set(primitive, EVAS_CANVAS3D_MESH_PRIMITIVE_CUBE); evas_canvas3d_primitive_precision_set(primitive, 50); evas_canvas3d_mesh_from_primitive_set(data->mesh_cube, 0, primitive); @@ -353,8 +351,7 @@ _mesh_setup(Scene_Data *data) MODEL_MESH_INIT(blender_test_eagle, eagle_test, DIFFUSE) MODEL_MESH_INIT(blender_test_sonic, sonic_test, DIFFUSE) - data->mesh_node = - eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH)); + eo_add(&data->mesh_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->mesh_node, EVAS_CANVAS3D_NODE_TYPE_MESH)); evas_canvas3d_node_member_add(data->root_node, data->mesh_node); evas_canvas3d_node_mesh_add(data->mesh_node, data->mesh_sphere); evas_canvas3d_node_scale_set(data->mesh_node, SCALE_SPHERE, SCALE_SPHERE, SCALE_SPHERE); @@ -371,15 +368,13 @@ _mesh_setup(Scene_Data *data) _print_result(data->mesh_sphere_ch, data->mesh_blender_test_sphere); - data->mesh_node_convex_hull = - eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH)); + eo_add(&data->mesh_node_convex_hull, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->mesh_node_convex_hull, EVAS_CANVAS3D_NODE_TYPE_MESH)); evas_canvas3d_node_member_add(data->root_node, data->mesh_node_convex_hull); evas_canvas3d_node_position_set(data->mesh_node_convex_hull, 0.0, 0.0, 0.0); evas_canvas3d_node_scale_set(data->mesh_node_convex_hull, SCALE_SPHERE, SCALE_SPHERE, SCALE_SPHERE); evas_canvas3d_node_mesh_add(data->mesh_node_convex_hull, data->mesh_sphere_ch); - data->mesh_node_blender = - eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH)); + eo_add(&data->mesh_node_blender, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->mesh_node_blender, EVAS_CANVAS3D_NODE_TYPE_MESH)); evas_canvas3d_node_member_add(data->root_node, data->mesh_node_blender); evas_canvas3d_node_position_set(data->mesh_node_blender, -3.0, 0.0, 0.0); evas_canvas3d_node_scale_set(data->mesh_node_blender, SCALE_SPHERE, SCALE_SPHERE, SCALE_SPHERE); @@ -389,12 +384,11 @@ _mesh_setup(Scene_Data *data) static void _scene_setup(Scene_Data *data) { - data->scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas); + eo_add(&data->scene, EVAS_CANVAS3D_SCENE_CLASS, evas); evas_canvas3d_scene_size_set(data->scene, WIDTH, HEIGHT); evas_canvas3d_scene_background_color_set(data->scene, 0.0, 0.0, 0.0, 0.0); - data->root_node = - eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_NODE)); + eo_add(&data->root_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->root_node, EVAS_CANVAS3D_NODE_TYPE_NODE)); _camera_setup(data); _light_setup(data); @@ -429,7 +423,7 @@ main(void) _scene_setup(&data); /* Add a background rectangle objects. */ - background = eo_add(EVAS_RECTANGLE_CLASS, evas); + eo_add(&background, EVAS_RECTANGLE_CLASS, evas); efl_gfx_color_set(background, 0, 0, 0, 255); efl_gfx_size_set(background, WIDTH, HEIGHT); efl_gfx_visible_set(background, EINA_TRUE); diff --git a/src/examples/evas/evas-3d-md2.c b/src/examples/evas/evas-3d-md2.c index e19dfd6630..443271a9dc 100644 --- a/src/examples/evas/evas-3d-md2.c +++ b/src/examples/evas/evas-3d-md2.c @@ -91,44 +91,42 @@ main(void) evas = ecore_evas_get(ecore_evas); /* Add a scene object .*/ - scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas); + eo_add(&scene, EVAS_CANVAS3D_SCENE_CLASS, evas); /* Add the root node for the scene. */ - root_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_NODE)); + eo_add(&root_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(root_node, EVAS_CANVAS3D_NODE_TYPE_NODE)); /* Add the camera. */ - camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas); + eo_add(&camera, EVAS_CANVAS3D_CAMERA_CLASS, evas); evas_canvas3d_camera_projection_perspective_set(camera, 60.0, 1.0, 1.0, 500.0); - camera_node = - eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_CAMERA)); + eo_add(&camera_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(camera_node, EVAS_CANVAS3D_NODE_TYPE_CAMERA)); evas_canvas3d_node_camera_set(camera_node, camera); evas_canvas3d_node_member_add(root_node, camera_node); evas_canvas3d_node_position_set(camera_node, 100.0, 0.0, 20.0); 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); /* Add the light. */ - light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas); + eo_add(&light, EVAS_CANVAS3D_LIGHT_CLASS, evas); evas_canvas3d_light_ambient_set(light, 1.0, 1.0, 1.0, 1.0); evas_canvas3d_light_diffuse_set(light, 1.0, 1.0, 1.0, 1.0); evas_canvas3d_light_specular_set(light, 1.0, 1.0, 1.0, 1.0); evas_canvas3d_light_directional_set(light, EINA_TRUE); - light_node = - eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_LIGHT)); + eo_add(&light_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(light_node, EVAS_CANVAS3D_NODE_TYPE_LIGHT)); evas_canvas3d_node_light_set(light_node, light); evas_canvas3d_node_position_set(light_node, 1000.0, 0.0, 1000.0); 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); evas_canvas3d_node_member_add(root_node, light_node); /* Add the mesh. */ - mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); - material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); + eo_add(&mesh, EVAS_CANVAS3D_MESH_CLASS, evas); + eo_add(&material, EVAS_CANVAS3D_MATERIAL_CLASS, evas); efl_file_set(mesh, model_path, NULL); evas_canvas3d_mesh_frame_material_set(mesh, 0, material); evas_canvas3d_mesh_shade_mode_set(mesh, EVAS_CANVAS3D_SHADE_MODE_PHONG); - texture = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); + eo_add(&texture, EVAS_CANVAS3D_TEXTURE_CLASS, evas); evas_canvas3d_texture_file_set(texture, image_path, NULL); evas_canvas3d_texture_filter_set(texture, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST); evas_canvas3d_texture_wrap_set(texture, EVAS_CANVAS3D_WRAP_MODE_REPEAT, EVAS_CANVAS3D_WRAP_MODE_REPEAT); @@ -142,7 +140,7 @@ main(void) evas_canvas3d_material_color_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0); evas_canvas3d_material_shininess_set(material, 50.0); - mesh_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH)); + eo_add(&mesh_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(mesh_node, EVAS_CANVAS3D_NODE_TYPE_MESH)); evas_canvas3d_node_member_add(root_node, mesh_node); evas_canvas3d_node_mesh_add(mesh_node, mesh); @@ -152,7 +150,7 @@ main(void) evas_canvas3d_scene_size_set(scene, WIDTH, HEIGHT); /* Add a background rectangle objects. */ - background = eo_add(EVAS_RECTANGLE_CLASS, evas); + eo_add(&background, EVAS_RECTANGLE_CLASS, evas); efl_gfx_color_set(background, 0, 0, 0, 255); efl_gfx_size_set(background, WIDTH, HEIGHT); efl_gfx_visible_set(background, EINA_TRUE); diff --git a/src/examples/evas/evas-3d-mmap-set.c b/src/examples/evas/evas-3d-mmap-set.c index 000204d2e8..2432a4b6a3 100644 --- a/src/examples/evas/evas-3d-mmap-set.c +++ b/src/examples/evas/evas-3d-mmap-set.c @@ -181,36 +181,34 @@ main(void) evas = ecore_evas_get(ecore_evas); /* Add a scene object .*/ - scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas); + eo_add(&scene, EVAS_CANVAS3D_SCENE_CLASS, evas); /* Add the root node for the scene. */ - root_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_NODE)); + eo_add(&root_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(root_node, EVAS_CANVAS3D_NODE_TYPE_NODE)); /* Add the camera. */ - camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas); + eo_add(&camera, EVAS_CANVAS3D_CAMERA_CLASS, evas); evas_canvas3d_camera_projection_perspective_set(camera, 10.0, 1.0, 1.0, 500.0); - camera_node = - eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_CAMERA)); + eo_add(&camera_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(camera_node, EVAS_CANVAS3D_NODE_TYPE_CAMERA)); evas_canvas3d_node_camera_set(camera_node, camera); evas_canvas3d_node_member_add(root_node, camera_node); evas_canvas3d_node_position_set(camera_node, 0.0, 0.0, 100.0); evas_canvas3d_node_look_at_set(camera_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0); /* Add the light. */ - light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas); + eo_add(&light, EVAS_CANVAS3D_LIGHT_CLASS, evas); evas_canvas3d_light_ambient_set(light, 1.0, 1.0, 1.0, 1.0); evas_canvas3d_light_diffuse_set(light, 1.0, 1.0, 1.0, 1.0); evas_canvas3d_light_specular_set(light, 1.0, 1.0, 1.0, 1.0); evas_canvas3d_light_directional_set(light, EINA_TRUE); - light_node = - eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_LIGHT)); + eo_add(&light_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(light_node, EVAS_CANVAS3D_NODE_TYPE_LIGHT)); evas_canvas3d_node_light_set(light_node, light); evas_canvas3d_node_position_set(light_node, 1.0, 0.0, 100.0); 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); evas_canvas3d_node_member_add(root_node, light_node); - material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); + eo_add(&material, EVAS_CANVAS3D_MATERIAL_CLASS, evas); evas_canvas3d_material_enable_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE); evas_canvas3d_material_enable_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE); @@ -233,7 +231,7 @@ main(void) evas_canvas3d_scene_size_set(scene, WIDTH, HEIGHT); /* Add a background rectangle objects. */ - background = eo_add(EVAS_RECTANGLE_CLASS, evas); + eo_add(&background, EVAS_RECTANGLE_CLASS, evas); efl_gfx_color_set(background, 20, 20, 200, 255); efl_gfx_size_set(background, WIDTH, HEIGHT); efl_gfx_visible_set(background, EINA_TRUE); diff --git a/src/examples/evas/evas-3d-obj.c b/src/examples/evas/evas-3d-obj.c index b9a6b69bd1..f2623f4779 100644 --- a/src/examples/evas/evas-3d-obj.c +++ b/src/examples/evas/evas-3d-obj.c @@ -63,7 +63,7 @@ ADD_OBJ_MESH(buffer, Y + COPY_OFFSET, Z, num + 4, shade_mode, name_of_material) #define ADD_TEXTURE(name, path) \ - name = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); \ + eo_add(&name, EVAS_CANVAS3D_TEXTURE_CLASS, evas); \ evas_canvas3d_texture_file_set(name, path, NULL); \ evas_canvas3d_texture_filter_set(name, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST, \ EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST); \ @@ -71,7 +71,7 @@ EVAS_CANVAS3D_WRAP_MODE_REPEAT); #define ADD_MATERIAL(name) \ - name = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); \ + eo_add(&name, EVAS_CANVAS3D_MATERIAL_CLASS, evas); \ evas_canvas3d_material_enable_set(name, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE); \ evas_canvas3d_material_enable_set(name, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE); \ evas_canvas3d_material_enable_set(name, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE); \ @@ -157,30 +157,28 @@ main(void) evas = ecore_evas_get(ecore_evas); /* Add a scene object .*/ - scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas); + eo_add(&scene, EVAS_CANVAS3D_SCENE_CLASS, evas); /* Add the root node for the scene. */ - root_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_NODE)); + eo_add(&root_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(root_node, EVAS_CANVAS3D_NODE_TYPE_NODE)); /* Add the camera. */ - camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas); + eo_add(&camera, EVAS_CANVAS3D_CAMERA_CLASS, evas); evas_canvas3d_camera_projection_perspective_set(camera, 20.0, 1.0, 1.0, 500.0); - camera_node = - eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_CAMERA)); + eo_add(&camera_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(camera_node, EVAS_CANVAS3D_NODE_TYPE_CAMERA)); evas_canvas3d_node_camera_set(camera_node, camera); evas_canvas3d_node_member_add(root_node, camera_node); evas_canvas3d_node_position_set(camera_node, 100.0, 0.0, 0.0); evas_canvas3d_node_look_at_set(camera_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 1.0); /* Add the light. */ - light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas); + eo_add(&light, EVAS_CANVAS3D_LIGHT_CLASS, evas); evas_canvas3d_light_ambient_set(light, 1.0, 1.0, 1.0, 1.0); evas_canvas3d_light_diffuse_set(light, 1.0, 1.0, 1.0, 1.0); evas_canvas3d_light_specular_set(light, 1.0, 1.0, 1.0, 1.0); evas_canvas3d_light_directional_set(light, EINA_TRUE); - light_node = - eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_LIGHT)); + eo_add(&light_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(light_node, EVAS_CANVAS3D_NODE_TYPE_LIGHT)); evas_canvas3d_node_light_set(light_node, light); evas_canvas3d_node_position_set(light_node, 10.0, 0.0, 0.0); 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); @@ -212,7 +210,7 @@ main(void) evas_canvas3d_scene_size_set(scene, WIDTH, HEIGHT); /* Add a background rectangle MESHES. */ - background = eo_add(EVAS_RECTANGLE_CLASS, evas); + eo_add(&background, EVAS_RECTANGLE_CLASS, evas); efl_gfx_color_set(background, 0, 0, 0, 255); efl_gfx_size_set(background, WIDTH, HEIGHT); efl_gfx_visible_set(background, EINA_TRUE); diff --git a/src/examples/evas/evas-3d-parallax-occlusion.c b/src/examples/evas/evas-3d-parallax-occlusion.c index 67be66536d..b096dc838b 100644 --- a/src/examples/evas/evas-3d-parallax-occlusion.c +++ b/src/examples/evas/evas-3d-parallax-occlusion.c @@ -104,11 +104,11 @@ _animate_scene(void *data) static void _camera_setup(Scene_Data *data) { - data->camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas); + eo_add(&data->camera, EVAS_CANVAS3D_CAMERA_CLASS, evas); evas_canvas3d_camera_projection_perspective_set(data->camera, 30.0, 1.0, 2.0, 50.0); - data->camera_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_CAMERA)); + eo_add(&data->camera_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->camera_node, EVAS_CANVAS3D_NODE_TYPE_CAMERA)); evas_canvas3d_node_camera_set(data->camera_node, data->camera); evas_canvas3d_node_position_set(data->camera_node, 0.0, 0.0, 10.0); 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); @@ -118,12 +118,12 @@ _camera_setup(Scene_Data *data) static void _light_setup(Scene_Data *data) { - data->light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas); + eo_add(&data->light, EVAS_CANVAS3D_LIGHT_CLASS, evas); evas_canvas3d_light_ambient_set(data->light, 0.2, 0.2, 0.2, 1.0); evas_canvas3d_light_diffuse_set(data->light, 1.0, 1.0, 1.0, 1.0); evas_canvas3d_light_specular_set(data->light, 1.0, 1.0, 1.0, 1.0); - data->light_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_LIGHT)); + eo_add(&data->light_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->light_node, EVAS_CANVAS3D_NODE_TYPE_LIGHT)); evas_canvas3d_node_light_set(data->light_node, data->light); evas_canvas3d_node_position_set(data->light_node, -20.0, 20.0, 50.0); 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); @@ -134,10 +134,10 @@ static void _mesh_setup(Scene_Data *data) { /* Setup material. */ - data->material_rocks = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); + eo_add(&data->material_rocks, EVAS_CANVAS3D_MATERIAL_CLASS, evas); - data->texture_rocks = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); - data->texture_rocks_n = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); + eo_add(&data->texture_rocks, EVAS_CANVAS3D_TEXTURE_CLASS, evas); + eo_add(&data->texture_rocks_n, EVAS_CANVAS3D_TEXTURE_CLASS, evas); evas_canvas3d_texture_file_set(data->texture_rocks, rock_diffuse, NULL); evas_canvas3d_texture_wrap_set(data->texture_rocks, EVAS_CANVAS3D_WRAP_MODE_REPEAT, EVAS_CANVAS3D_WRAP_MODE_REPEAT); evas_canvas3d_texture_file_set(data->texture_rocks_n, rock_n_and_height_map, NULL); @@ -156,10 +156,10 @@ _mesh_setup(Scene_Data *data) evas_canvas3d_material_color_set(data->material_rocks, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0); evas_canvas3d_material_shininess_set(data->material_rocks, 100.0); - data->material_wood = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); + eo_add(&data->material_wood, EVAS_CANVAS3D_MATERIAL_CLASS, evas); - data->texture_wood = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); - data->texture_four_n = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); + eo_add(&data->texture_wood, EVAS_CANVAS3D_TEXTURE_CLASS, evas); + eo_add(&data->texture_four_n, EVAS_CANVAS3D_TEXTURE_CLASS, evas); evas_canvas3d_texture_file_set(data->texture_wood, wood_diffuse, NULL); evas_canvas3d_texture_wrap_set(data->texture_wood, EVAS_CANVAS3D_WRAP_MODE_REPEAT, EVAS_CANVAS3D_WRAP_MODE_REPEAT); evas_canvas3d_texture_file_set(data->texture_four_n, wood_n_and_height_map, NULL); @@ -179,11 +179,11 @@ _mesh_setup(Scene_Data *data) evas_canvas3d_material_shininess_set(data->material_wood, 100.0); /* Set data of primitive */ - data->cube = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); + eo_add(&data->cube, EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); evas_canvas3d_primitive_form_set(data->cube, EVAS_CANVAS3D_MESH_PRIMITIVE_CUBE); /* Setup mesh. */ - data->mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); + eo_add(&data->mesh, EVAS_CANVAS3D_MESH_CLASS, evas); evas_canvas3d_mesh_from_primitive_set(data->mesh, 0, data->cube); evas_canvas3d_mesh_from_primitive_set(data->mesh, 100, data->cube); evas_canvas3d_mesh_shade_mode_set(data->mesh, EVAS_CANVAS3D_SHADE_MODE_PARALLAX_OCCLUSION); @@ -191,7 +191,7 @@ _mesh_setup(Scene_Data *data) evas_canvas3d_mesh_frame_material_set(data->mesh, 100, data->material_wood); - data->mesh_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH)); + eo_add(&data->mesh_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->mesh_node, EVAS_CANVAS3D_NODE_TYPE_MESH)); evas_canvas3d_node_member_add(data->root_node, data->mesh_node); evas_canvas3d_node_mesh_add(data->mesh_node, data->mesh); evas_canvas3d_node_scale_set(data->mesh_node, 3, 3, 3); @@ -200,11 +200,11 @@ _mesh_setup(Scene_Data *data) static void _scene_setup(Scene_Data *data) { - data->scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas); + eo_add(&data->scene, EVAS_CANVAS3D_SCENE_CLASS, evas); evas_canvas3d_scene_size_set(data->scene, WIDTH, HEIGHT); evas_canvas3d_scene_background_color_set(data->scene, 0.0, 0.0, 0.0, 0.0); - data->root_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_NODE)); + eo_add(&data->root_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->root_node, EVAS_CANVAS3D_NODE_TYPE_NODE)); _camera_setup(data); _light_setup(data); @@ -237,7 +237,7 @@ main(void) _scene_setup(&data); /* Add a background rectangle objects. */ - background = eo_add(EVAS_RECTANGLE_CLASS, evas); + eo_add(&background, EVAS_RECTANGLE_CLASS, evas); efl_gfx_color_set(background, 0, 0, 0, 255); efl_gfx_size_set(background, WIDTH, HEIGHT); efl_gfx_visible_set(background, EINA_TRUE); diff --git a/src/examples/evas/evas-3d-pick.c b/src/examples/evas/evas-3d-pick.c index 1ae79a8cc9..86ee222b8a 100644 --- a/src/examples/evas/evas-3d-pick.c +++ b/src/examples/evas/evas-3d-pick.c @@ -132,32 +132,31 @@ main(void) evas = ecore_evas_get(ecore_evas); /* Add a scene object .*/ - scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas); + eo_add(&scene, EVAS_CANVAS3D_SCENE_CLASS, evas); /* Add the root node for the scene. */ - root_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_NODE)); + eo_add(&root_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(root_node, EVAS_CANVAS3D_NODE_TYPE_NODE)); /* Add the camera. */ - camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas); + eo_add(&camera, EVAS_CANVAS3D_CAMERA_CLASS, evas); evas_canvas3d_camera_projection_perspective_set(camera, 30.0, 1.0, 1.0, 100.0); - camera_node = - eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_CAMERA)); + eo_add(&camera_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(camera_node, EVAS_CANVAS3D_NODE_TYPE_CAMERA)); evas_canvas3d_node_camera_set(camera_node, camera); evas_canvas3d_node_position_set(camera_node, 0.0, 0.0, 2.5); evas_canvas3d_node_look_at_set(camera_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0); evas_canvas3d_node_member_add(root_node, camera_node); - sphere = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); + eo_add(&sphere, EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); evas_canvas3d_primitive_form_set(sphere, EVAS_CANVAS3D_MESH_PRIMITIVE_SPHERE); evas_canvas3d_primitive_precision_set(sphere, 50); - mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); + eo_add(&mesh, EVAS_CANVAS3D_MESH_CLASS, evas); evas_canvas3d_mesh_from_primitive_set(mesh, 0, sphere); - material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); + eo_add(&material, EVAS_CANVAS3D_MATERIAL_CLASS, evas); - texture_diffuse = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); + eo_add(&texture_diffuse, EVAS_CANVAS3D_TEXTURE_CLASS, evas); evas_canvas3d_texture_file_set(texture_diffuse, image_path, NULL); evas_canvas3d_texture_filter_set(texture_diffuse, EVAS_CANVAS3D_TEXTURE_FILTER_LINEAR, EVAS_CANVAS3D_TEXTURE_FILTER_LINEAR); evas_canvas3d_material_texture_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, texture_diffuse); @@ -169,7 +168,7 @@ main(void) evas_canvas3d_material_color_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0); evas_canvas3d_material_shininess_set(material, 50.0); - mesh_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH)); + eo_add(&mesh_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(mesh_node, EVAS_CANVAS3D_NODE_TYPE_MESH)); evas_canvas3d_node_member_add(root_node, mesh_node); evas_canvas3d_node_mesh_add(mesh_node, mesh); @@ -182,7 +181,7 @@ main(void) evas_canvas3d_scene_size_set(scene, WIDTH, HEIGHT); /* Add evas objects. */ - background = eo_add(EVAS_RECTANGLE_CLASS, evas); + eo_add(&background, EVAS_RECTANGLE_CLASS, evas); efl_gfx_color_set(background, 0, 0, 0, 255); efl_gfx_size_set(background, WIDTH, HEIGHT); efl_gfx_visible_set(background, EINA_TRUE); diff --git a/src/examples/evas/evas-3d-ply.c b/src/examples/evas/evas-3d-ply.c index b34b2cc313..65f4fe5de3 100644 --- a/src/examples/evas/evas-3d-ply.c +++ b/src/examples/evas/evas-3d-ply.c @@ -130,35 +130,35 @@ main(void) evas = ecore_evas_get(ecore_evas); /* Add a scene object .*/ - scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas); + eo_add(&scene, EVAS_CANVAS3D_SCENE_CLASS, evas); /* Add the root node for the scene. */ - root_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_NODE)); + eo_add(&root_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(root_node, EVAS_CANVAS3D_NODE_TYPE_NODE)); /* Add the camera. */ - camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas); + eo_add(&camera, EVAS_CANVAS3D_CAMERA_CLASS, evas); evas_canvas3d_camera_projection_perspective_set(camera, 60.0, 1.0, 1.0, 500.0); - camera_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_CAMERA)); + eo_add(&camera_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(camera_node, EVAS_CANVAS3D_NODE_TYPE_CAMERA)); evas_canvas3d_node_camera_set(camera_node, camera); evas_canvas3d_node_member_add(root_node, camera_node); evas_canvas3d_node_position_set(camera_node, 15.0, 0.0, 0.0); evas_canvas3d_node_look_at_set(camera_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 1.0); /* Add the light. */ - light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas); + eo_add(&light, EVAS_CANVAS3D_LIGHT_CLASS, evas); evas_canvas3d_light_ambient_set(light, 1.0, 1.0, 1.0, 1.0); evas_canvas3d_light_diffuse_set(light, 1.0, 1.0, 1.0, 1.0); evas_canvas3d_light_specular_set(light, 1.0, 1.0, 1.0, 1.0); evas_canvas3d_light_directional_set(light, EINA_TRUE); - light_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_LIGHT)); + eo_add(&light_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(light_node, EVAS_CANVAS3D_NODE_TYPE_LIGHT)); evas_canvas3d_node_light_set(light_node, light); evas_canvas3d_node_position_set(light_node, 1000.0, 0.0, 1000.0); 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); evas_canvas3d_node_member_add(root_node, light_node); - material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); - texture = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); + eo_add(&material, EVAS_CANVAS3D_MATERIAL_CLASS, evas); + eo_add(&texture, EVAS_CANVAS3D_TEXTURE_CLASS, evas); evas_canvas3d_texture_file_set(texture, image_path, NULL); evas_canvas3d_texture_filter_set(texture, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST); evas_canvas3d_texture_wrap_set(texture, EVAS_CANVAS3D_WRAP_MODE_REPEAT, EVAS_CANVAS3D_WRAP_MODE_REPEAT); @@ -208,7 +208,7 @@ main(void) evas_canvas3d_scene_size_set(scene, WIDTH, HEIGHT); /* Add a background rectangle objects. */ - background = eo_add(EVAS_RECTANGLE_CLASS, evas); + eo_add(&background, EVAS_RECTANGLE_CLASS, evas); efl_gfx_color_set(background, 100, 100, 100, 255); efl_gfx_size_set(background, WIDTH, HEIGHT); efl_gfx_visible_set(background, EINA_TRUE); diff --git a/src/examples/evas/evas-3d-proxy.c b/src/examples/evas/evas-3d-proxy.c index 901c52bd54..7ec50bc4c2 100644 --- a/src/examples/evas/evas-3d-proxy.c +++ b/src/examples/evas/evas-3d-proxy.c @@ -97,11 +97,10 @@ _animate_scene(void *data) static void _camera_setup(Scene_Data *data) { - data->camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas); + eo_add(&data->camera, EVAS_CANVAS3D_CAMERA_CLASS, evas); evas_canvas3d_camera_projection_perspective_set(data->camera, 30.0, 1.0, 2.0, 50.0); - data->camera_node = - eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_CAMERA)); + eo_add(&data->camera_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->camera_node, EVAS_CANVAS3D_NODE_TYPE_CAMERA)); evas_canvas3d_node_camera_set(data->camera_node, data->camera); evas_canvas3d_node_position_set(data->camera_node, 0.0, 0.0, 5.0); 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); @@ -111,13 +110,12 @@ _camera_setup(Scene_Data *data) static void _light_setup(Scene_Data *data) { - data->light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas); + eo_add(&data->light, EVAS_CANVAS3D_LIGHT_CLASS, evas); evas_canvas3d_light_ambient_set(data->light, 0.2, 0.2, 0.2, 1.0); evas_canvas3d_light_diffuse_set(data->light, 1.0, 1.0, 1.0, 1.0); evas_canvas3d_light_specular_set(data->light, 1.0, 1.0, 1.0, 1.0); - data->light_node = - eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_LIGHT)); + eo_add(&data->light_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->light_node, EVAS_CANVAS3D_NODE_TYPE_LIGHT)); evas_canvas3d_node_light_set(data->light_node, data->light); evas_canvas3d_node_position_set(data->light_node, 0.0, 0.0, 10.0); 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); @@ -128,8 +126,8 @@ static void _mesh_setup(Scene_Data *data) { /* Setup material. */ - data->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); - data->texture = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); + eo_add(&data->material, EVAS_CANVAS3D_MATERIAL_CLASS, evas); + eo_add(&data->texture, EVAS_CANVAS3D_TEXTURE_CLASS, evas); evas_canvas3d_texture_source_set(data->texture, source); evas_canvas3d_texture_source_visible_set(data->texture, EINA_TRUE); @@ -144,17 +142,16 @@ _mesh_setup(Scene_Data *data) evas_canvas3d_material_texture_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, data->texture); /* Set data of primitive */ - data->cube = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); + eo_add(&data->cube, EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); evas_canvas3d_primitive_form_set(data->cube, EVAS_CANVAS3D_MESH_PRIMITIVE_CUBE); /* Setup mesh. */ - data->mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); + eo_add(&data->mesh, EVAS_CANVAS3D_MESH_CLASS, evas); evas_canvas3d_mesh_from_primitive_set(data->mesh, 0, data->cube); evas_canvas3d_mesh_shade_mode_set(data->mesh, EVAS_CANVAS3D_SHADE_MODE_FLAT); evas_canvas3d_mesh_frame_material_set(data->mesh, 0, data->material); - data->mesh_node = - eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH)); + eo_add(&data->mesh_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->mesh_node, EVAS_CANVAS3D_NODE_TYPE_MESH)); evas_canvas3d_node_member_add(data->root_node, data->mesh_node); evas_canvas3d_node_mesh_add(data->mesh_node, data->mesh); @@ -163,12 +160,11 @@ _mesh_setup(Scene_Data *data) static void _scene_setup(Scene_Data *data) { - data->scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas); + eo_add(&data->scene, EVAS_CANVAS3D_SCENE_CLASS, evas); evas_canvas3d_scene_size_set(data->scene, WIDTH, HEIGHT); evas_canvas3d_scene_background_color_set(data->scene, 0.0, 0.0, 0.0, 0.0); - data->root_node = - eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_NODE)); + eo_add(&data->root_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->root_node, EVAS_CANVAS3D_NODE_TYPE_NODE)); _camera_setup(data); _light_setup(data); @@ -199,7 +195,7 @@ main(void) evas = ecore_evas_get(ecore_evas); /* Add a background rectangle objects. */ - background = eo_add(EVAS_RECTANGLE_CLASS, evas); + eo_add(&background, EVAS_RECTANGLE_CLASS, evas); efl_gfx_color_set(background, 0, 0, 0, 255); efl_gfx_size_set(background, WIDTH, HEIGHT); efl_gfx_visible_set(background, EINA_TRUE); diff --git a/src/examples/evas/evas-3d-shadows.c b/src/examples/evas/evas-3d-shadows.c index f70d7e41a8..90a714655f 100644 --- a/src/examples/evas/evas-3d-shadows.c +++ b/src/examples/evas/evas-3d-shadows.c @@ -174,7 +174,7 @@ _on_canvas_resize(Ecore_Evas *ee) static void _body_material_set(Body_3D *body, float r, float g, float b) { - body->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); + eo_add(&body->material, EVAS_CANVAS3D_MATERIAL_CLASS, evas); evas_canvas3d_material_enable_set(body->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE); evas_canvas3d_material_enable_set(body->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE); @@ -191,33 +191,32 @@ _body_material_set(Body_3D *body, float r, float g, float b) static void _sphere_setup(Body_3D *sphere) { - sphere->primitive = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); + eo_add(&sphere->primitive, EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); evas_canvas3d_primitive_form_set(sphere->primitive, EVAS_CANVAS3D_MESH_PRIMITIVE_SPHERE); evas_canvas3d_primitive_precision_set(sphere->primitive, 50); - sphere->mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); + eo_add(&sphere->mesh, EVAS_CANVAS3D_MESH_CLASS, evas); evas_canvas3d_mesh_from_primitive_set(sphere->mesh, 0, sphere->primitive); _body_material_set(sphere, 1, 0.0, 0.0); - sphere->node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH), evas_canvas3d_node_position_set(eoid, 3.0, 3.0, 0.0)); + eo_add(&sphere->node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(sphere->node, EVAS_CANVAS3D_NODE_TYPE_MESH), evas_canvas3d_node_position_set(sphere->node, 3.0, 3.0, 0.0)); evas_canvas3d_node_mesh_add(sphere->node, sphere->mesh); } static void _cone_setup(Body_3D *cone) { - cone->primitive = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); + eo_add(&cone->primitive, EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); evas_canvas3d_primitive_form_set(cone->primitive, EVAS_CANVAS3D_MESH_PRIMITIVE_CONE); evas_canvas3d_primitive_precision_set(cone->primitive, 50); - cone->mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); + eo_add(&cone->mesh, EVAS_CANVAS3D_MESH_CLASS, evas); evas_canvas3d_mesh_from_primitive_set(cone->mesh, 0, cone->primitive); _body_material_set(cone, 0.8, 0.5, 0.5); - cone->node = - eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH)); + eo_add(&cone->node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(cone->node, EVAS_CANVAS3D_NODE_TYPE_MESH)); evas_canvas3d_node_mesh_add(cone->node, cone->mesh); evas_canvas3d_node_orientation_angle_axis_set(cone->node, -90.0, 1.0, 0.0, 0.0); evas_canvas3d_node_position_set(cone->node, -4.0, 0.0, -3.0); @@ -226,17 +225,16 @@ _cone_setup(Body_3D *cone) static void _cylinder_setup(Body_3D *cylinder) { - cylinder->primitive = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); + eo_add(&cylinder->primitive, EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); evas_canvas3d_primitive_form_set(cylinder->primitive, EVAS_CANVAS3D_MESH_PRIMITIVE_CYLINDER); evas_canvas3d_primitive_precision_set(cylinder->primitive, 50); - cylinder->mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); + eo_add(&cylinder->mesh, EVAS_CANVAS3D_MESH_CLASS, evas); evas_canvas3d_mesh_from_primitive_set(cylinder->mesh, 0, cylinder->primitive); _body_material_set(cylinder, 0.0, 0.0, 1.0); - cylinder->node = - eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH)); + eo_add(&cylinder->node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(cylinder->node, EVAS_CANVAS3D_NODE_TYPE_MESH)); evas_canvas3d_node_mesh_add(cylinder->node, cylinder->mesh); evas_canvas3d_node_orientation_angle_axis_set(cylinder->node, -90.0, 1.0, 0.0, 0.0); evas_canvas3d_node_position_set(cylinder->node, -2.0, 3.0, 1.0); @@ -246,17 +244,19 @@ static void _fence_setup(Body_3D *fence) { - Eo *texture = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); + Eo *texture = NULL; + eo_add(&texture, EVAS_CANVAS3D_TEXTURE_CLASS, evas); evas_canvas3d_texture_atlas_enable_set(texture, EINA_FALSE); evas_canvas3d_texture_file_set(texture, PACKAGE_EXAMPLES_DIR EVAS_IMAGE_FOLDER "/grid.png", NULL); evas_canvas3d_texture_filter_set(texture, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST); evas_canvas3d_texture_wrap_set(texture, EVAS_CANVAS3D_WRAP_MODE_REPEAT, EVAS_CANVAS3D_WRAP_MODE_REPEAT); - Eo *texture1 = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); + Eo *texture1 = NULL; + eo_add(&texture1, EVAS_CANVAS3D_TEXTURE_CLASS, evas); evas_canvas3d_texture_atlas_enable_set(texture1, EINA_FALSE); evas_canvas3d_texture_file_set(texture1, PACKAGE_EXAMPLES_DIR EVAS_IMAGE_FOLDER "/grid_n.png", NULL); evas_canvas3d_texture_filter_set(texture1, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST); evas_canvas3d_texture_wrap_set(texture1, EVAS_CANVAS3D_WRAP_MODE_REPEAT, EVAS_CANVAS3D_WRAP_MODE_REPEAT); - fence->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); + eo_add(&fence->material, EVAS_CANVAS3D_MATERIAL_CLASS, evas); evas_canvas3d_material_texture_set(fence->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, texture); evas_canvas3d_material_texture_set(fence->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, texture); @@ -270,21 +270,20 @@ _fence_setup(Body_3D *fence) evas_canvas3d_material_color_set(fence->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0); evas_canvas3d_material_shininess_set(fence->material, 100.0); - fence->primitive = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); + eo_add(&fence->primitive, EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); evas_canvas3d_primitive_form_set(fence->primitive, EVAS_CANVAS3D_MESH_PRIMITIVE_CYLINDER); evas_canvas3d_primitive_mode_set(fence->primitive, EVAS_CANVAS3D_PRIMITIVE_MODE_WITHOUT_BASE); evas_canvas3d_primitive_tex_scale_set(fence->primitive, 160.0, 12.0); evas_canvas3d_primitive_precision_set(fence->primitive, 50); - fence->mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); + eo_add(&fence->mesh, EVAS_CANVAS3D_MESH_CLASS, evas); evas_canvas3d_mesh_from_primitive_set(fence->mesh, 0, fence->primitive); evas_canvas3d_mesh_frame_material_set(fence->mesh, 0, fence->material); evas_canvas3d_mesh_alpha_func_set(fence->mesh, EVAS_CANVAS3D_COMPARISON_GREATER, 0); evas_canvas3d_mesh_alpha_test_enable_set(fence->mesh, EINA_TRUE); evas_canvas3d_mesh_shade_mode_set(fence->mesh, EVAS_CANVAS3D_SHADE_MODE_NORMAL_MAP); - fence->node = - eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH)); + eo_add(&fence->node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(fence->node, EVAS_CANVAS3D_NODE_TYPE_MESH)); evas_canvas3d_node_mesh_add(fence->node, fence->mesh); evas_canvas3d_node_orientation_angle_axis_set(fence->node, -90.0, 1.0, 0.0, 0.0); evas_canvas3d_node_scale_set(fence->node, 10.0, 10.0, 5.0); @@ -294,16 +293,15 @@ _fence_setup(Body_3D *fence) static void _square_setup(Body_3D *square) { - square->primitive = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); + eo_add(&square->primitive, EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); evas_canvas3d_primitive_form_set(square->primitive, EVAS_CANVAS3D_MESH_PRIMITIVE_SQUARE); - square->mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); + eo_add(&square->mesh, EVAS_CANVAS3D_MESH_CLASS, evas); evas_canvas3d_mesh_from_primitive_set(square->mesh, 0, square->primitive); _body_material_set(square, 0.4, 0.4, 0.4); - square->node = - eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH)); + eo_add(&square->node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(square->node, EVAS_CANVAS3D_NODE_TYPE_MESH)); evas_canvas3d_node_mesh_add(square->node, square->mesh); evas_canvas3d_node_position_set(square->node, 0.0, -1.0, 0.0); evas_canvas3d_node_scale_set(square->node, 30.0, 30.0, 30.0); @@ -313,15 +311,15 @@ _square_setup(Body_3D *square) static void _box_setup(Body_3D *box) { - box->primitive = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); + eo_add(&box->primitive, EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); evas_canvas3d_primitive_form_set(box->primitive, EVAS_CANVAS3D_MESH_PRIMITIVE_CUBE); - box->mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); + eo_add(&box->mesh, EVAS_CANVAS3D_MESH_CLASS, evas); evas_canvas3d_mesh_from_primitive_set(box->mesh, 0, box->primitive); _body_material_set(box, 0, 1, 0); - box->node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH)); + eo_add(&box->node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(box->node, EVAS_CANVAS3D_NODE_TYPE_MESH)); evas_canvas3d_node_mesh_add(box->node, box->mesh); evas_canvas3d_node_position_set(box->node, 3.0, 0.0, -3.0); } @@ -329,11 +327,11 @@ _box_setup(Body_3D *box) static void _model_setup(Body_3D *model) { - model->texture = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); + eo_add(&model->texture, EVAS_CANVAS3D_TEXTURE_CLASS, evas); evas_canvas3d_texture_file_set(model->texture, image_path, NULL); evas_canvas3d_texture_filter_set(model->texture, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST); evas_canvas3d_texture_wrap_set(model->texture, EVAS_CANVAS3D_WRAP_MODE_REPEAT, EVAS_CANVAS3D_WRAP_MODE_REPEAT); - model->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); + eo_add(&model->material, EVAS_CANVAS3D_MATERIAL_CLASS, evas); evas_canvas3d_material_texture_set(model->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, model->texture); evas_canvas3d_material_texture_set(model->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, model->texture); @@ -343,13 +341,12 @@ _model_setup(Body_3D *model) evas_canvas3d_material_shininess_set(model->material, 100.0); - model->mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); + eo_add(&model->mesh, EVAS_CANVAS3D_MESH_CLASS, evas); efl_file_set(model->mesh, model_path, NULL); evas_canvas3d_mesh_frame_material_set(model->mesh, 0, model->material); evas_canvas3d_mesh_shade_mode_set(model->mesh, EVAS_CANVAS3D_SHADE_MODE_PHONG); - model->node = - eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH)); + eo_add(&model->node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(model->node, EVAS_CANVAS3D_NODE_TYPE_MESH)); evas_canvas3d_node_mesh_add(model->node, model->mesh); evas_canvas3d_node_scale_set(model->node, 0.1, 0.1, 0.1); evas_canvas3d_node_orientation_angle_axis_set(model->node, 120.0, -0.577, -0.577, -0.577); @@ -391,13 +388,12 @@ _billboard_setup(Scene_Data *data) static void _camera_setup(Scene_Data *data) { - data->camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas); - data->mediator = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_NODE)); + eo_add(&data->camera, EVAS_CANVAS3D_CAMERA_CLASS, evas); + eo_add(&data->mediator, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->mediator, EVAS_CANVAS3D_NODE_TYPE_NODE)); evas_canvas3d_camera_projection_perspective_set(data->camera, 50.0, 1.0, 2.0, 100.0); - data->camera_node = - eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_CAMERA)); + eo_add(&data->camera_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->camera_node, EVAS_CANVAS3D_NODE_TYPE_CAMERA)); evas_canvas3d_node_camera_set(data->camera_node, data->camera); @@ -412,15 +408,14 @@ _camera_setup(Scene_Data *data) static void _light_setup(Scene_Data *data) { - data->light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas); + eo_add(&data->light, EVAS_CANVAS3D_LIGHT_CLASS, evas); evas_canvas3d_light_ambient_set(data->light, AMBIENT_LIGHT, 1.0); evas_canvas3d_light_diffuse_set(data->light, DIFFUSE_LIGHT, 1.0); evas_canvas3d_light_specular_set(data->light, SPECULAR_LIGHT, 1.0); evas_canvas3d_light_spot_cutoff_set(data->light, 20); evas_canvas3d_light_projection_perspective_set(data->light, 40.0, 1.0, 2.0, 1000.0); - data->light_node = - eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_LIGHT)); + eo_add(&data->light_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->light_node, EVAS_CANVAS3D_NODE_TYPE_LIGHT)); evas_canvas3d_node_light_set(data->light_node, data->light); evas_canvas3d_node_position_set(data->light_node, 50.0, 50.0, 70.0); evas_canvas3d_node_look_at_set(data->light_node, EVAS_CANVAS3D_SPACE_PARENT, 15.0, 0.0, -5.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 1.0); @@ -432,13 +427,12 @@ _scene_setup(Scene_Data *data) { data->init = EINA_FALSE; - data->scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas); + eo_add(&data->scene, EVAS_CANVAS3D_SCENE_CLASS, evas); evas_canvas3d_scene_size_set(data->scene, WIDTH, HEIGHT); evas_canvas3d_scene_background_color_set(data->scene, BG_COLOR, 1); - data->root_node = - eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_NODE)); + eo_add(&data->root_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->root_node, EVAS_CANVAS3D_NODE_TYPE_NODE)); _camera_setup(data); @@ -610,7 +604,7 @@ main(void) _scene_setup(&data); /* Add a background rectangle objects. */ - background = eo_add(EVAS_RECTANGLE_CLASS, evas); + eo_add(&background, EVAS_RECTANGLE_CLASS, evas); efl_gfx_color_set(background, 0, 0, 0, 255); efl_gfx_size_set(background, WIDTH, HEIGHT); efl_gfx_visible_set(background, EINA_TRUE); diff --git a/src/examples/evas/evas-vg-simple.c b/src/examples/evas/evas-vg-simple.c index 2c0c7026b0..9d22907cc0 100644 --- a/src/examples/evas/evas-vg-simple.c +++ b/src/examples/evas/evas-vg-simple.c @@ -449,15 +449,19 @@ vector_set(int x, int y, int w, int h) root = evas_object_vg_root_node_get(d.vg); //evas_vg_node_transformation_set(root, &matrix); - Efl_VG *bg = eo_add(EFL_VG_SHAPE_CLASS, root, efl_vg_name_set(eoid, "bg")); + Efl_VG *bg = NULL; + eo_add(&bg, EFL_VG_SHAPE_CLASS, root, efl_vg_name_set(bg, "bg")); _rect_add(bg, 0, 0 , vg_w, vg_h); evas_vg_node_origin_set(bg, 0,0); evas_vg_shape_stroke_width_set(bg, 1.0); evas_vg_node_color_set(bg, 80, 80, 80, 80); - Efl_VG *shape = eo_add(EFL_VG_SHAPE_CLASS, root, efl_vg_name_set(eoid, "shape")); - Efl_VG *rgradient = eo_add(EFL_VG_GRADIENT_RADIAL_CLASS, NULL, efl_vg_name_set(eoid, "rgradient")); - Efl_VG *lgradient = eo_add(EFL_VG_GRADIENT_LINEAR_CLASS, NULL, efl_vg_name_set(eoid, "lgradient")); + Efl_VG *shape = NULL; + eo_add(&shape, EFL_VG_SHAPE_CLASS, root, efl_vg_name_set(shape, "shape")); + Efl_VG *rgradient = NULL; + eo_add(&rgradient, EFL_VG_GRADIENT_RADIAL_CLASS, NULL, efl_vg_name_set(rgradient, "rgradient")); + Efl_VG *lgradient = NULL; + eo_add(&lgradient, EFL_VG_GRADIENT_LINEAR_CLASS, NULL, efl_vg_name_set(lgradient, "lgradient")); _arcto(shape, 0, 0, 100, 100, 25, 330); @@ -498,7 +502,8 @@ vector_set(int x, int y, int w, int h) evas_vg_node_color_set(shape, 0, 0, 255, 255); evas_vg_shape_stroke_color_set(shape, 0, 0, 255, 128); - Efl_VG *rect = eo_add(EFL_VG_SHAPE_CLASS, root, efl_vg_name_set(eoid, "rect")); + Efl_VG *rect = NULL; + eo_add(&rect, EFL_VG_SHAPE_CLASS, root, efl_vg_name_set(rect, "rect")); _rect_add(rect, 0, 0, 100, 100); evas_vg_node_origin_set(rect, 100, 100); evas_vg_shape_fill_set(rect, lgradient); @@ -506,7 +511,8 @@ vector_set(int x, int y, int w, int h) evas_vg_shape_stroke_join_set(rect, EFL_GFX_JOIN_ROUND); evas_vg_shape_stroke_color_set(rect, 255, 255, 255, 255); - Efl_VG *rect1 = eo_add(EFL_VG_SHAPE_CLASS, root, efl_vg_name_set(eoid, "rect1")); + Efl_VG *rect1 = NULL; + eo_add(&rect1, EFL_VG_SHAPE_CLASS, root, efl_vg_name_set(rect1, "rect1")); _rect_add(rect1, 0, 0, 70, 70); evas_vg_node_origin_set(rect1, 50, 70); evas_vg_shape_stroke_scale_set(rect1, 2); @@ -514,7 +520,8 @@ vector_set(int x, int y, int w, int h) evas_vg_shape_stroke_join_set(rect1, EFL_GFX_JOIN_ROUND); evas_vg_shape_stroke_color_set(rect1, 0, 100, 80, 100); - Efl_VG *circle = eo_add(EFL_VG_SHAPE_CLASS, root, efl_vg_name_set(eoid, "circle")); + Efl_VG *circle = NULL; + eo_add(&circle, EFL_VG_SHAPE_CLASS, root, efl_vg_name_set(circle, "circle")); _arcto(circle, 0, 0, 250, 100, 30, 300); evas_vg_shape_fill_set(circle, lgradient); //evas_vg_node_transformation_set(&matrix), @@ -522,27 +529,30 @@ vector_set(int x, int y, int w, int h) evas_vg_node_color_set(circle, 50, 0, 0, 50); // Foreground - Efl_VG *fg = eo_add(EFL_VG_SHAPE_CLASS, root, efl_vg_name_set(eoid, "fg")); + Efl_VG *fg = NULL; + eo_add(&fg, EFL_VG_SHAPE_CLASS, root, efl_vg_name_set(fg, "fg")); _rect_add(fg, 0, 0, vg_w, vg_h); evas_vg_node_origin_set(fg, 0, 0); evas_vg_shape_stroke_width_set(fg, 5.0); evas_vg_shape_stroke_join_set(fg, EFL_GFX_JOIN_ROUND); evas_vg_shape_stroke_color_set(fg, 70, 70, 0, 70); - Efl_VG *tst = eo_add(EFL_VG_SHAPE_CLASS, root, efl_vg_name_set(eoid, "tst")); + Efl_VG *tst = NULL; + eo_add(&tst, EFL_VG_SHAPE_CLASS, root, efl_vg_name_set(tst, "tst")); evas_vg_shape_shape_append_rect(tst, 50, 25, 200, 200, 3, 5); evas_vg_node_color_set(tst, 0, 0, 200, 200); evas_vg_shape_stroke_width_set(tst, 2); evas_vg_shape_stroke_color_set(tst, 255, 0, 0, 255); - Efl_VG *vc = eo_add(EFL_VG_SHAPE_CLASS, root, efl_vg_name_set(eoid, "vc")); + Efl_VG *vc = NULL; + eo_add(&vc, EFL_VG_SHAPE_CLASS, root, efl_vg_name_set(vc, "vc")); evas_vg_shape_shape_append_circle(vc, 100, 100, 23); evas_vg_node_color_set(vc, 0, 200, 0, 255); evas_vg_shape_stroke_width_set(vc, 4); evas_vg_shape_stroke_color_set(vc, 255, 0, 0, 255); - beginning = eo_add(EFL_VG_CONTAINER_CLASS, NULL, efl_vg_dup(eoid, root)); - end = eo_add(EFL_VG_CONTAINER_CLASS, NULL, efl_vg_dup(eoid, root)); + eo_add(&beginning, EFL_VG_CONTAINER_CLASS, NULL, efl_vg_dup(beginning, root)); + eo_add(&end, EFL_VG_CONTAINER_CLASS, NULL, efl_vg_dup(end, root)); circle = efl_vg_container_child_get(end, "circle"); efl_vg_transformation_set(circle, &matrix); diff --git a/src/examples/evas/shooter/evas-3d-shooter-header.c b/src/examples/evas/shooter/evas-3d-shooter-header.c index ee608ba2f9..8529746f18 100644 --- a/src/examples/evas/shooter/evas-3d-shooter-header.c +++ b/src/examples/evas/shooter/evas-3d-shooter-header.c @@ -26,11 +26,11 @@ _distance(float x1, float z1, float x2, float z2) void _camera_setup(Scene_Data *data) { - data->camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas); + eo_add(&data->camera, EVAS_CANVAS3D_CAMERA_CLASS, evas); evas_canvas3d_camera_projection_perspective_set(data->camera, 65.0, 1.0, 1.0, 300.0); - data->mediator_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_NODE)); - data->camera_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_CAMERA)); + eo_add(&data->mediator_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->mediator_node, EVAS_CANVAS3D_NODE_TYPE_NODE)); + eo_add(&data->camera_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->camera_node, EVAS_CANVAS3D_NODE_TYPE_CAMERA)); evas_canvas3d_node_member_add(data->root_node, data->mediator_node); evas_canvas3d_node_member_add(data->mediator_node, data->camera_node); @@ -43,14 +43,14 @@ _camera_setup(Scene_Data *data) void _light_setup(Scene_Data *data) { - data->light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas); + eo_add(&data->light, EVAS_CANVAS3D_LIGHT_CLASS, evas); evas_canvas3d_light_ambient_set(data->light, 0.2, 0.2, 0.2, 1.0); evas_canvas3d_light_diffuse_set(data->light, 1.0, 1.0, 1.0, 1.0); evas_canvas3d_light_specular_set(data->light, 0.2, 0.2, 0.2, 1.0); evas_canvas3d_light_projection_perspective_set(data->light, 100.0, 1.0, 1.0, 200.0); - data->light_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_LIGHT)); + eo_add(&data->light_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->light_node, EVAS_CANVAS3D_NODE_TYPE_LIGHT)); evas_canvas3d_node_light_set(data->light_node, data->light); evas_canvas3d_node_position_set(data->light_node, -30.0, 70.0, 0.0); diff --git a/src/examples/evas/shooter/evas-3d-shooter.c b/src/examples/evas/shooter/evas-3d-shooter.c index 2e83fd8e6d..4acf990f25 100644 --- a/src/examples/evas/shooter/evas-3d-shooter.c +++ b/src/examples/evas/shooter/evas-3d-shooter.c @@ -802,7 +802,7 @@ _mesh_setup_gun_planet(Scene_Data *data) evas_canvas3d_node_position_set(data->mesh_node_column_c, 10, 9.0, -12); /* Setup mesh for bounding sphere */ - data->material_ball = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); + eo_add(&data->material_ball, EVAS_CANVAS3D_MATERIAL_CLASS, evas); evas_canvas3d_material_enable_set(data->material_ball, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE); evas_canvas3d_material_enable_set(data->material_ball, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE); evas_canvas3d_material_enable_set(data->material_ball, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE); @@ -811,7 +811,7 @@ _mesh_setup_gun_planet(Scene_Data *data) evas_canvas3d_material_color_set(data->material_ball, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0); evas_canvas3d_material_shininess_set(data->material_ball, 50.0); - data->mesh_ball = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); + eo_add(&data->mesh_ball, EVAS_CANVAS3D_MESH_CLASS, evas); _set_ball(data->mesh_ball, 10); @@ -865,7 +865,7 @@ _mesh_setup_column(Scene_Data *data, int index) { /* Setup mesh for column */ - data->material_column = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); + eo_add(&data->material_column, EVAS_CANVAS3D_MATERIAL_CLASS, evas); evas_canvas3d_material_enable_set(data->material_column, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE); evas_canvas3d_material_enable_set(data->material_column, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE); @@ -886,7 +886,7 @@ _mesh_setup_column(Scene_Data *data, int index) evas_canvas3d_mesh_shade_mode_set(data->mesh_column[index], EVAS_CANVAS3D_SHADE_MODE_PHONG); evas_canvas3d_mesh_frame_material_set(data->mesh_column[index], 0, data->material_column); - data->texture_diffuse_column = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); + eo_add(&data->texture_diffuse_column, EVAS_CANVAS3D_TEXTURE_CLASS, evas); evas_canvas3d_texture_file_set(data->texture_diffuse_column, red_brick_path, NULL); evas_canvas3d_texture_atlas_enable_set(data->texture_diffuse_column, EINA_FALSE); @@ -991,20 +991,20 @@ _scene_setup(Scene_Data *data) for (i = 0; i < 4; i++) motion_vec[i] = 0; - data->cube_primitive = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); + eo_add(&data->cube_primitive, EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); evas_canvas3d_primitive_form_set(data->cube_primitive, EVAS_CANVAS3D_MESH_PRIMITIVE_CUBE); evas_canvas3d_primitive_precision_set(data->cube_primitive, 10); - data->sphere_primitive = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); + eo_add(&data->sphere_primitive, EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); evas_canvas3d_primitive_form_set(data->sphere_primitive, EVAS_CANVAS3D_MESH_PRIMITIVE_SPHERE); evas_canvas3d_primitive_precision_set(data->sphere_primitive, 50); - global_scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas); + eo_add(&global_scene, EVAS_CANVAS3D_SCENE_CLASS, evas); evas_canvas3d_scene_size_set(global_scene, WIDTH, HEIGHT); evas_canvas3d_scene_background_color_set(global_scene, 0.5, 0.5, 0.9, 0.0); - data->root_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_NODE)); + eo_add(&data->root_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->root_node, EVAS_CANVAS3D_NODE_TYPE_NODE)); _camera_setup(data); _light_setup(data); @@ -1014,7 +1014,7 @@ _scene_setup(Scene_Data *data) for (i = 0; i < 10; i++) _mesh_setup_rocket(data, i); - data->cylinder_primitive = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); + eo_add(&data->cylinder_primitive, EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); evas_canvas3d_primitive_mode_set(data->cylinder_primitive, EVAS_CANVAS3D_PRIMITIVE_MODE_WITHOUT_BASE); evas_canvas3d_primitive_form_set(data->cylinder_primitive, EVAS_CANVAS3D_MESH_PRIMITIVE_CYLINDER); evas_canvas3d_primitive_tex_scale_set(data->cylinder_primitive, 1.0, 1.0); @@ -1069,7 +1069,7 @@ _scene_setup(Scene_Data *data) } } - data->carp_mediator_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH)); + eo_add(&data->carp_mediator_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->carp_mediator_node, EVAS_CANVAS3D_NODE_TYPE_MESH)); evas_canvas3d_node_member_add(data->carp_mediator_node, data->mesh_node_carpet); diff --git a/src/lib/ecore/ecore.c b/src/lib/ecore/ecore.c index 247612b4cf..f2376ff0a7 100644 --- a/src/lib/ecore/ecore.c +++ b/src/lib/ecore/ecore.c @@ -265,7 +265,7 @@ ecore_init(void) #if defined(GLIB_INTEGRATION_ALWAYS) if (_ecore_glib_always_integrate) ecore_main_loop_glib_integrate(); #endif - _ecore_parent = eo_add(ECORE_PARENT_CLASS, NULL); + eo_add(&_ecore_parent, ECORE_PARENT_CLASS, NULL); #if defined(HAVE_MALLINFO) || defined(HAVE_MALLOC_INFO) if (getenv("ECORE_MEM_STAT")) diff --git a/src/lib/ecore/ecore_anim.c b/src/lib/ecore/ecore_anim.c index d54e92f315..bddd7ce15c 100644 --- a/src/lib/ecore/ecore_anim.c +++ b/src/lib/ecore/ecore_anim.c @@ -372,7 +372,7 @@ ecore_animator_add(Ecore_Task_Cb func, { Ecore_Animator *animator = NULL; - animator = eo_add(MY_CLASS, _ecore_parent, ecore_animator_constructor(eoid, func, data)); + eo_add(&animator, MY_CLASS, _ecore_parent, ecore_animator_constructor(animator, func, data)); return animator; } @@ -388,7 +388,7 @@ ecore_animator_timeline_add(double runtime, const void *data) { Ecore_Animator *animator; - animator = eo_add(MY_CLASS, _ecore_parent, ecore_animator_timeline_constructor(eoid, runtime, func, data)); + eo_add(&animator, MY_CLASS, _ecore_parent, ecore_animator_timeline_constructor(animator, runtime, func, data)); return animator; } diff --git a/src/lib/ecore/ecore_exe.c b/src/lib/ecore/ecore_exe.c index 75c577b67f..bbb2d65814 100644 --- a/src/lib/ecore/ecore_exe.c +++ b/src/lib/ecore/ecore_exe.c @@ -67,7 +67,8 @@ ecore_exe_pipe_run(const char *exe_cmd, Ecore_Exe_Flags flags, const void *data) { - Ecore_Exe *ret = eo_add(MY_CLASS, NULL, ecore_obj_exe_command_set(eoid, exe_cmd, flags)); + Ecore_Exe *ret = NULL; + eo_add(&ret, MY_CLASS, NULL, ecore_obj_exe_command_set(ret, exe_cmd, flags)); if (ret) { Ecore_Exe_Data *pd = eo_data_scope_get(ret, MY_CLASS); diff --git a/src/lib/ecore/ecore_idle_enterer.c b/src/lib/ecore/ecore_idle_enterer.c index a7cbfa5704..d985550aec 100644 --- a/src/lib/ecore/ecore_idle_enterer.c +++ b/src/lib/ecore/ecore_idle_enterer.c @@ -61,7 +61,7 @@ ecore_idle_enterer_add(Ecore_Task_Cb func, const void *data) { Ecore_Idle_Enterer *ie = NULL; - ie = eo_add(MY_CLASS, _ecore_parent, ecore_idle_enterer_after_constructor(eoid, func, data)); + eo_add(&ie, MY_CLASS, _ecore_parent, ecore_idle_enterer_after_constructor(ie, func, data)); return ie; } @@ -78,7 +78,7 @@ ecore_idle_enterer_before_add(Ecore_Task_Cb func, const void *data) { Ecore_Idle_Enterer *ie = NULL; - ie = eo_add(MY_CLASS, _ecore_parent, ecore_idle_enterer_before_constructor(eoid, func, data)); + eo_add(&ie, MY_CLASS, _ecore_parent, ecore_idle_enterer_before_constructor(ie, func, data)); return ie; } diff --git a/src/lib/ecore/ecore_idle_exiter.c b/src/lib/ecore/ecore_idle_exiter.c index 5074b13009..483f8dfc0c 100644 --- a/src/lib/ecore/ecore_idle_exiter.c +++ b/src/lib/ecore/ecore_idle_exiter.c @@ -37,7 +37,7 @@ ecore_idle_exiter_add(Ecore_Task_Cb func, const void *data) { Ecore_Idle_Exiter *ie = NULL; - ie = eo_add(MY_CLASS, _ecore_parent, ecore_idle_exiter_constructor(eoid, func, data)); + eo_add(&ie, MY_CLASS, _ecore_parent, ecore_idle_exiter_constructor(ie, func, data)); return ie; } diff --git a/src/lib/ecore/ecore_idler.c b/src/lib/ecore/ecore_idler.c index f68d424488..00d60fb0ae 100644 --- a/src/lib/ecore/ecore_idler.c +++ b/src/lib/ecore/ecore_idler.c @@ -35,7 +35,8 @@ EAPI Ecore_Idler * ecore_idler_add(Ecore_Task_Cb func, const void *data) { - return eo_add(MY_CLASS, _ecore_parent, ecore_idler_constructor(eoid, func, data)); + Eo *ret = NULL; + return eo_add(&ret, MY_CLASS, _ecore_parent, ecore_idler_constructor(ret, func, data)); } EOLIAN static void diff --git a/src/lib/ecore/ecore_job.c b/src/lib/ecore/ecore_job.c index 1f459c7940..a9c4df55f0 100644 --- a/src/lib/ecore/ecore_job.c +++ b/src/lib/ecore/ecore_job.c @@ -49,7 +49,8 @@ EAPI Ecore_Job * ecore_job_add(Ecore_Cb func, const void *data) { - Ecore_Job *job = eo_add(MY_CLASS, _ecore_parent, ecore_job_constructor(eoid, func, data)); + Ecore_Job *job = NULL; + eo_add(&job, MY_CLASS, _ecore_parent, ecore_job_constructor(job, func, data)); return job; } diff --git a/src/lib/ecore/ecore_main.c b/src/lib/ecore/ecore_main.c index 8175e635e8..d0b9a25751 100644 --- a/src/lib/ecore/ecore_main.c +++ b/src/lib/ecore/ecore_main.c @@ -2713,7 +2713,7 @@ EAPI Eo *ecore_main_loop_get(void) { if (!_mainloop_singleton) { - _mainloop_singleton = eo_add(ECORE_MAINLOOP_CLASS, NULL); + eo_add(&_mainloop_singleton, ECORE_MAINLOOP_CLASS, NULL); } return _mainloop_singleton; diff --git a/src/lib/ecore/ecore_poller.c b/src/lib/ecore/ecore_poller.c index 79f2a78f0b..9b0b9a84d5 100644 --- a/src/lib/ecore/ecore_poller.c +++ b/src/lib/ecore/ecore_poller.c @@ -237,7 +237,7 @@ ecore_poller_add(Ecore_Poller_Type type EINA_UNUSED, const void *data) { Ecore_Poller *poller; - poller = eo_add(MY_CLASS, _ecore_parent, ecore_poller_constructor(eoid, type, interval, func, data)); + eo_add(&poller, MY_CLASS, _ecore_parent, ecore_poller_constructor(poller, type, interval, func, data)); return poller; } diff --git a/src/lib/ecore/ecore_timer.c b/src/lib/ecore/ecore_timer.c index 7343a7f726..2c3364879f 100644 --- a/src/lib/ecore/ecore_timer.c +++ b/src/lib/ecore/ecore_timer.c @@ -93,7 +93,7 @@ ecore_timer_add(double in, Ecore_Timer *timer = NULL; EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL); - timer = eo_add(MY_CLASS, _ecore_parent, ecore_obj_timer_constructor(eoid, in, func, data)); + eo_add(&timer, MY_CLASS, _ecore_parent, ecore_obj_timer_constructor(timer, in, func, data)); return timer; } @@ -357,7 +357,7 @@ _ecore_timer_loop_add(double in, const void *data) { Ecore_Timer *timer = NULL; - timer = eo_add(MY_CLASS, _ecore_parent, ecore_obj_timer_loop_constructor(eoid, in, func, data)); + eo_add(&timer, MY_CLASS, _ecore_parent, ecore_obj_timer_loop_constructor(timer, in, func, data)); return timer; } diff --git a/src/lib/ecore_con/ecore_con.c b/src/lib/ecore_con/ecore_con.c index ba1a575fad..2bfca03023 100644 --- a/src/lib/ecore_con/ecore_con.c +++ b/src/lib/ecore_con/ecore_con.c @@ -305,7 +305,7 @@ _efl_network_base_lookup(Eo *kls_obj EINA_UNUSED, void *pd EINA_UNUSED, const ch if (!name || !done_cb) return EINA_FALSE; - obj = eo_add(EFL_NETWORK_CONNECTOR_CLASS, NULL, efl_network_server_connection_type_set(eoid, ECORE_CON_REMOTE_TCP), efl_network_server_name_set(eoid, name), efl_network_base_port_set(eoid, 1025)); + eo_add(&obj, EFL_NETWORK_CONNECTOR_CLASS, NULL, efl_network_server_connection_type_set(obj, ECORE_CON_REMOTE_TCP), efl_network_server_name_set(obj, name), efl_network_base_port_set(obj, 1025)); lk = malloc(sizeof (Ecore_Con_Lookup)); if (!lk) @@ -359,7 +359,7 @@ ecore_con_server_add(Ecore_Con_Type compl_type, /* local system socket: FILE: /tmp/.ecore_service|[name]|[port] */ /* remote system socket: TCP/IP: [name]:[port] */ - obj = eo_add(EFL_NETWORK_SERVER_CLASS, NULL, efl_network_server_connection_type_set(eoid, compl_type), efl_network_server_name_set(eoid, name), efl_network_base_port_set(eoid, port)); + eo_add(&obj, EFL_NETWORK_SERVER_CLASS, NULL, efl_network_server_connection_type_set(obj, compl_type), efl_network_server_name_set(obj, name), efl_network_base_port_set(obj, port)); ecore_con_server_data_set(obj, (void *) data); @@ -455,7 +455,7 @@ ecore_con_server_connect(Ecore_Con_Type compl_type, /* local user socket: FILE: ~/.ecore/[name]/[port] */ /* local system socket: FILE: /tmp/.ecore_service|[name]|[port] */ /* remote system socket: TCP/IP: [name]:[port] */ - obj = eo_add(EFL_NETWORK_CONNECTOR_CLASS, NULL, efl_network_server_connection_type_set(eoid, compl_type), efl_network_server_name_set(eoid, name), efl_network_base_port_set(eoid, port)); + eo_add(&obj, EFL_NETWORK_CONNECTOR_CLASS, NULL, efl_network_server_connection_type_set(obj, compl_type), efl_network_server_name_set(obj, name), efl_network_base_port_set(obj, port)); ecore_con_server_data_set(obj, (void *) data); @@ -2056,7 +2056,7 @@ _ecore_con_svr_tcp_handler(void *data, /* a new client */ - obj = eo_add(EFL_NETWORK_CLIENT_CLASS, NULL); + eo_add(&obj, EFL_NETWORK_CLIENT_CLASS, NULL); Efl_Network_Client_Data *cl = eo_data_scope_get(obj, EFL_NETWORK_CLIENT_CLASS); if (!cl) { @@ -2331,7 +2331,7 @@ _ecore_con_svr_udp_handler(void *data, } /* Create a new client for use in the client data event */ - obj = eo_add(EFL_NETWORK_CLIENT_CLASS, NULL); + eo_add(&obj, EFL_NETWORK_CLIENT_CLASS, NULL); Efl_Network_Client_Data *cl = eo_data_scope_get(obj, EFL_NETWORK_CLIENT_CLASS); EINA_SAFETY_ON_NULL_RETURN_VAL(cl, ECORE_CALLBACK_RENEW); diff --git a/src/lib/ecore_con/ecore_con_eet.c b/src/lib/ecore_con/ecore_con_eet.c index 59a5b211c4..a652636cfa 100644 --- a/src/lib/ecore_con/ecore_con_eet.c +++ b/src/lib/ecore_con/ecore_con_eet.c @@ -722,7 +722,7 @@ ecore_con_eet_server_new(Ecore_Con_Server *server) if (!server) return NULL; - ece_obj = eo_add(ECORE_CON_EET_SERVER_OBJ_CLASS, NULL, ecore_con_eet_base_server_set(eoid, server)); + eo_add(&ece_obj, ECORE_CON_EET_SERVER_OBJ_CLASS, NULL, ecore_con_eet_base_server_set(ece_obj, server)); return ece_obj; } @@ -734,7 +734,7 @@ ecore_con_eet_client_new(Ecore_Con_Server *server) if (!server) return NULL; - ece_obj = eo_add(ECORE_CON_EET_CLIENT_OBJ_CLASS, NULL, ecore_con_eet_base_server_set(eoid, server)); + eo_add(&ece_obj, ECORE_CON_EET_CLIENT_OBJ_CLASS, NULL, ecore_con_eet_base_server_set(ece_obj, server)); return ece_obj; } diff --git a/src/lib/ecore_con/ecore_con_local_win32.c b/src/lib/ecore_con/ecore_con_local_win32.c index 75d71c0bf9..9ab9b960ad 100644 --- a/src/lib/ecore_con/ecore_con_local_win32.c +++ b/src/lib/ecore_con/ecore_con_local_win32.c @@ -286,7 +286,8 @@ _ecore_con_local_win32_client_add(void *data, Ecore_Win32_Handler *wh) (svr->client_count >= (unsigned int)svr->client_limit)) return ECORE_CALLBACK_CANCEL; - Ecore_Con_Client *cl_obj = eo_add(EFL_NETWORK_CLIENT_CLASS, NULL); + Ecore_Con_Client *cl_obj = NULL; + eo_add(&cl_obj, EFL_NETWORK_CLIENT_CLASS, NULL); Efl_Network_Client_Data *cl = eo_data_scope_get(obj, EFL_NETWORK_CLIENT_CLASS); if (!cl) { diff --git a/src/lib/ecore_con/ecore_con_url.c b/src/lib/ecore_con/ecore_con_url.c index 000bf4d016..3f127185f3 100644 --- a/src/lib/ecore_con/ecore_con_url.c +++ b/src/lib/ecore_con/ecore_con_url.c @@ -225,7 +225,7 @@ EAPI Ecore_Con_Url * ecore_con_url_new(const char *url) { Ecore_Con_Url *url_obj; - url_obj = eo_add(EFL_NETWORK_URL_CLASS, NULL, efl_network_url_set(eoid, url)); + eo_add(&url_obj, EFL_NETWORK_URL_CLASS, NULL, efl_network_url_set(url_obj, url)); eo_event_callback_array_add(url_obj, efl_network_url_event_table_callbacks(), NULL); diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c index 6ea31570fb..3e8f9c3837 100644 --- a/src/lib/edje/edje_calc.c +++ b/src/lib/edje/edje_calc.c @@ -4744,7 +4744,7 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta case EVAS_CANVAS3D_MESH_PRIMITIVE_SPHERE: { Eo *primitive = NULL; - primitive = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, ed->base->evas); + eo_add(&primitive, EVAS_CANVAS3D_PRIMITIVE_CLASS, ed->base->evas); evas_canvas3d_primitive_form_set(primitive, pd_mesh_node->mesh_node.mesh.primitive); frame_exist = evas_canvas3d_mesh_frame_exist(mesh, pf->type.node.frame); diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c index 3934392965..d6b46086b0 100644 --- a/src/lib/edje/edje_edit.c +++ b/src/lib/edje/edje_edit.c @@ -231,7 +231,7 @@ EAPI Evas_Object * edje_edit_object_add(Evas *evas) { Evas_Object *e; - e = eo_add(MY_CLASS, evas); + eo_add(&e, MY_CLASS, evas); return e; } diff --git a/src/lib/edje/edje_load.c b/src/lib/edje/edje_load.c index 87bbbf0afd..81cba4830f 100644 --- a/src/lib/edje/edje_load.c +++ b/src/lib/edje/edje_load.c @@ -793,9 +793,9 @@ _edje_object_file_set_internal(Evas_Object *obj, const Eina_File *file, const ch Evas_Canvas3D_Material *material = NULL; Edje_Part_Description_Mesh_Node *pd_mesh_node; - rp->node = eo_add(EVAS_CANVAS3D_NODE_CLASS, ed->base->evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH)); + eo_add(&rp->node, EVAS_CANVAS3D_NODE_CLASS, ed->base->evas, evas_canvas3d_node_constructor(rp->node, EVAS_CANVAS3D_NODE_TYPE_MESH)); - mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, ed->base->evas); + eo_add(&mesh, EVAS_CANVAS3D_MESH_CLASS, ed->base->evas); evas_canvas3d_node_mesh_add(rp->node, mesh); pd_mesh_node = (Edje_Part_Description_Mesh_Node*) rp->chosen_description; @@ -809,13 +809,13 @@ _edje_object_file_set_internal(Evas_Object *obj, const Eina_File *file, const ch evas_canvas3d_mesh_frame_add(mesh, 0); } - material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, ed->base->evas); + eo_add(&material, EVAS_CANVAS3D_MATERIAL_CLASS, ed->base->evas); evas_canvas3d_mesh_frame_material_set(mesh, 0, material); if (pd_mesh_node->mesh_node.texture.need_texture && pd_mesh_node->mesh_node.texture.textured) { Evas_Canvas3D_Texture *texture = NULL; - texture = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, ed->base->evas); + eo_add(&texture, EVAS_CANVAS3D_TEXTURE_CLASS, ed->base->evas); evas_canvas3d_material_texture_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, texture); } rp->object = NULL; @@ -826,8 +826,8 @@ _edje_object_file_set_internal(Evas_Object *obj, const Eina_File *file, const ch { Evas_Canvas3D_Light *light = NULL; - rp->node = eo_add(EVAS_CANVAS3D_NODE_CLASS, ed->base->evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_LIGHT)); - light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, ed->base->evas); + eo_add(&rp->node, EVAS_CANVAS3D_NODE_CLASS, ed->base->evas, evas_canvas3d_node_constructor(rp->node, EVAS_CANVAS3D_NODE_TYPE_LIGHT)); + eo_add(&light, EVAS_CANVAS3D_LIGHT_CLASS, ed->base->evas); evas_canvas3d_node_light_set(rp->node, light); rp->object = NULL; @@ -838,8 +838,8 @@ _edje_object_file_set_internal(Evas_Object *obj, const Eina_File *file, const ch { Evas_Canvas3D_Camera *camera = NULL; - rp->node = eo_add(EVAS_CANVAS3D_NODE_CLASS, ed->base->evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_CAMERA)); - camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, ed->base->evas); + eo_add(&rp->node, EVAS_CANVAS3D_NODE_CLASS, ed->base->evas, evas_canvas3d_node_constructor(rp->node, EVAS_CANVAS3D_NODE_TYPE_CAMERA)); + eo_add(&camera, EVAS_CANVAS3D_CAMERA_CLASS, ed->base->evas); evas_canvas3d_node_camera_set(rp->node, camera); rp->object = evas_object_image_filled_add(ed->base->evas); diff --git a/src/lib/edje/edje_multisense.c b/src/lib/edje/edje_multisense.c index df981573f0..8b6f2fa969 100644 --- a/src/lib/edje/edje_multisense.c +++ b/src/lib/edje/edje_multisense.c @@ -202,13 +202,13 @@ _edje_multisense_internal_sound_sample_play(Edje *ed, const char *sample_name, c eet_data->vio.tell = eet_snd_file_tell; eet_data->offset = 0; - in = eo_add(ECORE_AUDIO_IN_SNDFILE_CLASS, NULL, ecore_audio_obj_name_set(eoid, snd_id_str), ecore_audio_obj_in_speed_set(eoid, speed), ecore_audio_obj_vio_set(eoid, &eet_data->vio, eet_data, _free), eo_event_callback_add(eoid, ECORE_AUDIO_IN_EVENT_IN_STOPPED, _play_finished, NULL)); + eo_add(&in, ECORE_AUDIO_IN_SNDFILE_CLASS, NULL, ecore_audio_obj_name_set(in, snd_id_str), ecore_audio_obj_in_speed_set(in, speed), ecore_audio_obj_vio_set(in, &eet_data->vio, eet_data, _free), eo_event_callback_add(in, ECORE_AUDIO_IN_EVENT_IN_STOPPED, _play_finished, NULL)); if (!out) { #if HAVE_COREAUDIO - out = eo_add(ECORE_AUDIO_OUT_CORE_AUDIO_CLASS, NULL); + eo_add(&out, ECORE_AUDIO_OUT_CORE_AUDIO_CLASS, NULL); #elif HAVE_PULSE - out = eo_add(ECORE_AUDIO_OUT_PULSE_CLASS, NULL, eo_event_callback_add(eoid, ECORE_AUDIO_OUT_PULSE_EVENT_CONTEXT_FAIL, _out_fail, NULL)); + eo_add(&out, ECORE_AUDIO_OUT_PULSE_CLASS, NULL, eo_event_callback_add(out, ECORE_AUDIO_OUT_PULSE_EVENT_CONTEXT_FAIL, _out_fail, NULL)); #endif if (out) outs++; } @@ -269,7 +269,7 @@ _edje_multisense_internal_sound_tone_play(Edje *ed, const char *tone_name, const tone = &ed->file->sound_dir->tones[i]; if (!strcmp(tone->name, tone_name)) { - in = eo_add(ECORE_AUDIO_IN_TONE_CLASS, NULL); + eo_add(&in, ECORE_AUDIO_IN_TONE_CLASS, NULL); ecore_audio_obj_name_set(in, "tone"); eo_key_data_set(in, ECORE_AUDIO_ATTR_TONE_FREQ, &tone->value); ecore_audio_obj_in_length_set(in, duration); @@ -278,9 +278,9 @@ _edje_multisense_internal_sound_tone_play(Edje *ed, const char *tone_name, const if (!out) { #if HAVE_COREAUDIO - out = eo_add(ECORE_AUDIO_OUT_CORE_AUDIO_CLASS, NULL); + eo_add(&out, ECORE_AUDIO_OUT_CORE_AUDIO_CLASS, NULL); #elif HAVE_PULSE - out = eo_add(ECORE_AUDIO_OUT_PULSE_CLASS, NULL, eo_event_callback_add(eoid, ECORE_AUDIO_OUT_PULSE_EVENT_CONTEXT_FAIL, _out_fail, NULL)); + eo_add(&out, ECORE_AUDIO_OUT_PULSE_CLASS, NULL, eo_event_callback_add(out, ECORE_AUDIO_OUT_PULSE_EVENT_CONTEXT_FAIL, _out_fail, NULL)); #endif if (out) outs++; } diff --git a/src/lib/edje/edje_smart.c b/src/lib/edje/edje_smart.c index ab42445257..eb5a9cb1f9 100644 --- a/src/lib/edje/edje_smart.c +++ b/src/lib/edje/edje_smart.c @@ -20,7 +20,7 @@ edje_object_add(Evas *evas) { Evas_Object *e; EINA_SAFETY_ON_NULL_RETURN_VAL(evas, NULL); - e = eo_add(MY_CLASS, evas); + eo_add(&e, MY_CLASS, evas); return e; } diff --git a/src/lib/eio/eio_model.c b/src/lib/eio/eio_model.c index 1d96750cc3..91235d2aa9 100644 --- a/src/lib/eio/eio_model.c +++ b/src/lib/eio/eio_model.c @@ -147,7 +147,7 @@ _efl_model_evt_added_ecore_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void Efl_Model_Children_Event cevt; Eina_Value path; - cevt.child = eo_add_ref(EIO_MODEL_CLASS, priv->obj, eio_model_path_set(eoid, evt->filename)); + eo_add_ref(&cevt.child, EIO_MODEL_CLASS, priv->obj, eio_model_path_set(cevt.child, evt->filename)); priv->children_list = eina_list_append(priv->children_list, cevt.child); cevt.index = eina_list_count(priv->children_list); @@ -407,7 +407,7 @@ _eio_main_children_load_cb(void *data, Eio_File *handler EINA_UNUSED, const Eina Eio_Model_Data *priv = data; EINA_SAFETY_ON_NULL_RETURN(priv); - child = eo_add(MY_CLASS, NULL, eio_model_path_set(eoid, info->path)); + eo_add(&child, MY_CLASS, NULL, eio_model_path_set(child, info->path)); eina_spinlock_take(&priv->filter_lock); if (priv->filter_cb) eio_model_children_filter_set(child, priv->filter_cb, priv->filter_userdata); @@ -523,7 +523,8 @@ _eio_model_children_filter_set(Eo *obj EINA_UNUSED, Eio_Model_Data *priv, Eio_Fi static Eo * _eio_model_efl_model_base_child_add(Eo *obj EINA_UNUSED, Eio_Model_Data *priv EINA_UNUSED) { - return eo_add(EIO_MODEL_CLASS, obj); + Eo *ret = NULL; + return eo_add(&ret, EIO_MODEL_CLASS, obj); } static void diff --git a/src/lib/eldbus/eldbus_model_connection.c b/src/lib/eldbus/eldbus_model_connection.c index ebd758be2b..af7e9eb6f7 100644 --- a/src/lib/eldbus/eldbus_model_connection.c +++ b/src/lib/eldbus/eldbus_model_connection.c @@ -345,7 +345,8 @@ _eldbus_model_connection_names_list_cb(void *data, { DBG("(%p): bus = %s", pd->obj, bus); - Eo *child = eo_add(ELDBUS_MODEL_OBJECT_CLASS, NULL, eldbus_model_object_connection_constructor(eoid, pd->connection, bus, "/")); + Eo *child = NULL; + eo_add(&child, ELDBUS_MODEL_OBJECT_CLASS, NULL, eldbus_model_object_connection_constructor(child, pd->connection, bus, "/")); pd->children_list = eina_list_append(pd->children_list, child); } diff --git a/src/lib/eldbus/eldbus_model_object.c b/src/lib/eldbus/eldbus_model_object.c index 240d657e77..697a7591c3 100644 --- a/src/lib/eldbus/eldbus_model_object.c +++ b/src/lib/eldbus/eldbus_model_object.c @@ -532,7 +532,7 @@ _eldbus_model_object_create_children(Eldbus_Model_Object_Data *pd, Eldbus_Object WRN("(%p) Creating child: bus = %s, path = %s, interface = %s", pd->obj, pd->bus, current_path, interface->name); // TODO: increment reference to keep 'interface' in memory - child = eo_add_ref(ELDBUS_MODEL_PROXY_CLASS, NULL, eldbus_model_proxy_constructor(eoid, object, interface)); + eo_add_ref(&child, ELDBUS_MODEL_PROXY_CLASS, NULL, eldbus_model_proxy_constructor(child, object, interface)); pd->children_list = eina_list_append(pd->children_list, child); } diff --git a/src/lib/eldbus/eldbus_model_proxy.c b/src/lib/eldbus/eldbus_model_proxy.c index 2e660f4116..d2a3c80b51 100644 --- a/src/lib/eldbus/eldbus_model_proxy.c +++ b/src/lib/eldbus/eldbus_model_proxy.c @@ -325,7 +325,7 @@ _eldbus_model_proxy_create_methods_children(Eldbus_Model_Proxy_Data *pd) INF("(%p) Creating method child: bus = %s, path = %s, method = %s::%s", pd->obj, bus, path, interface_name, method_name); - child = eo_add(ELDBUS_MODEL_METHOD_CLASS, NULL, eldbus_model_method_constructor(eoid, pd->proxy, method)); + eo_add(&child, ELDBUS_MODEL_METHOD_CLASS, NULL, eldbus_model_method_constructor(child, pd->proxy, method)); pd->children_list = eina_list_append(pd->children_list, child); } @@ -359,7 +359,7 @@ _eldbus_model_proxy_create_signals_children(Eldbus_Model_Proxy_Data *pd) DBG("(%p) Creating signal child: bus = %s, path = %s, signal = %s::%s", pd->obj, bus, path, interface_name, signal_name); - child = eo_add(ELDBUS_MODEL_SIGNAL_CLASS, NULL, eldbus_model_signal_constructor(eoid, pd->proxy, signal)); + eo_add(&child, ELDBUS_MODEL_SIGNAL_CLASS, NULL, eldbus_model_signal_constructor(child, pd->proxy, signal)); pd->children_list = eina_list_append(pd->children_list, child); } diff --git a/src/lib/emotion/emotion_smart.c b/src/lib/emotion/emotion_smart.c index d0b0f327f8..5e7afa29de 100644 --- a/src/lib/emotion/emotion_smart.c +++ b/src/lib/emotion/emotion_smart.c @@ -236,7 +236,7 @@ EAPI Evas_Object * emotion_object_add(Evas *evas) { Evas_Object *e; - e = eo_add(MY_CLASS, evas); + eo_add(&e, MY_CLASS, evas); return e; } diff --git a/src/lib/evas/Evas_Legacy.h b/src/lib/evas/Evas_Legacy.h index 6f2108f810..916304789d 100644 --- a/src/lib/evas/Evas_Legacy.h +++ b/src/lib/evas/Evas_Legacy.h @@ -1681,7 +1681,8 @@ EAPI Evas_Object *evas_object_rectangle_add(Evas *e) EINA_WARN_UNUSED_RESULT EIN * @code * vector = evas_object_vg_add(canvas); * root = evas_obj_vg_root_node_get(vector); - * shape = eo_add(EVAS_VG_SHAPE_CLASS, root); + * shape = NULL; + eo_add(&shape, EVAS_VG_SHAPE_CLASS, root); * Efl_Gfx_Path_Command *path_cmd = NULL; * double *points = NULL; * efl_gfx_path_append_circle(&path_cmd, &points); diff --git a/src/lib/evas/canvas/evas_canvas3d_camera.c b/src/lib/evas/canvas/evas_canvas3d_camera.c index d631df6917..9b1fc6c137 100644 --- a/src/lib/evas/canvas/evas_canvas3d_camera.c +++ b/src/lib/evas/canvas/evas_canvas3d_camera.c @@ -101,7 +101,8 @@ evas_canvas3d_camera_add(Evas *e) MAGIC_CHECK(e, Evas, MAGIC_EVAS); return NULL; MAGIC_CHECK_END(); - Evas_Object *eo_obj = eo_add(MY_CLASS, e); + Evas_Object *eo_obj = NULL; + eo_add(&eo_obj, MY_CLASS, e); return eo_obj; } diff --git a/src/lib/evas/canvas/evas_canvas3d_light.c b/src/lib/evas/canvas/evas_canvas3d_light.c index 11e9c81965..b9b186fe18 100644 --- a/src/lib/evas/canvas/evas_canvas3d_light.c +++ b/src/lib/evas/canvas/evas_canvas3d_light.c @@ -72,7 +72,8 @@ evas_canvas3d_light_add(Evas *e) MAGIC_CHECK(e, Evas, MAGIC_EVAS); return NULL; MAGIC_CHECK_END(); - Evas_Object *eo_obj = eo_add(MY_CLASS, e); + Evas_Object *eo_obj = NULL; + eo_add(&eo_obj, MY_CLASS, e); return eo_obj; } diff --git a/src/lib/evas/canvas/evas_canvas3d_material.c b/src/lib/evas/canvas/evas_canvas3d_material.c index 5070d44450..98a4e66cb5 100644 --- a/src/lib/evas/canvas/evas_canvas3d_material.c +++ b/src/lib/evas/canvas/evas_canvas3d_material.c @@ -84,7 +84,8 @@ evas_canvas3d_material_add(Evas *e) MAGIC_CHECK(e, Evas, MAGIC_EVAS); return NULL; MAGIC_CHECK_END(); - Evas_Object *eo_obj = eo_add(MY_CLASS, e); + Evas_Object *eo_obj = NULL; + eo_add(&eo_obj, MY_CLASS, e); return eo_obj; } diff --git a/src/lib/evas/canvas/evas_canvas3d_mesh.c b/src/lib/evas/canvas/evas_canvas3d_mesh.c index d19a1fc39a..5442ecadb2 100644 --- a/src/lib/evas/canvas/evas_canvas3d_mesh.c +++ b/src/lib/evas/canvas/evas_canvas3d_mesh.c @@ -254,7 +254,8 @@ evas_canvas3d_mesh_add(Evas *e) MAGIC_CHECK(e, Evas, MAGIC_EVAS); return NULL; MAGIC_CHECK_END(); - Evas_Object *eo_obj = eo_add(MY_CLASS, e); + Evas_Object *eo_obj = NULL; + eo_add(&eo_obj, MY_CLASS, e); return eo_obj; } diff --git a/src/lib/evas/canvas/evas_canvas3d_node.c b/src/lib/evas/canvas/evas_canvas3d_node.c index 5e0944d929..246450f593 100644 --- a/src/lib/evas/canvas/evas_canvas3d_node.c +++ b/src/lib/evas/canvas/evas_canvas3d_node.c @@ -1012,7 +1012,8 @@ evas_canvas3d_node_add(Evas *e, Evas_Canvas3D_Node_Type type) MAGIC_CHECK(e, Evas, MAGIC_EVAS); return NULL; MAGIC_CHECK_END(); - Evas_Object *eo_obj = eo_add(MY_CLASS, e, evas_canvas3d_node_constructor(eoid, type)); + Evas_Object *eo_obj = NULL; + eo_add(&eo_obj, MY_CLASS, e, evas_canvas3d_node_constructor(eo_obj, type)); return eo_obj; } diff --git a/src/lib/evas/canvas/evas_canvas3d_primitive.c b/src/lib/evas/canvas/evas_canvas3d_primitive.c index 76dcdd6746..ab07d132f3 100644 --- a/src/lib/evas/canvas/evas_canvas3d_primitive.c +++ b/src/lib/evas/canvas/evas_canvas3d_primitive.c @@ -20,7 +20,8 @@ evas_canvas3d_primitive_add(Evas *e) MAGIC_CHECK(e, Evas, MAGIC_EVAS); return NULL; MAGIC_CHECK_END(); - Evas_Object *eo_obj = eo_add(MY_CLASS, e); + Evas_Object *eo_obj = NULL; + eo_add(&eo_obj, MY_CLASS, e); return eo_obj; } diff --git a/src/lib/evas/canvas/evas_canvas3d_scene.c b/src/lib/evas/canvas/evas_canvas3d_scene.c index cb7ffc373a..e1a0295e07 100644 --- a/src/lib/evas/canvas/evas_canvas3d_scene.c +++ b/src/lib/evas/canvas/evas_canvas3d_scene.c @@ -61,7 +61,8 @@ evas_canvas3d_scene_add(Evas *e) MAGIC_CHECK(e, Evas, MAGIC_EVAS); return NULL; MAGIC_CHECK_END(); - Evas_Object *eo_obj = eo_add(MY_CLASS, e); + Evas_Object *eo_obj = NULL; + eo_add(&eo_obj, MY_CLASS, e); return eo_obj; } diff --git a/src/lib/evas/canvas/evas_canvas3d_texture.c b/src/lib/evas/canvas/evas_canvas3d_texture.c index 664de1c9c1..b058765b6a 100644 --- a/src/lib/evas/canvas/evas_canvas3d_texture.c +++ b/src/lib/evas/canvas/evas_canvas3d_texture.c @@ -313,7 +313,8 @@ evas_canvas3d_texture_add(Evas *e) MAGIC_CHECK(e, Evas, MAGIC_EVAS); return NULL; MAGIC_CHECK_END(); - Evas_Object *eo_obj = eo_add(MY_CLASS, e); + Evas_Object *eo_obj = NULL; + eo_add(&eo_obj, MY_CLASS, e); return eo_obj; } diff --git a/src/lib/evas/canvas/evas_main.c b/src/lib/evas/canvas/evas_main.c index 38e901a957..56956a7e3e 100644 --- a/src/lib/evas/canvas/evas_main.c +++ b/src/lib/evas/canvas/evas_main.c @@ -151,7 +151,8 @@ evas_shutdown(void) EAPI Evas * evas_new(void) { - Evas_Object *eo_obj = eo_add(EVAS_CANVAS_CLASS, NULL); + Evas_Object *eo_obj = NULL; + eo_add(&eo_obj, EVAS_CANVAS_CLASS, NULL); return eo_obj; } diff --git a/src/lib/evas/canvas/evas_object_box.c b/src/lib/evas/canvas/evas_object_box.c index 55e7ca5943..739012ee5c 100644 --- a/src/lib/evas/canvas/evas_object_box.c +++ b/src/lib/evas/canvas/evas_object_box.c @@ -458,7 +458,8 @@ evas_object_box_add(Evas *evas) MAGIC_CHECK(evas, Evas, MAGIC_EVAS); return NULL; MAGIC_CHECK_END(); - Evas_Object *obj = eo_add(MY_CLASS, evas); + Evas_Object *obj = NULL; + eo_add(&obj, MY_CLASS, evas); return obj; } diff --git a/src/lib/evas/canvas/evas_object_grid.c b/src/lib/evas/canvas/evas_object_grid.c index 0374b132f2..12b6d2bf74 100644 --- a/src/lib/evas/canvas/evas_object_grid.c +++ b/src/lib/evas/canvas/evas_object_grid.c @@ -265,7 +265,8 @@ evas_object_grid_add(Evas *evas) MAGIC_CHECK(evas, Evas, MAGIC_EVAS); return NULL; MAGIC_CHECK_END(); - Evas_Object *obj = eo_add(MY_CLASS, evas); + Evas_Object *obj = NULL; + eo_add(&obj, MY_CLASS, evas); return obj; } diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c index f3b1d7797a..0367fa2526 100644 --- a/src/lib/evas/canvas/evas_object_image.c +++ b/src/lib/evas/canvas/evas_object_image.c @@ -383,7 +383,8 @@ evas_object_image_add(Evas *eo_e) Evas_Public_Data *e = eo_data_scope_get(eo_e, EVAS_CANVAS_CLASS); EINA_SAFETY_ON_NULL_RETURN_VAL(e, NULL); EINA_SAFETY_ON_NULL_RETURN_VAL(e->engine.func, NULL); - Evas_Object *eo_obj = eo_add(EVAS_IMAGE_CLASS, eo_e); + Evas_Object *eo_obj = NULL; + eo_add(&eo_obj, EVAS_IMAGE_CLASS, eo_e); return eo_obj; } diff --git a/src/lib/evas/canvas/evas_object_line.c b/src/lib/evas/canvas/evas_object_line.c index 26dd5c7acb..07ef578d8f 100644 --- a/src/lib/evas/canvas/evas_object_line.c +++ b/src/lib/evas/canvas/evas_object_line.c @@ -97,7 +97,8 @@ evas_object_line_add(Evas *e) MAGIC_CHECK(e, Evas, MAGIC_EVAS); return NULL; MAGIC_CHECK_END(); - Evas_Object *eo_obj = eo_add(EVAS_LINE_CLASS, e); + Evas_Object *eo_obj = NULL; + eo_add(&eo_obj, EVAS_LINE_CLASS, e); return eo_obj; } diff --git a/src/lib/evas/canvas/evas_object_polygon.c b/src/lib/evas/canvas/evas_object_polygon.c index a154e37cd2..10276ca02f 100644 --- a/src/lib/evas/canvas/evas_object_polygon.c +++ b/src/lib/evas/canvas/evas_object_polygon.c @@ -98,7 +98,8 @@ evas_object_polygon_add(Evas *e) MAGIC_CHECK(e, Evas, MAGIC_EVAS); return NULL; MAGIC_CHECK_END(); - Evas_Object *eo_obj = eo_add(EVAS_POLYGON_CLASS, e); + Evas_Object *eo_obj = NULL; + eo_add(&eo_obj, EVAS_POLYGON_CLASS, e); return eo_obj; } diff --git a/src/lib/evas/canvas/evas_object_rectangle.c b/src/lib/evas/canvas/evas_object_rectangle.c index 37f8266eb1..212cda658f 100644 --- a/src/lib/evas/canvas/evas_object_rectangle.c +++ b/src/lib/evas/canvas/evas_object_rectangle.c @@ -95,7 +95,8 @@ evas_object_rectangle_add(Evas *e) MAGIC_CHECK(e, Evas, MAGIC_EVAS); return NULL; MAGIC_CHECK_END(); - Evas_Object *eo_obj = eo_add(EVAS_RECTANGLE_CLASS, e); + Evas_Object *eo_obj = NULL; + eo_add(&eo_obj, EVAS_RECTANGLE_CLASS, e); return eo_obj; } diff --git a/src/lib/evas/canvas/evas_object_smart.c b/src/lib/evas/canvas/evas_object_smart.c index 44c18f197f..b380f58c83 100644 --- a/src/lib/evas/canvas/evas_object_smart.c +++ b/src/lib/evas/canvas/evas_object_smart.c @@ -570,7 +570,7 @@ evas_object_smart_add(Evas *eo_e, Evas_Smart *s) MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS); return NULL; MAGIC_CHECK_END(); - eo_obj = eo_add(EVAS_OBJECT_SMART_CLASS, eo_e); + eo_add(&eo_obj, EVAS_OBJECT_SMART_CLASS, eo_e); evas_obj_smart_attach(eo_obj, s); return eo_obj; } diff --git a/src/lib/evas/canvas/evas_object_table.c b/src/lib/evas/canvas/evas_object_table.c index 60a83fddbe..ab71ad8e25 100644 --- a/src/lib/evas/canvas/evas_object_table.c +++ b/src/lib/evas/canvas/evas_object_table.c @@ -964,7 +964,8 @@ evas_object_table_add(Evas *evas) MAGIC_CHECK(evas, Evas, MAGIC_EVAS); return NULL; MAGIC_CHECK_END(); - Evas_Object *obj = eo_add(MY_CLASS, evas); + Evas_Object *obj = NULL; + eo_add(&obj, MY_CLASS, evas); return obj; } diff --git a/src/lib/evas/canvas/evas_object_text.c b/src/lib/evas/canvas/evas_object_text.c index a492ebdca7..723c8b510e 100644 --- a/src/lib/evas/canvas/evas_object_text.c +++ b/src/lib/evas/canvas/evas_object_text.c @@ -372,7 +372,8 @@ evas_object_text_add(Evas *e) MAGIC_CHECK(e, Evas, MAGIC_EVAS); return NULL; MAGIC_CHECK_END(); - Evas_Object *eo_obj = eo_add(EVAS_TEXT_CLASS, e); + Evas_Object *eo_obj = NULL; + eo_add(&eo_obj, EVAS_TEXT_CLASS, e); return eo_obj; } diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index 8066f08732..b82a6911a9 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -6253,7 +6253,8 @@ evas_object_textblock_add(Evas *e) MAGIC_CHECK(e, Evas, MAGIC_EVAS); return NULL; MAGIC_CHECK_END(); - Evas_Object *eo_obj = eo_add(EVAS_TEXTBLOCK_CLASS, e); + Evas_Object *eo_obj = NULL; + eo_add(&eo_obj, EVAS_TEXTBLOCK_CLASS, e); return eo_obj; } diff --git a/src/lib/evas/canvas/evas_object_textgrid.c b/src/lib/evas/canvas/evas_object_textgrid.c index 8742a4c2de..bcbc186488 100644 --- a/src/lib/evas/canvas/evas_object_textgrid.c +++ b/src/lib/evas/canvas/evas_object_textgrid.c @@ -1056,7 +1056,8 @@ evas_object_textgrid_add(Evas *e) MAGIC_CHECK(e, Evas, MAGIC_EVAS); return NULL; MAGIC_CHECK_END(); - Evas_Object *eo_obj = eo_add(EVAS_TEXTGRID_CLASS, e); + Evas_Object *eo_obj = NULL; + eo_add(&eo_obj, EVAS_TEXTGRID_CLASS, e); return eo_obj; } diff --git a/src/lib/evas/canvas/evas_object_vg.c b/src/lib/evas/canvas/evas_object_vg.c index 929b584871..1b915e4405 100644 --- a/src/lib/evas/canvas/evas_object_vg.c +++ b/src/lib/evas/canvas/evas_object_vg.c @@ -81,7 +81,8 @@ evas_object_vg_add(Evas *e) MAGIC_CHECK(e, Evas, MAGIC_EVAS); return NULL; MAGIC_CHECK_END(); - Evas_Object *eo_obj = eo_add(MY_CLASS, e); + Evas_Object *eo_obj = NULL; + eo_add(&eo_obj, MY_CLASS, e); // Ask backend to return the main Ector_Surface @@ -137,7 +138,7 @@ _evas_vg_eo_base_constructor(Eo *eo_obj, Evas_VG_Data *pd) obj->type = o_type; /* root node */ - pd->root = eo_add(EFL_VG_ROOT_NODE_CLASS, eo_obj); + eo_add(&pd->root, EFL_VG_ROOT_NODE_CLASS, eo_obj); eo_ref(pd->root); eina_array_step_set(&pd->cleanup, sizeof(pd->cleanup), 8); diff --git a/src/lib/evas/canvas/evas_out.c b/src/lib/evas/canvas/evas_out.c index 73c902c20f..fdf4f9542c 100644 --- a/src/lib/evas/canvas/evas_out.c +++ b/src/lib/evas/canvas/evas_out.c @@ -19,7 +19,8 @@ evas_out_add(Evas *e) MAGIC_CHECK(e, Evas, MAGIC_EVAS); return NULL; MAGIC_CHECK_END(); - Evas_Object *eo_obj = eo_add(MY_CLASS, e); + Evas_Object *eo_obj = NULL; + eo_add(&eo_obj, MY_CLASS, e); return eo_obj; } diff --git a/src/lib/evas/canvas/evas_vg_container.c b/src/lib/evas/canvas/evas_vg_container.c index 7d766a55da..7491c3a523 100644 --- a/src/lib/evas/canvas/evas_vg_container.c +++ b/src/lib/evas/canvas/evas_vg_container.c @@ -155,14 +155,16 @@ _efl_vg_container_efl_vg_base_dup(Eo *obj, { // By setting parent, we automatically reference // this new object as a child of obj. Magic at work ! - (void) eo_add_ref(eo_class_get(child), obj, efl_vg_dup(eoid, child)); + Eo *tmp = NULL; + eo_add_ref(&tmp, eo_class_get(child), obj, efl_vg_dup(tmp, child)); } } EAPI Efl_VG* evas_vg_container_add(Efl_VG *parent) { - return eo_add(EFL_VG_CONTAINER_CLASS, parent); + Eo *ret = NULL; + return eo_add(&ret, EFL_VG_CONTAINER_CLASS, parent); } #include "efl_vg_container.eo.c" diff --git a/src/lib/evas/canvas/evas_vg_node.c b/src/lib/evas/canvas/evas_vg_node.c index 2ae9135681..fed256b56a 100644 --- a/src/lib/evas/canvas/evas_vg_node.c +++ b/src/lib/evas/canvas/evas_vg_node.c @@ -779,7 +779,7 @@ _efl_vg_base_dup(Eo *obj, Efl_VG_Base_Data *pd, const Efl_VG_Base *from) if (fromd->mask) { Eo *tmp = pd->mask; - pd->mask = eo_add(eo_class_get(fromd->mask), obj, efl_vg_dup(eoid, tmp)); + eo_add(&pd->mask, eo_class_get(fromd->mask), obj, efl_vg_dup(pd->mask, tmp)); } pd->x = fromd->x; diff --git a/src/lib/evas/canvas/evas_vg_shape.c b/src/lib/evas/canvas/evas_vg_shape.c index 312953a46f..9d49735243 100644 --- a/src/lib/evas/canvas/evas_vg_shape.c +++ b/src/lib/evas/canvas/evas_vg_shape.c @@ -232,17 +232,17 @@ _efl_vg_shape_efl_vg_base_dup(Eo *obj, Efl_VG_Shape_Data *pd EINA_UNUSED, const if (fromd->fill) { - fill = eo_add(eo_class_get(fromd->fill), parent, efl_vg_dup(eoid, fromd->fill)); + eo_add(&fill, eo_class_get(fromd->fill), parent, efl_vg_dup(fill, fromd->fill)); } if (fromd->stroke.fill) { - stroke_fill = eo_add(eo_class_get(fromd->stroke.fill), parent, efl_vg_dup(eoid, fromd->stroke.fill)); + eo_add(&stroke_fill, eo_class_get(fromd->stroke.fill), parent, efl_vg_dup(stroke_fill, fromd->stroke.fill)); } if (fromd->stroke.marker) { - stroke_marker = eo_add(eo_class_get(fromd->stroke.marker), parent, efl_vg_dup(eoid, fromd->stroke.marker)); + eo_add(&stroke_marker, eo_class_get(fromd->stroke.marker), parent, efl_vg_dup(stroke_marker, fromd->stroke.marker)); } efl_vg_shape_fill_set(obj, fill); @@ -458,7 +458,8 @@ evas_vg_shape_shape_equal_commands(Eo *obj, const Eo *with) EAPI Efl_VG* evas_vg_shape_add(Efl_VG *parent) { - return eo_add(EFL_VG_SHAPE_CLASS, parent); + Eo *ret = NULL; + return eo_add(&ret, EFL_VG_SHAPE_CLASS, parent); } #include "efl_vg_shape.eo.c" diff --git a/src/modules/evas/engines/gl_generic/evas_engine.c b/src/modules/evas/engines/gl_generic/evas_engine.c index d296cf660e..617ae340e4 100644 --- a/src/modules/evas/engines/gl_generic/evas_engine.c +++ b/src/modules/evas/engines/gl_generic/evas_engine.c @@ -2447,16 +2447,16 @@ eng_ector_create(void *data EINA_UNUSED) ector_backend = getenv("ECTOR_BACKEND"); if (ector_backend && !strcasecmp(ector_backend, "default")) { - ector = eo_add(ECTOR_SOFTWARE_SURFACE_CLASS, NULL); + eo_add(&ector, ECTOR_SOFTWARE_SURFACE_CLASS, NULL); } else if (ector_backend && !strcasecmp(ector_backend, "experimental")) { - ector = eo_add(ECTOR_GL_SURFACE_CLASS, NULL); + eo_add(&ector, ECTOR_GL_SURFACE_CLASS, NULL); use_gl = EINA_TRUE; } else { - ector = eo_add(ECTOR_CAIRO_SOFTWARE_SURFACE_CLASS, NULL); + eo_add(&ector, ECTOR_CAIRO_SOFTWARE_SURFACE_CLASS, NULL); use_cairo = EINA_TRUE; } return ector; @@ -2477,13 +2477,13 @@ eng_ector_buffer_wrap(void *data EINA_UNUSED, Evas *evas, void *engine_image, Ei { RGBA_Image *im = engine_image; - buf = eo_add(EVAS_ECTOR_GL_RGBAIMAGE_BUFFER_CLASS, evas, evas_ector_buffer_engine_image_set(eoid, evas, im)); + eo_add(&buf, EVAS_ECTOR_GL_RGBAIMAGE_BUFFER_CLASS, evas, evas_ector_buffer_engine_image_set(buf, evas, im)); } else { Evas_GL_Image *im = engine_image; - buf = eo_add(EVAS_ECTOR_GL_IMAGE_BUFFER_CLASS, evas, evas_ector_buffer_engine_image_set(eoid, evas, im)); + eo_add(&buf, EVAS_ECTOR_GL_IMAGE_BUFFER_CLASS, evas, evas_ector_buffer_engine_image_set(buf, evas, im)); } return buf; } @@ -2544,7 +2544,7 @@ eng_ector_buffer_new(void *data, Evas *evas, void *pixels, gc = re->window_gl_context_get(re->software.ob); im = evas_gl_common_image_surface_new(gc, iw, ih, EINA_TRUE); - buf = eo_add(EVAS_ECTOR_GL_IMAGE_BUFFER_CLASS, evas, evas_ector_buffer_engine_image_set(eoid, evas, im)); + eo_add(&buf, EVAS_ECTOR_GL_IMAGE_BUFFER_CLASS, evas, evas_ector_buffer_engine_image_set(buf, evas, im)); im->references--; } return buf; diff --git a/src/modules/evas/engines/software_generic/evas_engine.c b/src/modules/evas/engines/software_generic/evas_engine.c index f2018a626b..060d2e12b9 100644 --- a/src/modules/evas/engines/software_generic/evas_engine.c +++ b/src/modules/evas/engines/software_generic/evas_engine.c @@ -3740,12 +3740,12 @@ eng_ector_create(void *data EINA_UNUSED) ector_backend = getenv("ECTOR_BACKEND"); if (ector_backend && !strcasecmp(ector_backend, "default")) { - ector = eo_add(ECTOR_SOFTWARE_SURFACE_CLASS, NULL); + eo_add(&ector, ECTOR_SOFTWARE_SURFACE_CLASS, NULL); use_cairo = EINA_FALSE; } else { - ector = eo_add(ECTOR_CAIRO_SOFTWARE_SURFACE_CLASS, NULL); + eo_add(&ector, ECTOR_CAIRO_SOFTWARE_SURFACE_CLASS, NULL); use_cairo = EINA_TRUE; } return ector; @@ -3765,7 +3765,7 @@ eng_ector_buffer_wrap(void *data EINA_UNUSED, Evas *e, void *engine_image, Eina_ if (!ie) return NULL; - buf = eo_add(EVAS_ECTOR_SOFTWARE_BUFFER_CLASS, e, evas_ector_buffer_engine_image_set(eoid, e, ie)); + eo_add(&buf, EVAS_ECTOR_SOFTWARE_BUFFER_CLASS, e, evas_ector_buffer_engine_image_set(buf, e, ie)); return buf; } @@ -3784,7 +3784,7 @@ eng_ector_buffer_new(void *data EINA_UNUSED, Evas *evas, void *pixels, if ((flags & (ECTOR_BUFFER_FLAG_RENDERABLE | ECTOR_BUFFER_FLAG_DRAWABLE)) == 0) { - buf = eo_add(ECTOR_SOFTWARE_BUFFER_CLASS, evas, ector_buffer_pixels_set(eoid, pixels, width, height, stride, cspace, writeable, l, r, t, b)); + eo_add(&buf, ECTOR_SOFTWARE_BUFFER_CLASS, evas, ector_buffer_pixels_set(buf, pixels, width, height, stride, cspace, writeable, l, r, t, b)); } else { diff --git a/src/modules/evas/model_loaders/eet/evas_model_load_eet.c b/src/modules/evas/model_loaders/eet/evas_model_load_eet.c index c17e984634..96e70fee90 100644 --- a/src/modules/evas/model_loaders/eet/evas_model_load_eet.c +++ b/src/modules/evas/model_loaders/eet/evas_model_load_eet.c @@ -65,7 +65,7 @@ _set_material_to_mesh_from_eet_file(Evas_Canvas3D_Mesh *mesh, { Evas_Canvas3D_Object_Data *pd = eo_data_scope_get(mesh, EVAS_CANVAS3D_OBJECT_CLASS); Eo *material = NULL; - material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, pd->evas); + eo_add(&material, EVAS_CANVAS3D_MATERIAL_CLASS, pd->evas); evas_canvas3d_material_enable_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, !!(eet_mesh->materials->colors[0].a > 0)); evas_canvas3d_material_enable_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, !!(eet_mesh->materials->colors[1].a > 0)); diff --git a/src/tests/ecore/ecore_test_animator.c b/src/tests/ecore/ecore_test_animator.c index e2f17bcd9c..c00cdd752e 100644 --- a/src/tests/ecore/ecore_test_animator.c +++ b/src/tests/ecore/ecore_test_animator.c @@ -30,7 +30,7 @@ START_TEST(ecore_test_animators) fail_if(!ecore_init(), "ERROR: Cannot init Ecore!\n"); ecore_animator_frametime_set(interval1); - animator = eo_add(ECORE_ANIMATOR_CLASS, NULL, ecore_animator_timeline_constructor(eoid, 1, _anim_cb, &interval1)); + eo_add(&animator, ECORE_ANIMATOR_CLASS, NULL, ecore_animator_timeline_constructor(animator, 1, _anim_cb, &interval1)); fail_if(!animator); @@ -38,7 +38,7 @@ START_TEST(ecore_test_animators) ecore_animator_frametime_set(interval2); prev = 0; - animator = eo_add(ECORE_ANIMATOR_CLASS, NULL, ecore_animator_timeline_constructor(eoid, 1, _anim_cb, &interval2)); + eo_add(&animator, ECORE_ANIMATOR_CLASS, NULL, ecore_animator_timeline_constructor(animator, 1, _anim_cb, &interval2)); fail_if(!animator); ecore_main_loop_begin(); diff --git a/src/tests/ecore/ecore_test_ecore_audio.c b/src/tests/ecore/ecore_test_ecore_audio.c index 0240903e0b..a6589ce02b 100644 --- a/src/tests/ecore/ecore_test_ecore_audio.c +++ b/src/tests/ecore/ecore_test_ecore_audio.c @@ -62,14 +62,14 @@ START_TEST(ecore_test_ecore_audio_obj_pulse) Eina_Bool ret = EINA_FALSE; Eina_Bool pulse_context_failed = EINA_FALSE; - in = eo_add(ECORE_AUDIO_IN_SNDFILE_CLASS, NULL); + eo_add(&in, ECORE_AUDIO_IN_SNDFILE_CLASS, NULL); fail_if(!in); ecore_audio_obj_name_set(in, "modem.wav"); ret = ecore_audio_obj_source_set(in, TESTS_SRC_DIR"/modem.wav"); fail_if(!ret); - out = eo_add(ECORE_AUDIO_OUT_PULSE_CLASS, NULL); + eo_add(&out, ECORE_AUDIO_OUT_PULSE_CLASS, NULL); fail_if(!out); ecore_timer_add(0.3, _seek_vol, in); @@ -112,12 +112,12 @@ START_TEST(ecore_test_ecore_audio_cleanup) int freq = 1000; Eina_Bool ret = EINA_FALSE; - in = eo_add(ECORE_AUDIO_IN_TONE_CLASS, NULL); + eo_add(&in, ECORE_AUDIO_IN_TONE_CLASS, NULL); fail_if(!in); eo_key_data_set(in, ECORE_AUDIO_ATTR_TONE_FREQ, &freq); ecore_audio_obj_in_length_set(in, 2); - out = eo_add(ECORE_AUDIO_OUT_SNDFILE_CLASS, NULL); + eo_add(&out, ECORE_AUDIO_OUT_SNDFILE_CLASS, NULL); fail_if(!out); ret = ecore_audio_obj_format_set(out, ECORE_AUDIO_FORMAT_OGG); fail_if(!ret); @@ -143,7 +143,7 @@ START_TEST(ecore_test_ecore_audio_obj_tone) Eina_Bool ret; char *tmp; - in = eo_add(ECORE_AUDIO_IN_TONE_CLASS, NULL); + eo_add(&in, ECORE_AUDIO_IN_TONE_CLASS, NULL); fail_if(!in); ecore_audio_obj_name_set(in, "tone"); @@ -201,7 +201,7 @@ START_TEST(ecore_test_ecore_audio_obj_tone) len = ecore_audio_obj_in_remaining_get(in); fail_if(len != 1.0); - out = eo_add(ECORE_AUDIO_OUT_SNDFILE_CLASS, NULL); + eo_add(&out, ECORE_AUDIO_OUT_SNDFILE_CLASS, NULL); fail_if(!out); ecore_audio_obj_name_set(out, "tmp.wav"); @@ -235,7 +235,7 @@ START_TEST(ecore_test_ecore_audio_obj_sndfile) Ecore_Audio_Format fmt; const char *src; - in = eo_add(ECORE_AUDIO_IN_SNDFILE_CLASS, NULL); + eo_add(&in, ECORE_AUDIO_IN_SNDFILE_CLASS, NULL); fail_if(!in); fmt = ecore_audio_obj_format_get(in); @@ -281,7 +281,7 @@ START_TEST(ecore_test_ecore_audio_obj_sndfile) len = ecore_audio_obj_in_seek(in, -1.0, SEEK_END); fail_if(fabs(rem - 1 - len) > 0.1); - out = eo_add(ECORE_AUDIO_OUT_SNDFILE_CLASS, NULL); + eo_add(&out, ECORE_AUDIO_OUT_SNDFILE_CLASS, NULL); fail_if(!out); ecore_audio_obj_name_set(out, "tmp.wav"); @@ -322,9 +322,12 @@ START_TEST(ecore_test_ecore_audio_obj_in_out) Eina_List *in3; Eina_Bool attached; - Eo *in = eo_add(ECORE_AUDIO_IN_CLASS, NULL); - Eo *in2 = eo_add(ECORE_AUDIO_IN_CLASS, NULL); - Eo *out = eo_add(ECORE_AUDIO_OUT_CLASS, NULL); + Eo *in = NULL; + eo_add(&in, ECORE_AUDIO_IN_CLASS, NULL); + Eo *in2 = NULL; + eo_add(&in2, ECORE_AUDIO_IN_CLASS, NULL); + Eo *out = NULL; + eo_add(&out, ECORE_AUDIO_OUT_CLASS, NULL); fail_if(!in); fail_if(!in2); @@ -420,10 +423,10 @@ START_TEST(ecore_test_ecore_audio_obj_vio) { Eo *in, *out; - in = eo_add(ECORE_AUDIO_IN_CLASS, NULL); + eo_add(&in, ECORE_AUDIO_IN_CLASS, NULL); fail_if(!in); - out = eo_add(ECORE_AUDIO_OUT_CLASS, NULL); + eo_add(&out, ECORE_AUDIO_OUT_CLASS, NULL); fail_if(!out); ecore_audio_obj_vio_set(in, &in_vio, NULL, NULL); @@ -458,7 +461,8 @@ START_TEST(ecore_test_ecore_audio_obj_in) Ecore_Audio_Vio vio; Eina_Bool freed = EINA_FALSE; - Eo *in = eo_add(ECORE_AUDIO_IN_CLASS, NULL); + Eo *in = NULL; + eo_add(&in, ECORE_AUDIO_IN_CLASS, NULL); fail_if(!in); @@ -545,10 +549,10 @@ START_TEST(ecore_test_ecore_audio_obj) double volume; Eo *objs[2], *obj; - objs[0] = eo_add(ECORE_AUDIO_IN_CLASS, NULL); + eo_add(&objs[0], ECORE_AUDIO_IN_CLASS, NULL); fail_if(!objs[0]); - objs[1] = eo_add(ECORE_AUDIO_OUT_CLASS, NULL); + eo_add(&objs[1], ECORE_AUDIO_OUT_CLASS, NULL); fail_if(!objs[1]); for (i=0; i<2; i++) { diff --git a/src/tests/eio/eio_model_test_file.c b/src/tests/eio/eio_model_test_file.c index 5873d7ab83..8018c5b080 100644 --- a/src/tests/eio/eio_model_test_file.c +++ b/src/tests/eio/eio_model_test_file.c @@ -165,7 +165,7 @@ START_TEST(eio_model_test_test_file) fail_if(!ecore_init(), "ERROR: Cannot init Ecore!\n"); fail_if(!eio_init(), "ERROR: Cannot init EIO!\n"); - filemodel = eo_add(EIO_MODEL_CLASS, NULL, eio_model_path_set(eoid, EFL_MODEL_TEST_FILENAME_PATH)); + eo_add(&filemodel, EIO_MODEL_CLASS, NULL, eio_model_path_set(filemodel, EFL_MODEL_TEST_FILENAME_PATH)); fail_if(!filemodel, "ERROR: Cannot init model!\n"); eo_event_callback_add(filemodel, EFL_MODEL_BASE_EVENT_LOAD_STATUS, _load_status_cb, NULL); diff --git a/src/tests/eio/eio_model_test_monitor_add.c b/src/tests/eio/eio_model_test_monitor_add.c index b718edd137..0cf0c9f4ee 100644 --- a/src/tests/eio/eio_model_test_monitor_add.c +++ b/src/tests/eio/eio_model_test_monitor_add.c @@ -125,7 +125,7 @@ START_TEST(eio_model_test_test_monitor_add) tmpdir = eina_environment_tmp_get(); - filemodel = eo_add(EIO_MODEL_CLASS, NULL, eio_model_path_set(eoid, tmpdir)); + eo_add(&filemodel, EIO_MODEL_CLASS, NULL, eio_model_path_set(filemodel, tmpdir)); fail_if(!filemodel, "ERROR: Cannot init model!\n"); eo_event_callback_add(filemodel, EFL_MODEL_BASE_EVENT_CHILD_ADDED, _children_added_cb, NULL); diff --git a/src/tests/eldbus/eldbus_test_eldbus_model.c b/src/tests/eldbus/eldbus_test_eldbus_model.c index 5439217e46..d1dcbfc869 100644 --- a/src/tests/eldbus/eldbus_test_eldbus_model.c +++ b/src/tests/eldbus/eldbus_test_eldbus_model.c @@ -123,7 +123,8 @@ check_property(Eo *object, const char *property_name, const char *expected_value Eo * create_connection(void) { - Eo *connection = eo_add_ref(ELDBUS_MODEL_CONNECTION_CLASS, NULL, eldbus_model_connection_constructor(eoid, ELDBUS_CONNECTION_TYPE_SESSION, NULL, EINA_FALSE)); + Eo *connection = NULL; + eo_add_ref(&connection, ELDBUS_MODEL_CONNECTION_CLASS, NULL, eldbus_model_connection_constructor(connection, ELDBUS_CONNECTION_TYPE_SESSION, NULL, EINA_FALSE)); ck_assert_ptr_ne(NULL, connection); return connection; } @@ -139,7 +140,8 @@ create_and_load_connection(void) Eo * create_object(void) { - Eo *object = eo_add_ref(ELDBUS_MODEL_OBJECT_CLASS, NULL, eldbus_model_object_constructor(eoid, ELDBUS_CONNECTION_TYPE_SESSION, NULL, EINA_FALSE, ELDBUS_FDO_BUS, ELDBUS_FDO_PATH)); + Eo *object = NULL; + eo_add_ref(&object, ELDBUS_MODEL_OBJECT_CLASS, NULL, eldbus_model_object_constructor(object, ELDBUS_CONNECTION_TYPE_SESSION, NULL, EINA_FALSE, ELDBUS_FDO_BUS, ELDBUS_FDO_PATH)); ck_assert_ptr_ne(NULL, object); return object; } diff --git a/src/tests/eldbus/eldbus_test_eldbus_model_method.c b/src/tests/eldbus/eldbus_test_eldbus_model_method.c index 51ed4afc34..06e5bf7aa7 100644 --- a/src/tests/eldbus/eldbus_test_eldbus_model_method.c +++ b/src/tests/eldbus/eldbus_test_eldbus_model_method.c @@ -29,7 +29,7 @@ _setup(void) fake_server = fake_server_start(&fake_server_data); - fake_server_object = eo_add(ELDBUS_MODEL_OBJECT_CLASS, NULL, eldbus_model_object_constructor(eoid, ELDBUS_CONNECTION_TYPE_SESSION, NULL, EINA_FALSE, FAKE_SERVER_BUS, FAKE_SERVER_PATH)); + eo_add(&fake_server_object, ELDBUS_MODEL_OBJECT_CLASS, NULL, eldbus_model_object_constructor(fake_server_object, ELDBUS_CONNECTION_TYPE_SESSION, NULL, EINA_FALSE, FAKE_SERVER_BUS, FAKE_SERVER_PATH)); ck_assert_ptr_ne(NULL, fake_server_object); efl_model_load_and_wait_for_load_status(fake_server_object, EFL_MODEL_LOAD_STATUS_LOADED); diff --git a/src/tests/eldbus/eldbus_test_eldbus_model_signal.c b/src/tests/eldbus/eldbus_test_eldbus_model_signal.c index 7c3187430e..3f51d07c53 100644 --- a/src/tests/eldbus/eldbus_test_eldbus_model_signal.c +++ b/src/tests/eldbus/eldbus_test_eldbus_model_signal.c @@ -27,7 +27,7 @@ _setup(void) fake_server = fake_server_start(&fake_server_data); - fake_server_object = eo_add(ELDBUS_MODEL_OBJECT_CLASS, NULL, eldbus_model_object_constructor(eoid, ELDBUS_CONNECTION_TYPE_SESSION, NULL, EINA_FALSE, FAKE_SERVER_BUS, FAKE_SERVER_PATH)); + eo_add(&fake_server_object, ELDBUS_MODEL_OBJECT_CLASS, NULL, eldbus_model_object_constructor(fake_server_object, ELDBUS_CONNECTION_TYPE_SESSION, NULL, EINA_FALSE, FAKE_SERVER_BUS, FAKE_SERVER_PATH)); ck_assert_ptr_ne(NULL, fake_server_object); efl_model_load_and_wait_for_load_status(fake_server_object, EFL_MODEL_LOAD_STATUS_LOADED); diff --git a/src/tests/eldbus/eldbus_test_fake_server_eldbus_model_proxy.c b/src/tests/eldbus/eldbus_test_fake_server_eldbus_model_proxy.c index 09ef4cc9ca..0195aff349 100644 --- a/src/tests/eldbus/eldbus_test_fake_server_eldbus_model_proxy.c +++ b/src/tests/eldbus/eldbus_test_fake_server_eldbus_model_proxy.c @@ -33,7 +33,7 @@ _setup(void) }; fake_server = fake_server_start(&fake_server_data); - fake_server_object = eo_add(ELDBUS_MODEL_OBJECT_CLASS, NULL, eldbus_model_object_constructor(eoid, ELDBUS_CONNECTION_TYPE_SESSION, NULL, EINA_FALSE, FAKE_SERVER_BUS, FAKE_SERVER_PATH)); + eo_add(&fake_server_object, ELDBUS_MODEL_OBJECT_CLASS, NULL, eldbus_model_object_constructor(fake_server_object, ELDBUS_CONNECTION_TYPE_SESSION, NULL, EINA_FALSE, FAKE_SERVER_BUS, FAKE_SERVER_PATH)); ck_assert_ptr_ne(NULL, fake_server_object); efl_model_load_and_wait_for_load_status(fake_server_object, EFL_MODEL_LOAD_STATUS_LOADED); diff --git a/src/tests/emotion/emotion_test_main-eo.c b/src/tests/emotion/emotion_test_main-eo.c index f88e045836..0f9ea6493e 100644 --- a/src/tests/emotion/emotion_test_main-eo.c +++ b/src/tests/emotion/emotion_test_main-eo.c @@ -111,7 +111,7 @@ main_delete_request(Ecore_Evas *ee EINA_UNUSED) static void bg_setup(void) { - o_bg = eo_add(EDJE_OBJECT_CLASS, evas); + eo_add(&o_bg, EDJE_OBJECT_CLASS, evas); efl_file_set(o_bg, theme_file, "background"); efl_gfx_position_set(o_bg, 0, 0); efl_gfx_size_set(o_bg, startw, starth); @@ -639,7 +639,7 @@ init_video_object(const char *module_filename, const char *filename) fd = calloc(1, sizeof(Frame_Data)); if (!fd) exit(1); - oe = eo_add(EDJE_OBJECT_CLASS, evas); + eo_add(&oe, EDJE_OBJECT_CLASS, evas); eo_event_callback_add(oe, EVAS_OBJECT_EVENT_FREE, _oe_free_cb, fd); eo_key_data_set(oe, "frame_data", fd); efl_file_set(oe, theme_file, reflex ? "video_controller/reflex" : "video_controller"); diff --git a/src/tests/eo/access/access_main.c b/src/tests/eo/access/access_main.c index d8d825bda2..348422fe2a 100644 --- a/src/tests/eo/access/access_main.c +++ b/src/tests/eo/access/access_main.c @@ -13,7 +13,8 @@ main(int argc, char *argv[]) (void) argv; eo_init(); - Eo *obj = eo_add(INHERIT_CLASS, NULL); + Eo *obj = NULL; + eo_add(&obj, INHERIT_CLASS, NULL); simple_a_set(obj, 1); inherit_prot_print(obj); diff --git a/src/tests/eo/children/children_main.c b/src/tests/eo/children/children_main.c index 9d30277333..25e9f9fcd4 100644 --- a/src/tests/eo/children/children_main.c +++ b/src/tests/eo/children/children_main.c @@ -22,11 +22,15 @@ main(int argc, char *argv[]) eo_init(); - Eo *parent = eo_add(SIMPLE_CLASS, NULL); - - Eo *child1 = eo_add(SIMPLE_CLASS, parent); - Eo *child2 = eo_add(SIMPLE_CLASS, parent); - Eo *child3 = eo_add(SIMPLE_CLASS, parent); + Eo *parent = NULL; + eo_add(&parent, SIMPLE_CLASS, NULL); + + Eo *child1 = NULL; + eo_add(&child1, SIMPLE_CLASS, parent); + Eo *child2 = NULL; + eo_add(&child2, SIMPLE_CLASS, parent); + Eo *child3 = NULL; + eo_add(&child3, SIMPLE_CLASS, parent); iter = eo_children_iterator_new(parent); fail_if(!iter); diff --git a/src/tests/eo/composite_objects/composite_objects_comp.c b/src/tests/eo/composite_objects/composite_objects_comp.c index 51824a9a98..349bf8ffff 100644 --- a/src/tests/eo/composite_objects/composite_objects_comp.c +++ b/src/tests/eo/composite_objects/composite_objects_comp.c @@ -26,7 +26,8 @@ _constructor(Eo *obj, void *class_data EINA_UNUSED) { obj = eo_constructor(eo_super(obj, MY_CLASS)); - Eo *simple = eo_add(SIMPLE_CLASS, obj); + Eo *simple = NULL; + eo_add(&simple, SIMPLE_CLASS, obj); eo_composite_attach(obj, simple); eo_event_callback_forwarder_add(simple, EV_A_CHANGED, obj); diff --git a/src/tests/eo/composite_objects/composite_objects_main.c b/src/tests/eo/composite_objects/composite_objects_main.c index 6f9e914415..47902a4424 100644 --- a/src/tests/eo/composite_objects/composite_objects_main.c +++ b/src/tests/eo/composite_objects/composite_objects_main.c @@ -30,7 +30,8 @@ main(int argc, char *argv[]) (void) argv; eo_init(); - Eo *obj = eo_add(COMP_CLASS, NULL); + Eo *obj = NULL; + eo_add(&obj, COMP_CLASS, NULL); eo_event_callback_add(obj, EV_A_CHANGED, _a_changed_cb, NULL); fail_if(!eo_isa(obj, COMP_CLASS)); diff --git a/src/tests/eo/constructors/constructors_main.c b/src/tests/eo/constructors/constructors_main.c index 5844e46624..bb2baa1d6c 100644 --- a/src/tests/eo/constructors/constructors_main.c +++ b/src/tests/eo/constructors/constructors_main.c @@ -24,7 +24,8 @@ main(int argc, char *argv[]) (void) argv; eo_init(); - Eo *obj = eo_add(SIMPLE_CLASS, NULL); + Eo *obj = NULL; + eo_add(&obj, SIMPLE_CLASS, NULL); fail_if(my_init_count != 2); @@ -42,14 +43,14 @@ main(int argc, char *argv[]) fail_if(my_init_count != 0); - obj = eo_add(SIMPLE2_CLASS, NULL); + eo_add(&obj, SIMPLE2_CLASS, NULL); fail_if(obj); - obj = eo_add(SIMPLE3_CLASS, NULL); + eo_add(&obj, SIMPLE3_CLASS, NULL); fail_if(obj); my_init_count = 0; - obj = eo_add(SIMPLE4_CLASS, NULL); + eo_add(&obj, SIMPLE4_CLASS, NULL); fail_if(my_init_count != 2); @@ -57,33 +58,33 @@ main(int argc, char *argv[]) fail_if(my_init_count != 0); - obj = eo_add(SIMPLE5_CLASS, NULL); + eo_add(&obj, SIMPLE5_CLASS, NULL); fail_if(!obj); eo_unref(obj); - obj = eo_add(SIMPLE6_CLASS, NULL); + eo_add(&obj, SIMPLE6_CLASS, NULL); fail_if(!obj); eo_unref(obj); - obj = eo_add(SIMPLE7_CLASS, NULL); + eo_add(&obj, SIMPLE7_CLASS, NULL); fail_if(obj); my_init_count = 0; - obj = eo_add(SIMPLE_CLASS, NULL); + eo_add(&obj, SIMPLE_CLASS, NULL); fail_if(!obj); fail_if(my_init_count != 2); a = simple_a_get(obj); fail_if(a != 0); my_init_count = 0; - obj = eo_add(SIMPLE_CLASS, NULL, simple_a_set(eoid, 7)); + eo_add(&obj, SIMPLE_CLASS, NULL, simple_a_set(obj, 7)); fail_if(!obj); fail_if(my_init_count != 2); a = simple_a_get(obj); fail_if(a != 7); my_init_count = 0; - obj = eo_add(SIMPLE_CLASS, NULL, simple_b_set(eoid, 6), simple_a_set(eoid, -1), b = simple_b_get(eoid)); + eo_add(&obj, SIMPLE_CLASS, NULL, simple_b_set(obj, 6), simple_a_set(obj, -1), b = simple_b_get(obj)); fail_if(obj); fail_if(b != 6); fail_if(my_init_count != 0); diff --git a/src/tests/eo/function_overrides/function_overrides_main.c b/src/tests/eo/function_overrides/function_overrides_main.c index b2aa840897..a9148ed4ef 100644 --- a/src/tests/eo/function_overrides/function_overrides_main.c +++ b/src/tests/eo/function_overrides/function_overrides_main.c @@ -18,7 +18,8 @@ main(int argc, char *argv[]) eo_init(); Eina_Bool called = EINA_FALSE; - Eo *obj = eo_add(INHERIT2_CLASS, NULL); + Eo *obj = NULL; + eo_add(&obj, INHERIT2_CLASS, NULL); simple_a_set(obj, 1); Simple_Public_Data *pd = eo_data_scope_get(obj, SIMPLE_CLASS); @@ -26,7 +27,7 @@ main(int argc, char *argv[]) eo_unref(obj); - obj = eo_add(INHERIT3_CLASS, NULL); + eo_add(&obj, INHERIT3_CLASS, NULL); simple_a_set(obj, 1); pd = eo_data_scope_get(obj, SIMPLE_CLASS); @@ -34,7 +35,7 @@ main(int argc, char *argv[]) eo_unref(obj); - obj = eo_add(INHERIT2_CLASS, NULL); + eo_add(&obj, INHERIT2_CLASS, NULL); called = inherit2_print(obj); fail_if(!called); called = inherit2_print(obj); @@ -42,7 +43,7 @@ main(int argc, char *argv[]) fail_if(!called); eo_unref(obj); - obj = eo_add(SIMPLE_CLASS, NULL); + eo_add(&obj, SIMPLE_CLASS, NULL); called = inherit2_print(obj); fail_if(called); diff --git a/src/tests/eo/interface/interface_main.c b/src/tests/eo/interface/interface_main.c index a85f030963..489a4e86c3 100644 --- a/src/tests/eo/interface/interface_main.c +++ b/src/tests/eo/interface/interface_main.c @@ -16,7 +16,8 @@ main(int argc, char *argv[]) (void) argv; eo_init(); - Eo *obj = eo_add(SIMPLE_CLASS, NULL); + Eo *obj = NULL; + eo_add(&obj, SIMPLE_CLASS, NULL); simple_a_set(obj, 1); simple_b_set(obj, 2); diff --git a/src/tests/eo/mixin/mixin_main.c b/src/tests/eo/mixin/mixin_main.c index d3c1dbf2ac..1c5cebd609 100644 --- a/src/tests/eo/mixin/mixin_main.c +++ b/src/tests/eo/mixin/mixin_main.c @@ -18,7 +18,8 @@ main(int argc, char *argv[]) (void) argv; eo_init(); - Eo *obj = eo_add(SIMPLE_CLASS, NULL); + Eo *obj = NULL; + eo_add(&obj, SIMPLE_CLASS, NULL); simple_a_set(obj, 1); simple_b_set(obj, 2); @@ -40,7 +41,7 @@ main(int argc, char *argv[]) eo_unref(obj); - obj = eo_add(INHERIT_CLASS, NULL); + eo_add(&obj, INHERIT_CLASS, NULL); simple_a_set(obj, 5); a = simple_a_get(obj); printf("%d\n", a); diff --git a/src/tests/eo/signals/signals_main.c b/src/tests/eo/signals/signals_main.c index 5d40331b03..f69faf5030 100644 --- a/src/tests/eo/signals/signals_main.c +++ b/src/tests/eo/signals/signals_main.c @@ -37,7 +37,8 @@ main(int argc, char *argv[]) (void) argv; eo_init(); - Eo *obj = eo_add(SIMPLE_CLASS, NULL); + Eo *obj = NULL; + eo_add(&obj, SIMPLE_CLASS, NULL); Simple_Public_Data *pd = eo_data_scope_get(obj, SIMPLE_CLASS); /* The order of these two is undetermined. */ diff --git a/src/tests/eo/suite/eo_test_call_errors.c b/src/tests/eo/suite/eo_test_call_errors.c index 551c58deae..f4c2d42cc6 100644 --- a/src/tests/eo/suite/eo_test_call_errors.c +++ b/src/tests/eo/suite/eo_test_call_errors.c @@ -17,7 +17,8 @@ START_TEST(eo_pure_virtual_fct_call) eo_init(); eina_log_print_cb_set(eo_test_print_cb, &ctx); - Eo *obj = eo_add(SIMPLE_CLASS, NULL); + Eo *obj = NULL; + eo_add(&obj, SIMPLE_CLASS, NULL); fail_if(!obj); TEST_EO_ERROR("_eo_call_resolve", "in %s:%d: you called a pure virtual func '%s' (%d) of class '%s'."); @@ -35,7 +36,8 @@ START_TEST(eo_api_not_implemented_call) eo_init(); eina_log_print_cb_set(eo_test_print_cb, &ctx); - Eo *obj = eo_add(SIMPLE_CLASS, NULL); + Eo *obj = NULL; + eo_add(&obj, SIMPLE_CLASS, NULL); fail_if(!obj); TEST_EO_ERROR("_eo_api_op_id_get", "Unable to resolve op for api func %p"); @@ -53,7 +55,8 @@ START_TEST(eo_op_not_found_in_super) eo_init(); eina_log_print_cb_set(eo_test_print_cb, &ctx); - Eo *obj = eo_add(SIMPLE_CLASS, NULL); + Eo *obj = NULL; + eo_add(&obj, SIMPLE_CLASS, NULL); fail_if(!obj); TEST_EO_ERROR("_eo_call_resolve", "in %s:%d: func '%s' (%d) could not be resolved for class '%s' for super of '%s'."); diff --git a/src/tests/eo/suite/eo_test_class_behaviour_errors.c b/src/tests/eo/suite/eo_test_class_behaviour_errors.c index 12c478f454..5288f066ca 100644 --- a/src/tests/eo/suite/eo_test_class_behaviour_errors.c +++ b/src/tests/eo/suite/eo_test_class_behaviour_errors.c @@ -45,7 +45,8 @@ START_TEST(eo_destructor_unref) klass = eo_class_new(&class_desc, SIMPLE_CLASS, NULL); fail_if(!klass); - Eo *obj = eo_add(klass, NULL); + Eo *obj = NULL; + eo_add(&obj, klass, NULL); fail_if(!obj); TEST_EO_ERROR("_eo_unref", "Object %p deletion already triggered. You wrongly call eo_unref() within a destructor."); @@ -76,7 +77,8 @@ START_TEST(eo_destructor_double_del) klass = eo_class_new(&class_desc, SIMPLE_CLASS, NULL); fail_if(!klass); - Eo *obj = eo_add(klass, NULL); + Eo *obj = NULL; + eo_add(&obj, klass, NULL); eo_manual_free_set(obj, EINA_TRUE); fail_if(!obj); diff --git a/src/tests/eo/suite/eo_test_class_simple.c b/src/tests/eo/suite/eo_test_class_simple.c index 224e80a290..ef5d8e9e0c 100644 --- a/src/tests/eo/suite/eo_test_class_simple.c +++ b/src/tests/eo/suite/eo_test_class_simple.c @@ -54,7 +54,8 @@ static Eo * _part_get(Eo *obj, void *class_data EINA_UNUSED, const char *name EINA_UNUSED) { /* A normal part get will do something saner, we just create objects. */ - return eo_add(SIMPLE_CLASS, obj); + Eo *ret = NULL; + return eo_add(&ret, SIMPLE_CLASS, obj); } EO_VOID_FUNC_BODYV(simple_recursive, EO_FUNC_CALL(n), int n); diff --git a/src/tests/eo/suite/eo_test_threaded_calls.c b/src/tests/eo/suite/eo_test_threaded_calls.c index b25b00b672..76a9ca9684 100644 --- a/src/tests/eo/suite/eo_test_threaded_calls.c +++ b/src/tests/eo/suite/eo_test_threaded_calls.c @@ -94,7 +94,7 @@ _thread_job(void *data, Eina_Thread t EINA_UNUSED) fail_if(EINA_LOCK_SUCCEED != eina_spinlock_take(&locks[0])); } - obj = eo_add(THREAD_TEST_CLASS, NULL, thread_test_constructor(eoid, v)); + eo_add(&obj, THREAD_TEST_CLASS, NULL, thread_test_constructor(obj, v)); thread_test_try_swap_stack(obj); v = thread_test_v_get(obj); diff --git a/src/tests/eo/suite/eo_test_value.c b/src/tests/eo/suite/eo_test_value.c index 6162389e16..b9fac0db36 100644 --- a/src/tests/eo/suite/eo_test_value.c +++ b/src/tests/eo/suite/eo_test_value.c @@ -17,7 +17,8 @@ START_TEST(eo_value) Eina_Value val2, eo_val; void *tmpp = NULL; Eo_Dbg_Info *eo_dbg_info; - Eo *obj = eo_add(SIMPLE_CLASS, NULL); + Eo *obj = NULL; + eo_add(&obj, SIMPLE_CLASS, NULL); eo_dbg_info = EO_DBG_INFO_LIST_APPEND(NULL, "Root"); eo_dbg_info_get(obj, eo_dbg_info); diff --git a/src/tests/eolian_js/eolian_js_test_constructor_method_impl.c b/src/tests/eolian_js/eolian_js_test_constructor_method_impl.c index 1740e61466..adff8f5614 100644 --- a/src/tests/eolian_js/eolian_js_test_constructor_method_impl.c +++ b/src/tests/eolian_js/eolian_js_test_constructor_method_impl.c @@ -132,7 +132,8 @@ _constructor_method_class_classoutmethod1(Eo* obj EINA_UNUSED, Constructor_Metho { fprintf(stderr, "classoutmethod1\n"); fflush(stderr); - return eo_add(MY_CLASS, NULL, constructor_method_class_constructor1(eoid, one), constructor_method_class_constructor2(eoid, two)); + Eo *ret = NULL; + return eo_add(&ret, MY_CLASS, NULL, constructor_method_class_constructor1(ret, one), constructor_method_class_constructor2(ret, two)); } EOLIAN static void @@ -140,7 +141,8 @@ _constructor_method_class_classoutmethod2(Eo* obj EINA_UNUSED, Constructor_Metho { fprintf(stderr, "classoutmethod2\n"); fflush(stderr); - *out_class = eo_add(MY_CLASS, NULL, constructor_method_class_constructor1(eoid, one), constructor_method_class_constructor2(eoid, two)); + *out_class = NULL; + eo_add(&out_class, MY_CLASS, NULL, constructor_method_class_constructor1(out_class, one), constructor_method_class_constructor2(out_class, two)); } diff --git a/src/tests/evas/evas_test_mesh.c b/src/tests/evas/evas_test_mesh.c index 40a2239000..a339584f5d 100644 --- a/src/tests/evas/evas_test_mesh.c +++ b/src/tests/evas/evas_test_mesh.c @@ -44,8 +44,8 @@ EINA_ITERATOR_FOREACH(it, file) \ { \ int set_ok, save_ok; \ - mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, e); \ - mesh2 = eo_add(EVAS_CANVAS3D_MESH_CLASS, e); \ + eo_add(&mesh, EVAS_CANVAS3D_MESH_CLASS, e); \ + eo_add(&mesh2, EVAS_CANVAS3D_MESH_CLASS, e); \ fail_if(mesh == NULL); \ fail_if(mesh2 == NULL); \ snprintf(buffer, PATH_MAX, "%s%s", tmp, ext); \ |