mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
language: Add not-swapped flag for signals
This is needed because GtkBuilder defaults to swapped when you specify the object attribute.
This commit is contained in:
parent
9b9fab832b
commit
a6d57cebec
10 changed files with 72 additions and 8 deletions
5
tests/sample_errors/signal_exclusive_flags.blp
Normal file
5
tests/sample_errors/signal_exclusive_flags.blp
Normal file
|
@ -0,0 +1,5 @@
|
|||
using Gtk 4.0;
|
||||
|
||||
$MyObject obj {
|
||||
signal1 => $handler() swapped not-swapped;
|
||||
}
|
1
tests/sample_errors/signal_exclusive_flags.err
Normal file
1
tests/sample_errors/signal_exclusive_flags.err
Normal file
|
@ -0,0 +1 @@
|
|||
4,33,11,'swapped' and 'not-swapped' flags cannot be used together
|
6
tests/sample_errors/signal_unnecessary_flags.blp
Normal file
6
tests/sample_errors/signal_unnecessary_flags.blp
Normal file
|
@ -0,0 +1,6 @@
|
|||
using Gtk 4.0;
|
||||
|
||||
$MyObject obj {
|
||||
signal1 => $handler() not-swapped;
|
||||
signal2 => $handler(obj) swapped;
|
||||
}
|
2
tests/sample_errors/signal_unnecessary_flags.err
Normal file
2
tests/sample_errors/signal_unnecessary_flags.err
Normal file
|
@ -0,0 +1,2 @@
|
|||
4,25,11,'not-swapped' is the default for handlers that do not specify an object
|
||||
5,28,7,'swapped' is the default for handlers that specify an object
|
5
tests/samples/signal_not_swapped.blp
Normal file
5
tests/samples/signal_not_swapped.blp
Normal file
|
@ -0,0 +1,5 @@
|
|||
using Gtk 4.0;
|
||||
|
||||
Button obj {
|
||||
clicked => $handler(obj) not-swapped;
|
||||
}
|
12
tests/samples/signal_not_swapped.ui
Normal file
12
tests/samples/signal_not_swapped.ui
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?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="GtkButton" id="obj">
|
||||
<signal name="clicked" handler="handler" swapped="False" object="obj"/>
|
||||
</object>
|
||||
</interface>
|
|
@ -200,6 +200,7 @@ class TestSamples(unittest.TestCase):
|
|||
"expr_closure_args",
|
||||
"parseable",
|
||||
"signal",
|
||||
"signal_not_swapped",
|
||||
"template",
|
||||
"template_binding",
|
||||
"template_binding_extern",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue