Is there any diagram which shows the functional parts of FPC and another from Lazarus?
No, not really. Free Pascal units are about the language and basic functionality that is used from the command-line, so file handling, serial/parallel interface, memory management, database access, SDL/GL, networking, TUI interface etc. though there are units available that help in manually writing GUI interfaces for example cocoa, gtk, Windows etc (in case you like to punish yourself).
Lazarus is more about the GUI itself (components, interfaces), though there are also some generic units that imho belong to Free Pascal because they are basically non visual components or offer no components at all (just classes/objects/additions).
In addition which folders belong to which parts of that daigram.
Oh, you can see that for yourself pretty quick by installing Free Pascal and Lazarus separately. FPC uses it's own units, while all things belonging to Lazarus is situated in the Lazarus directories.
I do no believe there is such a diagram. There is one for all components and their inheritance though (it is part of the Lazarus IDE).
For the Lazarus IDE is there a part that is used to implement the graphical user interface and another one for the widget support?
Bit of a trick question as the IDE itself is something else than Lazarus (it is rather part of).
There is a clear separation between:
- GUI, the components used to write/design applications, which is widgetset independent (at least should be).
- The widgetset, which is a front-end for the GUI offered by the OS so its actual implementation has all the gory details)
- The IDE which is an application written/designed in/with Lazarus that uses GUI components but also allows you to use those components at designtime to resize and assign their events, properties etc which is done by interacting with your source-code using the object inspector (amongst others).
So what you usually do is find a existing widgetset that you are familiar with, say for example windows, look at the widgetset implementation (understand the calls made to windows functionality) and re-implement the behaviour of a widget using your OS offered GUI.
Lazarus itself (actually it is Free Pascal) has proficiency for storing resources in an application. If your OS offers the graphical bits itself (windows does for example with icons' etc) then you do not have to include those in your application but just use the corresponding windows settings to for example draw a messagebox with an exclamation mark).
As a hint, one of the first things you would have to do when implementing support for a new widgetset is implementing the canvas (which is a drawing surface). All other functionality of a component (graphical wise) is based on that.
The Lazarus widgets are basically an extented version of the RISC OS toolbox as it includes also more powerful widgets like database access etc. The Lazarus "Toolbox" should use the standard RISC OS files like res (Resource) files (Window, bar and menu definitions) and sprites (for icons and images).
As mentioned above. Lazarus is not designed to implement OS specific features in its offered components, rather you need to make sure that existing components behave the same on your OS/GUI. Having said that, i had also already stated that whenever that is not an option, that it is possible to make your own widget implementation tailured for only your OS but in that case you won't be able to use the IDE to design your applications since it will not be using the offered components in that case (I have not seen a platform yes that went out of its way and offer platform specific visual components, but someone please correct if I'm wrong about that).
There is also an alternative solution, named
fpGUI toolkit (not to be confused with the fpGUI interface for Lazarus) which does not adapt their widgets to/from the OS but implement widgets in a way that they all look/behave exactly similar, no matter what target you choose, so they are fully custom drawn (Lazarus also has some custom drawn components that so not obey OS rules/standards).
Maybe a converter tool can help here. What are the policies of Lazarus here?
Hopefully that gives you some insight but understand that it is only a /little/ insight. It will simply take too much time to explain everything and in practice it is much faster to have a look at the code (but it will take some time to get yourself familiar with it especially when it comes to the "gory" details).
For more information:
-
Development status for the individual widgetsets-
Adding a new interface (that page also contains other links of importance such as "Lazarus known issues (things that will never be fixed) - A list of interface compatibility issues"