2023-11-18 14:32:37 +09:00
|
|
|
package editor
|
|
|
|
|
|
|
|
/*
|
|
|
|
#cgo CFLAGS: -x objective-c
|
|
|
|
#cgo LDFLAGS: -framework Cocoa
|
2024-06-05 23:55:03 +09:00
|
|
|
#include "objcbridge.h"
|
|
|
|
#include <stdlib.h>
|
2023-11-18 14:32:37 +09:00
|
|
|
*/
|
|
|
|
import "C"
|
2024-06-10 22:39:04 +09:00
|
|
|
import "unsafe"
|
2023-11-18 14:32:37 +09:00
|
|
|
|
2024-06-05 23:55:03 +09:00
|
|
|
//export GetOpeningFilepath
|
|
|
|
func GetOpeningFilepath(str *C.char) {
|
|
|
|
goStr := C.GoString(str)
|
2024-06-10 22:39:04 +09:00
|
|
|
C.free(unsafe.Pointer(str))
|
2024-09-01 21:16:22 +09:00
|
|
|
|
|
|
|
if editor.openingFileCh == nil {
|
|
|
|
editor.openingFileCh = make(chan string, 2)
|
|
|
|
}
|
2024-06-05 23:55:03 +09:00
|
|
|
editor.openingFileCh <- goStr
|
|
|
|
}
|
|
|
|
|
2023-11-18 14:32:37 +09:00
|
|
|
func setMyApplicationDelegate() {
|
|
|
|
C.SetMyApplicationDelegate()
|
|
|
|
}
|