From: hyunho Date: Thu, 8 Aug 2019 02:53:13 +0000 (+0900) Subject: Add internal API to get resource ID X-Git-Tag: submit/tizen/20190830.041902~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eed82272006547d5f7642b5a3ec05f018fef0b29;p=platform%2Fcore%2Fappfw%2Fcomponent-based-application.git Add internal API to get resource ID Change-Id: Ibd573b5f405ed33c39645e78747d49f224407153 Signed-off-by: hyunho --- diff --git a/component_based/efl_base/api/frame_component_internal.h b/component_based/efl_base/api/frame_component_internal.h new file mode 100644 index 0000000..f89f485 --- /dev/null +++ b/component_based/efl_base/api/frame_component_internal.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __TIZEN_FRAME_COMPONENT_INTERNAL_H__ +#define __TIZEN_FRAME_COMPONENT_INTERNAL_H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +int frame_component_get_resource_id(Evas_Object *win, int *res_id); + +#ifdef __cplusplus +} +#endif +#endif /* __TIZEN_FRAME_COMPONENT_INTERNAL_H__ */ + diff --git a/component_based/efl_base/stub.cc b/component_based/efl_base/stub.cc index c7daf72..c40d8df 100755 --- a/component_based/efl_base/stub.cc +++ b/component_based/efl_base/stub.cc @@ -18,6 +18,7 @@ #include #include #include +#include #include @@ -576,5 +577,33 @@ extern "C" EXPORT_API int frame_component_get_window( const_cast(win); *window = static_cast(elm_win->GetRaw()); + return COMPONENT_ERROR_NONE; +} + +extern "C" EXPORT_API int frame_component_get_resource_id(Evas_Object* win, + int* res_id) { + if (win == nullptr || res_id == nullptr) { + LOGE("Invalid parameter"); + return COMPONENT_ERROR_INVALID_PARAMETER; + } + Evas* evas = evas_object_evas_get(win); + if (evas == nullptr) { + LOGE("Invalid parameter"); + return COMPONENT_ERROR_INVALID_PARAMETER; + } + + Ecore_Evas* ecore_evas = ecore_evas_ecore_evas_get(evas); + if (ecore_evas == nullptr) { + LOGE("Invalid parameter"); + return COMPONENT_ERROR_INVALID_PARAMETER; + } + + Ecore_Wl2_Window* wl_win = ecore_evas_wayland2_window_get(ecore_evas); + if (wl_win == nullptr) { + LOGE("Invalid parameter"); + return COMPONENT_ERROR_INVALID_PARAMETER; + } + + *res_id = ecore_wl2_window_id_get(wl_win); return COMPONENT_ERROR_NONE; } \ No newline at end of file