From 2c6c1b6cc046558519bb8dcfb8ee60401862d7e0 Mon Sep 17 00:00:00 2001 From: Yuki Hashimoto Date: Mon, 5 Jul 2021 12:58:33 +0200 Subject: Cleanup: replace NSTextInput with NSTextInputClient This revision replaces the deprecated protocol NSTextInput with NSTextInputClient in Cocoa Text View. No functional changes. For more information of the methods, please see: https://developer.apple.com/documentation/appkit/nstextinputclient Differential Revision: https://developer.blender.org/D11407 --- intern/ghost/intern/GHOST_WindowViewCocoa.h | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'intern') diff --git a/intern/ghost/intern/GHOST_WindowViewCocoa.h b/intern/ghost/intern/GHOST_WindowViewCocoa.h index b94f46b6e63..af84297626b 100644 --- a/intern/ghost/intern/GHOST_WindowViewCocoa.h +++ b/intern/ghost/intern/GHOST_WindowViewCocoa.h @@ -25,7 +25,7 @@ * Objective-C does not have multiple inheritance. */ // We need to subclass it in order to give Cocoa the feeling key events are trapped -@interface COCOA_VIEW_CLASS : COCOA_VIEW_BASE_CLASS +@interface COCOA_VIEW_CLASS : COCOA_VIEW_BASE_CLASS { GHOST_SystemCocoa *systemCocoa; GHOST_WindowCocoa *associatedWindow; @@ -202,12 +202,14 @@ } } -- (void)insertText:(id)chars +- (void)insertText:(id)chars replacementRange:(NSRange)replacementRange { [self composing_free]; } -- (void)setMarkedText:(id)chars selectedRange:(NSRange)range +- (void)setMarkedText:(id)chars + selectedRange:(NSRange)range + replacementRange:(NSRange)replacementRange { [self composing_free]; if ([chars length] == 0) @@ -241,12 +243,8 @@ return composing; } -- (NSInteger)conversationIdentifier -{ - return (NSInteger)self; -} - -- (NSAttributedString *)attributedSubstringFromRange:(NSRange)range +- (NSAttributedString *)attributedSubstringForProposedRange:(NSRange)range + actualRange:(NSRangePointer)actualRange { return [[[NSAttributedString alloc] init] autorelease]; } @@ -267,7 +265,7 @@ return NSMakeRange(0, length); } -- (NSRect)firstRectForCharacterRange:(NSRange)range +- (NSRect)firstRectForCharacterRange:(NSRange)range actualRange:(NSRangePointer)actualRange { return NSZeroRect; } -- cgit v1.2.3