aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2016-03-11 12:24:06 +0000
committerTom Hacohen <tom@stosb.com>2016-03-11 12:29:03 +0000
commit9fdac37187e35f45570c3808011d0283c658652d (patch)
tree632258982611b30be2f540731239fda57e338dab
parentRevert "Fix examples according to the recent eo event changes." (diff)
downloadefl-9fdac37187e35f45570c3808011d0283c658652d.tar.gz
Revert "Examples: Update according to recent eo_add changes."
-rw-r--r--src/examples/evas/evas-3d-colorpick.c14
-rw-r--r--src/examples/evas/evas-3d-hull.c4
-rw-r--r--src/examples/evas/evas-3d-mmap-set.c4
-rw-r--r--src/examples/evas/evas-3d-obj.c4
-rw-r--r--src/examples/evas/evas-3d-ply.c4
-rw-r--r--src/examples/evas/evas-3d-shadows.c8
-rw-r--r--src/examples/evas/evas-object-manipulation-eo.c8
-rw-r--r--src/examples/evas/shooter/evas-3d-shooter-macros.h12
-rw-r--r--src/examples/evas/shooter/evas-3d-shooter.c2
9 files changed, 31 insertions, 29 deletions
diff --git a/src/examples/evas/evas-3d-colorpick.c b/src/examples/evas/evas-3d-colorpick.c
index ceda8bc012..4a7594bd6d 100644
--- a/src/examples/evas/evas-3d-colorpick.c
+++ b/src/examples/evas/evas-3d-colorpick.c
@@ -272,25 +272,27 @@ _init_scene(const char *texture)
Evas_Real tmp;
Test_object *m;
- eo_add(&globalscene.scene, EVAS_CANVAS3D_SCENE_CLASS, evas);
+ globalscene.scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas);
- eo_add(&globalscene.root_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(globalscene.root_node, EVAS_CANVAS3D_NODE_TYPE_NODE));
+ globalscene.root_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_NODE));
- eo_add(&globalscene.camera, EVAS_CANVAS3D_CAMERA_CLASS, evas);
+ globalscene.camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas);
evas_canvas3d_camera_projection_perspective_set(globalscene.camera, 30.0, 1.0, 1.0, 1000.0);
- eo_add(&globalscene.camera_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(globalscene.camera_node, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
+ globalscene.camera_node =
+ eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
evas_canvas3d_node_camera_set(globalscene.camera_node, globalscene.camera);
evas_canvas3d_node_member_add(globalscene.root_node, globalscene.camera_node);
evas_canvas3d_node_position_set(globalscene.camera_node, 0.0, 30.0, 800.0);
evas_canvas3d_node_look_at_set(globalscene.camera_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, -1000.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
- eo_add(&globalscene.light, EVAS_CANVAS3D_LIGHT_CLASS, evas);
+ globalscene.light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas);
evas_canvas3d_light_ambient_set(globalscene.light, 1.0, 1.0, 1.0, 1.0);
evas_canvas3d_light_diffuse_set(globalscene.light, 1.0, 1.0, 1.0, 1.0);
evas_canvas3d_light_specular_set(globalscene.light, 1.0, 1.0, 1.0, 1.0);
evas_canvas3d_light_directional_set(globalscene.light, EINA_TRUE);
- eo_add(&globalscene.light_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(globalscene.light_node, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
+ globalscene.light_node =
+ eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
evas_canvas3d_node_light_set(globalscene.light_node, globalscene.light);
evas_canvas3d_node_position_set(globalscene.light_node, 100.0, 50.0, 300.0);
evas_canvas3d_node_look_at_set(globalscene.light_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 1.0, 1.0, 1.0);
diff --git a/src/examples/evas/evas-3d-hull.c b/src/examples/evas/evas-3d-hull.c
index 32c1d01b65..130ad3742e 100644
--- a/src/examples/evas/evas-3d-hull.c
+++ b/src/examples/evas/evas-3d-hull.c
@@ -84,7 +84,7 @@ typedef struct _Scene_Data
int rr;
#define MODEL_MESH_INIT(name, model, shade) \
- eo_add(&data->mesh_##name, EVAS_CANVAS3D_MESH_CLASS, evas); \
+ data->mesh_##name = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); \
efl_file_set(data->mesh_##name, model, NULL); \
evas_canvas3d_mesh_vertex_assembly_set(data->mesh_##name, EVAS_CANVAS3D_VERTEX_ASSEMBLY_TRIANGLES); \
evas_canvas3d_mesh_shade_mode_set(data->mesh_##name, EVAS_CANVAS3D_SHADE_MODE_##shade); \
@@ -96,7 +96,7 @@ int rr;
evas_canvas3d_mesh_convex_hull_data_get(data->mesh_##name, 0, vert, ind); \
vertex = (float*) vert->members;\
index = ind->members;\
- eo_add(&data->mesh_##name##_ch, EVAS_CANVAS3D_MESH_CLASS, evas); \
+ data->mesh_##name##_ch = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); \
evas_canvas3d_mesh_vertex_count_set(data->mesh_##name##_ch, (vert->len / 10)); \
evas_canvas3d_mesh_frame_add(data->mesh_##name##_ch, 0); \
evas_canvas3d_mesh_frame_vertex_data_copy_set(data->mesh_##name##_ch, 0, EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION, \
diff --git a/src/examples/evas/evas-3d-mmap-set.c b/src/examples/evas/evas-3d-mmap-set.c
index 389be0ce34..2432a4b6a3 100644
--- a/src/examples/evas/evas-3d-mmap-set.c
+++ b/src/examples/evas/evas-3d-mmap-set.c
@@ -32,11 +32,11 @@
#define LOAD_AND_ADD_MESH(extention, number) \
snprintf(buffer, PATH_MAX, "%s%s", template_path, #extention); \
extention##_file = eina_file_open(buffer , 0); \
- eo_add(&mesh_##extention, EVAS_CANVAS3D_MESH_CLASS, evas); \
+ mesh_##extention = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); \
efl_file_mmap_set(mesh_##extention, extention##_file, NULL); \
evas_canvas3d_mesh_frame_material_set(mesh_##extention, 0, material); \
evas_canvas3d_mesh_shade_mode_set(mesh_##extention, EVAS_CANVAS3D_SHADE_MODE_PHONG); \
- eo_add(&node_##extention, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(node_##extention, EVAS_CANVAS3D_NODE_TYPE_MESH)); \
+ node_##extention = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH)); \
evas_canvas3d_node_member_add(root_node, node_##extention); \
evas_canvas3d_node_mesh_add(node_##extention, mesh_##extention); \
evas_canvas3d_node_position_set(node_##extention, initial_node_data[number * 10], \
diff --git a/src/examples/evas/evas-3d-obj.c b/src/examples/evas/evas-3d-obj.c
index db7b5ff978..f2623f4779 100644
--- a/src/examples/evas/evas-3d-obj.c
+++ b/src/examples/evas/evas-3d-obj.c
@@ -44,12 +44,12 @@
#define NUMBER_OF_MESHES 8
#define ADD_OBJ_MESH(path, Y, Z, num, shade_mode, name_of_material) \
- eo_add(&mesh[num], EVAS_CANVAS3D_MESH_CLASS, evas); \
+ mesh[num] = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); \
snprintf(full_file_path, PATH_MAX, "%s%s", path, ".obj"); \
efl_file_set(mesh[num], full_file_path, NULL); \
evas_canvas3d_mesh_frame_material_set(mesh[num], 0, name_of_material); \
evas_canvas3d_mesh_shade_mode_set(mesh[num], shade_mode); \
- eo_add(&mesh_node[num], EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(mesh_node[num], EVAS_CANVAS3D_NODE_TYPE_MESH)); \
+ mesh_node[num] = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH)); \
evas_canvas3d_node_member_add(root_node, mesh_node[num]); \
evas_canvas3d_node_mesh_add(mesh_node[num], mesh[num]); \
evas_canvas3d_node_position_set(mesh_node[num], 0, Y, Z); \
diff --git a/src/examples/evas/evas-3d-ply.c b/src/examples/evas/evas-3d-ply.c
index 80a73b85a4..65f4fe5de3 100644
--- a/src/examples/evas/evas-3d-ply.c
+++ b/src/examples/evas/evas-3d-ply.c
@@ -179,7 +179,7 @@ main(void)
/* Add the meshes. */
for (i = 0; i < NUMBER_OF_MESHES; i++)
{
- eo_add(&mesh[i], EVAS_CANVAS3D_MESH_CLASS, evas);
+ mesh[i] = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas);
snprintf(buffer, PATH_MAX, "%s%s", input_template, file_name[i % 8]);
efl_file_set(mesh[i], buffer, NULL);
@@ -196,7 +196,7 @@ main(void)
evas_canvas3d_mesh_shade_mode_set(mesh[i], draw_mode[(i % 8)]);
}
- eo_add(&mesh_node[i], EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(mesh_node[i], EVAS_CANVAS3D_NODE_TYPE_MESH));
+ mesh_node[i] = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH));
evas_canvas3d_node_member_add(root_node, mesh_node[i]);
evas_canvas3d_node_mesh_add(mesh_node[i], mesh[i]);
evas_canvas3d_node_position_set(mesh_node[i], 0, ((i % 4) * 4) + ((i / 16) * 1) - 6.5, (((i % 16) / 4) * 4) - 6);
diff --git a/src/examples/evas/evas-3d-shadows.c b/src/examples/evas/evas-3d-shadows.c
index ce1ab7344a..90a714655f 100644
--- a/src/examples/evas/evas-3d-shadows.c
+++ b/src/examples/evas/evas-3d-shadows.c
@@ -355,15 +355,15 @@ _model_setup(Body_3D *model)
static void
_billboard_setup(Scene_Data *data)
{
- eo_add(&data->billboard.texture, EVAS_CANVAS3D_TEXTURE_CLASS, evas);
+ data->billboard.texture = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas);
evas_canvas3d_texture_file_set(data->billboard.texture, b_image_path, NULL);
evas_canvas3d_texture_filter_set(data->billboard.texture, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST);
evas_canvas3d_texture_wrap_set(data->billboard.texture, EVAS_CANVAS3D_WRAP_MODE_REPEAT, EVAS_CANVAS3D_WRAP_MODE_REPEAT);
- eo_add(&data->billboard.primitive, EVAS_CANVAS3D_PRIMITIVE_CLASS, evas);
+ data->billboard.primitive = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas);
evas_canvas3d_primitive_form_set(data->billboard.primitive, EVAS_CANVAS3D_MESH_PRIMITIVE_SQUARE);
- eo_add(&data->billboard.mesh, EVAS_CANVAS3D_MESH_CLASS, evas);
+ data->billboard.mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas);
evas_canvas3d_mesh_from_primitive_set(data->billboard.mesh, 0, data->billboard.primitive);
_body_material_set(&(data->billboard), 1.0, 1.0, 1.0);
@@ -377,7 +377,7 @@ _billboard_setup(Scene_Data *data)
evas_canvas3d_mesh_blending_enable_set(data->billboard.mesh, EINA_TRUE);
evas_canvas3d_mesh_blending_func_set(data->billboard.mesh, EVAS_CANVAS3D_BLEND_FUNC_SRC_ALPHA, EVAS_CANVAS3D_BLEND_FUNC_ONE_MINUS_SRC_ALPHA);
- eo_add(&data->billboard.node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->billboard.node, EVAS_CANVAS3D_NODE_TYPE_MESH));
+ data->billboard.node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH));
evas_canvas3d_node_mesh_add(data->billboard.node, data->billboard.mesh);
evas_canvas3d_node_position_set(data->billboard.node, 0.0, 2.0, 0.0);
evas_canvas3d_node_scale_set(data->billboard.node, 2.2, 4.6, 4.0);
diff --git a/src/examples/evas/evas-object-manipulation-eo.c b/src/examples/evas/evas-object-manipulation-eo.c
index c95618c845..bcd825cb97 100644
--- a/src/examples/evas/evas-object-manipulation-eo.c
+++ b/src/examples/evas/evas-object-manipulation-eo.c
@@ -174,7 +174,7 @@ main(void)
/* Creating object with Eo.
* Object must be deleted explixitly at the end of program.*/
- eo_add(&d.bg, EVAS_RECTANGLE_CLASS, d.canvas);
+ d.bg = eo_add(EVAS_RECTANGLE_CLASS, d.canvas);
/* Eo-styled way to perform actions on an object*/
evas_obj_name_set(d.bg, "background rectangle");
@@ -190,7 +190,7 @@ main(void)
evas_object_event_callback_add(
d.bg, EVAS_CALLBACK_KEY_DOWN, _on_keydown, NULL);
- eo_add(&d.img, EVAS_IMAGE_CLASS, d.canvas);
+ d.img = eo_add(EVAS_IMAGE_CLASS, d.canvas);
/* As soon as 'canvas' object is a parent for 'image' object,
* 'canvas' keeps reference to 'image'.
@@ -217,7 +217,7 @@ main(void)
}
/* border on the image's clipper, here just to emphasize its position */
- eo_add(&d.clipper_border, EVAS_IMAGE_CLASS, d.canvas);
+ d.clipper_border = eo_add(EVAS_IMAGE_CLASS, d.canvas);
evas_obj_image_filled_set(d.clipper_border, EINA_TRUE);
efl_file_set(d.clipper_border, border_img_path, NULL);
err = evas_obj_image_load_error_get(d.clipper_border);
@@ -237,7 +237,7 @@ main(void)
/* solid white clipper (note that it's the default color for a
* rectangle) - it won't change clippees' colors, then (multiplying
* by 255) */
- eo_add(&d.clipper, EVAS_RECTANGLE_CLASS, d.canvas);
+ d.clipper = eo_add(EVAS_RECTANGLE_CLASS, d.canvas);
efl_gfx_position_set(d.clipper, WIDTH / 4, HEIGHT / 4);
efl_gfx_size_set(d.clipper, WIDTH / 2, HEIGHT / 2);
diff --git a/src/examples/evas/shooter/evas-3d-shooter-macros.h b/src/examples/evas/shooter/evas-3d-shooter-macros.h
index 1e6e9e2475..cae6417ea2 100644
--- a/src/examples/evas/shooter/evas-3d-shooter-macros.h
+++ b/src/examples/evas/shooter/evas-3d-shooter-macros.h
@@ -127,7 +127,7 @@ typedef struct _vec2
#define ADD_MESH(Object, Name, a, d, s) \
- eo_add(&data->material_##Object, EVAS_CANVAS3D_MATERIAL_CLASS, evas); \
+ data->material_##Object = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); \
\
evas_canvas3d_material_enable_set(data->material_##Object, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE); \
evas_canvas3d_material_enable_set(data->material_##Object, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE); \
@@ -138,7 +138,7 @@ typedef struct _vec2
evas_canvas3d_material_color_set(data->material_##Object, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, s, s, s, 1.0); \
evas_canvas3d_material_shininess_set(data->material_##Object, 50.0); \
\
- eo_add(&data->mesh_##Name, EVAS_CANVAS3D_MESH_CLASS, evas);
+ data->mesh_##Name = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas);
#define SETUP_DEFAULT_MESH(Object, Name, Shade_Mode) \
evas_canvas3d_mesh_shade_mode_set(data->mesh_##Name, EVAS_CANVAS3D_SHADE_MODE_##Shade_Mode); \
@@ -147,7 +147,7 @@ typedef struct _vec2
#define SETUP_MESH_NODE(Name) \
- eo_add(&data->mesh_node_##Name, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->mesh_node_##Name, EVAS_CANVAS3D_NODE_TYPE_MESH)); \
+ data->mesh_node_##Name = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH)); \
\
evas_canvas3d_node_mesh_add(data->mesh_node_##Name, data->mesh_##Name);
@@ -156,7 +156,7 @@ typedef struct _vec2
efl_file_set(data->mesh_##Name, file, NULL); \
\
SETUP_DEFAULT_MESH(Object, Name, PHONG) \
- eo_add(&data->texture_diffuse_##Object, EVAS_CANVAS3D_TEXTURE_CLASS, evas); \
+ data->texture_diffuse_##Object = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); \
\
evas_canvas3d_texture_atlas_enable_set(data->texture_diffuse_##Object, EINA_FALSE); \
evas_canvas3d_texture_file_set(data->texture_diffuse_##Object, image, NULL); \
@@ -175,7 +175,7 @@ typedef struct _vec2
evas_canvas3d_mesh_frame_vertex_data_set(data->mesh_##Name, 0, EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD, \
2 * sizeof(float), vertex); \
SETUP_DEFAULT_MESH(Object, Name, NORMAL_MAP) \
- eo_add(&data->texture_diffuse_##Object, EVAS_CANVAS3D_TEXTURE_CLASS, evas); \
+ data->texture_diffuse_##Object = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); \
\
evas_canvas3d_texture_atlas_enable_set(data->texture_diffuse_##Object, EINA_FALSE); \
evas_canvas3d_texture_file_set(data->texture_diffuse_##Object, image, NULL); \
@@ -190,7 +190,7 @@ typedef struct _vec2
#define NORMAL_SET(Object, Name, normal) \
- eo_add(&data->texture_normal_##Object, EVAS_CANVAS3D_TEXTURE_CLASS, evas); \
+ data->texture_normal_##Object = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); \
\
evas_canvas3d_texture_atlas_enable_set(data->texture_normal_##Object, EINA_FALSE); \
evas_canvas3d_texture_file_set(data->texture_normal_##Object, normal, NULL); \
diff --git a/src/examples/evas/shooter/evas-3d-shooter.c b/src/examples/evas/shooter/evas-3d-shooter.c
index a306f41055..4acf990f25 100644
--- a/src/examples/evas/shooter/evas-3d-shooter.c
+++ b/src/examples/evas/shooter/evas-3d-shooter.c
@@ -876,7 +876,7 @@ _mesh_setup_column(Scene_Data *data, int index)
evas_canvas3d_material_color_set(data->material_column, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0);
evas_canvas3d_material_shininess_set(data->material_column, 50.0);
- eo_add(&data->mesh_column[index], EVAS_CANVAS3D_MESH_CLASS, evas);
+ data->mesh_column[index] = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas);
SETUP_MESH_NODE(column[index])