mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-02 23:23:55 +00:00
Fixed windows warning and x11 error
This commit is contained in:
parent
477a7b473c
commit
63f914ae62
@ -60,4 +60,12 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef RobotGo_64
|
||||||
|
typedef int64_t intptr;
|
||||||
|
typedef uint64_t uintptr;
|
||||||
|
#else
|
||||||
|
typedef int32_t intptr;
|
||||||
|
typedef uint32_t uintptr; // Unsigned pointer integer
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* OS_H */
|
#endif /* OS_H */
|
||||||
|
@ -15,6 +15,7 @@ package robotgo
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/robotn/xgb"
|
"github.com/robotn/xgb"
|
||||||
@ -185,11 +186,11 @@ func Alert(title, msg string, args ...string) bool {
|
|||||||
` -title ` + title + ` -buttons ` + defaultBtn + ":0," + cancelBtn + ":1" + ` -default Ok`
|
` -title ` + title + ` -buttons ` + defaultBtn + ":0," + cancelBtn + ":1" + ` -default Ok`
|
||||||
out, err := Run(c)
|
out, err := Run(c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("Alert: ", err, ". ", strint(out))
|
fmt.Println("Alert: ", err, ". ", string(out))
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
if strint(out) == "1" {
|
if string(out) == "1" {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
|
@ -95,7 +95,7 @@ MMBitmapRef copyMMBitmapFromDisplayInRect(MMRectInt32 rect, int32_t display_id)
|
|||||||
if (display_id == -1) {
|
if (display_id == -1) {
|
||||||
screen = GetDC(NULL); /* Get entire screen */
|
screen = GetDC(NULL); /* Get entire screen */
|
||||||
} else {
|
} else {
|
||||||
screen = GetDC((HWND) display_id);
|
screen = GetDC((HWND) (uintptr) display_id);
|
||||||
}
|
}
|
||||||
if (screen == NULL) { return NULL; }
|
if (screen == NULL) { return NULL; }
|
||||||
|
|
||||||
|
@ -15,14 +15,6 @@
|
|||||||
#include <X11/Xatom.h>
|
#include <X11/Xatom.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef RobotGo_64
|
|
||||||
typedef int64_t intptr;
|
|
||||||
typedef uint64_t uintptr;
|
|
||||||
#else
|
|
||||||
typedef int32_t intptr;
|
|
||||||
typedef uint32_t uintptr; // Unsigned pointer integer
|
|
||||||
#endif
|
|
||||||
|
|
||||||
struct _MData{
|
struct _MData{
|
||||||
#if defined(IS_MACOSX)
|
#if defined(IS_MACOSX)
|
||||||
CGWindowID CgID; // Handle to a CGWindowID
|
CGWindowID CgID; // Handle to a CGWindowID
|
||||||
|
Loading…
Reference in New Issue
Block a user