patches: fix ObjC category declaration warnings
Move postAccessibilityNotificationsForFrame: declaration from primary @interface to (Notifications) category. Add invalidateInteractiveSpans to (InteractiveSpans) category. Fixes 3 compiler warnings (-Wobjc-method-access, -Wincomplete-implementation, -Wobjc-protocol-method-implementation).
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
From 69b3f939764d4a7e5e9dc7bcb882b654364d7ca9 Mon Sep 17 00:00:00 2001
|
||||
From 3bb5a0bed12de424e79a24228e6ae2b4a6e0ecf1 Mon Sep 17 00:00:00 2001
|
||||
From: Martin Sukany <martin@sukany.cz>
|
||||
Date: Sat, 28 Feb 2026 10:35:35 +0100
|
||||
Date: Sat, 28 Feb 2026 12:58:11 +0100
|
||||
Subject: [PATCH 1/6] ns: add accessibility base classes and text extraction
|
||||
|
||||
Add the foundation for macOS VoiceOver accessibility in the NS
|
||||
@@ -10,19 +10,18 @@ Add the foundation for macOS VoiceOver accessibility in the NS
|
||||
(EmacsAccessibilityElement): New base class.
|
||||
(EmacsAccessibilityBuffer, EmacsAccessibilityModeLine)
|
||||
(EmacsAccessibilityInteractiveSpan): Forward declarations.
|
||||
(EmacsAccessibilityBuffer(Notifications)): New category interface.
|
||||
(EmacsAccessibilityBuffer(InteractiveSpans)): New category interface.
|
||||
(EmacsAXSpanType): New enum.
|
||||
(EmacsView): New ivars for accessibility state.
|
||||
* src/nsterm.m: Include intervals.h for TEXT_PROP_MEANS_INVISIBLE.
|
||||
(NS_AX_TEXT_CAP): New macro, 100000.
|
||||
(ns_ax_buffer_text): New function.
|
||||
(ns_ax_mode_line_text): New function.
|
||||
(ns_ax_frame_for_range): New function.
|
||||
(ns_ax_completion_string_from_prop): New function.
|
||||
(ns_ax_window_buffer_object, ns_ax_window_end_charpos)
|
||||
(ns_ax_text_prop_at, ns_ax_next_prop_change)
|
||||
(ns_ax_get_span_label): New utility functions.
|
||||
(ns_ax_buffer_text, ns_ax_mode_line_text, ns_ax_frame_for_range)
|
||||
(ns_ax_completion_string_from_prop, ns_ax_window_buffer_object)
|
||||
(ns_ax_window_end_charpos, ns_ax_text_prop_at)
|
||||
(ns_ax_next_prop_change, ns_ax_get_span_label)
|
||||
(ns_ax_post_notification, ns_ax_post_notification_with_info): New
|
||||
functions. dispatch_async wrappers preventing VoiceOver deadlock.
|
||||
functions.
|
||||
(EmacsAccessibilityElement): Implement base class.
|
||||
(syms_of_nsterm): Register accessibility DEFSYM and DEFVAR
|
||||
ns-accessibility-enabled.
|
||||
@@ -30,15 +29,15 @@ ns-accessibility-enabled.
|
||||
Tested on macOS 14 Sonoma with VoiceOver 10. Builds cleanly;
|
||||
no functional change (dead code until patch 5/6 wires it in).
|
||||
---
|
||||
src/nsterm.h | 119 +++++++++++++
|
||||
src/nsterm.h | 127 ++++++++++++++
|
||||
src/nsterm.m | 468 +++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
2 files changed, 587 insertions(+)
|
||||
2 files changed, 595 insertions(+)
|
||||
|
||||
diff --git a/src/nsterm.h b/src/nsterm.h
|
||||
index 7c1ee4c..393fc4c 100644
|
||||
index 7c1ee4c..51c30ca 100644
|
||||
--- a/src/nsterm.h
|
||||
+++ b/src/nsterm.h
|
||||
@@ -453,6 +453,110 @@ enum ns_return_frame_mode
|
||||
@@ -453,6 +453,118 @@ enum ns_return_frame_mode
|
||||
@end
|
||||
|
||||
|
||||
@@ -103,11 +102,19 @@ index 7c1ee4c..393fc4c 100644
|
||||
+@property (nonatomic, assign) ptrdiff_t cachedCompletionOverlayEnd;
|
||||
+@property (nonatomic, assign) ptrdiff_t cachedCompletionPoint;
|
||||
+- (void)invalidateTextCache;
|
||||
+- (void)postAccessibilityNotificationsForFrame:(struct frame *)f;
|
||||
+- (ptrdiff_t)charposForAccessibilityIndex:(NSUInteger)ax_idx;
|
||||
+- (NSUInteger)accessibilityIndexForCharpos:(ptrdiff_t)charpos;
|
||||
+@end
|
||||
+
|
||||
+@interface EmacsAccessibilityBuffer (Notifications)
|
||||
+- (void)postTextChangedNotification:(ptrdiff_t)point;
|
||||
+- (void)postAccessibilityNotificationsForFrame:(struct frame *)f;
|
||||
+@end
|
||||
+
|
||||
+@interface EmacsAccessibilityBuffer (InteractiveSpans)
|
||||
+- (void)invalidateInteractiveSpans;
|
||||
+@end
|
||||
+
|
||||
+/* Virtual AXStaticText element — one per mode line. */
|
||||
+@interface EmacsAccessibilityModeLine : EmacsAccessibilityElement
|
||||
+@end
|
||||
@@ -149,7 +156,7 @@ index 7c1ee4c..393fc4c 100644
|
||||
/* ==========================================================================
|
||||
|
||||
The main Emacs view
|
||||
@@ -471,6 +575,14 @@ enum ns_return_frame_mode
|
||||
@@ -471,6 +583,14 @@ enum ns_return_frame_mode
|
||||
#ifdef NS_IMPL_COCOA
|
||||
char *old_title;
|
||||
BOOL maximizing_resize;
|
||||
@@ -164,7 +171,7 @@ index 7c1ee4c..393fc4c 100644
|
||||
#endif
|
||||
BOOL font_panel_active;
|
||||
NSFont *font_panel_result;
|
||||
@@ -528,6 +640,13 @@ enum ns_return_frame_mode
|
||||
@@ -528,6 +648,13 @@ enum ns_return_frame_mode
|
||||
- (void)windowWillExitFullScreen;
|
||||
- (void)windowDidExitFullScreen;
|
||||
- (void)windowDidBecomeKey;
|
||||
|
||||
Reference in New Issue
Block a user