core: use new typed signals from hu (#10853)

This commit is contained in:
outfoxxed 2025-07-08 09:56:40 -07:00 committed by GitHub
parent 2f34ef141b
commit 78e9eddfb6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
85 changed files with 667 additions and 865 deletions

View file

@ -11,9 +11,9 @@ CInputMethodRelay::CInputMethodRelay() {
static auto P =
g_pHookSystem->hookDynamic("keyboardFocus", [&](void* self, SCallbackInfo& info, std::any param) { onKeyboardFocus(std::any_cast<SP<CWLSurfaceResource>>(param)); });
m_listeners.newTIV3 = PROTO::textInputV3->m_events.newTextInput.registerListener([this](std::any ti) { onNewTextInput(std::any_cast<WP<CTextInputV3>>(ti)); });
m_listeners.newTIV1 = PROTO::textInputV1->m_events.newTextInput.registerListener([this](std::any ti) { onNewTextInput(std::any_cast<WP<CTextInputV1>>(ti)); });
m_listeners.newIME = PROTO::ime->m_events.newIME.registerListener([this](std::any ime) { onNewIME(std::any_cast<SP<CInputMethodV2>>(ime)); });
m_listeners.newTIV3 = PROTO::textInputV3->m_events.newTextInput.listen([this](const auto& input) { onNewTextInput(input); });
m_listeners.newTIV1 = PROTO::textInputV1->m_events.newTextInput.listen([this](const auto& input) { onNewTextInput(input); });
m_listeners.newIME = PROTO::ime->m_events.newIME.listen([this](const auto& ime) { onNewIME(ime); });
}
void CInputMethodRelay::onNewIME(SP<CInputMethodV2> pIME) {
@ -27,7 +27,7 @@ void CInputMethodRelay::onNewIME(SP<CInputMethodV2> pIME) {
m_inputMethod = pIME;
m_listeners.commitIME = pIME->m_events.onCommit.registerListener([this](std::any d) {
m_listeners.commitIME = pIME->m_events.onCommit.listen([this] {
const auto PTI = getFocusedTextInput();
if (!PTI) {
@ -38,7 +38,7 @@ void CInputMethodRelay::onNewIME(SP<CInputMethodV2> pIME) {
PTI->updateIMEState(m_inputMethod.lock());
});
m_listeners.destroyIME = pIME->m_events.destroy.registerListener([this](std::any d) {
m_listeners.destroyIME = pIME->m_events.destroy.listen([this] {
const auto PTI = getFocusedTextInput();
Debug::log(LOG, "IME Destroy");
@ -49,9 +49,8 @@ void CInputMethodRelay::onNewIME(SP<CInputMethodV2> pIME) {
m_inputMethod.reset();
});
m_listeners.newPopup = pIME->m_events.newPopup.registerListener([this](std::any d) {
m_inputMethodPopups.emplace_back(makeUnique<CInputPopup>(std::any_cast<SP<CInputMethodPopupV2>>(d)));
m_listeners.newPopup = pIME->m_events.newPopup.listen([this](const SP<CInputMethodPopupV2>& popup) {
m_inputMethodPopups.emplace_back(makeUnique<CInputPopup>(popup));
Debug::log(LOG, "New input popup");
});