[fpc-devel] TCustomApplication

Michael Schnell mschnell at lumino.de
Mon Aug 19 11:19:47 CEST 2013


Hi Experts.

Since ages I am searching  for an "easy" method to do "normal (i.e. 
"event driven") Pascal programming using Lazarus as an IDE and targeting 
headless embedded devices (with no GUI hardware and/or GUI software 
infrastructure).

I understand that the fpc RTL already provides TCustomApplication (while 
Lazarus creates descendants from same to do "Lazarus Applications" - of 
several kinds,  definable by Lazarus "WidgetTypes" - in the LCL).

Now, unfortunately, there is no predefined "WidgetType" that out of the 
box allows for event driven programming using "normal" stuff like 
TTimer, TThread.Synchronize, TThread,Queue, and 
Application.QueuAsnycCall without forcing a GUI binding (while all this 
seems to be possible with mseide).

In fact some years ago I tried to create  an LCL Widget Type like that, 
using the "Lazarus Way", but failed due to the complexity of the LCL.

I understand that (without using the LCL at all), in the RTL, it is 
possible to do e.g. an "Application" that provides at least one timer 
(see testtimer.pp) or things like a "DaemonApplication (see 
daemonapp.pp). At least the "DaemonApplication" seems to auto-adapt to 
Linux or Windows while being compiled.

But here it seems, the application programmer needs to dedicatedly 
tailor his code for a very special kind of application himself.

Is there (or would it be viable to have in an LCL-independent package) a 
more general "TCustomApplication" descendant such as "TApplication" or 
similar, that (auto-adapting to Linux and Windows when being compiled) 
provides TTimer, TThread.Synchronize, TThread,Queue, and 
Application.QueuAsnycCall, while allowing for decent "event driven" 
programming ? Here a decent (OS-dependent) mechanism needs to be 
implemented to notify the main thread of timer and Thread generated 
events so that it is able to try to fetch the next event from the queue 
as soon as possible after (and only when) at least one has been generated.

I would happily try to do something like that myself, but at least for 
the rest of this year I will not find the time :( . But as this thought 
comes in my mind, I now try to collect information on this issue.

Thanks,
-Michael



More information about the fpc-devel mailing list