mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-02-17 19:20:13 +00:00
st/oxr: Add a very ugly stub implementation of xrGetInputSourceLocalizedName
This commit is contained in:
parent
53a0646e24
commit
9f684dbc21
|
@ -13,6 +13,7 @@
|
||||||
|
|
||||||
#include "oxr_objects.h"
|
#include "oxr_objects.h"
|
||||||
#include "oxr_logger.h"
|
#include "oxr_logger.h"
|
||||||
|
#include "oxr_two_call.h"
|
||||||
|
|
||||||
#include "oxr_binding_data.h"
|
#include "oxr_binding_data.h"
|
||||||
|
|
||||||
|
@ -212,6 +213,33 @@ add_key_to_matching_bindings(struct oxr_binding *bindings,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
add_path_string(struct oxr_logger *log,
|
||||||
|
struct oxr_instance *inst,
|
||||||
|
XrPath path,
|
||||||
|
char *temp,
|
||||||
|
size_t max,
|
||||||
|
ssize_t *current)
|
||||||
|
{
|
||||||
|
const char *str = NULL;
|
||||||
|
size_t length = 0;
|
||||||
|
XrResult ret;
|
||||||
|
|
||||||
|
ret = oxr_path_get_string(log, inst, path, &str, &length);
|
||||||
|
if (ret != XR_SUCCESS) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (*current > 0) {
|
||||||
|
temp[(*current)++] = ' ';
|
||||||
|
}
|
||||||
|
|
||||||
|
ssize_t len = snprintf(temp + *current, max - *current, "%s", str);
|
||||||
|
if (len > 0) {
|
||||||
|
*current += len;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
|
@ -416,22 +444,38 @@ oxr_action_get_input_source_localized_name(
|
||||||
uint32_t *bufferCountOutput,
|
uint32_t *bufferCountOutput,
|
||||||
char *buffer)
|
char *buffer)
|
||||||
{
|
{
|
||||||
//! @todo Implement
|
char temp[1024] = {0};
|
||||||
return oxr_error(log, XR_ERROR_HANDLE_INVALID, "Not implemented");
|
ssize_t current = 0;
|
||||||
}
|
|
||||||
|
|
||||||
XrResult
|
//! @todo This implementation is very very very ugly.
|
||||||
oxr_action_enumerate_bound_sources(struct oxr_logger *log,
|
|
||||||
struct oxr_session *sess,
|
if ((getInfo->whichComponents &
|
||||||
uint64_t key,
|
XR_INPUT_SOURCE_LOCALIZED_NAME_INTERACTION_PROFILE_BIT) != 0) {
|
||||||
uint32_t sourceCapacityInput,
|
add_path_string(log, sess->sys->inst, sess->left, temp,
|
||||||
uint32_t *sourceCountOutput,
|
ARRAY_SIZE(temp), ¤t);
|
||||||
XrPath *sources)
|
|
||||||
{
|
|
||||||
//! @todo Implement
|
|
||||||
if (sourceCountOutput != NULL) {
|
|
||||||
*sourceCountOutput = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return XR_SUCCESS;
|
if (getInfo->whichComponents &
|
||||||
|
XR_INPUT_SOURCE_LOCALIZED_NAME_USER_PATH_BIT) {
|
||||||
|
if (current > 0) {
|
||||||
|
temp[current++] = ' ';
|
||||||
|
}
|
||||||
|
|
||||||
|
ssize_t len = snprintf(temp + current,
|
||||||
|
ARRAY_SIZE(temp) - current, "/user/???");
|
||||||
|
|
||||||
|
if (len > 0) {
|
||||||
|
current += len;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((getInfo->whichComponents &
|
||||||
|
XR_INPUT_SOURCE_LOCALIZED_NAME_COMPONENT_BIT) != 0) {
|
||||||
|
add_path_string(log, sess->sys->inst, getInfo->sourcePath, temp,
|
||||||
|
ARRAY_SIZE(temp), ¤t);
|
||||||
|
}
|
||||||
|
|
||||||
|
OXR_TWO_CALL_HELPER(log, bufferCapacityInput, bufferCountOutput, buffer,
|
||||||
|
(size_t)current, temp,
|
||||||
|
oxr_session_success_result(sess));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue