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

support fundamental types #1294

Merged
merged 4 commits into from
Jan 1, 2022
Merged

support fundamental types #1294

merged 4 commits into from
Jan 1, 2022

Conversation

bilelmoussaoui
Copy link
Member

@bilelmoussaoui bilelmoussaoui commented Dec 29, 2021

This merge request allows generating a portion of the code needed for fundamental types. It still needs manual code to create a common trait & implement it for the various sub-types along with the casting functions.

The PR as is, allows to drop a huge portion of the manual code in gtk4-rs.

The next step before merging this is to automatically use AsRef<T> instead of IsA<T> where needed.

Fixes #1069

@MarijnS95
Copy link
Contributor

Seeing the title, is this something I could leverage for #1134?

@bilelmoussaoui
Copy link
Member Author

Seeing the title, is this something I could leverage for #1134?

Not really, the ones this PR attempts to fix are fundamental types in "glib terms", so they do provide a ref/unref/get_type functions

@MarijnS95
Copy link
Contributor

That's unfortunate, I thought this added a way to specify fundamental types (somehow) in .gir and generate them here.

@sdroege
Copy link
Member

sdroege commented Dec 29, 2021

Can you create a WIP PR for gtk4-rs?

@bilelmoussaoui
Copy link
Member Author

Can you create a WIP PR for gtk4-rs?

Will do once it's +/- compiling locally

@bilelmoussaoui bilelmoussaoui changed the title wip: support fundamental types support fundamental types Dec 29, 2021
@bilelmoussaoui
Copy link
Member Author

It should be ready for a review :) It can properly generate things like ParamSpecExpression

src/parser.rs Show resolved Hide resolved
@sdroege
Copy link
Member

sdroege commented Jan 1, 2022

Looks good to me otherwise. Less code than I feared :)

@sdroege
Copy link
Member

sdroege commented Jan 1, 2022

Good to merge then?

@bilelmoussaoui
Copy link
Member Author

Looks good to me yes

@sdroege sdroege merged commit bb0022f into gtk-rs:master Jan 1, 2022
@bilelmoussaoui bilelmoussaoui deleted the bilelmoussaoui/fundemantal-types branch January 1, 2022 11:47
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.

Don't use IsA for fundamental types
3 participants