master
Avril 4 years ago
parent 1f30071f6e
commit e5c3f0deb0
Signed by: flanchan
GPG Key ID: 284488987C31F630

@ -12,45 +12,45 @@
- [-] `GHOST_Types.h` - [-] `GHOST_Types.h`
- [X] /Handles/ - [X] /Handles/
- [X] GHOST_SystemHandle - [X] GHOST_SystemHandle
- [X] GHOST_TimerTaskHandle - [X] GHOST_TimerTaskHandle
- [X] GHOST_WindowHandle - [X] GHOST_WindowHandle
- [X] GHOST_EventHandle - [X] GHOST_EventHandle
- [X] GHOST_RectangleHandle - [X] GHOST_RectangleHandle
- [X] GHOST_EventConsumerHandle - [X] GHOST_EventConsumerHandle
- [X] GHOST_ContextHandle - [X] GHOST_ContextHandle
- [X] GHOST_XrContextHandle - [X] GHOST_XrContextHandle
- [-] /Primitives/ (ones that begin with =T= I count as `primitive') - [-] /Primitives/ (ones that begin with =T= I count as `primitive')
- [X] GHOST_TInt8 - [X] GHOST_TInt8
- [X] GHOST_TUns8 - [X] GHOST_TUns8
- [X] GHOST_Tint16 - [X] GHOST_Tint16
- [X] GHOST_TUns16 - [X] GHOST_TUns16
- [X] GHOST_Tint32 - [X] GHOST_Tint32
- [X] GHOST_TUns32 - [X] GHOST_TUns32
- [X] GHOST_TInt64 - [X] GHOST_TInt64
- [X] GHOST_TUns64 - [X] GHOST_TUns64
- [X] GHOST_TUserDataPtr - [X] GHOST_TUserDataPtr
- [X] GHOST_TSuccess - [X] GHOST_TSuccess
- [X] GHOST_TTabletMode - [X] GHOST_TTabletMode
- [X] GHOST_TTabletAPI - [X] GHOST_TTabletAPI
- [X] GHOST_TVisibility - [X] GHOST_TVisibility
- [X] GHOST_TFireTimeConstant - [X] GHOST_TFireTimeConstant
- [X] GHOST_TModifierKeyMask - [X] GHOST_TModifierKeyMask
- [X] GHOST_TWindowState - [X] GHOST_TWindowState
- [X] GHOST_TWindowOrder - [X] GHOST_TWindowOrder
- [X] GHOST_TDrawingContextType - [X] GHOST_TDrawingContextType
- [X] GHOST_TButtonMask - [X] GHOST_TButtonMask
- [X] GHOST_TEventType - [X] GHOST_TEventType
- [ ] GHOST_TStandardCursor - [ ] GHOST_TStandardCursor
- [ ] GHOST_TKey - [ ] GHOST_TKey
- [X] /Structures/ - [X] /Structures/
- [X] GHOST_GLSettings - [X] GHOST_GLSettings
- [X] GHOST_GLFlags - [X] GHOST_GLFlags
- [X] GHOST_DialogOptions - [X] GHOST_DialogOptions
- [X] GHOST_TabletData - [X] GHOST_TabletData
- [X] /Constants/ - [X] /Constants/
- [X] =GHOST_TABLET_DATA_NONE= - [X] =GHOST_TABLET_DATA_NONE=
* reimpl as ~const fn~ (~GHOST_TabletData::none()~) * reimpl as ~const fn~ (~GHOST_TabletData::none()~)
*** Native Rust API *** Native Rust API
I provide more Rust idiomatic API for some things. 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. I provide more Rust idiomatic API for some things. 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.
@ -58,9 +58,9 @@
**** Overview **** Overview
List and implementation status of features List and implementation status of features
- [-] Types - [-] Types
- [X] [[Handles]]: ~handle.rs~ - [X] [[Handles]]: ~handle.rs~
- [ ] Events: ~event.rs~ - [ ] Events: ~event.rs~
**** Handles **** Handles
Handles keep the C ABI, but are re-wrtten with traits to be more idiomatic. Handles keep the C ABI, but are re-wrtten with traits to be more idiomatic.
@ -70,12 +70,12 @@
Since handles are just types pointers, they are only ever used as such and shouldn't exist themselves. Since handles are just types pointers, they are only ever used as such and shouldn't exist themselves.
***** Example ***** Example
#+BEGIN_SRC rust #+BEGIN_SRC rust
extern "C" unsafe fn internal_call(window: GHOST_WindowHandle) -> GHOST_TSuccess; extern "C" unsafe fn internal_call(window: GHOST_WindowHandle) -> GHOST_TSuccess;
fn do_something_to_window(window: &mut Handle<Window>) -> Result<()> fn do_something_to_window(window: &mut Handle<Window>) -> Result<()>
{ {
unsafe { unsafe {
internal_call(window as GHOST_WindowHandle).into() internal_call(window as GHOST_WindowHandle).into()
} }
} }
#+END_SRC #+END_SRC

Loading…
Cancel
Save