mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-22 22:23:29 -07:00
[iOS] Add CalcManager static library
Include as Native Reference. Use __Internal path for import.
This commit is contained in:
parent
1fdce90a2e
commit
4872e9f459
4 changed files with 48 additions and 28 deletions
|
@ -12,88 +12,94 @@ namespace CalculationManager
|
|||
{
|
||||
public static class NativeDispatch
|
||||
{
|
||||
[DllImport("CalcManager")]
|
||||
#if __IOS__
|
||||
private const string DllPath = "__Internal"; // https://docs.microsoft.com/en-us/xamarin/ios/platform/native-interop
|
||||
#else
|
||||
private const string DllPath = "CalcManager";
|
||||
#endif
|
||||
|
||||
[DllImport(DllPath)]
|
||||
public static extern IntPtr CalculatorManager_Create(ref CalculatorManager_CreateParams parms);
|
||||
|
||||
[DllImport("CalcManager")]
|
||||
[DllImport(DllPath)]
|
||||
public static extern void CalculatorManager_SendCommand(IntPtr nativeManager, Command command);
|
||||
|
||||
[DllImport("CalcManager")]
|
||||
[DllImport(DllPath)]
|
||||
public static extern void CalculatorManager_SetRadix(IntPtr nativeManager, RADIX_TYPE iRadixType);
|
||||
|
||||
[DllImport("CalcManager")]
|
||||
[DllImport(DllPath)]
|
||||
public static extern void CalculatorManager_Reset(IntPtr nativeManager, bool clearMemory);
|
||||
|
||||
[DllImport("CalcManager")]
|
||||
[DllImport(DllPath)]
|
||||
public static extern void CalculatorManager_SetStandardMode(IntPtr nativeManager);
|
||||
|
||||
[DllImport("CalcManager")]
|
||||
[DllImport(DllPath)]
|
||||
public static extern void CalculatorManager_SetScientificMode(IntPtr nativeManager);
|
||||
|
||||
[DllImport("CalcManager")]
|
||||
[DllImport(DllPath)]
|
||||
public static extern void CalculatorManager_SetProgrammerMode(IntPtr nativeManager);
|
||||
|
||||
[DllImport("CalcManager")]
|
||||
[DllImport(DllPath)]
|
||||
public static extern void CalculatorManager_MemorizeNumber(IntPtr nativeManager);
|
||||
|
||||
[DllImport("CalcManager")]
|
||||
[DllImport(DllPath)]
|
||||
public static extern void CalculatorManager_MemorizedNumberLoad(IntPtr nativeManager, int value);
|
||||
|
||||
[DllImport("CalcManager")]
|
||||
[DllImport(DllPath)]
|
||||
public static extern void CalculatorManager_MemorizedNumberAdd(IntPtr nativeManager, int value);
|
||||
|
||||
[DllImport("CalcManager")]
|
||||
[DllImport(DllPath)]
|
||||
public static extern void CalculatorManager_MemorizedNumberSubtract(IntPtr nativeManager, int value);
|
||||
|
||||
[DllImport("CalcManager")]
|
||||
[DllImport(DllPath)]
|
||||
public static extern void CalculatorManager_MemorizedNumberClear(IntPtr nativeManager, int value);
|
||||
|
||||
[DllImport("CalcManager")]
|
||||
[DllImport(DllPath)]
|
||||
public static extern void CalculatorManager_MemorizedNumberClearAll(IntPtr nativeManager);
|
||||
|
||||
[DllImport("CalcManager")]
|
||||
[DllImport(DllPath)]
|
||||
public static extern bool CalculatorManager_IsEngineRecording(IntPtr nativeManager);
|
||||
|
||||
[DllImport("CalcManager")]
|
||||
[DllImport(DllPath)]
|
||||
public static extern void CalculatorManager_SetMemorizedNumbersString(IntPtr nativeManager);
|
||||
|
||||
[DllImport("CalcManager", CharSet = CharSet.Unicode)]
|
||||
[DllImport(DllPath, CharSet = CharSet.Unicode)]
|
||||
public static extern string CalculatorManager_GetResultForRadix(IntPtr nativeManager, int radix, int precision);
|
||||
|
||||
[DllImport("CalcManager")]
|
||||
[DllImport(DllPath)]
|
||||
public static extern void CalculatorManager_SetPrecision(IntPtr nativeManager, int precision);
|
||||
|
||||
[DllImport("CalcManager")]
|
||||
[DllImport(DllPath)]
|
||||
public static extern void CalculatorManager_UpdateMaxIntDigits(IntPtr nativeManager);
|
||||
|
||||
[DllImport("CalcManager")]
|
||||
[DllImport(DllPath)]
|
||||
public static extern char CalculatorManager_DecimalSeparator(IntPtr nativeManager);
|
||||
|
||||
[DllImport("CalcManager")]
|
||||
[DllImport(DllPath)]
|
||||
public static extern bool CalculatorManager_RemoveHistoryItem(IntPtr nativeManager, int uIdx);
|
||||
|
||||
[DllImport("CalcManager")]
|
||||
[DllImport(DllPath)]
|
||||
public static extern void CalculatorManager_ClearHistory(IntPtr nativeManager);
|
||||
|
||||
[DllImport("CalcManager")]
|
||||
[DllImport(DllPath)]
|
||||
public static extern int CalculatorManager_MaxHistorySize(IntPtr nativeManager);
|
||||
|
||||
[DllImport("CalcManager")]
|
||||
[DllImport(DllPath)]
|
||||
public static extern Command CalculatorManager_GetCurrentDegreeMode(IntPtr nativeManager);
|
||||
|
||||
[DllImport("CalcManager")]
|
||||
[DllImport(DllPath)]
|
||||
public static extern void CalculatorManager_SetInHistoryItemLoadMode(IntPtr nativeManager, bool isHistoryItemLoadMode);
|
||||
|
||||
[DllImport("CalcManager")]
|
||||
[DllImport(DllPath)]
|
||||
public static extern IntPtr CalculatorManager_GetHistoryItems(IntPtr nativeManager);
|
||||
|
||||
[DllImport("CalcManager")]
|
||||
[DllImport(DllPath)]
|
||||
public static extern IntPtr CalculatorManager_GetHistoryItemsWithMode(IntPtr nativeManager, CALCULATOR_MODE mode);
|
||||
|
||||
[DllImport("CalcManager")]
|
||||
[DllImport(DllPath)]
|
||||
public static extern IntPtr CalculatorManager_GetHistoryItem(IntPtr nativeManager, int uIdx);
|
||||
|
||||
[DllImport("CalcManager")]
|
||||
[DllImport(DllPath)]
|
||||
public static extern CommandType IExpressionCommand_GetCommandType(IntPtr pExpressionCommand);
|
||||
|
||||
public delegate IntPtr GetCEngineStringFunc(IntPtr state, IntPtr id);
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
<MtouchArch>x86_64</MtouchArch>
|
||||
<MtouchLink>None</MtouchLink>
|
||||
<MtouchDebug>true</MtouchDebug>
|
||||
<MtouchExtraArgs>-gcc_flags "-lc++ -lstdc++"</MtouchExtraArgs>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
|
||||
<DebugType>portable</DebugType>
|
||||
|
@ -35,6 +36,7 @@
|
|||
<MtouchLink>None</MtouchLink>
|
||||
<MtouchArch>x86_64</MtouchArch>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<MtouchExtraArgs>-gcc_flags "-lc++ -lstdc++"</MtouchExtraArgs>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
|
@ -49,6 +51,7 @@
|
|||
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
|
||||
<CodesignKey>iPhone Developer</CodesignKey>
|
||||
<MtouchDebug>true</MtouchDebug>
|
||||
<MtouchExtraArgs>-gcc_flags "-lc++ -lstdc++"</MtouchExtraArgs>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
|
||||
<DebugType>none</DebugType>
|
||||
|
@ -60,6 +63,7 @@
|
|||
<MtouchArch>ARM64</MtouchArch>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<CodesignKey>iPhone Developer</CodesignKey>
|
||||
<MtouchExtraArgs>-gcc_flags "-lc++ -lstdc++"</MtouchExtraArgs>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Ad-Hoc|iPhone' ">
|
||||
<DebugType>none</DebugType>
|
||||
|
@ -104,6 +108,16 @@
|
|||
<ItemGroup>
|
||||
<PackageReference Include="Uno.UI" Version="1.45.0-dev.1457" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition=" '$(Platform)' == 'iPhoneSimulator' ">
|
||||
<NativeReference Include="Native References/x86_64/libCalcManager.a">
|
||||
<Kind>Static</Kind>
|
||||
</NativeReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition=" '$(Platform)' == 'iPhone' ">
|
||||
<NativeReference Include="Native References/arm64/libCalcManager.a">
|
||||
<Kind>Static</Kind>
|
||||
</NativeReference>
|
||||
</ItemGroup>
|
||||
<Import Project="..\Calculator.Shared\Calculator.Shared.projitems" Label="Shared" Condition="Exists('..\Calculator.Shared\Calculator.Shared.projitems')" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
|
||||
</Project>
|
BIN
src/Calculator.iOS/Native References/arm64/libCalcManager.a
Normal file
BIN
src/Calculator.iOS/Native References/arm64/libCalcManager.a
Normal file
Binary file not shown.
BIN
src/Calculator.iOS/Native References/x86_64/libCalcManager.a
Normal file
BIN
src/Calculator.iOS/Native References/x86_64/libCalcManager.a
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue