Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2002-06

Lazarus-project

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Unknown author

Dear Lazarus team,

Being interested in the Lazarus project, I want to study the source code and hope to contribute some time myself.

Having started now, I wrote a document about what I already know in order to be useful to other starters and also in order to ask you for how to proceed. I attached it in this mail in KWord/HTML format.

Some questions still arise for me:

- What's the status of the LCL itself? Is that stable? Is it exactly Delphi's?
- What parts of Lazarus are developed in Lazarus itself?

Sincerely,

Josse Colpaert

(Mail: )

Title: lazarus.html

The Lazarus IDE: How the program is being built
�
1 General ideas
�
The program uses as the programs in itself the LCL or Lazarus Component Library, which can be seen as the replacement of the VCL or Visual Component Library in Delphi/Kylix. Also, some extra file extensions are necessary: the .lfm-file or Lazarus Form, the .lpr-file or Lazarus Project file, the .lrs or Lazarus Resource file. �
2 How the program starts
�
The program starts from the file lazarus.pp. In that file, you can find between begin and end. how the application starts. In the uses clause you will find the units directly associated with that code. And maybe it's not a bad thing to start explaining what each unit stands for. �
�
uses
{$IFDEF IDE_MEM_CHECK}
MemCheck,
{$ENDIF}
Forms,
Splash,
Main,
MainBar,
MsgView,
FindReplaceDialog,
FindInFilesDlg,

  aboutfrm;

�
Forms is a unit out of the LCL, so can be compared to the Delphi Forms unit. It contains the code to start an application which uses the LCL and contains the classes TForm, TCustomForm, TApplication, TScreen, THintWindow. Application is a variable out of that unit and Application.Initialize will start that application and take control over event-handling and such. �
The rest of the units are from Lazarus itself. The Splash unit contains the splashing form with the Lazarus symbol appearing when you start the Lazarus IDE. The other units (except Main/Mainbar) are also for forms and are here to create them within the application. �
MainBar contains the TMainIDEBar class and main.pp the TMainIDE class. �
The TMainIDE has the following inheritance scheme: �
TObject -> TCustomForm -> TForm -> TMainIDEBar -> TMainIDE �
I copied the code out of lazarus.pp and wrote some extra comments in it: �
begin
Application.Initialize; {Initializes the application as an LCL-application and lets LCL take control} TMainIde.ParseCmdLineOptions; {TMainIDE from MainIDE, parsing the command-line options} �

  // Show splashform
  SplashForm := TSplashForm.Create(nil);
  with SplashForm do begin
    Show;
    Paint;
  end;
  Application.ProcessMessages; // process splash paint message

�

  Application.CreateForm(TMainIDE, MainIDE); //MainIDE is a variable out of TMainIDEBar
  {$IFDEF IDE_MEM_CHECK}
  CheckHeap('TMainIDE created');
  {$ENDIF}

�
{Creating those forms associated with the units}

  Application.CreateForm(TMessagesView, MessagesView);//MessagesView will be a variable out of the unit MsgView

�

  Application.CreateForm(TLazFindReplaceDialog, FindReplaceDlg);
  Application.CreateForm(TLazFindInFilesDialog, FindInFilesDialog);
  SplashForm.StartTimer;
  Application.Run;
  SplashForm.Free;

�

  writeln('LAZARUS END');

end.
�
�

-------------- next part --------------
A non-text attachment was scrubbed...
Name: bin00014.bin
Type: application/octet-stream
Size: 3701 bytes
Desc: "LazarusIDEinternals.doc"
Url : http://localhost/pipermail/lazarus/attachments/20020627/8cbd5076/bin00014.bin

Reply by email

Mattias Gaertner
to Unknown author
Dear Lazarus team, Being interested in the Lazarus project, I want to study the source code and hope to contribute some time myself.

Great.

Having started now, I wrote a document about what I already know in order to be useful to other starters and also in order to ask you for how to proceed. I attached it in this mail in KWord/HTML format.

I like your idea to explain, what can be found in what file. But I think, your description of lazarus.pp is too detailed. This is a good introduction to an LCL program. But I think, people who wants to help improving the IDE will probably know basic lcl programs. Some ideas how to proceed:
- write an overview of the classes (location and short description)
- write comments for methods and variables

Some questions still arise for me: - What's the status of the LCL itself? Is that stable? Is it exactly Delphi's?

The LCL is OS- and widget-independent. Delphi's VCL has some win32 specific parts (e.g. images, clipboard). But the LCL tends to provide nearly the same API as the VCL. Internally it maps everything to the widget interfaces. The gtk interface is usable, although there are some bugs left. The win32 interface can already be used for simple applications, but the IDE for example does not run yet. The gtk2 interface will be started soon. The qt interface is outdated, since we have no developer for it. So, the LCL as whole is not stable, but most components are.

- What parts of Lazarus are developed in Lazarus itself?

Nearly everything. I'm developing lazarus exclusively with lazarus.

Mattias

Reply by email