Blender
V3.3
|
#include <math.h>
#include <string.h>
#include "BKE_context.h"
#include "BKE_idprop.h"
#include "BLI_listbase.h"
#include "BLI_string.h"
#include "GHOST_Types.h"
#include "MEM_guardedalloc.h"
#include "WM_api.h"
#include "WM_types.h"
#include "wm_xr_intern.h"
Go to the source code of this file.
Macros | |
Window-Manager XR Action Maps | |
XR actionmap API, similar to WM keymap API. | |
#define | WM_XR_ACTIONMAP_STR_DEFAULT "actionmap" |
#define | WM_XR_ACTIONMAP_ITEM_STR_DEFAULT "action" |
#define | WM_XR_ACTIONMAP_BINDING_STR_DEFAULT "binding" |
#define WM_XR_ACTIONMAP_BINDING_STR_DEFAULT "binding" |
Definition at line 31 of file wm_xr_actionmap.c.
#define WM_XR_ACTIONMAP_ITEM_STR_DEFAULT "action" |
Definition at line 30 of file wm_xr_actionmap.c.
#define WM_XR_ACTIONMAP_STR_DEFAULT "actionmap" |
Definition at line 29 of file wm_xr_actionmap.c.
short WM_xr_actionmap_active_index_get | ( | const wmXrRuntimeData * | runtime | ) |
Definition at line 527 of file wm_xr_actionmap.c.
References wmXrRuntimeData::actactionmap.
void WM_xr_actionmap_active_index_set | ( | wmXrRuntimeData * | runtime, |
short | idx | ||
) |
Definition at line 532 of file wm_xr_actionmap.c.
References wmXrRuntimeData::actactionmap.
XrActionMap* WM_xr_actionmap_add_copy | ( | wmXrRuntimeData * | runtime, |
XrActionMap * | am_src | ||
) |
Definition at line 458 of file wm_xr_actionmap.c.
References wmXrRuntimeData::actionmaps, BLI_addtail(), wm_xr_actionmap_copy(), and WM_xr_actionmap_ensure_unique().
XrActionMapBinding* WM_xr_actionmap_binding_add_copy | ( | XrActionMapItem * | ami, |
XrActionMapBinding * | amb_src | ||
) |
Definition at line 115 of file wm_xr_actionmap.c.
References XrActionMapItem::bindings, BLI_addtail(), wm_xr_actionmap_binding_copy(), and WM_xr_actionmap_binding_ensure_unique().
|
static |
Definition at line 127 of file wm_xr_actionmap.c.
References BLI_freelistN(), and XrActionMapBinding::component_paths.
Referenced by WM_xr_actionmap_binding_remove(), and wm_xr_actionmap_item_clear().
|
static |
Definition at line 101 of file wm_xr_actionmap.c.
References BLI_addtail(), BLI_listbase_clear(), XrActionMapBinding::component_paths, LISTBASE_FOREACH, MEM_dupallocN, XrActionMapBinding::next, NULL, and XrActionMapBinding::prev.
Referenced by WM_xr_actionmap_binding_add_copy(), and wm_xr_actionmap_item_copy().
void WM_xr_actionmap_binding_ensure_unique | ( | XrActionMapItem * | ami, |
XrActionMapBinding * | amb | ||
) |
Definition at line 74 of file wm_xr_actionmap.c.
References BLI_snprintf(), BLI_strncpy(), BLI_strnlen(), MAX_NAME, XrActionMapBinding::name, wm_xr_actionmap_binding_find_except(), and WM_XR_ACTIONMAP_BINDING_STR_DEFAULT.
Referenced by WM_xr_actionmap_binding_add_copy(), and WM_xr_actionmap_binding_new().
XrActionMapBinding* WM_xr_actionmap_binding_find | ( | XrActionMapItem * | ami, |
const char * | name | ||
) |
Definition at line 152 of file wm_xr_actionmap.c.
References XrActionMapItem::bindings, LISTBASE_FOREACH, MAX_NAME, NULL, and STREQLEN.
Referenced by WM_xr_actionmap_binding_new().
|
static |
Definition at line 62 of file wm_xr_actionmap.c.
References XrActionMapItem::bindings, LISTBASE_FOREACH, MAX_NAME, NULL, and STREQLEN.
Referenced by WM_xr_actionmap_binding_ensure_unique().
XrActionMapBinding* WM_xr_actionmap_binding_new | ( | XrActionMapItem * | ami, |
const char * | name, | ||
bool | replace_existing | ||
) |
Definition at line 39 of file wm_xr_actionmap.c.
References XrActionMapItem::bindings, BLI_addtail(), BLI_strncpy(), XrActionMapBinding::float_threshold, MAX_NAME, MEM_callocN, XrActionMapBinding::name, WM_xr_actionmap_binding_ensure_unique(), and WM_xr_actionmap_binding_find().
bool WM_xr_actionmap_binding_remove | ( | XrActionMapItem * | ami, |
XrActionMapBinding * | amb | ||
) |
Definition at line 132 of file wm_xr_actionmap.c.
References XrActionMapItem::bindings, BLI_findindex(), BLI_freelinkN(), XrActionMapItem::selbinding, and wm_xr_actionmap_binding_clear().
void WM_xr_actionmap_clear | ( | XrActionMap * | actionmap | ) |
Definition at line 504 of file wm_xr_actionmap.c.
References BLI_freelistN(), XrActionMap::items, LISTBASE_FOREACH, XrActionMap::selitem, and wm_xr_actionmap_item_clear().
Referenced by WM_xr_actionmap_new(), WM_xr_actionmap_remove(), and WM_xr_actionmaps_clear().
|
static |
Definition at line 444 of file wm_xr_actionmap.c.
References BLI_addtail(), BLI_listbase_clear(), XrActionMap::items, LISTBASE_FOREACH, MEM_dupallocN, XrActionMap::next, NULL, XrActionMap::prev, and wm_xr_actionmap_item_copy().
Referenced by WM_xr_actionmap_add_copy().
void WM_xr_actionmap_ensure_unique | ( | wmXrRuntimeData * | runtime, |
XrActionMap * | actionmap | ||
) |
Definition at line 417 of file wm_xr_actionmap.c.
References BLI_snprintf(), BLI_strncpy(), BLI_strnlen(), MAX_NAME, XrActionMap::name, wm_xr_actionmap_find_except(), and WM_XR_ACTIONMAP_STR_DEFAULT.
Referenced by WM_xr_actionmap_add_copy(), and WM_xr_actionmap_new().
XrActionMap* WM_xr_actionmap_find | ( | wmXrRuntimeData * | runtime, |
const char * | name | ||
) |
Definition at line 494 of file wm_xr_actionmap.c.
References wmXrRuntimeData::actionmaps, LISTBASE_FOREACH, MAX_NAME, NULL, and STREQLEN.
Referenced by WM_xr_actionmap_new().
|
static |
Definition at line 404 of file wm_xr_actionmap.c.
References wmXrRuntimeData::actionmaps, LISTBASE_FOREACH, MAX_NAME, NULL, and STREQLEN.
Referenced by WM_xr_actionmap_ensure_unique().
XrActionMapItem* WM_xr_actionmap_item_add_copy | ( | XrActionMap * | actionmap, |
XrActionMapItem * | ami_src | ||
) |
Definition at line 336 of file wm_xr_actionmap.c.
References BLI_addtail(), XrActionMap::items, wm_xr_actionmap_item_copy(), and WM_xr_actionmap_item_ensure_unique().
|
static |
Definition at line 189 of file wm_xr_actionmap.c.
References XrActionMapItem::bindings, BLI_freelistN(), LISTBASE_FOREACH, XrActionMapItem::selbinding, XrActionMapItem::user_paths, wm_xr_actionmap_binding_clear(), and wm_xr_actionmap_item_properties_free().
Referenced by WM_xr_actionmap_clear(), and WM_xr_actionmap_item_remove().
|
static |
Definition at line 305 of file wm_xr_actionmap.c.
References XrActionMapItem::bindings, BLI_addtail(), BLI_listbase_clear(), PointerRNA::data, IDP_CopyProperty(), LISTBASE_FOREACH, MEM_callocN, MEM_dupallocN, XrActionMapItem::next, NULL, XrActionMapItem::op, XrActionMapItem::op_properties, XrActionMapItem::op_properties_ptr, XrActionMapItem::prev, XrActionMapItem::user_paths, WM_operator_properties_create(), and wm_xr_actionmap_binding_copy().
Referenced by wm_xr_actionmap_copy(), and WM_xr_actionmap_item_add_copy().
void WM_xr_actionmap_item_ensure_unique | ( | XrActionMap * | actionmap, |
XrActionMapItem * | ami | ||
) |
Definition at line 278 of file wm_xr_actionmap.c.
References BLI_snprintf(), BLI_strncpy(), BLI_strnlen(), MAX_NAME, XrActionMapItem::name, wm_xr_actionmap_item_find_except(), and WM_XR_ACTIONMAP_ITEM_STR_DEFAULT.
Referenced by WM_xr_actionmap_item_add_copy(), and WM_xr_actionmap_item_new().
XrActionMapItem* WM_xr_actionmap_item_find | ( | XrActionMap * | actionmap, |
const char * | name | ||
) |
Definition at line 367 of file wm_xr_actionmap.c.
References XrActionMap::items, LISTBASE_FOREACH, MAX_NAME, NULL, and STREQLEN.
Referenced by WM_xr_actionmap_item_new().
|
static |
Definition at line 266 of file wm_xr_actionmap.c.
References XrActionMap::items, LISTBASE_FOREACH, MAX_NAME, NULL, and STREQLEN.
Referenced by WM_xr_actionmap_item_ensure_unique().
XrActionMapItem* WM_xr_actionmap_item_new | ( | XrActionMap * | actionmap, |
const char * | name, | ||
bool | replace_existing | ||
) |
Definition at line 242 of file wm_xr_actionmap.c.
References BLI_addtail(), BLI_strncpy(), XrActionMap::items, MAX_NAME, MEM_callocN, XrActionMapItem::name, XrActionMapItem::type, WM_xr_actionmap_item_ensure_unique(), WM_xr_actionmap_item_find(), wm_xr_actionmap_item_properties_free(), and XR_FLOAT_INPUT.
|
static |
Definition at line 176 of file wm_xr_actionmap.c.
References BLI_assert, MEM_freeN, NULL, XrActionMapItem::op_properties, XrActionMapItem::op_properties_ptr, and WM_operator_properties_free().
Referenced by wm_xr_actionmap_item_clear(), WM_xr_actionmap_item_new(), and WM_xr_actionmap_item_properties_update_ot().
|
static |
Definition at line 170 of file wm_xr_actionmap.c.
References XrActionMapItem::op, XrActionMapItem::op_properties, XrActionMapItem::op_properties_ptr, WM_operator_properties_alloc(), and WM_operator_properties_sanitize().
Referenced by WM_xr_actionmap_item_properties_update_ot().
void WM_xr_actionmap_item_properties_update_ot | ( | XrActionMapItem * | ami | ) |
Definition at line 202 of file wm_xr_actionmap.c.
References PointerRNA::data, NULL, XrActionMapItem::op, XrActionMapItem::op_properties, XrActionMapItem::op_properties_ptr, ot, wmOperatorType::srna, XrActionMapItem::type, PointerRNA::type, WM_operator_properties_create_ptr(), WM_operator_properties_sanitize(), WM_operatortype_find(), wm_xr_actionmap_item_properties_free(), wm_xr_actionmap_item_properties_set(), XR_BOOLEAN_INPUT, XR_FLOAT_INPUT, XR_POSE_INPUT, XR_VECTOR2F_INPUT, and XR_VIBRATION_OUTPUT.
bool WM_xr_actionmap_item_remove | ( | XrActionMap * | actionmap, |
XrActionMapItem * | ami | ||
) |
Definition at line 347 of file wm_xr_actionmap.c.
References BLI_findindex(), BLI_freelinkN(), XrActionMap::items, XrActionMap::selitem, and wm_xr_actionmap_item_clear().
XrActionMap* WM_xr_actionmap_new | ( | wmXrRuntimeData * | runtime, |
const char * | name, | ||
bool | replace_existing | ||
) |
Definition at line 385 of file wm_xr_actionmap.c.
References wmXrRuntimeData::actionmaps, BLI_addtail(), BLI_strncpy(), MAX_NAME, MEM_callocN, XrActionMap::name, WM_xr_actionmap_clear(), WM_xr_actionmap_ensure_unique(), and WM_xr_actionmap_find().
bool WM_xr_actionmap_remove | ( | wmXrRuntimeData * | runtime, |
XrActionMap * | actionmap | ||
) |
Definition at line 469 of file wm_xr_actionmap.c.
References wmXrRuntimeData::actactionmap, wmXrRuntimeData::actionmaps, BLI_findindex(), BLI_freelinkN(), wmXrRuntimeData::selactionmap, and WM_xr_actionmap_clear().
short WM_xr_actionmap_selected_index_get | ( | const wmXrRuntimeData * | runtime | ) |
Definition at line 537 of file wm_xr_actionmap.c.
References wmXrRuntimeData::selactionmap.
void WM_xr_actionmap_selected_index_set | ( | wmXrRuntimeData * | runtime, |
short | idx | ||
) |
Definition at line 542 of file wm_xr_actionmap.c.
References wmXrRuntimeData::selactionmap.
void WM_xr_actionmaps_clear | ( | wmXrRuntimeData * | runtime | ) |
Definition at line 513 of file wm_xr_actionmap.c.
References wmXrRuntimeData::actactionmap, wmXrRuntimeData::actionmaps, BLI_freelistN(), LISTBASE_FOREACH, wmXrRuntimeData::selactionmap, and WM_xr_actionmap_clear().
Referenced by wm_xr_runtime_data_free().
ListBase* WM_xr_actionmaps_get | ( | wmXrRuntimeData * | runtime | ) |
Definition at line 522 of file wm_xr_actionmap.c.
References wmXrRuntimeData::actionmaps.