Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuki Hashimoto <hzuika>2021-07-05 13:58:33 +0300
committerBrecht Van Lommel <brecht@blender.org>2021-07-05 14:10:08 +0300
commit2c6c1b6cc046558519bb8dcfb8ee60401862d7e0 (patch)
tree30b23d9e296f1ca68ebdab3ea194413301ca3030
parentc1ba68dd042c86c6650dad534bdb3687c3a8f621 (diff)
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
-rw-r--r--intern/ghost/intern/GHOST_WindowViewCocoa.h18
1 files changed, 8 insertions, 10 deletions
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 <NSTextInput>
+@interface COCOA_VIEW_CLASS : COCOA_VIEW_BASE_CLASS <NSTextInputClient>
{
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;
}