2020-10-23 03:54:50 +13:00
|
|
|
package types
|
|
|
|
|
2021-01-10 10:58:18 +13:00
|
|
|
type CursorImage struct {
|
|
|
|
Width uint16
|
|
|
|
Height uint16
|
|
|
|
Xhot uint16
|
|
|
|
Yhot uint16
|
|
|
|
Serial uint64
|
|
|
|
Pixels []byte
|
|
|
|
}
|
|
|
|
|
2020-11-02 04:09:48 +13:00
|
|
|
type ScreenSize struct {
|
2020-11-26 10:35:54 +13:00
|
|
|
Width int
|
|
|
|
Height int
|
|
|
|
Rate int16
|
2020-11-02 04:09:48 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
type ScreenConfiguration struct {
|
2020-11-26 10:35:54 +13:00
|
|
|
Width int
|
|
|
|
Height int
|
|
|
|
Rates map[int]int16
|
2020-11-02 04:09:48 +13:00
|
|
|
}
|
|
|
|
|
2021-01-13 10:54:13 +13:00
|
|
|
type KeyboardModifiers struct {
|
|
|
|
NumLock *bool
|
|
|
|
CapsLock *bool
|
|
|
|
}
|
|
|
|
|
2020-11-02 04:09:48 +13:00
|
|
|
type DesktopManager interface {
|
2020-10-23 03:54:50 +13:00
|
|
|
Start()
|
|
|
|
Shutdown() error
|
2020-11-08 05:22:25 +13:00
|
|
|
OnBeforeScreenSizeChange(listener func())
|
|
|
|
OnAfterScreenSizeChange(listener func())
|
2020-11-02 04:09:48 +13:00
|
|
|
|
|
|
|
// xorg
|
|
|
|
ChangeScreenSize(width int, height int, rate int) error
|
2020-10-23 03:54:50 +13:00
|
|
|
Move(x, y int)
|
|
|
|
Scroll(x, y int)
|
|
|
|
ButtonDown(code int) error
|
|
|
|
KeyDown(code uint64) error
|
|
|
|
ButtonUp(code int) error
|
|
|
|
KeyUp(code uint64) error
|
|
|
|
ResetKeys()
|
2020-11-02 04:09:48 +13:00
|
|
|
ScreenConfigurations() map[int]ScreenConfiguration
|
|
|
|
GetScreenSize() *ScreenSize
|
2020-10-23 03:54:50 +13:00
|
|
|
SetKeyboardLayout(layout string)
|
2021-01-13 10:54:13 +13:00
|
|
|
SetKeyboardModifiers(mod KeyboardModifiers)
|
|
|
|
GetKeyboardModifiers() KeyboardModifiers
|
2021-01-10 10:58:18 +13:00
|
|
|
GetCursorImage() *CursorImage
|
2020-11-02 04:09:48 +13:00
|
|
|
|
2021-01-11 03:58:17 +13:00
|
|
|
// xevent
|
|
|
|
OnCursorChanged(listener func(serial uint64))
|
2021-01-12 03:30:53 +13:00
|
|
|
OnClipboardUpdated(listener func())
|
2021-01-12 12:09:43 +13:00
|
|
|
OnWindowCreated(listener func(window uint32, name string, role string))
|
2021-01-11 03:58:17 +13:00
|
|
|
OnEventError(listener func(error_code uint8, message string, request_code uint8, minor_code uint8))
|
|
|
|
|
2020-11-02 04:09:48 +13:00
|
|
|
// clipboard
|
|
|
|
ReadClipboard() string
|
|
|
|
WriteClipboard(data string)
|
2021-01-07 06:57:50 +13:00
|
|
|
|
|
|
|
// drop
|
|
|
|
DropFiles(x int, y int, files []string)
|
2020-10-23 03:54:50 +13:00
|
|
|
}
|