decompiler: Implement support for bindings

The .ui files for tests were taken from GTK test suite.
This commit is contained in:
Jan Tojnar 2023-11-18 21:06:03 +01:00
parent 479fe17589
commit 7fc367e644
18 changed files with 172 additions and 0 deletions

View file

@ -0,0 +1,5 @@
using Gtk 4.0;
DropDown {
expression: bla as <gchararray> ;
}

View file

@ -0,0 +1,7 @@
<interface>
<object class="GtkDropDown">
<property name="expression">
<constant type="gchararray">bla</constant>
</property>
</object>
</interface>

View file

@ -0,0 +1,5 @@
using Gtk 4.0;
DropDown {
expression: bla as <gint> ;
}

View file

@ -0,0 +1,7 @@
<interface>
<object class="GtkDropDown">
<property name="expression">
<constant type="gint">bla</constant>
</property>
</object>
</interface>

View file

@ -0,0 +1,5 @@
using Gtk 4.0;
DropDown {
expression: bla ;
}

View file

@ -0,0 +1,7 @@
<interface>
<object class="GtkDropDown">
<property name="expression">
<constant>bla</constant>
</property>
</object>
</interface>

View file

@ -0,0 +1,5 @@
using Gtk 4.0;
DropDown {
expression: bla as <nosuchtype> ;
}

View file

@ -0,0 +1,7 @@
<interface>
<object class="GtkDropDown">
<property name="expression">
<constant type="nosuchtype">bla</constant>
</property>
</object>
</interface>

View file

@ -0,0 +1,8 @@
using Gtk 4.0;
Label bla {
}
DropDown {
expression: bla.label ;
}

View file

@ -0,0 +1,8 @@
<interface>
<object class="GtkLabel" id="bla"/>
<object class="GtkDropDown">
<property name="expression">
<lookup name="label">bla</lookup>
</property>
</object>
</interface>

View file

@ -0,0 +1,8 @@
using Gtk 4.0;
Label bla {
}
DropDown {
expression: bla as <GtkLabel>.label ;
}

View file

@ -0,0 +1,8 @@
<interface>
<object class="GtkLabel" id="bla"/>
<object class="GtkDropDown">
<property name="expression">
<lookup name="label" type="GtkLabel">bla</lookup>
</property>
</object>
</interface>

View file

@ -0,0 +1,8 @@
using Gtk 4.0;
Label bla {
}
DropDown {
expression: bla as <GtkLabel>.label ;
}

10
tests/samples/binding7.ui Normal file
View file

@ -0,0 +1,10 @@
<interface>
<object class="GtkLabel" id="bla"/>
<object class="GtkDropDown">
<property name="expression">
<lookup name="label">
<constant type="GtkLabel">bla</constant>
</lookup>
</property>
</object>
</interface>

View file

@ -0,0 +1,8 @@
using Gtk 4.0;
Label bla {
}
DropDown {
expression: strcmp('File size:', bla as <GtkLabel>.max-width-chars) as <gchararray>;
}

11
tests/samples/binding8.ui Normal file
View file

@ -0,0 +1,11 @@
<interface>
<object class="GtkLabel" id="bla"/>
<object class="GtkDropDown">
<property name="expression">
<closure type='gchararray' function="strcmp">
<constant type="gchararray">File size:</constant>
<lookup type="GtkLabel" name="max-width-chars">bla</lookup>
</closure>
</property>
</object>
</interface>