mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-01 14:43:55 +00:00
Update sequence
This commit is contained in:
parent
bb213e0dfe
commit
cc0d7f76b7
28
robotgo.go
28
robotgo.go
@ -84,14 +84,6 @@ func GetScreenSize() (int, int) {
|
|||||||
return int(size.width), int(size.height)
|
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
|
//SetXDisplayName Set XDisplay Name
|
||||||
func SetXDisplayName(name string) string {
|
func SetXDisplayName(name string) string {
|
||||||
cname := C.CString(name)
|
cname := C.CString(name)
|
||||||
@ -100,6 +92,14 @@ func SetXDisplayName(name string) string {
|
|||||||
return gstr
|
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
|
//CaptureScreen Capture the Screen
|
||||||
func CaptureScreen(args ...int) C.MMBitmapRef {
|
func CaptureScreen(args ...int) C.MMBitmapRef {
|
||||||
var x C.size_t
|
var x C.size_t
|
||||||
@ -740,6 +740,12 @@ func CloseWindow() {
|
|||||||
C.aCloseWindow()
|
C.aCloseWindow()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//SetHandle Set the Window Handle
|
||||||
|
func SetHandle(hwnd int) {
|
||||||
|
chwnd := C.uintptr(hwnd)
|
||||||
|
C.aSetHandle(chwnd)
|
||||||
|
}
|
||||||
|
|
||||||
//GetHandle Get the Window Handle
|
//GetHandle Get the Window Handle
|
||||||
func GetHandle() int {
|
func GetHandle() int {
|
||||||
hwnd := C.aGetHandle()
|
hwnd := C.aGetHandle()
|
||||||
@ -748,12 +754,6 @@ func GetHandle() int {
|
|||||||
return ghwnd
|
return ghwnd
|
||||||
}
|
}
|
||||||
|
|
||||||
//SetHandle Set the Window Handle
|
|
||||||
func SetHandle(hwnd int) {
|
|
||||||
chwnd := C.uintptr(hwnd)
|
|
||||||
C.aSetHandle(chwnd)
|
|
||||||
}
|
|
||||||
|
|
||||||
//GetTitle Get the Window Title
|
//GetTitle Get the Window Title
|
||||||
func GetTitle() string {
|
func GetTitle() string {
|
||||||
title := C.aGetTitle()
|
title := C.aGetTitle()
|
||||||
|
@ -56,6 +56,15 @@ MMSize aGetScreenSize(){
|
|||||||
return displaySize;
|
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(){
|
char* aGetXDisplayName(){
|
||||||
#if defined(USE_X11)
|
#if defined(USE_X11)
|
||||||
const char* display = getXDisplay();
|
const char* display = getXDisplay();
|
||||||
@ -68,15 +77,6 @@ char* aGetXDisplayName(){
|
|||||||
#endif
|
#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){
|
MMBitmapRef aCaptureScreen(size_t x,size_t y,size_t w,size_t h){
|
||||||
// if (){
|
// if (){
|
||||||
// x = 0;
|
// x = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user