Add internal API to get resource ID 67/211667/3
authorhyunho <hhstark.kang@samsung.com>
Thu, 8 Aug 2019 02:53:13 +0000 (11:53 +0900)
committerHyunho Kang <hhstark.kang@samsung.com>
Wed, 21 Aug 2019 04:03:57 +0000 (04:03 +0000)
Change-Id: Ibd573b5f405ed33c39645e78747d49f224407153
Signed-off-by: hyunho <hhstark.kang@samsung.com>
component_based/efl_base/api/frame_component_internal.h [new file with mode: 0644]
component_based/efl_base/stub.cc

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 (file)
index 0000000..f89f485
--- /dev/null
@@ -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 <Elementary.h>
+
+#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__ */
+
index c7daf7283f46733de24e106899632d549038ace4..c40d8dfd3a9eac3b2bff7fce9e49b34d5fa6d7e6 100755 (executable)
@@ -18,6 +18,7 @@
 #include <glib.h>
 #include <unistd.h>
 #include <app_control_internal.h>
+#include <Ecore_Wl2.h>
 
 #include <list>
 
@@ -576,5 +577,33 @@ extern "C" EXPORT_API int frame_component_get_window(
       const_cast<component_based::ElmWindow*>(win);
   *window = static_cast<Evas_Object*>(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