OSVR-Core
PluginRegistrationC.h
Go to the documentation of this file.
1 
14 /*
15 // Copyright 2014 Sensics, Inc.
16 //
17 // Licensed under the Apache License, Version 2.0 (the "License");
18 // you may not use this file except in compliance with the License.
19 // You may obtain a copy of the License at
20 //
21 // http://www.apache.org/licenses/LICENSE-2.0
22 //
23 // Unless required by applicable law or agreed to in writing, software
24 // distributed under the License is distributed on an "AS IS" BASIS,
25 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
26 // See the License for the specific language governing permissions and
27 // limitations under the License.
28 */
29 
30 #ifndef INCLUDED_PluginRegistrationC_h_GUID_C019DFA9_5B54_4791_B0A4_040EA20501BA
31 #define INCLUDED_PluginRegistrationC_h_GUID_C019DFA9_5B54_4791_B0A4_040EA20501BA
32 
33 /* Internal Includes */
34 #include <osvr/PluginKit/Export.h>
35 #include <osvr/PluginKit/CommonC.h>
38 #include <osvr/Util/LogLevelC.h>
39 
40 /* Library/third-party includes */
41 #include <libfunctionality/PluginInterface.h>
42 
43 /* Standard includes */
44 #include <stddef.h>
45 
54 OSVR_EXTERN_C_BEGIN
55 
67 #define OSVR_PLUGIN(PLUGIN_NAME) LIBFUNC_PLUGIN(PLUGIN_NAME, ctx)
68 
90 OSVR_PLUGINKIT_EXPORT OSVR_ReturnCode osvrPluginRegisterHardwareDetectCallback(
92  OSVR_IN OSVR_HardwareDetectCallback detectCallback,
93  OSVR_IN_OPT void *userData OSVR_CPP_ONLY(= NULL)) OSVR_FUNC_NONNULL((1));
94 
107 OSVR_PLUGINKIT_EXPORT OSVR_ReturnCode osvrRegisterDriverInstantiationCallback(
108  OSVR_INOUT_PTR OSVR_PluginRegContext ctx, OSVR_IN_STRZ const char *name,
110  OSVR_IN_OPT void *userData OSVR_CPP_ONLY(= NULL))
111  OSVR_FUNC_NONNULL((1, 2, 3));
112 
141 OSVR_PLUGINKIT_EXPORT OSVR_ReturnCode osvrPluginRegisterDataWithDeleteCallback(
143  OSVR_IN OSVR_PluginDataDeleteCallback deleteCallback,
144  OSVR_INOUT_PTR void *pluginData) OSVR_FUNC_NONNULL((1, 2, 3));
154 OSVR_PLUGINKIT_EXPORT void
156  OSVR_IN OSVR_LogLevel severity, OSVR_IN const char *message)
157  OSVR_FUNC_NONNULL((1, 3));
158 
159 OSVR_EXTERN_C_END
160 
163 #endif
#define OSVR_IN_STRZ
Indicates a null-terminated string function parameter that serves only as input.
Definition: AnnotationMacrosC.h:124
#define OSVR_IN_PTR
Indicates a required pointer (non-null) function parameter that serves only as input.
Definition: AnnotationMacrosC.h:108
Header.
#define OSVR_IN_OPT
Indicates a function parameter (pointer) that serves only as input, but is optional and might be NULL...
Definition: AnnotationMacrosC.h:116
OSVR_PLUGINKIT_EXPORT OSVR_ReturnCode osvrPluginRegisterDataWithDeleteCallback(OSVR_INOUT_PTR OSVR_PluginRegContext ctx, OSVR_IN OSVR_PluginDataDeleteCallback deleteCallback, OSVR_INOUT_PTR void *pluginData) OSVR_FUNC_NONNULL((1
Register plugin data along with an appropriate deleter callback.
OSVR_PLUGINKIT_EXPORT OSVR_ReturnCode osvrPluginRegisterHardwareDetectCallback(OSVR_INOUT_PTR OSVR_PluginRegContext ctx, OSVR_IN OSVR_HardwareDetectCallback detectCallback, OSVR_IN_OPT void *userData OSVR_CPP_ONLY(=NULL)) OSVR_FUNC_NONNULL((1))
Register a callback in your plugin to be notified when hardware should be detected again...
#define OSVR_FUNC_NONNULL(X)
Indicates the parameter(s) that must be non-null.
Definition: AnnotationMacrosC.h:202
Header declaring plugin callback types.
OSVR_PLUGINKIT_EXPORT OSVR_ReturnCode OSVR_PLUGINKIT_EXPORT void osvrPluginLog(OSVR_INOUT_PTR OSVR_PluginRegContext ctx, OSVR_IN OSVR_LogLevel severity, OSVR_IN const char *message) OSVR_FUNC_NONNULL((1
Log a message to the plugin&#39;s log channel.
void(* OSVR_PluginDataDeleteCallback)(void *pluginData)
Function type of a Plugin Data Delete callback.
Definition: PluginCallbackTypesC.h:48
#define OSVR_INOUT_PTR
Indicates a required pointer (non-null) function parameter that is both read and written to...
Definition: AnnotationMacrosC.h:178
OSVR_PLUGINKIT_EXPORT OSVR_ReturnCode osvrRegisterDriverInstantiationCallback(OSVR_INOUT_PTR OSVR_PluginRegContext ctx, OSVR_IN_STRZ const char *name, OSVR_IN_PTR OSVR_DriverInstantiationCallback cb, OSVR_IN_OPT void *userData OSVR_CPP_ONLY(=NULL)) OSVR_FUNC_NONNULL((1
Register an instantiation callback (constructor) for a driver type.
OSVR_ReturnCode(* OSVR_HardwareDetectCallback)(OSVR_PluginRegContext ctx, void *userData)
Function type of a Hardware Detect callback.
Definition: PluginCallbackTypesC.h:51
OSVR_LogLevel
Log message severity levels.
Definition: LogLevelC.h:44
Header containing macros for source-level annotation.
OSVR_ReturnCode(* OSVR_DriverInstantiationCallback)(OSVR_PluginRegContext ctx, const char *params, void *userData)
Function type of a driver instantiation callback.
Definition: PluginCallbackTypesC.h:55
OSVR_EXTERN_C_BEGIN typedef void * OSVR_PluginRegContext
A context pointer passed in to your plugin&#39;s entry point and other locations of control flow transfer...
Definition: PluginRegContextC.h:47
#define OSVR_IN
Indicates a required function parameter that serves only as input.
Definition: AnnotationMacrosC.h:100
Header shared between multiple C API headers.