Blender
V3.3
|
#include <string.h>
#include "BLI_buffer.h"
#include "BLI_ghash.h"
#include "BLI_listbase.h"
#include "BLI_math.h"
#include "BLI_math_bits.h"
#include "BLI_rect.h"
#include "BKE_context.h"
#include "BKE_global.h"
#include "BKE_main.h"
#include "ED_screen.h"
#include "ED_select_utils.h"
#include "ED_view3d.h"
#include "GPU_framebuffer.h"
#include "GPU_matrix.h"
#include "GPU_platform.h"
#include "GPU_select.h"
#include "GPU_state.h"
#include "GPU_viewport.h"
#include "MEM_guardedalloc.h"
#include "WM_api.h"
#include "WM_types.h"
#include "wm_event_system.h"
#include "UI_interface.h"
#include "DEG_depsgraph.h"
#include "wm_gizmo_intern.h"
#include "wm_gizmo_wmapi.h"
Go to the source code of this file.
Typedefs | |
typedef enum eWM_GizmoFlagGroupTypeGlobalFlag | eWM_GizmoFlagGroupTypeGlobalFlag |
Enumerations | |
enum | eWM_GizmoFlagGroupTypeGlobalFlag { WM_GIZMOMAPTYPE_GLOBAL_UPDATE_INIT = (1 << 0) , WM_GIZMOMAPTYPE_GLOBAL_UPDATE_REMOVE = (1 << 1) , WM_GIZMOTYPE_GLOBAL_UPDATE_REMOVE = (1 << 2) } |
enum | { GIZMOMAP_IS_PREPARE_DRAW = (1 << 0) , GIZMOMAP_IS_REFRESH_CALLBACK = (1 << 1) } |
Variables | |
static ListBase | gizmomaptypes = {NULL, NULL} |
static eWM_GizmoFlagGroupTypeGlobalFlag | wm_gzmap_type_update_flag = 0 |
Update when gizmo-map types change.
anonymous enum |
Gizmo-map update tagging.
Enumerator | |
---|---|
GIZMOMAP_IS_PREPARE_DRAW | gizmomap_prepare_drawing has run |
GIZMOMAP_IS_REFRESH_CALLBACK |
Definition at line 72 of file wm_gizmo_map.c.
Update when gizmo-map types change.
Definition at line 57 of file wm_gizmo_map.c.
|
static |
Definition at line 498 of file wm_gizmo_map.c.
References C, wmGizmoType::draw_select, wmGizmo::flag, wmGizmoGroupType::flag, GPU_DEPTH_LESS_EQUAL, GPU_depth_mask(), GPU_DEPTH_NONE, GPU_depth_test(), NULL, wmGizmo::parent_gzgroup, wmGizmo::select_bias, wmGizmo::type, wmGizmoGroup::type, WM_GIZMO_SELECT_BACKGROUND, and WM_GIZMOGROUPTYPE_DEPTH_3D.
Referenced by gizmo_find_intersected_3d_intern().
|
static |
Try to find a 3D gizmo at screen-space coordinate co. Uses OpenGL picking.
Definition at line 637 of file wm_gizmo_map.c.
References ARRAY_SIZE, BLI_assert, C, CTX_wm_region(), wmGizmoType::draw_select, gizmo_find_intersected_3d_intern(), GPU_framebuffer_bind(), GPU_framebuffer_free(), GPU_framebuffer_restore(), GPU_viewport_depth_texture(), NULL, result, wmGizmoType::test_select, wmGizmo::type, view3d_operator_needs_opengl(), and WM_draw_region_get_viewport().
Referenced by wm_gizmomap_highlight_find().
|
static |
Definition at line 554 of file wm_gizmo_map.c.
References blender::compositor::area(), ARRAY_SIZE, BLI_assert, BLI_rcti_init_pt_radius(), buffer, C, CTX_data_depsgraph_pointer(), CTX_data_scene(), CTX_wm_area(), CTX_wm_manager(), CTX_wm_region(), CTX_wm_window(), depsgraph, GPUSelectResult::depth, dot_v3v3(), double(), ED_view3d_draw_setup_view(), ED_view3d_win_to_vector(), wmGizmo::flag, float(), gizmo_draw_select_3d_loop(), GPU_matrix_unproject_3fv(), GPU_select_begin(), GPU_select_buffer_near(), GPU_select_end(), GPU_SELECT_NEAREST_FIRST_PASS, GPU_SELECT_NEAREST_SECOND_PASS, GPUSelectResult::id, MAXPICKELEMS, NULL, ARegion::regiondata, wmGizmo::scale_final, wmGizmo::select_bias, sub_v3_v3(), UINT_MAX, UNPACK2, ARegion::winx, ARegion::winy, and WM_GIZMO_DRAW_NO_SCALE.
Referenced by gizmo_find_intersected_3d().
|
static |
Definition at line 327 of file wm_gizmo_map.c.
References BLI_addhead(), BLI_genericNodeN(), C, GIZMOMAP_IS_PREPARE_DRAW, wmGizmoMap::update_flag, wm_gizmo_is_visible(), WM_GIZMO_IS_VISIBLE_DRAW, WM_GIZMO_IS_VISIBLE_UPDATE, and wm_gizmo_update().
Referenced by gizmomap_prepare_drawing().
BLI_INLINE bool gizmo_selectable_poll | ( | const wmGizmo * | gz, |
void * | UNUSEDdata | ||
) |
Definition at line 874 of file wm_gizmo_map.c.
References wmGizmoGroupType::flag, wmGizmo::parent_gzgroup, wmGizmoGroup::type, and WM_GIZMOGROUPTYPE_SELECT.
Referenced by wm_gizmomap_select_all_intern().
|
static |
Update gizmos of gzmap to prepare for drawing. Adds all gizmos that should be drawn to list draw_gizmos, note that added items need freeing.
Definition at line 356 of file wm_gizmo_map.c.
References BLI_listbase_is_empty(), C, gizmo_prepare_drawing(), GIZMOMAP_IS_PREPARE_DRAW, GIZMOMAP_IS_REFRESH_CALLBACK, wmGizmoMap::groups, wmGizmoMap::gzmap_context, wmGizmoMap::is_init, LISTBASE_FOREACH, wmGizmoMap::modal, wmGizmo::parent_gzgroup, wmGizmoMap::update_flag, WM_gizmo_group_type_poll(), WM_gizmogroup_ensure_init(), WM_GIZMOGROUP_INIT_REFRESH, wm_gizmogroup_is_visible_in_drawstep(), WM_GIZMOGROUPTYPE_DRAW_MODAL_ALL, and WM_GIZMOGROUPTYPE_DRAW_MODAL_EXCLUDE.
Referenced by WM_gizmomap_draw().
|
static |
Draw all visible gizmos in gzmap. Uses global draw_gizmos listbase.
Definition at line 426 of file wm_gizmo_map.c.
References BLI_freelinkN(), BLI_listbase_is_empty(), C, wmGizmoType::draw, ListBase::first, wmGizmoGroupType::flag, GPU_DEPTH_LESS_EQUAL, GPU_DEPTH_NONE, GPU_depth_test(), GPU_line_smooth(), GPU_polygon_smooth(), wmGizmoMap::groups, wmGizmo::next, NULL, wmGizmo::parent_gzgroup, wmGizmo::state, wmGizmo::type, wmGizmoGroup::type, WM_GIZMO_STATE_HIGHLIGHT, and WM_GIZMOGROUPTYPE_DEPTH_3D.
Referenced by WM_gizmomap_draw().
Run in case new types have been added (runs often, early exit where possible). Follows WM_keyconfig_update conventions.
Definition at line 1285 of file wm_gizmo_map.c.
References blender::compositor::area(), ED_region_tag_redraw_editor_overlays(), ListBase::first, G, ARegion::gizmo_map, gizmomaptypes, wmGizmoMap::groups, LISTBASE_FOREACH, NULL, Main::screens, wmGizmoMap::tag_remove_group, wm_gizmogroup_free(), WM_GIZMOMAPTYPE_GLOBAL_UPDATE_INIT, WM_GIZMOMAPTYPE_GLOBAL_UPDATE_REMOVE, WM_gizmomaptype_group_init_runtime(), WM_gizmomaptype_group_init_runtime_keymap(), WM_gizmomaptype_group_unlink(), WM_GIZMOMAPTYPE_KEYMAP_INIT, WM_GIZMOMAPTYPE_UPDATE_INIT, WM_GIZMOMAPTYPE_UPDATE_REMOVE, WM_GIZMOTYPE_GLOBAL_UPDATE_REMOVE, and wm_gzmap_type_update_flag.
Referenced by wm_event_do_handlers().
void WM_gizmoconfig_update_tag_group_remove | ( | wmGizmoMap * | gzmap | ) |
Definition at line 1278 of file wm_gizmo_map.c.
References wmGizmoMap::tag_remove_group, WM_GIZMOTYPE_GLOBAL_UPDATE_REMOVE, and wm_gzmap_type_update_flag.
Referenced by WM_gizmo_group_tag_remove().
void WM_gizmoconfig_update_tag_group_type_init | ( | wmGizmoMapType * | gzmap_type, |
wmGizmoGroupType * | gzgt | ||
) |
Definition at line 1259 of file wm_gizmo_map.c.
References wmGizmoMapType::type_update_flag, wmGizmoGroupType::type_update_flag, WM_GIZMOMAPTYPE_GLOBAL_UPDATE_INIT, WM_GIZMOMAPTYPE_KEYMAP_INIT, WM_GIZMOMAPTYPE_UPDATE_INIT, and wm_gzmap_type_update_flag.
Referenced by toolsystem_ref_link(), and WM_gizmo_group_type_add_ptr_ex().
void WM_gizmoconfig_update_tag_group_type_remove | ( | wmGizmoMapType * | gzmap_type, |
wmGizmoGroupType * | gzgt | ||
) |
Definition at line 1268 of file wm_gizmo_map.c.
References wmGizmoMapType::type_update_flag, wmGizmoGroupType::type_update_flag, WM_GIZMOMAPTYPE_GLOBAL_UPDATE_REMOVE, WM_GIZMOMAPTYPE_UPDATE_REMOVE, and wm_gzmap_type_update_flag.
Referenced by WM_gizmo_group_type_unlink_delayed_ptr_ex().
void WM_gizmomap_add_handlers | ( | ARegion * | region, |
wmGizmoMap * | gzmap | ||
) |
Definition at line 790 of file wm_gizmo_map.c.
References BLI_addtail(), BLI_assert, ARegion::gizmo_map, wmEventHandler_Gizmo::gizmo_map, ARegion::handlers, wmEventHandler_Gizmo::head, LISTBASE_FOREACH, MEM_callocN, wmEventHandler::type, and WM_HANDLER_TYPE_GIZMO.
Referenced by ed_default_handlers().
bool WM_gizmomap_cursor_set | ( | const wmGizmoMap * | gzmap, |
wmWindow * | win | ||
) |
Definition at line 972 of file wm_gizmo_map.c.
References wmGizmoType::cursor_get, wmGizmoMap::gzmap_context, wmGizmoMap::highlight, wmGizmo::type, and WM_cursor_set().
Referenced by ED_region_cursor_set().
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_draw | ( | wmGizmoMap * | gzmap, |
const bContext * | C, | ||
const eWM_GizmoFlagMapDrawStep | drawstep | ||
) |
Definition at line 483 of file wm_gizmo_map.c.
References BLI_assert, BLI_listbase_is_empty(), C, gizmomap_prepare_drawing(), gizmos_draw_list(), NULL, and WM_gizmo_context_check_drawstep().
Referenced by action_main_region_draw(), clip_main_region_draw(), draw_timeline_seq(), DRW_draw_gizmo_2d(), DRW_draw_gizmo_3d(), image_main_region_draw(), blender::ed::space_node::node_draw_space(), and sequencer_preview_region_draw().
eWM_GizmoFlagMapDrawStep WM_gizmomap_drawstep_from_gizmo_group | ( | const wmGizmoGroup * | gzgroup | ) |
Definition at line 288 of file wm_gizmo_map.c.
References wmGizmoGroupType::flag, wmGizmoGroup::type, WM_GIZMOGROUPTYPE_3D, WM_GIZMOMAP_DRAWSTEP_2D, and WM_GIZMOMAP_DRAWSTEP_3D.
Referenced by WM_gizmo_group_refresh(), wm_gizmomap_highlight_find(), and wm_gizmomap_modal_set().
|
static |
Definition at line 174 of file wm_gizmo_map.c.
References BLI_assert, BLI_listbase_is_empty(), ListBase::first, wmGizmoMap::groups, NULL, wm_gizmogroup_free(), and wm_gizmomap_select_array_clear().
Referenced by WM_gizmomap_reinit(), and wm_gizmomap_remove().
wmGizmo* WM_gizmomap_get_modal | ( | const wmGizmoMap * | gzmap | ) |
Definition at line 232 of file wm_gizmo_map.c.
References wmGizmoMap::gzmap_context, and wmGizmoMap::modal.
Referenced by WIDGETGROUP_gizmo_draw_prepare(), and WIDGETGROUP_gizmo_refresh().
|
static |
Creates and returns idname hash table for (visible) gizmos in gzmap
poll | Polling function for excluding gizmos. |
data | Custom data passed to poll |
TODO(campbell): this uses unreliable order, best we use an iterator function instead of a hash.
Definition at line 265 of file wm_gizmo_map.c.
References BLI_ghash_insert(), BLI_ghash_ptr_new(), C, data, wmGizmoMap::groups, hash, LISTBASE_FOREACH, and WM_gizmo_group_type_poll().
Referenced by wm_gizmomap_select_all_intern().
wmGizmoGroup* WM_gizmomap_group_find | ( | struct wmGizmoMap * | gzmap, |
const char * | idname | ||
) |
Definition at line 202 of file wm_gizmo_map.c.
References NULL, WM_gizmogrouptype_find(), and WM_gizmomap_group_find_ptr().
Referenced by edbm_preselect_or_active(), gizmo_mesh_spin_redo_setup(), ringcut_invoke(), transform_from_gizmo_invoke(), UNUSED_FUNCTION_WITH_RETURN_TYPE(), view3d_ruler_add_invoke(), view3d_ruler_remove_invoke(), and wm_event_get_keymap_from_toolsystem_ex().
wmGizmoGroup* WM_gizmomap_group_find_ptr | ( | struct wmGizmoMap * | gzmap, |
const struct wmGizmoGroupType * | gzgt | ||
) |
Definition at line 211 of file wm_gizmo_map.c.
References wmGizmoMap::groups, LISTBASE_FOREACH, and NULL.
Referenced by v3d_cursor_snap_poll_fn(), and WM_gizmomap_group_find().
const ListBase* WM_gizmomap_group_list | ( | wmGizmoMap * | gzmap | ) |
Definition at line 222 of file wm_gizmo_map.c.
References wmGizmoMap::groups.
Referenced by gizmo_snap_rna_find_operator(), wm_handlers_do_gizmo_handler(), and wm_region_test_gizmo_do_draw().
ListBase* wm_gizmomap_groups_get | ( | wmGizmoMap * | gzmap | ) |
Definition at line 1139 of file wm_gizmo_map.c.
References wmGizmoMap::groups.
void wm_gizmomap_handler_context_gizmo | ( | bContext * | UNUSEDC, |
wmEventHandler_Gizmo * | UNUSEDhandler | ||
) |
Definition at line 967 of file wm_gizmo_map.c.
Referenced by wm_handlers_do_gizmo_handler().
void wm_gizmomap_handler_context_op | ( | bContext * | C, |
struct wmEventHandler_Op * | handler | ||
) |
Prepare context for gizmo handling (but only if area/region is part of screen). Version of wm_handler_op_context for gizmos.
Definition at line 934 of file wm_gizmo_map.c.
References blender::compositor::area(), wmEventHandler_Op::area, bScreen::areabase, C, wmEventHandler_Op::context, CTX_wm_area_set(), CTX_wm_region_set(), CTX_wm_screen(), ListBase::first, ARegion::next, NULL, and wmEventHandler_Op::region.
Referenced by wm_gizmomaps_handled_modal_update().
wmGizmo* wm_gizmomap_highlight_find | ( | wmGizmoMap * | gzmap, |
bContext * | C, | ||
const wmEvent * | event, | ||
int * | r_part | ||
) |
Definition at line 723 of file wm_gizmo_map.c.
References ARRAY_SIZE, BLI_buffer_declare_static, BLI_buffer_free, BLI_BUFFER_NOP, C, copy_v2_v2_int(), CTX_wm_manager(), CTX_wm_region(), gizmo_find_intersected_3d(), GIZMOMAP_IS_REFRESH_CALLBACK, wmGizmoMap::groups, KM_CLICK_DRAG, LISTBASE_FOREACH, wmEvent::modifier, wmEvent::mval, NULL, wmGizmoMap::update_flag, wmEvent::val, WM_event_drag_start_mval(), WM_gizmo_context_check_drawstep(), WM_gizmo_group_refresh(), WM_gizmo_group_type_poll(), wm_gizmogroup_find_intersected_gizmo(), WM_GIZMOGROUP_INIT_SETUP, wm_gizmogroup_intersectable_gizmos_to_list(), WM_GIZMOMAP_DRAWSTEP_2D, WM_GIZMOMAP_DRAWSTEP_3D, WM_gizmomap_drawstep_from_gizmo_group(), and WM_GIZMOMAP_DRAWSTEP_MAX.
Referenced by wm_handlers_do_gizmo_handler().
wmGizmo* wm_gizmomap_highlight_get | ( | wmGizmoMap * | gzmap | ) |
Definition at line 1030 of file wm_gizmo_map.c.
References wmGizmoMap::gzmap_context, and wmGizmoMap::highlight.
Referenced by wm_event_get_keymap_from_toolsystem_ex(), WM_gizmo_group_refresh(), wm_handler_operator_call(), and wm_handlers_do_gizmo_handler().
bool wm_gizmomap_highlight_set | ( | wmGizmoMap * | gzmap, |
const bContext * | C, | ||
wmGizmo * | gz, | ||
int | part | ||
) |
Definition at line 983 of file wm_gizmo_map.c.
References C, CTX_wm_region(), CTX_wm_window(), wmWindow::cursor, wmGizmoType::cursor_get, ED_region_tag_redraw_editor_overlays(), wmGizmoMap::gzmap_context, wmGizmoMap::highlight, wmGizmo::highlight_part, wmGizmoMap::last_cursor, wmGizmo::state, wmGizmo::type, WM_cursor_set(), and WM_GIZMO_STATE_HIGHLIGHT.
Referenced by WM_gizmo_highlight_set(), wm_gizmo_select_and_highlight(), WM_gizmo_unlink(), wm_gizmogroup_free(), wm_gizmomap_select_all_intern(), wm_gizmomaps_handled_modal_update(), WM_gizmomaptype_group_init_runtime_with_region(), and wm_handlers_do_gizmo_handler().
bool WM_gizmomap_is_any_selected | ( | const wmGizmoMap * | gzmap | ) |
Definition at line 227 of file wm_gizmo_map.c.
References wmGizmoMap::gzmap_context, wmGizmoMapSelectState::len, and wmGizmoMap::select.
Referenced by viewselected_exec(), and wm_handlers_do_gizmo_handler().
void WM_gizmomap_message_subscribe | ( | const bContext * | C, |
wmGizmoMap * | gzmap, | ||
ARegion * | region, | ||
struct wmMsgBus * | mbus | ||
) |
Definition at line 1144 of file wm_gizmo_map.c.
References C, wmGizmo::flag, wmGizmoMap::groups, LISTBASE_FOREACH, NULL, WM_gizmo_group_type_poll(), WM_GIZMO_HIDDEN, WM_gizmo_target_property_subscribe_all(), and WM_GIZMOGROUP_INIT_SETUP.
Referenced by ED_region_message_subscribe().
bool WM_gizmomap_minmax | ( | const wmGizmoMap * | gzmap, |
bool | UNUSEDuse_hidden, | ||
bool | use_select, | ||
float | r_min[3], | ||
float | r_max[3] | ||
) |
Definition at line 237 of file wm_gizmo_map.c.
References BLI_assert_msg, wmGizmoMap::gzmap_context, wmGizmoMapSelectState::items, wmGizmoMapSelectState::len, wmGizmo::matrix_basis, minmax_v3v3_v3(), and wmGizmoMap::select.
Referenced by viewselected_exec().
wmGizmo* wm_gizmomap_modal_get | ( | wmGizmoMap * | gzmap | ) |
Definition at line 1128 of file wm_gizmo_map.c.
References wmGizmoMap::gzmap_context, and wmGizmoMap::modal.
Referenced by wm_gizmomaps_handled_modal_update(), and wm_handlers_do_gizmo_handler().
void wm_gizmomap_modal_set | ( | wmGizmoMap * | gzmap, |
bContext * | C, | ||
wmGizmo * | gz, | ||
const wmEvent * | event, | ||
bool | enable | ||
) |
Definition at line 1035 of file wm_gizmo_map.c.
References BLI_assert, C, copy_v2_v2_int(), CTX_wm_region(), CTX_wm_window(), wmGizmo::custom_modal, ED_region_tag_redraw_editor_overlays(), ELEM, wmGizmoMap::event_grabcursor, wmGizmoMap::event_xy, wmGizmo::flag, GIZMOMAP_IS_REFRESH_CALLBACK, wmWindow::grabcursor, wmGizmoMap::gzmap_context, wmGizmo::highlight_part, wmGizmo::interaction_data, wmGizmoType::invoke, wmGizmoGroupType::invoke_prepare, wmTabletData::is_motion_absolute, MEM_SAFE_FREE, wmGizmoMap::modal, wmGizmoType::modal, NULL, OPERATOR_RUNNING_MODAL, wmGizmo::parent_gzgroup, wmGizmo::state, wmEvent::tablet, wmGizmoOpElem::type, wmGizmo::type, wmGizmoGroup::type, UNPACK2, wmGizmoMap::update_flag, WM_cursor_grab_disable(), WM_cursor_grab_enable(), WM_cursor_warp(), WM_CURSOR_WRAP_XY, WM_event_add_mousemove(), WM_GIZMO_MOVE_CURSOR, WM_gizmo_operator_get(), WM_gizmo_operator_invoke(), WM_GIZMO_STATE_MODAL, WM_gizmomap_drawstep_from_gizmo_group(), WM_tooltip_clear(), and wmEvent::xy.
Referenced by gizmo_tweak_finish(), gizmo_tweak_start(), gizmo_tweak_start_and_finish(), WM_gizmo_modal_set_from_setup(), WM_gizmo_unlink(), wm_gizmogroup_free(), and wm_gizmomaps_handled_modal_update().
wmGizmoMap* WM_gizmomap_new_from_type | ( | const struct wmGizmoMapType_Params * | gzmap_params | ) |
Creates a gizmo-map with all registered gizmos for that type
Definition at line 166 of file wm_gizmo_map.c.
References MEM_callocN, wm_gizmomap_new_from_type_ex(), and WM_gizmomaptype_ensure().
Referenced by ed_default_handlers().
|
static |
Definition at line 150 of file wm_gizmo_map.c.
References wmGizmoMapType::grouptype_refs, wmGizmoMap::is_init, LISTBASE_FOREACH, wmGizmoMap::type, wm_gizmogroup_new_from_type(), and WM_gizmomap_tag_refresh().
Referenced by WM_gizmomap_new_from_type(), and WM_gizmomap_reinit().
void WM_gizmomap_reinit | ( | struct wmGizmoMap * | gzmap | ) |
Re-create the gizmos (use when changing theme settings).
Definition at line 194 of file wm_gizmo_map.c.
References wmGizmoMap::type, wm_gizmomap_free_data(), and wm_gizmomap_new_from_type_ex().
Referenced by WM_reinit_gizmomap_all().
void wm_gizmomap_remove | ( | wmGizmoMap * | gzmap | ) |
Definition at line 188 of file wm_gizmo_map.c.
References MEM_freeN, and wm_gizmomap_free_data().
Referenced by WM_init().
bool WM_gizmomap_select_all | ( | struct bContext * | C, |
struct wmGizmoMap * | gzmap, | ||
int | action | ||
) |
Select/Deselect all selectable gizmos in gzmap.
TODO: select all by type.
Definition at line 911 of file wm_gizmo_map.c.
References BLI_assert_unreachable, C, CTX_wm_window(), SEL_DESELECT, SEL_SELECT, WM_event_add_mousemove(), wm_gizmomap_deselect_all(), and wm_gizmomap_select_all_intern().
|
static |
Select all selectable gizmos in gzmap.
Definition at line 883 of file wm_gizmo_map.c.
References BLI_assert, BLI_ghash_free(), BLI_ghash_len(), BLI_ghashIterator_getValue(), C, GHASH_ITER_INDEX, gizmo_selectable_poll(), wmGizmoMap::gzmap_context, hash, wmGizmo::highlight_part, wmGizmoMapSelectState::items, wmGizmoMapSelectState::len, NULL, wmGizmoMap::select, WM_GIZMO_HIDDEN, WM_GIZMO_HIDDEN_SELECT, WM_gizmo_select_set(), WM_gizmomap_gizmo_hash_new(), wm_gizmomap_highlight_set(), and wm_gizmomap_select_array_ensure_len_alloc().
Referenced by WM_gizmomap_select_all().
void wm_gizmomap_select_array_clear | ( | 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().
|
static |
Definition at line 85 of file wm_gizmo_map.c.
References wmGizmoMap::gzmap_context, wmGizmoMapSelectState::items, len, len_alloc, wmGizmoMapSelectState::len_alloc, MEM_reallocN, and wmGizmoMap::select.
Referenced by wm_gizmomap_select_all_intern().
void wm_gizmomap_select_array_push_back | ( | 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 | ( | 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 | ( | 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().
wmGizmo** wm_gizmomap_selected_get | ( | wmGizmoMap * | gzmap, |
int * | r_selected_len | ||
) |
Definition at line 1133 of file wm_gizmo_map.c.
References wmGizmoMap::gzmap_context, wmGizmoMapSelectState::items, wmGizmoMapSelectState::len, and wmGizmoMap::select.
bool WM_gizmomap_tag_delay_refresh_for_tweak_check | ( | wmGizmoMap * | gzmap | ) |
Definition at line 317 of file wm_gizmo_map.c.
References wmGizmoMap::groups, and LISTBASE_FOREACH.
Referenced by wm_region_tag_draw_on_gizmo_delay_refresh_for_tweak().
void WM_gizmomap_tag_refresh | ( | wmGizmoMap * | gzmap | ) |
Definition at line 308 of file wm_gizmo_map.c.
References GIZMOMAP_IS_PREPARE_DRAW, GIZMOMAP_IS_REFRESH_CALLBACK, wmGizmoMap::update_flag, and WM_GIZMOMAP_DRAWSTEP_MAX.
Referenced by image_main_region_listener(), blender::ed::space_node::node_main_region_init(), blender::ed::space_node::node_region_listener(), sequencer_preview_region_listener(), view3d_main_region_listener(), WM_gizmo_do_msg_notify_tag_refresh(), wm_gizmomap_new_from_type_ex(), wm_handlers_do_gizmo_handler(), and WM_init().
void WM_gizmomap_tag_refresh_drawstep | ( | wmGizmoMap * | gzmap, |
const eWM_GizmoFlagMapDrawStep | drawstep | ||
) |
Definition at line 300 of file wm_gizmo_map.c.
References BLI_assert, GIZMOMAP_IS_PREPARE_DRAW, GIZMOMAP_IS_REFRESH_CALLBACK, wmGizmoMap::update_flag, and WM_GIZMOMAP_DRAWSTEP_MAX.
Referenced by WM_gizmo_group_refresh().
struct ARegion* WM_gizmomap_tooltip_init | ( | struct bContext * | C, |
struct ARegion * | region, | ||
int * | UNUSEDr_pass, | ||
double * | UNUSEDpass_delay, | ||
bool * | r_exit_on_event | ||
) |
Definition at line 1172 of file wm_gizmo_map.c.
References C, wmGizmoGroupType::flag, ARegion::gizmo_map, wmGizmoMap::gzmap_context, wmGizmoMap::highlight, NULL, wmGizmo::parent_gzgroup, wmGizmoGroup::type, UI_tooltip_create_from_gizmo(), and WM_GIZMOGROUPTYPE_3D.
Referenced by wm_handlers_do_gizmo_handler().
void wm_gizmomaps_handled_modal_update | ( | bContext * | C, |
wmEvent * | event, | ||
wmEventHandler_Op * | handler | ||
) |
Definition at line 808 of file wm_gizmo_map.c.
References blender::compositor::area(), BLI_assert, C, wmEventHandler_Op::context, CTX_wm_area(), CTX_wm_area_set(), CTX_wm_region(), CTX_wm_region_set(), wmGizmo::custom_modal, wmGizmoType::exit, ARegion::gizmo_map, wmGizmo::highlight_part, wmGizmoType::modal, NULL, wmEventHandler_Op::op, OPERATOR_RUNNING_MODAL, wmEventHandler_Op::region, wmOperator::type, wmGizmoOpElem::type, wmGizmo::type, UNUSED_VARS_NDEBUG, WM_gizmo_operator_get(), wm_gizmomap_handler_context_op(), wm_gizmomap_highlight_set(), wm_gizmomap_modal_get(), and wm_gizmomap_modal_set().
Referenced by wm_handler_operator_call().
wmGizmoMapType* WM_gizmomaptype_ensure | ( | const struct wmGizmoMapType_Params * | gzmap_params | ) |
Definition at line 1212 of file wm_gizmo_map.c.
References BLI_addhead(), gizmomaptypes, MEM_callocN, wmGizmoMapType::regionid, wmGizmoMapType_Params::regionid, wmGizmoMapType::spaceid, wmGizmoMapType_Params::spaceid, and WM_gizmomaptype_find().
Referenced by clip_gizmos(), ED_gizmo_poll_or_unlink_delayed_from_tool_ex(), image_widgets(), blender::ed::space_node::node_widgets(), sequencer_gizmos(), toolsystem_ref_link(), view3d_widgets(), WM_gizmo_group_type_add_ptr(), WM_gizmo_group_type_ensure_ptr(), WM_gizmo_group_type_reinit_ptr(), WM_gizmo_group_type_remove_ptr(), WM_gizmo_group_type_unlink_delayed_ptr(), WM_gizmomap_new_from_type(), and wm_handler_operator_call().
wmGizmoMapType* WM_gizmomaptype_find | ( | const struct wmGizmoMapType_Params * | gzmap_params | ) |
Definition at line 1200 of file wm_gizmo_map.c.
References gizmomaptypes, LISTBASE_FOREACH, NULL, wmGizmoMapType_Params::regionid, and wmGizmoMapType_Params::spaceid.
Referenced by WM_gizmo_group_remove_by_tool(), and WM_gizmomaptype_ensure().
Definition at line 1228 of file wm_gizmo_map.c.
References ListBase::first, gizmomaptypes, MEM_freeN, and WM_gizmomaptype_group_free().
Referenced by WM_exit_ex().
void wm_gizmos_keymap | ( | struct wmKeyConfig * | keyconf | ) |
Initialize key-maps for all existing gizmo-groups
Definition at line 1242 of file wm_gizmo_map.c.
References gizmomaptypes, LISTBASE_FOREACH, wm_gizmogroup_tweak_modal_keymap(), and wm_gizmogrouptype_setup_keymap().
Referenced by wm_window_keymap().
Definition at line 1373 of file wm_gizmo_map.c.
References blender::compositor::area(), ListBase::first, ARegion::gizmo_map, wmGizmoMap::is_init, LISTBASE_FOREACH, NULL, Main::screens, and WM_gizmomap_reinit().
Referenced by preferences_reset_default_theme_exec(), and wm_userpref_update_when_changed().
Store all gizmo-maps here. Anyone who wants to register a gizmo for a certain area type can query the gizmo-map to do so.
Definition at line 51 of file wm_gizmo_map.c.
Referenced by WM_gizmoconfig_update(), WM_gizmomaptype_ensure(), WM_gizmomaptype_find(), wm_gizmomaptypes_free(), and wm_gizmos_keymap().
|
static |
Definition at line 67 of file wm_gizmo_map.c.
Referenced by WM_gizmoconfig_update(), WM_gizmoconfig_update_tag_group_remove(), WM_gizmoconfig_update_tag_group_type_init(), and WM_gizmoconfig_update_tag_group_type_remove().