Set data to use in accessibility 59/133559/2
authorHyunho Kang <hhstark.kang@samsung.com>
Tue, 13 Jun 2017 01:43:06 +0000 (10:43 +0900)
committerHyunho Kang <hhstark.kang@samsung.com>
Tue, 13 Jun 2017 02:34:04 +0000 (11:34 +0900)
Change-Id: I1987e4fa019aba6e56c4dcade2fa6e603f535162
Signed-off-by: Hyunho Kang <hhstark.kang@samsung.com>
src/watch_app_main.c

index df4f9c7..6a005b2 100755 (executable)
@@ -1012,12 +1012,20 @@ EXPORT_API int watch_time_get_daylight_time_status(watch_time_h watch_time, bool
        return watch_time_get_dst_status(watch_time, daylight);
 }
 
+static void __win_del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+       char *plug_id;
+       plug_id = evas_object_data_del(obj, "___PLUGID");
+       free(plug_id);
+}
+
 EXPORT_API int watch_app_get_elm_win(Evas_Object **win)
 {
        Evas_Object *ret_win;
        struct wl_surface *surface;
        Ecore_Wl_Window *wl_win;
        screen_connector_provider_h remote;
+       char buffer[256];
 
        if (win == NULL)
                return watch_app_error(APP_ERROR_INVALID_PARAMETER,
@@ -1039,6 +1047,11 @@ EXPORT_API int watch_app_get_elm_win(Evas_Object **win)
                        SCREEN_CONNECTOR_INPUT_TYPE_MOUSE_MOVE_X_Y |
                        SCREEN_CONNECTOR_INPUT_TYPE_TOUCH_MOVE_X_Y);
 
+       /* Set data to use in accessibility */
+       snprintf(buffer, sizeof(buffer), "%s:%d", __context.appid, getpid());
+       evas_object_data_set(ret_win, "___PLUGID", strdup(buffer));
+       evas_object_event_callback_add(ret_win, EVAS_CALLBACK_DEL, __win_del_cb, NULL);
+
        *win = ret_win;
        return APP_ERROR_NONE;
 }