Initial attempt at implementing NSTextInputClient instead of NSTextInput
NSTextInput was deprecated in 10.6. Change-Id: I6bce9e91a68014a6ca28bff6a820c27817f9baaf
This commit is contained in:
@@ -63,11 +63,11 @@
|
||||
-(void)unregisterDraggingDestinationHandler:(id)theHandler;
|
||||
@end
|
||||
|
||||
@interface SalFrameView : AquaA11yWrapper <NSTextInput>
|
||||
@interface SalFrameView : AquaA11yWrapper <NSTextInputClient>
|
||||
{
|
||||
AquaSalFrame* mpFrame;
|
||||
|
||||
// for NSTextInput
|
||||
// for NSTextInputClient
|
||||
NSEvent* mpLastEvent;
|
||||
BOOL mbNeedSpecialKeyHandle;
|
||||
BOOL mbInKeyInput;
|
||||
@@ -117,7 +117,7 @@
|
||||
/*
|
||||
text action methods
|
||||
*/
|
||||
-(void)insertText:(id)aString;
|
||||
-(void)insertText:(id)aString replacementRange:(NSRange)replacementRange;
|
||||
-(void)insertTab: (id)aSender;
|
||||
-(void)insertBacktab: (id)aSender;
|
||||
-(void)moveLeft: (id)aSender;
|
||||
|
@@ -1026,8 +1026,10 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
-(void)insertText:(id)aString
|
||||
-(void)insertText:(id)aString replacementRange:(NSRange)replacementRange
|
||||
{
|
||||
(void) replacementRange; // FIXME: surely it must be used
|
||||
|
||||
YIELD_GUARD;
|
||||
|
||||
if( AquaSalFrame::isAlive( mpFrame ) )
|
||||
@@ -1545,7 +1547,7 @@ private:
|
||||
}
|
||||
|
||||
|
||||
// NSTextInput protocol
|
||||
// NSTextInputClient protocol
|
||||
- (NSArray *)validAttributesForMarkedText
|
||||
{
|
||||
return [NSArray arrayWithObjects:NSUnderlineStyleAttributeName, nil];
|
||||
@@ -1596,8 +1598,10 @@ private:
|
||||
return mSelectedRange;
|
||||
}
|
||||
|
||||
- (void)setMarkedText:(id)aString selectedRange:(NSRange)selRange
|
||||
- (void)setMarkedText:(id)aString selectedRange:(NSRange)selRange replacementRange:(NSRange)replacementRange
|
||||
{
|
||||
(void) replacementRange; // FIXME - use it!
|
||||
|
||||
if( ![aString isKindOfClass:[NSAttributedString class]] )
|
||||
aString = [[[NSAttributedString alloc] initWithString:aString] autorelease];
|
||||
NSRange rangeToReplace = [self hasMarkedText] ? [self markedRange] : [self selectedRange];
|
||||
@@ -1664,10 +1668,12 @@ private:
|
||||
mSelectedRange = mMarkedRange = NSMakeRange(NSNotFound, 0);
|
||||
}
|
||||
|
||||
- (NSAttributedString *)attributedSubstringFromRange:(NSRange)theRange
|
||||
- (NSAttributedString *)attributedSubstringForProposedRange:(NSRange)aRange actualRange:(NSRangePointer)actualRange
|
||||
{
|
||||
(void)theRange;
|
||||
// FIXME
|
||||
(void) aRange;
|
||||
(void) actualRange;
|
||||
|
||||
// FIXME - Implement
|
||||
return nil;
|
||||
}
|
||||
|
||||
@@ -1709,9 +1715,12 @@ private:
|
||||
mpLastEvent = nil;
|
||||
}
|
||||
|
||||
- (NSRect)firstRectForCharacterRange:(NSRange)theRange
|
||||
- (NSRect)firstRectForCharacterRange:(NSRange)aRange actualRange:(NSRangePointer)actualRange
|
||||
{
|
||||
(void)theRange;
|
||||
// FIXME - These should probably be used?
|
||||
(void) aRange;
|
||||
(void) actualRange;
|
||||
|
||||
SalExtTextInputPosEvent aPosEvent;
|
||||
mpFrame->CallCallback( SALEVENT_EXTTEXTINPUTPOS, (void *)&aPosEvent );
|
||||
|
||||
|
Reference in New Issue
Block a user