cocoa: update the use of textinputclient to be compatible with fpc3.0.4 headers

git-svn-id: trunk@63710 -
This commit is contained in:
dmitry 2020-08-10 01:40:07 +00:00
parent a46dc42df8
commit d459164217
2 changed files with 25 additions and 2 deletions

View File

@ -108,6 +108,29 @@ type
end;
{$endif}
{$if FPC_FULLVERSION < 30200}
{NSTextInputClientProtocol = objcprotocol external name 'NSTextInputClient'
required
procedure insertText_replacementRange (aString: id; replacementRange: NSRange); message 'insertText:replacementRange:';
procedure doCommandBySelector (aSelector: SEL); message 'doCommandBySelector:';
procedure setMarkedText_selectedRange_replacementRange (aString: id; selectedRange: NSRange; replacementRange: NSRange); message 'setMarkedText:selectedRange:replacementRange:';
procedure unmarkText; message 'unmarkText';
function selectedRange: NSRange; message 'selectedRange';
function markedRange: NSRange; message 'markedRange';
function hasMarkedText: ObjCBOOL; message 'hasMarkedText';
function attributedSubstringForProposedRange_actualRange (aRange: NSRange; actualRange: NSRangePointer): NSAttributedString; message 'attributedSubstringForProposedRange:actualRange:';
function validAttributesForMarkedText: NSArray; message 'validAttributesForMarkedText';
function firstRectForCharacterRange_actualRange (aRange: NSRange; actualRange: NSRangePointer): NSRect; message 'firstRectForCharacterRange:actualRange:';
function characterIndexForPoint (aPoint: NSPoint): NSUInteger; message 'characterIndexForPoint:';
optional
function attributedString: NSAttributedString; message 'attributedString';
function fractionOfDistanceThroughGlyphForPoint (aPoint: NSPoint): CGFloat; message 'fractionOfDistanceThroughGlyphForPoint:';
function baselineDeltaForCharacterAtIndex (anIndex: NSUInteger): CGFloat; message 'baselineDeltaForCharacterAtIndex:';
function windowLevel: NSInteger; message 'windowLevel';
function drawsVerticallyForCharacterAtIndex (charIndex: NSUInteger): ObjCBOOL; message 'drawsVerticallyForCharacterAtIndex:'; { available in 10_6 }
end;}
{$endif}
NSEdgeInsets = packed record
top : CGFloat;
left : CGFloat;

View File

@ -238,7 +238,7 @@ type
procedure unmarkText;
function selectedRange: NSRange;
function markedRange: NSRange;
function hasMarkedText: ObjCBOOL;
function hasMarkedText: LCLObjCBoolean;
function attributedSubstringForProposedRange_actualRange (aRange: NSRange; actualRange: NSRangePointer): NSAttributedString;
function validAttributesForMarkedText: NSArray;
function firstRectForCharacterRange_actualRange (aRange: NSRange; actualRange: NSRangePointer): NSRect;
@ -599,7 +599,7 @@ begin
Result := NSMakeRange(0,0);
end;
function TCocoaCustomControl.hasMarkedText: ObjCBOOL;
function TCocoaCustomControl.hasMarkedText: LCLObjCBoolean;
begin
Result := false;
end;