update readme

master
Avril 4 years ago
parent 80bc839221
commit 111786bfec
Signed by: flanchan
GPG Key ID: 284488987C31F630

@ -1,23 +1,23 @@
* GHOST Rust bindings
Rust bindings and interop for GHOST.
* GHOST
Rust bindings and Rust APIs for GHOST.
** Layout
ABI-compatable types and functions are all prefixed with `GHOST_` and are exported in the `c` module (TODO).
I've attempted to provide more Rust-idiomatic API variants as well, which have non-prefixed names.
ABI-compatable types and functions are all prefixed with ~GHOST_~ and are exported in the ~c~ module.
Rust-native API variants are made as well, which have non-prefixed names.
** Notes
Eventually I intend to have /most/ (if not all) C compatable types either reimplemented or aliased to non-prefixed Rust types.
Eventually we should intend to have /most/ (if not all) C compatable types either reimplemented or aliased to non-prefixed Rust types.
At present though this is not the case, and prefixed names that can double as ergonomic Rust types are not aliased to them, so you'll have to use both often.
The reimplementation is undergoing, the aliasing not yet.
I've elected to leave out implementing ~Copy~ for /most/ FFI types, because I think the ownership model will work well here.
Leaving out implementing ~Copy~ for /most/ FFI types was a design decision, because I think the ownership model will work well here. (The hack flags-like structures need to implement copy to avoid passing around useless references when assigning them.)
This may be changed in the future, as (virtually) all implement ~Clone~ anyway.
I did this basically just because I want people to think about it when and why they copy something, instead of it being default behaviour.
I did this basically just because I want people to think about it when and why they copy something, instead of it being default behaviour. If it proves inconvenient it can be changed.
** Implementation
*** Implemented C compatable ABI
Note: List is in-progress and doesn't show everything
Note: List is in-progress and doesn't show everything. (Also the checkboxes might not be rendered here.)
- [-] `GHOST_Types.h`
- [X] /Handles/
@ -58,11 +58,12 @@
- [X] GHOST_DialogOptions
- [X] GHOST_TabletData
- [X] /Constants/
- [X] =GHOST_TABLET_DATA_NONE= (reimpl as ~const fn GHOST_TabletData::none()~)
- [X] =GHOST_TABLET_DATA_NONE= (reimpl. as ~const fn GHOST_TabletData::none()~)
*** Native Rust API
I provide more Rust idiomatic API for some things.
Rust native APIs are provided for things where the C API bindings are cumbersome or unsafe.
They may or may not share ABI, if they do they will have type aliases to the corresponding ~GHOST_~ identifier, so always use those when ABI compatability is desired.
Currently, most of the intended Rust API and structures do not exist (I haven't really studied the codebase), and C ones that are suitable for this purpose are mostly not aliased yet.
**** Overview
List and implementation status of features
@ -72,6 +73,9 @@
- [X] [[Error handling]]: ~error.rs~
- [ ] Events: ~event.rs~
***** Aliases
- [X] /Handle types/
**** Handles
Handles keep the C ABI, but are re-wrtten with traits to be more idiomatic.

Loading…
Cancel
Save