2014-07-08 15:47:28 -05:00
|
|
|
// 8 july 2014
|
|
|
|
|
|
|
|
package ui
|
|
|
|
|
|
|
|
import (
|
2014-08-10 21:24:08 -05:00
|
|
|
"fmt"
|
2014-07-08 15:47:28 -05:00
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
2014-07-20 20:22:10 -05:00
|
|
|
// #cgo CFLAGS: -mmacosx-version-min=10.7 -DMACOSX_DEPLOYMENT_TARGET=10.7
|
|
|
|
// #cgo LDFLAGS: -mmacosx-version-min=10.7 -lobjc -framework Foundation -framework AppKit
|
2014-07-08 15:47:28 -05:00
|
|
|
// #include "objc_darwin.h"
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
func uiinit() error {
|
2014-08-10 21:24:08 -05:00
|
|
|
var errmsg *C.char
|
|
|
|
|
|
|
|
errmsg = nil
|
|
|
|
C.uiinit(&errmsg)
|
|
|
|
if errmsg != nil {
|
|
|
|
return fmt.Errorf("package ui initialization failed: %s", C.GoString(errmsg))
|
|
|
|
}
|
2014-07-08 15:47:28 -05:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func uimsgloop() {
|
|
|
|
C.uimsgloop()
|
|
|
|
}
|
|
|
|
|
2014-07-13 20:31:13 -05:00
|
|
|
func uistop() {
|
|
|
|
C.uistop()
|
|
|
|
}
|
|
|
|
|
2014-07-19 08:57:01 -05:00
|
|
|
func issue(f func()) {
|
|
|
|
C.issue(unsafe.Pointer(&f))
|
2014-07-08 15:47:28 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//export doissue
|
2014-07-19 08:57:01 -05:00
|
|
|
func doissue(fp unsafe.Pointer) {
|
|
|
|
perform(fp)
|
2014-07-08 15:47:28 -05:00
|
|
|
}
|