SynEdit: Remove "published" from TextAttribute. Add to child-classes

This commit is contained in:
Martin 2025-08-03 16:25:47 +02:00
parent 30eba66380
commit aa4b55e655
42 changed files with 243 additions and 198 deletions

View File

@ -36,7 +36,7 @@ type
Offset: Integer; // default 0. MultiWidth (e.g. Tab), if token starts in the middle of char
function HasValue: boolean; inline;
function Init(APhys, ALog: Integer; AnOffs: Integer = 0): boolean; inline;
procedure Init(APhys, ALog: Integer; AnOffs: Integer = 0); inline;
end;
@ -244,7 +244,7 @@ type
property Caption: PString read FCaption; // will never be nil
property StoredName: string read FStoredName write FStoredName; // name for storage (e.g. xml)
published
public
property Foreground stored GetColorStored;
property Background stored GetColorStored;
property FrameColor stored GetColorStored;
@ -292,7 +292,7 @@ type
function IsEnabled: boolean; override;
procedure InternalSaveDefaultValues; override;
published
public
property BackAlpha stored GetAlphaStored;
property ForeAlpha stored GetAlphaStored;
property FrameAlpha stored GetAlphaStored;
@ -360,7 +360,7 @@ begin
Result := (Physical > 0) or (Logical > 0);
end;
function TLazEditDisplayTokenBound.Init(APhys, ALog: Integer; AnOffs: Integer): boolean;
procedure TLazEditDisplayTokenBound.Init(APhys, ALog: Integer; AnOffs: Integer);
begin
Physical := APhys;
Logical := ALog;

View File

@ -1039,10 +1039,10 @@ type
const AChar: TUTF8Char; Data: pointer); virtual;
function GetHighlighterAttriAtRowCol(XY: TPoint; out Token: string;
out Attri: TSynHighlighterAttributes): boolean;
out Attri: TLazEditTextAttribute): boolean;
function GetHighlighterAttriAtRowColEx(XY: TPoint; out Token: string;
out TokenType, Start: Integer;
out Attri: TSynHighlighterAttributes;
out Attri: TLazEditTextAttribute;
ContinueIfPossible: boolean = False): boolean;
function GetHighlighterAttriAtRowColEx(XY: TPoint; out TokenType: Integer; ContinueIfPossible: boolean = False): boolean;
procedure CaretAtIdentOrString(XY: TPoint; out AtIdent, NearString: Boolean);
@ -10032,7 +10032,7 @@ var
// for ContextMatch
BracketKind, TmpStart: Integer;
SearchingForward: Boolean;
TmpAttr : TSynHighlighterAttributes;
TmpAttr : TLazEditTextAttribute;
// for IsContextBracket
MaxKnownTokenPos, LastUsedTokenIdx, TokenListCnt: Integer;
TokenPosList: Array of TokenPos;
@ -10308,7 +10308,7 @@ end;
//L505 begin
function TCustomSynEdit.GetHighlighterAttriAtRowCol(XY: TPoint;
out Token: string; out Attri: TSynHighlighterAttributes): boolean;
out Token: string; out Attri: TLazEditTextAttribute): boolean;
var
TmpType, TmpStart: Integer;
begin
@ -10316,7 +10316,7 @@ begin
end;
function TCustomSynEdit.GetHighlighterAttriAtRowColEx(XY: TPoint; out Token: string; out
TokenType, Start: Integer; out Attri: TSynHighlighterAttributes; ContinueIfPossible: boolean
TokenType, Start: Integer; out Attri: TLazEditTextAttribute; ContinueIfPossible: boolean
): boolean;
var
PosX, PosY: integer;
@ -10393,7 +10393,7 @@ procedure TCustomSynEdit.CaretAtIdentOrString(XY: TPoint; out AtIdent, NearStrin
var
PosX, PosY, Start: integer;
Line, Token: string;
Attri, PrevAttri: TSynHighlighterAttributes;
Attri, PrevAttri: TLazEditTextAttribute;
begin
PosY := XY.Y -1;
PrevAttri := nil;

View File

@ -71,8 +71,58 @@ type
end;
TLazSynCustomTextAttributes = TLazEditTextAttribute deprecated 'use TLazEditTextAttribute // to be removed in 5.99';
TSynHighlighterAttributes = TLazEditTextAttribute;
TSynHighlighterAttributesModifier = TLazEditTextAttributeModifier;
TSynHighlighterAttributes = class(TLazEditTextAttribute)
published
property Foreground;
property Background;
property FrameColor;
property ForePriority;
property BackPriority;
property FramePriority;
property FrameStyle;
property FrameEdges;
property Style;
property BoldPriority;
property ItalicPriority;
property UnderlinePriority;
property StrikeOutPriority;
property Features;
property OnChange;
end;
TSynHighlighterAttributesModifier = class(TLazEditTextAttributeModifier)
published
property Foreground;
property Background;
property FrameColor;
property ForePriority;
property BackPriority;
property FramePriority;
property FrameStyle;
property FrameEdges;
property Style;
property BoldPriority;
property ItalicPriority;
property UnderlinePriority;
property StrikeOutPriority;
property Features;
property OnChange;
published
property BackAlpha;
property ForeAlpha;
property FrameAlpha;
property StyleMask;
end;
{ TSynHighlighterAttributesHelper }
@ -200,11 +250,11 @@ type
fUpdateChange: boolean; //mh 2001-09-13
FIsInNextToEOL: Boolean;
function GetInstanceLanguageName: string; virtual;
procedure AddAttribute(AAttrib: TSynHighlighterAttributes); override;
procedure AddAttribute(AAttrib: TLazEditTextAttribute); override;
procedure RemoveAttribute(AAttrib: TLazEditTextAttribute); override;
procedure FreeHighlighterAttributes; //mh 2001-09-13
function GetAttribCount: integer; virtual;
function GetAttribute(idx: integer): TSynHighlighterAttributes; virtual;
function GetAttribute(idx: integer): TLazEditTextAttribute; virtual;
function GetDefaultAttribute(Index: integer): TSynHighlighterAttributes;
virtual; abstract;
function GetDefaultFilter: string; virtual;
@ -242,9 +292,9 @@ type
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
function AddSpecialAttribute(const aCaption: string;
const aStoredName: String = ''): TSynHighlighterAttributes;
const aStoredName: String = ''): TLazEditTextAttribute;
function AddSpecialAttribute(const aCaption: PString;
const aStoredName: String = ''): TSynHighlighterAttributes;
const aStoredName: String = ''): TLazEditTextAttribute;
procedure Assign(Source: TPersistent); override;
procedure BeginUpdate;
procedure EndUpdate;
@ -260,9 +310,9 @@ type
* GetTokenAttributeEx / GetEndOfLineAttributeEx
The final attribute with merged modifiers (if HL has modifiers)
*)
function GetEndOfLineAttribute: TSynHighlighterAttributes; virtual; // valid after line was scanned to EOL
function GetEndOfLineAttribute: TLazEditTextAttribute; virtual; // valid after line was scanned to EOL
function GetEndOfLineAttributeEx: TLazCustomEditTextAttribute; virtual; // valid after line was scanned to EOL
function GetTokenAttribute: TSynHighlighterAttributes; virtual; abstract;
function GetTokenAttribute: TLazEditTextAttribute; virtual; abstract;
function GetTokenAttributeEx: TLazCustomEditTextAttribute; virtual;
function GetTokenKind: integer; virtual; abstract;
function GetTokenPos: Integer; virtual; abstract; // 0-based
@ -310,7 +360,7 @@ type
property LanguageName: string read GetInstanceLanguageName;
public
property AttrCount: integer read GetAttribCount;
property Attribute[idx: integer]: TSynHighlighterAttributes read GetAttribute;
property Attribute[idx: integer]: TLazEditTextAttribute read GetAttribute;
property Capabilities: TSynHighlighterCapabilities read FCapabilities;
property SampleSource: string read GetSampleSource write SetSampleSource;
// The below should be depricated and moved to those HL that actually implement them.
@ -797,7 +847,7 @@ var
begin
if fAttributes <> nil then begin
for i := fAttributes.Count - 1 downto 0 do
TSynHighlighterAttributes(fAttributes[i]).Free;
TLazEditTextAttribute(fAttributes[i]).Free;
fAttributes.Clear;
end;
end;
@ -806,7 +856,7 @@ procedure TSynCustomHighlighter.Assign(Source: TPersistent);
var
Src: TSynCustomHighlighter;
i, j: integer;
SrcAttri: TSynHighlighterAttributes;
SrcAttri: TLazEditTextAttribute;
StoredName: String;
begin
if Source is TSynCustomHighlighter then begin
@ -918,7 +968,7 @@ begin
end;
end;
procedure TSynCustomHighlighter.AddAttribute(AAttrib: TSynHighlighterAttributes);
procedure TSynCustomHighlighter.AddAttribute(AAttrib: TLazEditTextAttribute);
begin
fAttributes.Add(AAttrib);
end;
@ -929,14 +979,14 @@ begin
end;
function TSynCustomHighlighter.AddSpecialAttribute(const aCaption: string;
const aStoredName: String): TSynHighlighterAttributes;
const aStoredName: String): TLazEditTextAttribute;
begin
result := TSynHighlighterAttributes.Create(aCaption,aStoredName);
AddAttribute(result);
end;
function TSynCustomHighlighter.AddSpecialAttribute(const aCaption: PString;
const aStoredName: String): TSynHighlighterAttributes;
const aStoredName: String): TLazEditTextAttribute;
begin
Result := TSynHighlighterAttributes.Create(aCaption,aStoredName);
AddAttribute(result);
@ -958,11 +1008,11 @@ begin
Result := fAttributes.Count;
end;
function TSynCustomHighlighter.GetAttribute(idx: integer): TSynHighlighterAttributes;
function TSynCustomHighlighter.GetAttribute(idx: integer): TLazEditTextAttribute;
begin
Result := nil;
if (idx >= 0) and (idx < fAttributes.Count) then
Result := TSynHighlighterAttributes(fAttributes[idx]);
Result := TLazEditTextAttribute(fAttributes[idx]);
end;
class function TSynCustomHighlighter.GetCapabilities: TSynHighlighterCapabilities;
@ -980,7 +1030,7 @@ begin
Result := ['_', 'A'..'Z', 'a'..'z', '0'..'9'];
end;
function TSynCustomHighlighter.GetEndOfLineAttribute: TSynHighlighterAttributes;
function TSynCustomHighlighter.GetEndOfLineAttribute: TLazEditTextAttribute;
begin
Result := nil;
end;
@ -1099,10 +1149,10 @@ procedure TSynCustomHighlighter.SetAttributesOnChange(AEvent: TNotifyEvent);
after all Attributes where created *)
var
i: integer;
Attri: TSynHighlighterAttributes;
Attri: TLazEditTextAttribute;
begin
for i := fAttributes.Count - 1 downto 0 do begin
Attri := TSynHighlighterAttributes(fAttributes[i]);
Attri := TLazEditTextAttribute(fAttributes[i]);
if Attri <> nil then begin
Attri.OnChange := AEvent;
Attri.InternalSaveDefaultValues;

View File

@ -31,7 +31,7 @@ uses
// SynEdit
SynEditMiscClasses, SynHighlighterPas, SynEditMarkupHighAll,
SynEditHighlighterFoldBase, SynEditFoldedView, LazSynEditText, SynEditMiscProcs,
SynEditMarkup, SynEditPointClasses, SynEditHighlighter;
SynEditMarkup, SynEditPointClasses, SynEditHighlighter, LazEditTextAttributes;
type
@ -328,7 +328,7 @@ type
//TODO, move to highlighter
function GetHighlighterAttriAtRowColEx(XY: TPoint; out Token: string;
out TokenType, Start: Integer;
out Attri: TSynHighlighterAttributes): boolean; //L505
out Attri: TLazEditTextAttribute): boolean; //L505
procedure MaybeRequestNodeStates(var ANode: TSynMarkupHighIfDefLinesNodeInfo);
@ -2361,7 +2361,7 @@ begin
end;
function TSynMarkupHighIfDefLinesTree.GetHighlighterAttriAtRowColEx(XY: TPoint; out
Token: string; out TokenType, Start: Integer; out Attri: TSynHighlighterAttributes): boolean;
Token: string; out TokenType, Start: Integer; out Attri: TLazEditTextAttribute): boolean;
var
PosX, PosY: integer;
Line: string;
@ -2499,7 +2499,7 @@ var
var
len, i, c, tk, x: Integer;
dummy: String;
attr: TSynHighlighterAttributes;
attr: TLazEditTextAttribute;
r: TSynCustomHighlighterRange;
f: TRangeStates;
begin

View File

@ -58,7 +58,7 @@ interface
uses
SysUtils, Classes, LazUTF8, LazFileUtils, Controls, Graphics, Registry,
SynEditTypes, SynEditHighlighter, SynEditStrConst;
SynEditTypes, SynEditHighlighter, SynEditStrConst, LazEditTextAttributes;
type
TtkTokenKind = (tkComment, tkIdentifier, tkKey, tkNull, tkNumber,
@ -177,7 +177,7 @@ type
function GetTokenID: TtkTokenKind;
function GetToken: String; override;
procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override;
function GetTokenAttribute: TSynHighlighterAttributes; override;
function GetTokenAttribute: TLazEditTextAttribute; override;
function GetTokenKind: integer; override;
function GetTokenPos: Integer; override;
function IsKeyword(const AKeyword: string): boolean; override; //mh 2000-11-08
@ -819,7 +819,7 @@ begin
Result := fTokenId;
end;
function TSynAnySyn.GetTokenAttribute: TSynHighlighterAttributes;
function TSynAnySyn.GetTokenAttribute: TLazEditTextAttribute;
begin
case fTokenID of
tkComment: Result := fCommentAttri;
@ -851,7 +851,7 @@ begin
Result := fTokenPos;
end;
procedure TSynAnySyn.ReSetRange;
procedure TSynAnySyn.ResetRange;
begin
fRange := rsUnknown;
end;

View File

@ -51,7 +51,7 @@ interface
uses
Classes,
Graphics,
SynEditTypes, SynEditHighlighter, SynEditStrConst;
SynEditTypes, SynEditHighlighter, SynEditStrConst, LazEditTextAttributes;
type
TtkTokenKind = (tkComment, tkIdentifier, tkKey, tkNull, tkNumber, tkSpace,
@ -135,7 +135,7 @@ type
procedure SetLine(const NewValue: String; LineNumber: Integer); override;
function GetToken: String; override;
procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override;
function GetTokenAttribute: TSynHighlighterAttributes; override;
function GetTokenAttribute: TLazEditTextAttribute; override;
function GetTokenKind: integer; override;
function GetTokenPos: Integer; override;
procedure Next; override;
@ -557,7 +557,7 @@ begin
TokenStart := FLine + fTokenPos;
end;
function TSynBatSyn.GetTokenAttribute: TSynHighlighterAttributes;
function TSynBatSyn.GetTokenAttribute: TLazEditTextAttribute;
begin
case fTokenID of
tkComment: Result := fCommentAttri;

View File

@ -53,7 +53,7 @@ uses
SysUtils,
LCLIntf,
Classes, Registry, Controls, Graphics,
SynEditTypes, SynEditHighlighter, SynEditStrConst;
SynEditTypes, SynEditHighlighter, SynEditStrConst, LazEditTextAttributes;
type
TtkTokenKind = (tkAsm, tkComment, tkDirective, tkIdentifier, tkKey, tkNull,
@ -236,7 +236,7 @@ type
procedure SetLine(const NewValue: String; LineNumber:Integer); override;
function GetToken: String; override;
procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override;
function GetTokenAttribute: TSynHighlighterAttributes; override;
function GetTokenAttribute: TLazEditTextAttribute; override;
function GetTokenKind: integer; override;
function GetTokenPos: Integer; override;
procedure Next; override;
@ -1508,7 +1508,7 @@ begin
Result := FExtTokenID;
end;
function TSynCppSyn.GetTokenAttribute: TSynHighlighterAttributes;
function TSynCppSyn.GetTokenAttribute: TLazEditTextAttribute;
begin
case fTokenID of
tkAsm: Result := fAsmAttri;
@ -1535,7 +1535,7 @@ begin
Result := fTokenPos;
end;
procedure TSynCppSyn.ReSetRange;
procedure TSynCppSyn.ResetRange;
begin
fRange:= rsUnknown;
end;

View File

@ -53,7 +53,7 @@ uses
SysUtils, Classes,
LCLIntf, LCLType,
Controls, Graphics,
SynEditTypes, SynEditHighlighter, SynEditStrConst;
SynEditTypes, SynEditHighlighter, SynEditStrConst, LazEditTextAttributes;
type
TtkTokenKind = (tkComment, tkIdentifier, tkKey, tkNull, tkNumber, tkSpace,
@ -283,7 +283,7 @@ type
procedure SetLine(const NewValue: String; LineNumber: Integer); override;
function GetToken: string; override;
procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override;
function GetTokenAttribute: TSynHighlighterAttributes; override;
function GetTokenAttribute: TLazEditTextAttribute; override;
function GetTokenKind: integer; override;
function GetTokenPos: Integer; override;
procedure Next; override;
@ -2103,7 +2103,7 @@ begin
Result := FTokenId;
end;
function TSynCssSyn.GetTokenAttribute: TSynHighlighterAttributes;
function TSynCssSyn.GetTokenAttribute: TLazEditTextAttribute;
begin
case GetTokenID of
tkComment : Result := FCommentAttri;

View File

@ -35,7 +35,7 @@ interface
uses
Classes, Graphics, math, SynEditStrConst,
SynEditHighlighter, SynEditHighlighterFoldBase;
SynEditHighlighter, SynEditHighlighterFoldBase, LazEditTextAttributes;
type
TtkTokenKind = (tkNull, tkUnknown, tkSpace,
@ -130,7 +130,7 @@ type
function GetToken: String; override;
procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override;
function GetTokenAttribute: TSynHighlighterAttributes; override;
function GetTokenAttribute: TLazEditTextAttribute; override;
function GetTokenKind: integer; override;
function GetTokenPos: Integer; override;
function GetTokenID: TtkTokenKind;
@ -556,7 +556,7 @@ begin
TokenStart:=FLine + fTokenPos;
end;
function TSynDiffSyn.GetTokenAttribute: TSynHighlighterAttributes;
function TSynDiffSyn.GetTokenAttribute: TLazEditTextAttribute;
begin
case fTokenID of
tkNull: Result := FUnknownAttri;

View File

@ -49,7 +49,7 @@ interface
uses
SysUtils, Classes, Math, Graphics, SynEditTypes, SynEditHighlighter,
SynEditHighlighterXMLBase, SynEditHighlighterFoldBase, SynEditStrConst;
SynEditHighlighterXMLBase, SynEditHighlighterFoldBase, SynEditStrConst, LazEditTextAttributes;
const
MAX_ESCAPEAMPS = 159;
@ -478,7 +478,7 @@ type
procedure SetLine(const NewValue: string; LineNumber:Integer); override;
function GetToken: string; override;
procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override;
function GetTokenAttribute: TSynHighlighterAttributes; override;
function GetTokenAttribute: TLazEditTextAttribute; override;
function GetTokenKind: integer; override;
function GetTokenPos: Integer; override;
procedure Next; override;
@ -2708,7 +2708,7 @@ begin
Result := fTokenId;
end;
function TSynHTMLSyn.GetTokenAttribute: TSynHighlighterAttributes;
function TSynHTMLSyn.GetTokenAttribute: TLazEditTextAttribute;
begin
case fTokenID of
tkAmpersand: Result := fAndAttri;

View File

@ -51,7 +51,7 @@ interface
uses
Classes,
Graphics,
SynEditTypes, SynEditHighlighter, SynEditStrConst;
SynEditTypes, SynEditHighlighter, SynEditStrConst, LazEditTextAttributes;
type
TtkTokenKind = (tkComment, tkText, tkSection, tkKey, tkNull, tkNumber,
@ -104,14 +104,14 @@ type
class function GetLanguageName: string; override;
public
constructor Create(AOwner: TComponent); override;
function GetDefaultAttribute(Index: integer): TSynHighlighterAttributes;
function GetDefaultAttribute(Index: integer): TSynHighlighterAttributes;
override;
function GetEol: Boolean; override;
function GetTokenID: TtkTokenKind;
procedure SetLine(const NewValue: String; LineNumber:Integer); override;
function GetToken: String; override;
procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override;
function GetTokenAttribute: TSynHighlighterAttributes; override;
function GetTokenAttribute: TLazEditTextAttribute; override;
function GetTokenKind: integer; override;
function GetTokenPos: Integer; override;
procedure Next; override;
@ -406,7 +406,7 @@ begin
Result := fTokenId;
end;
function TSynIniSyn.GetTokenAttribute: TSynHighlighterAttributes;
function TSynIniSyn.GetTokenAttribute: TLazEditTextAttribute;
begin
case fTokenID of
tkComment: Result := fCommentAttri;

View File

@ -50,7 +50,7 @@ interface
uses
SysUtils, Classes,
LCLIntf, LCLType, Graphics,
SynEditTypes, SynEditHighlighter, SynEditStrConst;
SynEditTypes, SynEditHighlighter, SynEditStrConst, LazEditTextAttributes;
type
TtkTokenKind = (tkComment, tkDocument, tkIdentifier, tkInvalid, tkKey,
@ -195,7 +195,7 @@ type
class function GetLanguageName: string; override;
public
constructor Create(AOwner: TComponent); override;
function GetDefaultAttribute(Index: integer): TSynHighlighterAttributes;
function GetDefaultAttribute(Index: integer): TSynHighlighterAttributes;
override;
function GetEol: Boolean; override;
function GetRange: Pointer; override;
@ -204,7 +204,7 @@ type
LineNumber:Integer); override;
function GetToken: String; override;
procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override;
function GetTokenAttribute: TSynHighlighterAttributes; override;
function GetTokenAttribute: TLazEditTextAttribute; override;
function GetTokenKind: integer; override;
function GetTokenPos: Integer; override;
procedure Next; override;
@ -1301,7 +1301,7 @@ begin
Result := Pointer(PtrInt(fRange));
end;
procedure TSynJavaSyn.ReSetRange;
procedure TSynJavaSyn.ResetRange;
begin
fRange := rsUnknown;
end;
@ -1339,7 +1339,7 @@ begin
Result := xtkNonSymbol;
end;
function TSynJavaSyn.GetTokenAttribute: TSynHighlighterAttributes;
function TSynJavaSyn.GetTokenAttribute: TLazEditTextAttribute;
begin
case fTokenID of
tkAnnotation: Result := fAnnotationAttri;

View File

@ -55,7 +55,7 @@ uses
Graphics,
SynEditTypes,
SynEditHighlighter, SynEditHighlighterFoldBase,
SysUtils, Classes, SynEditStrConst;
SysUtils, Classes, SynEditStrConst, LazEditTextAttributes;
type
TtkTokenKind = (tkComment, tkIdentifier, tkKey, tkNull, tkNumber, tkSpace,
@ -287,7 +287,7 @@ type
procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override;
procedure SetLine(const NewValue: String; LineNumber: Integer); override;
function GetToken: String; override;
function GetTokenAttribute: TSynHighlighterAttributes; override;
function GetTokenAttribute: TLazEditTextAttribute; override;
function GetTokenKind: integer; override;
function GetTokenPos: Integer; override;
procedure Next; override;
@ -1845,7 +1845,7 @@ begin
TokenStart:=FLine + fTokenPos;
end;
function TSynJScriptSyn.GetTokenAttribute: TSynHighlighterAttributes;
function TSynJScriptSyn.GetTokenAttribute: TLazEditTextAttribute;
begin
case GetTokenID of
tkComment: Result := fCommentAttri;

View File

@ -49,8 +49,8 @@ unit SynHighlighterLFM;
interface
uses
SysUtils, Classes, FileUtil, Graphics,
SynEditTypes, SynEditHighlighter, SynEditHighlighterFoldBase, SynEditStrConst;
SysUtils, Classes, FileUtil, Graphics, SynEditTypes, SynEditHighlighter,
SynEditHighlighterFoldBase, SynEditStrConst, LazEditTextAttributes;
type
TtkTokenKind = (tkComment, tkIdentifier, tkKey, tkNull, tkNumber, tkSpace,
@ -140,7 +140,7 @@ type
LineNumber: Integer); override;
function GetToken: String; override;
procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override;
function GetTokenAttribute: TSynHighlighterAttributes; override;
function GetTokenAttribute: TLazEditTextAttribute; override;
function GetTokenKind: integer; override;
function GetTokenPos: Integer; override;
procedure Next; override;
@ -564,7 +564,7 @@ begin
TokenStart:=FLine + fTokenPos;
end;
function TSynLFMSyn.GetTokenAttribute: TSynHighlighterAttributes;
function TSynLFMSyn.GetTokenAttribute: TLazEditTextAttribute;
begin
case fTokenID of
tkComment: Result := fCommentAttri;

View File

@ -288,7 +288,7 @@ type
FCurLineIndex, FLineLen: Integer;
FTokenPos: integer;
FTokenKind: integer;
FTokenAttr: TSynHighlighterAttributes;
FTokenAttr: TLazEditTextAttribute;
FTokenAttrEx: TLazCustomEditTextAttribute;
FRun: Integer;
FRunSectionInfo: Array of TRunSectionInfo;
@ -296,7 +296,7 @@ type
function GetIdentChars: TSynIdentChars; override;
function GetDefaultAttribute(Index: integer): TSynHighlighterAttributes; override;
function GetAttribCount: integer; override;
function GetAttribute(idx: integer): TSynHighlighterAttributes; override;
function GetAttribute(idx: integer): TLazEditTextAttribute; override;
function GetSampleSource: string; override;
procedure SetSampleSource(Value: string); override;
@ -322,7 +322,7 @@ type
function GetEol: Boolean; override;
function GetToken: string; override;
procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override;
function GetTokenAttribute: TSynHighlighterAttributes; override;
function GetTokenAttribute: TLazEditTextAttribute; override;
function GetTokenAttributeEx: TLazCustomEditTextAttribute; override;
function GetTokenKind: integer; override;
function GetTokenPos: Integer; override; // 0-based
@ -1267,8 +1267,7 @@ begin
Inc(Result, DefaultHighlighter.AttrCount);
end;
function TSynMultiSyn.GetAttribute(
idx: integer): TSynHighlighterAttributes;
function TSynMultiSyn.GetAttribute(idx: integer): TLazEditTextAttribute;
var
i, j: Integer;
begin
@ -1353,7 +1352,7 @@ begin
end;
end;
function TSynMultiSyn.GetTokenAttribute: TSynHighlighterAttributes;
function TSynMultiSyn.GetTokenAttribute: TLazEditTextAttribute;
begin
Result := FTokenAttr;
end;

View File

@ -969,7 +969,7 @@ type
function GetRange: Pointer; override;
function GetToken: string; override;
procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override;
function GetTokenAttribute: TSynHighlighterAttributes; override;
function GetTokenAttribute: TLazEditTextAttribute; override;
function GetTokenAttributeEx: TLazCustomEditTextAttribute; override;
function GetTokenID: TtkTokenKind;
function GetTokenKind: integer; override;
@ -5533,8 +5533,7 @@ begin
FIsInNextToEOL := True;
end;
function TSynPasSyn.GetDefaultAttribute(Index: integer):
TSynHighlighterAttributes;
function TSynPasSyn.GetDefaultAttribute(Index: integer): TSynHighlighterAttributes;
begin
case Index of
SYN_ATTR_COMMENT: Result := fCommentAttri;
@ -5581,7 +5580,7 @@ begin
end;
function TSynPasSyn.GetTokenAttribute: TSynHighlighterAttributes;
function TSynPasSyn.GetTokenAttribute: TLazEditTextAttribute;
var
x1, x2: Integer;
begin
@ -5621,7 +5620,7 @@ var
tid: TtkTokenKind;
i, x1, x2: Integer;
LeftCol, RightCol: TLazSynDisplayTokenBound;
attr: TSynHighlighterAttributesModifier;
attr: TLazEditTextAttributeModifier;
procedure InitMergeRes(AMergeRes: TSynSelectedColorMergeResult; AnAttr: TLazCustomEditTextAttribute);
begin

View File

@ -54,7 +54,7 @@ uses
SysUtils, Classes,
LCLIntf, LCLType,
Controls, Graphics,
SynEditTypes, SynEditHighlighter, SynEditStrConst;
SynEditTypes, SynEditHighlighter, SynEditStrConst, LazEditTextAttributes;
type
TtkTokenKind = (tkComment, tkIdentifier, tkKey, tkNull, tkNumber, tkOperator,
@ -366,7 +366,7 @@ type
LineNumber:Integer); override;
function GetToken: String; override;
procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override;
function GetTokenAttribute: TSynHighlighterAttributes; override;
function GetTokenAttribute: TLazEditTextAttribute; override;
function GetTokenKind: integer; override;
function GetTokenPos: Integer; override;
procedure Next; override;
@ -2553,7 +2553,7 @@ begin
Result := fTokenId;
end;
function TSynPerlSyn.GetTokenAttribute: TSynHighlighterAttributes;
function TSynPerlSyn.GetTokenAttribute: TLazEditTextAttribute;
begin
case fTokenID of
tkComment: Result := fCommentAttri;

View File

@ -52,7 +52,7 @@ uses
SysUtils, Classes,
LCLIntf, LCLType,
Controls, Graphics,
SynEditTypes, SynEditHighlighter, SynEditStrConst;
SynEditTypes, SynEditHighlighter, SynEditStrConst, LazEditTextAttributes;
type
TtkTokenKind = (tkComment, tkIdentifier, tkInvalidSymbol, tkKey, tkNull,
@ -195,7 +195,7 @@ type
function GetToken: String; override;
procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override;
function GetTokenAttribute: TSynHighlighterAttributes; override;
function GetTokenAttribute: TLazEditTextAttribute; override;
function GetTokenKind: integer; override;
function GetTokenPos: Integer; override;
procedure Next; override;
@ -1355,7 +1355,7 @@ begin
Result := fTokenId;
end;
function TSynPHPSyn.GetTokenAttribute: TSynHighlighterAttributes;
function TSynPHPSyn.GetTokenAttribute: TLazEditTextAttribute;
begin
case GetTokenID of
tkComment: Result := fCommentAttri;

View File

@ -35,7 +35,7 @@ interface
uses
Classes, SysUtils,
Graphics,
SynEditTypes, SynEditHighlighter, SynEditStrConst;
SynEditTypes, SynEditHighlighter, SynEditStrConst, LazEditTextAttributes;
type
TtkTokenKind = (tkComment, tkText, tkKey, tkNull, tkSpace, tkString,
@ -89,7 +89,7 @@ type
procedure SetLine(const NewValue: String; LineNumber:Integer); override;
function GetToken: String; override;
procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override;
function GetTokenAttribute: TSynHighlighterAttributes; override;
function GetTokenAttribute: TLazEditTextAttribute; override;
function GetTokenKind: integer; override;
function GetTokenPos: Integer; override;
procedure Next; override;
@ -339,7 +339,7 @@ begin
Result := fTokenId;
end;
function TSynPoSyn.GetTokenAttribute: TSynHighlighterAttributes;
function TSynPoSyn.GetTokenAttribute: TLazEditTextAttribute;
begin
case fTokenID of
tkComment: Result := fCommentAttri;

View File

@ -30,7 +30,7 @@ interface
uses
Classes, SysUtils, Graphics, SynEditStrConst, SynEditTypes,
SynEditHighlighter;
SynEditHighlighter, LazEditTextAttributes;
const
tkNone = 0;
@ -84,7 +84,7 @@ type
function GetRange: Pointer; override;
function GetToken: string; override;
procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override;
function GetTokenAttribute: TSynHighlighterAttributes; override;
function GetTokenAttribute: TLazEditTextAttribute; override;
function GetTokenKind: integer; override;
function GetTokenPos: Integer; override;
procedure Next; override;
@ -109,8 +109,8 @@ type
);
function CreateTokenID(const aName: string; Foreground, BackGround: TColor;
Style: TFontStyles): TtkTokenKind;
function GetCopiedTokenID(Attr: TSynHighlighterAttributes): TtkTokenKind;
function GetCopiedAttribute(TokenID: TtkTokenKind): TSynHighlighterAttributes;
function GetCopiedTokenID(Attr: TLazEditTextAttribute): TtkTokenKind;
function GetCopiedAttribute(TokenID: TtkTokenKind): TLazEditTextAttribute;
property Tokens[TheLineNumber: integer]: PPositionTokens read GetTokens;
published
property TextAttri: TSynHighlighterAttributes read fTextAttri write fTextAttri;
@ -203,7 +203,7 @@ begin
end;
end;
function TSynPositionHighlighter.GetTokenAttribute: TSynHighlighterAttributes;
function TSynPositionHighlighter.GetTokenAttribute: TLazEditTextAttribute;
var
t: TtkTokenKind;
begin
@ -368,7 +368,7 @@ var
RelLine: integer;
nTokenLen: integer;
sToken: PChar;
Attr: TSynHighlighterAttributes;
Attr: TLazEditTextAttribute;
TokenID: integer;
begin
if (Lines=nil) or (Lines.Count=0) or (Highlighter=nil) then exit;
@ -395,9 +395,9 @@ function TSynPositionHighlighter.CreateTokenID(const aName: string;
Foreground, BackGround: TColor;
Style: TFontStyles): TtkTokenKind;
var
Attr: TSynHighlighterAttributes;
Attr: TLazEditTextAttribute;
begin
Attr:=TSynHighlighterAttributes.Create(aName);
Attr:=TLazEditTextAttribute.Create(aName);
Attr.Foreground:=Foreground;
Attr.Background:=BackGround;
Attr.Style:=Style;
@ -405,15 +405,14 @@ begin
Attr.Free;
end;
function TSynPositionHighlighter.GetCopiedTokenID(
Attr: TSynHighlighterAttributes): TtkTokenKind;
function TSynPositionHighlighter.GetCopiedTokenID(Attr: TLazEditTextAttribute): TtkTokenKind;
var
i: Integer;
CurAttr: TSynHighlighterAttributes;
CurAttr: TLazEditTextAttribute;
begin
i:=fCopiedAttributes.Count-1;
while i>=0 do begin
CurAttr:=TSynHighlighterAttributes(fCopiedAttributes[i]);
CurAttr:=TLazEditTextAttribute(fCopiedAttributes[i]);
if (Attr.ForeGround=CurAttr.ForeGround)
and (Attr.BackGround=CurAttr.BackGround)
and (Attr.Style=CurAttr.Style) then begin
@ -424,17 +423,16 @@ begin
dec(i);
end;
// create new attribute
CurAttr:=TSynHighlighterAttributes.Create(nil);
CurAttr:=TLazEditTextAttribute.Create(nil);
CurAttr.Assign(Attr);
fCopiedAttributes.Add(CurAttr);
Result:= -fCopiedAttributes.Count;
end;
function TSynPositionHighlighter.GetCopiedAttribute(TokenID: TtkTokenKind
): TSynHighlighterAttributes;
function TSynPositionHighlighter.GetCopiedAttribute(TokenID: TtkTokenKind): TLazEditTextAttribute;
begin
if (TokenID<0) and (fCopiedAttributes.Count>=-TokenID) then
Result:=TSynHighlighterAttributes(fCopiedAttributes[-TokenID-1])
Result:=TLazEditTextAttribute(fCopiedAttributes[-TokenID-1])
else
Result:=nil;
end;

View File

@ -51,7 +51,7 @@ interface
uses
IniFiles, //THashedStringList
LCLIntf, LCLType,
SynEditHighlighter, SynEditTypes, SynEditStrConst,
SynEditHighlighter, SynEditTypes, SynEditStrConst, LazEditTextAttributes,
Graphics, SysUtils, Classes;
const
@ -139,7 +139,7 @@ type
LineNumber: Integer); override;
function GetKeywordIdentifiers: TStringList; virtual;
function GetToken: string; override;
function GetTokenAttribute: TSynHighlighterAttributes; override;
function GetTokenAttribute: TLazEditTextAttribute; override;
function GetTokenKind: integer; override;
function GetTokenPos: Integer; override;
procedure Next; override;
@ -1177,7 +1177,7 @@ begin
Result := fTokenId;
end;
function TSynPythonSyn.GetTokenAttribute: TSynHighlighterAttributes;
function TSynPythonSyn.GetTokenAttribute: TLazEditTextAttribute;
begin
case fTokenID of
tkComment: Result := fCommentAttri;

View File

@ -56,7 +56,7 @@ uses
LCLIntf, LCLType,
Controls, Graphics,
SynEditTypes, SynEditHighlighter, SynEditStrConst,
SynHighlighterHashEntries;
SynHighlighterHashEntries, LazEditTextAttributes;
type
TtkTokenKind = (tkComment, tkDatatype, tkDefaultPackage, tkException, // DJLP 2000-08-11
@ -157,7 +157,7 @@ type
function GetToken: string; override;
procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override;
function GetTokenAttribute: TSynHighlighterAttributes; override;
function GetTokenAttribute: TLazEditTextAttribute; override;
function GetTokenID: TtkTokenKind;
function GetTokenKind: integer; override;
function GetTokenPos: Integer; override;
@ -1872,7 +1872,7 @@ begin
Result := fTokenId;
end;
function TSynSQLSyn.GetTokenAttribute: TSynHighlighterAttributes;
function TSynSQLSyn.GetTokenAttribute: TLazEditTextAttribute;
begin
case GetTokenID of
tkComment: Result := fCommentAttri;

View File

@ -44,7 +44,7 @@ uses
SysUtils, Classes,
LCLIntf, LCLType, LazUTF8,
Controls, Graphics,
SynEditTypes, SynEditHighlighter, SynEditStrConst;
SynEditTypes, SynEditHighlighter, SynEditStrConst, LazEditTextAttributes;
type
TtkTokenKind = (tkBrace, tkBracket, tkNull, tkSpace, tkText, tkComment,
@ -103,7 +103,7 @@ type
function GetToken: String; override;
procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override;
function GetTokenAttribute: TSynHighlighterAttributes; override;
function GetTokenAttribute: TLazEditTextAttribute; override;
function GetTokenKind: integer; override;
function GetTokenPos: Integer; override;
procedure Next; override;
@ -259,7 +259,7 @@ begin
Exit;
end; { CommentProc }
procedure TSynTeXSyn.MathModeProc;
procedure TSynTeXSyn.MathmodeProc;
begin
fTokenID:=tkMathMode;
Inc(Run);
@ -326,7 +326,7 @@ begin
Result := fTokenId;
end; { GetTokenID }
function TSynTeXSyn.GetTokenAttribute: TSynHighlighterAttributes;
function TSynTeXSyn.GetTokenAttribute: TLazEditTextAttribute;
begin
case fTokenID of
tkComment : Result := fCommentAttri;

View File

@ -60,7 +60,7 @@ uses
SynEditHighlighter,
SysUtils,
Classes,
SynEditStrConst;
SynEditStrConst, LazEditTextAttributes;
type
TtkTokenKind = (tkComment, tkIdentifier, tkKey, tkNull, tkNumber, tkSecondKey,
@ -137,7 +137,7 @@ type
function IsSecondKeyWord(aToken: string): Boolean;
function GetToken: string; override;
procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override; /////TL: Added 2003-06-11
function GetTokenAttribute: TSynHighlighterAttributes; override;
function GetTokenAttribute: TLazEditTextAttribute; override;
function GetTokenKind: integer; override;
function GetTokenPos: Integer; override;
procedure Next; override;
@ -753,7 +753,7 @@ begin
Result := fTokenId;
end;
function TSynUNIXShellScriptSyn.GetTokenAttribute: TSynHighlighterAttributes;
function TSynUNIXShellScriptSyn.GetTokenAttribute: TLazEditTextAttribute;
begin
case fTokenID of
tkComment: Result := fCommentAttri;

View File

@ -52,7 +52,7 @@ uses
SysUtils, Classes,
LCLIntf, LCLType,
Controls, Graphics,
SynEditTypes, SynEditHighlighter, SynEditStrConst;
SynEditTypes, SynEditHighlighter, SynEditStrConst, LazEditTextAttributes;
type
TtkTokenKind = (tkComment, tkIdentifier, tkKey, tkNull, tkNumber, tkSpace,
@ -204,7 +204,7 @@ type
procedure SetLine(const NewValue: String; LineNumber: Integer); override;
function GetToken: String; override;
procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override;
function GetTokenAttribute: TSynHighlighterAttributes; override;
function GetTokenAttribute: TLazEditTextAttribute; override;
function GetTokenKind: integer; override;
function GetTokenPos: Integer; override;
procedure Next; override;
@ -1207,7 +1207,7 @@ begin
Result := fTokenId;
end;
function TSynVBSyn.GetTokenAttribute: TSynHighlighterAttributes;
function TSynVBSyn.GetTokenAttribute: TLazEditTextAttribute;
begin
case GetTokenID of
tkComment: Result := fCommentAttri;

View File

@ -213,7 +213,7 @@ type
procedure SetLine(const NewValue: string; LineNumber:Integer); override;
function GetToken: string; override;
procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override;
function GetTokenAttribute: TSynHighlighterAttributes; override;
function GetTokenAttribute: TLazEditTextAttribute; override;
function GetTokenAttributeEx: TLazCustomEditTextAttribute; override;
function GetTokenKind: integer; override;
function GetTokenPos: Integer; override;
@ -973,7 +973,7 @@ begin
Result := fTokenId;
end;
function TSynXMLSyn.GetTokenAttribute: TSynHighlighterAttributes;
function TSynXMLSyn.GetTokenAttribute: TLazEditTextAttribute;
begin
case fTokenID of
tkElement: Result:= fElementAttri;

View File

@ -11,7 +11,7 @@ uses
LazFileUtils,
Laz2_XMLRead, Laz2_DOM, LazStringUtils,
// LazEdit
TextMateGrammar,
TextMateGrammar, LazEditTextAttributes,
// SynEdit
SynEditHighlighter, SynEditHighlighterFoldBase, SynEditTypes, SynEditTextBase;
@ -60,7 +60,7 @@ type
FRangeInfo: TSynTextMateRangeInfo;
FCurrentTokenPos, FCurrentTokenLen: Integer;
FCurrentTokenKind: integer;
FCurrentAttrib: TSynHighlighterAttributes;
FCurrentAttrib: TLazEditTextAttribute;
function GetParserError: String;
protected
@ -82,7 +82,7 @@ type
procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override;
function GetTokenPos: Integer; override;
function GetTokenKind: integer; override;
function GetTokenAttribute: TSynHighlighterAttributes; override;
function GetTokenAttribute: TLazEditTextAttribute; override;
//
function GetDefaultAttribute(Index: integer): TSynHighlighterAttributes; override;
@ -214,7 +214,7 @@ procedure TSynTextMateSyn.DoCheckAttributeInfo(Sender: TTextMatePattern;
begin
AnUseId := AnAttribInfo.TokId >= 0;
AnUseObject := (AnAttribInfo.TokObject <> nil) and
(TSynHighlighterAttributes(AnAttribInfo.TokObject).IsEnabled);
(TLazEditTextAttribute(AnAttribInfo.TokObject).IsEnabled);
end;
function TSynTextMateSyn.GetParserError: String;
@ -306,7 +306,7 @@ begin
else begin
FTextMateGrammar.First;
FCurrentTokenKind := FTextMateGrammar.CurrentTokenKind;
FCurrentAttrib := TSynHighlighterAttributes(FTextMateGrammar.CurrentAttrib);
FCurrentAttrib := TLazEditTextAttribute(FTextMateGrammar.CurrentAttrib);
FCurrentTokenPos := FTextMateGrammar.CurrentTokenPos;
FCurrentTokenLen := FTextMateGrammar.CurrentTokenLen;
end;
@ -318,7 +318,7 @@ procedure TSynTextMateSyn.Next;
begin
FTextMateGrammar.Next;
FCurrentTokenKind := FTextMateGrammar.CurrentTokenKind;
FCurrentAttrib := TSynHighlighterAttributes(FTextMateGrammar.CurrentAttrib);
FCurrentAttrib := TLazEditTextAttribute(FTextMateGrammar.CurrentAttrib);
FCurrentTokenPos := FTextMateGrammar.CurrentTokenPos;
FCurrentTokenLen := FTextMateGrammar.CurrentTokenLen;
//FCurrentRange := FTextMateGrammar.CurrentPatternIndex;
@ -401,13 +401,12 @@ begin
Result := FCurrentTokenKind;
end;
function TSynTextMateSyn.GetTokenAttribute: TSynHighlighterAttributes;
function TSynTextMateSyn.GetTokenAttribute: TLazEditTextAttribute;
begin
Result := FCurrentAttrib;
end;
function TSynTextMateSyn.GetDefaultAttribute(Index: integer
): TSynHighlighterAttributes;
function TSynTextMateSyn.GetDefaultAttribute(Index: integer): TSynHighlighterAttributes;
begin
Result := FAttriMap.Data[FTextMateGrammar.RootPattern.AttribInfo.TokId];
end;

View File

@ -25,13 +25,13 @@ type
TExpTokenInfo = record
ExpKind: Integer;
ExpAttr: TSynHighlighterAttributes;
ExpAttr: TLazEditTextAttribute;
Flags: set of (etiKind, etiAttr);
end;
operator := (a: Integer) : TExpTokenInfo;
operator := (a: TSynHighlighterAttributes) : TExpTokenInfo;
operator + (a: Integer; b: TSynHighlighterAttributes) : TExpTokenInfo;
operator := (a: TLazEditTextAttribute) : TExpTokenInfo;
operator + (a: Integer; b: TLazEditTextAttribute) : TExpTokenInfo;
type
@ -68,14 +68,14 @@ begin
result.Flags := [etiKind];
end;
operator := (a: TSynHighlighterAttributes) : TExpTokenInfo;
operator := (a: TLazEditTextAttribute) : TExpTokenInfo;
begin
result := default(TExpTokenInfo);
result.ExpAttr := a;
result.Flags := [etiAttr];
end;
operator + (a: Integer; b: TSynHighlighterAttributes) : TExpTokenInfo;
operator + (a: Integer; b: TLazEditTextAttribute) : TExpTokenInfo;
begin
result := default(TExpTokenInfo);
result.ExpKind := a;
@ -103,9 +103,9 @@ begin
//DebugLn(['# ', i, ' ', FTheHighLighter.Attribute[i].StoredName]);
FTheHighLighter.Attribute[i].Foreground := 10000 + i; // unique foreground colors
FTheHighLighter.Attribute[i].Foreground := 10000 + i; // unique foreground colors
if FTheHighLighter.Attribute[i] is TSynHighlighterAttributesModifier then begin
TSynHighlighterAttributesModifier(FTheHighLighter.Attribute[i]).ForeAlpha := 0;
TSynHighlighterAttributesModifier(FTheHighLighter.Attribute[i]).ForePriority := 100+i;
if FTheHighLighter.Attribute[i] is TLazEditTextAttributeModifier then begin
TLazEditTextAttributeModifier(FTheHighLighter.Attribute[i]).ForeAlpha := 0;
TLazEditTextAttributeModifier(FTheHighLighter.Attribute[i]).ForePriority := 100+i;
end;
end;
end;

View File

@ -18,8 +18,8 @@ type
FMultiHl: TSynMultiSyn;
FXmlHl: TSynXMLSyn;
{FEmptyScheme, }FPasScheme: TSynHighlighterMultiScheme;
FAtXmlEl, FAtXmlSym, FAtXmlTxt: TSynHighlighterAttributes;
FAtPasMark, FAtPasSym, FAtPasId, FAtPasKey, {FAtPasSp, }FAtPasCom: TSynHighlighterAttributes;
FAtXmlEl, FAtXmlSym, FAtXmlTxt: TLazEditTextAttribute;
FAtPasMark, FAtPasSym, FAtPasId, FAtPasKey, {FAtPasSp, }FAtPasCom: TLazEditTextAttribute;
FPasHl: TSynPasSyn;
procedure InitMultiEMpty;
@ -42,7 +42,7 @@ type
procedure DumpRanges(ARangeList: TSynHighlighterRangeList);
procedure DumpAll(Hl: TSynMultiSyn);
procedure CheckTokensForLine(Name: String; HL: TSynCustomHighlighter;
LineIdx: Integer; ExpAttr: Array of TSynHighlighterAttributes);
LineIdx: Integer; ExpAttr: Array of TLazEditTextAttribute);
published
procedure TestSectionList;
procedure TestVirtualLines;
@ -261,7 +261,7 @@ begin // ensure CurrentLines are set
end;
procedure TTestHighlightMulti.CheckTokensForLine(Name: String; HL: TSynCustomHighlighter;
LineIdx: Integer; ExpAttr: array of TSynHighlighterAttributes);
LineIdx: Integer; ExpAttr: array of TLazEditTextAttribute);
var
c: Integer;
tk: TLazCustomEditTextAttribute;
@ -276,8 +276,8 @@ begin
end;
//DebugLn([HL.GetToken,' (',HL.GetTokenID ,') at ', HL.GetTokenPos]);
tk := HL.GetTokenAttributeEx;
if (tk <> nil) and (tk is TSynHighlighterAttributes)
then tkName := TSynHighlighterAttributes(tk).StoredName
if (tk <> nil) and (tk is TLazEditTextAttribute)
then tkName := TLazEditTextAttribute(tk).StoredName
else tkName := '<nil>';
AssertTrue(Format('%s Attrib Line=%d pos=%d exp=%s got=%s',
[Name, LineIdx, c, ExpAttr[c].StoredName, tkName]),

View File

@ -7,7 +7,7 @@ interface
uses
Classes, SysUtils, testregistry, TestBase, Forms, LazLoggerBase,
TestHighlightFoldBase, SynEdit, SynEditTypes, SynHighlighterPas,
SynEditHighlighterFoldBase, SynEditHighlighter;
SynEditHighlighterFoldBase, SynEditHighlighter, LazEditTextAttributes;
type
@ -110,7 +110,7 @@ begin
result.Flags := [etiKind];
end;
operator + (a: TtkTokenKind; b: TSynHighlighterAttributes) : TExpTokenInfo;
operator + (a: TtkTokenKind; b: TLazEditTextAttribute) : TExpTokenInfo;
begin
result := default(TExpTokenInfo);
result.ExpKind := ord(a);
@ -1608,7 +1608,7 @@ end;
procedure TTestHighlighterPas.TestContextForProcedure;
var
AtP, AtI, AtK: TSynHighlighterAttributes;
AtP, AtI, AtK: TLazEditTextAttribute;
var
AFolds: TPascalCodeFoldBlockTypes;
i: Integer;

View File

@ -23,7 +23,7 @@ implementation
procedure TTestPaintColorMerging.MergeAttrib;
procedure SetAttrib(AnAttrib: TSynHighlighterAttributes;
procedure SetAttrib(AnAttrib: TLazEditTextAttribute;
AFore, ABack, AFrame: TColor;
AStyle: TFontStyles = []; AStyleMask: TFontStyles = [];
AFrameSides: TSynFrameEdges = sfeAround; AFrameStyle: TSynLineStyle = slsSolid;
@ -33,12 +33,12 @@ procedure TTestPaintColorMerging.MergeAttrib;
AnAttrib.Background := ABack;
AnAttrib.FrameColor := AFrame;
AnAttrib.Style := AStyle;
if AnAttrib is TSynHighlighterAttributesModifier then
if AnAttrib is TLazEditTextAttributeModifier then
AnAttrib.StyleMask := AStyleMask;
AnAttrib.FrameEdges := AFrameSides;
AnAttrib.FrameStyle := AFrameStyle;
if AnAttrib is TSynSelectedColor then begin
TSynSelectedColor(AnAttrib).SetFrameBoundsPhys(AStartX, AEndX);
if AnAttrib is TLazEditTextAttribute then begin
TLazEditTextAttribute(AnAttrib).SetFrameBoundsPhys(AStartX, AEndX);
end;
end;

View File

@ -111,7 +111,7 @@ type
////TL replaced out prefix procedure CreatePanel(out comp: TPanel; Parent: TWinControl; left, top, width, height: integer);
procedure CreatePanel(var comp: TPanel; Parent: TWinControl; left, top, width, height: integer);
function GetNodeType(Node: TTreeNode): TNodeType;
procedure SetDefaultAttributes(Attr: TSynHighlighterAttributes);
procedure SetDefaultAttributes(Attr: TLazEditTextAttribute);
procedure SetDefaultRangeAttr(R: TSynRange);
procedure DoAddKeyword(Sender: TObject);
procedure AddingKeyWord(Node: TTreeNode);
@ -937,7 +937,7 @@ begin
memo.Lines.Add(SampleMemo.SelText);
end;
Procedure TSynUniDesigner.SetDefaultAttributes(Attr:TSynHighlighterAttributes);
Procedure TSynUniDesigner.SetDefaultAttributes(Attr:TLazEditTextAttribute);
begin
Attr.Background:=clWhite;
Attr.Foreground:=clBlack;

View File

@ -328,7 +328,7 @@ type
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
function GetDefaultAttribute(Index: integer): TSynHighlighterAttributes;
function GetDefaultAttribute(Index: integer): TLazEditTextAttribute;
override;
function GetEOL: Boolean; override;
function GetRange: Pointer; override;
@ -336,7 +336,7 @@ type
////TL Added the following 3 lines... and the implementation procedure
procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override; ////TL: Added 2003-06-11
function GetTokenAttribute: TSynHighlighterAttributes; override;
function GetTokenAttribute: TLazEditTextAttribute; override;
function GetTokenID: Integer;
function GetTokenKind: integer; override;
function GetTokenPos: Integer; override;
@ -1718,7 +1718,7 @@ begin
Result :=1;// CODE_REVIEW fCurrToken.ID;
end;
function TSynUniSyn.GetTokenAttribute: TSynHighlighterAttributes;
function TSynUniSyn.GetTokenAttribute: TLazEditTextAttribute;
begin
Result:=fCurrToken.Attr;
end;

View File

@ -30,7 +30,7 @@ type
FCurRange: Integer;
public
procedure Next; override;
function GetTokenAttribute: TSynHighlighterAttributes; override;
function GetTokenAttribute: TLazEditTextAttribute; override;
public
procedure SetRange(Value: Pointer); override;
procedure ResetRange; override;
@ -51,7 +51,7 @@ begin
dec(FCurRange);
end;
function TSynDemoHlContext.GetTokenAttribute: TSynHighlighterAttributes;
function TSynDemoHlContext.GetTokenAttribute: TLazEditTextAttribute;
begin
Result := inherited GetTokenAttribute;
if (Result = SpecialAttri) and (FCurRange > 0) then

View File

@ -47,7 +47,7 @@ type
procedure Next; override;
function GetEol: Boolean; override;
procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override;
function GetTokenAttribute: TSynHighlighterAttributes; override;
function GetTokenAttribute: TLazEditTextAttribute; override;
public
function GetToken: String; override;
function GetTokenPos: Integer; override;
@ -78,7 +78,7 @@ type
FCurRange: Integer;
public
procedure Next; override;
function GetTokenAttribute: TSynHighlighterAttributes; override;
function GetTokenAttribute: TLazEditTextAttribute; override;
public
(* The below needed to be changed and are in TSynDemoHlFold
TSynDemoHlContextFoldBase uses Ranges itself.
@ -242,7 +242,7 @@ begin
TokenLength := FTokenEnd - FTokenPos;
end;
function TSynDemoHlFoldBase.GetTokenAttribute: TSynHighlighterAttributes;
function TSynDemoHlFoldBase.GetTokenAttribute: TLazEditTextAttribute;
begin
// Match the text, specified by FTokenPos and FTokenEnd
@ -307,7 +307,7 @@ begin
dec(FCurRange);
end;
function TSynDemoHlContextFoldBase.GetTokenAttribute: TSynHighlighterAttributes;
function TSynDemoHlContextFoldBase.GetTokenAttribute: TLazEditTextAttribute;
begin
Result := inherited GetTokenAttribute;
if (Result = SpecialAttri) and (FCurRange > 0) then

View File

@ -78,7 +78,7 @@ type
procedure Next; override;
function GetEol: Boolean; override;
procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override;
function GetTokenAttribute: TSynHighlighterAttributes; override;
function GetTokenAttribute: TLazEditTextAttribute; override;
public
function GetToken: String; override;
function GetTokenPos: Integer; override;
@ -192,7 +192,7 @@ begin
TokenLength := FTokenEnd - FTokenPos;
end;
function TSynDemoHl.GetTokenAttribute: TSynHighlighterAttributes;
function TSynDemoHl.GetTokenAttribute: TLazEditTextAttribute;
begin
// Match the text, specified by FTokenPos and FTokenEnd

View File

@ -86,7 +86,7 @@ type
// TSynPositionHighlighter - minimum implementation needed.
TNonSrcIDEHighlighter = class(TSynPositionHighlighter); // Hold colors, not related to SourceEditor
TSynHighlightElement = TSynHighlighterAttributes;
TSynHighlightElement = TLazEditTextAttribute deprecated 'use TLazEditTextAttribute // to be removed in 5.99';
TCustomSynClass = class of TSrcIDEHighlighter;
TLazSynPluginTemplateMultiCaret = class(TForm) end;
@ -352,7 +352,7 @@ type
constructor Create(ASchemeLang: TColorSchemeLanguage; attribName: PString;
const aStoredName: String = '');
function IsEnabled: boolean; override;
procedure ApplyTo(aDest: TSynHighlighterAttributes; aDefault: TColorSchemeAttribute = nil);
procedure ApplyTo(aDest: TLazEditTextAttribute; aDefault: TColorSchemeAttribute = nil);
procedure Assign(Src: TPersistent); override;
function Equals(Other: TColorSchemeAttribute): Boolean; reintroduce;
function GetStoredValuesForAttrib: TColorSchemeAttribute; // The IDE default colors from the resources
@ -509,7 +509,7 @@ type
function GetEol: Boolean; override;
function GetToken: string; override;
procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override;
function GetTokenAttribute: TSynHighlighterAttributes; override;
function GetTokenAttribute: TLazEditTextAttribute; override;
function GetTokenPos: Integer; override;
function GetTokenKind: integer; override;
procedure Next; override;
@ -7140,7 +7140,7 @@ end;
procedure TColorSchemeAttribute.ApplyTo(aDest: TObject);
begin
ApplyTo(aDest as TSynHighlighterAttributes, nil);
ApplyTo(aDest as TLazEditTextAttribute, nil);
end;
procedure TColorSchemeAttribute.Init;
@ -7208,7 +7208,7 @@ begin
Result := (inherited IsEnabled) or (FMarkupFoldLineColor <> clNone);
end;
procedure TColorSchemeAttribute.ApplyTo(aDest: TSynHighlighterAttributes;
procedure TColorSchemeAttribute.ApplyTo(aDest: TLazEditTextAttribute;
aDefault: TColorSchemeAttribute);
// aDefault (if supplied) is usually the Schemes agnDefault / DefaultAttribute
var
@ -7233,10 +7233,10 @@ begin
aDest.StyleMask := [low(TFontStyle)..high(TFontStyle)];
end;
if aDest is TSynHighlighterAttributesModifier then begin
TSynHighlighterAttributesModifier(aDest).ForeAlpha := Src.ForeAlpha;
TSynHighlighterAttributesModifier(aDest).BackAlpha := Src.BackAlpha;
TSynHighlighterAttributesModifier(aDest).FrameAlpha := Src.FrameAlpha;
if aDest is TLazEditTextAttributeModifier then begin
TLazEditTextAttributeModifier(aDest).ForeAlpha := Src.ForeAlpha;
TLazEditTextAttributeModifier(aDest).BackAlpha := Src.BackAlpha;
TLazEditTextAttributeModifier(aDest).FrameAlpha := Src.FrameAlpha;
if aDest is TSynHighlighterLazCustomPasAttribute then begin
TSynHighlighterLazCustomPasAttribute(aDest).CustomWords.Assign(CustomWords);
TSynHighlighterLazCustomPasAttribute(aDest).CustomWordTokenKind := CustomWordTokenKind;
@ -7252,7 +7252,7 @@ begin
aDest.UnderlinePriority := Src.UnderlinePriority;
end;
if not (aDest is TSynHighlighterAttributesModifier) then begin
if not (aDest is TLazEditTextAttributeModifier) then begin
if aDefault <> nil then begin
if aDefault.IsUsingSchemeGlobals then
aDefault := aDefault.GetSchemeGlobal;
@ -7286,7 +7286,7 @@ begin
hafStyle, hafFrameStyle, hafFrameEdges, hafPrior];
if Src is TSynHighlighterLazCustomPasAttribute then
FAttrFeatures := FAttrFeatures + [hafCustomWords];
if Src is TSynHighlighterAttributesModifier then
if Src is TLazEditTextAttributeModifier then
FAttrFeatures := FAttrFeatures + [hafAlpha, hafStyleMask];
if Src is TColorSchemeAttribute then begin
@ -7496,7 +7496,7 @@ constructor TColorSchemeLanguage.CreateFromXml(AGroup: TColorScheme;
const aPath: String; IsSchemeDefault: Boolean;
aPascalScheme: TColorSchemeLanguage; MappedAttributes: TStringList);
var
hla: TSynHighlighterAttributes;
hla: TLazEditTextAttribute;
csa, pasattr: TColorSchemeAttribute;
aha: TAdditionalHilightAttribute;
FormatVersion, i: Integer;
@ -7517,7 +7517,7 @@ begin
if hla is TSynHighlighterLazCustomPasAttribute then
csa.AttrFeatures := [hafBackColor, hafForeColor, hafFrameColor, hafAlpha, hafPrior, hafStyle, hafStyleMask, hafCustomWords]
else
if hla is TSynHighlighterAttributesModifier then
if hla is TLazEditTextAttributeModifier then
csa.AttrFeatures := [hafBackColor, hafForeColor, hafFrameColor, hafAlpha, hafPrior, hafStyle, hafStyleMask]
else
csa.AttrFeatures := [hafBackColor, hafForeColor, hafFrameColor, hafStyle];
@ -8013,7 +8013,7 @@ procedure TColorSchemeLanguage.ApplyTo(AHLighter: TSynCustomHighlighter);
var
i: Integer;
Attr: TColorSchemeAttribute;
hlattrs: TSynHighlighterAttributes;
hlattrs: TLazEditTextAttribute;
begin
AHLighter.BeginUpdate;
try
@ -8276,8 +8276,8 @@ begin
csa := TColorSchemeAttribute.Create(csl, AName, AStoredName);
csa.Clear;
if ADefaults <> nil then begin
csa.AssignSupportedFeaturesFrom(ADefaults as TSynHighlighterAttributes);
csa.AssignColors(ADefaults as TSynHighlighterAttributes);
csa.AssignSupportedFeaturesFrom(ADefaults as TLazEditTextAttribute);
csa.AssignColors(ADefaults as TLazEditTextAttribute);
end;
csa.InternalSaveDefaultValues;
csa.FDefaultSynFeatures := csa.Features;
@ -8457,7 +8457,7 @@ begin
TokenLength := Length(FLineText);
end;
function TIDESynTextSyn.GetTokenAttribute: TSynHighlighterAttributes;
function TIDESynTextSyn.GetTokenAttribute: TLazEditTextAttribute;
begin
Result := nil;
end;

View File

@ -37,7 +37,7 @@ uses
SynEditTypes, SynGutterChanges, SynEditMouseCmds, SynEditHighlighter, SynEditStrConst,
// IdeIntf
IDEOptionsIntf, IDEOptEditorIntf, IDEImagesIntf, IDEUtils,
EditorSyntaxHighlighterDef,
EditorSyntaxHighlighterDef, LazEditTextAttributes,
// IdeConfig
IDEProcs, LazConf,
// IDE
@ -476,7 +476,7 @@ procedure TEditorColorOptionsFrame.ColorPreviewMouseUp(Sender: TObject;
var
i: Integer;
Token: String;
Attri: TSynHighlightElement;
Attri: TLazEditTextAttribute;
MouseXY, XY: TPoint;
AddAttr: TAdditionalHilightAttribute;
NewNode: TTreeNode;

View File

@ -178,7 +178,7 @@ uses
SourceFileManager, EditorToolbarStatic, IDEInstances,
WordCompletion, EnvGuiOptions, EnvDebuggerOptions, IdeDebuggerValueFormatter, ProjectDebugLink,
// main ide
MainBar, MainIntf, MainBase, SearchPathProcs;
MainBar, MainIntf, MainBase, SearchPathProcs, LazEditTextAttributes;
type
{ TMainIDE }
@ -4054,7 +4054,7 @@ var
CurWordAtCursor, TokenTxt: string;
FindDeclarationCmd: TIDECommand;
i, TokenType, Start: Integer;
Attri: TSynHighlighterAttributes;
Attri: TLazEditTextAttribute;
xy: TPoint;
begin
GetCurrentUnit(ASrcEdit, AnUnitInfo);

View File

@ -112,7 +112,7 @@ type
procedure pbAsmMouseUp(Sender: TObject; {%H-}Button: TMouseButton; {%H-}Shift: TShiftState; {%H-}X,
{%H-}Y: Integer);
procedure pbAsmMouseWheel(Sender: TObject; Shift: TShiftState; WheelDelta: Integer; {%H-}MousePos: TPoint; var Handled: Boolean);
procedure GetColors(ASrc: TSynHighlighterAttributes; AMod: array of TSynHighlighterAttributesModifier; out AText, ABack, AFrame: TColor; out AStyle: TFontStyles);
procedure GetColors(ASrc: TLazEditTextAttribute; AMod: array of TLazEditTextAttributeModifier; out AText, ABack, AFrame: TColor; out AStyle: TFontStyles);
procedure pbAsmPaint(Sender: TObject);
procedure popCopyAddrClick(Sender: TObject);
procedure sbHorizontalChange(Sender: TObject);
@ -798,8 +798,8 @@ begin
pbAsm.Invalidate;
end;
procedure TAssemblerDlg.GetColors(ASrc: TSynHighlighterAttributes;
AMod: array of TSynHighlighterAttributesModifier; out AText, ABack,
procedure TAssemblerDlg.GetColors(ASrc: TLazEditTextAttribute;
AMod: array of TLazEditTextAttributeModifier; out AText, ABack,
AFrame: TColor; out AStyle: TFontStyles);
var
i: Integer;
@ -829,7 +829,7 @@ var
TextStyle: TTextStyle;
Fore, Back, Frame: TColor;
St: TFontStyles;
m0, m1, m2, m3: TSynHighlighterAttributesModifier;
m0, m1, m2, m3: TLazEditTextAttributeModifier;
begin
R := pbAsm.ClientRect;
TextStyle := pbAsm.Canvas.TextStyle;

View File

@ -84,7 +84,7 @@ uses
EncloseSelectionDlg, EncloseIfDef, InvertAssignTool, SourceEditProcs,
SourceMarks, SearchFrm, MultiPasteDlg, EditorMacroListViewer,
EditorToolbarStatic, editortoolbar_options, InputhistoryWithSearchOpt,
FPDocHints, MainIntf, GotoFrm;
FPDocHints, MainIntf, GotoFrm, LazEditTextAttributes;
type
TSourceNotebook = class;
@ -6646,7 +6646,7 @@ end;
function TSourceEditor.GetCodeAttributeName(LogXY: TPoint): String;
var
Token: string;
Attri: TSynHighlighterAttributes;
Attri: TLazEditTextAttribute;
begin
Result := '';
if EditorComponent.GetHighlighterAttriAtRowCol(LogXY,Token,Attri)

View File

@ -228,10 +228,10 @@ type
TSynMarkupIdentComplWindow = class // don't inherit from TSynEditMarkup, no regular markup
private
FColor: array[TIdentWindowAhaColorRange] of TSynHighlighterAttributes;
FColor: array[TIdentWindowAhaColorRange] of TLazEditTextAttribute;
FUseRecent: boolean;
function GetColor(AnIndex: TIdentWindowAhaColorRange): TSynHighlighterAttributes;
function GetColor(AnIndex: TIdentWindowAhaColorRange): TLazEditTextAttribute;
function GetForegroundColor(AnIndex: TAdditionalHilightAttribute): TColor;
function GetBackgroundColor(AnIndex: TAdditionalHilightAttribute): TColor;
public
@ -240,7 +240,7 @@ type
procedure Clear;
procedure Merge(AColors: TSynMarkupIdentComplWindow);
public
property Color [AnIndex: TIdentWindowAhaColorRange]: TSynHighlighterAttributes read GetColor; default;
property Color [AnIndex: TIdentWindowAhaColorRange]: TLazEditTextAttribute read GetColor; default;
property TextColor: TColor index ahaIdentComplWindow read GetForegroundColor;
property BackgroundColor: TColor index ahaIdentComplWindow read GetBackgroundColor;
@ -594,7 +594,7 @@ implementation
{ TSynMarkupIdentComplWindow }
function TSynMarkupIdentComplWindow.GetColor(AnIndex: TIdentWindowAhaColorRange
): TSynHighlighterAttributes;
): TLazEditTextAttribute;
begin
Result := FColor[AnIndex];
end;
@ -618,7 +618,7 @@ begin
inherited Create;
for i := low(TIdentWindowAhaColorRange) to high(TIdentWindowAhaColorRange) do
FColor[i] := TSynHighlighterAttributes.Create;
FColor[i] := TLazEditTextAttribute.Create;
Clear;
end;