vg_container : apply evas_vg parent and refactored code for latest efl 02/189602/1 submit/tizen/20180919.084736 submit/tizen/20180920.084839
authorSangHyeon Jade Lee <sh10233.lee@samsung.com>
Wed, 19 Sep 2018 06:34:35 +0000 (15:34 +0900)
committerSangHyeon Jade Lee <sh10233.lee@samsung.com>
Wed, 19 Sep 2018 06:34:54 +0000 (15:34 +0900)
Change-Id: Ic5a8099cd8f150ab8be6b3a71852e0554496e923
Signed-off-by: SangHyeon Jade Lee <sh10233.lee@samsung.com>
src/wearable/circle/efl_extension_circle_object.c
src/wearable/circle/efl_extension_circle_surface.c

index 16072e6247c93d46c2bbf406df98c07014a31b59..44e52060d4f4e95121b90000894939926dd2bd60 100644 (file)
@@ -165,6 +165,9 @@ _eext_circle_object_add(Evas_Object *parent, Evas_Object *widget_obj, Eext_Circl
 
    obj = elm_table_add(parent);
 
+   if (!surface)
+     surface = _eext_circle_surface_init(circle_obj->main_obj, NULL, EEXT_CIRCLE_SURFACE_TYPE_PRIVATE);
+
    circle_obj = (Eext_Circle_Object *)calloc(1, sizeof(Eext_Circle_Object));
    // Obj is expected to be elm_image object.
    circle_obj->main_obj = obj;
@@ -173,7 +176,7 @@ _eext_circle_object_add(Evas_Object *parent, Evas_Object *widget_obj, Eext_Circl
    circle_obj->widget_type = EEXT_CIRCLE_OBJECT_TYPE;
    circle_obj->del_func = NULL;
    circle_obj->disabled_func = NULL;
-   circle_obj->vg_container = evas_vg_container_add(NULL);
+   circle_obj->vg_container = evas_vg_container_add(surface->vg_root);
 
    /* When circle object is deleted, it must call efl_unref() for vg_container */
    efl_ref(circle_obj->vg_container);
@@ -195,14 +198,7 @@ _eext_circle_object_add(Evas_Object *parent, Evas_Object *widget_obj, Eext_Circl
         evas_object_smart_callback_add(widget_obj, "enabled", _eext_circle_object_widget_object_enabled_cb, circle_obj);
      }
 
-   if (surface)
-     _eext_circle_surface_object_append(surface, circle_obj);
-   else
-     {
-        Eext_Circle_Surface *private_surface =
-           _eext_circle_surface_init(circle_obj->main_obj, NULL, EEXT_CIRCLE_SURFACE_TYPE_PRIVATE);
-        _eext_circle_surface_object_append(private_surface, circle_obj);
-     }
+   _eext_circle_surface_object_append(surface, circle_obj);
 
    return obj;
 }
index eee3e795a4737f4fb500d07e8c32c7872794f805..0ce490dee5bbd9983e75fc05fab637f21810bbd9 100644 (file)
@@ -212,7 +212,7 @@ _eext_circle_surface_vector_init(Eext_Circle_Surface *surface)
      }
 
    surface->vg_obj = evas_object_vg_add(evas_object_evas_get(surface->main_obj));
-   root = evas_vg_container_add(NULL);
+   root = evas_vg_container_add(surface->vg_obj);
    evas_object_vg_root_node_set(surface->vg_obj, root);
    surface->vg_root = root;
    evas_object_repeat_events_set(surface->vg_obj, EINA_TRUE);
@@ -702,10 +702,13 @@ _eext_circle_surface_add(Evas_Object *parent, Eext_Circle_Surface_Type type)
 
    if (!parent) return NULL;
 
-   if (type != EEXT_CIRCLE_SURFACE_TYPE_NAVIFRAME)
-     main_obj = _eext_circle_surface_main_obj_add(parent);
+   //FIXME: vg container need main object as their parent.
+   // This main object will be fake parent in naviframe case.
+   //if (type != EEXT_CIRCLE_SURFACE_TYPE_NAVIFRAME)
+   main_obj = _eext_circle_surface_main_obj_add(parent);
 
    surface = _eext_circle_surface_init(main_obj, parent, type);
+   _eext_circle_surface_vector_init(surface);
 
    return surface;
 }