* @brief Registers event handlers for the 'Hand Create', 'Hand Update' and 'Hand Destroy' events. * Pass NULL for any event you don't want your application to receive. * * @param [in] CreateCB [Optional] Callback function to be invoked when the 'Hand Create' event is raised. * @param [in] UpdateCB [Optional] Callback function to be invoked when the 'Hand Update' event is raised.
| 6169 | * For full details and usage of the parameters, see @ref reg_to_events. |
| 6170 | */ |
| 6171 | inline XnStatus RegisterHandCallbacks(HandCreate CreateCB, HandUpdate UpdateCB, HandDestroy DestroyCB, void* pCookie, XnCallbackHandle& hCallback) |
| 6172 | { |
| 6173 | XnStatus nRetVal = XN_STATUS_OK; |
| 6174 | |
| 6175 | HandCookie* pHandCookie; |
| 6176 | XN_VALIDATE_ALLOC(pHandCookie, HandCookie); |
| 6177 | pHandCookie->createHandler = CreateCB; |
| 6178 | pHandCookie->updateHandler = UpdateCB; |
| 6179 | pHandCookie->destroyHandler = DestroyCB; |
| 6180 | pHandCookie->pUserCookie = pCookie; |
| 6181 | |
| 6182 | nRetVal = xnRegisterHandCallbacks(GetHandle(), HandCreateCB, HandUpdateCB, HandDestroyCB, pHandCookie, &pHandCookie->hCallback); |
| 6183 | if (nRetVal != XN_STATUS_OK) |
| 6184 | { |
| 6185 | xnOSFree(pHandCookie); |
| 6186 | return (nRetVal); |
| 6187 | } |
| 6188 | |
| 6189 | hCallback = pHandCookie; |
| 6190 | |
| 6191 | return (XN_STATUS_OK); |
| 6192 | } |
| 6193 | |
| 6194 | /** |
| 6195 | * @brief Unregisters event handlers for the 'Hand Create', 'Hand Update' and 'Hand Destroy' events. |
no test coverage detected