Monado OpenXR Runtime
Loading...
Searching...
No Matches
oxr_binding_registry.c File Reference

Runtime registry built from generated OpenXR binding templates. More...

#include "util/u_hashmap.h"
#include "util/u_misc.h"
#include "oxr_binding_registry.h"
#include "oxr_binding_point_store.h"
#include "oxr_binding_profile.h"
#include "oxr_rebinding_profile.h"
#include "oxr_session_action_context.h"
#include "oxr_subaction_store.h"
#include "../oxr_logger.h"
#include "../path/oxr_path_store.h"
#include <assert.h>
#include <string.h>
#include <stdlib.h>
Include dependency graph for oxr_binding_registry.c:

Macros

#define MAKE_PATH(STR, OUT_PATH)
 
#define MAKE_PATH_OPT(STR, OUT_PATH)
 
#define ADD_SUBACTION(lower, CAP, PATH, LOCALIZED_NAME)
 

Functions

static XrResult make_path (struct oxr_path_store *store, const char *str, XrPath *out_path)
 
static XrResult make_path_opt (struct oxr_path_store *store, const char *str, XrPath *out_path)
 
static XrResult binding_registry_add_subaction (struct oxr_logger *log, struct oxr_path_store *store, struct oxr_binding_registry *registry, const char *subaction_path_str, const char *localized_name)
 
static XrResult binding_registry_populate_subactions (struct oxr_logger *log, struct oxr_path_store *store, struct oxr_binding_registry *registry)
 
static void binding_point_fini (struct oxr_binding_point *point)
 
static void dpad_emulation_fini (struct oxr_dpad_emulation *emulation)
 
static void binding_profile_fini (struct oxr_binding_profile *profile)
 
static void rebinding_profile_fini (struct oxr_rebinding_profile *profile)
 
static void registry_destroy_cb (struct oxr_refcounted *orc)
 
static XrResult dpad_emulation_init (struct oxr_logger *log, struct oxr_path_store *store, struct oxr_binding_profile *profile, const struct oxr_dpad_emulation_template *templ, struct oxr_dpad_emulation *emulation)
 
static struct oxr_dpad_emulation * binding_profile_find_dpad_emulation_by_path (struct oxr_binding_profile *profile, XrPath path)
 
static XrResult binding_registry_get_subaction (struct oxr_logger *log, struct oxr_path_store *store, struct oxr_binding_registry *registry, const char *subaction_path_str, const struct oxr_binding_subaction **out_subaction)
 
static XrResult binding_point_init (struct oxr_logger *log, struct oxr_path_store *store, struct oxr_binding_profile *profile, const struct oxr_binding_point_template *templ, struct oxr_binding_point *point)
 
static XrResult binding_profile_init (struct oxr_logger *log, struct oxr_path_store *store, struct oxr_binding_registry *registry, const struct oxr_profile_template *templ, struct oxr_binding_profile *profile)
 
static XrResult rebinding_profile_init (struct oxr_logger *log, struct oxr_path_store *store, const struct oxr_rebinding_profile_template *templ, struct oxr_rebinding_profile *profile)
 
XrResult oxr_binding_registry_create (struct oxr_logger *log, struct oxr_path_store *store, struct oxr_binding_registry **out_registry)
 
void oxr_binding_registry_ref (struct oxr_binding_registry *registry)
 
void oxr_binding_registry_unref (struct oxr_binding_registry *registry)
 
bool oxr_binding_registry_find_profile (const struct oxr_binding_registry *registry, XrPath path, const struct oxr_binding_profile **out_profile)
 
bool oxr_binding_registry_get_for_source_path (const struct oxr_binding_registry *registry, XrPath source_path, const struct oxr_binding_point **out_binding_point)
 
bool oxr_binding_registry_find_rebinding_from_source_for_device (const struct oxr_binding_registry *registry, XrPath source_profile_path, enum xrt_device_name target_device_name, const struct oxr_rebinding_profile **out_rebinding)
 

Detailed Description

Runtime registry built from generated OpenXR binding templates.

Macro Definition Documentation

◆ ADD_SUBACTION

#define ADD_SUBACTION (   lower,
  CAP,
  PATH,
  LOCALIZED_NAME 
)
Value:
do { \
XrResult ret = binding_registry_add_subaction(log, store, registry, PATH, LOCALIZED_NAME); \
if (ret != XR_SUCCESS) { \
return ret; \
} \
} while (false);

◆ MAKE_PATH

#define MAKE_PATH (   STR,
  OUT_PATH 
)
Value:
do { \
XrResult ret = make_path(store, (STR), (OUT_PATH)); \
if (ret != XR_SUCCESS) { \
return oxr_error(log, ret, "Failed to create '" #STR "' path"); \
} \
} while (false)
XrResult oxr_error(struct oxr_logger *logger, XrResult result, const char *fmt,...)
Definition oxr_logger.c:203

◆ MAKE_PATH_OPT

#define MAKE_PATH_OPT (   STR,
  OUT_PATH 
)
Value:
do { \
XrResult ret = make_path_opt(store, (STR), (OUT_PATH)); \
if (ret != XR_SUCCESS) { \
return oxr_error(log, ret, "Failed to create '" #STR "' path"); \
} \
} while (false)