bool cancel_touch;
Evas_Object *img_tbm;
Evas_Object *img_file;
+ uint32_t img_type;
struct wl_buffer *pre_buffer;
void *data;
};
return;
free(h->ops);
free(h);
+ h = NULL;
}
EXPORT_API int screen_connector_watcher_evas_init(Evas_Object *win)
__obj_update_visibility(data, e, obj, event_info);
}
+static void __clear_img_tbm(screen_connector_watcher_evas_h watcher_evas_h)
+{
+ if (watcher_evas_h->img_tbm == NULL)
+ return;
+
+ g_hash_table_remove(__watcher_tbl, watcher_evas_h->img_tbm);
+ evas_object_del(watcher_evas_h->img_tbm);
+ watcher_evas_h->img_tbm = NULL;
+}
+
+static void __clear_img_file(screen_connector_watcher_evas_h watcher_evas_h)
+{
+ if (watcher_evas_h->img_file == NULL)
+ return;
+
+ evas_object_del(watcher_evas_h->img_file);
+ watcher_evas_h->img_file = NULL;
+}
+
static void __watcher_change_cb(struct tizen_remote_surface *trs, uint32_t type, struct wl_buffer *tbm,
int32_t img_file_fd, uint32_t img_file_size, uint32_t time, struct wl_array *keys, void *data)
{
evas_object_data_set(watcher_evas_h->img_tbm, "___PLUGID", strdup(plug_id));
evas_object_event_callback_add(watcher_evas_h->img_tbm,
EVAS_CALLBACK_MOVE, __obj_update_visibility, watcher_evas_h);
+ }
+ if (watcher_evas_h->img_type != type)
is_added = true;
- }
+ watcher_evas_h->img_type = type;
/* check type of given buffer */
if (type == TIZEN_REMOTE_SURFACE_BUFFER_TYPE_TBM) {
evas_object_image_fill_set(watcher_evas_h->img_file, 0, 0, width, height);
evas_object_resize(watcher_evas_h->img_file, width, height);
munmap(map, img_file_size);
- close(img_file_fd); /* close passed fd */
evas_object_image_native_surface_set(watcher_evas_h->img_tbm, NULL); /* set null to previous object for the tbm type */
}
watcher_evas_h->pre_buffer = tbm;
if (is_added) {
- LOGD("call added !!!! %s", appid);
- watcher_evas_h->ops->added(appid, watcher_evas_h->img_tbm,
- watcher_evas_h->data);
+ LOGD("call added !!!! %s, type %d", appid, type);
+ if (type == TIZEN_REMOTE_SURFACE_BUFFER_TYPE_IMAGE_FILE) {
+ watcher_evas_h->ops->added(appid, watcher_evas_h->img_file,
+ watcher_evas_h->data);
+ __clear_img_tbm(watcher_evas_h);
+ } else {
+ watcher_evas_h->ops->added(appid, watcher_evas_h->img_tbm,
+ watcher_evas_h->data);
+ __clear_img_file(watcher_evas_h);
+ }
} else {
- LOGD("call updated !!!! %s", appid);
- watcher_evas_h->ops->updated(appid, watcher_evas_h->img_tbm,
- watcher_evas_h->data);
+ LOGD("call updated !!!! %s, type %d", appid, type);
+ if (type == TIZEN_REMOTE_SURFACE_BUFFER_TYPE_IMAGE_FILE) {
+ watcher_evas_h->ops->updated(appid, watcher_evas_h->img_file,
+ watcher_evas_h->data);
+ __clear_img_tbm(watcher_evas_h);
+ } else {
+ watcher_evas_h->ops->updated(appid, watcher_evas_h->img_tbm,
+ watcher_evas_h->data);
+ __clear_img_file(watcher_evas_h);
+ }
}
+ close(img_file_fd); /* close passed fd */
}
static void __watcher_update_cb(struct tizen_remote_surface *trs, struct wl_buffer *buffer, uint32_t time, void *data)
}
appid = screen_connector_watcher_get_appid(watcher_evas_h->watcher_h);
- watcher_evas_h->ops->removed(appid, watcher_evas_h->img_tbm, watcher_evas_h->data);
+ if (watcher_evas_h->img_tbm != NULL)
+ watcher_evas_h->ops->removed(appid, watcher_evas_h->img_tbm, watcher_evas_h->data);
+ else
+ watcher_evas_h->ops->removed(appid, watcher_evas_h->img_file, watcher_evas_h->data);
__free_watcher_evas_h(watcher_evas_h);
}
LOGE("handle calloc fail");
return NULL;
}
+ handle->img_type = -1;
handle->ops = evas_ops;
handle->data = data;
handle->watcher_h = screen_connector_watcher_add(&watcher_ops, id, handle);