Documentation
¶
Overview ¶
Package darwin implements the macOS backend (AppKit + WKWebView) in pure Go: Objective-C is driven through the runtime with purego, no cgo.
Index ¶
- func EnableNotificationSenders()
- func LinkContentRules()
- func LinkContextMenus()
- func LinkMenuIcons()
- func LinkNotificationImages()
- func LinkNowPlaying()
- func RadicalIdeographs(font string, radicals []rune) map[rune]rune
- func TestAccessibilityAttribute(handle uintptr, label, attr string) (value string, settable, named, ok bool)
- func TestAccessibilityPerform(handle uintptr, label, action, value string) bool
- func TestActivate()
- func TestAllowsPictureInPicture(handle uintptr) (allowed, supported bool)
- func TestAppClick(handle uintptr, x, y float64)
- func TestAppKey(code uint16, chars string)
- func TestAppMouseAt(handle uintptr, steps ...TestMouseStep)
- func TestAppPress(handle uintptr, x, y float64, down bool)
- func TestBackgroundThrottlingOff(handle uintptr, webView bool) (off bool, settings int)
- func TestCancelModal(handle uintptr) bool
- func TestChoosePageMenuItem(label string) bool
- func TestClick(handle uintptr, x, y float64)
- func TestClickAndType(handle uintptr, x, y float64, text string) bool
- func TestClosePopover(handle uintptr) bool
- func TestCollectionBehavior(handle uintptr) uint
- func TestCompose(handle uintptr, text string, caret int, commit bool) bool
- func TestComposeOver(handle uintptr, text string, caret int, commit bool, from, length int) bool
- func TestControlClick(handle uintptr, x, y float64)
- func TestDismissPageMenu()
- func TestDockInspector(handle uintptr) bool
- func TestDockMenu(click int) []string
- func TestDockTileImage() []byte
- func TestDocumentChrome(handle uintptr) (title, file string, icon, edited bool)
- func TestDrag(handle uintptr, points [][2]float64)
- func TestDrawablesTrimmed(handle uintptr) (trimmed, ok bool)
- func TestDropData(handle uintptr, x, y float64, data transfer.Data, ...) (operation transfer.Operation, dropped bool)
- func TestDropFiles(handle uintptr, x, y float64, paths []string) (over, dropped bool)
- func TestEndSheet(handle uintptr) bool
- func TestEndSheetButton(handle uintptr, i int) bool
- func TestFullScreenHidesToolbar(handle uintptr) bool
- func TestGlassTint(handle uintptr) (red, green, blue, alpha float64)
- func TestHitView(handle uintptr, x, y float64) (cls string)
- func TestInputClient(handle uintptr) (selected [2]int, document string)
- func TestInspectorPlace(handle uintptr) string
- func TestIsFrontmost() bool
- func TestKey(handle uintptr, code uint16, chars string) bool
- func TestKeyCmd(handle uintptr, code uint16, chars string) bool
- func TestKeyComposing(handle uintptr, code uint16, chars, commit, command string) bool
- func TestKeyShift(handle uintptr, code uint16, chars string, shift bool) bool
- func TestMaterial(handle uintptr) (class string, style int, radius float64, active bool)
- func TestMaterialState(handle uintptr) int
- func TestMenuItemEnabled(path ...string) (enabled bool, err error)
- func TestMenuItemSubtitle(path ...string) (title, subtitle string, err error)
- func TestMockCaptureDevices(handle uintptr) bool
- func TestModal(handle uintptr) (running, shows bool)
- func TestMouseButtons() (downs, ups int)
- func TestNativeGlass(handle uintptr) (class string, frame [4]float64, style int, ok bool)
- func TestNativeGlassSupported() (ok bool)
- func TestNativeGlassTint(handle uintptr) (red, green, blue, alpha float64)
- func TestObserve(handle uintptr) (stop func())
- func TestOnActiveSpace(handle uintptr) bool
- func TestOnScreen(handle uintptr) bool
- func TestPageGestures(handle uintptr, webView int) (swipe, pinch, ok bool)
- func TestPageKeyShift(handle uintptr, code uint16, chars string, shift bool) bool
- func TestPageMenu() ([]string, bool)
- func TestPerformKeyEquivalent(key string, shift bool) bool
- func TestPerformMenuItem(path ...string) error
- func TestPinch(handle uintptr, x, y, magnification float64) (ok bool)
- func TestPostMouse(x, y float64, down bool) bool
- func TestRecentDocuments() []string
- func TestRightClickPage(handle uintptr, x, y float64)
- func TestRoundedBacking(handle uintptr) (opaque bool, alpha, red float64)
- func TestSecondaryClickAsPrimary(handle uintptr, x, y float64) (ok bool)
- func TestSetDroppedFiles(handle uintptr, paths []string)
- func TestSetWindowAppearance(handle uintptr, dark bool)
- func TestSheet(handle uintptr) (texts, buttons []string, ok bool)
- func TestSheetDestructive(handle uintptr) (destructive []bool, ok bool)
- func TestSheetKey(handle uintptr, code uint16, chars string, cmd bool) bool
- func TestSideButton(handle uintptr, back bool) bool
- func TestSurfacePaused(handle uintptr) bool
- func TestSwipe(handle uintptr, back bool) (ok bool)
- func TestTabFocusesLinks(handle uintptr) bool
- func TestTrafficLights(handle uintptr) (x, y float64)
- func TestWebViewAttached(handle uintptr) bool
- func TestWindowBacking(handle uintptr) (opaque bool, alpha float64)
- func TestWindowDrag(handle uintptr) string
- func TestWindowLevel(handle uintptr) int
- func TestWindowOrder() []uintptr
- func TestWindowPixels(handle uintptr) (img *image.RGBA, ok bool)
- type Backend
- func (b *Backend) App() platform.AppController
- func (b *Backend) Applications() ([]platform.Application, error)
- 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) Network() platform.Network
- func (*Backend) NewFileWatch(notify func(platform.FileWatchNotice)) (platform.FileWatch, error)
- 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) 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 (b *Backend) RegisterHotkey(hid int, acc string) error
- func (b *Backend) RemoveAllNotifications()
- func (b *Backend) RemoveNotification(ident string)
- func (*Backend) ReplaceFile(target, replacement string) error
- func (b *Backend) Run() error
- func (b *Backend) Screen() platform.Screen
- func (b *Backend) Secrets() platform.Secrets
- func (b *Backend) SetApplicationMenu(m *platform.Menu)
- func (b *Backend) Shell() platform.Shell
- func (b *Backend) ShowNotification(n *platform.Notification, done func(error))
- func (b *Backend) Signal()
- func (b *Backend) Step()
- func (b *Backend) Theme() platform.Theme
- func (b *Backend) UnregisterHotkey(hid int)
- func (b *Backend) UpdateMenuItem(it *platform.MenuItem)
- func (b *Backend) Wake()
- func (b *Backend) WebViewAvailable() bool
- type NSPoint
- type NSRect
- type NSSize
- type TestAccessNode
- type TestMouseStep
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnableNotificationSenders ¶
func EnableNotificationSenders()
EnableNotificationSenders registers the opt-in translator before a sender notification can reach the backend. Later constructors only read the Once.
func LinkContentRules ¶ added in v0.1.8
func LinkContentRules()
LinkContentRules links the code of content rules, when the app first compiles rules.
func LinkContextMenus ¶ added in v0.1.13
func LinkContextMenus()
LinkContextMenus links the code of pages' context menus, when the app first listens to them (Page.OnContextMenu).
func LinkMenuIcons ¶ added in v0.1.13
func LinkMenuIcons()
LinkMenuIcons links the code of the icons of menu items.
func LinkNotificationImages ¶ added in v0.1.17
func LinkNotificationImages()
LinkNotificationImages links the code of notifications' images, when the app first makes a notification with one.
func LinkNowPlaying ¶ added in v0.1.13
func LinkNowPlaying()
LinkNowPlaying links the code of NowPlaying, when the app first shows what it plays.
func RadicalIdeographs ¶ added in v0.1.8
RadicalIdeographs returns the ideographs that the installed font of the PostScript name draws with the glyphs of the radicals, as PingFang SC draws ⼈ (U+2F08) with the glyph of 人: for each radical whose glyph an ideograph has too, the first such ideograph of CJK Unified Ideographs, else of Extension A. It returns nil when no font has the name. It may be called from any goroutine.
func TestAccessibilityAttribute ¶
func TestAccessibilityAttribute(handle uintptr, label, attr string) (value string, settable, named, ok bool)
TestAccessibilityAttribute reads an attribute of the element labeled label through AppKit's older API, as assistive technology does: its value, whether it is settable, and whether the element names it.
func TestAccessibilityPerform ¶
TestAccessibilityPerform performs action ("press", "increment", "decrement", "focus" or "value" with value) on the element of a window showing native UI labeled label, as assistive technology does, and reports whether there was such an element that allowed it.
func TestActivate ¶ added in v0.1.17
func TestActivate()
TestActivate brings the application in front, as clicking its Dock icon does.
func TestAllowsPictureInPicture ¶ added in v0.1.13
TestAllowsPictureInPicture reports whether a window's page lets its videos go into picture in picture, and false for supported when WebKit doesn't answer its private _allowsPictureInPictureMediaPlayback.
func TestAppClick ¶
TestAppClick is TestClick through the application's event queue, where event monitors see the click as they see the user's, as those of transient popovers that close on clicks elsewhere. The application has handled the click when it returns (handlePosted).
func TestAppKey ¶
TestAppKey posts a key down and up to the application's event queue, which sends it to the key window as it does the user's keys, to a page or native UI. The application has handled the key when it returns (handlePosted).
func TestAppMouseAt ¶ added in v0.1.13
func TestAppMouseAt(handle uintptr, steps ...TestMouseStep)
TestAppMouseAt posts steps of the left button in a window through the application's queue, where event monitors see them as they see the user's, and handles them before it returns. Each step is placed in the window where it is when the step is made, so a step keeps its place on the screen when the window moves.
func TestAppPress ¶
TestAppPress is half of TestAppClick: the left mouse down, or the up, which a user's click handles apart, a frame or more later.
func TestBackgroundThrottlingOff ¶ added in v0.1.13
TestBackgroundThrottlingOff reports whether the page of a window, or of its first web view, keeps running while it can't be seen: every one of throttlingPrefs WebKit has at its value for that, and the web view's window occlusion detection off where WebKit has it; and how many of those settings WebKit has.
func TestCancelModal ¶ added in v0.1.14
TestCancelModal dismisses the dialog TestModal finds, as its Cancel button or Escape would, and reports whether there was one.
func TestChoosePageMenuItem ¶ added in v0.1.13
TestChoosePageMenuItem chooses the item titled label of the page's context menu being shown, as a click on it does, closes the menu, and reports whether it has one.
func TestClick ¶
TestClick sends a left mouse down and up at a point of a window's content (top-left origin, in points), like a user click.
func TestClickAndType ¶
TestClickAndType clicks (x, y) in a window showing native UI and types text there at once, before the window draws another frame, with key events that go through the input method as a keyboard's do. It reports false for a window showing a web page, and while the input source is an input method, which would compose the keys rather than insert them.
func TestClosePopover ¶ added in v0.1.17
TestClosePopover asks a flyout's popover to close as AppKit asks a transient one as the user presses outside it (performClose:), and reports whether it has one.
func TestCollectionBehavior ¶
TestCollectionBehavior returns a window's NSWindowCollectionBehavior.
func TestCompose ¶
TestCompose does what an input method does to a window showing native UI: it shows text as the composition, its caret at rune caret, or with commit, inserts it. It reports false for a window showing a web page.
func TestComposeOver ¶
TestComposeOver is TestCompose replacing the length UTF-16 units of the input method's document at from, unless from is negative, as macOS's press and hold does with the letter it accents.
func TestControlClick ¶
TestControlClick Control-clicks (x, y), in points from the top-left corner of a window's content.
func TestDismissPageMenu ¶ added in v0.1.13
func TestDismissPageMenu()
TestDismissPageMenu closes the page's context menu being shown, if one is.
func TestDockInspector ¶
TestDockInspector opens the web inspector of a window docked to it, and reports whether the window has one.
func TestDockMenu ¶
TestDockMenu returns the titles of the Dock menu the app delegate returns, and clicks the item at click unless it is -1.
func TestDockTileImage ¶
func TestDockTileImage() []byte
TestDockTileImage renders the content of the Dock tile offscreen, as the Dock does, to PNG; nil when the tile shows the plain application icon.
func TestDocumentChrome ¶
TestDocumentChrome describes what a window's title bar shows of its document: the title, the file of the proxy icon, whether the icon shows, and the dot of an edited document.
func TestDrag ¶
TestDrag presses the primary button at the first of points, in points from the top-left corner of a window's content, drags the pointer through the others, and releases it at the last.
func TestDrawablesTrimmed ¶ added in v0.1.17
TestDrawablesTrimmed reports whether the GPU renderer of a window's native UI gave back its drawables, as it does once the window has drawn nothing for a while (internal/gpu/metal's trim), and whether the window draws with one.
func TestDropData ¶
func TestDropData(handle uintptr, x, y float64, data transfer.Data, operations transfer.Operation) (operation transfer.Operation, dropped bool)
TestDropData exercises native source pasteboard providers and the destination protocol with serialized data (no core session token).
func TestDropFiles ¶
TestDropFiles drags files over (x, y), in points from the top-left corner of a window's content, and drops them there, as Finder would: it calls the surface's dragging methods with an NSDraggingInfo of its own, and puts on the pasteboard the file reference URLs of the files that exist at those paths, with no symbolic links. It reports whether the surface took the files over that point and whether it took the drop.
func TestEndSheet ¶
TestEndSheet ends the sheet attached to a window as if its first button was clicked, and reports whether there was one.
func TestEndSheetButton ¶
TestEndSheetButton ends the alert attached to a window as a sheet as if its button i, in the order the alert was given them, was clicked.
func TestFullScreenHidesToolbar ¶
TestFullScreenHidesToolbar reports whether a window asks to hide its toolbar with the menu bar when it enters full screen.
func TestGlassTint ¶ added in v0.1.17
TestGlassTint returns the glass's tint, in sRGB, and 0, 0, 0, 0 when it has none or the window has no glass.
func TestHitView ¶ added in v0.1.17
TestHitView returns the class of the view a window hit-tests at (x, y) of its content, in DIPs from its top left.
func TestInputClient ¶
TestInputClient returns what a window's surface tells input methods: the selected range and the whole text of their document.
func TestInspectorPlace ¶
TestInspectorPlace reports where the docked inspector of a window is: "content" in its content view, "frame" elsewhere in the window, "" when the window has none.
func TestIsFrontmost ¶
func TestIsFrontmost() bool
TestIsFrontmost reports whether the application is the frontmost one, which NSApp's isActive does not tell while a nonactivating panel is the key window: it reports the app active then.
func TestKey ¶
TestKey presses and releases the key of virtual key code code, typing chars, in a window showing native UI, as the keyboard does: the events go through the window to its first responder, the surface and its input method or a web view.
func TestKeyCmd ¶ added in v0.1.17
TestKeyCmd presses a key with Command held in a window showing native UI, which the window sends to its first responder as it does the keyboard's: the content, or the page of a web view.
func TestKeyComposing ¶ added in v0.1.17
TestKeyComposing presses the key of virtual key code code, typing chars, in a window showing native UI, with the test standing in for the input method that interprets it: the input method inserts commit, unless it is empty, then asks for the key's command (doCommandBySelector:), unless command is empty. The Korean input method takes Return so while it composes: it commits the syllable and asks for insertNewline:. The Japanese one commits the candidate and asks for nothing. It reports false for a window showing a web page.
func TestKeyShift ¶
TestKeyShift is TestKey with Shift held when shift is set.
func TestMaterial ¶ added in v0.1.13
TestMaterial returns the class of a window's material (Vibrancy), its style when glass, the corners its content view is cut to, and whether the window draws as active.
func TestMaterialState ¶ added in v0.1.17
TestMaterialState returns the NSVisualEffectState of a window's material, -1 for none or glass.
func TestMenuItemEnabled ¶ added in v0.1.15
TestMenuItemEnabled reports whether an item of the application menu, found as TestPerformMenuItem finds it, is enabled once its menu validates its items, as before it opens.
func TestMenuItemSubtitle ¶ added in v0.1.17
TestMenuItemSubtitle returns the title and the subtitle of an item of the application menu, found by its title as TestPerformMenuItem finds it.
func TestMockCaptureDevices ¶ added in v0.1.13
TestMockCaptureDevices gives a window's page WebKit's mock camera and microphone, which getUserMedia() captures without devices or the system's permission (private -[WKPreferences _setMockCaptureDevicesEnabled:]), even while the page is not focused (_setGetUserMediaRequiresFocus:), for the pages it loads from then on; false when WebKit doesn't answer them.
func TestModal ¶ added in v0.1.14
TestModal reports whether a dialog runs for a window, as its sheet or application modal (runModal), and whether it shows: AppKit ordered it in, and the window server put it on screen.
func TestMouseButtons ¶ added in v0.1.17
func TestMouseButtons() (downs, ups int)
TestMouseButtons returns how many presses and releases of the primary button the application took from the window server since the first call, which starts counting them: a test that posts them with TestPostMouse waits for them so.
func TestNativeGlass ¶ added in v0.1.17
TestNativeGlass returns the first system's glass view of a window's native content: its class, frame in its view's coordinates, and style.
func TestNativeGlassSupported ¶ added in v0.1.17
func TestNativeGlassSupported() (ok bool)
TestNativeGlassSupported reports whether windows show the system's glass: the system has Liquid Glass and does not reduce transparency, as GitHub's macOS runners do.
func TestNativeGlassTint ¶ added in v0.1.17
TestNativeGlassTint returns the first system's glass view of a window's native content tint, in sRGB.
func TestObserve ¶
func TestObserve(handle uintptr) (stop func())
TestObserve has key-value observing watch the view of a window showing native UI and the elements of it that assistive technology reads, as other code may: the runtime gives each a generated subclass of its class, whose methods reach the overrides of Golet's classes. stop ends it.
func TestOnActiveSpace ¶ added in v0.1.13
TestOnActiveSpace reports whether a window is on the Space that shows, a full-screen window's own when it is in front.
func TestOnScreen ¶
TestOnScreen reports whether some of a window shows on screen, as the window server reports once it put the window there.
func TestPageGestures ¶ added in v0.1.13
TestPageGestures reports whether a swipe navigates and a pinch magnifies the page of a window, or with webView 0 or more, of its web view of that index, as WKWebView's properties say. ok is false without that page.
func TestPageKeyShift ¶
TestPageKeyShift presses a key in a window showing a web page, which the window sends to its first responder as it does the keyboard's, with Shift held when shift is set. It reports false for a window without a page.
func TestPageMenu ¶ added in v0.1.13
TestPageMenu returns the titles of the items of the page's context menu being shown, "-" for separators, and false when none is.
func TestPerformKeyEquivalent ¶
TestPerformKeyEquivalent sends a key press with the Command key (and shift when requested) to the application menu and reports whether an item handled it.
func TestPerformMenuItem ¶
TestPerformMenuItem activates an item of the application menu, found by the titles along its path, e.g. TestPerformMenuItem("File", "New"). plugins/automation's menu request chooses items with it too.
func TestPinch ¶ added in v0.1.8
TestPinch pinches a touchpad at a point of a window showing native UI (top-left origin, in points), growing the content by magnification, as a magnify event of macOS says it. It reports false when the event it makes is not one.
func TestPostMouse ¶ added in v0.1.17
TestPostMouse presses (down) or releases the primary button at (x, y) on screen, in Golet's coordinates (top-left origin), as the user's mouse does: through the window server, to whatever shows there, the menu bar's items too. It reports false where the process may not post events (Accessibility).
func TestRecentDocuments ¶
func TestRecentDocuments() []string
TestRecentDocuments returns the paths of the documents the app recorded with App.AddRecentDocument and did not clear, in the order the system keeps them.
func TestRightClickPage ¶ added in v0.1.13
TestRightClickPage right-clicks (x, y), in points from the top-left corner of a window's content, as TestClick clicks. WebKit opens the page's context menu once the page heard the click, later.
func TestRoundedBacking ¶ added in v0.1.13
TestRoundedBacking reports whether a window is opaque, and the alpha and red, in sRGB, of its content view's background, which fills its rounded corners' inside.
func TestSecondaryClickAsPrimary ¶ added in v0.1.17
TestSecondaryClickAsPrimary clicks (x, y), in points from the top-left corner of a window's content, with the secondary button as data loss prevention agents post its events again: as the primary button's press and release, which keep the secondary button's number.
func TestSetDroppedFiles ¶
TestSetDroppedFiles makes paths the files of the next drop on a window's page, as if they had been dragged there.
func TestSetWindowAppearance ¶
TestSetWindowAppearance gives a window its own dark or light appearance, apart from the application's.
func TestSheet ¶
TestSheet returns the texts of the alert attached to a window as a sheet, and its button titles in the order the alert was given them (their tags), which TestEndSheetButton takes.
func TestSheetDestructive ¶ added in v0.1.15
TestSheetDestructive reports whether each button of the alert attached to a window as a sheet, in the order the alert was given them, has a destructive action.
func TestSheetKey ¶ added in v0.1.15
TestSheetKey presses and releases a key in the sheet attached to a window, with Command held when cmd is set, through the application's event queue as the keyboard's keys go. It reports whether there was a sheet.
func TestSideButton ¶
TestSideButton presses and releases a mouse's back or forward button (buttons 3 and 4) in a window showing native UI.
func TestSurfacePaused ¶ added in v0.1.14
TestSurfacePaused reports when the scheduler has no frame queued and the next input will take RequestFrame's after-pause path. Main thread only.
func TestSwipe ¶ added in v0.1.13
TestSwipe swipes left (back) or right (forward) in a window showing native UI, as a touchpad swiping between pages and the side buttons of mice through their makers' software do. It reports false when the event it makes is not a swipe.
func TestTabFocusesLinks ¶
TestTabFocusesLinks reports whether Tab reaches links and form controls that are not text fields in a window's page.
func TestTrafficLights ¶
TestTrafficLights returns where the top-left corner of a window's close button is, in points from the top-left corner of the window.
func TestWebViewAttached ¶
TestWebViewAttached reports whether a window's web view is in its view hierarchy.
func TestWindowBacking ¶ added in v0.1.17
TestWindowBacking reports whether a window is opaque, and the alpha of its background color, in sRGB.
func TestWindowDrag ¶ added in v0.1.13
TestWindowDrag tells where the press stands in moving a window (StartDrag): "idle", "pressed", "native", "manual" or "server"; "idle" for a window no press is down in.
func TestWindowLevel ¶ added in v0.1.13
TestWindowLevel returns a window's level.
func TestWindowOrder ¶ added in v0.1.13
func TestWindowOrder() []uintptr
TestWindowOrder returns the app's windows on screen, panels too, front to back.
func TestWindowPixels ¶ added in v0.1.17
TestWindowPixels returns the content of a window as the window server shows it on screen, not as its views would draw it now: what Core Animation committed and the screen took. One pixel a point, in sRGB; ok is false where the window server gives no image of the window. An app gets the images of its own windows without the permission to record the screen.
Types ¶
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
Backend is the macOS implementation of platform.Backend.
func (*Backend) App ¶
func (b *Backend) App() platform.AppController
func (*Backend) Applications ¶
func (b *Backend) Applications() ([]platform.Application, error)
Applications finds the .app bundles in the folders apps are installed in and those one level down (Utilities, an app's folder), without looking inside bundles, and Finder (which is in CoreServices), each once: an app a symbolic link points to, as /Applications/Safari.app does, is listed at the link, which FileIcon draws without the badge of links. Each has the name Finder shows (localized, without .app) and its bundle identifier, or its path without one.
func (*Backend) Init ¶
func (b *Backend) Init(h platform.AppHandler, opts platform.AppOptions) error
func (*Backend) IsMainThread ¶
func (*Backend) NewFileWatch ¶
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.1.13
func (b *Backend) NowPlaying() platform.NowPlaying
func (*Backend) RemoveAllNotifications ¶
func (b *Backend) RemoveAllNotifications()
func (*Backend) RemoveNotification ¶
func (*Backend) ReplaceFile ¶
ReplaceFile replaces target with -[NSFileManager replaceItemAtURL:withItemAtURL:…], NSDocument's safe save: the target keeps its permissions, creation date, extended attributes (Finder tags, Finder info) and ACLs, and its identity, so that aliases still find it.
func (*Backend) SetApplicationMenu ¶
func (*Backend) ShowNotification ¶
func (b *Backend) ShowNotification(n *platform.Notification, done func(error))
func (*Backend) UnregisterHotkey ¶
func (*Backend) UpdateMenuItem ¶
func (*Backend) Wake ¶
func (b *Backend) Wake()
Wake makes a pending Step return. It is called from any goroutine.
func (*Backend) WebViewAvailable ¶
WebViewAvailable reports whether a window showing a web page can have one. WKWebView is part of macOS, so this holds wherever the app runs.
type NSPoint ¶
type NSPoint struct{ X, Y float64 }
NSPoint, NSSize and NSRect mirror the CoreGraphics structs (64-bit).
type TestAccessNode ¶
type TestAccessNode struct {
Role, Subrole, Label, Value string
// Frame is in points of the screen, its origin at the bottom left.
Frame [4]float64
Focused bool
Depth int
Children int
// Index is a row's place among its table's rows, from 0, and
// RowCount how many rows a table has, through the newer API.
Index, RowCount int
// contains filtered or unexported fields
}
TestAccessNode is an element of native UI as assistive technology reads it through NSAccessibility.
func TestAccessibility ¶
func TestAccessibility(handle uintptr) []TestAccessNode
TestAccessibility reads the elements of a window showing native UI as assistive technology does, depth first.
type TestMouseStep ¶ added in v0.1.13
TestMouseStep is a press (Down), drag or release of the left button at a point of the screen, in Golet's coordinates (top-left origin).
Source Files
¶
- access.go
- access_text.go
- app.go
- apps.go
- auth.go
- cf.go
- child_window.go
- clipboard.go
- content_rules.go
- context_menu.go
- cookies.go
- deeplink.go
- dialog.go
- dock.go
- hotkey.go
- icon.go
- ideographs.go
- locale.go
- login.go
- menu.go
- network.go
- notify.go
- notify_communication.go
- notify_image.go
- nowplaying.go
- objc.go
- popover.go
- power.go
- replace.go
- scheme.go
- secrets.go
- session.go
- surface.go
- surface_drag.go
- surface_input.go
- system.go
- testhooks.go
- watch.go
- webview.go
- window.go
- window_drag.go