int screen_connector_toolkit_bind(screen_connector_toolkit_h h, struct wl_surface *surface);
int screen_connector_toolkit_unbind(screen_connector_toolkit_h h);
+bool screen_connector_toolkit_is_exist(char *id,
+ screen_connector_screen_type_e type);
#ifdef __cplusplus
}
return toolkit_h;
}
+EXPORT_API bool screen_connector_toolkit_is_exist(char *id,
+ screen_connector_screen_type_e type)
+{
+ screen_connector_type_h type_h = NULL;
+
+ if (id == NULL) {
+ LOGE("Invalid param");
+ return false;
+ }
+
+ type_h = g_hash_table_lookup(__type_table, GINT_TO_POINTER(type));
+ if (type_h == NULL) {
+ LOGE("type %d is not initialized !!", type);
+ return false;
+ }
+
+ if (type_h->toolkit_table == NULL)
+ return false;
+
+ return (g_hash_table_lookup(type_h->toolkit_table, id) != NULL);
+}
+
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)
{
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);
+ if (screen_connector_toolkit_is_exist(id, type)) {
+ LOGE("Already exist ID : %s", id);
return NULL;
}
screen_connector_type_evas_h type_h;
int int_type = type;
+ if (screen_connector_toolkit_is_exist(id, type)) {
+ LOGE("Already exist ID : %s", id);
+ 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);