Documentation
¶
Overview ¶
Package web is the backend for browsers (GOOS=js, GOARCH=wasm): windows showing content MyGo draws itself (package ui) on canvases of the page, drawn with WebGL 2 by the GL renderer (package gl), or in memory where the browser has no WebGL 2. A window fills the page's element with the ID "mygo", or else the page; windows opened later cover earlier ones. Windows of web pages, menus, trays and the like have nothing in a browser to stand for them, and report so.
Go's main goroutine, which runs the event loop (Run), is the main thread. JavaScript calls Go's functions (js.FuncOf) on goroutines of their own: the backend has the main goroutine handle their events and waits for it, so that they can still prevent the browser's defaults.
Index ¶
- type Backend
- func (b *Backend) App() platform.AppController
- func (*Backend) Applications() ([]platform.Application, error)
- func (b *Backend) Clipboard() platform.Clipboard
- func (b *Backend) Dialogs() platform.Dialogs
- func (b *Backend) Init(h platform.AppHandler, _ platform.AppOptions) error
- func (b *Backend) IsMainThread() bool
- func (b *Backend) Name() string
- func (b *Backend) Network() platform.Network
- func (*Backend) NewFileWatch(func(platform.FileWatchNotice)) (platform.FileWatch, error)
- func (*Backend) NewTray(platform.TrayHandler) (platform.Tray, error)
- func (b *Backend) NewWindow(o *platform.WindowOptions, h platform.WindowHandler) (platform.Window, error)
- func (*Backend) NotificationsSupported() bool
- func (b *Backend) NowPlaying() platform.NowPlaying
- func (b *Backend) PopupMenu(m *platform.Menu, pw platform.Window, pos *platform.Point)
- func (b *Backend) Power() platform.Power
- func (b *Backend) Quit()
- func (*Backend) RegisterHotkey(int, string) error
- func (*Backend) RemoveAllNotifications()
- func (*Backend) RemoveNotification(string)
- func (*Backend) ReplaceFile(target, replacement string) error
- func (b *Backend) Run() error
- func (b *Backend) Screen() platform.Screen
- func (*Backend) Secrets() platform.Secrets
- func (*Backend) SetApplicationMenu(*platform.Menu)
- func (b *Backend) Shell() platform.Shell
- func (*Backend) ShowNotification(_ *platform.Notification, done func(error))
- func (b *Backend) Signal()
- func (b *Backend) Step()
- func (b *Backend) Theme() platform.Theme
- func (*Backend) UnregisterHotkey(int)
- func (*Backend) UpdateMenuItem(*platform.MenuItem)
- func (b *Backend) Wake()
- func (*Backend) WebViewAvailable() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
Backend is the browser backend.
func (*Backend) App ¶
func (b *Backend) App() platform.AppController
func (*Backend) Applications ¶ added in v0.5.0
func (*Backend) Applications() ([]platform.Application, error)
func (*Backend) Init ¶
func (b *Backend) Init(h platform.AppHandler, _ platform.AppOptions) error
func (*Backend) IsMainThread ¶
func (*Backend) NewFileWatch ¶ added in v0.5.0
func (*Backend) NewWindow ¶
func (b *Backend) NewWindow(o *platform.WindowOptions, h platform.WindowHandler) (platform.Window, error)
func (*Backend) NotificationsSupported ¶
func (*Backend) NowPlaying ¶ added in v0.7.0
func (b *Backend) NowPlaying() platform.NowPlaying
func (*Backend) PopupMenu ¶
PopupMenu shows m at pos in w's content, or where the pointer last pressed, and waits until the user chooses an item or dismisses it, handling events meanwhile.
func (*Backend) RemoveAllNotifications ¶
func (*Backend) RemoveAllNotifications()
func (*Backend) RemoveNotification ¶
func (*Backend) ReplaceFile ¶ added in v0.5.0
func (*Backend) SetApplicationMenu ¶
func (*Backend) ShowNotification ¶
func (*Backend) ShowNotification(_ *platform.Notification, done func(error))