Skip to content
This repository has been archived by the owner on Jun 8, 2021. It is now read-only.

Event accessors #108

Closed
gkoz opened this issue Mar 2, 2016 · 1 comment
Closed

Event accessors #108

gkoz opened this issue Mar 2, 2016 · 1 comment

Comments

@gkoz
Copy link
Member

gkoz commented Mar 2, 2016

We have the following goals for the high level APIs like these getters:

  • Do not expose raw pointers. We have helper function for common cases, you might want to look at the surrounding modules and glib::translate for guidance (example of returning a window). It seems likely that most pointers carried by the events are nullable, so the type would be wrapped in Option (the helper functions can handle that).
  • Do not expose any of the FFI types (or at least type names) that have higher-level counterparts. If an FFI type hasn't been reexported yet, add it to lib.rs among the others. In particular,
    • GdkRectangle is currently exposed as cairo::RectangleInt;
    • strings might translate to &str or Option<&str> or Cow<str> depending on our assumptions, new helper functions will be needed for that.
  • Integers that aren't expected to be negative (e.g. width, height) should be converted to u32 with assertions ([RFC] Integer signedness story gtk#246, we don't have a settled style for that yet).
  • There's a still open question of whether to make keyval type an enum: Export GDK_KEY constants as u32. #105
  • Ideally, you should have some idea of how the event can be used. For instance, I'd rather not bind EventProperty at all yet because the properties story is not clear.
@gkoz
Copy link
Member Author

gkoz commented Mar 16, 2016

This issue has served its purpose it seems.

@gkoz gkoz closed this as completed Mar 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant