Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
TestToolChainDemo
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
dsq
TestToolChainDemo
Commits
68e471e9
Commit
68e471e9
authored
May 04, 2026
by
dsq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
适配0.2.0
parent
0954dbef
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
143 additions
and
299 deletions
+143
-299
build.gradle.kts
composeApp/build.gradle.kts
+17
-16
MainArkUIViewController.kt
...64Main/kotlin/com.dong.demo013/MainArkUIViewController.kt
+2
-2
TestLog.ohosArm64.kt
...hosArm64Main/kotlin/com.dong.demo013/TestLog.ohosArm64.kt
+1
-1
raw_file.h
composeApp/src/ohosX64Main/cinterop/include/raw_file.h
+0
-23
raw_file_manager.h
...seApp/src/ohosX64Main/cinterop/include/raw_file_manager.h
+0
-26
resource.def
composeApp/src/ohosX64Main/cinterop/resource.def
+0
-2
MainArkUIViewController.kt
...64Main/kotlin/com.dong/demo013/MainArkUIViewController.kt
+1
-2
TestLog.ohosX64.kt
...rc/ohosX64Main/kotlin/com.dong/demo013/TestLog.ohosX64.kt
+1
-2
libs.versions.toml
gradle/libs.versions.toml
+5
-10
gradle-wrapper.properties
gradle/wrapper/gradle-wrapper.properties
+1
-1
gradlew.bat
gradlew.bat
+94
-94
compose.har
harmonyApp/entry/libs/compose.har
+0
-0
oh-package-lock.json5
harmonyApp/entry/oh-package-lock.json5
+6
-6
libkn_api.h
harmonyApp/entry/src/main/cpp/include/libkn_api.h
+12
-15
napi_init.cpp
harmonyApp/entry/src/main/cpp/napi_init.cpp
+0
-75
settings.gradle.kts
settings.gradle.kts
+3
-24
No files found.
composeApp/build.gradle.kts
View file @
68e471e9
...
@@ -53,10 +53,10 @@ kotlin {
...
@@ -53,10 +53,10 @@ kotlin {
main
.
compilerOptions
.
configure
{
main
.
compilerOptions
.
configure
{
freeCompilerArgs
.
add
(
"-Xbinary=sanitizer=address"
)
freeCompilerArgs
.
add
(
"-Xbinary=sanitizer=address"
)
}
}
//
val resource by main.cinterops.creating {
val
resource
by
main
.
cinterops
.
creating
{
//
defFile(file("src/ohosArm64Main/cinterop/resource.def"))
defFile
(
file
(
"src/ohosArm64Main/cinterop/resource.def"
))
//
includeDirs(file("src/ohosArm64Main/cinterop/include"))
includeDirs
(
file
(
"src/ohosArm64Main/cinterop/include"
))
//
}
}
}
}
ohosX64
{
ohosX64
{
...
@@ -71,10 +71,10 @@ kotlin {
...
@@ -71,10 +71,10 @@ kotlin {
main
.
compilerOptions
.
configure
{
main
.
compilerOptions
.
configure
{
freeCompilerArgs
.
add
(
"-Xbinary=sanitizer=address"
)
freeCompilerArgs
.
add
(
"-Xbinary=sanitizer=address"
)
}
}
//
val resource by main.cinterops.creating {
val
resource
by
main
.
cinterops
.
creating
{
//
defFile(file("src/ohosX64Main/cinterop/resource.def"))
defFile
(
file
(
"src/ohosX64Main/cinterop/resource.def"
))
//
includeDirs(file("src/ohosX64Main/cinterop/include"))
includeDirs
(
file
(
"src/ohosX64Main/cinterop/include"
))
//
}
}
}
}
sourceSets
{
sourceSets
{
...
@@ -83,7 +83,7 @@ kotlin {
...
@@ -83,7 +83,7 @@ kotlin {
implementation
(
libs
.
androidx
.
lifecycle
.
viewmodelCompose
)
implementation
(
libs
.
androidx
.
lifecycle
.
viewmodelCompose
)
implementation
(
libs
.
androidx
.
lifecycle
.
runtimeCompose
)
implementation
(
libs
.
androidx
.
lifecycle
.
runtimeCompose
)
implementation
(
libs
.
androidx
.
collection
)
implementation
(
libs
.
androidx
.
collection
)
implementation
(
libs
.
compose
.
ui
.
backhandler
)
//需要单独依赖
//
implementation(libs.compose.ui.backhandler) //需要单独依赖
}
}
commonMain
.
dependencies
{
commonMain
.
dependencies
{
implementation
(
compose
.
runtime
)
implementation
(
compose
.
runtime
)
...
@@ -96,7 +96,7 @@ kotlin {
...
@@ -96,7 +96,7 @@ kotlin {
implementation
(
libs
.
kotlinx
.
coroutines
.
core
)
implementation
(
libs
.
kotlinx
.
coroutines
.
core
)
implementation
(
libs
.
atomicFu
)
implementation
(
libs
.
atomicFu
)
// Navigation 库测试 Demo:使用 Maven 依赖(版本见 libs.versions.toml 的 androidx-navigation)
// Navigation 库测试 Demo:使用 Maven 依赖(版本见 libs.versions.toml 的 androidx-navigation)
implementation
(
libs
.
compose
.
navigation
)
//
implementation(libs.compose.navigation)
}
}
val
iosMain
by
creating
{
val
iosMain
by
creating
{
dependencies
{
dependencies
{
...
@@ -110,14 +110,14 @@ kotlin {
...
@@ -110,14 +110,14 @@ kotlin {
dependencies
{
dependencies
{
api
(
libs
.
compose
.
multiplatform
.
export
)
api
(
libs
.
compose
.
multiplatform
.
export
)
//导出skiko api 用于demo中测试
//导出skiko api 用于demo中测试
implementation
(
"org.jetbrains.skiko:skiko-ohosarm64"
)
//
implementation("org.jetbrains.skiko:skiko-ohosarm64")
}
}
}
}
val
ohosX64Main
by
getting
{
val
ohosX64Main
by
getting
{
dependencies
{
dependencies
{
api
(
libs
.
compose
.
multiplatform
.
export
)
api
(
libs
.
compose
.
multiplatform
.
export
)
implementation
(
"org.jetbrains.skiko:skiko-ohosx64"
)
//
implementation("org.jetbrains.skiko:skiko-ohosx64")
}
}
}
}
}
}
...
@@ -154,10 +154,11 @@ dependencies {
...
@@ -154,10 +154,11 @@ dependencies {
debugImplementation
(
libs
.
compose
.
ui
.
tooling
)
debugImplementation
(
libs
.
compose
.
ui
.
tooling
)
}
}
compose
{
// OHOS 渲染模式二选一:自渲染(Skia)或统一渲染(ohrender)。切换时只保留其一,另一行注释掉。
ohos
{
compose
{
skia
(
"0.9.22.2-OH.0.1.2-06"
)
// 启用自渲染
ohos
{
// ohrender(" 0.9.22.2-ohrende") //启用统一渲染
skia
(
"0.9.22.2-0.1.1"
)
// 自渲染:Compose 用 Skia 自绘
// ohrender("0.9.22.2-0.1.0") // 统一渲染:与 ArkUI 统一渲染管线;启用时注释上一行
}
}
}
}
...
...
composeApp/src/ohosArm64Main/kotlin/com.dong.demo013/MainArkUIViewController.kt
View file @
68e471e9
...
@@ -5,10 +5,10 @@ import com.dong.demo013.debug.DebugAllTypesData
...
@@ -5,10 +5,10 @@ import com.dong.demo013.debug.DebugAllTypesData
import
com.dong.demo013.debug.allBreakpoints
import
com.dong.demo013.debug.allBreakpoints
import
kotlinx.cinterop.ExperimentalForeignApi
import
kotlinx.cinterop.ExperimentalForeignApi
import
kotlinx.coroutines.initMainHandler
import
kotlinx.coroutines.initMainHandler
import
platform.ohos.napi_env
import
platform.ArkTS.ArkTS_Napi_NativeModule.*
import
platform.ohos.napi_value
import
kotlin.experimental.ExperimentalNativeApi
import
kotlin.experimental.ExperimentalNativeApi
@OptIn
(
ExperimentalNativeApi
::
class
,
ExperimentalForeignApi
::
class
)
@OptIn
(
ExperimentalNativeApi
::
class
,
ExperimentalForeignApi
::
class
)
@CName
(
"MainArkUIViewController"
)
@CName
(
"MainArkUIViewController"
)
fun
MainArkUIViewController
(
env
:
napi_env
):
napi_value
{
fun
MainArkUIViewController
(
env
:
napi_env
):
napi_value
{
...
...
composeApp/src/ohosArm64Main/kotlin/com.dong.demo013/TestLog.ohosArm64.kt
View file @
68e471e9
package
com.dong.demo013
package
com.dong.demo013
import
kotlinx.cinterop.ExperimentalForeignApi
import
kotlinx.cinterop.ExperimentalForeignApi
import
platform.
ohos
.OH_LOG_Print
import
platform.
PerformanceAnalysisKit.HiLog
.OH_LOG_Print
import
kotlin.experimental.ExperimentalNativeApi
import
kotlin.experimental.ExperimentalNativeApi
@OptIn
(
kotlinx
.
cinterop
.
ExperimentalForeignApi
::
class
,
kotlin
.
experimental
.
ExperimentalNativeApi
::
class
)
@OptIn
(
kotlinx
.
cinterop
.
ExperimentalForeignApi
::
class
,
kotlin
.
experimental
.
ExperimentalNativeApi
::
class
)
...
...
composeApp/src/ohosX64Main/cinterop/include/raw_file.h
View file @
68e471e9
#ifndef GLOBAL_RAW_FILE_H
#define GLOBAL_RAW_FILE_H
#ifdef __cplusplus
extern
"C"
{
#endif
struct
RawFile
;
typedef
struct
RawFile
RawFile
;
int
OH_ResourceManager_ReadRawFile
(
const
RawFile
*
rawFile
,
void
*
buf
,
size_t
length
);
long
OH_ResourceManager_GetRawFileSize
(
RawFile
*
rawFile
);
void
OH_ResourceManager_CloseRawFile
(
RawFile
*
rawFile
);
#ifdef __cplusplus
};
#endif
/** @} */
#endif // GLOBAL_RAW_FILE_H
composeApp/src/ohosX64Main/cinterop/include/raw_file_manager.h
View file @
68e471e9
#ifndef GLOBAL_NATIVE_RESOURCE_MANAGER_H
#define GLOBAL_NATIVE_RESOURCE_MANAGER_H
#include "napi/native_api.h"
#include "raw_file.h"
#ifdef __cplusplus
extern
"C"
{
#endif
struct
NativeResourceManager
;
typedef
struct
NativeResourceManager
NativeResourceManager
;
NativeResourceManager
*
OH_ResourceManager_InitNativeResourceManager
(
napi_env
env
,
napi_value
jsResMgr
);
void
OH_ResourceManager_ReleaseNativeResourceManager
(
NativeResourceManager
*
resMgr
);
RawFile
*
OH_ResourceManager_OpenRawFile
(
const
NativeResourceManager
*
mgr
,
const
char
*
fileName
);
#ifdef __cplusplus
};
#endif
/** @} */
#endif // GLOBAL_NATIVE_RESOURCE_MANAGER_H
composeApp/src/ohosX64Main/cinterop/resource.def
View file @
68e471e9
package
=
platform
.
resource
headers
=
raw_file_manager
.
h
raw_file
.
h
\ No newline at end of file
composeApp/src/ohosX64Main/kotlin/com.dong/demo013/MainArkUIViewController.kt
View file @
68e471e9
...
@@ -4,8 +4,7 @@ import androidx.compose.ui.window.ComposeArkUIViewController
...
@@ -4,8 +4,7 @@ import androidx.compose.ui.window.ComposeArkUIViewController
import
com.dong.demo013.debug.allBreakpoints
import
com.dong.demo013.debug.allBreakpoints
import
kotlinx.cinterop.ExperimentalForeignApi
import
kotlinx.cinterop.ExperimentalForeignApi
import
kotlinx.coroutines.initMainHandler
import
kotlinx.coroutines.initMainHandler
import
platform.ohos.napi_env
import
platform.ArkTS.ArkTS_Napi_NativeModule.*
import
platform.ohos.napi_value
import
kotlin.experimental.ExperimentalNativeApi
import
kotlin.experimental.ExperimentalNativeApi
@OptIn
(
ExperimentalNativeApi
::
class
,
ExperimentalForeignApi
::
class
)
@OptIn
(
ExperimentalNativeApi
::
class
,
ExperimentalForeignApi
::
class
)
...
...
composeApp/src/ohosX64Main/kotlin/com.dong/demo013/TestLog.ohosX64.kt
View file @
68e471e9
package
com.dong.demo013
package
com.dong.demo013
import
kotlinx.cinterop.ExperimentalForeignApi
import
kotlinx.cinterop.ExperimentalForeignApi
import
platform.ohos.OH_LOG_Print
import
platform.PerformanceAnalysisKit.HiLog.OH_LOG_Print
import
platform.posix.usleep
import
kotlin.experimental.ExperimentalNativeApi
import
kotlin.experimental.ExperimentalNativeApi
@OptIn
(
kotlinx
.
cinterop
.
ExperimentalForeignApi
::
class
,
kotlin
.
experimental
.
ExperimentalNativeApi
::
class
)
@OptIn
(
kotlinx
.
cinterop
.
ExperimentalForeignApi
::
class
,
kotlin
.
experimental
.
ExperimentalNativeApi
::
class
)
...
...
gradle/libs.versions.toml
View file @
68e471e9
[versions]
[versions]
# Build & Android
# Build & Android
agp
=
"8.
2.2
"
agp
=
"8.
6.0
"
android-compileSdk
=
"36"
android-compileSdk
=
"36"
android-minSdk
=
"24"
android-minSdk
=
"24"
android-targetSdk
=
"36"
android-targetSdk
=
"36"
...
@@ -19,15 +19,13 @@ androidx-testExt = "1.3.0"
...
@@ -19,15 +19,13 @@ androidx-testExt = "1.3.0"
# Compose
# Compose
compose
=
"1.9.4"
compose
=
"1.9.4"
compose-material3
=
"1.4.0"
compose-material3
=
"1.4.0"
composeMultiplatform
=
"1.9.2-OH.0.1.2-14"
composeMultiplatform
=
"1.9.2-0.2.0-03"
compose-navigation
=
"2.9.4-OH.0.1.2-14"
compose-ui-backhandler
=
"1.9.2-OH.0.1.2-14"
# Kotlin & testing
# Kotlin & testing
junit
=
"4.13.2"
junit
=
"4.13.2"
kotlin
=
"2.2.21-
OH.0.1.0-02
"
kotlin
=
"2.2.21-
0.2.0-09
"
kotlinx-coroutines
=
"1.10.2-
OH-103
"
kotlinx-coroutines
=
"1.10.2-
0.2.0-01
"
atomicFu
=
"0.31.0-
OH-001
"
atomicFu
=
"0.31.0-
0.2.0-02
"
[libraries]
[libraries]
# ----- Testing -----
# ----- Testing -----
...
@@ -65,9 +63,6 @@ compose-runtime = { module = "androidx.compose.runtime:runtime", version.ref = "
...
@@ -65,9 +63,6 @@ compose-runtime = { module = "androidx.compose.runtime:runtime", version.ref = "
compose-foundation
=
{
module
=
"androidx.compose.foundation:foundation"
,
version.ref
=
"compose"
}
compose-foundation
=
{
module
=
"androidx.compose.foundation:foundation"
,
version.ref
=
"compose"
}
compose-material
=
{
module
=
"androidx.compose.material:material"
,
version.ref
=
"compose"
}
compose-material
=
{
module
=
"androidx.compose.material:material"
,
version.ref
=
"compose"
}
compose-material3
=
{
module
=
"androidx.compose.material:material3"
,
version.ref
=
"compose-material3"
}
compose-material3
=
{
module
=
"androidx.compose.material:material3"
,
version.ref
=
"compose-material3"
}
# Navigation(Maven 依赖,用于「Navigation 库测试」Demo;版本请与已发布的 navigation-compose 一致)
compose-navigation
=
{
module
=
"org.jetbrains.androidx.navigation:navigation-compose"
,
version.ref
=
"compose-navigation"
}
compose-ui-backhandler
=
{
module
=
"org.jetbrains.compose.ui:ui-backhandler"
,
version.ref
=
"compose-ui-backhandler"
}
[plugins]
[plugins]
# Android
# Android
...
...
gradle/wrapper/gradle-wrapper.properties
View file @
68e471e9
distributionBase
=
GRADLE_USER_HOME
distributionBase
=
GRADLE_USER_HOME
distributionPath
=
wrapper/dists
distributionPath
=
wrapper/dists
distributionUrl
=
https
\:
//
services.gradle.org/distributions/gradle-8.14.3
-bin.zip
distributionUrl
=
https
\:
//
mirrors.tencent.com/gradle/gradle-8.9
-bin.zip
networkTimeout
=
10000
networkTimeout
=
10000
validateDistributionUrl
=
true
validateDistributionUrl
=
true
zipStoreBase
=
GRADLE_USER_HOME
zipStoreBase
=
GRADLE_USER_HOME
...
...
gradlew.bat
View file @
68e471e9
@rem
@rem
@rem Copyright 2015 the original author or authors.
@rem Copyright 2015 the original author or authors.
@rem
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem You may obtain a copy of the License at
@rem
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem limitations under the License.
@rem
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem SPDX-License-Identifier: Apache-2.0
@rem
@rem
@if "%DEBUG%"=="" @echo off
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem ##########################################################################
@rem
@rem
@rem Gradle startup script for Windows
@rem Gradle startup script for Windows
@rem
@rem
@rem ##########################################################################
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
if %ERRORLEVEL% equ 0 goto execute
echo. 1>&2
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
echo location of your Java installation. 1>&2
goto fail
goto fail
:findJavaFromJavaHome
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
if exist "%JAVA_EXE%" goto execute
echo. 1>&2
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
echo location of your Java installation. 1>&2
goto fail
goto fail
:execute
:execute
@rem Setup the command line
@rem Setup the command line
set CLASSPATH=
set CLASSPATH=
@rem Execute Gradle
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
:end
:end
@rem End local scope for the variables with windows NT shell
@rem End local scope for the variables with windows NT shell
if %ERRORLEVEL% equ 0 goto mainEnd
if %ERRORLEVEL% equ 0 goto mainEnd
:fail
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
rem the _cmd.exe /c_ return code!
set EXIT_CODE=%ERRORLEVEL%
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
:mainEnd
if "%OS%"=="Windows_NT" endlocal
if "%OS%"=="Windows_NT" endlocal
:omega
:omega
harmonyApp/entry/libs/compose.har
View file @
68e471e9
No preview for this file type
harmonyApp/entry/oh-package-lock.json5
View file @
68e471e9
...
@@ -7,9 +7,9 @@
...
@@ -7,9 +7,9 @@
"ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
"ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
"specifiers": {
"specifiers": {
"compose@libs/compose.har": "compose@libs/compose.har",
"compose@libs/compose.har": "compose@libs/compose.har",
"libcompose_arkui_utils.so@../oh_modules/.ohpm/compose@
ma2je3shc8wd1ay4sclgu8prv+0pyungmargnuaabae=/oh_modules/compose/src/main/cpp/types/libcompose_arkui_utils": "libcompose_arkui_utils.so@../oh_modules/.ohpm/compose@ma2je3shc8wd1ay4sclgu8prv+0pyungmargnuaabae
=/oh_modules/compose/src/main/cpp/types/libcompose_arkui_utils",
"libcompose_arkui_utils.so@../oh_modules/.ohpm/compose@
zyix+yj1mhkoan3lc4sdfsulqfawiqohijc9ejvuxzw=/oh_modules/compose/src/main/cpp/types/libcompose_arkui_utils": "libcompose_arkui_utils.so@../oh_modules/.ohpm/compose@zyix+yj1mhkoan3lc4sdfsulqfawiqohijc9ejvuxzw
=/oh_modules/compose/src/main/cpp/types/libcompose_arkui_utils",
"libentry.so@src/main/cpp/types/libentry": "libentry.so@src/main/cpp/types/libentry",
"libentry.so@src/main/cpp/types/libentry": "libentry.so@src/main/cpp/types/libentry",
"libskikobridge.so@../oh_modules/.ohpm/compose@
ma2je3shc8wd1ay4sclgu8prv+0pyungmargnuaabae=/oh_modules/compose/src/main/cpp/types/libskikobridge": "libskikobridge.so@../oh_modules/.ohpm/compose@ma2je3shc8wd1ay4sclgu8prv+0pyungmargnuaabae
=/oh_modules/compose/src/main/cpp/types/libskikobridge"
"libskikobridge.so@../oh_modules/.ohpm/compose@
zyix+yj1mhkoan3lc4sdfsulqfawiqohijc9ejvuxzw=/oh_modules/compose/src/main/cpp/types/libskikobridge": "libskikobridge.so@../oh_modules/.ohpm/compose@zyix+yj1mhkoan3lc4sdfsulqfawiqohijc9ejvuxzw
=/oh_modules/compose/src/main/cpp/types/libskikobridge"
},
},
"packages": {
"packages": {
"compose@libs/compose.har": {
"compose@libs/compose.har": {
...
@@ -22,10 +22,10 @@
...
@@ -22,10 +22,10 @@
"libskikobridge.so": "file:./src/main/cpp/types/libskikobridge"
"libskikobridge.so": "file:./src/main/cpp/types/libskikobridge"
}
}
},
},
"libcompose_arkui_utils.so@../oh_modules/.ohpm/compose@
ma2je3shc8wd1ay4sclgu8prv+0pyungmargnuaabae
=/oh_modules/compose/src/main/cpp/types/libcompose_arkui_utils": {
"libcompose_arkui_utils.so@../oh_modules/.ohpm/compose@
zyix+yj1mhkoan3lc4sdfsulqfawiqohijc9ejvuxzw
=/oh_modules/compose/src/main/cpp/types/libcompose_arkui_utils": {
"name": "libcompose_arkui_utils.so",
"name": "libcompose_arkui_utils.so",
"version": "1.0.0",
"version": "1.0.0",
"resolved": "../oh_modules/.ohpm/compose@
ma2je3shc8wd1ay4sclgu8prv+0pyungmargnuaabae
=/oh_modules/compose/src/main/cpp/types/libcompose_arkui_utils",
"resolved": "../oh_modules/.ohpm/compose@
zyix+yj1mhkoan3lc4sdfsulqfawiqohijc9ejvuxzw
=/oh_modules/compose/src/main/cpp/types/libcompose_arkui_utils",
"registryType": "local"
"registryType": "local"
},
},
"libentry.so@src/main/cpp/types/libentry": {
"libentry.so@src/main/cpp/types/libentry": {
...
@@ -34,10 +34,10 @@
...
@@ -34,10 +34,10 @@
"resolved": "src/main/cpp/types/libentry",
"resolved": "src/main/cpp/types/libentry",
"registryType": "local"
"registryType": "local"
},
},
"libskikobridge.so@../oh_modules/.ohpm/compose@
ma2je3shc8wd1ay4sclgu8prv+0pyungmargnuaabae
=/oh_modules/compose/src/main/cpp/types/libskikobridge": {
"libskikobridge.so@../oh_modules/.ohpm/compose@
zyix+yj1mhkoan3lc4sdfsulqfawiqohijc9ejvuxzw
=/oh_modules/compose/src/main/cpp/types/libskikobridge": {
"name": "libskikobridge.so",
"name": "libskikobridge.so",
"version": "0.0.0",
"version": "0.0.0",
"resolved": "../oh_modules/.ohpm/compose@
ma2je3shc8wd1ay4sclgu8prv+0pyungmargnuaabae
=/oh_modules/compose/src/main/cpp/types/libskikobridge",
"resolved": "../oh_modules/.ohpm/compose@
zyix+yj1mhkoan3lc4sdfsulqfawiqohijc9ejvuxzw
=/oh_modules/compose/src/main/cpp/types/libskikobridge",
"registryType": "local"
"registryType": "local"
}
}
}
}
...
...
harmonyApp/entry/src/main/cpp/include/libkn_api.h
View file @
68e471e9
...
@@ -194,20 +194,25 @@ extern void* MainArkUIViewController(void* env);
...
@@ -194,20 +194,25 @@ extern void* MainArkUIViewController(void* env);
extern
libkn_KInt
hiLogPrintMsg
(
libkn_KUInt
type
,
libkn_KUInt
level
,
libkn_KUInt
domain
,
const
char
*
tag
,
const
char
*
message
);
extern
libkn_KInt
hiLogPrintMsg
(
libkn_KUInt
type
,
libkn_KUInt
level
,
libkn_KUInt
domain
,
const
char
*
tag
,
const
char
*
message
);
extern
void
testArkTsToKotin
();
extern
void
testArkTsToKotin
();
extern
libkn_KInt
kn_get_render_backend_id
();
extern
libkn_KInt
kn_get_render_backend_id
();
extern
void
InitJsRenderNodeContext
(
void
*
env
,
void
*
nodeConstructor
,
void
*
statusModifyConstructor
,
libkn_KDouble
ratio
,
libkn_KBoolean
fixed
);
extern
void
androidx_compose_ui_arkui_ArkUIViewController_aboutToAppear
(
void
*
controllerRef
);
extern
void
androidx_compose_ui_arkui_ArkUIViewController_aboutToAppear
(
void
*
controllerRef
);
extern
void
androidx_compose_ui_arkui_ArkUIViewController_aboutToDisappear
(
void
*
controllerRef
);
extern
void
androidx_compose_ui_arkui_ArkUIViewController_aboutToDisappear
(
void
*
controllerRef
);
extern
void
androidx_compose_ui_arkui_ArkUIViewController_cancelSyncRefresh
(
void
*
controllerRef
,
libkn_KInt
refreshId
);
extern
void
androidx_compose_ui_arkui_ArkUIViewController_cancelSyncRefresh
(
void
*
controllerRef
,
libkn_KInt
refreshId
);
extern
void
androidx_compose_ui_arkui_ArkUIViewController_dispatchHoverEvent
(
void
*
controllerRef
);
extern
void
androidx_compose_ui_arkui_ArkUIViewController_dispatchHoverEvent
(
void
*
controllerRef
);
extern
void
androidx_compose_ui_arkui_ArkUIViewController_dispatchMouseEvent
(
void
*
controllerRef
);
extern
void
androidx_compose_ui_arkui_ArkUIViewController_dispatchMouseEvent
(
void
*
controllerRef
);
extern
libkn_KBoolean
androidx_compose_ui_arkui_ArkUIViewController_dispatchTouchEvent
(
void
*
controllerRef
,
void
*
nativeTouchEvent
,
libkn_KBoolean
ignoreInteropView
);
extern
libkn_KBoolean
androidx_compose_ui_arkui_ArkUIViewController_dispatchTouchEvent
(
void
*
controllerRef
,
void
*
nativeTouchEvent
,
libkn_KBoolean
ignoreInteropView
);
extern
void
AndroidxComposeUiArkuiArkUiViewControllerDraw
(
void
*
controllerRef
,
void
*
canvas
);
extern
const
char
*
androidx_compose_ui_arkui_ArkUIViewController_getId
(
void
*
controllerRef
);
extern
const
char
*
androidx_compose_ui_arkui_ArkUIViewController_getId
(
void
*
controllerRef
);
extern
void
*
AndroidxComposeUiArkuiArkUiViewControllerGetJsNode
(
void
*
controllerRef
);
extern
void
*
androidx_compose_ui_arkui_ArkUIViewController_getXComponentRender
(
void
*
controllerRef
);
extern
void
*
androidx_compose_ui_arkui_ArkUIViewController_getXComponentRender
(
void
*
controllerRef
);
extern
void
androidx_compose_ui_arkui_ArkUIViewController_initFusionRendererNode
(
void
*
controllerRef
,
libkn_KBoolean
enableCApi
,
void
*
rootContent
,
void
*
frameMgr
);
extern
void
androidx_compose_ui_arkui_ArkUIViewController_keyboardWillHide
(
void
*
controllerRef
);
extern
void
androidx_compose_ui_arkui_ArkUIViewController_keyboardWillHide
(
void
*
controllerRef
);
extern
void
androidx_compose_ui_arkui_ArkUIViewController_keyboardWillShow
(
void
*
controllerRef
,
libkn_KFloat
keyboardHeight
);
extern
void
androidx_compose_ui_arkui_ArkUIViewController_keyboardWillShow
(
void
*
controllerRef
,
libkn_KFloat
keyboardHeight
);
extern
libkn_KBoolean
androidx_compose_ui_arkui_ArkUIViewController_onBackPress
(
void
*
controllerRef
);
extern
libkn_KBoolean
androidx_compose_ui_arkui_ArkUIViewController_onBackPress
(
void
*
controllerRef
);
extern
void
androidx_compose_ui_arkui_ArkUIViewController_onFinalize
(
void
*
controllerRef
);
extern
void
androidx_compose_ui_arkui_ArkUIViewController_onFinalize
(
void
*
controllerRef
);
extern
void
androidx_compose_ui_arkui_ArkUIViewController_onFocusEvent
(
void
*
controllerRef
);
extern
void
androidx_compose_ui_arkui_ArkUIViewController_onFocusEvent
(
void
*
controllerRef
);
extern
void
androidx_compose_ui_arkui_ArkUIViewController_onFrame
(
void
*
controllerRef
,
libkn_KLong
timestamp
,
libkn_KLong
targetTimestamp
);
extern
void
androidx_compose_ui_arkui_ArkUIViewController_onFrame
(
void
*
controllerRef
,
libkn_KLong
timestamp
,
libkn_KLong
targetTimestamp
);
extern
void
AndroidXComposeUIArkUIArkUIViewControllerOnIdle
(
void
*
controllerRef
,
libkn_KLong
timeLeft
);
extern
void
androidx_compose_ui_arkui_ArkUIViewController_onKeyEvent
(
void
*
controllerRef
);
extern
void
androidx_compose_ui_arkui_ArkUIViewController_onKeyEvent
(
void
*
controllerRef
);
extern
void
androidx_compose_ui_arkui_ArkUIViewController_onPageHide
(
void
*
controllerRef
);
extern
void
androidx_compose_ui_arkui_ArkUIViewController_onPageHide
(
void
*
controllerRef
);
extern
void
androidx_compose_ui_arkui_ArkUIViewController_onPageShow
(
void
*
controllerRef
);
extern
void
androidx_compose_ui_arkui_ArkUIViewController_onPageShow
(
void
*
controllerRef
);
...
@@ -223,16 +228,10 @@ extern void androidx_compose_ui_arkui_ArkUIViewController_setEnv(void* controlle
...
@@ -223,16 +228,10 @@ extern void androidx_compose_ui_arkui_ArkUIViewController_setEnv(void* controlle
extern
void
androidx_compose_ui_arkui_ArkUIViewController_setId
(
void
*
controllerRef
,
const
char
*
id
);
extern
void
androidx_compose_ui_arkui_ArkUIViewController_setId
(
void
*
controllerRef
,
const
char
*
id
);
extern
void
androidx_compose_ui_arkui_ArkUIViewController_setLocaleAndStringProvider
(
void
*
controllerRef
,
void
*
provider
);
extern
void
androidx_compose_ui_arkui_ArkUIViewController_setLocaleAndStringProvider
(
void
*
controllerRef
,
void
*
provider
);
extern
void
androidx_compose_ui_arkui_ArkUIViewController_setMessenger
(
void
*
controllerRef
,
void
*
messenger
);
extern
void
androidx_compose_ui_arkui_ArkUIViewController_setMessenger
(
void
*
controllerRef
,
void
*
messenger
);
extern
void
androidx_compose_ui_arkui_ArkUIViewController_setRenderBackendId
(
void
*
controllerRef
,
libkn_KInt
backendId
);
extern
void
androidx_compose_ui_arkui_ArkUIViewController_setRender
er
BackendId
(
void
*
controllerRef
,
libkn_KInt
backendId
);
extern
void
androidx_compose_ui_arkui_ArkUIViewController_setRootView
(
void
*
controllerRef
,
void
*
backRootView
,
void
*
foreRootView
,
void
*
touchableRootView
);
extern
void
androidx_compose_ui_arkui_ArkUIViewController_setRootView
(
void
*
controllerRef
,
void
*
backRootView
,
void
*
foreRootView
,
void
*
touchableRootView
);
extern
void
androidx_compose_ui_arkui_ArkUIViewController_setUIContext
(
void
*
controllerRef
,
void
*
uiContext
);
extern
void
androidx_compose_ui_arkui_ArkUIViewController_setUIContext
(
void
*
controllerRef
,
void
*
uiContext
);
extern
void
androidx_compose_ui_arkui_ArkUIViewController_setXComponentRender
(
void
*
controllerRef
,
void
*
render
);
extern
void
androidx_compose_ui_arkui_ArkUIViewController_setXComponentRender
(
void
*
controllerRef
,
void
*
render
);
extern
void
buildInstance
(
void
*
env
,
void
*
func
);
extern
void
*
createRootRenderNode
();
extern
void
renderNodeDraw
(
void
*
env
,
void
*
jsCanvas
,
void
*
jsNode
);
extern
void
renderNodeNotifyRedraw
(
void
*
env
,
void
*
jsNode
);
extern
void
setNodeConstructor
(
void
*
env
,
void
*
func
);
extern
void
setPixelRatio
(
libkn_KDouble
ratio
);
extern
void
androidx_compose_ui_arkui_init
(
void
*
env
,
void
*
exports
);
extern
void
androidx_compose_ui_arkui_init
(
void
*
env
,
void
*
exports
);
typedef
struct
{
typedef
struct
{
...
@@ -1104,21 +1103,25 @@ typedef struct {
...
@@ -1104,21 +1103,25 @@ typedef struct {
struct
{
struct
{
struct
{
struct
{
struct
{
struct
{
void
*
(
*
get_NodeDrawCallback
)(
);
void
(
*
InitJsRenderNodeContext_
)(
void
*
env
,
void
*
nodeConstructor
,
void
*
statusModifyConstructor
,
libkn_KDouble
ratio
,
libkn_KBoolean
fixed
);
void
(
*
_Export_ArkUIViewController_aboutToAppear
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_aboutToAppear
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_aboutToDisappear
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_aboutToDisappear
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_cancelSyncRefresh
)(
void
*
controllerRef
,
libkn_KInt
refreshId
);
void
(
*
_Export_ArkUIViewController_cancelSyncRefresh
)(
void
*
controllerRef
,
libkn_KInt
refreshId
);
void
(
*
_Export_ArkUIViewController_dispatchHoverEvent
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_dispatchHoverEvent
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_dispatchMouseEvent
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_dispatchMouseEvent
)(
void
*
controllerRef
);
libkn_KBoolean
(
*
_Export_ArkUIViewController_dispatchTouchEvent
)(
void
*
controllerRef
,
void
*
nativeTouchEvent
,
libkn_KBoolean
ignoreInteropView
);
libkn_KBoolean
(
*
_Export_ArkUIViewController_dispatchTouchEvent
)(
void
*
controllerRef
,
void
*
nativeTouchEvent
,
libkn_KBoolean
ignoreInteropView
);
void
(
*
_Export_ArkUIViewController_draw
)(
void
*
controllerRef
,
void
*
canvas
);
const
char
*
(
*
_Export_ArkUIViewController_getId
)(
void
*
controllerRef
);
const
char
*
(
*
_Export_ArkUIViewController_getId
)(
void
*
controllerRef
);
void
*
(
*
_Export_ArkUIViewController_getJsNode
)(
void
*
controllerRef
);
void
*
(
*
_Export_ArkUIViewController_getXComponentRender
)(
void
*
controllerRef
);
void
*
(
*
_Export_ArkUIViewController_getXComponentRender
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_initFusionRendererNode
)(
void
*
controllerRef
,
libkn_KBoolean
enableCApi
,
void
*
rootContent
,
void
*
frameMgr
);
void
(
*
_Export_ArkUIViewController_keyboardWillHide
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_keyboardWillHide
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_keyboardWillShow
)(
void
*
controllerRef
,
libkn_KFloat
keyboardHeight
);
void
(
*
_Export_ArkUIViewController_keyboardWillShow
)(
void
*
controllerRef
,
libkn_KFloat
keyboardHeight
);
libkn_KBoolean
(
*
_Export_ArkUIViewController_onBackPress
)(
void
*
controllerRef
);
libkn_KBoolean
(
*
_Export_ArkUIViewController_onBackPress
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_onFinalize
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_onFinalize
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_onFocusEvent
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_onFocusEvent
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_onFrame
)(
void
*
controllerRef
,
libkn_KLong
timestamp
,
libkn_KLong
targetTimestamp
);
void
(
*
_Export_ArkUIViewController_onFrame
)(
void
*
controllerRef
,
libkn_KLong
timestamp
,
libkn_KLong
targetTimestamp
);
void
(
*
_Export_ArkUIViewController_onIdle
)(
void
*
controllerRef
,
libkn_KLong
timeLeft
);
void
(
*
_Export_ArkUIViewController_onKeyEvent
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_onKeyEvent
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_onPageHide
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_onPageHide
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_onPageShow
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_onPageShow
)(
void
*
controllerRef
);
...
@@ -1134,17 +1137,11 @@ typedef struct {
...
@@ -1134,17 +1137,11 @@ typedef struct {
void
(
*
_Export_ArkUIViewController_setId
)(
void
*
controllerRef
,
const
char
*
id
);
void
(
*
_Export_ArkUIViewController_setId
)(
void
*
controllerRef
,
const
char
*
id
);
void
(
*
_Export_ArkUIViewController_setLocaleAndStringProvider
)(
void
*
controllerRef
,
void
*
provider
);
void
(
*
_Export_ArkUIViewController_setLocaleAndStringProvider
)(
void
*
controllerRef
,
void
*
provider
);
void
(
*
_Export_ArkUIViewController_setMessenger
)(
void
*
controllerRef
,
void
*
messenger
);
void
(
*
_Export_ArkUIViewController_setMessenger
)(
void
*
controllerRef
,
void
*
messenger
);
void
(
*
_Export_ArkUIViewController_setRenderBackendId
)(
void
*
controllerRef
,
libkn_KInt
backendId
);
void
(
*
_Export_ArkUIViewController_setRender
er
BackendId
)(
void
*
controllerRef
,
libkn_KInt
backendId
);
void
(
*
_Export_ArkUIViewController_setRootView
)(
void
*
controllerRef
,
void
*
backRootView
,
void
*
foreRootView
,
void
*
touchableRootView
);
void
(
*
_Export_ArkUIViewController_setRootView
)(
void
*
controllerRef
,
void
*
backRootView
,
void
*
foreRootView
,
void
*
touchableRootView
);
void
(
*
_Export_ArkUIViewController_setUIContext
)(
void
*
controllerRef
,
void
*
uiContext
);
void
(
*
_Export_ArkUIViewController_setUIContext
)(
void
*
controllerRef
,
void
*
uiContext
);
void
(
*
_Export_ArkUIViewController_setXComponentRender
)(
void
*
controllerRef
,
void
*
render
);
void
(
*
_Export_ArkUIViewController_setXComponentRender
)(
void
*
controllerRef
,
void
*
render
);
void
(
*
buildInstance_
)(
void
*
env
,
void
*
func
);
void
*
(
*
createRootRenderNode_
)();
libkn_KLong
(
*
getCurrentTimeNanos
)();
libkn_KLong
(
*
getCurrentTimeNanos
)();
void
(
*
renderNodeDraw_
)(
void
*
env
,
void
*
jsCanvas
,
void
*
jsNode
);
void
(
*
renderNodeNotifyRedraw_
)(
void
*
env
,
void
*
jsNode
);
void
(
*
setNodeConstructor_
)(
void
*
env
,
void
*
func
);
void
(
*
setPixelRatio_
)(
libkn_KDouble
ratio
);
void
(
*
_Export_ArkUIViewInitializer_init
)(
void
*
env
,
void
*
exports
);
void
(
*
_Export_ArkUIViewInitializer_init
)(
void
*
env
,
void
*
exports
);
}
arkui
;
}
arkui
;
}
ui
;
}
ui
;
...
...
harmonyApp/entry/src/main/cpp/napi_init.cpp
View file @
68e471e9
...
@@ -15,75 +15,6 @@ static napi_value MainArkUIViewController(napi_env env, napi_callback_info info)
...
@@ -15,75 +15,6 @@ static napi_value MainArkUIViewController(napi_env env, napi_callback_info info)
static
napi_value
nativeCreateRootNode
(
napi_env
env
,
napi_callback_info
info
)
{
size_t
argc
=
2
;
napi_value
argv
[
2
];
napi_get_cb_info
(
env
,
info
,
&
argc
,
argv
,
NULL
,
NULL
);
return
reinterpret_cast
<
napi_value
>
(
createRootRenderNode
());
}
static
napi_value
nativeOHRenderNodeDraw
(
napi_env
env
,
napi_callback_info
info
)
{
size_t
argc
=
2
;
napi_value
argv
[
2
];
napi_status
status
;
status
=
napi_get_cb_info
(
env
,
info
,
&
argc
,
argv
,
nullptr
,
nullptr
);
if
(
status
!=
napi_ok
||
argc
<
2
)
{
napi_throw_type_error
(
env
,
nullptr
,
"Expected canvas argument"
);
return
nullptr
;
}
renderNodeDraw
(
env
,
argv
[
0
],
argv
[
1
]);
return
nullptr
;
}
static
napi_value
nativeOHRenderNotifyRedraw
(
napi_env
env
,
napi_callback_info
info
)
{
size_t
argc
=
1
;
napi_value
argv
[
1
];
napi_status
status
;
status
=
napi_get_cb_info
(
env
,
info
,
&
argc
,
argv
,
nullptr
,
nullptr
);
if
(
status
!=
napi_ok
||
argc
<
1
)
{
napi_throw_type_error
(
env
,
nullptr
,
"Expected renderNode argument"
);
return
nullptr
;
}
renderNodeNotifyRedraw
(
env
,
argv
[
0
]);
return
nullptr
;
}
static
napi_value
nativeRegisterNodeConstructor
(
napi_env
env
,
napi_callback_info
info
)
{
size_t
argc
=
1
;
napi_value
argv
[
1
];
napi_get_cb_info
(
env
,
info
,
&
argc
,
argv
,
NULL
,
NULL
);
if
(
argc
<
1
)
{
return
nullptr
;
}
setNodeConstructor
(
env
,
argv
[
0
]);
return
nullptr
;
}
static
napi_value
nativeSetPixelRatio
(
napi_env
env
,
napi_callback_info
info
)
{
size_t
argc
=
1
;
napi_value
argv
[
1
];
napi_get_cb_info
(
env
,
info
,
&
argc
,
argv
,
NULL
,
NULL
);
double
ratio
=
1.0
;
napi_get_value_double
(
env
,
argv
[
0
],
&
ratio
);
setPixelRatio
(
ratio
);
return
nullptr
;
}
static
napi_value
nativeRegisterNodeStatusModifyConstructor
(
napi_env
env
,
napi_callback_info
info
)
{
size_t
argc
=
1
;
napi_value
argv
[
1
];
napi_get_cb_info
(
env
,
info
,
&
argc
,
argv
,
NULL
,
NULL
);
if
(
argc
<
1
)
{
return
nullptr
;
}
buildInstance
(
env
,
argv
[
0
]);
return
nullptr
;
}
static
napi_value
nativeTestArkTsToKotin
(
napi_env
env
,
napi_callback_info
info
)
{
static
napi_value
nativeTestArkTsToKotin
(
napi_env
env
,
napi_callback_info
info
)
{
testArkTsToKotin
();
testArkTsToKotin
();
...
@@ -97,12 +28,6 @@ static napi_value Init(napi_env env, napi_value exports) {
...
@@ -97,12 +28,6 @@ static napi_value Init(napi_env env, napi_value exports) {
androidx_compose_ui_arkui_init
(
env
,
exports
);
androidx_compose_ui_arkui_init
(
env
,
exports
);
napi_property_descriptor
desc
[]
=
{
napi_property_descriptor
desc
[]
=
{
{
"MainArkUIViewController"
,
nullptr
,
MainArkUIViewController
,
nullptr
,
nullptr
,
nullptr
,
napi_default
,
nullptr
},
{
"MainArkUIViewController"
,
nullptr
,
MainArkUIViewController
,
nullptr
,
nullptr
,
nullptr
,
napi_default
,
nullptr
},
{
"nativeCreateRootNode"
,
nullptr
,
nativeCreateRootNode
,
nullptr
,
nullptr
,
nullptr
,
napi_default
,
nullptr
},
{
"nativeOHRenderNodeDraw"
,
nullptr
,
nativeOHRenderNodeDraw
,
nullptr
,
nullptr
,
nullptr
,
napi_default
,
nullptr
},
{
"nativeOHRenderNotifyRedraw"
,
nullptr
,
nativeOHRenderNotifyRedraw
,
nullptr
,
nullptr
,
nullptr
,
napi_default
,
nullptr
},
{
"nativeRegisterNodeConstructor"
,
nullptr
,
nativeRegisterNodeConstructor
,
nullptr
,
nullptr
,
nullptr
,
napi_default
,
nullptr
},
{
"nativeRegisterNodeStatusModifyConstructor"
,
nullptr
,
nativeRegisterNodeStatusModifyConstructor
,
nullptr
,
nullptr
,
nullptr
,
napi_default
,
nullptr
},
{
"nativeSetPixelRatio"
,
nullptr
,
nativeSetPixelRatio
,
nullptr
,
nullptr
,
nullptr
,
napi_default
,
nullptr
},
{
"testArkTsToKotin"
,
nullptr
,
nativeTestArkTsToKotin
,
nullptr
,
nullptr
,
nullptr
,
napi_default
,
nullptr
},
{
"testArkTsToKotin"
,
nullptr
,
nativeTestArkTsToKotin
,
nullptr
,
nullptr
,
nullptr
,
napi_default
,
nullptr
},
};
};
napi_define_properties
(
env
,
exports
,
sizeof
(
desc
)
/
sizeof
(
desc
[
0
]),
desc
);
napi_define_properties
(
env
,
exports
,
sizeof
(
desc
)
/
sizeof
(
desc
[
0
]),
desc
);
...
...
settings.gradle.kts
View file @
68e471e9
rootProject
.
name
=
"TestToolChainDemo"
rootProject
.
name
=
"TestToolChainDemo"
// 启用类型安全项目访问器特性(Type-safe project accessors)
enableFeaturePreview
(
"TYPESAFE_PROJECT_ACCESSORS"
)
/**
专门管理 Gradle 插件的解析和应用:
影响 plugins {} 块中的插件解析
影响 buildscript {} 块中的插件解析
影响插件版本管理
影响插件仓库配置
只在构建脚本配置阶段生效
*/
pluginManagement
{
pluginManagement
{
repositories
{
repositories
{
// mavenLocal()
maven
(
"https://maven.eazytec-cloud.com/nexus/repository/maven-public/"
)
maven
(
"https://maven.eazytec-cloud.com/nexus/repository/maven-public/"
)
// 引入 Gradle 插件门户(主要用于查找 Gradle 插件)
gradlePluginPortal
()
gradlePluginPortal
()
}
}
}
}
/**
专门管理项目依赖的解析:
影响 dependencies {} 块中的依赖解析
影响 implementation、api、compileOnly 等依赖声明
影响依赖版本管理
影响依赖仓库配置
在整个项目构建过程中生效
*/
dependencyResolutionManagement
{
dependencyResolutionManagement
{
repositories
{
repositories
{
// mavenLocal()
maven
(
"https://maven.eazytec-cloud.com/nexus/repository/maven-public/"
)
maven
(
"https://maven.eazytec-cloud.com/nexus/repository/maven-public/"
)
}
}
}
}
// 包含 composeApp 模块
include
(
":composeApp"
)
include
(
":composeApp"
)
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment