A markup language for GTK user interfaces. Docs: https://jwestman.pages.gitlab.gnome.org/blueprint-compiler/
Find a file
James Westman 06f54c8ff8
Use typelib instead of XML
For normal compilation, use .typelib files rather than .gir XML files.
This is much faster.

Rather than using libgirepository, which would try to actually load the
libraries, we use a custom parser.

The language server will still read XML because it needs to access
documentation, which is not in the typelib, but that's generally fine
because it's a long lived process and only has to do that once.
2022-06-25 00:15:20 -05:00
blueprintcompiler Use typelib instead of XML 2022-06-25 00:15:20 -05:00
build-aux tests: Add fuzz test 2022-04-18 20:22:31 -05:00
docs docs: Fix typo, add link 2022-05-27 12:18:00 -05:00
tests Use typelib instead of XML 2022-06-25 00:15:20 -05:00
.coveragerc tests: Exclude lines from coverage 2022-01-16 20:59:11 -06:00
.gitignore Remove references to gtk-blueprint-tool 2022-05-27 12:25:56 -05:00
.gitlab-ci.yml Use typelib instead of XML 2022-06-25 00:15:20 -05:00
blueprint-compiler.pc.in Rename to blueprint-compiler 2021-12-01 15:35:58 -06:00
blueprint-compiler.py Use typelib instead of XML 2022-06-25 00:15:20 -05:00
COPYING Initial commit 2021-10-17 15:26:34 -05:00
meson.build build: Set the module path in the build 2022-06-25 00:15:20 -05:00
meson_options.txt docs: Add examples 2021-10-27 00:31:49 -05:00
README.md readme: Add Matrix room link 2022-05-17 12:53:22 -05:00

Blueprint

A markup language for GTK user interface files.

Motivation

GtkBuilder XML format is quite verbose, and many app developers don't like using WYSIWYG editors for creating UIs. Blueprint files are intended to be a concise, easy-to-read format that makes it easier to create and edit GTK UIs.

Internally, it compiles to GtkBuilder XML as part of an app's build system. It adds no new features, just makes the features that exist more accessible.

Another goal is to have excellent developer tooling--including a language server--so that less knowledge of the format is required. Hopefully this will increase adoption of cool advanced features like GtkExpression.

Example

Here is what the libshumate demo's UI definition looks like ported to this new format:

using Gtk 4.0;
using Shumate 1.0;

template ShumateDemoWindow : Gtk.ApplicationWindow {
  can-focus: yes;
  title: _("Shumate Demo");
  default-width: 800;
  default-height: 600;

  [titlebar]
  Gtk.HeaderBar {
    Gtk.DropDown layers_dropdown {
      notify::selected => on_layers_dropdown_notify_selected() swapped;
    }
  }

  Gtk.Overlay overlay {
    vexpand: true;
    Shumate.Map map {}

    [overlay]
    Shumate.Scale scale {
      halign: start;
      valign: end;
    }

    [overlay]
    Gtk.Box {
      orientation: vertical;
      halign: end;
      valign: end;

      Shumate.Compass compass {
        halign: end;
        map: map;
      }
      Shumate.License license {
        halign: end;
      }
    }
  }
}

Editor plugins

Vim

License

Copyright (C) 2021 James Westman james@jwestman.net

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program. If not, see https://www.gnu.org/licenses/.

Donate

You can support my work on GitHub Sponsors! https://github.com/sponsors/jameswestman

Getting in Touch

Matrix room: #blueprint-language:matrix.org