ui

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytePtrToString

func BytePtrToString(ptr uintptr) string

func CheckScreenCapture

func CheckScreenCapture()

CheckScreenCapture checks if the process has Screen Recording permission and, if not, shows a floating HIG-style window. It polls until permission is granted, then briefly shows a green checkmark before closing.

func CheckTrust

func CheckTrust()

func ConfigureIdentity

func ConfigureIdentity(appName, bundleID string)

ConfigureIdentity sets the app name and bundle identifier used for TCC prompts and resets.

func IsScreenRecordingTrusted

func IsScreenRecordingTrusted() bool

IsScreenRecordingTrusted checks if screen recording permission is granted without triggering a system prompt. It falls back to an actual capture test when the preflight API returns false, which handles post-re-sign scenarios where the TCC grant no longer matches the code signature.

func IsTrusted

func IsTrusted() bool

IsTrusted reports whether the process has Accessibility permission.

func MkString

func MkString(s string) uintptr

func PrivacySettingsURL added in v0.2.0

func PrivacySettingsURL(service string) string

func RequestAccessibilityPermission added in v0.2.0

func RequestAccessibilityPermission()

func RequestScreenCapturePermission added in v0.2.0

func RequestScreenCapturePermission()

func ResetTCC added in v0.2.0

func ResetTCC(service string)

func ScreenCaptureTerminateGuardActive added in v0.2.0

func ScreenCaptureTerminateGuardActive() bool

func ShouldTerminateReply added in v0.2.0

func ShouldTerminateReply(app appkit.NSApplication) appkit.NSApplicationTerminateReply

func WaitForAccessibility added in v0.2.0

func WaitForAccessibility(timeout time.Duration) bool

func WaitForScreenRecording

func WaitForScreenRecording(timeout time.Duration) bool

WaitForScreenRecording shows the permission window if screen recording is not already granted and blocks until permission is granted or the timeout expires. It returns true if permission was granted, false on timeout.

func WaitForWindows

func WaitForWindows()

WaitForWindows blocks until all permission windows have finished their close animations. Call this before os.Exit to avoid cutting off the green checkmark transition.

Types

type App

type App struct {
	// contains filtered or unexported fields
}

App ...

func Application

func Application() *App

func ApplicationWithBundleID

func ApplicationWithBundleID(bid string) *App

func NewApp

func NewApp(bundleID string) *App

func (*App) Activate

func (a *App) Activate()

func (*App) Element

func (a *App) Element() *Element

func (*App) Exists

func (a *App) Exists() bool

func (*App) Launch

func (a *App) Launch()

func (*App) Terminate

func (a *App) Terminate()

func (*App) Tree

func (a *App) Tree() string

type Attributes

type Attributes struct {
	Label      string
	Identifier string
	Title      string
	Value      string
	Frame      corefoundation.CGRect
	Enabled    bool
	Selected   bool
	HasFocus   bool
}

Attributes struct for Inspect

type Device

type Device struct{}

Device stub for AX

func SharedDevice

func SharedDevice() *Device

func (*Device) PressHome

func (d *Device) PressHome()

func (*Device) PressLock

func (d *Device) PressLock()

func (*Device) PressVolumeDown

func (d *Device) PressVolumeDown()

func (*Device) PressVolumeUp

func (d *Device) PressVolumeUp()

func (*Device) SetOrientation

func (d *Device) SetOrientation(o int)

type Element

type Element struct {
	// contains filtered or unexported fields
}

Element

func ElementByID

func ElementByID(id string) *Element

func (*Element) Attributes

func (e *Element) Attributes() Attributes

func (*Element) Buttons

func (e *Element) Buttons() []*Element

func (*Element) Children

func (e *Element) Children() []*Element

func (*Element) ElementByID

func (e *Element) ElementByID(id string) *Element

func (*Element) Exists

func (e *Element) Exists() bool

func (*Element) FindChildren

func (e *Element) FindChildren(role string) []*Element

Helper filter functions

func (*Element) Frame

func (e *Element) Frame() corefoundation.CGRect

func (*Element) Identifier

func (e *Element) Identifier() string

func (*Element) Label

func (e *Element) Label() string

func (*Element) PerformAction

func (e *Element) PerformAction(action string)

func (*Element) Query

func (e *Element) Query(p QueryParams) []*Element

func (*Element) Role

func (e *Element) Role() string

func (*Element) Screenshot

func (e *Element) Screenshot() ([]byte, error)

func (*Element) Tap

func (e *Element) Tap()

func (*Element) Title

func (e *Element) Title() string

func (*Element) Tree

func (e *Element) Tree() string

func (*Element) VisualTree

func (e *Element) VisualTree() string

VisualTree returns a tree representation of the element and its children using ASCII box-drawing characters.

func (*Element) Windows

func (e *Element) Windows() []*Element

type PermissionSnapshot added in v0.2.0

type PermissionSnapshot struct {
	Accessibility   PermissionStatus
	ScreenRecording PermissionStatus
	Pending         bool
	Message         string
}

func CurrentPermissionSnapshot added in v0.2.0

func CurrentPermissionSnapshot() PermissionSnapshot

type PermissionStatus added in v0.2.0

type PermissionStatus string
const (
	PermissionStatusGranted    PermissionStatus = "granted"
	PermissionStatusMissing    PermissionStatus = "missing"
	PermissionStatusInProgress PermissionStatus = "in_progress"
)

type QueryParams

type QueryParams struct {
	Role       string
	Title      string // Contains match
	Identifier string // Exact match
	Label      string // Contains match
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL