Bemutatkozott a Blueprint — az új nyelv a GTK felhasználói felületek építésére.

James Westman, a developer of the GNOME Maps application, presented a new markup language called Blueprint, designed for building interfaces using the GTK library. The compiler code for transforming 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 the GTK ui-files describing the interface to the XML format, which is overloaded and inconvenient for writing or editing markup manually. The Blueprint format differs in the clarity of information presentation and, thanks to its readable syntax, allows for the creation, editing, and evaluation of changes in interface elements without needing specialized visual interface editors.

Additionally, Blueprint does not require changes to GTK, fully replicates the GTK widget model, and is positioned as an add-on that compiles the markup into the standard XML format for GtkBuilder. The functional capabilities of Blueprint fully correspond to GtkBuilder; it only differs in the method of information presentation. To convert a project to Blueprint, it is sufficient to add a call to the blueprint-compiler in 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!»); } }

Bemutatásra került a Blueprint - új nyelv a GTK felhasználói felületek készítéséhez

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

Among the plans for developing Blueprint is the addition of reactive programming elements to the markup, implemented using the Gtk.Expression class provided in GTK4. The proposed method is more familiar to web interface developers in JavaScript and allows for automatic synchronization of the interface presentation with the associated data model without the need for forced updates to the user interface after each data change.

Forrás: opennet.ru

Megbízható hosting vásárlása weboldalak számára, DDoS védelemmel, VPS VDS szerverek. 🔥 Megbízható webtárhely vásárlása DDoS védelemmel, VPS VDS szerverek | ProHoster