-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTianLi.TruthEye.cs
53 lines (40 loc) · 3.05 KB
/
TianLi.TruthEye.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
using System.Runtime.InteropServices;
/// <summary>
/// TianLi.TruthEye 的 C API
/// </summary>
namespace TianLi
{
public class TruthEyeInface
{
public delegate void Progress_Type(int current, int total);
[DllImport("TianLi.TruthEye.Inface.dll", EntryPoint = "TianLiTruthEye_Impl_Async_Download", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
public static extern void ImplAsyncDownload(Progress_Type progress);
[DllImport("TianLi.TruthEye.Inface.dll", EntryPoint = "TianLiTruthEye_Impl_Load", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
public static extern void Load(byte[] path = null, bool is_release = false);
[DllImport("TianLi.TruthEye.Inface.dll", EntryPoint = "TianLiTruthEye_Impl_Free", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
public static extern void Free();
[DllImport("TianLi.TruthEye.Inface.dll", EntryPoint = "TianLiTruthEye_CreateWindow", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
public static extern void CreateWindow();
[DllImport("TianLi.TruthEye.Inface.dll", EntryPoint = "TianLiTruthEye_DestroyWindow", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
public static extern void DestroyWindow();
[DllImport("TianLi.TruthEye.Inface.dll", EntryPoint = "TianLiTruthEye_ShowWindow", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
public static extern void ShowWindow();
[DllImport("TianLi.TruthEye.Inface.dll", EntryPoint = "TianLiTruthEye_HideWindow", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
public static extern void HideWindow();
[DllImport("TianLi.TruthEye.Inface.dll", EntryPoint = "TianLiTruthEye_SetJsonParams", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
public static extern void SetJsonParams(byte[] json_buff, int buff_size);
}
public class TruthEye
{
[DllImport("TianLi.TruthEye.dll", EntryPoint = "TianLiTruthEye_CreateWindow", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
public static extern void CreateWindow();
[DllImport("TianLi.TruthEye.dll", EntryPoint = "TianLiTruthEye_DestroyWindow", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
public static extern void DestroyWindow();
[DllImport("TianLi.TruthEye.dll", EntryPoint = "TianLiTruthEye_ShowWindow", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
public static extern void ShowWindow();
[DllImport("TianLi.TruthEye.dll", EntryPoint = "TianLiTruthEye_HideWindow", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
public static extern void HideWindow();
[DllImport("TianLi.TruthEye.dll", EntryPoint = "TianLiTruthEye_SetJsonParams", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
public static extern void SetJsonParams(byte[] json_buff, int buff_size);
}
}