Skip to content

Add support for Delphi 10 Seattle to 10.3 Rio; restore removed highlighters - #1

Open
TetzkatLipHoka wants to merge 4 commits into
VSoftTechnologies:masterfrom
TetzkatLipHoka:delphi-10.x-support
Open

Add support for Delphi 10 Seattle to 10.3 Rio; restore removed highlighters#1
TetzkatLipHoka wants to merge 4 commits into
VSoftTechnologies:masterfrom
TetzkatLipHoka:delphi-10.x-support

Conversation

@TetzkatLipHoka

Copy link
Copy Markdown

This PR extends compiler support from 10.4+ down to Delphi 10 Seattle and
restores the highlighters that were dropped when the Omni highlighter was
introduced. The commits are independent — if you only want some of them, I am
happy to split the PR.

Commit 1 — Restore removed highlighters

Re-adds SynHighlighterAsmMASM, SynHighlighterECMAScript,
SynHighlighterGLSL, SynHighlighterGo, SynHighlighterZPL and the
SynHighlighterHashEntries helper unit (taken from the pre-removal state of
the code base), including their SynEditStrConst constants, designtime
registration and runtime package entries for all four package sets.

Commit 2 — Delphi 10 Seattle to 10.3 Rio

All changes are guarded with {$IF CompilerVersion >= NN}, so 10.4+ compiles
exactly as before. Highlights:

  • 10.3 Rio: Screen.DefaultPixelsPerInchUSER_DEFAULT_SCREEN_DPI
    (same pattern already used elsewhere in the code base),
    TControl.ClientToScreen(TRect) overload, per-control StyleServices(Self).
  • 10.2 Tokyo: inline variable declarations (8 sites) rewritten as classic
    var blocks; guarded the DPI overloads of DrawElement, the GetCurrentPPI
    override and GetSystemMetricsForDPI.
  • 10.1 Berlin: TThread.ForceQueue falls back to TThread.Queue;
    SynHighlighterManager uses the existing CurrentPPI compatibility helper
    from SynEditTypes.
  • 10 Seattle: TStrings.Options/Updating/TrailingLineBreak fallbacks;
    ChangeScale without isDpiChange; explicit TRectTRectF conversions
    (no implicit operator yet); Seattle's Winapi.D2D1 declares
    IDWriteLocalizedStrings.FindLocaleName(var localeName: WCHAR) instead of
    PWideChar; guarded TStringList.UseLocale; the char helper does not
    resolve on indexed PWideChar expressions (fixed with a Char() cast);
    TParallel.&For overload resolution via a typed local closure.

New package folders RAD Studio 10.0RAD Studio 10.3 contain dpk files
with fixed LIBSUFFIX (230/240/250/260); the IDE generates the dproj when
opening the dpk.

Commit 3 — Fix EListError in TSynHashEntryList on Win64

This one belongs to the restored SynHighlighterHashEntries and cannot be
submitted separately, since the unit does not exist on master.

The list declared Get/Put/Items with an Integer index. TList.Items
is declared Items[Index: NativeInt] since Delphi 12, so on Win64 the
redeclaration no longer fully hides the inherited property: a Cardinal
argument — which the Asm highlighters pass as their hash value — binds to
TList.Items, because Cardinal → NativeInt is lossless while
Cardinal → Integer is not. The inherited setter does not grow the list, so
the very first keyword raises EListError: List index out of bounds. Win32
is unaffected, both signatures are identical there.

The index type is switched conditionally: an unconditional NativeInt is
itself ambiguous on 11.3 and older (E2251).

Commit 4 — Add SynEditWildcardSearch to the 10.x runtime packages

SynEditWildcardSearch sits in Source but is not listed in any package, so
it is never built or registered. The new 10.x packages introduced by this PR
now contain it. The same entry for the existing 10.4–13.0 packages is a
separate PR, so that this one only touches the folders it adds.

Verified builds (command line, -B)

Delphi SynEditDR SynEditDD
10 Seattle
10.1 Berlin
10.2 Tokyo
10.3 Rio
10.4 Sydney
11.3 Alexandria
12.3 Athens
13.1 ✔ (Win32 + Win64)

SynHighlighterHashEntries additionally built for Win32 and Win64 on 13.1.

Behavioural notes on the old versions

  • On 10.1 TThread.Queue replaces ForceQueue (UI Automation notifications
    may run synchronously when raised from the main thread).
  • On Seattle TStringList.UseLocale := False is not available for the Omni
    highlighter keyword lists (sorting falls back to locale-aware comparison).
  • Per-monitor DPI awareness remains limited by what the RTL/VCL of each
    version provides.

🤖 Generated with Claude Code

TetzkatLipHoka and others added 4 commits July 21, 2026 19:10
Re-adds SynHighlighterAsmMASM, SynHighlighterECMAScript, SynHighlighterGLSL,
SynHighlighterGo, SynHighlighterZPL and the SynHighlighterHashEntries helper
unit (taken from the pre-removal state of the code base), including their
SynEditStrConst constants, designtime registration and package entries.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
All changes are guarded with {$IF CompilerVersion >= NN} so that 10.4+
compiles exactly as before:

- 10.3: Screen.DefaultPixelsPerInch -> USER_DEFAULT_SCREEN_DPI,
  TControl.ClientToScreen(TRect) and per-control StyleServices(Self)
- 10.2: replaced inline variable declarations with classic var blocks,
  guarded the DPI overloads of DrawElement, GetCurrentPPI override and
  GetSystemMetricsForDPI
- 10.1: TThread.ForceQueue falls back to TThread.Queue,
  SynHighlighterManager uses the CurrentPPI helper from SynEditTypes
- 10 Seattle: TStrings.Options/Updating/TrailingLineBreak fallbacks,
  ChangeScale without isDpiChange, explicit TRect->TRectF conversions,
  IDWriteLocalizedStrings.FindLocaleName header difference, guarded
  TStringList.UseLocale, Char helper workaround on indexed PWideChar,
  TParallel.For overload resolution via typed local closure

Adds package folders for RAD Studio 10.0-10.3 (dpk with fixed LIBSUFFIX;
the IDE generates the dproj when opening the dpk).

Verified: DR+DD build with dcc32 on 10.0/10.1/10.2/10.3/10.4/11.3/12.3/13.1
and with dcc64 on 13.1.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The list declared Get/Put/Items with an Integer index. TList.Items is
declared Items[Index: NativeInt] since Delphi 12, so on Win64 the
redeclaration no longer fully hides the inherited property: a Cardinal
argument - which the Asm highlighters pass as their hash value - binds to
TList.Items, because Cardinal -> NativeInt is lossless while
Cardinal -> Integer is not. The inherited setter does not grow the list, so
the very first keyword raises "EListError: List index out of bounds (52)".
Win32 is unaffected, both signatures are identical there.

The index type is switched conditionally: an unconditional NativeInt is
itself ambiguous on 11.3 and older (E2251).
Same entry as in the newer packages: the unit sits in Source but was not
listed anywhere, so it was never built or registered.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant