On Wed, 15 Feb 2006 12:00:39 -0300
Alexsander Rosa <[EMAIL PROTECTED]> wrote:
> After a few "quick looks", I do not fully understand the structure of the
> Lazarus source code. I would be easier for me if I could start a separate
> application for early limited tests and, after it proves itself worthy,
> someone more familiar with Lazarus source tree could help me to integrate
> the tool into the IDE.
Of course, reinventing the wheel is much easier at the beginning.
And for simple Delphi sources, without packages, include files, IFDEFs, etc.
a simple converter could be written quite easily.
So, please continue, but keep in mind to write it as modules and/or package.
This way we can later add some designtime features, so the converter can be
extended to use the IDE package system. Then more complex Delphi
projects/packages can be converted too.
> IMHO, main.pp is a bit "crowded". More comments below.
main.pp is a monster.
Eventually the source editor stuff and the form editor stuff will become
separate parts.
> 2006/2/14, Mattias Gaertner <[EMAIL PROTECTED]>:
> >
> > On Tue, 14 Feb 2006 17:22:21 -0300
> > Alexsander Rosa <[EMAIL PROTECTED]> wrote:
> >
> > > (...) I was thinking about a different design, where the typical use
> > > would be:
> > >
> > > 1) Select a directory where the Delphi project is
> >
> > 1b) Open in the Lazarus IDE a Delphi project
>
>
> This would be nice, too. Seems easy to add this feature after the tool is
> ready.
>
> > 2) Click "Convert to Lazarus"
> > > 3) Watch the progress bar run ;-)
> > >
> > > Optionally, the user could specify two places: LCL_DIR and VCL_DIR,
> > where
> > > the tool would read the classes to get the available properties,
> > removing
> > > them from the DFM files (and commenting out in the PAS files). A
> > > "translation table" could be used to replace the property instead of
> > > removing the entire line from the DFM. In the PAS files, the Uses
> > section
> > > would be corrected, and so on.
> > >
> > > I would like to start coding as soon as possible, but I'm putting this
> > > here in order to discuss this design and get ideas.
> >
> > About LCL_DIR and VCL_DIR:
> > - The tool must work without Delphi sources too.
> > - The tool should also work with Delphi packages.
> > - The tool should also convert Delphi projects, which require packages.
> > A LCL_DIR is not enough.
> >
> > The idea is that:
> > It first scans the project for required packages and searches
> > corresponding
> > lazarus packages.
> > Then it loads the needed packages.
> > Then it scans for search paths and compiler options.
> > Then it converts each .pas file and does a simple conversion of the .dfm
> > to
> > .lfm files.
> > Then it searches for all used classes in the .lfm files and collects all
> > properties.
> > Then it finishes the conversion of the .lfm files.
>
>
> About packages: there's a huge number of standard and third-party packages
> available for Delphi, many of them have similar counterparts for Lazarus,
> others are unique. How the tool would solve that? A simple solution (for
> version 1.0) is to have a database of Delphi third-party packages with the
> provided functionality: after the first scan, the tool would show a report
> of what needs to be installed on Lazarus, what is compatible, what is
> similar, etc.
Yes.
Or a simple heuristic: If a unit is missing and a lazarus package contains a
unit with this name, suggest the user to add this package to the
requirements of the new lazarus project.
But this can be added later. Just keep the interface of the converter open
for additions. Aka add some events.
> The package stuff, the compiler options and the .lpi parts require so many
> > parts of the IDE, that it will be quite hard to create a separated
> > application. That's why I suggest to create instead a package with the
> > conversion functions. You can write a small application to test the
> > basic functions, like converting simple Delphi projects.
Mattias
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives