-
-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement basic vfunc support #1319
Comments
Hi, I would like to work on this. It would take me at least a week to go through the codebase before I can start contributing though, is that okay? |
Sure, make sure to check #604 for inspiration as well. |
Could you give me some examples of the kinds of parsing for virtual-method parser.rs needs to support? I am not entirely sure of the inputs |
For example <virtual-method name="get_action_name" invoker="get_action_name">
<attribute name="org.gtk.Property.get" value="action-name"/>
<doc xml:space="preserve">Gets the action name for @actionable.</doc>
<return-value transfer-ownership="none" nullable="1">
<doc xml:space="preserve">the action name</doc>
<type name="utf8" c:type="const char*"/>
</return-value>
<parameters>
<instance-parameter name="actionable" transfer-ownership="none">
<doc xml:space="preserve">a `GtkActionable` widget</doc>
<type name="Actionable" c:type="GtkActionable*"/>
</instance-parameter>
</parameters>
</virtual-method> Look at the files in the gir-files repository. |
Thank you. I will try to get the first task done by 16th |
Hello, I have slowly realized that this issue would require hundreds of lines of code so, if possible could you give me some guidance on the ways you want all this implemented? I am not very familiar with the codebase so don't know how gobject and gir internals work. There was an old commit from vhdirk reviewed by @sdroege which did a few things with regards to vfunc parsing, but the review said that it still had a lot of assumptions about crate name, return value, etc. Some info on the shortcomings in that commit would help a lot, and if there is some doc on the expected behavior of vfuncs, that would help too |
Hi, so far I have understood that just the virtual-method parsing (line 606 to 610 in https://github.com/gtk-rs/gir/pull/604/files) and read_virtual_method function(line 1017 to 1091) with some modification to include annotations for parameters and return values is what is required. Is that correct? |
The whole subclassing code (which uses virtual functions that you have to implement to change a behaviour) is all manual for now but we want to change that somehow. The goal of this issue is to start by doing the parsing of virtual-functions from the GIR file and include that information in Class/Interface types so we can use them for generating the documentation. Instead of trying to do everything at once, I would suggest doing multiple smaller PRs that follows more or less what I mentioned in the issue and allows ticking those items. |
I believe the scope of the issue is now implemented. An issue to discuss generating subclassing code could be opened if someone want to work on it. |
Currently, the parsing part ignores the virtual functions definitions. Ideally we would need:
Parse the XML for all the various vfuncs
Have a
[object.subclass]
configuration that would allow you toTypeImpl
&TypeImplExt
for chaining up[object.subclass.vfunc]
by marking at eitherignore = true
orrename = "some_different_vfunc_name"
Embed the docs for the
TypeImpl::some_vfunc
from the correspondingTypeClass::some_vfunc
Generate working docs links for the vfuncs
The text was updated successfully, but these errors were encountered: