| 457 | } |
| 458 | |
| 459 | void setFileDropCallback (FileDropCallback handler) |
| 460 | { |
| 461 | CHOC_AUTORELEASE_BEGIN |
| 462 | |
| 463 | if (handler) |
| 464 | { |
| 465 | fileDropCallback = std::move (handler); |
| 466 | auto types = objc::callClass<id> ("NSArray", "arrayWithObject:", objc::getNSString ("NSFilenamesPboardType")); |
| 467 | objc::call<void> (window, "registerForDraggedTypes:", types); |
| 468 | } |
| 469 | else |
| 470 | { |
| 471 | fileDropCallback = {}; |
| 472 | objc::call<void> (window, "unregisterDraggedTypes"); |
| 473 | } |
| 474 | |
| 475 | CHOC_AUTORELEASE_END |
| 476 | } |
nothing calls this directly
no test coverage detected