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

Missing cairo types #194

Open
vixalien opened this issue Aug 20, 2024 · 5 comments
Open

Missing cairo types #194

vixalien opened this issue Aug 20, 2024 · 5 comments

Comments

@vixalien
Copy link

Some Cairo types are missing. For example, Cairo.Surface.

It seems most of the types are defined here: https://gitlab.gnome.org/GNOME/gjs/-/blob/master/modules/cairo-context.cpp#L824-921

@JumpLink
Copy link
Collaborator

@vixalien Thank you for the issue. It would be very nice if you can help to complete this types. Contributions to overrides are very simple as they are also written by hand. The hand written type definitions for 'cairo' can be found here: https://github.com/gjsify/ts-for-gir/blob/main/packages%2Fgenerator-typescript%2Ftemplates%2Fgjs%2Fcairo.d.ts

@vixalien
Copy link
Author

Nice I'll take a stab at it soon

@vixalien
Copy link
Author

vixalien commented Sep 3, 2024

The issue seems to stem from the fact that both cairo-1.d.ts (from cairo's GIR) and cairo.d.ts are generated.

When using a type like Gtk.DrawingArea.set_drawing_func, it uses the cairo.Context from the GIR (cairo-1.d.ts) instead of the handwritten cairo.Context (from cairo.d.ts)

@vixalien
Copy link
Author

vixalien commented Sep 3, 2024

It seems @ewlsh posted the types of cairo here https://gitlab.gnome.org/GNOME/gjs/-/snippets/2990, although the origin is unclear.

@JumpLink
Copy link
Collaborator

JumpLink commented Nov 5, 2024

@vixalien Yes, that's right, currently the handwritten ones are only used for import, but not for the generated types. Perhaps a special treatment can be built in for this.

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

No branches or pull requests

2 participants