X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Ftdm_display.c;h=a355ab78628ce5ccfc8362eaf30e7eb141475eaf;hb=7e1f4f71006d85a16303b0b70e5b9d0e45b7e9ec;hp=9f6dd72fe2b9772c133e2a3d925776d9431f9a0c;hpb=eca0e8c8a3a8b1a4b27823a87a35f81044f10a77;p=platform%2Fcore%2Fuifw%2Flibtdm.git diff --git a/src/tdm_display.c b/src/tdm_display.c index 9f6dd72..a355ab7 100644 --- a/src/tdm_display.c +++ b/src/tdm_display.c @@ -815,6 +815,68 @@ tdm_display_find_output(tdm_display *dpy, const char *name, tdm_error *error) return NULL; } +INTERN tdm_output * +tdm_display_create_output(tdm_display *dpy, const char *name, tdm_error *error) +{ + tdm_private_module *private_module = NULL; + tdm_private_module *current_module = NULL; + tdm_func_display *func_display = NULL; + tdm_output *output = NULL; + + DISPLAY_FUNC_ENTRY_ERROR(); + + TDM_RETURN_VAL_IF_FAIL_WITH_ERROR(dpy != NULL, TDM_ERROR_INVALID_PARAMETER, NULL); + private_display = (tdm_private_display*)dpy; + + private_module = private_display->virtual_module; + TDM_RETURN_VAL_IF_FAIL_WITH_ERROR(private_module != NULL, TDM_ERROR_BAD_MODULE, NULL); + + _pthread_mutex_lock(&private_display->lock); + + if (error) + *error = TDM_ERROR_NONE; + + func_display = &private_module->func_display; + current_module = private_display->current_module; + private_display->current_module = private_module; + output = func_display->display_output_create(private_module->bdata, name, &ret); + private_display->current_module = current_module; + + _pthread_mutex_unlock(&private_display->lock); + + TDM_RETURN_VAL_IF_FAIL_WITH_ERROR(output != NULL, ret, NULL); + + return output; +} + +INTERN tdm_error +tdm_display_destroy_output(tdm_display *dpy, tdm_output *output) +{ + tdm_private_module *private_module = NULL; + tdm_private_module *current_module = NULL; + tdm_func_display *func_display = NULL; + + DISPLAY_FUNC_ENTRY(); + + TDM_RETURN_VAL_IF_FAIL(output != NULL, TDM_ERROR_INVALID_PARAMETER); + private_display = (tdm_private_display*)dpy; + + private_module = private_display->virtual_module; + TDM_RETURN_VAL_IF_FAIL(private_module != NULL, TDM_ERROR_BAD_MODULE); + + _pthread_mutex_lock(&private_display->lock); + + func_display = &private_module->func_display; + current_module = private_display->current_module; + private_display->current_module = private_module; + ret = func_display->display_output_destroy(private_module->bdata, output); + private_display->current_module = current_module; + + _pthread_mutex_unlock(&private_display->lock); + + return ret; +} + EXTERN tdm_error tdm_display_get_fd(tdm_display *dpy, int *fd) {