Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

bilelmoussaoui
Copy link
Member

this allows finding *_type() functions using their c names

See gtk-rs/gtk4-rs#383 for the end result

Copy link
Member

@sdroege sdroege left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That of course only helps for enums/flags and not for boxed/shared/object types :) Not sure how useful that is overall.

@bilelmoussaoui
Copy link
Member Author

That of course only helps for enums/flags and not for boxed/shared/object types :) Not sure how useful that is overall.

For boxed/shared/object types, we need a way for glib::wrapper! to add the doc aliases which is not possible as far as I can tell, you can't stringify something and pass it to #[doc(alias = "x")] if type_ is passed

I don't think it's super useful, but it would reduce the questions of how can I get get_type() for this type. Especially if people are copying a C example/looking at the C docs

@bilelmoussaoui
Copy link
Member Author

So I suppose this is something we should just close?

@sdroege
Copy link
Member

sdroege commented Dec 9, 2022

Do doc aliases on trait impls actually work? I thought they only work on trait definitions

@bilelmoussaoui
Copy link
Member Author

Do doc aliases on trait impls actually work? I thought they only work on trait definitions

They do, see https://gtk-rs.org/gtk4-rs/stable/latest/docs/?search=gtk_widget_get_css_name and I still think we should land this one btw. The fact we can't get a doc alias for types using glib::wrapper! is something that might get fixed in the future but shouldn't block what we can improve already.

@sdroege
Copy link
Member

sdroege commented Dec 9, 2022

Sure, why not. Doesn't seem too useful for only enums/flags but it's something :)

this allows finding *_type() functions using their c names
@bilelmoussaoui bilelmoussaoui merged commit 24902d9 into gtk-rs:master Aug 25, 2023
@bilelmoussaoui bilelmoussaoui deleted the bilelmoussaoui/gen-doc-alias-static-type branch August 25, 2023 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants