-
Notifications
You must be signed in to change notification settings - Fork 2
/
ultralight_renderer.cpp
60 lines (49 loc) · 1.83 KB
/
ultralight_renderer.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#include "ultralight_hb.h"
#include "ultralight/Renderer.h"
using namespace ultralight;
DEFINE_GETCLASSID(RENDERER)
/*
CONSTRUCTOR Create()
METHOD CreateSession(is_persistent,name)
METHOD default_session();
METHOD CreateView(nWidth,nHeight,lransparent,session)
METHOD Update()
METHOD Render()
METHOD PurgeMemory()
METHOD LogMemoryUsage();
*/
HB_FUNC( ULTRALIGHT_RENDERER_CREATE ) {
initUltralightObj((Renderer::Create()).ptr(), GETCLASSID(RENDERER));
}
FORWARD_GETCLASSID(SESSION);
HB_FUNC( ULTRALIGHT_RENDERER_CREATESESSION ) { //(is_persistent,name)
Renderer* renderer = (Renderer*)hb_selfUltralight();
hb_retUltralight((renderer->CreateSession(hb_parnl(1), hb_parc(2))).ptr(), GETCLASSID(SESSION));
}
HB_FUNC( ULTRALIGHT_RENDERER_DEFAULT_SESSION ) {
Renderer* renderer = (Renderer*)hb_selfUltralight();
hb_retUltralight((renderer->default_session()).ptr(), GETCLASSID(SESSION));
}
FORWARD_GETCLASSID(VIEW);
HB_FUNC( ULTRALIGHT_RENDERER_CREATEVIEW ) { //(nWidth,nHeight,lransparent)
Renderer* renderer = (Renderer*)hb_selfUltralight();
RefPtr<View> view = (renderer->CreateView(hb_parni(1), hb_parni(2), hb_parl(3), nullptr));
hb_retUltralight(view.get(), GETCLASSID(VIEW));
}
HB_FUNC( ULTRALIGHT_RENDERER_UPDATE ) { //()
Renderer* renderer = (Renderer*)hb_selfUltralight();
renderer->Update();
hb_idleState();
}
HB_FUNC( ULTRALIGHT_RENDERER_RENDER ) { //()
Renderer* renderer = (Renderer*)hb_selfUltralight();
renderer->Render();
}
HB_FUNC( ULTRALIGHT_RENDERER_PURGEMEMORY ) { //()
Renderer* renderer = (Renderer*)hb_selfUltralight();
renderer->PurgeMemory();
}
HB_FUNC( ULTRALIGHT_RENDERER_LOGMEMORYUSAGE ) { //()
Renderer* renderer = (Renderer*)hb_selfUltralight();
renderer->LogMemoryUsage();
}