-
Notifications
You must be signed in to change notification settings - Fork 31
/
event.c
34 lines (30 loc) · 955 Bytes
/
event.c
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
#include "event.h"
#include "export.h"
void initGlobalEvent()
{
}
//当文档ready的时候
void WKE_CALL_TYPE onDocumentReady2Callback(wkeWebView window, void *param, wkeWebFrameHandle frameId)
{
//只触发main frame 的 ready
if (wkeWebFrameGetMainFrame(window) == frameId)
{
goOnDocumentReadyCallback(window);
}
}
//当网页标题(title)改变的时候
void WKE_CALL_TYPE onTitleChangedCallback(wkeWebView window, void *param, const wkeString title)
{
goOnTitleChangedCallback(window, wkeGetString(title));
}
void initWebViewEvent(wkeWebView window)
{
//窗口被销毁
wkeOnWindowDestroy(window, goOnWindowDestroyCallback, NULL);
//JS引擎初始化完毕
wkeOnDidCreateScriptContext(window, onDidCreateScriptContextCallback, NULL);
//document ready
wkeOnDocumentReady2(window, onDocumentReady2Callback, NULL);
//title changed
wkeOnTitleChanged(window, onTitleChangedCallback, NULL);
}