Skip to content
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

add a flag for generating variant traits for flags/enums #1418

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jf2048
Copy link
Member

@jf2048 jf2048 commented Dec 11, 2022

GTK will probably not use this, but other libraries can enable it if they want

Fixes #1355

@jf2048
Copy link
Member Author

jf2048 commented Dec 13, 2022

cc @pbor

@pbor
Copy link
Contributor

pbor commented Dec 13, 2022

I have skimmed through the patch (I am not familiar enough with gir code to properly review)... can you show an example of how the syntax in Gir.toml would look like?

@jf2048
Copy link
Member Author

jf2048 commented Dec 13, 2022

It's just generate_variant_traits = "repr" or generate_variant_traits = "string" on the gir options (or on the type itself) and then you get traits for either serializing to int or string variant.

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.

Generate FromVariant and ToVariant for enums
3 participants