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 0000000000000000000000000000000000000000..f731446089c0d207470d425ac256a6511cdc4c0a --- /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 +