├── .gitattributes
├── .gitignore
├── OpenHarmony.Demo
├── ArkTsLibraryExample.cs
├── Entry.cs
├── OpenHarmony.Demo.csproj
└── OpenglExample.cs
├── OpenHarmony.NDK.Bindings.sln
├── OpenHarmony.NDK.Bindings
├── Core_File_Kit
│ ├── Environment
│ │ └── Environment.cs
│ ├── FileIO
│ │ ├── FileIO.cs
│ │ ├── FileIO_FileLocation.cs
│ │ └── FileManagement_ErrCode.cs
│ ├── FileShare
│ │ ├── FileShare.cs
│ │ ├── FileShare_OperationMode.cs
│ │ └── FileShare_PolicyErrorCode.cs
│ └── FileUri.cs
├── HiLog
│ └── hilog.cs
├── IPC_Kit
│ ├── OHIPCErrorCode.cs
│ ├── OHIPCParcel.cs
│ ├── OHIPCRemoteObject.cs
│ └── OHIPCSkeleton.cs
├── OpenHarmony.NDK.Bindings.csproj
├── ace
│ ├── Ace.cs
│ └── ace_types.cs
├── arkui
│ ├── ArkUI.cs
│ └── arkui_type.cs
├── display_manager
│ ├── display_manager.cs
│ └── display_type.cs
├── input_method
│ ├── input_method.cs
│ └── input_method_type.cs
└── node_api
│ ├── ace_napi.cs
│ └── napi_types.cs
└── README.md
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.rsuser
8 | *.suo
9 | *.user
10 | *.userosscache
11 | *.sln.docstates
12 |
13 | # User-specific files (MonoDevelop/Xamarin Studio)
14 | *.userprefs
15 |
16 | # Mono auto generated files
17 | mono_crash.*
18 |
19 | # Build results
20 | [Dd]ebug/
21 | [Dd]ebugPublic/
22 | [Rr]elease/
23 | [Rr]eleases/
24 | x64/
25 | x86/
26 | [Ww][Ii][Nn]32/
27 | [Aa][Rr][Mm]/
28 | [Aa][Rr][Mm]64/
29 | bld/
30 | [Bb]in/
31 | [Oo]bj/
32 | [Oo]ut/
33 | [Ll]og/
34 | [Ll]ogs/
35 |
36 | # Visual Studio 2015/2017 cache/options directory
37 | .vs/
38 | # Uncomment if you have tasks that create the project's static files in wwwroot
39 | #wwwroot/
40 |
41 | # Visual Studio 2017 auto generated files
42 | Generated\ Files/
43 |
44 | # MSTest test Results
45 | [Tt]est[Rr]esult*/
46 | [Bb]uild[Ll]og.*
47 |
48 | # NUnit
49 | *.VisualState.xml
50 | TestResult.xml
51 | nunit-*.xml
52 |
53 | # Build Results of an ATL Project
54 | [Dd]ebugPS/
55 | [Rr]eleasePS/
56 | dlldata.c
57 |
58 | # Benchmark Results
59 | BenchmarkDotNet.Artifacts/
60 |
61 | # .NET Core
62 | project.lock.json
63 | project.fragment.lock.json
64 | artifacts/
65 |
66 | # ASP.NET Scaffolding
67 | ScaffoldingReadMe.txt
68 |
69 | # StyleCop
70 | StyleCopReport.xml
71 |
72 | # Files built by Visual Studio
73 | *_i.c
74 | *_p.c
75 | *_h.h
76 | *.ilk
77 | *.meta
78 | *.obj
79 | *.iobj
80 | *.pch
81 | *.pdb
82 | *.ipdb
83 | *.pgc
84 | *.pgd
85 | *.rsp
86 | *.sbr
87 | *.tlb
88 | *.tli
89 | *.tlh
90 | *.tmp
91 | *.tmp_proj
92 | *_wpftmp.csproj
93 | *.log
94 | *.vspscc
95 | *.vssscc
96 | .builds
97 | *.pidb
98 | *.svclog
99 | *.scc
100 |
101 | # Chutzpah Test files
102 | _Chutzpah*
103 |
104 | # Visual C++ cache files
105 | ipch/
106 | *.aps
107 | *.ncb
108 | *.opendb
109 | *.opensdf
110 | *.sdf
111 | *.cachefile
112 | *.VC.db
113 | *.VC.VC.opendb
114 |
115 | # Visual Studio profiler
116 | *.psess
117 | *.vsp
118 | *.vspx
119 | *.sap
120 |
121 | # Visual Studio Trace Files
122 | *.e2e
123 |
124 | # TFS 2012 Local Workspace
125 | $tf/
126 |
127 | # Guidance Automation Toolkit
128 | *.gpState
129 |
130 | # ReSharper is a .NET coding add-in
131 | _ReSharper*/
132 | *.[Rr]e[Ss]harper
133 | *.DotSettings.user
134 |
135 | # TeamCity is a build add-in
136 | _TeamCity*
137 |
138 | # DotCover is a Code Coverage Tool
139 | *.dotCover
140 |
141 | # AxoCover is a Code Coverage Tool
142 | .axoCover/*
143 | !.axoCover/settings.json
144 |
145 | # Coverlet is a free, cross platform Code Coverage Tool
146 | coverage*.json
147 | coverage*.xml
148 | coverage*.info
149 |
150 | # Visual Studio code coverage results
151 | *.coverage
152 | *.coveragexml
153 |
154 | # NCrunch
155 | _NCrunch_*
156 | .*crunch*.local.xml
157 | nCrunchTemp_*
158 |
159 | # MightyMoose
160 | *.mm.*
161 | AutoTest.Net/
162 |
163 | # Web workbench (sass)
164 | .sass-cache/
165 |
166 | # Installshield output folder
167 | [Ee]xpress/
168 |
169 | # DocProject is a documentation generator add-in
170 | DocProject/buildhelp/
171 | DocProject/Help/*.HxT
172 | DocProject/Help/*.HxC
173 | DocProject/Help/*.hhc
174 | DocProject/Help/*.hhk
175 | DocProject/Help/*.hhp
176 | DocProject/Help/Html2
177 | DocProject/Help/html
178 |
179 | # Click-Once directory
180 | publish/
181 |
182 | # Publish Web Output
183 | *.[Pp]ublish.xml
184 | *.azurePubxml
185 | # Note: Comment the next line if you want to checkin your web deploy settings,
186 | # but database connection strings (with potential passwords) will be unencrypted
187 | *.pubxml
188 | *.publishproj
189 |
190 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
191 | # checkin your Azure Web App publish settings, but sensitive information contained
192 | # in these scripts will be unencrypted
193 | PublishScripts/
194 |
195 | # NuGet Packages
196 | *.nupkg
197 | # NuGet Symbol Packages
198 | *.snupkg
199 | # The packages folder can be ignored because of Package Restore
200 | **/[Pp]ackages/*
201 | # except build/, which is used as an MSBuild target.
202 | !**/[Pp]ackages/build/
203 | # Uncomment if necessary however generally it will be regenerated when needed
204 | #!**/[Pp]ackages/repositories.config
205 | # NuGet v3's project.json files produces more ignorable files
206 | *.nuget.props
207 | *.nuget.targets
208 |
209 | # Microsoft Azure Build Output
210 | csx/
211 | *.build.csdef
212 |
213 | # Microsoft Azure Emulator
214 | ecf/
215 | rcf/
216 |
217 | # Windows Store app package directories and files
218 | AppPackages/
219 | BundleArtifacts/
220 | Package.StoreAssociation.xml
221 | _pkginfo.txt
222 | *.appx
223 | *.appxbundle
224 | *.appxupload
225 |
226 | # Visual Studio cache files
227 | # files ending in .cache can be ignored
228 | *.[Cc]ache
229 | # but keep track of directories ending in .cache
230 | !?*.[Cc]ache/
231 |
232 | # Others
233 | ClientBin/
234 | ~$*
235 | *~
236 | *.dbmdl
237 | *.dbproj.schemaview
238 | *.jfm
239 | *.pfx
240 | *.publishsettings
241 | orleans.codegen.cs
242 |
243 | # Including strong name files can present a security risk
244 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
245 | #*.snk
246 |
247 | # Since there are multiple workflows, uncomment next line to ignore bower_components
248 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
249 | #bower_components/
250 |
251 | # RIA/Silverlight projects
252 | Generated_Code/
253 |
254 | # Backup & report files from converting an old project file
255 | # to a newer Visual Studio version. Backup files are not needed,
256 | # because we have git ;-)
257 | _UpgradeReport_Files/
258 | Backup*/
259 | UpgradeLog*.XML
260 | UpgradeLog*.htm
261 | ServiceFabricBackup/
262 | *.rptproj.bak
263 |
264 | # SQL Server files
265 | *.mdf
266 | *.ldf
267 | *.ndf
268 |
269 | # Business Intelligence projects
270 | *.rdl.data
271 | *.bim.layout
272 | *.bim_*.settings
273 | *.rptproj.rsuser
274 | *- [Bb]ackup.rdl
275 | *- [Bb]ackup ([0-9]).rdl
276 | *- [Bb]ackup ([0-9][0-9]).rdl
277 |
278 | # Microsoft Fakes
279 | FakesAssemblies/
280 |
281 | # GhostDoc plugin setting file
282 | *.GhostDoc.xml
283 |
284 | # Node.js Tools for Visual Studio
285 | .ntvs_analysis.dat
286 | node_modules/
287 |
288 | # Visual Studio 6 build log
289 | *.plg
290 |
291 | # Visual Studio 6 workspace options file
292 | *.opt
293 |
294 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
295 | *.vbw
296 |
297 | # Visual Studio LightSwitch build output
298 | **/*.HTMLClient/GeneratedArtifacts
299 | **/*.DesktopClient/GeneratedArtifacts
300 | **/*.DesktopClient/ModelManifest.xml
301 | **/*.Server/GeneratedArtifacts
302 | **/*.Server/ModelManifest.xml
303 | _Pvt_Extensions
304 |
305 | # Paket dependency manager
306 | .paket/paket.exe
307 | paket-files/
308 |
309 | # FAKE - F# Make
310 | .fake/
311 |
312 | # CodeRush personal settings
313 | .cr/personal
314 |
315 | # Python Tools for Visual Studio (PTVS)
316 | __pycache__/
317 | *.pyc
318 |
319 | # Cake - Uncomment if you are using it
320 | # tools/**
321 | # !tools/packages.config
322 |
323 | # Tabs Studio
324 | *.tss
325 |
326 | # Telerik's JustMock configuration file
327 | *.jmconfig
328 |
329 | # BizTalk build output
330 | *.btp.cs
331 | *.btm.cs
332 | *.odx.cs
333 | *.xsd.cs
334 |
335 | # OpenCover UI analysis results
336 | OpenCover/
337 |
338 | # Azure Stream Analytics local run output
339 | ASALocalRun/
340 |
341 | # MSBuild Binary and Structured Log
342 | *.binlog
343 |
344 | # NVidia Nsight GPU debugger configuration file
345 | *.nvuser
346 |
347 | # MFractors (Xamarin productivity tool) working folder
348 | .mfractor/
349 |
350 | # Local History for Visual Studio
351 | .localhistory/
352 |
353 | # BeatPulse healthcheck temp database
354 | healthchecksdb
355 |
356 | # Backup folder for Package Reference Convert tool in Visual Studio 2017
357 | MigrationBackup/
358 |
359 | # Ionide (cross platform F# VS Code tools) working folder
360 | .ionide/
361 |
362 | # Fody - auto-generated XML schema
363 | FodyWeavers.xsd
--------------------------------------------------------------------------------
/OpenHarmony.Demo/ArkTsLibraryExample.cs:
--------------------------------------------------------------------------------
1 | using OpenHarmony.NDK.Bindings.Native;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Runtime.CompilerServices;
6 | using System.Runtime.InteropServices;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 |
10 | namespace OpenHarmony.Net;
11 |
12 | public unsafe static class ArkTsLibraryExample
13 | {
14 | public unsafe static napi_value Init(napi_env env, napi_value exports)
15 | {
16 | var methodName = Marshal.StringToHGlobalAnsi("CSharpAdd");
17 | napi_property_descriptor[] desc = [
18 | new (){utf8name = (sbyte*)methodName, name = default, method = &Add, getter = null, setter = null, value = default, attributes = napi_property_attributes.napi_default, data = null}
19 | ];
20 | fixed (napi_property_descriptor* p = desc)
21 | {
22 | node_api.napi_define_properties(env, exports, 1, p);
23 | }
24 | Marshal.FreeHGlobal(methodName);
25 |
26 | return exports;
27 | }
28 | [UnmanagedCallersOnly(CallConvs = [typeof(CallConvCdecl)])]
29 | static unsafe napi_value Add(napi_env env, napi_callback_info info)
30 | {
31 | ulong argc = 2;
32 | napi_value[] args = [default, default];
33 | fixed (napi_value* p = args)
34 | {
35 | node_api.napi_get_cb_info(env, info, &argc, p, null, null);
36 | }
37 |
38 | napi_valuetype valuetype0;
39 | node_api.napi_typeof(env, args[0], &valuetype0);
40 |
41 | napi_valuetype valuetype1;
42 | node_api.napi_typeof(env, args[1], &valuetype1);
43 |
44 | double value0;
45 | node_api.napi_get_value_double(env, args[0], &value0);
46 |
47 | double value1;
48 | node_api.napi_get_value_double(env, args[1], &value1);
49 |
50 | napi_value sum;
51 | node_api.napi_create_double(env, value0 + value1, &sum);
52 |
53 | return sum;
54 |
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/OpenHarmony.Demo/Entry.cs:
--------------------------------------------------------------------------------
1 | using OpenHarmony.NDK.Bindings.Native;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | namespace OpenHarmony.Net;
6 |
7 | public class Entry
8 | {
9 | [UnmanagedCallersOnly(CallConvs = [typeof(CallConvCdecl)], EntryPoint = "RegisterEntryModule")]
10 | public unsafe static void RegisterEntryModule()
11 | {
12 | var tag = Marshal.StringToHGlobalAnsi("CSharp");
13 | var msg = Marshal.StringToHGlobalAnsi("Hello CSharp");
14 |
15 | Hilog.HiLogPrint(LogType.LOG_APP, LogLevel.LOG_ERROR, 0xFF00, (sbyte*)tag, (sbyte*)msg);
16 |
17 | Marshal.FreeHGlobal(tag);
18 | Marshal.FreeHGlobal(msg);
19 | var s = "entry";
20 |
21 | napi_module demoModule = new napi_module
22 | {
23 | nm_version = 1,
24 | nm_flags = 0,
25 | nm_filename = null,
26 | nm_modname = (sbyte*)Marshal.StringToHGlobalAnsi(s),
27 | nm_priv = null,
28 | napi_addon_register_func = &Init,
29 | reserved_0 = null,
30 | reserved_1 = null,
31 | reserved_2 = null,
32 | reserved_3 = null,
33 | };
34 |
35 | node_api.napi_module_register(&demoModule);
36 | }
37 |
38 | [UnmanagedCallersOnly(CallConvs = [typeof(CallConvCdecl)])]
39 | public unsafe static napi_value Init(napi_env env, napi_value exports)
40 | {
41 | ArkTsLibraryExample.Init(env, exports);
42 | OpenglExample.Init(env, exports);
43 |
44 | return exports;
45 | }
46 |
47 |
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/OpenHarmony.Demo/OpenHarmony.Demo.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net8.0
5 | enable
6 | enable
7 | true
8 | true
9 | true
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/OpenHarmony.Demo/OpenglExample.cs:
--------------------------------------------------------------------------------
1 | using Avalonia.OpenGL.Egl;
2 | using Silk.NET.OpenGLES;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Runtime.CompilerServices;
8 | using System.Runtime.InteropServices;
9 | using System.Text;
10 | using System.Threading.Tasks;
11 | using OpenHarmony.NDK.Bindings.Native;
12 |
13 | namespace OpenHarmony.Net;
14 |
15 | public unsafe static class OpenglExample
16 | {
17 | public unsafe static napi_value Init(napi_env env, napi_value exports)
18 | {
19 | napi_value exportInstance = default;
20 | OH_NativeXComponent* nativeXComponent = null;
21 | int ret = default;
22 | var xcomponentName = "__NATIVE_XCOMPONENT_OBJ__";
23 | var xcomponentNamePtr = Marshal.StringToHGlobalAnsi(xcomponentName);
24 | if (node_api.napi_get_named_property(env, exports, (sbyte*)xcomponentNamePtr, &exportInstance) == napi_status.napi_ok)
25 | {
26 | if (node_api.napi_unwrap(env, exportInstance, (void**)&nativeXComponent) == napi_status.napi_ok)
27 | {
28 | var p = Marshal.AllocHGlobal(sizeof(OH_NativeXComponent_Callback));
29 | ref var g_ComponentCallback = ref Unsafe.AsRef((void*)p);
30 | g_ComponentCallback.OnSurfaceCreated = &OnSurfaceCreated;
31 | g_ComponentCallback.OnSurfaceChanged = &OnSurfaceChanged;
32 | g_ComponentCallback.OnSurfaceDestroyed = &OnSurfaceDestroyed;
33 | g_ComponentCallback.DispatchTouchEvent = &DispatchTouchEvent;
34 | Ace.OH_NativeXComponent_RegisterCallback(nativeXComponent, (OH_NativeXComponent_Callback*)p);
35 | }
36 | }
37 | Marshal.FreeHGlobal(xcomponentNamePtr);
38 | return exports;
39 | }
40 |
41 |
42 | static GL gl;
43 | static nint display;
44 | static nint surface;
45 | static EglInterface egl;
46 | [UnmanagedCallersOnly(CallConvs = [typeof(CallConvCdecl)])]
47 | public static void OnSurfaceCreated(OH_NativeXComponent* component, void* window)
48 | {
49 | Ace.OH_NativeXComponent_RegisterOnFrameCallback(component, &OnSurfaceRendered);
50 | Hilog.OH_LOG_DEBUG(LogType.LOG_APP, "CSharp", "OnSurfaceCreated");
51 |
52 | egl = new EglInterface("libEGL.so");
53 |
54 | display = egl.GetDisplay(0);
55 | if (egl.Initialize(display, out var major, out var minor) == false)
56 | {
57 | Hilog.OH_LOG_DEBUG(LogType.LOG_APP, "CSharp", "egl.Initialize fail");
58 | return;
59 | }
60 | int[] attributes = [0x3033, 0x0004, 0x3024, 8, 0x3023, 8, 0x3022, 8, 0x3021, 8, 0x3040, 0x0004, 0x3038];
61 | if (egl.ChooseConfig(display, attributes, out var configs, 1, out var choosenConfig) == false)
62 | {
63 | Hilog.OH_LOG_DEBUG(LogType.LOG_APP, "CSharp", "egl.ChooseConfig fail");
64 | return;
65 | }
66 | int[] winAttribs = [0x309D, 0x3089, 0x3038];
67 | surface = egl.CreateWindowSurface(display, configs, (nint)window, winAttribs);
68 | if (surface == 0)
69 | {
70 | Hilog.OH_LOG_DEBUG(LogType.LOG_APP, "CSharp", "egl.CreateWindowSurface fail");
71 | return;
72 | }
73 | int[] attrib3_list = [0x3098, 2, 0x3038];
74 | int sharedEglContext = 0;
75 | var context = egl.CreateContext(display, configs, sharedEglContext, attrib3_list);
76 | if (egl.MakeCurrent(display, surface, surface, context) == false)
77 | {
78 | Hilog.OH_LOG_DEBUG(LogType.LOG_APP, "CSharp", "egl.MakeCurrent fail");
79 | return;
80 | }
81 |
82 | Hilog.OH_LOG_DEBUG(LogType.LOG_APP, "CSharp", "egl init success");
83 | gl = GL.GetApi(name =>
84 | {
85 | var ptr = Marshal.StringToHGlobalAnsi(name);
86 | var fun = egl.GetProcAddress(ptr);
87 | Marshal.FreeHGlobal(ptr);
88 | return fun;
89 | });
90 | }
91 |
92 | [UnmanagedCallersOnly(CallConvs = [typeof(CallConvCdecl)])]
93 | public static void OnSurfaceRendered(OH_NativeXComponent* component, ulong timestamp, ulong targetTimestamp)
94 | {
95 | // Hilog.OH_LOG_DEBUG(LogType.LOG_APP, "CSharp", "OnRender");
96 | gl.ClearColor(Color.Blue);
97 | gl.Clear(ClearBufferMask.ColorBufferBit);
98 | egl.SwapBuffers(display, surface);
99 | }
100 |
101 | [UnmanagedCallersOnly(CallConvs = [typeof(CallConvCdecl)])]
102 | public static void OnSurfaceChanged(OH_NativeXComponent* component, void* window)
103 | {
104 |
105 | }
106 | [UnmanagedCallersOnly(CallConvs = [typeof(CallConvCdecl)])]
107 | public static void OnSurfaceDestroyed(OH_NativeXComponent* component, void* window)
108 | {
109 |
110 | }
111 | [UnmanagedCallersOnly(CallConvs = [typeof(CallConvCdecl)])]
112 | public static void DispatchTouchEvent(OH_NativeXComponent* component, void* window)
113 | {
114 |
115 | }
116 | }
117 |
--------------------------------------------------------------------------------
/OpenHarmony.NDK.Bindings.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.12.35410.144
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenHarmony.Demo", "OpenHarmony.Demo\OpenHarmony.Demo.csproj", "{56E61895-E8F6-472F-8D73-A34AD009AE76}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenHarmony.NDK.Bindings", "OpenHarmony.NDK.Bindings\OpenHarmony.NDK.Bindings.csproj", "{7D3C255F-1D97-4DB1-B972-54F1BF229207}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|Any CPU = Debug|Any CPU
13 | Release|Any CPU = Release|Any CPU
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {56E61895-E8F6-472F-8D73-A34AD009AE76}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17 | {56E61895-E8F6-472F-8D73-A34AD009AE76}.Debug|Any CPU.Build.0 = Debug|Any CPU
18 | {56E61895-E8F6-472F-8D73-A34AD009AE76}.Release|Any CPU.ActiveCfg = Release|Any CPU
19 | {56E61895-E8F6-472F-8D73-A34AD009AE76}.Release|Any CPU.Build.0 = Release|Any CPU
20 | {7D3C255F-1D97-4DB1-B972-54F1BF229207}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21 | {7D3C255F-1D97-4DB1-B972-54F1BF229207}.Debug|Any CPU.Build.0 = Debug|Any CPU
22 | {7D3C255F-1D97-4DB1-B972-54F1BF229207}.Release|Any CPU.ActiveCfg = Release|Any CPU
23 | {7D3C255F-1D97-4DB1-B972-54F1BF229207}.Release|Any CPU.Build.0 = Release|Any CPU
24 | EndGlobalSection
25 | GlobalSection(SolutionProperties) = preSolution
26 | HideSolutionNode = FALSE
27 | EndGlobalSection
28 | EndGlobal
29 |
--------------------------------------------------------------------------------
/OpenHarmony.NDK.Bindings/Core_File_Kit/Environment/Environment.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.InteropServices;
2 |
3 | namespace OpenHarmony.NDK.Bindings.Core_File_Kit;
4 |
5 | public static unsafe partial class Environment
6 | {
7 | [LibraryImport("llibohenvironment.so")]
8 | public static partial FileManagement_ErrCode* OH_Environment_GetUserDownloadDir(char** result);
9 |
10 | [LibraryImport("llibohenvironment.so")]
11 | public static partial FileManagement_ErrCode OH_Environment_GetUserDesktopDir(char** result);
12 |
13 | [LibraryImport("llibohenvironment.so")]
14 | public static partial FileManagement_ErrCode OH_Environment_GetUserDocumentDir(char** result);
15 | }
--------------------------------------------------------------------------------
/OpenHarmony.NDK.Bindings/Core_File_Kit/FileIO/FileIO.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.InteropServices;
2 |
3 | namespace OpenHarmony.NDK.Bindings.Core_File_Kit;
4 |
5 | public static unsafe partial class FileIO
6 | {
7 | [LibraryImport("libohfileio.so")]
8 | public static partial FileManagement_ErrCode OH_FileIO_GetFileLocation(char* uri, int uriLength,
9 | FileIO_FileLocation* location);
10 | }
--------------------------------------------------------------------------------
/OpenHarmony.NDK.Bindings/Core_File_Kit/FileIO/FileIO_FileLocation.cs:
--------------------------------------------------------------------------------
1 | namespace OpenHarmony.NDK.Bindings.Core_File_Kit;
2 |
3 | ///
4 | /// 文件存储位置枚举值。
5 | ///
6 | public enum FileIO_FileLocation
7 | {
8 | LOCAL = 1,
9 |
10 | CLOUD = 2,
11 |
12 | LOCAL_AND_CLOUD = 3
13 | }
--------------------------------------------------------------------------------
/OpenHarmony.NDK.Bindings/Core_File_Kit/FileIO/FileManagement_ErrCode.cs:
--------------------------------------------------------------------------------
1 | namespace OpenHarmony.NDK.Bindings.Core_File_Kit;
2 |
3 | ///
4 | /// 文件管理模块错误码。
5 | ///
6 | public enum FileManagement_ErrCode
7 | {
8 | ERR_OK = 0,
9 |
10 | ERR_PERMISSION_ERROR = 201,
11 |
12 | ERR_INVALID_PARAMETER = 401,
13 |
14 | ERR_DEVICE_NOT_SUPPORTED = 801,
15 |
16 | ERR_EPERM = 13900001,
17 |
18 | ERR_ENOENT = 13900002,
19 |
20 | ERR_ENOMEM = 13900011,
21 |
22 | ERR_UNKNOWN = 13900042
23 | }
--------------------------------------------------------------------------------
/OpenHarmony.NDK.Bindings/Core_File_Kit/FileShare/FileShare.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.InteropServices;
2 |
3 | namespace OpenHarmony.NDK.Bindings.Core_File_Kit;
4 |
5 | public static unsafe partial class FileShare
6 | {
7 | [LibraryImport("libohfileshare.so")]
8 | public static partial FileManagement_ErrCode OH_FileShare_PersistPermission(FileShare_PolicyInfo* policies,
9 | uint policyNum, FileShare_PolicyErrorResult** result, uint* resultNum);
10 |
11 | [LibraryImport("libohfileshare.so")]
12 | public static partial FileManagement_ErrCode OH_FileShare_RevokePermission(FileShare_PolicyInfo* policies,
13 | uint policyNum,
14 | FileShare_PolicyErrorResult** result, uint* resultNum);
15 |
16 | [LibraryImport("libohfileshare.so")]
17 | public static partial FileManagement_ErrCode OH_FileShare_ActivatePermission(FileShare_PolicyInfo* policies,
18 | uint policyNum,
19 | FileShare_PolicyErrorResult** result, uint* resultNum);
20 |
21 | [LibraryImport("libohfileshare.so")]
22 | public static partial FileManagement_ErrCode OH_FileShare_DeactivatePermission(FileShare_PolicyInfo* policies,
23 | uint policyNum,
24 | FileShare_PolicyErrorResult** result, uint* resultNum);
25 |
26 | [LibraryImport("libohfileshare.so")]
27 | public static partial FileManagement_ErrCode OH_FileShare_CheckPersistentPermission(FileShare_PolicyInfo* policies,
28 | uint policyNum,
29 | bool** result, uint* resultNum);
30 |
31 | [LibraryImport("libohfileshare.so")]
32 | public static partial void OH_FileShare_ReleasePolicyErrorResult(FileShare_PolicyErrorResult* errorResult,
33 | uint resultNum);
34 | }
35 |
36 | public struct FileShare_PolicyErrorResult;
37 |
38 | public struct FileShare_PolicyInfo;
--------------------------------------------------------------------------------
/OpenHarmony.NDK.Bindings/Core_File_Kit/FileShare/FileShare_OperationMode.cs:
--------------------------------------------------------------------------------
1 | namespace OpenHarmony.NDK.Bindings.Core_File_Kit;
2 |
3 | public enum FileShare_OperationMode
4 | {
5 | READ_MODE = 1 << 0,
6 |
7 | WRITE_MODE = 1 << 1
8 | }
--------------------------------------------------------------------------------
/OpenHarmony.NDK.Bindings/Core_File_Kit/FileShare/FileShare_PolicyErrorCode.cs:
--------------------------------------------------------------------------------
1 | namespace OpenHarmony.NDK.Bindings.Core_File_Kit;
2 |
3 | public enum FileShare_PolicyErrorCode
4 | {
5 | PERSISTENCE_FORBIDDEN = 1,
6 |
7 | INVALID_MODE = 2,
8 |
9 | INVALID_PATH = 3,
10 |
11 | PERMISSION_NOT_PERSISTED = 4
12 | }
--------------------------------------------------------------------------------
/OpenHarmony.NDK.Bindings/Core_File_Kit/FileUri.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.InteropServices;
2 |
3 | namespace OpenHarmony.NDK.Bindings.Core_File_Kit;
4 |
5 | public static unsafe partial class FileUri
6 | {
7 | [LibraryImport("libohfileuri.so")]
8 | public static partial FileManagement_ErrCode OH_FileUri_GetUriFromPath(char* path, uint length, char** result);
9 |
10 | [LibraryImport("libohfileuri.so")]
11 | public static partial FileManagement_ErrCode OH_FileUri_GetPathFromUri(char* uri, uint length, char** result);
12 |
13 |
14 | [LibraryImport("libohfileuri.so")]
15 | public static partial FileManagement_ErrCode OH_FileUri_GetFullDirectoryUri(char* uri, uint length, char** result);
16 |
17 |
18 | [LibraryImport("libohfileuri.so")]
19 | [return: MarshalAs(UnmanagedType.Bool)]
20 | public static partial bool OH_FileUri_IsValidUri(char* uri, uint length);
21 |
22 |
23 | [LibraryImport("libohfileuri.so")]
24 | public static partial FileManagement_ErrCode OH_FileUri_GetFileName(char* uri, uint length, char** result);
25 | }
--------------------------------------------------------------------------------
/OpenHarmony.NDK.Bindings/HiLog/hilog.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection.Emit;
2 | using System.Runtime.InteropServices;
3 |
4 | namespace OpenHarmony.NDK.Bindings.Native;
5 |
6 | public unsafe static partial class Hilog
7 | {
8 | [LibraryImport("libhilog.so")]
9 | public static partial int HiLogPrint(LogType type, LogLevel level, uint domain, sbyte* tag, sbyte* msg);
10 |
11 | public static int OH_LOG_DEBUG(LogType type, string tag, string message)
12 | {
13 | return OH_LOG_PRINT(type, LogLevel.LOG_DEBUG, tag, message);
14 | }
15 | public static int OH_LOG_ERROR(LogType type, string tag, string message)
16 | {
17 | return OH_LOG_PRINT(type, LogLevel.LOG_ERROR, tag, message);
18 | }
19 | public static int OH_LOG_INFO(LogType type, string tag, string message)
20 | {
21 | return OH_LOG_PRINT(type, LogLevel.LOG_INFO, tag, message);
22 | }
23 | public static int OH_LOG_WARN(LogType type, string tag, string message)
24 | {
25 | return OH_LOG_PRINT(type, LogLevel.LOG_WARN, tag, message);
26 | }
27 | public static int OH_LOG_FATAL(LogType type, string tag, string message)
28 | {
29 | return OH_LOG_PRINT(type, LogLevel.LOG_FATAL, tag, message);
30 | }
31 | public static int OH_LOG_PRINT(LogType type, LogLevel level, string tag, string message)
32 | {
33 | var ptag = Marshal.StringToHGlobalAnsi(tag);
34 | var pmsg = Marshal.StringToHGlobalAnsi(message);
35 | var ret = HiLogPrint(type, level, 0, (sbyte*)ptag, (sbyte*)pmsg);
36 | Marshal.FreeHGlobal(ptag);
37 | Marshal.FreeHGlobal(pmsg);
38 | return ret;
39 | }
40 | }
41 |
42 |
43 | public enum LogType
44 | {
45 | LOG_APP = 0
46 | }
47 |
48 | public enum LogLevel
49 | {
50 | /** Debug level to be used by {@link OH_LOG_DEBUG} */
51 | LOG_DEBUG = 3,
52 | /** Informational level to be used by {@link OH_LOG_INFO} */
53 | LOG_INFO = 4,
54 | /** Warning level to be used by {@link OH_LOG_WARN} */
55 | LOG_WARN = 5,
56 | /** Error level to be used by {@link OH_LOG_ERROR} */
57 | LOG_ERROR = 6,
58 | /** Fatal level to be used by {@link OH_LOG_FATAL} */
59 | LOG_FATAL = 7,
60 | }
--------------------------------------------------------------------------------
/OpenHarmony.NDK.Bindings/IPC_Kit/OHIPCErrorCode.cs:
--------------------------------------------------------------------------------
1 | namespace OpenHarmony.NDK.Bindings.IPC_Kit;
2 |
3 | public enum OH_IPC_ErrorCode
4 | {
5 | OH_IPC_SUCCESS = 0,
6 |
7 | OH_IPC_ERROR_CODE_BASE = 1901000,
8 |
9 | OH_IPC_CHECK_PARAM_ERROR = OH_IPC_ERROR_CODE_BASE,
10 |
11 | OH_IPC_PARCEL_WRITE_ERROR = OH_IPC_ERROR_CODE_BASE + 1,
12 |
13 | OH_IPC_PARCEL_READ_ERROR = OH_IPC_ERROR_CODE_BASE + 2,
14 |
15 | OH_IPC_MEM_ALLOCATOR_ERROR = OH_IPC_ERROR_CODE_BASE + 3,
16 |
17 | OH_IPC_CODE_OUT_OF_RANGE = OH_IPC_ERROR_CODE_BASE + 4,
18 |
19 | OH_IPC_DEAD_REMOTE_OBJECT = OH_IPC_ERROR_CODE_BASE + 5,
20 |
21 | OH_IPC_INVALID_USER_ERROR_CODE = OH_IPC_ERROR_CODE_BASE + 6,
22 |
23 | OH_IPC_INNER_ERROR = OH_IPC_ERROR_CODE_BASE + 7,
24 |
25 | OH_IPC_ERROR_CODE_MAX = OH_IPC_ERROR_CODE_BASE + 1000,
26 |
27 | OH_IPC_USER_ERROR_CODE_MIN = 1909000,
28 |
29 | OH_IPC_USER_ERROR_CODE_MAX = 1909999
30 | }
--------------------------------------------------------------------------------
/OpenHarmony.NDK.Bindings/IPC_Kit/OHIPCParcel.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.CompilerServices;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 | using OpenHarmony.NDK.Bindings.Native;
5 | [assembly: DisableRuntimeMarshalling]
6 |
7 |
8 | namespace OpenHarmony.NDK.Bindings.IPC_Kit;
9 |
10 | public unsafe partial struct OHIPCParcel
11 | {
12 | [LibraryImport("libipc_capi.so")]
13 | public static partial OHIPCParcel* OH_IPCParcel_Create();
14 |
15 | [LibraryImport("libipc_capi.so")]
16 | public static partial void OH_IPCParcel_Destroy(OHIPCParcel* parcel);
17 |
18 | [LibraryImport("libipc_capi.so")]
19 | public static partial int OH_IPCParcel_GetDataSize(OHIPCParcel* parcel);
20 |
21 | [LibraryImport("libipc_capi.so")]
22 | public static partial int OH_IPCParcel_GetWritableBytes(OHIPCParcel* parcel);
23 |
24 | [LibraryImport("libipc_capi.so")]
25 | public static partial int OH_IPCParcel_GetReadableBytes(OHIPCParcel* parcel);
26 |
27 | [LibraryImport("libipc_capi.so")]
28 | public static partial int OH_IPCParcel_GetReadPosition(OHIPCParcel* parcel);
29 |
30 | [LibraryImport("libipc_capi.so")]
31 | public static partial int OH_IPCParcel_GetWritePosition(OHIPCParcel* parcel);
32 |
33 | [LibraryImport("libipc_capi.so")]
34 | public static partial int OH_IPCParcel_RewindReadPosition(OHIPCParcel* parcel, uint newReadPos);
35 |
36 | [LibraryImport("libipc_capi.so")]
37 | public static partial int OH_IPCParcel_RewindWritePosition(OHIPCParcel* parcel, uint newWritePos);
38 |
39 | [LibraryImport("libipc_capi.so")]
40 | public static partial int OH_IPCParcel_WriteInt8(OHIPCParcel* parcel, char value);
41 |
42 | [LibraryImport("libipc_capi.so")]
43 | public static partial int OH_IPCParcel_ReadInt8(OHIPCParcel* parcel, char* value);
44 |
45 | [LibraryImport("libipc_capi.so")]
46 | public static partial int OH_IPCParcel_WriteInt16(OHIPCParcel* parcel, short value);
47 |
48 | [LibraryImport("libipc_capi.so")]
49 | public static partial int OH_IPCParcel_ReadInt16(OHIPCParcel* parcel, short* value);
50 |
51 | [LibraryImport("libipc_capi.so")]
52 | public static partial int OH_IPCParcel_WriteInt32(OHIPCParcel* parcel, int value);
53 |
54 | [LibraryImport("libipc_capi.so")]
55 | public static partial int OH_IPCParcel_ReadInt32(OHIPCParcel* parcel, int* value);
56 |
57 | [LibraryImport("libipc_capi.so")]
58 | public static partial int OH_IPCParcel_WriteInt64(OHIPCParcel* parcel, long value);
59 |
60 | [LibraryImport("libipc_capi.so")]
61 | public static partial int OH_IPCParcel_ReadInt64(OHIPCParcel* parcel, long* value);
62 |
63 | [LibraryImport("libipc_capi.so")]
64 | public static partial int OH_IPCParcel_WriteFloat(OHIPCParcel* parcel, float value);
65 |
66 | [LibraryImport("libipc_capi.so")]
67 | public static partial int OH_IPCParcel_ReadFloat(OHIPCParcel* parcel, float* value);
68 |
69 | [LibraryImport("libipc_capi.so")]
70 | public static partial int OH_IPCParcel_WriteDouble(OHIPCParcel* parcel, double value);
71 |
72 | [LibraryImport("libipc_capi.so")]
73 | public static partial int OH_IPCParcel_ReadDouble(OHIPCParcel* parcel, double* value);
74 |
75 | [LibraryImport("libipc_capi.so")]
76 | public static partial int OH_IPCParcel_WriteString(OHIPCParcel* parcel, char* str);
77 |
78 | [LibraryImport("libipc_capi.so")]
79 | public static partial char* OH_IPCParcel_ReadString(OHIPCParcel* parcel);
80 |
81 | [LibraryImport("libipc_capi.so")]
82 | public static partial int OH_IPCParcel_WriteBuffer(OHIPCParcel* parcel, char* buffer, int len);
83 |
84 | [LibraryImport("libipc_capi.so")]
85 | public static partial char* OH_IPCParcel_ReadBuffer(OHIPCParcel* parcel, int len);
86 |
87 | [LibraryImport("libipc_capi.so")]
88 | public static partial int OH_IPCParcel_WriteRemoteStub(OHIPCParcel* parcel, OHIPCRemoteStub* stub);
89 |
90 | [LibraryImport("libipc_capi.so")]
91 | public static partial OHIPCRemoteStub* OH_IPCParcel_ReadRemoteStub(OHIPCParcel* parcel);
92 |
93 | [LibraryImport("libipc_capi.so")]
94 | public static partial int OH_IPCParcel_WriteRemoteProxy(OHIPCParcel* parcel, OHIPCRemoteProxy* proxy);
95 |
96 | [LibraryImport("libipc_capi.so")]
97 | public static partial OHIPCRemoteProxy* OH_IPCParcel_ReadRemoteProxy(OHIPCParcel* parcel);
98 |
99 | [LibraryImport("libipc_capi.so")]
100 | public static partial int OH_IPCParcel_WriteFileDescriptor(OHIPCParcel* parcel, int fd);
101 |
102 | [LibraryImport("libipc_capi.so")]
103 | public static partial int OH_IPCParcel_ReadFileDescriptor(OHIPCParcel* parcel, int* fd);
104 |
105 | [LibraryImport("libipc_capi.so")]
106 | public static partial int OH_IPCParcel_Append(OHIPCParcel* parcel, OHIPCParcel* data);
107 |
108 | [LibraryImport("libipc_capi.so")]
109 | public static partial int OH_IPCParcel_WriteInterfaceToken(OHIPCParcel* parcel, char* token);
110 |
111 | [LibraryImport("libipc_capi.so")]
112 | public static partial int OH_IPCParcel_ReadInterfaceToken(OHIPCParcel* parcel, char** token, int* len,
113 | delegate* unmanaged[Cdecl] allocator);
114 | }
--------------------------------------------------------------------------------
/OpenHarmony.NDK.Bindings/IPC_Kit/OHIPCRemoteObject.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.InteropServices;
2 |
3 | namespace OpenHarmony.NDK.Bindings.IPC_Kit;
4 |
5 | public static unsafe partial class OHIPCRemoteObject
6 | {
7 | [LibraryImport("libipc_capi.so")]
8 | public static partial OHIPCRemoteStub* OH_IPCRemoteStub_Create(char* descriptor,
9 | delegate* unmanaged[Cdecl] requestCallback,
10 | delegate* unmanaged[Cdecl] destroyCallback, void* userData);
11 |
12 | [LibraryImport("libipc_capi.so")]
13 | public static partial void OH_IPCRemoteStub_Destroy(OHIPCRemoteStub* stub);
14 |
15 | [LibraryImport("libipc_capi.so")]
16 | public static partial void OH_IPCRemoteProxy_Destroy(OHIPCRemoteProxy* proxy);
17 |
18 | [LibraryImport("libipc_capi.so")]
19 | public static partial int OH_IPCRemoteProxy_SendRequest(OHIPCRemoteProxy* proxy, uint code, OHIPCParcel*
20 | data, OHIPCParcel* reply, OH_IPC_MessageOption* option);
21 |
22 | [LibraryImport("libipc_capi.so")]
23 | public static partial int OH_IPCRemoteProxy_GetInterfaceDescriptor(OHIPCRemoteProxy* proxy, char** descriptor,
24 | int* len,
25 | delegate* unmanaged[Cdecl] allocator);
26 |
27 | [LibraryImport("libipc_capi.so")]
28 | public static partial OHIPCDeathRecipient* OH_IPCDeathRecipient_Create(
29 | delegate* unmanaged[Cdecl] deathRecipientCallback,
30 | delegate* unmanaged[Cdecl] destroyCallback, void* userData);
31 |
32 | [LibraryImport("libipc_capi.so")]
33 | public static partial void OH_IPCDeathRecipient_Destroy(OHIPCDeathRecipient* recipient);
34 |
35 | [LibraryImport("libipc_capi.so")]
36 | public static partial int OH_IPCRemoteProxy_AddDeathRecipient(OHIPCRemoteProxy* proxy,
37 | OHIPCDeathRecipient* recipient);
38 |
39 | [LibraryImport("libipc_capi.so")]
40 | public static partial int OH_IPCRemoteProxy_RemoveDeathRecipient(OHIPCRemoteProxy* proxy,
41 | OHIPCDeathRecipient* recipient);
42 |
43 | [LibraryImport("libipc_capi.so")]
44 | public static partial int OH_IPCRemoteProxy_IsRemoteDead(OHIPCRemoteProxy* proxy);
45 | }
46 |
47 | public struct OH_IPC_MessageOption;
48 |
49 | public struct OHIPCRemoteStub;
50 |
51 | public struct OHIPCRemoteProxy;
52 |
53 | public struct OHIPCDeathRecipient;
54 |
55 | public enum OH_IPC_RequestMode
56 | {
57 | OH_IPC_REQUEST_MODE_SYNC = 0,
58 | OH_IPC_REQUEST_MODE_ASYNC = 1
59 | }
--------------------------------------------------------------------------------
/OpenHarmony.NDK.Bindings/IPC_Kit/OHIPCSkeleton.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.InteropServices;
2 |
3 | namespace OpenHarmony.NDK.Bindings.IPC_Kit;
4 |
5 | public static unsafe partial class OHIPCSkeleton
6 | {
7 | [LibraryImport("libipc_capi.so")]
8 | public static partial void OH_IPCSkeleton_JoinWorkThread();
9 |
10 | [LibraryImport("libipc_capi.so")]
11 | public static partial void OH_IPCSkeleton_StopWorkThread();
12 |
13 | [LibraryImport("libipc_capi.so")]
14 | public static partial ulong OH_IPCSkeleton_GetCallingTokenId();
15 |
16 | [LibraryImport("libipc_capi.so")]
17 | public static partial ulong OH_IPCSkeleton_GetFirstTokenId();
18 |
19 | [LibraryImport("libipc_capi.so")]
20 | public static partial ulong OH_IPCSkeleton_GetSelfTokenId();
21 |
22 | [LibraryImport("libipc_capi.so")]
23 | public static partial ulong OH_IPCSkeleton_GetCallingPid();
24 |
25 | [LibraryImport("libipc_capi.so")]
26 | public static partial ulong OH_IPCSkeleton_GetCallingUid();
27 |
28 | [LibraryImport("libipc_capi.so")]
29 | public static partial int OH_IPCSkeleton_IsLocalCalling();
30 |
31 | [LibraryImport("libipc_capi.so")]
32 | public static partial int OH_IPCSkeleton_SetMaxWorkThreadNum(int maxThreadNum);
33 |
34 | [LibraryImport("libipc_capi.so")]
35 | public static partial int OH_IPCSkeleton_ResetCallingIdentity(char** identity, int* len,
36 | delegate* unmanaged[Cdecl] allocator);
37 |
38 | [LibraryImport("libipc_capi.so")]
39 | public static partial int OH_IPCSkeleton_SetCallingIdentity(char* identity);
40 |
41 | [LibraryImport("libipc_capi.so")]
42 | public static partial int OH_IPCSkeleton_IsHandlingTransaction();
43 | }
--------------------------------------------------------------------------------
/OpenHarmony.NDK.Bindings/OpenHarmony.NDK.Bindings.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net8.0
5 | enable
6 | enable
7 | true
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/OpenHarmony.NDK.Bindings/ace/Ace.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.InteropServices;
3 |
4 | namespace OpenHarmony.NDK.Bindings.Native;
5 |
6 | public unsafe static partial class Ace
7 | {
8 |
9 | [LibraryImport("libace_ndk.z.so")]
10 | public static partial int OH_NativeXComponent_GetXComponentId(OH_NativeXComponent* component, sbyte* id, ulong* size);
11 |
12 | [LibraryImport("libace_ndk.z.so")]
13 | public static partial int OH_NativeXComponent_GetXComponentSize(OH_NativeXComponent* component, void* window, ulong* width, ulong* height);
14 |
15 | [LibraryImport("libace_ndk.z.so")]
16 | public static partial int OH_NativeXComponent_GetXComponentOffset(OH_NativeXComponent* component, void* window, double* x, double* y);
17 |
18 | [LibraryImport("libace_ndk.z.so")]
19 | public static partial int OH_NativeXComponent_GetTouchEvent(OH_NativeXComponent* component, void* window, OH_NativeXComponent_TouchEvent* touchEvent);
20 |
21 | [LibraryImport("libace_ndk.z.so")]
22 | public static partial int OH_NativeXComponent_GetTouchPointToolType(OH_NativeXComponent* component, uint pointIndex, OH_NativeXComponent_TouchPointToolType* toolType);
23 |
24 | [LibraryImport("libace_ndk.z.so")]
25 | public static partial int OH_NativeXComponent_GetTouchPointTiltX(OH_NativeXComponent* component, uint pointIndex, float* tiltX);
26 | [LibraryImport("libace_ndk.z.so")]
27 | public static partial int OH_NativeXComponent_GetTouchPointTiltY(OH_NativeXComponent* component, uint pointIndex, float* tiltY);
28 |
29 | [LibraryImport("libace_ndk.z.so")]
30 | public static partial int OH_NativeXComponent_GetTouchPointWindowX(OH_NativeXComponent* component, uint pointIndex, float* windowX);
31 |
32 | [LibraryImport("libace_ndk.z.so")]
33 | public static partial int OH_NativeXComponent_GetTouchPointWindowY(OH_NativeXComponent* component, uint pointIndex, float* windowY);
34 |
35 | [LibraryImport("libace_ndk.z.so")]
36 | public static partial int OH_NativeXComponent_GetTouchPointDisplayX(OH_NativeXComponent* component, uint pointIndex, float* displayX);
37 |
38 | [LibraryImport("libace_ndk.z.so")]
39 | public static partial int OH_NativeXComponent_GetTouchPointDisplayY(OH_NativeXComponent* component, uint pointIndex, float* displayY);
40 |
41 | [LibraryImport("libace_ndk.z.so")]
42 | public static partial int OH_NativeXComponent_GetHistoricalPoints(OH_NativeXComponent* component, void* window, int size, OH_NativeXComponent_HistoricalPoint** historicalPoints);
43 |
44 | [LibraryImport("libace_ndk.z.so")]
45 | public static partial int OH_NativeXComponent_GetMouseEvent(OH_NativeXComponent* component, void* window, OH_NativeXComponent_MouseEvent* mouseEvent);
46 |
47 | [LibraryImport("libace_ndk.z.so")]
48 | public static partial int OH_NativeXComponent_RegisterCallback(OH_NativeXComponent* component, OH_NativeXComponent_Callback* callback);
49 |
50 | [LibraryImport("libace_ndk.z.so")]
51 | public static partial int OH_NativeXComponent_RegisterMouseEventCallback(OH_NativeXComponent* component, OH_NativeXComponent_MouseEvent_Callback* callback);
52 |
53 | [LibraryImport("libace_ndk.z.so")]
54 | public static partial int OH_NativeXComponent_RegisterFocusEventCallback(OH_NativeXComponent* component, delegate* unmanaged[Cdecl] callback);
55 |
56 | [LibraryImport("libace_ndk.z.so")]
57 | public static partial int OH_NativeXComponent_RegisterKeyEventCallback(OH_NativeXComponent* component, delegate* unmanaged[Cdecl] callback);
58 |
59 | [LibraryImport("libace_ndk.z.so")]
60 | public static partial int OH_NativeXComponent_RegisterBlurEventCallback(OH_NativeXComponent* component, delegate* unmanaged[Cdecl] callback);
61 |
62 | [LibraryImport("libace_ndk.z.so")]
63 | public static partial int OH_NativeXComponent_GetKeyEvent(OH_NativeXComponent* component, OH_NativeXComponent_KeyEvent** keyEvent);
64 |
65 | [LibraryImport("libace_ndk.z.so")]
66 | public static partial int OH_NativeXComponent_GetKeyEventAction(OH_NativeXComponent_KeyEvent* keyEvent, OH_NativeXComponent_KeyAction* action);
67 |
68 | [LibraryImport("libace_ndk.z.so")]
69 | public static partial int OH_NativeXComponent_GetKeyEventCode(OH_NativeXComponent_KeyEvent* keyEvent, OH_NativeXComponent_KeyCode* code);
70 |
71 | [LibraryImport("libace_ndk.z.so")]
72 | public static partial int OH_NativeXComponent_GetKeyEventSourceType(OH_NativeXComponent_KeyEvent* keyEvent, OH_NativeXComponent_EventSourceType* sourceType);
73 |
74 | [LibraryImport("libace_ndk.z.so")]
75 | public static partial int OH_NativeXComponent_GetKeyEventDeviceId(OH_NativeXComponent_KeyEvent* keyEvent, long* deviceId);
76 |
77 | [LibraryImport("libace_ndk.z.so")]
78 | public static partial int OH_NativeXComponent_GetKeyEventTimestamp(OH_NativeXComponent_KeyEvent* keyEvent, long* timestamp);
79 |
80 | [LibraryImport("libace_ndk.z.so")]
81 | public static partial int OH_NativeXComponent_SetExpectedFrameRateRange(OH_NativeXComponent* component, OH_NativeXComponent_ExpectedRateRange* range);
82 |
83 | [LibraryImport("libace_ndk.z.so")]
84 | public static partial int OH_NativeXComponent_RegisterOnFrameCallback(OH_NativeXComponent* component, delegate* unmanaged[Cdecl] callback);
85 |
86 | [LibraryImport("libace_ndk.z.so")]
87 | public static partial int OH_NativeXComponent_UnregisterOnFrameCallback(OH_NativeXComponent* component);
88 |
89 | [LibraryImport("libace_ndk.z.so")]
90 | public static partial int OH_NativeXComponent_AttachNativeRootNode(OH_NativeXComponent* component, ArkUI_Node* root);
91 |
92 | [LibraryImport("libace_ndk.z.so")]
93 | public static partial int OH_NativeXComponent_DetachNativeRootNode(OH_NativeXComponent* component, ArkUI_NodeHandle root);
94 |
95 | [LibraryImport("libace_ndk.z.so")]
96 | public static partial int OH_NativeXComponent_RegisterSurfaceShowCallback(OH_NativeXComponent* component, delegate* unmanaged[Cdecl] callback);
97 |
98 | [LibraryImport("libace_ndk.z.so")]
99 | public static partial int OH_NativeXComponent_RegisterSurfaceHideCallback(OH_NativeXComponent* component, delegate* unmanaged[Cdecl] callback);
100 |
101 | [LibraryImport("libace_ndk.z.so")]
102 | public static partial int OH_NativeXComponent_RegisterUIInputEventCallback(OH_NativeXComponent* component, delegate* unmanaged[Cdecl] callback, ArkUI_UIInputEvent_Type type);
103 |
104 | [LibraryImport("libace_ndk.z.so")]
105 | public static partial int OH_NativeXComponent_SetNeedSoftKeyboard(OH_NativeXComponent* component, [MarshalAs(UnmanagedType.Bool)]bool needSoftKeyboard);
106 |
107 | [LibraryImport("libace_ndk.z.so")]
108 | public static partial int OH_NativeXComponent_RegisterOnTouchInterceptCallback(OH_NativeXComponent* component, delegate* unmanaged[Cdecl] callback);
109 |
110 | [LibraryImport("libace_ndk.z.so")]
111 | public static partial int OH_NativeXComponent_GetTouchEventSourceType(OH_NativeXComponent* component, int pointId, OH_NativeXComponent_EventSourceType* sourceType);
112 |
113 | [LibraryImport("libace_ndk.z.so")]
114 | public static partial OH_NativeXComponent* OH_NativeXComponent_GetNativeXComponent(ArkUI_NodeHandle node);
115 |
116 | [LibraryImport("libace_ndk.z.so")]
117 | public static partial int OH_NativeXComponent_GetNativeAccessibilityProvider(OH_NativeXComponent* component, ArkUI_AccessibilityProvider** handle);
118 | }
119 |
--------------------------------------------------------------------------------
/OpenHarmony.NDK.Bindings/ace/ace_types.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace OpenHarmony.NDK.Bindings.Native;
4 |
5 |
6 | public struct OH_NativeXComponent
7 | {
8 |
9 | }
10 |
11 | public struct OH_NativeXComponent_KeyEvent
12 | {
13 |
14 | }
15 |
16 | public struct ArkUI_Node
17 | {
18 |
19 | }
20 | public enum OH_NativeXComponent_KeyAction
21 | {
22 | OH_NATIVEXCOMPONENT_KEY_ACTION_UNKNOWN = -1,
23 | OH_NATIVEXCOMPONENT_KEY_ACTION_DOWN = 0,
24 | OH_NATIVEXCOMPONENT_KEY_ACTION_UP,
25 | }
26 | public unsafe struct OH_NativeXComponent_Callback
27 | {
28 | public delegate* unmanaged[Cdecl] OnSurfaceCreated;
29 | public delegate* unmanaged[Cdecl] OnSurfaceChanged;
30 | public delegate* unmanaged[Cdecl] OnSurfaceDestroyed;
31 | public delegate* unmanaged[Cdecl] DispatchTouchEvent;
32 | }
33 |
34 | public unsafe struct OH_NativeXComponent_MouseEvent_Callback
35 | {
36 | /** Called when a mouse event is triggered. */
37 | public delegate* unmanaged[Cdecl] DispatchMouseEvent;
38 |
39 | /** Called when a hover event is triggered. */
40 | public delegate* unmanaged[Cdecl] DispatchHoverEvent;
41 |
42 | }
43 |
44 | public enum OH_NativeXComponent_EventSourceType
45 | {
46 | OH_NATIVEXCOMPONENT_SOURCE_TYPE_UNKNOWN = 0,
47 | OH_NATIVEXCOMPONENT_SOURCE_TYPE_MOUSE,
48 | OH_NATIVEXCOMPONENT_SOURCE_TYPE_TOUCHSCREEN,
49 | OH_NATIVEXCOMPONENT_SOURCE_TYPE_TOUCHPAD,
50 | OH_NATIVEXCOMPONENT_SOURCE_TYPE_JOYSTICK,
51 | OH_NATIVEXCOMPONENT_SOURCE_TYPE_KEYBOARD,
52 | }
53 |
54 | public struct OH_NativeXComponent_ExpectedRateRange
55 | {
56 | public int min;
57 | public int max;
58 | public int expected;
59 | }
60 |
61 | public struct OH_NativeXComponent_TouchEvent
62 | {
63 | public int id;
64 | public float screenX;
65 | public float screenY;
66 | public float x;
67 | public float y;
68 | public OH_NativeXComponent_TouchEventType type;
69 | public double size;
70 | public float force;
71 | public long deviceId;
72 | public long timeStamp;
73 | public OH_NativeXComponent_TouchPoint_Array touchPoints;
74 | public uint numPoints;
75 | }
76 |
77 | [System.Runtime.CompilerServices.InlineArray(10)]
78 | public struct OH_NativeXComponent_TouchPoint_Array
79 | {
80 | private OH_NativeXComponent_TouchPoint _element0;
81 | }
82 |
83 | public enum OH_NATIVEXCOMPONENT_RESULT
84 | {
85 | /** Successful. */
86 | SUCCESS = 0,
87 | /** Failed. */
88 | FAILED = -1,
89 | /** Invalid parameters. */
90 | BAD_PARAMETER = -2,
91 | };
92 |
93 | public struct OH_NativeXComponent_TouchPoint
94 | {
95 | /** Unique identifier of a finger. */
96 | public int id;
97 | /** X coordinate of the touch point relative to the left edge of the screen. */
98 | public float screenX;
99 | /** Y coordinate of the touch point relative to the upper edge of the screen. */
100 | public float screenY;
101 | /** X coordinate of the touch point relative to the left edge of the element to touch. */
102 | public float x;
103 | /** Y coordinate of the touch point relative to the upper edge of the element to touch. */
104 | public float y;
105 | /** Touch type of the touch event. */
106 | public OH_NativeXComponent_TouchEventType type;
107 | /** Contact area between the finger pad and the screen. */
108 | public double size;
109 | /** Pressure of the current touch event. */
110 | public float force;
111 | /** Timestamp of the current touch event. */
112 | public long timeStamp;
113 | /** Whether the current point is pressed. */
114 | public bool isPressed;
115 | }
116 |
117 | public enum OH_NativeXComponent_TouchEventType
118 | {
119 | /** Trigger a touch event when a finger is pressed. */
120 | OH_NATIVEXCOMPONENT_DOWN = 0,
121 | /** Trigger a touch event when a finger is lifted. */
122 | OH_NATIVEXCOMPONENT_UP,
123 | /** Trigger a touch event when a finger moves on the screen in pressed state. */
124 | OH_NATIVEXCOMPONENT_MOVE,
125 | /** Trigger an event when a touch event is canceled. */
126 | OH_NATIVEXCOMPONENT_CANCEL,
127 | /** Invalid touch type. */
128 | OH_NATIVEXCOMPONENT_UNKNOWN,
129 | }
130 |
131 | public enum OH_NativeXComponent_TouchPointToolType
132 | {
133 | /** Indicates invalid tool type. */
134 | OH_NATIVEXCOMPONENT_TOOL_TYPE_UNKNOWN = 0,
135 | /** Indicates a finger. */
136 | OH_NATIVEXCOMPONENT_TOOL_TYPE_FINGER,
137 | /** Indicates a stylus. */
138 | OH_NATIVEXCOMPONENT_TOOL_TYPE_PEN,
139 | /** Indicates a eraser. */
140 | OH_NATIVEXCOMPONENT_TOOL_TYPE_RUBBER,
141 | /** Indicates a brush. */
142 | OH_NATIVEXCOMPONENT_TOOL_TYPE_BRUSH,
143 | /** Indicates a pencil. */
144 | OH_NATIVEXCOMPONENT_TOOL_TYPE_PENCIL,
145 | /** Indicates a brush. */
146 | OH_NATIVEXCOMPONENT_TOOL_TYPE_AIRBRUSH,
147 | /** Indicates a mouse. */
148 | OH_NATIVEXCOMPONENT_TOOL_TYPE_MOUSE,
149 | /** Indicates a lens. */
150 | OH_NATIVEXCOMPONENT_TOOL_TYPE_LENS,
151 | }
152 |
153 | public enum OH_NativeXComponent_KeyCode
154 | {
155 | KEY_UNKNOWN = -1,
156 | KEY_FN = 0,
157 | KEY_HOME = 1,
158 | KEY_BACK = 2,
159 | KEY_MEDIA_PLAY_PAUSE = 10,
160 | KEY_MEDIA_STOP = 11,
161 | KEY_MEDIA_NEXT = 12,
162 | KEY_MEDIA_PREVIOUS = 13,
163 | KEY_MEDIA_REWIND = 14,
164 | KEY_MEDIA_FAST_FORWARD = 15,
165 | KEY_VOLUME_UP = 16,
166 | KEY_VOLUME_DOWN = 17,
167 | KEY_POWER = 18,
168 | KEY_CAMERA = 19,
169 | KEY_VOLUME_MUTE = 22,
170 | KEY_MUTE = 23,
171 | KEY_BRIGHTNESS_UP = 40,
172 | KEY_BRIGHTNESS_DOWN = 41,
173 | KEY_0 = 2000,
174 | KEY_1 = 2001,
175 | KEY_2 = 2002,
176 | KEY_3 = 2003,
177 | KEY_4 = 2004,
178 | KEY_5 = 2005,
179 | KEY_6 = 2006,
180 | KEY_7 = 2007,
181 | KEY_8 = 2008,
182 | KEY_9 = 2009,
183 | KEY_STAR = 2010,
184 | KEY_POUND = 2011,
185 | KEY_DPAD_UP = 2012,
186 | KEY_DPAD_DOWN = 2013,
187 | KEY_DPAD_LEFT = 2014,
188 | KEY_DPAD_RIGHT = 2015,
189 | KEY_DPAD_CENTER = 2016,
190 | KEY_A = 2017,
191 | KEY_B = 2018,
192 | KEY_C = 2019,
193 | KEY_D = 2020,
194 | KEY_E = 2021,
195 | KEY_F = 2022,
196 | KEY_G = 2023,
197 | KEY_H = 2024,
198 | KEY_I = 2025,
199 | KEY_J = 2026,
200 | KEY_K = 2027,
201 | KEY_L = 2028,
202 | KEY_M = 2029,
203 | KEY_N = 2030,
204 | KEY_O = 2031,
205 | KEY_P = 2032,
206 | KEY_Q = 2033,
207 | KEY_R = 2034,
208 | KEY_S = 2035,
209 | KEY_T = 2036,
210 | KEY_U = 2037,
211 | KEY_V = 2038,
212 | KEY_W = 2039,
213 | KEY_X = 2040,
214 | KEY_Y = 2041,
215 | KEY_Z = 2042,
216 | KEY_COMMA = 2043,
217 | KEY_PERIOD = 2044,
218 | KEY_ALT_LEFT = 2045,
219 | KEY_ALT_RIGHT = 2046,
220 | KEY_SHIFT_LEFT = 2047,
221 | KEY_SHIFT_RIGHT = 2048,
222 | KEY_TAB = 2049,
223 | KEY_SPACE = 2050,
224 | KEY_SYM = 2051,
225 | KEY_EXPLORER = 2052,
226 | KEY_ENVELOPE = 2053,
227 | KEY_ENTER = 2054,
228 | KEY_DEL = 2055,
229 | KEY_GRAVE = 2056,
230 | KEY_MINUS = 2057,
231 | KEY_EQUALS = 2058,
232 | KEY_LEFT_BRACKET = 2059,
233 | KEY_RIGHT_BRACKET = 2060,
234 | KEY_BACKSLASH = 2061,
235 | KEY_SEMICOLON = 2062,
236 | KEY_APOSTROPHE = 2063,
237 | KEY_SLASH = 2064,
238 | KEY_AT = 2065,
239 | KEY_PLUS = 2066,
240 | KEY_MENU = 2067,
241 | KEY_PAGE_UP = 2068,
242 | KEY_PAGE_DOWN = 2069,
243 | KEY_ESCAPE = 2070,
244 | KEY_FORWARD_DEL = 2071,
245 | KEY_CTRL_LEFT = 2072,
246 | KEY_CTRL_RIGHT = 2073,
247 | KEY_CAPS_LOCK = 2074,
248 | KEY_SCROLL_LOCK = 2075,
249 | KEY_META_LEFT = 2076,
250 | KEY_META_RIGHT = 2077,
251 | KEY_FUNCTION = 2078,
252 | KEY_SYSRQ = 2079,
253 | KEY_BREAK = 2080,
254 | KEY_MOVE_HOME = 2081,
255 | KEY_MOVE_END = 2082,
256 | KEY_INSERT = 2083,
257 | KEY_FORWARD = 2084,
258 | KEY_MEDIA_PLAY = 2085,
259 | KEY_MEDIA_PAUSE = 2086,
260 | KEY_MEDIA_CLOSE = 2087,
261 | KEY_MEDIA_EJECT = 2088,
262 | KEY_MEDIA_RECORD = 2089,
263 | KEY_F1 = 2090,
264 | KEY_F2 = 2091,
265 | KEY_F3 = 2092,
266 | KEY_F4 = 2093,
267 | KEY_F5 = 2094,
268 | KEY_F6 = 2095,
269 | KEY_F7 = 2096,
270 | KEY_F8 = 2097,
271 | KEY_F9 = 2098,
272 | KEY_F10 = 2099,
273 | KEY_F11 = 2100,
274 | KEY_F12 = 2101,
275 | KEY_NUM_LOCK = 2102,
276 | KEY_NUMPAD_0 = 2103,
277 | KEY_NUMPAD_1 = 2104,
278 | KEY_NUMPAD_2 = 2105,
279 | KEY_NUMPAD_3 = 2106,
280 | KEY_NUMPAD_4 = 2107,
281 | KEY_NUMPAD_5 = 2108,
282 | KEY_NUMPAD_6 = 2109,
283 | KEY_NUMPAD_7 = 2110,
284 | KEY_NUMPAD_8 = 2111,
285 | KEY_NUMPAD_9 = 2112,
286 | KEY_NUMPAD_DIVIDE = 2113,
287 | KEY_NUMPAD_MULTIPLY = 2114,
288 | KEY_NUMPAD_SUBTRACT = 2115,
289 | KEY_NUMPAD_ADD = 2116,
290 | KEY_NUMPAD_DOT = 2117,
291 | KEY_NUMPAD_COMMA = 2118,
292 | KEY_NUMPAD_ENTER = 2119,
293 | KEY_NUMPAD_EQUALS = 2120,
294 | KEY_NUMPAD_LEFT_PAREN = 2121,
295 | KEY_NUMPAD_RIGHT_PAREN = 2122,
296 | KEY_VIRTUAL_MULTITASK = 2210,
297 | KEY_SLEEP = 2600,
298 | KEY_ZENKAKU_HANKAKU = 2601,
299 | KEY_102ND = 2602,
300 | KEY_RO = 2603,
301 | KEY_KATAKANA = 2604,
302 | KEY_HIRAGANA = 2605,
303 | KEY_HENKAN = 2606,
304 | KEY_KATAKANA_HIRAGANA = 2607,
305 | KEY_MUHENKAN = 2608,
306 | KEY_LINEFEED = 2609,
307 | KEY_MACRO = 2610,
308 | KEY_NUMPAD_PLUSMINUS = 2611,
309 | KEY_SCALE = 2612,
310 | KEY_HANGUEL = 2613,
311 | KEY_HANJA = 2614,
312 | KEY_YEN = 2615,
313 | KEY_STOP = 2616,
314 | KEY_AGAIN = 2617,
315 | KEY_PROPS = 2618,
316 | KEY_UNDO = 2619,
317 | KEY_COPY = 2620,
318 | KEY_OPEN = 2621,
319 | KEY_PASTE = 2622,
320 | KEY_FIND = 2623,
321 | KEY_CUT = 2624,
322 | KEY_HELP = 2625,
323 | KEY_CALC = 2626,
324 | KEY_FILE = 2627,
325 | KEY_BOOKMARKS = 2628,
326 | KEY_NEXT = 2629,
327 | KEY_PLAYPAUSE = 2630,
328 | KEY_PREVIOUS = 2631,
329 | KEY_STOPCD = 2632,
330 | KEY_CONFIG = 2634,
331 | KEY_REFRESH = 2635,
332 | KEY_EXIT = 2636,
333 | KEY_EDIT = 2637,
334 | KEY_SCROLLUP = 2638,
335 | KEY_SCROLLDOWN = 2639,
336 | KEY_NEW = 2640,
337 | KEY_REDO = 2641,
338 | KEY_CLOSE = 2642,
339 | KEY_PLAY = 2643,
340 | KEY_BASSBOOST = 2644,
341 | KEY_PRINT = 2645,
342 | KEY_CHAT = 2646,
343 | KEY_FINANCE = 2647,
344 | KEY_CANCEL = 2648,
345 | KEY_KBDILLUM_TOGGLE = 2649,
346 | KEY_KBDILLUM_DOWN = 2650,
347 | KEY_KBDILLUM_UP = 2651,
348 | KEY_SEND = 2652,
349 | KEY_REPLY = 2653,
350 | KEY_FORWARDMAIL = 2654,
351 | KEY_SAVE = 2655,
352 | KEY_DOCUMENTS = 2656,
353 | KEY_VIDEO_NEXT = 2657,
354 | KEY_VIDEO_PREV = 2658,
355 | KEY_BRIGHTNESS_CYCLE = 2659,
356 | KEY_BRIGHTNESS_ZERO = 2660,
357 | KEY_DISPLAY_OFF = 2661,
358 | KEY_BTN_MISC = 2662,
359 | KEY_GOTO = 2663,
360 | KEY_INFO = 2664,
361 | KEY_PROGRAM = 2665,
362 | KEY_PVR = 2666,
363 | KEY_SUBTITLE = 2667,
364 | KEY_FULL_SCREEN = 2668,
365 | KEY_KEYBOARD = 2669,
366 | KEY_ASPECT_RATIO = 2670,
367 | KEY_PC = 2671,
368 | KEY_TV = 2672,
369 | KEY_TV2 = 2673,
370 | KEY_VCR = 2674,
371 | KEY_VCR2 = 2675,
372 | KEY_SAT = 2676,
373 | KEY_CD = 2677,
374 | KEY_TAPE = 2678,
375 | KEY_TUNER = 2679,
376 | KEY_PLAYER = 2680,
377 | KEY_DVD = 2681,
378 | KEY_AUDIO = 2682,
379 | KEY_VIDEO = 2683,
380 | KEY_MEMO = 2684,
381 | KEY_CALENDAR = 2685,
382 | KEY_RED = 2686,
383 | KEY_GREEN = 2687,
384 | KEY_YELLOW = 2688,
385 | KEY_BLUE = 2689,
386 | KEY_CHANNELUP = 2690,
387 | KEY_CHANNELDOWN = 2691,
388 | KEY_LAST = 2692,
389 | KEY_RESTART = 2693,
390 | KEY_SLOW = 2694,
391 | KEY_SHUFFLE = 2695,
392 | KEY_VIDEOPHONE = 2696,
393 | KEY_GAMES = 2697,
394 | KEY_ZOOMIN = 2698,
395 | KEY_ZOOMOUT = 2699,
396 | KEY_ZOOMRESET = 2700,
397 | KEY_WORDPROCESSOR = 2701,
398 | KEY_EDITOR = 2702,
399 | KEY_SPREADSHEET = 2703,
400 | KEY_GRAPHICSEDITOR = 2704,
401 | KEY_PRESENTATION = 2705,
402 | KEY_DATABASE = 2706,
403 | KEY_NEWS = 2707,
404 | KEY_VOICEMAIL = 2708,
405 | KEY_ADDRESSBOOK = 2709,
406 | KEY_MESSENGER = 2710,
407 | KEY_BRIGHTNESS_TOGGLE = 2711,
408 | KEY_SPELLCHECK = 2712,
409 | KEY_COFFEE = 2713,
410 | KEY_MEDIA_REPEAT = 2714,
411 | KEY_IMAGES = 2715,
412 | KEY_BUTTONCONFIG = 2716,
413 | KEY_TASKMANAGER = 2717,
414 | KEY_JOURNAL = 2718,
415 | KEY_CONTROLPANEL = 2719,
416 | KEY_APPSELECT = 2720,
417 | KEY_SCREENSAVER = 2721,
418 | KEY_ASSISTANT = 2722,
419 | KEY_KBD_LAYOUT_NEXT = 2723,
420 | KEY_BRIGHTNESS_MIN = 2724,
421 | KEY_BRIGHTNESS_MAX = 2725,
422 | KEY_KBDINPUTASSIST_PREV = 2726,
423 | KEY_KBDINPUTASSIST_NEXT = 2727,
424 | KEY_KBDINPUTASSIST_PREVGROUP = 2728,
425 | KEY_KBDINPUTASSIST_NEXTGROUP = 2729,
426 | KEY_KBDINPUTASSIST_ACCEPT = 2730,
427 | KEY_KBDINPUTASSIST_CANCEL = 2731,
428 | KEY_FRONT = 2800,
429 | KEY_SETUP = 2801,
430 | KEY_WAKEUP = 2802,
431 | KEY_SENDFILE = 2803,
432 | KEY_DELETEFILE = 2804,
433 | KEY_XFER = 2805,
434 | KEY_PROG1 = 2806,
435 | KEY_PROG2 = 2807,
436 | KEY_MSDOS = 2808,
437 | KEY_SCREENLOCK = 2809,
438 | KEY_DIRECTION_ROTATE_DISPLAY = 2810,
439 | KEY_CYCLEWINDOWS = 2811,
440 | KEY_COMPUTER = 2812,
441 | KEY_EJECTCLOSECD = 2813,
442 | KEY_ISO = 2814,
443 | KEY_MOVE = 2815,
444 | KEY_F13 = 2816,
445 | KEY_F14 = 2817,
446 | KEY_F15 = 2818,
447 | KEY_F16 = 2819,
448 | KEY_F17 = 2820,
449 | KEY_F18 = 2821,
450 | KEY_F19 = 2822,
451 | KEY_F20 = 2823,
452 | KEY_F21 = 2824,
453 | KEY_F22 = 2825,
454 | KEY_F23 = 2826,
455 | KEY_F24 = 2827,
456 | KEY_PROG3 = 2828,
457 | KEY_PROG4 = 2829,
458 | KEY_DASHBOARD = 2830,
459 | KEY_SUSPEND = 2831,
460 | KEY_HP = 2832,
461 | KEY_SOUND = 2833,
462 | KEY_QUESTION = 2834,
463 | KEY_CONNECT = 2836,
464 | KEY_SPORT = 2837,
465 | KEY_SHOP = 2838,
466 | KEY_ALTERASE = 2839,
467 | KEY_SWITCHVIDEOMODE = 2841,
468 | KEY_BATTERY = 2842,
469 | KEY_BLUETOOTH = 2843,
470 | KEY_WLAN = 2844,
471 | KEY_UWB = 2845,
472 | KEY_WWAN_WIMAX = 2846,
473 | KEY_RFKILL = 2847,
474 | KEY_CHANNEL = 3001,
475 | KEY_BTN_0 = 3100,
476 | KEY_BTN_1 = 3101,
477 | KEY_BTN_2 = 3102,
478 | KEY_BTN_3 = 3103,
479 | KEY_BTN_4 = 3104,
480 | KEY_BTN_5 = 3105,
481 | KEY_BTN_6 = 3106,
482 | KEY_BTN_7 = 3107,
483 | KEY_BTN_8 = 3108,
484 | KEY_BTN_9 = 3109,
485 | }
486 |
487 | public struct OH_NativeXComponent_HistoricalPoint
488 | {
489 | /** Unique identifier of a finger. */
490 | public int id;
491 | /** X coordinate of the touch point relative to the left edge of the screen. */
492 | public float screenX;
493 | /** Y coordinate of the touch point relative to the upper edge of the screen. */
494 | public float screenY;
495 | /** X coordinate of the touch point relative to the left edge of the element to touch. */
496 | public float x;
497 | /** Y coordinate of the touch point relative to the upper edge of the element to touch. */
498 | public float y;
499 | /** Touch type of the touch event. */
500 | public OH_NativeXComponent_TouchEventType type;
501 | /** Contact area between the finger pad and the screen. */
502 | public double size;
503 | /** Pressure of the current touch event. */
504 | public float force;
505 | /** Timestamp of the current touch event. */
506 | public long timeStamp;
507 | /** The angle betweenprojection on plane-X-Y and axis-Z of the current touch event. */
508 | public float titlX;
509 | /** The angle betweenprojection on plane-Y-Z and axis-Z of the current touch event. */
510 | public float titlY;
511 | /** The sourceTool of the current touch event. */
512 | public OH_NativeXComponent_TouchEvent_SourceTool sourceTool;
513 | }
514 |
515 | /**
516 | * @brief Represents the source tool type of TouchEvent
517 | *
518 | * @since 10
519 | * @version 1.0
520 | */
521 | public enum OH_NativeXComponent_TouchEvent_SourceTool
522 | {
523 | OH_NATIVEXCOMPONENT_SOURCETOOL_UNKNOWN = 0,
524 | OH_NATIVEXCOMPONENT_SOURCETOOL_FINGER = 1,
525 | OH_NATIVEXCOMPONENT_SOURCETOOL_PEN = 2,
526 | OH_NATIVEXCOMPONENT_SOURCETOOL_RUBBER = 3,
527 | OH_NATIVEXCOMPONENT_SOURCETOOL_BRUSH = 4,
528 | OH_NATIVEXCOMPONENT_SOURCETOOL_PENCIL = 5,
529 | OH_NATIVEXCOMPONENT_SOURCETOOL_AIRBRUSH = 6,
530 | OH_NATIVEXCOMPONENT_SOURCETOOL_MOUSE = 7,
531 | OH_NATIVEXCOMPONENT_SOURCETOOL_LENS = 8,
532 | OH_NATIVEXCOMPONENT_SOURCETOOL_TOUCHPAD = 9,
533 | }
534 |
535 | public struct OH_NativeXComponent_MouseEvent
536 | {
537 | /** X coordinate of the mouse point relative to the left edge of the element to mouse. */
538 | public float x;
539 | /** Y coordinate of the mouse point relative to the upper edge of the element to mouse. */
540 | public float y;
541 | /** X coordinate of the mouse point relative to the left edge of the screen. */
542 | public float screenX;
543 | /** Y coordinate of the mouse point relative to the upper edge of the screen. */
544 | public float screenY;
545 | /** Timestamp of the current mouse event. */
546 | public long timestamp;
547 | /** Mouse event action. */
548 | public OH_NativeXComponent_MouseEventAction action;
549 | /** Mouse event button. */
550 | public OH_NativeXComponent_MouseEventButton button;
551 | }
552 | ;
553 | public enum OH_NativeXComponent_MouseEventAction
554 | {
555 | OH_NATIVEXCOMPONENT_MOUSE_NONE = 0,
556 | OH_NATIVEXCOMPONENT_MOUSE_PRESS,
557 | OH_NATIVEXCOMPONENT_MOUSE_RELEASE,
558 | OH_NATIVEXCOMPONENT_MOUSE_MOVE,
559 | }
560 | public enum OH_NativeXComponent_MouseEventButton
561 | {
562 | OH_NATIVEXCOMPONENT_NONE_BUTTON = 0,
563 | OH_NATIVEXCOMPONENT_LEFT_BUTTON = 0x01,
564 | OH_NATIVEXCOMPONENT_RIGHT_BUTTON = 0x02,
565 | OH_NATIVEXCOMPONENT_MIDDLE_BUTTON = 0x04,
566 | OH_NATIVEXCOMPONENT_BACK_BUTTON = 0x08,
567 | OH_NATIVEXCOMPONENT_FORWARD_BUTTON = 0x10,
568 | }
569 |
570 | public struct ArkUI_NodeHandle
571 | {
572 | public nint Pointer;
573 | }
574 | public struct ArkUI_UIInputEvent { };
575 |
576 | public enum ArkUI_UIInputEvent_Type
577 | {
578 | ARKUI_UIINPUTEVENT_TYPE_UNKNOWN = 0,
579 | ARKUI_UIINPUTEVENT_TYPE_TOUCH = 1,
580 | ARKUI_UIINPUTEVENT_TYPE_AXIS = 2,
581 | /** Mouse event. */
582 | ARKUI_UIINPUTEVENT_TYPE_MOUSE = 3,
583 | }
584 |
585 | public enum HitTestMode
586 | {
587 | /** Both the node and its child node respond to the hit test of a touch event, but its sibling node is blocked from
588 | * the hit test.
589 | */
590 | HTM_DEFAULT = 0,
591 |
592 | /** The node responds to the hit test of a touch event, but its child node and sibling node are blocked from the hit
593 | * test.
594 | */
595 | HTM_BLOCK,
596 |
597 | /** Both the node and its child node respond to the hit test of a touch event, and its sibling node is also
598 | * considered during the hit test.
599 | */
600 | HTM_TRANSPARENT,
601 |
602 | /** The node does not respond to the hit test of a touch event, but its child node and sibling node are considered
603 | * during the hit test.
604 | */
605 | HTM_NONE,
606 | }
607 |
608 | public struct ArkUI_AccessibilityProvider { };
--------------------------------------------------------------------------------
/OpenHarmony.NDK.Bindings/arkui/ArkUI.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel.DataAnnotations;
3 | using System.Runtime.InteropServices;
4 |
5 | namespace OpenHarmony.NDK.Bindings.Native;
6 |
7 | public unsafe static partial class ArkUI
8 | {
9 | [LibraryImport("libace_ndk.z.so")]
10 | public static partial ArkUI_DragEvent* OH_ArkUI_NodeEvent_GetDragEvent(ArkUI_NodeEvent* nodeEvent);
11 |
12 | [LibraryImport("libace_ndk.z.so")]
13 | public static partial ArkUI_PreDragStatus OH_ArkUI_NodeEvent_GetPreDragStatus(ArkUI_NodeEvent* nodeEvent);
14 |
15 | [LibraryImport("libace_ndk.z.so")]
16 | public static partial int OH_ArkUI_DragEvent_DisableDefaultDropAnimation(ArkUI_DragEvent* @event, [MarshalAs(UnmanagedType.Bool)]bool disable);
17 |
18 | [LibraryImport("libace_ndk.z.so")]
19 | public static partial int OH_ArkUI_DragEvent_SetSuggestedDropOperation(ArkUI_DragEvent* @event, ArkUI_DropOperation dropOperation);
20 |
21 | [LibraryImport("libace_ndk.z.so")]
22 | public static partial int OH_ArkUI_DragEvent_SetDragResult(ArkUI_DragEvent* @event, ArkUI_DragResult result);
23 |
24 | [LibraryImport("libace_ndk.z.so")]
25 | public static partial int OH_ArkUI_DragEvent_SetData(ArkUI_DragEvent* @event, OH_UdmfData* data);
26 |
27 | [LibraryImport("libace_ndk.z.so")]
28 | public static partial int OH_ArkUI_DragAction_SetDragPreviewOption(ArkUI_DragAction* dragAction, ArkUI_DragPreviewOption* option);
29 |
30 | [LibraryImport("libace_ndk.z.so")]
31 | public static partial int OH_ArkUI_DragAction_RegisterStatusListener(ArkUI_DragAction* dragAction, void* userData, delegate* unmanaged[Cdecl] listener);
32 |
33 | [LibraryImport("libace_ndk.z.so")]
34 | public static partial void OH_ArkUI_DragAction_UnregisterStatusListener(ArkUI_DragAction* dragAction);
35 |
36 | [LibraryImport("libace_ndk.z.so")]
37 | public static partial ArkUI_DragStatus OH_ArkUI_DragAndDropInfo_GetDragStatus(ArkUI_DragAndDropInfo* dragAndDropInfo);
38 |
39 | [LibraryImport("libace_ndk.z.so")]
40 | public static partial ArkUI_DragEvent* OH_ArkUI_DragAndDropInfo_GetDragEvent(ArkUI_DragAndDropInfo* dragAndDropInfo);
41 |
42 | [LibraryImport("libace_ndk.z.so")]
43 | public static partial int OH_ArkUI_StartDrag(ArkUI_DragAction* dragAction);
44 |
45 | [LibraryImport("libace_ndk.z.so")]
46 | public static partial ArkUI_DrawableDescriptor* OH_ArkUI_DrawableDescriptor_CreateFromPixelMap(OH_PixelmapNativeHandle pixelMap);
47 |
48 |
49 | [LibraryImport("libace_ndk.z.so")]
50 | public static partial ArkUI_DrawableDescriptor* OH_ArkUI_DrawableDescriptor_CreateFromAnimatedPixelMap(OH_PixelmapNativeHandle* array, int size);
51 |
52 | [LibraryImport("libace_ndk.z.so")]
53 | public static partial void OH_ArkUI_DrawableDescriptor_Dispose(ArkUI_DrawableDescriptor* drawableDescriptor);
54 |
55 | [LibraryImport("libace_ndk.z.so")]
56 | public static partial OH_PixelmapNativeHandle OH_ArkUI_DrawableDescriptor_GetStaticPixelMap(ArkUI_DrawableDescriptor* drawableDescriptor);
57 |
58 | [LibraryImport("libace_ndk.z.so")]
59 | public static partial OH_PixelmapNativeHandle* OH_ArkUI_DrawableDescriptor_GetAnimatedPixelMapArray(ArkUI_DrawableDescriptor* drawableDescriptor);
60 |
61 | [LibraryImport("libace_ndk.z.so")]
62 | public static partial int OH_ArkUI_DrawableDescriptor_GetAnimatedPixelMapArraySize(ArkUI_DrawableDescriptor* drawableDescriptor);
63 |
64 | [LibraryImport("libace_ndk.z.so")]
65 | public static partial void OH_ArkUI_DrawableDescriptor_SetAnimationDuration(ArkUI_DrawableDescriptor* drawableDescriptor, int duration);
66 |
67 | [LibraryImport("libace_ndk.z.so")]
68 | public static partial int OH_ArkUI_DrawableDescriptor_GetAnimationDuration(ArkUI_DrawableDescriptor* drawableDescriptor);
69 |
70 | [LibraryImport("libace_ndk.z.so")]
71 | public static partial void OH_ArkUI_DrawableDescriptor_SetAnimationIteration(ArkUI_DrawableDescriptor* drawableDescriptor, int iteration);
72 |
73 | [LibraryImport("libace_ndk.z.so")]
74 | public static partial int OH_ArkUI_DrawableDescriptor_GetAnimationIteration(ArkUI_DrawableDescriptor* drawableDescriptor);
75 |
76 |
77 | [LibraryImport("libace_ndk.z.so")]
78 | public static partial ArkUI_AnimateOption* OH_ArkUI_AnimateOption_Create();
79 |
80 |
81 | [LibraryImport("libace_ndk.z.so")]
82 | public static partial void OH_ArkUI_AnimateOption_Dispose(ArkUI_AnimateOption* option);
83 |
84 |
85 | [LibraryImport("libace_ndk.z.so")]
86 | public static partial uint OH_ArkUI_AnimateOption_GetDuration(ArkUI_AnimateOption* option);
87 |
88 |
89 | [LibraryImport("libace_ndk.z.so")]
90 | public static partial float OH_ArkUI_AnimateOption_GetTempo(ArkUI_AnimateOption* option);
91 |
92 |
93 | [LibraryImport("libace_ndk.z.so")]
94 | public static partial ArkUI_AnimationCurve OH_ArkUI_AnimateOption_GetCurve(ArkUI_AnimateOption* option);
95 |
96 |
97 | [LibraryImport("libace_ndk.z.so")]
98 | public static partial int OH_ArkUI_AnimateOption_GetDelay(ArkUI_AnimateOption* option);
99 |
100 |
101 | [LibraryImport("libace_ndk.z.so")]
102 | public static partial int OH_ArkUI_AnimateOption_GetIterations(ArkUI_AnimateOption* option);
103 |
104 |
105 | [LibraryImport("libace_ndk.z.so")]
106 | public static partial ArkUI_AnimationPlayMode OH_ArkUI_AnimateOption_GetPlayMode(ArkUI_AnimateOption* option);
107 |
108 |
109 | [LibraryImport("libace_ndk.z.so")]
110 | public static partial ArkUI_ExpectedFrameRateRange* OH_ArkUI_AnimateOption_GetExpectedFrameRateRange(ArkUI_AnimateOption* option);
111 |
112 |
113 | [LibraryImport("libace_ndk.z.so")]
114 | public static partial void OH_ArkUI_AnimateOption_SetDuration(ArkUI_AnimateOption* option, int value);
115 |
116 |
117 | [LibraryImport("libace_ndk.z.so")]
118 | public static partial void OH_ArkUI_AnimateOption_SetTempo(ArkUI_AnimateOption* option, float value);
119 |
120 |
121 | [LibraryImport("libace_ndk.z.so")]
122 | public static partial void OH_ArkUI_AnimateOption_SetCurve(ArkUI_AnimateOption* option, ArkUI_AnimationCurve value);
123 |
124 |
125 | [LibraryImport("libace_ndk.z.so")]
126 | public static partial void OH_ArkUI_AnimateOption_SetDelay(ArkUI_AnimateOption* option, int value);
127 |
128 | [LibraryImport("libace_ndk.z.so")]
129 | public static partial void OH_ArkUI_AnimateOption_SetIterations(ArkUI_AnimateOption* option, int value);
130 |
131 | [LibraryImport("libace_ndk.z.so")]
132 | public static partial void OH_ArkUI_AnimateOption_SetPlayMode(ArkUI_AnimateOption* option, ArkUI_AnimationPlayMode value);
133 |
134 | [LibraryImport("libace_ndk.z.so")]
135 | public static partial void OH_ArkUI_AnimateOption_SetExpectedFrameRateRange(ArkUI_AnimateOption* option, ArkUI_ExpectedFrameRateRange* value);
136 |
137 | [LibraryImport("libace_ndk.z.so")]
138 | public static partial void OH_ArkUI_AnimateOption_SetICurve(ArkUI_AnimateOption* option, ArkUI_CurveHandle value);
139 |
140 | [LibraryImport("libace_ndk.z.so")]
141 | public static partial ArkUI_CurveHandle OH_ArkUI_AnimateOption_GetICurve(ArkUI_AnimateOption* option);
142 |
143 | [LibraryImport("libace_ndk.z.so")]
144 | public static partial ArkUI_KeyframeAnimateOption* OH_ArkUI_KeyframeAnimateOption_Create(int size);
145 |
146 | [LibraryImport("libace_ndk.z.so")]
147 | public static partial void OH_ArkUI_KeyframeAnimateOption_Dispose(ArkUI_KeyframeAnimateOption* option);
148 |
149 | [LibraryImport("libace_ndk.z.so")]
150 | public static partial int OH_ArkUI_KeyframeAnimateOption_SetDelay(ArkUI_KeyframeAnimateOption* option, int value);
151 |
152 | [LibraryImport("libace_ndk.z.so")]
153 | public static partial int OH_ArkUI_KeyframeAnimateOption_SetIterations(ArkUI_KeyframeAnimateOption* option, int value);
154 |
155 | [LibraryImport("libace_ndk.z.so")]
156 | public static partial int OH_ArkUI_KeyframeAnimateOption_RegisterOnFinishCallback(ArkUI_KeyframeAnimateOption* option, void* userData, delegate* unmanaged[Cdecl] onFinish);
157 |
158 | [LibraryImport("libace_ndk.z.so")]
159 | public static partial int OH_ArkUI_KeyframeAnimateOption_SetDuration(ArkUI_KeyframeAnimateOption* option, int value, int index);
160 |
161 | [LibraryImport("libace_ndk.z.so")]
162 | public static partial int OH_ArkUI_KeyframeAnimateOption_SetCurve(ArkUI_KeyframeAnimateOption* option, ArkUI_CurveHandle value, int index);
163 |
164 | [LibraryImport("libace_ndk.z.so")]
165 | public static partial int OH_ArkUI_KeyframeAnimateOption_RegisterOnEventCallback(ArkUI_KeyframeAnimateOption* option, void* userData, delegate* unmanaged[Cdecl] @event, int index);
166 |
167 | [LibraryImport("libace_ndk.z.so")]
168 | public static partial int OH_ArkUI_KeyframeAnimateOption_GetDelay(ArkUI_KeyframeAnimateOption* option);
169 |
170 |
171 | [LibraryImport("libace_ndk.z.so")]
172 | public static partial int OH_ArkUI_KeyframeAnimateOption_GetIterations(ArkUI_KeyframeAnimateOption* option);
173 |
174 |
175 | [LibraryImport("libace_ndk.z.so")]
176 | public static partial int OH_ArkUI_KeyframeAnimateOption_GetDuration(ArkUI_KeyframeAnimateOption* option, int index);
177 |
178 |
179 | [LibraryImport("libace_ndk.z.so")]
180 | public static partial ArkUI_CurveHandle OH_ArkUI_KeyframeAnimateOption_GetCurve(ArkUI_KeyframeAnimateOption* option, int index);
181 |
182 |
183 | [LibraryImport("libace_ndk.z.so")]
184 | public static partial ArkUI_AnimatorOption* OH_ArkUI_AnimatorOption_Create(int keyframeSize);
185 |
186 |
187 | [LibraryImport("libace_ndk.z.so")]
188 | public static partial void OH_ArkUI_AnimatorOption_Dispose(ArkUI_AnimatorOption* option);
189 |
190 |
191 | [LibraryImport("libace_ndk.z.so")]
192 | public static partial int OH_ArkUI_AnimatorOption_SetDuration(ArkUI_AnimatorOption* option, int value);
193 |
194 |
195 | [LibraryImport("libace_ndk.z.so")]
196 | public static partial int OH_ArkUI_AnimatorOption_SetDelay(ArkUI_AnimatorOption* option, int value);
197 |
198 |
199 | [LibraryImport("libace_ndk.z.so")]
200 | public static partial int OH_ArkUI_AnimatorOption_SetIterations(ArkUI_AnimatorOption* option, int value);
201 |
202 |
203 | [LibraryImport("libace_ndk.z.so")]
204 | public static partial int OH_ArkUI_AnimatorOption_SetFill(ArkUI_AnimatorOption* option, ArkUI_AnimationFillMode value);
205 |
206 |
207 | [LibraryImport("libace_ndk.z.so")]
208 | public static partial int OH_ArkUI_AnimatorOption_SetDirection(ArkUI_AnimatorOption* option, ArkUI_AnimationDirection value);
209 |
210 |
211 | [LibraryImport("libace_ndk.z.so")]
212 | public static partial int OH_ArkUI_AnimatorOption_SetCurve(ArkUI_AnimatorOption* option, ArkUI_CurveHandle value);
213 |
214 |
215 | [LibraryImport("libace_ndk.z.so")]
216 | public static partial int OH_ArkUI_AnimatorOption_SetBegin(ArkUI_AnimatorOption* option, float value);
217 |
218 |
219 | [LibraryImport("libace_ndk.z.so")]
220 | public static partial int OH_ArkUI_AnimatorOption_SetEnd(ArkUI_AnimatorOption* option, float value);
221 |
222 |
223 | [LibraryImport("libace_ndk.z.so")]
224 | public static partial int OH_ArkUI_AnimatorOption_SetExpectedFrameRateRange(
225 | ArkUI_AnimatorOption* option, ArkUI_ExpectedFrameRateRange* value);
226 |
227 | [LibraryImport("libace_ndk.z.so")]
228 | public static partial int OH_ArkUI_AnimatorOption_SetKeyframe(
229 | ArkUI_AnimatorOption* option, float time, float value, int index);
230 |
231 |
232 | [LibraryImport("libace_ndk.z.so")]
233 | public static partial int OH_ArkUI_AnimatorOption_SetKeyframeCurve(ArkUI_AnimatorOption* option, ArkUI_CurveHandle value, int index);
234 |
235 | [LibraryImport("libace_ndk.z.so")]
236 | public static partial int OH_ArkUI_AnimatorOption_GetDuration(ArkUI_AnimatorOption* option);
237 |
238 |
239 | [LibraryImport("libace_ndk.z.so")]
240 | public static partial int OH_ArkUI_AnimatorOption_GetDelay(ArkUI_AnimatorOption* option);
241 |
242 |
243 | [LibraryImport("libace_ndk.z.so")]
244 | public static partial int OH_ArkUI_AnimatorOption_GetIterations(ArkUI_AnimatorOption* option);
245 |
246 |
247 | [LibraryImport("libace_ndk.z.so")]
248 | public static partial ArkUI_AnimationFillMode OH_ArkUI_AnimatorOption_GetFill(ArkUI_AnimatorOption* option);
249 |
250 | [LibraryImport("libace_ndk.z.so")]
251 | public static partial ArkUI_AnimationDirection OH_ArkUI_AnimatorOption_GetDirection(ArkUI_AnimatorOption* option);
252 |
253 | [LibraryImport("libace_ndk.z.so")]
254 | public static partial ArkUI_CurveHandle OH_ArkUI_AnimatorOption_GetCurve(ArkUI_AnimatorOption* option);
255 |
256 | [LibraryImport("libace_ndk.z.so")]
257 | public static partial float OH_ArkUI_AnimatorOption_GetBegin(ArkUI_AnimatorOption* option);
258 |
259 | [LibraryImport("libace_ndk.z.so")]
260 | public static partial float OH_ArkUI_AnimatorOption_GetEnd(ArkUI_AnimatorOption* option);
261 |
262 | [LibraryImport("libace_ndk.z.so")]
263 | public static partial ArkUI_ExpectedFrameRateRange* OH_ArkUI_AnimatorOption_GetExpectedFrameRateRange(ArkUI_AnimatorOption* option);
264 |
265 | [LibraryImport("libace_ndk.z.so")]
266 | public static partial float OH_ArkUI_AnimatorOption_GetKeyframeTime(ArkUI_AnimatorOption* option, int index);
267 |
268 | [LibraryImport("libace_ndk.z.so")]
269 | public static partial float OH_ArkUI_AnimatorOption_GetKeyframeValue(ArkUI_AnimatorOption* option, int index);
270 |
271 | [LibraryImport("libace_ndk.z.so")]
272 | public static partial ArkUI_CurveHandle OH_ArkUI_AnimatorOption_GetKeyframeCurve(ArkUI_AnimatorOption* option, int index);
273 |
274 | [LibraryImport("libace_ndk.z.so")]
275 | public static partial void* OH_ArkUI_AnimatorEvent_GetUserData(ArkUI_AnimatorEvent* @event);
276 |
277 | [LibraryImport("libace_ndk.z.so")]
278 | public static partial void* OH_ArkUI_AnimatorOnFrameEvent_GetUserData(ArkUI_AnimatorOnFrameEvent* @event);
279 |
280 | [LibraryImport("libace_ndk.z.so")]
281 | public static partial float OH_ArkUI_AnimatorOnFrameEvent_GetValue(ArkUI_AnimatorOnFrameEvent* @event);
282 |
283 | [LibraryImport("libace_ndk.z.so")]
284 | public static partial int OH_ArkUI_AnimatorOption_RegisterOnFrameCallback(
285 | ArkUI_AnimatorOption* option, void* userData, delegate* unmanaged[Cdecl] callback);
286 |
287 | [LibraryImport("libace_ndk.z.so")]
288 | public static partial int OH_ArkUI_AnimatorOption_RegisterOnFinishCallback(ArkUI_AnimatorOption* option, void* userData, delegate* unmanaged[Cdecl] callback);
289 |
290 | [LibraryImport("libace_ndk.z.so")]
291 | public static partial int OH_ArkUI_AnimatorOption_RegisterOnCancelCallback(ArkUI_AnimatorOption* option, void* userData, delegate* unmanaged[Cdecl] callback);
292 |
293 |
294 | [LibraryImport("libace_ndk.z.so")]
295 | public static partial int OH_ArkUI_AnimatorOption_RegisterOnRepeatCallback(ArkUI_AnimatorOption* option, void* userData, delegate* unmanaged[Cdecl] callback);
296 |
297 | [LibraryImport("libace_ndk.z.so")]
298 | public static partial int OH_ArkUI_Animator_ResetAnimatorOption(
299 | ArkUI_AnimatorHandle animatorHandle, ArkUI_AnimatorOption* option);
300 |
301 | [LibraryImport("libace_ndk.z.so")]
302 | public static partial int OH_ArkUI_Animator_Play(ArkUI_AnimatorHandle animatorHandle);
303 |
304 | [LibraryImport("libace_ndk.z.so")]
305 | public static partial int OH_ArkUI_Animator_Finish(ArkUI_AnimatorHandle animatorHandle);
306 |
307 | [LibraryImport("libace_ndk.z.so")]
308 | public static partial int OH_ArkUI_Animator_Pause(ArkUI_AnimatorHandle animatorHandle);
309 |
310 | [LibraryImport("libace_ndk.z.so")]
311 | public static partial int OH_ArkUI_Animator_Cancel(ArkUI_AnimatorHandle animatorHandle);
312 |
313 | [LibraryImport("libace_ndk.z.so")]
314 | public static partial int OH_ArkUI_Animator_Reverse(ArkUI_AnimatorHandle animatorHandle);
315 |
316 | [LibraryImport("libace_ndk.z.so")]
317 | public static partial ArkUI_CurveHandle OH_ArkUI_Curve_CreateCurveByType(ArkUI_AnimationCurve curve);
318 |
319 | [LibraryImport("libace_ndk.z.so")]
320 | public static partial ArkUI_CurveHandle OH_ArkUI_Curve_CreateStepsCurve(int count, [MarshalAs(UnmanagedType.Bool)]bool end);
321 |
322 | [LibraryImport("libace_ndk.z.so")]
323 | public static partial ArkUI_CurveHandle OH_ArkUI_Curve_CreateCubicBezierCurve(float x1, float y1, float x2, float y2);
324 |
325 | [LibraryImport("libace_ndk.z.so")]
326 | public static partial ArkUI_CurveHandle OH_ArkUI_Curve_CreateSpringCurve(float velocity, float mass, float stiffness, float damping);
327 |
328 | [LibraryImport("libace_ndk.z.so")]
329 | public static partial ArkUI_CurveHandle OH_ArkUI_Curve_CreateSpringMotion(float response, float dampingFraction, float overlapDuration);
330 |
331 | [LibraryImport("libace_ndk.z.so")]
332 | public static partial ArkUI_CurveHandle OH_ArkUI_Curve_CreateResponsiveSpringMotion(
333 | float response, float dampingFraction, float overlapDuration);
334 |
335 | [LibraryImport("libace_ndk.z.so")]
336 | public static partial ArkUI_CurveHandle OH_ArkUI_Curve_CreateInterpolatingSpring(float velocity, float mass, float stiffness, float damping);
337 |
338 | [LibraryImport("libace_ndk.z.so")]
339 | public static partial ArkUI_CurveHandle OH_ArkUI_Curve_CreateCustomCurve(void* userData, delegate* unmanaged[Cdecl] interpolate);
340 |
341 | [LibraryImport("libace_ndk.z.so")]
342 | public static partial void OH_ArkUI_Curve_DisposeCurve(ArkUI_CurveHandle curveHandle);
343 |
344 | [LibraryImport("libace_ndk.z.so")]
345 | public static partial ArkUI_TransitionEffect* OH_ArkUI_CreateOpacityTransitionEffect(float opacity);
346 |
347 | [LibraryImport("libace_ndk.z.so")]
348 | public static partial ArkUI_TransitionEffect* OH_ArkUI_CreateTranslationTransitionEffect(ArkUI_TranslationOptions* translate);
349 |
350 | [LibraryImport("libace_ndk.z.so")]
351 | public static partial ArkUI_TransitionEffect* OH_ArkUI_CreateScaleTransitionEffect(ArkUI_ScaleOptions* scale);
352 |
353 | [LibraryImport("libace_ndk.z.so")]
354 | public static partial ArkUI_TransitionEffect* OH_ArkUI_CreateRotationTransitionEffect(ArkUI_RotationOptions* rotate);
355 |
356 | [LibraryImport("libace_ndk.z.so")]
357 | public static partial ArkUI_TransitionEffect* OH_ArkUI_CreateMovementTransitionEffect(ArkUI_TransitionEdge edge);
358 |
359 | [LibraryImport("libace_ndk.z.so")]
360 | public static partial ArkUI_TransitionEffect* OH_ArkUI_CreateAsymmetricTransitionEffect(
361 | ArkUI_TransitionEffect* appear, ArkUI_TransitionEffect* disappear);
362 |
363 | [LibraryImport("libace_ndk.z.so")]
364 | public static partial void OH_ArkUI_TransitionEffect_Dispose(ArkUI_TransitionEffect* effect);
365 |
366 | [LibraryImport("libace_ndk.z.so")]
367 | public static partial int OH_ArkUI_TransitionEffect_Combine(
368 | ArkUI_TransitionEffect* firstEffect, ArkUI_TransitionEffect* secondEffect);
369 |
370 | [LibraryImport("libace_ndk.z.so")]
371 | public static partial int OH_ArkUI_TransitionEffect_SetAnimation(
372 | ArkUI_TransitionEffect* effect, ArkUI_AnimateOption* animation);
373 |
374 | [LibraryImport("libace_ndk.z.so")]
375 | public static partial void OH_ArkUI_DialogDismissEvent_SetShouldBlockDismiss(ArkUI_DialogDismissEvent* @event, [MarshalAs(UnmanagedType.Bool)]bool shouldBlockDismiss);
376 |
377 | [LibraryImport("libace_ndk.z.so")]
378 | public static partial void* OH_ArkUI_DialogDismissEvent_GetUserData(ArkUI_DialogDismissEvent* @event);
379 |
380 | [LibraryImport("libace_ndk.z.so")]
381 | public static partial int OH_ArkUI_DialogDismissEvent_GetDismissReason(ArkUI_DialogDismissEvent* @event);
382 |
383 | [LibraryImport("libace_ndk.z.so")]
384 | [return: MarshalAs(UnmanagedType.Bool)]
385 | public static partial bool OH_ArkUI_GestureInterruptInfo_GetSystemFlag(ArkUI_GestureInterruptInfo* @event);
386 |
387 | [LibraryImport("libace_ndk.z.so")]
388 | public static partial ArkUI_GestureRecognizer* OH_ArkUI_GestureInterruptInfo_GetRecognizer(ArkUI_GestureInterruptInfo* @event);
389 |
390 | [LibraryImport("libace_ndk.z.so")]
391 | public static partial ArkUI_GestureEvent* OH_ArkUI_GestureInterruptInfo_GetGestureEvent(ArkUI_GestureInterruptInfo* @event);
392 |
393 | [LibraryImport("libace_ndk.z.so")]
394 | public static partial int OH_ArkUI_GestureInterruptInfo_GetSystemRecognizerType(ArkUI_GestureInterruptInfo* @event);
395 |
396 | [LibraryImport("libace_ndk.z.so")]
397 | public static partial ArkUI_GestureEventActionType OH_ArkUI_GestureEvent_GetActionType(ArkUI_GestureEvent* @event);
398 |
399 | [LibraryImport("libace_ndk.z.so")]
400 | public static partial ArkUI_UIInputEvent* OH_ArkUI_GestureEvent_GetRawInputEvent(ArkUI_GestureEvent* @event);
401 |
402 | [LibraryImport("libace_ndk.z.so")]
403 | public static partial int OH_ArkUI_LongPress_GetRepeatCount(ArkUI_GestureEvent* @event);
404 |
405 | [LibraryImport("libace_ndk.z.so")]
406 | public static partial float OH_ArkUI_PanGesture_GetVelocity(ArkUI_GestureEvent* @event);
407 |
408 | [LibraryImport("libace_ndk.z.so")]
409 | public static partial float OH_ArkUI_PanGesture_GetVelocityX(ArkUI_GestureEvent* @event);
410 |
411 | [LibraryImport("libace_ndk.z.so")]
412 | public static partial float OH_ArkUI_PanGesture_GetVelocityY(ArkUI_GestureEvent* @event);
413 |
414 | [LibraryImport("libace_ndk.z.so")]
415 | public static partial float OH_ArkUI_PanGesture_GetOffsetX(ArkUI_GestureEvent* @event);
416 |
417 | [LibraryImport("libace_ndk.z.so")]
418 | public static partial float OH_ArkUI_PanGesture_GetOffsetY(ArkUI_GestureEvent* @event);
419 |
420 | [LibraryImport("libace_ndk.z.so")]
421 | public static partial float OH_ArkUI_SwipeGesture_GetAngle(ArkUI_GestureEvent* @event);
422 |
423 | [LibraryImport("libace_ndk.z.so")]
424 | public static partial float OH_ArkUI_SwipeGesture_GetVelocity(ArkUI_GestureEvent* @event);
425 |
426 | [LibraryImport("libace_ndk.z.so")]
427 | public static partial float OH_ArkUI_RotationGesture_GetAngle(ArkUI_GestureEvent* @event);
428 |
429 | [LibraryImport("libace_ndk.z.so")]
430 | public static partial float OH_ArkUI_PinchGesture_GetScale(ArkUI_GestureEvent* @event);
431 |
432 | [LibraryImport("libace_ndk.z.so")]
433 | public static partial float OH_ArkUI_PinchGesture_GetCenterX(ArkUI_GestureEvent* @event);
434 |
435 | [LibraryImport("libace_ndk.z.so")]
436 | public static partial float OH_ArkUI_PinchGesture_GetCenterY(ArkUI_GestureEvent* @event);
437 |
438 | [LibraryImport("libace_ndk.z.so")]
439 | public static partial ArkUI_NodeHandle OH_ArkUI_GestureEvent_GetNode(ArkUI_GestureEvent* @event);
440 |
441 | [LibraryImport("libace_ndk.z.so")]
442 | public static partial int OH_ArkUI_GetResponseRecognizersFromInterruptInfo(ArkUI_GestureInterruptInfo* @event,
443 | ArkUI_GestureRecognizerHandleArray* responseChain, int* count);
444 |
445 | [LibraryImport("libace_ndk.z.so")]
446 | public static partial int OH_ArkUI_SetGestureRecognizerEnabled(ArkUI_GestureRecognizer* recognizer, [MarshalAs(UnmanagedType.Bool)]bool enabled);
447 |
448 | [LibraryImport("libace_ndk.z.so")]
449 | [return: MarshalAs(UnmanagedType.Bool)]
450 | public static partial bool OH_ArkUI_GetGestureRecognizerEnabled(ArkUI_GestureRecognizer* recognizer);
451 |
452 | [LibraryImport("libace_ndk.z.so")]
453 | public static partial int OH_ArkUI_GetGestureRecognizerState(ArkUI_GestureRecognizer* recognizer, ArkUI_GestureRecognizerState* state);
454 |
455 | [LibraryImport("libace_ndk.z.so")]
456 | public static partial int OH_ArkUI_GetGestureEventTargetInfo(ArkUI_GestureRecognizer* recognizer, ArkUI_GestureEventTargetInfo** info);
457 |
458 | [LibraryImport("libace_ndk.z.so")]
459 | public static partial int OH_ArkUI_GestureEventTargetInfo_IsScrollBegin(ArkUI_GestureEventTargetInfo* info, bool* ret);
460 |
461 | [LibraryImport("libace_ndk.z.so")]
462 | public static partial int OH_ArkUI_GestureEventTargetInfo_IsScrollEnd(ArkUI_GestureEventTargetInfo* info, bool* ret);
463 |
464 | [LibraryImport("libace_ndk.z.so")]
465 | public static partial int OH_ArkUI_GetPanGestureDirectionMask(ArkUI_GestureRecognizer* recognizer,
466 | uint* directionMask);
467 |
468 | [LibraryImport("libace_ndk.z.so")]
469 | [return: MarshalAs(UnmanagedType.Bool)]
470 | public static partial bool OH_ArkUI_IsBuiltInGesture(ArkUI_GestureRecognizer* recognizer);
471 |
472 | [LibraryImport("libace_ndk.z.so")]
473 | public static partial int OH_ArkUI_GetGestureTag(ArkUI_GestureRecognizer* recognizer, sbyte* buffer, int bufferSize, int* result);
474 |
475 | [LibraryImport("libace_ndk.z.so")]
476 | public static partial int OH_ArkUI_GetGestureBindNodeId(ArkUI_GestureRecognizer* recognizer, sbyte* nodeId, int size, int* result);
477 |
478 | [LibraryImport("libace_ndk.z.so")]
479 | [return: MarshalAs(UnmanagedType.Bool)]
480 | public static partial bool OH_ArkUI_IsGestureRecognizerValid(ArkUI_GestureRecognizer* recognizer);
481 |
482 | [LibraryImport("libace_ndk.z.so")]
483 | public static partial void* OH_ArkUI_ParallelInnerGestureEvent_GetUserData(ArkUI_ParallelInnerGestureEvent* @event);
484 |
485 | [LibraryImport("libace_ndk.z.so")]
486 | public static partial ArkUI_GestureRecognizer* OH_ArkUI_ParallelInnerGestureEvent_GetCurrentRecognizer(
487 | ArkUI_ParallelInnerGestureEvent* @event);
488 |
489 | [LibraryImport("libace_ndk.z.so")]
490 | public static partial int OH_ArkUI_ParallelInnerGestureEvent_GetConflictRecognizers(ArkUI_ParallelInnerGestureEvent* @event,
491 | ArkUI_GestureRecognizerHandleArray* array, int* size);
492 |
493 | [LibraryImport("libace_ndk.z.so")]
494 | public static partial int OH_ArkUI_SetArkUIGestureRecognizerDisposeNotify(ArkUI_GestureRecognizer* recognizer, delegate* unmanaged[Cdecl] callback, void* userData);
495 |
496 |
497 | [LibraryImport("libace_ndk.z.so")]
498 | public static partial int OH_ArkUI_GetNodeHandleFromNapiValue(napi_env env, napi_value frameNode, ArkUI_NodeHandle* handle);
499 |
500 |
501 | [LibraryImport("libace_ndk.z.so")]
502 | public static partial int OH_ArkUI_GetContextFromNapiValue(napi_env env, napi_value value, ArkUI_ContextHandle* context);
503 |
504 |
505 |
506 | [LibraryImport("libace_ndk.z.so")]
507 | public static partial int OH_ArkUI_GetNodeContentFromNapiValue(napi_env env, napi_value value, ArkUI_NodeContentHandle* content);
508 |
509 |
510 | [LibraryImport("libace_ndk.z.so")]
511 | public static partial int OH_ArkUI_GetDrawableDescriptorFromNapiValue(
512 | napi_env env, napi_value value, ArkUI_DrawableDescriptor** drawableDescriptor);
513 |
514 |
515 | [LibraryImport("libace_ndk.z.so")]
516 | public static partial int OH_ArkUI_GetDrawableDescriptorFromResourceNapiValue(napi_env env, napi_value value, ArkUI_DrawableDescriptor** drawableDescriptor);
517 |
518 | [LibraryImport("libace_ndk.z.so")]
519 | public static partial ArkUI_ErrorCode OH_ArkUI_GetNavigationId(
520 | ArkUI_NodeHandle node, sbyte* buffer, int bufferSize, int* writeLength);
521 |
522 | [LibraryImport("libace_ndk.z.so")]
523 | public static partial ArkUI_ErrorCode OH_ArkUI_GetNavDestinationName(
524 | ArkUI_NodeHandle node, sbyte* buffer, int bufferSize, int* writeLength);
525 |
526 |
527 | [LibraryImport("libace_ndk.z.so")]
528 | public static partial ArkUI_ErrorCode OH_ArkUI_GetNavStackLength(ArkUI_NodeHandle node, int* length);
529 |
530 |
531 | [LibraryImport("libace_ndk.z.so")]
532 | public static partial ArkUI_ErrorCode OH_ArkUI_GetNavDestinationNameByIndex(
533 | ArkUI_NodeHandle node, int index, sbyte* buffer, int bufferSize, int* writeLength);
534 |
535 |
536 | [LibraryImport("libace_ndk.z.so")]
537 | public static partial ArkUI_ErrorCode OH_ArkUI_GetNavDestinationId(
538 | ArkUI_NodeHandle node, sbyte* buffer, int bufferSize, int* writeLength);
539 |
540 |
541 | [LibraryImport("libace_ndk.z.so")]
542 | public static partial ArkUI_ErrorCode OH_ArkUI_GetNavDestinationState(ArkUI_NodeHandle node, ArkUI_NavDestinationState* state);
543 |
544 |
545 | [LibraryImport("libace_ndk.z.so")]
546 | public static partial ArkUI_ErrorCode OH_ArkUI_GetNavDestinationIndex(ArkUI_NodeHandle node, int* index);
547 |
548 |
549 | [LibraryImport("libace_ndk.z.so")]
550 | public static partial napi_value OH_ArkUI_GetNavDestinationParam(ArkUI_NodeHandle node);
551 |
552 |
553 | [LibraryImport("libace_ndk.z.so")]
554 | public static partial ArkUI_ErrorCode OH_ArkUI_GetRouterPageIndex(ArkUI_NodeHandle node, int* index);
555 |
556 |
557 | [LibraryImport("libace_ndk.z.so")]
558 | public static partial ArkUI_ErrorCode OH_ArkUI_GetRouterPageName(
559 | ArkUI_NodeHandle node, sbyte* buffer, int bufferSize, int* writeLength);
560 |
561 |
562 | [LibraryImport("libace_ndk.z.so")]
563 | public static partial ArkUI_ErrorCode OH_ArkUI_GetRouterPagePath(
564 | ArkUI_NodeHandle node, sbyte* buffer, int bufferSize, int* writeLength);
565 |
566 | [LibraryImport("libace_ndk.z.so")]
567 | public static partial ArkUI_ErrorCode OH_ArkUI_GetRouterPageState(ArkUI_NodeHandle node, ArkUI_RouterPageState* state);
568 |
569 |
570 | [LibraryImport("libace_ndk.z.so")]
571 | public static partial ArkUI_ErrorCode OH_ArkUI_GetRouterPageId(
572 | ArkUI_NodeHandle node, sbyte* buffer, int bufferSize, int* writeLength);
573 |
574 |
575 |
576 | [LibraryImport("libace_ndk.z.so")]
577 | public static partial ArkUI_NodeEventType OH_ArkUI_NodeEvent_GetEventType(ArkUI_NodeEvent* @event);
578 |
579 |
580 | [LibraryImport("libace_ndk.z.so")]
581 | public static partial int OH_ArkUI_NodeEvent_GetTargetId(ArkUI_NodeEvent* @event);
582 |
583 |
584 | [LibraryImport("libace_ndk.z.so")]
585 | public static partial ArkUI_NodeHandle OH_ArkUI_NodeEvent_GetNodeHandle(ArkUI_NodeEvent* @event);
586 |
587 |
588 | [LibraryImport("libace_ndk.z.so")]
589 | public static partial ArkUI_UIInputEvent* OH_ArkUI_NodeEvent_GetInputEvent(ArkUI_NodeEvent* @event);
590 |
591 |
592 | [LibraryImport("libace_ndk.z.so")]
593 | public static partial ArkUI_NodeComponentEvent* OH_ArkUI_NodeEvent_GetNodeComponentEvent(ArkUI_NodeEvent* @event);
594 |
595 |
596 | [LibraryImport("libace_ndk.z.so")]
597 | public static partial ArkUI_StringAsyncEvent* OH_ArkUI_NodeEvent_GetStringAsyncEvent(ArkUI_NodeEvent* @event);
598 |
599 |
600 | [LibraryImport("libace_ndk.z.so")]
601 | public static partial void* OH_ArkUI_NodeEvent_GetUserData(ArkUI_NodeEvent* @event);
602 |
603 |
604 | [LibraryImport("libace_ndk.z.so")]
605 | public static partial int OH_ArkUI_NodeEvent_GetNumberValue(ArkUI_NodeEvent* @event, int index, ArkUI_NumberValue* value);
606 |
607 |
608 | [LibraryImport("libace_ndk.z.so")]
609 | public static partial int OH_ArkUI_NodeEvent_GetStringValue(ArkUI_NodeEvent* @event, int index, sbyte** @string, int* stringSize);
610 |
611 | [LibraryImport("libace_ndk.z.so")]
612 | public static partial int OH_ArkUI_NodeEvent_SetReturnNumberValue(ArkUI_NodeEvent* @event, ArkUI_NumberValue* value, int size);
613 |
614 |
615 | [LibraryImport("libace_ndk.z.so")]
616 | public static partial ArkUI_NodeAdapterHandle OH_ArkUI_NodeAdapter_Create();
617 |
618 |
619 | [LibraryImport("libace_ndk.z.so")]
620 | public static partial void OH_ArkUI_NodeAdapter_Dispose(ArkUI_NodeAdapterHandle handle);
621 |
622 |
623 | [LibraryImport("libace_ndk.z.so")]
624 | public static partial int OH_ArkUI_NodeAdapter_SetTotalNodeCount(ArkUI_NodeAdapterHandle handle, uint size);
625 |
626 |
627 | [LibraryImport("libace_ndk.z.so")]
628 | public static partial uint OH_ArkUI_NodeAdapter_GetTotalNodeCount(ArkUI_NodeAdapterHandle handle);
629 |
630 |
631 | [LibraryImport("libace_ndk.z.so")]
632 | public static partial int OH_ArkUI_NodeAdapter_RegisterEventReceiver(ArkUI_NodeAdapterHandle handle, void* userData, delegate* unmanaged[Cdecl] receiver);
633 |
634 |
635 | [LibraryImport("libace_ndk.z.so")]
636 | public static partial void OH_ArkUI_NodeAdapter_UnregisterEventReceiver(ArkUI_NodeAdapterHandle handle);
637 |
638 |
639 | [LibraryImport("libace_ndk.z.so")]
640 | public static partial int OH_ArkUI_NodeAdapter_ReloadAllItems(ArkUI_NodeAdapterHandle handle);
641 |
642 |
643 | [LibraryImport("libace_ndk.z.so")]
644 | public static partial int OH_ArkUI_NodeAdapter_ReloadItem(
645 | ArkUI_NodeAdapterHandle handle, uint startPosition, uint itemCount);
646 |
647 |
648 | [LibraryImport("libace_ndk.z.so")]
649 | public static partial int OH_ArkUI_NodeAdapter_RemoveItem(
650 | ArkUI_NodeAdapterHandle handle, uint startPosition, uint itemCount);
651 |
652 |
653 | [LibraryImport("libace_ndk.z.so")]
654 | public static partial int OH_ArkUI_NodeAdapter_InsertItem(
655 | ArkUI_NodeAdapterHandle handle, uint startPosition, uint itemCount);
656 |
657 |
658 | [LibraryImport("libace_ndk.z.so")]
659 | public static partial int OH_ArkUI_NodeAdapter_MoveItem(ArkUI_NodeAdapterHandle handle, uint from, uint to);
660 |
661 |
662 | [LibraryImport("libace_ndk.z.so")]
663 | public static partial int OH_ArkUI_NodeAdapter_GetAllItems(ArkUI_NodeAdapterHandle handle, ArkUI_NodeHandle** items, uint* size);
664 |
665 |
666 | [LibraryImport("libace_ndk.z.so")]
667 | public static partial void* OH_ArkUI_NodeAdapterEvent_GetUserData(ArkUI_NodeAdapterEvent* @event);
668 |
669 |
670 | [LibraryImport("libace_ndk.z.so")]
671 | public static partial ArkUI_NodeAdapterEventType OH_ArkUI_NodeAdapterEvent_GetType(ArkUI_NodeAdapterEvent* @event);
672 |
673 |
674 | [LibraryImport("libace_ndk.z.so")]
675 | public static partial ArkUI_NodeHandle OH_ArkUI_NodeAdapterEvent_GetRemovedNode(ArkUI_NodeAdapterEvent* @event);
676 |
677 |
678 | [LibraryImport("libace_ndk.z.so")]
679 | public static partial uint OH_ArkUI_NodeAdapterEvent_GetItemIndex(ArkUI_NodeAdapterEvent* @event);
680 |
681 |
682 | [LibraryImport("libace_ndk.z.so")]
683 | public static partial ArkUI_NodeHandle OH_ArkUI_NodeAdapterEvent_GetHostNode(ArkUI_NodeAdapterEvent* @event);
684 |
685 |
686 | [LibraryImport("libace_ndk.z.so")]
687 | public static partial int OH_ArkUI_NodeAdapterEvent_SetItem(ArkUI_NodeAdapterEvent* @event, ArkUI_NodeHandle node);
688 |
689 |
690 | [LibraryImport("libace_ndk.z.so")]
691 | public static partial int OH_ArkUI_NodeAdapterEvent_SetNodeId(ArkUI_NodeAdapterEvent* @event, int id);
692 |
693 | /**
694 | * @brief Declares a collection of native node APIs provided by ArkUI.
695 | *
696 | * The APIs related to the native node must be called in the main thread.
697 | *
698 | * @version 1
699 | * @since 12
700 | */
701 |
702 |
703 | [LibraryImport("libace_ndk.z.so")]
704 | public static partial ArkUI_LayoutConstraint* OH_ArkUI_NodeCustomEvent_GetLayoutConstraintInMeasure(ArkUI_NodeCustomEvent* @event);
705 |
706 |
707 | [LibraryImport("libace_ndk.z.so")]
708 | public static partial ArkUI_IntOffset OH_ArkUI_NodeCustomEvent_GetPositionInLayout(ArkUI_NodeCustomEvent* @event);
709 |
710 |
711 | [LibraryImport("libace_ndk.z.so")]
712 | public static partial ArkUI_DrawContext* OH_ArkUI_NodeCustomEvent_GetDrawContextInDraw(ArkUI_NodeCustomEvent* @event);
713 |
714 |
715 | [LibraryImport("libace_ndk.z.so")]
716 | public static partial int OH_ArkUI_NodeCustomEvent_GetEventTargetId(ArkUI_NodeCustomEvent* @event);
717 |
718 |
719 | [LibraryImport("libace_ndk.z.so")]
720 | public static partial void* OH_ArkUI_NodeCustomEvent_GetUserData(ArkUI_NodeCustomEvent* @event);
721 |
722 |
723 | [LibraryImport("libace_ndk.z.so")]
724 | public static partial ArkUI_NodeHandle OH_ArkUI_NodeCustomEvent_GetNodeHandle(ArkUI_NodeCustomEvent* @event);
725 |
726 | [LibraryImport("libace_ndk.z.so")]
727 | public static partial ArkUI_NodeCustomEventType OH_ArkUI_NodeCustomEvent_GetEventType(ArkUI_NodeCustomEvent* @event);
728 |
729 |
730 | [LibraryImport("libace_ndk.z.so")]
731 | public static partial int OH_ArkUI_NodeCustomEvent_GetCustomSpanMeasureInfo(
732 | ArkUI_NodeCustomEvent* @event, ArkUI_CustomSpanMeasureInfo* info);
733 |
734 |
735 | [LibraryImport("libace_ndk.z.so")]
736 | public static partial int OH_ArkUI_NodeCustomEvent_SetCustomSpanMetrics(
737 | ArkUI_NodeCustomEvent* @event, ArkUI_CustomSpanMetrics* metrics);
738 |
739 |
740 | [LibraryImport("libace_ndk.z.so")]
741 | public static partial int OH_ArkUI_NodeCustomEvent_GetCustomSpanDrawInfo(
742 | ArkUI_NodeCustomEvent* @event, ArkUI_CustomSpanDrawInfo* info);
743 |
744 |
745 |
746 | [LibraryImport("libace_ndk.z.so")]
747 | public static partial int OH_ArkUI_NodeContent_RegisterCallback(ArkUI_NodeContentHandle content, delegate* unmanaged[Cdecl] callback);
748 |
749 |
750 | [LibraryImport("libace_ndk.z.so")]
751 | public static partial ArkUI_NodeContentEventType OH_ArkUI_NodeContentEvent_GetEventType(ArkUI_NodeContentEvent* @event);
752 |
753 |
754 | [LibraryImport("libace_ndk.z.so")]
755 | public static partial ArkUI_NodeContentHandle OH_ArkUI_NodeContentEvent_GetNodeContentHandle(ArkUI_NodeContentEvent* @event);
756 |
757 |
758 | [LibraryImport("libace_ndk.z.so")]
759 | public static partial int OH_ArkUI_NodeContent_SetUserData(ArkUI_NodeContentHandle content, void* userData);
760 |
761 |
762 | [LibraryImport("libace_ndk.z.so")]
763 | public static partial void* OH_ArkUI_NodeContent_GetUserData(ArkUI_NodeContentHandle content);
764 |
765 |
766 | [LibraryImport("libace_ndk.z.so")]
767 | public static partial int OH_ArkUI_NodeContent_AddNode(ArkUI_NodeContentHandle content, ArkUI_NodeHandle node);
768 |
769 |
770 | [LibraryImport("libace_ndk.z.so")]
771 | public static partial int OH_ArkUI_NodeContent_RemoveNode(ArkUI_NodeContentHandle content, ArkUI_NodeHandle node);
772 |
773 |
774 | [LibraryImport("libace_ndk.z.so")]
775 | public static partial int OH_ArkUI_NodeContent_InsertNode(ArkUI_NodeContentHandle content, ArkUI_NodeHandle node, int position);
776 |
777 |
778 | [LibraryImport("libace_ndk.z.so")]
779 | public static partial int OH_ArkUI_NodeUtils_GetLayoutSize(ArkUI_NodeHandle node, ArkUI_IntSize* size);
780 |
781 |
782 | [LibraryImport("libace_ndk.z.so")]
783 | public static partial int OH_ArkUI_NodeUtils_GetLayoutPosition(ArkUI_NodeHandle node, ArkUI_IntOffset* localOffset);
784 |
785 |
786 | [LibraryImport("libace_ndk.z.so")]
787 | public static partial int OH_ArkUI_NodeUtils_GetLayoutPositionInWindow(ArkUI_NodeHandle node, ArkUI_IntOffset* globalOffset);
788 |
789 |
790 | [LibraryImport("libace_ndk.z.so")]
791 | public static partial int OH_ArkUI_NodeUtils_GetLayoutPositionInScreen(ArkUI_NodeHandle node, ArkUI_IntOffset* screenOffset);
792 |
793 |
794 | [LibraryImport("libace_ndk.z.so")]
795 | public static partial int OH_ArkUI_NodeUtils_GetPositionWithTranslateInWindow(ArkUI_NodeHandle node, ArkUI_IntOffset* translateOffset);
796 |
797 |
798 | [LibraryImport("libace_ndk.z.so")]
799 | public static partial int OH_ArkUI_NodeUtils_GetPositionWithTranslateInScreen(ArkUI_NodeHandle node, ArkUI_IntOffset* translateOffset);
800 |
801 |
802 | [LibraryImport("libace_ndk.z.so")]
803 | public static partial void OH_ArkUI_NodeUtils_AddCustomProperty(ArkUI_NodeHandle node, char* name, char* value);
804 |
805 |
806 | [LibraryImport("libace_ndk.z.so")]
807 | public static partial void OH_ArkUI_NodeUtils_RemoveCustomProperty(ArkUI_NodeHandle node, char* name);
808 |
809 | [LibraryImport("libace_ndk.z.so")]
810 | public static partial int OH_ArkUI_List_CloseAllSwipeActions(ArkUI_NodeHandle node, void* userData, delegate* unmanaged[Cdecl] onFinish);
811 |
812 | [LibraryImport("libace_ndk.z.so")]
813 | public static partial ArkUI_ContextHandle OH_ArkUI_GetContextByNode(ArkUI_NodeHandle node);
814 |
815 | [LibraryImport("libace_ndk.z.so")]
816 | public static partial int OH_ArkUI_RegisterSystemColorModeChangeEvent(ArkUI_NodeHandle node,
817 | void* userData, delegate* unmanaged[Cdecl] onColorModeChange);
818 |
819 | [LibraryImport("libace_ndk.z.so")]
820 | public static partial void OH_ArkUI_UnregisterSystemColorModeChangeEvent(ArkUI_NodeHandle node);
821 |
822 | [LibraryImport("libace_ndk.z.so")]
823 | public static partial int OH_ArkUI_RegisterSystemFontStyleChangeEvent(ArkUI_NodeHandle node,
824 | void* userData, delegate* unmanaged[Cdecl] onFontStyleChange);
825 |
826 | [LibraryImport("libace_ndk.z.so")]
827 | public static partial void OH_ArkUI_UnregisterSystemFontStyleChangeEvent(ArkUI_NodeHandle node);
828 |
829 | [LibraryImport("libace_ndk.z.so")]
830 | public static partial float OH_ArkUI_SystemFontStyleEvent_GetFontSizeScale(ArkUI_SystemFontStyleEvent* @event);
831 |
832 | [LibraryImport("libace_ndk.z.so")]
833 | public static partial float OH_ArkUI_SystemFontStyleEvent_GetFontWeightScale(ArkUI_SystemFontStyleEvent* @event);
834 |
835 | [LibraryImport("libace_ndk.z.so")]
836 | public static partial ArkUI_StyledString* OH_ArkUI_StyledString_Create(
837 | OH_Drawing_TypographyStyle* style, OH_Drawing_FontCollection* collection);
838 |
839 | [LibraryImport("libace_ndk.z.so")]
840 | public static partial void OH_ArkUI_StyledString_Destroy(ArkUI_StyledString* handle);
841 |
842 | [LibraryImport("libace_ndk.z.so")]
843 | public static partial void OH_ArkUI_StyledString_PushTextStyle(ArkUI_StyledString* handle, OH_Drawing_TextStyle* style);
844 |
845 | [LibraryImport("libace_ndk.z.so")]
846 | public static partial void OH_ArkUI_StyledString_AddText(ArkUI_StyledString* handle, sbyte* content);
847 |
848 | [LibraryImport("libace_ndk.z.so")]
849 | public static partial void OH_ArkUI_StyledString_PopTextStyle(ArkUI_StyledString* handle);
850 |
851 | [LibraryImport("libace_ndk.z.so")]
852 | public static partial OH_Drawing_Typography* OH_ArkUI_StyledString_CreateTypography(ArkUI_StyledString* handle);
853 |
854 | [LibraryImport("libace_ndk.z.so")]
855 | public static partial void OH_ArkUI_StyledString_AddPlaceholder(ArkUI_StyledString* handle, OH_Drawing_PlaceholderSpan* placeholder);
856 |
857 |
858 | [LibraryImport("libace_ndk.z.so")]
859 | public static partial int OH_ArkUI_UIInputEvent_GetType(ArkUI_UIInputEvent* @event);
860 |
861 |
862 | [LibraryImport("libace_ndk.z.so")]
863 | public static partial int OH_ArkUI_UIInputEvent_GetAction(ArkUI_UIInputEvent* @event);
864 |
865 |
866 | [LibraryImport("libace_ndk.z.so")]
867 | public static partial int OH_ArkUI_UIInputEvent_GetSourceType(ArkUI_UIInputEvent* @event);
868 |
869 |
870 | [LibraryImport("libace_ndk.z.so")]
871 | public static partial int OH_ArkUI_UIInputEvent_GetToolType(ArkUI_UIInputEvent* @event);
872 |
873 |
874 | [LibraryImport("libace_ndk.z.so")]
875 | public static partial long OH_ArkUI_UIInputEvent_GetEventTime(ArkUI_UIInputEvent* @event);
876 |
877 |
878 | [LibraryImport("libace_ndk.z.so")]
879 | public static partial uint OH_ArkUI_PointerEvent_GetPointerCount(ArkUI_UIInputEvent* @event);
880 |
881 |
882 | [LibraryImport("libace_ndk.z.so")]
883 | public static partial int OH_ArkUI_PointerEvent_GetPointerId(ArkUI_UIInputEvent* @event, uint pointerIndex);
884 |
885 |
886 | [LibraryImport("libace_ndk.z.so")]
887 | public static partial float OH_ArkUI_PointerEvent_GetX(ArkUI_UIInputEvent* @event);
888 |
889 |
890 | [LibraryImport("libace_ndk.z.so")]
891 | public static partial float OH_ArkUI_PointerEvent_GetXByIndex(ArkUI_UIInputEvent* @event, uint pointerIndex);
892 |
893 |
894 | [LibraryImport("libace_ndk.z.so")]
895 | public static partial float OH_ArkUI_PointerEvent_GetY(ArkUI_UIInputEvent* @event);
896 |
897 |
898 | [LibraryImport("libace_ndk.z.so")]
899 | public static partial float OH_ArkUI_PointerEvent_GetYByIndex(ArkUI_UIInputEvent* @event, uint pointerIndex);
900 |
901 |
902 | [LibraryImport("libace_ndk.z.so")]
903 | public static partial float OH_ArkUI_PointerEvent_GetWindowX(ArkUI_UIInputEvent* @event);
904 |
905 |
906 | [LibraryImport("libace_ndk.z.so")]
907 | public static partial float OH_ArkUI_PointerEvent_GetWindowXByIndex(ArkUI_UIInputEvent* @event, uint pointerIndex);
908 |
909 |
910 | [LibraryImport("libace_ndk.z.so")]
911 | public static partial float OH_ArkUI_PointerEvent_GetWindowY(ArkUI_UIInputEvent* @event);
912 |
913 |
914 | [LibraryImport("libace_ndk.z.so")]
915 | public static partial float OH_ArkUI_PointerEvent_GetWindowYByIndex(ArkUI_UIInputEvent* @event, uint pointerIndex);
916 |
917 |
918 | [LibraryImport("libace_ndk.z.so")]
919 | public static partial float OH_ArkUI_PointerEvent_GetDisplayX(ArkUI_UIInputEvent* @event);
920 |
921 |
922 | [LibraryImport("libace_ndk.z.so")]
923 | public static partial float OH_ArkUI_PointerEvent_GetDisplayXByIndex(ArkUI_UIInputEvent* @event, uint pointerIndex);
924 |
925 |
926 | [LibraryImport("libace_ndk.z.so")]
927 | public static partial float OH_ArkUI_PointerEvent_GetDisplayY(ArkUI_UIInputEvent* @event);
928 |
929 |
930 | [LibraryImport("libace_ndk.z.so")]
931 | public static partial float OH_ArkUI_PointerEvent_GetDisplayYByIndex(ArkUI_UIInputEvent* @event, uint pointerIndex);
932 |
933 |
934 | [LibraryImport("libace_ndk.z.so")]
935 | public static partial float OH_ArkUI_PointerEvent_GetPressure(ArkUI_UIInputEvent* @event, uint pointerIndex);
936 |
937 |
938 | [LibraryImport("libace_ndk.z.so")]
939 | public static partial float OH_ArkUI_PointerEvent_GetTiltX(ArkUI_UIInputEvent* @event, uint pointerIndex);
940 |
941 |
942 | [LibraryImport("libace_ndk.z.so")]
943 | public static partial float OH_ArkUI_PointerEvent_GetTiltY(ArkUI_UIInputEvent* @event, uint pointerIndex);
944 |
945 |
946 | [LibraryImport("libace_ndk.z.so")]
947 | public static partial float OH_ArkUI_PointerEvent_GetTouchAreaWidth(ArkUI_UIInputEvent* @event, uint pointerIndex);
948 |
949 |
950 | [LibraryImport("libace_ndk.z.so")]
951 | public static partial float OH_ArkUI_PointerEvent_GetTouchAreaHeight(ArkUI_UIInputEvent* @event, uint pointerIndex);
952 |
953 |
954 | [LibraryImport("libace_ndk.z.so")]
955 | public static partial uint OH_ArkUI_PointerEvent_GetHistorySize(ArkUI_UIInputEvent* @event);
956 |
957 |
958 | [LibraryImport("libace_ndk.z.so")]
959 | public static partial long OH_ArkUI_PointerEvent_GetHistoryEventTime(ArkUI_UIInputEvent* @event, uint historyIndex);
960 |
961 |
962 | [LibraryImport("libace_ndk.z.so")]
963 | public static partial uint OH_ArkUI_PointerEvent_GetHistoryPointerCount(ArkUI_UIInputEvent* @event, uint historyIndex);
964 |
965 |
966 | [LibraryImport("libace_ndk.z.so")]
967 | public static partial int OH_ArkUI_PointerEvent_GetHistoryPointerId(
968 | ArkUI_UIInputEvent* @event, uint pointerIndex, uint historyIndex);
969 |
970 |
971 | [LibraryImport("libace_ndk.z.so")]
972 | public static partial float OH_ArkUI_PointerEvent_GetHistoryX(ArkUI_UIInputEvent* @event, uint pointerIndex, uint historyIndex);
973 |
974 |
975 | [LibraryImport("libace_ndk.z.so")]
976 | public static partial float OH_ArkUI_PointerEvent_GetHistoryY(ArkUI_UIInputEvent* @event, uint pointerIndex, uint historyIndex);
977 |
978 |
979 | [LibraryImport("libace_ndk.z.so")]
980 | public static partial float OH_ArkUI_PointerEvent_GetHistoryWindowX(
981 | ArkUI_UIInputEvent* @event, uint pointerIndex, uint historyIndex);
982 |
983 |
984 | [LibraryImport("libace_ndk.z.so")]
985 | public static partial float OH_ArkUI_PointerEvent_GetHistoryWindowY(
986 | ArkUI_UIInputEvent* @event, uint pointerIndex, uint historyIndex);
987 |
988 |
989 | [LibraryImport("libace_ndk.z.so")]
990 | public static partial float OH_ArkUI_PointerEvent_GetHistoryDisplayX(
991 | ArkUI_UIInputEvent* @event, uint pointerIndex, uint historyIndex);
992 |
993 |
994 | [LibraryImport("libace_ndk.z.so")]
995 | public static partial float OH_ArkUI_PointerEvent_GetHistoryDisplayY(
996 | ArkUI_UIInputEvent* @event, uint pointerIndex, uint historyIndex);
997 |
998 |
999 | [LibraryImport("libace_ndk.z.so")]
1000 | public static partial float OH_ArkUI_PointerEvent_GetHistoryPressure(
1001 | ArkUI_UIInputEvent* @event, uint pointerIndex, uint historyIndex);
1002 |
1003 |
1004 | [LibraryImport("libace_ndk.z.so")]
1005 | public static partial float OH_ArkUI_PointerEvent_GetHistoryTiltX(
1006 | ArkUI_UIInputEvent* @event, uint pointerIndex, uint historyIndex);
1007 |
1008 |
1009 | [LibraryImport("libace_ndk.z.so")]
1010 | public static partial float OH_ArkUI_PointerEvent_GetHistoryTiltY(
1011 | ArkUI_UIInputEvent* @event, uint pointerIndex, uint historyIndex);
1012 |
1013 | [LibraryImport("libace_ndk.z.so")]
1014 | public static partial float OH_ArkUI_PointerEvent_GetHistoryTouchAreaWidth(
1015 | ArkUI_UIInputEvent* @event, uint pointerIndex, uint historyIndex);
1016 |
1017 |
1018 | [LibraryImport("libace_ndk.z.so")]
1019 | public static partial float OH_ArkUI_PointerEvent_GetHistoryTouchAreaHeight(
1020 | ArkUI_UIInputEvent* @event, uint pointerIndex, uint historyIndex);
1021 |
1022 |
1023 | [LibraryImport("libace_ndk.z.so")]
1024 | public static partial double OH_ArkUI_AxisEvent_GetVerticalAxisValue(ArkUI_UIInputEvent* @event);
1025 |
1026 |
1027 | [LibraryImport("libace_ndk.z.so")]
1028 | public static partial double OH_ArkUI_AxisEvent_GetHorizontalAxisValue(ArkUI_UIInputEvent* @event);
1029 |
1030 |
1031 | [LibraryImport("libace_ndk.z.so")]
1032 | public static partial double OH_ArkUI_AxisEvent_GetPinchAxisScaleValue(ArkUI_UIInputEvent* @event);
1033 |
1034 |
1035 | [LibraryImport("libace_ndk.z.so")]
1036 | public static partial int OH_ArkUI_PointerEvent_SetInterceptHitTestMode(ArkUI_UIInputEvent* @event, HitTestMode mode);
1037 |
1038 |
1039 | [LibraryImport("libace_ndk.z.so")]
1040 | public static partial int OH_ArkUI_MouseEvent_GetMouseButton(ArkUI_UIInputEvent* @event);
1041 |
1042 |
1043 | [LibraryImport("libace_ndk.z.so")]
1044 | public static partial int OH_ArkUI_MouseEvent_GetMouseAction(ArkUI_UIInputEvent* @event);
1045 |
1046 |
1047 | [LibraryImport("libace_ndk.z.so")]
1048 | public static partial int OH_ArkUI_PointerEvent_SetStopPropagation(ArkUI_UIInputEvent* @event, [MarshalAs(UnmanagedType.Bool)]bool stopPropagation);
1049 |
1050 | [LibraryImport("libace_ndk.z.so")]
1051 | public static partial void* OH_ArkUI_QueryModuleInterfaceByName(ArkUI_NativeAPIVariantKind type, sbyte* structName);
1052 |
1053 |
1054 | [LibraryImport("libace_ndk.z.so")]
1055 | public static partial int OH_ArkUI_AccessibilityProviderRegisterCallback(
1056 | ArkUI_AccessibilityProvider* provider, ArkUI_AccessibilityProviderCallbacks* callbacks);
1057 |
1058 | [LibraryImport("libace_ndk.z.so")]
1059 | public static partial void OH_ArkUI_SendAccessibilityAsyncEvent(
1060 | ArkUI_AccessibilityProvider* provider, ArkUI_AccessibilityEventInfo* eventInfo,
1061 | delegate* unmanaged[Cdecl] callback);
1062 |
1063 | [LibraryImport("libace_ndk.z.so")]
1064 | public static partial ArkUI_AccessibilityElementInfo* OH_ArkUI_AddAndGetAccessibilityElementInfo(
1065 | ArkUI_AccessibilityElementInfoList* list);
1066 |
1067 | [LibraryImport("libace_ndk.z.so")]
1068 | public static partial int OH_ArkUI_AccessibilityElementInfoSetElementId(
1069 | ArkUI_AccessibilityElementInfo* elementInfo, int elementId);
1070 |
1071 | [LibraryImport("libace_ndk.z.so")]
1072 | public static partial int OH_ArkUI_AccessibilityElementInfoSetParentId(
1073 | ArkUI_AccessibilityElementInfo* elementInfo, int parentId);
1074 |
1075 | [LibraryImport("libace_ndk.z.so")]
1076 | public static partial int OH_ArkUI_AccessibilityElementInfoSetComponentType(
1077 | ArkUI_AccessibilityElementInfo* elementInfo, sbyte** componentType);
1078 |
1079 | [LibraryImport("libace_ndk.z.so")]
1080 | public static partial int OH_ArkUI_AccessibilityElementInfoSetContents(
1081 | ArkUI_AccessibilityElementInfo* elementInfo, sbyte** contents);
1082 |
1083 | [LibraryImport("libace_ndk.z.so")]
1084 | public static partial int OH_ArkUI_AccessibilityElementInfoSetHintText(
1085 | ArkUI_AccessibilityElementInfo* elementInfo, sbyte** hintText);
1086 |
1087 | [LibraryImport("libace_ndk.z.so")]
1088 | public static partial int OH_ArkUI_AccessibilityElementInfoSetAccessibilityText(
1089 | ArkUI_AccessibilityElementInfo* elementInfo, sbyte** accessibilityText);
1090 |
1091 |
1092 | [LibraryImport("libace_ndk.z.so")]
1093 | public static partial int OH_ArkUI_AccessibilityElementInfoSetAccessibilityDescription(
1094 | ArkUI_AccessibilityElementInfo* elementInfo, sbyte** accessibilityDescription);
1095 |
1096 | [LibraryImport("libace_ndk.z.so")]
1097 | public static partial int OH_ArkUI_AccessibilityElementInfoSetChildNodeIds(
1098 | ArkUI_AccessibilityElementInfo* elementInfo, int childCount, long* childNodeIds);
1099 |
1100 | [LibraryImport("libace_ndk.z.so")]
1101 | public static partial int OH_ArkUI_AccessibilityElementInfoSetOperationActions(ArkUI_AccessibilityElementInfo* elementInfo,
1102 | int operationCount, ArkUI_AccessibleAction* operationActions);
1103 |
1104 | [LibraryImport("libace_ndk.z.so")]
1105 | public static partial int OH_ArkUI_AccessibilityElementInfoSetScreenRect(
1106 | ArkUI_AccessibilityElementInfo* elementInfo, ArkUI_AccessibleRect* screenRect);
1107 |
1108 | [LibraryImport("libace_ndk.z.so")]
1109 | public static partial int OH_ArkUI_AccessibilityElementInfoSetCheckable(
1110 | ArkUI_AccessibilityElementInfo* elementInfo, [MarshalAs(UnmanagedType.Bool)]bool checkable);
1111 |
1112 | [LibraryImport("libace_ndk.z.so")]
1113 | public static partial int OH_ArkUI_AccessibilityElementInfoSetChecked(
1114 | ArkUI_AccessibilityElementInfo* elementInfo, [MarshalAs(UnmanagedType.Bool)] bool @checked);
1115 |
1116 | [LibraryImport("libace_ndk.z.so")]
1117 | public static partial int OH_ArkUI_AccessibilityElementInfoSetFocusable(
1118 | ArkUI_AccessibilityElementInfo* elementInfo, [MarshalAs(UnmanagedType.Bool)] bool focusable);
1119 |
1120 | [LibraryImport("libace_ndk.z.so")]
1121 | public static partial int OH_ArkUI_AccessibilityElementInfoSetFocused(
1122 | ArkUI_AccessibilityElementInfo* elementInfo, [MarshalAs(UnmanagedType.Bool)] bool isFocused);
1123 |
1124 | [LibraryImport("libace_ndk.z.so")]
1125 | public static partial int OH_ArkUI_AccessibilityElementInfoSetVisible(
1126 | ArkUI_AccessibilityElementInfo* elementInfo, [MarshalAs(UnmanagedType.Bool)] bool isVisible);
1127 |
1128 | [LibraryImport("libace_ndk.z.so")]
1129 | public static partial int OH_ArkUI_AccessibilityElementInfoSetAccessibilityFocused(
1130 | ArkUI_AccessibilityElementInfo* elementInfo, [MarshalAs(UnmanagedType.Bool)] bool accessibilityFocused);
1131 |
1132 | [LibraryImport("libace_ndk.z.so")]
1133 | public static partial int OH_ArkUI_AccessibilityElementInfoSetSelected(
1134 | ArkUI_AccessibilityElementInfo* elementInfo, [MarshalAs(UnmanagedType.Bool)] bool selected);
1135 |
1136 | [LibraryImport("libace_ndk.z.so")]
1137 | public static partial int OH_ArkUI_AccessibilityElementInfoSetClickable(
1138 | ArkUI_AccessibilityElementInfo* elementInfo, [MarshalAs(UnmanagedType.Bool)] bool clickable);
1139 |
1140 |
1141 | [LibraryImport("libace_ndk.z.so")]
1142 | public static partial int OH_ArkUI_AccessibilityElementInfoSetLongClickable(
1143 | ArkUI_AccessibilityElementInfo* elementInfo, [MarshalAs(UnmanagedType.Bool)] bool longClickable);
1144 |
1145 | [LibraryImport("libace_ndk.z.so")]
1146 | public static partial int OH_ArkUI_AccessibilityElementInfoSetEnabled(
1147 | ArkUI_AccessibilityElementInfo* elementInfo, [MarshalAs(UnmanagedType.Bool)] bool isEnabled);
1148 |
1149 | [LibraryImport("libace_ndk.z.so")]
1150 | public static partial int OH_ArkUI_AccessibilityElementInfoSetIsPassword(
1151 | ArkUI_AccessibilityElementInfo* elementInfo, [MarshalAs(UnmanagedType.Bool)] bool isPassword);
1152 |
1153 | [LibraryImport("libace_ndk.z.so")]
1154 | public static partial int OH_ArkUI_AccessibilityElementInfoSetScrollable(
1155 | ArkUI_AccessibilityElementInfo* elementInfo, [MarshalAs(UnmanagedType.Bool)] bool scrollable);
1156 |
1157 | [LibraryImport("libace_ndk.z.so")]
1158 | public static partial int OH_ArkUI_AccessibilityElementInfoSetEditable(
1159 | ArkUI_AccessibilityElementInfo* elementInfo, [MarshalAs(UnmanagedType.Bool)] bool editable);
1160 |
1161 | [LibraryImport("libace_ndk.z.so")]
1162 | public static partial int OH_ArkUI_AccessibilityElementInfoSetIsHint(
1163 | ArkUI_AccessibilityElementInfo* elementInfo, [MarshalAs(UnmanagedType.Bool)] bool isHint);
1164 |
1165 | [LibraryImport("libace_ndk.z.so")]
1166 | public static partial int OH_ArkUI_AccessibilityElementInfoSetRangeInfo(
1167 | ArkUI_AccessibilityElementInfo* elementInfo, ArkUI_AccessibleRangeInfo* rangeInfo);
1168 |
1169 | [LibraryImport("libace_ndk.z.so")]
1170 | public static partial int OH_ArkUI_AccessibilityElementInfoSetGridInfo(
1171 | ArkUI_AccessibilityElementInfo* elementInfo, ArkUI_AccessibleGridInfo* gridInfo);
1172 |
1173 | [LibraryImport("libace_ndk.z.so")]
1174 | public static partial int OH_ArkUI_AccessibilityElementInfoSetGridItemInfo(
1175 | ArkUI_AccessibilityElementInfo* elementInfo, ArkUI_AccessibleGridItemInfo* gridItem);
1176 |
1177 | [LibraryImport("libace_ndk.z.so")]
1178 | public static partial int OH_ArkUI_AccessibilityElementInfoSetSelectedTextStart(
1179 | ArkUI_AccessibilityElementInfo* elementInfo, int selectedTextStart);
1180 |
1181 | [LibraryImport("libace_ndk.z.so")]
1182 | public static partial int OH_ArkUI_AccessibilityElementInfoSetSelectedTextEnd(
1183 | ArkUI_AccessibilityElementInfo* elementInfo, int selectedTextEnd);
1184 |
1185 | [LibraryImport("libace_ndk.z.so")]
1186 | public static partial int OH_ArkUI_AccessibilityElementInfoSetCurrentItemIndex(
1187 | ArkUI_AccessibilityElementInfo* elementInfo, int currentItemIndex);
1188 |
1189 | [LibraryImport("libace_ndk.z.so")]
1190 | public static partial int OH_ArkUI_AccessibilityElementInfoSetStartItemIndex(
1191 | ArkUI_AccessibilityElementInfo* elementInfo, int startItemIndex);
1192 |
1193 | [LibraryImport("libace_ndk.z.so")]
1194 | public static partial int OH_ArkUI_AccessibilityElementInfoSetEndItemIndex(
1195 | ArkUI_AccessibilityElementInfo* elementInfo, int endItemIndex);
1196 |
1197 | [LibraryImport("libace_ndk.z.so")]
1198 | public static partial int OH_ArkUI_AccessibilityElementInfoSetItemCount(
1199 | ArkUI_AccessibilityElementInfo* elementInfo, int itemCount);
1200 |
1201 | [LibraryImport("libace_ndk.z.so")]
1202 | public static partial int OH_ArkUI_AccessibilityElementInfoSetAccessibilityOffset(
1203 | ArkUI_AccessibilityElementInfo* elementInfo, int offset);
1204 |
1205 | [LibraryImport("libace_ndk.z.so")]
1206 | public static partial int OH_ArkUI_AccessibilityElementInfoSetAccessibilityGroup(
1207 | ArkUI_AccessibilityElementInfo* elementInfo, [MarshalAs(UnmanagedType.Bool)]bool accessibilityGroup);
1208 |
1209 |
1210 | [LibraryImport("libace_ndk.z.so")]
1211 | public static partial int OH_ArkUI_AccessibilityElementInfoSetAccessibilityLevel(
1212 | ArkUI_AccessibilityElementInfo* elementInfo, sbyte** accessibilityLevel);
1213 |
1214 | [LibraryImport("libace_ndk.z.so")]
1215 | public static partial int OH_ArkUI_AccessibilityElementInfoSetZIndex(
1216 | ArkUI_AccessibilityElementInfo* elementInfo, int zIndex);
1217 |
1218 | [LibraryImport("libace_ndk.z.so")]
1219 | public static partial int OH_ArkUI_AccessibilityElementInfoSetAccessibilityOpacity(
1220 | ArkUI_AccessibilityElementInfo* elementInfo, float opacity);
1221 |
1222 | [LibraryImport("libace_ndk.z.so")]
1223 | public static partial int OH_ArkUI_AccessibilityElementInfoSetBackgroundColor(
1224 | ArkUI_AccessibilityElementInfo* elementInfo, sbyte** backgroundColor);
1225 |
1226 | [LibraryImport("libace_ndk.z.so")]
1227 | public static partial int OH_ArkUI_AccessibilityElementInfoSetBackgroundImage(
1228 | ArkUI_AccessibilityElementInfo* elementInfo, sbyte** backgroundImage);
1229 |
1230 | [LibraryImport("libace_ndk.z.so")]
1231 | public static partial int OH_ArkUI_AccessibilityElementInfoSetBlur(
1232 | ArkUI_AccessibilityElementInfo* elementInfo, sbyte** blur);
1233 |
1234 | [LibraryImport("libace_ndk.z.so")]
1235 | public static partial int OH_ArkUI_AccessibilityElementInfoSetHitTestBehavior(
1236 | ArkUI_AccessibilityElementInfo* elementInfo, sbyte** hitTestBehavior);
1237 |
1238 | [LibraryImport("libace_ndk.z.so")]
1239 | public static partial ArkUI_AccessibilityElementInfo* OH_ArkUI_CreateAccessibilityElementInfo();
1240 |
1241 | [LibraryImport("libace_ndk.z.so")]
1242 | public static partial void OH_ArkUI_DestoryAccessibilityElementInfo(ArkUI_AccessibilityElementInfo* elementInfo);
1243 |
1244 | [LibraryImport("libace_ndk.z.so")]
1245 | public static partial ArkUI_AccessibilityEventInfo* OH_ArkUI_CreateAccessibilityEventInfo();
1246 |
1247 | [LibraryImport("libace_ndk.z.so")]
1248 | public static partial void OH_ArkUI_DestoryAccessibilityEventInfo(ArkUI_AccessibilityEventInfo* eventInfo);
1249 |
1250 | [LibraryImport("libace_ndk.z.so")]
1251 | public static partial int OH_ArkUI_AccessibilityEventSetEventType(
1252 | ArkUI_AccessibilityEventInfo* eventInfo, ArkUI_AccessibilityEventType eventType);
1253 |
1254 | [LibraryImport("libace_ndk.z.so")]
1255 | public static partial int OH_ArkUI_AccessibilityEventSetTextAnnouncedForAccessibility(
1256 | ArkUI_AccessibilityEventInfo* eventInfo, sbyte** textAnnouncedForAccessibility);
1257 |
1258 | [LibraryImport("libace_ndk.z.so")]
1259 | public static partial int OH_ArkUI_AccessibilityEventSetRequestFocusId(
1260 | ArkUI_AccessibilityEventInfo* eventInfo, int requestFocusId);
1261 |
1262 | [LibraryImport("libace_ndk.z.so")]
1263 | public static partial int OH_ArkUI_AccessibilityEventSetElementInfo(
1264 | ArkUI_AccessibilityEventInfo* eventInfo, ArkUI_AccessibilityElementInfo* elementInfo);
1265 |
1266 | [LibraryImport("libace_ndk.z.so")]
1267 | public static partial int OH_ArkUI_FindAccessibilityActionArgumentByKey(
1268 | ArkUI_AccessibilityActionArguments* arguments, sbyte** key, sbyte** value);
1269 | }
1270 |
--------------------------------------------------------------------------------
/OpenHarmony.NDK.Bindings/display_manager/display_manager.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.InteropServices;
2 |
3 | namespace OpenHarmony.NDK.Bindings.Native;
4 |
5 | public unsafe static partial class display_manager
6 | {
7 | [LibraryImport("libnative_display_manager.so")]
8 | public static partial NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayScaledDensity(float* Density);
9 |
10 | [LibraryImport("libnative_display_manager.so")]
11 | public static partial NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayId(ulong* displayId);
12 |
13 | [LibraryImport("libnative_display_manager.so")]
14 | public static partial NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayWidth(int* displayWidth);
15 |
16 | [LibraryImport("libnative_display_manager.so")]
17 | public static partial NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayHeight(int* displayHeight);
18 |
19 | [LibraryImport("libnative_display_manager.so")]
20 | public static partial NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayRotation(NativeDisplayManager_Rotation* displayRotation);
21 |
22 | [LibraryImport("libnative_display_manager.so")]
23 | public static partial NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayOrientation(NativeDisplayManager_Orientation* displayOrientation);
24 |
25 | [LibraryImport("libnative_display_manager.so")]
26 | public static partial NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayVirtualPixelRatio(float* virtualPixels);
27 |
28 | [LibraryImport("libnative_display_manager.so")]
29 | public static partial NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayRefreshRate(uint* refreshRate);
30 |
31 | [LibraryImport("libnative_display_manager.so")]
32 | public static partial NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayDensityDpi(int* densityDpi);
33 |
34 | [LibraryImport("libnative_display_manager.so")]
35 | public static partial NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayDensityPixels(float* densityPixels);
36 |
37 | [LibraryImport("libnative_display_manager.so")]
38 | public static partial NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayDensityXdpi(float* xDpi);
39 |
40 | [LibraryImport("libnative_display_manager.so")]
41 | public static partial NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayDensityYdpi(float* yDpi);
42 |
43 | [LibraryImport("libnative_display_manager.so")]
44 | public static partial NativeDisplayManager_ErrorCode OH_NativeDisplayManager_CreateDefaultDisplayCutoutInfo(
45 | NativeDisplayManager_CutoutInfo** cutoutInfo);
46 |
47 | [LibraryImport("libnative_display_manager.so")]
48 | public static partial NativeDisplayManager_ErrorCode OH_NativeDisplayManager_DestroyDefaultDisplayCutoutInfo(NativeDisplayManager_CutoutInfo* cutoutInfo);
49 |
50 | [LibraryImport("libnative_display_manager.so")]
51 | [return: MarshalAs(UnmanagedType.Bool)]
52 | public static partial bool OH_NativeDisplayManager_IsFoldable();
53 |
54 | [LibraryImport("libnative_display_manager.so")]
55 | public static partial NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetFoldDisplayMode(
56 | NativeDisplayManager_FoldDisplayMode* displayMode);
57 |
58 | [LibraryImport("libnative_display_manager.so")]
59 | public static partial NativeDisplayManager_ErrorCode OH_NativeDisplayManager_RegisterDisplayChangeListener(delegate* unmanaged[Cdecl] displayChangeCallback, uint* listenerIndex);
60 |
61 | [LibraryImport("libnative_display_manager.so")]
62 | public static partial NativeDisplayManager_ErrorCode OH_NativeDisplayManager_UnregisterDisplayChangeListener(uint listenerIndex);
63 |
64 | [LibraryImport("libnative_display_manager.so")]
65 | public static partial NativeDisplayManager_ErrorCode OH_NativeDisplayManager_RegisterFoldDisplayModeChangeListener(
66 | delegate*unmanaged[Cdecl] displayModeChangeCallback, uint* listenerIndex);
67 |
68 | [LibraryImport("libnative_display_manager.so")]
69 | public static partial NativeDisplayManager_ErrorCode OH_NativeDisplayManager_UnregisterFoldDisplayModeChangeListener(uint listenerIndex);
70 |
71 | }
72 |
--------------------------------------------------------------------------------
/OpenHarmony.NDK.Bindings/display_manager/display_type.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace OpenHarmony.NDK.Bindings.Native;
8 |
9 | public enum NativeDisplayManager_ErrorCode
10 | {
11 | /** @error Operation is successful */
12 | DISPLAY_MANAGER_OK = 0,
13 |
14 | /** @error Operation no permission */
15 | DISPLAY_MANAGER_ERROR_NO_PERMISSION = 201,
16 |
17 | /** @error Operation not system app */
18 | DISPLAY_MANAGER_ERROR_NOT_SYSTEM_APP = 202,
19 |
20 | /** @error Operation invalid param */
21 | DISPLAY_MANAGER_ERROR_INVALID_PARAM = 401,
22 |
23 | /** @error Operation device not supported */
24 | DISPLAY_MANAGER_ERROR_DEVICE_NOT_SUPPORTED = 801,
25 |
26 | /** @error Operation screen invalid */
27 | DISPLAY_MANAGER_ERROR_INVALID_SCREEN = 1400001,
28 |
29 | /** @error Operation invalid call */
30 | DISPLAY_MANAGER_ERROR_INVALID_CALL = 1400002,
31 |
32 | /** @error Operation system abnormal */
33 | DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL = 1400003,
34 | }
35 |
36 | public enum NativeDisplayManager_Rotation
37 | {
38 | /** device rotation 0 degree */
39 | DISPLAY_MANAGER_ROTATION_0,
40 |
41 | /** device rotation 90 degrees */
42 | DISPLAY_MANAGER_ROTATION_90,
43 |
44 | /** device rotation 180 degrees */
45 | DISPLAY_MANAGER_ROTATION_180,
46 |
47 | /** device rotation 270 degree */
48 | DISPLAY_MANAGER_ROTATION_270,
49 | }
50 |
51 | public enum NativeDisplayManager_Orientation
52 | {
53 | /** device portrait show */
54 | DISPLAY_MANAGER_PORTRAIT = 0,
55 |
56 | /** device landscape show */
57 | DISPLAY_MANAGER_LANDSCAPE = 1,
58 |
59 | /** device portrait inverted show */
60 | DISPLAY_MANAGER_PORTRAIT_INVERTED = 2,
61 |
62 | /** device landscape inverted show */
63 | DISPLAY_MANAGER_LANDSCAPE_INVERTED = 3,
64 |
65 | /** device unknow show */
66 | DISPLAY_MANAGER_UNKNOWN,
67 | }
68 |
69 | public unsafe struct NativeDisplayManager_CutoutInfo
70 | {
71 | /* boundingRects length */
72 | public int boundingRectsLength;
73 |
74 | /* boundingRects info pointer */
75 | public NativeDisplayManager_Rect* boundingRects;
76 |
77 | /* waterfallDisplayAreaRects info */
78 | public NativeDisplayManager_WaterfallDisplayAreaRects waterfallDisplayAreaRects;
79 | }
80 |
81 | public struct NativeDisplayManager_Rect
82 | {
83 | /* rect left */
84 | public int left;
85 | /* rect top */
86 | public int top;
87 | /* rect width */
88 | public uint width;
89 | /* rect height */
90 | public uint height;
91 | }
92 |
93 | public struct NativeDisplayManager_WaterfallDisplayAreaRects
94 | {
95 | /* waterfall left rect */
96 | public NativeDisplayManager_Rect left;
97 |
98 | /* waterfall top rect */
99 | public NativeDisplayManager_Rect top;
100 |
101 | /* waterfall right rect */
102 | public NativeDisplayManager_Rect right;
103 |
104 | /* waterfall bottom rect */
105 | public NativeDisplayManager_Rect bottom;
106 | }
107 |
108 | public enum NativeDisplayManager_FoldDisplayMode
109 | {
110 | /** display mode unknown */
111 | DISPLAY_MANAGER_FOLD_DISPLAY_MODE_UNKNOWN = 0,
112 |
113 | /** display mode full */
114 | DISPLAY_MANAGER_FOLD_DISPLAY_MODE_FULL = 1,
115 |
116 | /** display mode main */
117 | DISPLAY_MANAGER_FOLD_DISPLAY_MODE_MAIN = 2,
118 |
119 | /** display mode sub */
120 | DISPLAY_MANAGER_FOLD_DISPLAY_MODE_SUB = 3,
121 |
122 | /** display mode coordination */
123 | DISPLAY_MANAGER_FOLD_DISPLAY_MODE_COORDINATION = 4,
124 | }
--------------------------------------------------------------------------------
/OpenHarmony.NDK.Bindings/input_method/input_method.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.InteropServices;
2 |
3 | namespace OpenHarmony.NDK.Bindings.Native;
4 |
5 | public unsafe static partial class input_method
6 | {
7 | [LibraryImport("libohinputmethod.so")]
8 | public static partial InputMethod_AttachOptions* OH_AttachOptions_Create([MarshalAs(UnmanagedType.Bool)] bool showKeyboard);
9 |
10 | [LibraryImport("libohinputmethod.so")]
11 | public static partial void OH_AttachOptions_Destroy(InputMethod_AttachOptions* options);
12 |
13 | [LibraryImport("libohinputmethod.so")]
14 | public static partial InputMethod_ErrorCode OH_AttachOptions_IsShowKeyboard(InputMethod_AttachOptions* options, bool* showKeyboard);
15 |
16 | [LibraryImport("libohinputmethod.so")]
17 | public static partial InputMethod_ErrorCode OH_InputMethodProxy_ShowKeyboard(InputMethod_InputMethodProxy* inputMethodProxy);
18 |
19 | [LibraryImport("libohinputmethod.so")]
20 | public static partial InputMethod_ErrorCode OH_InputMethodProxy_HideKeyboard(InputMethod_InputMethodProxy* inputMethodProxy);
21 |
22 | [LibraryImport("libohinputmethod.so")]
23 | public static partial InputMethod_ErrorCode OH_InputMethodProxy_NotifySelectionChange(InputMethod_InputMethodProxy* inputMethodProxy, char* text, ulong length, int start, int end);
24 |
25 | [LibraryImport("libohinputmethod.so")]
26 | public static partial InputMethod_ErrorCode OH_InputMethodProxy_NotifyConfigurationChange(InputMethod_InputMethodProxy* inputMethodProxy, InputMethod_EnterKeyType enterKey, InputMethod_TextInputType textType);
27 |
28 | [LibraryImport("libohinputmethod.so")]
29 | public static partial InputMethod_ErrorCode OH_InputMethodProxy_NotifyCursorUpdate(InputMethod_InputMethodProxy* inputMethodProxy, InputMethod_CursorInfo* cursorInfo);
30 |
31 | [LibraryImport("libohinputmethod.so")]
32 | public static partial InputMethod_ErrorCode OH_InputMethodProxy_SendPrivateCommand(InputMethod_InputMethodProxy* inputMethodProxy, InputMethod_PrivateCommand** privateCommand, ulong size);
33 |
34 | [LibraryImport("libohinputmethod.so")]
35 | public static partial InputMethod_ErrorCode OH_InputMethodController_Attach(InputMethod_TextEditorProxy* textEditorProxy, InputMethod_AttachOptions* options, InputMethod_InputMethodProxy** inputMethodProxy);
36 |
37 | [LibraryImport("libohinputmethod.so")]
38 | public static partial InputMethod_ErrorCode OH_InputMethodController_Detach(InputMethod_InputMethodProxy* inputMethodProxy);
39 |
40 | [LibraryImport("libohinputmethod.so")]
41 | public static partial InputMethod_CursorInfo* OH_CursorInfo_Create(double left, double top, double width, double height);
42 |
43 | [LibraryImport("libohinputmethod.so")]
44 | public static partial void OH_CursorInfo_Destroy(InputMethod_CursorInfo* cursorInfo);
45 |
46 | [LibraryImport("libohinputmethod.so")]
47 | public static partial InputMethod_ErrorCode OH_CursorInfo_SetRect(InputMethod_CursorInfo* cursorInfo, double left, double top, double width, double height);
48 |
49 | [LibraryImport("libohinputmethod.so")]
50 | public static partial InputMethod_ErrorCode OH_CursorInfo_GetRect(InputMethod_CursorInfo* cursorInfo, double* left, double* top, double* width, double* height);
51 |
52 | [LibraryImport("libohinputmethod.so")]
53 | public static partial InputMethod_PrivateCommand* OH_PrivateCommand_Create(sbyte* key, ulong keyLength);
54 |
55 | [LibraryImport("libohinputmethod.so")]
56 | public static partial void OH_PrivateCommand_Destroy(InputMethod_PrivateCommand* command);
57 |
58 | [LibraryImport("libohinputmethod.so")]
59 | public static partial InputMethod_ErrorCode OH_PrivateCommand_SetKey(InputMethod_PrivateCommand* command, sbyte* key, ulong keyLength);
60 |
61 | [LibraryImport("libohinputmethod.so")]
62 | public static partial InputMethod_ErrorCode OH_PrivateCommand_SetBoolValue(InputMethod_PrivateCommand* command, [MarshalAs(UnmanagedType.Bool)] bool value);
63 |
64 | [LibraryImport("libohinputmethod.so")]
65 | public static partial InputMethod_ErrorCode OH_PrivateCommand_SetIntValue(InputMethod_PrivateCommand* command, int value);
66 |
67 | [LibraryImport("libohinputmethod.so")]
68 | public static partial InputMethod_ErrorCode OH_PrivateCommand_SetStrValue(InputMethod_PrivateCommand* command, sbyte* value, ulong valueLength);
69 |
70 | [LibraryImport("libohinputmethod.so")]
71 | public static partial InputMethod_ErrorCode OH_PrivateCommand_GetKey(InputMethod_PrivateCommand* command, sbyte** key, ulong* keyLength);
72 |
73 | [LibraryImport("libohinputmethod.so")]
74 | public static partial InputMethod_ErrorCode OH_PrivateCommand_GetValueType(InputMethod_PrivateCommand* command, InputMethod_CommandValueType* type);
75 |
76 | [LibraryImport("libohinputmethod.so")]
77 | public static partial InputMethod_ErrorCode OH_PrivateCommand_GetBoolValue(InputMethod_PrivateCommand* command, bool* value);
78 |
79 | [LibraryImport("libohinputmethod.so")]
80 | public static partial InputMethod_ErrorCode OH_PrivateCommand_GetIntValue(InputMethod_PrivateCommand* command, int* value);
81 |
82 | [LibraryImport("libohinputmethod.so")]
83 | public static partial InputMethod_ErrorCode OH_PrivateCommand_GetStrValue(InputMethod_PrivateCommand* command, sbyte** value, ulong* valueLength);
84 |
85 | [LibraryImport("libohinputmethod.so")]
86 | public static partial InputMethod_TextAvoidInfo* OH_TextAvoidInfo_Create(double positionY, double height);
87 |
88 | [LibraryImport("libohinputmethod.so")]
89 | public static partial void OH_TextAvoidInfo_Destroy(InputMethod_TextAvoidInfo* info);
90 |
91 | [LibraryImport("libohinputmethod.so")]
92 | public static partial InputMethod_ErrorCode OH_TextAvoidInfo_SetPositionY(InputMethod_TextAvoidInfo* info, double positionY);
93 |
94 | [LibraryImport("libohinputmethod.so")]
95 | public static partial InputMethod_ErrorCode OH_TextAvoidInfo_SetHeight(InputMethod_TextAvoidInfo* info, double height);
96 |
97 | [LibraryImport("libohinputmethod.so")]
98 | public static partial InputMethod_ErrorCode OH_TextAvoidInfo_GetPositionY(InputMethod_TextAvoidInfo* info, double* positionY);
99 |
100 | [LibraryImport("libohinputmethod.so")]
101 | public static partial InputMethod_ErrorCode OH_TextAvoidInfo_GetHeight(InputMethod_TextAvoidInfo* info, double* height);
102 |
103 | [LibraryImport("libohinputmethod.so")]
104 | public static partial InputMethod_TextConfig* OH_TextConfig_Create();
105 |
106 | [LibraryImport("libohinputmethod.so")]
107 | public static partial void OH_TextConfig_Destroy(InputMethod_TextConfig* config);
108 |
109 | [LibraryImport("libohinputmethod.so")]
110 | public static partial InputMethod_ErrorCode OH_TextConfig_SetInputType(InputMethod_TextConfig* config, InputMethod_TextInputType inputType);
111 |
112 | [LibraryImport("libohinputmethod.so")]
113 | public static partial InputMethod_ErrorCode OH_TextConfig_SetEnterKeyType(InputMethod_TextConfig* config, InputMethod_EnterKeyType enterKeyType);
114 |
115 | [LibraryImport("libohinputmethod.so")]
116 | public static partial InputMethod_ErrorCode OH_TextConfig_SetPreviewTextSupport(InputMethod_TextConfig* config, [MarshalAs(UnmanagedType.Bool)] bool supported);
117 |
118 | [LibraryImport("libohinputmethod.so")]
119 | public static partial InputMethod_ErrorCode OH_TextConfig_SetSelection(InputMethod_TextConfig* config, int start, int end);
120 |
121 | [LibraryImport("libohinputmethod.so")]
122 | public static partial InputMethod_ErrorCode OH_TextConfig_SetWindowId(InputMethod_TextConfig* config, int windowId);
123 |
124 | [LibraryImport("libohinputmethod.so")]
125 | public static partial InputMethod_ErrorCode OH_TextConfig_GetInputType(InputMethod_TextConfig* config, InputMethod_TextInputType* inputType);
126 |
127 | [LibraryImport("libohinputmethod.so")]
128 | public static partial InputMethod_ErrorCode OH_TextConfig_GetEnterKeyType(InputMethod_TextConfig* config, InputMethod_EnterKeyType* enterKeyType);
129 |
130 | [LibraryImport("libohinputmethod.so")]
131 | public static partial InputMethod_ErrorCode OH_TextConfig_IsPreviewTextSupported(InputMethod_TextConfig* config, bool* supported);
132 |
133 | [LibraryImport("libohinputmethod.so")]
134 | public static partial InputMethod_ErrorCode OH_TextConfig_GetCursorInfo(InputMethod_TextConfig* config, InputMethod_CursorInfo** cursorInfo);
135 |
136 | [LibraryImport("libohinputmethod.so")]
137 | public static partial InputMethod_ErrorCode OH_TextConfig_GetTextAvoidInfo(InputMethod_TextConfig* config, InputMethod_TextAvoidInfo** avoidInfo);
138 |
139 | [LibraryImport("libohinputmethod.so")]
140 | public static partial InputMethod_ErrorCode OH_TextConfig_GetSelection(InputMethod_TextConfig* config, int* start, int* end);
141 |
142 | [LibraryImport("libohinputmethod.so")]
143 | public static partial InputMethod_ErrorCode OH_TextConfig_GetWindowId(InputMethod_TextConfig* config, int* windowId);
144 |
145 | [LibraryImport("libohinputmethod.so")]
146 | public static partial InputMethod_TextEditorProxy* OH_TextEditorProxy_Create();
147 |
148 | [LibraryImport("libohinputmethod.so")]
149 | public static partial void OH_TextEditorProxy_Destroy(InputMethod_TextEditorProxy* proxy);
150 |
151 | [LibraryImport("libohinputmethod.so")]
152 | public static partial InputMethod_ErrorCode OH_TextEditorProxy_SetGetTextConfigFunc(InputMethod_TextEditorProxy* proxy, delegate* unmanaged[Cdecl] getTextConfigFunc);
153 |
154 | [LibraryImport("libohinputmethod.so")]
155 | public static partial InputMethod_ErrorCode OH_TextEditorProxy_SetInsertTextFunc(InputMethod_TextEditorProxy* proxy, delegate* unmanaged[Cdecl] insertTextFunc);
156 |
157 | [LibraryImport("libohinputmethod.so")]
158 | public static partial InputMethod_ErrorCode OH_TextEditorProxy_SetDeleteForwardFunc(InputMethod_TextEditorProxy* proxy, delegate* unmanaged[Cdecl] insertTextFunc);
159 |
160 | [LibraryImport("libohinputmethod.so")]
161 | public static partial InputMethod_ErrorCode OH_TextEditorProxy_SetDeleteBackwardFunc(
162 | InputMethod_TextEditorProxy* proxy, delegate* unmanaged[Cdecl] deleteBackwardFunc);
163 |
164 | [LibraryImport("libohinputmethod.so")]
165 | public static partial InputMethod_ErrorCode OH_TextEditorProxy_SetSendKeyboardStatusFunc(
166 | InputMethod_TextEditorProxy* proxy, delegate* unmanaged[Cdecl] sendKeyboardStatusFunc);
167 |
168 | [LibraryImport("libohinputmethod.so")]
169 | public static partial InputMethod_ErrorCode OH_TextEditorProxy_SetSendEnterKeyFunc(InputMethod_TextEditorProxy* proxy, delegate* unmanaged[Cdecl] sendEnterKeyFunc);
170 |
171 | [LibraryImport("libohinputmethod.so")]
172 | public static partial InputMethod_ErrorCode OH_TextEditorProxy_SetMoveCursorFunc(
173 | InputMethod_TextEditorProxy* proxy, delegate* unmanaged[Cdecl] moveCursorFunc);
174 |
175 | [LibraryImport("libohinputmethod.so")]
176 | public static partial InputMethod_ErrorCode OH_TextEditorProxy_SetHandleSetSelectionFunc(InputMethod_TextEditorProxy* proxy, delegate* unmanaged[Cdecl] handleSetSelectionFunc);
177 |
178 | [LibraryImport("libohinputmethod.so")]
179 | public static partial InputMethod_ErrorCode OH_TextEditorProxy_SetHandleExtendActionFunc(
180 | InputMethod_TextEditorProxy* proxy, delegate* unmanaged[Cdecl] handleExtendActionFunc);
181 |
182 | [LibraryImport("libohinputmethod.so")]
183 | public static partial InputMethod_ErrorCode OH_TextEditorProxy_SetGetLeftTextOfCursorFunc(
184 | InputMethod_TextEditorProxy* proxy, delegate* unmanaged[Cdecl] getLeftTextOfCursorFunc);
185 |
186 | [LibraryImport("libohinputmethod.so")]
187 | public static partial InputMethod_ErrorCode OH_TextEditorProxy_SetGetRightTextOfCursorFunc(
188 | InputMethod_TextEditorProxy* proxy, delegate* unmanaged[Cdecl] getRightTextOfCursorFunc);
189 |
190 | [LibraryImport("libohinputmethod.so")]
191 | public static partial InputMethod_ErrorCode OH_TextEditorProxy_SetGetTextIndexAtCursorFunc(
192 | InputMethod_TextEditorProxy* proxy, delegate* unmanaged[Cdecl] getTextIndexAtCursorFunc);
193 |
194 | [LibraryImport("libohinputmethod.so")]
195 | public static partial InputMethod_ErrorCode OH_TextEditorProxy_SetReceivePrivateCommandFunc(
196 | InputMethod_TextEditorProxy* proxy, delegate* unmanaged[Cdecl] receivePrivateCommandFunc);
197 |
198 | [LibraryImport("libohinputmethod.so")]
199 | public static partial InputMethod_ErrorCode OH_TextEditorProxy_SetSetPreviewTextFunc(
200 | InputMethod_TextEditorProxy* proxy, delegate* unmanaged[Cdecl] setPreviewTextFunc);
201 |
202 |
203 | [LibraryImport("libohinputmethod.so")]
204 | public static partial InputMethod_ErrorCode OH_TextEditorProxy_SetFinishTextPreviewFunc(
205 | InputMethod_TextEditorProxy* proxy, delegate* unmanaged[Cdecl] finishTextPreviewFunc);
206 |
207 | [LibraryImport("libohinputmethod.so")]
208 | public static partial InputMethod_ErrorCode OH_TextEditorProxy_GetGetTextConfigFunc(
209 | InputMethod_TextEditorProxy* proxy, delegate* unmanaged[Cdecl] getTextConfigFunc);
210 |
211 | [LibraryImport("libohinputmethod.so")]
212 | public static partial InputMethod_ErrorCode OH_TextEditorProxy_GetInsertTextFunc(
213 | InputMethod_TextEditorProxy* proxy, delegate* unmanaged[Cdecl] insertTextFunc);
214 |
215 | [LibraryImport("libohinputmethod.so")]
216 | public static partial InputMethod_ErrorCode OH_TextEditorProxy_GetDeleteForwardFunc(
217 | InputMethod_TextEditorProxy* proxy, delegate* unmanaged[Cdecl] deleteForwardFunc);
218 |
219 | [LibraryImport("libohinputmethod.so")]
220 | public static partial InputMethod_ErrorCode OH_TextEditorProxy_GetDeleteBackwardFunc(
221 | InputMethod_TextEditorProxy* proxy, delegate* unmanaged[Cdecl]* deleteBackwardFunc);
222 |
223 | [LibraryImport("libohinputmethod.so")]
224 | public static partial InputMethod_ErrorCode OH_TextEditorProxy_GetSendKeyboardStatusFunc(
225 | InputMethod_TextEditorProxy* proxy, delegate* unmanaged[Cdecl] sendKeyboardStatusFunc);
226 |
227 | [LibraryImport("libohinputmethod.so")]
228 | public static partial InputMethod_ErrorCode OH_TextEditorProxy_GetSendEnterKeyFunc(
229 | InputMethod_TextEditorProxy* proxy, delegate* unmanaged[Cdecl] sendEnterKeyFunc);
230 |
231 | [LibraryImport("libohinputmethod.so")]
232 | public static partial InputMethod_ErrorCode OH_TextEditorProxy_GetMoveCursorFunc(
233 | InputMethod_TextEditorProxy* proxy, delegate* unmanaged[Cdecl] moveCursorFunc);
234 |
235 | [LibraryImport("libohinputmethod.so")]
236 | public static partial InputMethod_ErrorCode OH_TextEditorProxy_GetHandleSetSelectionFunc(
237 | InputMethod_TextEditorProxy* proxy, delegate* unmanaged[Cdecl] handleSetSelectionFunc);
238 |
239 | [LibraryImport("libohinputmethod.so")]
240 | public static partial InputMethod_ErrorCode OH_TextEditorProxy_GetHandleExtendActionFunc(
241 | InputMethod_TextEditorProxy* proxy, delegate* unmanaged[Cdecl] handleExtendActionFunc);
242 |
243 | [LibraryImport("libohinputmethod.so")]
244 | public static partial InputMethod_ErrorCode OH_TextEditorProxy_GetGetLeftTextOfCursorFunc(
245 | InputMethod_TextEditorProxy* proxy, delegate* unmanaged[Cdecl] getLeftTextOfCursorFunc);
246 |
247 | [LibraryImport("libohinputmethod.so")]
248 | public static partial InputMethod_ErrorCode OH_TextEditorProxy_GetGetRightTextOfCursorFunc(
249 | InputMethod_TextEditorProxy* proxy, delegate* unmanaged[Cdecl] getRightTextOfCursorFunc);
250 |
251 | [LibraryImport("libohinputmethod.so")]
252 | public static partial InputMethod_ErrorCode OH_TextEditorProxy_GetGetTextIndexAtCursorFunc(
253 | InputMethod_TextEditorProxy* proxy, delegate* unmanaged[Cdecl] getTextIndexAtCursorFunc);
254 |
255 | [LibraryImport("libohinputmethod.so")]
256 | public static partial InputMethod_ErrorCode OH_TextEditorProxy_GetReceivePrivateCommandFunc(
257 | InputMethod_TextEditorProxy* proxy, delegate* unmanaged[Cdecl] receivePrivateCommandFunc);
258 |
259 | [LibraryImport("libohinputmethod.so")]
260 | public static partial InputMethod_ErrorCode OH_TextEditorProxy_GetSetPreviewTextFunc(
261 | InputMethod_TextEditorProxy* proxy, delegate* unmanaged[Cdecl] setPreviewTextFunc);
262 |
263 | [LibraryImport("libohinputmethod.so")]
264 | public static partial InputMethod_ErrorCode OH_TextEditorProxy_GetFinishTextPreviewFunc(
265 | InputMethod_TextEditorProxy* proxy, delegate* unmanaged[Cdecl] finishTextPreviewFunc);
266 | }
267 |
--------------------------------------------------------------------------------
/OpenHarmony.NDK.Bindings/input_method/input_method_type.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace OpenHarmony.NDK.Bindings.Native;
8 |
9 | public struct InputMethod_AttachOptions
10 | {
11 |
12 | }
13 |
14 | public struct InputMethod_TextEditorProxy
15 | {
16 |
17 | }
18 | public struct InputMethod_InputMethodProxy
19 | {
20 |
21 | }
22 | public struct InputMethod_CursorInfo
23 | {
24 |
25 | }
26 |
27 | public struct InputMethod_PrivateCommand
28 | {
29 |
30 | }
31 |
32 | public struct InputMethod_TextAvoidInfo
33 | {
34 |
35 | }
36 |
37 | public struct InputMethod_TextConfig
38 | {
39 |
40 | }
41 | public enum InputMethod_CommandValueType
42 | {
43 | /**
44 | * Value type is NONE.
45 | */
46 | IME_COMMAND_VALUE_TYPE_NONE = 0,
47 | /**
48 | * Value type is STRING.
49 | */
50 | IME_COMMAND_VALUE_TYPE_STRING = 1,
51 | /**
52 | * Value type is BOOL.
53 | */
54 | IME_COMMAND_VALUE_TYPE_BOOL = 2,
55 | /**
56 | * Value type is INT32.
57 | */
58 | IME_COMMAND_VALUE_TYPE_INT32 = 3,
59 | }
60 |
61 | public enum InputMethod_EnterKeyType
62 | {
63 | /**
64 | * The enter key type is UNSPECIFIED.
65 | */
66 | IME_ENTER_KEY_UNSPECIFIED = 0,
67 | /**
68 | * The enter key type is NONE.
69 | */
70 | IME_ENTER_KEY_NONE = 1,
71 | /**
72 | * The enter key type is GO.
73 | */
74 | IME_ENTER_KEY_GO = 2,
75 | /**
76 | * The enter key type is SEARCH.
77 | */
78 | IME_ENTER_KEY_SEARCH = 3,
79 | /**
80 | * The enter key type is SEND.
81 | */
82 | IME_ENTER_KEY_SEND = 4,
83 | /**
84 | * The enter key type is NEXT.
85 | */
86 | IME_ENTER_KEY_NEXT = 5,
87 | /**
88 | * The enter key type is DONE.
89 | */
90 | IME_ENTER_KEY_DONE = 6,
91 | /**
92 | * The enter key type is PREVIOUS.
93 | */
94 | IME_ENTER_KEY_PREVIOUS = 7,
95 | /**
96 | * The enter key type is NEWLINE.
97 | */
98 | IME_ENTER_KEY_NEWLINE = 8,
99 | }
100 |
101 | public enum InputMethod_TextInputType
102 | {
103 | /**
104 | * The text input type is NONE.
105 | */
106 | IME_TEXT_INPUT_TYPE_NONE = -1,
107 | /**
108 | * The text input type is TEXT.
109 | */
110 | IME_TEXT_INPUT_TYPE_TEXT = 0,
111 | /**
112 | * The text input type is MULTILINE.
113 | */
114 | IME_TEXT_INPUT_TYPE_MULTILINE = 1,
115 | /**
116 | * The text input type is NUMBER.
117 | */
118 | IME_TEXT_INPUT_TYPE_NUMBER = 2,
119 | /**
120 | * The text input type is PHONE.
121 | */
122 | IME_TEXT_INPUT_TYPE_PHONE = 3,
123 | /**
124 | * The text input type is DATETIME.
125 | */
126 | IME_TEXT_INPUT_TYPE_DATETIME = 4,
127 | /**
128 | * The text input type is EMAIL ADDRESS.
129 | */
130 | IME_TEXT_INPUT_TYPE_EMAIL_ADDRESS = 5,
131 | /**
132 | * The text input type is URL.
133 | */
134 | IME_TEXT_INPUT_TYPE_URL = 6,
135 | /**
136 | * The text input type is VISIBLE PASSWORD.
137 | */
138 | IME_TEXT_INPUT_TYPE_VISIBLE_PASSWORD = 7,
139 | /**
140 | * The text input type is NUMBER PASSWORD.
141 | */
142 | IME_TEXT_INPUT_TYPE_NUMBER_PASSWORD = 8,
143 | /**
144 | * The text input type is SCREEN LOCK PASSWORD.
145 | */
146 | IME_TEXT_INPUT_TYPE_SCREEN_LOCK_PASSWORD = 9,
147 | /**
148 | * The text input type is USER NAME.
149 | */
150 | IME_TEXT_INPUT_TYPE_USER_NAME = 10,
151 | /**
152 | * The text input type is NEW PASSWORD.
153 | */
154 | IME_TEXT_INPUT_TYPE_NEW_PASSWORD = 11,
155 | /**
156 | * The text input type is NUMBER DECIMAL.
157 | */
158 | IME_TEXT_INPUT_TYPE_NUMBER_DECIMAL = 12,
159 | }
160 | public enum InputMethod_ErrorCode
161 | {
162 | /**
163 | * @error The error code in the correct case.
164 | */
165 | IME_ERR_OK = 0,
166 |
167 | /**
168 | * @error The error code when error is undefined.
169 | */
170 | IME_ERR_UNDEFINED = 1,
171 | /**
172 | * @error The error code when parameter check failed.
173 | */
174 | IME_ERR_PARAMCHECK = 401,
175 | /**
176 | * @error The error code when the package manager error.
177 | */
178 | IME_ERR_PACKAGEMANAGER = 12800001,
179 | /**
180 | * @error The error code when input method engine error.
181 | */
182 | IME_ERR_IMENGINE = 12800002,
183 | /**
184 | * @error The error code when input method client error.
185 | */
186 | IME_ERR_IMCLIENT = 12800003,
187 | /**
188 | * @error The error code when configuration persisting error.
189 | */
190 | IME_ERR_CONFIG_PERSIST = 12800005,
191 | /**
192 | * @error The error code when input method controller error.
193 | */
194 | IME_ERR_CONTROLLER = 12800006,
195 | /**
196 | * @error The error code when input method setting error.
197 | */
198 | IME_ERR_SETTINGS = 12800007,
199 | /**
200 | * @error The error code when input method manager service error.
201 | */
202 | IME_ERR_IMMS = 12800008,
203 | /**
204 | * @error The error code when input method client is detached.
205 | */
206 | IME_ERR_DETACHED = 12800009,
207 | /**
208 | * @error The error code when unexpected null pointer.
209 | */
210 | IME_ERR_NULL_POINTER = 12802000,
211 | /**
212 | * @error The error code when query failed.
213 | */
214 | IME_ERR_QUERY_FAILED = 12802001,
215 | }
216 | public enum InputMethod_KeyboardStatus
217 | {
218 | /**
219 | * The keyboard status is none.
220 | */
221 | IME_KEYBOARD_STATUS_NONE = 0,
222 | /**
223 | * The keyboard status is hide.
224 | */
225 | IME_KEYBOARD_STATUS_HIDE = 1,
226 | /**
227 | * The keyboard status is show.
228 | */
229 | IME_KEYBOARD_STATUS_SHOW = 2,
230 | }
231 |
232 | public enum InputMethod_Direction
233 | {
234 | /**
235 | * The direction is NONE.
236 | */
237 | IME_DIRECTION_NONE = 0,
238 | /**
239 | * The direction is UP.
240 | */
241 | IME_DIRECTION_UP = 1,
242 | /**
243 | * The direction is DOWN.
244 | */
245 | IME_DIRECTION_DOWN = 2,
246 | /**
247 | * The direction is LEFT.
248 | */
249 | IME_DIRECTION_LEFT = 3,
250 | /**
251 | * The direction is RIGHT.
252 | */
253 | IME_DIRECTION_RIGHT = 4,
254 | }
255 |
256 | public enum InputMethod_ExtendAction
257 | {
258 | /**
259 | * Select all text.
260 | */
261 | IME_EXTEND_ACTION_SELECT_ALL = 0,
262 | /**
263 | * Cut selected text.
264 | */
265 | IME_EXTEND_ACTION_CUT = 3,
266 | /**
267 | * Copy selected text.
268 | */
269 | IME_EXTEND_ACTION_COPY = 4,
270 | /**
271 | * Paste from paste board.
272 | */
273 | IME_EXTEND_ACTION_PASTE = 5,
274 | }
--------------------------------------------------------------------------------
/OpenHarmony.NDK.Bindings/node_api/ace_napi.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.InteropServices;
3 |
4 | namespace OpenHarmony.NDK.Bindings.Native;
5 |
6 | public static unsafe partial class node_api
7 | {
8 | [LibraryImport("libace_napi.z.so")]
9 | public static partial void napi_module_register(napi_module* module);
10 |
11 | [LibraryImport("libace_napi.z.so")]
12 | public static partial napi_status napi_fatal_exception(napi_env env, napi_value err);
13 |
14 | [LibraryImport("libace_napi.z.so")]
15 | public static partial void napi_fatal_error(sbyte* location, ulong location_len, sbyte* message, ulong message_len);
16 |
17 | [LibraryImport("libace_napi.z.so")]
18 | public static partial napi_status napi_async_init(napi_env env, napi_value async_resource, napi_value async_resource_name, napi_async_context* result);
19 |
20 | [LibraryImport("libace_napi.z.so")]
21 | public static partial napi_status napi_make_callback(napi_env env, napi_async_context async_context, napi_value recv, napi_value func, ulong argc, napi_value* argv, napi_value* result);
22 |
23 | [LibraryImport("libace_napi.z.so")]
24 | public static partial napi_status napi_create_buffer(napi_env env, ulong length, void** data, napi_value* result);
25 |
26 | [LibraryImport("libace_napi.z.so")]
27 | public static partial napi_status napi_create_external_buffer(napi_env env, ulong length, void* data, delegate* unmanaged[Cdecl] finalize_cb, void* finalize_hint, napi_value* result);
28 |
29 | [LibraryImport("libace_napi.z.so")]
30 | public static partial napi_status napi_create_buffer_copy(napi_env env, ulong length, void* data, void** result_data, napi_value* result);
31 |
32 | [LibraryImport("libace_napi.z.so")]
33 | public static partial napi_status napi_is_buffer(napi_env env, napi_value value, bool* result);
34 |
35 | [LibraryImport("libace_napi.z.so")]
36 | public static partial napi_status napi_get_buffer_info(napi_env env, napi_value value, void** data, ulong* length);
37 |
38 | [LibraryImport("libace_napi.z.so")]
39 | public static partial napi_status napi_create_async_work(napi_env env,
40 | napi_value async_resource,
41 | napi_value async_resource_name,
42 | delegate* unmanaged[Cdecl] execute,
43 | delegate* unmanaged[Cdecl] complete,
44 | void* data,
45 | napi_async_work* result);
46 |
47 |
48 |
49 | [LibraryImport("libace_napi.z.so")]
50 | public static partial napi_status napi_get_last_error_info(napi_env env, napi_extended_error_info** result);
51 |
52 | [LibraryImport("libace_napi.z.so")]
53 | public static partial napi_status napi_get_undefined(napi_env env, napi_value* result);
54 |
55 | [LibraryImport("libace_napi.z.so")]
56 | public static partial napi_status napi_get_null(napi_env env, napi_value* result);
57 |
58 | [LibraryImport("libace_napi.z.so")]
59 | public static partial napi_status napi_get_global(napi_env env, napi_value* result);
60 |
61 | [LibraryImport("libace_napi.z.so")]
62 | public static partial napi_status napi_get_boolean(napi_env env, [MarshalAs(UnmanagedType.Bool)] bool value, napi_value* result);
63 |
64 |
65 | [LibraryImport("libace_napi.z.so")]
66 | public static partial napi_status napi_create_object(napi_env env, napi_value* result);
67 |
68 | [LibraryImport("libace_napi.z.so")]
69 | public static partial napi_status napi_create_array(napi_env env, napi_value* result);
70 |
71 | [LibraryImport("libace_napi.z.so")]
72 | public static partial napi_status napi_create_array_with_length(napi_env env, ulong length, napi_value* result);
73 |
74 | [LibraryImport("libace_napi.z.so")]
75 | public static partial napi_status napi_create_double(napi_env env, double value, napi_value* result);
76 |
77 | [LibraryImport("libace_napi.z.so")]
78 | public static partial napi_status napi_create_int32(napi_env env, int value, napi_value* result);
79 |
80 | [LibraryImport("libace_napi.z.so")]
81 | public static partial napi_status napi_create_uint32(napi_env env,
82 | uint value,
83 | napi_value* result);
84 |
85 | [LibraryImport("libace_napi.z.so")]
86 | public static partial napi_status napi_create_int64(napi_env env,
87 | long value,
88 | napi_value* result);
89 |
90 | [LibraryImport("libace_napi.z.so")]
91 | public static partial napi_status napi_create_string_latin1(napi_env env,
92 | sbyte* str,
93 | ulong length,
94 | napi_value* result);
95 |
96 | [LibraryImport("libace_napi.z.so")]
97 | public static partial napi_status napi_create_string_utf8(napi_env env,
98 | sbyte* str,
99 | ulong length,
100 | napi_value* result);
101 |
102 | [LibraryImport("libace_napi.z.so")]
103 | public static partial napi_status napi_create_string_utf16(napi_env env,
104 | char* str,
105 | ulong length,
106 | napi_value* result);
107 |
108 | [LibraryImport("libace_napi.z.so")]
109 | public static partial napi_status napi_create_symbol(napi_env env,
110 | napi_value description,
111 | napi_value* result);
112 |
113 | [LibraryImport("libace_napi.z.so")]
114 | public static partial napi_status napi_create_function(napi_env env,
115 | sbyte* utf8name,
116 | ulong length,
117 | delegate* unmanaged[Cdecl] cb,
118 | void* data,
119 | napi_value* result);
120 |
121 | [LibraryImport("libace_napi.z.so")]
122 | public static partial napi_status napi_create_error(napi_env env,
123 | napi_value code,
124 | napi_value msg,
125 | napi_value* result);
126 |
127 | [LibraryImport("libace_napi.z.so")]
128 | public static partial napi_status napi_create_type_error(napi_env env,
129 | napi_value code,
130 | napi_value msg,
131 | napi_value* result);
132 |
133 | [LibraryImport("libace_napi.z.so")]
134 | public static partial napi_status napi_create_range_error(napi_env env,
135 | napi_value code,
136 | napi_value msg,
137 | napi_value* result);
138 |
139 |
140 |
141 | [LibraryImport("libace_napi.z.so")]
142 | public static partial napi_status napi_typeof(napi_env env,
143 | napi_value value,
144 | napi_valuetype* result);
145 | [LibraryImport("libace_napi.z.so")]
146 | public static partial napi_status napi_get_value_double(napi_env env,
147 | napi_value value,
148 | double* result);
149 | [LibraryImport("libace_napi.z.so")]
150 | public static partial napi_status napi_get_value_int32(napi_env env,
151 | napi_value value,
152 | int* result);
153 | [LibraryImport("libace_napi.z.so")]
154 | public static partial napi_status napi_get_value_uint32(napi_env env,
155 | napi_value value,
156 | uint* result);
157 | [LibraryImport("libace_napi.z.so")]
158 | public static partial napi_status napi_get_value_int64(napi_env env,
159 | napi_value value,
160 | long* result);
161 | [LibraryImport("libace_napi.z.so")]
162 | public static partial napi_status napi_get_value_bool(napi_env env,
163 | napi_value value,
164 | bool* result);
165 |
166 | // Copies LATIN-1 encoded bytes from a string into a buffer.
167 | [LibraryImport("libace_napi.z.so")]
168 | public static partial napi_status napi_get_value_string_latin1(napi_env env,
169 | napi_value value,
170 | char* buf,
171 | ulong bufsize,
172 | ulong* result);
173 |
174 | // Copies UTF-8 encoded bytes from a string into a buffer.
175 | [LibraryImport("libace_napi.z.so")]
176 | public static partial napi_status napi_get_value_string_utf8(napi_env env,
177 | napi_value value,
178 | sbyte* buf,
179 | ulong bufsize,
180 | ulong* result);
181 |
182 | // Copies UTF-16 encoded bytes from a string into a buffer.
183 | [LibraryImport("libace_napi.z.so")]
184 | public static partial napi_status napi_get_value_string_utf16(napi_env env,
185 | napi_value value,
186 | char* buf,
187 | ulong bufsize,
188 | ulong* result);
189 |
190 | [LibraryImport("libace_napi.z.so")]
191 | public static partial napi_status napi_coerce_to_bool(napi_env env,
192 | napi_value value,
193 | napi_value* result);
194 | [LibraryImport("libace_napi.z.so")]
195 | public static partial napi_status napi_coerce_to_number(napi_env env,
196 | napi_value value,
197 | napi_value* result);
198 | [LibraryImport("libace_napi.z.so")]
199 | public static partial napi_status napi_coerce_to_object(napi_env env,
200 | napi_value value,
201 | napi_value* result);
202 | [LibraryImport("libace_napi.z.so")]
203 | public static partial napi_status napi_coerce_to_string(napi_env env,
204 | napi_value value,
205 | napi_value* result);
206 | [LibraryImport("libace_napi.z.so")]
207 | public static partial napi_status napi_get_prototype(napi_env env,
208 | napi_value @object,
209 | napi_value* result);
210 | [LibraryImport("libace_napi.z.so")]
211 | public static partial napi_status napi_get_property_names(napi_env env,
212 | napi_value @object,
213 | napi_value* result);
214 | [LibraryImport("libace_napi.z.so")]
215 | public static partial napi_status napi_set_property(napi_env env,
216 | napi_value @object,
217 | napi_value key,
218 | napi_value value);
219 | [LibraryImport("libace_napi.z.so")]
220 | public static partial napi_status napi_has_property(napi_env env,
221 | napi_value @object,
222 | napi_value key,
223 | bool* result);
224 | [LibraryImport("libace_napi.z.so")]
225 | public static partial napi_status napi_get_property(napi_env env,
226 | napi_value @object,
227 | napi_value key,
228 | napi_value* result);
229 | [LibraryImport("libace_napi.z.so")]
230 | public static partial napi_status napi_delete_property(napi_env env,
231 | napi_value @object,
232 | napi_value key,
233 | bool* result);
234 | [LibraryImport("libace_napi.z.so")]
235 | public static partial napi_status napi_has_own_property(napi_env env,
236 | napi_value @object,
237 | napi_value key,
238 | bool* result);
239 | [LibraryImport("libace_napi.z.so")]
240 | public static partial napi_status napi_set_named_property(napi_env env,
241 | napi_value @object,
242 | sbyte* utf8name,
243 | napi_value value);
244 | [LibraryImport("libace_napi.z.so")]
245 | public static partial napi_status napi_has_named_property(napi_env env,
246 | napi_value @object,
247 | sbyte* utf8name,
248 | bool* result);
249 | [LibraryImport("libace_napi.z.so")]
250 | public static partial napi_status napi_get_named_property(napi_env env,
251 | napi_value @object,
252 | sbyte* utf8name,
253 | napi_value* result);
254 | [LibraryImport("libace_napi.z.so")]
255 | public static partial napi_status napi_set_element(napi_env env,
256 | napi_value @object,
257 | uint index,
258 | napi_value value);
259 | [LibraryImport("libace_napi.z.so")]
260 | public static partial napi_status napi_has_element(napi_env env,
261 | napi_value @object,
262 | uint index,
263 | bool* result);
264 | [LibraryImport("libace_napi.z.so")]
265 | public static partial napi_status napi_get_element(napi_env env,
266 | napi_value @object,
267 | uint index,
268 | napi_value* result);
269 | [LibraryImport("libace_napi.z.so")]
270 | public static partial napi_status napi_delete_element(napi_env env,
271 | napi_value @object,
272 | uint index,
273 | bool* result);
274 |
275 | [LibraryImport("libace_napi.z.so")]
276 | public static partial napi_status napi_define_properties(napi_env env,
277 | napi_value @object,
278 | ulong property_count,
279 | napi_property_descriptor* properties);
280 |
281 | // Methods to work with Arrays
282 | [LibraryImport("libace_napi.z.so")]
283 | public static partial napi_status napi_is_array(napi_env env,
284 | napi_value value,
285 | bool* result);
286 | [LibraryImport("libace_napi.z.so")]
287 | public static partial napi_status napi_get_array_length(napi_env env,
288 | napi_value value,
289 | uint* result);
290 |
291 | // Methods to compare values
292 | [LibraryImport("libace_napi.z.so")]
293 | public static partial napi_status napi_strict_equals(napi_env env,
294 | napi_value lhs,
295 | napi_value rhs,
296 | bool* result);
297 |
298 | // Methods to work with Functions
299 | [LibraryImport("libace_napi.z.so")]
300 | public static partial napi_status napi_call_function(napi_env env,
301 | napi_value recv,
302 | napi_value func,
303 | ulong argc,
304 | napi_value* argv,
305 | napi_value* result);
306 | [LibraryImport("libace_napi.z.so")]
307 | public static partial napi_status napi_new_instance(napi_env env,
308 | napi_value constructor,
309 | ulong argc,
310 | napi_value* argv,
311 | napi_value* result);
312 | [LibraryImport("libace_napi.z.so")]
313 | public static partial napi_status napi_instanceof(napi_env env,
314 | napi_value @object,
315 | napi_value constructor,
316 | bool* result);
317 | // Methods to work with napi_callbacks
318 |
319 | // Gets all callback info in a single call. (Ugly, but faster.)
320 | [LibraryImport("libace_napi.z.so")]
321 | public static partial napi_status napi_get_cb_info(
322 | napi_env env, // [in] NAPI environment handle
323 | napi_callback_info cbinfo, // [in] Opaque callback-info handle
324 | ulong* argc, // [in-out] Specifies the size of the provided argv array
325 | // and receives the actual count of args.
326 | napi_value* argv, // [out] Array of values
327 | napi_value* this_arg, // [out] Receives the JS 'this' arg for the call
328 | void** data); // [out] Receives the data pointer for the callback.
329 |
330 | [LibraryImport("libace_napi.z.so")]
331 | public static partial napi_status napi_get_new_target(napi_env env,
332 | napi_callback_info cbinfo,
333 | napi_value* result);
334 | [LibraryImport("libace_napi.z.so")]
335 | public static partial napi_status napi_define_class(napi_env env,
336 | sbyte* utf8name,
337 | ulong length,
338 | delegate* unmanaged[Cdecl] constructor,
339 | void* data,
340 | ulong property_count,
341 | napi_property_descriptor* properties,
342 | napi_value* result);
343 |
344 | // Methods to work with external data objects
345 | [LibraryImport("libace_napi.z.so")]
346 | public static partial napi_status napi_wrap(napi_env env,
347 | napi_value js_object,
348 | void* native_object,
349 | delegate* unmanaged[Cdecl] finalize_cb,
350 | void* finalize_hint,
351 | napi_ref* result);
352 | [LibraryImport("libace_napi.z.so")]
353 | public static partial napi_status napi_unwrap(napi_env env,
354 | napi_value js_object,
355 | void** result);
356 | [LibraryImport("libace_napi.z.so")]
357 | public static partial napi_status napi_remove_wrap(napi_env env,
358 | napi_value js_object,
359 | void** result);
360 | [LibraryImport("libace_napi.z.so")]
361 | public static partial napi_status napi_create_external(napi_env env,
362 | void* data,
363 | delegate* unmanaged[Cdecl] finalize_cb,
364 | void* finalize_hint,
365 | napi_value* result);
366 | [LibraryImport("libace_napi.z.so")]
367 | public static partial napi_status napi_get_value_external(napi_env env,
368 | napi_value value,
369 | void** result);
370 |
371 | // Methods to control object lifespan
372 |
373 | // Set initial_refcount to 0 for a weak reference, >0 for a strong reference.
374 | [LibraryImport("libace_napi.z.so")]
375 | public static partial napi_status napi_create_reference(napi_env env,
376 | napi_value value,
377 | int initial_refcount,
378 | napi_ref* result);
379 |
380 | // Deletes a reference. The referenced value is released, and may
381 | // be GC'd unless there are other references to it.
382 | [LibraryImport("libace_napi.z.so")]
383 | public static partial napi_status napi_delete_reference(napi_env env, napi_ref @ref);
384 |
385 | // Increments the reference count, optionally returning the resulting count.
386 | // After this call the reference will be a strong reference because its
387 | // refcount is >0, and the referenced object is effectively "pinned".
388 | // Calling this when the refcount is 0 and the object is unavailable
389 | // results in an error.
390 | [LibraryImport("libace_napi.z.so")]
391 | public static partial napi_status napi_reference_ref(napi_env env,
392 | napi_ref @ref,
393 | int* result);
394 |
395 | // Decrements the reference count, optionally returning the resulting count.
396 | // If the result is 0 the reference is now weak and the object may be GC'd
397 | // at any time if there are no other references. Calling this when the
398 | // refcount is already 0 results in an error.
399 | [LibraryImport("libace_napi.z.so")]
400 | public static partial napi_status napi_reference_unref(napi_env env,
401 | napi_ref @ref,
402 | int* result);
403 |
404 | // Attempts to get a referenced value. If the reference is weak,
405 | // the value might no longer be available, in that case the call
406 | // is still successful but the result is NULL.
407 | [LibraryImport("libace_napi.z.so")]
408 | public static partial napi_status napi_get_reference_value(napi_env env,
409 | napi_ref @ref,
410 | napi_value* result);
411 |
412 | [LibraryImport("libace_napi.z.so")]
413 | public static partial napi_status napi_open_handle_scope(napi_env env,
414 | napi_handle_scope* result);
415 | [LibraryImport("libace_napi.z.so")]
416 | public static partial napi_status napi_close_handle_scope(napi_env env,
417 | napi_handle_scope scope);
418 | [LibraryImport("libace_napi.z.so")]
419 | public static partial napi_status
420 | napi_open_escapable_handle_scope(napi_env env,
421 | napi_escapable_handle_scope* result);
422 | [LibraryImport("libace_napi.z.so")]
423 | public static partial napi_status
424 | napi_close_escapable_handle_scope(napi_env env,
425 | napi_escapable_handle_scope scope);
426 |
427 | [LibraryImport("libace_napi.z.so")]
428 | public static partial napi_status napi_escape_handle(napi_env env,
429 | napi_escapable_handle_scope scope,
430 | napi_value escapee,
431 | napi_value* result);
432 |
433 | // Methods to support error handling
434 | [LibraryImport("libace_napi.z.so")]
435 | public static partial napi_status napi_throw(napi_env env, napi_value error);
436 | [LibraryImport("libace_napi.z.so")]
437 | public static partial napi_status napi_throw_error(napi_env env,
438 | sbyte* code,
439 | sbyte* msg);
440 | [LibraryImport("libace_napi.z.so")]
441 | public static partial napi_status napi_throw_type_error(napi_env env,
442 | sbyte* code,
443 | sbyte* msg);
444 | [LibraryImport("libace_napi.z.so")]
445 | public static partial napi_status napi_throw_range_error(napi_env env,
446 | sbyte* code,
447 | sbyte* msg);
448 | [LibraryImport("libace_napi.z.so")]
449 | public static partial napi_status napi_is_error(napi_env env,
450 | napi_value value,
451 | bool* result);
452 |
453 | // Methods to support catching exceptions
454 | [LibraryImport("libace_napi.z.so")]
455 | public static partial napi_status napi_is_exception_pending(napi_env env, bool* result);
456 | [LibraryImport("libace_napi.z.so")]
457 | public static partial napi_status napi_get_and_clear_last_exception(napi_env env,
458 | napi_value* result);
459 |
460 | // Methods to work with array buffers and typed arrays
461 | [LibraryImport("libace_napi.z.so")]
462 | public static partial napi_status napi_is_arraybuffer(napi_env env,
463 | napi_value value,
464 | bool* result);
465 | [LibraryImport("libace_napi.z.so")]
466 | public static partial napi_status napi_create_arraybuffer(napi_env env,
467 | ulong byte_length,
468 | void** data,
469 | napi_value* result);
470 | [LibraryImport("libace_napi.z.so")]
471 | public static partial napi_status
472 | napi_create_external_arraybuffer(napi_env env,
473 | void* external_data,
474 | ulong byte_length,
475 | delegate* unmanaged[Cdecl] finalize_cb,
476 | void* finalize_hint,
477 | napi_value* result);
478 | [LibraryImport("libace_napi.z.so")]
479 | public static partial napi_status napi_get_arraybuffer_info(napi_env env,
480 | napi_value arraybuffer,
481 | void** data,
482 | ulong* byte_length);
483 | [LibraryImport("libace_napi.z.so")]
484 | public static partial napi_status napi_is_typedarray(napi_env env,
485 | napi_value value,
486 | bool* result);
487 | [LibraryImport("libace_napi.z.so")]
488 | public static partial napi_status napi_create_typedarray(napi_env env,
489 | napi_typedarray_type type,
490 | ulong length,
491 | napi_value arraybuffer,
492 | ulong byte_offset,
493 | napi_value* result);
494 | [LibraryImport("libace_napi.z.so")]
495 | public static partial napi_status napi_get_typedarray_info(napi_env env,
496 | napi_value typedarray,
497 | napi_typedarray_type* type,
498 | ulong* length,
499 | void** data,
500 | napi_value* arraybuffer,
501 | ulong* byte_offset);
502 |
503 | [LibraryImport("libace_napi.z.so")]
504 | public static partial napi_status napi_create_dataview(napi_env env,
505 | ulong length,
506 | napi_value arraybuffer,
507 | ulong byte_offset,
508 | napi_value* result);
509 | [LibraryImport("libace_napi.z.so")]
510 | public static partial napi_status napi_is_dataview(napi_env env,
511 | napi_value value,
512 | bool* result);
513 | [LibraryImport("libace_napi.z.so")]
514 | public static partial napi_status napi_get_dataview_info(napi_env env,
515 | napi_value dataview,
516 | ulong* bytelength,
517 | void** data,
518 | napi_value* arraybuffer,
519 | ulong* byte_offset);
520 |
521 | // version management
522 | [LibraryImport("libace_napi.z.so")]
523 | public static partial napi_status napi_get_version(napi_env env, int* result);
524 |
525 | // Promises
526 | [LibraryImport("libace_napi.z.so")]
527 | public static partial napi_status napi_create_promise(napi_env env,
528 | napi_deferred* deferred,
529 | napi_value* promise);
530 | [LibraryImport("libace_napi.z.so")]
531 | public static partial napi_status napi_resolve_deferred(napi_env env,
532 | napi_deferred deferred,
533 | napi_value resolution);
534 | [LibraryImport("libace_napi.z.so")]
535 | public static partial napi_status napi_reject_deferred(napi_env env,
536 | napi_deferred deferred,
537 | napi_value rejection);
538 | [LibraryImport("libace_napi.z.so")]
539 | public static partial napi_status napi_is_promise(napi_env env,
540 | napi_value value,
541 | bool* is_promise);
542 |
543 | // Running a script
544 | [LibraryImport("libace_napi.z.so")]
545 | public static partial napi_status napi_run_script(napi_env env,
546 | napi_value script,
547 | napi_value* result);
548 |
549 | // Memory management
550 | [LibraryImport("libace_napi.z.so")]
551 | public static partial napi_status napi_adjust_external_memory(napi_env env,
552 | long change_in_bytes,
553 | long* adjusted_value);
554 |
555 |
556 | // Dates
557 | [LibraryImport("libace_napi.z.so")]
558 | public static partial napi_status napi_create_date(napi_env env,
559 | double time,
560 | napi_value* result);
561 |
562 | [LibraryImport("libace_napi.z.so")]
563 | public static partial napi_status napi_is_date(napi_env env,
564 | napi_value value,
565 | bool* is_date);
566 |
567 | [LibraryImport("libace_napi.z.so")]
568 | public static partial napi_status napi_get_date_value(napi_env env,
569 | napi_value value,
570 | double* result);
571 |
572 | // Add finalizer for pointer
573 | [LibraryImport("libace_napi.z.so")]
574 | public static partial napi_status napi_add_finalizer(napi_env env,
575 | napi_value js_object,
576 | void* native_object,
577 | delegate* unmanaged[Cdecl] finalize_cb,
578 | void* finalize_hint,
579 | napi_ref* result);
580 |
581 | // BigInt
582 | [LibraryImport("libace_napi.z.so")]
583 | public static partial napi_status napi_create_bigint_int64(napi_env env,
584 | long value,
585 | napi_value* result);
586 | [LibraryImport("libace_napi.z.so")]
587 | public static partial napi_status napi_create_bigint_uint64(napi_env env,
588 | ulong value,
589 | napi_value* result);
590 | [LibraryImport("libace_napi.z.so")]
591 | public static partial napi_status napi_create_bigint_words(napi_env env,
592 | int sign_bit,
593 | ulong word_count,
594 | ulong* words,
595 | napi_value* result);
596 | [LibraryImport("libace_napi.z.so")]
597 | public static partial napi_status napi_get_value_bigint_int64(napi_env env,
598 | napi_value value,
599 | long* result,
600 | bool* lossless);
601 | [LibraryImport("libace_napi.z.so")]
602 | public static partial napi_status napi_get_value_bigint_uint64(napi_env env,
603 | napi_value value,
604 | ulong* result,
605 | bool* lossless);
606 | [LibraryImport("libace_napi.z.so")]
607 | public static partial napi_status napi_get_value_bigint_words(napi_env env,
608 | napi_value value,
609 | int* sign_bit,
610 | ulong* word_count,
611 | ulong* words);
612 |
613 | // Object
614 | [LibraryImport("libace_napi.z.so")]
615 | public static partial napi_status napi_get_all_property_names(napi_env env,
616 | napi_value @object,
617 | napi_key_collection_mode key_mode,
618 | napi_key_filter key_filter,
619 | napi_key_conversion key_conversion,
620 | napi_value* result);
621 |
622 | // Instance data
623 | [LibraryImport("libace_napi.z.so")]
624 | public static partial napi_status napi_set_instance_data(napi_env env,
625 | void* data,
626 | delegate* unmanaged[Cdecl] finalize_cb,
627 | void* finalize_hint);
628 |
629 | [LibraryImport("libace_napi.z.so")]
630 | public static partial napi_status napi_get_instance_data(napi_env env,
631 | void** data);
632 |
633 | // ArrayBuffer detaching
634 | [LibraryImport("libace_napi.z.so")]
635 | public static partial napi_status napi_detach_arraybuffer(napi_env env,
636 | napi_value arraybuffer);
637 |
638 | [LibraryImport("libace_napi.z.so")]
639 | public static partial napi_status napi_is_detached_arraybuffer(napi_env env,
640 | napi_value value,
641 | bool* result);
642 | // Type tagging
643 | [LibraryImport("libace_napi.z.so")]
644 | public static partial napi_status napi_type_tag_object(napi_env env,
645 | napi_value value,
646 | napi_type_tag* type_tag);
647 |
648 | [LibraryImport("libace_napi.z.so")]
649 | public static partial napi_status napi_check_object_type_tag(napi_env env,
650 | napi_value value,
651 | napi_type_tag* type_tag,
652 | bool* result);
653 | [LibraryImport("libace_napi.z.so")]
654 | public static partial napi_status napi_object_freeze(napi_env env,
655 | napi_value @object);
656 | [LibraryImport("libace_napi.z.so")]
657 | public static partial napi_status napi_object_seal(napi_env env,
658 | napi_value @object);
659 |
660 |
661 | [LibraryImport("libace_napi.z.so")]
662 | public static partial napi_status napi_run_script_path(napi_env env, sbyte* path, napi_value* result);
663 |
664 | [LibraryImport("libace_napi.z.so")]
665 | public static partial napi_status napi_queue_async_work_with_qos(napi_env env, napi_async_work work, napi_qos_t qos);
666 |
667 | [LibraryImport("libace_napi.z.so")]
668 | public static partial napi_status napi_load_module(napi_env env, sbyte* path, napi_value* result);
669 |
670 | }
671 |
--------------------------------------------------------------------------------
/OpenHarmony.NDK.Bindings/node_api/napi_types.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace OpenHarmony.NDK.Bindings.Native;
4 |
5 | public unsafe struct napi_module
6 | {
7 | public int nm_version;
8 | public uint nm_flags;
9 | public sbyte* nm_filename;
10 | public delegate* unmanaged[Cdecl] napi_addon_register_func;
11 | public sbyte* nm_modname;
12 | public void* nm_priv;
13 |
14 | public void* reserved_0;
15 | public void* reserved_1;
16 | public void* reserved_2;
17 | public void* reserved_3;
18 | }
19 |
20 | public struct napi_value
21 | {
22 | public nint Pointer;
23 | }
24 | public struct napi_env
25 | {
26 | public nint Pointer;
27 | }
28 | public struct napi_ref
29 | {
30 | public nint Pointer;
31 | }
32 | public struct napi_handle_scope
33 | {
34 | public nint Pointer;
35 | }
36 | public struct napi_escapable_handle_scope
37 | {
38 | public nint Pointer;
39 | }
40 | public struct napi_callback_info
41 | {
42 | public nint Pointer;
43 | }
44 | public struct napi_deferred
45 | {
46 | public nint Pointer;
47 | }
48 | public struct napi_async_work
49 | {
50 | public nint Pointer;
51 | }
52 |
53 | public struct napi_async_context
54 | {
55 | public nint Pointer;
56 | }
57 | public enum napi_status
58 | {
59 | napi_ok,
60 | napi_invalid_arg,
61 | napi_object_expected,
62 | napi_string_expected,
63 | napi_name_expected,
64 | napi_function_expected,
65 | napi_number_expected,
66 | napi_boolean_expected,
67 | napi_array_expected,
68 | napi_generic_failure,
69 | napi_pending_exception,
70 | napi_cancelled,
71 | napi_escape_called_twice,
72 | napi_handle_scope_mismatch,
73 | napi_callback_scope_mismatch,
74 | napi_queue_full,
75 | napi_closing,
76 | napi_bigint_expected,
77 | napi_date_expected,
78 | napi_arraybuffer_expected,
79 | napi_detachable_arraybuffer_expected,
80 | napi_would_deadlock, // unused
81 | napi_create_ark_runtime_too_many_envs = 22,
82 | napi_create_ark_runtime_only_one_env_per_thread = 23,
83 | napi_destroy_ark_runtime_env_not_exist = 24
84 | }
85 |
86 | public struct napi_type_tag
87 | {
88 | public ulong lower;
89 | public ulong upper;
90 | }
91 |
92 | public enum napi_qos_t
93 | {
94 | napi_qos_background = 0,
95 | napi_qos_utility = 1,
96 | napi_qos_default = 2,
97 | napi_qos_user_initiated = 3,
98 | }
99 |
100 | public unsafe struct napi_property_descriptor
101 | {
102 | public sbyte* utf8name;
103 | public napi_value name;
104 | public delegate* unmanaged[Cdecl] method;
105 | public delegate* unmanaged[Cdecl] getter;
106 | public delegate* unmanaged[Cdecl] setter;
107 | public napi_value value;
108 | public napi_property_attributes attributes;
109 | public void* data;
110 | };
111 |
112 | public enum napi_property_attributes
113 | {
114 | napi_default = 0,
115 | napi_writable = 1 << 0,
116 | napi_enumerable = 1 << 1,
117 | napi_configurable = 1 << 2,
118 | napi_static = 1 << 10,
119 | napi_default_method = napi_writable | napi_configurable,
120 | napi_default_jsproperty = napi_writable | napi_enumerable | napi_configurable,
121 | }
122 | public enum napi_valuetype
123 | {
124 | // ES6 types (corresponds to typeof)
125 | napi_undefined,
126 | napi_null,
127 | napi_boolean,
128 | napi_number,
129 | napi_string,
130 | napi_symbol,
131 | napi_object,
132 | napi_function,
133 | napi_external,
134 | napi_bigint,
135 | }
136 |
137 | public unsafe struct napi_extended_error_info
138 | {
139 | public sbyte* error_message;
140 | public void* engine_reserved;
141 | public uint engine_error_code;
142 | public napi_status error_code;
143 | }
144 |
145 | public enum napi_typedarray_type
146 | {
147 | napi_int8_array,
148 | napi_uint8_array,
149 | napi_uint8_clamped_array,
150 | napi_int16_array,
151 | napi_uint16_array,
152 | napi_int32_array,
153 | napi_uint32_array,
154 | napi_float32_array,
155 | napi_float64_array,
156 | napi_bigint64_array,
157 | napi_biguint64_array,
158 | }
159 |
160 | public enum napi_key_collection_mode
161 | {
162 | napi_key_include_prototypes,
163 | napi_key_own_only
164 | }
165 |
166 | public enum napi_key_filter
167 | {
168 | napi_key_all_properties = 0,
169 | napi_key_writable = 1,
170 | napi_key_enumerable = 1 << 1,
171 | napi_key_configurable = 1 << 2,
172 | napi_key_skip_strings = 1 << 3,
173 | napi_key_skip_symbols = 1 << 4
174 | }
175 |
176 | public enum napi_key_conversion
177 | {
178 | napi_key_keep_numbers,
179 | napi_key_numbers_to_strings
180 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## OpenHarmony NDK 绑定库 基于api level 13
--------------------------------------------------------------------------------