mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
language: Add expression literals
Add expression literals, so you can set properties of type Gtk.Expression.
This commit is contained in:
parent
b9f58aeab5
commit
8c6f8760f7
29 changed files with 268 additions and 21 deletions
9
tests/samples/bind_expr_prop.blp
Normal file
9
tests/samples/bind_expr_prop.blp
Normal file
|
@ -0,0 +1,9 @@
|
|||
using Gtk 4.0;
|
||||
|
||||
BoolFilter filter1 {
|
||||
expression: expr true;
|
||||
}
|
||||
|
||||
BoolFilter filter2 {
|
||||
expression: bind filter1.expression;
|
||||
}
|
17
tests/samples/bind_expr_prop.ui
Normal file
17
tests/samples/bind_expr_prop.ui
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
DO NOT EDIT!
|
||||
This file was @generated by blueprint-compiler. Instead, edit the
|
||||
corresponding .blp file and regenerate this file with blueprint-compiler.
|
||||
-->
|
||||
<interface>
|
||||
<requires lib="gtk" version="4.0"/>
|
||||
<object class="GtkBoolFilter" id="filter1">
|
||||
<property name="expression">
|
||||
<constant type="gboolean">true</constant>
|
||||
</property>
|
||||
</object>
|
||||
<object class="GtkBoolFilter" id="filter2">
|
||||
<property name="expression" bind-source="filter1" bind-property="expression" bind-flags="sync-create"/>
|
||||
</object>
|
||||
</interface>
|
5
tests/samples/bind_literal.blp
Normal file
5
tests/samples/bind_literal.blp
Normal file
|
@ -0,0 +1,5 @@
|
|||
using Gtk 4.0;
|
||||
|
||||
Label {
|
||||
label: bind "Hello, world!";
|
||||
}
|
14
tests/samples/bind_literal.ui
Normal file
14
tests/samples/bind_literal.ui
Normal file
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
DO NOT EDIT!
|
||||
This file was @generated by blueprint-compiler. Instead, edit the
|
||||
corresponding .blp file and regenerate this file with blueprint-compiler.
|
||||
-->
|
||||
<interface>
|
||||
<requires lib="gtk" version="4.0"/>
|
||||
<object class="GtkLabel">
|
||||
<binding name="label">
|
||||
<constant type="gchararray">Hello, world!</constant>
|
||||
</binding>
|
||||
</object>
|
||||
</interface>
|
5
tests/samples/expr_value.blp
Normal file
5
tests/samples/expr_value.blp
Normal file
|
@ -0,0 +1,5 @@
|
|||
using Gtk 4.0;
|
||||
|
||||
BoolFilter {
|
||||
expression: expr item as <Entry>.visible;
|
||||
}
|
14
tests/samples/expr_value.ui
Normal file
14
tests/samples/expr_value.ui
Normal file
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
DO NOT EDIT!
|
||||
This file was @generated by blueprint-compiler. Instead, edit the
|
||||
corresponding .blp file and regenerate this file with blueprint-compiler.
|
||||
-->
|
||||
<interface>
|
||||
<requires lib="gtk" version="4.0"/>
|
||||
<object class="GtkBoolFilter">
|
||||
<property name="expression">
|
||||
<lookup name="visible" type="GtkEntry"></lookup>
|
||||
</property>
|
||||
</object>
|
||||
</interface>
|
5
tests/samples/expr_value_closure.blp
Normal file
5
tests/samples/expr_value_closure.blp
Normal file
|
@ -0,0 +1,5 @@
|
|||
using Gtk 4.0;
|
||||
|
||||
BoolFilter {
|
||||
expression: expr $closure(item as <Entry>.visible) as <bool>;
|
||||
}
|
16
tests/samples/expr_value_closure.ui
Normal file
16
tests/samples/expr_value_closure.ui
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
DO NOT EDIT!
|
||||
This file was @generated by blueprint-compiler. Instead, edit the
|
||||
corresponding .blp file and regenerate this file with blueprint-compiler.
|
||||
-->
|
||||
<interface>
|
||||
<requires lib="gtk" version="4.0"/>
|
||||
<object class="GtkBoolFilter">
|
||||
<property name="expression">
|
||||
<closure function="closure" type="gboolean">
|
||||
<lookup name="visible" type="GtkEntry"></lookup>
|
||||
</closure>
|
||||
</property>
|
||||
</object>
|
||||
</interface>
|
5
tests/samples/expr_value_literal.blp
Normal file
5
tests/samples/expr_value_literal.blp
Normal file
|
@ -0,0 +1,5 @@
|
|||
using Gtk 4.0;
|
||||
|
||||
BoolFilter {
|
||||
expression: expr true;
|
||||
}
|
14
tests/samples/expr_value_literal.ui
Normal file
14
tests/samples/expr_value_literal.ui
Normal file
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
DO NOT EDIT!
|
||||
This file was @generated by blueprint-compiler. Instead, edit the
|
||||
corresponding .blp file and regenerate this file with blueprint-compiler.
|
||||
-->
|
||||
<interface>
|
||||
<requires lib="gtk" version="4.0"/>
|
||||
<object class="GtkBoolFilter">
|
||||
<property name="expression">
|
||||
<constant type="gboolean">true</constant>
|
||||
</property>
|
||||
</object>
|
||||
</interface>
|
Loading…
Add table
Add a link
Reference in a new issue