mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
language: Support boxed types and GType
- Add support for type checking boxed types - Remove support for converting string and number literals - Add the `typeof()` operator for GType literals
This commit is contained in:
parent
ee2b9b2950
commit
c0c40b1577
12 changed files with 140 additions and 26 deletions
|
@ -1,5 +1,14 @@
|
|||
using Gtk 4.0;
|
||||
using Gio 2.0;
|
||||
|
||||
Gtk.Shortcut {
|
||||
trigger: "Escape";
|
||||
}
|
||||
|
||||
Picture {
|
||||
paintable: "/path/to/paintable";
|
||||
}
|
||||
|
||||
ColorButton {
|
||||
rgba: "rgb(0, 0, 0)";
|
||||
}
|
|
@ -4,4 +4,10 @@
|
|||
<object class="GtkShortcut">
|
||||
<property name="trigger">Escape</property>
|
||||
</object>
|
||||
<object class="GtkPicture">
|
||||
<property name="paintable">/path/to/paintable</property>
|
||||
</object>
|
||||
<object class="GtkColorButton">
|
||||
<property name="rgba">rgb(0, 0, 0)</property>
|
||||
</object>
|
||||
</interface>
|
||||
|
|
11
tests/samples/typeof.blp
Normal file
11
tests/samples/typeof.blp
Normal file
|
@ -0,0 +1,11 @@
|
|||
using Gtk 4.0;
|
||||
using GObject 2.0;
|
||||
using Gio 2.0;
|
||||
|
||||
Gio.ListStore {
|
||||
item-type: typeof(GObject.Object);
|
||||
}
|
||||
|
||||
Gio.ListStore {
|
||||
item-type: typeof(.MyObject);
|
||||
}
|
10
tests/samples/typeof.ui
Normal file
10
tests/samples/typeof.ui
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<requires lib="gtk" version="4.0"/>
|
||||
<object class="GListStore">
|
||||
<property name="item-type">GObject</property>
|
||||
</object>
|
||||
<object class="GListStore">
|
||||
<property name="item-type">MyObject</property>
|
||||
</object>
|
||||
</interface>
|
Loading…
Add table
Add a link
Reference in a new issue