Changeset View
Changeset View
Standalone View
Standalone View
source/blender/windowmanager/intern/wm_event_system.c
| Show First 20 Lines • Show All 537 Lines • ▼ Show 20 Lines | # if 0 | ||||
| printf("notifier win %d screen %s cat %x\n", | printf("notifier win %d screen %s cat %x\n", | ||||
| win->winid, | win->winid, | ||||
| win->screen->id.name + 2, | win->screen->id.name + 2, | ||||
| note->category); | note->category); | ||||
| # endif | # endif | ||||
| ED_screen_do_listen(C, note); | ED_screen_do_listen(C, note); | ||||
| LISTBASE_FOREACH (ARegion *, region, &screen->regionbase) { | LISTBASE_FOREACH (ARegion *, region, &screen->regionbase) { | ||||
| ED_region_do_listen(win, NULL, region, note, scene); | wmRegionListenerParams region_params = { | ||||
| .window = win, | |||||
| .area = NULL, | |||||
| .region = region, | |||||
| .scene = scene, | |||||
| .notifier = note, | |||||
| }; | |||||
| ED_region_do_listen(®ion_params); | |||||
| } | } | ||||
| ED_screen_areas_iter (win, screen, area) { | ED_screen_areas_iter (win, screen, area) { | ||||
| ED_area_do_listen(win, area, note, scene); | wmSpaceTypeListenerParams area_params = { | ||||
| .window = win, | |||||
| .area = area, | |||||
| .notifier = note, | |||||
| .scene = scene, | |||||
| }; | |||||
| ED_area_do_listen(&area_params); | |||||
| LISTBASE_FOREACH (ARegion *, region, &area->regionbase) { | LISTBASE_FOREACH (ARegion *, region, &area->regionbase) { | ||||
| ED_region_do_listen(win, area, region, note, scene); | wmRegionListenerParams region_params = { | ||||
| .window = win, | |||||
| .area = area, | |||||
| .region = region, | |||||
| .scene = scene, | |||||
| .notifier = note, | |||||
| }; | |||||
| ED_region_do_listen(®ion_params); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| MEM_freeN(note); | MEM_freeN(note); | ||||
| } | } | ||||
| #endif /* if 1 (postpone disabling for in favor of message-bus), eventually. */ | #endif /* if 1 (postpone disabling for in favor of message-bus), eventually. */ | ||||
| ▲ Show 20 Lines • Show All 2,222 Lines • ▼ Show 20 Lines | else if (handler_base->poll == NULL || handler_base->poll(CTX_wm_region(C), event)) { | ||||
| if (!wm->is_interface_locked && event->type == EVT_DROP) { | if (!wm->is_interface_locked && event->type == EVT_DROP) { | ||||
| LISTBASE_FOREACH (wmDropBox *, drop, handler->dropboxes) { | LISTBASE_FOREACH (wmDropBox *, drop, handler->dropboxes) { | ||||
| /* Other drop custom types allowed. */ | /* Other drop custom types allowed. */ | ||||
| if (event->custom == EVT_DATA_DRAGDROP) { | if (event->custom == EVT_DATA_DRAGDROP) { | ||||
| ListBase *lb = (ListBase *)event->customdata; | ListBase *lb = (ListBase *)event->customdata; | ||||
| LISTBASE_FOREACH (wmDrag *, drag, lb) { | LISTBASE_FOREACH (wmDrag *, drag, lb) { | ||||
| const char *tooltip = NULL; | const char *tooltip = NULL; | ||||
| if (drop->poll(C, drag, event, &tooltip)) { | if (drop->poll(C, drag, event, &tooltip)) { | ||||
| /* Optionally copy drag information to operator properties. */ | /* Optionally copy drag information to operator properties. Don't call it if the | ||||
| if (drop->copy) { | * operator fails anyway, it might do more than just set properties (e.g. | ||||
| * typically import an asset). */ | |||||
| if (drop->copy && WM_operator_poll_context(C, drop->ot, drop->opcontext)) { | |||||
| drop->copy(drag, drop); | drop->copy(drag, drop); | ||||
| } | } | ||||
| /* Pass single matched wmDrag onto the operator. */ | /* Pass single matched wmDrag onto the operator. */ | ||||
| BLI_remlink(lb, drag); | BLI_remlink(lb, drag); | ||||
| ListBase single_lb = {drag, drag}; | ListBase single_lb = {drag, drag}; | ||||
| event->customdata = &single_lb; | event->customdata = &single_lb; | ||||
| ▲ Show 20 Lines • Show All 2,389 Lines • Show Last 20 Lines | |||||