Started layout out the uiControl stuff. I forgot to write tests for uiFreeEvent() errors :|

This commit is contained in:
Pietro Gagliardi 2019-06-02 18:49:16 -04:00
parent 12c01d0d42
commit d040bca07e
2 changed files with 14 additions and 3 deletions

View File

@ -8,10 +8,16 @@ TODO
## Reference ## Reference
### `xxx` ### `uiControl`
```c ```c
TODO typedef struct uiControl uiControl;
uint32_t uiControlType(void);
#define uiControl(obj) ((uiControl *) uiCheckControlType((obj), uiControlType()))
``` ```
TODO `uiControl` is an opaque type that describes a control.
`uiControl()` is a conversion macro for casting a pointer of a specific control type (or a `void *`) to `uiControl` while also checking for errors.
`uiControlType()` is the type identifier of a `uiControl` as passed to `uiControlCheckType()`. You rarely need to call this directly; the `uiControl()` conversion macro does this for you.

5
ui.h
View File

@ -61,6 +61,11 @@ uiprivExtern void uiEventFire(uiEvent *e, void *sender, void *args);
uiprivExtern bool uiEventHandlerBlocked(const uiEvent *e, int id); uiprivExtern bool uiEventHandlerBlocked(const uiEvent *e, int id);
uiprivExtern void uiEventSetHandlerBlocked(uiEvent *e, int id, bool blocked); uiprivExtern void uiEventSetHandlerBlocked(uiEvent *e, int id, bool blocked);
typedef struct uiControl uiControl;
uiprivExtern uint32_t uiControlType(void);
#define uiControl(obj) ((uiControl *) uiCheckControlType((obj), uiControlType()))
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif