More advanced binding data structs
Consider making the binding data hold more information.
/*
*
* Public bits
*
*/
struct oxr_binding_data_profile;
struct oxr_binding_data_source;
struct oxr_binding_data_component;
struct oxr_binding_data_component
{
const char *path;
size_t path_len;
struct oxr_binding_data_source *source;
};
struct oxr_binding_data_source
{
const char *path;
size_t path_len;
struct oxr_binding_data_profile *profile;
struct oxr_binding_data_component *bool_upgrade;
struct oxr_binding_data_component *vec1_upgrade;
struct oxr_binding_data_component *vec2_upgrade;
struct oxr_binding_data_component *pose_upgrade;
struct oxr_binding_data_component *x_upgrade;
struct oxr_binding_data_component *y_upgrade;
};
struct oxr_binding_data_profile
{
const char *path;
size_t path_len;
struct
{
struct oxr_binding_data_source **sources;
uint32_t sources_num;
} left, right, head, gamepad;
};
/*
*
* Private in generated files from bindings.json, accessed via getter functions.
*
*/
extern struct oxr_binding_data_component psmv_component_trigger_cross_mndx_left;
extern struct oxr_binding_data_source psmv_source_cross_left;
extern struct oxr_binding_data_profile psmv_profile;
struct oxr_binding_data_component psmv_component_click_cross_mndx_left = {
.path = "/user/hand/left/input/cross_mndx/click",
.path_len = 23,
.source = &psmv_source_cross_left,
};
struct oxr_binding_data_source psmv_source_cross_left = {
.path = "/user/hand/left/input/cross_mndx",
.path_len = 23,
.profile = &psmv_profile,
.bool_upgrade = &psmv_component_click_cross_mndx_left,
};
struct oxr_binding_data_source *psmv_sources[] = {
&psmv_source_cross_left,
};
struct oxr_binding_data_profile psmv_profile = {
.path = "/interaction_profiles/mndx/ball_on_a_stick_controller",
.path_len = 23,
.left.sources = psmv_sources,
.left.sources_num = ARRAY_SIZE(psmv_sources),
};