mirror of
https://github.com/wailsapp/wails.git
synced 2026-03-14 14:45:49 +01:00
Move runtime out to package
This commit is contained in:
parent
01a1288364
commit
9f9c9e27de
3 changed files with 36 additions and 33 deletions
29
runtime/runtime.go
Normal file
29
runtime/runtime.go
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
package runtime
|
||||
|
||||
import "github.com/wailsapp/wails/lib/interfaces"
|
||||
|
||||
// Runtime is the Wails Runtime Interface, given to a user who has defined the WailsInit method
|
||||
type Runtime struct {
|
||||
Events *Events
|
||||
Log *Log
|
||||
Dialog *Dialog
|
||||
Window *Window
|
||||
Browser *Browser
|
||||
FileSystem *FileSystem
|
||||
Store *StoreProvider
|
||||
}
|
||||
|
||||
// NewRuntime creates a new Runtime struct
|
||||
func NewRuntime(eventManager interfaces.EventManager, renderer interfaces.Renderer) *Runtime {
|
||||
result := &Runtime{
|
||||
Events: NewEvents(eventManager),
|
||||
Log: NewLog(),
|
||||
Dialog: NewDialog(renderer),
|
||||
Window: NewWindow(renderer),
|
||||
Browser: NewBrowser(),
|
||||
FileSystem: NewFileSystem(),
|
||||
}
|
||||
// We need a reference to itself
|
||||
result.Store = NewStoreProvider(result)
|
||||
return result
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue