Merge pull request #96 from chilicat/missing-methods

Added Window, Clipboard and Mouse methods
This commit is contained in:
Milan Nikolic 2020-01-22 11:17:33 +01:00 committed by GitHub
commit 6dc630b9be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -76,11 +76,34 @@ func IsWindowMinimized() bool {
return v
}
// IsWindowResized - Check if window has been resized
func IsWindowResized() bool {
ret := C.IsWindowResized()
v := bool(ret)
return v
}
// IsWindowHidden - Check if window is currently hidden
func IsWindowHidden() bool {
ret := C.IsWindowHidden()
v := bool(ret)
return v
}
// ToggleFullscreen - Fullscreen toggle (only PLATFORM_DESKTOP)
func ToggleFullscreen() {
C.ToggleFullscreen()
}
// UnhideWindow - Show the window
func UnhideWindow() {
C.UnhideWindow()
}
// HideWindow - Hide the window
func HideWindow() {
C.HideWindow()
}
// SetWindowIcon - Set icon for window (only PLATFORM_DESKTOP)
func SetWindowIcon(image Image) {
cimage := image.cptr()
@ -182,6 +205,20 @@ func GetMonitorName(monitor int) string {
return v
}
// GetClipboardText - Get clipboard text content
func GetClipboardText() string {
ret := C.GetClipboardText()
v := C.GoString(ret)
return v
}
// SetClipboardText - Set clipboard text content
func SetClipboardText(data string) {
cdata := C.CString(data)
defer C.free(unsafe.Pointer(cdata))
C.SetClipboardText(cdata)
}
// ClearBackground - Sets Background Color
func ClearBackground(color Color) {
ccolor := color.cptr()
@ -591,6 +628,13 @@ func SetMousePosition(x, y int) {
C.SetMousePosition(cx, cy)
}
// SetMouseOffset - Set mouse offset
func SetMouseOffset(offsetX, offsetY int) {
ox := (C.int)(offsetX)
oy := (C.int)(offsetY)
C.SetMouseOffset(ox, oy)
}
// SetMouseScale - Set mouse scaling
func SetMouseScale(scaleX, scaleY float32) {
cscaleX := (C.float)(scaleX)