mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
uris -> files.
This commit is contained in:
parent
a92ead019e
commit
64187964d4
@ -85,9 +85,9 @@ char **uris_make(int size) {
|
|||||||
return calloc(size + 1, sizeof(char *));
|
return calloc(size + 1, sizeof(char *));
|
||||||
}
|
}
|
||||||
|
|
||||||
void uris_set(char **uris, char *filename, int n) {
|
void uris_set_file(char **uris, char *file, int n) {
|
||||||
GFile *file = g_file_new_for_path(filename);
|
GFile *gfile = g_file_new_for_path(file);
|
||||||
uris[n] = g_file_get_uri(file);
|
uris[n] = g_file_get_uri(gfile);
|
||||||
}
|
}
|
||||||
|
|
||||||
void uris_free(char **uris, int size) {
|
void uris_free(char **uris, int size) {
|
||||||
|
@ -14,16 +14,16 @@ import (
|
|||||||
|
|
||||||
var mu = sync.Mutex{}
|
var mu = sync.Mutex{}
|
||||||
|
|
||||||
func FileDrop(x int, y int, uris []string) {
|
func DragWindow(files []string) {
|
||||||
mu.Lock()
|
mu.Lock()
|
||||||
defer mu.Unlock()
|
defer mu.Unlock()
|
||||||
|
|
||||||
size := C.int(len(uris))
|
size := C.int(len(files))
|
||||||
urisUnsafe := C.uris_make(size);
|
urisUnsafe := C.uris_make(size);
|
||||||
defer C.uris_free(urisUnsafe, size)
|
defer C.uris_free(urisUnsafe, size)
|
||||||
|
|
||||||
for i, uri := range uris {
|
for i, file := range files {
|
||||||
C.uris_set(urisUnsafe, C.CString(uri), C.int(i))
|
C.uris_set_file(urisUnsafe, C.CString(file), C.int(i))
|
||||||
}
|
}
|
||||||
|
|
||||||
C.drag_window(urisUnsafe)
|
C.drag_window(urisUnsafe)
|
||||||
|
@ -25,5 +25,5 @@ static void drag_end(
|
|||||||
void drag_window(char **uris);
|
void drag_window(char **uris);
|
||||||
|
|
||||||
char **uris_make(int size);
|
char **uris_make(int size);
|
||||||
void uris_set(char **uris, char *filename, int n);
|
void uris_set_file(char **uris, char *file, int n);
|
||||||
void uris_free(char **uris, int size);
|
void uris_free(char **uris, int size);
|
||||||
|
Loading…
Reference in New Issue
Block a user