diff --git a/robotgo.go b/robotgo.go index 840504a..e595260 100644 --- a/robotgo.go +++ b/robotgo.go @@ -84,14 +84,6 @@ func GetScreenSize() (int, int) { return int(size.width), int(size.height) } -//GetXDisplayName Get XDisplay Name -func GetXDisplayName() string { - name := C.aGetXDisplayName() - gname := C.GoString(name) - defer C.free(unsafe.Pointer(name)) - return gname -} - //SetXDisplayName Set XDisplay Name func SetXDisplayName(name string) string { cname := C.CString(name) @@ -100,6 +92,14 @@ func SetXDisplayName(name string) string { return gstr } +//GetXDisplayName Get XDisplay Name +func GetXDisplayName() string { + name := C.aGetXDisplayName() + gname := C.GoString(name) + defer C.free(unsafe.Pointer(name)) + return gname +} + //CaptureScreen Capture the Screen func CaptureScreen(args ...int) C.MMBitmapRef { var x C.size_t @@ -740,6 +740,12 @@ func CloseWindow() { C.aCloseWindow() } +//SetHandle Set the Window Handle +func SetHandle(hwnd int) { + chwnd := C.uintptr(hwnd) + C.aSetHandle(chwnd) +} + //GetHandle Get the Window Handle func GetHandle() int { hwnd := C.aGetHandle() @@ -748,12 +754,6 @@ func GetHandle() int { return ghwnd } -//SetHandle Set the Window Handle -func SetHandle(hwnd int) { - chwnd := C.uintptr(hwnd) - C.aSetHandle(chwnd) -} - //GetTitle Get the Window Title func GetTitle() string { title := C.aGetTitle() diff --git a/screen/goScreen.h b/screen/goScreen.h index 31bf5d9..1a0c97f 100644 --- a/screen/goScreen.h +++ b/screen/goScreen.h @@ -56,6 +56,15 @@ MMSize aGetScreenSize(){ return displaySize; } +char* aSetXDisplayName(char* name){ + #if defined(USE_X11) + setXDisplay(name); + return "success"; + #else + return "setXDisplayName is only supported on Linux"; + #endif +} + char* aGetXDisplayName(){ #if defined(USE_X11) const char* display = getXDisplay(); @@ -68,15 +77,6 @@ char* aGetXDisplayName(){ #endif } -char* aSetXDisplayName(char* name){ - #if defined(USE_X11) - setXDisplay(name); - return "success"; - #else - return "setXDisplayName is only supported on Linux"; - #endif -} - MMBitmapRef aCaptureScreen(size_t x,size_t y,size_t w,size_t h){ // if (){ // x = 0;