diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-02-19 07:32:01 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-02-19 08:17:21 +0300 |
commit | d718338828c19f6fa1bbaa0530dcc0fbc72e46c4 (patch) | |
tree | 0d17fff4d93256a18507b253502c125dd45f77d3 /source/blender/windowmanager/intern/wm_dragdrop.c | |
parent | f88ea20285891d516c91c976239f95994f73abf3 (diff) |
WM: move dropbox handler to it's own type
Diffstat (limited to 'source/blender/windowmanager/intern/wm_dragdrop.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_dragdrop.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/source/blender/windowmanager/intern/wm_dragdrop.c b/source/blender/windowmanager/intern/wm_dragdrop.c index 714312ef593..7a066ef4282 100644 --- a/source/blender/windowmanager/intern/wm_dragdrop.c +++ b/source/blender/windowmanager/intern/wm_dragdrop.c @@ -194,16 +194,17 @@ void WM_drag_free_list(struct ListBase *lb) static const char *dropbox_active(bContext *C, ListBase *handlers, wmDrag *drag, const wmEvent *event) { - wmEventHandler *handler = handlers->first; - for (; handler; handler = handler->next) { - if (handler->dropboxes) { - wmDropBox *drop = handler->dropboxes->first; - for (; drop; drop = drop->next) { - const char *tooltip = NULL; - if (drop->poll(C, drag, event, &tooltip)) { - /* XXX Doing translation here might not be ideal, but later we have no more - * access to ot (and hence op context)... */ - return (tooltip) ? tooltip : RNA_struct_ui_name(drop->ot->srna); + for (wmEventHandler *handler_base = handlers->first; handler_base; handler_base = handler_base->next) { + if (handler_base->type == WM_HANDLER_TYPE_DROPBOX) { + wmEventHandler_Dropbox *handler = (wmEventHandler_Dropbox *)handler_base; + if (handler->dropboxes) { + for (wmDropBox *drop = handler->dropboxes->first; drop; drop = drop->next) { + const char *tooltip = NULL; + if (drop->poll(C, drag, event, &tooltip)) { + /* XXX Doing translation here might not be ideal, but later we have no more + * access to ot (and hence op context)... */ + return (tooltip) ? tooltip : RNA_struct_ui_name(drop->ot->srna); + } } } } |