[accessibility][screen-reader] make widget accessible 54/97354/2 accepted/tizen/3.0/common/20161121.073037 accepted/tizen/3.0/ivi/20161121.012141 accepted/tizen/3.0/mobile/20161121.012051 accepted/tizen/3.0/tv/20161121.012110 accepted/tizen/3.0/wearable/20161121.012120 submit/tizen_3.0/20161117.231834
authorShinwoo Kim <cinoo.kim@samsung.com>
Mon, 14 Nov 2016 02:47:49 +0000 (11:47 +0900)
committerShinwoo Kim <cinoo.kim@samsung.com>
Tue, 15 Nov 2016 01:38:24 +0000 (10:38 +0900)
Change-Id: I2db8f30ae410aba654b3559e19f510f938ed023f

src/widget_app.c

index 80d9cb82b9d1ddd2981a4374db52ef9e82f462bf..374e43733ed69636af63d1f3955010f828aca6d8 100755 (executable)
@@ -1346,6 +1346,14 @@ EXPORT_API const char *widget_app_get_id(widget_context_h context)
        return context->id;
 }
 
+static void _win_del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+       /* Remove data used in accessibility */
+       char *plug_id;
+       plug_id = evas_object_data_del(obj, "___PLUGID");
+       free(plug_id);
+}
+
 EXPORT_API int widget_app_get_elm_win(widget_context_h context,
                                        Evas_Object **win)
 {
@@ -1353,6 +1361,7 @@ EXPORT_API int widget_app_get_elm_win(widget_context_h context,
        Evas_Object *ret_win;
        Ecore_Wl_Window *wl_win;
        struct wl_surface *surface;
+       char buffer[256];
 
        if (!_is_widget_feature_enabled()) {
                _E("not supported"); /* LCOV_EXCL_LINE */
@@ -1390,6 +1399,11 @@ EXPORT_API int widget_app_get_elm_win(widget_context_h context,
        cxt->win = ret_win;
        cxt->win_id = ecore_wl_window_id_get(wl_win);
 
+       /* Set data to use in accessibility */
+       snprintf(buffer, sizeof(buffer), "%s:%d", cxt->id, getpid());
+       evas_object_data_set(ret_win, "___PLUGID", strdup(buffer));
+       evas_object_event_callback_add(ret_win, EVAS_CALLBACK_DEL, _win_del_cb, NULL);
+
        _D("window created: %d", cxt->win_id);
 
        return WIDGET_ERROR_NONE;