-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjs.cpp
46 lines (35 loc) · 1.46 KB
/
js.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include "webview_candidate_window.hpp"
namespace candidate_window {
std::unordered_map<std::string, std::function<std::string(std::string)>>
handlers;
extern "C" {
EMSCRIPTEN_KEEPALIVE void web_action(const char *action, const char *args) {
handlers[action](args);
}
}
void WebviewCandidateWindow::platform_init() {}
WebviewCandidateWindow::~WebviewCandidateWindow() {}
void WebviewCandidateWindow::set_transparent_background() {}
void WebviewCandidateWindow::update_accent_color() {}
void WebviewCandidateWindow::hide() {
EM_ASM(fcitx.hidePanel());
epoch += 1;
}
void WebviewCandidateWindow::write_clipboard(const std::string &html) {}
void WebviewCandidateWindow::resize(double dx, double dy, double anchor_top,
double anchor_right, double anchor_bottom,
double anchor_left, double panel_top,
double panel_right, double panel_bottom,
double panel_left, double panel_radius,
double border_width, double width,
double height, bool dragging) {
EM_ASM(fcitx.placePanel($0, $1, $2, $3, $4), dx, dy, anchor_top,
anchor_left, dragging);
}
void WebviewCandidateWindow::set_native_blur(bool enabled) {
// Not supported.
}
void WebviewCandidateWindow::set_native_shadow(bool enabled) {
// Not supported.
}
} // namespace candidate_window