MCPcopy Create free account
hub / github.com/DISTRHO/DPF / webViewEvaluateJS

Function webViewEvaluateJS

distrho/extra/WebViewImpl.cpp:791–814  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

789}
790
791void webViewEvaluateJS(const WebViewHandle handle, const char* const js)
792{
793 #if WEB_VIEW_USING_CHOC
794 webview_choc_eval(handle->webview, js);
795 #elif WEB_VIEW_USING_MACOS_WEBKIT
796 NSString* const nsjs = [[NSString alloc] initWithBytes:js
797 length:std::strlen(js)
798 encoding:NSUTF8StringEncoding];
799 [handle->webview evaluateJavaScript:nsjs completionHandler:nil];
800 [nsjs release];
801 #elif WEB_VIEW_USING_X11_IPC
802 d_debug("evaluateJS '%s'", js);
803 const size_t len = std::strlen(js) + 1;
804 handle->rbctrl.writeUInt(kWebViewMessageEvaluateJS) &&
805 handle->rbctrl.writeUInt(len) &&
806 handle->rbctrl.writeCustomData(js, len);
807 if (handle->rbctrl.commitWrite())
808 webview_wake(&handle->shmptr->client.sem);
809 #endif
810
811 // maybe unused
812 (void)handle;
813 (void)js;
814}
815
816void webViewReload(const WebViewHandle handle)
817{

Callers 5

evaluateJSMethod · 0.85
parameterChangedMethod · 0.85
programLoadedMethod · 0.85
stateChangedMethod · 0.85
sampleRateChangedMethod · 0.85

Calls 2

webview_choc_evalFunction · 0.85
d_debugFunction · 0.85

Tested by

no test coverage detected