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

Autogenerated callbacks #224

Open
gucio321 opened this issue Sep 25, 2023 · 1 comment
Open

Autogenerated callbacks #224

gucio321 opened this issue Sep 25, 2023 · 1 comment
Labels
enhancement New feature or request investigating Searching for origins of the issue.

Comments

@gucio321
Copy link
Collaborator

Things like InputTextCallback should be autogenerated. I have an idea how to do this

  • declare go callback type
  • if C function needs callback, take go callback and convert it to uintptr via cgo.handle
  • in c declare a local function (in the function that wants to pass callback to c++) and make it compatible with our destination type
  • in go were should also have an exported to c function that takes uintptr (and other necessary parameters of needed). This one should just decide uintptr back to go type and call it
  • local c function mentioned above calf go exported function

This workflow should allow us to autogenerate callbacks

@gucio321
Copy link
Collaborator Author

This is not possible as C doesn't support so called "deltas"

I have another Idea. I need set of "global variables" (yeah I know its awful but its C).

type Callback1;
bool Callback1_used;

@gucio321 gucio321 added the enhancement New feature or request label Sep 19, 2024
@gucio321 gucio321 added the investigating Searching for origins of the issue. label Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request investigating Searching for origins of the issue.
Projects
None yet
Development

No branches or pull requests

1 participant