Event Loop
PBMessageAppCreate
Structure: (not documented yet)
Fields
window (owned PBWindow): Deprecated; do not use.
[in] argv (referenced array of referenced string): (not documented yet)
PBMessageAppQuery
Structure: (not documented yet)
Fields
[in] argv (referenced array of referenced string): (not documented yet)
[in] writeStream (referenced PBStream): (not documented yet)
PBMessageAppHandoff
Structure: (not documented yet)
Fields
[in] window (referenced PBWindow): (not documented yet)
[in] writeStream (referenced PBStream): (not documented yet)
PBMessageAppCleanup
Structure: (not documented yet)
Fields
unused (uint8_t
): (not documented yet)
PBMessageAppSystemPropertyChanged
Structure: (not documented yet)
Fields
index (PBSystemPropertyIndex): (not documented yet)
newValue (double
): (not documented yet)
PBApplicationMessageHandler
Callback: (not documented yet)
Syntax (C/C++)
intptr_t PBApplicationMessageHandler(/* in-out */ PBMessage * __restrict message);
You can create a callback of this type from a function pointer with the above signature using PBApplicationMessageHandler_Make
.
Syntax (Python)
ApplicationMessageHandler(message) -> (result)
Parameters and Return Values
[in-out] message (PBMessage): (not documented yet)
[out] result (intptr_t
): (not documented yet)
PBRunAsEventCallback
Callback: (not documented yet)
Syntax (C/C++)
void PBRunAsEventCallback();
You can create a callback of this type from a function pointer with the above signature using PBRunAsEventCallback_Make
.
Syntax (Python)
RunAsEventCallback()
PBEventLoop
Function: (not documented yet)
Syntax (C/C++)
int32_t PBEventLoop(PBApplicationMessageHandler messageApplication);
Syntax (Python)
EventLoop(messageApplication) -> (unused)
Parameters and Return Values
[in] messageApplication (PBApplicationMessageHandler): (not documented yet)
[out] unused (int32_t
): (not documented yet)
Discussion
Run the application's event loop. This function never returns.
PBRunAsEvent
Function: (not documented yet)
Syntax (C/C++)
bool PBRunAsEvent(PBRunAsEventCallback callback, bool waitForCompletion);
Syntax (Python)
RunAsEvent(callback, waitForCompletion) -> (success)
Parameters and Return Values
[in] callback (PBRunAsEventCallback): (not documented yet)
[in] waitForCompletion (bool
): (not documented yet)
[out] success (bool
): (not documented yet)
PBRunAsEventC
C-only function: (not documented yet)
Syntax (C)
bool PBRunAsEventC(void (*_Nullable callback)(void *_Nullable context), void (*_Nullable freeContext)(void *_Nullable context), void *_Nullable context, bool waitForCompletion)
PBEventSource
Opaque object handle: (not documented yet)
This object maintains an internal reference count. When the reference count reaches zero, the object will be automatically deallocated. To increment the reference count, call PBEventSourceRetain; to decrement the reference count, call PBEventSourceRelease. These functions are thread-safe.
PBEventSourceFlags
Enumeration/bitset of type uint32_t: (not documented yet)
Constants
PBEventSourceFlags_READ
PBEventSourceFlags_READ = 1<<0
(not documented yet)
PBEventSourceFlags_WRITE
PBEventSourceFlags_WRITE = 1<<1
(not documented yet)
PBEventSourceFlags_DISPATCH_OUTSIDE_UI_EVENT
PBEventSourceFlags_DISPATCH_OUTSIDE_UI_EVENT = 1<<2
For internal use only.
PBEventType
Enumeration/bitset of type uint32_t: (not documented yet)
Constants
PBEventType_OTHER
PBEventType_OTHER = 0
(not documented yet)
PBEventType_READ
PBEventType_READ = 1
(not documented yet)
PBEventType_WRITE
PBEventType_WRITE = 2
(not documented yet)
PBEventType_ERROR
PBEventType_ERROR = 3
(not documented yet)
PBEventHandler
Callback: (not documented yet)
Syntax (C/C++)
void PBEventHandler(PBEventSourceRef source, PBEventType eventType);
You can create a callback of this type from a function pointer with the above signature using PBEventHandler_Make
.
Syntax (Python)
EventHandler(source, eventType)
Parameters and Return Values
[in] source (referenced PBEventSource): (not documented yet)
[in] eventType (PBEventType): (not documented yet)
PBEventSourceCreateFromFD
Function: (not documented yet)
Syntax (C/C++)
PBEventSourcePtr _Nullable PBEventSourceCreateFromFD(int32_t fileDescriptor,
bool takeOwnership);
Syntax (Python)
EventSourceCreateFromFD(fileDescriptor, takeOwnership) -> (source)
Parameters and Return Values
[in] fileDescriptor (int32_t
): (not documented yet)
[in] takeOwnership (bool
): (not documented yet)
[out] source (nullable owned PBEventSource): (not documented yet)
Discussion
If takeOwnership is true and the call fails (i.e., null is returned), the call will close the fileDescriptor.
It is highly recommended that takeOwnership is set to true, since the file descriptor must not be closed until the event source is destroyed.
PBEventSourceCreateTimer
Function: (not documented yet)
Syntax (C/C++)
PBEventSourcePtr _Nullable PBEventSourceCreateTimer(uint32_t periodMs);
Syntax (Python)
EventSourceCreateTimer(periodMs) -> (source)
Parameters and Return Values
[in] periodMs (uint32_t
): (not documented yet)
[out] source (nullable owned PBEventSource): (not documented yet)
PBEventSourceIsActive
Function: (not documented yet)
Syntax (C/C++)
bool PBEventSourceIsActive(PBEventSourceRef source);
Syntax (Python)
EventSourceIsActive(source) -> (isActive)
Parameters and Return Values
[in] source (referenced PBEventSource): (not documented yet)
[out] isActive (bool
): (not documented yet)
PBEventSourceActivate
Function: (not documented yet)
Syntax (C/C++)
bool PBEventSourceActivate(PBEventSourceRef source);
Syntax (Python)
EventSourceActivate(source) -> (isActive)
Parameters and Return Values
[in] source (referenced PBEventSource): (not documented yet)
[out] isActive (bool
): (not documented yet)
Discussion
This function must be called on the thread that is processing the event loop.
PBEventSourceDeactivate
Function: (not documented yet)
Syntax (C/C++)
void PBEventSourceDeactivate(PBEventSourceRef source);
Syntax (Python)
EventSourceDeactivate(source)
Parameters and Return Values
[in] source (referenced PBEventSource): (not documented yet)
Discussion
This function must be called on the thread that is processing the event loop. This function does nothing if the source has already been deactivated.
PBEventSourceSetFlags
Function: (not documented yet)
Syntax (C/C++)
void PBEventSourceSetFlags(PBEventSourceRef source, PBEventSourceFlags flags);
Syntax (Python)
EventSourceSetFlags(source, flags)
Parameters and Return Values
[in] source (referenced PBEventSource): (not documented yet)
[in] flags (PBEventSourceFlags): (not documented yet)
PBEventSourceSetHandler
Function: (not documented yet)
Syntax (C/C++)
void PBEventSourceSetHandler(PBEventSourceRef source, PBEventHandler handler);
Syntax (Python)
EventSourceSetHandler(source, handler)
Parameters and Return Values
[in] source (referenced PBEventSource): (not documented yet)
[in] handler (PBEventHandler): (not documented yet)
PBEventSourceSetUserDataInt
Function: (not documented yet)
Syntax (C/C++)
void PBEventSourceSetUserDataInt(PBEventSourceRef source, int64_t integer);
Syntax (Python)
EventSourceSetUserDataInt(source, integer)
Parameters and Return Values
[in] source (referenced PBEventSource): (not documented yet)
[in] integer (int64_t
): (not documented yet)
PBEventSourceSetUserDataPtr
Function: (not documented yet)
Syntax (C/C++)
void PBEventSourceSetUserDataPtr(PBEventSourceRef source,
void *_Nullable pointer);
Syntax (Python)
EventSourceSetUserDataPtr(source, pointer)
Parameters and Return Values
[in] source (referenced PBEventSource): (not documented yet)
[in] pointer (opaque pointer): (not documented yet)
PBEventSourceSetUserDataPtrWithOwnership
Function: (not documented yet)
Syntax (C/C++)
void PBEventSourceSetUserDataPtrWithOwnership(PBEventSourceRef source,
void *_Nullable pointer);
Syntax (Python)
EventSourceSetUserDataPtrWithOwnership(source, pointer)
Parameters and Return Values
[in] source (referenced PBEventSource): (not documented yet)
[in] pointer (opaque pointer): (not documented yet)
PBEventSourceGetUserDataInt
Function: (not documented yet)
Syntax (C/C++)
int64_t PBEventSourceGetUserDataInt(PBEventSourceRef source);
Syntax (Python)
EventSourceGetUserDataInt(source) -> (integer)
Parameters and Return Values
[in] source (referenced PBEventSource): (not documented yet)
[out] integer (int64_t
): (not documented yet)
PBEventSourceGetUserDataPtr
Function: (not documented yet)
Syntax (C/C++)
void *_Nullable PBEventSourceGetUserDataPtr(PBEventSourceRef source);
Syntax (Python)
EventSourceGetUserDataPtr(source) -> (pointer)
Parameters and Return Values
[in] source (referenced PBEventSource): (not documented yet)
[out] pointer (opaque pointer): (not documented yet)
PBEventSourceGetTimeSincePreviousEvent
Function: (not documented yet)
Syntax (C/C++)
double PBEventSourceGetTimeSincePreviousEvent(PBEventSourceRef source);
Syntax (Python)
EventSourceGetTimeSincePreviousEvent(source) -> (timeInSeconds)
Parameters and Return Values
[in] source (referenced PBEventSource): (not documented yet)
[out] timeInSeconds (double
): (not documented yet)
Discussion
This can only be called during the event handler of the specified source. If there is no event between the current event and the most recent activation of the source, then this returns the time since activation.