__global_remove
};
-void __parent_id_getter(void *data, struct tizen_resource *tizen_resource, uint32_t id)
+static void __parent_id_getter(void *data, struct tizen_resource *tizen_resource, uint32_t id)
{
if (!data) {
LOGE("NULL data");
};
-int _mm_display_get_parent_id(mm_display_type_e type, void *handle, int *parent_id)
+static int __mm_display_get_parent_id(mm_display_type_e type, void *handle, int *parent_id)
{
int ret = MM_ERROR_NONE;
Ecore_Wl2_Window *wl2_window = NULL;
return MM_ERROR_OUT_OF_MEMORY;
}
- new_handle->type = MM_DISPLAY_TYPE_OVERLAY;
+ new_handle->type = MM_DISPLAY_TYPE_NONE;
*handle = (mm_display_h)new_handle;
int ret = MM_ERROR_NONE;
const char *object_type = NULL;
mm_display_t *dp_handle = NULL;
+#ifdef TIZEN_FEATURE_EVAS_RENDERER
+ MMHandleType new_evas_renderer = NULL;
+#endif
if (!handle || !display || !parent_id ||
type > MM_DISPLAY_TYPE_OVERLAY_EXT) {
}
}
- if ((type == MM_DISPLAY_TYPE_OVERLAY && !strcmp(object_type, "elm_win")) ||
- type == MM_DISPLAY_TYPE_OVERLAY_EXT) {
+ if (type == MM_DISPLAY_TYPE_OVERLAY_EXT ||
+ (type == MM_DISPLAY_TYPE_OVERLAY && !strcmp(object_type, "elm_win"))) {
/* get wayland parent id */
- ret = _mm_display_get_parent_id(type, display, &dp_handle->parent_id);
- if (ret == MM_ERROR_NONE)
- *parent_id = dp_handle->parent_id;
- else
+ ret = __mm_display_get_parent_id(type, display, &dp_handle->parent_id);
+ if (ret != MM_ERROR_NONE) {
LOGE("failed to get wayland info. ret 0x%x", ret);
+ return ret;
+ }
+
+ *parent_id = dp_handle->parent_id;
} else if (type == MM_DISPLAY_TYPE_EVAS && !strcmp(object_type, "image")) {
/* evas object surface */
#ifdef TIZEN_FEATURE_EVAS_RENDERER
- MMHandleType new_evas_renderer = NULL;
-
- /* create evas renderer */
ret = mm_evas_renderer_create(&new_evas_renderer, (Evas_Object *)display);
if (ret != MM_ERROR_NONE) {
LOGE("failed to create evas renderer 0x%x", ret);
- ret = MM_ERROR_UNKNOWN;
+ return MM_ERROR_UNKNOWN;
+ }
+
+ if (dp_handle->evas_renderer) {
+ /* release old evas renderer */
+ mm_evas_renderer_destroy(dp_handle->evas_renderer);
} else {
- /* release previous resources */
- if (dp_handle->evas_renderer) {
- LOGW("release previous evas renderer %p", dp_handle->evas_renderer);
- mm_evas_renderer_destroy(dp_handle->evas_renderer);
- dp_handle->evas_renderer = NULL;
- } else {
- /* init mutex for first time */
- g_mutex_init(&dp_handle->evas_mutex);
- }
-
- dp_handle->evas_renderer = new_evas_renderer;
-
- LOGD("new evas renderer %p", new_evas_renderer);
+ /* init mutex for first time */
+ g_mutex_init(&dp_handle->evas_mutex);
}
+
+ dp_handle->evas_renderer = new_evas_renderer;
+
+ LOGD("new evas renderer %p", new_evas_renderer);
#else /* TIZEN_FEATURE_EVAS_RENDERER */
LOGE("EVAS surface is not supported");
- ret = MM_ERROR_NOT_SUPPORT_API;
+ return MM_ERROR_NOT_SUPPORT_API;
#endif /* TIZEN_FEATURE_EVAS_RENDERER */
} else {
LOGE("unknown display handle [%p,%s] or type [%d] mismatch",
display, object_type ? object_type : "UNKNOWN", type);
- ret = MM_ERROR_INVALID_ARGUMENT;
+ return MM_ERROR_INVALID_ARGUMENT;
}
- if (ret == MM_ERROR_NONE) {
- dp_handle->type = type;
- dp_handle->display = display;
+ dp_handle->type = type;
+ dp_handle->display = display;
+
+ return MM_ERROR_NONE;
+}
+
+
+int mm_display_get_type(mm_display_h handle, mm_display_type_e *type)
+{
+ mm_display_t *dp_handle = (mm_display_t *)handle;
+
+ if (!dp_handle || !type) {
+ LOGE("NULL param %p %p", dp_handle, type);
+ return MM_ERROR_INVALID_ARGUMENT;
}
- return ret;
+ *type = dp_handle->type;
+
+ return MM_ERROR_NONE;
}
sym_ret = g_module_symbol(module, "mm_display_init", (gpointer *)&new_interface->init);
sym_ret &= g_module_symbol(module, "mm_display_deinit", (gpointer *)&new_interface->deinit);
sym_ret &= g_module_symbol(module, "mm_display_set_display", (gpointer *)&new_interface->set_display);
+ sym_ret &= g_module_symbol(module, "mm_display_get_type", (gpointer *)&new_interface->get_type);
sym_ret &= g_module_symbol(module, "mm_display_get_window_rect", (gpointer *)&new_interface->get_window_rect);
#ifdef TIZEN_FEATURE_EVAS_RENDERER
sym_ret &= g_module_symbol(module, "mm_display_evas_set_rotation", (gpointer *)&new_interface->evas_set_rotation);
}
+int mm_display_interface_get_type(mm_display_interface_h handle, mm_display_type_e *type)
+{
+ DECLARE_CHECK_INTERFACE_HANDLE(handle);
+
+ if (!interface->get_type) {
+ LOGE("NULL function pointer");
+ return MM_ERROR_UNKNOWN;
+ }
+
+ return interface->get_type(interface->dp_handle, type);
+}
+
+
int mm_display_interface_get_window_rect(mm_display_interface_h handle, MMRectType *window_rect)
{
DECLARE_CHECK_INTERFACE_HANDLE(handle);