2019-06-02 07:35:40 -05:00
|
|
|
// 2 june 2019
|
|
|
|
|
2019-06-09 09:27:28 -05:00
|
|
|
// common {
|
|
|
|
|
2019-06-02 07:35:40 -05:00
|
|
|
#define uiprivProgrammerErrorNotInitialized(func) \
|
|
|
|
uiprivProgrammerError("attempt to call %s() before uiInit()", \
|
|
|
|
func)
|
|
|
|
|
|
|
|
#define uiprivProgrammerErrorWrongThread(func) \
|
|
|
|
uiprivProgrammerError("attempt to call %s() on a thread other than the GUI thread", \
|
|
|
|
func)
|
|
|
|
|
2019-06-09 07:50:12 -05:00
|
|
|
#define uiprivProgrammerErrorWrongStructSize(badSize, structName, func) \
|
2019-06-09 12:39:14 -05:00
|
|
|
uiprivProgrammerError("%s(): wrong size %" uiprivSizetPrintf " for %s", \
|
|
|
|
func, badSize, structName)
|
2019-06-02 07:35:40 -05:00
|
|
|
|
|
|
|
#define uiprivProgrammerErrorIndexOutOfRange(badIndex, func) \
|
2019-06-09 12:39:14 -05:00
|
|
|
uiprivProgrammerError("%s(): index %d out of range", \
|
|
|
|
func, badIndex)
|
2019-06-02 07:35:40 -05:00
|
|
|
|
|
|
|
#define uiprivProgrammerErrorNullPointer(paramDesc, func) \
|
2019-06-09 12:39:14 -05:00
|
|
|
uiprivProgrammerError("%s(): invalid null pointer for %s", \
|
|
|
|
func, paramDesc)
|
2019-06-02 07:35:40 -05:00
|
|
|
|
2019-06-09 09:27:28 -05:00
|
|
|
// }
|
|
|
|
|
|
|
|
// events {
|
|
|
|
|
2019-06-09 09:30:47 -05:00
|
|
|
#define uiprivProgrammerErrorEventHandlerNotFound(badID, func) \
|
2019-06-09 12:39:14 -05:00
|
|
|
uiprivProgrammerError("%s(): event handler %d not found", \
|
|
|
|
func, badID)
|
2019-06-02 07:35:40 -05:00
|
|
|
|
|
|
|
#define uiprivProgrammerErrorBadSenderForEvent(senderDesc, eventDesc, func) \
|
2019-06-09 12:39:14 -05:00
|
|
|
uiprivProgrammerError("%s(): can't use a %s sender with a %s event", \
|
|
|
|
func, senderDesc, eventDesc)
|
2019-06-02 07:35:40 -05:00
|
|
|
|
|
|
|
#define uiprivProgrammerErrorChangingEventDuringFire(func) \
|
2019-06-09 12:39:14 -05:00
|
|
|
uiprivProgrammerError("%s(): can't change a uiEvent while it is firing", \
|
2019-06-02 07:35:40 -05:00
|
|
|
func)
|
|
|
|
|
2019-06-09 12:18:18 -05:00
|
|
|
#define uiprivProgrammerErrorRecursiveEventFire(func) \
|
2019-06-09 12:39:14 -05:00
|
|
|
uiprivProgrammerError("%s(): can't recursively fire a uiEvent", \
|
2019-06-09 12:18:18 -05:00
|
|
|
func)
|
2019-06-02 09:06:50 -05:00
|
|
|
|
2019-06-09 12:18:18 -05:00
|
|
|
#define uiprivProgrammerErrorFreeingInternalEvent(func) \
|
2019-06-09 12:39:14 -05:00
|
|
|
uiprivProgrammerError("%s(): can't free a libui-provided event", \
|
2019-06-09 12:18:18 -05:00
|
|
|
func)
|
2019-06-02 09:06:50 -05:00
|
|
|
|
2019-06-09 12:18:18 -05:00
|
|
|
#define uiprivProgrammerErrorFreeingEventInUse(func) \
|
2019-06-09 12:39:14 -05:00
|
|
|
uiprivProgrammerError("%s(): can't free event that still has handlers registered", \
|
2019-06-09 12:18:18 -05:00
|
|
|
func)
|
2019-06-07 09:58:39 -05:00
|
|
|
|
2019-06-09 12:18:18 -05:00
|
|
|
#define uiprivProgrammerErrorInvalidatingGlobalEvent(func) \
|
2019-06-09 12:39:14 -05:00
|
|
|
uiprivProgrammerError("%s(): can't invalidate a global event", \
|
2019-06-09 12:18:18 -05:00
|
|
|
func)
|
2019-06-08 12:00:30 -05:00
|
|
|
|
2019-06-09 09:27:28 -05:00
|
|
|
// }
|
|
|
|
|
|
|
|
// controls {
|
|
|
|
|
2019-06-09 12:32:31 -05:00
|
|
|
#define uiprivProgrammerErrorRequiredControlMethodMissing(typeName, tableType, methodName, func) \
|
|
|
|
uiprivProgrammerError("%s(): required %s method %s() missing for uiControl type %s", \
|
|
|
|
func, tableType, methodName, typeName)
|
2019-06-09 09:27:28 -05:00
|
|
|
|
|
|
|
#define uiprivProgrammerErrorNotAControl(func) \
|
2019-06-09 12:32:31 -05:00
|
|
|
uiprivProgrammerError("%s(): object passed in not a uiControl", \
|
2019-06-09 09:27:28 -05:00
|
|
|
func)
|
|
|
|
|
2019-06-09 12:32:31 -05:00
|
|
|
#define uiprivProgrammerErrorUnknownControlTypeUsed(type, func) \
|
|
|
|
uiprivProgrammerError("%s(): unknown uiControl type %" PRIu32 " found in uiControl (this is likely not a real uiControl or some data is corrupt)", \
|
|
|
|
func, type)
|
2019-06-09 09:27:28 -05:00
|
|
|
|
2019-06-09 12:32:31 -05:00
|
|
|
#define uiprivProgrammerErrorUnknownControlTypeRequested(type, func) \
|
|
|
|
uiprivProgrammerError("%s(): unknown uiControl type %" PRIu32 " requested", \
|
|
|
|
func, type)
|
2019-06-09 09:27:28 -05:00
|
|
|
|
2019-06-09 12:32:31 -05:00
|
|
|
#define uiprivProgrammerErrorWrongControlType(got, want, func) \
|
|
|
|
uiprivProgrammerError("%s(): wrong uiControl type passed: got %s, want %s", \
|
2019-06-09 09:27:28 -05:00
|
|
|
func, got, want)
|
2019-06-08 12:00:30 -05:00
|
|
|
|
2019-06-09 12:18:18 -05:00
|
|
|
#define uiprivProgrammerErrorCannotCreateBaseControl(func) \
|
2019-06-09 12:32:31 -05:00
|
|
|
uiprivProgrammerError("%s(): uiControlType() passed in when specific control type needed", \
|
2019-06-09 12:18:18 -05:00
|
|
|
func)
|
2019-06-08 14:31:40 -05:00
|
|
|
|
|
|
|
#define uiprivProgrammerErrorInvalidControlInitData(type, func) \
|
2019-06-09 12:32:31 -05:00
|
|
|
uiprivProgrammerError("%s(): invalid init data for %s", \
|
|
|
|
func, type)
|
2019-06-08 14:31:40 -05:00
|
|
|
|
|
|
|
#define uiprivProgrammerErrorControlHasParent(func) \
|
2019-06-09 12:32:31 -05:00
|
|
|
uiprivProgrammerError("%s(): cannot be called on a control with has a parent", \
|
2019-06-08 14:31:40 -05:00
|
|
|
func)
|
2019-06-09 09:27:28 -05:00
|
|
|
|
|
|
|
// }
|