mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
Remove PropertyBinding rule, just use Binding
This commit is contained in:
parent
abc4e5de65
commit
0a4b5d07a1
16 changed files with 100 additions and 179 deletions
|
@ -116,27 +116,21 @@ class XmlOutput(OutputFormat):
|
|||
if simple := value.simple_binding:
|
||||
props["bind-source"] = self._object_id(value, simple.source)
|
||||
props["bind-property"] = simple.property_name
|
||||
props["bind-flags"] = "sync-create"
|
||||
flags = []
|
||||
if not simple.no_sync_create:
|
||||
flags.append("sync-create")
|
||||
if simple.inverted:
|
||||
flags.append("invert-boolean")
|
||||
if simple.bidirectional:
|
||||
flags.append("bidirectional")
|
||||
props["bind-flags"] = "|".join(flags) or None
|
||||
|
||||
xml.put_self_closing("property", **props)
|
||||
else:
|
||||
xml.start_tag("binding", **props)
|
||||
self._emit_expression(value.expression, xml)
|
||||
xml.end_tag()
|
||||
|
||||
elif isinstance(value, PropertyBinding):
|
||||
bind_flags = []
|
||||
if not value.no_sync_create:
|
||||
bind_flags.append("sync-create")
|
||||
if value.inverted:
|
||||
bind_flags.append("invert-boolean")
|
||||
if value.bidirectional:
|
||||
bind_flags.append("bidirectional")
|
||||
|
||||
props["bind-source"] = self._object_id(value, value.source)
|
||||
props["bind-property"] = value.property_name
|
||||
props["bind-flags"] = "|".join(bind_flags) or None
|
||||
xml.put_self_closing("property", **props)
|
||||
|
||||
elif isinstance(value, ObjectValue):
|
||||
xml.start_tag("property", **props)
|
||||
self._emit_object(value.object, xml)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue