eext_popup: remove activated api 98/226498/1 submit/tizen_5.5/20200303.215650
authorTaehyub Kim <taehyub.kim@samsung.com>
Tue, 3 Mar 2020 06:39:39 +0000 (15:39 +0900)
committerTaehyub Kim <taehyub.kim@samsung.com>
Tue, 3 Mar 2020 06:53:46 +0000 (15:53 +0900)
Change-Id: Ifdaae1e50870435ee8966e9f7921f054feac89d8

inc/wearable/efl_extension_common_private.h
inc/wearable/efl_extension_popup.h
src/wearable/efl_extension_popup.c

index 040d732b9975add2ae98e1e27e1d4f125c91e824..038fb29d073d3a88c36ff481f367b469f263ecc1 100644 (file)
@@ -324,11 +324,6 @@ struct _Eext_Panel_Data {
    Eina_Bool panel_hide_cb_added;
 };
 
-typedef struct _Eext_Popup_Data Eext_Popup_Data;
-struct _Eext_Popup_Data {
-   Evas_Object *circle_scroller;
-};
-
 #ifdef __cplusplus
 }
 #endif
index 2db1eb8547982e853dfdfd051d4de3a4bfa244f9..3bffeab57252e6d8af53d7a52e57998ff320ef09 100644 (file)
@@ -42,18 +42,6 @@ extern "C" {
  */
 EAPI Evas_Object* eext_popup_add(Evas_Object *parent);
 
-/**
- * @WEARABLE_ONLY
- * @brief Set an eext popup as activated object.
- *
- * @param[in] eext_popup The eext popup object
- * @param[in] activated Set EINA_TRUE to activate or EINA_FALSE to de-activate object
- *
- * @if WEARABLE @since_tizen 5.5
- * @endif
- */
-EAPI void eext_popup_rotary_event_activated_set(Evas_Object *eext_popup, Eina_Bool activated);
-
 /**
  * @}
  */
index d267b207cf8dc9da9859fabc958e3e410df2e32a..3461ccfccac35a254bfc2414d51644fd6323fbc0 100644 (file)
  * limitations under the License.
  */
 
-
-#define EEXT_POPUP_DATA_KEY "eext_popup_data"
-
 #include "efl_extension.h"
 #include "efl_extension_private.h"
-#include "wearable/circle/efl_extension_circle_private.h"
-#include "wearable/efl_extension_common_private.h"
+
+static const char SIGNAL_ACTIVATED[] = "rotary,activated";
 
 static void
-_eext_popup_del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+_rotary_activated_cb(void *data, Evas_Object *obj, void *event_info)
 {
-   Eext_Popup_Data *pd = (Eext_Popup_Data *)evas_object_data_get(obj, EEXT_POPUP_DATA_KEY);
-   if (!pd)
-     {
-        LOGE("Eext Popup Data is NULL");
-        return;
-     }
+   eext_rotary_object_event_activated_set(data, EINA_TRUE);
+}
 
-   free(pd);
+static void
+_eext_popup_del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+   evas_object_smart_callback_del(obj, SIGNAL_ACTIVATED, _rotary_activated_cb);
 }
 
 EAPI Evas_Object *
@@ -58,7 +54,6 @@ eext_popup_add(Evas_Object *parent)
        return NULL;
      }
 
-
    elm_popup_scrollable_set(obj, EINA_TRUE);
    Evas_Object *popup_scr = evas_object_data_get(obj, "popup_scroller");
    if (popup_scr == NULL)
@@ -86,30 +81,8 @@ eext_popup_add(Evas_Object *parent)
         return NULL;
      }
 
-   Eext_Popup_Data *pd = (Eext_Popup_Data *)calloc(1, sizeof(Eext_Popup_Data));
-   if (!pd)
-     {
-        LOGE("Eext Popup Data is NULL");
-        return NULL;
-     }
-
-   pd->circle_scroller = circle_scr;
-   evas_object_data_set(obj, EEXT_POPUP_DATA_KEY, pd);
-
+   evas_object_smart_callback_add(obj, SIGNAL_ACTIVATED, _rotary_activated_cb, circle_scr);
    evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL, _eext_popup_del_cb, NULL);
 
    return obj;
 }
-
-EAPI void
-eext_popup_rotary_event_activated_set(Evas_Object *eext_popup, Eina_Bool activated)
-{
-   Eext_Popup_Data *pd = (Eext_Popup_Data *)evas_object_data_get(eext_popup, EEXT_POPUP_DATA_KEY);
-   if (!pd)
-     {
-        LOGE("Eext Popup Data is NULL, Rotary event activated set failed");
-        return;
-     }
-
-   eext_rotary_object_event_activated_set(pd->circle_scroller, activated);
-}