[Lazarus] Porting Delphi to Lazarus

drew einhorn drew.einhorn at gmail.com
Sat Mar 15 02:45:34 CET 2008


On Fri, Mar 14, 2008 at 6:53 PM, Luiz Americo Pereira Camara <
luizmed at oi.com.br> wrote:

> drew einhorn wrote:
> > Hi,
> >
> > I'm organizing a team attending Health Jam Seattle
> > April 18-20
> >
> >     http://wiki.laptop.org/go/Health_Jam
> >
> > We will be porting the VA's VistA software frontends
> > to Lazarus/Free Pascal.  VistA is the IT infrastructure
> > that runs the VA's hospitals, nursing homes, and clinics.
> > It includes a complete Electronic Medical Record System.
> >
> >     http://wiki.laptop.org/go/WorldVistA#VistA
> >
> > We are hoping some Lazarus/Free Pascal developers will join us.
>
> I have some experience in porting Delphi components to LCL (See
> https://luipack.bountysource.com/) and i would be happy in helping.
> See some notes below


Cool!  Are you considering joining us in Seattle, or just helping out
online?   I'm expecting Seattle to be a lot of fun.


> Will the code be shared between Delphi and Lazarus or it will be a fork?
> In the former option the work is harder.
>

I'm assuming it will all eventually get merged into the main Lazarus
project.
I don't think any code will go into Delphi.
Hope there is no need for any fork.


>
> >
> > We hope to have gotten past compilation issues by the
> > HealthJam, and be focusing on the necessary VCL
> > components missing from LCL.  But we may still
> > be fighting compilation issues.
> >
> > Been resisting the urge trying to extract the VCL calls
> > from the code.  Been hoping to get through the compilations
> > and get the linker or somthing to give me a count.
> >
> > Folks who are familiar with the CPRS code to a quick look at:
> >
> >     http://wiki.freepascal.org/Lazarus_Components
> >
> > And noticed TFrame and TRichEdit are missing.
> > There's almost certainly more.
>
> TFrame is easy to be ported but you are in trouble with TRichEdit. I
> already researched for a TRichEdit control that does not relies in
> native win32 control and only found comercial
> (http://www.trichview.com/). There's a port from a old version (
> http://wiki.lazarus.freepascal.org/RichView) but is read only. An
> alternative way is to find a suitable gtk2 control (i don't know any) an
> write a wrapper around it.
>
> Another issue is if gtk1 widgetset is suitable for such work. I don't
> know if XO supports gtk1. The gtk2 widgetset is not as good as gtk1.
>

Glad to hear TFrame is easy.

Don't care if it's really RichEdit underneath as long as we can come
up with something that provides the user with similar functions, and
we can write wrappers that reproduce the TRichEdit API so we don't
have to tweak a lot of existing code.  Before I discovered how well
the Lazarus does with "Convert Delphi ...", I was considering a
Coco/R <http://www.ssw.uni-linz.ac.at/Research/Projects/Coco/> based
approach for translating one Pascal dialect to another.
We may need to fall back to this if we have to translate from one
API to another.  (Or we may strip down the Lazarus parser and
use it as the basis for a translator.

Will try a: yum install gtk1 on my XO and see what happens.
Hmm.  I have a vague recollection of trying something like that
before and having problems because the gtk packages had "funny"
names not quite what you might guess.  Maybe, it was some
other package.  We'll see.



>
> >
> > I made a couple stabs at converting to Lazarus.
> >
> > Most recent on a Ubuntu box using the testing repos
> >
> >     lazarus 0.9.24 beta 5/11/07
> >     free pascal  2.2.0-1
> >
> > Getting "safecall" errors at compile time.  I see stuff in the
> > bug tracker about "safecall" runtime issues not resolve till
> > 2.3.1
> >
> > So next thing I need to do is find the right vintage of Lazarus/Free
> > Pascal.
>
> Can you post a link to the code, so i can take a look?
>

  Felipe Monteiro de Carvalho suggested

If you are going to Linux you probably don't need safecall anyway, and
you can ifdef it out for FPC:

{$ifndef fpc}safecall;{$endif}

I then asked if there was a good place to stuff this incantation so that it
applies to an entire project.

-- 
Drew Einhorn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20080314/15b53077/attachment-0007.html>


More information about the Lazarus mailing list