-
Notifications
You must be signed in to change notification settings - Fork 2
/
ultralight_monitor.cpp
52 lines (43 loc) · 1.45 KB
/
ultralight_monitor.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
#include "ultralight_hb.h"
#include <AppCore/Monitor.h>
using namespace ultralight;
DEFINE_GETCLASSID(MONITOR)
/*
ACCESS scale()
ACCESS width()
ACCESS height()
*/
HB_SIZE iObjIdxMonitor = 0;
HB_SIZE getObjIdxMonitor() {
if(iObjIdxMonitor) return iObjIdxMonitor;
iObjIdxMonitor = hb_clsGetVarIndex(GETCLASSID(MONITOR),hb_dynsymGet("pObj"));
return iObjIdxMonitor;
}
void hb_retMonitor(Monitor* monitor) {
hb_clsAssociate( GETCLASSID(MONITOR) );
PHB_ITEM pSelf = hb_stackReturnItem();
hb_arraySetPtr(pSelf, getObjIdxMonitor(), monitor);
}
Monitor* hb_parMonitor(int n) {
PHB_ITEM pItem = hb_param(n, HB_IT_OBJECT);
if(!pItem) return 0;
return (Monitor*)hb_arrayGetPtr(pItem,getObjIdxMonitor());
}
HB_FUNC( ULTRALIGHT_MONITOR_WIDTH ) {
PHB_ITEM pSelf = hb_stackSelfItem();
if(!HB_IS_OBJECT(pSelf)) return;
Monitor* monitor = (Monitor*)hb_arrayGetPtr(pSelf,getObjIdxMonitor());
hb_retni(monitor->width());
}
HB_FUNC( ULTRALIGHT_MONITOR_HEIGHT ) {
PHB_ITEM pSelf = hb_stackSelfItem();
if(!HB_IS_OBJECT(pSelf)) return;
Monitor* monitor = (Monitor*)hb_arrayGetPtr(pSelf,getObjIdxMonitor());
hb_retni(monitor->height());
}
HB_FUNC( ULTRALIGHT_MONITOR_SCALE ) {
PHB_ITEM pSelf = hb_stackSelfItem();
if(!HB_IS_OBJECT(pSelf)) return;
Monitor* monitor = (Monitor*)hb_arrayGetPtr(pSelf,getObjIdxMonitor());
hb_retnd(monitor->scale());
}