mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 09:39:25 +02:00
parent
c2545d0502
commit
6f0e7b8208
@ -401,7 +401,7 @@ var
|
|||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
CarbonInt, CarbonProc, CarbonCanvas, CarbonDbgConsts;
|
LazUTF8, CarbonInt, CarbonProc, CarbonCanvas, CarbonDbgConsts;
|
||||||
|
|
||||||
const
|
const
|
||||||
BITMAPINFOMAP: array[TCarbonBitmapType] of CGBitmapInfo = (
|
BITMAPINFOMAP: array[TCarbonBitmapType] of CGBitmapInfo = (
|
||||||
@ -1067,7 +1067,7 @@ var
|
|||||||
PValue: ATSUAttributeValuePtr;
|
PValue: ATSUAttributeValuePtr;
|
||||||
begin
|
begin
|
||||||
// keep copy of text
|
// keep copy of text
|
||||||
FTextBuffer := UTF8ToUTF16(Text);
|
FTextBuffer := LazUTF8.UTF8ToUTF16(Text);
|
||||||
if FTextBuffer='' then
|
if FTextBuffer='' then
|
||||||
FTextBuffer:=#0#0;
|
FTextBuffer:=#0#0;
|
||||||
TextStyle := Font.Style;
|
TextStyle := Font.Style;
|
||||||
|
@ -330,7 +330,7 @@ const
|
|||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses InterfaceBase, CarbonInt, CarbonProc, CarbonDbgConsts, CarbonUtils, CarbonCanvas, CarbonCaret;
|
uses LazUTF8, InterfaceBase, CarbonInt, CarbonProc, CarbonDbgConsts, CarbonUtils, CarbonCanvas, CarbonCaret;
|
||||||
|
|
||||||
var
|
var
|
||||||
// recursive number of draw events called by OSX
|
// recursive number of draw events called by OSX
|
||||||
|
@ -557,7 +557,7 @@ const
|
|||||||
if TextLen>0 then begin
|
if TextLen>0 then begin
|
||||||
u:=UTF16CharacterToUnicode(@WideBuf[1],CharLen);
|
u:=UTF16CharacterToUnicode(@WideBuf[1],CharLen);
|
||||||
if CharLen>0 then begin
|
if CharLen>0 then begin
|
||||||
UTF8VKCharacter:=UnicodeToUTF8(u);
|
UTF8VKCharacter:=LazUTF8.UnicodeToUTF8(u);
|
||||||
if (UTF8VKCharacter<>'') and (ord(Utf8VKCharacter[1])<=127) then //It's (true) ascii.
|
if (UTF8VKCharacter<>'') and (ord(Utf8VKCharacter[1])<=127) then //It's (true) ascii.
|
||||||
VKKeyChar:=Utf8VKCharacter[1]
|
VKKeyChar:=Utf8VKCharacter[1]
|
||||||
else //not ascii, get the Mac character.
|
else //not ascii, get the Mac character.
|
||||||
@ -612,7 +612,7 @@ const
|
|||||||
|
|
||||||
u:=UTF16CharacterToUnicode(@WideBuf[1],CharLen);
|
u:=UTF16CharacterToUnicode(@WideBuf[1],CharLen);
|
||||||
if CharLen=0 then exit;
|
if CharLen=0 then exit;
|
||||||
UTF8Character:=UnicodeToUTF8(u);
|
UTF8Character:=LazUTF8.UnicodeToUTF8(u);
|
||||||
|
|
||||||
if (UTF8Character<>'') and (ord(Utf8Character[1])<=127) then //It's (true) ascii.
|
if (UTF8Character<>'') and (ord(Utf8Character[1])<=127) then //It's (true) ascii.
|
||||||
KeyChar:=Utf8Character[1]
|
KeyChar:=Utf8Character[1]
|
||||||
@ -705,7 +705,7 @@ const
|
|||||||
begin
|
begin
|
||||||
if AUTF8Char='' then Exit;
|
if AUTF8Char='' then Exit;
|
||||||
// only one character should be used
|
// only one character should be used
|
||||||
WideBuf:={%H-}UTF8Encode(UTF8Copy(AUTF8Char, 1,1));
|
WideBuf:={%H-}UTF8Encode(LazUTF8.UTF8Copy(AUTF8Char, 1,1));
|
||||||
Result:=(length(WideBuf)>0) and
|
Result:=(length(WideBuf)>0) and
|
||||||
(not OSError(SetEventParameter(AEvent, kEventParamKeyUnicodes, typeUnicodeText,
|
(not OSError(SetEventParameter(AEvent, kEventParamKeyUnicodes, typeUnicodeText,
|
||||||
length(WideBuf)*2, @WideBuf[1]), SName, ASetEvent, 'kEventParamKeyUnicodes'));
|
length(WideBuf)*2, @WideBuf[1]), SName, ASetEvent, 'kEventParamKeyUnicodes'));
|
||||||
|
@ -2410,8 +2410,8 @@ function TCarbonWidgetSet.GradientFill(DC: HDC; Vertices: PTriVertex;
|
|||||||
with Mesh do
|
with Mesh do
|
||||||
begin
|
begin
|
||||||
Result :=
|
Result :=
|
||||||
(UpperLeft < Cardinal(NumVertices)) and (UpperLeft >= 0) and
|
(UpperLeft < Cardinal(NumVertices)) {and (UpperLeft >= 0)} and
|
||||||
(LowerRight < Cardinal(NumVertices)) and (LowerRight >= 0);
|
(LowerRight < Cardinal(NumVertices)) {and (LowerRight >= 0)};
|
||||||
if (LowerRight = UpperLeft) or not Result then
|
if (LowerRight = UpperLeft) or not Result then
|
||||||
Exit;
|
Exit;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user