Skip to content

AppKit macOS xcode16.0 b3

Rolf Bjarne Kvinge edited this page Jul 9, 2024 · 2 revisions

#AppKit.framework

diff -ruN /Applications/Xcode_16.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSAttributedString.h /Applications/Xcode_16.0.0-beta3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSAttributedString.h
--- /Applications/Xcode_16.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSAttributedString.h	2024-06-21 06:31:11
+++ /Applications/Xcode_16.0.0-beta3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSAttributedString.h	2024-07-02 08:27:36
@@ -176,6 +176,10 @@
 
 APPKIT_EXTERN NSAttributedStringDocumentReadingOptionKey const NSSourceTextScalingDocumentOption API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0), visionos(1.0));  // @"SourceTextScaling", one of the text scaling types declared above.  Only affects RTF documents.  For reading methods, you can pass this option to indicate the source text scaling type of the RTF document being read.  Use this in conjunction with NSTargetTextScalingDocumentOption to control text scaling conversions on the font point sizes in the returned attributed string.  This option does nothing unless NSTargetTextScalingDocumentOption is also specified.  If this option is not provided, the system will deduce the source text scaling type based on the information in the document.
 
+// NSNumber containing a boolean value. When true, the TextKit1-style text list including the marker format string will be produced.
+// NSAttributedString uses two representations for the text list. With TextKit2, the paragraph representing a text list item only contains the content. For example, " - text list A" is represented as "test list A" with a .hyphen NSTextList. TextKit1 requires the entire resolved text list content including the marker format string.
+APPKIT_EXTERN NSAttributedStringDocumentReadingOptionKey const NSTextKit1ListMarkerFormatDocumentOption API_AVAILABLE(macos(15.0), ios(18.0), tvos(18.0), watchos(11.0), visionos(2.0));
+
 
 @interface NSAttributedString (NSAttributedStringDocumentFormats)
 // Methods initializing the receiver contents with an external document data.  options specify document attributes for interpreting the document contents.  NSDocumentTypeDocumentAttribute, NSCharacterEncodingDocumentAttribute, and NSDefaultAttributesDocumentAttribute are supported options key.  When they are not specified, these methods will examine the data and do their best to detect the appropriate attributes.  If dict is non-NULL, it will return a dictionary with various document-wide attributes accessible via NS...DocumentAttribute keys.
diff -ruN /Applications/Xcode_16.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSMenuItem.h /Applications/Xcode_16.0.0-beta3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSMenuItem.h
--- /Applications/Xcode_16.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSMenuItem.h	2024-06-21 06:31:08
+++ /Applications/Xcode_16.0.0-beta3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSMenuItem.h	2024-07-02 08:27:33
@@ -46,6 +46,13 @@
 @property (copy) NSString *title;
 @property (nullable, copy) NSAttributedString *attributedTitle;
 
+/*!
+    @abstract       Used to specify a standard subtitle for the menu item.
+    @discussion     The subtitle is displayed below the standard title.
+    @note           On macOS 14, a menu item with an attributed title does not show the subtitle. The subtitle is shown on macOS 15 and later.
+*/
+@property (copy, nullable) NSString *subtitle API_AVAILABLE(macos(14.4));
+
 @property (getter=isSeparatorItem, readonly) BOOL separatorItem;
 
 /// Indicates whether the item is a section header.
diff -ruN /Applications/Xcode_16.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSResponder.h /Applications/Xcode_16.0.0-beta3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSResponder.h
--- /Applications/Xcode_16.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSResponder.h	2024-06-21 06:31:04
+++ /Applications/Xcode_16.0.0-beta3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSResponder.h	2024-07-02 08:27:30
@@ -81,6 +81,24 @@
 
 - (void)pressureChangeWithEvent:(NSEvent *)event API_AVAILABLE(macos(10.10.3));
 
+/*!
+    @method        `contextMenuKeyDown`
+    @abstract      Handle a key event that should present a context menu at the user focus.
+    @discussion    Most applications should not override this method. Instead, you should customize the context menu displayed from a keyboard event by implementing `menuForEvent:` and `selectionAnchorRect`, or `showContextMenuForSelection:`, rather than this method.
+
+    You should only override this method when you do not want the system-provided default behavior for the context menu hotkey, either for a specific key combination, or for the hotkey in general. For example, if your application already provides a different behavior for control-Return (the default context menu hotkey definition), and you want to preserve that behavior, you should override this method to handle that specific key combination, and then return without calling `super`. Note that the user may customize the hotkey to a different key combination, so in this example, if any other key combination is passed to your method, you would call `super`.
+
+    An implementation of this method should call `[super contextMenuKeyDown:event]` to pass the request up the responder chain. If the message reaches the application object, NSApplication's implementation of this method will send `showContextMenuForSelection:` to the responder chain. If you do not call `super`, then no further handling of the key event will be performed.
+
+    @note          In some cases, `showContextMenuForSelection:` will be called without a prior call to `contextMenuKeyDown:`. This occurs when a view receives an Accessibility ShowMenu action, or when the user has created a Cocoa Text key binding to map a different key combination to the `showContextMenuForSelection:` action.
+
+    @param         event
+                   The key down event that matches the system-wide context menu hotkey combination.
+
+    @seealso       `showContextMenuForSelection:`
+  */
+- (void)contextMenuKeyDown:(NSEvent *)event API_AVAILABLE(macos(15.0));
+
 - (void)noResponderFor:(SEL)eventSelector;
 @property (readonly) BOOL acceptsFirstResponder;
 - (BOOL)becomeFirstResponder;
@@ -260,6 +278,26 @@
 /* Perform a Quick Look on the text cursor position, selection, or whatever is appropriate for your view. If there are no Quick Look items, then call [[self nextResponder] tryToPerform:_cmd with:sender]; to pass the request up the responder chain. Eventually AppKit will attempt to perform a dictionary look up. Also see quickLookWithEvent: above.
 */
 - (void)quickLookPreviewItems:(nullable id)sender API_AVAILABLE(macos(10.8));
+
+/*!
+    @method        `showContextMenuForSelection`
+    @abstract      Present a context menu at the text cursor position, selection, or wherever is appropriate for your responder.
+    @discussion    NSView has a default implementation of this method. For any view that returns a non-nil value from `-menuForEvent:`, the default implementation will display that menu automatically. The NSView implementation uses the `selectionAnchorRect` method in the `NSViewContentSelectionInfo` protocol to determine the location of the selection and of the menu. The NSView implementation determines the menu to display by calling `menuForEvent:` with a right-mouse-down event that is centered on the anchor rect. If `selectionAnchorRect` is not implemented, then the NSView implementation calls `menuForEvent` with a right-mouse-down event that is centered on the view's bounds, and also displays the menu at that location.
+
+    You should only override this method in a custom view if you need full control over the display of a context menu from the keyboard or Accessibility, beyond what is provided by default by NSView.
+
+    If the view does not support a context menu, then you should call `[[self nextResponder] tryToPerform:_cmd with:sender]` to pass the request up the responder chain.
+
+    @note          In some cases, this method will be called without a prior call to `contextMenuKeyDown:`. This occurs when a view receives an Accessibility ShowMenu action, or when the user has created a Cocoa Text key binding to map a different key combination to the `showContextMenuForSelection:` action.
+
+    @param         sender
+                   The object that originated the display of the context menu.
+
+    @seealso       `menuForEvent:`
+    @seealso       `selectionAnchorRect`
+    @seealso       `contextMenuKeyDown:`
+  */
+- (void)showContextMenuForSelection:(nullable id)sender API_AVAILABLE(macos(15.0));
 
 @end
 
diff -ruN /Applications/Xcode_16.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSView.h /Applications/Xcode_16.0.0-beta3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSView.h
--- /Applications/Xcode_16.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSView.h	2024-06-21 06:31:09
+++ /Applications/Xcode_16.0.0-beta3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSView.h	2024-07-02 08:27:35
@@ -403,6 +403,26 @@
 @end
 #endif
 
+/*!
+    @protocol  `NSViewContentSelectionInfo`
+    @abstract  A protocol to request information from NSView subclasses about the selected content in the view.
+ */
+@protocol NSViewContentSelectionInfo <NSObject>
+/*!
+    @method     `selectionAnchorRect`
+
+    @abstract   Provides a rect that is used to position system UI, such as context menus and popovers, at an appropriate location in the view.
+
+    @discussion This method is used in macOS 15 to display a context menu in response to the context menu keyboard hotkey. The menu will be displayed adjacent to the anchor rect, but not overlapping. It is not used when displaying a context menu in response to a mouse or trackpad click; in that case, the mouse event has location information, and the context menu is displayed at the location of the event.
+
+    @return     A bounding rect in view coordinates. If the view has a current selection, then this rect should typically contain the entire selection, but this is not required if the view wants to position system UI at an alternate location. The return value may be CGRectNull to indicate that no system UI should be presented for the view at this time; in that case, the next responder is examined for a context menu.
+
+    @seealso    `showContextMenuForSelection:`
+*/
+@optional
+@property (readonly) NSRect selectionAnchorRect API_AVAILABLE(macos(15.0));
+@end
+
 @interface NSView(NSKeyboardUI)
 @property (nullable, assign) NSView *nextKeyView;
 @property (nullable, readonly, assign) NSView *previousKeyView;
Clone this wiki locally