InterfaceCallbackC.h (2446B)
1 /** @file 2 @brief Header 3 4 Must be c-safe! 5 6 @date 2014 7 8 @author 9 Sensics, Inc. 10 <http://sensics.com/osvr> 11 */ 12 13 /* 14 // Copyright 2014 Sensics, Inc. 15 // 16 // Licensed under the Apache License, Version 2.0 (the "License"); 17 // you may not use this file except in compliance with the License. 18 // You may obtain a copy of the License at 19 // 20 // http://www.apache.org/licenses/LICENSE-2.0 21 // 22 // Unless required by applicable law or agreed to in writing, software 23 // distributed under the License is distributed on an "AS IS" BASIS, 24 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 25 // See the License for the specific language governing permissions and 26 // limitations under the License. 27 */ 28 29 #ifndef INCLUDED_InterfaceCallbacksC_h_GUID_8F16E6CB_F998_4ABC_5B6B_4FC1E4B71BC9 30 #define INCLUDED_InterfaceCallbacksC_h_GUID_8F16E6CB_F998_4ABC_5B6B_4FC1E4B71BC9 31 32 /* Internal Includes */ 33 #include <osvr/ClientKit/Export.h> 34 #include <osvr/Util/APIBaseC.h> 35 #include <osvr/Util/ReturnCodesC.h> 36 #include <osvr/Util/AnnotationMacrosC.h> 37 #include <osvr/Util/ClientOpaqueTypesC.h> 38 #include <osvr/Util/ClientCallbackTypesC.h> 39 40 /* Library/third-party includes */ 41 /* none */ 42 43 /* Standard includes */ 44 /* none */ 45 46 OSVR_EXTERN_C_BEGIN 47 48 #define OSVR_INTERFACE_CALLBACK_METHOD(TYPE) \ 49 /** @brief Register a callback for TYPE reports on an interface */ \ 50 OSVR_CLIENTKIT_EXPORT OSVR_ReturnCode osvrRegister##TYPE##Callback( \ 51 OSVR_ClientInterface iface, OSVR_##TYPE##Callback cb, void* userdata); 52 53 OSVR_INTERFACE_CALLBACK_METHOD(Pose) 54 OSVR_INTERFACE_CALLBACK_METHOD(Position) 55 OSVR_INTERFACE_CALLBACK_METHOD(Orientation) 56 OSVR_INTERFACE_CALLBACK_METHOD(Velocity) 57 OSVR_INTERFACE_CALLBACK_METHOD(LinearVelocity) 58 OSVR_INTERFACE_CALLBACK_METHOD(AngularVelocity) 59 OSVR_INTERFACE_CALLBACK_METHOD(Acceleration) 60 OSVR_INTERFACE_CALLBACK_METHOD(LinearAcceleration) 61 OSVR_INTERFACE_CALLBACK_METHOD(AngularAcceleration) 62 OSVR_INTERFACE_CALLBACK_METHOD(Button) 63 OSVR_INTERFACE_CALLBACK_METHOD(Analog) 64 OSVR_INTERFACE_CALLBACK_METHOD(Imaging) 65 OSVR_INTERFACE_CALLBACK_METHOD(Location2D) 66 OSVR_INTERFACE_CALLBACK_METHOD(Direction) 67 OSVR_INTERFACE_CALLBACK_METHOD(EyeTracker2D) 68 OSVR_INTERFACE_CALLBACK_METHOD(EyeTracker3D) 69 OSVR_INTERFACE_CALLBACK_METHOD(EyeTrackerBlink) 70 OSVR_INTERFACE_CALLBACK_METHOD(NaviVelocity) 71 OSVR_INTERFACE_CALLBACK_METHOD(NaviPosition) 72 73 #undef OSVR_INTERFACE_CALLBACK_METHOD 74 75 OSVR_EXTERN_C_END 76 77 #endif