neko/internal/desktop/gtk/gtk.go

31 lines
462 B
Go
Raw Normal View History

2021-01-08 06:27:50 +13:00
package gtk
2021-01-07 06:27:21 +13:00
/*
#cgo linux CFLAGS: -I/usr/src -I/usr/local/include/
#cgo pkg-config: gdk-3.0 gtk+-3.0
2021-01-08 06:27:50 +13:00
#include "gtk.h"
2021-01-07 06:27:21 +13:00
*/
import "C"
import (
"sync"
)
var mu = sync.Mutex{}
2021-01-07 06:54:55 +13:00
func DragWindow(files []string) {
2021-01-07 06:27:21 +13:00
mu.Lock()
defer mu.Unlock()
2021-01-07 06:54:55 +13:00
size := C.int(len(files))
2021-01-07 06:27:21 +13:00
urisUnsafe := C.uris_make(size);
defer C.uris_free(urisUnsafe, size)
2021-01-07 06:54:55 +13:00
for i, file := range files {
C.uris_set_file(urisUnsafe, C.CString(file), C.int(i))
2021-01-07 06:27:21 +13:00
}
C.drag_window(urisUnsafe)
}