| 789 | } |
| 790 | |
| 791 | void 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 | |
| 816 | void webViewReload(const WebViewHandle handle) |
| 817 | { |
no test coverage detected