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) \
|
|
|
|
uiprivProgrammerError("wrong size %" uiprivSizetPrintf " for %s in %s()", \
|
|
|
|
badSize, structName, func)
|
2019-06-02 07:35:40 -05:00
|
|
|
|
|
|
|
#define uiprivProgrammerErrorIndexOutOfRange(badIndex, func) \
|
|
|
|
uiprivProgrammerError("index %d out of range in %s()", \
|
|
|
|
badIndex, func)
|
|
|
|
|
|
|
|
#define uiprivProgrammerErrorNullPointer(paramDesc, func) \
|
|
|
|
uiprivProgrammerError("invalid null pointer for %s passed into %s()", \
|
|
|
|
paramDesc, func)
|
|
|
|
|
2019-06-09 09:27:28 -05:00
|
|
|
// }
|
|
|
|
|
|
|
|
// events {
|
|
|
|
|
2019-06-09 09:30:47 -05:00
|
|
|
#define uiprivProgrammerErrorEventHandlerNotFound(badID, func) \
|
|
|
|
uiprivProgrammerError("event handler %d not found in %s()", \
|
|
|
|
badID, func)
|
2019-06-02 07:35:40 -05:00
|
|
|
|
|
|
|
#define uiprivProgrammerErrorBadSenderForEvent(senderDesc, eventDesc, func) \
|
|
|
|
uiprivProgrammerError("attempt to use a %s sender with a %s event in %s()", \
|
|
|
|
senderDesc, eventDesc, func)
|
|
|
|
|
|
|
|
#define uiprivProgrammerErrorChangingEventDuringFire(func) \
|
|
|
|
uiprivProgrammerError("attempt to change a uiEvent with %s() while it is firing", \
|
|
|
|
func)
|
|
|
|
|
2019-06-09 12:18:18 -05:00
|
|
|
#define uiprivProgrammerErrorRecursiveEventFire(func) \
|
2019-06-09 12:32:31 -05:00
|
|
|
uiprivProgrammerError("attempt to fire a uiEvent while it is already being fired in %s()", \
|
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:32:31 -05:00
|
|
|
uiprivProgrammerError("attempt to free a libui-provided 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 uiprivProgrammerErrorFreeingEventInUse(func) \
|
2019-06-09 12:32:31 -05:00
|
|
|
uiprivProgrammerError("attempt to free a uiEvent 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:32:31 -05:00
|
|
|
uiprivProgrammerError("attempt to call uiEventInvalidateSender() on a global uiEvent", \
|
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
|
|
|
|
|
|
|
// }
|