mirror of
https://github.com/taigrr/wails.git
synced 2026-04-16 11:44:49 -07:00
Develop (#250)
This commit is contained in:
14
lib/interfaces/appconfig.go
Normal file
14
lib/interfaces/appconfig.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package interfaces
|
||||
|
||||
// AppConfig is the application config interface
|
||||
type AppConfig interface {
|
||||
GetWidth() int
|
||||
GetHeight() int
|
||||
GetTitle() string
|
||||
GetResizable() bool
|
||||
GetDefaultHTML() string
|
||||
GetDisableInspector() bool
|
||||
GetColour() string
|
||||
GetCSS() string
|
||||
GetJS() string
|
||||
}
|
||||
10
lib/interfaces/bindingmanager.go
Normal file
10
lib/interfaces/bindingmanager.go
Normal file
@@ -0,0 +1,10 @@
|
||||
package interfaces
|
||||
|
||||
import "github.com/wailsapp/wails/lib/messages"
|
||||
|
||||
// BindingManager is the binding manager interface
|
||||
type BindingManager interface {
|
||||
Bind(object interface{})
|
||||
Start(renderer Renderer, runtime Runtime) error
|
||||
ProcessCall(callData *messages.CallData) (result interface{}, err error)
|
||||
}
|
||||
11
lib/interfaces/eventmanager.go
Normal file
11
lib/interfaces/eventmanager.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package interfaces
|
||||
|
||||
import "github.com/wailsapp/wails/lib/messages"
|
||||
|
||||
// EventManager is the event manager interface
|
||||
type EventManager interface {
|
||||
PushEvent(*messages.EventData)
|
||||
Emit(eventName string, optionalData ...interface{})
|
||||
On(eventName string, callback func(...interface{}))
|
||||
Start(Renderer)
|
||||
}
|
||||
8
lib/interfaces/ipcmanager.go
Normal file
8
lib/interfaces/ipcmanager.go
Normal file
@@ -0,0 +1,8 @@
|
||||
package interfaces
|
||||
|
||||
// IPCManager is the event manager interface
|
||||
type IPCManager interface {
|
||||
BindRenderer(Renderer)
|
||||
Dispatch(message string)
|
||||
Start(eventManager EventManager, bindingManager BindingManager)
|
||||
}
|
||||
29
lib/interfaces/renderer.go
Normal file
29
lib/interfaces/renderer.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package interfaces
|
||||
|
||||
import (
|
||||
"github.com/wailsapp/wails/lib/messages"
|
||||
)
|
||||
// Renderer is an interface describing a Wails target to render the app to
|
||||
type Renderer interface {
|
||||
Initialise(AppConfig, IPCManager, EventManager) error
|
||||
Run() error
|
||||
|
||||
// Binding
|
||||
NewBinding(bindingName string) error
|
||||
Callback(data string) error
|
||||
|
||||
// Events
|
||||
NotifyEvent(eventData *messages.EventData) error
|
||||
|
||||
// Dialog Runtime
|
||||
SelectFile() string
|
||||
SelectDirectory() string
|
||||
SelectSaveFile() string
|
||||
|
||||
// Window Runtime
|
||||
SetColour(string) error
|
||||
Fullscreen()
|
||||
UnFullscreen()
|
||||
SetTitle(title string)
|
||||
Close()
|
||||
}
|
||||
4
lib/interfaces/runtime.go
Normal file
4
lib/interfaces/runtime.go
Normal file
@@ -0,0 +1,4 @@
|
||||
package interfaces
|
||||
|
||||
// Runtime interface
|
||||
type Runtime interface {}
|
||||
Reference in New Issue
Block a user