Commit 1ab0d30a authored by Emmanuele Bassi's avatar Emmanuele Bassi

generate: Add signal emitter attribute

parent 17e5856d
......@@ -26,6 +26,10 @@ The following attributes apply to methods of a classed type or interface.
Defines the property set by the function. The property name must be in
the same type as the method
``out.gtk.Method.get_property`` = ``s``
``org.gtk.Method.get_property`` = ``s``
Defines the property retrieved by the function. The property name must
be in the same type as the method
``org.gtk.Method.signal`` = ``s``
Defines the signal emitted by the function. The signal name must be
in the same type as the method
......@@ -512,6 +512,11 @@ class TemplateMethod:
href = f"property.{type_.name}.{value}.html"
return Markup(f"<a href=\"{href}\"><code>{text}</code></a>")
def transform_signal_attribute(namespace, type_, method, value):
text = f"{namespace.name}.{type_.name}::{value}"
href = f"signal.{type_.name}.{value}.html"
return Markup(f"<a href=\"{href}\"><code>{text}</code></a>")
ATTRIBUTE_NAMES = {
"org.gtk.Method.set_property": {
"label": "Sets property",
......@@ -520,6 +525,10 @@ class TemplateMethod:
"org.gtk.Method.get_property": {
"label": "Gets property",
"transform": transform_property_attribute,
},
"org.gtk.Method.signal": {
"label": "Emits signal",
"transform": transform_signal_attribute,
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment