Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Emmanuele Bassi
gi-docgen
Commits
1ab0d30a
Commit
1ab0d30a
authored
Feb 23, 2021
by
Emmanuele Bassi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
generate: Add signal emitter attribute
parent
17e5856d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
docs/attributes.rst
docs/attributes.rst
+5
-1
gidocgen/gdgenerate.py
gidocgen/gdgenerate.py
+9
-0
No files found.
docs/attributes.rst
View file @
1ab0d30a
...
...
@@ -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
``o
ut
.gtk.Method.get_property`` = ``s``
``o
rg
.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
gidocgen/gdgenerate.py
View file @
1ab0d30a
...
...
@@ -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
,
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment