From ed69a5f1a7ec13da9a7bb3be881b213a148ac1df Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Tue, 14 Jan 2025 10:06:36 +0100 Subject: [PATCH 1/5] [src] Unify enum formatting. (#21934) * Add trailing comma at the end of the last element. * Put each enum field on its own line (this makes it easier to write/port xml docs). --- .../AVAudioSessionDataSourceDescription.cs | 17 +- src/AVFoundation/Enums.cs | 127 +++-- src/Accounts/Enums.cs | 4 +- src/AppKit/Enums.cs | 524 +++++++++++------- src/CoreData/Enums.cs | 32 +- src/CoreFoundation/DispatchSource.cs | 8 +- src/CoreGraphics/CGEventTypes.cs | 25 +- src/CoreImage/CISampler.cs | 5 +- src/CoreMidi/MidiServices.cs | 7 +- src/CoreMotion/Defs.cs | 5 +- src/CoreText/CTFontManager.cs | 4 +- src/Darwin/SystemLog.cs | 13 +- src/EventKit/EKEnums.cs | 79 ++- src/EventKitUI/Defs.cs | 14 +- src/Foundation/Enum.cs | 199 ++++--- src/Foundation/NSFileManager.cs | 8 +- src/Foundation/NSStream.cs | 13 +- src/GLKit/Defs.cs | 34 +- src/GameKit/GameKit.cs | 54 +- src/MapKit/MKEnums.cs | 12 +- src/MapKit/MKMapItem.cs | 6 +- src/MediaPlayer/MediaPlayer.cs | 54 +- src/MessageUI/MessageUI.cs | 8 +- src/Metal/MTLEnums.cs | 75 ++- src/ModelIO/MIEnums.cs | 14 +- src/PassKit/PKEnums.cs | 22 +- src/SceneKit/Defs.cs | 59 +- src/SearchKit/SearchKit.cs | 7 +- src/Security/Items.cs | 38 +- src/Security/SecureTransport.cs | 18 +- src/Social/Enums.cs | 10 +- src/StoreKit/Enums.cs | 11 +- src/Twitter/Enums.cs | 7 +- src/UIKit/UIEnums.cs | 345 +++++++----- src/UIKit/UIFontDescriptor.cs | 13 +- src/WebKit/Defs.cs | 11 +- src/WebKit/Enums.cs | 31 +- src/uikit.cs | 14 +- 38 files changed, 1221 insertions(+), 706 deletions(-) diff --git a/src/AVFoundation/AVAudioSessionDataSourceDescription.cs b/src/AVFoundation/AVAudioSessionDataSourceDescription.cs index 70b411dc2f03..853d2591cc4a 100644 --- a/src/AVFoundation/AVAudioSessionDataSourceDescription.cs +++ b/src/AVFoundation/AVAudioSessionDataSourceDescription.cs @@ -13,15 +13,26 @@ namespace AVFoundation { public enum AVAudioDataSourceLocation { - Unknown, Upper, Lower + Unknown, + Upper, + Lower, } public enum AVAudioDataSourceOrientation { - Unknown, Top, Bottom, Front, Back, Left, Right + Unknown, + Top, + Bottom, + Front, + Back, + Left, + Right, } public enum AVAudioDataSourcePolarPattern { - Unknown, Omnidirectional, Cardioid, Subcardioid + Unknown, + Omnidirectional, + Cardioid, + Subcardioid, } public partial class AVAudioSessionDataSourceDescription { diff --git a/src/AVFoundation/Enums.cs b/src/AVFoundation/Enums.cs index 2955878ceb00..2151aa192370 100644 --- a/src/AVFoundation/Enums.cs +++ b/src/AVFoundation/Enums.cs @@ -37,7 +37,7 @@ public enum AVAudioQuality : long { Low = 0x20, Medium = 0x40, High = 0x60, - Max = 0x7F + Max = 0x7F, } [MacCatalyst (13, 1)] @@ -49,7 +49,7 @@ public enum AVAssetExportSessionStatus : long { Exporting, Completed, Failed, - Cancelled + Cancelled, } [MacCatalyst (13, 1)] @@ -90,7 +90,9 @@ public enum AVCaptureVideoOrientation : long { [Native] // NSInteger - AVCaptureDevice.h public enum AVCaptureFlashMode : long { - Off, On, Auto + Off, + On, + Auto, } [Introduced (PlatformName.MacCatalyst, 14, 0)] @@ -98,7 +100,9 @@ public enum AVCaptureFlashMode : long { [Native] // NSInteger - AVCaptureDevice.h public enum AVCaptureTorchMode : long { - Off, On, Auto + Off, + On, + Auto, } [Introduced (PlatformName.MacCatalyst, 14, 0)] @@ -106,7 +110,9 @@ public enum AVCaptureTorchMode : long { [Native] // NSInteger - AVCaptureDevice.h public enum AVCaptureFocusMode : long { - Locked, AutoFocus, ContinuousAutoFocus, + Locked, + AutoFocus, + ContinuousAutoFocus, } [Introduced (PlatformName.MacCatalyst, 14, 0)] @@ -136,7 +142,9 @@ public enum AVCaptureExposureMode : long { [Native] // NSInteger - AVCaptureDevice.h public enum AVCaptureWhiteBalanceMode : long { - Locked, AutoWhiteBalance, ContinuousAutoWhiteBalance + Locked, + AutoWhiteBalance, + ContinuousAutoWhiteBalance, } #if !NET @@ -145,7 +153,7 @@ public enum AVCaptureWhiteBalanceMode : long { [Native] // NSUInteger - AVAudioSession.h public enum AVAudioSessionInterruptionFlags : ulong { - ShouldResume = 1 + ShouldResume = 1, } #endif @@ -251,14 +259,16 @@ public enum AVError : long { public enum AVPlayerActionAtItemEnd : long { Advance, Pause, - None + None, } [MacCatalyst (13, 1)] [Native] // NSInteger - AVPlayerItem.h public enum AVPlayerItemStatus : long { - Unknown, ReadyToPlay, Failed + Unknown, + ReadyToPlay, + Failed, } #if !NET @@ -268,7 +278,7 @@ public enum AVPlayerItemStatus : long { [Native] // declared as AVAudioSessionSetActiveOptions (NSUInteger) - AVAudioSession.h public enum AVAudioSessionFlags : ulong { - NotifyOthersOnDeactivation = 1 + NotifyOthersOnDeactivation = 1, } #endif @@ -276,7 +286,11 @@ public enum AVAudioSessionFlags : ulong { [Native] // NSInteger - AVAsynchronousKeyValueLoading.h public enum AVKeyValueStatus : long { - Unknown, Loading, Loaded, Failed, Cancelled + Unknown, + Loading, + Loaded, + Failed, + Cancelled, } [MacCatalyst (13, 1)] @@ -285,7 +299,7 @@ public enum AVKeyValueStatus : long { public enum AVPlayerStatus : long { Unknown, ReadyToPlay, - Failed + Failed, } [MacCatalyst (13, 1)] @@ -305,7 +319,9 @@ public enum AVAssetReferenceRestrictions : ulong { [Native] // NSInteger - AVAssetImageGenerator.h public enum AVAssetImageGeneratorResult : long { - Succeeded, Failed, Cancelled + Succeeded, + Failed, + Cancelled, } /// An enumeration whose values specify whether a is playing or not. @@ -315,7 +331,8 @@ public enum AVAssetImageGeneratorResult : long { [Native] // NSInteger - AVCaptureDevice.h public enum AVCaptureDeviceTransportControlsPlaybackMode : long { - NotPlaying, Playing + NotPlaying, + Playing, } /// An enumeration whose values specify how interlaced fields should be dealt with. @@ -327,7 +344,10 @@ public enum AVCaptureDeviceTransportControlsPlaybackMode : long { [Native] // NSInteger - AVCaptureSession.h public enum AVVideoFieldMode : long { - Both, TopOnly, BottomOnly, Deinterlace + Both, + TopOnly, + BottomOnly, + Deinterlace, } [MacCatalyst (13, 1)] @@ -335,7 +355,7 @@ public enum AVVideoFieldMode : long { [Native] // NSUInteger - AVAudioSession.h public enum AVAudioSessionInterruptionOptions : ulong { - ShouldResume = 1 + ShouldResume = 1, } [MacCatalyst (13, 1)] @@ -343,7 +363,7 @@ public enum AVAudioSessionInterruptionOptions : ulong { [Native] // NSUInteger - AVAudioSession.h public enum AVAudioSessionSetActiveOptions : ulong { - NotifyOthersOnDeactivation = 1 + NotifyOthersOnDeactivation = 1, } [MacCatalyst (13, 1)] @@ -354,7 +374,7 @@ public enum AVAudioSessionPortOverride : ulong { [NoTV] [NoMac] // Removed in Xcode 12 GM [MacCatalyst (13, 1)] - Speaker = 0x73706b72 // 'spkr' + Speaker = 0x73706b72, // 'spkr' } [MacCatalyst (13, 1)] @@ -368,7 +388,7 @@ public enum AVAudioSessionRouteChangeReason : ulong { Override, WakeFromSleep = 6, NoSuitableRouteForCategory = 7, - RouteConfigurationChange = 8 + RouteConfigurationChange = 8, } [Flags] @@ -406,7 +426,8 @@ public enum AVAudioSessionCategoryOptions : ulong { [Native] // NSUInteger - AVAudioSession.h public enum AVAudioSessionInterruptionType : ulong { - Ended, Began + Ended, + Began, } [MacCatalyst (13, 1)] @@ -442,7 +463,7 @@ public enum AVAudioSessionErrorCode : long { public enum AVCaptureAutoFocusRangeRestriction : long { None = 0, Near = 1, - Far = 2 + Far = 2, } // Convenience enum for native strings (defined in AVAudioSettings.h) @@ -450,13 +471,13 @@ public enum AVAudioBitRateStrategy : int { Constant, LongTermAverage, VariableConstrained, - Variable + Variable, } // Convenience enum for native strings (defined in AVAudioSettings.h) public enum AVSampleRateConverterAlgorithm : int { Normal, - Mastering + Mastering, } [Introduced (PlatformName.MacCatalyst, 14, 0)] @@ -464,7 +485,10 @@ public enum AVSampleRateConverterAlgorithm : int { [Native] // NSInteger - AVCaptureDevice.h public enum AVAuthorizationStatus : long { - NotDetermined, Restricted, Denied, Authorized + NotDetermined, + Restricted, + Denied, + Authorized, } [MacCatalyst (13, 1)] @@ -472,7 +496,7 @@ public enum AVAuthorizationStatus : long { // NSInteger - AVSpeechSynthesis.h public enum AVSpeechBoundary : long { Immediate, - Word + Word, } [MacCatalyst (13, 1)] @@ -482,7 +506,7 @@ public enum AVAudioCommonFormat : ulong { PCMFloat32 = 1, PCMFloat64 = 2, PCMInt16 = 3, - PCMInt32 = 4 + PCMInt32 = 4, } [Native] @@ -512,14 +536,14 @@ public enum AVAudio3DMixingRenderingAlgorithm : long { public enum AVAudioSessionRecordPermission : ulong { Undetermined = 1970168948 /*'undt'*/, Denied = 1684369017 /*'deny'*/, - Granted = 1735552628 /*'grnt'*/ + Granted = 1735552628 /*'grnt'*/, } [MacCatalyst (13, 1)] [Native] public enum AVAudioSessionSilenceSecondaryAudioHintType : ulong { Begin = 1, - End = 0 + End = 0, } [Flags] @@ -527,7 +551,7 @@ public enum AVAudioSessionSilenceSecondaryAudioHintType : ulong { public enum AVAudioPlayerNodeBufferOptions : ulong { Loops = 0x01, Interrupts = 0x02, - InterruptsAtLoop = 0x04 + InterruptsAtLoop = 0x04, } [Native] @@ -542,7 +566,7 @@ public enum AVAudioUnitEQFilterType : long { LowShelf = 7, HighShelf = 8, ResonantLowShelf = 9, - ResonantHighShelf = 10 + ResonantHighShelf = 10, } [Native] @@ -559,7 +583,7 @@ public enum AVAudioUnitReverbPreset : long { LargeRoom2 = 9, MediumHall2 = 10, MediumHall3 = 11, - LargeHall2 = 12 + LargeHall2 = 12, } [Native] @@ -585,20 +609,22 @@ public enum AVAudioUnitDistortionPreset : long { SpeechCosmicInterference = 18, SpeechGoldenPi = 19, SpeechRadioTower = 20, - SpeechWaves = 21 + SpeechWaves = 21, } [Native] public enum AVAudioEnvironmentDistanceAttenuationModel : long { Exponential = 1, Inverse = 2, - Linear = 3 + Linear = 3, } [MacCatalyst (13, 1)] [Native] public enum AVQueuedSampleBufferRenderingStatus : long { - Unknown, Rendering, Failed + Unknown, + Rendering, + Failed, } [Introduced (PlatformName.MacCatalyst, 14, 0)] @@ -624,7 +650,7 @@ public enum AVCaptureVideoStabilizationMode : long { public enum AVCaptureAutoFocusSystem : long { None, ContrastDetection, - PhaseDetection + PhaseDetection, } [Introduced (PlatformName.MacCatalyst, 14, 0)] @@ -647,7 +673,6 @@ public enum AVSpeechSynthesisVoiceQuality : long { Enhanced = 2, [iOS (16, 0), MacCatalyst (16, 0), TV (16, 0), Mac (13, 0)] Premium = 3, - } [MacCatalyst (13, 1)] @@ -655,7 +680,7 @@ public enum AVSpeechSynthesisVoiceQuality : long { public enum AVAudioConverterPrimeMethod : long { Pre = 0, Normal = 1, - None = 2 + None = 2, } [MacCatalyst (13, 1)] @@ -663,7 +688,7 @@ public enum AVAudioConverterPrimeMethod : long { public enum AVAudioConverterInputStatus : long { HaveData = 0, NoDataNow = 1, - EndOfStream = 2 + EndOfStream = 2, } [MacCatalyst (13, 1)] @@ -672,7 +697,7 @@ public enum AVAudioConverterOutputStatus : long { HaveData = 0, InputRanDry = 1, EndOfStream = 2, - Error = 3 + Error = 3, } [MacCatalyst (13, 1)] @@ -680,7 +705,7 @@ public enum AVAudioConverterOutputStatus : long { [Native] public enum AVMusicSequenceLoadOptions : ulong { PreserveTracks = 0, - ChannelsToTracks = (1 << 0) + ChannelsToTracks = (1 << 0), } [NoTV] @@ -690,7 +715,7 @@ public enum AVMusicSequenceLoadOptions : ulong { [Native] public enum AVMovieWritingOptions : ulong { AddMovieHeaderToDestination = 0, - TruncateDestinationToMovieHeaderOnly = (1 << 0) + TruncateDestinationToMovieHeaderOnly = (1 << 0), } [NoiOS] @@ -745,7 +770,7 @@ public enum AVCaptureColorSpace : long { [MacCatalyst (13, 1)] [Native] public enum AVMusicTrackLoopCount : long { - Forever = -1 + Forever = -1, } [MacCatalyst (13, 1)] @@ -753,7 +778,7 @@ public enum AVMusicTrackLoopCount : long { public enum AVPlayerTimeControlStatus : long { Paused, WaitingToPlayAtSpecifiedRate, - Playing + Playing, } [NoTV] @@ -770,7 +795,7 @@ public enum AVPlayerLooperStatus : long { Unknown, Ready, Failed, - Cancelled + Cancelled, } [NoiOS] @@ -780,7 +805,7 @@ public enum AVPlayerLooperStatus : long { public enum AVContentProposalAction : long { Accept, Reject, - Defer + Defer, } [NoiOS] @@ -789,7 +814,7 @@ public enum AVContentProposalAction : long { [Native] public enum AVPlayerViewControllerSkippingBehavior : long { Default = 0, - SkipItem + SkipItem, } [MacCatalyst (13, 1)] @@ -800,7 +825,7 @@ public enum AVContentKeyRequestStatus : long { Renewed, Retried, Cancelled, - Failed + Failed, } [MacCatalyst (13, 1)] @@ -939,7 +964,7 @@ public enum AVDepthDataAccuracy : long { [Native] public enum AVAudioEngineManualRenderingMode : long { Offline = 0, - Realtime = 1 + Realtime = 1, } [MacCatalyst (13, 1)] @@ -948,7 +973,7 @@ public enum AVAudioEngineManualRenderingStatus : long { Error = -1, Success = 0, InsufficientDataFromInputNode = 1, - CannotDoInCurrentContext = 2 + CannotDoInCurrentContext = 2, } [MacCatalyst (13, 1)] @@ -976,7 +1001,7 @@ public enum AVAudioSessionRouteSharingPolicy : ulong { public enum AVAudioPlayerNodeCompletionCallbackType : long { Consumed = 0, Rendered = 1, - PlayedBack = 2 + PlayedBack = 2, } [MacCatalyst (13, 1)] @@ -1091,7 +1116,7 @@ public enum AVVideoCodecType { [Native] public enum AVDepthDataQuality : long { Low = 0, - High = 1 + High = 1, } [Introduced (PlatformName.MacCatalyst, 14, 0)] diff --git a/src/Accounts/Enums.cs b/src/Accounts/Enums.cs index 1f3a59da84ee..0dac7a11c9fa 100644 --- a/src/Accounts/Enums.cs +++ b/src/Accounts/Enums.cs @@ -40,6 +40,8 @@ public enum ACErrorCode { /// An enumeration whose values indicate the result of a credential renewal request (see ). [Native] public enum ACAccountCredentialRenewResult : long { - Renewed, Rejected, Failed + Renewed, + Rejected, + Failed, } } diff --git a/src/AppKit/Enums.cs b/src/AppKit/Enums.cs index 8489dd41abb4..b178cae88586 100644 --- a/src/AppKit/Enums.cs +++ b/src/AppKit/Enums.cs @@ -35,7 +35,7 @@ namespace AppKit { public enum NSRunResponse : long { Stopped = -1000, Aborted = -1001, - Continues = -1002 + Continues = -1002, } [NoMacCatalyst] @@ -43,13 +43,15 @@ public enum NSRunResponse : long { public enum NSApplicationActivationOptions : ulong { Default = 0, ActivateAllWindows = 1, - ActivateIgnoringOtherWindows = 2 + ActivateIgnoringOtherWindows = 2, } [NoMacCatalyst] [Native] public enum NSApplicationActivationPolicy : long { - Regular, Accessory, Prohibited + Regular, + Accessory, + Prohibited, } [NoMacCatalyst] @@ -80,26 +82,31 @@ public enum NSApplicationPresentationOptions : ulong { public enum NSApplicationDelegateReply : ulong { Success, Cancel, - Failure + Failure, } [NoMacCatalyst] [Native] public enum NSRequestUserAttentionType : ulong { CriticalRequest = 0, - InformationalRequest = 10 + InformationalRequest = 10, } [NoMacCatalyst] [Native] public enum NSApplicationTerminateReply : ulong { - Cancel, Now, Later + Cancel, + Now, + Later, } [NoMacCatalyst] [Native] public enum NSApplicationPrintReply : ulong { - Cancelled, Success, Failure, ReplyLater + Cancelled, + Success, + Failure, + ReplyLater, } #if !NET @@ -107,14 +114,18 @@ public enum NSApplicationPrintReply : ulong { [Native] public enum NSApplicationLayoutDirection : long { LeftToRight = 0, - RightToLeft = 1 + RightToLeft = 1, } #endif [NoMacCatalyst] [Native] public enum NSImageInterpolation : ulong { - Default, None, Low, Medium, High + Default, + None, + Low, + Medium, + High, } [NoMacCatalyst] @@ -149,7 +160,7 @@ public enum NSComposite : ulong { Hue, Saturation, Color, - Luminosity + Luminosity, } [NoMacCatalyst] @@ -165,19 +176,25 @@ public enum NSBackingStore : ulong { [NoMacCatalyst] [Native] public enum NSWindowOrderingMode : long { - Below = -1, Out, Above, + Below = -1, + Out, + Above, } [NoMacCatalyst] [Native] public enum NSFocusRingPlacement : ulong { - RingOnly, RingBelow, RingAbove, + RingOnly, + RingBelow, + RingAbove, } [NoMacCatalyst] [Native] public enum NSFocusRingType : ulong { - Default, None, Exterior + Default, + None, + Exterior, } [NoMacCatalyst] @@ -187,20 +204,24 @@ public enum NSColorRenderingIntent : long { AbsoluteColorimetric, RelativeColorimetric, Perceptual, - Saturation + Saturation, } [MacCatalyst (13, 1)] [Native] public enum NSRectEdge : ulong { - MinXEdge, MinYEdge, MaxXEdge, MaxYEdge + MinXEdge, + MinYEdge, + MaxXEdge, + MaxYEdge, } [NoMacCatalyst] [Native] public enum NSUserInterfaceLayoutDirection : long { - LeftToRight, RightToLeft + LeftToRight, + RightToLeft, } #region NSColorSpace @@ -214,7 +235,7 @@ public enum NSColorSpaceModel : long { LAB, DeviceN, Indexed, - Pattern + Pattern, } #endregion @@ -225,7 +246,10 @@ public enum NSColorSpaceModel : long { [NoMacCatalyst] [Native] public enum NSTextTabType : ulong { - Left, Right, Center, Decimal + Left, + Right, + Center, + Decimal, } [Native] @@ -236,7 +260,7 @@ public enum NSLineBreakMode : ulong { Clipping, TruncatingHead, TruncatingTail, - TruncatingMiddle + TruncatingMiddle, } #endregion @@ -254,7 +278,7 @@ public enum NSType : ulong { Float = 3, PositiveFloat = 4, Double = 6, - PositiveDouble = 7 + PositiveDouble = 7, } #endif @@ -263,7 +287,7 @@ public enum NSType : ulong { public enum NSCellType : ulong { Null, Text, - Image + Image, } [NoMacCatalyst] @@ -308,7 +332,7 @@ public enum NSImageScale : ulong { ProportionallyDown = 0, AxesIndependently, None, - ProportionallyUpOrDown + ProportionallyUpOrDown, } [NoMacCatalyst] @@ -316,7 +340,7 @@ public enum NSImageScale : ulong { public enum NSCellStateValue : long { Mixed = -1, Off, - On + On, } [NoMacCatalyst] @@ -327,7 +351,7 @@ public enum NSCellStyleMask : ulong { ContentsCell = 1 << 0, PushInCell = 1 << 1, ChangeGrayCell = 1 << 2, - ChangeBackgroundCell = 1 << 3 + ChangeBackgroundCell = 1 << 3, } [NoMacCatalyst] @@ -337,7 +361,7 @@ public enum NSCellHit : ulong { None, ContentArea = 1, EditableTextArea = 2, - TrackableArae = 4 + TrackableArae = 4, } [NoMacCatalyst] @@ -346,7 +370,7 @@ public enum NSControlTint : ulong { Default = 0, // system 'default' Blue = 1, Graphite = 6, - Clear = 7 + Clear = 7, } [NoMacCatalyst] @@ -381,7 +405,7 @@ public enum NSImageLoadStatus : ulong { Cancelled, InvalidData, UnexpectedEOF, - ReadError + ReadError, } [NoMacCatalyst] @@ -390,14 +414,14 @@ public enum NSImageCacheMode : ulong { Default, Always, BySize, - Never + Never, } [NoMacCatalyst] [Native (ConvertToNative = "NSImageResizingModeExtensions.ToNative", ConvertToManaged = "NSImageResizingModeExtensions.ToManaged")] public enum NSImageResizingMode : long { Stretch, - Tile + Tile, } #endregion @@ -406,7 +430,9 @@ public enum NSImageResizingMode : long { [NoMacCatalyst] [Native] public enum NSAlertStyle : ulong { - Warning, Informational, Critical + Warning, + Informational, + Critical, } [NoMacCatalyst] @@ -416,7 +442,7 @@ public enum NSModalResponse : long { Cancel = 0, Stop = -1000, Abort = -1001, - Continue = -1002 + Continue = -1002, } #endregion @@ -501,7 +527,7 @@ public enum NSEventMask : ulong { Pressure = 1UL << (int) NSEventType.Pressure, // 10.10.3, 64-bit-only DirectTouch = 1UL << (int) NSEventType.DirectTouch, // 10.10 ChangeMode = 1UL << (int) NSEventType.ChangeMode, - AnyEvent = unchecked((ulong) UInt64.MaxValue) + AnyEvent = unchecked((ulong) UInt64.MaxValue), } [NoMacCatalyst] @@ -516,20 +542,25 @@ public enum NSEventModifierMask : ulong { NumericPadKeyMask = 1 << 21, HelpKeyMask = 1 << 22, FunctionKeyMask = 1 << 23, - DeviceIndependentModifierFlagsMask = 0xffff0000 + DeviceIndependentModifierFlagsMask = 0xffff0000, } [NoMacCatalyst] [Native] public enum NSPointingDeviceType : ulong { - Unknown, Pen, Cursor, Eraser + Unknown, + Pen, + Cursor, + Eraser, } [NoMacCatalyst] [Flags] [Native] public enum NSEventButtonMask : ulong { - Pen = 1, PenLower = 2, PenUpper = 4 + Pen = 1, + PenLower = 2, + PenUpper = 4, } // This enum is defined as an untyped enum in MacOSX.sdk/System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/Headers/Events.h @@ -659,7 +690,7 @@ public enum NSKey : ulong { LeftArrow = 0x7B, RightArrow = 0x7C, DownArrow = 0x7D, - UpArrow = 0x7E + UpArrow = 0x7E, } // This is an untyped enum in AppKit's NSEvent.h @@ -741,7 +772,7 @@ public enum NSFunctionKey : int { Redo = 0xF744, Find = 0xF745, Help = 0xF746, - ModeSwitch = 0xF747 + ModeSwitch = 0xF747, } [NoMacCatalyst] @@ -778,7 +809,7 @@ public enum NSEventSubtype : short { [Native] public enum NSSystemDefinedEvents : ulong { [Deprecated (PlatformName.MacOSX, 10, 12, message: "Use 'NSEventSubtype.PowerOff' instead.")] - NSPowerOffEventType = 1 + NSPowerOffEventType = 1, } #endif // !NET @@ -810,19 +841,23 @@ public enum NSViewResizingMask : ulong { MaxXMargin = 4, MinYMargin = 8, HeightSizable = 16, - MaxYMargin = 32 + MaxYMargin = 32, } [NoMacCatalyst] [Native] public enum NSBorderType : ulong { - NoBorder, LineBorder, BezelBorder, GrooveBorder + NoBorder, + LineBorder, + BezelBorder, + GrooveBorder, } [NoMacCatalyst] [Native] public enum NSTextFieldBezelStyle : ulong { - Square, Rounded + Square, + Rounded, } [NoMacCatalyst] @@ -876,7 +911,7 @@ public enum NSWindowStyle : ulong { UnifiedTitleAndToolbar = 1 << 12, Hud = 1 << 13, FullScreenWindow = 1 << 14, - FullSizeContentView = 1 << 15 + FullSizeContentView = 1 << 15, } [NoMacCatalyst] @@ -891,7 +926,9 @@ public enum NSWindowSharingType : ulong { [NoMacCatalyst] [Native] public enum NSWindowBackingLocation : ulong { - Default, VideoMemory, MainMemory, + Default, + VideoMemory, + MainMemory, } [NoMacCatalyst] @@ -921,7 +958,7 @@ public enum NSWindowCollectionBehavior : ulong { [Native] public enum NSWindowNumberListOptions : ulong { AllApplication = 1 << 0, - AllSpaces = 1 << 4 + AllSpaces = 1 << 4, } [NoMacCatalyst] @@ -929,15 +966,20 @@ public enum NSWindowNumberListOptions : ulong { public enum NSSelectionDirection : ulong { Direct = 0, Next, - Previous + Previous, } [NoMacCatalyst] [Native] public enum NSWindowButton : ulong { - CloseButton, MiniaturizeButton, ZoomButton, ToolbarButton, DocumentIconButton, DocumentVersionsButton = 6, + CloseButton, + MiniaturizeButton, + ZoomButton, + ToolbarButton, + DocumentIconButton, + DocumentVersionsButton = 6, [Deprecated (PlatformName.MacOSX, 10, 12, message: "The standard window button for FullScreenButton is always null; use ZoomButton instead.")] - FullScreenButton + FullScreenButton, } [NoMacCatalyst] @@ -951,7 +993,7 @@ public enum NSTouchPhase : ulong { Cancelled = 1 << 4, Touching = Began | Moved | Stationary, - Any = unchecked((ulong) UInt64.MaxValue) + Any = unchecked((ulong) UInt64.MaxValue), } #endregion #region NSAnimation @@ -962,7 +1004,7 @@ public enum NSAnimationCurve : ulong { EaseInOut, EaseIn, EaseOut, - Linear + Linear, }; [NoMacCatalyst] @@ -970,7 +1012,7 @@ public enum NSAnimationCurve : ulong { public enum NSAnimationBlockingMode : ulong { Blocking, Nonblocking, - NonblockingThreaded + NonblockingThreaded, }; #endregion @@ -985,7 +1027,7 @@ public enum NSTitlePosition : ulong { BelowTop, AboveBottom, AtBottom, - BelowBottom + BelowBottom, }; [NoMacCatalyst] @@ -997,7 +1039,7 @@ public enum NSBoxType : ulong { NSBoxSeparator, [Obsoleted (PlatformName.MacOSX, 10, 15, message: "'NSBoxOldStyle' is discouraged. Use 'NSBoxPrimary' or 'NSBoxCustom'.")] NSBoxOldStyle, - NSBoxCustom + NSBoxCustom, }; #endregion @@ -1014,7 +1056,7 @@ public enum NSButtonType : ulong { OnOff, MomentaryPushIn, Accelerator, // 10.10.3 - MultiLevelAccelerator // 10.10.3 + MultiLevelAccelerator, // 10.10.3 } [NoMacCatalyst] @@ -1066,7 +1108,7 @@ public enum NSGradientType : ulong { ConcaveWeak, ConcaveStrong, ConvexWeak, - ConvexStrong + ConvexStrong, } #endregion @@ -1077,7 +1119,7 @@ public enum NSGradientType : ulong { public enum NSWindowDepth : int { TwentyfourBitRgb = 0x208, SixtyfourBitRgb = 0x210, - OneHundredTwentyEightBitRgb = 0x220 + OneHundredTwentyEightBitRgb = 0x220, } [NoMacCatalyst] @@ -1112,14 +1154,14 @@ public enum NSCompositingOperation : ulong { Hue, Saturation, Color, - Luminosity + Luminosity, } [NoMacCatalyst] [Native] public enum NSAnimationEffect : ulong { DissapearingItemDefault = 0, - EffectPoof = 10 + EffectPoof = 10, } #endregion @@ -1127,7 +1169,10 @@ public enum NSAnimationEffect : ulong { [NoMacCatalyst] [Native] public enum NSMatrixMode : ulong { - Radio, Highlight, List, Track + Radio, + Highlight, + List, + Track, } #endregion @@ -1135,13 +1180,16 @@ public enum NSMatrixMode : ulong { [NoMacCatalyst] [Native] public enum NSBrowserColumnResizingType : ulong { - None, Auto, User + None, + Auto, + User, } [NoMacCatalyst] [Native] public enum NSBrowserDropOperation : ulong { - On, Above + On, + Above, } #endregion @@ -1157,7 +1205,7 @@ public enum NSColorPanelMode : long { CustomPalette, ColorList, Wheel, - Crayon + Crayon, }; [NoMacCatalyst] @@ -1172,7 +1220,7 @@ public enum NSColorPanelFlags : ulong { ColorList = 0x00000020, Wheel = 0x00000040, Crayon = 0x00000080, - All = 0x0000ffff + All = 0x0000ffff, } @@ -1182,18 +1230,25 @@ public enum NSColorPanelFlags : ulong { [NoMacCatalyst] [Native] public enum NSDocumentChangeType : ulong { - Done, Undone, Cleared, ReadOtherContents, Autosaved, Redone, - Discardable = 256 /* New in Lion */ + Done, + Undone, + Cleared, + ReadOtherContents, + Autosaved, + Redone, + Discardable = 256, /* New in Lion */ } [NoMacCatalyst] [Native] public enum NSSaveOperationType : ulong { - Save, SaveAs, SaveTo, + Save, + SaveAs, + SaveTo, Autosave = 3, /* Deprecated name in Lion */ Elsewhere = 3, /* New Lion name */ InPlace = 4, /* New in Lion */ - AutoSaveAs = 5 /* New in Mountain Lion */ + AutoSaveAs = 5, /* New in Mountain Lion */ } #endregion @@ -1203,19 +1258,24 @@ public enum NSSaveOperationType : ulong { [NoMacCatalyst] [Native] public enum NSLineCapStyle : ulong { - Butt, Round, Square + Butt, + Round, + Square, } [NoMacCatalyst] [Native] public enum NSLineJoinStyle : ulong { - Miter, Round, Bevel + Miter, + Round, + Bevel, } [NoMacCatalyst] [Native] public enum NSWindingRule : ulong { - NonZero, EvenOdd + NonZero, + EvenOdd, } [NoMacCatalyst] @@ -1234,7 +1294,8 @@ public enum NSBezierPathElement : ulong { [NoMacCatalyst] [Native] public enum NSRulerOrientation : ulong { - Horizontal, Vertical + Horizontal, + Vertical, } #endregion @@ -1248,7 +1309,7 @@ public enum NSGestureRecognizerState : long { Ended, Cancelled, Failed, - Recognized = NSGestureRecognizerState.Ended + Recognized = NSGestureRecognizerState.Ended, } #endregion @@ -1257,7 +1318,7 @@ public enum NSGestureRecognizerState : long { [Native] public enum NSUserInterfaceLayoutOrientation : long { Horizontal = 0, - Vertical = 1 + Vertical = 1, } // NSStackView.h:typedef float NSStackViewVisibilityPriority @@ -1269,7 +1330,7 @@ public enum NSStackViewVisibilityPriority : int { Musthold = MustHold, #endif DetachOnlyIfNecessary = 900, - NotVisible = 0 + NotVisible = 0, } [NoMacCatalyst] @@ -1279,7 +1340,7 @@ public enum NSStackViewGravity : long { Leading = 1, Center = 2, Bottom = 3, - Trailing = 3 + Trailing = 3, } #endregion @@ -1291,7 +1352,7 @@ public enum NSStackViewDistribution : long { FillEqually, FillProportionally, EqualSpacing, - EqualCentering + EqualCentering, } [NoMacCatalyst] @@ -1316,7 +1377,7 @@ public enum NSTextAlignment : ulong { Right = 1, Center = 2, Justified = 3, - Natural = 4 + Natural = 4, } #if !NET && MONOMAC @@ -1344,7 +1405,7 @@ public enum NSTextMovement : long { Right = 0x14, Up = 0x15, Down = 0x16, - Cancel = 0x17 + Cancel = 0x17, } [NoMacCatalyst] @@ -1356,13 +1417,16 @@ public enum NSMenuProperty : ulong { KeyEquivalent = 1 << 2, Image = 1 << 3, Enabled = 1 << 4, - AccessibilityDescription = 1 << 5 + AccessibilityDescription = 1 << 5, } [NoMacCatalyst] [Native] public enum NSFontRenderingMode : ulong { - Default, Antialiased, IntegerAdvancements, AntialiasedIntegerAdvancements + Default, + Antialiased, + IntegerAdvancements, + AntialiasedIntegerAdvancements, } [NoMacCatalyst] @@ -1372,7 +1436,7 @@ public enum NSPasteboardReadingOptions : ulong { AsData = 0, AsString = 1, AsPropertyList = 2, - AsKeyedArchive = 4 + AsKeyedArchive = 4, } #if !NET && MONOMAC // Use the one in Foundation instead, only keep this in macOS until .NET. @@ -1387,7 +1451,7 @@ public enum NSUnderlineStyle : long { PatternDash = 0x0200, PatternDashDot = 0x0300, PatternDashDotDot = 0x0400, - ByWord = 0x8000 + ByWord = 0x8000, } #endif @@ -1398,19 +1462,22 @@ public enum NSUnderlinePattern : int { Dot = 0x0100, Dash = 0x0200, DashDot = 0x0300, - DashDotDot = 0x0400 + DashDotDot = 0x0400, } [NoMacCatalyst] [Native] public enum NSSelectionAffinity : ulong { - Upstream, Downstream + Upstream, + Downstream, } [NoMacCatalyst] [Native] public enum NSSelectionGranularity : ulong { - Character, Word, Paragraph + Character, + Word, + Paragraph, } #region NSTrackingArea @@ -1427,7 +1494,7 @@ public enum NSTrackingAreaOptions : ulong { ActiveAlways = 0x80, AssumeInside = 0x100, InVisibleRect = 0x200, - EnabledDuringMouseDrag = 0x400 + EnabledDuringMouseDrag = 0x400, } #endregion @@ -1437,13 +1504,17 @@ public enum NSLineSweepDirection : ulong { NSLineSweepLeft, NSLineSweepRight, NSLineSweepDown, - NSLineSweepUp + NSLineSweepUp, } [NoMacCatalyst] [Native] public enum NSLineMovementDirection : ulong { - None, Left, Right, Down, Up + None, + Left, + Right, + Down, + Up, } [NoMacCatalyst] @@ -1460,7 +1531,7 @@ public enum NSTiffCompression : ulong { PackBits = 32773, [Deprecated (PlatformName.MacOSX, 10, 7)] - OldJpeg = 32865 + OldJpeg = 32865, } [NoMacCatalyst] @@ -1471,7 +1542,7 @@ public enum NSBitmapImageFileType : ulong { Gif, Jpeg, Png, - Jpeg2000 + Jpeg2000, } [NoMacCatalyst] @@ -1482,7 +1553,7 @@ public enum NSImageRepLoadStatus : long { WillNeedAllData = -3, InvalidData = -4, UnexpectedEOF = -5, - Completed = -6 + Completed = -6, } [NoMacCatalyst] @@ -1496,19 +1567,22 @@ public enum NSBitmapFormat : ulong { LittleEndian16Bit = 1 << 8, LittleEndian32Bit = 1 << 9, BigEndian16Bit = 1 << 10, - BigEndian32Bit = 1 << 11 + BigEndian32Bit = 1 << 11, } [NoMacCatalyst] [Native] public enum NSPrintingOrientation : ulong { - Portrait, Landscape + Portrait, + Landscape, } [NoMacCatalyst] [Native] public enum NSPrintingPaginationMode : ulong { - Auto, Fit, Clip + Auto, + Fit, + Clip, } #if !NET @@ -1519,7 +1593,7 @@ public enum NSPrintingPaginationMode : ulong { public enum NSGlyphStorageOptions : ulong { ShowControlGlyphs = 1, ShowInvisibleGlyphs = 2, - WantsBidiLevels = 4 + WantsBidiLevels = 4, } #endif // !NET @@ -1530,14 +1604,16 @@ public enum NSGlyphStorageOptions : ulong { [Native] public enum NSTextStorageEditedFlags : ulong { EditedAttributed = 1, - EditedCharacters = 2 + EditedCharacters = 2, } #endif [NoMacCatalyst] [Native] public enum NSPrinterTableStatus : ulong { - Ok, NotFound, Error + Ok, + NotFound, + Error, } [NoMacCatalyst] @@ -1577,7 +1653,8 @@ public enum NSScrollerPart : ulong { [Native] [Deprecated (PlatformName.MacOSX, 10, 14)] public enum NSScrollerArrow : ulong { - IncrementArrow, DecrementArrow + IncrementArrow, + DecrementArrow, } [NoMacCatalyst] @@ -1586,7 +1663,7 @@ public enum NSPrintingPageOrder : long { Descending = -1, Special, Ascending, - Unknown + Unknown, } [NoMacCatalyst] @@ -1600,13 +1677,14 @@ public enum NSPrintPanelOptions : long { ShowsScaling = 16, ShowsPrintSelection = 32, ShowsPageSetupAccessory = 256, - ShowsPreview = 131072 + ShowsPreview = 131072, } [NoMacCatalyst] [Native] public enum NSTextBlockValueType : ulong { - Absolute, Percentage + Absolute, + Percentage, } [NoMacCatalyst] @@ -1623,19 +1701,25 @@ public enum NSTextBlockDimension : ulong { [NoMacCatalyst] [Native] public enum NSTextBlockLayer : long { - Padding = -1, Border, Margin + Padding = -1, + Border, + Margin, } [NoMacCatalyst] [Native] public enum NSTextBlockVerticalAlignment : ulong { - Top, Middle, Bottom, Baseline + Top, + Middle, + Bottom, + Baseline, } [NoMacCatalyst] [Native] public enum NSTextTableLayoutAlgorithm : ulong { - Automatic, Fixed + Automatic, + Fixed, } [NoMacCatalyst] @@ -1681,26 +1765,31 @@ public enum NSFontTraitMask : ulong { Poster = 0x100, Compressed = 0x200, FixedPitch = 0x400, - Unitalic = 0x1000000 + Unitalic = 0x1000000, } [NoMacCatalyst] [Flags] [Native] public enum NSPasteboardWritingOptions : ulong { - WritingPromised = 1 << 9 + WritingPromised = 1 << 9, } [MacCatalyst (13, 1)] [Native] public enum NSToolbarDisplayMode : ulong { - Default, IconAndLabel, Icon, Label + Default, + IconAndLabel, + Icon, + Label, } [MacCatalyst (13, 1)] [Native] public enum NSToolbarSizeMode : ulong { - Default, Regular, Small + Default, + Regular, + Small, } #if !NET @@ -1711,7 +1800,7 @@ public enum NSAlertType : long { ErrorReturn = -2, OtherReturn, AlternateReturn, - DefaultReturn + DefaultReturn, } #endif // !NET @@ -1720,7 +1809,8 @@ public enum NSAlertType : long { [Deprecated (PlatformName.MacOSX, 10, 10, message: "Use NSModalResponse instead.")] [Native] public enum NSPanelButtonType : long { - Cancel, Ok + Cancel, + Ok, } #endif @@ -1732,7 +1822,7 @@ public enum NSTableViewColumnAutoresizingStyle : ulong { Sequential, ReverseSequential, LastColumnOnly, - FirstColumnOnly + FirstColumnOnly, } [NoMacCatalyst] @@ -1757,7 +1847,7 @@ public enum NSTableViewDraggingDestinationFeedbackStyle : long { [Native] public enum NSTableViewDropOperation : ulong { On, - Above + Above, } [NoMacCatalyst] @@ -1766,7 +1856,7 @@ public enum NSTableViewDropOperation : ulong { public enum NSTableColumnResizing : long { None = -1, Autoresizing = (1 << 0), - UserResizingMask = (1 << 1) + UserResizingMask = (1 << 1), } [NoMacCatalyst] @@ -1776,7 +1866,7 @@ public enum NSTableViewGridStyle : ulong { None = 0, SolidVerticalLine = 1 << 0, SolidHorizontalLine = 1 << 1, - DashedHorizontalGridLine = 1 << 3 + DashedHorizontalGridLine = 1 << 3, } [NoMacCatalyst] @@ -1785,7 +1875,7 @@ public enum NSTableViewGridStyle : ulong { public enum NSGradientDrawingOptions : ulong { None = 0, BeforeStartingLocation = (1 << 0), - AfterEndingLocation = (1 << 1) + AfterEndingLocation = (1 << 1), } [NoMacCatalyst] @@ -1799,7 +1889,7 @@ public enum NSImageAlignment : ulong { Bottom, BottomLeft, BottomRight, - Right + Right, } [NoMacCatalyst] @@ -1809,7 +1899,7 @@ public enum NSImageFrameStyle : ulong { Photo, GrayBezel, Groove, - Button + Button, } [NoMacCatalyst] @@ -1821,7 +1911,7 @@ public enum NSSpeechBoundary : ulong { hWord, #endif Word = 1, - Sentence + Sentence, } [NoMacCatalyst] @@ -1829,7 +1919,7 @@ public enum NSSpeechBoundary : ulong { public enum NSSplitViewDividerStyle : long { Thick = 1, Thin = 2, - PaneSplitter = 3 + PaneSplitter = 3, } [NoMacCatalyst] @@ -1848,7 +1938,7 @@ public enum NSImageScaling : ulong { ProportionallyDown = 0, AxesIndependently, None, - ProportionallyUpOrDown + ProportionallyUpOrDown, } [NoMacCatalyst] @@ -1861,7 +1951,7 @@ public enum NSSegmentStyle : long { TexturedSquare = 4, Capsule = 5, SmallSquare = 6, - Separated = 8 + Separated = 8, } [NoMacCatalyst] @@ -1870,7 +1960,7 @@ public enum NSSegmentSwitchTracking : ulong { SelectOne = 0, SelectAny = 1, Momentary = 2, - MomentaryAccelerator // 10.10.3 + MomentaryAccelerator, // 10.10.3 } [NoMacCatalyst] @@ -1881,14 +1971,14 @@ public enum NSTickMarkPosition : ulong { Left, Right, Leading = Left, - Trailing = Right + Trailing = Right, } [NoMacCatalyst] [Native] public enum NSSliderType : ulong { Linear = 0, - Circular = 1 + Circular = 1, } [NoMacCatalyst] @@ -1917,7 +2007,7 @@ public enum NSWorkspaceLaunchOptions : ulong { NewInstance = 0x80000, Hide = 0x100000, HideOthers = 0x200000, - Default = Async | AllowingClassicStartup + Default = Async | AllowingClassicStartup, } [NoMacCatalyst] @@ -1925,7 +2015,7 @@ public enum NSWorkspaceLaunchOptions : ulong { [Native] public enum NSWorkspaceIconCreationOptions : ulong { NSExcludeQuickDrawElements = 1 << 1, - NSExclude10_4Elements = 1 << 2 + NSExclude10_4Elements = 1 << 2, } [NoMacCatalyst] @@ -1934,7 +2024,7 @@ public enum NSPathStyle : long { Standard, [Deprecated (PlatformName.MacOSX, 10, 7)] NavigationBar, - PopUp + PopUp, } [NoMacCatalyst] @@ -1952,7 +2042,9 @@ public enum NSTabViewType : ulong { [NoMacCatalyst] [Native] public enum NSTabState : ulong { - Selected, Background, Pressed + Selected, + Background, + Pressed, } [NoMacCatalyst] @@ -1961,20 +2053,23 @@ public enum NSTabViewControllerTabStyle : long { SegmentedControlOnTop = 0, SegmentedControlOnBottom, Toolbar, - Unspecified = -1 + Unspecified = -1, } [NoMacCatalyst] [Native] public enum NSLevelIndicatorStyle : ulong { - Relevancy, ContinuousCapacity, DiscreteCapacity, RatingLevel + Relevancy, + ContinuousCapacity, + DiscreteCapacity, + RatingLevel, } [NoMacCatalyst] [Flags] [Native] public enum NSFontCollectionOptions : long { - ApplicationOnlyMask = 1 + ApplicationOnlyMask = 1, } #if XAMCORE_5_0 @@ -1988,7 +2083,8 @@ public enum NSFontCollectionOptions : long { #endif [Native] public enum NSCollectionViewDropOperation : long { - On = 0, Before = 1 + On = 0, + Before = 1, } #if XAMCORE_5_0 @@ -2005,7 +2101,7 @@ public enum NSCollectionViewItemHighlightState : long { None = 0, ForSelection = 1, ForDeselection = 2, - AsDropTarget = 3 + AsDropTarget = 3, } #if XAMCORE_5_0 @@ -2030,7 +2126,7 @@ public enum NSCollectionViewScrollPosition : ulong { Right = 1 << 5, LeadingEdge = 1 << 6, TrailingEdge = 1 << 7, - NearestVerticalEdge = 1 << 8 + NearestVerticalEdge = 1 << 8, } [MacCatalyst (13, 1)] @@ -2039,7 +2135,7 @@ public enum NSCollectionElementCategory : long { Item, SupplementaryView, DecorationView, - InterItemGap + InterItemGap, } [NoMacCatalyst] @@ -2049,14 +2145,14 @@ public enum NSCollectionUpdateAction : long { Delete, Reload, Move, - None + None, } [MacCatalyst (13, 1)] [Native] public enum NSCollectionViewScrollDirection : long { Vertical, - Horizontal + Horizontal, } [NoMacCatalyst] @@ -2064,13 +2160,14 @@ public enum NSCollectionViewScrollDirection : long { public enum NSDatePickerStyle : ulong { TextFieldAndStepper, ClockAndCalendar, - TextField + TextField, } [NoMacCatalyst] [Native] public enum NSDatePickerMode : ulong { - Single, Range + Single, + Range, } [NoMacCatalyst] @@ -2083,7 +2180,7 @@ public enum NSDatePickerElementFlags : ulong { YearMonthDate = 0xc0, YearMonthDateDay = 0xe0, - Era = 0x100 + Era = 0x100, } [NoMacCatalyst] @@ -2111,13 +2208,13 @@ public enum NSOpenGLContextParameter : ulong { GpuVertexProcessing = 310, GpuFragmentProcessing = 311, HasDrawable = 314, - MpsSwapsInFlight = 315 + MpsSwapsInFlight = 315, } [NoMacCatalyst] public enum NSSurfaceOrder { AboveWindow = 1, - BelowWindow = -1 + BelowWindow = -1, } [NoMacCatalyst] @@ -2178,7 +2275,7 @@ public enum NSOpenGLPixelFormatAttribute : uint { // uint32_t NSOpenGLPixelForma [Deprecated (PlatformName.MacOSX, 10, 5)] MPSafe = 78, [Deprecated (PlatformName.MacOSX, 10, 5)] - MultiScreen = 81 + MultiScreen = 81, } [NoMacCatalyst] @@ -2186,7 +2283,7 @@ public enum NSOpenGLPixelFormatAttribute : uint { // uint32_t NSOpenGLPixelForma public enum NSOpenGLProfile : int { VersionLegacy = 0x1000, // Legacy Version3_2Core = 0x3200, // 3.2 or better - Version4_1Core = 0x4100 + Version4_1Core = 0x4100, } [NoMacCatalyst] @@ -2205,7 +2302,7 @@ public enum NSOpenGLGlobalOption : uint { RetainRenderers = 503, UseBuildCache = 506, [Deprecated (PlatformName.MacOSX, 10, 4)] - ResetLibrary = 504 + ResetLibrary = 504, } [NoMacCatalyst] @@ -2233,7 +2330,7 @@ public enum NSGLTextureCubeMap : uint { PositiveZ = 0x8519, NegativeX = 0x8516, NegativeY = 0x8517, - NegativeZ = 0x851A + NegativeZ = 0x851A, } [NoMacCatalyst] @@ -2241,7 +2338,7 @@ public enum NSGLTextureCubeMap : uint { public enum NSGLColorBuffer : uint { Front = 0x0404, Back = 0x0405, - Aux0 = 0x0409 + Aux0 = 0x0409, } [NoMacCatalyst] @@ -2251,13 +2348,14 @@ public enum NSProgressIndicatorThickness : ulong { Small = 10, Regular = 14, Aqua = 12, - Large = 18 + Large = 18, } [NoMacCatalyst] [Native] public enum NSProgressIndicatorStyle : ulong { - Bar, Spinning + Bar, + Spinning, } [NoMacCatalyst] @@ -2265,7 +2363,7 @@ public enum NSProgressIndicatorStyle : ulong { public enum NSPopUpArrowPosition : ulong { None, Center, - Bottom + Bottom, } // FileType 4cc values to use with NSFileTypeForHFSTypeCode. @@ -2467,7 +2565,7 @@ public enum NSDrawerState : ulong { Closed = 0, Opening = 1, Open = 2, - Closing = 3 + Closing = 3, } [NoMacCatalyst] @@ -2483,14 +2581,14 @@ public enum NSWindowLevel : long { ScreenSaver = 1000, Status = 25, Submenu = 3, - TornOffMenu = 3 + TornOffMenu = 3, } [NoMacCatalyst] [Native] public enum NSRuleEditorRowType : ulong { Simple = 0, - Compound + Compound, } [NoMacCatalyst] @@ -2499,14 +2597,18 @@ public enum NSRuleEditorNestingMode : ulong { Single, List, Compound, - Simple + Simple, } [NoMacCatalyst] [Native] [Deprecated (PlatformName.MacOSX, 10, 11, message: "Use 'NSGlyphProperty' instead.")] public enum NSGlyphInscription : ulong { - Base, Below, Above, Overstrike, OverBelow + Base, + Below, + Above, + Overstrike, + OverBelow, } [NoMacCatalyst] @@ -2528,7 +2630,7 @@ public enum NSRemoteNotificationType : ulong { None = 0, Badge = 1 << 0, Sound = 1 << 1, - Alert = 1 << 2 + Alert = 1 << 2, } [NoMacCatalyst] @@ -2536,14 +2638,14 @@ public enum NSRemoteNotificationType : ulong { public enum NSScrollViewFindBarPosition : long { AboveHorizontalRuler = 0, AboveContent, - BelowContent + BelowContent, } [NoMacCatalyst] [Native] public enum NSScrollerStyle : long { Legacy = 0, - Overlay + Overlay, } [NoMacCatalyst] @@ -2551,7 +2653,7 @@ public enum NSScrollerStyle : long { public enum NSScrollElasticity : long { Automatic = 0, None, - Allowed + Allowed, } [NoMacCatalyst] @@ -2559,7 +2661,7 @@ public enum NSScrollElasticity : long { public enum NSScrollerKnobStyle : long { Default = 0, Dark = 1, - Light = 2 + Light = 2, } [NoMacCatalyst] @@ -2572,7 +2674,7 @@ public enum NSEventPhase : ulong { Changed = 4, Ended = 8, Cancelled = 16, - MayBegin = 32 + MayBegin = 32, } [NoMacCatalyst] @@ -2580,19 +2682,22 @@ public enum NSEventPhase : ulong { [Native] public enum NSEventSwipeTrackingOptions : ulong { LockDirection = 1, - ClampGestureAmount = 2 + ClampGestureAmount = 2, } [NoMacCatalyst] [Native] public enum NSEventGestureAxis : long { - None, Horizontal, Vertical + None, + Horizontal, + Vertical, } [NoMacCatalyst] [Native] public enum NSLayoutConstraintOrientation : long { - Horizontal, Vertical + Horizontal, + Vertical, } [NoMacCatalyst] @@ -2609,13 +2714,16 @@ public enum NSLayoutPriority : int /*float*/ { [NoMacCatalyst] [Native] public enum NSPopoverAppearance : long { - Minimal, HUD + Minimal, + HUD, } [NoMacCatalyst] [Native] public enum NSPopoverBehavior : long { - ApplicationDefined, Transient, Semitransient + ApplicationDefined, + Transient, + Semitransient, } [NoMacCatalyst] @@ -2623,29 +2731,36 @@ public enum NSPopoverBehavior : long { public enum NSTableViewRowSizeStyle : long { Default = -1, Custom = 0, - Small, Medium, Large + Small, + Medium, + Large, } [NoMacCatalyst] [Native] public enum NSTableRowActionEdge : long { Leading, - Trailing + Trailing, } [NoMacCatalyst] [Native] public enum NSTableViewRowActionStyle : long { Regular, - Destructive + Destructive, } [NoMacCatalyst] [Flags] [Native] public enum NSTableViewAnimation : ulong { - None, Fade = 1, Gap = 2, - SlideUp = 0x10, SlideDown = 0x20, SlideLeft = 0x30, SlideRight = 0x40 + None, + Fade = 1, + Gap = 2, + SlideUp = 0x10, + SlideDown = 0x20, + SlideLeft = 0x30, + SlideRight = 0x40, } [NoMacCatalyst] @@ -2653,25 +2768,34 @@ public enum NSTableViewAnimation : ulong { [Native] public enum NSDraggingItemEnumerationOptions : ulong { Concurrent = 1 << 0, - ClearNonenumeratedImages = 1 << 16 + ClearNonenumeratedImages = 1 << 16, } [NoMacCatalyst] [Native] public enum NSDraggingFormation : long { - Default, None, Pile, List, Stack + Default, + None, + Pile, + List, + Stack, } [NoMacCatalyst] [Native] public enum NSDraggingContext : long { - OutsideApplication, WithinApplication + OutsideApplication, + WithinApplication, } [NoMacCatalyst] [Native] public enum NSWindowAnimationBehavior : long { - Default = 0, None = 2, DocumentWindow, UtilityWindow, AlertPanel + Default = 0, + None = 2, + DocumentWindow, + UtilityWindow, + AlertPanel, } [NoMacCatalyst] @@ -2689,7 +2813,7 @@ public enum NSTextFinderAction : long { SelectAllInSelection = 10, HideFindInterface = 11, ShowReplaceInterface = 12, - HideReplaceInterface = 13 + HideReplaceInterface = 13, } [NoMacCatalyst] @@ -2706,7 +2830,7 @@ public enum NSFontPanelMode : ulong { ShadowEffectMask = 1 << 12, AllEffectsMask = 0XFFF00, StandardMask = 0xFFFF, - AllModesMask = unchecked((ulong) UInt32.MaxValue) + AllModesMask = unchecked((ulong) UInt32.MaxValue), } [NoMacCatalyst] @@ -2723,7 +2847,7 @@ public enum NSFontCollectionVisibility : ulong { public enum NSSharingContentScope : long { Item, Partial, - Full + Full, } [NoMacCatalyst] @@ -2743,7 +2867,7 @@ public enum NSTypesetterControlCharacterAction : ulong { public enum NSPageControllerTransitionStyle : long { StackHistory, StackBook, - HorizontalStrip + HorizontalStrip, } [NoMacCatalyst] @@ -2769,21 +2893,21 @@ public enum NSViewControllerTransitionOptions : ulong { SlideRight = 0x80, SlideForward = 0x140, SlideBackward = 0x180, - AllowUserInteraction = 0x1000 + AllowUserInteraction = 0x1000, } [NoMacCatalyst] [Flags] [Native] public enum NSApplicationOcclusionState : ulong { - Visible = 1 << 1 + Visible = 1 << 1, } [NoMacCatalyst] [Flags] [Native] public enum NSWindowOcclusionState : ulong { - Visible = 1 << 1 + Visible = 1 << 1, } @@ -2822,7 +2946,7 @@ public enum NSVisualEffectMaterial : long { [Native] public enum NSVisualEffectBlendingMode : long { BehindWindow, - WithinWindow + WithinWindow, } [NoMacCatalyst] @@ -2830,7 +2954,7 @@ public enum NSVisualEffectBlendingMode : long { public enum NSVisualEffectState : long { FollowsWindowActiveState, Active, - Inactive + Inactive, } #endregion @@ -2843,7 +2967,7 @@ public enum NSPressureBehavior : long { PrimaryGeneric = 2, PrimaryAccelerator = 3, PrimaryDeepClick = 5, - PrimaryDeepDrag = 6 + PrimaryDeepDrag = 6, } [NoMacCatalyst] @@ -2851,7 +2975,7 @@ public enum NSPressureBehavior : long { public enum NSHapticFeedbackPattern : long { Generic = 0, Alignment, - LevelChange + LevelChange, } [NoMacCatalyst] @@ -2859,7 +2983,7 @@ public enum NSHapticFeedbackPattern : long { public enum NSHapticFeedbackPerformanceTime : ulong { Default = 0, Now, - DrawCompleted + DrawCompleted, } [NoMacCatalyst] @@ -2867,7 +2991,7 @@ public enum NSHapticFeedbackPerformanceTime : ulong { public enum NSSpringLoadingHighlight : long { None = 0, Standard, - Emphasized + Emphasized, } [NoMacCatalyst] @@ -2877,21 +3001,21 @@ public enum NSSpringLoadingOptions : ulong { Disabled = 0, Enabled = 1 << 0, ContinuousActivation = 1 << 1, - NoHover = 1 << 3 + NoHover = 1 << 3, } [NoMacCatalyst] [Flags] [Native] public enum NSWindowListOptions : long { - OrderedFrontToBack = (1 << 0) + OrderedFrontToBack = (1 << 0), } [NoMacCatalyst] [Native] public enum NSStatusItemBehavior : ulong { RemovalAllowed = (1 << 1), - TerminationOnRemoval = (1 << 2) + TerminationOnRemoval = (1 << 2), } [NoMacCatalyst] @@ -2899,7 +3023,7 @@ public enum NSStatusItemBehavior : ulong { public enum NSWindowTabbingMode : long { Automatic, Preferred, - Disallowed + Disallowed, } [NoMacCatalyst] @@ -2907,7 +3031,7 @@ public enum NSWindowTabbingMode : long { public enum NSWindowUserTabbingPreference : long { Manual, Always, - InFullScreen + InFullScreen, } [NoMacCatalyst] @@ -2920,7 +3044,7 @@ public enum NSGridCellPlacement : long { Trailing, Bottom = Trailing, Center, - Fill + Fill, } [NoMacCatalyst] @@ -2929,7 +3053,7 @@ public enum NSGridRowAlignment : long { Inherited = 0, None, FirstBaseline, - LastBaseline + LastBaseline, } [NoMacCatalyst] @@ -2937,7 +3061,7 @@ public enum NSGridRowAlignment : long { public enum NSImageLayoutDirection : long { Unspecified = -1, LeftToRight = 2, - RightToLeft = 3 + RightToLeft = 3, } [NoMacCatalyst] @@ -2948,7 +3072,7 @@ public enum NSCloudKitSharingServiceOptions : ulong { AllowPublic = 1 << 0, AllowPrivate = 1 << 1, AllowReadOnly = 1 << 4, - AllowReadWrite = 1 << 5 + AllowReadWrite = 1 << 5, } [NoMacCatalyst] @@ -2986,7 +3110,7 @@ public enum NSPasteboardContentsOptions : ulong { [Native] public enum NSTouchType : long { Direct, - Indirect + Indirect, } [NoMacCatalyst] @@ -2994,14 +3118,14 @@ public enum NSTouchType : long { [Flags] public enum NSTouchTypeMask : ulong { Direct = (1 << (int) NSTouchType.Direct), - Indirect = (1 << (int) NSTouchType.Indirect) + Indirect = (1 << (int) NSTouchType.Indirect), } [NoMacCatalyst] [Native] public enum NSScrubberMode : long { Fixed = 0, - Free + Free, } [NoMacCatalyst] @@ -3010,7 +3134,7 @@ public enum NSScrubberAlignment : long { None = 0, Leading, Trailing, - Center + Center, } [NoMacCatalyst] diff --git a/src/CoreData/Enums.cs b/src/CoreData/Enums.cs index 5d99e910f44c..18469c4a6e4d 100644 --- a/src/CoreData/Enums.cs +++ b/src/CoreData/Enums.cs @@ -37,7 +37,7 @@ public enum NSEntityMappingType : ulong { Add = 0x02, Remove = 0x03, Copy = 0x04, - Transform = 0x05 + Transform = 0x05, } // NUInteger -> NSAttributeDescription.h @@ -73,7 +73,7 @@ public enum NSFetchRequestResultType : ulong { ManagedObject = 0x00, ManagedObjectID = 0x01, DictionaryResultType = 0x02, - NSCountResultType = 0x04 + NSCountResultType = 0x04, } // NUInteger -> NSRelationshipDescription.h @@ -83,7 +83,7 @@ public enum NSDeleteRule : ulong { NoAction, Nullify, Cascade, - Deny + Deny, } // NUInteger -> NSPersistentStoreRequest.h @@ -97,21 +97,27 @@ public enum NSPersistentStoreRequestType : ulong { [MacCatalyst (13, 1)] BatchInsert = 5, BatchUpdate = 6, - BatchDelete = 7 + BatchDelete = 7, } // NUInteger -> NSManagedObjectContext.h /// Enumerates types of concurrenty patterns that can be used by a . [Native] public enum NSManagedObjectContextConcurrencyType : ulong { - Confinement, PrivateQueue, MainQueue + Confinement, + PrivateQueue, + MainQueue, } // NUInteger -> NSManagedObjectContext.h /// Enumerates policies for merging. [Native] public enum NSMergePolicyType : ulong { - Error, PropertyStoreTrump, PropertyObjectTrump, Overwrite, RollbackMerge + Error, + PropertyStoreTrump, + PropertyObjectTrump, + Overwrite, + RollbackMerge, } // NUInteger -> NSFetchedResultsController.h @@ -121,7 +127,7 @@ public enum NSFetchedResultsChangeType : ulong { Insert = 1, Delete = 2, Move = 3, - Update = 4 + Update = 4, } /// Enumerates the kind of results that can be returned from a batched update request. @@ -129,7 +135,7 @@ public enum NSFetchedResultsChangeType : ulong { public enum NSBatchUpdateRequestResultType : ulong { StatusOnly = 0, UpdatedObjectIDs = 1, - UpdatedObjectsCount = 2 + UpdatedObjectsCount = 2, } /// Enumerates the form of the result of a . @@ -138,7 +144,7 @@ public enum NSBatchUpdateRequestResultType : ulong { public enum NSBatchDeleteRequestResultType : ulong { StatusOnly = 0, ObjectIDs = 1, - Count = 2 + Count = 2, } /// Enumerates errors that can be encountered during validation. @@ -169,7 +175,7 @@ public enum ObjectGraphManagementErrorType : ulong { PersistentStoreCoordinatorLocking = 132010, ManagedObjectReferentialIntegrity = 133000, ManagedObjectExternalRelationship = 133010, - ManagedObjectMerge = 133020 + ManagedObjectMerge = 133020, } /// Enumerates error codes that can be encountered while working with persistent stores. @@ -184,7 +190,7 @@ public enum PersistentStoreErrorType : ulong { Operation = 134070, Open = 134080, Timeout = 134090, - IncompatibleVersionHash = 134100 + IncompatibleVersionHash = 134100, } /// Enumerates error codes that can be encountered while migrating stores. @@ -208,7 +214,7 @@ public enum MigrationErrorType { [Native] public enum NSFetchIndexElementType : ulong { Binary, - RTree + RTree, } [MacCatalyst (13, 1)] @@ -216,7 +222,7 @@ public enum NSFetchIndexElementType : ulong { public enum NSPersistentHistoryChangeType : long { Insert, Update, - Delete + Delete, } [MacCatalyst (13, 1)] diff --git a/src/CoreFoundation/DispatchSource.cs b/src/CoreFoundation/DispatchSource.cs index 730404cc35ab..5962bd1813b6 100644 --- a/src/CoreFoundation/DispatchSource.cs +++ b/src/CoreFoundation/DispatchSource.cs @@ -29,7 +29,9 @@ namespace CoreFoundation { [Flags] public enum MemoryPressureFlags { - Normal = 1, Warn = 2, Critical = 4 + Normal = 1, + Warn = 2, + Critical = 4, } [Flags] @@ -37,7 +39,7 @@ public enum ProcessMonitorFlags : uint { Exit = 0x80000000, Fork = 0x40000000, Exec = 0x20000000, - Signal = 0x08000000 + Signal = 0x08000000, } [Flags] @@ -48,7 +50,7 @@ public enum VnodeMonitorKind : uint { Attrib = 8, Link = 0x10, Rename = 0x20, - Revoke = 0x40 + Revoke = 0x40, } #if NET diff --git a/src/CoreGraphics/CGEventTypes.cs b/src/CoreGraphics/CGEventTypes.cs index 6b11c06a8997..0dfe9dccc45e 100644 --- a/src/CoreGraphics/CGEventTypes.cs +++ b/src/CoreGraphics/CGEventTypes.cs @@ -33,7 +33,7 @@ namespace CoreGraphics { public enum CGEventTapLocation : int { HID, Session, - AnnotatedSession + AnnotatedSession, } // CGEventTypes.h:typedef uint32_t CGEventTapPlacement; @@ -45,7 +45,7 @@ public enum CGEventTapLocation : int { #endif public enum CGEventTapPlacement : uint { HeadInsert, - TailAppend + TailAppend, } // CGEventTypes.h:typedef uint32_t CGEventTapOptions; @@ -57,7 +57,7 @@ public enum CGEventTapPlacement : uint { #endif public enum CGEventTapOptions : uint { Default, - ListenOnly + ListenOnly, } // CGEventTypes.h:typedef uint32_t CGMouseButton; @@ -68,7 +68,9 @@ public enum CGEventTapOptions : uint { [MacCatalyst (13,1)] #endif public enum CGMouseButton : uint { - Left, Right, Center + Left, + Right, + Center, } // CGEventTypes.h:typedef uint32_t CGScrollEventUnit; @@ -79,7 +81,8 @@ public enum CGMouseButton : uint { [MacCatalyst (13,1)] #endif public enum CGScrollEventUnit : uint { - Pixel, Line + Pixel, + Line, } // CGEventTypes.h:typedef uint64_t CGEventMask; @@ -395,7 +398,7 @@ public enum CGEventField : int { // no documentation for this value in the header file. /// A value that represents the raw delta value for axis 2. - ScrollWheelEventRawDeltaAxis2 = 177 + ScrollWheelEventRawDeltaAxis2 = 177, } // CGEventTypes.h:typedef uint32_t CGEventType; @@ -435,7 +438,9 @@ public enum CGEventType : uint { [MacCatalyst (13,1)] #endif public enum CGEventMouseSubtype : uint { - Default, TabletPoint, TabletProximity + Default, + TabletPoint, + TabletProximity, } // CGEventTypes.h:typedef uint32_t CGEventSourceStateID; @@ -446,7 +451,9 @@ public enum CGEventMouseSubtype : uint { [MacCatalyst (13,1)] #endif public enum CGEventSourceStateID : int { - Private = -1, CombinedSession = 0, HidSystem = 1 + Private = -1, + CombinedSession = 0, + HidSystem = 1, } // CGRemoteOperation.h:typedef uint32_t CGEventFilterMask; @@ -460,7 +467,7 @@ public enum CGEventSourceStateID : int { public enum CGEventFilterMask : uint { PermitLocalMouseEvents = 1, PermitLocalKeyboardEvents = 2, - PermitSystemDefinedEvents = 4 + PermitSystemDefinedEvents = 4, } // CGRemoteOperation.h:typedef uint32_t CGEventSuppressionState; diff --git a/src/CoreImage/CISampler.cs b/src/CoreImage/CISampler.cs index bc62262306ec..3ffb7ba72c04 100644 --- a/src/CoreImage/CISampler.cs +++ b/src/CoreImage/CISampler.cs @@ -39,12 +39,13 @@ namespace CoreImage { // convenience enum on kCISamplerWrap[Black|Clamp] fields -> CISampler.h (headers hidden under QuartzCore.framework) public enum CIWrapMode { Black, - Clamp + Clamp, } // convenience enum on kCISamplerFilter[Nearest|Linear] fields -> CISampler.h (headers hidden under QuartzCore.framework) public enum CIFilterMode { - Nearest, Linear + Nearest, + Linear, } #if NET diff --git a/src/CoreMidi/MidiServices.cs b/src/CoreMidi/MidiServices.cs index 30b4fdbfcfa3..3abb0a018065 100644 --- a/src/CoreMidi/MidiServices.cs +++ b/src/CoreMidi/MidiServices.cs @@ -74,14 +74,17 @@ public enum MidiError : int { WrongThread = -10841, ObjectNotFound = -10842, IDNotUnique = -10843, - NotPermitted = -10844 + NotPermitted = -10844, } [Flags] // SInt32 - MIDIServices.h enum MidiObjectType : int { Other = -1, - Device, Entity, Source, Destination, + Device, + Entity, + Source, + Destination, ExternalMask = 0x10, ExternalDevice = ExternalMask | Device, ExternalEntity = ExternalMask | Entity, diff --git a/src/CoreMotion/Defs.cs b/src/CoreMotion/Defs.cs index 4c3d55ca6c16..d07f431f514e 100644 --- a/src/CoreMotion/Defs.cs +++ b/src/CoreMotion/Defs.cs @@ -111,6 +111,9 @@ public override string ToString () // untyped enum -> CMDeviceMotion.h public enum CMMagneticFieldCalibrationAccuracy { - Uncalibrated = -1, Low, Medium, High + Uncalibrated = -1, + Low, + Medium, + High, } } diff --git a/src/CoreText/CTFontManager.cs b/src/CoreText/CTFontManager.cs index 3eab8c96b5e6..e9150b2970d3 100644 --- a/src/CoreText/CTFontManager.cs +++ b/src/CoreText/CTFontManager.cs @@ -77,7 +77,9 @@ public enum CTFontManagerScope : uint { // defined as uint32_t - /System/Library/Frameworks/CoreText.framework/Headers/CTFontManager.h public enum CTFontManagerAutoActivation : uint { - Default = 0, Disabled = 1, Enabled = 2, + Default = 0, + Disabled = 1, + Enabled = 2, #if NET [SupportedOSPlatform ("ios")] [SupportedOSPlatform ("maccatalyst")] diff --git a/src/Darwin/SystemLog.cs b/src/Darwin/SystemLog.cs index c42ab4f5339d..02dcc77443e1 100644 --- a/src/Darwin/SystemLog.cs +++ b/src/Darwin/SystemLog.cs @@ -53,7 +53,11 @@ public static SystemLog Default { } [Flags] - public enum Option { Stderr, NoDelay, NoRemote } + public enum Option { + Stderr, + NoDelay, + NoRemote, + } protected override void Dispose (bool disposing) { @@ -202,7 +206,10 @@ public IEnumerable Search (Message msg) } public class Message : DisposableObject { - public enum Kind { Message, Query } + public enum Kind { + Message, + Query, + } [Flags] public enum Op { @@ -218,7 +225,7 @@ public enum Op { Less = 4, LessEqual = 5, NotEqual = 6, - True = 7 + True = 7, } [Preserve (Conditional = true)] diff --git a/src/EventKit/EKEnums.cs b/src/EventKit/EKEnums.cs index 98ade258bb1c..a4ec6e17f4cf 100644 --- a/src/EventKit/EKEnums.cs +++ b/src/EventKit/EKEnums.cs @@ -15,7 +15,11 @@ namespace EventKit { /// Specifies the type of a calendar. [Native] public enum EKCalendarType : long { - Local, CalDav, Exchange, Subscription, Birthday + Local, + CalDav, + Exchange, + Subscription, + Birthday, } // untyped enum -> EKTypes.h @@ -23,7 +27,11 @@ public enum EKCalendarType : long { /// The kind of participant to the event. [Native] public enum EKParticipantType : long { - Unknown, Person, Room, Resource, Group + Unknown, + Person, + Room, + Resource, + Group, } // untyped enum -> EKTypes.h @@ -31,7 +39,11 @@ public enum EKParticipantType : long { /// The role of an [Native] public enum EKParticipantRole : long { - Unknown, Required, Optional, Chair, NonParticipant + Unknown, + Required, + Optional, + Chair, + NonParticipant, } // untyped enum -> EKTypes.h @@ -39,8 +51,14 @@ public enum EKParticipantRole : long { /// The status of a participant. [Native] public enum EKParticipantStatus : long { - Unknown, Pending, Accepted, Declined, - Tentative, Delegated, Completed, InProcess + Unknown, + Pending, + Accepted, + Declined, + Tentative, + Delegated, + Completed, + InProcess, } // untyped enum -> EKError.h @@ -97,7 +115,12 @@ public enum EKErrorCode : long { public enum EKDay { NotSet = 0, Sunday = 1, - Monday, Tuesday, Wednesday, Thursday, Friday, Saturday + Monday, + Tuesday, + Wednesday, + Thursday, + Friday, + Saturday, } /// Enumerates the days of the week. @@ -119,7 +142,10 @@ public enum EKWeekday : long { /// The recurring frequency for the event. [Native] public enum EKRecurrenceFrequency : long { - Daily, Weekly, Monthly, Yearly + Daily, + Weekly, + Monthly, + Yearly, } // untyped enum -> EKEventStore.h @@ -127,7 +153,8 @@ public enum EKRecurrenceFrequency : long { /// Determines how changes to an event will be applied, either it affects a single instance or affects all instances. [Native] public enum EKSpan : long { - ThisEvent, FutureEvents + ThisEvent, + FutureEvents, } // NSUInteger -> EKTypes.h @@ -139,7 +166,7 @@ public enum EKCalendarEventAvailability : ulong { Busy = 1, Free = 2, Tentative = 4, - Unavailable = 8 + Unavailable = 8, } // untyped enum -> EKEvent.h @@ -148,7 +175,10 @@ public enum EKCalendarEventAvailability : ulong { [Native] public enum EKEventAvailability : long { NotSupported = -1, - Busy = 0, Free, Tentative, Unavailable, + Busy = 0, + Free, + Tentative, + Unavailable, } // untyped enum -> EKEvent.h @@ -156,7 +186,10 @@ public enum EKEventAvailability : long { /// The event status. [Native] public enum EKEventStatus : long { - None, Confirmed, Tentative, Cancelled + None, + Confirmed, + Tentative, + Cancelled, } // untyped enum -> EKTypes.h @@ -164,14 +197,21 @@ public enum EKEventStatus : long { /// An enumeration whose values indicate the type of a object. [Native] public enum EKSourceType : long { - Local, Exchange, CalDav, MobileMe, Subscribed, Birthdays + Local, + Exchange, + CalDav, + MobileMe, + Subscribed, + Birthdays, } // NSInteger -> EKTypes.h /// An enumeration whose values specify whether an event was raised by entering or leaving a region. [Native] public enum EKAlarmProximity : long { - None, Enter, Leave + None, + Enter, + Leave, } // NSUInteger -> EKTypes.h @@ -180,7 +220,7 @@ public enum EKAlarmProximity : long { [Flags] public enum EKEntityMask : ulong { Event = 1 << (int) EKEntityType.Event, - Reminder = 1 << (int) EKEntityType.Reminder + Reminder = 1 << (int) EKEntityType.Reminder, } // NSUInteger -> EKTypes.h @@ -188,7 +228,7 @@ public enum EKEntityMask : ulong { [Native] public enum EKEntityType : ulong { Event, - Reminder + Reminder, } #if MONOMAC @@ -196,7 +236,10 @@ public enum EKEntityType : ulong { // turned into a typed (NSInteger) enum in El Capitan (and also an NSInteger in watchOS) [Native] public enum EKAlarmType : long { - Display, Audio, Procedure, Email + Display, + Audio, + Procedure, + Email, } #endif // NSInteger -> EKEventStore.h @@ -220,7 +263,7 @@ public enum EKParticipantScheduleStatus : long { NoPrivileges, DeliveryFailed, CannotDeliver, - RecipientNotAllowed + RecipientNotAllowed, } [Native] @@ -228,7 +271,7 @@ public enum EKReminderPriority : ulong { None = 0, High = 1, Medium = 5, - Low = 9 + Low = 9, } } diff --git a/src/EventKitUI/Defs.cs b/src/EventKitUI/Defs.cs index 9ad6bcbceecb..75ea3d08f059 100644 --- a/src/EventKitUI/Defs.cs +++ b/src/EventKitUI/Defs.cs @@ -17,27 +17,33 @@ namespace EventKitUI { // iOS 9 promoted this to an NSInteger - which breaks compatibility [Native] public enum EKCalendarChooserSelectionStyle : long { - Single, Multiple + Single, + Multiple, } // untyped enum -> EKCalendarChooser.h // iOS 9 promoted this to an NSInteger - which breaks compatibility [Native] public enum EKCalendarChooserDisplayStyle : long { - AllCalendars, WritableCalendarsOnly + AllCalendars, + WritableCalendarsOnly, } // untyped enum -> EKEventViewController.h // iOS 9 promoted this to an NSInteger - which breaks compatibility [Native] public enum EKEventViewAction : long { - Done, Responded, Deleted + Done, + Responded, + Deleted, } // untyped enum -> EKEventEditViewController.h // iOS 9 promoted this to an NSInteger - which breaks compatibility [Native] public enum EKEventEditViewAction : long { - Canceled, Saved, Deleted + Canceled, + Saved, + Deleted, } } diff --git a/src/Foundation/Enum.cs b/src/Foundation/Enum.cs index 3fa1ca2e3cb7..82ae2939c54f 100644 --- a/src/Foundation/Enum.cs +++ b/src/Foundation/Enum.cs @@ -72,7 +72,7 @@ public enum NSUrlCredentialPersistence : ulong { None, ForSession, Permanent, - Synchronizable + Synchronizable, } #if MONOMAC @@ -97,7 +97,7 @@ public enum NSBundleExecutableArchitecture { public enum NSComparisonResult : long { Ascending = -1, Same, - Descending + Descending, } [Native] @@ -115,7 +115,9 @@ public enum NSUrlRequestCachePolicy : ulong { [Native] public enum NSUrlCacheStoragePolicy : ulong { - Allowed, AllowedInMemoryOnly, NotAllowed + Allowed, + AllowedInMemoryOnly, + NotAllowed, } [Native] @@ -127,21 +129,21 @@ public enum NSStreamStatus : ulong { Writing = 4, AtEnd = 5, Closed = 6, - Error = 7 + Error = 7, } [Native] public enum NSPropertyListFormat : ulong { OpenStep = 1, Xml = 100, - Binary = 200 + Binary = 200, } [Native] public enum NSPropertyListMutabilityOptions : ulong { Immutable = 0, MutableContainers = 1, - MutableContainersAndLeaves = 2 + MutableContainersAndLeaves = 2, } // Should mirror NSPropertyListMutabilityOptions @@ -149,7 +151,7 @@ public enum NSPropertyListMutabilityOptions : ulong { public enum NSPropertyListWriteOptions : ulong { Immutable = 0, MutableContainers = 1, - MutableContainersAndLeaves = 2 + MutableContainersAndLeaves = 2, } // Should mirror NSPropertyListMutabilityOptions, but currently @@ -158,7 +160,7 @@ public enum NSPropertyListWriteOptions : ulong { public enum NSPropertyListReadOptions : ulong { Immutable = 0, MutableContainers = 1, - MutableContainersAndLeaves = 2 + MutableContainersAndLeaves = 2, } [Native] @@ -166,7 +168,7 @@ public enum NSPropertyListReadOptions : ulong { public enum NSMachPortRights : ulong { None = 0, SendRight = (1 << 0), - ReceiveRight = (1 << 1) + ReceiveRight = (1 << 1), } [Native] @@ -186,7 +188,7 @@ public enum NSNetServicesStatus : long { [Native] public enum NSNetServiceOptions : ulong { NoAutoRename = 1 << 0, - ListenForConnections = 1 << 1 + ListenForConnections = 1 << 1, } [Native] @@ -195,7 +197,7 @@ public enum NSDateFormatterStyle : ulong { Short, Medium, Long, - Full + Full, } [Native] @@ -210,7 +212,9 @@ public enum NSDateFormatterBehavior : ulong { [Native] public enum NSHttpCookieAcceptPolicy : ulong { - Always, Never, OnlyFromMainDocumentDomain + Always, + Never, + OnlyFromMainDocumentDomain, } [Flags] @@ -252,7 +256,7 @@ public enum NSDataReadingOptions : ulong { [Obsolete ("This option is unavailable.")] Coordinated = 1 << 2, #endif - MappedAlways = 1 << 3 + MappedAlways = 1 << 3, } [Flags] @@ -279,7 +283,11 @@ public enum NSDataWritingOptions : ulong { [Native] public enum NSOperationQueuePriority : long { - VeryLow = -8, Low = -4, Normal = 0, High = 4, VeryHigh = 8 + VeryLow = -8, + Low = -4, + Normal = 0, + High = 4, + VeryHigh = 8, } [Flags] @@ -287,19 +295,21 @@ public enum NSOperationQueuePriority : long { public enum NSNotificationCoalescing : ulong { NoCoalescing = 0, CoalescingOnName = 1, - CoalescingOnSender = 2 + CoalescingOnSender = 2, } [Native] public enum NSPostingStyle : ulong { - PostWhenIdle = 1, PostASAP = 2, Now = 3 + PostWhenIdle = 1, + PostASAP = 2, + Now = 3, } [Flags] [Native] public enum NSDataSearchOptions : ulong { SearchBackwards = 1, - SearchAnchored = 2 + SearchAnchored = 2, } [Native] @@ -316,7 +326,7 @@ public enum NSExpressionType : ulong { NSAggregate, AnyKey = 15, Block = 19, - Conditional = 20 + Conditional = 20, } public enum NSCocoaError : int { @@ -497,19 +507,25 @@ public enum NSKeyValueObservingOptions : ulong { [Native] public enum NSKeyValueChange : ulong { - Setting = 1, Insertion, Removal, Replacement + Setting = 1, + Insertion, + Removal, + Replacement, } [Native] public enum NSKeyValueSetMutationKind : ulong { - UnionSet = 1, MinusSet, IntersectSet, SetSet + UnionSet = 1, + MinusSet, + IntersectSet, + SetSet, } [Flags] [Native] public enum NSEnumerationOptions : ulong { SortConcurrent = 1, - Reverse = 2 + Reverse = 2, } [Flags] @@ -520,14 +536,14 @@ public enum NSStreamEvent : ulong { HasBytesAvailable = 1 << 1, HasSpaceAvailable = 1 << 2, ErrorOccurred = 1 << 3, - EndEncountered = 1 << 4 + EndEncountered = 1 << 4, } [Native] public enum NSComparisonPredicateModifier : ulong { Direct, All, - Any + Any, } [Native] @@ -545,7 +561,7 @@ public enum NSPredicateOperatorType : ulong { In, CustomSelector, Contains = 99, - Between + Between, } [Flags] @@ -554,14 +570,14 @@ public enum NSComparisonPredicateOptions : ulong { None = 0x00, CaseInsensitive = 1 << 0, DiacriticInsensitive = 1 << 1, - Normalized = 1 << 2 + Normalized = 1 << 2, } [Native] public enum NSCompoundPredicateType : ulong { Not, And, - Or + Or, } [Flags] @@ -649,12 +665,19 @@ public enum NSSearchPathDomain : ulong { [Native] public enum NSRoundingMode : ulong { - Plain, Down, Up, Bankers + Plain, + Down, + Up, + Bankers, } [Native] public enum NSCalculationError : ulong { - None, PrecisionLoss, Underflow, Overflow, DivideByZero + None, + PrecisionLoss, + Underflow, + Overflow, + DivideByZero, } [Flags] @@ -673,7 +696,7 @@ public enum NSStringDrawingOptions : ulong { [NoMacCatalyst] [Deprecated (PlatformName.MacOSX, 10, 11)] OneShot = (1 << 4), - TruncatesLastVisibleLine = (1 << 5) + TruncatesLastVisibleLine = (1 << 5), } [Native] @@ -701,29 +724,38 @@ public enum NSNumberFormatterBehavior : ulong { [NoTV] [NoMacCatalyst] Version_10_0 = 1000, - Version_10_4 = 1040 + Version_10_4 = 1040, } [Native] public enum NSNumberFormatterPadPosition : ulong { - BeforePrefix, AfterPrefix, BeforeSuffix, AfterSuffix + BeforePrefix, + AfterPrefix, + BeforeSuffix, + AfterSuffix, } [Native] public enum NSNumberFormatterRoundingMode : ulong { - Ceiling, Floor, Down, Up, HalfEven, HalfDown, HalfUp + Ceiling, + Floor, + Down, + Up, + HalfEven, + HalfDown, + HalfUp, } [Flags] [Native] public enum NSFileVersionReplacingOptions : ulong { - ByMoving = 1 << 0 + ByMoving = 1 << 0, } [Flags] [Native] public enum NSFileVersionAddingOptions : ulong { - ByMoving = 1 << 0 + ByMoving = 1 << 0, } [Flags] @@ -734,7 +766,7 @@ public enum NSFileCoordinatorReadingOptions : ulong { [MacCatalyst (13, 1)] ImmediatelyAvailableMetadataOnly = 1 << 2, [MacCatalyst (13, 1)] - ForUploading = 1 << 3 + ForUploading = 1 << 3, } [Flags] @@ -755,12 +787,15 @@ public enum NSLinguisticTaggerOptions : ulong { OmitPunctuation = 2, OmitWhitespace = 4, OmitOther = 8, - JoinNames = 16 + JoinNames = 16, } [Native] public enum NSUbiquitousKeyValueStoreChangeReason : long { - ServerChange, InitialSyncChange, QuotaViolationChange, AccountChange + ServerChange, + InitialSyncChange, + QuotaViolationChange, + AccountChange, } [Flags] @@ -795,7 +830,11 @@ public enum NSJsonWritingOptions : ulong { [Native] public enum NSLocaleLanguageDirection : ulong { - Unknown, LeftToRight, RightToLeft, TopToBottom, BottomToTop, + Unknown, + LeftToRight, + RightToLeft, + TopToBottom, + BottomToTop, } [Flags] @@ -832,14 +871,14 @@ public enum NSAlignmentOptions : long { [Native] public enum NSFileWrapperReadingOptions : ulong { Immediate = 1 << 0, - WithoutMapping = 1 << 1 + WithoutMapping = 1 << 1, } [Flags] [Native] public enum NSFileWrapperWritingOptions : ulong { Atomic = 1 << 0, - WithNameUpdating = 1 << 1 + WithNameUpdating = 1 << 1, } [Flags] @@ -847,7 +886,7 @@ public enum NSFileWrapperWritingOptions : ulong { public enum NSAttributedStringEnumeration : ulong { None = 0, Reverse = 1 << 1, - LongestEffectiveRangeNotRequired = 1 << 20 + LongestEffectiveRangeNotRequired = 1 << 20, } #if NET || !MONOMAC @@ -864,7 +903,7 @@ public enum NSUnderlineStyle : long { PatternDash = 0x0200, PatternDashDot = 0x0300, PatternDashDotDot = 0x0400, - ByWord = 0x8000 + ByWord = 0x8000, } #endif @@ -874,7 +913,9 @@ public enum NSUnderlineStyle : long { // See https://github.com/xamarin/xamarin-macios/issues/6573 [Native] public enum NSWritingDirection : long { - Natural = -1, LeftToRight = 0, RightToLeft = 1, + Natural = -1, + LeftToRight = 0, + RightToLeft = 1, } [Flags] @@ -890,12 +931,15 @@ public enum NSByteCountFormatterUnits : ulong { UseEB = 1 << 6, UseZB = 1 << 7, UseYBOrHigher = 0x0FF << 8, - UseAll = 0x0FFFF + UseAll = 0x0FFFF, } [Native] public enum NSByteCountFormatterCountStyle : long { - File, Memory, Decimal, Binary + File, + Memory, + Decimal, + Binary, } [Flags] @@ -928,7 +972,9 @@ public enum NSUrlBookmarkResolutionOptions : ulong { [Native] public enum NSLigatureType : long { - None, Default, All + None, + Default, + All, } #if !NET @@ -993,14 +1039,14 @@ public enum NSUrlRequestNetworkServiceType : ulong { [Native] public enum NSSortOptions : ulong { Concurrent = 1 << 0, - Stable = 1 << 4 + Stable = 1 << 4, } [Flags] [Native] public enum NSDataBase64DecodingOptions : ulong { None = 0, - IgnoreUnknownCharacters = 1 + IgnoreUnknownCharacters = 1, } [Flags] @@ -1010,7 +1056,7 @@ public enum NSDataBase64EncodingOptions : ulong { SixtyFourCharacterLineLength = 1, SeventySixCharacterLineLength = 1 << 1, EndLineWithCarriageReturn = 1 << 4, - EndLineWithLineFeed = 1 << 5 + EndLineWithLineFeed = 1 << 5, } [Native] @@ -1018,7 +1064,7 @@ public enum NSUrlSessionAuthChallengeDisposition : long { UseCredential = 0, PerformDefaultHandling = 1, CancelAuthenticationChallenge = 2, - RejectProtectionSpace = 3 + RejectProtectionSpace = 3, } [Native] @@ -1026,7 +1072,7 @@ public enum NSUrlSessionTaskState : long { Running = 0, Suspended = 1, Canceling = 2, - Completed = 3 + Completed = 3, } [Native] @@ -1034,14 +1080,14 @@ public enum NSUrlSessionResponseDisposition : long { Cancel = 0, Allow = 1, BecomeDownload = 2, - BecomeStream = 3 + BecomeStream = 3, } [Native] public enum NSUrlErrorCancelledReason : long { UserForceQuitApplication, BackgroundUpdatesDisabled, - InsufficientSystemResources + InsufficientSystemResources, } [Flags] @@ -1066,7 +1112,7 @@ public enum NSTimeZoneNameStyle : long { DaylightSaving, ShortDaylightSaving, Generic, - ShortGeneric + ShortGeneric, } [MacCatalyst (13, 1)] @@ -1076,7 +1122,7 @@ public enum NSItemProviderErrorCode : long { None = 0, ItemUnavailable = -1000, UnexpectedValueClass = -1100, - UnavailableCoercion = -1200 + UnavailableCoercion = -1200, } [Native] @@ -1101,7 +1147,7 @@ public enum NSDateComponentsFormatterZeroFormattingBehavior : ulong { DropMiddle = (1 << 2), DropTrailing = (1 << 3), DropAll = (DropLeading | DropMiddle | DropTrailing), - Pad = (1 << 16) + Pad = (1 << 16), } [Native] @@ -1112,7 +1158,7 @@ public enum NSFormattingContext : long { Standalone = 2, ListItem = 3, BeginningOfSentence = 4, - MiddleOfSentence = 5 + MiddleOfSentence = 5, } [MacCatalyst (13, 1)] @@ -1122,7 +1168,7 @@ public enum NSDateIntervalFormatterStyle : ulong { Short = 1, Medium = 2, Long = 3, - Full = 4 + Full = 4, } [MacCatalyst (13, 1)] @@ -1131,7 +1177,7 @@ public enum NSEnergyFormatterUnit : long { Joule = 11, Kilojoule = 14, Calorie = (7 << 8) + 1, - Kilocalorie = (7 << 8) + 2 + Kilocalorie = (7 << 8) + 2, } [MacCatalyst (13, 1)] @@ -1139,7 +1185,7 @@ public enum NSEnergyFormatterUnit : long { public enum NSFormattingUnitStyle : long { Short = 1, Medium, - Long + Long, } [MacCatalyst (13, 1)] @@ -1149,7 +1195,7 @@ public enum NSMassFormatterUnit : long { Kilogram = 14, Ounce = (6 << 8) + 1, Pound = (6 << 8) + 2, - Stone = (6 << 8) + 3 + Stone = (6 << 8) + 3, } [MacCatalyst (13, 1)] @@ -1162,7 +1208,7 @@ public enum NSLengthFormatterUnit : long { Inch = (5 << 8) + 1, Foot = (5 << 8) + 2, Yard = (5 << 8) + 3, - Mile = (5 << 8) + 4 + Mile = (5 << 8) + 4, } [MacCatalyst (13, 1)] @@ -1172,18 +1218,23 @@ public enum NSQualityOfService : long { UserInitiated = 25, Utility = 17, Background = 9, - Default = -1 + Default = -1, } [MacCatalyst (13, 1)] [Native] public enum NSProcessInfoThermalState : long { - Nominal, Fair, Serious, Critical + Nominal, + Fair, + Serious, + Critical, } [Native] public enum NSUrlRelationship : long { - Contains, Same, Other + Contains, + Same, + Other, } // NSTextCheckingResult.h:typedef NS_OPTIONS(uint64_t, NSTextCheckingType) @@ -1208,7 +1259,7 @@ public enum NSTextCheckingType : ulong { public enum NSTextCheckingTypes : ulong { AllSystemTypes = 0xffffffff, AllCustomTypes = 0xffffffff00000000, - AllTypes = 0xffffffffffffffff + AllTypes = 0xffffffffffffffff, } [Native] @@ -1220,7 +1271,7 @@ public enum NSRegularExpressionOptions : ulong { DotMatchesLineSeparators = 1 << 3, AnchorsMatchLines = 1 << 4, UseUnixLineSeparators = 1 << 5, - UseUnicodeWordBoundaries = 1 << 6 + UseUnicodeWordBoundaries = 1 << 6, } [Native] @@ -1230,7 +1281,7 @@ public enum NSMatchingOptions : ulong { ReportCompletion = 1 << 1, Anchored = 1 << 2, WithTransparentBounds = 1 << 3, - WithoutAnchoringBounds = 1 << 4 + WithoutAnchoringBounds = 1 << 4, } [Native] @@ -1240,14 +1291,14 @@ public enum NSMatchingFlags : ulong { Completed = 1 << 1, HitEnd = 1 << 2, RequiredEnd = 1 << 3, - InternalError = 1 << 4 + InternalError = 1 << 4, } [MacCatalyst (13, 1)] [Native] [Flags] public enum NSPersonNameComponentsFormatterOptions : ulong { - Phonetic = (1 << 1) + Phonetic = (1 << 1), } [MacCatalyst (13, 1)] @@ -1257,14 +1308,14 @@ public enum NSPersonNameComponentsFormatterStyle : long { Short, Medium, Long, - Abbreviated + Abbreviated, } [MacCatalyst (13, 1)] [Native] public enum NSDecodingFailurePolicy : long { RaiseException, - SetErrorAndReturn + SetErrorAndReturn, } [MacCatalyst (13, 1)] @@ -1294,7 +1345,7 @@ public enum NSUrlSessionTaskMetricsResourceFetchType : long { Unknown, NetworkLoad, ServerPush, - LocalCache + LocalCache, } [MacCatalyst (13, 1)] @@ -1303,7 +1354,7 @@ public enum NSUrlSessionTaskMetricsResourceFetchType : long { public enum NSMeasurementFormatterUnitOptions : ulong { ProvidedUnit = (1 << 0), NaturalScale = (1 << 1), - TemperatureWithoutUnit = (1 << 2) + TemperatureWithoutUnit = (1 << 2), } diff --git a/src/Foundation/NSFileManager.cs b/src/Foundation/NSFileManager.cs index eb0eed75fac5..4c5fb422b4a7 100644 --- a/src/Foundation/NSFileManager.cs +++ b/src/Foundation/NSFileManager.cs @@ -39,7 +39,13 @@ namespace Foundation { // This is a convenience enum around a set of native strings. public enum NSFileType { - Directory, Regular, SymbolicLink, Socket, CharacterSpecial, BlockSpecial, Unknown + Directory, + Regular, + SymbolicLink, + Socket, + CharacterSpecial, + BlockSpecial, + Unknown, } #if !MONOMAC diff --git a/src/Foundation/NSStream.cs b/src/Foundation/NSStream.cs index d4e1d418ad8e..bae93f568a57 100644 --- a/src/Foundation/NSStream.cs +++ b/src/Foundation/NSStream.cs @@ -45,11 +45,20 @@ namespace Foundation { public enum NSStreamSocketSecurityLevel { - None, SslV2, SslV3, TlsV1, NegotiatedSsl, Unknown + None, + SslV2, + SslV3, + TlsV1, + NegotiatedSsl, + Unknown, } public enum NSStreamServiceType { - Default, VoIP, Video, Background, Voice + Default, + VoIP, + Video, + Background, + Voice, } #if NET diff --git a/src/GLKit/Defs.cs b/src/GLKit/Defs.cs index 355c9918fe04..e95a58c453d5 100644 --- a/src/GLKit/Defs.cs +++ b/src/GLKit/Defs.cs @@ -38,66 +38,78 @@ namespace GLKit { // GLint (32 bits on 64 bit hardware) -> GLKEffects.h public enum GLKVertexAttrib { - Position, Normal, Color, TexCoord0, TexCoord1 + Position, + Normal, + Color, + TexCoord0, + TexCoord1, } // GLint (32 bits on 64 bit hardware) -> GLKEffectPropertyLight.h public enum GLKLightingType { PerVertex, - PerPixel + PerPixel, } // GLint (32 bits on 64 bit hardware) -> GLKEffectPropertyTexture.h public enum GLKTextureEnvMode { - Replace, Modulate, Decal + Replace, + Modulate, + Decal, } // GLenum (32 bits on 64 bit hardware) -> GLKEffectPropertyTexture.h public enum GLKTextureTarget { Texture2D = 0x0DE1, // GL_TEXTURE_2D CubeMap = 0x8513, // GL_TEXTURE_CUBE_MAP - TargetCt = 2 + TargetCt = 2, } // GLint (32 bits on 64 bit hardware) -> GLKEffectPropertyFog.h public enum GLKFogMode { Exp = 0, Exp2, - Linear + Linear, } // GLint (32 bits on 64 bit hardware) -> GLKView.h public enum GLKViewDrawableColorFormat { RGBA8888 = 0, RGB565, - SRGBA8888 + SRGBA8888, } // GLint (32 bits on 64 bit hardware) -> GLKView.h public enum GLKViewDrawableDepthFormat { - None, Format16, Format24, + None, + Format16, + Format24, } // GLint (32 bits on 64 bit hardware) -> GLKView.h public enum GLKViewDrawableStencilFormat { - FormatNone, Format8 + FormatNone, + Format8, } // GLint (32 bits on 64 bit hardware) -> GLKView.h public enum GLKViewDrawableMultisample { - None, Sample4x + None, + Sample4x, } // GLint (32 bits on 64 bit hardware) -> GLKTextureLoader.h public enum GLKTextureInfoAlphaState { - None, NonPremultiplied, Premultiplied + None, + NonPremultiplied, + Premultiplied, } // GLint (32 bits on 64 bit hardware) -> GLKTextureLoader.h public enum GLKTextureInfoOrigin { Unknown = 0, TopLeft, - BottomLeft + BottomLeft, } // GLuint (we'll keep `int` for compatibility) -> GLKTextureLoader.h diff --git a/src/GameKit/GameKit.cs b/src/GameKit/GameKit.cs index 5ae93ba673ee..9b1037faa745 100644 --- a/src/GameKit/GameKit.cs +++ b/src/GameKit/GameKit.cs @@ -30,7 +30,7 @@ namespace GameKit { [Native] public enum GKPeerPickerConnectionType : ulong { Online = 1 << 0, - Nearby = 1 << 1 + Nearby = 1 << 1, } // untyped enum -> GKPublicConstants.h @@ -57,7 +57,7 @@ public enum GKVoiceChatServiceError { NetworkConfiguration = 32013, UnsupportedRemoteVersion = 32014, OutOfMemory = 32015, - InvalidParameter = 32016 + InvalidParameter = 32016, } // untyped enum -> GKPublicConstants.h @@ -98,13 +98,16 @@ public enum GKPeerConnectionState { // NSInteger -> GKLeaderboard.h [Native] public enum GKLeaderboardTimeScope : long { - Today, Week, AllTime + Today, + Week, + AllTime, } // NSInteger -> GKLeaderboard.h [Native] public enum GKLeaderboardPlayerScope : long { - Global, FriendsOnly + Global, + FriendsOnly, } // NSInteger -> GKError.h @@ -205,13 +208,16 @@ public enum GKGameSessionErrorCode : long { [Deprecated (PlatformName.MacCatalyst, 13, 1)] [Native] public enum GKMatchSendDataMode : long { - Reliable, Unreliable + Reliable, + Unreliable, } // NSInteger -> GKMatch.h [Native] public enum GKPlayerConnectionState : long { - Unknown, Connected, Disconnected + Unknown, + Connected, + Disconnected, } // NSInteger -> GKVoiceChat.h @@ -225,32 +231,50 @@ public enum GKVoiceChatPlayerState : long { Disconnected, Speaking, Silent, - Connecting + Connecting, } // NSInteger -> GKPlayer.h [Native] public enum GKPhotoSize : long { - Small, Normal + Small, + Normal, } // NSInteger -> GKTurnBasedMatch.h [Native] public enum GKTurnBasedMatchStatus : long { - Unknown, Open, Ended, Matching + Unknown, + Open, + Ended, + Matching, } // NSInteger -> GKTurnBasedMatch.h [Native] public enum GKTurnBasedParticipantStatus : long { - Unknown, Invited, Declined, Matching, Active, Done + Unknown, + Invited, + Declined, + Matching, + Active, + Done, } // NSInteger -> GKTurnBasedMatch.h [Native] public enum GKTurnBasedMatchOutcome : long { - None, Quit, Won, Lost, Tied, TimeExpired, - First, Second, Third, Fourth, CustomRange = 0xff0000 + None, + Quit, + Won, + Lost, + Tied, + TimeExpired, + First, + Second, + Third, + Fourth, + CustomRange = 0xff0000, } // NSInteger -> GKChallenge.h @@ -260,7 +284,7 @@ public enum GKChallengeState : long { Invalid = 0, Pending, Completed, - Declined + Declined, } // NSInteger -> GKGameCenterViewController.h @@ -301,7 +325,7 @@ public enum GKInviteeResponse : long { public enum GKMatchType : ulong { PeerToPeer, Hosted, - TurnBased + TurnBased, } // uint8_t -> GKTurnBasedMatch.h @@ -310,7 +334,7 @@ public enum GKTurnBasedExchangeStatus : sbyte { Active, Complete, Resolved, - Canceled + Canceled, } [Native] diff --git a/src/MapKit/MKEnums.cs b/src/MapKit/MKEnums.cs index f041976ed922..22db9990ea48 100644 --- a/src/MapKit/MKEnums.cs +++ b/src/MapKit/MKEnums.cs @@ -88,7 +88,11 @@ public enum MKErrorCode : ulong { [MacCatalyst (13, 1)] [Native] public enum MKAnnotationViewDragState : ulong { - None, Starting, Dragging, Canceling, Ending + None, + Starting, + Dragging, + Canceling, + Ending, } // NSUInteger -> MKTypes.h @@ -100,7 +104,9 @@ public enum MKAnnotationViewDragState : ulong { [Deprecated (PlatformName.MacCatalyst, 13, 1, message: "Use 'MKPinAnnotationView.PinTintColor' instead.")] [Deprecated (PlatformName.MacOSX, 10, 11, message: "Use 'MKPinAnnotationView.PinTintColor' instead.")] public enum MKPinAnnotationColor : ulong { - Red, Green, Purple + Red, + Green, + Purple, } // NSUInteger -> MKTypes.h @@ -125,7 +131,7 @@ public enum MKUserTrackingMode : ulong { [Deprecated (PlatformName.MacCatalyst, 13, 1, message: "Use 'MKLocalSearchCompleterResultType' instead.")] public enum MKSearchCompletionFilterType : long { AndQueries = 0, - Only + Only, } [MacCatalyst (13, 1)] diff --git a/src/MapKit/MKMapItem.cs b/src/MapKit/MKMapItem.cs index 0603f95a981b..ea7c67e0b4f9 100644 --- a/src/MapKit/MKMapItem.cs +++ b/src/MapKit/MKMapItem.cs @@ -19,7 +19,9 @@ namespace MapKit { // it's similar to MKDirectionsTransportType values but it's something only used on the managed side // to replace NSString fields public enum MKDirectionsMode { - Driving, Walking, Transit, + Driving, + Walking, + Transit, #if NET [SupportedOSPlatform ("ios")] [SupportedOSPlatform ("macos")] @@ -28,7 +30,7 @@ public enum MKDirectionsMode { #else [NoTV] #endif - Default + Default, } #if NET diff --git a/src/MediaPlayer/MediaPlayer.cs b/src/MediaPlayer/MediaPlayer.cs index e1cc71585490..37513501d164 100644 --- a/src/MediaPlayer/MediaPlayer.cs +++ b/src/MediaPlayer/MediaPlayer.cs @@ -29,7 +29,7 @@ public enum MPMoviePlaybackState : long { Paused, Interrupted, SeekingForward, - SeekingBackward + SeekingBackward, } // NSInteger -> MPMoviePlayerController.h @@ -56,7 +56,8 @@ public enum MPMovieLoadState : long { [Deprecated (PlatformName.MacCatalyst, 13, 1)] [Native] public enum MPMovieRepeatMode : long { - None, One + None, + One, } // NSInteger -> MPMoviePlayerController.h @@ -68,7 +69,10 @@ public enum MPMovieRepeatMode : long { [Deprecated (PlatformName.MacCatalyst, 13, 1)] [Native] public enum MPMovieControlStyle : long { - None, Embedded, Fullscreen, Default = Embedded + None, + Embedded, + Fullscreen, + Default = Embedded, } // NSInteger -> MPMoviePlayerController.h @@ -80,7 +84,9 @@ public enum MPMovieControlStyle : long { [Deprecated (PlatformName.MacCatalyst, 13, 1)] [Native] public enum MPMovieFinishReason : long { - PlaybackEnded, PlaybackError, UserExited + PlaybackEnded, + PlaybackError, + UserExited, } // NSInteger -> MPMoviePlayerController.h @@ -95,7 +101,7 @@ public enum MPMovieFinishReason : long { public enum MPMovieMediaType : long { None = 0, Video = 1 << 0, - Audio = 1 << 1 + Audio = 1 << 1, } // NSInteger -> MPMoviePlayerController.h @@ -107,7 +113,9 @@ public enum MPMovieMediaType : long { [Deprecated (PlatformName.MacCatalyst, 13, 1)] [Native] public enum MPMovieSourceType : long { - Unknown, File, Streaming + Unknown, + File, + Streaming, } // NSInteger -> MPMoviePlayerController.h @@ -120,7 +128,7 @@ public enum MPMovieSourceType : long { [Native] public enum MPMovieTimeOption : long { NearestKeyFrame, - Exact + Exact, } // NSUInteger -> MPMediaItem.h @@ -148,7 +156,7 @@ public enum MPMediaType : ulong { HomeVideo = 1 << 13, [MacCatalyst (13, 1)] TypeAnyVideo = 0xff00, - Any = 0xFFFFFFFFFFFFFFFF + Any = 0xFFFFFFFFFFFFFFFF, } // NSInteger -> MPMediaPlaylist.h @@ -162,7 +170,7 @@ public enum MPMediaPlaylistAttribute : long { None = 0, OnTheGo = (1 << 0), // if set, the playlist was created on a device rather than synced from iTunes Smart = (1 << 1), - Genius = (1 << 2) + Genius = (1 << 2), }; // NSInteger -> MPMediaQuery.h @@ -179,7 +187,7 @@ public enum MPMediaGrouping : long { Composer, Genre, Playlist, - PodcastTitle + PodcastTitle, } // NSInteger -> MPMediaQuery.h @@ -190,7 +198,7 @@ public enum MPMediaGrouping : long { [Native] public enum MPMediaPredicateComparison : long { EqualsTo, - Contains + Contains, } // NSInteger -> MPMoviePlayerController.h @@ -205,7 +213,7 @@ public enum MPMovieScalingMode : long { None, AspectFit, AspectFill, - Fill + Fill, } // untyped enum -> MPMoviePlayerController.h @@ -214,7 +222,7 @@ public enum MPMovieScalingMode : long { public enum MPMovieControlMode { Default, VolumeOnly, - Hidden + Hidden, } // NSInteger -> /MPMusicPlayerController.h @@ -228,7 +236,7 @@ public enum MPMusicPlaybackState : long { Paused, Interrupted, SeekingForward, - SeekingBackward + SeekingBackward, } // NSInteger -> /MPMusicPlayerController.h @@ -240,7 +248,7 @@ public enum MPMusicRepeatMode : long { Default, None, One, - All + All, } // NSInteger -> /MPMusicPlayerController.h @@ -252,7 +260,7 @@ public enum MPMusicShuffleMode : long { Default, Off, Songs, - Albums + Albums, } public delegate void MPMediaItemEnumerator (string property, NSObject value, ref bool stop); @@ -262,7 +270,7 @@ public enum MPMusicShuffleMode : long { public enum MPShuffleType : long { Off, Items, - Collections + Collections, } [MacCatalyst (13, 1)] @@ -270,7 +278,7 @@ public enum MPShuffleType : long { public enum MPRepeatType : long { Off, One, - All + All, } [MacCatalyst (13, 1)] @@ -278,7 +286,7 @@ public enum MPRepeatType : long { public enum MPChangeLanguageOptionSetting : long { None, NowPlayingItemOnly, - Permanent + Permanent, } // NSInteger -> MPRemoteCommand.h @@ -291,7 +299,7 @@ public enum MPRemoteCommandHandlerStatus : long { NoActionableNowPlayingItem = 110, [MacCatalyst (13, 1)] DeviceNotFound = 120, - CommandFailed = 200 + CommandFailed = 200, } // NSUInteger -> MPRemoteCommandEvent.h @@ -306,7 +314,7 @@ public enum MPSeekCommandEventType : ulong { [Native] public enum MPNowPlayingInfoLanguageOptionType : ulong { Audible, - Legible + Legible, } [MacCatalyst (13, 1)] @@ -332,7 +340,7 @@ public enum MPMediaLibraryAuthorizationStatus : long { NotDetermined = 0, Denied, Restricted, - Authorized + Authorized, } [MacCatalyst (13, 1)] @@ -340,7 +348,7 @@ public enum MPMediaLibraryAuthorizationStatus : long { public enum MPNowPlayingInfoMediaType : ulong { None = 0, Audio, - Video + Video, } [MacCatalyst (13, 1)] diff --git a/src/MessageUI/MessageUI.cs b/src/MessageUI/MessageUI.cs index a15817cce314..36b69e1a4fd0 100644 --- a/src/MessageUI/MessageUI.cs +++ b/src/MessageUI/MessageUI.cs @@ -24,7 +24,7 @@ public enum MFMailComposeResult { Cancelled, Saved, Sent, - Failed + Failed, } /// Details of the composing error. @@ -38,7 +38,7 @@ public enum MFMailComposeErrorCode : long { public enum MFMailComposeErrorCode { #endif SaveFailed, - SendFailed + SendFailed, } #if NET @@ -50,6 +50,8 @@ public enum MessageComposeResult : long { // Note: now used as a NSInteger in the API. public enum MessageComposeResult { #endif - Cancelled, Sent, Failed + Cancelled, + Sent, + Failed, } } diff --git a/src/Metal/MTLEnums.cs b/src/Metal/MTLEnums.cs index b6ae384877e5..e9e5983ed571 100644 --- a/src/Metal/MTLEnums.cs +++ b/src/Metal/MTLEnums.cs @@ -65,7 +65,7 @@ public enum MTLColorWriteMask : ulong { Green = 0x1 << 2, Blue = 0x1 << 1, Alpha = 0x1 << 0, - All = 0xf + All = 0xf, } /// The state of the command-buffer state-machine. Enqueued->Committed->Scheduled->Completed. @@ -76,7 +76,7 @@ public enum MTLCommandBufferStatus : ulong { Committed, Scheduled, Completed, - Error + Error, } /// Enumeration of error codes describing why a command buffer has failed. @@ -99,13 +99,17 @@ public enum MTLCommandBufferError : ulong { /// An action performed at the start of a rendering pass. [Native] public enum MTLLoadAction : ulong { - DontCare, Load, Clear + DontCare, + Load, + Clear, } /// The action to be performed at the end of a rendering pass. [Native] public enum MTLStoreAction : ulong { - DontCare, Store, MultisampleResolve, + DontCare, + Store, + MultisampleResolve, [MacCatalyst (13, 1)] StoreAndMultisampleResolve, [MacCatalyst (13, 1)] @@ -135,7 +139,8 @@ public enum MTLTextureType : ulong { /// Options for calculating the pixel value returned within a mipmap level. [Native] public enum MTLSamplerMinMagFilter : ulong { - Nearest, Linear + Nearest, + Linear, } /// Options for calculating the pixel value returned with multiple mipmap levels. @@ -143,7 +148,7 @@ public enum MTLSamplerMinMagFilter : ulong { public enum MTLSamplerMipFilter : ulong { NotMipmapped, Nearest, - Linear + Linear, } /// The wrapping mode. Used when a fetch falls outside the bounds of a texture. @@ -588,7 +593,9 @@ public enum MTLLibraryError : ulong { [Native] [ErrorDomain ("MTLRenderPipelineErrorDomain")] public enum MTLRenderPipelineError : ulong { - Internal = 1, Unsupported, InvalidInput + Internal = 1, + Unsupported, + InvalidInput, } #endif @@ -602,7 +609,7 @@ public enum MTLCompareFunction : ulong { Greater = 4, NotEqual = 5, GreaterEqual = 6, - Always = 7 + Always = 7, } @@ -616,7 +623,7 @@ public enum MTLStencilOperation : ulong { DecrementClamp = 4, Invert = 5, IncrementWrap = 6, - DecrementWrap = 7 + DecrementWrap = 7, } /// Enumerates the primitive geometry used for drawing commands. @@ -626,13 +633,14 @@ public enum MTLPrimitiveType : ulong { Line = 1, LineStrip = 2, Triangle = 3, - TriangleStrip = 4 + TriangleStrip = 4, } /// The index type for an index buffer. [Native] public enum MTLIndexType : ulong { - UInt16, UInt32 + UInt16, + UInt32, } /// Enumerates values that control how and whether to monitor samples that pass depth and stencil tests. @@ -648,19 +656,21 @@ public enum MTLVisibilityResultMode : ulong { public enum MTLCullMode : ulong { None = 0, Front = 1, - Back = 2 + Back = 2, } /// Vertex winding rule for front-facing primitives. [Native] public enum MTLWinding : ulong { - Clockwise = 0, CounterClockwise = 1 + Clockwise = 0, + CounterClockwise = 1, } /// How to rasterize triangle and triangle-strip primitives. [Native] public enum MTLTriangleFillMode : ulong { - Fill, Lines + Fill, + Lines, } /// The purgeable state of the resource. @@ -669,13 +679,14 @@ public enum MTLPurgeableState : ulong { KeepCurrent = 1, NonVolatile = 2, Volatile = 3, - Empty = 4 + Empty = 4, } /// Enumerates what cache mode is used for CPU mapping of a resource. [Native] public enum MTLCpuCacheMode : ulong { - DefaultCache, WriteCombined + DefaultCache, + WriteCombined, } /// Enumerates the ways in which a may be used. @@ -730,7 +741,9 @@ public enum MTLResourceOptions : ulong { /// The frequency at which the vertex shader function should fetch attribute data. [Native] public enum MTLVertexStepFunction : ulong { - Constant, PerVertex, PerInstance, + Constant, + PerVertex, + PerInstance, [MacCatalyst (13, 1)] PerPatch = 3, [MacCatalyst (13, 1)] @@ -929,7 +942,9 @@ public enum MTLArgumentType : ulong { [Deprecated (PlatformName.MacCatalyst, 17, 0)] [Native] public enum MTLArgumentAccess : ulong { - ReadOnly, ReadWrite, WriteOnly + ReadOnly, + ReadWrite, + WriteOnly, } #endif @@ -1093,7 +1108,7 @@ public enum MTLLanguageVersion : ulong { [Native] public enum MTLDepthClipMode : ulong { Clip = 0, - Clamp = 1 + Clamp = 1, } /// Enumerates blitting options. @@ -1106,7 +1121,7 @@ public enum MTLBlitOption : ulong { StencilFromDepthStencil = 1 << 1, [NoMac] [MacCatalyst (13, 1)] - RowLinearPvrtc = 1 << 2 + RowLinearPvrtc = 1 << 2, } /// Enumerates CPU cache modes for resource mapping. @@ -1127,7 +1142,9 @@ public enum MTLStorageMode : ulong { /// Enumerates MSAA dept resolve filter operations. [Native] public enum MTLMultisampleDepthResolveFilter : ulong { - Sample0, Min, Max + Sample0, + Min, + Max, } [TV (16, 0)] @@ -1137,7 +1154,7 @@ public enum MTLMultisampleDepthResolveFilter : ulong { public enum MTLSamplerBorderColor : ulong { TransparentBlack = 0, OpaqueBlack = 1, - OpaqueWhite = 2 + OpaqueWhite = 2, } [TV (13, 0)] @@ -1147,7 +1164,7 @@ public enum MTLPrimitiveTopologyClass : ulong { Unspecified = 0, Point = 1, Line = 2, - Triangle = 3 + Triangle = 3, } [MacCatalyst (13, 1)] @@ -1156,13 +1173,13 @@ public enum MTLTessellationPartitionMode : ulong { Pow2 = 0, Integer = 1, FractionalOdd = 2, - FractionalEven = 3 + FractionalEven = 3, } [MacCatalyst (13, 1)] [Native] public enum MTLTessellationFactorFormat : ulong { - Half = 0 + Half = 0, } [MacCatalyst (13, 1)] @@ -1170,7 +1187,7 @@ public enum MTLTessellationFactorFormat : ulong { public enum MTLTessellationControlPointIndexType : ulong { None = 0, UInt16 = 1, - UInt32 = 2 + UInt32 = 2, } [MacCatalyst (13, 1)] @@ -1179,7 +1196,7 @@ public enum MTLTessellationFactorStepFunction : ulong { Constant = 0, PerPatch = 1, PerInstance = 2, - PerPatchAndPerInstance = 3 + PerPatchAndPerInstance = 3, } [MacCatalyst (13, 1)] @@ -1187,7 +1204,7 @@ public enum MTLTessellationFactorStepFunction : ulong { public enum MTLPatchType : ulong { None = 0, Triangle = 1, - Quad = 2 + Quad = 2, } /// Enumerates formats for function attributes. @@ -1273,7 +1290,7 @@ public enum MTLStepFunction : ulong { ThreadPositionInGridX = 5, ThreadPositionInGridY = 6, ThreadPositionInGridXIndexed = 7, - ThreadPositionInGridYIndexed = 8 + ThreadPositionInGridYIndexed = 8, } [MacCatalyst (13, 1)] diff --git a/src/ModelIO/MIEnums.cs b/src/ModelIO/MIEnums.cs index 9e83fdb9c46f..6a1a456a7b62 100644 --- a/src/ModelIO/MIEnums.cs +++ b/src/ModelIO/MIEnums.cs @@ -158,7 +158,7 @@ public enum MDLMaterialSemantic : ulong { AmbientOcclusion, AmbientOcclusionScale, None = 0x8000, - UserDefined = 0x8001 + UserDefined = 0x8001, } /// Enumerates material property types. @@ -181,21 +181,23 @@ public enum MDLMaterialPropertyType : ulong { /// Enumerates procedures for handling texture coordinates outside of the range [0.0,1.0]. [Native] public enum MDLMaterialTextureWrapMode : ulong { - Clamp, Repeat, Mirror + Clamp, + Repeat, + Mirror, } /// Enumerates values that control how to sample between texels. [Native] public enum MDLMaterialTextureFilterMode : ulong { Nearest, - Linear + Linear, } /// Enumerates values that control texture sampling between mipmap levels. [Native] public enum MDLMaterialMipMapFilterMode : ulong { Nearest, - Linear + Linear, } /// Enumerates values that specify data types and sizes for texel channels. @@ -207,7 +209,7 @@ public enum MDLTextureChannelEncoding : long { UInt32 = 4, Float16 = 258, Float16SR = 770, - Float32 = 260 + Float32 = 260, } /// Enumerates the types of . @@ -224,7 +226,7 @@ public enum MDLLightType : ulong { SuperElliptical, Photometric, Probe, - Environment + Environment, } /// Enumerates camera projections. diff --git a/src/PassKit/PKEnums.cs b/src/PassKit/PKEnums.cs index 88fe94715b1d..cef26d1781ca 100644 --- a/src/PassKit/PKEnums.cs +++ b/src/PassKit/PKEnums.cs @@ -31,7 +31,7 @@ public enum PKPassKitErrorCode : long { InvalidData = 1, UnsupportedVersion, InvalidSignature, - NotEntitled + NotEntitled, } // NSInteger -> PKPassLibrary.h @@ -41,7 +41,7 @@ public enum PKPassKitErrorCode : long { public enum PKPassLibraryAddPassesStatus : long { DidAddPasses, ShouldReviewPasses, - DidCancelAddPasses + DidCancelAddPasses, } /// Enumeration of pass types (whether a pass is a barcode or presents a payment card). @@ -88,7 +88,7 @@ public enum PKPaymentAuthorizationStatus : long { [MacCatalyst (13, 1)] PinIncorrect, [MacCatalyst (13, 1)] - PinLockout + PinLockout, } /// Enumeration of valid states of a payment card. @@ -98,7 +98,11 @@ public enum PKPaymentAuthorizationStatus : long { [Deprecated (PlatformName.MacCatalyst, 13, 1, message: "Use 'PKSecureElementPassActivationState' instead.")] [Native] public enum PKPaymentPassActivationState : ulong { - Activated, RequiresActivation, Activating, Suspended, Deactivated + Activated, + RequiresActivation, + Activating, + Suspended, + Deactivated, } [iOS (13, 4)] @@ -138,7 +142,7 @@ public enum PKAddressField : ulong { Email = 1 << 2, [MacCatalyst (13, 1)] Name = 1 << 3, - All = PostalAddress | Phone | Email | Name + All = PostalAddress | Phone | Email | Name, } /// Enumerates available styles for objects. @@ -229,7 +233,7 @@ public enum PKShippingType : ulong { public enum PKAddPaymentPassError : long { Unsupported, UserCancelled, - SystemCancelled + SystemCancelled, } /// Enumerates results that are used in calls to . @@ -241,7 +245,7 @@ public enum PKAutomaticPassPresentationSuppressionResult : ulong { AlreadyPresenting, Denied, Cancelled, - Success + Success, } /// Enumerates the types of cards available to Apple Pay. @@ -261,7 +265,7 @@ public enum PKPaymentMethodType : ulong { [Native] public enum PKPaymentSummaryItemType : ulong { Final, - Pending + Pending, } /// Enumerates Pass Button styles. @@ -270,7 +274,7 @@ public enum PKPaymentSummaryItemType : ulong { [Native] public enum PKAddPassButtonStyle : long { Black = 0, - Outline + Outline, } /// Enumerates error conditions for payment operations. diff --git a/src/SceneKit/Defs.cs b/src/SceneKit/Defs.cs index 3fd1d786e7d2..8f1d6da893bf 100644 --- a/src/SceneKit/Defs.cs +++ b/src/SceneKit/Defs.cs @@ -33,7 +33,7 @@ public enum SCNGeometryPrimitiveType : long { Line, Point, [MacCatalyst (13, 1)] - Polygon + Polygon, } /// Enumerates techniques for calculating transparency. @@ -57,7 +57,8 @@ public enum SCNTransparencyMode : long { [MacCatalyst (13, 1)] [Native] public enum SCNCullMode : long { - Back, Front + Back, + Front, } /// Enumeration of texture filtering modes. @@ -66,7 +67,7 @@ public enum SCNCullMode : long { public enum SCNFilterMode : long { None, Nearest, - Linear + Linear, } /// Enumerates texture-wrapping techniques. @@ -77,7 +78,7 @@ public enum SCNWrapMode : long { Repeat, // added in iOS 8, removed in 8.3 (mistake?) but added back in 9.0 betas ClampToBorder, - Mirror + Mirror, } /// Enumerates the states of an SCNSceneSource. @@ -88,7 +89,7 @@ public enum SCNSceneSourceStatus : long { Parsing = 4, Validating = 8, Processing = 12, - Complete = 16 + Complete = 16, } /// Enumerates the ways a can be chamfered; on its front, back, or both sides. @@ -97,7 +98,7 @@ public enum SCNSceneSourceStatus : long { public enum SCNChamferMode : long { Both, Front, - Back + Back, } /// Enumeration of valid interpolation formulae for . @@ -105,7 +106,7 @@ public enum SCNChamferMode : long { [Native] public enum SCNMorpherCalculationMode : long { Normalized, - Additive + Additive, } /// Enumerates rate curves for use with objects. @@ -115,7 +116,7 @@ public enum SCNActionTimingMode : long { Linear, EaseIn, EaseOut, - EaseInEaseOut + EaseInEaseOut, } /// Enumeration controlling when shadows are calculated. @@ -124,7 +125,7 @@ public enum SCNActionTimingMode : long { public enum SCNShadowMode : long { Forward, Deferred, - Modulated + Modulated, } /// An enumeration specifying whether the is dynamic, kinematic, or static. Used with . @@ -133,7 +134,7 @@ public enum SCNShadowMode : long { public enum SCNPhysicsBodyType : long { Static, Dynamic, - Kinematic + Kinematic, } /// Enumerates values specifying whether an affects objects inside or outside its border. @@ -141,7 +142,7 @@ public enum SCNPhysicsBodyType : long { [Native] public enum SCNPhysicsFieldScope : long { InsideExtent, - OutsideExtent + OutsideExtent, } /// Enumeration specifying the order in which particles emitted by a T:SceneKit.SCNParticleScene are rendered. @@ -155,7 +156,7 @@ public enum SCNParticleSortingMode : long { ProjectedDepth, Distance, OldestFirst, - YoungestFirst + YoungestFirst, } /// Enumeration of the ways in which overlapping particles emitted by a will be rendered. @@ -167,7 +168,7 @@ public enum SCNParticleBlendMode : long { Multiply, Screen, Alpha, - Replace + Replace, } /// Enumerates the alignment of particles emitted by a . Used with . @@ -177,7 +178,7 @@ public enum SCNParticleOrientationMode : long { BillboardScreenAligned, BillboardViewAligned, Free, - BillboardYAligned + BillboardYAligned, } /// Enumeration of the initial location of particles emitted by a . @@ -186,7 +187,7 @@ public enum SCNParticleOrientationMode : long { public enum SCNParticleBirthLocation : long { Surface, Volume, - Vertex + Vertex, } /// Enumerates the initial direction of particles emitted by a . @@ -195,7 +196,7 @@ public enum SCNParticleBirthLocation : long { public enum SCNParticleBirthDirection : long { Constant, SurfaceNormal, - Random + Random, } /// Enumeration of playing modes for 's whose particles are rendered as a sequence of images. @@ -204,7 +205,7 @@ public enum SCNParticleBirthDirection : long { public enum SCNParticleImageSequenceAnimationMode : long { Repeat, Clamp, - AutoReverse + AutoReverse, } /// Enumerates how a particle property is animated (over the lifetime of the particle, as the particle travels over a distance, or based on another property). Used with . @@ -213,7 +214,7 @@ public enum SCNParticleImageSequenceAnimationMode : long { public enum SCNParticleInputMode : long { OverLife, OverDistance, - OverOtherProperty + OverOtherProperty, } /// Enumerates moments when the modifier specified in should be applied. @@ -223,7 +224,7 @@ public enum SCNParticleModifierStage : long { PreDynamics, PostDynamics, PreCollision, - PostCollision + PostCollision, } /// Enumeration of lifecycle events for particles emitted by a . Used with . @@ -232,7 +233,7 @@ public enum SCNParticleModifierStage : long { public enum SCNParticleEvent : long { Birth, Death, - Collision + Collision, } // Utility enum @@ -245,7 +246,7 @@ public enum SCNGeometrySourceSemantics { VertexCrease, EdgeCrease, BoneWeights, - BoneIndices + BoneIndices, } // Utility enum @@ -255,14 +256,16 @@ public enum SCNAnimationImportPolicy { Play, PlayRepeatedly, DoNotPlay, - PlayUsingSceneTimeBase + PlayUsingSceneTimeBase, } // Utility enum /// Enumerates values that control which physics search results are returned. public enum SCNPhysicsSearchMode { Unknown = -1, - Any, Closest, All, + Any, + Closest, + All, } /// Enumerates values that control antialiasing behavior. @@ -289,7 +292,7 @@ public enum SCNPhysicsCollisionCategory : ulong { None = 0, Default = 1 << 0, Static = 1 << 1, - All = UInt64.MaxValue + All = UInt64.MaxValue, } /// Enumeration of axes' locks available to nodes constrained by . @@ -299,7 +302,7 @@ public enum SCNBillboardAxis : ulong { X = 1 << 0, Y = 1 << 1, Z = 1 << 2, - All = (X | Y | Z) + All = (X | Y | Z), } /// Enumerates possible loading policies for objects. @@ -307,7 +310,7 @@ public enum SCNBillboardAxis : ulong { [Native] public enum SCNReferenceLoadingPolicy : long { Immediate = 0, - OnDemand = 1 + OnDemand = 1, } /// Enumeration of the ways SceneKit can blend colors from a material with colors that already exist in the render target. @@ -363,7 +366,7 @@ public enum SCNRenderingApi : ulong { [NoiOS][NoTV][NoMacCatalyst] OpenGLCore32, [NoiOS][NoTV][NoMacCatalyst] - OpenGLCore41 + OpenGLCore41, #endif } @@ -381,7 +384,7 @@ public enum SCNBufferFrequency : long { [Native] public enum SCNMovabilityHint : long { Fixed, - Movable + Movable, } [MacCatalyst (13, 1)] diff --git a/src/SearchKit/SearchKit.cs b/src/SearchKit/SearchKit.cs index c1ea053587fe..50465dcddd30 100644 --- a/src/SearchKit/SearchKit.cs +++ b/src/SearchKit/SearchKit.cs @@ -35,7 +35,10 @@ namespace SearchKit { public enum SKIndexType { - Unknown, Inverted, Vector, InvertedVector + Unknown, + Inverted, + Vector, + InvertedVector, }; [Flags] @@ -43,7 +46,7 @@ public enum SKSearchOptions { Default = 0, NoRelevanceScores = 1 << 0, SpaceMeansOr = 1 << 1, - FindSimilar = 1 << 2 + FindSimilar = 1 << 2, } #if NET diff --git a/src/Security/Items.cs b/src/Security/Items.cs index f4cdc6c194eb..6f49c0e74dfb 100644 --- a/src/Security/Items.cs +++ b/src/Security/Items.cs @@ -55,7 +55,7 @@ public enum SecKind { GenericPassword, Certificate, Key, - Identity + Identity, } // manually mapped to KeysAccessible @@ -89,14 +89,42 @@ public enum SecAccessible { [Deprecated (PlatformName.iOS, 12, 0, message: "Use 'AfterFirstUnlockThisDeviceOnly' or a better suited option instead.")] #endif AlwaysThisDeviceOnly, - WhenPasscodeSetThisDeviceOnly + WhenPasscodeSetThisDeviceOnly, } public enum SecProtocol { Invalid = -1, - Ftp, FtpAccount, Http, Irc, Nntp, Pop3, Smtp, Socks, Imap, Ldap, AppleTalk, Afp, Telnet, Ssh, - Ftps, Https, HttpProxy, HttpsProxy, FtpProxy, Smb, Rtsp, RtspProxy, Daap, Eppc, Ipp, - Nntps, Ldaps, Telnets, Imaps, Ircs, Pop3s, + Ftp, + FtpAccount, + Http, + Irc, + Nntp, + Pop3, + Smtp, + Socks, + Imap, + Ldap, + AppleTalk, + Afp, + Telnet, + Ssh, + Ftps, + Https, + HttpProxy, + HttpsProxy, + FtpProxy, + Smb, + Rtsp, + RtspProxy, + Daap, + Eppc, + Ipp, + Nntps, + Ldaps, + Telnets, + Imaps, + Ircs, + Pop3s, } public enum SecAuthenticationType { diff --git a/src/Security/SecureTransport.cs b/src/Security/SecureTransport.cs index a3247e46c4c3..01ce6e936ae2 100644 --- a/src/Security/SecureTransport.cs +++ b/src/Security/SecureTransport.cs @@ -97,7 +97,7 @@ public enum TlsCipherSuiteGroup : ushort { Compatibility, Legacy, Ats, - AtsCompatibility + AtsCompatibility, } // subset of OSStatus (int) @@ -226,7 +226,7 @@ public enum SslSessionOption { public enum SslAuthenticate { Never, Always, - Try + Try, } // Security.framework/Headers/SecureTransport.h @@ -250,7 +250,7 @@ public enum SslProtocolSide { [Deprecated (PlatformName.MacCatalyst, 13, 1, message: Constants.UseNetworkInstead)] public enum SslConnectionType { Stream, - Datagram + Datagram, } // Security.framework/Headers/SecureTransport.h @@ -266,7 +266,7 @@ public enum SslSessionState { Handshake, Connected, Closed, - Aborted + Aborted, } // Security.framework/Headers/SecureTransport.h @@ -278,7 +278,7 @@ public enum SslSessionState { public enum SslSessionStrengthPolicy { Default, ATSv1, - ATSv1NoPFS + ATSv1NoPFS, } // Security.framework/Headers/SecureTransport.h @@ -292,7 +292,7 @@ public enum SslClientCertificateState { None, Requested, Sent, - Rejected + Rejected, } #if !NET @@ -471,6 +471,10 @@ public enum SslCipherSuite : ushort { [Deprecated (PlatformName.MacCatalyst, 13, 1, message: "Use 'TlsCipherSuiteGroup' instead.")] // typedef CF_ENUM(int, SSLCiphersuiteGroup) public enum SslCipherSuiteGroup { - Default, Compatibility, Legacy, Ats, AtsCompatibility, + Default, + Compatibility, + Legacy, + Ats, + AtsCompatibility, } } diff --git a/src/Social/Enums.cs b/src/Social/Enums.cs index d763f9f7acdc..3e80171b08c9 100644 --- a/src/Social/Enums.cs +++ b/src/Social/Enums.cs @@ -16,7 +16,10 @@ namespace Social { /// The HTTP verb associated with a social service request. [Native] public enum SLRequestMethod : long { - Get, Post, Delete, Put + Get, + Post, + Delete, + Put, } // NSInteger -> SLComposeViewController.h @@ -27,7 +30,8 @@ public enum SLRequestMethod : long { #endif [Native] public enum SLComposeViewControllerResult : long { - Cancelled, Done + Cancelled, + Done, } // note: those are NSString in iOS/OSX that we expose as an enum (i.e. it's NOT a native enum) @@ -40,7 +44,7 @@ public enum SLServiceKind { SinaWeibo, TencentWeibo, #if MONOMAC - LinkedIn + LinkedIn, #endif } } diff --git a/src/StoreKit/Enums.cs b/src/StoreKit/Enums.cs index 4daec6faf9eb..1b9f9aded092 100644 --- a/src/StoreKit/Enums.cs +++ b/src/StoreKit/Enums.cs @@ -19,7 +19,7 @@ public enum SKPaymentTransactionState : long { Failed, Restored, [MacCatalyst (13, 1)] - Deferred + Deferred, } // untyped enum and not used in API - so it _could_ be an `int` @@ -68,7 +68,12 @@ public enum SKError : long { [MacCatalyst (13, 1)] [Native] public enum SKDownloadState : long { - Waiting, Active, Paused, Finished, Failed, Cancelled + Waiting, + Active, + Paused, + Finished, + Failed, + Cancelled, } /// Enumerates authorization states for music store access. @@ -82,7 +87,7 @@ public enum SKCloudServiceAuthorizationStatus : long { NotDetermined, Denied, Restricted, - Authorized + Authorized, } /// Enumerates flags that describe the user's local music library capabilities.. diff --git a/src/Twitter/Enums.cs b/src/Twitter/Enums.cs index cae9606099b1..926de4ed96e8 100644 --- a/src/Twitter/Enums.cs +++ b/src/Twitter/Enums.cs @@ -17,7 +17,8 @@ namespace Twitter { // SLComposeViewControllerResult, which is a NSInteger -> SLComposeViewController.h, but a // sizeof(TWTweetComposeViewControllerResultDone) shows it's 4 bytes (on a 64 bits process) public enum TWTweetComposeViewControllerResult { - Cancelled, Done + Cancelled, + Done, } // untyped enum -> TWRequest.h where the values are equals to those of SLRequestMethod, @@ -28,6 +29,8 @@ public enum TWTweetComposeViewControllerResult { // which likely means it's internally used as a `SLRequestMethod` [Native] public enum TWRequestMethod : long { - Get, Post, Delete + Get, + Post, + Delete, } } diff --git a/src/UIKit/UIEnums.cs b/src/UIKit/UIEnums.cs index be7acfd0ada8..e5a727f5acd6 100644 --- a/src/UIKit/UIEnums.cs +++ b/src/UIKit/UIEnums.cs @@ -24,7 +24,7 @@ public enum UIImagePickerControllerQualityType : long { Low, At640x480, At1280x720, - At960x540 + At960x540, } // NSInteger -> UIActivityIndicatorView.h @@ -66,7 +66,7 @@ public enum UIAlertViewStyle : long { Default, SecureTextInput, PlainTextInput, - LoginAndPasswordInput + LoginAndPasswordInput, } // NSInteger -> UIBarButtonItem.h @@ -151,7 +151,7 @@ public enum UIControlEvent : ulong { AllEditingEvents = 0x000F0000, ApplicationReserved = 0x0F000000, SystemReserved = 0xF0000000, - AllEvents = 0xFFFFFFFF + AllEvents = 0xFFFFFFFF, } // NSInteger -> UIEvent.h @@ -212,7 +212,7 @@ public enum UIControlContentHorizontalAlignment : long { Right = 2, Fill = 3, Leading = 4, - Trailing = 5 + Trailing = 5, } // NSUInteger -> UIControl.h @@ -227,7 +227,7 @@ public enum UIControlState : ulong { [MacCatalyst (13, 1)] Focused = 1 << 3, Application = 0x00FF0000, - Reserved = 0xFF000000 + Reserved = 0xFF000000, } // NSInteger -> UIImage.h @@ -257,7 +257,7 @@ public enum UIViewAutoresizing : ulong { FlexibleBottomMargin = 1 << 5, FlexibleMargins = FlexibleBottomMargin | FlexibleTopMargin | FlexibleLeftMargin | FlexibleRightMargin, FlexibleDimensions = FlexibleHeight | FlexibleWidth, - All = 63 + All = 63, } // NSInteger -> UIView.h @@ -267,7 +267,7 @@ public enum UIViewAnimationCurve : long { EaseInOut, EaseIn, EaseOut, - Linear + Linear, } // NSInteger -> UIView.h @@ -317,7 +317,7 @@ public enum UIBarMetrics : long { [Deprecated (PlatformName.iOS, 8, 0, message: "Use 'UIBarMetrics.CompactPrompt' instead.")] [Deprecated (PlatformName.TvOS, 9, 0, message: "Use 'UIBarMetrics.CompactPrompt' instead.")] [Deprecated (PlatformName.MacCatalyst, 13, 1, message: "Use 'UIBarMetrics.CompactPrompt' instead.")] - LandscapePhonePrompt = CompactPrompt + LandscapePhonePrompt = CompactPrompt, } // NSInteger -> UIButton.h @@ -388,7 +388,7 @@ public enum UIDeviceOrientation : long { LandscapeLeft, LandscapeRight, FaceUp, - FaceDown + FaceDown, } // NSInteger -> UIDevice.h @@ -412,7 +412,10 @@ public enum UIDeviceBatteryState : long { [NoTV] [MacCatalyst (13, 1)] public enum UIDocumentChangeKind : long { - Done, Undone, Redone, Cleared + Done, + Undone, + Redone, + Cleared, } // NSInteger -> UIDocument.h @@ -424,7 +427,8 @@ public enum UIDocumentChangeKind : long { [NoTV] [MacCatalyst (13, 1)] public enum UIDocumentSaveOperation : long { - ForCreating, ForOverwriting + ForCreating, + ForOverwriting, } // NSUInteger -> UIDocument.h @@ -439,7 +443,7 @@ public enum UIDocumentState : ulong { InConflict = 1 << 1, SavingError = 1 << 2, EditingDisabled = 1 << 3, - ProgressAvailable = 1 << 4 + ProgressAvailable = 1 << 4, } // NSInteger -> UIImagePickerController.h @@ -466,7 +470,8 @@ public enum UIImagePickerControllerSourceType : long { [NoTV] [MacCatalyst (13, 1)] public enum UIImagePickerControllerCameraCaptureMode : long { - Photo, Video + Photo, + Video, } // NSInteger -> UIImagePickerController.h @@ -477,7 +482,7 @@ public enum UIImagePickerControllerCameraCaptureMode : long { [MacCatalyst (13, 1)] public enum UIImagePickerControllerCameraDevice : long { Rear, - Front + Front, } // NSInteger -> UIImagePickerController.h @@ -487,7 +492,9 @@ public enum UIImagePickerControllerCameraDevice : long { [NoTV] [MacCatalyst (13, 1)] public enum UIImagePickerControllerCameraFlashMode : long { - Off = -1, Auto = 0, On = 1 + Off = -1, + Auto = 0, + On = 1, } // NSInteger -> UIInterface.h @@ -529,7 +536,7 @@ public enum UIProgressViewStyle : long { public enum UIScrollViewIndicatorStyle : long { Default, Black, - White + White, } // NSInteger -> UITextInputTraits.h @@ -568,7 +575,7 @@ public enum UIKeyboardType : long { Twitter, WebSearch, [MacCatalyst (13, 1)] - AsciiCapableNumberPad + AsciiCapableNumberPad, } // NSInteger -> UISegmentedControl.h @@ -582,7 +589,7 @@ public enum UISegmentedControlStyle : long { Plain, Bordered, Bar, - Bezeled + Bezeled, } // NSInteger -> UITabBarItem.h @@ -621,7 +628,7 @@ public enum UITableViewScrollPosition : long { None, Top, Middle, - Bottom + Bottom, } // NSInteger -> UITableView.h @@ -635,7 +642,7 @@ public enum UITableViewRowAnimation : long { Bottom, None, Middle, - Automatic = 100 + Automatic = 100, } // #defines over UIBarPosition -> NSInteger -> UIBarCommon.h @@ -644,7 +651,9 @@ public enum UITableViewRowAnimation : long { [NoTV] [MacCatalyst (13, 1)] public enum UIToolbarPosition : long { - Any, Bottom, Top + Any, + Bottom, + Top, } // NSInteger -> UITouch.h @@ -709,7 +718,7 @@ public enum UITextAlignment : long { Right, Justified, - Natural + Natural, } // NSInteger -> UITableViewCell.h @@ -719,7 +728,7 @@ public enum UITableViewCellStyle : long { Default, Value1, Value2, - Subtitle + Subtitle, } // NSInteger -> UITableViewCell.h @@ -734,7 +743,7 @@ public enum UITableViewCellSeparatorStyle : long { [Deprecated (PlatformName.iOS, 11, 0, message: "Use 'SingleLine' for a single line separator.")] [Deprecated (PlatformName.MacCatalyst, 13, 1, message: "Use 'SingleLine' for a single line separator.")] SingleLineEtched, - DoubleLineEtched = SingleLineEtched + DoubleLineEtched = SingleLineEtched, } // NSInteger -> UITableViewCell.h @@ -744,7 +753,7 @@ public enum UITableViewCellSelectionStyle : long { None, Blue, Gray, - Default + Default, } // NSInteger -> UITableViewCell.h @@ -753,7 +762,7 @@ public enum UITableViewCellSelectionStyle : long { public enum UITableViewCellEditingStyle : long { None, Delete, - Insert + Insert, } // NSInteger -> UITableViewCell.h @@ -768,7 +777,7 @@ public enum UITableViewCellAccessory : long { Checkmark, [NoTV] [MacCatalyst (13, 1)] - DetailButton + DetailButton, } // NSUInteger -> UITableViewCell.h @@ -778,7 +787,7 @@ public enum UITableViewCellAccessory : long { public enum UITableViewCellState : ulong { DefaultMask = 0, ShowingEditControlMask = 1 << 0, - ShowingDeleteConfirmationMask = 1 << 1 + ShowingDeleteConfirmationMask = 1 << 1, } // NSInteger -> UITextField.h @@ -788,7 +797,7 @@ public enum UITextBorderStyle : long { None, Line, Bezel, - RoundedRect + RoundedRect, } // NSInteger -> UITextField.h @@ -798,7 +807,7 @@ public enum UITextFieldViewMode : long { Never, WhileEditing, UnlessEditing, - Always + Always, } // NSInteger -> UIViewController.h @@ -812,7 +821,7 @@ public enum UIModalTransitionStyle : long { CrossDissolve, [NoTV] [MacCatalyst (13, 1)] - PartialCurl + PartialCurl, } // NSInteger -> UIApplication.h @@ -829,7 +838,7 @@ public enum UIInterfaceOrientation : long { Portrait = UIDeviceOrientation.Portrait, PortraitUpsideDown = UIDeviceOrientation.PortraitUpsideDown, LandscapeLeft = UIDeviceOrientation.LandscapeRight, - LandscapeRight = UIDeviceOrientation.LandscapeLeft + LandscapeRight = UIDeviceOrientation.LandscapeLeft, } // NSUInteger -> UIApplication.h @@ -863,7 +872,7 @@ public enum UIWebViewNavigationType : long { BackForward, Reload, FormResubmitted, - Other + Other, } // NSUInteger -> UIApplication.h @@ -891,7 +900,7 @@ public enum UIDataDetectorType : ulong { PhysicalValue = 1uL << 8, None = 0, - All = UInt64.MaxValue + All = UInt64.MaxValue, } // NSInteger -> UIActionSheet.h @@ -949,7 +958,7 @@ public enum UIStatusBarStyle : long { public enum UIStatusBarAnimation : long { None, Fade, - Slide + Slide, } // NSInteger -> UIGestureRecognizer.h @@ -963,7 +972,7 @@ public enum UIGestureRecognizerState : long { Cancelled, Failed, - Recognized = Ended + Recognized = Ended, } // NSUInteger -> UIApplication.h @@ -977,7 +986,7 @@ public enum UIRemoteNotificationType : ulong { Badge = 1 << 0, Sound = 1 << 1, Alert = 1 << 2, - NewsstandContentAvailability = 1 << 3 + NewsstandContentAvailability = 1 << 3, } // NSInteger -> UITextInputTraits.h @@ -987,7 +996,7 @@ public enum UIKeyboardAppearance : long { Default, Alert, Dark = Alert, - Light + Light, } // NSInteger -> UITextInputTraits.h @@ -1005,7 +1014,7 @@ public enum UIReturnKeyType : long { Yahoo, Done, EmergencyCall, - Continue + Continue, } // NSInteger -> UIViewController.h @@ -1057,7 +1066,7 @@ public enum UIPopoverArrowDirection : ulong { Left = 1 << 2, Right = 1 << 3, Any = Up | Down | Left | Right, - Unknown = UInt64.MaxValue + Unknown = UInt64.MaxValue, }; // NSInteger -> UIMenuController.h @@ -1081,14 +1090,15 @@ public enum UIRectCorner : ulong { TopRight = 1 << 1, BottomLeft = 1 << 2, BottomRight = 1 << 3, - AllCorners = ~(ulong) 0 + AllCorners = ~(ulong) 0, } // NSInteger -> UIApplication.h [Native] [MacCatalyst (13, 1)] public enum UIUserInterfaceLayoutDirection : long { - LeftToRight, RightToLeft + LeftToRight, + RightToLeft, } // NSInteger -> UIDevice.h @@ -1113,7 +1123,7 @@ public enum UIUserInterfaceIdiom : long { public enum UIApplicationState : long { Active, Inactive, - Background + Background, } // NSInteger -> UIView.h @@ -1197,7 +1207,7 @@ public enum UIPrintInfoOutputType : long { General, Photo, Grayscale, - PhotoGrayscale + PhotoGrayscale, } // NSInteger -> UIAccessibility.h @@ -1209,24 +1219,29 @@ public enum UIAccessibilityScrollDirection : long { Up, Down, Next, - Previous + Previous, } // NSInteger -> UIScreen.h [Native] [MacCatalyst (13, 1)] public enum UIScreenOverscanCompensation : long { - Scale, InsetBounds, + Scale, + InsetBounds, None, [Obsolete ("Use 'UIScreenOverscanCompensation.None' instead.")] - InsetApplicationFrame = None + InsetApplicationFrame = None, } // NSInteger -> UISegmentedControl.h [Native] [MacCatalyst (13, 1)] public enum UISegmentedControlSegment : long { - Any, Left, Center, Right, Alone + Any, + Left, + Center, + Right, + Alone, } // NSInteger -> UISearchBar.h @@ -1242,49 +1257,58 @@ public enum UISearchBarIcon : long { Bookmark, [NoTV] [MacCatalyst (13, 1)] - ResultsList + ResultsList, } // NSInteger -> UIPageViewController.h [Native] [MacCatalyst (13, 1)] public enum UIPageViewControllerNavigationOrientation : long { - Horizontal, Vertical + Horizontal, + Vertical, } // NSInteger -> UIPageViewController.h [Native] [MacCatalyst (13, 1)] public enum UIPageViewControllerSpineLocation : long { - None, Min, Mid, Max + None, + Min, + Mid, + Max, } // NSInteger -> UIPageViewController.h [Native] [MacCatalyst (13, 1)] public enum UIPageViewControllerNavigationDirection : long { - Forward, Reverse + Forward, + Reverse, } // NSInteger -> UIPageViewController.h [Native] [MacCatalyst (13, 1)] public enum UIPageViewControllerTransitionStyle : long { - PageCurl, Scroll + PageCurl, + Scroll, } // NSInteger -> UITextInputTraits.h [Native] [MacCatalyst (13, 1)] public enum UITextSpellCheckingType : long { - Default, No, Yes, + Default, + No, + Yes, } // NSInteger -> UITextInput.h [Native] [MacCatalyst (13, 1)] public enum UITextStorageDirection : long { - Forward, Backward + Forward, + Backward, } // NSInteger -> UITextInput.h @@ -1294,7 +1318,7 @@ public enum UITextLayoutDirection : long { Right = 2, Left, Up, - Down + Down, } // Sum of UITextStorageDirection and UITextLayoutDirection @@ -1302,7 +1326,12 @@ public enum UITextLayoutDirection : long { [Native] [MacCatalyst (13, 1)] public enum UITextDirection : long { - Forward, Backward, Right, Left, Up, Down + Forward, + Backward, + Right, + Left, + Up, + Down, } #if !NET @@ -1326,7 +1355,7 @@ public enum UITextGranularity : long { Sentence, Paragraph, Line, - Document + Document, } // float (and not even a CGFloat) -> NSLayoutConstraint.h @@ -1353,7 +1382,11 @@ public enum UILayoutPriority { [Native] [MacCatalyst (13, 1)] public enum UICollectionUpdateAction : long { - Insert, Delete, Reload, Move, None + Insert, + Delete, + Reload, + Move, + None, } // NSUInteger -> UICollectionView.h @@ -1367,21 +1400,23 @@ public enum UICollectionViewScrollPosition : ulong { Bottom = 1 << 2, Left = 1 << 3, CenteredHorizontally = 1 << 4, - Right = 1 << 5 + Right = 1 << 5, } // NSInteger -> UICollectionViewFlowLayout.h [Native] [MacCatalyst (13, 1)] public enum UICollectionViewScrollDirection : long { - Vertical, Horizontal + Vertical, + Horizontal, } // NSInteger -> UICollectionViewFlowLayout.h [Native] [MacCatalyst (13, 1)] public enum UILayoutConstraintAxis : long { - Horizontal, Vertical + Horizontal, + Vertical, } // NSInteger -> UIImage.h @@ -1391,21 +1426,24 @@ public enum UILayoutConstraintAxis : long { [Native] #endif public enum UIImageResizingMode : long { - Tile, Stretch + Tile, + Stretch, } // NSUInteger -> UICollectionViewLayout.h [Native] [MacCatalyst (13, 1)] public enum UICollectionElementCategory : ulong { - Cell, SupplementaryView, DecorationView + Cell, + SupplementaryView, + DecorationView, } // that's a convenience enum that maps to UICollectionElementKindSection[Footer|Header] which are NSString [MacCatalyst (13, 1)] public enum UICollectionElementKindSection { Header, - Footer + Footer, } // uint64_t -> UIAccessibilityConstants.h @@ -1438,7 +1476,7 @@ public enum UIAccessibilityTrait : long { public enum UIImageRenderingMode : long { Automatic, AlwaysOriginal, - AlwaysTemplate + AlwaysTemplate, } // NSInteger -> UIMotionEffect.h @@ -1446,14 +1484,16 @@ public enum UIImageRenderingMode : long { [MacCatalyst (13, 1)] public enum UIInterpolatingMotionEffectType : long { TiltAlongHorizontalAxis, - TiltAlongVerticalAxis + TiltAlongVerticalAxis, } // NSInteger -> UINavigationController.h [Native] [MacCatalyst (13, 1)] public enum UINavigationControllerOperation : long { - None, Push, Pop + None, + Push, + Pop, } // NSInteger -> UIActivity.h @@ -1465,21 +1505,26 @@ public enum UINavigationControllerOperation : long { [NoTV] [MacCatalyst (13, 1)] public enum UIActivityCategory : long { - Action, Share + Action, + Share, } // NSInteger -> UIAttachmentBehavior.h [Native] [MacCatalyst (13, 1)] public enum UIAttachmentBehaviorType : long { - Items, Anchor + Items, + Anchor, } // NSInteger -> UIBarCommon.h [Native] [MacCatalyst (13, 1)] public enum UIBarPosition : long { - Any, Bottom, Top, TopAttached, + Any, + Bottom, + Top, + TopAttached, } // NSUInteger -> UICollisionBehavior.h @@ -1489,7 +1534,7 @@ public enum UIBarPosition : long { public enum UICollisionBehaviorMode : ulong { Items = 1, Boundaries = 2, - Everything = UInt64.MaxValue + Everything = UInt64.MaxValue, } // uint32_t -> UIFontDescriptor.h @@ -1517,7 +1562,7 @@ public enum UIFontDescriptorSymbolicTraits : uint { ClassSansSerif = 8U << 28, ClassOrnamentals = 9U << 28, ClassScripts = 10U << 28, - ClassSymbolic = 12U << 28 + ClassSymbolic = 12U << 28, } // NSInteger -> UIResponder.h @@ -1552,7 +1597,8 @@ public enum UIScrollViewKeyboardDismissMode : long { [MacCatalyst (13, 1)] [Native] public enum UIWebPaginationBreakingMode : long { - Page, Column + Page, + Column, } // NSInteger -> UIWebView.h @@ -1565,7 +1611,7 @@ public enum UIWebPaginationMode : long { LeftToRight, TopToBottom, BottomToTop, - RightToLeft + RightToLeft, } // NSInteger -> UIPushBehavior.h @@ -1573,7 +1619,7 @@ public enum UIWebPaginationMode : long { [MacCatalyst (13, 1)] public enum UIPushBehaviorMode : long { Continuous, - Instantaneous + Instantaneous, } // NSInteger -> UITabBar.h @@ -1582,7 +1628,7 @@ public enum UIPushBehaviorMode : long { public enum UITabBarItemPositioning : long { Automatic, Fill, - Centered + Centered, } // NSUInteger -> UIView.h @@ -1601,7 +1647,7 @@ public enum UIViewKeyframeAnimationOptions : ulong { CalculationModeDiscrete = 1 << 10, CalculationModePaced = 2 << 10, CalculationModeCubic = 3 << 10, - CalculationModeCubicPaced = 4 << 10 + CalculationModeCubicPaced = 4 << 10, } // NSInteger -> UIView.h @@ -1610,14 +1656,14 @@ public enum UIViewKeyframeAnimationOptions : ulong { public enum UIViewTintAdjustmentMode : long { Automatic, Normal, - Dimmed + Dimmed, } // NSUInteger -> UIView.h [Native] [MacCatalyst (13, 1)] public enum UISystemAnimation : ulong { - Delete + Delete, } // NSUInteger -> UIGeometry.h @@ -1628,7 +1674,7 @@ public enum UIRectEdge : ulong { Left = 1 << 1, Bottom = 1 << 2, Right = 1 << 3, - All = Top | Left | Bottom | Right + All = Top | Left | Bottom | Right, } // Xamarin.iOS home-grown define @@ -1637,7 +1683,7 @@ public enum NSTextEffect { LetterPressStyle, // An unkonwn value, the real value can be fetched using the WeakTextEffect: Apple added a new effect and the bindings are old. - UnknownUseWeakEffect + UnknownUseWeakEffect, } // NSUInteger -> UISearchBar.h @@ -1646,7 +1692,7 @@ public enum NSTextEffect { public enum UISearchBarStyle : ulong { Default, Prominent, - Minimal + Minimal, } // NSInteger -> UIInputView.h @@ -1654,7 +1700,7 @@ public enum UISearchBarStyle : ulong { [MacCatalyst (13, 1)] public enum UIInputViewStyle : long { Default, - Keyboard + Keyboard, } [Native] @@ -1662,26 +1708,30 @@ public enum UIInputViewStyle : long { public enum UIUserInterfaceSizeClass : long { Unspecified = 0, Compact = 1, - Regular = 2 + Regular = 2, } [Native] [MacCatalyst (13, 1)] public enum UIAlertActionStyle : long { - Default, Cancel, Destructive + Default, + Cancel, + Destructive, } [Native] [MacCatalyst (13, 1)] public enum UIAlertControllerStyle : long { ActionSheet, - Alert + Alert, } [Native] [MacCatalyst (13, 1)] public enum UIBlurEffectStyle : long { - ExtraLight, Light, Dark, + ExtraLight, + Light, + Dark, [NoiOS] [NoMacCatalyst] ExtraDark, @@ -1749,7 +1799,7 @@ public enum UIPrinterJobTypes : long { Receipt = 1 << 4, Roll = 1 << 5, LargeFormat = 1 << 6, - Postcard = 1 << 7 + Postcard = 1 << 7, } /// Enumerates the various types of user notification. Can be "OR"ed together as flags. @@ -1763,7 +1813,7 @@ public enum UIUserNotificationType : ulong { None = 0, Badge = 1 << 0, Sound = 1 << 1, - Alert = 1 << 2 + Alert = 1 << 2, } /// Whether a should run the app in foreground or background mode. @@ -1774,7 +1824,7 @@ public enum UIUserNotificationType : ulong { [Native] public enum UIUserNotificationActivationMode : ulong { Foreground, - Background + Background, } /// Enumerates the amount of space available for a . Used with @@ -1785,7 +1835,7 @@ public enum UIUserNotificationActivationMode : ulong { [Native] public enum UIUserNotificationActionContext : ulong { Default, - Minimal + Minimal, } /// Enumerates the insertion points for custom menu items. @@ -1796,7 +1846,7 @@ public enum UIUserNotificationActionContext : ulong { [Native] public enum UIDocumentMenuOrder : ulong { First, - Last + Last, } /// Enumerates the types of file transfer operations used by the document picker. @@ -1809,7 +1859,7 @@ public enum UIDocumentPickerMode : ulong { Import, Open, ExportToService, - MoveToService + MoveToService, } [MacCatalyst (13, 1)] @@ -1818,7 +1868,7 @@ public enum UIAccessibilityNavigationStyle : long { Automatic = 0, Separate = 1, - Combined = 2 + Combined = 2, } [Native] @@ -1867,13 +1917,16 @@ public enum UISplitViewControllerDisplayMode : long { [MacCatalyst (13, 1)] [Deprecated (PlatformName.MacCatalyst, 13, 1, message: "Use 'UIContextualActionStyle' and corresponding APIs instead.")] public enum UITableViewRowActionStyle : long { - Default, Destructive = Default, Normal + Default, + Destructive = Default, + Normal, } // Utility enum for UITransitionContext[To|From]ViewKey [MacCatalyst (13, 1)] public enum UITransitionViewControllerKind { - ToView, FromView + ToView, + FromView, } // note [Native] since it maps to UIFontWeightConstants fields (CGFloat) @@ -1905,7 +1958,7 @@ public enum UIStackViewDistribution : long { FillEqually, FillProportionally, EqualSpacing, - EqualCentering + EqualCentering, } [MacCatalyst (13, 1)] @@ -1918,7 +1971,7 @@ public enum UIStackViewAlignment : long { Center, Trailing, Bottom = Trailing, - LastBaseline + LastBaseline, } [MacCatalyst (13, 1)] @@ -1926,7 +1979,7 @@ public enum UIStackViewAlignment : long { [Flags] public enum NSWritingDirectionFormatType : long { Embedding = 0 << 1, - Override = 1 << 1 + Override = 1 << 1, } /// Enumerates desired page cutting behavior for roll-feed printers. @@ -1938,7 +1991,7 @@ public enum UIPrinterCutterBehavior : long { PrinterDefault, CutAfterEachPage, CutAfterEachCopy, - CutAfterEachJob + CutAfterEachJob, } /// Enumerates whether the user may respond to a user notification with text input. @@ -1949,7 +2002,7 @@ public enum UIPrinterCutterBehavior : long { [Native] public enum UIUserNotificationActionBehavior : ulong { Default, - TextInput + TextInput, } [MacCatalyst (13, 1)] @@ -1959,7 +2012,7 @@ public enum UISemanticContentAttribute : long { Playback, Spatial, ForceLeftToRight, - ForceRightToLeft + ForceRightToLeft, } [MacCatalyst (13, 1)] @@ -1967,7 +2020,7 @@ public enum UISemanticContentAttribute : long { public enum UIDynamicItemCollisionBoundsType : ulong { Rectangle, Ellipse, - Path + Path, } [Native] @@ -1975,13 +2028,15 @@ public enum UIDynamicItemCollisionBoundsType : ulong { public enum UIForceTouchCapability : long { Unknown = 0, Unavailable = 1, - Available = 2 + Available = 2, } [Native] [MacCatalyst (13, 1)] public enum UIPreviewActionStyle : long { - Default, Selected, Destructive + Default, + Selected, + Destructive, } [MacCatalyst (13, 1)] @@ -1991,7 +2046,7 @@ public enum UIPressPhase : long { Changed, Stationary, Ended, - Cancelled + Cancelled, } [MacCatalyst (13, 1)] @@ -2022,7 +2077,7 @@ public enum UIPressType : long { [Native] public enum UITableViewCellFocusStyle : long { Default, - Custom + Custom, } [MacCatalyst (13, 1)] @@ -2030,7 +2085,7 @@ public enum UITableViewCellFocusStyle : long { public enum UIDisplayGamut : long { Unspecified = -1, Srgb, - P3 + P3, } [MacCatalyst (13, 1)] @@ -2038,7 +2093,7 @@ public enum UIDisplayGamut : long { public enum UITraitEnvironmentLayoutDirection : long { Unspecified = -1, LeftToRight = UIUserInterfaceLayoutDirection.LeftToRight, - RightToLeft = UIUserInterfaceLayoutDirection.RightToLeft + RightToLeft = UIUserInterfaceLayoutDirection.RightToLeft, } [MacCatalyst (13, 1)] @@ -2046,7 +2101,7 @@ public enum UITraitEnvironmentLayoutDirection : long { public enum UIUserInterfaceStyle : long { Unspecified, Light, - Dark + Dark, } [MacCatalyst (13, 1)] @@ -2054,7 +2109,7 @@ public enum UIUserInterfaceStyle : long { public enum UITextItemInteraction : long { InvokeDefaultAction, PresentActions, - Preview + Preview, } [MacCatalyst (13, 1)] @@ -2062,7 +2117,7 @@ public enum UITextItemInteraction : long { public enum UIViewAnimatingState : long { Inactive, Active, - Stopped + Stopped, } [MacCatalyst (13, 1)] @@ -2070,7 +2125,7 @@ public enum UIViewAnimatingState : long { public enum UIViewAnimatingPosition : long { End, Start, - Current + Current, } [MacCatalyst (13, 1)] @@ -2079,7 +2134,7 @@ public enum UITimingCurveType : long { Builtin, Cubic, Spring, - Composed + Composed, } /// Enumerates the ear (or ears) for which the accessibility device is paired. @@ -2090,14 +2145,14 @@ public enum UIAccessibilityHearingDeviceEar : ulong { None = 0, Left = 1 << 1, Right = 1 << 2, - Both = Left | Right + Both = Left | Right, } [MacCatalyst (13, 1)] [Native] public enum UIAccessibilityCustomRotorDirection : long { Previous, - Next + Next, } #if NET @@ -2114,7 +2169,7 @@ public enum UICloudSharingPermissionOptions : ulong { AllowPublic = 1 << 0, AllowPrivate = 1 << 1, AllowReadOnly = 1 << 2, - AllowReadWrite = 1 << 3 + AllowReadWrite = 1 << 3, } [MacCatalyst (13, 1)] @@ -2124,14 +2179,14 @@ public enum UITextFieldDidEndEditingReason : long { Committed, [NoiOS] [NoMacCatalyst] - Cancelled + Cancelled, } [MacCatalyst (13, 1)] [Native] public enum UIScrollViewIndexDisplayMode : long { Automatic, - AlwaysHidden + AlwaysHidden, } [MacCatalyst (13, 1)] @@ -2140,7 +2195,7 @@ public enum UIScrollViewContentInsetAdjustmentBehavior : long { Automatic, ScrollableAxes, Never, - Always + Always, } [MacCatalyst (13, 1)] @@ -2160,7 +2215,7 @@ public enum UIAccessibilityContainerType : long { public enum UITextSmartQuotesType : long { Default, No, - Yes + Yes, } [MacCatalyst (13, 1)] @@ -2168,7 +2223,7 @@ public enum UITextSmartQuotesType : long { public enum UITextSmartDashesType : long { Default, No, - Yes + Yes, } [MacCatalyst (13, 1)] @@ -2176,7 +2231,7 @@ public enum UITextSmartDashesType : long { public enum UITextSmartInsertDeleteType : long { Default, No, - Yes + Yes, } [MacCatalyst (13, 1)] @@ -2200,7 +2255,7 @@ public enum UIAccessibilityCustomSystemRotorType : long { TextField, Table, List, - Landmark + Landmark, } /// Enumerates drag activity drop resolutions. @@ -2211,7 +2266,7 @@ public enum UIDropOperation : ulong { Cancel = 0, Forbidden = 1, Copy = 2, - Move = 3 + Move = 3, } /// Enumerates behaviors when dragging text. @@ -2221,7 +2276,7 @@ public enum UIDropOperation : ulong { [Flags] public enum UITextDragOptions : long { None = 0, - StripTextColorFromPreviews = (1 << 0) + StripTextColorFromPreviews = (1 << 0), } /// Enumerates behaviors in response to dropped text. @@ -2231,7 +2286,7 @@ public enum UITextDragOptions : long { public enum UITextDropAction : ulong { Insert = 0, ReplaceSelection, - ReplaceAll + ReplaceAll, } /// Enumerates text drop progress notification styles. @@ -2240,7 +2295,7 @@ public enum UITextDropAction : ulong { [Native] public enum UITextDropProgressMode : ulong { System = 0, - Custom + Custom, } /// Enumerates behaviors for noneditable views when receiving dropped text. @@ -2250,7 +2305,7 @@ public enum UITextDropProgressMode : ulong { public enum UITextDropEditability : ulong { No = 0, Temporary, - Yes + Yes, } /// Enumerates collection view reorganization speeds for drop animations. @@ -2260,7 +2315,7 @@ public enum UITextDropEditability : ulong { public enum UICollectionViewReorderingCadence : long { Immediate, Fast, - Slow + Slow, } /// Enumerates drop actions. @@ -2270,7 +2325,7 @@ public enum UICollectionViewReorderingCadence : long { public enum UICollectionViewDropIntent : long { Unspecified, InsertAtDestinationIndexPath, - InsertIntoDestinationIndexPath + InsertIntoDestinationIndexPath, } /// Enumerates drag operation states. @@ -2280,7 +2335,7 @@ public enum UICollectionViewDropIntent : long { public enum UICollectionViewCellDragState : long { None, Lifting, - Dragging + Dragging, } /// Enumerates presets for exporting images. @@ -2291,7 +2346,7 @@ public enum UICollectionViewCellDragState : long { [Native] public enum UIImagePickerControllerImageUrlExportPreset : long { Compatible = 0, - Current + Current, } /// Enumerates action button styles. @@ -2300,7 +2355,7 @@ public enum UIImagePickerControllerImageUrlExportPreset : long { [Native] public enum UIContextualActionStyle : long { Normal, - Destructive + Destructive, } /// Enumerates cell states while the cell is involved in a drag operation. @@ -2310,14 +2365,14 @@ public enum UIContextualActionStyle : long { public enum UITableViewCellDragState : long { None, Lifting, - Dragging + Dragging, } [MacCatalyst (13, 1)] [Native] public enum UITableViewSeparatorInsetReference : long { CellEdges, - AutomaticInsets + AutomaticInsets, } /// Enumerates drop handling options. @@ -2328,14 +2383,14 @@ public enum UITableViewDropIntent : long { Unspecified, InsertAtDestinationIndexPath, InsertIntoDestinationIndexPath, - Automatic + Automatic, } [MacCatalyst (13, 1)] [Native] public enum UISplitViewControllerPrimaryEdge : long { Leading, - Trailing + Trailing, } /// Enumerates drop progress indicator styles. @@ -2344,7 +2399,7 @@ public enum UISplitViewControllerPrimaryEdge : long { [Native] public enum UIDropSessionProgressIndicatorStyle : ulong { None, - Default + Default, } /// Enumerates states for spring-loaded interactions. @@ -2355,7 +2410,7 @@ public enum UISpringLoadedInteractionEffectState : long { Inactive, Possible, Activating, - Activated + Activated, } /// Enumerates the import modes of the document browser. @@ -2365,7 +2420,7 @@ public enum UISpringLoadedInteractionEffectState : long { public enum UIDocumentBrowserImportMode : ulong { None, Copy, - Move + Move, } /// Enumerates document browser styles. @@ -2375,7 +2430,7 @@ public enum UIDocumentBrowserImportMode : ulong { public enum UIDocumentBrowserUserInterfaceStyle : ulong { White = 0, Light, - Dark + Dark, } /// Enumerates allowable action locations. @@ -2385,7 +2440,7 @@ public enum UIDocumentBrowserUserInterfaceStyle : ulong { [Flags] public enum UIDocumentBrowserActionAvailability : long { Menu = 1, - NavigationBar = 1 << 1 + NavigationBar = 1 << 1, } /// Enumerates the type responsible for the drop operation. @@ -2452,7 +2507,7 @@ public enum UIPrintErrorCode : long { NotAvailableError = 1, NoContentError, UnknownImageFormatError, - JobFailedError + JobFailedError, } [iOS (13, 0), TV (13, 0)] diff --git a/src/UIKit/UIFontDescriptor.cs b/src/UIKit/UIFontDescriptor.cs index cd5e5773840f..a664eb14d1df 100644 --- a/src/UIKit/UIFontDescriptor.cs +++ b/src/UIKit/UIFontDescriptor.cs @@ -419,7 +419,18 @@ public UIFontFeature [] FeatureSettings { // that's a convenience enum that maps to UIFontDescriptorXXX which are internal (hidden) NSString public enum UIFontDescriptorAttribute { - Family, Face, Name, Size, VisibleName, Matrix, CharacterSet, CascadeList, Traits, FixedAdvance, FeatureSettings, TextStyle + Family, + Face, + Name, + Size, + VisibleName, + Matrix, + CharacterSet, + CascadeList, + Traits, + FixedAdvance, + FeatureSettings, + TextStyle, } public class UIFontTraits : DictionaryContainer { diff --git a/src/WebKit/Defs.cs b/src/WebKit/Defs.cs index a12a0593088e..1656df7ca875 100644 --- a/src/WebKit/Defs.cs +++ b/src/WebKit/Defs.cs @@ -23,7 +23,7 @@ public enum WKNavigationType : long { BackForward, Reload, FormResubmitted, - Other = -1 + Other = -1, } /// Contains values that enumerate whether to cancel or allow navigation actions. @@ -53,7 +53,7 @@ public enum WKNavigationResponsePolicy : long { [Native] public enum WKUserScriptInjectionTime : long { AtDocumentStart, - AtDocumentEnd + AtDocumentEnd, } /// Enumerates WebKit errors. @@ -92,7 +92,8 @@ public enum WKErrorCode : long { [MacCatalyst (13, 1)] [Native] public enum WKSelectionGranularity : long { - Dynamic, Character + Dynamic, + Character, } /// Enumerates the kinds of data that are detected and converted to links. @@ -110,7 +111,7 @@ public enum WKDataDetectorTypes : ulong { FlightNumber = 1 << 5, LookupSuggestion = 1 << 6, SpotlightSuggestion = LookupSuggestion, - All = UInt64.MaxValue + All = UInt64.MaxValue, } /// Enumerates media types. @@ -121,7 +122,7 @@ public enum WKAudiovisualMediaTypes : ulong { None = 0, Audio = 1 << 0, Video = 1 << 1, - All = UInt64.MaxValue + All = UInt64.MaxValue, } [iOS (15, 0), NoTV, MacCatalyst (15, 0)] diff --git a/src/WebKit/Enums.cs b/src/WebKit/Enums.cs index 4ddb79163c6f..1cf82a598550 100644 --- a/src/WebKit/Enums.cs +++ b/src/WebKit/Enums.cs @@ -26,7 +26,7 @@ public enum DomCssValueType : ushort { Inherit = 0, PrimitiveValue = 1, ValueList = 2, - Custom = 3 + Custom = 3, } [NoiOS, NoTV, NoMacCatalyst] @@ -38,7 +38,7 @@ public enum DomDocumentPosition : ushort { Following = 0x04, Contains = 0x08, ContainedBy = 0x10, - ImplementationSpecific = 0x20 + ImplementationSpecific = 0x20, } [NoiOS, NoTV, NoMacCatalyst] @@ -55,7 +55,7 @@ public enum DomNodeType : ushort { Document = 9, DocumentType = 10, DocumentFragment = 11, - Notation = 12 + Notation = 12, } [NoiOS, NoTV, NoMacCatalyst] @@ -64,19 +64,23 @@ public enum DomRangeCompareHow : ushort { StartToStart = 0, StartToEnd = 1, EndToEnd = 2, - EndToStart = 3 + EndToStart = 3, } [NoiOS, NoTV, NoMacCatalyst] [Native] public enum WebCacheModel : ulong { - DocumentViewer, DocumentBrowser, PrimaryWebBrowser + DocumentViewer, + DocumentBrowser, + PrimaryWebBrowser, } [NoiOS, NoTV, NoMacCatalyst] [Deprecated (PlatformName.MacOSX, 10, 14, message: "No longer supported.")] public enum DomEventPhase : ushort { - Capturing = 1, AtTarget, Bubbling + Capturing = 1, + AtTarget, + Bubbling, } [NoiOS, NoTV, NoMacCatalyst] @@ -88,7 +92,7 @@ public enum WebDragSourceAction : ulong { Image = 2, Link = 4, Selection = 8, - Any = UInt64.MaxValue + Any = UInt64.MaxValue, } [NoiOS, NoTV, NoMacCatalyst] @@ -101,7 +105,7 @@ public enum WebDragDestinationAction : ulong { Link = 4, [Obsolete ("This API is not available on this platform.")] Selection = 8, - Any = UInt64.MaxValue + Any = UInt64.MaxValue, } [NoiOS, NoTV, NoMacCatalyst] @@ -111,7 +115,12 @@ public enum WebNavigationType : uint { [Native] public enum WebNavigationType : long { #endif - LinkClicked, FormSubmitted, BackForward, Reload, FormResubmitted, Other + LinkClicked, + FormSubmitted, + BackForward, + Reload, + FormResubmitted, + Other, } // Used as an 'unsigned int' parameter @@ -121,7 +130,7 @@ public enum DomKeyLocation : uint { Standard = 0, Left = 1, Right = 2, - NumberPad = 3 + NumberPad = 3, } // Used as an 'int' parameter @@ -130,6 +139,6 @@ public enum DomKeyLocation : uint { public enum DomDelta : int { Pixel = 0, Line = 1, - Page = 2 + Page = 2, } } diff --git a/src/uikit.cs b/src/uikit.cs index 5abfc153add3..46e5af4de823 100644 --- a/src/uikit.cs +++ b/src/uikit.cs @@ -90,13 +90,17 @@ public enum UIFocusHeading : ulong { [Native] // NSInteger -> UIApplication.h [MacCatalyst (13, 1)] public enum UIBackgroundRefreshStatus : long { - Restricted, Denied, Available + Restricted, + Denied, + Available, } [MacCatalyst (13, 1)] [Native] // NSUInteger -> UIApplication.h public enum UIBackgroundFetchResult : ulong { - NewData, NoData, Failed + NewData, + NoData, + Failed, } /// @@ -133,7 +137,7 @@ public enum UIApplicationShortcutIconType : long { Bookmark, Shuffle, Audio, - Update + Update, } /// Enumerates the mass of the objects used by the class. @@ -159,7 +163,7 @@ public enum UIImpactFeedbackStyle : long { public enum UINotificationFeedbackType : long { Success, Warning, - Error + Error, } [Native] @@ -3146,7 +3150,7 @@ public enum UIContentSizeCategory { AccessibilityExtraExtraLarge, [Field ("UIContentSizeCategoryAccessibilityExtraExtraExtraLarge")] - AccessibilityExtraExtraExtraLarge + AccessibilityExtraExtraExtraLarge, } [iOS (16, 0), MacCatalyst (16, 0), TV (16, 0)] From 1c16bfdc7022deb951100815b9da01efd832b0af Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Tue, 14 Jan 2025 10:06:45 +0100 Subject: [PATCH 2/5] [UIKit] Fix some nullability issues. Fixes #21957. (#21961) Fixes https://github.com/xamarin/xamarin-macios/issues/21957. --- src/uikit.cs | 85 +++++++++++++++++-- .../MacCatalyst-UIKit.ignore | 69 --------------- .../api-annotations-dotnet/iOS-UIKit.ignore | 69 --------------- .../api-annotations-dotnet/tvOS-UIKit.ignore | 44 ---------- 4 files changed, 79 insertions(+), 188 deletions(-) diff --git a/src/uikit.cs b/src/uikit.cs index 46e5af4de823..dc2a77d216f0 100644 --- a/src/uikit.cs +++ b/src/uikit.cs @@ -1541,9 +1541,11 @@ interface UIActionSheetDelegate { [BaseType (typeof (NSObject))] interface UIActivity { [Export ("activityType")] + [NullAllowed] NSString Type { get; } [Export ("activityTitle")] + [NullAllowed] string Title { get; } [Export ("activityImage")] @@ -1667,9 +1669,11 @@ interface UIActivityItemProvider : UIActivityItemSource { NativeHandle Constructor (NSObject placeholderItem); [Export ("placeholderItem", ArgumentSemantic.Retain)] + [NullAllowed] NSObject PlaceholderItem { get; } [Export ("activityType")] + [NullAllowed] NSString ActivityType { get; } [Export ("item")] @@ -1702,6 +1706,7 @@ interface UIActivityItemSource { [Abstract] [Export ("activityViewController:itemForActivityType:")] + [return: NullAllowed] NSObject GetItemForActivity (UIActivityViewController activityViewController, [NullAllowed] NSString activityType); [Export ("activityViewController:dataTypeIdentifierForActivityType:")] @@ -1768,6 +1773,7 @@ interface UIActivityViewController { [BaseType (typeof (NSObject))] partial interface UIAlertAction : NSCopying, UIAccessibilityIdentification { [Export ("title")] + [NullAllowed] string Title { get; } [Export ("style")] @@ -2022,6 +2028,7 @@ interface UIStateRestoring { IUIStateRestoring RestorationParent { get; } [Export ("objectRestorationClass")] + [NullAllowed] Class ObjectRestorationClass { get; } [Export ("encodeRestorableStateWithCoder:")] @@ -3806,6 +3813,7 @@ interface UIBarItem : NSCoding, UIAppearance, UIAccessibility, UIAccessibilityId [Export ("titleTextAttributesForState:"), Internal] [Appearance] + [return: NullAllowed] NSDictionary _GetTitleTextAttributes (UIControlState state); [MacCatalyst (13, 1)] @@ -4163,6 +4171,7 @@ interface UICollectionReusableView { NativeHandle Constructor (CGRect frame); [Export ("reuseIdentifier", ArgumentSemantic.Copy)] + [NullAllowed] NSString ReuseIdentifier { get; } [RequiresSuper] @@ -5086,6 +5095,7 @@ interface UICollectionViewLayoutAttributes : UIDynamicItem, NSCopying { UICollectionElementCategory RepresentedElementCategory { get; } [Export ("representedElementKind")] + [NullAllowed] string RepresentedElementKind { get; } [Static] @@ -5119,14 +5129,17 @@ interface UICollectionViewLayoutInvalidationContext { [MacCatalyst (13, 1)] [Export ("invalidatedItemIndexPaths")] + [NullAllowed] NSIndexPath [] InvalidatedItemIndexPaths { get; } [MacCatalyst (13, 1)] [Export ("invalidatedSupplementaryIndexPaths")] + [NullAllowed] NSDictionary InvalidatedSupplementaryIndexPaths { get; } [MacCatalyst (13, 1)] [Export ("invalidatedDecorationIndexPaths")] + [NullAllowed] NSDictionary InvalidatedDecorationIndexPaths { get; } [MacCatalyst (13, 1)] @@ -6070,6 +6083,7 @@ interface UICollisionBehavior { bool TranslatesReferenceBoundsIntoBoundary { get; set; } [Export ("boundaryIdentifiers", ArgumentSemantic.Copy)] + [NullAllowed] NSObject [] BoundaryIdentifiers { get; } [Export ("collisionDelegate", ArgumentSemantic.Assign), NullAllowed] @@ -6141,6 +6155,7 @@ interface UIDocument : NSFilePresenter, NSProgressReporting, UIUserActivityResto string LocalizedName { get; } [Export ("fileType", ArgumentSemantic.Copy)] + [NullAllowed] string FileType { get; } [Export ("fileModificationDate", ArgumentSemantic.Copy)] @@ -6169,6 +6184,7 @@ interface UIDocument : NSFilePresenter, NSProgressReporting, UIUserActivityResto bool LoadFromContents (NSObject contents, [NullAllowed] string typeName, out NSError outError); [Export ("contentsForType:error:")] + [return: NullAllowed] NSObject ContentsForType (string typeName, out NSError outError); [Export ("disableEditing")] @@ -6201,6 +6217,7 @@ interface UIDocument : NSFilePresenter, NSProgressReporting, UIUserActivityResto void AutoSave ([NullAllowed] UIOperationHandler completionHandler); [Export ("savingFileType")] + [NullAllowed] string SavingFileType { get; } [Export ("fileNameExtensionForType:saveOperation:")] @@ -6213,6 +6230,7 @@ interface UIDocument : NSFilePresenter, NSProgressReporting, UIUserActivityResto bool WriteContents (NSObject contents, NSUrl toUrl, UIDocumentSaveOperation saveOperation, [NullAllowed] NSUrl originalContentsURL, out NSError outError); [Export ("fileAttributesToWriteToURL:forSaveOperation:error:")] + [return: NullAllowed] NSDictionary GetFileAttributesToWrite (NSUrl forUrl, UIDocumentSaveOperation saveOperation, out NSError outError); [Export ("readFromURL:error:")] @@ -6769,6 +6787,7 @@ partial interface UIFontDescriptor : NSSecureCoding, NSCopying { UIFontDescriptorSymbolicTraits SymbolicTraits { get; } [Export ("objectForKey:")] + [return: NullAllowed] NSObject GetObject (NSString anAttribute); [Export ("fontAttributes")] @@ -9233,16 +9252,20 @@ interface UIEvent { UIEventButtonMask ButtonMask { get; } [Export ("allTouches")] + [NullAllowed] NSSet AllTouches { get; } [Export ("touchesForView:")] + [return: NullAllowed] NSSet TouchesForView (UIView view); [Export ("touchesForWindow:")] + [return: NullAllowed] NSSet TouchesForWindow (UIWindow window); [Export ("touchesForGestureRecognizer:")] + [return: NullAllowed] NSSet TouchesForGestureRecognizer (UIGestureRecognizer window); [MacCatalyst (13, 1)] @@ -9464,6 +9487,7 @@ interface UIControl : UIContextMenuInteractionDelegate { UIControlEvent AllControlEvents { get; } [Export ("actionsForTarget:forControlEvent:")] + [return: NullAllowed] string [] GetActions ([NullAllowed] NSObject target, UIControlEvent events); [TV (14, 0), iOS (14, 0)] @@ -9827,6 +9851,7 @@ interface UIButton : UIAccessibilityContentSizeCategoryImageAdjusting void SetBackgroundImage ([NullAllowed] UIImage image, UIControlState forState); [Export ("titleForState:")] + [return: NullAllowed] string Title (UIControlState state); [Export ("titleColorForState:")] @@ -9846,6 +9871,7 @@ interface UIButton : UIAccessibilityContentSizeCategoryImageAdjusting UIImage BackgroundImageForState (UIControlState state); [Export ("currentTitle", ArgumentSemantic.Retain)] + [NullAllowed] string CurrentTitle { get; } [Export ("currentTitleColor", ArgumentSemantic.Retain)] @@ -9902,12 +9928,14 @@ interface UIButton : UIAccessibilityContentSizeCategoryImageAdjusting // 6.0 // [Export ("currentAttributedTitle", ArgumentSemantic.Retain)] + [NullAllowed] NSAttributedString CurrentAttributedTitle { get; } [Export ("setAttributedTitle:forState:")] void SetAttributedTitle ([NullAllowed] NSAttributedString title, UIControlState state); [Export ("attributedTitleForState:")] + [return: NullAllowed] NSAttributedString GetAttributedTitle (UIControlState state); [Appearance] @@ -10365,6 +10393,7 @@ interface UIDevice { void PlayInputClick (); [Export ("identifierForVendor", ArgumentSemantic.Retain)] + [NullAllowed] NSUuid IdentifierForVendor { get; } } @@ -10372,6 +10401,7 @@ interface UIDevice { [BaseType (typeof (NSObject))] interface UIDictationPhrase { [Export ("alternativeInterpretations")] + [NullAllowed] string [] AlternativeInterpretations { get; } [Export ("text")] @@ -10520,6 +10550,7 @@ interface UIImagePickerController { bool IsSourceTypeAvailable (UIImagePickerControllerSourceType sourceType); [Export ("availableMediaTypesForSourceType:"), Static] + [return: NullAllowed] string [] AvailableMediaTypes (UIImagePickerControllerSourceType sourceType); // This is the foundation to implement both id @@ -10568,6 +10599,7 @@ interface UIImagePickerController { [Static] [Export ("availableCaptureModesForCameraDevice:")] + [return: NullAllowed] NSNumber [] AvailableCaptureModesForCameraDevice (UIImagePickerControllerCameraDevice cameraDevice); [Export ("cameraDevice")] @@ -10690,6 +10722,7 @@ interface UIManagedDocument { bool ReadAdditionalContent (NSUrl absoluteURL, out NSError error); [Export ("additionalContentForURL:error:")] + [return: NullAllowed] NSObject AdditionalContent (NSUrl absoluteURL, out NSError error); [Export ("writeAdditionalContent:toURL:originalContentsURL:error:")] @@ -11622,9 +11655,11 @@ bool Persistent { bool Contains (string [] pasteboardTypes); [Export ("dataForPasteboardType:")] + [return: NullAllowed] NSData DataForPasteboardType (string pasteboardType); [Export ("valueForPasteboardType:")] + [return: NullAllowed] NSObject GetValue (string pasteboardType); [Export ("setValue:forPasteboardType:")] @@ -11648,14 +11683,17 @@ bool Persistent { bool Contains (string [] pasteboardTypes, [NullAllowed] NSIndexSet itemSet); [Export ("itemSetWithPasteboardTypes:")] + [return: NullAllowed] NSIndexSet ItemSetWithPasteboardTypes (string [] pasteboardTypes); [Export ("valuesForPasteboardType:inItemSet:")] - NSData [] GetValuesForPasteboardType (string pasteboardType, NSIndexSet itemSet); + [return: NullAllowed] + NSData [] GetValuesForPasteboardType (string pasteboardType, [NullAllowed] NSIndexSet itemSet); [Export ("dataForPasteboardType:inItemSet:")] - NSData [] GetDataForPasteboardType (string pasteboardType, NSIndexSet itemSet); + [return: NullAllowed] + NSData [] GetDataForPasteboardType (string pasteboardType, [NullAllowed] NSIndexSet itemSet); [Export ("items", ArgumentSemantic.Copy)] NSDictionary [] Items { get; set; } @@ -11936,6 +11974,7 @@ interface UIPickerViewDelegate { nfloat GetComponentWidth (UIPickerView pickerView, nint component); [Export ("pickerView:titleForRow:forComponent:")] + [return: NullAllowed] string GetTitle (UIPickerView pickerView, nint row, nint component); [Export ("pickerView:viewForRow:forComponent:reusingView:")] @@ -11957,9 +11996,11 @@ interface UIPickerViewDelegate { [BaseType (typeof (UIPickerViewDelegate))] interface UIPickerViewAccessibilityDelegate { [Export ("pickerView:accessibilityLabelForComponent:")] + [return: NullAllowed] string GetAccessibilityLabel (UIPickerView pickerView, nint acessibilityLabelForComponent); [Export ("pickerView:accessibilityHintForComponent:")] + [return: NullAllowed] string GetAccessibilityHint (UIPickerView pickerView, nint component); [MacCatalyst (13, 1)] @@ -12379,6 +12420,7 @@ interface UIResponder : UIAccessibilityAction, UIAccessibilityFocus, UIUserActiv void ClearTextInputContextIdentifier (NSString identifier); [Export ("targetForAction:withSender:")] + [return: NullAllowed] NSObject GetTargetForAction (Selector action, [NullAllowed] NSObject sender); [iOS (13, 0), TV (13, 0)] @@ -12392,6 +12434,7 @@ interface UIResponder : UIAccessibilityAction, UIAccessibilityFocus, UIUserActiv void ValidateCommand (UICommand command); [Export ("textInputContextIdentifier")] + [NullAllowed] NSString TextInputContextIdentifier { get; } [Export ("textInputMode")] @@ -12631,6 +12674,7 @@ UIScreenMode CurrentMode { nfloat Scale { get; } [Export ("displayLinkWithTarget:selector:")] + [return: NullAllowed] CADisplayLink CreateDisplayLink (NSObject target, Selector sel); [MacCatalyst (13, 1)] @@ -13035,6 +13079,7 @@ interface UIScrollViewDelegate { [BaseType (typeof (UIScrollViewDelegate))] interface UIScrollViewAccessibilityDelegate { [Export ("accessibilityScrollStatusForScrollView:")] + [return: NullAllowed] string GetAccessibilityScrollStatus (UIScrollView scrollView); [MacCatalyst (13, 1)] @@ -13184,6 +13229,7 @@ interface UISearchBar : UIBarPositioning, UITextInputTraits, UILookToDictateCapa [Export ("scopeBarButtonTitleTextAttributesForState:"), Internal] [Appearance] + [return: NullAllowed] NSDictionary _GetScopeBarButtonTitleTextAttributes (UIControlState state); [Appearance] @@ -13657,6 +13703,7 @@ interface UISegmentedControl void SetTitle (string title, nint segment); [Export ("titleForSegmentAtIndex:")] + [return: NullAllowed] string TitleAt (nint segment); [Export ("setImage:forSegmentAtIndex:")] @@ -14876,9 +14923,11 @@ interface UITableViewSource { nint NumberOfSections (UITableView tableView); [Export ("tableView:titleForHeaderInSection:")] + [return: NullAllowed] string TitleForHeader (UITableView tableView, nint section); [Export ("tableView:titleForFooterInSection:")] + [return: NullAllowed] string TitleForFooter (UITableView tableView, nint section); [Export ("tableView:canEditRowAtIndexPath:")] @@ -14889,6 +14938,7 @@ interface UITableViewSource { [MacCatalyst (13, 1)] [Export ("sectionIndexTitlesForTableView:")] + [return: NullAllowed] string [] SectionIndexTitles (UITableView tableView); [MacCatalyst (13, 1)] @@ -14923,9 +14973,11 @@ interface UITableViewSource { void AccessoryButtonTapped (UITableView tableView, NSIndexPath indexPath); [Export ("tableView:willSelectRowAtIndexPath:")] + [return: NullAllowed] NSIndexPath WillSelectRow (UITableView tableView, NSIndexPath indexPath); [Export ("tableView:willDeselectRowAtIndexPath:")] + [return: NullAllowed] NSIndexPath WillDeselectRow (UITableView tableView, NSIndexPath indexPath); [Export ("tableView:didSelectRowAtIndexPath:")] @@ -14940,6 +14992,7 @@ interface UITableViewSource { [NoTV] [MacCatalyst (13, 1)] [Export ("tableView:titleForDeleteConfirmationButtonForRowAtIndexPath:")] + [return: NullAllowed] string TitleForDeleteConfirmation (UITableView tableView, NSIndexPath indexPath); [Export ("tableView:shouldIndentWhileEditingRowAtIndexPath:")] @@ -15202,6 +15255,7 @@ interface UITableViewCell : NSCoding, UIGestureRecognizerDelegate { UIView SelectedBackgroundView { get; set; } [Export ("reuseIdentifier", ArgumentSemantic.Copy)] + [NullAllowed] NSString ReuseIdentifier { get; } [RequiresSuper] @@ -15345,9 +15399,11 @@ interface UITableViewDataSource { nint NumberOfSections (UITableView tableView); [Export ("tableView:titleForHeaderInSection:")] + [return: NullAllowed] string TitleForHeader (UITableView tableView, nint section); [Export ("tableView:titleForFooterInSection:")] + [return: NullAllowed] string TitleForFooter (UITableView tableView, nint section); [Export ("tableView:canEditRowAtIndexPath:")] @@ -15358,6 +15414,7 @@ interface UITableViewDataSource { [MacCatalyst (13, 1)] [Export ("sectionIndexTitlesForTableView:")] + [return: NullAllowed] string [] SectionIndexTitles (UITableView tableView); [MacCatalyst (13, 1)] @@ -15401,9 +15458,11 @@ interface UITableViewDelegate { void AccessoryButtonTapped (UITableView tableView, NSIndexPath indexPath); [Export ("tableView:willSelectRowAtIndexPath:")] + [return: NullAllowed] NSIndexPath WillSelectRow (UITableView tableView, NSIndexPath indexPath); [Export ("tableView:willDeselectRowAtIndexPath:")] + [return: NullAllowed] NSIndexPath WillDeselectRow (UITableView tableView, NSIndexPath indexPath); [Export ("tableView:didSelectRowAtIndexPath:")] @@ -15418,6 +15477,7 @@ interface UITableViewDelegate { [NoTV] [MacCatalyst (13, 1)] [Export ("tableView:titleForDeleteConfirmationButtonForRowAtIndexPath:")] + [return: NullAllowed] string TitleForDeleteConfirmation (UITableView tableView, NSIndexPath indexPath); [Export ("tableView:shouldIndentWhileEditingRowAtIndexPath:")] @@ -15666,6 +15726,7 @@ interface UITableViewHeaderFooterView : UIAppearance, NSCoding { UIView BackgroundView { get; set; } [Export ("reuseIdentifier", ArgumentSemantic.Copy)] + [NullAllowed] NSString ReuseIdentifier { get; } [DesignatedInitializer] @@ -18915,9 +18976,11 @@ interface UITextChecker { NSRange RangeOfMisspelledWordInString (string stringToCheck, NSRange range, nint startingOffset, bool wrapFlag, string language); [Export ("guessesForWordRange:inString:language:")] + [return: NullAllowed] string [] GuessesForWordRange (NSRange range, string str, string language); [Export ("completionsForPartialWordRange:inString:language:")] + [return: NullAllowed] string [] CompletionsForPartialWordRange (NSRange range, string str, string language); [Export ("ignoreWord:")] @@ -19853,6 +19916,7 @@ interface UITextInputMode : NSSecureCoding { UITextInputMode CurrentInputMode { get; } [Export ("primaryLanguage", ArgumentSemantic.Retain)] + [NullAllowed] string PrimaryLanguage { get; } [Field ("UITextInputCurrentInputModeDidChangeNotification")] @@ -19879,12 +19943,14 @@ partial interface UIPrinter { string DisplayName { get; } [Export ("displayLocation")] + [NullAllowed] string DisplayLocation { get; } [Export ("supportedJobTypes")] UIPrinterJobTypes SupportedJobTypes { get; } [Export ("makeAndModel")] + [NullAllowed] string MakeAndModel { get; } [Export ("supportsColor")] @@ -20398,6 +20464,7 @@ interface UIMarkupTextPrintFormatter { [DesignatedDefaultCtor] interface UIMotionEffect : NSCoding, NSCopying { [Export ("keyPathsAndRelativeValuesForViewerOffset:")] + [return: NullAllowed] NSDictionary ComputeKeyPathsAndRelativeValues (UIOffset viewerOffset); } @@ -20665,10 +20732,12 @@ interface UIInteraction { partial interface UITextDocumentProxy : UIKeyInput { [Abstract] [Export ("documentContextBeforeInput")] + [NullAllowed] string DocumentContextBeforeInput { get; } [Abstract] [Export ("documentContextAfterInput")] + [NullAllowed] string DocumentContextAfterInput { get; } [Abstract] @@ -21234,10 +21303,12 @@ interface UIGuidedAccessRestrictionDelegate { interface UICollectionViewFocusUpdateContext { [Export ("previouslyFocusedIndexPath", ArgumentSemantic.Strong)] - NSIndexPath PreviouslyFocusedIndexPath { [return: NullAllowed] get; } + [NullAllowed] + NSIndexPath PreviouslyFocusedIndexPath { get; } [Export ("nextFocusedIndexPath", ArgumentSemantic.Strong)] - NSIndexPath NextFocusedIndexPath { [return: NullAllowed] get; } + [NullAllowed] + NSIndexPath NextFocusedIndexPath { get; } } [MacCatalyst (13, 1)] @@ -21594,10 +21665,12 @@ interface UIPreviewInteractionDelegate { interface UITableViewFocusUpdateContext { [Export ("previouslyFocusedIndexPath", ArgumentSemantic.Strong)] - NSIndexPath PreviouslyFocusedIndexPath { [return: NullAllowed] get; } + [NullAllowed] + NSIndexPath PreviouslyFocusedIndexPath { get; } [Export ("nextFocusedIndexPath", ArgumentSemantic.Strong)] - NSIndexPath NextFocusedIndexPath { [return: NullAllowed] get; } + [NullAllowed] + NSIndexPath NextFocusedIndexPath { get; } } [NoiOS] diff --git a/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-UIKit.ignore b/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-UIKit.ignore index 9fc752ab787b..50b188b86fcd 100644 --- a/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-UIKit.ignore +++ b/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-UIKit.ignore @@ -143,52 +143,9 @@ !extra-null-allowed! 'UIKit.UIView UIKit.UIScreen::SnapshotView(System.Boolean)' has a extraneous [NullAllowed] on return type # Initial result from new rule missing-null-allowed -!missing-null-allowed! 'CoreAnimation.CADisplayLink UIKit.UIScreen::CreateDisplayLink(Foundation.NSObject,ObjCRuntime.Selector)' is missing an [NullAllowed] on return type !missing-null-allowed! 'Foundation.NSArray Foundation.NSBundle::LoadNib(System.String,Foundation.NSObject,Foundation.NSDictionary)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSAttributedString UIKit.UIButton::get_CurrentAttributedTitle()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSAttributedString UIKit.UIButton::GetAttributedTitle(UIKit.UIControlState)' is missing an [NullAllowed] on return type !missing-null-allowed! 'Foundation.NSAttributedString UIKit.UIPickerViewDelegate::GetAttributedTitle(UIKit.UIPickerView,System.IntPtr,System.IntPtr)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSData UIKit.UIPasteboard::DataForPasteboardType(System.String)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSData[] UIKit.UIPasteboard::GetDataForPasteboardType(System.String,Foundation.NSIndexSet)' is missing an [NullAllowed] on parameter #1 -!missing-null-allowed! 'Foundation.NSData[] UIKit.UIPasteboard::GetDataForPasteboardType(System.String,Foundation.NSIndexSet)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSData[] UIKit.UIPasteboard::GetValuesForPasteboardType(System.String,Foundation.NSIndexSet)' is missing an [NullAllowed] on parameter #1 -!missing-null-allowed! 'Foundation.NSData[] UIKit.UIPasteboard::GetValuesForPasteboardType(System.String,Foundation.NSIndexSet)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSDictionary UIKit.UIBarItem::_GetTitleTextAttributes(UIKit.UIControlState)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSDictionary UIKit.UICollectionViewLayoutInvalidationContext::get_InvalidatedDecorationIndexPaths()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSDictionary UIKit.UICollectionViewLayoutInvalidationContext::get_InvalidatedSupplementaryIndexPaths()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSDictionary UIKit.UIDocument::GetFileAttributesToWrite(Foundation.NSUrl,UIKit.UIDocumentSaveOperation,Foundation.NSError&)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSDictionary UIKit.UIMotionEffect::ComputeKeyPathsAndRelativeValues(UIKit.UIOffset)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSDictionary UIKit.UISearchBar::_GetScopeBarButtonTitleTextAttributes(UIKit.UIControlState)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSIndexPath UIKit.UICollectionViewFocusUpdateContext::get_NextFocusedIndexPath()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSIndexPath UIKit.UICollectionViewFocusUpdateContext::get_PreviouslyFocusedIndexPath()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSIndexPath UIKit.UITableViewDelegate::WillDeselectRow(UIKit.UITableView,Foundation.NSIndexPath)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSIndexPath UIKit.UITableViewDelegate::WillSelectRow(UIKit.UITableView,Foundation.NSIndexPath)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSIndexPath UIKit.UITableViewFocusUpdateContext::get_NextFocusedIndexPath()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSIndexPath UIKit.UITableViewFocusUpdateContext::get_PreviouslyFocusedIndexPath()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSIndexPath[] UIKit.UICollectionViewLayoutInvalidationContext::get_InvalidatedItemIndexPaths()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSIndexSet UIKit.UIPasteboard::ItemSetWithPasteboardTypes(System.String[])' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSNumber[] UIKit.UIImagePickerController::AvailableCaptureModesForCameraDevice(UIKit.UIImagePickerControllerCameraDevice)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSObject UIKit.UIActivityItemProvider::get_PlaceholderItem()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSObject UIKit.UIActivityItemSource::GetItemForActivity(UIKit.UIActivityViewController,Foundation.NSString)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSObject UIKit.UIDocument::ContentsForType(System.String,Foundation.NSError&)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSObject UIKit.UIFontDescriptor::GetObject(Foundation.NSString)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSObject UIKit.UIManagedDocument::AdditionalContent(Foundation.NSUrl,Foundation.NSError&)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSObject UIKit.UIPasteboard::GetValue(System.String)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSObject UIKit.UIResponder::GetTargetForAction(ObjCRuntime.Selector,Foundation.NSObject)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSObject[] UIKit.UICollisionBehavior::get_BoundaryIdentifiers()' is missing an [NullAllowed] on return type !missing-null-allowed! 'Foundation.NSProgress UIKit.UIDocument::get_Progress()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSSet UIKit.UIEvent::get_AllTouches()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSSet UIKit.UIEvent::TouchesForGestureRecognizer(UIKit.UIGestureRecognizer)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSSet UIKit.UIEvent::TouchesForView(UIKit.UIView)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSSet UIKit.UIEvent::TouchesForWindow(UIKit.UIWindow)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSString UIKit.UIActivity::get_Type()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSString UIKit.UIActivityItemProvider::get_ActivityType()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSString UIKit.UICollectionReusableView::get_ReuseIdentifier()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSString UIKit.UIResponder::get_TextInputContextIdentifier()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSString UIKit.UITableViewCell::get_ReuseIdentifier()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSString UIKit.UITableViewHeaderFooterView::get_ReuseIdentifier()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSUuid UIKit.UIDevice::get_IdentifierForVendor()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'ObjCRuntime.Class UIKit.UIStateRestoring::get_ObjectRestorationClass()' is missing an [NullAllowed] on return type !missing-null-allowed! 'System.Boolean UIKit.UIApplicationDelegate::FinishedLaunching(UIKit.UIApplication,Foundation.NSDictionary)' is missing an [NullAllowed] on parameter #1 !missing-null-allowed! 'System.Boolean UIKit.UIApplicationDelegate::WillFinishLaunching(UIKit.UIApplication,Foundation.NSDictionary)' is missing an [NullAllowed] on parameter #1 !missing-null-allowed! 'System.Boolean UIKit.UIManagedDocument::ConfigurePersistentStoreCoordinator(Foundation.NSUrl,System.String,System.String,Foundation.NSDictionary,Foundation.NSError)' is missing an [NullAllowed] on parameter #2 @@ -202,32 +159,6 @@ !missing-null-allowed! 'System.Double UIKit.UIViewControllerAnimatedTransitioning::TransitionDuration(UIKit.IUIViewControllerContextTransitioning)' is missing an [NullAllowed] on parameter #0 !missing-null-allowed! 'System.IntPtr UIKit.UIApplication::BeginBackgroundTask(System.String,System.Action)' is missing an [NullAllowed] on parameter #0 !missing-null-allowed! 'System.IntPtr UIKit.UIApplication::BeginBackgroundTask(System.String,System.Action)' is missing an [NullAllowed] on parameter #1 -!missing-null-allowed! 'System.String UIKit.UIActivity::get_Title()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String UIKit.UIAlertAction::get_Title()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String UIKit.UIButton::get_CurrentTitle()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String UIKit.UIButton::Title(UIKit.UIControlState)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String UIKit.UICollectionViewLayoutAttributes::get_RepresentedElementKind()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String UIKit.UIDocument::get_FileType()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String UIKit.UIDocument::get_SavingFileType()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String UIKit.UIPickerViewAccessibilityDelegate::GetAccessibilityHint(UIKit.UIPickerView,System.IntPtr)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String UIKit.UIPickerViewAccessibilityDelegate::GetAccessibilityLabel(UIKit.UIPickerView,System.IntPtr)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String UIKit.UIPickerViewDelegate::GetTitle(UIKit.UIPickerView,System.IntPtr,System.IntPtr)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String UIKit.UIPrinter::get_DisplayLocation()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String UIKit.UIPrinter::get_MakeAndModel()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String UIKit.UIScrollViewAccessibilityDelegate::GetAccessibilityScrollStatus(UIKit.UIScrollView)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String UIKit.UISegmentedControl::TitleAt(System.IntPtr)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String UIKit.UITableViewDataSource::TitleForFooter(UIKit.UITableView,System.IntPtr)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String UIKit.UITableViewDataSource::TitleForHeader(UIKit.UITableView,System.IntPtr)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String UIKit.UITableViewDelegate::TitleForDeleteConfirmation(UIKit.UITableView,Foundation.NSIndexPath)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String UIKit.UITextDocumentProxy::get_DocumentContextAfterInput()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String UIKit.UITextDocumentProxy::get_DocumentContextBeforeInput()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String UIKit.UITextInputMode::get_PrimaryLanguage()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String[] UIKit.UIControl::GetActions(Foundation.NSObject,UIKit.UIControlEvent)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String[] UIKit.UIDictationPhrase::get_AlternativeInterpretations()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String[] UIKit.UIImagePickerController::AvailableMediaTypes(UIKit.UIImagePickerControllerSourceType)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String[] UIKit.UITableViewDataSource::SectionIndexTitles(UIKit.UITableView)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String[] UIKit.UITextChecker::CompletionsForPartialWordRange(Foundation.NSRange,System.String,System.String)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String[] UIKit.UITextChecker::GuessesForWordRange(Foundation.NSRange,System.String,System.String)' is missing an [NullAllowed] on return type !missing-null-allowed! 'System.Void Foundation.NSObject::set_AccessibilityAttributedUserInputLabels(Foundation.NSAttributedString[])' is missing an [NullAllowed] on parameter #0 !missing-null-allowed! 'System.Void Foundation.NSObject::set_AccessibilityUserInputLabels(System.String[])' is missing an [NullAllowed] on parameter #0 !missing-null-allowed! 'System.Void UIKit.UIAccessibilityCustomAction::.ctor(System.String,Foundation.NSObject,ObjCRuntime.Selector)' is missing an [NullAllowed] on parameter #1 diff --git a/tests/xtro-sharpie/api-annotations-dotnet/iOS-UIKit.ignore b/tests/xtro-sharpie/api-annotations-dotnet/iOS-UIKit.ignore index 7a4d4f38e100..5fa5783bcd48 100644 --- a/tests/xtro-sharpie/api-annotations-dotnet/iOS-UIKit.ignore +++ b/tests/xtro-sharpie/api-annotations-dotnet/iOS-UIKit.ignore @@ -147,52 +147,9 @@ !extra-null-allowed! 'UIKit.UIView UIKit.UIScreen::SnapshotView(System.Boolean)' has a extraneous [NullAllowed] on return type # Initial result from new rule missing-null-allowed -!missing-null-allowed! 'CoreAnimation.CADisplayLink UIKit.UIScreen::CreateDisplayLink(Foundation.NSObject,ObjCRuntime.Selector)' is missing an [NullAllowed] on return type !missing-null-allowed! 'Foundation.NSArray Foundation.NSBundle::LoadNib(System.String,Foundation.NSObject,Foundation.NSDictionary)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSAttributedString UIKit.UIButton::get_CurrentAttributedTitle()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSAttributedString UIKit.UIButton::GetAttributedTitle(UIKit.UIControlState)' is missing an [NullAllowed] on return type !missing-null-allowed! 'Foundation.NSAttributedString UIKit.UIPickerViewDelegate::GetAttributedTitle(UIKit.UIPickerView,System.IntPtr,System.IntPtr)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSData UIKit.UIPasteboard::DataForPasteboardType(System.String)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSData[] UIKit.UIPasteboard::GetDataForPasteboardType(System.String,Foundation.NSIndexSet)' is missing an [NullAllowed] on parameter #1 -!missing-null-allowed! 'Foundation.NSData[] UIKit.UIPasteboard::GetDataForPasteboardType(System.String,Foundation.NSIndexSet)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSData[] UIKit.UIPasteboard::GetValuesForPasteboardType(System.String,Foundation.NSIndexSet)' is missing an [NullAllowed] on parameter #1 -!missing-null-allowed! 'Foundation.NSData[] UIKit.UIPasteboard::GetValuesForPasteboardType(System.String,Foundation.NSIndexSet)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSDictionary UIKit.UIBarItem::_GetTitleTextAttributes(UIKit.UIControlState)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSDictionary UIKit.UICollectionViewLayoutInvalidationContext::get_InvalidatedDecorationIndexPaths()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSDictionary UIKit.UICollectionViewLayoutInvalidationContext::get_InvalidatedSupplementaryIndexPaths()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSDictionary UIKit.UIDocument::GetFileAttributesToWrite(Foundation.NSUrl,UIKit.UIDocumentSaveOperation,Foundation.NSError&)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSDictionary UIKit.UIMotionEffect::ComputeKeyPathsAndRelativeValues(UIKit.UIOffset)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSDictionary UIKit.UISearchBar::_GetScopeBarButtonTitleTextAttributes(UIKit.UIControlState)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSIndexPath UIKit.UICollectionViewFocusUpdateContext::get_NextFocusedIndexPath()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSIndexPath UIKit.UICollectionViewFocusUpdateContext::get_PreviouslyFocusedIndexPath()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSIndexPath UIKit.UITableViewDelegate::WillDeselectRow(UIKit.UITableView,Foundation.NSIndexPath)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSIndexPath UIKit.UITableViewDelegate::WillSelectRow(UIKit.UITableView,Foundation.NSIndexPath)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSIndexPath UIKit.UITableViewFocusUpdateContext::get_NextFocusedIndexPath()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSIndexPath UIKit.UITableViewFocusUpdateContext::get_PreviouslyFocusedIndexPath()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSIndexPath[] UIKit.UICollectionViewLayoutInvalidationContext::get_InvalidatedItemIndexPaths()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSIndexSet UIKit.UIPasteboard::ItemSetWithPasteboardTypes(System.String[])' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSNumber[] UIKit.UIImagePickerController::AvailableCaptureModesForCameraDevice(UIKit.UIImagePickerControllerCameraDevice)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSObject UIKit.UIActivityItemProvider::get_PlaceholderItem()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSObject UIKit.UIActivityItemSource::GetItemForActivity(UIKit.UIActivityViewController,Foundation.NSString)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSObject UIKit.UIDocument::ContentsForType(System.String,Foundation.NSError&)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSObject UIKit.UIFontDescriptor::GetObject(Foundation.NSString)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSObject UIKit.UIManagedDocument::AdditionalContent(Foundation.NSUrl,Foundation.NSError&)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSObject UIKit.UIPasteboard::GetValue(System.String)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSObject UIKit.UIResponder::GetTargetForAction(ObjCRuntime.Selector,Foundation.NSObject)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSObject[] UIKit.UICollisionBehavior::get_BoundaryIdentifiers()' is missing an [NullAllowed] on return type !missing-null-allowed! 'Foundation.NSProgress UIKit.UIDocument::get_Progress()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSSet UIKit.UIEvent::get_AllTouches()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSSet UIKit.UIEvent::TouchesForGestureRecognizer(UIKit.UIGestureRecognizer)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSSet UIKit.UIEvent::TouchesForView(UIKit.UIView)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSSet UIKit.UIEvent::TouchesForWindow(UIKit.UIWindow)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSString UIKit.UIActivity::get_Type()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSString UIKit.UIActivityItemProvider::get_ActivityType()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSString UIKit.UICollectionReusableView::get_ReuseIdentifier()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSString UIKit.UIResponder::get_TextInputContextIdentifier()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSString UIKit.UITableViewCell::get_ReuseIdentifier()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSString UIKit.UITableViewHeaderFooterView::get_ReuseIdentifier()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSUuid UIKit.UIDevice::get_IdentifierForVendor()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'ObjCRuntime.Class UIKit.UIStateRestoring::get_ObjectRestorationClass()' is missing an [NullAllowed] on return type !missing-null-allowed! 'System.Boolean UIKit.UIApplicationDelegate::FinishedLaunching(UIKit.UIApplication,Foundation.NSDictionary)' is missing an [NullAllowed] on parameter #1 !missing-null-allowed! 'System.Boolean UIKit.UIApplicationDelegate::WillFinishLaunching(UIKit.UIApplication,Foundation.NSDictionary)' is missing an [NullAllowed] on parameter #1 !missing-null-allowed! 'System.Boolean UIKit.UIManagedDocument::ConfigurePersistentStoreCoordinator(Foundation.NSUrl,System.String,System.String,Foundation.NSDictionary,Foundation.NSError)' is missing an [NullAllowed] on parameter #2 @@ -206,32 +163,6 @@ !missing-null-allowed! 'System.Double UIKit.UIViewControllerAnimatedTransitioning::TransitionDuration(UIKit.IUIViewControllerContextTransitioning)' is missing an [NullAllowed] on parameter #0 !missing-null-allowed! 'System.IntPtr UIKit.UIApplication::BeginBackgroundTask(System.String,System.Action)' is missing an [NullAllowed] on parameter #0 !missing-null-allowed! 'System.IntPtr UIKit.UIApplication::BeginBackgroundTask(System.String,System.Action)' is missing an [NullAllowed] on parameter #1 -!missing-null-allowed! 'System.String UIKit.UIActivity::get_Title()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String UIKit.UIAlertAction::get_Title()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String UIKit.UIButton::get_CurrentTitle()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String UIKit.UIButton::Title(UIKit.UIControlState)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String UIKit.UICollectionViewLayoutAttributes::get_RepresentedElementKind()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String UIKit.UIDocument::get_FileType()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String UIKit.UIDocument::get_SavingFileType()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String UIKit.UIPickerViewAccessibilityDelegate::GetAccessibilityHint(UIKit.UIPickerView,System.IntPtr)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String UIKit.UIPickerViewAccessibilityDelegate::GetAccessibilityLabel(UIKit.UIPickerView,System.IntPtr)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String UIKit.UIPickerViewDelegate::GetTitle(UIKit.UIPickerView,System.IntPtr,System.IntPtr)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String UIKit.UIPrinter::get_DisplayLocation()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String UIKit.UIPrinter::get_MakeAndModel()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String UIKit.UIScrollViewAccessibilityDelegate::GetAccessibilityScrollStatus(UIKit.UIScrollView)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String UIKit.UISegmentedControl::TitleAt(System.IntPtr)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String UIKit.UITableViewDataSource::TitleForFooter(UIKit.UITableView,System.IntPtr)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String UIKit.UITableViewDataSource::TitleForHeader(UIKit.UITableView,System.IntPtr)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String UIKit.UITableViewDelegate::TitleForDeleteConfirmation(UIKit.UITableView,Foundation.NSIndexPath)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String UIKit.UITextDocumentProxy::get_DocumentContextAfterInput()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String UIKit.UITextDocumentProxy::get_DocumentContextBeforeInput()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String UIKit.UITextInputMode::get_PrimaryLanguage()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String[] UIKit.UIControl::GetActions(Foundation.NSObject,UIKit.UIControlEvent)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String[] UIKit.UIDictationPhrase::get_AlternativeInterpretations()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String[] UIKit.UIImagePickerController::AvailableMediaTypes(UIKit.UIImagePickerControllerSourceType)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String[] UIKit.UITableViewDataSource::SectionIndexTitles(UIKit.UITableView)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String[] UIKit.UITextChecker::CompletionsForPartialWordRange(Foundation.NSRange,System.String,System.String)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String[] UIKit.UITextChecker::GuessesForWordRange(Foundation.NSRange,System.String,System.String)' is missing an [NullAllowed] on return type !missing-null-allowed! 'System.Void Foundation.NSObject::set_AccessibilityAttributedUserInputLabels(Foundation.NSAttributedString[])' is missing an [NullAllowed] on parameter #0 !missing-null-allowed! 'System.Void Foundation.NSObject::set_AccessibilityUserInputLabels(System.String[])' is missing an [NullAllowed] on parameter #0 !missing-null-allowed! 'System.Void UIKit.UIAccessibilityCustomAction::.ctor(System.String,Foundation.NSObject,ObjCRuntime.Selector)' is missing an [NullAllowed] on parameter #1 diff --git a/tests/xtro-sharpie/api-annotations-dotnet/tvOS-UIKit.ignore b/tests/xtro-sharpie/api-annotations-dotnet/tvOS-UIKit.ignore index 0c56cfbf7c49..6ed315a0cbea 100644 --- a/tests/xtro-sharpie/api-annotations-dotnet/tvOS-UIKit.ignore +++ b/tests/xtro-sharpie/api-annotations-dotnet/tvOS-UIKit.ignore @@ -179,35 +179,7 @@ !extra-null-allowed! 'UIKit.UIView UIKit.UIScreen::SnapshotView(System.Boolean)' has a extraneous [NullAllowed] on return type # Initial result from new rule missing-null-allowed -!missing-null-allowed! 'CoreAnimation.CADisplayLink UIKit.UIScreen::CreateDisplayLink(Foundation.NSObject,ObjCRuntime.Selector)' is missing an [NullAllowed] on return type !missing-null-allowed! 'Foundation.NSArray Foundation.NSBundle::LoadNib(System.String,Foundation.NSObject,Foundation.NSDictionary)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSAttributedString UIKit.UIButton::get_CurrentAttributedTitle()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSAttributedString UIKit.UIButton::GetAttributedTitle(UIKit.UIControlState)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSDictionary UIKit.UIBarItem::_GetTitleTextAttributes(UIKit.UIControlState)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSDictionary UIKit.UICollectionViewLayoutInvalidationContext::get_InvalidatedDecorationIndexPaths()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSDictionary UIKit.UICollectionViewLayoutInvalidationContext::get_InvalidatedSupplementaryIndexPaths()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSDictionary UIKit.UIMotionEffect::ComputeKeyPathsAndRelativeValues(UIKit.UIOffset)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSDictionary UIKit.UISearchBar::_GetScopeBarButtonTitleTextAttributes(UIKit.UIControlState)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSIndexPath UIKit.UICollectionViewFocusUpdateContext::get_NextFocusedIndexPath()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSIndexPath UIKit.UICollectionViewFocusUpdateContext::get_PreviouslyFocusedIndexPath()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSIndexPath UIKit.UITableViewDelegate::WillDeselectRow(UIKit.UITableView,Foundation.NSIndexPath)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSIndexPath UIKit.UITableViewDelegate::WillSelectRow(UIKit.UITableView,Foundation.NSIndexPath)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSIndexPath UIKit.UITableViewFocusUpdateContext::get_NextFocusedIndexPath()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSIndexPath UIKit.UITableViewFocusUpdateContext::get_PreviouslyFocusedIndexPath()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSIndexPath[] UIKit.UICollectionViewLayoutInvalidationContext::get_InvalidatedItemIndexPaths()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSObject UIKit.UIFontDescriptor::GetObject(Foundation.NSString)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSObject UIKit.UIResponder::GetTargetForAction(ObjCRuntime.Selector,Foundation.NSObject)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSObject[] UIKit.UICollisionBehavior::get_BoundaryIdentifiers()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSSet UIKit.UIEvent::get_AllTouches()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSSet UIKit.UIEvent::TouchesForGestureRecognizer(UIKit.UIGestureRecognizer)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSSet UIKit.UIEvent::TouchesForView(UIKit.UIView)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSSet UIKit.UIEvent::TouchesForWindow(UIKit.UIWindow)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSString UIKit.UICollectionReusableView::get_ReuseIdentifier()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSString UIKit.UIResponder::get_TextInputContextIdentifier()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSString UIKit.UITableViewCell::get_ReuseIdentifier()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSString UIKit.UITableViewHeaderFooterView::get_ReuseIdentifier()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSUuid UIKit.UIDevice::get_IdentifierForVendor()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'ObjCRuntime.Class UIKit.UIStateRestoring::get_ObjectRestorationClass()' is missing an [NullAllowed] on return type !missing-null-allowed! 'System.Boolean UIKit.UIApplicationDelegate::FinishedLaunching(UIKit.UIApplication,Foundation.NSDictionary)' is missing an [NullAllowed] on parameter #1 !missing-null-allowed! 'System.Boolean UIKit.UIApplicationDelegate::WillFinishLaunching(UIKit.UIApplication,Foundation.NSDictionary)' is missing an [NullAllowed] on parameter #1 !missing-null-allowed! 'System.Boolean UIKit.UIScrollView::TouchesShouldBegin(Foundation.NSSet,UIKit.UIEvent,UIKit.UIView)' is missing an [NullAllowed] on parameter #1 @@ -216,22 +188,6 @@ !missing-null-allowed! 'System.Double UIKit.UIViewControllerAnimatedTransitioning::TransitionDuration(UIKit.IUIViewControllerContextTransitioning)' is missing an [NullAllowed] on parameter #0 !missing-null-allowed! 'System.IntPtr UIKit.UIApplication::BeginBackgroundTask(System.String,System.Action)' is missing an [NullAllowed] on parameter #0 !missing-null-allowed! 'System.IntPtr UIKit.UIApplication::BeginBackgroundTask(System.String,System.Action)' is missing an [NullAllowed] on parameter #1 -!missing-null-allowed! 'System.String UIKit.UIAlertAction::get_Title()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String UIKit.UIButton::get_CurrentTitle()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String UIKit.UIButton::Title(UIKit.UIControlState)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String UIKit.UICollectionViewLayoutAttributes::get_RepresentedElementKind()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String UIKit.UIScrollViewAccessibilityDelegate::GetAccessibilityScrollStatus(UIKit.UIScrollView)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String UIKit.UISegmentedControl::TitleAt(System.IntPtr)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String UIKit.UITableViewDataSource::TitleForFooter(UIKit.UITableView,System.IntPtr)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String UIKit.UITableViewDataSource::TitleForHeader(UIKit.UITableView,System.IntPtr)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String UIKit.UITextDocumentProxy::get_DocumentContextAfterInput()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String UIKit.UITextDocumentProxy::get_DocumentContextBeforeInput()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String UIKit.UITextInputMode::get_PrimaryLanguage()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String[] UIKit.UIControl::GetActions(Foundation.NSObject,UIKit.UIControlEvent)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String[] UIKit.UIDictationPhrase::get_AlternativeInterpretations()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String[] UIKit.UITableViewDataSource::SectionIndexTitles(UIKit.UITableView)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String[] UIKit.UITextChecker::CompletionsForPartialWordRange(Foundation.NSRange,System.String,System.String)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String[] UIKit.UITextChecker::GuessesForWordRange(Foundation.NSRange,System.String,System.String)' is missing an [NullAllowed] on return type !missing-null-allowed! 'System.Void Foundation.NSObject::set_AccessibilityAttributedUserInputLabels(Foundation.NSAttributedString[])' is missing an [NullAllowed] on parameter #0 !missing-null-allowed! 'System.Void Foundation.NSObject::set_AccessibilityUserInputLabels(System.String[])' is missing an [NullAllowed] on parameter #0 !missing-null-allowed! 'System.Void UIKit.UIAccessibilityCustomAction::.ctor(System.String,Foundation.NSObject,ObjCRuntime.Selector)' is missing an [NullAllowed] on parameter #1 From 3ffc1daad2a955a7c201a2da6566ba578f8d1cd4 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Tue, 14 Jan 2025 10:40:23 +0100 Subject: [PATCH 3/5] [tests] Validate input when serving files in ProxyTest. (#21951) Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2334856. --- tests/monotouch-test/CoreFoundation/ProxyTest.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/monotouch-test/CoreFoundation/ProxyTest.cs b/tests/monotouch-test/CoreFoundation/ProxyTest.cs index 23af0b5dc5f0..d3dc852811fa 100644 --- a/tests/monotouch-test/CoreFoundation/ProxyTest.cs +++ b/tests/monotouch-test/CoreFoundation/ProxyTest.cs @@ -76,6 +76,9 @@ public void Setup () var context = listener.GetContext (); var request = context.Request; var pacPath = Path.Combine (NSBundle.MainBundle.ResourcePath, request.RawUrl.Substring (1)); + pacPath = Path.GetFullPath (pacPath); + if (!pacPath.StartsWith (Path.GetFullPath (NSBundle.MainBundle.ResourcePath) + Path.DirectorySeparatorChar)) + throw new InvalidOperationException ($"Invalid access: {request.RawUrl}"); Console.WriteLine ($" Serving {pacPath}"); var buf = File.ReadAllBytes (pacPath); context.Response.ContentLength64 = buf.Length; From 64167199c52ffebda1e94b6f4c996c742fb2e555 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Tue, 14 Jan 2025 10:42:09 +0100 Subject: [PATCH 4/5] [xharness] Validate input when serving files in the web view. (#21949) Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2320249. --- tests/xharness/Jenkins/TestServer.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/xharness/Jenkins/TestServer.cs b/tests/xharness/Jenkins/TestServer.cs index 82ac3a77501a..0c1609be8102 100644 --- a/tests/xharness/Jenkins/TestServer.cs +++ b/tests/xharness/Jenkins/TestServer.cs @@ -279,8 +279,16 @@ IEnumerable find_tasks (StreamWriter writer, string ids) jenkins.GenerateReport (); } - if (serveFile is null) + if (serveFile is null) { serveFile = Path.Combine (Path.GetDirectoryName (jenkins.LogDirectory), request.Url.LocalPath.Substring (1)); + serveFile = Path.GetFullPath (serveFile); + if (!serveFile.StartsWith (Path.GetDirectoryName (Path.GetFullPath (jenkins.LogDirectory)) + Path.DirectorySeparatorChar)) { + Console.WriteLine ($"400: {request.Url.LocalPath}"); + response.StatusCode = 400; + response.OutputStream.WriteByte ((byte) '?'); + break; + } + } var path = serveFile; if (File.Exists (path)) { var buffer = new byte [4096]; From 9de395d62bfc360a3370767acfefa26bf2b1dd19 Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Tue, 14 Jan 2025 04:47:16 -0500 Subject: [PATCH 5/5] [RGen] Use the correct attribute for field properties. (#21959) We cannot use Export because we need to be ablet to pass the library name to generate the property field correctly. This change moves from using Export to Field which allows to mark a property as a field AND will allow use to add the library name. This change + the one in PR https://github.com/xamarin/xamarin-macios/pull/21945 improves the way the Library.g.cs file is generated. --------- Co-authored-by: GitHub Actions Autoformatter --- src/ObjCBindings/FieldTag.cs | 17 ------ .../Attributes/FieldData.cs | 28 +++++----- .../AttributesNames.cs | 16 +++++- .../DataModel/CodeChanges.cs | 2 +- .../DataModel/Property.cs | 6 +- .../Extensions/TypeSymbolExtensions.cs | 40 ++++++++++---- .../Attributes/ExportDataTests.cs | 20 +++---- .../AttributesNamesTests.cs | 12 +++- .../DataModel/ClassCodeChangesTests.cs | 10 ++-- .../DataModel/CodeChangesTests.cs | 16 +++++- .../DataModel/InterfaceCodeChangesTests.cs | 7 +-- .../DataModel/PropertyTests.cs | 22 ++++++++ .../Extensions/TypeSymbolExtensionsTests.cs | 55 ++++++++++++++----- 13 files changed, 169 insertions(+), 82 deletions(-) diff --git a/src/ObjCBindings/FieldTag.cs b/src/ObjCBindings/FieldTag.cs index 8e756e7daeab..7a92e88bb087 100644 --- a/src/ObjCBindings/FieldTag.cs +++ b/src/ObjCBindings/FieldTag.cs @@ -5,23 +5,6 @@ namespace ObjCBindings { - /// - /// The exported constant/field is a class/interface property field. - /// - [Flags] - [Experimental ("APL0003")] - public enum Field { - /// - /// Use the default values. - /// - Default = 0, - - /// - /// Field represents a notification in ObjC. - /// - Notification = 1 << 2, - } - /// /// Field flag that states that the field is used as a Enum value. /// diff --git a/src/rgen/Microsoft.Macios.Generator/Attributes/FieldData.cs b/src/rgen/Microsoft.Macios.Generator/Attributes/FieldData.cs index c927de5e9a57..d9200c7e8ee8 100644 --- a/src/rgen/Microsoft.Macios.Generator/Attributes/FieldData.cs +++ b/src/rgen/Microsoft.Macios.Generator/Attributes/FieldData.cs @@ -27,6 +27,10 @@ internal FieldData (string symbolName, string? libraryName, T? flags) Flags = flags; } + internal FieldData (string symbolName, T? flags) : this (symbolName, null, flags) { } + + internal FieldData (string symbolName) : this (symbolName, null, default) { } + public static bool TryParse (AttributeData attributeData, [NotNullWhen (true)] out FieldData? data) => TryParse (attributeData, out data, out _); @@ -52,21 +56,19 @@ public static bool TryParse (AttributeData attributeData, if (!attributeData.ConstructorArguments [0].TryGetIdentifier (out symbolName)) { return false; } - switch (attributeData.ConstructorArguments [1].Value) { - // there are two possible cases here: - // 1. The second argument is a string - // 2. The second argument is an enum - case T enumValue: - flags = enumValue; - break; - case string lib: - libraryName = lib; - break; - default: - // unexpected value :/ - error = new (ParsingError.UnknownConstructor, attributeData.ConstructorArguments.Length); + + if (attributeData.ConstructorArguments [1].Value is string) { + libraryName = (string?) attributeData.ConstructorArguments [1].Value!; + } else { + flags = (T) attributeData.ConstructorArguments [1].Value!; + } + break; + case 3: + if (!attributeData.ConstructorArguments [0].TryGetIdentifier (out symbolName)) { return false; } + libraryName = (string?) attributeData.ConstructorArguments [1].Value!; + flags = (T) attributeData.ConstructorArguments [2].Value!; break; default: // 0 should not be an option. diff --git a/src/rgen/Microsoft.Macios.Generator/AttributesNames.cs b/src/rgen/Microsoft.Macios.Generator/AttributesNames.cs index 436e45225e2f..f7c9f4bc3dc2 100644 --- a/src/rgen/Microsoft.Macios.Generator/AttributesNames.cs +++ b/src/rgen/Microsoft.Macios.Generator/AttributesNames.cs @@ -16,7 +16,7 @@ static class AttributesNames { public const string BindingStrongDictionaryAttribute = "ObjCBindings.BindingTypeAttribute"; public const string FieldAttribute = "ObjCBindings.FieldAttribute"; public const string EnumFieldAttribute = "ObjCBindings.FieldAttribute"; - public const string ExportFieldAttribute = "ObjCBindings.ExportAttribute"; + public const string FieldPropertyAttribute = "ObjCBindings.FieldAttribute"; public const string ExportPropertyAttribute = "ObjCBindings.ExportAttribute"; public const string ExportMethodAttribute = "ObjCBindings.ExportAttribute"; public const string SupportedOSPlatformAttribute = "System.Runtime.Versioning.SupportedOSPlatformAttribute"; @@ -55,9 +55,19 @@ static class AttributesNames { { // we cannot use a switch statement because typeof is not a constant value var type = typeof (T); - if (type == typeof (ObjCBindings.Field)) { - return ExportFieldAttribute; + if (type == typeof (ObjCBindings.Property)) { + return FieldPropertyAttribute; + } + if (type == typeof (ObjCBindings.EnumValue)) { + return EnumFieldAttribute; } + return null; + } + + public static string? GetExportAttributeName () where T : Enum + { + // we cannot use a switch statement because typeof is not a constant value + var type = typeof (T); if (type == typeof (ObjCBindings.Property)) { return ExportPropertyAttribute; } diff --git a/src/rgen/Microsoft.Macios.Generator/DataModel/CodeChanges.cs b/src/rgen/Microsoft.Macios.Generator/DataModel/CodeChanges.cs index 272a622fb23f..785bfd0ee00f 100644 --- a/src/rgen/Microsoft.Macios.Generator/DataModel/CodeChanges.cs +++ b/src/rgen/Microsoft.Macios.Generator/DataModel/CodeChanges.cs @@ -212,7 +212,7 @@ internal static bool Skip (PropertyDeclarationSyntax propertyDeclarationSyntax, // 2. Exported properties if (propertyDeclarationSyntax.Modifiers.Any (SyntaxKind.PartialKeyword)) { return !propertyDeclarationSyntax.HasAtLeastOneAttribute (semanticModel, - AttributesNames.ExportFieldAttribute, AttributesNames.ExportPropertyAttribute); + AttributesNames.FieldPropertyAttribute, AttributesNames.ExportPropertyAttribute); } return true; diff --git a/src/rgen/Microsoft.Macios.Generator/DataModel/Property.cs b/src/rgen/Microsoft.Macios.Generator/DataModel/Property.cs index a846eb51f95f..4941b10e735a 100644 --- a/src/rgen/Microsoft.Macios.Generator/DataModel/Property.cs +++ b/src/rgen/Microsoft.Macios.Generator/DataModel/Property.cs @@ -53,7 +53,7 @@ namespace Microsoft.Macios.Generator.DataModel; /// /// The data of the field attribute used to mark the value as a field binding. /// - public ExportData? ExportFieldData { get; init; } + public FieldData? ExportFieldData { get; init; } /// /// True if the property represents a Objc field. @@ -61,7 +61,7 @@ namespace Microsoft.Macios.Generator.DataModel; [MemberNotNullWhen (true, nameof (ExportFieldData))] public bool IsField => ExportFieldData is not null; - public bool IsNotification => IsField && ExportFieldData.Value.Flags.HasFlag (Field.Notification); + public bool IsNotification => IsField && ExportFieldData.Value.Flags.HasFlag (ObjCBindings.Property.Notification); /// /// The data of the field attribute used to mark the value as a property binding. @@ -211,7 +211,7 @@ public static bool TryCreate (PropertyDeclarationSyntax declaration, SemanticMod attributes: attributes, modifiers: [.. declaration.Modifiers], accessors: accessorCodeChanges) { - ExportFieldData = propertySymbol.GetExportData (), + ExportFieldData = propertySymbol.GetFieldData (), ExportPropertyData = propertySymbol.GetExportData (), }; return true; diff --git a/src/rgen/Microsoft.Macios.Generator/Extensions/TypeSymbolExtensions.cs b/src/rgen/Microsoft.Macios.Generator/Extensions/TypeSymbolExtensions.cs index 1b65a9ae2011..209966924556 100644 --- a/src/rgen/Microsoft.Macios.Generator/Extensions/TypeSymbolExtensions.cs +++ b/src/rgen/Microsoft.Macios.Generator/Extensions/TypeSymbolExtensions.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; using System.Collections.Immutable; +using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Runtime.InteropServices; using Microsoft.CodeAnalysis; @@ -193,22 +194,17 @@ public static BindingTypeData GetBindingData (this ISymbol symbol) where T return default; } - /// - /// Retrieve the data of an export attribute on a symbol. - /// - /// The tagged symbol. - /// Enum type used in the attribute. - /// The data of the export attribute if present or null if it was not found. - /// If the passed enum is unknown or not supproted as an enum for the export attribute, null will be - /// returned. - public static ExportData? GetExportData (this ISymbol symbol) where T : Enum + delegate string? GetAttributeNames (); + delegate bool TryParse (AttributeData data, [NotNullWhen (true)] out T? value) where T : struct; + + static T? GetAttribute (this ISymbol symbol, GetAttributeNames getAttributeNames, TryParse tryParse) where T : struct { var attributes = symbol.GetAttributeData (); if (attributes.Count == 0) return null; // retrieve the name of the attribute based on the flag - var attrName = AttributesNames.GetFieldAttributeName (); + var attrName = getAttributeNames (); if (attrName is null) return null; if (!attributes.TryGetValue (attrName, out var exportAttrDataList) || @@ -220,11 +216,33 @@ public static BindingTypeData GetBindingData (this ISymbol symbol) where T if (fieldSyntax is null) return null; - if (ExportData.TryParse (exportAttrData, out var exportData)) + if (tryParse (exportAttrData, out var exportData)) return exportData.Value; return null; } + /// + /// Retrieve the data of an export attribute on a symbol. + /// + /// The tagged symbol. + /// Enum type used in the attribute. + /// The data of the export attribute if present or null if it was not found. + /// If the passed enum is unknown or not supported as an enum for the export attribute, null will be + /// returned. + public static ExportData? GetExportData (this ISymbol symbol) where T : Enum + => GetAttribute> (symbol, AttributesNames.GetExportAttributeName, ExportData.TryParse); + + /// + /// Retrieve the data of a field attribute on a symbol. + /// + /// The tagged symbol. + /// Enum type used in the attribute. + /// The data of the export attribute if present or null if it was not found. + /// If the passed enum is unknown or not supported as an enum for the field attribute, null will be + /// returned. + public static FieldData? GetFieldData (this ISymbol symbol) where T : Enum + => GetAttribute> (symbol, AttributesNames.GetFieldAttributeName, FieldData.TryParse); + /// /// Returns if a type is blittable or not. /// diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/Attributes/ExportDataTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/Attributes/ExportDataTests.cs index c801977803f6..04470f323983 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/Attributes/ExportDataTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/Attributes/ExportDataTests.cs @@ -16,8 +16,8 @@ public class ExportDataTests { [Fact] public void TestExportDataEqualsDiffSelector () { - var x = new ExportData ("field1"); - var y = new ExportData ("field2"); + var x = new ExportData ("field1"); + var y = new ExportData ("field2"); Assert.False (x.Equals (y)); Assert.False (y.Equals (x)); Assert.False (x == y); @@ -27,8 +27,8 @@ public void TestExportDataEqualsDiffSelector () [Fact] public void TestExportDataEqualsDiffArgumentSemantic () { - var x = new ExportData ("property", ArgumentSemantic.None); - var y = new ExportData ("property", ArgumentSemantic.Retain); + var x = new ExportData ("property", ArgumentSemantic.None); + var y = new ExportData ("property", ArgumentSemantic.Retain); Assert.False (x.Equals (y)); Assert.False (y.Equals (x)); Assert.False (x == y); @@ -52,14 +52,14 @@ class TestDataToString : IEnumerable { public IEnumerator GetEnumerator () { yield return [ - Field.Default, - new ExportData ("symbol", ArgumentSemantic.None, Field.Default), - "{ Type: 'ObjCBindings.Field', Selector: 'symbol', ArgumentSemantic: 'None', Flags: 'Default' }" + Method.Default, + new ExportData ("symbol", ArgumentSemantic.None, Method.Default), + "{ Type: 'ObjCBindings.Method', Selector: 'symbol', ArgumentSemantic: 'None', Flags: 'Default' }" ]; yield return [ - Field.Default, - new ExportData ("symbol"), - "{ Type: 'ObjCBindings.Field', Selector: 'symbol', ArgumentSemantic: 'None', Flags: 'Default' }" + Method.Default, + new ExportData ("symbol"), + "{ Type: 'ObjCBindings.Method', Selector: 'symbol', ArgumentSemantic: 'None', Flags: 'Default' }" ]; yield return [ Property.Default, diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/AttributesNamesTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/AttributesNamesTests.cs index 02fadc628298..a3e2a56aefe6 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/AttributesNamesTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/AttributesNamesTests.cs @@ -12,9 +12,19 @@ public class AttributesNamesTests { [Theory] [InlineData (StringComparison.Ordinal, null)] [InlineData (EnumValue.Default, null)] - [InlineData (Field.Default, AttributesNames.ExportFieldAttribute)] [InlineData (Property.Default, AttributesNames.ExportPropertyAttribute)] [InlineData (Method.Default, AttributesNames.ExportMethodAttribute)] + public void GetExportAttributeName (T @enum, string? expectedName) where T : Enum + { + Assert.NotNull (@enum); + Assert.Equal (expectedName, AttributesNames.GetExportAttributeName ()); + } + + [Theory] + [InlineData (StringComparison.Ordinal, null)] + [InlineData (Method.Default, null)] + [InlineData (Property.Default, AttributesNames.FieldPropertyAttribute)] + [InlineData (EnumValue.Default, AttributesNames.EnumFieldAttribute)] public void GetFieldAttributeName (T @enum, string? expectedName) where T : Enum { Assert.NotNull (@enum); diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/ClassCodeChangesTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/ClassCodeChangesTests.cs index 8e2bab8c7f40..617345deafcc 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/ClassCodeChangesTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/ClassCodeChangesTests.cs @@ -536,7 +536,7 @@ namespace NS; [BindingType] public partial class MyClass { - [Export (""name"", Property.Notification)] + [Field (""name"", Property.Notification)] public partial string Name { get; set; } = string.Empty; } "; @@ -566,7 +566,7 @@ public partial class MyClass { returnType: ReturnTypeForString (), symbolAvailability: new (), attributes: [ - new ("ObjCBindings.ExportAttribute", ["name", "ObjCBindings.Property.Notification"]) + new ("ObjCBindings.FieldAttribute", ["name", "ObjCBindings.Property.Notification"]) ], modifiers: [ SyntaxFactory.Token (SyntaxKind.PublicKeyword), @@ -590,7 +590,7 @@ public partial class MyClass { ] ) { - ExportPropertyData = new ("name", ArgumentSemantic.None, Property.Notification) + ExportFieldData = new (symbolName: "name", flags: Property.Notification) } ] } @@ -603,7 +603,7 @@ namespace NS; [BindingType] public partial class MyClass { - [Export (""CONSTANT"")] + [Field (""CONSTANT"")] public static partial string Name { get; set; } = string.Empty; } "; @@ -633,7 +633,7 @@ public partial class MyClass { returnType: ReturnTypeForString (), symbolAvailability: new (), attributes: [ - new ("ObjCBindings.ExportAttribute", ["CONSTANT"]) + new ("ObjCBindings.FieldAttribute", ["CONSTANT"]) ], modifiers: [ SyntaxFactory.Token (SyntaxKind.PublicKeyword), diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/CodeChangesTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/CodeChangesTests.cs index 7319ba1794df..2542637ee4ae 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/CodeChangesTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/CodeChangesTests.cs @@ -123,7 +123,7 @@ public class TestClass { "; yield return [wrongAttributeInProperty, true]; - const string fieldAttributeInProperty = @" + const string exportFieldAttributeInProperty = @" using System; using Foundation; using ObjCRuntime; @@ -134,6 +134,20 @@ public class TestClass { [Export (""name"")] public partial string Name { get;set; } } +"; + yield return [exportFieldAttributeInProperty, true]; + + const string fieldAttributeInProperty = @" +using System; +using Foundation; +using ObjCRuntime; +using ObjCBindings; + +[BindingType] +public class TestClass { + [Field (""name"")] + public partial string Name { get;set; } +} "; yield return [fieldAttributeInProperty, false]; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/InterfaceCodeChangesTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/InterfaceCodeChangesTests.cs index 772aaeccbfde..1237dd03edae 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/InterfaceCodeChangesTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/InterfaceCodeChangesTests.cs @@ -9,7 +9,6 @@ using Microsoft.Macios.Generator.Attributes; using Microsoft.Macios.Generator.DataModel; using ObjCBindings; -using ObjCRuntime; using Xamarin.Tests; using Xamarin.Utils; using Xunit; @@ -296,7 +295,7 @@ namespace NS; [BindingType] public partial interface IProtocol { - [Export (""name"", Property.Notification)] + [Field (""name"", Property.Notification)] public partial string Name { get; set; } = string.Empty; } "; @@ -324,7 +323,7 @@ public partial interface IProtocol { returnType: ReturnTypeForString (), symbolAvailability: new (), attributes: [ - new ("ObjCBindings.ExportAttribute", ["name", "ObjCBindings.Property.Notification"]) + new ("ObjCBindings.FieldAttribute", ["name", "ObjCBindings.Property.Notification"]) ], modifiers: [ SyntaxFactory.Token (SyntaxKind.PublicKeyword), @@ -347,7 +346,7 @@ public partial interface IProtocol { ), ] ) { - ExportPropertyData = new ("name", ArgumentSemantic.None, Property.Notification) + ExportFieldData = new ("name", Property.Notification) } ] } diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/PropertyTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/PropertyTests.cs index 60c4a6cb9527..5ae586c027b1 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/PropertyTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/PropertyTests.cs @@ -1,5 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +#pragma warning disable APL0003 using System.Collections; using System.Collections.Generic; using System.Linq; @@ -381,6 +382,27 @@ public void CompareEquals () Assert.False (x != y); } + [Theory] + [InlineData (ObjCBindings.Property.Default, false)] + [InlineData (ObjCBindings.Property.Notification, true)] +#pragma warning disable xUnit1025 + [InlineData (ObjCBindings.Property.Notification | ObjCBindings.Property.Default, true)] +#pragma warning restore xUnit1025 + public void IsNotification (ObjCBindings.Property flag, bool expectedResult) + { + var property = new Property ( + name: "Test", + returnType: new ReturnType ("string"), + symbolAvailability: new (), + attributes: [], + modifiers: [], + accessors: [] + ) { + ExportFieldData = new FieldData ("name", flag) + }; + Assert.Equal (expectedResult, property.IsNotification); + } + class TestDataFromPropertyDeclaration : IEnumerable { public IEnumerator GetEnumerator () { diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/Extensions/TypeSymbolExtensionsTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/Extensions/TypeSymbolExtensionsTests.cs index e56942d63ae2..6b7eee836438 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/Extensions/TypeSymbolExtensionsTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/Extensions/TypeSymbolExtensionsTests.cs @@ -432,20 +432,8 @@ public partial class MyClass { public static partial string Name { get; set; } = string.Empty; } "; - yield return [noAttrPropertyClass, Field.Default, null!]; + yield return [noAttrPropertyClass, Property.Default, null!]; - const string fieldPropertyClass = @" -using ObjCBindings; - -namespace NS; - -[BindingType] -public partial class MyClass { - [Export (""CONSTANT"")] - public static partial string Name { get; set; } = string.Empty; -} -"; - yield return [fieldPropertyClass, Field.Default, new ExportData ("CONSTANT")]; const string singlePropertyClass = @" using ObjCBindings; @@ -501,6 +489,47 @@ void GetExportData (ApplePlatform platform, string inputText, T @enum, Export Assert.Equal (expectedData, exportData); } + class TestDataGetFieldData : IEnumerable { + public IEnumerator GetEnumerator () + { + const string fieldPropertyClass = @" +using ObjCBindings; + +namespace NS; + +[BindingType] +public partial class MyClass { + [Field (""CONSTANT"")] + public static partial string Name { get; set; } = string.Empty; +} +"; + yield return [fieldPropertyClass, Property.Default, new FieldData ("CONSTANT")]; + } + + IEnumerator IEnumerable.GetEnumerator () => GetEnumerator (); + } + + [Theory] + [AllSupportedPlatformsClassData] + void GetFieldData (ApplePlatform platform, string inputText, T @enum, FieldData? expectedData) + where T : Enum + { + Assert.NotNull (@enum); + var (compilation, syntaxTrees) = CreateCompilation (platform, sources: inputText); + Assert.Single (syntaxTrees); + var declaration = syntaxTrees [0].GetRoot () + .DescendantNodes () + .OfType () + .FirstOrDefault (); + Assert.NotNull (declaration); + var semanticModel = compilation.GetSemanticModel (syntaxTrees [0]); + Assert.NotNull (semanticModel); + var symbol = semanticModel.GetDeclaredSymbol (declaration); + Assert.NotNull (symbol); + var fieldData = symbol.GetFieldData (); + Assert.Equal (expectedData, fieldData); + } + class TestDataIsBlittablePrimitiveType : IEnumerable { public IEnumerator GetEnumerator () {