neko/internal/types/desktop.go

58 lines
1.2 KiB
Go
Raw Normal View History

package types
2021-01-09 22:58:18 +01:00
type CursorImage struct {
Width uint16
Height uint16
Xhot uint16
Yhot uint16
Serial uint64
Pixels []byte
}
2020-11-01 16:09:48 +01:00
type ScreenSize struct {
2020-11-25 22:35:54 +01:00
Width int
Height int
Rate int16
2020-11-01 16:09:48 +01:00
}
type ScreenConfiguration struct {
2020-11-25 22:35:54 +01:00
Width int
Height int
Rates map[int]int16
2020-11-01 16:09:48 +01:00
}
type DesktopManager interface {
Start()
Shutdown() error
OnBeforeScreenSizeChange(listener func())
OnAfterScreenSizeChange(listener func())
2020-11-01 16:09:48 +01:00
// xorg
ChangeScreenSize(width int, height int, rate int) error
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-01 16:09:48 +01:00
ScreenConfigurations() map[int]ScreenConfiguration
GetScreenSize() *ScreenSize
SetKeyboardLayout(layout string)
SetKeyboardModifiers(NumLock int, CapsLock int, ScrollLock int)
2021-01-09 22:58:18 +01:00
GetCursorImage() *CursorImage
2020-11-01 16:09:48 +01:00
2021-01-10 15:58:17 +01:00
// xevent
OnCursorChanged(listener func(serial uint64))
2021-01-11 15:30:53 +01:00
OnClipboardUpdated(listener func())
2021-01-12 00:09:43 +01:00
OnWindowCreated(listener func(window uint32, name string, role string))
2021-01-10 15:58:17 +01:00
OnEventError(listener func(error_code uint8, message string, request_code uint8, minor_code uint8))
2020-11-01 16:09:48 +01:00
// clipboard
ReadClipboard() string
WriteClipboard(data string)
2021-01-06 18:57:50 +01:00
// drop
DropFiles(x int, y int, files []string)
}