mirror of
https://github.com/wailsapp/wails.git
synced 2026-03-15 15:15:51 +01:00
* custom transport initial * transport codecs * runtime set transport * events transport * clauded example * bundled runtime * wip: transport * rework transports * rework dialog responses * cleanup * cleanup * improve error handling in HTTPTransport * cleanup * cleanup * cleanup * cleanup * review changes * review changes * review changes * review changes * review changes * review changes * review changes * move documentation to website docs * update doc * update changelog * introduce JSClient method for transport for embedding JS part in transport --------- Co-authored-by: Atterpac <Capretta.Michael@gmail.com> Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
35 lines
693 B
Go
35 lines
693 B
Go
package application
|
|
|
|
import (
|
|
"github.com/wailsapp/wails/v3/pkg/errs"
|
|
)
|
|
|
|
const (
|
|
ApplicationHide = 0
|
|
ApplicationShow = 1
|
|
ApplicationQuit = 2
|
|
)
|
|
|
|
var applicationMethodNames = map[int]string{
|
|
ApplicationQuit: "Quit",
|
|
ApplicationHide: "Hide",
|
|
ApplicationShow: "Show",
|
|
}
|
|
|
|
func (m *MessageProcessor) processApplicationMethod(
|
|
req *RuntimeRequest,
|
|
) (any, error) {
|
|
switch req.Method {
|
|
case ApplicationQuit:
|
|
globalApplication.Quit()
|
|
return unit, nil
|
|
case ApplicationHide:
|
|
globalApplication.Hide()
|
|
return unit, nil
|
|
case ApplicationShow:
|
|
globalApplication.Show()
|
|
return unit, nil
|
|
default:
|
|
return nil, errs.NewInvalidApplicationCallErrorf("unknown method %d", req.Method)
|
|
}
|
|
}
|