screen_connector_toolkit_ops *ops, void *data);
struct tizen_remote_surface *screen_connector_toolkit_get_trs(screen_connector_toolkit_h h);
int screen_connector_toolkit_redirect_surface(screen_connector_toolkit_h info);
+screen_connector_toolkit_h screen_connector_toolkit_add_with_surface(screen_connector_toolkit_ops *ops, char *id,
+ screen_connector_screen_type_e type, struct wl_surface *surface, void *data);
#ifdef __cplusplus
}
struct tizen_remote_surface *surface;
struct _screen_connector_type_h *type_h;
void *data;
+ struct wl_surface *bind_surface;
};
static GHashTable *__type_table;
tizen_remote_surface_add_listener(toolkit_h->surface, &__rs_listener, toolkit_h);
tizen_remote_surface_redirect(toolkit_h->surface);
+ if (toolkit_h->bind_surface != NULL)
+ tizen_remote_surface_manager_bind_surface(rsm, toolkit_h->bind_surface, toolkit_h->surface);
+
return 0;
}
return toolkit_h;
}
+EXPORT_API screen_connector_toolkit_h screen_connector_toolkit_add_with_surface(screen_connector_toolkit_ops *ops, char *id,
+ screen_connector_screen_type_e type, struct wl_surface *surface, void *data)
+{
+ screen_connector_toolkit_h toolkit_h;
+ screen_connector_type_h type_h;
+ screen_connector_toolkit_ops *ops_copy;
+
+ if (id == NULL || ops == NULL) {
+ LOGE("Invalid param");
+ return NULL;
+ }
+
+ type_h = g_hash_table_lookup(__type_table, GINT_TO_POINTER(type));
+ if (type_h == NULL) {
+ LOGE("type %d is not initialized !!", type);
+ return NULL;
+ }
+
+ ops_copy = (screen_connector_toolkit_ops *)calloc(1, sizeof(screen_connector_toolkit_ops));
+ if (ops_copy == NULL) {
+ LOGE("ops_copy calloc fail");
+ return NULL;
+ }
+ memcpy(ops_copy, ops, sizeof(screen_connector_toolkit_ops));
+
+ toolkit_h = (screen_connector_toolkit_h)calloc(1, sizeof(struct _screen_connector_toolkit_h));
+ if (toolkit_h == NULL) {
+ LOGE("toolkit_h calloc fail");
+ free(ops_copy);
+ return NULL;
+ }
+
+ toolkit_h->instance_id = strdup(id);
+ if (toolkit_h->instance_id == NULL) {
+ LOGE("strdup id fail");
+ free(ops_copy);
+ free(toolkit_h);
+ return NULL;
+ }
+
+ toolkit_h->data = data;
+ toolkit_h->ops = ops_copy;
+ toolkit_h->type_h = type_h;
+ toolkit_h->bind_surface = surface;
+
+ if (type_h->toolkit_table == NULL)
+ type_h->toolkit_table = g_hash_table_new_full(g_str_hash,
+ g_str_equal, free, __destroy_toolkit_h);
+
+ g_hash_table_insert(type_h->toolkit_table, strdup(id), toolkit_h);
+
+ if (type_h->aul_handle == NULL)
+ aul_screen_connector_add_screen_viewer(__aul_screen_viewer_cb, type, true, type_h, &type_h->aul_handle);
+
+ return toolkit_h;
+}
+
EXPORT_API screen_connector_toolkit_h screen_connector_toolkit_add(screen_connector_toolkit_ops *ops, char *id,
screen_connector_screen_type_e type, void *data)
{
screen_connector_toolkit_evas_h screen_connector_toolkit_evas_add_by_rid(screen_connector_toolkit_evas_ops *ops, int res_id,
screen_connector_screen_type_e type, void *data);
int screen_connector_toolkit_evas_get_rid(Evas_Object *obj, int *resource_id);
+screen_connector_toolkit_evas_h screen_connector_toolkit_evas_add_with_win(screen_connector_toolkit_evas_ops *ops, char *id,
+ screen_connector_screen_type_e type, Evas_Object *win, void *data);
+
/**
* @}
__free_toolkit_evas_h(toolkit_evas_h);
}
+EXPORT_API screen_connector_toolkit_evas_h screen_connector_toolkit_evas_add_with_win(screen_connector_toolkit_evas_ops *ops, char *id,
+ screen_connector_screen_type_e type, Evas_Object *win, void *data)
+{
+ screen_connector_toolkit_evas_h handle;
+ screen_connector_toolkit_evas_ops *evas_ops;
+ screen_connector_toolkit_ops toolkit_ops;
+ screen_connector_type_evas_h type_h;
+ int int_type = type;
+ struct wl_surface *surface;
+ Ecore_Wl_Window *wl_win;
+
+ if (win == NULL || ops == NULL || id == NULL
+ || type < SCREEN_CONNECTOR_SCREEEN_TYPE_WIDGET
+ || type > SCREEN_CONNECTOR_SCREEEN_TYPE_ALL) {
+ LOGE("Invalid param NULL");
+ return NULL;
+ }
+
+ wl_win = elm_win_wl_window_get(win);
+ if (wl_win == NULL) {
+ LOGE("failed to get wl_win");
+ return NULL;
+ }
+
+ surface = ecore_wl_window_surface_get(wl_win);
+ if (surface == NULL) {
+ LOGE("failed to get surface");
+ return NULL;
+ }
+
+ type_h = g_hash_table_lookup(__type_table, GINT_TO_POINTER(int_type));
+ if (type_h == NULL) {
+ LOGE("type %d is not initialized !!", type);
+ return NULL;
+ }
+
+ toolkit_ops.added_cb = __toolkit_added_cb;
+ toolkit_ops.updated_cb = NULL;
+ toolkit_ops.removed_cb = __toolkit_removed_cb;
+
+ evas_ops = (screen_connector_toolkit_evas_ops *)calloc(1, sizeof(screen_connector_toolkit_evas_ops));
+ if (evas_ops == NULL) {
+ LOGE("evas_ops calloc fail");
+ return NULL;
+ }
+
+ memcpy(evas_ops, ops, sizeof(screen_connector_toolkit_evas_ops));
+ handle = (screen_connector_toolkit_evas_h)calloc(1, sizeof(struct _screen_connector_toolkit_evas_h));
+ if (handle == NULL) {
+ LOGE("handle calloc fail");
+ free(evas_ops);
+ return NULL;
+ }
+ handle->img_type = -1;
+ handle->ops = evas_ops;
+ handle->data = data;
+ handle->type_h = type_h;
+ handle->toolkit_h = screen_connector_toolkit_add_with_surface(&toolkit_ops, id, type, surface, handle);
+
+ return handle;
+}
+
EXPORT_API screen_connector_toolkit_evas_h screen_connector_toolkit_evas_add(screen_connector_toolkit_evas_ops *ops, char *id,
screen_connector_screen_type_e type, void *data)
{