mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 23:16:14 +01:00
gdbus-codegen: make members of an interface inherit the "Since" annotation
This is the expected (and sane) behavior - without this bug-fix you'd have to add "Since" to every member of a newly added D-Bus interface. Also show-case this in the codegen example. Signed-off-by: David Zeuthen <zeuthen@gmail.com>
This commit is contained in:
parent
242dfd617b
commit
fa6a684630
@ -11,8 +11,14 @@ example_animal_call_poke_sync
|
|||||||
example_animal_complete_poke
|
example_animal_complete_poke
|
||||||
example_animal_emit_jumped
|
example_animal_emit_jumped
|
||||||
example_animal_get_mood
|
example_animal_get_mood
|
||||||
|
example_animal_get_foo
|
||||||
|
example_animal_get_bar
|
||||||
example_animal_dup_mood
|
example_animal_dup_mood
|
||||||
|
example_animal_dup_foo
|
||||||
|
example_animal_dup_bar
|
||||||
example_animal_set_mood
|
example_animal_set_mood
|
||||||
|
example_animal_set_foo
|
||||||
|
example_animal_set_bar
|
||||||
ExampleAnimalProxy
|
ExampleAnimalProxy
|
||||||
ExampleAnimalProxyClass
|
ExampleAnimalProxyClass
|
||||||
example_animal_proxy_new
|
example_animal_proxy_new
|
||||||
|
@ -235,11 +235,13 @@ class Method:
|
|||||||
self.since = ''
|
self.since = ''
|
||||||
self.deprecated = False
|
self.deprecated = False
|
||||||
|
|
||||||
def post_process(self, interface_prefix, cns, cns_upper, cns_lower):
|
def post_process(self, interface_prefix, cns, cns_upper, cns_lower, containing_iface):
|
||||||
if len(self.doc_string) == 0:
|
if len(self.doc_string) == 0:
|
||||||
self.doc_string = utils.lookup_docs(self.annotations)
|
self.doc_string = utils.lookup_docs(self.annotations)
|
||||||
if len(self.since) == 0:
|
if len(self.since) == 0:
|
||||||
self.since = utils.lookup_since(self.annotations)
|
self.since = utils.lookup_since(self.annotations)
|
||||||
|
if len(self.since) == 0:
|
||||||
|
self.since = containing_iface.since
|
||||||
|
|
||||||
name = self.name
|
name = self.name
|
||||||
overridden_name = utils.lookup_annotation(self.annotations, 'org.gtk.GDBus.C.Name')
|
overridden_name = utils.lookup_annotation(self.annotations, 'org.gtk.GDBus.C.Name')
|
||||||
@ -272,11 +274,13 @@ class Signal:
|
|||||||
self.since = ''
|
self.since = ''
|
||||||
self.deprecated = False
|
self.deprecated = False
|
||||||
|
|
||||||
def post_process(self, interface_prefix, cns, cns_upper, cns_lower):
|
def post_process(self, interface_prefix, cns, cns_upper, cns_lower, containing_iface):
|
||||||
if len(self.doc_string) == 0:
|
if len(self.doc_string) == 0:
|
||||||
self.doc_string = utils.lookup_docs(self.annotations)
|
self.doc_string = utils.lookup_docs(self.annotations)
|
||||||
if len(self.since) == 0:
|
if len(self.since) == 0:
|
||||||
self.since = utils.lookup_since(self.annotations)
|
self.since = utils.lookup_since(self.annotations)
|
||||||
|
if len(self.since) == 0:
|
||||||
|
self.since = containing_iface.since
|
||||||
|
|
||||||
name = self.name
|
name = self.name
|
||||||
overridden_name = utils.lookup_annotation(self.annotations, 'org.gtk.GDBus.C.Name')
|
overridden_name = utils.lookup_annotation(self.annotations, 'org.gtk.GDBus.C.Name')
|
||||||
@ -319,11 +323,13 @@ class Property:
|
|||||||
self.since = ''
|
self.since = ''
|
||||||
self.deprecated = False
|
self.deprecated = False
|
||||||
|
|
||||||
def post_process(self, interface_prefix, cns, cns_upper, cns_lower):
|
def post_process(self, interface_prefix, cns, cns_upper, cns_lower, containing_iface):
|
||||||
if len(self.doc_string) == 0:
|
if len(self.doc_string) == 0:
|
||||||
self.doc_string = utils.lookup_docs(self.annotations)
|
self.doc_string = utils.lookup_docs(self.annotations)
|
||||||
if len(self.since) == 0:
|
if len(self.since) == 0:
|
||||||
self.since = utils.lookup_since(self.annotations)
|
self.since = utils.lookup_since(self.annotations)
|
||||||
|
if len(self.since) == 0:
|
||||||
|
self.since = containing_iface.since
|
||||||
|
|
||||||
name = self.name
|
name = self.name
|
||||||
overridden_name = utils.lookup_annotation(self.annotations, 'org.gtk.GDBus.C.Name')
|
overridden_name = utils.lookup_annotation(self.annotations, 'org.gtk.GDBus.C.Name')
|
||||||
@ -411,10 +417,10 @@ class Interface:
|
|||||||
self.deprecated = True
|
self.deprecated = True
|
||||||
|
|
||||||
for m in self.methods:
|
for m in self.methods:
|
||||||
m.post_process(interface_prefix, cns, cns_upper, cns_lower)
|
m.post_process(interface_prefix, cns, cns_upper, cns_lower, self)
|
||||||
|
|
||||||
for s in self.signals:
|
for s in self.signals:
|
||||||
s.post_process(interface_prefix, cns, cns_upper, cns_lower)
|
s.post_process(interface_prefix, cns, cns_upper, cns_lower, self)
|
||||||
|
|
||||||
for p in self.properties:
|
for p in self.properties:
|
||||||
p.post_process(interface_prefix, cns, cns_upper, cns_lower)
|
p.post_process(interface_prefix, cns, cns_upper, cns_lower, self)
|
||||||
|
@ -45,6 +45,19 @@
|
|||||||
<signal name="Jumped">
|
<signal name="Jumped">
|
||||||
<arg type="d" name="height"/>
|
<arg type="d" name="height"/>
|
||||||
</signal>
|
</signal>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Foo:
|
||||||
|
Property with no <quote>since</quote> annotation (should inherit the 2.30 from its containing interface).
|
||||||
|
-->
|
||||||
|
<property name="Foo" type="s" access="read"/>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Bar:
|
||||||
|
@since: 2.36
|
||||||
|
Property with a later <quote>since</quote> annotation.
|
||||||
|
-->
|
||||||
|
<property name="Bar" type="s" access="read"/>
|
||||||
</interface>
|
</interface>
|
||||||
|
|
||||||
<!-- org.gtk.GDBus.Example.ObjectManager.Cat:
|
<!-- org.gtk.GDBus.Example.ObjectManager.Cat:
|
||||||
|
Loading…
Reference in New Issue
Block a user