TurboPack / SynEdit

SynEdit is a syntax highlighting edit control, not based on the Windows common controls.
226 stars 75 forks source link

Update the C++ packages to match the Delphi ones #153

Closed pyscripter closed 2 years ago

pyscripter commented 2 years ago

With the move to DirectWrite units have added/removed. The C++ packages need to be updated.

dm-e commented 2 years ago

I updated the package for the C++Builder. The components can be installed with it, but unfortunately they cannot be used. When trying to compile a new VCL application with a SynEditor, there are about 80 errors of the following kind:

[bcc32c Error] SynDWrite.hpp(55): unknown type name '_di_IDWriteFontCollection'

If you still want the updated package, I'm happy to push it.

I can also provide an update of the package for C++Builder Tokyo. It compiles but I didn't try to install it to avoid polluting my system

An attempt to make the package for C++Builder Sydney failed completely. It didn't even compile.

For an older version of the components, I created a C++Builder-only counterpart. I will post an announcement here.

pyscripter commented 2 years ago

This interface comes from Winapi.D2D1. If you look at this file at the top in includes:

(*$DEFINE WINAPI_D2D1_HPP_DEFINES_INTERFACE*)
(*$DEFINE WINAPI_D2D1_USE_ENUMERATIONS*)
(*$DEFINE WINAPI_D2D1_ENUM_WITH_FLAG_OPERATORS_AS_INTEGER*)
(*$HPPEMIT NOUSINGNAMESPACE *)
(*$HPPEMIT '#include <d2d1.h>' *)
(*$HPPEMIT '#include <dwrite.h>' *)

So you need to link these include files. In theory whatever compiles in Delphi should be usable in C++ Builder maybe with a bit of tweaking and HPPEMMIT directives.

dm-e commented 2 years ago

The reason for the error was in the redeclaration of some interfaces in SynDWrite.pas. I have declared them as EXTERNALSYM now. I installed the components again and could run the example application. The Delphi code can now be correctly debugged even in C++Builder.

If you get me the right to access the repository I will push the modified SynDWrite.pas and the files for the Alexandria package.

pyscripter commented 2 years ago

Great!!!

You don't need access to the repo. The standard way of contributing is:

Looking forward to your PR...

And by the way could you help resolve the remaining C++ issues? Or does your work resolve them as well?

dm-e commented 2 years ago

If I did everything correctly, you should now see a pull request.

I don't know if other C++Builder-related problems have been solved, but they've certainly been reduced. When I get a chance I'll try to get the package for Sydney as well.

pyscripter commented 2 years ago

I saw your PR and was about to merge but you closed it! Are you about to submit a new one?

pyscripter commented 2 years ago

Regarding the open issues this is what I was referring to.

dm-e commented 2 years ago

I now have a meeting, I will try again a few hours later

dm-e commented 2 years ago

sorry, I never did this before. I now created a new pull request On the bottom of the page there are two buttons: one to close with comment and a comment button. I don't see any other reasonable possibility to procced.

dm-e commented 2 years ago

I pressed the comment button now

pyscripter commented 2 years ago

Your PR was now merged.

dm-e commented 2 years ago

great!

pyscripter commented 2 years ago

If you could now look at the other open C++ issues it would be faboulous.

dm-e commented 2 years ago

All C++Builder issues affect version 10.4. Sydney. I tried to build the package with the modified SynDWrite.pas but in vain. I didn't even manage to create a new empty package.

The reason is that the versions of the C++Builder that follow 10.2 Tokyo are very bad. In these versions, the conversion from the classic C++compiler to the clang compiler takes place. A lot of things don't work here anymore. The compiler is extremely slow, declarations are not found and resources are constantly exhausted when debugging. It's scandalous that Embarcadero is taking money for these compilers from his subscribers. Only C++Builder 11.0 Alexandria works halfway again. I'm still using C++Builder 10.2 Tokyo. Sorry, I dont want to waste more time with C++Builder 10.4.

pyscripter commented 2 years ago

Thanks for looking into this. No problem. Can I assume that Synedit works well Delphi Alexandria and the issues raised are resolved at least with that version?

dm-e commented 2 years ago

As far as I understand the issues, they will be solved with C++Builder Alexandria. I can't estimate whether other problems will then remain, e.g. with TwineCompile.