Blender
V3.3
|
Go to the source code of this file.
Classes | |
struct | wmEventHandler |
struct | wmEventHandler_KeymapPost |
struct | wmEventHandler_KeymapDynamic |
struct | wmEventHandler_Keymap |
struct | wmEventHandler_Gizmo |
struct | wmEventHandler_UI |
struct | wmEventHandler_Op |
struct | wmEventHandler_Dropbox |
Macros | |
#define | WM_HANDLER_CONTINUE 0 |
#define | WM_HANDLER_BREAK 1 |
#define | WM_HANDLER_HANDLED 2 |
#define | WM_HANDLER_MODAL 4 /* MODAL|BREAK means unhandled */ |
Typedefs | |
typedef bool(* | EventHandlerPoll) (const ARegion *region, const wmEvent *event) |
typedef struct wmEventHandler | wmEventHandler |
typedef struct wmEventHandler_Keymap | wmEventHandler_Keymap |
typedef struct wmEventHandler_Gizmo | wmEventHandler_Gizmo |
typedef struct wmEventHandler_UI | wmEventHandler_UI |
typedef struct wmEventHandler_Op | wmEventHandler_Op |
typedef struct wmEventHandler_Dropbox | wmEventHandler_Dropbox |
Enumerations | |
enum | eWM_EventHandlerType { WM_HANDLER_TYPE_GIZMO = 1 , WM_HANDLER_TYPE_UI , WM_HANDLER_TYPE_OP , WM_HANDLER_TYPE_DROPBOX , WM_HANDLER_TYPE_KEYMAP } |
#define WM_HANDLER_BREAK 1 |
Definition at line 12 of file wm_event_system.h.
#define WM_HANDLER_CONTINUE 0 |
Definition at line 11 of file wm_event_system.h.
#define WM_HANDLER_HANDLED 2 |
Definition at line 13 of file wm_event_system.h.
#define WM_HANDLER_MODAL 4 /* MODAL|BREAK means unhandled */ |
Definition at line 14 of file wm_event_system.h.
Definition at line 40 of file wm_event_system.h.
typedef struct wmEventHandler wmEventHandler |
typedef struct wmEventHandler_Dropbox wmEventHandler_Dropbox |
typedef struct wmEventHandler_Gizmo wmEventHandler_Gizmo |
typedef struct wmEventHandler_Keymap wmEventHandler_Keymap |
typedef struct wmEventHandler_Op wmEventHandler_Op |
typedef struct wmEventHandler_UI wmEventHandler_UI |
enum eWM_EventHandlerType |
Custom types for handlers, for signaling, freeing
Enumerator | |
---|---|
WM_HANDLER_TYPE_GIZMO | |
WM_HANDLER_TYPE_UI | |
WM_HANDLER_TYPE_OP | |
WM_HANDLER_TYPE_DROPBOX | |
WM_HANDLER_TYPE_KEYMAP |
Definition at line 32 of file wm_event_system.h.
Called in inner handler loop, region context.
Definition at line 481 of file wm_dragdrop.cc.
References BLI_listbase_is_empty(), C, CTX_wm_manager(), CTX_wm_window(), wmWindowManager::drags, LISTBASE_FOREACH, WM_CURSOR_DEFAULT, WM_cursor_modal_set(), WM_CURSOR_STOP, and wm_drop_update_active().
Referenced by wm_event_do_region_handlers().
Called in wm_draw_window_onscreen.
Definition at line 966 of file wm_dragdrop.cc.
References blender::compositor::area(), BKE_screen_find_area_xy(), BLI_assert, C, CTX_store_set(), CTX_wm_area(), CTX_wm_area_set(), CTX_wm_manager(), CTX_wm_region(), CTX_wm_region_set(), CTX_wm_screen(), wmWindowManager::drags, ED_area_find_region_xy_visual(), ELEM, wmWindow::eventstate, GHOST_kGrabHide, GHOST_kGrabWrap, GPU_blend(), GPU_BLEND_ALPHA, GPU_BLEND_NONE, wmWindow::grabcursor, LISTBASE_FOREACH, RGN_TYPE_ANY, SPACE_TYPE_ANY, ARegion::winrct, wm_cursor_position_get(), wm_drag_draw_default(), wmViewport(), wmWindowViewport(), xy, and wmEvent::xy.
Referenced by wm_draw_window_onscreen().
void wm_drags_exit | ( | wmWindowManager * | wm, |
wmWindow * | win | ||
) |
Additional work to cleanly end dragging. Additional because this doesn't actually remove the drag items. Should be called whenever dragging is stopped (successful or not, also when canceled).
Definition at line 244 of file wm_dragdrop.cc.
References wmWindowManager::drags, LISTBASE_FOREACH, wmWindow::tag_cursor_refresh, WM_cursor_modal_restore(), and WM_event_add_mousemove().
Referenced by wm_drop_prepare(), wm_event_drag_and_drop_test(), and wm_handlers_do_intern().
wmOperatorCallContext wm_drop_operator_context_get | ( | const wmDropBox * | drop | ) |
The operator of a dropbox should always be executed in the context determined by the mouse coordinates. The dropbox poll should check the context area and region as needed. So this always returns WM_OP_INVOKE_DEFAULT.
Definition at line 458 of file wm_dragdrop.cc.
References C, wmDropBox::copy, CTX_store_set(), CTX_wm_manager(), CTX_wm_window(), wmDrag::drop_state, wmDropBox::ot, wmDragActiveDropState::ui_context, wm_drags_exit(), wm_drop_operator_context_get(), and WM_operator_poll_context().
Referenced by wm_handlers_do_intern().
Definition at line 121 of file wm_dragdrop.cc.
References BLI_freelistN(), dropboxes, LISTBASE_FOREACH, MEM_freeN, and WM_operator_properties_free().
Referenced by WM_exit_ex().
void wm_event_add_ghostevent | ( | wmWindowManager * | wm, |
wmWindow * | win, | ||
int | type, | ||
void * | customdata | ||
) |
Windows store own event queues wmWindow.event_queue (no bContext here).
Having both, event and event_state, can be highly confusing to work with, but is necessary for our current event system, so let's clear things up a bit:
Always support accessing the last key press/release. This is set from win->eventstate
, so it will always be a valid event type to store in the previous state.
Note that these values are intentionally not set in the win->eventstate
, as copying these values only makes sense when win->eventstate->{val/type}
would be written to (which only happens for some kinds of events). If this was done it could leave win->eventstate
previous and current value set to the same key press/release state which doesn't make sense.
Definition at line 5193 of file wm_event_system.cc.
References BLI_assert, BLI_assert_unreachable, BLI_str_utf8_from_unicode(), BLI_str_utf8_size(), GHOST_TEventButtonData::button, BUTTON4MOUSE, BUTTON5MOUSE, BUTTON6MOUSE, BUTTON7MOUSE, Freestyle::c, CLOG_ERROR, CLOG_INFO, CLOG_WARN, convert_key(), copy_v2_v2_int(), GHOST_TEventTrackpadData::deltaX, GHOST_TEventTrackpadData::deltaY, e, EVENT_NONE, wmWindow::eventstate, EVT_DATA_TIMER, EVT_ESCKEY, EVT_LEFTALTKEY, EVT_LEFTCTRLKEY, EVT_LEFTSHIFTKEY, EVT_OSKEY, EVT_RIGHTALTKEY, EVT_RIGHTCTRLKEY, EVT_RIGHTSHIFTKEY, EVT_UNKNOWNKEY, wmEvent::flag, G, G_FLAG_EVENT_SIMULATE, GHOST_kButtonMaskButton4, GHOST_kButtonMaskButton5, GHOST_kButtonMaskButton6, GHOST_kButtonMaskButton7, GHOST_kButtonMaskLeft, GHOST_kButtonMaskRight, GHOST_kEventButtonDown, GHOST_kEventButtonUp, GHOST_kEventCursorMove, GHOST_kEventImeComposition, GHOST_kEventImeCompositionEnd, GHOST_kEventImeCompositionStart, GHOST_kEventKeyDown, GHOST_kEventKeyUp, GHOST_kEventTimer, GHOST_kEventTrackpad, GHOST_kEventUnknown, GHOST_kEventWheel, GHOST_kEventWindowDeactivate, GHOST_kNumEventTypes, GHOST_kTrackpadEventMagnify, GHOST_kTrackpadEventRotate, GHOST_kTrackpadEventScroll, GHOST_kTrackpadEventSmartMagnify, wmWindow::ime_data, wmTabletData::is_motion_absolute, GHOST_TEventKeyData::is_repeat, GHOST_TEventTrackpadData::isDirectionInverted, ISKEYBOARD_OR_BUTTON, GHOST_TEventKeyData::key, wmEvent::keymodifier, KM_ALT, KM_CTRL, KM_NOTHING, KM_OSKEY, KM_PRESS, KM_RELEASE, KM_SHIFT, LEFTMOUSE, MIDDLEMOUSE, wmEvent::modifier, MOUSEMOVE, MOUSEPAN, MOUSEROTATE, MOUSESMARTZOOM, MOUSEZOOM, NDOF_BUTTON_NONE, NDOF_MOTION, wmEvent::prev_type, wmEvent::prev_val, RIGHTMOUSE, SET_FLAG_FROM_TEST, GHOST_TEventTrackpadData::subtype, GHOST_TEventCursorData::tablet, GHOST_TEventButtonData::tablet, wmEvent::tablet, TIMER, type, wmEvent::type, UNLIKELY, GHOST_TEventKeyData::utf8_buf, wmEvent::utf8_buf, wmEvent::val, WHEELDOWNMOUSE, WHEELUPMOUSE, WINDEACTIVATE, wm_event_add(), wm_event_add_mousemove(), wm_event_add_trackpad(), wm_event_cursor_other_windows(), wm_event_is_ignorable_key_press(), WM_EVENT_IS_REPEAT, WM_event_print(), WM_EVENT_SCROLL_INVERT, wm_event_state_update_and_click_set(), wm_eventemulation(), WM_IME_COMPOSITE_END, WM_IME_COMPOSITE_EVENT, WM_IME_COMPOSITE_START, WM_LOG_EVENTS, WM_LOG_HANDLERS, wm_stereo3d_mouse_offset_apply(), wm_tablet_data_from_ghost(), GHOST_TEventCursorData::x, GHOST_TEventTrackpadData::x, wmEvent::xy, GHOST_TEventTrackpadData::y, and GHOST_TEventWheelData::z.
Referenced by ghost_event_proc().
Definition at line 379 of file wm_event_system.cc.
References BKE_scene_ensure_depsgraph(), BKE_scene_graph_update_tagged(), C, CTX_data_main(), CTX_wm_manager(), Scene::customdata_mask, Scene::customdata_mask_modal, CustomData_MeshMasks_update(), DEG_graph_tag_on_visible_update(), DEG_make_active(), depsgraph, ED_view3d_screen_datamask(), wmWindowManager::is_interface_locked, LISTBASE_FOREACH, scene, wmWindowManager::windows, wm_surfaces_do_depsgraph(), WM_window_get_active_scene(), WM_window_get_active_screen(), and WM_window_get_active_view_layer().
Referenced by wm_event_do_refresh_wm_and_depsgraph(), and wm_file_read_post().
Goes over entire hierarchy: events -> window -> screen -> area -> region.
Definition at line 3744 of file wm_event_system.cc.
References wmWindow::addmousemove, blender::compositor::area(), area_event_inside(), AREA_FLAG_ACTIONZONES_UPDATE, BKE_scene_get_depsgraph(), BKE_sound_scene_playing(), BKE_sound_sync_scene(), BLI_assert, BLI_remlink(), C, RenderData::cfra, CLOG_INFO, copy_v2_v2_int(), CTX_data_main(), CTX_data_scene(), CTX_data_scene_set(), CTX_wm_area_set(), CTX_wm_manager(), CTX_wm_region_set(), CTX_wm_screen(), CTX_wm_screen_set(), CTX_wm_window(), CTX_wm_window_set(), wmEvent::customdata, DEG_get_evaluated_scene(), depsgraph, ED_area_azones_update(), ED_screen_animation_play(), ED_screen_animation_playing(), ED_screen_areas_iter, ED_screen_set_active_region(), ED_undo_is_state_valid(), ED_update_for_newframe(), wmWindow::event_queue, wmWindow::event_queue_check_click, wmWindow::event_queue_check_drag, wmWindow::event_queue_check_drag_handled, wmTooltipState::event_xy, wmWindow::eventstate, EVT_XR_ACTION, wmTooltipState::exit_on_event, ListBase::first, wmEvent::flag, FPS, G, G_DEBUG_EVENTS, G_DEBUG_HANDLERS, wmWindow::handlers, Scene::id, ID_RECALC_FRAME_CHANGE, CCL_NAMESPACE_BEGIN::isfinite(), ISKEYBOARD_OR_BUTTON, ISMOUSE_BUTTON, ISMOUSE_MOTION, KM_NOTHING, KM_PRESS, len_manhattan_v2v2_int(), LISTBASE_FOREACH, wmWindow::modalhandlers, MOUSEMOVE, NC_WINDOW, NDOF_MOTION, wmEvent::prev_press_type, wmEvent::prev_xy, Scene::r, ID::recalc, region_event_inside(), scene, bScreen::skip_handling, time, TIMER, wmTooltipState::timer, bScreen::tool_tip, wmEvent::type, wmEvent::val, wmWindowManager::windows, wm_action_not_handled(), wm_event_add(), wm_event_add_mousemove_to_head(), WM_event_add_notifier(), WM_EVENT_CURSOR_MOTION_THRESHOLD, wm_event_do_handlers_area_regions(), wm_event_drag_and_drop_test(), WM_EVENT_FORCE_DRAG_THRESHOLD, wm_event_free_all(), wm_event_free_and_remove_from_queue_if_valid(), wm_event_free_last_handled(), wm_event_inside_rect(), WM_EVENT_IS_REPEAT, wm_event_pie_filter(), WM_event_print(), WM_gizmoconfig_update(), WM_HANDLER_BREAK, WM_HANDLER_CONTINUE, wm_handlers_do(), WM_keyconfig_update(), WM_LOG_HANDLERS, wm_paintcursor_test(), wm_region_mouse_co(), wm_region_tag_draw_on_gizmo_delay_refresh_for_tweak(), WM_tooltip_clear(), WM_tooltip_init(), WM_window_get_active_scene(), WM_window_get_active_screen(), WM_window_get_active_view_layer(), WM_window_get_active_workspace(), wm_window_make_drawable(), and wmEvent::xy.
Referenced by ghost_event_proc(), and WM_main().
Called in main-loop.
Definition at line 456 of file wm_event_system.cc.
References blender::compositor::area(), BKE_workspace_layout_screen_get(), BLI_pophead(), C, wmNotifier::category, CTX_data_depsgraph_pointer(), CTX_data_main(), CTX_data_view_layer(), CTX_wm_manager(), CTX_wm_window_set(), depsgraph, ED_area_do_listen(), ED_info_stats_clear(), ED_preview_restart_queue_work(), ED_region_do_listen(), ED_screen_areas_iter, ED_screen_change(), ED_screen_do_listen(), ED_update_for_newframe(), ED_workspace_delete(), ED_workspace_layout_delete(), ELEM, wmWindowManager::file_saved, G, G_DEBUG_EVENTS, LISTBASE_FOREACH, LISTBASE_FOREACH_MUTABLE, MEM_freeN, wmWindowManager::message_bus, NC_GEOM, NC_OBJECT, NC_SCENE, NC_SCREEN, NC_SPACE, NC_WM, ND_DATACHANGED, ND_FILEREAD, ND_FILESAVE, ND_FRAME, ND_LAYOUTBROWSE, ND_LAYOUTDELETE, ND_SPACE_INFO, ND_UNDO, ND_WORKSPACE_DELETE, ND_WORKSPACE_SET, wmWindowManager::notifier_queue, wmNotifier::reference, bScreen::regionbase, scene, wmWindow::scene, UI_popup_handlers_remove_all(), wmWindowManager::winactive, wmSpaceTypeListenerParams::window, wmRegionListenerParams::window, wmWindowManager::windows, WM_event_add_notifier(), wm_event_do_refresh_wm_and_depsgraph(), wm_event_execute_timers(), WM_msgbus_handle(), wm_test_autorun_warning(), WM_window_cursor_keymap_status_refresh(), WM_window_get_active_layout(), WM_window_get_active_scene(), WM_window_get_active_screen(), WM_window_get_active_workspace(), WM_window_set_active_workspace(), and wm_window_title().
Referenced by ghost_event_proc(), and WM_main().
Was part of wm_event_do_notifiers, split out so it can be called once before entering the WM_main loop. This ensures operators don't run before the UI and depsgraph are initialized.
Definition at line 420 of file wm_event_system.cc.
References blender::compositor::area(), bScreen::areabase, C, CTX_wm_area_set(), CTX_wm_manager(), CTX_wm_window_set(), ED_area_do_refresh(), LISTBASE_FOREACH, wmWindowManager::windows, wm_event_do_depsgraph(), and WM_window_get_active_screen().
Referenced by redraw_timer_step(), wm_event_do_notifiers(), and WM_main().
Definition at line 184 of file wm_event_system.cc.
References wmEvent::flag, ISKEYBOARD, ISMOUSE_MOTION, KM_NOTHING, MEM_freeN, wmEvent::type, wmEvent::val, wm_event_custom_free(), WM_EVENT_IS_REPEAT, and WM_event_print().
Referenced by wm_event_free_all(), wm_event_free_and_remove_from_queue_if_valid(), wm_event_free_last(), and wm_event_free_last_handled().
Definition at line 236 of file wm_event_system.cc.
References BLI_pophead(), wmWindow::event_queue, and wm_event_free().
Referenced by wm_event_do_handlers(), and wm_window_free().
void wm_event_free_handler | ( | wmEventHandler * | handler | ) |
Definition at line 1907 of file wm_event_system.cc.
References MEM_freeN.
Referenced by WM_event_free_ui_handler_all(), WM_event_remove_area_handler(), WM_event_remove_handlers(), WM_event_remove_keymap_handler(), WM_event_remove_ui_handler(), wm_handler_fileselect_do(), wm_handler_operator_call(), wm_handlers_do_intern(), and wm_macro_modal().
void wm_event_handler_ui_cancel_ex | ( | bContext * | C, |
wmWindow * | win, | ||
ARegion * | region, | ||
bool | reactivate_button | ||
) |
Definition at line 768 of file wm_event_system.cc.
References BLI_assert, C, EVT_BUT_CANCEL, wmEventHandler_UI::handle_fn, ARegion::handlers, LISTBASE_FOREACH_MUTABLE, wmEventHandler_UI::user_data, wm_event_init_from_window(), and WM_HANDLER_TYPE_UI.
Referenced by UI_context_active_but_clear(), and wm_event_handler_ui_cancel().
Applies the global tablet pressure correction curve.
Definition at line 508 of file wm_event_query.c.
Referenced by wm_tablet_data_from_ghost().
void wm_tablet_data_from_ghost | ( | const struct GHOST_TabletData * | tablet_data, |
wmTabletData * | wmtab | ||
) |