forked from go-llvm/llgo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
core.go
44 lines (36 loc) · 975 Bytes
/
core.go
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
// Copyright 2012 The llgo Authors.
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file.
package ppapi
import (
"time"
)
type ppbCore1_0 struct {
addRefResource func(res Resource)
releaseResource func(res Resource)
getTime func() ppTime
getTimeTicks func() ppTimeTicks
callOnMainThread func(delayMillis int32, callback ppCompletionCallback, result int32)
isMainThread func() ppBool
}
func (p *ppbCore1_0) AddRefResource(r Resource) {
p.addRefResource(r)
}
func (p *ppbCore1_0) ReleaseResource(r Resource) {
p.ReleaseResource(r)
}
func (p *ppbCore1_0) GetTime() time.Time {
seconds := p.getTime()
return seconds.asTime()
}
func (p *ppbCore1_0) IsMainThread() bool {
return p.isMainThread().toBool()
}
type Core interface {
AddRefResource(Resource)
ReleaseResource(Resource)
GetTime() time.Time
//GetTimeTicks()
//CallOnMainThread(after time.Duration, ...)
IsMainThread() bool
}