Merge pull request #347 from go-vgo/bitmap-pr

add mac os M1 support and update examples
This commit is contained in:
vz 2021-07-29 11:58:50 -04:00 committed by GitHub
commit 336f647d75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 15 additions and 7 deletions

2
.gitignore vendored
View File

@ -56,6 +56,8 @@ vendor
# ##
*.a
!cdeps/mac/libpng.a
!cdeps/mac/amd/libpng.a
!cdeps/mac/m1/libpng.a
!cdeps/win32/libpng.a
!cdeps/win64/libpng.a
#

BIN
cdeps/mac/m1/libpng.a Normal file

Binary file not shown.

View File

@ -7,14 +7,19 @@ import (
)
func main() {
clipboard.WriteAll("日本語")
err := clipboard.WriteAll("日本語")
if err != nil {
log.Println("clipboard write all error: ", err)
}
text, err := clipboard.ReadAll()
if err != nil {
log.Println("clipboard read all error: ", err)
} else {
if text != "" {
log.Println("text is: ", text)
// Output: 日本語
}
return
}
if text != "" {
log.Println("text is: ", text)
// Output: 日本語
}
}

View File

@ -27,7 +27,8 @@ package robotgo
#cgo darwin CFLAGS: -x objective-c -Wno-deprecated-declarations
#cgo darwin LDFLAGS: -framework Cocoa -framework OpenGL -framework IOKit
#cgo darwin LDFLAGS: -framework Carbon -framework CoreFoundation
#cgo darwin LDFLAGS:-L${SRCDIR}/cdeps/mac -lpng -lz
#cgo darwin,amd64 LDFLAGS:-L${SRCDIR}/cdeps/mac/amd -lpng -lz
#cgo darwin,arm64 LDFLAGS:-L${SRCDIR}/cdeps/mac/m1 -lpng -lz
//#elif defined(USE_X11)
// Drop -std=c11
#cgo linux CFLAGS: -I/usr/src