Added functionality for user payload data in mjSpec.

PiperOrigin-RevId: 738343134
Change-Id: I6217362ced9993afcd5a2914c78718ffe3bf753a
This commit is contained in:
Alessio Quaglino
2025-03-19 04:35:12 -07:00
committed by Copybara-Service
parent dc50fbbb9b
commit 209d2bd2c5
9 changed files with 184 additions and 2 deletions
+68
View File
@@ -10471,6 +10471,74 @@ FUNCTIONS: Mapping[str, FunctionDecl] = dict([
),
doc='Transform body into a frame.',
)),
('mjs_setUserValue',
FunctionDecl(
name='mjs_setUserValue',
return_type=ValueType(name='void'),
parameters=(
FunctionParameterDecl(
name='element',
type=PointerType(
inner_type=ValueType(name='mjsElement'),
),
),
FunctionParameterDecl(
name='key',
type=PointerType(
inner_type=ValueType(name='char', is_const=True),
),
),
FunctionParameterDecl(
name='data',
type=PointerType(
inner_type=ValueType(name='void', is_const=True),
),
),
),
doc='Set user payload, overriding the existing value for the specified key if present.', # pylint: disable=line-too-long
)),
('mjs_getUserValue',
FunctionDecl(
name='mjs_getUserValue',
return_type=PointerType(
inner_type=ValueType(name='void', is_const=True),
),
parameters=(
FunctionParameterDecl(
name='element',
type=PointerType(
inner_type=ValueType(name='mjsElement'),
),
),
FunctionParameterDecl(
name='key',
type=PointerType(
inner_type=ValueType(name='char', is_const=True),
),
),
),
doc='Return user payload or NULL if none found.',
)),
('mjs_deleteUserValue',
FunctionDecl(
name='mjs_deleteUserValue',
return_type=ValueType(name='void'),
parameters=(
FunctionParameterDecl(
name='element',
type=PointerType(
inner_type=ValueType(name='mjsElement'),
),
),
FunctionParameterDecl(
name='key',
type=PointerType(
inner_type=ValueType(name='char', is_const=True),
),
),
),
doc='Delete user payload.',
)),
('mjs_defaultSpec',
FunctionDecl(
name='mjs_defaultSpec',