-
Notifications
You must be signed in to change notification settings - Fork 36
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
Make all public structs opaque #15
Comments
Discussed this with Zan. We won't do it for the 0.1 API. Consider again before releasing a 1.0 API version. |
After another round of discussion between myself and @carlosgcampos the conclusion is that doing this would prevent allocating event structs in the stack (which is fast and convenient) and would incur hitting dynamic allocation every time an event is passed around. We won't be doing this for the time being. |
That's actually @zdobersek reasoning, not mine. I still think structs should be opaque to ensure we can modify them in the future without breaking the API/ABI. I'm not opposed to close this anyway, hopefully we won't need to add more fields to events. |
We can always reopen this later if needed, of course. |
We should make structs in the public API opaque in order to make it possible to add new members without breaking the ABI. E.g.:
Instead of exposing the contents of the struct, we would expose getter and setter functions:
wpe_input_keyboard_event_get_time()
,wpe_input_keyboard_event_set_time()
, etc.Since this is a bigger change, I don't think it has to block the first release, but we should do it before a 1.0 release IMO.
The text was updated successfully, but these errors were encountered: