示例#1
0
func GetPluginInfo(id PluginId) (name, filePath, signature, description string) {
	nameBuf := (*C.char)(C.malloc(255))
	defer C.free(unsafe.Pointer(nameBuf))
	pathBuf := (*C.char)(C.malloc(255))
	defer C.free(unsafe.Pointer(pathBuf))
	sigBuf := (*C.char)(C.malloc(255))
	defer C.free(unsafe.Pointer(sigBuf))
	descBuf := (*C.char)(C.malloc(255))
	defer C.free(unsafe.Pointer(descBuf))
	C.XPLMGetPluginInfo(C.XPLMPluginID(id), nameBuf, pathBuf, sigBuf, descBuf)
	name = C.GoString(nameBuf)
	filePath = C.GoString(pathBuf)
	signature = C.GoString(sigBuf)
	description = C.GoString(descBuf)
	return
}
示例#2
0
func DisablePlugin(id PluginId) {
	C.XPLMDisablePlugin(C.XPLMPluginID(id))
}
示例#3
0
func EnablePlugin(id PluginId) bool {
	return C.XPLMEnablePlugin(C.XPLMPluginID(id)) == 1
}
示例#4
0
func IsPluginEnabled(id PluginId) bool {
	return C.XPLMIsPluginEnabled(C.XPLMPluginID(id)) == 1
}