5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-04 01:50:09 +08:00
wails/v3/pkg/application/window.go
Fabio Massaioli e7c134de4e
[v3] Late service registration and error handling overhaul (#4066)
* Add service registration method

* Fix error handling and formatting in messageprocessor

* Add configurable error handling

* Improve error strings

* Fix service shutdown on macOS

* Add post shutdown hook

* Better fatal errors

* Add startup/shutdown sequence tests

* Improve debug messages

* Update JS runtime

* Update docs

* Update changelog

* Fix log message in clipboard message processor

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Remove panic in RegisterService

* Fix linux tests (hopefully)

* Fix error formatting everywhere

* Fix typo in windows webview

* Tidy example mods

* Set application name in tests

* Fix ubuntu test workflow

* Cleanup template test pipeline

* Fix dev build detection on Go 1.24

* Update template go.mod/sum to Go 1.24

* Remove redundant caching in template tests

* Final format string cleanup

* Fix wails3 tool references

* Fix legacy log calls

* Remove formatJS and simplify format strings

* Fix indirect import

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-02-19 09:27:41 +01:00

88 lines
2.1 KiB
Go

package application
import (
"github.com/wailsapp/wails/v3/pkg/events"
)
type Callback interface {
CallError(callID string, result string, isJSON bool)
CallResponse(callID string, result string)
DialogError(dialogID string, result string)
DialogResponse(dialogID string, result string, isJSON bool)
}
type Window interface {
Callback
Center()
Close()
DisableSizeConstraints()
DispatchWailsEvent(event *CustomEvent)
EmitEvent(name string, data ...any)
EnableSizeConstraints()
Error(message string, args ...any)
ExecJS(js string)
Focus()
ForceReload()
Fullscreen() Window
GetBorderSizes() *LRTB
GetScreen() (*Screen, error)
GetZoom() float64
HandleDragAndDropMessage(filenames []string)
HandleMessage(message string)
HandleWindowEvent(id uint)
Height() int
Hide() Window
HideMenuBar()
ID() uint
Info(message string, args ...any)
IsFocused() bool
IsFullscreen() bool
IsIgnoreMouseEvents() bool
IsMaximised() bool
IsMinimised() bool
HandleKeyEvent(acceleratorString string)
Maximise() Window
Minimise() Window
Name() string
OnWindowEvent(eventType events.WindowEventType, callback func(event *WindowEvent)) func()
OpenContextMenu(data *ContextMenuData)
Position() (int, int)
RelativePosition() (int, int)
Reload()
Resizable() bool
Restore()
Run()
SetPosition(x, y int)
SetAlwaysOnTop(b bool) Window
SetBackgroundColour(colour RGBA) Window
SetFrameless(frameless bool) Window
SetHTML(html string) Window
SetMinimiseButtonState(state ButtonState) Window
SetMaximiseButtonState(state ButtonState) Window
SetCloseButtonState(state ButtonState) Window
SetMaxSize(maxWidth, maxHeight int) Window
SetMinSize(minWidth, minHeight int) Window
SetRelativePosition(x, y int) Window
SetResizable(b bool) Window
SetIgnoreMouseEvents(ignore bool) Window
SetSize(width, height int) Window
SetTitle(title string) Window
SetURL(s string) Window
SetZoom(magnification float64) Window
Show() Window
ShowMenuBar()
Size() (width int, height int)
OpenDevTools()
ToggleFullscreen()
ToggleMaximise()
ToggleMenuBar()
UnFullscreen()
UnMaximise()
UnMinimise()
Width() int
Zoom()
ZoomIn()
ZoomOut()
ZoomReset() Window
}