Documentation
¶
Index ¶
- Constants
- Variables
- func EnumProc(hMonitor w32.HMONITOR, hdcMonitor w32.HDC, lprcMonitor *w32.RECT, ...) uintptr
- func GetMonitorInfo(hMonitor w32.HMONITOR) (*w32.MONITORINFO, error)
- func MonitorsEqual(first w32.MONITORINFO, second w32.MONITORINFO) bool
- func SendMessage(hwnd w32.HWND, data string)
- func SetupSingleInstance(uniqueId string)
- type COPYDATASTRUCT
- type EventNotify
- type Frontend
- func (f *Frontend) BrowserOpenURL(rawURL string)
- func (f *Frontend) Callback(message string)
- func (f *Frontend) CheckNotificationAuthorization() (bool, error)
- func (f *Frontend) CleanupNotifications()
- func (f *Frontend) ClipboardGetText() (string, error)
- func (f *Frontend) ClipboardSetText(text string) error
- func (f *Frontend) ExecJS(js string)
- func (f *Frontend) Hide()
- func (f *Frontend) InitializeNotifications() error
- func (f *Frontend) IsNotificationAvailable() bool
- func (f *Frontend) MenuSetApplicationMenu(menu *menu.Menu)
- func (f *Frontend) MenuUpdateApplicationMenu()
- func (f *Frontend) MessageDialog(options frontend.MessageDialogOptions) (string, error)
- func (f *Frontend) Notify(name string, data ...interface{})
- func (f *Frontend) OnNotificationResponse(callback func(result frontend.NotificationResult))
- func (f *Frontend) OpenDirectoryDialog(options frontend.OpenDialogOptions) (string, error)
- func (f *Frontend) OpenFileDialog(options frontend.OpenDialogOptions) (string, error)
- func (f *Frontend) OpenMultipleFilesDialog(options frontend.OpenDialogOptions) ([]string, error)
- func (f *Frontend) Quit()
- func (f *Frontend) RegisterNotificationCategory(category frontend.NotificationCategory) error
- func (f *Frontend) RemoveAllDeliveredNotifications() error
- func (f *Frontend) RemoveAllPendingNotifications() error
- func (f *Frontend) RemoveDeliveredNotification(_ string) error
- func (f *Frontend) RemoveNotification(identifier string) error
- func (f *Frontend) RemoveNotificationCategory(categoryId string) error
- func (f *Frontend) RemovePendingNotification(_ string) error
- func (f *Frontend) RequestNotificationAuthorization() (bool, error)
- func (f *Frontend) Run(ctx context.Context) error
- func (f *Frontend) RunMainLoop()
- func (f *Frontend) SaveFileDialog(options frontend.SaveDialogOptions) (string, error)
- func (f *Frontend) ScreenGetAll() ([]Screen, error)
- func (f *Frontend) SendNotification(options frontend.NotificationOptions) error
- func (f *Frontend) SendNotificationWithActions(options frontend.NotificationOptions) error
- func (f *Frontend) Show()
- func (f *Frontend) ShowWindow()
- func (f *Frontend) WindowCenter()
- func (f *Frontend) WindowClose()
- func (f *Frontend) WindowFullscreen()
- func (f *Frontend) WindowGetPosition() (int, int)
- func (f *Frontend) WindowGetSize() (int, int)
- func (f *Frontend) WindowHide()
- func (f *Frontend) WindowIsFullscreen() bool
- func (f *Frontend) WindowIsMaximised() bool
- func (f *Frontend) WindowIsMinimised() bool
- func (f *Frontend) WindowIsNormal() bool
- func (f *Frontend) WindowMaximise()
- func (f *Frontend) WindowMinimise()
- func (f *Frontend) WindowPrint()
- func (f *Frontend) WindowReload()
- func (f *Frontend) WindowReloadApp()
- func (f *Frontend) WindowSetAlwaysOnTop(b bool)
- func (f *Frontend) WindowSetBackgroundColour(col *options.RGBA)
- func (f *Frontend) WindowSetDarkTheme()
- func (f *Frontend) WindowSetLightTheme()
- func (f *Frontend) WindowSetMaxSize(width int, height int)
- func (f *Frontend) WindowSetMinSize(width int, height int)
- func (f *Frontend) WindowSetPosition(x, y int)
- func (f *Frontend) WindowSetSize(width, height int)
- func (f *Frontend) WindowSetSystemDefaultTheme()
- func (f *Frontend) WindowSetTitle(title string)
- func (f *Frontend) WindowShow()
- func (f *Frontend) WindowToggleMaximise()
- func (f *Frontend) WindowUnfullscreen()
- func (f *Frontend) WindowUnmaximise()
- func (f *Frontend) WindowUnminimise()
- type NotificationPayload
- type Screen
- type ScreenContainer
- type Window
- func (w *Window) Fullscreen()
- func (w *Window) IsFullScreen() bool
- func (w *Window) IsMaximised() bool
- func (w *Window) IsMinimised() bool
- func (w *Window) IsNormal() bool
- func (w *Window) IsVisible() bool
- func (w *Window) Restore()
- func (w *Window) SetApplicationMenu(menu *menu.Menu)
- func (w *Window) SetMaxSize(maxWidth int, maxHeight int)
- func (w *Window) SetMinSize(minWidth int, minHeight int)
- func (w *Window) SetPadding(padding edge.Rect)
- func (w *Window) SetTheme(theme winoptions.Theme)
- func (w *Window) UnFullscreen()
- func (w *Window) UpdateTheme()
- func (w *Window) WndProc(msg uint32, wparam, lparam uintptr) uintptr
Constants ¶
const ( ToastRegistryPath = `Software\Classes\AppUserModelId\` ToastRegistryGuidKey = "CustomActivator" NotificationCategoriesRegistryPath = `SOFTWARE\%s\NotificationCategories` NotificationCategoriesRegistryKey = "Categories" )
const DefaultActionIdentifier = "DEFAULT_ACTION"
const WMCOPYDATA_SINGLE_INSTANCE_DATA = 1542
WMCOPYDATA_SINGLE_INSTANCE_DATA we define our own type for WM_COPYDATA message
Variables ¶
var ModifierMap = map[keys.Modifier]winc.Modifiers{ keys.ShiftKey: winc.ModShift, keys.ControlKey: winc.ModControl, keys.OptionOrAltKey: winc.ModAlt, keys.CmdOrCtrlKey: winc.ModControl, }
Functions ¶
func GetMonitorInfo ¶
func GetMonitorInfo(hMonitor w32.HMONITOR) (*w32.MONITORINFO, error)
func MonitorsEqual ¶
func MonitorsEqual(first w32.MONITORINFO, second w32.MONITORINFO) bool
func SendMessage ¶ added in v2.7.0
func SetupSingleInstance ¶ added in v2.7.0
func SetupSingleInstance(uniqueId string)
SetupSingleInstance single instance Windows app
Types ¶
type COPYDATASTRUCT ¶ added in v2.7.0
type COPYDATASTRUCT struct {
// contains filtered or unexported fields
}
type EventNotify ¶
type EventNotify struct {
Name string `json:"name"`
Data []interface{} `json:"data"`
}
type Frontend ¶
type Frontend struct {
// contains filtered or unexported fields
}
func NewFrontend ¶
func (*Frontend) BrowserOpenURL ¶
BrowserOpenURL Use the default browser to open the url
func (*Frontend) CheckNotificationAuthorization ¶ added in v2.12.0
func (*Frontend) CleanupNotifications ¶ added in v2.12.0
func (f *Frontend) CleanupNotifications()
CleanupNotifications is a Windows stub that does nothing. (Linux-specific cleanup)
func (*Frontend) ClipboardGetText ¶ added in v2.4.0
func (*Frontend) ClipboardSetText ¶ added in v2.4.0
func (*Frontend) InitializeNotifications ¶ added in v2.12.0
func (*Frontend) IsNotificationAvailable ¶ added in v2.12.0
func (*Frontend) MenuSetApplicationMenu ¶
func (*Frontend) MenuUpdateApplicationMenu ¶
func (f *Frontend) MenuUpdateApplicationMenu()
func (*Frontend) MessageDialog ¶
func (f *Frontend) MessageDialog(options frontend.MessageDialogOptions) (string, error)
MessageDialog show a message dialog to the user
func (*Frontend) OnNotificationResponse ¶ added in v2.12.0
func (f *Frontend) OnNotificationResponse(callback func(result frontend.NotificationResult))
func (*Frontend) OpenDirectoryDialog ¶
func (f *Frontend) OpenDirectoryDialog(options frontend.OpenDialogOptions) (string, error)
OpenDirectoryDialog prompts the user to select a directory
func (*Frontend) OpenFileDialog ¶
func (f *Frontend) OpenFileDialog(options frontend.OpenDialogOptions) (string, error)
OpenFileDialog prompts the user to select a file
func (*Frontend) OpenMultipleFilesDialog ¶
func (f *Frontend) OpenMultipleFilesDialog(options frontend.OpenDialogOptions) ([]string, error)
OpenMultipleFilesDialog prompts the user to select a file
func (*Frontend) RegisterNotificationCategory ¶ added in v2.12.0
func (f *Frontend) RegisterNotificationCategory(category frontend.NotificationCategory) error
RegisterNotificationCategory registers a new NotificationCategory to be used with SendNotificationWithActions. Registering a category with the same name as a previously registered NotificationCategory will override it.
func (*Frontend) RemoveAllDeliveredNotifications ¶ added in v2.12.0
RemoveAllDeliveredNotifications is a Windows stub that always returns nil. (macOS and Linux only)
func (*Frontend) RemoveAllPendingNotifications ¶ added in v2.12.0
RemoveAllPendingNotifications is a Windows stub that always returns nil. (macOS and Linux only)
func (*Frontend) RemoveDeliveredNotification ¶ added in v2.12.0
RemoveDeliveredNotification is a Windows stub that always returns nil. (macOS and Linux only)
func (*Frontend) RemoveNotification ¶ added in v2.12.0
RemoveNotification is a Windows stub that always returns nil. (Linux-specific)
func (*Frontend) RemoveNotificationCategory ¶ added in v2.12.0
RemoveNotificationCategory removes a previously registered NotificationCategory.
func (*Frontend) RemovePendingNotification ¶ added in v2.12.0
RemovePendingNotification is a Windows stub that always returns nil. (macOS and Linux only)
func (*Frontend) RequestNotificationAuthorization ¶ added in v2.12.0
func (*Frontend) RunMainLoop ¶ added in v2.1.0
func (f *Frontend) RunMainLoop()
func (*Frontend) SaveFileDialog ¶
func (f *Frontend) SaveFileDialog(options frontend.SaveDialogOptions) (string, error)
SaveFileDialog prompts the user to select a file
func (*Frontend) ScreenGetAll ¶
func (*Frontend) SendNotification ¶ added in v2.12.0
func (f *Frontend) SendNotification(options frontend.NotificationOptions) error
SendNotification sends a basic notification with a name, title, and body. All other options are ignored on Windows. (subtitle is only available on macOS and Linux)
func (*Frontend) SendNotificationWithActions ¶ added in v2.12.0
func (f *Frontend) SendNotificationWithActions(options frontend.NotificationOptions) error
SendNotificationWithActions sends a notification with additional actions and inputs. A NotificationCategory must be registered with RegisterNotificationCategory first. The `CategoryID` must match the registered category. If a NotificationCategory is not registered a basic notification will be sent. (subtitle is only available on macOS and Linux)
func (*Frontend) ShowWindow ¶
func (f *Frontend) ShowWindow()
func (*Frontend) WindowCenter ¶
func (f *Frontend) WindowCenter()
func (*Frontend) WindowClose ¶ added in v2.1.0
func (f *Frontend) WindowClose()
func (*Frontend) WindowFullscreen ¶
func (f *Frontend) WindowFullscreen()
func (*Frontend) WindowGetPosition ¶
func (*Frontend) WindowGetSize ¶
func (*Frontend) WindowHide ¶
func (f *Frontend) WindowHide()
func (*Frontend) WindowIsFullscreen ¶
func (*Frontend) WindowIsMaximised ¶
func (*Frontend) WindowIsMinimised ¶
func (*Frontend) WindowIsNormal ¶
func (*Frontend) WindowMaximise ¶
func (f *Frontend) WindowMaximise()
func (*Frontend) WindowMinimise ¶
func (f *Frontend) WindowMinimise()
func (*Frontend) WindowPrint ¶ added in v2.6.0
func (f *Frontend) WindowPrint()
func (*Frontend) WindowReload ¶
func (f *Frontend) WindowReload()
func (*Frontend) WindowReloadApp ¶
func (f *Frontend) WindowReloadApp()
func (*Frontend) WindowSetAlwaysOnTop ¶
func (*Frontend) WindowSetBackgroundColour ¶
func (*Frontend) WindowSetDarkTheme ¶
func (f *Frontend) WindowSetDarkTheme()
func (*Frontend) WindowSetLightTheme ¶
func (f *Frontend) WindowSetLightTheme()
func (*Frontend) WindowSetMaxSize ¶
func (*Frontend) WindowSetMinSize ¶
func (*Frontend) WindowSetPosition ¶
func (*Frontend) WindowSetSize ¶
func (*Frontend) WindowSetSystemDefaultTheme ¶
func (f *Frontend) WindowSetSystemDefaultTheme()
func (*Frontend) WindowSetTitle ¶
func (*Frontend) WindowShow ¶
func (f *Frontend) WindowShow()
func (*Frontend) WindowToggleMaximise ¶
func (f *Frontend) WindowToggleMaximise()
func (*Frontend) WindowUnfullscreen ¶
func (f *Frontend) WindowUnfullscreen()
func (*Frontend) WindowUnmaximise ¶
func (f *Frontend) WindowUnmaximise()
func (*Frontend) WindowUnminimise ¶
func (f *Frontend) WindowUnminimise()
type NotificationPayload ¶ added in v2.12.0
type NotificationPayload struct {
Action string `json:"action"`
Options frontend.NotificationOptions `json:"payload,omitempty"`
}
NotificationPayload combines the action ID and user data into a single structure
type ScreenContainer ¶
type ScreenContainer struct {
// contains filtered or unexported fields
}
type Window ¶
type Window struct {
winc.Form
OnSuspend func()
OnResume func()
// contains filtered or unexported fields
}
func NewWindow ¶
func NewWindow(parent winc.Controller, appoptions *options.App, versionInfo *operatingsystem.WindowsVersionInfo, chromium *edge.Chromium) *Window
func (*Window) Fullscreen ¶
func (w *Window) Fullscreen()
func (*Window) IsFullScreen ¶
func (*Window) IsMaximised ¶
func (*Window) IsMinimised ¶
func (*Window) SetApplicationMenu ¶
func (*Window) SetMaxSize ¶
func (*Window) SetMinSize ¶
func (*Window) SetPadding ¶ added in v2.10.0
SetPadding is a filter that wraps chromium.SetPadding to prevent unnecessary redraws during minimize/restore 包装了chromium.SetPadding的过滤器,用于防止窗口最小化/恢复过程中的不必要重绘 This fixes window flickering when minimizing/restoring frameless windows 这修复了无边框窗口在最小化/恢复时的闪烁问题 Reference: https://github.com/wailsapp/wails/issues/3951
func (*Window) SetTheme ¶
func (w *Window) SetTheme(theme winoptions.Theme)
func (*Window) UnFullscreen ¶
func (w *Window) UnFullscreen()
func (*Window) UpdateTheme ¶ added in v2.1.0
func (w *Window) UpdateTheme()