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
2.1 The program lazarus.pp
The program starts from the file lazarus.pp. In that file, you can find between begin and end. how the application starts. The program is a typical LCL program. As lots of you will know how such an application starts, we describe these details in Appendix A. Generally speaking, the command-line options are parsed, the Splash form is shown (afterwards removed), and four Forms are created: MainIDE, MessagesView, FindReplaceDlg and FindInFilesDlg. Interesting is also the inheritance scheme of TMainIDE: TObject -> TCustomForm -> TForm -> TMainIDEBar -> TMainIDE
2.2 main.pp: the TMainIDE class and TMainIDE.Create
As you would scroll through main.pp, you would notice that the unit is built around the one big class TMainIDE. TMainIDE compromises as it name implies, the main pieces of the IDE and all other pieces are indirectly related to it. So, the constructor of TMainIDE can be seen as the real start of the program. After the command-line options are parsed and the config path is initialized, the global options are loaded into their data structures: - EnvironmentOptions (TEnvironmentOptions) from the unit EnvironmentOpts contains general environment options. - EditorOptions (TEditorOptions) from the unit editoroptions contains options for the unit editor. - CodeToolOpts (TCodeToolOpts) from the unit codetoolsoptions contains code tool options. - InputHistories (TInputHistories) will keep track of what has already been done, so it can be undone, ... After that ToolStatus, which sets the IDE mode, is set into editable mode.