Blueprint, a new user interface language for GTK, is introduced

James Westman, developer of the GNOME Maps application, has introduced a new markup language, Blueprint, for building interfaces using the GTK library. The compiler code for converting Blueprint markup into GTK ui files is written in Python and distributed under the LGPLv3 license.

The reason for creating the project is the binding of interface description ui-files used in GTK to the XML format, which is overloaded and not convenient for writing or editing markup manually. The Blueprint format is distinguished by the visual presentation of information and, thanks to its readable syntax, makes it possible to do without the use of specialized visual interface editors when creating, editing and evaluating changes in interface elements.

At the same time, Blueprint does not require any changes to GTK, it completely repeats the GTK widget model and is positioned as an add-on that compiles markup into the standard XML format for GtkBuilder. The functionality of Blueprint is exactly the same as GtkBuilder, only the way the information is presented is different. To translate a project to Blueprint, just add a call to blueprint-compiler to the build script without changing the code. using GTK 4.0; template MyAppWindow : Gtk.ApplicationWindow { title: _("My App Title"); [titlebar] HeaderBar header_bar {} Label { styles ["heading"] label: _("Hello, world!"); } }

Blueprint, a new user interface language for GTK, is introduced

In addition to the compiler to the standard GTK XML format, a plugin with Blueprint support for the GNOME Builder integrated development environment is also under development. A separate LSP (Language Server Protocol) server is being developed for Blueprint, which can be used for highlighting, error analysis, prompting and code completion in code editors that support LSP, including Visual Studio Code.

Blueprint's development plans include adding reactive programming elements to the markup, implemented using the Gtk.Expression class provided in GTK4. The proposed method is more familiar to JavaScript web interface developers and allows you to achieve automatic synchronization of the interface view with the associated data model, without the need to force a user interface update after each data change.

Source: opennet.ru

Add a comment