Changeset View
Changeset View
Standalone View
Standalone View
source/blender/windowmanager/intern/wm_event_system.c
| Show First 20 Lines • Show All 2,845 Lines • ▼ Show 20 Lines | else if (handler_base->poll == NULL || handler_base->poll(CTX_wm_region(C), event)) { | ||||
| else if (handler_base->type == WM_HANDLER_TYPE_DROPBOX) { | else if (handler_base->type == WM_HANDLER_TYPE_DROPBOX) { | ||||
| wmEventHandler_Dropbox *handler = (wmEventHandler_Dropbox *)handler_base; | wmEventHandler_Dropbox *handler = (wmEventHandler_Dropbox *)handler_base; | ||||
| 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; | if (drop->poll(C, drag, event)) { | ||||
| if (drop->poll(C, drag, event, &tooltip)) { | |||||
| /* Optionally copy drag information to operator properties. Don't call it if the | /* Optionally copy drag information to operator properties. Don't call it if the | ||||
| * operator fails anyway, it might do more than just set properties (e.g. | * operator fails anyway, it might do more than just set properties (e.g. | ||||
| * typically import an asset). */ | * typically import an asset). */ | ||||
| if (drop->copy && WM_operator_poll_context(C, drop->ot, drop->opcontext)) { | 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. */ | ||||
| ▲ Show 20 Lines • Show All 2,445 Lines • Show Last 20 Lines | |||||