summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2018-02-12 14:29:20 -0500
committerMike Blumenkrantz <zmike@osg.samsung.com>2018-02-12 16:47:41 -0500
commit27ae060633fdc5d950410492fec14806e2d4b9f3 (patch)
tree6ae5220dc8c9f881f668efc5daba1c49b0e3cedc /src/lib
parent87d741052b51e081faf0d8a9cf5cdd765adf262c (diff)
evas3d: use a type setter function with finalize instead of a custom constructor
resolves a conflict with the 'constructor' method name
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/edje/edje_load.c8
-rw-r--r--src/lib/evas/canvas/evas_canvas3d_node.c43
-rw-r--r--src/lib/evas/canvas/evas_canvas3d_node.eo24
3 files changed, 43 insertions, 32 deletions
diff --git a/src/lib/edje/edje_load.c b/src/lib/edje/edje_load.c
index 34492c847b..a458b77970 100644
--- a/src/lib/edje/edje_load.c
+++ b/src/lib/edje/edje_load.c
@@ -1086,7 +1086,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const Eina_File *file, const ch
1086 Evas_Canvas3D_Material *material = NULL; 1086 Evas_Canvas3D_Material *material = NULL;
1087 Edje_Part_Description_Mesh_Node *pd_mesh_node; 1087 Edje_Part_Description_Mesh_Node *pd_mesh_node;
1088 1088
1089 rp->node = efl_add(EVAS_CANVAS3D_NODE_CLASS, ed->base.evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH)); 1089 rp->node = efl_add(EVAS_CANVAS3D_NODE_CLASS, ed->base.evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_MESH));
1090 1090
1091 mesh = efl_add(EVAS_CANVAS3D_MESH_CLASS, ed->base.evas); 1091 mesh = efl_add(EVAS_CANVAS3D_MESH_CLASS, ed->base.evas);
1092 evas_canvas3d_node_mesh_add(rp->node, mesh); 1092 evas_canvas3d_node_mesh_add(rp->node, mesh);
@@ -1119,7 +1119,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const Eina_File *file, const ch
1119 { 1119 {
1120 Evas_Canvas3D_Light *light = NULL; 1120 Evas_Canvas3D_Light *light = NULL;
1121 1121
1122 rp->node = efl_add(EVAS_CANVAS3D_NODE_CLASS, ed->base.evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_LIGHT)); 1122 rp->node = efl_add(EVAS_CANVAS3D_NODE_CLASS, ed->base.evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
1123 light = efl_add(EVAS_CANVAS3D_LIGHT_CLASS, ed->base.evas); 1123 light = efl_add(EVAS_CANVAS3D_LIGHT_CLASS, ed->base.evas);
1124 evas_canvas3d_node_light_set(rp->node, light); 1124 evas_canvas3d_node_light_set(rp->node, light);
1125 1125
@@ -1131,7 +1131,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const Eina_File *file, const ch
1131 { 1131 {
1132 Evas_Canvas3D_Camera *camera = NULL; 1132 Evas_Canvas3D_Camera *camera = NULL;
1133 1133
1134 rp->node = efl_add(EVAS_CANVAS3D_NODE_CLASS, ed->base.evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA)); 1134 rp->node = efl_add(EVAS_CANVAS3D_NODE_CLASS, ed->base.evas, evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
1135 camera = efl_add(EVAS_CANVAS3D_CAMERA_CLASS, ed->base.evas); 1135 camera = efl_add(EVAS_CANVAS3D_CAMERA_CLASS, ed->base.evas);
1136 evas_canvas3d_node_camera_set(rp->node, camera); 1136 evas_canvas3d_node_camera_set(rp->node, camera);
1137 1137
@@ -2670,7 +2670,7 @@ edje_3d_object_add(Evas_Object *obj, Eo **root_node, Eo *scene)
2670 2670
2671 if (*root_node == NULL) 2671 if (*root_node == NULL)
2672 *root_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, ed->base.evas, 2672 *root_node = efl_add(EVAS_CANVAS3D_NODE_CLASS, ed->base.evas,
2673 evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE)); 2673 evas_canvas3d_node_type_set(efl_added, EVAS_CANVAS3D_NODE_TYPE_NODE));
2674 2674
2675 if (scene == NULL) 2675 if (scene == NULL)
2676 scene = efl_add(EVAS_CANVAS3D_SCENE_CLASS, ed->base.evas); 2676 scene = efl_add(EVAS_CANVAS3D_SCENE_CLASS, ed->base.evas);
diff --git a/src/lib/evas/canvas/evas_canvas3d_node.c b/src/lib/evas/canvas/evas_canvas3d_node.c
index 0760b231be..9e194397a2 100644
--- a/src/lib/evas/canvas/evas_canvas3d_node.c
+++ b/src/lib/evas/canvas/evas_canvas3d_node.c
@@ -1025,11 +1025,27 @@ evas_canvas3d_node_add(Evas *e, Evas_Canvas3D_Node_Type type)
1025 MAGIC_CHECK(e, Evas, MAGIC_EVAS); 1025 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
1026 return NULL; 1026 return NULL;
1027 MAGIC_CHECK_END(); 1027 MAGIC_CHECK_END();
1028 return efl_add(MY_CLASS, e, evas_canvas3d_node_constructor(efl_added, type)); 1028 return efl_add(MY_CLASS, e, evas_canvas3d_node_type_set(efl_added, type));
1029} 1029}
1030 1030
1031EOLIAN static void 1031EOLIAN static Efl_Object *
1032_evas_canvas3d_node_constructor(Eo *obj, Evas_Canvas3D_Node_Data *pd, Evas_Canvas3D_Node_Type type) 1032_evas_canvas3d_node_efl_object_finalize(Eo *obj, Evas_Canvas3D_Node_Data *pd)
1033{
1034 if (pd->type == EVAS_CANVAS3D_NODE_TYPE_MESH)
1035 {
1036 pd->data.mesh.node_meshes = eina_hash_pointer_new(_node_mesh_free_func);
1037 if (pd->data.mesh.node_meshes == NULL)
1038 {
1039 ERR("Failed to create node mesh table.");
1040 _node_free(obj);
1041 return NULL;
1042 }
1043 }
1044 return obj;
1045}
1046
1047EOLIAN static Efl_Object *
1048_evas_canvas3d_node_efl_object_constructor(Eo *obj, Evas_Canvas3D_Node_Data *pd)
1033{ 1049{
1034 evas_canvas3d_object_type_set(obj, EVAS_CANVAS3D_OBJECT_TYPE_NODE); 1050 evas_canvas3d_object_type_set(obj, EVAS_CANVAS3D_OBJECT_TYPE_NODE);
1035 1051
@@ -1049,18 +1065,7 @@ _evas_canvas3d_node_constructor(Eo *obj, Evas_Canvas3D_Node_Data *pd, Evas_Canva
1049 pd->lod = EINA_FALSE; 1065 pd->lod = EINA_FALSE;
1050 1066
1051 evas_box3_set(&pd->aabb, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); 1067 evas_box3_set(&pd->aabb, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
1052 1068 return obj;
1053 pd->type = type;
1054
1055 if (type == EVAS_CANVAS3D_NODE_TYPE_MESH)
1056 {
1057 pd->data.mesh.node_meshes = eina_hash_pointer_new(_node_mesh_free_func);
1058 if (pd->data.mesh.node_meshes == NULL)
1059 {
1060 ERR("Failed to create node mesh table.");
1061 _node_free(obj);
1062 }
1063 }
1064} 1069}
1065 1070
1066EOLIAN static void 1071EOLIAN static void
@@ -1072,12 +1077,18 @@ _evas_canvas3d_node_efl_object_destructor(Eo *obj, Evas_Canvas3D_Node_Data *pd E
1072} 1077}
1073 1078
1074EOLIAN static Evas_Canvas3D_Node_Type 1079EOLIAN static Evas_Canvas3D_Node_Type
1075_evas_canvas3d_node_type_get(const Eo *obj EINA_UNUSED, Evas_Canvas3D_Node_Data *pd) 1080_evas_canvas3d_node_node_type_get(Eo *obj EINA_UNUSED, Evas_Canvas3D_Node_Data *pd)
1076{ 1081{
1077 return pd->type; 1082 return pd->type;
1078} 1083}
1079 1084
1080EOLIAN static void 1085EOLIAN static void
1086_evas_canvas3d_node_node_type_set(Eo *obj EINA_UNUSED, Evas_Canvas3D_Node_Data *pd, Evas_Canvas3D_Node_Type type)
1087{
1088 pd->type = type;
1089}
1090
1091EOLIAN static void
1081_evas_canvas3d_node_member_add(Eo *obj, Evas_Canvas3D_Node_Data *pd, Evas_Canvas3D_Node *member) 1092_evas_canvas3d_node_member_add(Eo *obj, Evas_Canvas3D_Node_Data *pd, Evas_Canvas3D_Node *member)
1082{ 1093{
1083 if (obj == member) 1094 if (obj == member)
diff --git a/src/lib/evas/canvas/evas_canvas3d_node.eo b/src/lib/evas/canvas/evas_canvas3d_node.eo
index ca4e155824..98f27483f4 100644
--- a/src/lib/evas/canvas/evas_canvas3d_node.eo
+++ b/src/lib/evas/canvas/evas_canvas3d_node.eo
@@ -5,18 +5,19 @@ class Evas.Canvas3D.Node (Evas.Canvas3D.Object)
5 [[Evas 3D canvas node class]] 5 [[Evas 3D canvas node class]]
6 data: Evas_Canvas3D_Node_Data; 6 data: Evas_Canvas3D_Node_Data;
7 methods { 7 methods {
8 constructor { 8 @property node_type {
9 [[Constructor.]]
10 legacy: null;
11 params {
12 @in type: Evas.Canvas3D.Node_Type; [[Node type]]
13 }
14 }
15 type_get @const {
16 [[Get the type of the given node. 9 [[Get the type of the given node.
17 10
18 See also @Evas.Canvas3D.Node.member_add.]] 11 See also @Evas.Canvas3D.Node.member_add.]]
19 return: Evas.Canvas3D.Node_Type ; [[The type of the given node.]] 12 set {
13 [[Type can only be set before finalize.]]
14 }
15 get {
16 [[If the object is not node object, returns $unknown.]]
17 }
18 values {
19 type: Evas.Canvas3D.Node_Type(Evas.Canvas3D.Node_Type.unknown); [[Node type]]
20 }
20 } 21 }
21 member_add { 22 member_add {
22 [[Add a member node to the given node. 23 [[Add a member node to the given node.
@@ -383,13 +384,12 @@ class Evas.Canvas3D.Node (Evas.Canvas3D.Object)
383 } 384 }
384 } 385 }
385 implements { 386 implements {
387 Efl.Object.constructor;
386 Efl.Object.destructor; 388 Efl.Object.destructor;
389 Efl.Object.finalize;
387 Evas.Canvas3D.Object.update_notify; 390 Evas.Canvas3D.Object.update_notify;
388 Evas.Canvas3D.Object.change_notify; 391 Evas.Canvas3D.Object.change_notify;
389 Evas.Canvas3D.Object.callback_register; 392 Evas.Canvas3D.Object.callback_register;
390 Evas.Canvas3D.Object.callback_unregister; 393 Evas.Canvas3D.Object.callback_unregister;
391 } 394 }
392 constructors {
393 .constructor;
394 }
395} 395}