Blender
V3.3
|
#include "wm_gizmo_fn.h"
Go to the source code of this file.
Classes | |
struct | wmGizmoMapSelectState |
struct | wmGizmoMap |
struct | wmGizmoMapType |
Typedefs | |
typedef struct wmGizmoMapSelectState | wmGizmoMapSelectState |
Enumerations | |
enum | { WM_GIZMO_IS_VISIBLE_UPDATE = (1 << 0) , WM_GIZMO_IS_VISIBLE_DRAW = (1 << 1) } |
enum | { TWEAK_MODAL_CANCEL = 1 , TWEAK_MODAL_CONFIRM , TWEAK_MODAL_PRECISION_ON , TWEAK_MODAL_PRECISION_OFF , TWEAK_MODAL_SNAP_ON , TWEAK_MODAL_SNAP_OFF } |
typedef struct wmGizmoMapSelectState wmGizmoMapSelectState |
anonymous enum |
Enumerator | |
---|---|
WM_GIZMO_IS_VISIBLE_UPDATE | |
WM_GIZMO_IS_VISIBLE_DRAW |
Definition at line 32 of file wm_gizmo_intern.h.
anonymous enum |
Enumerator | |
---|---|
TWEAK_MODAL_CANCEL | |
TWEAK_MODAL_CONFIRM | |
TWEAK_MODAL_PRECISION_ON | |
TWEAK_MODAL_PRECISION_OFF | |
TWEAK_MODAL_SNAP_ON | |
TWEAK_MODAL_SNAP_OFF |
Definition at line 40 of file wm_gizmo_intern.h.
Definition at line 433 of file wm_gizmo.c.
References C, CTX_wm_region_view3d(), ED_view3d_pixel_size_no_ui_scale(), wmGizmoGroupType::flag, wmGizmo::matrix_basis, wmGizmoType::matrix_basis_get, wmGizmo::matrix_space, mul_m4_m4m4(), wmGizmo::parent_gzgroup, wmGizmo::scale_basis, wmGizmo::scale_final, wmGizmo::type, wmGizmoGroup::type, UI_DPI_FAC, and WM_GIZMOGROUPTYPE_SCALE.
Referenced by wm_gizmo_update().
int wm_gizmo_is_visible | ( | struct wmGizmo * | gz | ) |
Definition at line 482 of file wm_gizmo.c.
References wmGizmo::flag, wmGizmo::state, WM_GIZMO_DRAW_HOVER, WM_GIZMO_DRAW_MODAL, WM_GIZMO_DRAW_VALUE, WM_GIZMO_HIDDEN, WM_GIZMO_IS_VISIBLE_DRAW, WM_GIZMO_IS_VISIBLE_UPDATE, WM_GIZMO_STATE_HIGHLIGHT, WM_GIZMO_STATE_MODAL, and WM_GIZMO_STATE_SELECT.
Referenced by gizmo_prepare_drawing().
bool wm_gizmo_select_and_highlight | ( | bContext * | C, |
struct wmGizmoMap * | gzmap, | ||
struct wmGizmo * | gz | ||
) |
Definition at line 407 of file wm_gizmo.c.
References C, wmGizmo::highlight_part, WM_gizmo_select_set(), and wm_gizmomap_highlight_set().
Referenced by gizmo_select_invoke().
bool wm_gizmo_select_set_ex | ( | struct wmGizmoMap * | gzmap, |
struct wmGizmo * | gz, | ||
bool | select, | ||
bool | use_array, | ||
bool | use_callback | ||
) |
Add/Remove gizmo to selection. Reallocates memory for selected gizmos so better not call for selecting multiple ones.
Definition at line 357 of file wm_gizmo.c.
References select(), wmGizmoType::select_refresh, wmGizmo::state, wmGizmo::type, WM_GIZMO_STATE_SELECT, wm_gizmomap_select_array_push_back(), and wm_gizmomap_select_array_remove().
Referenced by WM_gizmo_select_set(), WM_gizmo_select_unlink(), and wm_gizmomap_deselect_all().
Definition at line 474 of file wm_gizmo.c.
References C, gizmo_update_prop_data(), and wm_gizmo_calculate_scale().
Referenced by gizmo_prepare_drawing().
struct wmGizmoGroup* wm_gizmogroup_find_by_type | ( | const struct wmGizmoMap * | gzmap, |
const struct wmGizmoGroupType * | gzgt | ||
) |
struct wmGizmo* wm_gizmogroup_find_intersected_gizmo | ( | wmWindowManager * | wm, |
const struct wmGizmoGroup * | gzgroup, | ||
struct bContext * | C, | ||
int | event_modifier, | ||
const int | mval[2], | ||
int * | r_part | ||
) |
void wm_gizmogroup_free | ( | bContext * | C, |
struct wmGizmoGroup * | gzgroup | ||
) |
Definition at line 70 of file wm_gizmo_group.c.
References BKE_reports_clear(), BLI_listbase_clear(), BLI_remlink(), BPY_DECREF_RNA_INVALIDATE(), C, wmGizmoGroup::customdata, wmGizmoGroup::customdata_free, ListBase::first, ReportList::flag, wmGizmoGroup::gizmos, wmGizmoMap::groups, wmGizmoMap::gzmap_context, wmGizmoMap::highlight, wmGizmoMapSelectState::len, MEM_freeN, MEM_SAFE_FREE, wmGizmoMap::modal, NULL, wmGizmo::parent_gzgroup, wmGizmoGroup::parent_gzmap, wmGizmoGroup::py_instance, wmGizmoGroup::reports, RPT_FREE, wmGizmoMap::select, wmGizmoGroup::tag_remove, wmGizmoGroup::type, wmGizmoGroupType::users, WM_gizmo_free(), WM_gizmo_select_unlink(), wm_gizmomap_highlight_set(), and wm_gizmomap_modal_set().
Referenced by WM_gizmo_group_remove_by_tool(), WM_gizmoconfig_update(), wm_gizmomap_free_data(), and WM_gizmomaptype_group_unlink().
void wm_gizmogroup_gizmo_register | ( | struct wmGizmoGroup * | gzgroup, |
struct wmGizmo * | gz | ||
) |
Add gizmo to gzgroup and make sure its name is unique within the group.
Definition at line 132 of file wm_gizmo_group.c.
References BLI_addtail(), BLI_assert, BLI_findindex(), wmGizmoGroup::gizmos, and wmGizmo::parent_gzgroup.
Referenced by wm_gizmo_register().
void wm_gizmogroup_intersectable_gizmos_to_list | ( | wmWindowManager * | wm, |
const struct wmGizmoGroup * | gzgroup, | ||
int | event_modifier, | ||
struct BLI_Buffer * | visible_gizmos | ||
) |
Adds all gizmos of gzgroup that can be selected to the head of listbase. Added items need freeing!
bool wm_gizmogroup_is_visible_in_drawstep | ( | const struct wmGizmoGroup * | gzgroup, |
eWM_GizmoFlagMapDrawStep | drawstep | ||
) |
struct wmGizmoGroup* wm_gizmogroup_new_from_type | ( | struct wmGizmoMap * | gzmap, |
struct wmGizmoGroupType * | gzgt | ||
) |
Create a new gizmo-group from gzgt.
Definition at line 50 of file wm_gizmo_group.c.
References BLI_addtail(), wmGizmoMap::groups, MEM_callocN, wmGizmoGroup::parent_gzmap, wmGizmoGroup::type, and wmGizmoGroupType::users.
Referenced by wm_gizmomap_new_from_type_ex(), and WM_gizmomaptype_group_init_runtime_with_region().
wmKeyMap* wm_gizmogroup_tweak_modal_keymap | ( | struct wmKeyConfig * | keyconf | ) |
Definition at line 617 of file wm_gizmo_group.c.
References EVT_ESCKEY, EVT_LEFTCTRLKEY, EVT_LEFTSHIFTKEY, EVT_PADENTER, EVT_RETKEY, EVT_RIGHTCTRLKEY, EVT_RIGHTSHIFTKEY, KM_ANY, KM_PRESS, KM_RELEASE, KMAP_MAX_NAME, wmKeyMap::modal_items, NULL, RIGHTMOUSE, STRNCPY, TWEAK_MODAL_CANCEL, TWEAK_MODAL_CONFIRM, TWEAK_MODAL_PRECISION_OFF, TWEAK_MODAL_PRECISION_ON, TWEAK_MODAL_SNAP_OFF, TWEAK_MODAL_SNAP_ON, WM_modalkeymap_add_item(), WM_modalkeymap_assign(), WM_modalkeymap_ensure(), and WM_modalkeymap_find().
Referenced by wm_gizmos_keymap().
void wm_gizmogrouptype_setup_keymap | ( | struct wmGizmoGroupType * | gzgt, |
struct wmKeyConfig * | keyconf | ||
) |
Definition at line 1066 of file wm_gizmo_group.c.
References wmGizmoGroupType::keyconf, wmGizmoGroupType::keymap, wmGizmoGroupType::setup_keymap, wmGizmoGroupType::type_update_flag, and WM_GIZMOMAPTYPE_KEYMAP_INIT.
Referenced by WM_gizmogroup_ensure_init(), WM_gizmomaptype_group_init_runtime_keymap(), and wm_gizmos_keymap().
bool wm_gizmomap_deselect_all | ( | struct wmGizmoMap * | gzmap | ) |
Deselect all selected gizmos in gzmap.
Definition at line 855 of file wm_gizmo_map.c.
References wmGizmoMap::gzmap_context, wmGizmoMapSelectState::items, wmGizmoMapSelectState::len, NULL, wmGizmoMap::select, wm_gizmo_select_set_ex(), and wm_gizmomap_select_array_clear().
Referenced by gizmo_select_invoke(), and WM_gizmomap_select_all().
void wm_gizmomap_select_array_clear | ( | struct wmGizmoMap * | gzmap | ) |
Definition at line 95 of file wm_gizmo_map.c.
References wmGizmoMap::gzmap_context, wmGizmoMapSelectState::items, wmGizmoMapSelectState::len, wmGizmoMapSelectState::len_alloc, MEM_SAFE_FREE, and wmGizmoMap::select.
Referenced by wm_gizmomap_deselect_all(), wm_gizmomap_free_data(), and wm_gizmomap_select_array_shrink().
void wm_gizmomap_select_array_push_back | ( | struct wmGizmoMap * | gzmap, |
wmGizmo * | gz | ||
) |
Definition at line 118 of file wm_gizmo_map.c.
References BLI_assert, wmGizmoMap::gzmap_context, wmGizmoMapSelectState::items, wmGizmoMapSelectState::len, wmGizmoMapSelectState::len_alloc, MEM_reallocN, and wmGizmoMap::select.
Referenced by wm_gizmo_select_set_ex().
void wm_gizmomap_select_array_remove | ( | struct wmGizmoMap * | gzmap, |
wmGizmo * | gz | ||
) |
Definition at line 129 of file wm_gizmo_map.c.
References wmGizmoMap::gzmap_context, wmGizmoMapSelectState::items, wmGizmoMapSelectState::len, wmGizmoMap::select, and wm_gizmomap_select_array_shrink().
Referenced by wm_gizmo_select_set_ex().
void wm_gizmomap_select_array_shrink | ( | struct wmGizmoMap * | gzmap, |
int | len_subtract | ||
) |
Definition at line 103 of file wm_gizmo_map.c.
References wmGizmoMap::gzmap_context, wmGizmoMapSelectState::items, wmGizmoMapSelectState::len, wmGizmoMapSelectState::len_alloc, MEM_reallocN, wmGizmoMap::select, and wm_gizmomap_select_array_clear().
Referenced by wm_gizmomap_select_array_remove().