Message processing

EsMessageGetInputText

size_t EsMessageGetInputText(EsMessage *message, char *buffer);

The buffer should be 64 bytes in size.

EsMessageMutexAcquire

void EsMessageMutexAcquire();

Acquires the message mutex. Call this before handling messages or touching the user interface.

EsMessageMutexCheck

void EsMessageMutexCheck();

Asserts that the current thread holds the message mutex.

EsMessageMutexRelease

void EsMessageMutexRelease();

Releases the message mutex.

EsMessagePost

EsError EsMessagePost(EsElement *target, EsMessage *message);

Queues the message for the current process's message loop and wakes it. Returns ES_ERROR_INSUFFICIENT_RESOURCES if the queue is full.

EsMessagePostRemote

EsError EsMessagePostRemote(EsHandle process, EsMessage *message);

Queues the message for the given process's message loop. Returns an EsError.

EsMessageSend

int EsMessageSend(EsElement *object, EsMessage *message);

Sends the message synchronously to the element's user and class handlers. Returns the response, or 0 if it was not handled.

EsMessageReceive

EsMessage *EsMessageReceive();

Blocks until a message is available and returns the next message for the application. Some messages are handled internally. The returned pointer is overwritten by the next call.