Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into protocol-static-members
Browse files Browse the repository at this point in the history
  • Loading branch information
rolfbjarne committed May 28, 2024
2 parents 54aca60 + 6d764a8 commit 0d3ae84
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
<Reference Include="Microsoft.Build.Utilities.Core">
<HintPath>$(MonoMSBuildBinPath)/Microsoft.Build.Utilities.Core.dll</HintPath>
</Reference>
<Compile Include="..\..\Versions.g.cs">
<Link>Versions.g.cs</Link>
</Compile>
</ItemGroup>

<ItemGroup>
Expand Down
10 changes: 10 additions & 0 deletions msbuild/Xamarin.Localization.MSBuild/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System;
using System.Reflection;
using System.Runtime.CompilerServices;

[assembly: AssemblyCompanyAttribute ("Microsoft Corp.")]
[assembly: AssemblyFileVersionAttribute (VersionConstants.XamarinIOSVersion)]
[assembly: AssemblyInformationalVersionAttribute (VersionConstants.XamarinIOSVersion + "." + VersionConstants.NuGetPrereleaseIdentifier + "+" + VersionConstants.NuGetBuildMetadata)]
[assembly: AssemblyProductAttribute ("Xamarin.Localization.MSBuild")]
[assembly: AssemblyTitleAttribute ("Xamarin.Localization.MSBuild")]
[assembly: AssemblyVersionAttribute (VersionConstants.XamarinIOSVersion)]
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
<WarningsAsErrors>Nullable</WarningsAsErrors>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
<PropertyGroup>
<EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems>
Expand All @@ -27,6 +28,9 @@
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<Compile Include="..\Versions.g.cs">
<Link>Versions.g.cs</Link>
</Compile>
<EmbeddedResource Include="TranslatedAssemblies/MSBStrings.cs.resx">
<Link>MSBStrings.cs.resx</Link>
<ManifestResourceName>Xamarin.Localization.MSBuild.MSBStrings.cs</ManifestResourceName>
Expand Down
3 changes: 0 additions & 3 deletions msbuild/Xamarin.MacDev.Tasks/Xamarin.MacDev.Tasks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@
<Compile Include="..\..\tools\common\NullableAttributes.cs">
<Link>external\NullableAttributes.cs</Link>
</Compile>
<Compile Include="..\Versions.g.cs">
<Link>Versions.g.cs</Link>
</Compile>
<Compile Remove="Errors.designer.cs" /> <!-- The 'CoreResGen' target will add it again from the EmbeddedResource item, this avoids a warning about the file being compiled twice -->
<Compile Include="..\..\tools\common\SdkVersions.cs">
<Link>external\SdkVersions.cs</Link>
Expand Down
53 changes: 53 additions & 0 deletions src/GameController/GCMouse.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#nullable enable

using System;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;

using ObjCRuntime;
using Foundation;

namespace GameController {

#if !XAMCORE_5_0
// The GCMouse doesn't conform to NSCoding/NSSecureCoding, but it probably did in an early beta, which is why we declared it as such.
public partial class GCMouse : INSCoding, INSSecureCoding {
[BindingImpl (BindingImplOptions.Optimizable)]
[EditorBrowsable (EditorBrowsableState.Never)]
public GCMouse (NSCoder coder) : base (NSObjectFlag.Empty)
{
if (IsDirectBinding) {
InitializeHandle (global::ObjCRuntime.Messaging.IntPtr_objc_msgSend_IntPtr (this.Handle, Selector.GetHandle ("initWithCoder:"), coder.Handle), "initWithCoder:");
} else {
InitializeHandle (global::ObjCRuntime.Messaging.IntPtr_objc_msgSendSuper_IntPtr (this.SuperHandle, Selector.GetHandle ("initWithCoder:"), coder.Handle), "initWithCoder:");
}
}

#if NET
[SupportedOSPlatform ("ios14.0")]
[SupportedOSPlatform ("macos")]
[SupportedOSPlatform ("tvos14.0")]
[SupportedOSPlatform ("maccatalyst")]
#endif
[BindingImpl (BindingImplOptions.Optimizable)]
[EditorBrowsable (EditorBrowsableState.Never)]
public virtual void EncodeTo (NSCoder encoder)
{
var encoder__handle__ = encoder!.GetNonNullHandle (nameof (encoder));
#if NET
if (IsDirectBinding) {
global::ObjCRuntime.Messaging.void_objc_msgSend_NativeHandle (this.Handle, Selector.GetHandle ("encodeWithCoder:"), encoder__handle__);
} else {
global::ObjCRuntime.Messaging.void_objc_msgSendSuper_NativeHandle (this.SuperHandle, Selector.GetHandle ("encodeWithCoder:"), encoder__handle__);
}
#else
if (IsDirectBinding) {
global::ObjCRuntime.Messaging.void_objc_msgSend_IntPtr (this.Handle, Selector.GetHandle ("encodeWithCoder:"), encoder__handle__);
} else {
global::ObjCRuntime.Messaging.void_objc_msgSendSuper_IntPtr (this.SuperHandle, Selector.GetHandle ("encodeWithCoder:"), encoder__handle__);
}
#endif
}
}
#endif // !XAMCORE_5_0
}
1 change: 1 addition & 0 deletions src/frameworks.sources
Original file line number Diff line number Diff line change
Expand Up @@ -927,6 +927,7 @@ GAMECONTROLLER_SOURCES = \
GameController/GCExtendedGamepadSnapshot.cs \
GameController/GCGamepadSnapshot.cs \
GameController/GCMicroGamepadSnapshot.cs \
GameController/GCMouse.cs \

# GameKit

Expand Down
2 changes: 1 addition & 1 deletion src/gamecontroller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ interface GCKeyboardInput {
[Mac (11, 0), iOS (14, 0), TV (14, 0)]
[MacCatalyst (14, 0)]
[BaseType (typeof (NSObject))]
interface GCMouse : GCDevice, NSSecureCoding, NSCoding {
interface GCMouse : GCDevice {
[NullAllowed, Export ("mouseInput", ArgumentSemantic.Strong)]
GCMouseInput MouseInput { get; }

Expand Down
1 change: 0 additions & 1 deletion tests/cecil-tests/Documentation.KnownFailures.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33079,7 +33079,6 @@ M:GameController.GCMotion.SetGravity(GameController.GCAcceleration)
M:GameController.GCMotion.SetRotationRate(GameController.GCRotationRate)
M:GameController.GCMotion.SetState(GameController.GCMotion)
M:GameController.GCMotion.SetUserAcceleration(GameController.GCAcceleration)
M:GameController.GCMouse.EncodeTo(Foundation.NSCoder)
M:GameController.GCPhysicalInputProfile.Capture
M:GameController.GCPhysicalInputProfile.Dispose(System.Boolean)
M:GameController.GCPhysicalInputProfile.GetMappedElementAlias(System.String)
Expand Down

0 comments on commit 0d3ae84

Please sign in to comment.