From f888171548c0c716bc26ad90f654894c7c11a850 Mon Sep 17 00:00:00 2001 From: Alexander Gorshenev Date: Thu, 7 Nov 2024 18:40:07 +0300 Subject: [PATCH] Added a task on C API generation for Photos business logic libraries Signed-off-by: Alexander Gorshenev --- arkoala-arkts/doc/PHOTOS_OHOS_C_API.md | 70 ++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 arkoala-arkts/doc/PHOTOS_OHOS_C_API.md diff --git a/arkoala-arkts/doc/PHOTOS_OHOS_C_API.md b/arkoala-arkts/doc/PHOTOS_OHOS_C_API.md new file mode 100644 index 000000000..f73144608 --- /dev/null +++ b/arkoala-arkts/doc/PHOTOS_OHOS_C_API.md @@ -0,0 +1,70 @@ +# C API and ArkTS bindings for Selected OHOS libraries + +We need C API and ArkTS NEXT bindings generated for several @ohos libraries used in the Photos app main screen. + +## The scope of work + +Only the libraries needed for Photos app main screen need to be converted. + +At least for the following set of libraries should be covered + + * @ohos.file.photoAccessHelper + * @ohos.abilityAccessCtrl + * @ohos.data.dataSharePredicates + +Talk to Nikolay Igotti before doing any other libraries. + +## The generator + +### The tool + +The generation tool can be found here +https://gitee.com/nikolay-igotti/idlize + +### libxml example + +The generator invocation for @ohos.xml example can be found starting from this entry point: + +https://gitee.com/nikolay-igotti/idlize/blob/master/package.json#L61 + + +## The task breakdown + +### Generate everything that can be generated + +#### Generate the C header + +See here for example of such generated header for libace.so + +https://gitee.com/openharmony/arkui_ace_engine/blob/OpenHarmony_ArkUI_Upstream_2024/frameworks/core/interfaces/arkoala/generated/interface/arkoala_api_generated.h#L9783 + +#### Generate interop bridges + +See here for example of such file for libace.so + +https://gitee.com/openharmony-sig/arkcompiler_ets_frontend/raw/master/arkoala/framework/native/src/generated/bridge_generated.cc + +#### Generate ArkTS bindings for your library + +See here for example of ArkTS bindings generated for libace.so + +https://gitee.com/openharmony-sig/arkcompiler_ets_frontend/blob/master/arkoala-arkts/arkui/src/generated/ArkSwiperControllerMaterialized.ts + +### Manually create the Modifiers where needed + +See here for the generated modifiers: + +https://gitee.com/openharmony/arkui_ace_engine/blob/OpenHarmony_ArkUI_Upstream_2024/frameworks/core/interfaces/arkoala/implementation/ + +For example + +https://gitee.com/openharmony/arkui_ace_engine/blob/OpenHarmony_ArkUI_Upstream_2024/frameworks/core/interfaces/arkoala/implementation/button_modifier.cpp + +### Compile everything native to a shared object + +Compile and link the natives to .so + +## Run and verify + +Ensure the user sts code can access the library and get reasonable results + -- Gitee