| 538 | } |
| 539 | |
| 540 | void recompui::ContextId::queue_element_update(ResourceId element) { |
| 541 | // Ensure a context is currently opened by this thread. |
| 542 | if (opened_context_id == ContextId::null()) { |
| 543 | context_error(*this, ContextErrorType::UpdateElementWithoutContext); |
| 544 | } |
| 545 | |
| 546 | // Check that the context that was specified is the same one that's currently open. |
| 547 | if (*this != opened_context_id) { |
| 548 | context_error(*this, ContextErrorType::UpdateElementInWrongContext); |
| 549 | } |
| 550 | |
| 551 | // Check that the element that was specified is in the open context. |
| 552 | auto* elementPtr = opened_context->resources.get(resource_slotmap::key{ element.slot_id }); |
| 553 | if (elementPtr == nullptr) { |
| 554 | context_error(*this, ContextErrorType::UpdateElementInWrongContext); |
| 555 | } |
| 556 | |
| 557 | opened_context->to_update.emplace(element); |
| 558 | } |
| 559 | |
| 560 | void recompui::ContextId::queue_set_text(Element* element, std::string&& text) { |
| 561 | // Ensure a context is currently opened by this thread. |
no test coverage detected