diff --git a/src/AppKit/ActionDispatcher.cs b/src/AppKit/ActionDispatcher.cs index b671247c3a..378b51627e 100644 --- a/src/AppKit/ActionDispatcher.cs +++ b/src/AppKit/ActionDispatcher.cs @@ -29,8 +29,7 @@ using System; using ObjCRuntime; using Foundation; -namespace AppKit -{ +namespace AppKit { [Register ("__monomac_internal_ActionDispatcher")] internal class ActionDispatcher : NSObject #if !__MACCATALYST__ @@ -62,7 +61,7 @@ namespace AppKit if (handler != null) handler (sender, EventArgs.Empty); } - + public ActionDispatcher (EventHandler handler) { IsDirectBinding = false; @@ -77,7 +76,7 @@ namespace AppKit public static NSObject SetupAction (NSObject target, EventHandler handler) { ActionDispatcher ctarget = target as ActionDispatcher; - if (ctarget == null){ + if (ctarget == null) { ctarget = new ActionDispatcher (); } ctarget.Activated += handler; @@ -91,11 +90,11 @@ namespace AppKit return; ctarget.Activated -= handler; } - + public static NSObject SetupDoubleAction (NSObject target, EventHandler doubleHandler) { ActionDispatcher ctarget = target as ActionDispatcher; - if (ctarget == null){ + if (ctarget == null) { ctarget = new ActionDispatcher (); } ctarget.DoubleActivated += doubleHandler; diff --git a/src/AppKit/AppKitThreadAccessException.cs b/src/AppKit/AppKitThreadAccessException.cs index ee3da36231..13df123963 100644 --- a/src/AppKit/AppKitThreadAccessException.cs +++ b/src/AppKit/AppKitThreadAccessException.cs @@ -1,15 +1,13 @@ using System; using System.Runtime.Versioning; -namespace AppKit -{ +namespace AppKit { #if NET [SupportedOSPlatform ("macos")] [SupportedOSPlatform ("maccatalyst")] #endif - public class AppKitThreadAccessException : Exception - { - public AppKitThreadAccessException() : base("AppKit Consistency error: you are calling a method that can only be invoked from the UI thread.") + public class AppKitThreadAccessException : Exception { + public AppKitThreadAccessException () : base ("AppKit Consistency error: you are calling a method that can only be invoked from the UI thread.") { } } diff --git a/src/AppKit/BeginSheet.cs b/src/AppKit/BeginSheet.cs index 1bd7334b42..aab3f4d813 100644 --- a/src/AppKit/BeginSheet.cs +++ b/src/AppKit/BeginSheet.cs @@ -38,7 +38,7 @@ namespace AppKit { { BeginSheet (sheet, docWindow, null, null, IntPtr.Zero); } - + public void BeginSheet (NSWindow sheet, NSWindow docWindow, Action onEnded) { var obj = new NSAsyncActionDispatcher (onEnded); @@ -47,12 +47,12 @@ namespace AppKit { } public partial class NSOpenPanel { - public void BeginSheet (string directory, string fileName, string []fileTypes, NSWindow modalForWindow) + public void BeginSheet (string directory, string fileName, string [] fileTypes, NSWindow modalForWindow) { BeginSheet (directory, fileName, fileTypes, modalForWindow, null, null, IntPtr.Zero); } - - public void BeginSheet (string directory, string fileName, string []fileTypes, NSWindow modalForWindow, Action onEnded) + + public void BeginSheet (string directory, string fileName, string [] fileTypes, NSWindow modalForWindow, Action onEnded) { var obj = new NSAsyncActionDispatcher (onEnded); BeginSheet (directory, fileName, fileTypes, modalForWindow, obj, NSActionDispatcher.Selector, IntPtr.Zero); @@ -64,7 +64,7 @@ namespace AppKit { { BeginSheet (printInfo, docWindow, null, null, IntPtr.Zero); } - + public void BeginSheet (NSPrintInfo printInfo, NSWindow docWindow, Action onEnded) { var obj = new NSAsyncActionDispatcher (onEnded); diff --git a/src/AppKit/Compat.cs b/src/AppKit/Compat.cs index 779b66250e..fd358f1f99 100644 --- a/src/AppKit/Compat.cs +++ b/src/AppKit/Compat.cs @@ -11,7 +11,7 @@ namespace AppKit { [Obsolete ("Use the 'TextBlocks' property instead.", false)] [EditorBrowsable (EditorBrowsableState.Never)] [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] - public virtual void SetTextBlocks (NSTextBlock[] array) + public virtual void SetTextBlocks (NSTextBlock [] array) { if (array == null) throw new ArgumentNullException (nameof (array)); @@ -27,7 +27,7 @@ namespace AppKit { [Obsolete ("Use the 'TextLists' property instead.", false)] [EditorBrowsable (EditorBrowsableState.Never)] [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] - public virtual void SetTextLists (NSTextList[] array) + public virtual void SetTextLists (NSTextList [] array) { if (array == null) throw new ArgumentNullException (nameof (array)); @@ -41,8 +41,7 @@ namespace AppKit { } } - public static class NSFileTypeForHFSTypeCode - { + public static class NSFileTypeForHFSTypeCode { public static readonly string ComputerIcon = "root"; public static readonly string DesktopIcon = "desk"; public static readonly string FinderIcon = "FNDR"; diff --git a/src/AppKit/DoubleWrapper.cs b/src/AppKit/DoubleWrapper.cs index 49ea5b71bf..336bd22731 100644 --- a/src/AppKit/DoubleWrapper.cs +++ b/src/AppKit/DoubleWrapper.cs @@ -89,7 +89,7 @@ namespace AppKit { } } } - + public partial class NSTableView { public event EventHandler DoubleClick { add { diff --git a/src/AppKit/Enums.cs b/src/AppKit/Enums.cs index 657a003598..002b281db4 100644 --- a/src/AppKit/Enums.cs +++ b/src/AppKit/Enums.cs @@ -48,28 +48,28 @@ namespace AppKit { public enum NSApplicationActivationPolicy : long { Regular, Accessory, Prohibited } - + [NoMacCatalyst] [Flags] [Native] public enum NSApplicationPresentationOptions : ulong { - Default = 0, - AutoHideDock = (1 << 0), - HideDock = (1 << 1), + Default = 0, + AutoHideDock = (1 << 0), + HideDock = (1 << 1), - AutoHideMenuBar = (1 << 2), - HideMenuBar = (1 << 3), + AutoHideMenuBar = (1 << 2), + HideMenuBar = (1 << 3), - DisableAppleMenu = (1 << 4), - DisableProcessSwitching = (1 << 5), - DisableForceQuit = (1 << 6), - DisableSessionTermination = (1 << 7), - DisableHideApplication = (1 << 8), - DisableMenuBarTransparency = (1 << 9), + DisableAppleMenu = (1 << 4), + DisableProcessSwitching = (1 << 5), + DisableForceQuit = (1 << 6), + DisableSessionTermination = (1 << 7), + DisableHideApplication = (1 << 8), + DisableMenuBarTransparency = (1 << 9), - FullScreen = (1 << 10), - AutoHideToolbar = (1 << 11), - [Mac (10,11,2)] + FullScreen = (1 << 10), + AutoHideToolbar = (1 << 11), + [Mac (10, 11, 2)] DisableCursorLocationAssistance = (1 << 12), } @@ -130,33 +130,33 @@ namespace AppKit { DestinationAtop, XOR, PlusDarker, - [Deprecated (PlatformName.MacOSX, 10, 10, message : "Use NSCompositeSourceOver instead.")] + [Deprecated (PlatformName.MacOSX, 10, 10, message: "Use NSCompositeSourceOver instead.")] Highlight, PlusLighter, - [Mac (10,10)] Multiply, - [Mac (10,10)] Screen, - [Mac (10,10)] Overlay, - [Mac (10,10)] Darken, - [Mac (10,10)] Lighten, - [Mac (10,10)] ColorDodge, - [Mac (10,10)] ColorBurn, - [Mac (10,10)] SoftLight, - [Mac (10,10)] HardLight, - [Mac (10,10)] Difference, - [Mac (10,10)] Exclusion, - [Mac (10,10)] Hue, - [Mac (10,10)] Saturation, - [Mac (10,10)] Color, - [Mac (10,10)] Luminosity + [Mac (10, 10)] Multiply, + [Mac (10, 10)] Screen, + [Mac (10, 10)] Overlay, + [Mac (10, 10)] Darken, + [Mac (10, 10)] Lighten, + [Mac (10, 10)] ColorDodge, + [Mac (10, 10)] ColorBurn, + [Mac (10, 10)] SoftLight, + [Mac (10, 10)] HardLight, + [Mac (10, 10)] Difference, + [Mac (10, 10)] Exclusion, + [Mac (10, 10)] Hue, + [Mac (10, 10)] Saturation, + [Mac (10, 10)] Color, + [Mac (10, 10)] Luminosity } [NoMacCatalyst] [Native] public enum NSBackingStore : ulong { - [Deprecated (PlatformName.MacOSX, 10, 13, message : "Use 'Buffered' instead.")] - Retained, - [Deprecated (PlatformName.MacOSX, 10, 13, message : "Use 'Buffered' instead.")] - Nonretained, + [Deprecated (PlatformName.MacOSX, 10, 13, message: "Use 'Buffered' instead.")] + Retained, + [Deprecated (PlatformName.MacOSX, 10, 13, message: "Use 'Buffered' instead.")] + Nonretained, Buffered, } @@ -177,7 +177,7 @@ namespace AppKit { public enum NSFocusRingType : ulong { Default, None, Exterior } - + [NoMacCatalyst] [Native] public enum NSColorRenderingIntent : long { @@ -186,7 +186,7 @@ namespace AppKit { RelativeColorimetric, Perceptual, Saturation - + } [MacCatalyst (13, 0)] @@ -201,7 +201,7 @@ namespace AppKit { LeftToRight, RightToLeft } -#region NSColorSpace + #region NSColorSpace [NoMacCatalyst] [Native] public enum NSColorSpaceModel : long { @@ -213,10 +213,10 @@ namespace AppKit { DeviceN, Indexed, Pattern - } -#endregion + } + #endregion -#region NSFileWrapper + #region NSFileWrapper #if !XAMCORE_3_0 [NoMacCatalyst] [Flags] @@ -226,9 +226,9 @@ namespace AppKit { Immediate = 1, WithoutMapping = 2 } #endif -#endregion - -#region NSParagraphStyle + #endregion + + #region NSParagraphStyle [NoMacCatalyst] [Native] public enum NSTextTabType : ulong { @@ -245,34 +245,34 @@ namespace AppKit { TruncatingTail, TruncatingMiddle } - -#endregion - -#region NSCell Defines + + #endregion + + #region NSCell Defines #if !NET [NoMacCatalyst] [Native] - [Deprecated (PlatformName.MacOSX, 10, 10, message : "Use formatters instead.")] + [Deprecated (PlatformName.MacOSX, 10, 10, message: "Use formatters instead.")] public enum NSType : ulong { - Any = 0, - Int = 1, - PositiveInt = 2, - Float = 3, - PositiveFloat = 4, - Double = 6, - PositiveDouble = 7 + Any = 0, + Int = 1, + PositiveInt = 2, + Float = 3, + PositiveFloat = 4, + Double = 6, + PositiveDouble = 7 } #endif - + [NoMacCatalyst] [Native] public enum NSCellType : ulong { - Null, - Text, - Image + Null, + Text, + Image } - + [NoMacCatalyst] [Native] public enum NSCellAttribute : ulong { @@ -294,7 +294,7 @@ namespace AppKit { CellIsInsetButton, CellAllowsMixedState, } - + [NoMacCatalyst] [Native] public enum NSCellImagePosition : ulong { @@ -305,21 +305,21 @@ namespace AppKit { ImageBelow, ImageAbove, ImageOverlaps, - [Mac (10,12)] + [Mac (10, 12)] ImageLeading, - [Mac (10,12)] + [Mac (10, 12)] ImageTrailing, } - + [NoMacCatalyst] [Native] public enum NSImageScale : ulong { ProportionallyDown = 0, - AxesIndependently, - None, + AxesIndependently, + None, ProportionallyUpOrDown } - + [NoMacCatalyst] [Native] public enum NSCellStateValue : long { @@ -334,7 +334,7 @@ namespace AppKit { public enum NSCellStyleMask : ulong { NoCell = 0, ContentsCell = 1 << 0, - PushInCell = 1 << 1, + PushInCell = 1 << 1, ChangeGrayCell = 1 << 2, ChangeBackgroundCell = 1 << 3 } @@ -348,23 +348,23 @@ namespace AppKit { EditableTextArea = 2, TrackableArae = 4 } - + [NoMacCatalyst] [Native] public enum NSControlTint : ulong { - Default = 0, // system 'default' - Blue = 1, + Default = 0, // system 'default' + Blue = 1, Graphite = 6, - Clear = 7 + Clear = 7 } - + [NoMacCatalyst] [Native] public enum NSControlSize : ulong { - Regular = 0, + Regular = 0, Small = 1, Mini = 2, - [Mac (11,0)] + [Mac (11, 0)] Large = 3, } @@ -372,48 +372,48 @@ namespace AppKit { [Native] public enum NSBackgroundStyle : long { Normal = 0, - [Deprecated (PlatformName.MacOSX, 10, 14, message : "Use 'Normal' instead.")] + [Deprecated (PlatformName.MacOSX, 10, 14, message: "Use 'Normal' instead.")] Light = Normal, Emphasized, - [Deprecated (PlatformName.MacOSX, 10, 14, message : "Use 'Emphasized' instead.")] - Dark = Emphasized, - Raised, + [Deprecated (PlatformName.MacOSX, 10, 14, message: "Use 'Emphasized' instead.")] + Dark = Emphasized, + Raised, Lowered, } -#endregion + #endregion + + #region NSImage -#region NSImage - [NoMacCatalyst] [Native] public enum NSImageLoadStatus : ulong { - Completed, - Cancelled, - InvalidData, - UnexpectedEOF, - ReadError - } - - [NoMacCatalyst] - [Native] - public enum NSImageCacheMode : ulong { - Default, - Always, - BySize, - Never + Completed, + Cancelled, + InvalidData, + UnexpectedEOF, + ReadError } [NoMacCatalyst] - [Mac (10,10)] + [Native] + public enum NSImageCacheMode : ulong { + Default, + Always, + BySize, + Never + } + + [NoMacCatalyst] + [Mac (10, 10)] [Native (ConvertToNative = "NSImageResizingModeExtensions.ToNative", ConvertToManaged = "NSImageResizingModeExtensions.ToManaged")] public enum NSImageResizingMode : long { Stretch, Tile } - -#endregion - -#region NSAlert + + #endregion + + #region NSAlert [NoMacCatalyst] [Native] public enum NSAlertStyle : ulong { @@ -421,7 +421,7 @@ namespace AppKit { } [NoMacCatalyst] - [Mac (10,9)] + [Mac (10, 9)] [Native] public enum NSModalResponse : long { OK = 1, @@ -430,13 +430,13 @@ namespace AppKit { Abort = -1001, Continue = -1002 } -#endregion + #endregion -#region NSEvent + #region NSEvent [NoMacCatalyst] [Native] public enum NSEventType : ulong { - LeftMouseDown = 1, + LeftMouseDown = 1, LeftMouseUp = 2, RightMouseDown = 3, RightMouseUp = 4, @@ -474,63 +474,63 @@ namespace AppKit { QuickLook = 33, Pressure = 34, // 10.10.3, 64-bit-only DirectTouch = 37, // 10.10 - [Mac (10,15)] + [Mac (10, 15)] ChangeMode = 38, } [NoMacCatalyst] [Flags] public enum NSEventMask : ulong { - LeftMouseDown = 1UL << (int)NSEventType.LeftMouseDown, - LeftMouseUp = 1UL << (int)NSEventType.LeftMouseUp, - RightMouseDown = 1UL << (int)NSEventType.RightMouseDown, - RightMouseUp = 1UL << (int)NSEventType.RightMouseUp, - MouseMoved = 1UL << (int)NSEventType.MouseMoved, - LeftMouseDragged = 1UL << (int)NSEventType.LeftMouseDragged, - RightMouseDragged = 1UL << (int)NSEventType.RightMouseDragged, - MouseEntered = 1UL << (int)NSEventType.MouseEntered, - MouseExited = 1UL << (int)NSEventType.MouseExited, - KeyDown = 1UL << (int)NSEventType.KeyDown, - KeyUp = 1UL << (int)NSEventType.KeyUp, - FlagsChanged = 1UL << (int)NSEventType.FlagsChanged, - AppKitDefined = 1UL << (int)NSEventType.AppKitDefined, - SystemDefined = 1UL << (int)NSEventType.SystemDefined, - ApplicationDefined = 1UL << (int)NSEventType.ApplicationDefined, - Periodic = 1UL << (int)NSEventType.Periodic, - CursorUpdate = 1UL << (int)NSEventType.CursorUpdate, - ScrollWheel = 1UL << (int)NSEventType.ScrollWheel, - TabletPoint = 1UL << (int)NSEventType.TabletPoint, - TabletProximity = 1UL << (int)NSEventType.TabletProximity, - OtherMouseDown = 1UL << (int)NSEventType.OtherMouseDown, - OtherMouseUp = 1UL << (int)NSEventType.OtherMouseUp, - OtherMouseDragged = 1UL << (int)NSEventType.OtherMouseDragged, - EventGesture = 1UL << (int)NSEventType.Gesture, - EventMagnify = 1UL << (int)NSEventType.Magnify, - EventSwipe = 1UL << (int)NSEventType.Swipe, - EventRotate = 1UL << (int)NSEventType.Rotate, - EventBeginGesture = 1UL << (int)NSEventType.BeginGesture, - EventEndGesture = 1UL << (int)NSEventType.EndGesture, - SmartMagnify = 1UL << (int)NSEventType.SmartMagnify, - Pressure = 1UL << (int)NSEventType.Pressure, // 10.10.3, 64-bit-only - DirectTouch = 1UL << (int)NSEventType.DirectTouch, // 10.10 - [Mac (10,15)] - ChangeMode = 1UL << (int)NSEventType.ChangeMode, - AnyEvent = unchecked ((ulong)UInt64.MaxValue) + LeftMouseDown = 1UL << (int) NSEventType.LeftMouseDown, + LeftMouseUp = 1UL << (int) NSEventType.LeftMouseUp, + RightMouseDown = 1UL << (int) NSEventType.RightMouseDown, + RightMouseUp = 1UL << (int) NSEventType.RightMouseUp, + MouseMoved = 1UL << (int) NSEventType.MouseMoved, + LeftMouseDragged = 1UL << (int) NSEventType.LeftMouseDragged, + RightMouseDragged = 1UL << (int) NSEventType.RightMouseDragged, + MouseEntered = 1UL << (int) NSEventType.MouseEntered, + MouseExited = 1UL << (int) NSEventType.MouseExited, + KeyDown = 1UL << (int) NSEventType.KeyDown, + KeyUp = 1UL << (int) NSEventType.KeyUp, + FlagsChanged = 1UL << (int) NSEventType.FlagsChanged, + AppKitDefined = 1UL << (int) NSEventType.AppKitDefined, + SystemDefined = 1UL << (int) NSEventType.SystemDefined, + ApplicationDefined = 1UL << (int) NSEventType.ApplicationDefined, + Periodic = 1UL << (int) NSEventType.Periodic, + CursorUpdate = 1UL << (int) NSEventType.CursorUpdate, + ScrollWheel = 1UL << (int) NSEventType.ScrollWheel, + TabletPoint = 1UL << (int) NSEventType.TabletPoint, + TabletProximity = 1UL << (int) NSEventType.TabletProximity, + OtherMouseDown = 1UL << (int) NSEventType.OtherMouseDown, + OtherMouseUp = 1UL << (int) NSEventType.OtherMouseUp, + OtherMouseDragged = 1UL << (int) NSEventType.OtherMouseDragged, + EventGesture = 1UL << (int) NSEventType.Gesture, + EventMagnify = 1UL << (int) NSEventType.Magnify, + EventSwipe = 1UL << (int) NSEventType.Swipe, + EventRotate = 1UL << (int) NSEventType.Rotate, + EventBeginGesture = 1UL << (int) NSEventType.BeginGesture, + EventEndGesture = 1UL << (int) NSEventType.EndGesture, + SmartMagnify = 1UL << (int) NSEventType.SmartMagnify, + Pressure = 1UL << (int) NSEventType.Pressure, // 10.10.3, 64-bit-only + DirectTouch = 1UL << (int) NSEventType.DirectTouch, // 10.10 + [Mac (10, 15)] + ChangeMode = 1UL << (int) NSEventType.ChangeMode, + AnyEvent = unchecked((ulong) UInt64.MaxValue) } [NoMacCatalyst] [Flags] [Native] public enum NSEventModifierMask : ulong { - AlphaShiftKeyMask = 1 << 16, - ShiftKeyMask = 1 << 17, - ControlKeyMask = 1 << 18, - AlternateKeyMask = 1 << 19, - CommandKeyMask = 1 << 20, - NumericPadKeyMask = 1 << 21, - HelpKeyMask = 1 << 22, - FunctionKeyMask = 1 << 23, - DeviceIndependentModifierFlagsMask = 0xffff0000 + AlphaShiftKeyMask = 1 << 16, + ShiftKeyMask = 1 << 17, + ControlKeyMask = 1 << 18, + AlternateKeyMask = 1 << 19, + CommandKeyMask = 1 << 20, + NumericPadKeyMask = 1 << 21, + HelpKeyMask = 1 << 22, + FunctionKeyMask = 1 << 23, + DeviceIndependentModifierFlagsMask = 0xffff0000 } [NoMacCatalyst] @@ -555,123 +555,123 @@ namespace AppKit { [Native] public enum NSKey : ulong { #endif - A = 0x00, - S = 0x01, - D = 0x02, - F = 0x03, - H = 0x04, - G = 0x05, - Z = 0x06, - X = 0x07, - C = 0x08, - V = 0x09, - B = 0x0B, - Q = 0x0C, - W = 0x0D, - E = 0x0E, - R = 0x0F, - Y = 0x10, - T = 0x11, - D1 = 0x12, - D2 = 0x13, - D3 = 0x14, - D4 = 0x15, - D6 = 0x16, - D5 = 0x17, - Equal = 0x18, - D9 = 0x19, - D7 = 0x1A, - Minus = 0x1B, - D8 = 0x1C, - D0 = 0x1D, - RightBracket = 0x1E, - O = 0x1F, - U = 0x20, - LeftBracket = 0x21, - I = 0x22, - P = 0x23, - L = 0x25, - J = 0x26, - Quote = 0x27, - K = 0x28, - Semicolon = 0x29, - Backslash = 0x2A, - Comma = 0x2B, - Slash = 0x2C, - N = 0x2D, - M = 0x2E, - Period = 0x2F, - Grave = 0x32, - KeypadDecimal = 0x41, + A = 0x00, + S = 0x01, + D = 0x02, + F = 0x03, + H = 0x04, + G = 0x05, + Z = 0x06, + X = 0x07, + C = 0x08, + V = 0x09, + B = 0x0B, + Q = 0x0C, + W = 0x0D, + E = 0x0E, + R = 0x0F, + Y = 0x10, + T = 0x11, + D1 = 0x12, + D2 = 0x13, + D3 = 0x14, + D4 = 0x15, + D6 = 0x16, + D5 = 0x17, + Equal = 0x18, + D9 = 0x19, + D7 = 0x1A, + Minus = 0x1B, + D8 = 0x1C, + D0 = 0x1D, + RightBracket = 0x1E, + O = 0x1F, + U = 0x20, + LeftBracket = 0x21, + I = 0x22, + P = 0x23, + L = 0x25, + J = 0x26, + Quote = 0x27, + K = 0x28, + Semicolon = 0x29, + Backslash = 0x2A, + Comma = 0x2B, + Slash = 0x2C, + N = 0x2D, + M = 0x2E, + Period = 0x2F, + Grave = 0x32, + KeypadDecimal = 0x41, KeypadMultiply = 0x43, - KeypadPlus = 0x45, - KeypadClear = 0x47, - KeypadDivide = 0x4B, - KeypadEnter = 0x4C, - KeypadMinus = 0x4E, - KeypadEquals = 0x51, - Keypad0 = 0x52, - Keypad1 = 0x53, - Keypad2 = 0x54, - Keypad3 = 0x55, - Keypad4 = 0x56, - Keypad5 = 0x57, - Keypad6 = 0x58, - Keypad7 = 0x59, - Keypad8 = 0x5B, - Keypad9 = 0x5C, - Return = 0x24, - Tab = 0x30, - Space = 0x31, - Delete = 0x33, - Escape = 0x35, - Command = 0x37, - Shift = 0x38, - CapsLock = 0x39, - Option = 0x3A, - Control = 0x3B, - RightShift = 0x3C, - RightOption = 0x3D, - RightControl = 0x3E, - Function = 0x3F, - VolumeUp = 0x48, - VolumeDown = 0x49, - Mute = 0x4A, - ForwardDelete = 0x75, - ISOSection = 0x0A, - JISYen = 0x5D, - JISUnderscore = 0x5E, + KeypadPlus = 0x45, + KeypadClear = 0x47, + KeypadDivide = 0x4B, + KeypadEnter = 0x4C, + KeypadMinus = 0x4E, + KeypadEquals = 0x51, + Keypad0 = 0x52, + Keypad1 = 0x53, + Keypad2 = 0x54, + Keypad3 = 0x55, + Keypad4 = 0x56, + Keypad5 = 0x57, + Keypad6 = 0x58, + Keypad7 = 0x59, + Keypad8 = 0x5B, + Keypad9 = 0x5C, + Return = 0x24, + Tab = 0x30, + Space = 0x31, + Delete = 0x33, + Escape = 0x35, + Command = 0x37, + Shift = 0x38, + CapsLock = 0x39, + Option = 0x3A, + Control = 0x3B, + RightShift = 0x3C, + RightOption = 0x3D, + RightControl = 0x3E, + Function = 0x3F, + VolumeUp = 0x48, + VolumeDown = 0x49, + Mute = 0x4A, + ForwardDelete = 0x75, + ISOSection = 0x0A, + JISYen = 0x5D, + JISUnderscore = 0x5E, JISKeypadComma = 0x5F, - JISEisu = 0x66, - JISKana = 0x68, - F18 = 0x4F, - F19 = 0x50, - F20 = 0x5A, - F5 = 0x60, - F6 = 0x61, - F7 = 0x62, - F3 = 0x63, - F8 = 0x64, - F9 = 0x65, - F11 = 0x67, - F13 = 0x69, - F16 = 0x6A, - F14 = 0x6B, - F10 = 0x6D, - F12 = 0x6F, - F15 = 0x71, - Help = 0x72, - Home = 0x73, - PageUp = 0x74, - F4 = 0x76, - End = 0x77, - F2 = 0x78, - PageDown = 0x79, - F1 = 0x7A, - LeftArrow = 0x7B, - RightArrow = 0x7C, - DownArrow = 0x7D, - UpArrow = 0x7E + JISEisu = 0x66, + JISKana = 0x68, + F18 = 0x4F, + F19 = 0x50, + F20 = 0x5A, + F5 = 0x60, + F6 = 0x61, + F7 = 0x62, + F3 = 0x63, + F8 = 0x64, + F9 = 0x65, + F11 = 0x67, + F13 = 0x69, + F16 = 0x6A, + F14 = 0x6B, + F10 = 0x6D, + F12 = 0x6F, + F15 = 0x71, + Help = 0x72, + Home = 0x73, + PageUp = 0x74, + F4 = 0x76, + End = 0x77, + F2 = 0x78, + PageDown = 0x79, + F1 = 0x7A, + LeftArrow = 0x7B, + RightArrow = 0x7C, + DownArrow = 0x7D, + UpArrow = 0x7E } // This is an untyped enum in AppKit's NSEvent.h @@ -682,78 +682,78 @@ namespace AppKit { #else public enum NSFunctionKey : int { #endif - UpArrow = 0xF700, - DownArrow = 0xF701, - LeftArrow = 0xF702, - RightArrow = 0xF703, - F1 = 0xF704, - F2 = 0xF705, - F3 = 0xF706, - F4 = 0xF707, - F5 = 0xF708, - F6 = 0xF709, - F7 = 0xF70A, - F8 = 0xF70B, - F9 = 0xF70C, - F10 = 0xF70D, - F11 = 0xF70E, - F12 = 0xF70F, - F13 = 0xF710, - F14 = 0xF711, - F15 = 0xF712, - F16 = 0xF713, - F17 = 0xF714, - F18 = 0xF715, - F19 = 0xF716, - F20 = 0xF717, - F21 = 0xF718, - F22 = 0xF719, - F23 = 0xF71A, - F24 = 0xF71B, - F25 = 0xF71C, - F26 = 0xF71D, - F27 = 0xF71E, - F28 = 0xF71F, - F29 = 0xF720, - F30 = 0xF721, - F31 = 0xF722, - F32 = 0xF723, - F33 = 0xF724, - F34 = 0xF725, - F35 = 0xF726, - Insert = 0xF727, - Delete = 0xF728, - Home = 0xF729, - Begin = 0xF72A, - End = 0xF72B, - PageUp = 0xF72C, - PageDown = 0xF72D, - PrintScreen = 0xF72E, - ScrollLock = 0xF72F, - Pause = 0xF730, - SysReq = 0xF731, - Break = 0xF732, - Reset = 0xF733, - Stop = 0xF734, - Menu = 0xF735, - User = 0xF736, - System = 0xF737, - Print = 0xF738, - ClearLine = 0xF739, - ClearDisplay = 0xF73A, - InsertLine = 0xF73B, - DeleteLine = 0xF73C, - InsertChar = 0xF73D, - DeleteChar = 0xF73E, - Prev = 0xF73F, - Next = 0xF740, - Select = 0xF741, - Execute = 0xF742, - Undo = 0xF743, - Redo = 0xF744, - Find = 0xF745, - Help = 0xF746, - ModeSwitch = 0xF747 + UpArrow = 0xF700, + DownArrow = 0xF701, + LeftArrow = 0xF702, + RightArrow = 0xF703, + F1 = 0xF704, + F2 = 0xF705, + F3 = 0xF706, + F4 = 0xF707, + F5 = 0xF708, + F6 = 0xF709, + F7 = 0xF70A, + F8 = 0xF70B, + F9 = 0xF70C, + F10 = 0xF70D, + F11 = 0xF70E, + F12 = 0xF70F, + F13 = 0xF710, + F14 = 0xF711, + F15 = 0xF712, + F16 = 0xF713, + F17 = 0xF714, + F18 = 0xF715, + F19 = 0xF716, + F20 = 0xF717, + F21 = 0xF718, + F22 = 0xF719, + F23 = 0xF71A, + F24 = 0xF71B, + F25 = 0xF71C, + F26 = 0xF71D, + F27 = 0xF71E, + F28 = 0xF71F, + F29 = 0xF720, + F30 = 0xF721, + F31 = 0xF722, + F32 = 0xF723, + F33 = 0xF724, + F34 = 0xF725, + F35 = 0xF726, + Insert = 0xF727, + Delete = 0xF728, + Home = 0xF729, + Begin = 0xF72A, + End = 0xF72B, + PageUp = 0xF72C, + PageDown = 0xF72D, + PrintScreen = 0xF72E, + ScrollLock = 0xF72F, + Pause = 0xF730, + SysReq = 0xF731, + Break = 0xF732, + Reset = 0xF733, + Stop = 0xF734, + Menu = 0xF735, + User = 0xF736, + System = 0xF737, + Print = 0xF738, + ClearLine = 0xF739, + ClearDisplay = 0xF73A, + InsertLine = 0xF73B, + DeleteLine = 0xF73C, + InsertChar = 0xF73D, + DeleteChar = 0xF73E, + Prev = 0xF73F, + Next = 0xF740, + Select = 0xF741, + Execute = 0xF742, + Undo = 0xF743, + Redo = 0xF744, + Find = 0xF745, + Help = 0xF746, + ModeSwitch = 0xF747 } [NoMacCatalyst] @@ -789,7 +789,7 @@ namespace AppKit { [NoMacCatalyst] [Native] public enum NSSystemDefinedEvents : ulong { - [Deprecated (PlatformName.MacOSX, 10, 12, message : "Use 'NSEventSubtype.PowerOff' instead.")] + [Deprecated (PlatformName.MacOSX, 10, 12, message: "Use 'NSEventSubtype.PowerOff' instead.")] NSPowerOffEventType = 1 } #endif // !NET @@ -798,33 +798,33 @@ namespace AppKit { [NoMacCatalyst] [Native] public enum NSEventMouseSubtype : ulong { - [Deprecated (PlatformName.MacOSX, 10, 12, message : "Use 'NSEventSubtype.MouseEvent' instead.")] - Mouse, - [Deprecated (PlatformName.MacOSX, 10, 12, message : "Use 'NSEventSubtype.TabletPoint' instead.")] - TablePoint, - [Deprecated (PlatformName.MacOSX, 10, 12, message : "Use 'NSEventSubtype.TabletProximity' instead.")] + [Deprecated (PlatformName.MacOSX, 10, 12, message: "Use 'NSEventSubtype.MouseEvent' instead.")] + Mouse, + [Deprecated (PlatformName.MacOSX, 10, 12, message: "Use 'NSEventSubtype.TabletPoint' instead.")] + TablePoint, + [Deprecated (PlatformName.MacOSX, 10, 12, message: "Use 'NSEventSubtype.TabletProximity' instead.")] TabletProximity, - [Deprecated (PlatformName.MacOSX, 10, 12, message : "Use 'NSEventSubtype.Touch' instead.")] + [Deprecated (PlatformName.MacOSX, 10, 12, message: "Use 'NSEventSubtype.Touch' instead.")] Touch, } #endif // !NET - -#endregion -#region NSView + #endregion + + #region NSView [NoMacCatalyst] [Flags] [Native] public enum NSViewResizingMask : ulong { - NotSizable = 0, - MinXMargin = 1, - WidthSizable = 2, - MaxXMargin = 4, - MinYMargin = 8, - HeightSizable = 16, - MaxYMargin = 32 + NotSizable = 0, + MinXMargin = 1, + WidthSizable = 2, + MaxXMargin = 4, + MinYMargin = 8, + HeightSizable = 16, + MaxYMargin = 32 } - + [NoMacCatalyst] [Native] public enum NSBorderType : ulong { @@ -836,15 +836,15 @@ namespace AppKit { public enum NSTextFieldBezelStyle : ulong { Square, Rounded } - + [NoMacCatalyst] [Native] public enum NSViewLayerContentsRedrawPolicy : long { Never, OnSetNeedsDisplay, - DuringViewResize, + DuringViewResize, BeforeViewResize, - [Mac (10,9)] + [Mac (10, 9)] Crossfade = 4, } @@ -865,31 +865,31 @@ namespace AppKit { TopLeft, } -#endregion - -#region NSWindow + #endregion + + #region NSWindow [NoMacCatalyst] [Flags] [Native ("NSWindowStyleMask")] public enum NSWindowStyle : ulong { - Borderless = 0 << 0, - Titled = 1 << 0, - Closable = 1 << 1, - Miniaturizable = 1 << 2, - Resizable = 1 << 3, - Utility = 1 << 4, - DocModal = 1 << 6, - NonactivatingPanel = 1 << 7, + Borderless = 0 << 0, + Titled = 1 << 0, + Closable = 1 << 1, + Miniaturizable = 1 << 2, + Resizable = 1 << 3, + Utility = 1 << 4, + DocModal = 1 << 6, + NonactivatingPanel = 1 << 7, [Deprecated (PlatformName.MacOSX, 11, 0, message: "Don't use 'TexturedBackground' anymore.")] - TexturedBackground = 1 << 8, + TexturedBackground = 1 << 8, #if !NET [Deprecated (PlatformName.MacOSX, 10, 9, message: "Don't use, this value has no effect.")] - Unscaled = 1 << 11, + Unscaled = 1 << 11, #endif - UnifiedTitleAndToolbar = 1 << 12, - Hud = 1 << 13, - FullScreenWindow = 1 << 14, - [Mac (10,10)] FullSizeContentView = 1 << 15 + UnifiedTitleAndToolbar = 1 << 12, + Hud = 1 << 13, + FullScreenWindow = 1 << 14, + [Mac (10, 10)] FullSizeContentView = 1 << 15 } [NoMacCatalyst] @@ -942,8 +942,8 @@ namespace AppKit { [NoMacCatalyst] [Native] public enum NSWindowButton : ulong { - 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.")] + 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 } @@ -951,18 +951,18 @@ namespace AppKit { [Flags] [Native] public enum NSTouchPhase : ulong { - Began = 1 << 0, - Moved = 1 << 1, - Stationary = 1 << 2, - Ended = 1 << 3, - Cancelled = 1 << 4, - - Touching = Began | Moved | Stationary, - Any = unchecked ((ulong)UInt64.MaxValue) + Began = 1 << 0, + Moved = 1 << 1, + Stationary = 1 << 2, + Ended = 1 << 3, + Cancelled = 1 << 4, + + Touching = Began | Moved | Stationary, + Any = unchecked((ulong) UInt64.MaxValue) } -#endregion -#region NSAnimation - + #endregion + #region NSAnimation + [NoMacCatalyst] [Native] public enum NSAnimationCurve : ulong { @@ -971,7 +971,7 @@ namespace AppKit { EaseOut, Linear }; - + [NoMacCatalyst] [Native] public enum NSAnimationBlockingMode : ulong { @@ -979,10 +979,10 @@ namespace AppKit { Nonblocking, NonblockingThreaded }; -#endregion + #endregion + + #region NSBox -#region NSBox - [NoMacCatalyst] [Native] public enum NSTitlePosition : ulong { @@ -999,16 +999,16 @@ namespace AppKit { [Native] public enum NSBoxType : ulong { NSBoxPrimary, - [Obsoleted (PlatformName.MacOSX, 10,15, message: "Identical to 'NSBoxPrimary'.")] + [Obsoleted (PlatformName.MacOSX, 10, 15, message: "Identical to 'NSBoxPrimary'.")] NSBoxSecondary, NSBoxSeparator, - [Obsoleted (PlatformName.MacOSX, 10,15, message: "'NSBoxOldStyle' is discouraged. Use 'NSBoxPrimary' or 'NSBoxCustom'.")] + [Obsoleted (PlatformName.MacOSX, 10, 15, message: "'NSBoxOldStyle' is discouraged. Use 'NSBoxPrimary' or 'NSBoxCustom'.")] NSBoxOldStyle, NSBoxCustom }; -#endregion + #endregion -#region NSButtonCell + #region NSButtonCell [NoMacCatalyst] [Native] public enum NSButtonType : ulong { @@ -1023,7 +1023,7 @@ namespace AppKit { Accelerator, // 10.10.3 MultiLevelAccelerator // 10.10.3 } - + [NoMacCatalyst] [Native] public enum NSBezelStyle : ulong { @@ -1046,7 +1046,7 @@ namespace AppKit { [NoMacCatalyst] [Native] - [Deprecated (PlatformName.MacOSX, 10, 12, message : "The GradientType property is unused, and setting it has no effect.")] + [Deprecated (PlatformName.MacOSX, 10, 12, message: "The GradientType property is unused, and setting it has no effect.")] public enum NSGradientType : ulong { None, ConcaveWeak, @@ -1054,16 +1054,16 @@ namespace AppKit { ConvexWeak, ConvexStrong } - -#endregion -#region NSGraphics + #endregion + + #region NSGraphics [NoMacCatalyst] // NSGraphics.h:typedef int NSWindowDepth; public enum NSWindowDepth : int { TwentyfourBitRgb = 0x208, SixtyfourBitRgb = 0x210, - OneHundredTwentyEightBitRgb = 0x220 + OneHundredTwentyEightBitRgb = 0x220 } [NoMacCatalyst] @@ -1122,17 +1122,17 @@ namespace AppKit { DissapearingItemDefault = 0, EffectPoof = 10 } -#endregion - -#region NSMatrix + #endregion + + #region NSMatrix [NoMacCatalyst] [Native] public enum NSMatrixMode : ulong { Radio, Highlight, List, Track } -#endregion + #endregion -#region NSBrowser + #region NSBrowser [NoMacCatalyst] [Native] public enum NSBrowserColumnResizingType : ulong { @@ -1144,9 +1144,9 @@ namespace AppKit { public enum NSBrowserDropOperation : ulong { On, Above } -#endregion + #endregion -#region NSColorPanel + #region NSColorPanel [NoMacCatalyst] [Native] public enum NSColorPanelMode : long { @@ -1165,78 +1165,78 @@ namespace AppKit { [Flags] [Native] public enum NSColorPanelFlags : ulong { - Gray = 0x00000001, - RGB = 0x00000002, - CMYK = 0x00000004, - HSB = 0x00000008, - CustomPalette = 0x00000010, - ColorList = 0x00000020, - Wheel = 0x00000040, - Crayon = 0x00000080, - All = 0x0000ffff + Gray = 0x00000001, + RGB = 0x00000002, + CMYK = 0x00000004, + HSB = 0x00000008, + CustomPalette = 0x00000010, + ColorList = 0x00000020, + Wheel = 0x00000040, + Crayon = 0x00000080, + All = 0x0000ffff } -#endregion -#region NSDocument + #endregion + #region NSDocument [NoMacCatalyst] [Native] - public enum NSDocumentChangeType : ulong { + public enum NSDocumentChangeType : ulong { Done, Undone, Cleared, ReadOtherContents, Autosaved, Redone, Discardable = 256 /* New in Lion */ } [NoMacCatalyst] [Native] - public enum NSSaveOperationType : ulong { + public enum NSSaveOperationType : ulong { 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 */ + Autosave = 3, /* Deprecated name in Lion */ + Elsewhere = 3, /* New Lion name */ + InPlace = 4, /* New in Lion */ + AutoSaveAs = 5 /* New in Mountain Lion */ } -#endregion + #endregion + + #region NSBezelPath -#region NSBezelPath - [NoMacCatalyst] [Native] public enum NSLineCapStyle : ulong { Butt, Round, Square } - + [NoMacCatalyst] [Native] public enum NSLineJoinStyle : ulong { Miter, Round, Bevel } - + [NoMacCatalyst] [Native] public enum NSWindingRule : ulong { NonZero, EvenOdd } - + [NoMacCatalyst] [Native] public enum NSBezierPathElement : ulong { MoveTo, LineTo, CurveTo, ClosePath } -#endregion + #endregion -#region NSRulerView + #region NSRulerView [NoMacCatalyst] [Native] public enum NSRulerOrientation : ulong { Horizontal, Vertical } -#endregion + #endregion -#region NSGestureRecognizer + #region NSGestureRecognizer [NoMacCatalyst] - [Mac (10,10)] + [Mac (10, 10)] [Native] public enum NSGestureRecognizerState : long { Possible, @@ -1247,9 +1247,9 @@ namespace AppKit { Failed, Recognized = NSGestureRecognizerState.Ended } -#endregion + #endregion -#region NSStackLayout + #region NSStackLayout [NoMacCatalyst] [Native] public enum NSUserInterfaceLayoutOrientation : long { @@ -1278,13 +1278,12 @@ namespace AppKit { Bottom = 3, Trailing = 3 } -#endregion + #endregion [NoMacCatalyst] - [Mac (10,11)] + [Mac (10, 11)] [Native] - public enum NSStackViewDistribution : long - { + public enum NSStackViewDistribution : long { GravityAreas = -1, Fill = 0, FillEqually, @@ -1312,9 +1311,9 @@ namespace AppKit { [Native (ConvertToNative = "NSTextAlignmentExtensions.ToNative", ConvertToManaged = "NSTextAlignmentExtensions.ToManaged")] public enum NSTextAlignment : ulong { Left = 0, - Right = 1, + Right = 1, Center = 2, - Justified = 3, + Justified = 3, Natural = 4 } @@ -1345,7 +1344,7 @@ namespace AppKit { Down = 0x16, Cancel = 0x17 } - + [NoMacCatalyst] [Flags] [Native] @@ -1393,11 +1392,11 @@ namespace AppKit { // Convenience enum, untyped in ObjC [NoMacCatalyst] public enum NSUnderlinePattern : int { - Solid = 0x0000, - Dot = 0x0100, - Dash = 0x0200, - DashDot = 0x0300, - DashDotDot = 0x0400 + Solid = 0x0000, + Dot = 0x0100, + Dash = 0x0200, + DashDot = 0x0300, + DashDotDot = 0x0400 } [NoMacCatalyst] @@ -1412,23 +1411,23 @@ namespace AppKit { Character, Word, Paragraph } -#region NSTrackingArea + #region NSTrackingArea [NoMacCatalyst] [Flags] [Native] public enum NSTrackingAreaOptions : ulong { - MouseEnteredAndExited = 0x01, - MouseMoved = 0x02, - CursorUpdate = 0x04, - ActiveWhenFirstResponder = 0x10, - ActiveInKeyWindow = 0x20, - ActiveInActiveApp = 0x40, - ActiveAlways = 0x80, - AssumeInside = 0x100, - InVisibleRect = 0x200, - EnabledDuringMouseDrag = 0x400 + MouseEnteredAndExited = 0x01, + MouseMoved = 0x02, + CursorUpdate = 0x04, + ActiveWhenFirstResponder = 0x10, + ActiveInKeyWindow = 0x20, + ActiveInActiveApp = 0x40, + ActiveAlways = 0x80, + AssumeInside = 0x100, + InVisibleRect = 0x200, + EnabledDuringMouseDrag = 0x400 } -#endregion + #endregion [NoMacCatalyst] [Native] @@ -1447,19 +1446,19 @@ namespace AppKit { [NoMacCatalyst] [Native] - public enum NSTiffCompression : ulong { + public enum NSTiffCompression : ulong { None = 1, CcittFax3 = 3, CcittFax4 = 4, Lzw = 5, [Deprecated (PlatformName.MacOSX, 10, 7)] - Jpeg = 6, - Next = 32766, - PackBits = 32773, + Jpeg = 6, + Next = 32766, + PackBits = 32773, [Deprecated (PlatformName.MacOSX, 10, 7)] - OldJpeg = 32865 + OldJpeg = 32865 } [NoMacCatalyst] @@ -1476,12 +1475,12 @@ namespace AppKit { [NoMacCatalyst] [Native] public enum NSImageRepLoadStatus : long { - UnknownType = -1, - ReadingHeader = -2, + UnknownType = -1, + ReadingHeader = -2, WillNeedAllData = -3, - InvalidData = -4, - UnexpectedEOF = -5, - Completed = -6 + InvalidData = -4, + UnexpectedEOF = -5, + Completed = -6 } [NoMacCatalyst] @@ -1503,7 +1502,7 @@ namespace AppKit { public enum NSPrintingOrientation : ulong { Portrait, Landscape } - + [NoMacCatalyst] [Native] public enum NSPrintingPaginationMode : ulong { @@ -1514,7 +1513,7 @@ namespace AppKit { [NoMacCatalyst] [Flags] [Native] - [Deprecated (PlatformName.MacOSX, 10, 11, message : "Use 'NSGlyphProperty' instead.")] + [Deprecated (PlatformName.MacOSX, 10, 11, message: "Use 'NSGlyphProperty' instead.")] public enum NSGlyphStorageOptions : ulong { ShowControlGlyphs = 1, ShowInvisibleGlyphs = 2, @@ -1524,7 +1523,7 @@ namespace AppKit { #if !NET [NoMacCatalyst] - [Deprecated (PlatformName.MacOSX, 10, 11, message : "Use NSTextStorageEditActions instead.")] + [Deprecated (PlatformName.MacOSX, 10, 11, message: "Use NSTextStorageEditActions instead.")] [Flags] [Native] public enum NSTextStorageEditedFlags : ulong { @@ -1541,7 +1540,7 @@ namespace AppKit { [NoMacCatalyst] [Native] - [Deprecated (PlatformName.MacOSX, 10, 14)] + [Deprecated (PlatformName.MacOSX, 10, 14)] public enum NSScrollArrowPosition : ulong { MaxEnd = 0, MinEnd = 1, @@ -1552,9 +1551,9 @@ namespace AppKit { [NoMacCatalyst] [Native] public enum NSUsableScrollerParts : ulong { - NoScroller, - [Deprecated (PlatformName.MacOSX, 10, 14)] - OnlyArrows, + NoScroller, + [Deprecated (PlatformName.MacOSX, 10, 14)] + OnlyArrows, All, } @@ -1565,16 +1564,16 @@ namespace AppKit { DecrementPage, Knob, IncrementPage, - [Deprecated (PlatformName.MacOSX, 10, 14)] + [Deprecated (PlatformName.MacOSX, 10, 14)] DecrementLine, - [Deprecated (PlatformName.MacOSX, 10, 14)] + [Deprecated (PlatformName.MacOSX, 10, 14)] IncrementLine, KnobSlot, } [NoMacCatalyst] [Native] - [Deprecated (PlatformName.MacOSX, 10, 14)] + [Deprecated (PlatformName.MacOSX, 10, 14)] public enum NSScrollerArrow : ulong { IncrementArrow, DecrementArrow } @@ -1613,12 +1612,12 @@ namespace AppKit { public enum NSTextBlockDimension : ulong { Width = 0, MinimumWidth = 1, - MaximumWidth = 2, + MaximumWidth = 2, Height = 4, - MinimumHeight = 5, + MinimumHeight = 5, MaximumHeight = 6, } - + [NoMacCatalyst] [Native] public enum NSTextBlockLayer : long { @@ -1652,11 +1651,11 @@ namespace AppKit { ExpandedTrait = (1 << 5), CondensedTrait = (1 << 6), MonoSpaceTrait = (1 << 10), - VerticalTrait = (1 << 11), + VerticalTrait = (1 << 11), UIOptimizedTrait = (1 << 12), - [Mac (10,13)] + [Mac (10, 13)] TraitTightLeading = 1 << 15, - [Mac (10,13)] + [Mac (10, 13)] TraitLooseLeading = 1 << 16, TraitEmphasized = BoldTrait, UnknownClass = 0 << 28, @@ -1691,11 +1690,11 @@ namespace AppKit { FixedPitch = 0x400, Unitalic = 0x1000000 } - + [NoMacCatalyst] [Flags] [Native] - public enum NSPasteboardWritingOptions : ulong { + public enum NSPasteboardWritingOptions : ulong { WritingPromised = 1 << 9 } @@ -1713,7 +1712,7 @@ namespace AppKit { #if !NET [NoMacCatalyst] - [Deprecated (PlatformName.MacOSX, 10, 10, message : "Use NSAlertButtonReturn instead.")] + [Deprecated (PlatformName.MacOSX, 10, 10, message: "Use NSAlertButtonReturn instead.")] [Native] public enum NSAlertType : long { ErrorReturn = -2, @@ -1725,7 +1724,7 @@ namespace AppKit { #if !NET [NoMacCatalyst] - [Deprecated (PlatformName.MacOSX, 10, 10, message : "Use NSModalResponse instead.")] + [Deprecated (PlatformName.MacOSX, 10, 10, message: "Use NSModalResponse instead.")] [Native] public enum NSPanelButtonType : long { Cancel, Ok @@ -1773,16 +1772,16 @@ namespace AppKit { [Native] public enum NSTableColumnResizing : long { None = -1, - Autoresizing = ( 1 << 0 ), - UserResizingMask = ( 1 << 1 ) - } + Autoresizing = (1 << 0), + UserResizingMask = (1 << 1) + } [NoMacCatalyst] [Flags] [Native] public enum NSTableViewGridStyle : ulong { None = 0, - SolidVerticalLine = 1 << 0, + SolidVerticalLine = 1 << 0, SolidHorizontalLine = 1 << 1, DashedHorizontalGridLine = 1 << 3 } @@ -1792,10 +1791,10 @@ namespace AppKit { [Native] public enum NSGradientDrawingOptions : ulong { None = 0, - BeforeStartingLocation = (1 << 0), - AfterEndingLocation = (1 << 1) + BeforeStartingLocation = (1 << 0), + AfterEndingLocation = (1 << 1) } - + [NoMacCatalyst] [Native] public enum NSImageAlignment : ulong { @@ -1809,7 +1808,7 @@ namespace AppKit { BottomRight, Right } - + [NoMacCatalyst] [Native] public enum NSImageFrameStyle : ulong { @@ -1819,11 +1818,11 @@ namespace AppKit { Groove, Button } - + [NoMacCatalyst] [Native] public enum NSSpeechBoundary : ulong { - Immediate = 0, + Immediate = 0, #if !NET [Obsolete ("Use 'Word' instead.")] hWord, @@ -1841,15 +1840,14 @@ namespace AppKit { } [NoMacCatalyst] - [Mac (10,11)] + [Mac (10, 11)] [Native] - public enum NSSplitViewItemBehavior : long - { + public enum NSSplitViewItemBehavior : long { Default, Sidebar, ContentList } - + [NoMacCatalyst] [Native] public enum NSImageScaling : ulong { @@ -1858,7 +1856,7 @@ namespace AppKit { None, ProportionallyUpOrDown } - + [NoMacCatalyst] [Native] public enum NSSegmentStyle : long { @@ -1869,9 +1867,9 @@ namespace AppKit { TexturedSquare = 4, Capsule = 5, SmallSquare = 6, - [Mac (10,10)] Separated = 8 + [Mac (10, 10)] Separated = 8 } - + [NoMacCatalyst] [Native] public enum NSSegmentSwitchTracking : ulong { @@ -1880,7 +1878,7 @@ namespace AppKit { Momentary = 2, MomentaryAccelerator // 10.10.3 } - + [NoMacCatalyst] [Native] public enum NSTickMarkPosition : ulong { @@ -1891,14 +1889,14 @@ namespace AppKit { Leading = Left, Trailing = Right } - + [NoMacCatalyst] [Native] public enum NSSliderType : ulong { - Linear = 0, + Linear = 0, Circular = 1 } - + [NoMacCatalyst] [Native] public enum NSTokenStyle : ulong { @@ -1932,8 +1930,8 @@ namespace AppKit { [Flags] [Native] public enum NSWorkspaceIconCreationOptions : ulong { - NSExcludeQuickDrawElements = 1 << 1, - NSExclude10_4Elements = 1 << 2 + NSExcludeQuickDrawElements = 1 << 1, + NSExclude10_4Elements = 1 << 2 } [NoMacCatalyst] @@ -1985,29 +1983,27 @@ namespace AppKit { ApplicationOnlyMask = 1 } - [MacCatalyst (13,1)] + [MacCatalyst (13, 1)] [Native] public enum NSCollectionViewDropOperation : long { On = 0, Before = 1 } - [MacCatalyst (13,1)] - [Mac (10,11)] + [MacCatalyst (13, 1)] + [Mac (10, 11)] [Native] - public enum NSCollectionViewItemHighlightState : long - { + public enum NSCollectionViewItemHighlightState : long { None = 0, ForSelection = 1, ForDeselection = 2, AsDropTarget = 3 } - [MacCatalyst (13,0)] - [Mac (10,11)] // Not marked 10.11 in the headers, but doesn't exist in the 10.10 headers + [MacCatalyst (13, 0)] + [Mac (10, 11)] // Not marked 10.11 in the headers, but doesn't exist in the 10.10 headers [Native] [Flags] - public enum NSCollectionViewScrollPosition : ulong - { + public enum NSCollectionViewScrollPosition : ulong { None = 0, Top = 1 << 0, CenteredVertically = 1 << 1, @@ -2021,11 +2017,10 @@ namespace AppKit { NearestVerticalEdge = 1 << 8 } - [MacCatalyst (13,1)] - [Mac (10,11)] + [MacCatalyst (13, 1)] + [Mac (10, 11)] [Native] - public enum NSCollectionElementCategory : long - { + public enum NSCollectionElementCategory : long { Item, SupplementaryView, DecorationView, @@ -2033,10 +2028,9 @@ namespace AppKit { } [NoMacCatalyst] - [Mac (10,11)] + [Mac (10, 11)] [Native] - public enum NSCollectionUpdateAction : long - { + public enum NSCollectionUpdateAction : long { Insert, Delete, Reload, @@ -2044,11 +2038,10 @@ namespace AppKit { None } - [MacCatalyst (13,1)] - [Mac (10,11)] + [MacCatalyst (13, 1)] + [Mac (10, 11)] [Native] - public enum NSCollectionViewScrollDirection : long - { + public enum NSCollectionViewScrollDirection : long { Vertical, Horizontal } @@ -2082,7 +2075,7 @@ namespace AppKit { [NoMacCatalyst] [Native] - [Deprecated (PlatformName.MacOSX, 10, 14, message : "Use 'Metal' Framework instead.")] + [Deprecated (PlatformName.MacOSX, 10, 14, message: "Use 'Metal' Framework instead.")] public enum NSOpenGLContextParameter : ulong { [Deprecated (PlatformName.MacOSX, 10, 7)] SwapRectangle = 200, @@ -2107,7 +2100,7 @@ namespace AppKit { HasDrawable = 314, MpsSwapsInFlight = 315 } - + [NoMacCatalyst] public enum NSSurfaceOrder { AboveWindow = 1, @@ -2115,74 +2108,74 @@ namespace AppKit { } [NoMacCatalyst] - [Deprecated (PlatformName.MacOSX, 10, 14, message : "Use 'Metal' Framework instead.")] + [Deprecated (PlatformName.MacOSX, 10, 14, message: "Use 'Metal' Framework instead.")] public enum NSOpenGLPixelFormatAttribute : uint { // uint32_t NSOpenGLPixelFormatAttribute - AllRenderers = 1, - DoubleBuffer = 5, + AllRenderers = 1, + DoubleBuffer = 5, TripleBuffer = 3, #if !NET [Obsolete ("Use 'TripleBuffer' instead.")] TrippleBuffer = TripleBuffer, #endif - Stereo = 6, - AuxBuffers = 7, - ColorSize = 8, - AlphaSize = 11, - DepthSize = 12, - StencilSize = 13, - AccumSize = 14, - MinimumPolicy = 51, - MaximumPolicy = 52, + Stereo = 6, + AuxBuffers = 7, + ColorSize = 8, + AlphaSize = 11, + DepthSize = 12, + StencilSize = 13, + AccumSize = 14, + MinimumPolicy = 51, + MaximumPolicy = 52, [Deprecated (PlatformName.MacOSX, 10, 7)] - OffScreen = 53, + OffScreen = 53, [Deprecated (PlatformName.MacOSX, 10, 6)] - FullScreen = 54, - SampleBuffers = 55, - Samples = 56, - AuxDepthStencil = 57, - ColorFloat = 58, - Multisample = 59, - Supersample = 60, - SampleAlpha = 61, - RendererID = 70, + FullScreen = 54, + SampleBuffers = 55, + Samples = 56, + AuxDepthStencil = 57, + ColorFloat = 58, + Multisample = 59, + Supersample = 60, + SampleAlpha = 61, + RendererID = 70, [Deprecated (PlatformName.MacOSX, 10, 9)] - SingleRenderer = 71, - NoRecovery = 72, - Accelerated = 73, - ClosestPolicy = 74, - BackingStore = 76, + SingleRenderer = 71, + NoRecovery = 72, + Accelerated = 73, + ClosestPolicy = 74, + BackingStore = 76, [Deprecated (PlatformName.MacOSX, 10, 9)] - Window = 80, + Window = 80, [Deprecated (PlatformName.MacOSX, 10, 9)] - Compliant = 83, - ScreenMask = 84, + Compliant = 83, + ScreenMask = 84, [Deprecated (PlatformName.MacOSX, 10, 7)] - PixelBuffer = 90, + PixelBuffer = 90, [Deprecated (PlatformName.MacOSX, 10, 7)] - RemotePixelBuffer = 91, + RemotePixelBuffer = 91, AllowOfflineRenderers = 96, - AcceleratedCompute = 97, + AcceleratedCompute = 97, // Specify the profile OpenGLProfile = 99, VirtualScreenCount = 128, [Deprecated (PlatformName.MacOSX, 10, 5)] - Robust = 75, + Robust = 75, [Deprecated (PlatformName.MacOSX, 10, 5)] - MPSafe = 78, + MPSafe = 78, [Deprecated (PlatformName.MacOSX, 10, 5)] - MultiScreen = 81 + MultiScreen = 81 } [NoMacCatalyst] - [Deprecated (PlatformName.MacOSX, 10, 14, message : "Use 'Metal' Framework instead.")] + [Deprecated (PlatformName.MacOSX, 10, 14, message: "Use 'Metal' Framework instead.")] public enum NSOpenGLProfile : int { - VersionLegacy = 0x1000, // Legacy - Version3_2Core = 0x3200, // 3.2 or better - Version4_1Core = 0x4100 + VersionLegacy = 0x1000, // Legacy + Version3_2Core = 0x3200, // 3.2 or better + Version4_1Core = 0x4100 } - + [NoMacCatalyst] [Native] public enum NSAlertButtonReturn : long { @@ -2192,7 +2185,7 @@ namespace AppKit { } [NoMacCatalyst] - [Deprecated (PlatformName.MacOSX, 10, 14, message : "Use 'Metal' Framework instead.")] + [Deprecated (PlatformName.MacOSX, 10, 14, message: "Use 'Metal' Framework instead.")] public enum NSOpenGLGlobalOption : uint { FormatCacheSize = 501, ClearFormatCache = 502, @@ -2203,7 +2196,7 @@ namespace AppKit { } [NoMacCatalyst] - [Deprecated (PlatformName.MacOSX, 10, 14, message : "Use 'Metal' Framework instead.")] + [Deprecated (PlatformName.MacOSX, 10, 14, message: "Use 'Metal' Framework instead.")] public enum NSGLTextureTarget : uint { T2D = 0x0de1, CubeMap = 0x8513, @@ -2211,15 +2204,15 @@ namespace AppKit { } [NoMacCatalyst] - [Deprecated (PlatformName.MacOSX, 10, 14, message : "Use 'Metal' Framework instead.")] + [Deprecated (PlatformName.MacOSX, 10, 14, message: "Use 'Metal' Framework instead.")] public enum NSGLFormat : uint { RGB = 0x1907, RGBA = 0x1908, DepthComponent = 0x1902, } - + [NoMacCatalyst] - [Deprecated (PlatformName.MacOSX, 10, 14, message : "Use 'Metal' Framework instead.")] + [Deprecated (PlatformName.MacOSX, 10, 14, message: "Use 'Metal' Framework instead.")] public enum NSGLTextureCubeMap : uint { None = 0, PositiveX = 0x8515, @@ -2231,7 +2224,7 @@ namespace AppKit { } [NoMacCatalyst] - [Deprecated (PlatformName.MacOSX, 10, 14, message : "Use 'Metal' Framework instead.")] + [Deprecated (PlatformName.MacOSX, 10, 14, message: "Use 'Metal' Framework instead.")] public enum NSGLColorBuffer : uint { Front = 0x0404, Back = 0x0405, @@ -2263,197 +2256,196 @@ namespace AppKit { } // FileType 4cc values to use with NSFileTypeForHFSTypeCode. - [MacCatalyst(15, 0)] - public enum HfsTypeCode : uint - { + [MacCatalyst (15, 0)] + public enum HfsTypeCode : uint { /* Generic Finder icons */ - ClipboardIcon = 0x434C4950, //'CLIP' - ClippingUnknownTypeIcon = 0x636C7075, //'clpu' - ClippingPictureTypeIcon = 0x636C7070, //'clpp' - ClippingTextTypeIcon = 0x636C7074, //'clpt' - ClippingSoundTypeIcon = 0x636C7073, //'clps' - DesktopIcon = 0x6465736B, //'desk' - FinderIcon = 0x464E4452, //'FNDR' - ComputerIcon = 0x726F6F74, //'root' - FontSuitcaseIcon = 0x4646494C, //'FFIL' - FullTrashIcon = 0x66747268, //'ftrh' - GenericApplicationIcon = 0x4150504C, //'APPL' - GenericCdromIcon = 0x63646472, //'cddr' - GenericControlPanelIcon = 0x41505043, //'APPC' + ClipboardIcon = 0x434C4950, //'CLIP' + ClippingUnknownTypeIcon = 0x636C7075, //'clpu' + ClippingPictureTypeIcon = 0x636C7070, //'clpp' + ClippingTextTypeIcon = 0x636C7074, //'clpt' + ClippingSoundTypeIcon = 0x636C7073, //'clps' + DesktopIcon = 0x6465736B, //'desk' + FinderIcon = 0x464E4452, //'FNDR' + ComputerIcon = 0x726F6F74, //'root' + FontSuitcaseIcon = 0x4646494C, //'FFIL' + FullTrashIcon = 0x66747268, //'ftrh' + GenericApplicationIcon = 0x4150504C, //'APPL' + GenericCdromIcon = 0x63646472, //'cddr' + GenericControlPanelIcon = 0x41505043, //'APPC' GenericControlStripModuleIcon = 0x73646576, //'sdev' - GenericComponentIcon = 0x74686E67, //'thng' - GenericDeskAccessoryIcon = 0x41505044, //'APPD' - GenericDocumentIcon = 0x646F6375, //'docu' - GenericEditionFileIcon = 0x65647466, //'edtf' - GenericExtensionIcon = 0x494E4954, //'INIT' - GenericFileServerIcon = 0x73727672, //'srvr' - GenericFontIcon = 0x6666696C, //'ffil' - GenericFontScalerIcon = 0x73636C72, //'sclr' - GenericFloppyIcon = 0x666C7079, //'flpy' - GenericHardDiskIcon = 0x6864736B, //'hdsk' - GenericIDiskIcon = 0x6964736B, //'idsk' - GenericRemovableMediaIcon = 0x726D6F76, //'rmov' - GenericMoverObjectIcon = 0x6D6F7672, //'movr' - GenericPCCardIcon = 0x70636D63, //'pcmc' - GenericPreferencesIcon = 0x70726566, //'pref' - GenericQueryDocumentIcon = 0x71657279, //'qery' - GenericRamDiskIcon = 0x72616D64, //'ramd' + GenericComponentIcon = 0x74686E67, //'thng' + GenericDeskAccessoryIcon = 0x41505044, //'APPD' + GenericDocumentIcon = 0x646F6375, //'docu' + GenericEditionFileIcon = 0x65647466, //'edtf' + GenericExtensionIcon = 0x494E4954, //'INIT' + GenericFileServerIcon = 0x73727672, //'srvr' + GenericFontIcon = 0x6666696C, //'ffil' + GenericFontScalerIcon = 0x73636C72, //'sclr' + GenericFloppyIcon = 0x666C7079, //'flpy' + GenericHardDiskIcon = 0x6864736B, //'hdsk' + GenericIDiskIcon = 0x6964736B, //'idsk' + GenericRemovableMediaIcon = 0x726D6F76, //'rmov' + GenericMoverObjectIcon = 0x6D6F7672, //'movr' + GenericPCCardIcon = 0x70636D63, //'pcmc' + GenericPreferencesIcon = 0x70726566, //'pref' + GenericQueryDocumentIcon = 0x71657279, //'qery' + GenericRamDiskIcon = 0x72616D64, //'ramd' #if !NET [Obsolete ("Use 'GenericSharedLibraryIcon' instead.")] - GenericSharedLibaryIcon = 0x73686C62, //'shlb' + GenericSharedLibaryIcon = 0x73686C62, //'shlb' #endif - GenericSharedLibraryIcon = 0x73686C62, //'shlb' - GenericStationeryIcon = 0x73646F63, //'sdoc' - GenericSuitcaseIcon = 0x73756974, //'suit' - GenericUrlIcon = 0x6775726C, //'gurl' - GenericWormIcon = 0x776F726D, //'worm' - InternationalResourcesIcon = 0x6966696C, //'ifil' - KeyboardLayoutIcon = 0x6B66696C, //'kfil' - SoundFileIcon = 0x7366696C, //'sfil' - SystemSuitcaseIcon = 0x7A737973, //'zsys' - TrashIcon = 0x74727368, //'trsh' - TrueTypeFontIcon = 0x7466696C, //'tfil' - TrueTypeFlatFontIcon = 0x73666E74, //'sfnt' - TrueTypeMultiFlatFontIcon = 0x74746366, //'ttcf' - UserIDiskIcon = 0x7564736B, //'udsk' - UnknownFSObjectIcon = 0x756E6673, //'unfs' + GenericSharedLibraryIcon = 0x73686C62, //'shlb' + GenericStationeryIcon = 0x73646F63, //'sdoc' + GenericSuitcaseIcon = 0x73756974, //'suit' + GenericUrlIcon = 0x6775726C, //'gurl' + GenericWormIcon = 0x776F726D, //'worm' + InternationalResourcesIcon = 0x6966696C, //'ifil' + KeyboardLayoutIcon = 0x6B66696C, //'kfil' + SoundFileIcon = 0x7366696C, //'sfil' + SystemSuitcaseIcon = 0x7A737973, //'zsys' + TrashIcon = 0x74727368, //'trsh' + TrueTypeFontIcon = 0x7466696C, //'tfil' + TrueTypeFlatFontIcon = 0x73666E74, //'sfnt' + TrueTypeMultiFlatFontIcon = 0x74746366, //'ttcf' + UserIDiskIcon = 0x7564736B, //'udsk' + UnknownFSObjectIcon = 0x756E6673, //'unfs' /* Internet locations */ - InternetLocationHttpIcon = 0x696C6874, //'ilht' - InternetLocationFtpIcon = 0x696C6674, //'ilft' - InternetLocationAppleShareIcon = 0x696C6166, //'ilaf' - InternetLocationAppleTalkZoneIcon = 0x696C6174, //'ilat' - InternetLocationFileIcon = 0x696C6669, //'ilfi' - InternetLocationMailIcon = 0x696C6D61, //'ilma' - InternetLocationNewsIcon = 0x696C6E77, //'ilnw' + InternetLocationHttpIcon = 0x696C6874, //'ilht' + InternetLocationFtpIcon = 0x696C6674, //'ilft' + InternetLocationAppleShareIcon = 0x696C6166, //'ilaf' + InternetLocationAppleTalkZoneIcon = 0x696C6174, //'ilat' + InternetLocationFileIcon = 0x696C6669, //'ilfi' + InternetLocationMailIcon = 0x696C6D61, //'ilma' + InternetLocationNewsIcon = 0x696C6E77, //'ilnw' InternetLocationNslNeighborhoodIcon = 0x696C6E73, //'ilns' - InternetLocationGenericIcon = 0x696C6765, //'ilge' + InternetLocationGenericIcon = 0x696C6765, //'ilge' /* Folders */ GenericFolderIcon = 0x666C6472, //'fldr' - DropFolderIcon = 0x64626F78, //'dbox' + DropFolderIcon = 0x64626F78, //'dbox' MountedFolderIcon = 0x6D6E7464, //'mntd' - OpenFolderIcon = 0x6F666C64, //'ofld' - OwnedFolderIcon = 0x6F776E64, //'ownd' + OpenFolderIcon = 0x6F666C64, //'ofld' + OwnedFolderIcon = 0x6F776E64, //'ownd' PrivateFolderIcon = 0x70727666, //'prvf' - SharedFolderIcon = 0x7368666C, //'shfl' + SharedFolderIcon = 0x7368666C, //'shfl' /* Sharingprivileges icons */ SharingPrivsNotApplicableIcon = 0x73686E61, //'shna' - SharingPrivsReadOnlyIcon = 0x7368726F, //'shro' - SharingPrivsReadWriteIcon = 0x73687277, //'shrw' - SharingPrivsUnknownIcon = 0x7368756B, //'shuk' - SharingPrivsWritableIcon = 0x77726974, //'writ' + SharingPrivsReadOnlyIcon = 0x7368726F, //'shro' + SharingPrivsReadWriteIcon = 0x73687277, //'shrw' + SharingPrivsUnknownIcon = 0x7368756B, //'shuk' + SharingPrivsWritableIcon = 0x77726974, //'writ' /* Users and Groups icons */ - UserFolderIcon = 0x75666C64, //'ufld' + UserFolderIcon = 0x75666C64, //'ufld' WorkgroupFolderIcon = 0x77666C64, //'wfld' - GuestUserIcon = 0x67757372, //'gusr' - UserIcon = 0x75736572, //'user' - OwnerIcon = 0x73757372, //'susr' - GroupIcon = 0x67727570, //'grup' + GuestUserIcon = 0x67757372, //'gusr' + UserIcon = 0x75736572, //'user' + OwnerIcon = 0x73757372, //'susr' + GroupIcon = 0x67727570, //'grup' /* Special folders */ - AppearanceFolderIcon = 0x61707072, //'appr' - AppleMenuFolderIcon = 0x616D6E75, //'amnu' - ApplicationsFolderIcon = 0x61707073, //'apps' - ApplicationSupportFolderIcon = 0x61737570, //'asup' - ColorSyncFolderIcon = 0x70726F66, //'prof' - ContextualMenuItemsFolderIcon = 0x636D6E75, //'cmnu' - ControlPanelDisabledFolderIcon = 0x63747244, //'ctrD' - ControlPanelFolderIcon = 0x6374726C, //'ctrl' - DocumentsFolderIcon = 0x646F6373, //'docs' - ExtensionsDisabledFolderIcon = 0x65787444, //'extD' - ExtensionsFolderIcon = 0x6578746E, //'extn' - FavoritesFolderIcon = 0x66617673, //'favs' - FontsFolderIcon = 0x666F6E74, //'font' - InternetSearchSitesFolderIcon = 0x69737366, //'issf' - PublicFolderIcon = 0x70756266, //'pubf' - PrinterDescriptionFolderIcon = 0x70706466, //'ppdf' - PrintMonitorFolderIcon = 0x70726E74, //'prnt' - RecentApplicationsFolderIcon = 0x72617070, //'rapp' - RecentDocumentsFolderIcon = 0x72646F63, //'rdoc' - RecentServersFolderIcon = 0x72737276, //'rsrv' - ShutdownItemsDisabledFolderIcon = 0x73686444, //'shdD' - ShutdownItemsFolderIcon = 0x73686466, //'shdf' - SpeakableItemsFolder = 0x73706B69, //'spki' - StartupItemsDisabledFolderIcon = 0x73747244, //'strD' - StartupItemsFolderIcon = 0x73747274, //'strt' + AppearanceFolderIcon = 0x61707072, //'appr' + AppleMenuFolderIcon = 0x616D6E75, //'amnu' + ApplicationsFolderIcon = 0x61707073, //'apps' + ApplicationSupportFolderIcon = 0x61737570, //'asup' + ColorSyncFolderIcon = 0x70726F66, //'prof' + ContextualMenuItemsFolderIcon = 0x636D6E75, //'cmnu' + ControlPanelDisabledFolderIcon = 0x63747244, //'ctrD' + ControlPanelFolderIcon = 0x6374726C, //'ctrl' + DocumentsFolderIcon = 0x646F6373, //'docs' + ExtensionsDisabledFolderIcon = 0x65787444, //'extD' + ExtensionsFolderIcon = 0x6578746E, //'extn' + FavoritesFolderIcon = 0x66617673, //'favs' + FontsFolderIcon = 0x666F6E74, //'font' + InternetSearchSitesFolderIcon = 0x69737366, //'issf' + PublicFolderIcon = 0x70756266, //'pubf' + PrinterDescriptionFolderIcon = 0x70706466, //'ppdf' + PrintMonitorFolderIcon = 0x70726E74, //'prnt' + RecentApplicationsFolderIcon = 0x72617070, //'rapp' + RecentDocumentsFolderIcon = 0x72646F63, //'rdoc' + RecentServersFolderIcon = 0x72737276, //'rsrv' + ShutdownItemsDisabledFolderIcon = 0x73686444, //'shdD' + ShutdownItemsFolderIcon = 0x73686466, //'shdf' + SpeakableItemsFolder = 0x73706B69, //'spki' + StartupItemsDisabledFolderIcon = 0x73747244, //'strD' + StartupItemsFolderIcon = 0x73747274, //'strt' SystemExtensionDisabledFolderIcon = 0x6D616344, //'macD' - SystemFolderIcon = 0x6D616373, //'macs' - VoicesFolderIcon = 0x66766F63, //'fvoc' + SystemFolderIcon = 0x6D616373, //'macs' + VoicesFolderIcon = 0x66766F63, //'fvoc' /* Badges */ - AppleScriptBadgeIcon = 0x73637270, //'scrp' - LockedBadgeIcon = 0x6C626467, //'lbdg' - MountedBadgeIcon = 0x6D626467, //'mbdg' - SharedBadgeIcon = 0x73626467, //'sbdg' - AliasBadgeIcon = 0x61626467, //'abdg' + AppleScriptBadgeIcon = 0x73637270, //'scrp' + LockedBadgeIcon = 0x6C626467, //'lbdg' + MountedBadgeIcon = 0x6D626467, //'mbdg' + SharedBadgeIcon = 0x73626467, //'sbdg' + AliasBadgeIcon = 0x61626467, //'abdg' AlertCautionBadgeIcon = 0x63626467, //'cbdg' /* Alert icons */ - AlertNoteIcon = 0x6E6F7465, //'note' + AlertNoteIcon = 0x6E6F7465, //'note' AlertCautionIcon = 0x63617574, //'caut' - AlertStopIcon = 0x73746F70, //'stop' + AlertStopIcon = 0x73746F70, //'stop' /* Networking icons */ - AppleTalkIcon = 0x61746C6B, //'atlk' - AppleTalkZoneIcon = 0x61747A6E, //'atzn' - AfpServerIcon = 0x61667073, //'afps' - FtpServerIcon = 0x66747073, //'ftps' - HttpServerIcon = 0x68747073, //'htps' + AppleTalkIcon = 0x61746C6B, //'atlk' + AppleTalkZoneIcon = 0x61747A6E, //'atzn' + AfpServerIcon = 0x61667073, //'afps' + FtpServerIcon = 0x66747073, //'ftps' + HttpServerIcon = 0x68747073, //'htps' GenericNetworkIcon = 0x676E6574, //'gnet' - IPFileServerIcon = 0x69737276, //'isrv' + IPFileServerIcon = 0x69737276, //'isrv' /* Toolbar icons */ - ToolbarCustomizeIcon = 0x74637573, //'tcus' - ToolbarDeleteIcon = 0x7464656C, //'tdel' - ToolbarFavoritesIcon = 0x74666176, //'tfav' - ToolbarHomeIcon = 0x74686F6D, //'thom' - ToolbarAdvancedIcon = 0x74626176, //'tbav' - ToolbarInfoIcon = 0x7462696E, //'tbin' - ToolbarLabelsIcon = 0x74626C62, //'tblb' + ToolbarCustomizeIcon = 0x74637573, //'tcus' + ToolbarDeleteIcon = 0x7464656C, //'tdel' + ToolbarFavoritesIcon = 0x74666176, //'tfav' + ToolbarHomeIcon = 0x74686F6D, //'thom' + ToolbarAdvancedIcon = 0x74626176, //'tbav' + ToolbarInfoIcon = 0x7462696E, //'tbin' + ToolbarLabelsIcon = 0x74626C62, //'tblb' ToolbarApplicationsFolderIcon = 0x74417073, //'tAps' - ToolbarDocumentsFolderIcon = 0x74446F63, //'tDoc' - ToolbarMovieFolderIcon = 0x744D6F76, //'tMov' - ToolbarMusicFolderIcon = 0x744D7573, //'tMus' - ToolbarPicturesFolderIcon = 0x74506963, //'tPic' - ToolbarPublicFolderIcon = 0x74507562, //'tPub' - ToolbarDesktopFolderIcon = 0x7444736B, //'tDsk' - ToolbarDownloadsFolderIcon = 0x7444776E, //'tDwn' - ToolbarLibraryFolderIcon = 0x744C6962, //'tLib' - ToolbarUtilitiesFolderIcon = 0x7455746C, //'tUtl' - ToolbarSitesFolderIcon = 0x74537473, //'tSts' + ToolbarDocumentsFolderIcon = 0x74446F63, //'tDoc' + ToolbarMovieFolderIcon = 0x744D6F76, //'tMov' + ToolbarMusicFolderIcon = 0x744D7573, //'tMus' + ToolbarPicturesFolderIcon = 0x74506963, //'tPic' + ToolbarPublicFolderIcon = 0x74507562, //'tPub' + ToolbarDesktopFolderIcon = 0x7444736B, //'tDsk' + ToolbarDownloadsFolderIcon = 0x7444776E, //'tDwn' + ToolbarLibraryFolderIcon = 0x744C6962, //'tLib' + ToolbarUtilitiesFolderIcon = 0x7455746C, //'tUtl' + ToolbarSitesFolderIcon = 0x74537473, //'tSts' /* Other icons */ - AppleLogoIcon = 0x6361706C, //'capl' - AppleMenuIcon = 0x7361706C, //'sapl' - BackwardArrowIcon = 0x6261726F, //'baro' - FavoriteItemsIcon = 0x66617672, //'favr' - ForwardArrowIcon = 0x6661726F, //'faro' - GridIcon = 0x67726964, //'grid' - HelpIcon = 0x68656C70, //'help' - KeepArrangedIcon = 0x61726E67, //'arng' - LockedIcon = 0x6C6F636B, //'lock' - NoFilesIcon = 0x6E66696C, //'nfil' - NoFolderIcon = 0x6E666C64, //'nfld' - NoWriteIcon = 0x6E777274, //'nwrt' + AppleLogoIcon = 0x6361706C, //'capl' + AppleMenuIcon = 0x7361706C, //'sapl' + BackwardArrowIcon = 0x6261726F, //'baro' + FavoriteItemsIcon = 0x66617672, //'favr' + ForwardArrowIcon = 0x6661726F, //'faro' + GridIcon = 0x67726964, //'grid' + HelpIcon = 0x68656C70, //'help' + KeepArrangedIcon = 0x61726E67, //'arng' + LockedIcon = 0x6C6F636B, //'lock' + NoFilesIcon = 0x6E66696C, //'nfil' + NoFolderIcon = 0x6E666C64, //'nfld' + NoWriteIcon = 0x6E777274, //'nwrt' ProtectedApplicationFolderIcon = 0x70617070, //'papp' - ProtectedSystemFolderIcon = 0x70737973, //'psys' - RecentItemsIcon = 0x72636E74, //'rcnt' - ShortcutIcon = 0x73687274, //'shrt' - SortAscendingIcon = 0x61736E64, //'asnd' - SortDescendingIcon = 0x64736E64, //'dsnd' - UnlockedIcon = 0x756C636B, //'ulck' - ConnectToIcon = 0x636E6374, //'cnct' - GenericWindowIcon = 0x6777696E, //'gwin' - QuestionMarkIcon = 0x71756573, //'ques' - DeleteAliasIcon = 0x64616C69, //'dali' - EjectMediaIcon = 0x656A6563, //'ejec' - BurningIcon = 0x6275726E, //'burn' - RightContainerArrowIcon = 0x72636172, //'rcar' + ProtectedSystemFolderIcon = 0x70737973, //'psys' + RecentItemsIcon = 0x72636E74, //'rcnt' + ShortcutIcon = 0x73687274, //'shrt' + SortAscendingIcon = 0x61736E64, //'asnd' + SortDescendingIcon = 0x64736E64, //'dsnd' + UnlockedIcon = 0x756C636B, //'ulck' + ConnectToIcon = 0x636E6374, //'cnct' + GenericWindowIcon = 0x6777696E, //'gwin' + QuestionMarkIcon = 0x71756573, //'ques' + DeleteAliasIcon = 0x64616C69, //'dali' + EjectMediaIcon = 0x656A6563, //'ejec' + BurningIcon = 0x6275726E, //'burn' + RightContainerArrowIcon = 0x72636172, //'rcar' } - + // These constants specify the possible states of a drawer. [NoMacCatalyst] [Native] @@ -2472,7 +2464,7 @@ namespace AppKit { [Deprecated (PlatformName.MacOSX, 10, 13)] Dock = 20, Floating = 3, - MainMenu = 24, + MainMenu = 24, ModalPanel = 8, PopUpMenu = 101, ScreenSaver = 1000, @@ -2480,14 +2472,14 @@ namespace AppKit { Submenu = 3, TornOffMenu = 3 } - + [NoMacCatalyst] [Native] public enum NSRuleEditorRowType : ulong { Simple = 0, Compound } - + [NoMacCatalyst] [Native] public enum NSRuleEditorNestingMode : ulong { @@ -2499,7 +2491,7 @@ namespace AppKit { [NoMacCatalyst] [Native] - [Deprecated (PlatformName.MacOSX, 10, 11, message : "Use 'NSGlyphProperty' instead.")] + [Deprecated (PlatformName.MacOSX, 10, 11, message: "Use 'NSGlyphProperty' instead.")] public enum NSGlyphInscription : ulong { Base, Below, Above, Overstrike, OverBelow } @@ -2513,7 +2505,7 @@ namespace AppKit { Specific_10_2 = 2, Specific_10_3 = 3, Specific_10_4 = 4, - + } [NoMacCatalyst] @@ -2525,7 +2517,7 @@ namespace AppKit { Sound = 1 << 1, Alert = 1 << 2 } - + [NoMacCatalyst] [Native] public enum NSScrollViewFindBarPosition : long { @@ -2533,28 +2525,28 @@ namespace AppKit { AboveContent, BelowContent } - + [NoMacCatalyst] [Native] public enum NSScrollerStyle : long { - Legacy = 0, + Legacy = 0, Overlay } - + [NoMacCatalyst] [Native] - public enum NSScrollElasticity : long { + public enum NSScrollElasticity : long { Automatic = 0, - None, + None, Allowed } - + [NoMacCatalyst] [Native] - public enum NSScrollerKnobStyle : long { - Default = 0, - Dark = 1, - Light = 2 + public enum NSScrollerKnobStyle : long { + Default = 0, + Dark = 1, + Light = 2 } [NoMacCatalyst] @@ -2622,19 +2614,17 @@ namespace AppKit { } [NoMacCatalyst] - [Mac (10,11)] + [Mac (10, 11)] [Native] - public enum NSTableRowActionEdge : long - { + public enum NSTableRowActionEdge : long { Leading, Trailing } [NoMacCatalyst] - [Mac (10,11)] + [Mac (10, 11)] [Native] - public enum NSTableViewRowActionStyle : long - { + public enum NSTableViewRowActionStyle : long { Regular, Destructive } @@ -2698,14 +2688,14 @@ namespace AppKit { FaceMask = 1 << 0, SizeMask = 1 << 1, CollectionMask = 1 << 2, - UnderlineEffectMask = 1<<8, - StrikethroughEffectMask = 1<<9, - TextColorEffectMask = 1<< 10, - DocumentColorEffectMask = 1<<11, - ShadowEffectMask = 1<<12, + UnderlineEffectMask = 1 << 8, + StrikethroughEffectMask = 1 << 9, + TextColorEffectMask = 1 << 10, + DocumentColorEffectMask = 1 << 11, + ShadowEffectMask = 1 << 12, AllEffectsMask = 0XFFF00, StandardMask = 0xFFFF, - AllModesMask = unchecked ((ulong)UInt32.MaxValue) + AllModesMask = unchecked((ulong) UInt32.MaxValue) } [NoMacCatalyst] @@ -2774,20 +2764,20 @@ namespace AppKit { [NoMacCatalyst] [Flags] [Native] - public enum NSApplicationOcclusionState : ulong { + public enum NSApplicationOcclusionState : ulong { Visible = 1 << 1 } [NoMacCatalyst] [Flags] [Native] - public enum NSWindowOcclusionState : ulong { + public enum NSWindowOcclusionState : ulong { Visible = 1 << 1 } - - -#region NSVisualEffectView + + + #region NSVisualEffectView [NoMacCatalyst] [Native] public enum NSVisualEffectMaterial : long { @@ -2799,35 +2789,35 @@ namespace AppKit { Dark, Titlebar, Selection, - [Mac (10,11)] + [Mac (10, 11)] Menu, - [Mac (10,11)] + [Mac (10, 11)] Popover, - [Mac (10,11)] + [Mac (10, 11)] Sidebar, - [Mac (10,11)] + [Mac (10, 11)] [Advice ("Use a semantic material instead.")] MediumLight, - [Mac (10,11)] + [Mac (10, 11)] [Advice ("Use a semantic material instead.")] UltraDark, - [Mac (10,14)] + [Mac (10, 14)] HeaderView = 10, - [Mac (10,14)] + [Mac (10, 14)] Sheet = 11, - [Mac (10,14)] + [Mac (10, 14)] WindowBackground = 12, - [Mac (10,14)] + [Mac (10, 14)] HudWindow = 13, - [Mac (10,14)] + [Mac (10, 14)] FullScreenUI = 15, - [Mac (10,14)] + [Mac (10, 14)] ToolTip = 17, - [Mac (10,14)] + [Mac (10, 14)] ContentBackground = 18, - [Mac (10,14)] + [Mac (10, 14)] UnderWindowBackground = 21, - [Mac (10,14)] + [Mac (10, 14)] UnderPageBackground = 22, } @@ -2845,13 +2835,12 @@ namespace AppKit { Active, Inactive } -#endregion + #endregion [NoMacCatalyst] - [Mac (10,10,3)] + [Mac (10, 10, 3)] [Native] - public enum NSPressureBehavior : long - { + public enum NSPressureBehavior : long { Unknown = -1, PrimaryDefault = 0, PrimaryClick = 1, @@ -2862,30 +2851,27 @@ namespace AppKit { } [NoMacCatalyst] - [Mac (10,11)] + [Mac (10, 11)] [Native] - public enum NSHapticFeedbackPattern : long - { + public enum NSHapticFeedbackPattern : long { Generic = 0, Alignment, LevelChange } [NoMacCatalyst] - [Mac (10,11)] + [Mac (10, 11)] [Native] - public enum NSHapticFeedbackPerformanceTime : ulong - { + public enum NSHapticFeedbackPerformanceTime : ulong { Default = 0, Now, DrawCompleted } [NoMacCatalyst] - [Mac (10,11)] + [Mac (10, 11)] [Native] - public enum NSSpringLoadingHighlight : long - { + public enum NSSpringLoadingHighlight : long { None = 0, Standard, Emphasized @@ -2893,10 +2879,9 @@ namespace AppKit { [NoMacCatalyst] [Flags] - [Mac (10,11)] + [Mac (10, 11)] [Native] - public enum NSSpringLoadingOptions : ulong - { + public enum NSSpringLoadingOptions : ulong { Disabled = 0, Enabled = 1 << 0, ContinuousActivation = 1 << 1, @@ -2905,36 +2890,33 @@ namespace AppKit { [NoMacCatalyst] [Flags] - [Mac (10,12)] + [Mac (10, 12)] [Native] public enum NSWindowListOptions : long { OrderedFrontToBack = (1 << 0) } [NoMacCatalyst] - [Mac (10,12)] + [Mac (10, 12)] [Native] - public enum NSStatusItemBehavior : ulong - { + public enum NSStatusItemBehavior : ulong { RemovalAllowed = (1 << 1), TerminationOnRemoval = (1 << 2) } [NoMacCatalyst] - [Mac (10,12)] + [Mac (10, 12)] [Native] - public enum NSWindowTabbingMode : long - { + public enum NSWindowTabbingMode : long { Automatic, Preferred, Disallowed } [NoMacCatalyst] - [Mac (10,12)] + [Mac (10, 12)] [Native] - public enum NSWindowUserTabbingPreference : long - { + public enum NSWindowUserTabbingPreference : long { Manual, Always, InFullScreen @@ -2943,8 +2925,7 @@ namespace AppKit { [NoMacCatalyst] [Mac (10, 12)] [Native] - public enum NSGridCellPlacement : long - { + public enum NSGridCellPlacement : long { Inherited = 0, None, Leading, @@ -2958,8 +2939,7 @@ namespace AppKit { [NoMacCatalyst] [Mac (10, 12)] [Native] - public enum NSGridRowAlignment : long - { + public enum NSGridRowAlignment : long { Inherited = 0, None, FirstBaseline, @@ -2969,8 +2949,7 @@ namespace AppKit { [NoMacCatalyst] [Mac (10, 12)] [Native] - public enum NSImageLayoutDirection : long - { + public enum NSImageLayoutDirection : long { Unspecified = -1, LeftToRight = 2, RightToLeft = 3 @@ -2978,9 +2957,9 @@ namespace AppKit { [NoMacCatalyst] [Mac (10, 12)] - [Native][Flags] - public enum NSCloudKitSharingServiceOptions : ulong - { + [Native] + [Flags] + public enum NSCloudKitSharingServiceOptions : ulong { Standard = 0, AllowPublic = 1 << 0, AllowPrivate = 1 << 1, @@ -2991,8 +2970,7 @@ namespace AppKit { [NoMacCatalyst] [Mac (10, 12)] [Native] - public enum NSDisplayGamut : long - { + public enum NSDisplayGamut : long { Srgb = 1, P3, } @@ -3000,8 +2978,7 @@ namespace AppKit { [NoMacCatalyst] [Mac (10, 12)] [Native] - public enum NSTabPosition : ulong - { + public enum NSTabPosition : ulong { None = 0, Top, Left, @@ -3012,8 +2989,7 @@ namespace AppKit { [NoMacCatalyst] [Mac (10, 12)] [Native] - public enum NSTabViewBorderType : ulong - { + public enum NSTabViewBorderType : ulong { None = 0, Line, Bezel, @@ -3022,44 +2998,39 @@ namespace AppKit { [NoMacCatalyst] [Mac (10, 12)] [Native] - public enum NSPasteboardContentsOptions : ulong - { + public enum NSPasteboardContentsOptions : ulong { CurrentHostOnly = 1, } [NoMacCatalyst] - [Mac (10,12,2)] + [Mac (10, 12, 2)] [Native] - public enum NSTouchType : long - { + public enum NSTouchType : long { Direct, Indirect } [NoMacCatalyst] - [Mac (10,12,2)] + [Mac (10, 12, 2)] [Native] [Flags] - public enum NSTouchTypeMask : ulong - { - Direct = (1 << (int)NSTouchType.Direct), - Indirect = (1 << (int)NSTouchType.Indirect) + public enum NSTouchTypeMask : ulong { + Direct = (1 << (int) NSTouchType.Direct), + Indirect = (1 << (int) NSTouchType.Indirect) } [NoMacCatalyst] - [Mac (10,12,2)] + [Mac (10, 12, 2)] [Native] - public enum NSScrubberMode : long - { + public enum NSScrubberMode : long { Fixed = 0, Free } [NoMacCatalyst] - [Mac (10,12,2)] + [Mac (10, 12, 2)] [Native] - public enum NSScrubberAlignment : long - { + public enum NSScrubberAlignment : long { None = 0, Leading, Trailing, @@ -3067,7 +3038,7 @@ namespace AppKit { } [NoMacCatalyst] - [Mac (10,13)] + [Mac (10, 13)] public enum NSFontError : int { AssetDownloadError = 66304, ErrorMinimum = 66304, @@ -3075,7 +3046,7 @@ namespace AppKit { } [NoMacCatalyst] - [Mac (10,13)] + [Mac (10, 13)] [Native] public enum NSAccessibilityAnnotationPosition : long { FullRange, @@ -3084,7 +3055,7 @@ namespace AppKit { } [NoMacCatalyst] - [Mac (10,13)] + [Mac (10, 13)] [Native] public enum NSAccessibilityCustomRotorSearchDirection : long { Previous, @@ -3092,7 +3063,7 @@ namespace AppKit { } [NoMacCatalyst] - [Mac (10,13)] + [Mac (10, 13)] [Native] public enum NSAccessibilityCustomRotorType : long { Custom = 0, @@ -3129,7 +3100,7 @@ namespace AppKit { } [NoMacCatalyst] - [Mac (10,13)] + [Mac (10, 13)] [Native] [Flags] public enum NSFontAssetRequestOptions : ulong { @@ -3137,7 +3108,7 @@ namespace AppKit { } [NoMacCatalyst] - [Mac (10,13)] + [Mac (10, 13)] [Native] [Flags] public enum NSFontPanelModeMask : ulong { @@ -3149,13 +3120,13 @@ namespace AppKit { TextColorEffect = 1 << 10, DocumentColorEffect = 1 << 11, ShadowEffect = 1 << 12, - AllEffects = (ulong)0XFFF00, - StandardModes = (ulong)0XFFFF, - AllModes = (ulong)0XFFFFFFFF, + AllEffects = (ulong) 0XFFF00, + StandardModes = (ulong) 0XFFFF, + AllModes = (ulong) 0XFFFFFFFF, } [NoMacCatalyst] - [Mac (10,13)] + [Mac (10, 13)] [Native] public enum NSLevelIndicatorPlaceholderVisibility : long { Automatic = 0, @@ -3164,7 +3135,7 @@ namespace AppKit { } [NoMacCatalyst] - [Mac (10,13)] + [Mac (10, 13)] [Native] public enum NSSegmentDistribution : long { Fit = 0, @@ -3174,7 +3145,7 @@ namespace AppKit { } [NoMacCatalyst] - [Mac (10,14)] + [Mac (10, 14)] [Native] public enum NSColorSystemEffect : long { None, @@ -3185,19 +3156,18 @@ namespace AppKit { } [NoMacCatalyst] - [Mac (10,14)] + [Mac (10, 14)] [Native] - public enum NSWorkspaceAuthorizationType : long { + public enum NSWorkspaceAuthorizationType : long { CreateSymbolicLink, SetAttributes, ReplaceFile, } [NoMacCatalyst] - [Mac (11,0)] + [Mac (11, 0)] [Native] - public enum NSTableViewStyle : long - { + public enum NSTableViewStyle : long { Automatic, FullWidth, Inset, @@ -3206,10 +3176,9 @@ namespace AppKit { } [NoMacCatalyst] - [Mac (11,0)] + [Mac (11, 0)] [Native] - public enum NSTitlebarSeparatorStyle : long - { + public enum NSTitlebarSeparatorStyle : long { Automatic, None, Line, @@ -3217,10 +3186,9 @@ namespace AppKit { } [NoMacCatalyst] - [Mac (11,0)] + [Mac (11, 0)] [Native] - public enum NSWindowToolbarStyle : long - { + public enum NSWindowToolbarStyle : long { Automatic, Expanded, Preference, @@ -3231,8 +3199,7 @@ namespace AppKit { [NoMacCatalyst] [Flags] [Native] - public enum NSTableViewAnimationOptions : ulong - { + public enum NSTableViewAnimationOptions : ulong { EffectNone = 0x0, EffectFade = 0x1, EffectGap = 0x2, @@ -3243,10 +3210,9 @@ namespace AppKit { } [NoMacCatalyst] - [Mac (11,0)] + [Mac (11, 0)] [Native] - public enum NSImageSymbolScale : long - { + public enum NSImageSymbolScale : long { Small = 1, Medium = 2, Large = 3, diff --git a/src/AppKit/EventArgs.cs b/src/AppKit/EventArgs.cs index db33919026..7be55cd44d 100644 --- a/src/AppKit/EventArgs.cs +++ b/src/AppKit/EventArgs.cs @@ -31,18 +31,15 @@ using Foundation; -namespace AppKit -{ - public enum NSFontCollectionAction - { +namespace AppKit { + public enum NSFontCollectionAction { Unknown, Shown, Hidden, Renamed } - public partial class NSFontCollectionChangedEventArgs - { + public partial class NSFontCollectionChangedEventArgs { public NSFontCollectionAction Action { get { if (_Action == NSFontCollection.ActionWasShown) { @@ -58,19 +55,17 @@ namespace AppKit } public NSFontCollectionVisibility Visibility { - get { return (NSFontCollectionVisibility)(int)_Visibility; } + get { return (NSFontCollectionVisibility) (int) _Visibility; } } } - public enum NSPopoverCloseReason - { + public enum NSPopoverCloseReason { Unknown, Standard, DetachToWindow } - public partial class NSPopoverCloseEventArgs - { + public partial class NSPopoverCloseEventArgs { public NSPopoverCloseReason Reason { get { if (_Reason == NSPopover.CloseReasonStandard) { diff --git a/src/AppKit/NSAccessibility.cs b/src/AppKit/NSAccessibility.cs index 8c5383f24f..9670ca7ebc 100644 --- a/src/AppKit/NSAccessibility.cs +++ b/src/AppKit/NSAccessibility.cs @@ -17,22 +17,20 @@ using CoreGraphics; using Foundation; using ObjCRuntime; -namespace AppKit -{ - public partial interface INSAccessibility {} +namespace AppKit { + public partial interface INSAccessibility { } #if NET [SupportedOSPlatform ("macos10.9")] #else - [Mac (10,9)] // but the field/notifications are in 10.9 + [Mac (10, 9)] // but the field/notifications are in 10.9 #endif - public partial class NSAccessibility - { + public partial class NSAccessibility { #if !COREBUILD #if NET [SupportedOSPlatform ("macos10.10")] #else - [Mac (10,10)] + [Mac (10, 10)] #endif [DllImport (Constants.AppKitLibrary)] static extern CGRect NSAccessibilityFrameInView (NSView parentView, CGRect frame); @@ -45,7 +43,7 @@ namespace AppKit #if NET [SupportedOSPlatform ("macos10.10")] #else - [Mac (10,10)] + [Mac (10, 10)] #endif [DllImport (Constants.AppKitLibrary)] static extern CGPoint NSAccessibilityPointInView (NSView parentView, CGPoint point); @@ -159,7 +157,7 @@ namespace AppKit [DllImport (Constants.AppKitLibrary)] static extern IntPtr NSAccessibilityUnignoredChildren (IntPtr originalChildren); - public static NSObject[] GetUnignoredChildren (NSArray originalChildren) + public static NSObject [] GetUnignoredChildren (NSArray originalChildren) { if (originalChildren == null) throw new ArgumentNullException ("originalChildren"); @@ -172,7 +170,7 @@ namespace AppKit [DllImport (Constants.AppKitLibrary)] static extern IntPtr NSAccessibilityUnignoredChildrenForOnlyChild (IntPtr originalChild); - public static NSObject[] GetUnignoredChildren (NSObject originalChild) + public static NSObject [] GetUnignoredChildren (NSObject originalChild) { if (originalChild == null) throw new ArgumentNullException ("originalChild"); diff --git a/src/AppKit/NSAlert.cs b/src/AppKit/NSAlert.cs index 9525c238aa..db26529fdd 100644 --- a/src/AppKit/NSAlert.cs +++ b/src/AppKit/NSAlert.cs @@ -35,11 +35,9 @@ using System.Runtime.Versioning; using Foundation; using ObjCRuntime; -namespace AppKit -{ +namespace AppKit { [Register ("__MonoMac_NSAlertDidEndDispatcher")] - internal class NSAlertDidEndDispatcher : NSObject - { + internal class NSAlertDidEndDispatcher : NSObject { const string selector = "alertDidEnd:returnCode:contextInfo:"; public static readonly Selector Selector = new Selector (selector); @@ -66,8 +64,7 @@ namespace AppKit } } - public partial class NSAlert - { + public partial class NSAlert { public void BeginSheet (NSWindow window) { BeginSheet (window, null, null, IntPtr.Zero); diff --git a/src/AppKit/NSApplication.cs b/src/AppKit/NSApplication.cs index 8f47b1f03e..3293e9a99f 100644 --- a/src/AppKit/NSApplication.cs +++ b/src/AppKit/NSApplication.cs @@ -66,7 +66,7 @@ namespace AppKit { // and call NSApplicationMain externally prior to this Init, so only // initialize the context if it hasn't been set externally. Alternatively, // AppKitSynchronizationContext could be made public. - if(SynchronizationContext.Current == null) + if (SynchronizationContext.Current == null) SynchronizationContext.SetSynchronizationContext (new AppKitSynchronizationContext ()); // Establish the main thread at the time of Init to support hosts @@ -106,7 +106,7 @@ namespace AppKit { public static void Main (string [] args) { // Switch to an AppKitSynchronizationContext if Main is invoked - if(SynchronizationContext.Current == null || !typeof(AppKitSynchronizationContext).IsAssignableFrom(SynchronizationContext.Current.GetType())) + if (SynchronizationContext.Current == null || !typeof (AppKitSynchronizationContext).IsAssignableFrom (SynchronizationContext.Current.GetType ())) SynchronizationContext.SetSynchronizationContext (new AppKitSynchronizationContext ()); // Init where this is set the first time is generally paired @@ -116,29 +116,29 @@ namespace AppKit { NSApplicationMain (args.Length, args); } - public static void EnsureUIThread() + public static void EnsureUIThread () { if (NSApplication.CheckForIllegalCrossThreadCalls && NSApplication.mainThread != Thread.CurrentThread) - throw new AppKitThreadAccessException(); + throw new AppKitThreadAccessException (); } public static void EnsureEventAndDelegateAreNotMismatched (object del, Type expectedType) { if (NSApplication.CheckForEventAndDelegateMismatches && !(expectedType.IsAssignableFrom (del.GetType ()))) - throw new InvalidOperationException (string.Format("Event registration is overwriting existing delegate. Either just use events or your own delegate: {0} {1}", del.GetType (), expectedType)); + throw new InvalidOperationException (string.Format ("Event registration is overwriting existing delegate. Either just use events or your own delegate: {0} {1}", del.GetType (), expectedType)); } public static void EnsureDelegateAssignIsNotOverwritingInternalDelegate (object currentDelegateValue, object newDelegateValue, Type internalDelegateType) { if (NSApplication.CheckForEventAndDelegateMismatches && currentDelegateValue != null && newDelegateValue != null - && currentDelegateValue.GetType().IsAssignableFrom (internalDelegateType) - && !newDelegateValue.GetType().IsAssignableFrom (internalDelegateType)) - throw new InvalidOperationException (string.Format("Event registration is overwriting existing delegate. Either just use events or your own delegate: {0} {1}", newDelegateValue.GetType(), internalDelegateType)); + && currentDelegateValue.GetType ().IsAssignableFrom (internalDelegateType) + && !newDelegateValue.GetType ().IsAssignableFrom (internalDelegateType)) + throw new InvalidOperationException (string.Format ("Event registration is overwriting existing delegate. Either just use events or your own delegate: {0} {1}", newDelegateValue.GetType (), internalDelegateType)); } public void DiscardEvents (NSEventMask mask, NSEvent lastEvent) { - DiscardEvents ((nuint)(ulong) mask, lastEvent); + DiscardEvents ((nuint) (ulong) mask, lastEvent); } #if !NET @@ -149,7 +149,7 @@ namespace AppKit { #endif // note: if needed override the protected Get|Set methods - public NSApplicationActivationPolicy ActivationPolicy { + public NSApplicationActivationPolicy ActivationPolicy { get { return GetActivationPolicy (); } // ignore return value (bool) set { SetActivationPolicy (value); } diff --git a/src/AppKit/NSArrayController.cs b/src/AppKit/NSArrayController.cs index 02aeacde3d..2a9d82e5a0 100644 --- a/src/AppKit/NSArrayController.cs +++ b/src/AppKit/NSArrayController.cs @@ -32,21 +32,21 @@ namespace AppKit { public partial class NSArrayController { // note: if needed override the protected Get|Set methods - public NSIndexSet SelectionIndexes { + public NSIndexSet SelectionIndexes { get { return GetSelectionIndexes (); } // ignore return value (bool) set { SetSelectionIndexes (value); } } // note: if needed override the protected Get|Set methods - public ulong SelectionIndex { + public ulong SelectionIndex { get { return (ulong) GetSelectionIndex (); } // ignore return value (bool) set { SetSelectionIndex ((nuint) value); } } // note: if needed override the protected Get|Set methods - public NSObject [] SelectedObjects { + public NSObject [] SelectedObjects { get { return GetSelectedObjects (); } // ignore return value (bool) set { SetSelectedObjects (value); } diff --git a/src/AppKit/NSBezierPath.cs b/src/AppKit/NSBezierPath.cs index 0a29556fd9..2cd18d4c86 100644 --- a/src/AppKit/NSBezierPath.cs +++ b/src/AppKit/NSBezierPath.cs @@ -59,7 +59,7 @@ namespace AppKit { _SetLineDash ((IntPtr) ptr, pattern.Length, phase); } - public unsafe NSBezierPathElement ElementAt (nint index, out CGPoint[] points) + public unsafe NSBezierPathElement ElementAt (nint index, out CGPoint [] points) { NSBezierPathElement bpe; @@ -78,19 +78,19 @@ namespace AppKit { return bpe; } - public unsafe void SetAssociatedPointsAtIndex (CGPoint[] points, nint index) + public unsafe void SetAssociatedPointsAtIndex (CGPoint [] points, nint index) { - if (points == null) - throw new ArgumentNullException ("points"); + if (points == null) + throw new ArgumentNullException ("points"); if (points.Length < 1) throw new ArgumentException ("points array is empty"); fixed (CGPoint* ptr = &points [0]) - _SetAssociatedPointsAtIndex ((IntPtr)ptr, index); + _SetAssociatedPointsAtIndex ((IntPtr) ptr, index); } - public unsafe void Append (CGPoint[] points) + public unsafe void Append (CGPoint [] points) { if (points == null) throw new ArgumentNullException ("points"); @@ -98,18 +98,18 @@ namespace AppKit { throw new ArgumentException ("points array is empty"); fixed (CGPoint* ptr = &points [0]) - _AppendPathWithPoints ((IntPtr)ptr, points.Length); + _AppendPathWithPoints ((IntPtr) ptr, points.Length); } #if !NET [Obsolete ("Use 'Append (CGPoint[])' instead.")] - public unsafe void AppendPathWithPoints (CGPoint[] points) + public unsafe void AppendPathWithPoints (CGPoint [] points) { Append (points); } [Obsolete ("Use 'Append (uint[], NSFont)' instead.")] - public unsafe void AppendPathWithGlyphs (uint[] glyphs, NSFont font) + public unsafe void AppendPathWithGlyphs (uint [] glyphs, NSFont font) { if (glyphs == null) throw new ArgumentNullException ("glyphs"); @@ -117,7 +117,7 @@ namespace AppKit { throw new ArgumentException ("glyphs array is empty"); fixed (uint* ptr = &glyphs [0]) - _AppendPathWithGlyphs ((IntPtr)ptr, glyphs.Length, font); + _AppendPathWithGlyphs ((IntPtr) ptr, glyphs.Length, font); } #endif @@ -125,9 +125,9 @@ namespace AppKit { [SupportedOSPlatform ("macos10.13")] [UnsupportedOSPlatform ("maccatalyst")] #else - [Mac (10,13)] + [Mac (10, 13)] #endif - public unsafe void Append (uint[] glyphs, NSFont font) + public unsafe void Append (uint [] glyphs, NSFont font) { if (glyphs == null) throw new ArgumentNullException ("glyphs"); @@ -135,7 +135,7 @@ namespace AppKit { throw new ArgumentException ("glyphs array is empty"); fixed (uint* ptr = &glyphs [0]) - _AppendBezierPathWithCGGlyphs ((IntPtr)ptr, glyphs.Length, font); + _AppendBezierPathWithCGGlyphs ((IntPtr) ptr, glyphs.Length, font); } } } diff --git a/src/AppKit/NSBrowser.cs b/src/AppKit/NSBrowser.cs index 8d98561107..8cc0095db1 100644 --- a/src/AppKit/NSBrowser.cs +++ b/src/AppKit/NSBrowser.cs @@ -26,11 +26,11 @@ using System; namespace AppKit { - + public partial class NSBrowser { - + // note: if needed override the protected Get|Set methods - public string Path { + public string Path { get { return GetPath (); } // ignore return value (bool) set { SetPath (value); } diff --git a/src/AppKit/NSButton.cs b/src/AppKit/NSButton.cs index 715b6d4c04..b511cefac3 100644 --- a/src/AppKit/NSButton.cs +++ b/src/AppKit/NSButton.cs @@ -38,7 +38,7 @@ namespace AppKit { NSActionDispatcher dispatcher; public new NSButtonCell Cell { - get { return (NSButtonCell)base.Cell; } + get { return (NSButtonCell) base.Cell; } set { base.Cell = value; } } @@ -46,7 +46,7 @@ namespace AppKit { [SupportedOSPlatform ("macos10.12")] [UnsupportedOSPlatform ("maccatalyst")] #else - [Mac (10,12)] + [Mac (10, 12)] #endif public static NSButton CreateButton (string title, NSImage image, Action action) { @@ -60,7 +60,7 @@ namespace AppKit { [SupportedOSPlatform ("macos10.12")] [UnsupportedOSPlatform ("maccatalyst")] #else - [Mac (10,12)] + [Mac (10, 12)] #endif public static NSButton CreateButton (string title, Action action) { @@ -74,7 +74,7 @@ namespace AppKit { [SupportedOSPlatform ("macos10.12")] [UnsupportedOSPlatform ("maccatalyst")] #else - [Mac (10,12)] + [Mac (10, 12)] #endif public static NSButton CreateButton (NSImage image, Action action) { @@ -88,7 +88,7 @@ namespace AppKit { [SupportedOSPlatform ("macos10.12")] [UnsupportedOSPlatform ("maccatalyst")] #else - [Mac (10,12)] + [Mac (10, 12)] #endif public static NSButton CreateCheckbox (string title, Action action) { @@ -102,7 +102,7 @@ namespace AppKit { [SupportedOSPlatform ("macos10.12")] [UnsupportedOSPlatform ("maccatalyst")] #else - [Mac (10,12)] + [Mac (10, 12)] #endif public static NSButton CreateRadioButton (string title, Action action) { diff --git a/src/AppKit/NSCell.cs b/src/AppKit/NSCell.cs index adca3fe7d9..6ada3f5607 100644 --- a/src/AppKit/NSCell.cs +++ b/src/AppKit/NSCell.cs @@ -40,7 +40,7 @@ namespace AppKit { extern static void NSDrawThreePartImage (CGRect rect, IntPtr /* NSImage* */ startCap, IntPtr /* NSImage* */ centerFill, IntPtr /* NSImage* */ endCap, [MarshalAs (UnmanagedType.I1)] bool vertial, nint op, nfloat alphaFraction, [MarshalAs (UnmanagedType.I1)] bool flipped); - + public void DrawThreePartImage (CGRect frame, NSImage startCap, NSImage centerFill, NSImage endCap, bool vertical, NSCompositingOperation op, nfloat alphaFraction, bool flipped) @@ -76,7 +76,7 @@ namespace AppKit { bottomEdgeFill != null ? bottomEdgeFill.Handle : IntPtr.Zero, bottomRightCorner != null ? bottomRightCorner.Handle : IntPtr.Zero, (nint) (long) op, alphaFraction, flipped); - } + } } } #endif // !__MACCATALYST__ diff --git a/src/AppKit/NSCollectionLayoutAnchor.cs b/src/AppKit/NSCollectionLayoutAnchor.cs index 28bb2feea5..2f243d62e3 100644 --- a/src/AppKit/NSCollectionLayoutAnchor.cs +++ b/src/AppKit/NSCollectionLayoutAnchor.cs @@ -20,12 +20,11 @@ namespace AppKit { public partial class NSCollectionLayoutAnchor { public static NSCollectionLayoutAnchor Create (NSDirectionalRectEdge edges, NSCollectionLayoutAnchorOffsetType offsetType, CGPoint offset) => - offsetType switch - { - NSCollectionLayoutAnchorOffsetType.Absolute => CreateFromAbsoluteOffset (edges, offset), - NSCollectionLayoutAnchorOffsetType.Fractional => CreateFromFractionalOffset (edges, offset), - _ => throw new ArgumentException (message: "Invalid enum value", paramName: nameof (offsetType)), - }; + offsetType switch { + NSCollectionLayoutAnchorOffsetType.Absolute => CreateFromAbsoluteOffset (edges, offset), + NSCollectionLayoutAnchorOffsetType.Fractional => CreateFromFractionalOffset (edges, offset), + _ => throw new ArgumentException (message: "Invalid enum value", paramName: nameof (offsetType)), + }; } } #endif // !__MACCATALYST__ diff --git a/src/AppKit/NSCollectionViewDelegate.cs b/src/AppKit/NSCollectionViewDelegate.cs index 3de296ea61..e14f14224b 100644 --- a/src/AppKit/NSCollectionViewDelegate.cs +++ b/src/AppKit/NSCollectionViewDelegate.cs @@ -3,10 +3,8 @@ using System; using Foundation; using ObjCRuntime; -namespace AppKit -{ - public partial class NSCollectionViewDelegate - { +namespace AppKit { + public partial class NSCollectionViewDelegate { [Mac (10, 11)] [Obsolete ("Use 'ValidateDropOperation (NSCollectionView collectionView, NSDraggingInfo draggingInfo, ref NSIndexPath proposedDropIndexPath, ref NSCollectionViewDropOperation proposedDropOperation)' instead.")] public virtual NSDragOperation ValidateDrop (NSCollectionView collectionView, NSDraggingInfo draggingInfo, out NSIndexPath proposedDropIndexPath, out NSCollectionViewDropOperation proposedDropOperation) @@ -17,8 +15,7 @@ namespace AppKit } } - public partial class NSCollectionViewDelegateFlowLayout - { + public partial class NSCollectionViewDelegateFlowLayout { [Mac (10, 11)] [Obsolete ("Use 'ValidateDropOperation (NSCollectionView collectionView, NSDraggingInfo draggingInfo, ref NSIndexPath proposedDropIndexPath, ref NSCollectionViewDropOperation proposedDropOperation)' instead.")] public virtual NSDragOperation ValidateDrop (NSCollectionView collectionView, NSDraggingInfo draggingInfo, out NSIndexPath proposedDropIndexPath, out NSCollectionViewDropOperation proposedDropOperation) diff --git a/src/AppKit/NSColor.cs b/src/AppKit/NSColor.cs index cffc6e366b..40b8ee5d33 100644 --- a/src/AppKit/NSColor.cs +++ b/src/AppKit/NSColor.cs @@ -15,7 +15,7 @@ namespace AppKit { public static NSColor FromRgb (byte red, byte green, byte blue) { - return FromRgba (red/255.0f, green/255.0f, blue/255.0f, 1.0f); + return FromRgba (red / 255.0f, green / 255.0f, blue / 255.0f, 1.0f); } public static NSColor FromRgb (int red, int green, int blue) @@ -25,7 +25,7 @@ namespace AppKit { public static NSColor FromRgba (byte red, byte green, byte blue, byte alpha) { - return FromRgba (red/255.0f, green/255.0f, blue/255.0f, alpha/255.0f); + return FromRgba (red / 255.0f, green / 255.0f, blue / 255.0f, alpha / 255.0f); } public static NSColor FromRgba (int red, int green, int blue, int alpha) @@ -65,7 +65,7 @@ namespace AppKit { public static NSColor FromDeviceRgb (byte red, byte green, byte blue) { - return FromDeviceRgba (red/255.0f, green/255.0f, blue/255.0f, 1.0f); + return FromDeviceRgba (red / 255.0f, green / 255.0f, blue / 255.0f, 1.0f); } public static NSColor FromDeviceRgb (int red, int green, int blue) @@ -75,7 +75,7 @@ namespace AppKit { public static NSColor FromDeviceRgba (byte red, byte green, byte blue, byte alpha) { - return FromDeviceRgba (red/255.0f, green/255.0f, blue/255.0f, alpha/255.0f); + return FromDeviceRgba (red / 255.0f, green / 255.0f, blue / 255.0f, alpha / 255.0f); } public static NSColor FromDeviceRgba (int red, int green, int blue, int alpha) @@ -140,7 +140,7 @@ namespace AppKit { public static NSColor FromCalibratedRgb (byte red, byte green, byte blue) { - return FromCalibratedRgba (red/255.0f, green/255.0f, blue/255.0f, 1.0f); + return FromCalibratedRgba (red / 255.0f, green / 255.0f, blue / 255.0f, 1.0f); } public static NSColor FromCalibratedRgb (int red, int green, int blue) @@ -150,7 +150,7 @@ namespace AppKit { public static NSColor FromCalibratedRgba (byte red, byte green, byte blue, byte alpha) { - return FromCalibratedRgba (red/255.0f, green/255.0f, blue/255.0f, alpha/255.0f); + return FromCalibratedRgba (red / 255.0f, green / 255.0f, blue / 255.0f, alpha / 255.0f); } public static NSColor FromCalibratedRgba (int red, int green, int blue, int alpha) @@ -209,19 +209,19 @@ namespace AppKit { try { string name = this.ColorSpaceName; if (name == "NSNamedColorSpace") - return this.LocalizedCatalogNameComponent +"/" + this.LocalizedColorNameComponent; + return this.LocalizedCatalogNameComponent + "/" + this.LocalizedColorNameComponent; if (name == "NSPatternColorSpace") return "Pattern Color: " + this.PatternImage.Name; - + StringBuilder sb = new StringBuilder (this.ColorSpace.LocalizedName); - nfloat[] components; + nfloat [] components; this.GetComponents (out components); if (components.Length > 0) sb.Append ("(" + components [0]); for (int i = 1; i < components.Length; i++) sb.Append ("," + components [i]); sb.Append (")"); - + return sb.ToString (); } catch { //fallback to base method if we have an unexpected condition. diff --git a/src/AppKit/NSComboBox.cs b/src/AppKit/NSComboBox.cs index 9a65d671d8..c5cfc8e238 100644 --- a/src/AppKit/NSComboBox.cs +++ b/src/AppKit/NSComboBox.cs @@ -14,7 +14,7 @@ namespace AppKit { } #endif - public NSObject this [nint index] { + public NSObject this [nint index] { get { return GetItemObject (index); } diff --git a/src/AppKit/NSDocument.cs b/src/AppKit/NSDocument.cs index 26c4f40fcd..3052e455ab 100644 --- a/src/AppKit/NSDocument.cs +++ b/src/AppKit/NSDocument.cs @@ -6,21 +6,21 @@ using Foundation; using ObjCRuntime; namespace AppKit { - + public partial class NSDocument { public delegate void DuplicateCallback (NSDocument document, bool didDuplicate); [Register ("__NSDocumentDuplicateCallback")] internal class Callback : NSObject { DuplicateCallback callback; - + public Callback (DuplicateCallback callback) { this.callback = callback; IsDirectBinding = false; DangerousRetain (); } - + [Export ("document:didDuplicate:contextInfo:")] void SelectorCallback (NSDocument source, bool didDuplicate, IntPtr contextInfo) { @@ -31,7 +31,7 @@ namespace AppKit { } } } - + public void DuplicateDocument (DuplicateCallback callback) { if (callback == null) { diff --git a/src/AppKit/NSDraggingItem.cs b/src/AppKit/NSDraggingItem.cs index 616fd06ac1..d7bbf98433 100644 --- a/src/AppKit/NSDraggingItem.cs +++ b/src/AppKit/NSDraggingItem.cs @@ -9,7 +9,8 @@ using ObjCRuntime; namespace AppKit { #if !NET public partial class NSDraggingItem { - public NSDraggingItem (NSPasteboardWriting pasteboardWriter) : this ((INSPasteboardWriting)pasteboardWriter) { + public NSDraggingItem (NSPasteboardWriting pasteboardWriter) : this ((INSPasteboardWriting) pasteboardWriter) + { } } #endif diff --git a/src/AppKit/NSEvent.cs b/src/AppKit/NSEvent.cs index 881b59771b..cd54e789b6 100644 --- a/src/AppKit/NSEvent.cs +++ b/src/AppKit/NSEvent.cs @@ -8,12 +8,12 @@ using ObjCRuntime; namespace AppKit { - [DebuggerTypeProxy (typeof(NSEvent.NSEventDebuggerProxy))] + [DebuggerTypeProxy (typeof (NSEvent.NSEventDebuggerProxy))] public partial class NSEvent { - + class NSEventDebuggerProxy { NSEvent target; - + public NSEventDebuggerProxy (NSEvent target) { this.target = target; @@ -33,7 +33,7 @@ namespace AppKit { return target.LocationInWindow; } } - + public NSEventModifierMask ModifierFlags { get { return target.ModifierFlags; @@ -57,7 +57,7 @@ namespace AppKit { return target.Window; } } - + public nint WindowNumber { get { return target.WindowNumber; @@ -98,21 +98,21 @@ namespace AppKit { return target.Characters; } } - + public string CharactersIgnoringModifiers { get { CheckKeyEvent (); return target.CharactersIgnoringModifiers; } } - + public bool IsARepeat { get { CheckKeyEvent (); return target.IsARepeat; } } - + public ushort KeyCode { get { CheckKeyEvent (); @@ -161,21 +161,21 @@ namespace AppKit { return; throw new InvalidOperationException ("Not a tablet pointing event."); } - + public nint AbsoluteX { get { CheckTabletPointingEvent (); return target.AbsoluteX; } } - + public nint AbsoluteY { get { CheckTabletPointingEvent (); return target.AbsoluteY; } } - + public nint AbsoluteZ { get { CheckTabletPointingEvent (); @@ -235,7 +235,7 @@ namespace AppKit { return target.ButtonNumber; } } - + public nint ClickCount { get { CheckMouseEvent (); @@ -266,7 +266,7 @@ namespace AppKit { return; throw new InvalidOperationException ("Not a mouse tracking event."); } - + internal nint EventNumber { get { CheckMouseTrackingEvent (); @@ -353,14 +353,14 @@ namespace AppKit { return false; } } - + void CheckScrollWheelEvent () { if (IsScrollWheelEvent ()) return; throw new InvalidOperationException ("Not a scroll wheel event."); } - + public float DeltaX { get { CheckScrollWheelEvent (); @@ -434,7 +434,7 @@ namespace AppKit { return target.PointingDeviceID (); } } - + public NSPointingDeviceType PointingDeviceType { get { CheckTabletProximityEvent (); @@ -486,7 +486,7 @@ namespace AppKit { // FIXME return false; } - + void CheckTouchOrGestureEvent () { if (IsTouchOrGestureEvent ()) @@ -511,21 +511,21 @@ namespace AppKit { return true; return false; } - + void CheckScrollWheelOrFlickEvent () { if (IsScrollWheelOrFlickEvent ()) return; throw new InvalidOperationException ("Not a scroll wheel or flick event."); } - + public bool HasPreciseScrollingDeltas { get { CheckScrollWheelOrFlickEvent (); return target.HasPreciseScrollingDeltas; } } - + public nfloat ScrollingDeltaX { get { CheckScrollWheelOrFlickEvent (); @@ -560,9 +560,9 @@ namespace AppKit { return target.IsDirectionInvertedFromDevice; } } -#endregion + #endregion } - + } } #endif // !__MACCATALYST__ diff --git a/src/AppKit/NSFont.cs b/src/AppKit/NSFont.cs index 0ce4324394..12e12af704 100644 --- a/src/AppKit/NSFont.cs +++ b/src/AppKit/NSFont.cs @@ -11,8 +11,7 @@ using CoreText; using CGGlyph = System.UInt16; namespace AppKit { - public partial class NSFont - { + public partial class NSFont { public static NSFont FromCTFont (CTFont font) { if (font == null) @@ -24,7 +23,7 @@ namespace AppKit { [SupportedOSPlatform ("macos10.13")] [UnsupportedOSPlatform ("maccatalyst")] #else - [Mac (10,13)] + [Mac (10, 13)] #endif public unsafe CGRect [] GetBoundingRects (CGGlyph [] glyphs) { @@ -33,10 +32,10 @@ namespace AppKit { if (glyphs.Length < 1) throw new ArgumentException ("glyphs array is empty"); - CGRect [] bounds = new CGRect [glyphs.Length]; + CGRect [] bounds = new CGRect [glyphs.Length]; fixed (CGRect* boundsPtr = &bounds [0]) { fixed (CGGlyph* glyphsPtr = &glyphs [0]) { - _GetBoundingRects ((IntPtr)boundsPtr, (IntPtr)glyphsPtr, (nuint)glyphs.Length); + _GetBoundingRects ((IntPtr) boundsPtr, (IntPtr) glyphsPtr, (nuint) glyphs.Length); } } return bounds; @@ -46,7 +45,7 @@ namespace AppKit { [SupportedOSPlatform ("macos10.13")] [UnsupportedOSPlatform ("maccatalyst")] #else - [Mac (10,13)] + [Mac (10, 13)] #endif public unsafe CGSize [] GetAdvancements (CGGlyph [] glyphs) { @@ -55,10 +54,10 @@ namespace AppKit { if (glyphs.Length < 1) throw new ArgumentException ("glyphs array is empty"); - CGSize [] advancements = new CGSize [glyphs.Length]; + CGSize [] advancements = new CGSize [glyphs.Length]; fixed (CGSize* advancementsPtr = &advancements [0]) { fixed (CGGlyph* glyphsPtr = &glyphs [0]) { - _GetAdvancements ((IntPtr)advancementsPtr, (IntPtr)glyphsPtr, (nuint)glyphs.Length); + _GetAdvancements ((IntPtr) advancementsPtr, (IntPtr) glyphsPtr, (nuint) glyphs.Length); } } return advancements; @@ -69,85 +68,85 @@ namespace AppKit { var ptr = _FromFontName (fontName, fontSize); return ptr == IntPtr.Zero ? null : new NSFont (ptr); } - + public static NSFont FromDescription (NSFontDescriptor fontDescriptor, nfloat fontSize) { var ptr = _FromDescription (fontDescriptor, fontSize); return ptr == IntPtr.Zero ? null : new NSFont (ptr); } - + public static NSFont FromDescription (NSFontDescriptor fontDescriptor, NSAffineTransform textTransform) { var ptr = _FromDescription (fontDescriptor, textTransform); return ptr == IntPtr.Zero ? null : new NSFont (ptr); } - + public static NSFont UserFontOfSize (nfloat fontSize) { var ptr = _UserFontOfSize (fontSize); return ptr == IntPtr.Zero ? null : new NSFont (ptr); } - + public static NSFont UserFixedPitchFontOfSize (nfloat fontSize) { var ptr = _UserFixedPitchFontOfSize (fontSize); return ptr == IntPtr.Zero ? null : new NSFont (ptr); } - + public static NSFont SystemFontOfSize (nfloat fontSize) { var ptr = _SystemFontOfSize (fontSize); return ptr == IntPtr.Zero ? null : new NSFont (ptr); } - + public static NSFont BoldSystemFontOfSize (nfloat fontSize) { var ptr = _BoldSystemFontOfSize (fontSize); return ptr == IntPtr.Zero ? null : new NSFont (ptr); } - + public static NSFont LabelFontOfSize (nfloat fontSize) { var ptr = _LabelFontOfSize (fontSize); return ptr == IntPtr.Zero ? null : new NSFont (ptr); } - + public static NSFont TitleBarFontOfSize (nfloat fontSize) { var ptr = _TitleBarFontOfSize (fontSize); return ptr == IntPtr.Zero ? null : new NSFont (ptr); } - + public static NSFont MenuFontOfSize (nfloat fontSize) { var ptr = _MenuFontOfSize (fontSize); return ptr == IntPtr.Zero ? null : new NSFont (ptr); } - + public static NSFont MenuBarFontOfSize (nfloat fontSize) { var ptr = _MenuBarFontOfSize (fontSize); return ptr == IntPtr.Zero ? null : new NSFont (ptr); } - + public static NSFont MessageFontOfSize (nfloat fontSize) { var ptr = _MessageFontOfSize (fontSize); return ptr == IntPtr.Zero ? null : new NSFont (ptr); } - + public static NSFont PaletteFontOfSize (nfloat fontSize) { var ptr = _PaletteFontOfSize (fontSize); return ptr == IntPtr.Zero ? null : new NSFont (ptr); } - + public static NSFont ToolTipsFontOfSize (nfloat fontSize) { var ptr = _ToolTipsFontOfSize (fontSize); return ptr == IntPtr.Zero ? null : new NSFont (ptr); } - + public static NSFont ControlContentFontOfSize (nfloat fontSize) { var ptr = _ControlContentFontOfSize (fontSize); @@ -164,7 +163,7 @@ namespace AppKit { #else [Deprecated (PlatformName.MacOSX, 10, 13)] #endif - public virtual NSFont PrinterFont { + public virtual NSFont PrinterFont { get { var ptr = _PrinterFont; return ptr == IntPtr.Zero ? null : new NSFont (ptr); @@ -203,7 +202,7 @@ namespace AppKit { var ptr = _ScreenFontWithRenderingMode (renderingMode); return ptr == IntPtr.Zero ? null : new NSFont (ptr); } - + public virtual NSFont GetVerticalFont () { var ptr = _GetVerticalFont (); @@ -214,7 +213,7 @@ namespace AppKit { [SupportedOSPlatform ("macos10.11")] [UnsupportedOSPlatform ("maccatalyst")] #else - [Mac (10,11)] + [Mac (10, 11)] #endif public static NSFont SystemFontOfSize (nfloat fontSize, nfloat weight) { @@ -226,7 +225,7 @@ namespace AppKit { [SupportedOSPlatform ("macos10.11")] [UnsupportedOSPlatform ("maccatalyst")] #else - [Mac (10,11)] + [Mac (10, 11)] #endif public static NSFont MonospacedDigitSystemFontOfSize (nfloat fontSize, nfloat weight) { @@ -238,7 +237,7 @@ namespace AppKit { [SupportedOSPlatform ("macos10.15")] [UnsupportedOSPlatform ("maccatalyst")] #else - [Mac (10,15)] + [Mac (10, 15)] #endif public static NSFont MonospacedSystemFont (nfloat fontSize, nfloat weight) { diff --git a/src/AppKit/NSGestureRecognizer.cs b/src/AppKit/NSGestureRecognizer.cs index 6a8f1bf8da..bbf019eee0 100644 --- a/src/AppKit/NSGestureRecognizer.cs +++ b/src/AppKit/NSGestureRecognizer.cs @@ -11,7 +11,7 @@ using System; using System.Collections; -using Foundation; +using Foundation; using ObjCRuntime; using System.Runtime.Versioning; @@ -93,8 +93,8 @@ namespace AppKit { } public partial class NSClickGestureRecognizer : NSGestureRecognizer { - public NSClickGestureRecognizer (Action action) : base (action) {} - public NSClickGestureRecognizer (Action action) : base (NSGestureRecognizer.ParametrizedSelector, new Callback (action)) {} + public NSClickGestureRecognizer (Action action) : base (action) { } + public NSClickGestureRecognizer (Action action) : base (NSGestureRecognizer.ParametrizedSelector, new Callback (action)) { } [Register ("__NSClickGestureRecognizer")] [Preserve (Conditional = true)] @@ -116,8 +116,8 @@ namespace AppKit { } public partial class NSMagnificationGestureRecognizer : NSGestureRecognizer { - public NSMagnificationGestureRecognizer (Action action) : base (action) {} - public NSMagnificationGestureRecognizer (Action action) : base (NSGestureRecognizer.ParametrizedSelector, new Callback (action)) {} + public NSMagnificationGestureRecognizer (Action action) : base (action) { } + public NSMagnificationGestureRecognizer (Action action) : base (NSGestureRecognizer.ParametrizedSelector, new Callback (action)) { } [Register ("__NSMagnificationGestureRecognizer")] [Preserve (Conditional = true)] @@ -139,8 +139,8 @@ namespace AppKit { } public partial class NSPanGestureRecognizer : NSGestureRecognizer { - public NSPanGestureRecognizer (Action action) : base (action) {} - public NSPanGestureRecognizer (Action action) : base (NSGestureRecognizer.ParametrizedSelector, new Callback (action)) {} + public NSPanGestureRecognizer (Action action) : base (action) { } + public NSPanGestureRecognizer (Action action) : base (NSGestureRecognizer.ParametrizedSelector, new Callback (action)) { } [Register ("__NSPanGestureRecognizer")] [Preserve (Conditional = true)] @@ -162,8 +162,8 @@ namespace AppKit { } public partial class NSPressGestureRecognizer : NSGestureRecognizer { - public NSPressGestureRecognizer (Action action) : base (action) {} - public NSPressGestureRecognizer (Action action) : base (NSGestureRecognizer.ParametrizedSelector, new Callback (action)) {} + public NSPressGestureRecognizer (Action action) : base (action) { } + public NSPressGestureRecognizer (Action action) : base (NSGestureRecognizer.ParametrizedSelector, new Callback (action)) { } [Register ("__NSPressGestureRecognizer")] [Preserve (Conditional = true)] @@ -185,8 +185,8 @@ namespace AppKit { } public partial class NSRotationGestureRecognizer : NSGestureRecognizer { - public NSRotationGestureRecognizer (Action action) : base (action) {} - public NSRotationGestureRecognizer (Action action) : base (NSGestureRecognizer.ParametrizedSelector, new Callback (action)) {} + public NSRotationGestureRecognizer (Action action) : base (action) { } + public NSRotationGestureRecognizer (Action action) : base (NSGestureRecognizer.ParametrizedSelector, new Callback (action)) { } [Register ("__NSRotationGestureRecognizer")] [Preserve (Conditional = true)] diff --git a/src/AppKit/NSGradient.cs b/src/AppKit/NSGradient.cs index 7647e03641..cac949ae04 100644 --- a/src/AppKit/NSGradient.cs +++ b/src/AppKit/NSGradient.cs @@ -13,10 +13,9 @@ using ObjCRuntime; using System.Runtime.InteropServices; namespace AppKit { - public partial class NSGradient : NSObject - { + public partial class NSGradient : NSObject { static IntPtr selInitWithColorsAtLocationsColorSpace = Selector.GetHandle ("initWithColors:atLocations:colorSpace:"); - + // The signature of this ObjC method is // - (id)initWithColorsAndLocations:(NSColor *)firstColor, ... NS_REQUIRES_NIL_TERMINATION; // where colors and locations (as CGFloats between 0.0 and 1.0) alternate until nil @@ -32,36 +31,36 @@ namespace AppKit { // Per NSGradient.h, this initializer calls the designated initializer (below) with a // color space of NSColorSpace.GenericRGBColorSpace, so we will do the same. - public NSGradient (NSColor[] colors, float[] locations) : - this(colors, locations, NSColorSpace.GenericRGBColorSpace) + public NSGradient (NSColor [] colors, float [] locations) : + this (colors, locations, NSColorSpace.GenericRGBColorSpace) { } - public NSGradient (NSColor[] colors, double[] locations) : - this(colors, locations, NSColorSpace.GenericRGBColorSpace) + public NSGradient (NSColor [] colors, double [] locations) : + this (colors, locations, NSColorSpace.GenericRGBColorSpace) { } - public NSGradient (NSColor[] colors, float[] locations, NSColorSpace colorSpace) + public NSGradient (NSColor [] colors, float [] locations, NSColorSpace colorSpace) { unsafe { - double[] converted = Array.ConvertAll (locations, new Converter (a => (double)a)); - fixed (void * locationPtr = converted) { + double [] converted = Array.ConvertAll (locations, new Converter (a => (double) a)); + fixed (void* locationPtr = converted) { Initialize (colors, locationPtr, colorSpace); } } } - public NSGradient (NSColor[] colors, double[] locations, NSColorSpace colorSpace) : base (NSObjectFlag.Empty) + public NSGradient (NSColor [] colors, double [] locations, NSColorSpace colorSpace) : base (NSObjectFlag.Empty) { unsafe { - fixed (void * locationPtr = locations) { + fixed (void* locationPtr = locations) { Initialize (colors, locationPtr, colorSpace); } } } - unsafe void Initialize (NSColor[] colors, void * locationPtr, NSColorSpace colorSpace) + unsafe void Initialize (NSColor [] colors, void* locationPtr, NSColorSpace colorSpace) { if (colors == null) throw new ArgumentNullException ("colors"); @@ -71,7 +70,7 @@ namespace AppKit { throw new ArgumentNullException ("colorSpace"); var nsa_colorArray = NSArray.FromNSObjects (colors); - + IntPtr locations = new IntPtr (locationPtr); #if NET if (IsDirectBinding) { diff --git a/src/AppKit/NSGraphics.cs b/src/AppKit/NSGraphics.cs index deaf4701b7..6c9462111e 100644 --- a/src/AppKit/NSGraphics.cs +++ b/src/AppKit/NSGraphics.cs @@ -37,24 +37,24 @@ namespace AppKit { public static class NSGraphics { public static readonly float White = 1; public static readonly float Black = 0; - public static readonly float LightGray = (float) 2/3.0f; - public static readonly float DarkGray = (float) 1/3.0f; - + public static readonly float LightGray = (float) 2 / 3.0f; + public static readonly float DarkGray = (float) 1 / 3.0f; + [DllImport (Constants.AppKitLibrary)] extern static NSWindowDepth NSBestDepth (IntPtr colorspaceHandle, nint bitsPerSample, nint bitsPerPixel, [MarshalAs (UnmanagedType.I1)] bool planar, [MarshalAs (UnmanagedType.I1)] ref bool exactMatch); - + public static NSWindowDepth BestDepth (NSString colorspace, nint bitsPerSample, nint bitsPerPixel, [MarshalAs (UnmanagedType.I1)] bool planar, [MarshalAs (UnmanagedType.I1)] ref bool exactMatch) { if (colorspace == null) throw new ArgumentNullException ("colorspace"); - + return NSBestDepth (colorspace.Handle, bitsPerSample, bitsPerPixel, planar, ref exactMatch); } [DllImport (Constants.AppKitLibrary)] [return: MarshalAs (UnmanagedType.I1)] extern static bool NSPlanarFromDepth (NSWindowDepth depth); - + public static bool PlanarFromDepth (NSWindowDepth depth) { return NSPlanarFromDepth (depth); @@ -106,55 +106,55 @@ namespace AppKit { } } - [DllImport (Constants.AppKitLibrary, EntryPoint="NSRectFill")] + [DllImport (Constants.AppKitLibrary, EntryPoint = "NSRectFill")] public extern static void RectFill (CGRect rect); [DllImport (Constants.AppKitLibrary)] extern static void NSRectFillUsingOperation (CGRect rect, nuint op); - public static void RectFill (CGRect rect, NSCompositingOperation op) + public static void RectFill (CGRect rect, NSCompositingOperation op) { - NSRectFillUsingOperation (rect, (nuint)(ulong)op); + NSRectFillUsingOperation (rect, (nuint) (ulong) op); } - [DllImport (Constants.AppKitLibrary, EntryPoint="NSRectFillList")] - unsafe extern static void RectFillList (CGRect *rects, nint count); + [DllImport (Constants.AppKitLibrary, EntryPoint = "NSRectFillList")] + unsafe extern static void RectFillList (CGRect* rects, nint count); public static void RectFill (CGRect [] rects) { if (rects == null) throw new ArgumentNullException ("rects"); unsafe { - fixed (CGRect *ptr = &rects [0]) + fixed (CGRect* ptr = &rects [0]) RectFillList (ptr, rects.Length); } } - [DllImport (Constants.AppKitLibrary, EntryPoint="NSRectClip")] + [DllImport (Constants.AppKitLibrary, EntryPoint = "NSRectClip")] public extern static void RectClip (CGRect rect); - - [DllImport (Constants.AppKitLibrary, EntryPoint="NSFrameRect")] - public extern static void FrameRect (CGRect rect); - [DllImport (Constants.AppKitLibrary, EntryPoint="NSFrameRectWithWidth")] - public extern static void FrameRect (CGRect rect, nfloat frameWidth); + [DllImport (Constants.AppKitLibrary, EntryPoint = "NSFrameRect")] + public extern static void FrameRect (CGRect rect); + + [DllImport (Constants.AppKitLibrary, EntryPoint = "NSFrameRectWithWidth")] + public extern static void FrameRect (CGRect rect, nfloat frameWidth); // Bad naming, added the overload above - [DllImport (Constants.AppKitLibrary, EntryPoint="NSFrameRectWithWidth")] - public extern static void FrameRectWithWidth (CGRect rect, nfloat frameWidth); + [DllImport (Constants.AppKitLibrary, EntryPoint = "NSFrameRectWithWidth")] + public extern static void FrameRectWithWidth (CGRect rect, nfloat frameWidth); [DllImport (Constants.AppKitLibrary)] extern static void NSFrameRectWithWidthUsingOperation (CGRect rect, nfloat frameWidth, nuint operation); public static void FrameRect (CGRect rect, nfloat frameWidth, NSCompositingOperation operation) { - NSFrameRectWithWidthUsingOperation (rect, frameWidth, (nuint)(ulong)operation); + NSFrameRectWithWidthUsingOperation (rect, frameWidth, (nuint) (ulong) operation); } - [DllImport (Constants.AppKitLibrary, EntryPoint="NSShowAnimationEffect")] + [DllImport (Constants.AppKitLibrary, EntryPoint = "NSShowAnimationEffect")] extern static void NSShowAnimationEffect (nuint animationEffect, CGPoint centerLocation, CGSize size, NSObject animationDelegate, Selector didEndSelector, IntPtr contextInfo); public static void ShowAnimationEffect (NSAnimationEffect animationEffect, CGPoint centerLocation, CGSize size, NSObject animationDelegate, Selector didEndSelector, IntPtr contextInfo) { - NSShowAnimationEffect ((nuint)(ulong)animationEffect, centerLocation, size, animationDelegate, didEndSelector, contextInfo); + NSShowAnimationEffect ((nuint) (ulong) animationEffect, centerLocation, size, animationDelegate, didEndSelector, contextInfo); } public static void ShowAnimationEffect (NSAnimationEffect animationEffect, CGPoint centerLocation, CGSize size, Action endedCallback) @@ -166,31 +166,31 @@ namespace AppKit { public static void SetFocusRingStyle (NSFocusRingPlacement placement) { - SetFocusRingStyle ((nuint)(ulong)placement); + SetFocusRingStyle ((nuint) (ulong) placement); } - [DllImport (Constants.AppKitLibrary, EntryPoint="NSSetFocusRingStyle")] + [DllImport (Constants.AppKitLibrary, EntryPoint = "NSSetFocusRingStyle")] extern static void SetFocusRingStyle (nuint placement); - [DllImport (Constants.AppKitLibrary, EntryPoint="NSDrawWhiteBezel")] + [DllImport (Constants.AppKitLibrary, EntryPoint = "NSDrawWhiteBezel")] public extern static void DrawWhiteBezel (CGRect aRect, CGRect clipRect); - [DllImport (Constants.AppKitLibrary, EntryPoint="NSDrawLightBezel")] + [DllImport (Constants.AppKitLibrary, EntryPoint = "NSDrawLightBezel")] public extern static void DrawLightBezel (CGRect aRect, CGRect clipRect); - [DllImport (Constants.AppKitLibrary, EntryPoint="NSDrawGrayBezel")] + [DllImport (Constants.AppKitLibrary, EntryPoint = "NSDrawGrayBezel")] public extern static void DrawGrayBezel (CGRect aRect, CGRect clipRect); - [DllImport (Constants.AppKitLibrary, EntryPoint="NSDrawDarkBezel")] + [DllImport (Constants.AppKitLibrary, EntryPoint = "NSDrawDarkBezel")] public extern static void DrawDarkBezel (CGRect aRect, CGRect clipRect); - [DllImport (Constants.AppKitLibrary, EntryPoint="NSDrawGroove")] + [DllImport (Constants.AppKitLibrary, EntryPoint = "NSDrawGroove")] public extern static void DrawGroove (CGRect aRect, CGRect clipRect); - [DllImport (Constants.AppKitLibrary, EntryPoint="NSDrawTiledRects")] + [DllImport (Constants.AppKitLibrary, EntryPoint = "NSDrawTiledRects")] unsafe extern static CGRect DrawTiledRects (CGRect aRect, CGRect clipRect, NSRectEdge* sides, nfloat* grays, nint count); - public static CGRect DrawTiledRects (CGRect aRect, CGRect clipRect, NSRectEdge[] sides, nfloat[] grays) + public static CGRect DrawTiledRects (CGRect aRect, CGRect clipRect, NSRectEdge [] sides, nfloat [] grays) { if (sides == null) throw new ArgumentNullException ("sides"); @@ -199,15 +199,15 @@ namespace AppKit { if (sides.Length != grays.Length) throw new ArgumentOutOfRangeException ("grays", "Both array parameters must have the same length"); unsafe { - fixed (NSRectEdge *ptr = &sides [0]) - fixed (nfloat *ptr2 = &grays [0]) + fixed (NSRectEdge* ptr = &sides [0]) + fixed (nfloat* ptr2 = &grays [0]) return DrawTiledRects (aRect, clipRect, ptr, ptr2, sides.Length); } } - [DllImport (Constants.AppKitLibrary, EntryPoint="NSDrawWindowBackground")] + [DllImport (Constants.AppKitLibrary, EntryPoint = "NSDrawWindowBackground")] public extern static void DrawWindowBackground (CGRect aRect); - + #if NET [SupportedOSPlatform ("macos")] [UnsupportedOSPlatform ("macos10.11")] @@ -215,11 +215,11 @@ namespace AppKit { [Obsolete ("Starting with macos10.11 not usually necessary, 'NSAnimationContext.RunAnimation' can be used instead and not suffer from performance issues.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #endif #else - [Deprecated (PlatformName.MacOSX, 10, 11, message : "Not usually necessary, 'NSAnimationContext.RunAnimation' can be used instead and not suffer from performance issues.")] + [Deprecated (PlatformName.MacOSX, 10, 11, message: "Not usually necessary, 'NSAnimationContext.RunAnimation' can be used instead and not suffer from performance issues.")] #endif - [DllImport (Constants.AppKitLibrary, EntryPoint="NSDisableScreenUpdates")] + [DllImport (Constants.AppKitLibrary, EntryPoint = "NSDisableScreenUpdates")] public extern static void DisableScreenUpdates (); - + #if NET [SupportedOSPlatform ("macos")] [UnsupportedOSPlatform ("macos10.11")] @@ -227,11 +227,11 @@ namespace AppKit { [Obsolete ("Starting with macos10.11 not usually necessary, 'NSAnimationContext.RunAnimation' can be used instead and not suffer from performance issues.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #endif #else - [Deprecated (PlatformName.MacOSX, 10, 11, message : "Not usually necessary, 'NSAnimationContext.RunAnimation' can be used instead and not suffer from performance issues.")] + [Deprecated (PlatformName.MacOSX, 10, 11, message: "Not usually necessary, 'NSAnimationContext.RunAnimation' can be used instead and not suffer from performance issues.")] #endif - [DllImport (Constants.AppKitLibrary, EntryPoint="NSEnableScreenUpdates")] + [DllImport (Constants.AppKitLibrary, EntryPoint = "NSEnableScreenUpdates")] public extern static void EnableScreenUpdates (); - + } } #endif // !__MACCATALYST__ diff --git a/src/AppKit/NSImage.cs b/src/AppKit/NSImage.cs index cfc36390da..1a32e67da1 100644 --- a/src/AppKit/NSImage.cs +++ b/src/AppKit/NSImage.cs @@ -64,7 +64,7 @@ namespace AppKit { } // note: if needed override the protected Get|Set methods - public string Name { + public string Name { get { return GetName (); } // ignore return value (bool) set { SetName (value); } @@ -72,7 +72,7 @@ namespace AppKit { public static NSImage ImageNamed (NSImageName name) { - return ImageNamed (name.GetConstant ()); + return ImageNamed (name.GetConstant ()); } } diff --git a/src/AppKit/NSLayoutManager.cs b/src/AppKit/NSLayoutManager.cs index 19738488f4..08d4884058 100644 --- a/src/AppKit/NSLayoutManager.cs +++ b/src/AppKit/NSLayoutManager.cs @@ -2,7 +2,7 @@ #if !WATCH #if !MONOMAC -using NSFont=UIKit.UIFont; +using NSFont = UIKit.UIFont; #endif using System; diff --git a/src/AppKit/NSLevelIndicator.cs b/src/AppKit/NSLevelIndicator.cs index 009c124dea..66f1538548 100644 --- a/src/AppKit/NSLevelIndicator.cs +++ b/src/AppKit/NSLevelIndicator.cs @@ -15,7 +15,7 @@ namespace AppKit { public partial class NSLevelIndicator { public new NSLevelIndicatorCell Cell { - get { return (NSLevelIndicatorCell)base.Cell; } + get { return (NSLevelIndicatorCell) base.Cell; } set { base.Cell = value; } } } diff --git a/src/AppKit/NSMatrix.cs b/src/AppKit/NSMatrix.cs index dfb50c2b0f..d5984664f7 100644 --- a/src/AppKit/NSMatrix.cs +++ b/src/AppKit/NSMatrix.cs @@ -33,6 +33,6 @@ namespace AppKit { } } } - + } #endif // !__MACCATALYST__ diff --git a/src/AppKit/NSMenuItem.cs b/src/AppKit/NSMenuItem.cs index 332ddc3438..6a410b193b 100644 --- a/src/AppKit/NSMenuItem.cs +++ b/src/AppKit/NSMenuItem.cs @@ -42,13 +42,13 @@ namespace AppKit { public NSMenuItem (string title, EventHandler handler) : this (title, "", handler) { } - + public NSMenuItem (string title, string charCode, EventHandler handler) : this (title, null, charCode) { Activated += handler; } - public NSMenuItem (string title, string charCode, EventHandler handler, Func validator) : this (title, null, charCode) + public NSMenuItem (string title, string charCode, EventHandler handler, Func validator) : this (title, null, charCode) { Activated += handler; ValidateMenuItem = validator; @@ -61,7 +61,7 @@ namespace AppKit { public NSMenuItem (string title) : this (title, null, "") { } - + public event EventHandler Activated { add { target = ActionDispatcher.SetupAction (Target, value); @@ -80,7 +80,7 @@ namespace AppKit { } [Advice ("The 'Activated' event must be set before setting 'ValidateMenuItem'.")] - public Func ValidateMenuItem { + public Func ValidateMenuItem { get { return (target as ActionDispatcher)?.ValidateMenuItemFunc; } diff --git a/src/AppKit/NSMutableFontCollection.cs b/src/AppKit/NSMutableFontCollection.cs index d37a5b7d98..3c22bdc36a 100644 --- a/src/AppKit/NSMutableFontCollection.cs +++ b/src/AppKit/NSMutableFontCollection.cs @@ -10,11 +10,9 @@ using System; -namespace AppKit -{ +namespace AppKit { #if !NET - public partial class NSMutableFontCollection - { + public partial class NSMutableFontCollection { [Obsolete ("macOS 10.12 does not allow creation via this constructor")] public NSMutableFontCollection () { diff --git a/src/AppKit/NSOpenGLContext.cs b/src/AppKit/NSOpenGLContext.cs index f1d0f581a6..50f23f93c6 100644 --- a/src/AppKit/NSOpenGLContext.cs +++ b/src/AppKit/NSOpenGLContext.cs @@ -8,20 +8,20 @@ using ObjCRuntime; using Foundation; namespace AppKit { - + public partial class NSOpenGLContext { unsafe void SetValue (int /* GLint */ val, NSOpenGLContextParameter par) { - int *p = &val; + int* p = &val; SetValues ((IntPtr) p, par); } - + unsafe int /* GLint */ GetValue (NSOpenGLContextParameter par) { int ret; - int *p = &ret; - GetValues ((IntPtr)p, par); + int* p = &ret; + GetValues ((IntPtr) p, par); return ret; } @@ -68,7 +68,7 @@ namespace AppKit { public NSSurfaceOrder SurfaceOrder { get { - switch (GetValue (NSOpenGLContextParameter.SurfaceOrder)){ + switch (GetValue (NSOpenGLContextParameter.SurfaceOrder)) { case -1: return NSSurfaceOrder.BelowWindow; default: diff --git a/src/AppKit/NSOpenGLPixelFormat.cs b/src/AppKit/NSOpenGLPixelFormat.cs index c5c6caa994..a4fbeed723 100644 --- a/src/AppKit/NSOpenGLPixelFormat.cs +++ b/src/AppKit/NSOpenGLPixelFormat.cs @@ -36,23 +36,23 @@ namespace AppKit { public partial class NSOpenGLPixelFormat { static IntPtr selInitWithAttributes = Selector.GetHandle ("initWithAttributes:"); - public NSOpenGLPixelFormat (NSOpenGLPixelFormatAttribute[] attribs) : base (NSObjectFlag.Empty) + public NSOpenGLPixelFormat (NSOpenGLPixelFormatAttribute [] attribs) : base (NSObjectFlag.Empty) { if (attribs == null) throw new ArgumentNullException ("attribs"); unsafe { - NSOpenGLPixelFormatAttribute [] copy = new NSOpenGLPixelFormatAttribute [attribs.Length+1]; + NSOpenGLPixelFormatAttribute [] copy = new NSOpenGLPixelFormatAttribute [attribs.Length + 1]; Array.Copy (attribs, 0, copy, 0, attribs.Length); - fixed (NSOpenGLPixelFormatAttribute* pArray = copy){ + fixed (NSOpenGLPixelFormatAttribute* pArray = copy) { if (IsDirectBinding) { - Handle = ObjCRuntime.Messaging.IntPtr_objc_msgSend_IntPtr (this.Handle, selInitWithAttributes, new IntPtr((void*)pArray )); + Handle = ObjCRuntime.Messaging.IntPtr_objc_msgSend_IntPtr (this.Handle, selInitWithAttributes, new IntPtr ((void*) pArray)); } else { - Handle = ObjCRuntime.Messaging.IntPtr_objc_msgSendSuper_IntPtr (this.SuperHandle, selInitWithAttributes, new IntPtr((void*)pArray)); + Handle = ObjCRuntime.Messaging.IntPtr_objc_msgSendSuper_IntPtr (this.SuperHandle, selInitWithAttributes, new IntPtr ((void*) pArray)); } } - + } } @@ -61,16 +61,15 @@ namespace AppKit { if (attribs == null) throw new ArgumentNullException ("attribs"); - unsafe - { + unsafe { uint [] copy = new uint [attribs.Length + 1]; Array.Copy (attribs, 0, copy, 0, attribs.Length); fixed (uint* pArray = copy) { if (IsDirectBinding) { - InitializeHandle (ObjCRuntime.Messaging.IntPtr_objc_msgSend_IntPtr (this.Handle, selInitWithAttributes, new IntPtr ((void*)pArray))); + InitializeHandle (ObjCRuntime.Messaging.IntPtr_objc_msgSend_IntPtr (this.Handle, selInitWithAttributes, new IntPtr ((void*) pArray))); } else { - InitializeHandle (ObjCRuntime.Messaging.IntPtr_objc_msgSendSuper_IntPtr (this.SuperHandle, selInitWithAttributes, new IntPtr ((void*)pArray))); + InitializeHandle (ObjCRuntime.Messaging.IntPtr_objc_msgSendSuper_IntPtr (this.SuperHandle, selInitWithAttributes, new IntPtr ((void*) pArray))); } } @@ -79,11 +78,11 @@ namespace AppKit { static uint [] ConvertToAttributes (object [] args) { - + var list = new List (); - for (int i = 0; i < args.Length; i++){ + for (int i = 0; i < args.Length; i++) { if (args [i] is NSOpenGLPixelFormatAttribute) { - NSOpenGLPixelFormatAttribute v = (NSOpenGLPixelFormatAttribute)args [i]; + NSOpenGLPixelFormatAttribute v = (NSOpenGLPixelFormatAttribute) args [i]; switch (v) { case NSOpenGLPixelFormatAttribute.AllRenderers: case NSOpenGLPixelFormatAttribute.DoubleBuffer: @@ -137,18 +136,18 @@ namespace AppKit { list.Add ((uint) (int) args [i]); break; } - } else if (args [i] is int && (int) args [i] == 0 && i == args.Length - 1) + } else if (args [i] is int && (int) args [i] == 0 && i == args.Length - 1) list.Add (0); else throw new ArgumentException ($"The specified attribute is not of type NSOpenGLPixelFormatAttribute: {args [i]}"); } - if (args.Length == 0 || !(args[args.Length - 1] is int) || ((int)args [args.Length - 1]) != 0) + if (args.Length == 0 || !(args [args.Length - 1] is int) || ((int) args [args.Length - 1]) != 0) list.Add (0); - + return list.ToArray (); } - + public NSOpenGLPixelFormat (params object [] attribs) : this (ConvertToAttributes (attribs)) { if (attribs == null) @@ -165,14 +164,14 @@ namespace AppKit { } } - fixed (NSOpenGLPixelFormatAttribute* pArray = copy){ + fixed (NSOpenGLPixelFormatAttribute* pArray = copy) { if (IsDirectBinding) { - Handle = ObjCRuntime.Messaging.IntPtr_objc_msgSend_IntPtr (this.Handle, selInitWithAttributes, new IntPtr((void*)pArray )); + Handle = ObjCRuntime.Messaging.IntPtr_objc_msgSend_IntPtr (this.Handle, selInitWithAttributes, new IntPtr ((void*) pArray)); } else { - Handle = ObjCRuntime.Messaging.IntPtr_objc_msgSendSuper_IntPtr (this.SuperHandle, selInitWithAttributes, new IntPtr((void*)pArray)); + Handle = ObjCRuntime.Messaging.IntPtr_objc_msgSendSuper_IntPtr (this.SuperHandle, selInitWithAttributes, new IntPtr ((void*) pArray)); } } - + } } } diff --git a/src/AppKit/NSPasteboard.cs b/src/AppKit/NSPasteboard.cs index f8229eb412..f03c5d5fc6 100644 --- a/src/AppKit/NSPasteboard.cs +++ b/src/AppKit/NSPasteboard.cs @@ -15,7 +15,7 @@ namespace AppKit { nsa_pasteboardReading.Dispose (); return result; } - + #if !NET public bool WriteObjects (NSPasteboardWriting [] objects) { diff --git a/src/AppKit/NSPathControlItem.cs b/src/AppKit/NSPathControlItem.cs index 84ebe13fb7..fd39f4f278 100644 --- a/src/AppKit/NSPathControlItem.cs +++ b/src/AppKit/NSPathControlItem.cs @@ -3,10 +3,10 @@ using System; using Foundation; namespace AppKit { - public partial class NSPathControlItem + public partial class NSPathControlItem #if !XAMCORE_3_0 : INSCoding -#endif +#endif { #if !XAMCORE_3_0 public NSPathControlItem (NSCoder coder) : this () diff --git a/src/AppKit/NSPopUpButton.cs b/src/AppKit/NSPopUpButton.cs index cc50dcbb98..0f88239164 100644 --- a/src/AppKit/NSPopUpButton.cs +++ b/src/AppKit/NSPopUpButton.cs @@ -36,7 +36,7 @@ namespace AppKit { public partial class NSPopUpButton { public new NSPopUpButtonCell Cell { - get { return (NSPopUpButtonCell)base.Cell; } + get { return (NSPopUpButtonCell) base.Cell; } set { base.Cell = value; } } } diff --git a/src/AppKit/NSPopUpButtonCell.cs b/src/AppKit/NSPopUpButtonCell.cs index c5007cbe9d..d0409a6f4b 100644 --- a/src/AppKit/NSPopUpButtonCell.cs +++ b/src/AppKit/NSPopUpButtonCell.cs @@ -9,9 +9,9 @@ namespace AppKit { } } - public NSMenuItem this [string title]{ + public NSMenuItem this [string title] { get { - return ItemWithTitle (title); + return ItemWithTitle (title); } } } diff --git a/src/AppKit/NSPredicateEditorRowTemplate.cs b/src/AppKit/NSPredicateEditorRowTemplate.cs index cba4b069db..c2ca8476e5 100644 --- a/src/AppKit/NSPredicateEditorRowTemplate.cs +++ b/src/AppKit/NSPredicateEditorRowTemplate.cs @@ -16,12 +16,10 @@ using System.Collections.Generic; using Foundation; using CoreData; -namespace AppKit -{ - public partial class NSPredicateEditorRowTemplate - { +namespace AppKit { + public partial class NSPredicateEditorRowTemplate { public NSPredicateEditorRowTemplate (params NSCompoundPredicateType [] compoundTypes) - : this (Array.ConvertAll (compoundTypes, t => NSNumber.FromUInt32 ((uint)t))) + : this (Array.ConvertAll (compoundTypes, t => NSNumber.FromUInt32 ((uint) t))) { } @@ -35,7 +33,7 @@ namespace AppKit leftExpressions.ToArray (), rightExpressions.ToArray (), modifier, - operators.Select (o => NSNumber.FromUInt32 ((uint)o)).ToArray (), + operators.Select (o => NSNumber.FromUInt32 ((uint) o)).ToArray (), options) { } @@ -95,7 +93,7 @@ namespace AppKit leftExpressions.ToArray (), attributeType, modifier, - operators.Select (o => NSNumber.FromUInt32 ((uint)o)).ToArray (), + operators.Select (o => NSNumber.FromUInt32 ((uint) o)).ToArray (), options) { } diff --git a/src/AppKit/NSScreen.cs b/src/AppKit/NSScreen.cs index a3b763bf4b..3645501701 100644 --- a/src/AppKit/NSScreen.cs +++ b/src/AppKit/NSScreen.cs @@ -28,10 +28,10 @@ using System.Collections.Generic; using System.Runtime.InteropServices; namespace AppKit { - + public partial class NSScreen { - - public NSWindowDepth[] SupportedWindowDepths { + + public NSWindowDepth [] SupportedWindowDepths { get { List list = new List (); IntPtr p = GetSupportedWindowDepths (); @@ -40,7 +40,7 @@ namespace AppKit { int value = Marshal.ReadInt32 (p); while (value != 0) { list.Add ((NSWindowDepth) value); - p = (IntPtr) (p.ToInt64 () + sizeof(int)); + p = (IntPtr) (p.ToInt64 () + sizeof (int)); value = Marshal.ReadInt32 (p); } } diff --git a/src/AppKit/NSSegmentedControl.cs b/src/AppKit/NSSegmentedControl.cs index 764ecb3548..9d7003ad4d 100644 --- a/src/AppKit/NSSegmentedControl.cs +++ b/src/AppKit/NSSegmentedControl.cs @@ -15,7 +15,7 @@ namespace AppKit { public partial class NSSegmentedControl { NSActionDispatcher dispatcher; - + public new NSSegmentedCell Cell { get { return (NSSegmentedCell) base.Cell; } set { base.Cell = value; } @@ -25,9 +25,9 @@ namespace AppKit { [SupportedOSPlatform ("macos10.12")] [UnsupportedOSPlatform ("maccatalyst")] #else - [Mac (10,12)] + [Mac (10, 12)] #endif - public static NSSegmentedControl FromLabels (string[] labels, NSSegmentSwitchTracking trackingMode, Action action) + public static NSSegmentedControl FromLabels (string [] labels, NSSegmentSwitchTracking trackingMode, Action action) { var dispatcher = new NSActionDispatcher (action); var control = _FromLabels (labels, trackingMode, dispatcher, NSActionDispatcher.Selector); @@ -39,9 +39,9 @@ namespace AppKit { [SupportedOSPlatform ("macos10.12")] [UnsupportedOSPlatform ("maccatalyst")] #else - [Mac (10,12)] + [Mac (10, 12)] #endif - public static NSSegmentedControl FromImages (NSImage[] images, NSSegmentSwitchTracking trackingMode, Action action) + public static NSSegmentedControl FromImages (NSImage [] images, NSSegmentSwitchTracking trackingMode, Action action) { var dispatcher = new NSActionDispatcher (action); var control = _FromImages (images, trackingMode, dispatcher, NSActionDispatcher.Selector); @@ -49,12 +49,12 @@ namespace AppKit { return control; } - public void UnselectAllSegments() + public void UnselectAllSegments () { NSSegmentSwitchTracking current = this.Cell.TrackingMode; this.Cell.TrackingMode = NSSegmentSwitchTracking.Momentary; - - for (nint i = 0; i < this.SegmentCount; i ++) + + for (nint i = 0; i < this.SegmentCount; i++) SetSelected (false, i); this.Cell.TrackingMode = current; diff --git a/src/AppKit/NSSharingService.cs b/src/AppKit/NSSharingService.cs index 7df1621c32..827e4c8e0f 100644 --- a/src/AppKit/NSSharingService.cs +++ b/src/AppKit/NSSharingService.cs @@ -3,10 +3,8 @@ using System; using Foundation; using ObjCRuntime; -namespace AppKit -{ - public partial class NSSharingService - { +namespace AppKit { + public partial class NSSharingService { public static NSSharingService GetSharingService (NSSharingServiceName service) { var constant = service.GetConstant (); diff --git a/src/AppKit/NSSharingServiceDelegate.cs b/src/AppKit/NSSharingServiceDelegate.cs index fdab2a8e08..21bc3f6e32 100644 --- a/src/AppKit/NSSharingServiceDelegate.cs +++ b/src/AppKit/NSSharingServiceDelegate.cs @@ -11,12 +11,12 @@ namespace AppKit { public partial class NSSharingServiceDelegate { CGRect SourceFrameOnScreenForShareItem (NSSharingService sharingService, NSPasteboardWriting item) { - return SourceFrameOnScreenForShareItem (sharingService, (INSPasteboardWriting)item); + return SourceFrameOnScreenForShareItem (sharingService, (INSPasteboardWriting) item); } NSImage TransitionImageForShareItem (NSSharingService sharingService, NSPasteboardWriting item, CGRect contentRect) { - return TransitionImageForShareItem (sharingService, (INSPasteboardWriting)item, contentRect); + return TransitionImageForShareItem (sharingService, (INSPasteboardWriting) item, contentRect); } } #endif diff --git a/src/AppKit/NSSlider.cs b/src/AppKit/NSSlider.cs index 5ae36b7fac..9dc2c7e0f5 100644 --- a/src/AppKit/NSSlider.cs +++ b/src/AppKit/NSSlider.cs @@ -41,7 +41,7 @@ namespace AppKit { [SupportedOSPlatform ("macos10.12")] [UnsupportedOSPlatform ("maccatalyst")] #else - [Mac (10,12)] + [Mac (10, 12)] #endif public static NSSlider FromTarget (Action action) { @@ -55,7 +55,7 @@ namespace AppKit { [SupportedOSPlatform ("macos10.12")] [UnsupportedOSPlatform ("maccatalyst")] #else - [Mac (10,12)] + [Mac (10, 12)] #endif public static NSSlider FromValue (double value, double minValue, double maxValue, Action action) { diff --git a/src/AppKit/NSSound.cs b/src/AppKit/NSSound.cs index 2dce7cfb06..363add549d 100644 --- a/src/AppKit/NSSound.cs +++ b/src/AppKit/NSSound.cs @@ -26,11 +26,11 @@ using System; namespace AppKit { - + public partial class NSSound { - + // note: if needed override the protected Get|Set methods - public string Name { + public string Name { get { return GetName (); } // ignore return value (bool) set { SetName (value); } diff --git a/src/AppKit/NSSpeechSynthesizer.cs b/src/AppKit/NSSpeechSynthesizer.cs index e50d44b186..921e086797 100644 --- a/src/AppKit/NSSpeechSynthesizer.cs +++ b/src/AppKit/NSSpeechSynthesizer.cs @@ -26,11 +26,11 @@ using System; namespace AppKit { - + public partial class NSSpeechSynthesizer { - + // note: if needed override the protected Get|Set methods - public string Voice { + public string Voice { get { return GetVoice (); } // ignore return value (bool) set { SetVoice (value); } diff --git a/src/AppKit/NSSpellChecker.cs b/src/AppKit/NSSpellChecker.cs index 33cefe4c27..2fef93bf56 100644 --- a/src/AppKit/NSSpellChecker.cs +++ b/src/AppKit/NSSpellChecker.cs @@ -26,11 +26,11 @@ using System; namespace AppKit { - + public partial class NSSpellChecker { - + // note: if needed override the protected Get|Set methods - public string Language { + public string Language { get { return GetLanguage (); } // ignore return value (bool) set { SetLanguage (value); } diff --git a/src/AppKit/NSStatusBar.cs b/src/AppKit/NSStatusBar.cs index 979b1f1a91..8b6df892f9 100644 --- a/src/AppKit/NSStatusBar.cs +++ b/src/AppKit/NSStatusBar.cs @@ -11,19 +11,16 @@ using System; -namespace AppKit -{ - public enum NSStatusItemLength - { +namespace AppKit { + public enum NSStatusItemLength { Variable = -1, Square = -2 } - public partial class NSStatusBar - { + public partial class NSStatusBar { public NSStatusItem CreateStatusItem (NSStatusItemLength length) { - return CreateStatusItem ((float)length); + return CreateStatusItem ((float) length); } } } diff --git a/src/AppKit/NSStringAttributes.cs b/src/AppKit/NSStringAttributes.cs index 8bb8e2a7d5..ad602e1ef6 100644 --- a/src/AppKit/NSStringAttributes.cs +++ b/src/AppKit/NSStringAttributes.cs @@ -14,10 +14,8 @@ using ObjCRuntime; using CoreFoundation; using Foundation; -namespace AppKit -{ - public partial class NSStringAttributes : DictionaryContainer - { +namespace AppKit { + public partial class NSStringAttributes : DictionaryContainer { static internal NSDictionary ToDictionary ( NSFont font, NSColor foregroundColor, @@ -50,7 +48,7 @@ namespace AppKit { var attr = new NSStringAttributes (); - if (font != null){ + if (font != null) { attr.Font = font; } @@ -63,7 +61,7 @@ namespace AppKit } if (underlineStyle != NSUnderlineStyle.None) { - attr.UnderlineStyle = (int?)underlineStyle; + attr.UnderlineStyle = (int?) underlineStyle; } if (superscript) { @@ -107,7 +105,7 @@ namespace AppKit } if (strikethroughStyle != NSUnderlineStyle.None) { - attr.StrikethroughStyle = (int?)strikethroughStyle; + attr.StrikethroughStyle = (int?) strikethroughStyle; } if (strikethroughColor != null) { @@ -192,18 +190,18 @@ namespace AppKit bool? GetBool (NSString key) { var value = GetInt32Value (key); - return value == null ? null : (bool?)(value.Value != 0); + return value == null ? null : (bool?) (value.Value != 0); } - + void Set (NSString key, bool? value) { - SetNumberValue (key, value == null ? null : (int?)(value.Value ? 1 : 0)); + SetNumberValue (key, value == null ? null : (int?) (value.Value ? 1 : 0)); } int SetUnderlineStyle (NSString attr, NSUnderlineStyle style, NSUnderlinePattern pattern, bool byWord) { - var value = (int)style | (int)pattern; + var value = (int) style | (int) pattern; if (byWord) { value |= (int) NSAttributedString.UnderlineByWordMaskAttributeName; } @@ -264,8 +262,8 @@ namespace AppKit } public NSLigatureType? Ligature { - get { return (NSLigatureType?)GetInt32Value (NSStringAttributeKey.Ligature); } - set { SetNumberValue (NSStringAttributeKey.Ligature, (int?)value); } + get { return (NSLigatureType?) GetInt32Value (NSStringAttributeKey.Ligature); } + set { SetNumberValue (NSStringAttributeKey.Ligature, (int?) value); } } public float? BaselineOffset { @@ -364,8 +362,8 @@ namespace AppKit } public NSTextLayoutOrientation? VerticalGlyphForm { - get { return (NSTextLayoutOrientation?)GetInt32Value (NSStringAttributeKey.VerticalGlyphForm); } - set { SetNumberValue (NSStringAttributeKey.VerticalGlyphForm, (int?)value); } + get { return (NSTextLayoutOrientation?) GetInt32Value (NSStringAttributeKey.VerticalGlyphForm); } + set { SetNumberValue (NSStringAttributeKey.VerticalGlyphForm, (int?) value); } } public NSTextAlternatives TextAlternatives { @@ -374,8 +372,8 @@ namespace AppKit } public NSSpellingState? SpellingState { - get { return (NSSpellingState?)GetInt32Value (NSStringAttributeKey.SpellingState); } - set { SetNumberValue (NSStringAttributeKey.SpellingState, (int?)value); } + get { return (NSSpellingState?) GetInt32Value (NSStringAttributeKey.SpellingState); } + set { SetNumberValue (NSStringAttributeKey.SpellingState, (int?) value); } } } } diff --git a/src/AppKit/NSStringDrawing.cs b/src/AppKit/NSStringDrawing.cs index e9e4dc8b67..7b28cf7dcd 100644 --- a/src/AppKit/NSStringDrawing.cs +++ b/src/AppKit/NSStringDrawing.cs @@ -14,7 +14,7 @@ namespace AppKit { [SupportedOSPlatform ("tvos")] #endif // Manual bindings, easier than make the generator support extension methods on non-NSObject-derived types (string in this case). - public unsafe static partial class NSStringDrawing { + public unsafe static partial class NSStringDrawing { public static void DrawAtPoint (this string This, CGPoint point, NSDictionary attributes) { using (var self = ((NSString) This)) diff --git a/src/AppKit/NSTableView.cs b/src/AppKit/NSTableView.cs index 8539a3b477..1765be1f5d 100644 --- a/src/AppKit/NSTableView.cs +++ b/src/AppKit/NSTableView.cs @@ -35,7 +35,7 @@ namespace AppKit { public partial class NSTableView { public NSTableViewSource Source { get { - var d = WeakDelegate as NSTableViewSource; + var d = WeakDelegate as NSTableViewSource; if (d != null) return d; return null; diff --git a/src/AppKit/NSTextContainer.cs b/src/AppKit/NSTextContainer.cs index a319bb8508..9cb385a340 100644 --- a/src/AppKit/NSTextContainer.cs +++ b/src/AppKit/NSTextContainer.cs @@ -3,12 +3,10 @@ using System; using CoreGraphics; using ObjCRuntime; -namespace AppKit -{ - public partial class NSTextContainer - { +namespace AppKit { + public partial class NSTextContainer { #if !NET - [Obsoleted (PlatformName.MacOSX, 10, 11, message : "Use NSTextContainer.FromSize instead.")] + [Obsoleted (PlatformName.MacOSX, 10, 11, message: "Use NSTextContainer.FromSize instead.")] public NSTextContainer (CGSize size) { Handle = InitWithContainerSize (size); @@ -29,7 +27,7 @@ namespace AppKit [SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("tvos")] #else - [Mac (10,11)] + [Mac (10, 11)] #endif public static NSTextContainer FromSize (CGSize size) { @@ -46,7 +44,7 @@ namespace AppKit [Obsolete ("Starting with macos10.11 use NSTextContainer.FromSize instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #endif #else - [Deprecated (PlatformName.MacOSX, 10, 11, message : "Use NSTextContainer.FromSize instead.")] + [Deprecated (PlatformName.MacOSX, 10, 11, message: "Use NSTextContainer.FromSize instead.")] #endif public static NSTextContainer FromContainerSize (CGSize containerSize) { diff --git a/src/AppKit/NSTextField.cs b/src/AppKit/NSTextField.cs index 0688e810f6..b9c830a6d4 100644 --- a/src/AppKit/NSTextField.cs +++ b/src/AppKit/NSTextField.cs @@ -12,7 +12,7 @@ namespace AppKit { public partial class NSTextField { public new NSTextFieldCell Cell { - get { return (NSTextFieldCell)base.Cell; } + get { return (NSTextFieldCell) base.Cell; } set { base.Cell = value; } } } diff --git a/src/AppKit/NSTextStorage.cs b/src/AppKit/NSTextStorage.cs index a16b158924..3551728439 100644 --- a/src/AppKit/NSTextStorage.cs +++ b/src/AppKit/NSTextStorage.cs @@ -4,13 +4,16 @@ using Foundation; namespace AppKit { public partial class NSTextStorage { - public NSTextStorage (string str, NSDictionary attributes) : base (str, attributes) { + public NSTextStorage (string str, NSDictionary attributes) : base (str, attributes) + { } - public NSTextStorage (NSAttributedString other) : base (other) { + public NSTextStorage (NSAttributedString other) : base (other) + { } - public NSTextStorage (string str, CTStringAttributes attributes) : base (str, attributes) { + public NSTextStorage (string str, CTStringAttributes attributes) : base (str, attributes) + { } } } diff --git a/src/AppKit/NSTextTableBlock.cs b/src/AppKit/NSTextTableBlock.cs index d2aef393ad..a571214831 100644 --- a/src/AppKit/NSTextTableBlock.cs +++ b/src/AppKit/NSTextTableBlock.cs @@ -10,11 +10,9 @@ using System; -namespace AppKit -{ +namespace AppKit { #if !NET - public partial class NSTextTableBlock - { + public partial class NSTextTableBlock { [Obsolete ("macOS 10.12 does not allow creation via this constructor")] public NSTextTableBlock () { diff --git a/src/AppKit/NSTreeController.cs b/src/AppKit/NSTreeController.cs index e6b77f8344..ae48b0b3ec 100644 --- a/src/AppKit/NSTreeController.cs +++ b/src/AppKit/NSTreeController.cs @@ -28,18 +28,18 @@ using System; using Foundation; namespace AppKit { - + public partial class NSTreeController { - + // note: if needed override the protected Get|Set methods - public NSIndexPath SelectionIndexPath { + public NSIndexPath SelectionIndexPath { get { return GetSelectionIndexPath (); } // ignore return value (bool) - set { SetSelectionIndexPath(value); } + set { SetSelectionIndexPath (value); } } - + // note: if needed override the protected Get|Set methods - public NSIndexPath [] SelectionIndexPaths { + public NSIndexPath [] SelectionIndexPaths { get { return GetSelectionIndexPaths (); } // ignore return value (bool) set { SetSelectionIndexPaths (value); } diff --git a/src/AppKit/NSView.cs b/src/AppKit/NSView.cs index a8726c8650..9cb05967af 100644 --- a/src/AppKit/NSView.cs +++ b/src/AppKit/NSView.cs @@ -19,8 +19,7 @@ namespace AppKit { static view_compare_func view_comparer = view_compare; #endif - sealed class SortData - { + sealed class SortData { public Exception Exception; public Func Comparer; } diff --git a/src/AppKit/NSWindow.cs b/src/AppKit/NSWindow.cs index a347b9a216..a37b0025af 100644 --- a/src/AppKit/NSWindow.cs +++ b/src/AppKit/NSWindow.cs @@ -64,7 +64,7 @@ namespace AppKit { // // If that is the case, we take a reference first, and to keep the behavior // we call Dispose after that. - if (WindowController == null){ + if (WindowController == null) { bool released_when_closed = ReleasedWhenClosed; if (released_when_closed) CFObject.CFRetain (Handle); @@ -76,7 +76,7 @@ namespace AppKit { } // note: if needed override the protected Get|Set methods - public string FrameAutosaveName { + public string FrameAutosaveName { get { return GetFrameAutosaveName (); } // ignore return value (bool) set { SetFrameAutosaveName (value); } @@ -86,7 +86,7 @@ namespace AppKit { { return NextEventMatchingMask ((uint) mask); } - + public NSEvent NextEventMatchingMask (NSEventMask mask, NSDate expiration, string mode, bool deqFlag) { return NextEventMatchingMask ((uint) mask, expiration, mode, deqFlag); @@ -97,27 +97,27 @@ namespace AppKit { DiscardEventsMatchingMask ((uint) mask, beforeLastEvent); } -// NSString NSWindowDidBecomeKeyNotification; -// NSString NSWindowDidBecomeMainNotification; -// NSString NSWindowDidChangeScreenNotification; -// NSString NSWindowDidDeminiaturizeNotification; -// NSString NSWindowDidExposeNotification; -// NSString NSWindowDidMiniaturizeNotification; -// NSString NSWindowDidMoveNotification; -// NSString NSWindowDidResignKeyNotification; -// NSString NSWindowDidResignMainNotification; -// NSString NSWindowDidResizeNotification; -// NSString NSWindowDidUpdateNotification; -// NSString NSWindowWillCloseNotification; -// NSString NSWindowWillMiniaturizeNotification; -// NSString NSWindowWillMoveNotification; -// NSString NSWindowWillBeginSheetNotification; -// NSString NSWindowDidEndSheetNotification; -// NSString NSWindowDidChangeScreenProfileNotification -// NSString NSWindowWillStartLiveResizeNotification -// NSString NSWindowDidEndLiveResizeNotification + // NSString NSWindowDidBecomeKeyNotification; + // NSString NSWindowDidBecomeMainNotification; + // NSString NSWindowDidChangeScreenNotification; + // NSString NSWindowDidDeminiaturizeNotification; + // NSString NSWindowDidExposeNotification; + // NSString NSWindowDidMiniaturizeNotification; + // NSString NSWindowDidMoveNotification; + // NSString NSWindowDidResignKeyNotification; + // NSString NSWindowDidResignMainNotification; + // NSString NSWindowDidResizeNotification; + // NSString NSWindowDidUpdateNotification; + // NSString NSWindowWillCloseNotification; + // NSString NSWindowWillMiniaturizeNotification; + // NSString NSWindowWillMoveNotification; + // NSString NSWindowWillBeginSheetNotification; + // NSString NSWindowDidEndSheetNotification; + // NSString NSWindowDidChangeScreenProfileNotification + // NSString NSWindowWillStartLiveResizeNotification + // NSString NSWindowDidEndLiveResizeNotification + - } } #endif // !__MACCATALYST__ diff --git a/src/AppKit/NSWorkspace.cs b/src/AppKit/NSWorkspace.cs index 2769f380dc..d107cf46fd 100644 --- a/src/AppKit/NSWorkspace.cs +++ b/src/AppKit/NSWorkspace.cs @@ -20,7 +20,7 @@ namespace AppKit { #else [Deprecated (PlatformName.MacOSX, 11, 0, message: "Use 'NSWorkspace.OpenUrls' with completion handler.")] #endif - public virtual bool OpenUrls (NSUrl[] urls, string bundleIdentifier, NSWorkspaceLaunchOptions options, NSAppleEventDescriptor descriptor, string[] identifiers) + public virtual bool OpenUrls (NSUrl [] urls, string bundleIdentifier, NSWorkspaceLaunchOptions options, NSAppleEventDescriptor descriptor, string [] identifiers) { // Ignore the passed in argument, because if you pass it in we will crash on cleanup. return _OpenUrls (urls, bundleIdentifier, options, descriptor, null); @@ -36,7 +36,7 @@ namespace AppKit { #else [Deprecated (PlatformName.MacOSX, 11, 0, message: "Use 'NSWorkspace.OpenUrls' with completion handler.")] #endif - public virtual bool OpenUrls (NSUrl[] urls, string bundleIdentifier, NSWorkspaceLaunchOptions options, NSAppleEventDescriptor descriptor) + public virtual bool OpenUrls (NSUrl [] urls, string bundleIdentifier, NSWorkspaceLaunchOptions options, NSAppleEventDescriptor descriptor) { return _OpenUrls (urls, bundleIdentifier, options, descriptor, null); } @@ -47,8 +47,7 @@ namespace AppKit { var nsFileType = NSString.CreateNative (fileType); try { return IconForFileType (nsFileType); - } - finally { + } finally { NSString.ReleaseNative (nsFileType); } } diff --git a/tools/autoformat.sh b/tools/autoformat.sh index b6177260c0..4017d62071 100755 --- a/tools/autoformat.sh +++ b/tools/autoformat.sh @@ -33,6 +33,7 @@ dotnet format whitespace --folder "$SRC_DIR/src/Accounts" dotnet format whitespace --folder "$SRC_DIR/src/AddressBook" dotnet format whitespace --folder "$SRC_DIR/src/AddressBookUI" dotnet format whitespace --folder "$SRC_DIR/src/AdSupport/" +dotnet format whitespace --folder "$SRC_DIR/src/AppKit/" dotnet format whitespace --folder "$SRC_DIR/src/ARKit/" dotnet format whitespace --folder "$SRC_DIR/src/AssetsLibrary/" dotnet format whitespace --folder "$SRC_DIR/src/AudioToolbox/"