Linux and Templot

I was impressed by the efforts of Andrew Hunt (Templot and Linux topic in the old Templot Club) in getting Templot running natively on Linux. I would hope that if we can get a repository set up that Andrew would be able to commit that code and share it with the rest of us :) I suspect that his fixes for 64-bit Linux will also help with building on 64-bit Windows.

Regards,
Alistair Ward.
 
_______________
message ref: 450

graeme

Member
Location
Bangkok
Hi All,
This is just by way of a quick update to let you know we are still alive and kicking in development land.

Since Andrew seemed to have left the fold, I made the changes to allow T3 to work on linux. Unfortunately this has NOT included the work around EMF files yet, so although the program is running, it doesn't really do anything useful yet.

WELL ... that's not quite true. The trackpad seems to be working OK, so It IS possible to edit templates, and since we have a mostly-working PDF module it is possible to create a template and save it as PDF, which can then be printed. However, without being able to read and write files, this is really of only academic interest for a little while yet.

The next exciting step was Alistair taking this and making it work on a Raspberry Pi, which for those who don't know is a tiny, cheap computer. It is a remarkable little device, with prices starting around GBP35-ish, though I expect Alistair's model was probably around double this.

This is important, though, as it means we have a single version of the code which will run on a PC on Windows, on a PC on linux, and on a non-PC machine (the Pi) on linux. All very encouraging for our cross-platform ambitions. (Android here we come!)

Even given the still-severe restrictions on what can be achieved with the program, we hope to be adding new features in the not-too-distant future (or rather re-enabling currently disabled features :)) so it would be great to have someone to run the occasional test on an Apple machine, as that is the one major platform we do not yet have covered. Any volunteers?

It is still rather early days, but we will also soon be looking for testers on Linux, so if anyone is interested ....

I have also done some analysis on the code that Martin commented out way back when to create the first T3 version, and categorised all the work needed to address the removed functionality into some 40+ issues. Still a LOT to be done.

Alistair, meanwhile, has done great work on breaking out components of Templot along with work around the development environment so that we can have automated tests to verify our future changes.

Anyway, more news as it happens, but in the meantime, keep safe. :)
 

Attachments

  • Screenshot_2021-09-25_18-06-51.png
    Screenshot_2021-09-25_18-06-51.png
    276.7 KB · Views: 8
_______________
message ref: 2719
Last edited:

graeme

Member
Location
Bangkok
Hi Martin,

Obviously all this digging through the code is going to raise a few (ha!) questions. We are trying to sort things out for ourselves to avoid being a complete PITA, but inevitably there are some things we just don't know and can't figure out with certainty.

If I may start with an easy one ... is the 'old_startup' form that I see mentioned related to the T2 function which contacts the Templot web site to check for new versions?

Thanks,

Graeme
 
_______________
message ref: 2728

Martin Wynne

Admin
Location
West of the Severn UK
Info
Please do not send requests for help direct to me via email.

Post your questions on the forum where everyone can see them and add helpful replies.
If I may start with an easy one ... is the 'old_startup' form that I see mentioned related to the T2 function which contacts the Templot web site to check for new versions?
@graeme

Hi Graeme,

Good to hear from you. I wish I'd been asked these questions when I first released the open-source files 3 or 4 years ago. Since then I have suffered significant brain-fade. :)

I can no longer remember most of this stuff and I have to look in the actual code to try to find the answers. And there are multiple places to look -- current Templot2; Templot2 as it was when I released the first open-source files; those files; the updated open-source files which I released in 2019; the T1 files I'm half-way through posting now, but can't remember where I have got to. :(

The answer to your specific question is no. For legal reasons Templot doesn't use the internet connection until you click the GO button, which is then an informed click after reading the note above it:

go_connect.png


Ignore the old_ part of old_startup_form. It is the current startup splash:

startup_form.png


As far as I can remember there was a new_startup_form about the time the Pyramids were being built, but I reverted to the previous one. What was in the new one I no longer have the faintest idea. I don't think it was ever released.

This form is in startup_unit.pas

While it is displayed Templot does some housekeeping, such as checking for multiple instances, doing the DPI scaling for the program size function, detecting which version of Windows it is running under, detecting if it is running under Wine, making sure there is a default printer, etc.

Some or all of this is/was redacted or commented-out from the open-source files but it would take me all day to discover exactly what was done in each version.

I assume the T3 program will have its own "check for updates" functions independent of the Templot web site, but what or how that will work I don't know -- over to you.

cheers,

Martin.
 
_______________
message ref: 2729

graeme

Member
Location
Bangkok
Hi Martin,

Thanks for this.

Yes, there is a lot of code there, and many changes over the years.

On the plus side, we are able to get rid of some things. Since we are attempting to make this cross-platform, Wine does not come into the equation, so we will be able to remove all the Wine-related code ... in the fullness of time, of course. 😁
 
_______________
message ref: 2760

graeme

Member
Location
Bangkok
Well it seems I was unduly pessimistic of what would work on Linux. Box files can be saved and read in, and best of all, printing looks to be working too!

One change in the code that I have not yet been able to fathom, @Martin, is that in many forms (about 25 of them) the initial height and width settings have been removed. I have tried replacing the settings and all seems to work OK, so I just wondered if you recall why you commented them out.

Cheers,

Graeme
 
_______________
message ref: 2812

Martin Wynne

Admin
Location
West of the Severn UK
Info
Please do not send requests for help direct to me via email.

Post your questions on the forum where everyone can see them and add helpful replies.
One change in the code that I have not yet been able to fathom, @Martin, is that in many forms (about 25 of them) the initial height and width settings have been removed. I have tried replacing the settings and all seems to work OK, so I just wondered if you recall why you commented them out.
@graeme

Hi Graeme,

In Delphi5, in all the form OnCreate events, I set the ClientWidth and ClientHeight to the design size, and leave Windows to adjust the overall form size to suit. This is because different versions of Windows have used varying border widths over the years, from the thick bubble-gum look, Aero, and now Windows10 with a single line narrow border. If you set the overall form size, you get different client sizes in different Windows versions, and annoying scroll bars appear in versions with wide borders.

In Lazarus, for no reason I could fathom, client size is read-only, so it was a mess. Or some such reason why my Delphi5 code wouldn't work with the DPI scaling. I commented out any size settings that I had been playing with and left the design-time sizes in the lfm file. At the time, my main aim was to get Lazarus to compile and run. Fixing the cosmetic details I left for the future.

Good to hear that you are making good progress on Linux. :)

cheers,

Martin.
 
_______________
message ref: 2813
Top