Author Topic: TDWEdit  (Read 12122 times)

docno

  • New Member
  • *
  • Posts: 25
Re: TDWEdit
« Reply #30 on: August 13, 2026, 03:18:35 pm »
Hello,

I cant compile DWEDIT (project.lpi) on lazarus 4.8 FPC 3.2.4, on windows 11.

Error : dwedit.pas(114,26) Error: No matching implementation for interface method "Compare(const TEmbeddedImage;const TEmbeddedImage):LongInt;" found

I have not installed dweditpkg.lpk : is it the problem ?

Any help ?

docno

  • New Member
  • *
  • Posts: 25
Re: TDWEdit
« Reply #31 on: August 13, 2026, 05:26:23 pm »
I have not modified the code.
I load project.lpi and compile.
I dont have install dwedit component.

The error is in line 114 on DWedit unit:

Code: Pascal  [Select][+][-]
  1.  // New helper class to sort TEmbeddedImage objects by position
  2.   TEmbeddedImageSorter = class(TInterfacedObject, IEmbeddedImageComparer)
  3.   public
  4.     function Compare(constref Left, Right: TEmbeddedImage): Integer;
  5.   end;        
  6.  

Same problem if i try to install dweditpkg.lpk : cant compile with same error line 114.

I use Laz 4.8 and FPC 3.2.4

Any idea ?
« Last Edit: August 13, 2026, 05:31:51 pm by docno »

Ed78z

  • Jr. Member
  • **
  • Posts: 76
Re: TDWEdit
« Reply #32 on: August 14, 2026, 01:51:52 am »
Wait!
You are using fpc3.2.4 RC???
Maybe that's the issue! I guess there is a change about handling the specialize generics between 3.2.2 and 3.2.4 versions.
IEmbeddedImageComparer = specialize IComparer<TEmbeddedImage>;


Change both sections (lines #114 and #1641) to these and try again
 

TEmbeddedImageSorter = class(TInterfacedObject, IEmbeddedImageComparer)
  public
    {$IF FPC_FULLVERSION >= 30204}
    function Compare(const Left, Right: TEmbeddedImage): Integer;
    {$ELSE}
    function Compare(constref Left, Right: TEmbeddedImage): Integer;
    {$ENDIF}
  end;       


{$IF FPC_FULLVERSION >= 30204}
function TEmbeddedImageSorter.Compare(const Left, Right: TEmbeddedImage): Integer;
{$ELSE}
function TEmbeddedImageSorter.Compare(constref Left, Right: TEmbeddedImage): Integer;
{$ENDIF}
begin
  Result := Left.Position - Right.Position;
end;



paweld

  • Hero Member
  • *****
  • Posts: 1733
Re: TDWEdit
« Reply #33 on: August 14, 2026, 07:58:33 am »
@Ed78z - Unfortunately, it is not possible to compile the “SkiaEdit” project; the “Skiaedit” unit is missing.
Best regards / Pozdrawiam
paweld

docno

  • New Member
  • *
  • Posts: 25
Re: TDWEdit
« Reply #34 on: August 14, 2026, 09:07:58 am »
Hello,

Good catch but more errors in compilation.
I have to change line 1498 :
Code: Pascal  [Select][+][-]
  1. TStyleRangeComparer = class(TInterfacedObject, IStyleRangeComparer)
  2.   public
  3.    //>>>> function Compare(constref Left, Right: TStyleRange): Integer;   <<<< change
  4.     function Compare(const Left, Right: TStyleRange): Integer;
  5.   end;            
  6.  

and line 1640 :

Code: Pascal  [Select][+][-]
  1. //>>>>>>function TStyleRangeComparer.Compare(constref Left, Right: TStyleRange): Integer; <<< change this
  2. function TStyleRangeComparer.Compare(const Left, Right: TStyleRange): Integer;
  3. begin
  4.   Result := Left.StartPos - Right.StartPos;
  5. end;  
  6.  

And that compile (48260 ko !!!)

Very interesting and good component.
I search for clipboard functions and printing...

Thanx for your help.


docno

  • New Member
  • *
  • Posts: 25
Re: TDWEdit
« Reply #35 on: August 14, 2026, 09:37:12 am »
Hello,

For compiling Skiaedit demo there is many units missing : QDocModel,QRTFLoader, QSharedTypes, QSkiaRender, QSkiaLayout, QSkiaController, QColors

Also need : dwedit_inc dir, dx12 dir, qunits dir

Just for infos...

Ed78z

  • Jr. Member
  • **
  • Posts: 76
Re: TDWEdit
« Reply #36 on: August 14, 2026, 02:17:54 pm »
Hello,

Good catch but more errors in compilation.
I have to change line 1498 :
Code: Pascal  [Select][+][-]
  1. TStyleRangeComparer = class(TInterfacedObject, IStyleRangeComparer)
  2.   public
  3.    //>>>> function Compare(constref Left, Right: TStyleRange): Integer;   <<<< change
  4.     function Compare(const Left, Right: TStyleRange): Integer;
  5.   end;            
  6.  

and line 1640 :

Code: Pascal  [Select][+][-]
  1. //>>>>>>function TStyleRangeComparer.Compare(constref Left, Right: TStyleRange): Integer; <<< change this
  2. function TStyleRangeComparer.Compare(const Left, Right: TStyleRange): Integer;
  3. begin
  4.   Result := Left.StartPos - Right.StartPos;
  5. end;  
  6.  

And that compile (48260 ko !!!)

Very interesting and good component.
I search for clipboard functions and printing...

Thanx for your help.

Docno, these are not errors in the component, I explained you what happened! fpc3.2.4 handling generics different than fpc3.2 2 and I explained how to fix this issue correctly. If you don't use my recommended solution, your projects may not compile in fpc.3.2.2 or olders versions.

Regarding the size:
I enabled debug mode, that's why the size is 48mb, you can change it to release mode, the size will be small....

DWEdit is based on DirectWrite and works on Windows only
I shared it completely free .


SkiaEdit is cross-platform and much more advanced, I just shared the core Skia wrappers compatible modified for FPC, not the whole project.
« Last Edit: August 14, 2026, 02:19:25 pm by Ed78z »

docno

  • New Member
  • *
  • Posts: 25
Re: TDWEdit
« Reply #37 on: August 14, 2026, 03:35:02 pm »

Hi Ed78z,

The FPC 3.2.4 compiler says there is errors line 1498 and 1640 and i report to you the lines.
FPC 3.2.4 is the future on FPC i think.

Thats all, and this is not an offense !

I make speed changes on the code for tests only and see if (finally) i can compile the code.
Thats all and thanx tor your response.

Skiaedit demo is not compilable in its actual state : many unit are missing.

Regarding the size : i have disabled debuger and use O2 optimisation and i have 48199 ko.

I am french and english is not my natural langage and i cant says all i want.
Maybe its better.


Ed78z

  • Jr. Member
  • **
  • Posts: 76
Re: TDWEdit
« Reply #38 on: August 15, 2026, 08:40:52 am »
Hi Docno,

The reason I suggested that format is because FPC 3.2.4 still doesn't have an official release date. FPC 3.2.2 is currently the latest official version, and many developers stick with it. If you make the changes as you did, anyone on the official version won't be able to compile your code.

Additionally, I had the compile mode set to Debug by default. If you change it to Release mode, your executable size will drop significantly (from 48MB down to 6MB, as shown in the attached screenshot).

I modified the Skia files and included my ExtraFPC.pas so Skia can be used in Lazarus (Remember, the original wrapper only work with Delphi, you can't compile it in Lazarus)

Thanks for your feedback!

docno

  • New Member
  • *
  • Posts: 25
Re: TDWEdit
« Reply #39 on: August 15, 2026, 10:12:10 am »
Hi Ed78z,

Without debug project1.exe :48199 ko with O2
But if i remove Heaptrc, GPROF and all : 6151 ko with O3

But the compiler says (not me ! ) there is an error ! Waou ! No offense !

Here on project1.lpr line 24 : the conditional directive is not follow.
I made a change (sorry, my bad) :

Code: Pascal  [Select][+][-]
  1. // Only compile these lines if the HeapTrc unit is enabled (Debug Mode)
  2.   //{$IFDEF HEAPTRC}
  3.  
  4.   {$ifdef debug}
  5.  
  6.   //>>>>>>>>>
  7.     GlobalSkipIfNoLeaks := True;
  8.     SetHeapTraceOutput('HeapTrace.log');
  9.   {$ENDIF}  
  10.  

And then the code compile fine !

Also, where can i find the skiaedit demo with the new files ?

Have a good day...

 

TinyPortal © 2005-2018