-
Notifications
You must be signed in to change notification settings - Fork 13
Legacy: PmCreateCallback routine
You are reading the documentation of YYToolkit Legacy (v2.x.x) - for documentation on current-gen YYTK, see the Homepage.
Registers and creates a callback routine for a plugin.
YYTKStatus PmCreateCallback(
PluginAttributes_t* pObjectAttributes,
CallbackAttributes_t* &outAttributes,
FNEventHandler pfnCallback,
EventType Flags,
void* OptionalArgument
);
Attributes of the owner plugin object. Plugins should use PmGetPluginAttributes to get an opaque pointer to the structure.
A reference to a CallbackAttributes_t
pointer. Plugins should keep this pointer for use in a PmRemoveCallback call.
The function associated with the callback. It gets called by the YYTK Core.
Events under which the callback should be run. These values may be OR'd via the bitwise |
operator, to register it for more than one event type.
The callback can then get the actual type by interrogating the passed-in YYTKEventBase
structure.
If the passed in value is NULL
, the callback is not called, but the function returns a valid CallbackAttributes_t
pointer which still has to be unregistered.
The argument always passed to the registered callback function.
The meaning of this value is entirely plugin-dependant.
The function returns YYTK_OK
on success. If or more arguments are invalid, the function returns YYTK_INVALIDARG
.
It is entirely possible for two distinct calls to PmCreateCallback
to register the same function.
If this happens, plugins must unregister both CallbackAttributes structs by calling PmRemoveCallback.