|
Blender
V2.93
|
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 } |
Functions | |
| void | wm_event_free_all (wmWindow *win) |
| void | wm_event_free (wmEvent *event) |
| void | wm_event_free_handler (wmEventHandler *handler) |
| void | wm_event_do_handlers (bContext *C) |
| void | wm_event_add_ghostevent (wmWindowManager *wm, wmWindow *win, int type, void *customdata) |
| void | wm_event_do_depsgraph (bContext *C, bool is_after_open_file) |
| void | wm_event_do_refresh_wm_and_depsgraph (bContext *C) |
| void | wm_event_do_notifiers (bContext *C) |
| void | wm_event_handler_ui_cancel_ex (bContext *C, wmWindow *win, ARegion *region, bool reactivate_button) |
| float | wm_pressure_curve (float raw_pressure) |
| void | wm_tablet_data_from_ghost (const struct GHOST_TabletData *tablet_data, wmTabletData *wmtab) |
| void | wm_dropbox_free (void) |
| void | wm_drags_check_ops (bContext *C, const wmEvent *event) |
| void | wm_drags_draw (bContext *C, wmWindow *win, rcti *rect) |
| #define WM_HANDLER_BREAK 1 |
Definition at line 28 of file wm_event_system.h.
| #define WM_HANDLER_CONTINUE 0 |
Definition at line 27 of file wm_event_system.h.
| #define WM_HANDLER_HANDLED 2 |
Definition at line 29 of file wm_event_system.h.
| #define WM_HANDLER_MODAL 4 /* MODAL|BREAK means unhandled */ |
Definition at line 30 of file wm_event_system.h.
Definition at line 51 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 43 of file wm_event_system.h.
Definition at line 301 of file wm_dragdrop.c.
References C, CTX_wm_manager(), wmWindowManager::drags, LISTBASE_FOREACH, and wm_drop_operator_options().
Referenced by wm_event_do_handlers().
Definition at line 499 of file wm_dragdrop.c.
References C, col, CTX_wm_manager(), drag_rect_minmax(), wmWindowManager::drags, wmWindow::eventstate, GPU_blend(), GPU_BLEND_ALPHA, GPU_BLEND_NONE, GPU_RGBA8, GPU_SHADER_2D_IMAGE_COLOR, immDrawPixelsTexScaled(), immDrawPixelsTexSetup(), LISTBASE_FOREACH, padding(), state, UI_DPI_FAC, UI_DPI_ICON_SIZE, UI_fontstyle_draw_simple(), UI_fontstyle_string_width(), UI_FSTYLE_WIDGET, UI_icon_draw_ex(), w(), wm_drag_name(), wm_drop_operator_draw(), WM_window_pixels_y(), x, wmEvent::x, rcti::xmax, rcti::xmin, y, wmEvent::y, rcti::ymax, and rcti::ymin.
Referenced by wm_draw_window_onscreen().
| void wm_dropbox_free | ( | void | ) |
Definition at line 121 of file wm_dragdrop.c.
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 4446 of file wm_event_system.c.
References wmEvent::alt, GHOST_TEventKeyData::ascii, wmEvent::ascii, BLI_str_utf8_size(), GHOST_TEventButtonData::button, BUTTON4MOUSE, BUTTON5MOUSE, BUTTON6MOUSE, BUTTON7MOUSE, CLOG_ERROR, CLOG_INFO, CLOG_WARN, convert_key(), copy_v2_v2_int(), wmEvent::ctrl, GHOST_TEventTrackpadData::deltaX, GHOST_TEventTrackpadData::deltaY, e, wmWindow::eventstate, EVT_DATA_TIMER, EVT_ESCKEY, EVT_LEFTALTKEY, EVT_LEFTCTRLKEY, EVT_LEFTSHIFTKEY, EVT_OSKEY, EVT_RIGHTALTKEY, EVT_RIGHTCTRLKEY, EVT_RIGHTSHIFTKEY, EVT_UNKNOWNKEY, 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, wmEvent::is_repeat, GHOST_TEventTrackpadData::isDirectionInverted, ISKEYBOARD, ISMOUSE_BUTTON, GHOST_TEventKeyData::key, wmEvent::keymodifier, KM_DBL_CLICK, KM_MOD_FIRST, KM_MOD_SECOND, KM_NOTHING, KM_PRESS, KM_RELEASE, LEFTMOUSE, MIDDLEMOUSE, MOUSEMOVE, MOUSEPAN, MOUSEROTATE, MOUSESMARTZOOM, MOUSEZOOM, NDOF_BUTTON_NONE, NDOF_MOTION, NULL, wmEvent::oskey, wmEvent::prevtype, wmEvent::prevval, RIGHTMOUSE, wmEvent::shift, 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_double_click(), wm_event_prev_click_set(), wm_event_prev_values_set(), WM_event_print(), 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::x, GHOST_TEventTrackpadData::y, wmEvent::y, and GHOST_TEventWheelData::z.
Referenced by ghost_event_proc().
| void wm_event_do_depsgraph | ( | bContext * | C, |
| bool | is_after_open_file | ||
| ) |
Definition at line 348 of file wm_event_system.c.
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_on_visible_update(), DEG_graph_relations_update(), DEG_make_active(), depsgraph, ED_view3d_screen_datamask(), wmWindowManager::is_interface_locked, LISTBASE_FOREACH, scene, wmWindowManager::windows, 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().
| void wm_event_do_handlers | ( | bContext * | C | ) |
Definition at line 3263 of file wm_event_system.c.
References 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_listbase_is_empty(), BLI_remlink(), C, RenderData::cfra, CLOG_INFO, 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, wmWindowManager::drags, 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(), ELEM, wmTooltipState::event_xy, EVT_DROP, wmTooltipState::exit_on_event, FPS, G, G_DEBUG_EVENTS, G_DEBUG_HANDLERS, Scene::id, ID_RECALC_AUDIO_SEEK, INBETWEEN_MOUSEMOVE, wmEvent::is_repeat, CCL_NAMESPACE_BEGIN::isfinite(), ISKEYMODIFIER, ISMOUSE_BUTTON, KM_PRESS, len_manhattan_v2v2_int(), LISTBASE_FOREACH, MOUSEMOVE, NC_WINDOW, NDOF_MOTION, NULL, wmEvent::prevx, wmEvent::prevy, 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_drags_check_ops(), wm_event_add(), WM_event_add_notifier(), wm_event_drag_and_drop_test(), wm_event_free(), wm_event_free_all(), wm_event_free_and_remove_from_queue_if_valid(), wm_event_inside_rect(), wm_event_inside_region(), 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_tooltip_clear(), WM_tooltip_init(), wm_tweakevent_test(), 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(), wmEvent::x, and wmEvent::y.
Referenced by ghost_event_proc(), and WM_main().
| void wm_event_do_notifiers | ( | bContext * | C | ) |
Definition at line 433 of file wm_event_system.c.
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_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_WORKSPACE_DELETE, ND_WORKSPACE_SET, wmWindowManager::notifier_queue, NULL, wmNotifier::reference, bScreen::regionbase, 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().
| void wm_event_do_refresh_wm_and_depsgraph | ( | bContext * | C | ) |
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 396 of file wm_event_system.c.
References blender::compositor::area(), bScreen::areabase, C, CTX_wm_area_set(), CTX_wm_manager(), CTX_wm_window_set(), ED_area_do_refresh(), LISTBASE_FOREACH, NULL, wmWindowManager::windows, wm_event_do_depsgraph(), and WM_window_get_active_screen().
Referenced by redraw_timer_step(), wm_event_do_notifiers(), and WM_main().
| void wm_event_free | ( | wmEvent * | event | ) |
Definition at line 179 of file wm_event_system.c.
References wmEvent::custom, wmEvent::customdata, wmEvent::customdatafree, EVT_DATA_DRAGDROP, wmEvent::is_repeat, ISKEYBOARD, MEM_freeN, wmEvent::type, WM_drag_free_list(), and WM_event_print().
Referenced by wm_event_do_handlers(), wm_event_free_all(), wm_event_free_and_remove_from_queue_if_valid(), and wm_event_free_last().
| void wm_event_free_all | ( | wmWindow * | win | ) |
Definition at line 214 of file wm_event_system.c.
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 1681 of file wm_event_system.c.
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 720 of file wm_event_system.c.
References BLI_assert, C, EVT_BUT_CANCEL, wmEventHandler_UI::handle_fn, ARegion::handlers, LISTBASE_FOREACH_MUTABLE, NULL, 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().
Definition at line 410 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 | ||
| ) |