VCL Weld Mechanism

    From The Document Foundation Wiki

    Introduction

    In early LibreOffice versions, and before that in OpenOffice, the user interface was created in the code, and the visual appearance of the application was different from the native applications on every platform. That was problematic because of the complexity of creating and modifying the user interfaces, and also the non-native look and feel.

    In order to add native widget support and also simplify user interface creation in LibreOffice, Caolán McNamara introduced a mechanism to load UI files created with Glade interface designer, and use them as if they are UI files for each and every GUI framework that LibreOffice supports: from GTK to Qt, Windows, macOS and even the so-called gen backend that only requires the X11 library on Linux.

    Through the welding mechanism, VCL can use native widgets to create user interfaces. In backends that do not use native widgets, VCL creates the widgets itself, and then uses theming to emulate the native desktop appearance. With the introduction of VCL API, now there are no direct usages of VCL dialog APIs. More details on how this applies to the GTK3 backend can be found in [3]. As described there, "non-dialog utility windows and other elements" might be remaining, but dialogs are already complete in the GTK3 backend since late 2019.

    Links

    1. LibreOffice and Native Gtk Widgets, LibreOffice conference 2020, Caolán McNamara: PDF slides / video.

    2. LibreOffice Native GTK Dialog Status, Caolán McNamara, 2019

    3. Some Native GTK Dialogs in LibreOffice, Caolán McNamara, 2018