diff options
author | Alexis Christoforides <alexis@thenull.net> | 2019-03-01 03:50:44 +0300 |
---|---|---|
committer | Alexander Köplinger <alex.koeplinger@outlook.com> | 2019-03-01 03:50:44 +0300 |
commit | adc62b328ed7d09accf691b25f5189e5b1253771 (patch) | |
tree | a436435538611f44829478cb03648d1f150ee306 /mcs/class/Facades | |
parent | 4ea57007fa2ccabf0a43ef265271d0def20d9448 (diff) |
[monodroid] Use CoreFX to implement System.Drawing types that used to be in Mono.Android.dll (#13135)
* [monodroid] Use CoreFX to fill in reference stubs for System.Drawing types that are currently 'forked' from Mono into Mono.Android.dll
The list of localy implemented System.Drawing types: https://github.com/xamarin/xamarin-android/blob/e0da1f152de84c4cc39983f2fda775ec98c08250/src/Mono.Android/Mono.Android.csproj#L311-L325
* [netstandard] Update for Mono.Android change
* Bump reference assemblies to include Mono.Android update
* Use System.Drawing.Common to find moved types in monodroid case for netstandard facade
* Bump API snapshot submodule
* [csproj] Update project files
Diffstat (limited to 'mcs/class/Facades')
10 files changed, 99 insertions, 9 deletions
diff --git a/mcs/class/Facades/Makefile b/mcs/class/Facades/Makefile index 7269a172642..da7f8f9b5b0 100644 --- a/mcs/class/Facades/Makefile +++ b/mcs/class/Facades/Makefile @@ -40,7 +40,7 @@ doc-update-recursive: System System.Core System.ComponentModel.DataAnnotations System.Numerics System.Numerics.Vectors System.Runtime.Serialization System.Transactions System.Xml \ System.ComponentModel.Composition System.ServiceModel System.Xml.Linq System.Data System.IO.Compression.FileSystem System.Runtime.InteropServices.RuntimeInformation \ System.ServiceProcess System.Security System.Net.Http.WebRequest System.Net.Http System.ServiceProcess System.IO.Compression System.IdentityModel System.Web \ -Facades/System.Drawing.Primitives System.Drawing System.Web.Services: +Facades/System.Drawing.Primitives Facades/System.Drawing.Common System.Drawing System.Web.Services: all-local-aot: diff --git a/mcs/class/Facades/System.Drawing.Common/Facades_System.Drawing.Common.csproj b/mcs/class/Facades/System.Drawing.Common/Facades_System.Drawing.Common.csproj index 7e74f98d332..f0df1fa37e5 100644 --- a/mcs/class/Facades/System.Drawing.Common/Facades_System.Drawing.Common.csproj +++ b/mcs/class/Facades/System.Drawing.Common/Facades_System.Drawing.Common.csproj @@ -96,6 +96,57 @@ <Compile Include="TypeForwarders.cs" />
</ItemGroup>
<!--End of common files-->
+ <!--Per-profile files-->
+ <Choose>
+ <When Condition="'$(Platform)' == 'xammac'">
+ <ItemGroup />
+ </When>
+ <When Condition="'$(Platform)' == 'winaot'">
+ <ItemGroup />
+ </When>
+ <When Condition="'$(Platform)' == 'wasm'">
+ <ItemGroup />
+ </When>
+ <When Condition="'$(Platform)' == 'unreal'">
+ <ItemGroup />
+ </When>
+ <When Condition="'$(Platform)' == 'orbis'">
+ <ItemGroup />
+ </When>
+ <When Condition="'$(Platform)' == 'net_4_x'">
+ <ItemGroup />
+ </When>
+ <When Condition="'$(Platform)' == 'monotouch_watch'">
+ <ItemGroup />
+ </When>
+ <When Condition="'$(Platform)' == 'monotouch_tv'">
+ <ItemGroup />
+ </When>
+ <When Condition="'$(Platform)' == 'monotouch'">
+ <ItemGroup />
+ </When>
+ <When Condition="'$(Platform)' == 'monodroid'">
+ <ItemGroup>
+ <Compile Include="..\..\..\..\external\corefx\src\Common\src\System\Drawing\ColorTable.cs" />
+ <Compile Include="..\..\..\..\external\corefx\src\Common\src\System\Drawing\ColorUtil.netcoreapp21.cs" />
+ <Compile Include="..\..\..\..\external\corefx\src\Common\src\System\Drawing\KnownColor.cs" />
+ <Compile Include="..\..\..\..\external\corefx\src\Common\src\System\Drawing\KnownColorTable.cs" />
+ <Compile Include="..\..\..\..\external\corefx\src\Common\src\System\Numerics\Hashing\HashHelpers.cs" />
+ <Compile Include="..\..\..\..\external\corefx\src\System.Drawing.Common\src\System\Drawing\ColorConverter.cs" />
+ <Compile Include="..\..\..\..\external\corefx\src\System.Drawing.Common\src\System\Drawing\SystemColors.cs" />
+ <Compile Include="..\..\..\..\external\corefx\src\System.Drawing.Primitives\src\System\Drawing\Color.cs" />
+ <Compile Include="..\..\..\..\external\corefx\src\System.Drawing.Primitives\src\System\Drawing\Point.cs" />
+ <Compile Include="..\..\..\..\external\corefx\src\System.Drawing.Primitives\src\System\Drawing\PointF.cs" />
+ <Compile Include="..\..\..\..\external\corefx\src\System.Drawing.Primitives\src\System\Drawing\Rectangle.cs" />
+ <Compile Include="..\..\..\..\external\corefx\src\System.Drawing.Primitives\src\System\Drawing\RectangleF.cs" />
+ <Compile Include="..\..\..\..\external\corefx\src\System.Drawing.Primitives\src\System\Drawing\Size.cs" />
+ <Compile Include="..\..\..\..\external\corefx\src\System.Drawing.Primitives\src\System\Drawing\SizeF.cs" />
+ <Compile Include="..\..\..\build\common\SR.cs" />
+ <Compile Include="SR.cs" />
+ </ItemGroup>
+ </When>
+ </Choose>
+ <!--End of per-profile files-->
<!-- @ALL_SOURCES@ -->
<ItemGroup>
<ProjectReference Include="../../System/System.csproj" />
diff --git a/mcs/class/Facades/System.Drawing.Common/SR.cs b/mcs/class/Facades/System.Drawing.Common/SR.cs new file mode 100644 index 00000000000..750d1e2be9c --- /dev/null +++ b/mcs/class/Facades/System.Drawing.Common/SR.cs @@ -0,0 +1,6 @@ + +partial class SR +{ + public const string InvalidColor = "Color '{0}' is not valid."; + public const string InvalidEx2BoundArgument = "Value of '{1}' is not valid for '{0}'. '{0}' should be greater than or equal to {2} and less than or equal to {3}."; +} diff --git a/mcs/class/Facades/System.Drawing.Common/TypeForwarders.cs b/mcs/class/Facades/System.Drawing.Common/TypeForwarders.cs index 8515153f31e..00817000720 100644 --- a/mcs/class/Facades/System.Drawing.Common/TypeForwarders.cs +++ b/mcs/class/Facades/System.Drawing.Common/TypeForwarders.cs @@ -10,6 +10,9 @@ // System.Drawing.Primitives/ref: namespace System.Drawing { + +#if !MONODROID + public readonly partial struct Color : System.IEquatable<System.Drawing.Color> { private readonly object _dummy; @@ -565,6 +568,9 @@ namespace System.Drawing public System.Drawing.Size ToSize() { throw new PlatformNotSupportedException(); } public override string ToString() { throw new PlatformNotSupportedException(); } } + +#endif // !MONODROID + } // System.Drawing.Common/ref: @@ -1690,6 +1696,9 @@ namespace System.Drawing public static System.Drawing.Brush WindowText { get { throw new PlatformNotSupportedException(); } } public static System.Drawing.Brush FromSystemColor(System.Drawing.Color c) { throw new PlatformNotSupportedException(); } } + +#if !MONODROID + public static partial class SystemColors { public static System.Drawing.Color ActiveBorder { get { throw new PlatformNotSupportedException(); } } @@ -1726,6 +1735,9 @@ namespace System.Drawing public static System.Drawing.Color WindowFrame { get { throw new PlatformNotSupportedException(); } } public static System.Drawing.Color WindowText { get { throw new PlatformNotSupportedException(); } } } + +#endif // !MONODROID + public static partial class SystemFonts { public static System.Drawing.Font CaptionFont { get { throw new PlatformNotSupportedException(); } } diff --git a/mcs/class/Facades/System.Drawing.Common/monodroid_System.Drawing.Common.dll.sources b/mcs/class/Facades/System.Drawing.Common/monodroid_System.Drawing.Common.dll.sources new file mode 100644 index 00000000000..129d648f236 --- /dev/null +++ b/mcs/class/Facades/System.Drawing.Common/monodroid_System.Drawing.Common.dll.sources @@ -0,0 +1,17 @@ +#include System.Drawing.Common.dll.sources +../../../../external/corefx/src/System.Drawing.Primitives/src/System/Drawing/Color.cs +../../../../external/corefx/src/Common/src/System/Drawing/KnownColor.cs +../../../../external/corefx/src/System.Drawing.Primitives/src/System/Drawing/Point.cs +../../../../external/corefx/src/System.Drawing.Primitives/src/System/Drawing/PointF.cs +../../../../external/corefx/src/System.Drawing.Primitives/src/System/Drawing/Rectangle.cs +../../../../external/corefx/src/System.Drawing.Primitives/src/System/Drawing/RectangleF.cs +../../../../external/corefx/src/System.Drawing.Primitives/src/System/Drawing/Size.cs +../../../../external/corefx/src/System.Drawing.Primitives/src/System/Drawing/SizeF.cs +../../../../external/corefx/src/Common/src/System/Numerics/Hashing/HashHelpers.cs +../../../../external/corefx/src/Common/src/System/Drawing/KnownColorTable.cs +../../../../external/corefx/src/Common/src/System/Drawing/ColorTable.cs +../../../../external/corefx/src/Common/src/System/Drawing/ColorUtil.netcoreapp21.cs +../../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/SystemColors.cs +../../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/ColorConverter.cs +../../../build/common/SR.cs +SR.cs diff --git a/mcs/class/Facades/System.Drawing.Primitives/Facades_System.Drawing.Primitives.csproj b/mcs/class/Facades/System.Drawing.Primitives/Facades_System.Drawing.Primitives.csproj index 1bc5166c4a1..55a6cdc5807 100644 --- a/mcs/class/Facades/System.Drawing.Primitives/Facades_System.Drawing.Primitives.csproj +++ b/mcs/class/Facades/System.Drawing.Primitives/Facades_System.Drawing.Primitives.csproj @@ -159,6 +159,7 @@ <HintPath>./../../../../external/binary-reference-assemblies/build/monodroid/Mono.Android.dll</HintPath>
<Private>False</Private>
</Reference>
+ <ProjectReference Include="../System.Drawing.Common/Facades_System.Drawing.Common.csproj" />
</ItemGroup>
<ItemGroup Condition=" '$(Platform)' == 'monotouch' ">
<Reference Include="./../../../../external/binary-reference-assemblies/build/monotouch/Xamarin.iOS.dll">
diff --git a/mcs/class/Facades/System.Drawing.Primitives/Makefile b/mcs/class/Facades/System.Drawing.Primitives/Makefile index a2c00db8868..79f3546d283 100644 --- a/mcs/class/Facades/System.Drawing.Primitives/Makefile +++ b/mcs/class/Facades/System.Drawing.Primitives/Makefile @@ -17,6 +17,7 @@ LIB_MCS_FLAGS = $(SIGN_FLAGS) $(EXTRA_LIB_MCS_FLAGS) ifeq ($(PROFILE),monodroid) # XA implements System.Drawing API inside Mono.Android API_BIN_REFS := Mono.Android +LIB_REFS += Facades/System.Drawing.Common endif ifeq ($(PROFILE),monotouch) diff --git a/mcs/class/Facades/netstandard/Facades_netstandard.csproj b/mcs/class/Facades/netstandard/Facades_netstandard.csproj index 3110448800c..f9572cc06b1 100644 --- a/mcs/class/Facades/netstandard/Facades_netstandard.csproj +++ b/mcs/class/Facades/netstandard/Facades_netstandard.csproj @@ -166,6 +166,7 @@ <Private>False</Private>
</Reference>
<ProjectReference Include="../../System.Web.Services/System.Web.Services.csproj" />
+ <ProjectReference Include="../System.Drawing.Common/Facades_System.Drawing.Common.csproj" />
</ItemGroup>
<ItemGroup Condition=" '$(Platform)' == 'monotouch' ">
<Reference Include="./../../../../external/binary-reference-assemblies/build/monotouch/Xamarin.iOS.dll">
diff --git a/mcs/class/Facades/netstandard/Makefile b/mcs/class/Facades/netstandard/Makefile index b8be19fd64b..00c08b4f36b 100644 --- a/mcs/class/Facades/netstandard/Makefile +++ b/mcs/class/Facades/netstandard/Makefile @@ -39,6 +39,7 @@ endif ifeq ($(PROFILE),monodroid) # XA implements System.Drawing API inside Mono.Android API_BIN_REFS := Mono.Android +LIB_REFS += Facades/System.Drawing.Common endif ifeq ($(PROFILE),monotouch) diff --git a/mcs/class/Facades/subdirs.make b/mcs/class/Facades/subdirs.make index 1be737de76f..712744c40da 100644 --- a/mcs/class/Facades/subdirs.make +++ b/mcs/class/Facades/subdirs.make @@ -37,9 +37,9 @@ System.Security.Cryptography.X509Certificates System.Runtime.Serialization.Primi common_DEPS_SUBDIRS := monotouch_SUBDIRS = $(common_DEPS_SUBDIRS) -monotouch_PARALLEL_SUBDIRS = $(common_SUBDIRS) $(mobile_only_SUBDIRS) +monotouch_PARALLEL_SUBDIRS = $(common_SUBDIRS) $(mobile_only_SUBDIRS) System.Drawing.Common -monodroid_SUBDIRS = $(common_DEPS_SUBDIRS) +monodroid_SUBDIRS = $(common_DEPS_SUBDIRS) System.Drawing.Common monodroid_PARALLEL_SUBDIRS = $(common_SUBDIRS) $(mobile_only_SUBDIRS) net_4_x_SUBDIRS = $(common_DEPS_SUBDIRS) @@ -67,22 +67,22 @@ monotouch_tv_SUBDIRS = $(monotouch_SUBDIRS) monotouch_tv_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS) winaot_SUBDIRS = $(common_DEPS_SUBDIRS) -winaot_PARALLEL_SUBDIRS = $(common_SUBDIRS) $(mobile_only_SUBDIRS) +winaot_PARALLEL_SUBDIRS = $(common_SUBDIRS) $(mobile_only_SUBDIRS) System.Drawing.Common orbis_SUBDIRS = $(common_DEPS_SUBDIRS) -orbis_PARALLEL_SUBDIRS = $(common_SUBDIRS) $(mobile_only_SUBDIRS) +orbis_PARALLEL_SUBDIRS = $(common_SUBDIRS) $(mobile_only_SUBDIRS) System.Drawing.Common unreal_SUBDIRS = $(common_DEPS_SUBDIRS) -unreal_PARALLEL_SUBDIRS = $(common_SUBDIRS) $(mobile_only_SUBDIRS) +unreal_PARALLEL_SUBDIRS = $(common_SUBDIRS) $(mobile_only_SUBDIRS) System.Drawing.Common wasm_SUBDIRS = $(common_DEPS_SUBDIRS) -wasm_PARALLEL_SUBDIRS = $(common_SUBDIRS) $(mobile_only_SUBDIRS) +wasm_PARALLEL_SUBDIRS = $(common_SUBDIRS) $(mobile_only_SUBDIRS) System.Drawing.Common testing_aot_full_SUBDIRS = $(common_DEPS_SUBDIRS) -testing_aot_full_PARALLEL_SUBDIRS = $(common_SUBDIRS) $(mobile_only_SUBDIRS) +testing_aot_full_PARALLEL_SUBDIRS = $(common_SUBDIRS) $(mobile_only_SUBDIRS) System.Drawing.Common mobile_only_SUBDIRS = System.Security.Cryptography.Pkcs System.Security.Cryptography.OpenSsl System.Threading.Tasks.Extensions \ System.Security.Cryptography.Cng System.Runtime.Loader System.Xml.XPath.XmlDocument System.Reflection.DispatchProxy System.Memory \ -System.Drawing.Common System.Buffers +System.Buffers PROFILE_PARALLEL_SUBDIRS = $(net_4_x_PARALLEL_SUBDIRS) |