Documentation
¶
Overview ¶
Package linux implements the Linux backend (GTK 3 + WebKitGTK) in pure Go: the libraries are loaded at run time with purego, no cgo.
Index ¶
- func TestActivateMenuItem(handle uintptr, path ...string) error
- func TestDefaultURLHandler(scheme string) string
- func TestDismissPopups() int
- func TestMovePointer(x, y int) bool
- func TestPressButton(press bool) bool
- func TestPressKeys(names ...string) bool
- func TestResizeCursor(handle uintptr) string
- func TestSetDroppedFiles(handle uintptr, paths []string)
- func TestUsePortalShortcuts(on bool) bool
- type Backend
- func (b *Backend) App() platform.AppController
- func (b *Backend) Clipboard() platform.Clipboard
- func (b *Backend) Dialogs() platform.Dialogs
- func (b *Backend) Init(h platform.AppHandler, opts platform.AppOptions) error
- func (b *Backend) IsMainThread() bool
- func (b *Backend) Name() string
- func (b *Backend) NewTray(h platform.TrayHandler) (platform.Tray, error)
- func (b *Backend) NewWindow(o *platform.WindowOptions, h platform.WindowHandler) (platform.Window, error)
- func (b *Backend) NotificationsSupported() bool
- func (b *Backend) PopupMenu(m *platform.Menu, pw platform.Window, pos *platform.Point)
- func (b *Backend) Power() platform.Power
- func (b *Backend) Quit()
- func (b *Backend) RegisterHotkey(id int, acc string) error
- func (b *Backend) RemoveNotification(id string)
- func (b *Backend) Run() error
- func (b *Backend) Screen() platform.Screen
- func (b *Backend) SetApplicationMenu(m *platform.Menu)
- func (b *Backend) Shell() platform.Shell
- func (b *Backend) ShowNotification(n *platform.Notification) error
- func (b *Backend) Signal()
- func (b *Backend) Step()
- func (b *Backend) Theme() platform.Theme
- func (b *Backend) UnregisterHotkey(id int)
- func (b *Backend) UpdateMenuItem(it *platform.MenuItem)
- func (b *Backend) Wake()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TestActivateMenuItem ¶
TestActivateMenuItem activates an item of a window's menu bar, found by the labels along its path.
func TestDefaultURLHandler ¶
TestDefaultURLHandler returns the id of the application GLib opens URLs of scheme with, as xdg-open and GTK apps do.
func TestDismissPopups ¶
func TestDismissPopups() int
TestDismissPopups closes the context menus being shown, as if the user pressed Escape, and reports how many there were.
func TestMovePointer ¶ added in v0.1.5
TestMovePointer moves the pointer to a point of the screen through the XTEST extension like a mouse would. It reports false without an X server.
func TestPressButton ¶ added in v0.1.5
TestPressButton presses or releases the first mouse button the same way.
func TestPressKeys ¶
TestPressKeys presses keys, X keysym names such as "Control_L", together and releases them, through the XTEST extension like a keyboard would. It reports false without an X server.
func TestResizeCursor ¶ added in v0.1.5
TestResizeCursor returns the name of the resize cursor a frameless window shows over an edge of its page, or "".
func TestSetDroppedFiles ¶
TestSetDroppedFiles makes paths the files of the next drop on a window's page, as if they had been dragged there.
func TestUsePortalShortcuts ¶
TestUsePortalShortcuts makes global shortcuts bind through the XDG desktop portal, as on Wayland, and reports whether the desktop offers it.
Types ¶
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
Backend is the Linux (GTK 3 + WebKitGTK) implementation of platform.Backend.
func New ¶
func New() *Backend
New creates the Linux backend. Libraries are loaded by Init so that programs still start (and report a clear error) on machines without GTK.
func (*Backend) App ¶
func (b *Backend) App() platform.AppController
func (*Backend) Init ¶
func (b *Backend) Init(h platform.AppHandler, opts platform.AppOptions) error
func (*Backend) IsMainThread ¶
IsMainThread reports whether the caller runs on the thread the process started with, whose thread id is the process id. Package mygo locks the main goroutine to it, so this holds before Init too.
func (*Backend) NewWindow ¶
func (b *Backend) NewWindow(o *platform.WindowOptions, h platform.WindowHandler) (platform.Window, error)
func (*Backend) NotificationsSupported ¶
func (*Backend) RemoveNotification ¶
func (*Backend) SetApplicationMenu ¶
func (*Backend) ShowNotification ¶
func (b *Backend) ShowNotification(n *platform.Notification) error