Added the documentation for macOS uiControl, or what little of it currently exists.

This commit is contained in:
Pietro Gagliardi 2019-06-10 20:11:10 -04:00
parent 7e3d6d2b1c
commit 89f64eb067
2 changed files with 28 additions and 0 deletions

View File

@ -4,3 +4,5 @@
* [Initialization and the Main Loop](init-main.md)
* [Event Handling](events.md)
* [Controls](controls.md)
* macOS
** [Controls](darwin-controls.md)

26
doc/darwin-controls.md Normal file
View File

@ -0,0 +1,26 @@
<!-- 10 june 2019 -->
# Controls on macOS
## Overview
TODO
## Reference
### `uiControlOSVtable`
```c
typedef struct uiControlOSVtable uiControlOSVtable;
struct uiControlOSVtable {
size_t Size;
};
```
`uiControlOSVtable` describes the set of functions that control implementations on macOS need to implement. When registering your control type, you pass this in as a parameter to `uiRegisterControlType()`. Each method here is required.
You are responsible for allocating and initializing this struct. To do so, you simply zero the memory for this struct and set its `Size` field to `sizeof (uiControlOSVtable)`. (TODO put this in a common place)
Each method takes at least two parameters. The first, `c`, is the `uiControl` itself. The second, `implData`, is the implementation data pointer; it is the same as the pointer returned by `uiControlImplData(c)`, and is provided here as a convenience.
Each method is named for the `uiDarwinControl` function that it implements. As such, details on how to implement these methods are documented alongside those functions. For instance, instructions on implementing `TODO()` are given under the documentation for `TOOD()`.