mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-02 23:39:21 +08:00
Merge branch 'feature/asset-server-runtime'
# Conflicts: # v3/V3 Changes.md # v3/examples/events/assets/index.html # v3/examples/events/main.go # v3/internal/runtime/desktop/main.js # v3/internal/runtime/package-lock.json # v3/internal/runtime/package.json # v3/internal/runtime/runtime_debug_desktop_darwin.js # v3/internal/runtime/runtime_debug_desktop_linux.js # v3/internal/runtime/runtime_debug_desktop_windows.js # v3/internal/runtime/runtime_production_desktop_darwin.js # v3/internal/runtime/runtime_production_desktop_linux.js # v3/internal/runtime/runtime_production_desktop_windows.js # v3/pkg/application/application.go # v3/pkg/application/messageprocessor.go # v3/pkg/application/messageprocessor_window.go # v3/pkg/application/options_webview_window.go # v3/pkg/application/webview_window.go # v3/pkg/application/webview_window_darwin.go # v3/pkg/options/application.go
This commit is contained in:
commit
b16b263820
@ -6,16 +6,19 @@ github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keL
|
|||||||
github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I=
|
github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I=
|
||||||
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||||
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||||
|
github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw=
|
||||||
github.com/google/renameio/v2 v2.0.0 h1:UifI23ZTGY8Tt29JbYFiuyIU3eX+RNFtUwefq9qAhxg=
|
github.com/google/renameio/v2 v2.0.0 h1:UifI23ZTGY8Tt29JbYFiuyIU3eX+RNFtUwefq9qAhxg=
|
||||||
github.com/jessevdk/go-flags v1.5.0 h1:1jKYvbxEjfUl0fmqTCOfonvskHHXMjBySTLW4y9LFvc=
|
github.com/jessevdk/go-flags v1.5.0 h1:1jKYvbxEjfUl0fmqTCOfonvskHHXMjBySTLW4y9LFvc=
|
||||||
github.com/klauspost/cpuid/v2 v2.2.0/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY=
|
github.com/klauspost/cpuid/v2 v2.2.0/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY=
|
||||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk=
|
github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk=
|
||||||
github.com/kr/fs v0.1.0 h1:Jskdu9ieNAYnjxsi0LbQp1ulIKZV1LAFgK1tWhpZgl8=
|
github.com/kr/fs v0.1.0 h1:Jskdu9ieNAYnjxsi0LbQp1ulIKZV1LAFgK1tWhpZgl8=
|
||||||
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||||
|
github.com/kr/pty v1.1.1 h1:VkoXIwSboBpnk99O/KFauAEILuNHv5DVFKZMBN/gUgw=
|
||||||
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e h1:aoZm08cpOy4WuID//EZDgcC4zIxODThtZNPirFr42+A=
|
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e h1:aoZm08cpOy4WuID//EZDgcC4zIxODThtZNPirFr42+A=
|
||||||
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
|
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
|
||||||
github.com/pkg/sftp v1.10.1 h1:VasscCm72135zRysgrJDKsntdmPN+OuU3+nnHYA9wyc=
|
github.com/pkg/sftp v1.10.1 h1:VasscCm72135zRysgrJDKsntdmPN+OuU3+nnHYA9wyc=
|
||||||
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
|
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
|
||||||
|
github.com/sirupsen/logrus v1.4.1 h1:GL2rEmy6nsikmW0r8opw9JIRScdMF5hA8cOYLH7In1k=
|
||||||
github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY=
|
github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY=
|
||||||
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
||||||
github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=
|
github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=
|
||||||
|
@ -7,13 +7,12 @@ import (
|
|||||||
"github.com/wailsapp/wails/v3/examples/binding/services"
|
"github.com/wailsapp/wails/v3/examples/binding/services"
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v3/pkg/application"
|
"github.com/wailsapp/wails/v3/pkg/application"
|
||||||
"github.com/wailsapp/wails/v3/pkg/options"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type localStruct struct{}
|
type localStruct struct{}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
app := application.New(options.Application{
|
app := application.New(application.Options{
|
||||||
Bind: []interface{}{
|
Bind: []interface{}{
|
||||||
&localStruct{},
|
&localStruct{},
|
||||||
&services.GreetService{},
|
&services.GreetService{},
|
||||||
|
@ -9,18 +9,16 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v3/pkg/options"
|
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v3/pkg/events"
|
"github.com/wailsapp/wails/v3/pkg/events"
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v3/pkg/application"
|
"github.com/wailsapp/wails/v3/pkg/application"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
app := application.New(options.Application{
|
app := application.New(application.Options{
|
||||||
Name: "WebviewWindow Demo",
|
Name: "WebviewWindow Demo",
|
||||||
Description: "A demo of the WebviewWindow API",
|
Description: "A demo of the WebviewWindow API",
|
||||||
Mac: options.Mac{
|
Mac: application.MacOptions{
|
||||||
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@ -67,45 +65,45 @@ func main() {
|
|||||||
windowCounter++
|
windowCounter++
|
||||||
})
|
})
|
||||||
if runtime.GOOS == "darwin" {
|
if runtime.GOOS == "darwin" {
|
||||||
myMenu.Add("New WebviewWindow (TitleBarHiddenInset)").
|
myMenu.Add("New WebviewWindow (MacTitleBarHiddenInset)").
|
||||||
OnClick(func(ctx *application.Context) {
|
OnClick(func(ctx *application.Context) {
|
||||||
app.NewWebviewWindowWithOptions(&options.WebviewWindow{
|
app.NewWebviewWindowWithOptions(&application.WebviewWindowOptions{
|
||||||
Mac: options.MacWindow{
|
Mac: application.MacWindow{
|
||||||
TitleBar: options.TitleBarHiddenInset,
|
TitleBar: application.MacTitleBarHiddenInset,
|
||||||
InvisibleTitleBarHeight: 25,
|
InvisibleTitleBarHeight: 25,
|
||||||
},
|
},
|
||||||
}).
|
}).
|
||||||
SetTitle("WebviewWindow "+strconv.Itoa(windowCounter)).
|
SetTitle("WebviewWindow "+strconv.Itoa(windowCounter)).
|
||||||
SetPosition(rand.Intn(1000), rand.Intn(800)).
|
SetPosition(rand.Intn(1000), rand.Intn(800)).
|
||||||
SetHTML("<br/><br/><p>A TitleBarHiddenInset WebviewWindow example</p>").
|
SetHTML("<br/><br/><p>A MacTitleBarHiddenInset WebviewWindow example</p>").
|
||||||
Show()
|
Show()
|
||||||
windowCounter++
|
windowCounter++
|
||||||
})
|
})
|
||||||
myMenu.Add("New WebviewWindow (TitleBarHiddenInsetUnified)").
|
myMenu.Add("New WebviewWindow (MacTitleBarHiddenInsetUnified)").
|
||||||
OnClick(func(ctx *application.Context) {
|
OnClick(func(ctx *application.Context) {
|
||||||
app.NewWebviewWindowWithOptions(&options.WebviewWindow{
|
app.NewWebviewWindowWithOptions(&application.WebviewWindowOptions{
|
||||||
Mac: options.MacWindow{
|
Mac: application.MacWindow{
|
||||||
TitleBar: options.TitleBarHiddenInsetUnified,
|
TitleBar: application.MacTitleBarHiddenInsetUnified,
|
||||||
InvisibleTitleBarHeight: 50,
|
InvisibleTitleBarHeight: 50,
|
||||||
},
|
},
|
||||||
}).
|
}).
|
||||||
SetTitle("WebviewWindow "+strconv.Itoa(windowCounter)).
|
SetTitle("WebviewWindow "+strconv.Itoa(windowCounter)).
|
||||||
SetPosition(rand.Intn(1000), rand.Intn(800)).
|
SetPosition(rand.Intn(1000), rand.Intn(800)).
|
||||||
SetHTML("<br/><br/><p>A TitleBarHiddenInsetUnified WebviewWindow example</p>").
|
SetHTML("<br/><br/><p>A MacTitleBarHiddenInsetUnified WebviewWindow example</p>").
|
||||||
Show()
|
Show()
|
||||||
windowCounter++
|
windowCounter++
|
||||||
})
|
})
|
||||||
myMenu.Add("New WebviewWindow (TitleBarHidden)").
|
myMenu.Add("New WebviewWindow (MacTitleBarHidden)").
|
||||||
OnClick(func(ctx *application.Context) {
|
OnClick(func(ctx *application.Context) {
|
||||||
app.NewWebviewWindowWithOptions(&options.WebviewWindow{
|
app.NewWebviewWindowWithOptions(&application.WebviewWindowOptions{
|
||||||
Mac: options.MacWindow{
|
Mac: application.MacWindow{
|
||||||
TitleBar: options.TitleBarHidden,
|
TitleBar: application.MacTitleBarHidden,
|
||||||
InvisibleTitleBarHeight: 25,
|
InvisibleTitleBarHeight: 25,
|
||||||
},
|
},
|
||||||
}).
|
}).
|
||||||
SetTitle("WebviewWindow "+strconv.Itoa(windowCounter)).
|
SetTitle("WebviewWindow "+strconv.Itoa(windowCounter)).
|
||||||
SetPosition(rand.Intn(1000), rand.Intn(800)).
|
SetPosition(rand.Intn(1000), rand.Intn(800)).
|
||||||
SetHTML("<br/><br/><p>A TitleBarHidden WebviewWindow example</p>").
|
SetHTML("<br/><br/><p>A MacTitleBarHidden WebviewWindow example</p>").
|
||||||
Show()
|
Show()
|
||||||
windowCounter++
|
windowCounter++
|
||||||
})
|
})
|
||||||
|
@ -5,17 +5,15 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v3/pkg/options"
|
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v3/pkg/application"
|
"github.com/wailsapp/wails/v3/pkg/application"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
||||||
app := application.New(options.Application{
|
app := application.New(application.Options{
|
||||||
Name: "Clipboard Demo",
|
Name: "Clipboard Demo",
|
||||||
Description: "A demo of the clipboard API",
|
Description: "A demo of the clipboard API",
|
||||||
Mac: options.Mac{
|
Mac: application.MacOptions{
|
||||||
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
30
v3/examples/contextmenus/assets/index.html
Normal file
30
v3/examples/contextmenus/assets/index.html
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Title</title>
|
||||||
|
<style>body{ text-align: center; color: white; background-color: rgba(0,0,0,0); user-select: none; -ms-user-select: none; -webkit-user-select: none; }</style>
|
||||||
|
<style>.file{ width: 100px; height: 100px; border: 3px solid black; }</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Events Demo</h1>
|
||||||
|
<br/>
|
||||||
|
<div class="file" id="123abc" data-contextmenu="test" data-contextmenu-data="1" draggable="true" ondragstart="dragstart()" ondragend="dragend()">
|
||||||
|
<h1>1</h1>
|
||||||
|
</div>
|
||||||
|
<div class="file" id="234abc" data-contextmenu="test" data-contextmenu-data="2" draggable="true" ondragstart="dragstart()" ondragend="dragend()">
|
||||||
|
<h1>2</h1>
|
||||||
|
</div>
|
||||||
|
<div class="file" id="345abc" data-contextmenu="test" data-contextmenu-data="3" draggable="true" ondragstart="dragstart()" ondragend="dragend()">
|
||||||
|
<h1>3</h1>
|
||||||
|
</div>
|
||||||
|
<div id="results"></div>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// window.addEventListener("dragstart", (event) =>
|
||||||
|
// event.dataTransfer.setData("text/plain", "This text may be dragged")
|
||||||
|
// );
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</html>
|
70
v3/examples/contextmenus/main.go
Normal file
70
v3/examples/contextmenus/main.go
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"embed"
|
||||||
|
_ "embed"
|
||||||
|
"fmt"
|
||||||
|
"log"
|
||||||
|
|
||||||
|
"github.com/wailsapp/wails/v3/pkg/application"
|
||||||
|
)
|
||||||
|
|
||||||
|
//go:embed assets
|
||||||
|
var assets embed.FS
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
|
||||||
|
app := application.New(application.Options{
|
||||||
|
Name: "Context Menu Demo",
|
||||||
|
Description: "A demo of the Context Menu API",
|
||||||
|
Mac: application.MacOptions{
|
||||||
|
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
mainWindow := app.NewWebviewWindowWithOptions(&application.WebviewWindowOptions{
|
||||||
|
Title: "Context Menu Demo",
|
||||||
|
Assets: application.AssetOptions{
|
||||||
|
FS: assets,
|
||||||
|
},
|
||||||
|
Mac: application.MacWindow{
|
||||||
|
Backdrop: application.MacBackdropTranslucent,
|
||||||
|
TitleBar: application.MacTitleBarHiddenInsetUnified,
|
||||||
|
InvisibleTitleBarHeight: 50,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
app.NewWebviewWindowWithOptions(&application.WebviewWindowOptions{
|
||||||
|
Title: "Context Menu Demo",
|
||||||
|
Assets: application.AssetOptions{
|
||||||
|
FS: assets,
|
||||||
|
},
|
||||||
|
Mac: application.MacWindow{
|
||||||
|
Backdrop: application.MacBackdropTranslucent,
|
||||||
|
TitleBar: application.MacTitleBarHiddenInsetUnified,
|
||||||
|
InvisibleTitleBarHeight: 50,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
contextMenu := app.NewMenu()
|
||||||
|
contextMenu.Add("Click Me").OnClick(func(data *application.Context) {
|
||||||
|
fmt.Printf("Context menu data: %+v\n", data.ContextMenuData())
|
||||||
|
})
|
||||||
|
|
||||||
|
globalContextMenu := app.NewMenu()
|
||||||
|
globalContextMenu.Add("Default context menu item").OnClick(func(data *application.Context) {
|
||||||
|
fmt.Printf("Context menu data: %+v\n", data.ContextMenuData())
|
||||||
|
})
|
||||||
|
|
||||||
|
// Registering the menu with a window will make it available to that window only
|
||||||
|
mainWindow.RegisterContextMenu("test", contextMenu)
|
||||||
|
|
||||||
|
// Registering the menu with the app will make it available to all windows
|
||||||
|
app.RegisterContextMenu("test", globalContextMenu)
|
||||||
|
|
||||||
|
err := app.Run()
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err.Error())
|
||||||
|
}
|
||||||
|
}
|
@ -7,17 +7,15 @@ import (
|
|||||||
"runtime"
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v3/pkg/options"
|
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v3/pkg/application"
|
"github.com/wailsapp/wails/v3/pkg/application"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
||||||
app := application.New(options.Application{
|
app := application.New(application.Options{
|
||||||
Name: "Dialogs Demo",
|
Name: "Dialogs Demo",
|
||||||
Description: "A demo of the dialogs API",
|
Description: "A demo of the dialogs API",
|
||||||
Mac: options.Mac{
|
Mac: application.MacOptions{
|
||||||
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
25
v3/examples/drag-n-drop/assets/index.html
Normal file
25
v3/examples/drag-n-drop/assets/index.html
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Title</title>
|
||||||
|
<style>body{ text-align: center; color: white; background-color: rgba(0,0,0,0); user-select: none; -ms-user-select: none; -webkit-user-select: none; }</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Drag-n-drop Demo</h1>
|
||||||
|
<br/>
|
||||||
|
Drop Files onto this window...
|
||||||
|
<div id="results"></div>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
wails.Events.On("files", function(event) {
|
||||||
|
let resultsHTML = "";
|
||||||
|
event.data.forEach(function(file) {
|
||||||
|
resultsHTML += "<br/>" + file;
|
||||||
|
});
|
||||||
|
document.getElementById("results").innerHTML = resultsHTML;
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</html>
|
51
v3/examples/drag-n-drop/main.go
Normal file
51
v3/examples/drag-n-drop/main.go
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"embed"
|
||||||
|
_ "embed"
|
||||||
|
"log"
|
||||||
|
|
||||||
|
"github.com/wailsapp/wails/v3/pkg/application"
|
||||||
|
"github.com/wailsapp/wails/v3/pkg/events"
|
||||||
|
)
|
||||||
|
|
||||||
|
//go:embed assets
|
||||||
|
var assets embed.FS
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
|
||||||
|
app := application.New(application.Options{
|
||||||
|
Name: "Drag-n-drop Demo",
|
||||||
|
Description: "A demo of the Drag-n-drop API",
|
||||||
|
Mac: application.MacOptions{
|
||||||
|
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
window := app.NewWebviewWindowWithOptions(&application.WebviewWindowOptions{
|
||||||
|
Title: "Drag-n-drop Demo",
|
||||||
|
Assets: application.AssetOptions{
|
||||||
|
FS: assets,
|
||||||
|
},
|
||||||
|
Mac: application.MacWindow{
|
||||||
|
Backdrop: application.MacBackdropTranslucent,
|
||||||
|
TitleBar: application.MacTitleBarHiddenInsetUnified,
|
||||||
|
InvisibleTitleBarHeight: 50,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
window.On(events.FilesDropped, func(ctx *application.WindowEventContext) {
|
||||||
|
files := ctx.DroppedFiles()
|
||||||
|
app.Events.Emit(&application.CustomEvent{
|
||||||
|
Name: "files",
|
||||||
|
Data: files,
|
||||||
|
})
|
||||||
|
log.Printf("[Go] FilesDropped received: %+v\n", files)
|
||||||
|
})
|
||||||
|
|
||||||
|
err := app.Run()
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err.Error())
|
||||||
|
}
|
||||||
|
}
|
@ -8,14 +8,13 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v3/pkg/application"
|
"github.com/wailsapp/wails/v3/pkg/application"
|
||||||
"github.com/wailsapp/wails/v3/pkg/options"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
app := application.New(options.Application{
|
app := application.New(application.Options{
|
||||||
Name: "Menu Demo",
|
Name: "Menu Demo",
|
||||||
Description: "A demo of the menu system",
|
Description: "A demo of the menu system",
|
||||||
Mac: options.Mac{
|
Mac: application.MacOptions{
|
||||||
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@ -110,22 +109,22 @@ func main() {
|
|||||||
mySystray.SetMenu(myMenu)
|
mySystray.SetMenu(myMenu)
|
||||||
mySystray.SetIconPosition(application.NSImageLeading)
|
mySystray.SetIconPosition(application.NSImageLeading)
|
||||||
|
|
||||||
myWindow := app.NewWebviewWindowWithOptions(&options.WebviewWindow{
|
myWindow := app.NewWebviewWindowWithOptions(&application.WebviewWindowOptions{
|
||||||
Title: "Kitchen Sink",
|
Title: "Kitchen Sink",
|
||||||
Width: 600,
|
Width: 600,
|
||||||
Height: 400,
|
Height: 400,
|
||||||
AlwaysOnTop: true,
|
AlwaysOnTop: true,
|
||||||
DisableResize: false,
|
DisableResize: false,
|
||||||
BackgroundColour: &options.RGBA{
|
BackgroundColour: &application.RGBA{
|
||||||
Red: 255,
|
Red: 255,
|
||||||
Green: 255,
|
Green: 255,
|
||||||
Blue: 255,
|
Blue: 255,
|
||||||
Alpha: 30,
|
Alpha: 30,
|
||||||
},
|
},
|
||||||
StartState: options.WindowStateMaximised,
|
StartState: application.WindowStateMaximised,
|
||||||
Mac: options.MacWindow{
|
Mac: application.MacWindow{
|
||||||
Backdrop: options.MacBackdropTranslucent,
|
Backdrop: application.MacBackdropTranslucent,
|
||||||
Appearance: options.NSAppearanceNameDarkAqua,
|
Appearance: application.NSAppearanceNameDarkAqua,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
/*
|
/*
|
||||||
@ -185,14 +184,14 @@ func main() {
|
|||||||
*/
|
*/
|
||||||
var myWindow2 *application.WebviewWindow
|
var myWindow2 *application.WebviewWindow
|
||||||
var myWindow2Lock sync.RWMutex
|
var myWindow2Lock sync.RWMutex
|
||||||
myWindow2 = app.NewWebviewWindowWithOptions(&options.WebviewWindow{
|
myWindow2 = app.NewWebviewWindowWithOptions(&application.WebviewWindowOptions{
|
||||||
Title: "#2",
|
Title: "#2",
|
||||||
Width: 1024,
|
Width: 1024,
|
||||||
Height: 768,
|
Height: 768,
|
||||||
AlwaysOnTop: false,
|
AlwaysOnTop: false,
|
||||||
URL: "https://google.com",
|
URL: "https://google.com",
|
||||||
Mac: options.MacWindow{
|
Mac: application.MacWindow{
|
||||||
Backdrop: options.MacBackdropTranslucent,
|
Backdrop: application.MacBackdropTranslucent,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
//myWindow2.On(events.Mac.WindowDidMove, func() {
|
//myWindow2.On(events.Mac.WindowDidMove, func() {
|
||||||
|
@ -4,17 +4,15 @@ import (
|
|||||||
_ "embed"
|
_ "embed"
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v3/pkg/options"
|
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v3/pkg/application"
|
"github.com/wailsapp/wails/v3/pkg/application"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
||||||
app := application.New(options.Application{
|
app := application.New(application.Options{
|
||||||
Name: "Menu Demo",
|
Name: "Menu Demo",
|
||||||
Description: "A demo of the menu system",
|
Description: "A demo of the menu system",
|
||||||
Mac: options.Mac{
|
Mac: application.MacOptions{
|
||||||
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
@ -5,31 +5,29 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v3/pkg/options"
|
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v3/pkg/application"
|
"github.com/wailsapp/wails/v3/pkg/application"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
app := application.New(options.Application{
|
app := application.New(application.Options{
|
||||||
Name: "Plain",
|
Name: "Plain",
|
||||||
Description: "A demo of using raw HTML & CSS",
|
Description: "A demo of using raw HTML & CSS",
|
||||||
Mac: options.Mac{
|
Mac: application.MacOptions{
|
||||||
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
// Create window
|
// Create window
|
||||||
app.NewWebviewWindowWithOptions(&options.WebviewWindow{
|
app.NewWebviewWindowWithOptions(&application.WebviewWindowOptions{
|
||||||
Title: "Plain Bundle",
|
Title: "Plain Bundle",
|
||||||
CSS: `body { background-color: rgba(255, 255, 255, 0); } .main { color: white; margin: 20%; }`,
|
CSS: `body { background-color: rgba(255, 255, 255, 0); } .main { color: white; margin: 20%; }`,
|
||||||
Mac: options.MacWindow{
|
Mac: application.MacWindow{
|
||||||
InvisibleTitleBarHeight: 50,
|
InvisibleTitleBarHeight: 50,
|
||||||
Backdrop: options.MacBackdropTranslucent,
|
Backdrop: application.MacBackdropTranslucent,
|
||||||
TitleBar: options.TitleBarHiddenInset,
|
TitleBar: application.MacTitleBarHiddenInset,
|
||||||
},
|
},
|
||||||
|
|
||||||
URL: "/",
|
URL: "/",
|
||||||
Assets: options.Assets{
|
Assets: application.AssetOptions{
|
||||||
Handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
Handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||||
w.WriteHeader(http.StatusOK)
|
w.WriteHeader(http.StatusOK)
|
||||||
w.Write([]byte(`<html><head><title>Plain Bundle</title></head><body><div class="main"><h1>Plain Bundle</h1><p>This is a plain bundle. It has no frontend code but this was Served by the AssetServer's Handler</p></div></body></html>`))
|
w.Write([]byte(`<html><head><title>Plain Bundle</title></head><body><div class="main"><h1>Plain Bundle</h1><p>This is a plain bundle. It has no frontend code but this was Served by the AssetServer's Handler</p></div></body></html>`))
|
||||||
|
@ -5,17 +5,15 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v3/pkg/options"
|
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v3/pkg/application"
|
"github.com/wailsapp/wails/v3/pkg/application"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
app := application.New(options.Application{
|
app := application.New(application.Options{
|
||||||
Name: "Systray Demo",
|
Name: "Systray Demo",
|
||||||
Description: "A demo of the Systray API",
|
Description: "A demo of the Systray API",
|
||||||
Mac: options.Mac{
|
Mac: application.MacOptions{
|
||||||
ActivationPolicy: options.ActivationPolicyAccessory,
|
ActivationPolicy: application.ActivationPolicyAccessory,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -9,18 +9,16 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v3/pkg/options"
|
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v3/pkg/events"
|
"github.com/wailsapp/wails/v3/pkg/events"
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v3/pkg/application"
|
"github.com/wailsapp/wails/v3/pkg/application"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
app := application.New(options.Application{
|
app := application.New(application.Options{
|
||||||
Name: "WebviewWindow Demo",
|
Name: "WebviewWindow Demo",
|
||||||
Description: "A demo of the WebviewWindow API",
|
Description: "A demo of the WebviewWindow API",
|
||||||
Mac: options.Mac{
|
Mac: application.MacOptions{
|
||||||
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@ -58,56 +56,56 @@ func main() {
|
|||||||
myMenu.Add("New Frameless WebviewWindow").
|
myMenu.Add("New Frameless WebviewWindow").
|
||||||
SetAccelerator("CmdOrCtrl+F").
|
SetAccelerator("CmdOrCtrl+F").
|
||||||
OnClick(func(ctx *application.Context) {
|
OnClick(func(ctx *application.Context) {
|
||||||
app.NewWebviewWindowWithOptions(&options.WebviewWindow{
|
app.NewWebviewWindowWithOptions(&application.WebviewWindowOptions{
|
||||||
X: rand.Intn(1000),
|
X: rand.Intn(1000),
|
||||||
Y: rand.Intn(800),
|
Y: rand.Intn(800),
|
||||||
Frameless: true,
|
Frameless: true,
|
||||||
Mac: options.MacWindow{
|
Mac: application.MacWindow{
|
||||||
InvisibleTitleBarHeight: 50,
|
InvisibleTitleBarHeight: 50,
|
||||||
},
|
},
|
||||||
}).Show()
|
}).Show()
|
||||||
windowCounter++
|
windowCounter++
|
||||||
})
|
})
|
||||||
if runtime.GOOS == "darwin" {
|
if runtime.GOOS == "darwin" {
|
||||||
myMenu.Add("New WebviewWindow (TitleBarHiddenInset)").
|
myMenu.Add("New WebviewWindow (MacTitleBarHiddenInset)").
|
||||||
OnClick(func(ctx *application.Context) {
|
OnClick(func(ctx *application.Context) {
|
||||||
app.NewWebviewWindowWithOptions(&options.WebviewWindow{
|
app.NewWebviewWindowWithOptions(&application.WebviewWindowOptions{
|
||||||
Mac: options.MacWindow{
|
Mac: application.MacWindow{
|
||||||
TitleBar: options.TitleBarHiddenInset,
|
TitleBar: application.MacTitleBarHiddenInset,
|
||||||
InvisibleTitleBarHeight: 25,
|
InvisibleTitleBarHeight: 25,
|
||||||
},
|
},
|
||||||
}).
|
}).
|
||||||
SetTitle("WebviewWindow "+strconv.Itoa(windowCounter)).
|
SetTitle("WebviewWindow "+strconv.Itoa(windowCounter)).
|
||||||
SetPosition(rand.Intn(1000), rand.Intn(800)).
|
SetPosition(rand.Intn(1000), rand.Intn(800)).
|
||||||
SetHTML("<br/><br/><p>A TitleBarHiddenInset WebviewWindow example</p>").
|
SetHTML("<br/><br/><p>A MacTitleBarHiddenInset WebviewWindow example</p>").
|
||||||
Show()
|
Show()
|
||||||
windowCounter++
|
windowCounter++
|
||||||
})
|
})
|
||||||
myMenu.Add("New WebviewWindow (TitleBarHiddenInsetUnified)").
|
myMenu.Add("New WebviewWindow (MacTitleBarHiddenInsetUnified)").
|
||||||
OnClick(func(ctx *application.Context) {
|
OnClick(func(ctx *application.Context) {
|
||||||
app.NewWebviewWindowWithOptions(&options.WebviewWindow{
|
app.NewWebviewWindowWithOptions(&application.WebviewWindowOptions{
|
||||||
Mac: options.MacWindow{
|
Mac: application.MacWindow{
|
||||||
TitleBar: options.TitleBarHiddenInsetUnified,
|
TitleBar: application.MacTitleBarHiddenInsetUnified,
|
||||||
InvisibleTitleBarHeight: 50,
|
InvisibleTitleBarHeight: 50,
|
||||||
},
|
},
|
||||||
}).
|
}).
|
||||||
SetTitle("WebviewWindow "+strconv.Itoa(windowCounter)).
|
SetTitle("WebviewWindow "+strconv.Itoa(windowCounter)).
|
||||||
SetPosition(rand.Intn(1000), rand.Intn(800)).
|
SetPosition(rand.Intn(1000), rand.Intn(800)).
|
||||||
SetHTML("<br/><br/><p>A TitleBarHiddenInsetUnified WebviewWindow example</p>").
|
SetHTML("<br/><br/><p>A MacTitleBarHiddenInsetUnified WebviewWindow example</p>").
|
||||||
Show()
|
Show()
|
||||||
windowCounter++
|
windowCounter++
|
||||||
})
|
})
|
||||||
myMenu.Add("New WebviewWindow (TitleBarHidden)").
|
myMenu.Add("New WebviewWindow (MacTitleBarHidden)").
|
||||||
OnClick(func(ctx *application.Context) {
|
OnClick(func(ctx *application.Context) {
|
||||||
app.NewWebviewWindowWithOptions(&options.WebviewWindow{
|
app.NewWebviewWindowWithOptions(&application.WebviewWindowOptions{
|
||||||
Mac: options.MacWindow{
|
Mac: application.MacWindow{
|
||||||
TitleBar: options.TitleBarHidden,
|
TitleBar: application.MacTitleBarHidden,
|
||||||
InvisibleTitleBarHeight: 25,
|
InvisibleTitleBarHeight: 25,
|
||||||
},
|
},
|
||||||
}).
|
}).
|
||||||
SetTitle("WebviewWindow "+strconv.Itoa(windowCounter)).
|
SetTitle("WebviewWindow "+strconv.Itoa(windowCounter)).
|
||||||
SetPosition(rand.Intn(1000), rand.Intn(800)).
|
SetPosition(rand.Intn(1000), rand.Intn(800)).
|
||||||
SetHTML("<br/><br/><p>A TitleBarHidden WebviewWindow example</p>").
|
SetHTML("<br/><br/><p>A MacTitleBarHidden WebviewWindow example</p>").
|
||||||
Show()
|
Show()
|
||||||
windowCounter++
|
windowCounter++
|
||||||
})
|
})
|
||||||
|
@ -7,8 +7,6 @@ import (
|
|||||||
"math/rand"
|
"math/rand"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v3/pkg/options"
|
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v3/pkg/application"
|
"github.com/wailsapp/wails/v3/pkg/application"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -16,11 +14,11 @@ import (
|
|||||||
var assets embed.FS
|
var assets embed.FS
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
app := application.New(options.Application{
|
app := application.New(application.Options{
|
||||||
Name: "WebviewWindow Javascript Demo",
|
Name: "WebviewWindow Javascript Demo",
|
||||||
Description: "A demo of the WebviewWindow API from Javascript",
|
Description: "A demo of the WebviewWindow API from Javascript",
|
||||||
Icon: nil,
|
Icon: nil,
|
||||||
Mac: options.Mac{
|
Mac: application.MacOptions{
|
||||||
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@ -32,8 +30,8 @@ func main() {
|
|||||||
windowCounter := 1
|
windowCounter := 1
|
||||||
|
|
||||||
newWindow := func() {
|
newWindow := func() {
|
||||||
app.NewWebviewWindowWithOptions(&options.WebviewWindow{
|
app.NewWebviewWindowWithOptions(&application.WebviewWindowOptions{
|
||||||
Assets: options.Assets{
|
Assets: application.AssetOptions{
|
||||||
FS: assets,
|
FS: assets,
|
||||||
},
|
},
|
||||||
}).
|
}).
|
||||||
|
@ -115,7 +115,7 @@ func findApplicationNewCalls(context *Context) {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check struct literal is of type "options.Application"
|
// Check struct literal is of type "application.Options"
|
||||||
selectorExpr, ok := structLit.Type.(*ast.SelectorExpr)
|
selectorExpr, ok := structLit.Type.(*ast.SelectorExpr)
|
||||||
if !ok {
|
if !ok {
|
||||||
return true
|
return true
|
||||||
|
@ -5,7 +5,6 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v3/pkg/application"
|
"github.com/wailsapp/wails/v3/pkg/application"
|
||||||
"github.com/wailsapp/wails/v3/pkg/options"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type GreetService struct {
|
type GreetService struct {
|
||||||
@ -22,7 +21,7 @@ type OtherService struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
app := application.New(options.Application{
|
app := application.New(application.Options{
|
||||||
Bind: []interface{}{
|
Bind: []interface{}{
|
||||||
&GreetService{},
|
&GreetService{},
|
||||||
&OtherService{},
|
&OtherService{},
|
||||||
|
@ -5,11 +5,10 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v3/pkg/application"
|
"github.com/wailsapp/wails/v3/pkg/application"
|
||||||
"github.com/wailsapp/wails/v3/pkg/options"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
app := application.New(options.Application{
|
app := application.New(application.Options{
|
||||||
Bind: []interface{}{
|
Bind: []interface{}{
|
||||||
&GreetService{},
|
&GreetService{},
|
||||||
&OtherService{},
|
&OtherService{},
|
||||||
|
@ -5,7 +5,6 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v3/pkg/application"
|
"github.com/wailsapp/wails/v3/pkg/application"
|
||||||
"github.com/wailsapp/wails/v3/pkg/options"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type GreetService struct {
|
type GreetService struct {
|
||||||
@ -18,7 +17,7 @@ func (*GreetService) Greet(name string) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
app := application.New(options.Application{
|
app := application.New(application.Options{
|
||||||
Bind: []interface{}{
|
Bind: []interface{}{
|
||||||
&GreetService{},
|
&GreetService{},
|
||||||
},
|
},
|
||||||
|
32
v3/internal/runtime/desktop/contextmenu.js
Normal file
32
v3/internal/runtime/desktop/contextmenu.js
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
import {newRuntimeCaller} from "./runtime";
|
||||||
|
|
||||||
|
let call = newRuntimeCaller("contextmenu");
|
||||||
|
|
||||||
|
function openContextMenu(id, x, y, data) {
|
||||||
|
return call("OpenContextMenu", {id, x, y, data});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function enableContextMenus(enabled) {
|
||||||
|
if (enabled) {
|
||||||
|
window.addEventListener('contextmenu', contextMenuHandler);
|
||||||
|
} else {
|
||||||
|
window.removeEventListener('contextmenu', contextMenuHandler);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function contextMenuHandler(event) {
|
||||||
|
processContextMenu(event.target, event);
|
||||||
|
}
|
||||||
|
|
||||||
|
function processContextMenu(element, event) {
|
||||||
|
let id = element.getAttribute('data-contextmenu');
|
||||||
|
if (id) {
|
||||||
|
event.preventDefault();
|
||||||
|
openContextMenu(id, event.clientX, event.clientY, element.getAttribute('data-contextmenu-data'));
|
||||||
|
} else {
|
||||||
|
let parent = element.parentElement;
|
||||||
|
if (parent) {
|
||||||
|
processContextMenu(parent, event);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -5,8 +5,6 @@ import (
|
|||||||
_ "embed"
|
_ "embed"
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v3/pkg/options"
|
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v3/pkg/application"
|
"github.com/wailsapp/wails/v3/pkg/application"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -14,25 +12,25 @@ import (
|
|||||||
var assets embed.FS
|
var assets embed.FS
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
app := application.New(options.Application{
|
app := application.New(application.Options{
|
||||||
Name: "{{.ProjectName}}",
|
Name: "{{.ProjectName}}",
|
||||||
Description: "A demo of using raw HTML & CSS",
|
Description: "A demo of using raw HTML & CSS",
|
||||||
Mac: options.Mac{
|
Mac: application.MacOptions{
|
||||||
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
// Create window
|
// Create window
|
||||||
app.NewWebviewWindowWithOptions(&options.WebviewWindow{
|
app.NewWebviewWindowWithOptions(&application.WebviewWindowOptions{
|
||||||
Title: "Plain Bundle",
|
Title: "Plain Bundle",
|
||||||
CSS: `body { background-color: rgba(255, 255, 255, 0); } .main { color: white; margin: 20%; }`,
|
CSS: `body { background-color: rgba(255, 255, 255, 0); } .main { color: white; margin: 20%; }`,
|
||||||
Mac: options.MacWindow{
|
Mac: application.MacWindow{
|
||||||
InvisibleTitleBarHeight: 50,
|
InvisibleTitleBarHeight: 50,
|
||||||
Backdrop: options.MacBackdropTranslucent,
|
Backdrop: application.MacBackdropTranslucent,
|
||||||
TitleBar: options.TitleBarHiddenInset,
|
TitleBar: application.MacTitleBarHiddenInset,
|
||||||
},
|
},
|
||||||
|
|
||||||
URL: "/",
|
URL: "/",
|
||||||
Assets: options.Assets{
|
Assets: application.AssetOptions{
|
||||||
FS: assets,
|
FS: assets,
|
||||||
},
|
},
|
||||||
})
|
})
|
@ -5,8 +5,6 @@ import (
|
|||||||
_ "embed"
|
_ "embed"
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v3/pkg/options"
|
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v3/pkg/application"
|
"github.com/wailsapp/wails/v3/pkg/application"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -14,25 +12,25 @@ import (
|
|||||||
var assets embed.FS
|
var assets embed.FS
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
app := application.New(options.Application{
|
app := application.New(application.Options{
|
||||||
Name: "{{.ProjectName}}",
|
Name: "{{.ProjectName}}",
|
||||||
Description: "A demo of using raw HTML & CSS",
|
Description: "A demo of using raw HTML & CSS",
|
||||||
Mac: options.Mac{
|
Mac: application.MacOptions{
|
||||||
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
// Create window
|
// Create window
|
||||||
app.NewWebviewWindowWithOptions(&options.WebviewWindow{
|
app.NewWebviewWindowWithOptions(&application.WebviewWindowOptions{
|
||||||
Title: "Plain Bundle",
|
Title: "Plain Bundle",
|
||||||
CSS: `body { background-color: rgba(255, 255, 255, 0); } .main { color: white; margin: 20%; }`,
|
CSS: `body { background-color: rgba(255, 255, 255, 0); } .main { color: white; margin: 20%; }`,
|
||||||
Mac: options.MacWindow{
|
Mac: application.MacWindow{
|
||||||
InvisibleTitleBarHeight: 50,
|
InvisibleTitleBarHeight: 50,
|
||||||
Backdrop: options.MacBackdropTranslucent,
|
Backdrop: application.MacBackdropTranslucent,
|
||||||
TitleBar: options.TitleBarHiddenInset,
|
TitleBar: application.MacTitleBarHiddenInset,
|
||||||
},
|
},
|
||||||
|
|
||||||
URL: "/",
|
URL: "/",
|
||||||
Assets: options.Assets{
|
Assets: application.AssetOptions{
|
||||||
FS: assets,
|
FS: assets,
|
||||||
},
|
},
|
||||||
})
|
})
|
@ -5,8 +5,6 @@ import (
|
|||||||
_ "embed"
|
_ "embed"
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v3/pkg/options"
|
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v3/pkg/application"
|
"github.com/wailsapp/wails/v3/pkg/application"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -14,25 +12,25 @@ import (
|
|||||||
var assets embed.FS
|
var assets embed.FS
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
app := application.New(options.Application{
|
app := application.New(application.Options{
|
||||||
Name: "{{.ProjectName}}",
|
Name: "{{.ProjectName}}",
|
||||||
Description: "A demo of using raw HTML & CSS",
|
Description: "A demo of using raw HTML & CSS",
|
||||||
Mac: options.Mac{
|
Mac: application.MacOptions{
|
||||||
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
// Create window
|
// Create window
|
||||||
app.NewWebviewWindowWithOptions(&options.WebviewWindow{
|
app.NewWebviewWindowWithOptions(&application.WebviewWindowOptions{
|
||||||
Title: "Plain Bundle",
|
Title: "Plain Bundle",
|
||||||
CSS: `body { background-color: rgba(255, 255, 255, 0); } .main { color: white; margin: 20%; }`,
|
CSS: `body { background-color: rgba(255, 255, 255, 0); } .main { color: white; margin: 20%; }`,
|
||||||
Mac: options.MacWindow{
|
Mac: application.MacWindow{
|
||||||
InvisibleTitleBarHeight: 50,
|
InvisibleTitleBarHeight: 50,
|
||||||
Backdrop: options.MacBackdropTranslucent,
|
Backdrop: application.MacBackdropTranslucent,
|
||||||
TitleBar: options.TitleBarHiddenInset,
|
TitleBar: application.MacTitleBarHiddenInset,
|
||||||
},
|
},
|
||||||
|
|
||||||
URL: "/",
|
URL: "/",
|
||||||
Assets: options.Assets{
|
Assets: application.AssetOptions{
|
||||||
FS: assets,
|
FS: assets,
|
||||||
},
|
},
|
||||||
})
|
})
|
@ -5,8 +5,6 @@ import (
|
|||||||
_ "embed"
|
_ "embed"
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v3/pkg/options"
|
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v3/pkg/application"
|
"github.com/wailsapp/wails/v3/pkg/application"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -14,25 +12,25 @@ import (
|
|||||||
var assets embed.FS
|
var assets embed.FS
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
app := application.New(options.Application{
|
app := application.New(application.Options{
|
||||||
Name: "{{.ProjectName}}",
|
Name: "{{.ProjectName}}",
|
||||||
Description: "A demo of using raw HTML & CSS",
|
Description: "A demo of using raw HTML & CSS",
|
||||||
Mac: options.Mac{
|
Mac: application.MacOptions{
|
||||||
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
// Create window
|
// Create window
|
||||||
app.NewWebviewWindowWithOptions(&options.WebviewWindow{
|
app.NewWebviewWindowWithOptions(&application.WebviewWindowOptions{
|
||||||
Title: "Plain Bundle",
|
Title: "Plain Bundle",
|
||||||
CSS: `body { background-color: rgba(255, 255, 255, 0); } .main { color: white; margin: 20%; }`,
|
CSS: `body { background-color: rgba(255, 255, 255, 0); } .main { color: white; margin: 20%; }`,
|
||||||
Mac: options.MacWindow{
|
Mac: application.MacWindow{
|
||||||
InvisibleTitleBarHeight: 50,
|
InvisibleTitleBarHeight: 50,
|
||||||
Backdrop: options.MacBackdropTranslucent,
|
Backdrop: application.MacBackdropTranslucent,
|
||||||
TitleBar: options.TitleBarHiddenInset,
|
TitleBar: application.MacTitleBarHiddenInset,
|
||||||
},
|
},
|
||||||
|
|
||||||
URL: "/",
|
URL: "/",
|
||||||
Assets: options.Assets{
|
Assets: application.AssetOptions{
|
||||||
FS: assets,
|
FS: assets,
|
||||||
},
|
},
|
||||||
})
|
})
|
43
v3/internal/templates/preact/main.go.tmpl
Normal file
43
v3/internal/templates/preact/main.go.tmpl
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"embed"
|
||||||
|
_ "embed"
|
||||||
|
"log"
|
||||||
|
|
||||||
|
"github.com/wailsapp/wails/v3/pkg/application"
|
||||||
|
)
|
||||||
|
|
||||||
|
//go:embed frontend/dist
|
||||||
|
var assets embed.FS
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
app := application.New(application.Options{
|
||||||
|
Name: "{{.ProjectName}}",
|
||||||
|
Description: "A demo of using raw HTML & CSS",
|
||||||
|
Mac: application.MacOptions{
|
||||||
|
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
// Create window
|
||||||
|
app.NewWebviewWindowWithOptions(&application.WebviewWindowOptions{
|
||||||
|
Title: "Plain Bundle",
|
||||||
|
CSS: `body { background-color: rgba(255, 255, 255, 0); } .main { color: white; margin: 20%; }`,
|
||||||
|
Mac: application.MacWindow{
|
||||||
|
InvisibleTitleBarHeight: 50,
|
||||||
|
Backdrop: application.MacBackdropTranslucent,
|
||||||
|
TitleBar: application.MacTitleBarHiddenInset,
|
||||||
|
},
|
||||||
|
|
||||||
|
URL: "/",
|
||||||
|
Assets: application.AssetOptions{
|
||||||
|
FS: assets,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
err := app.Run()
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
}
|
@ -1,45 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"embed"
|
|
||||||
_ "embed"
|
|
||||||
"log"
|
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v3/pkg/options"
|
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v3/pkg/application"
|
|
||||||
)
|
|
||||||
|
|
||||||
//go:embed frontend/dist
|
|
||||||
var assets embed.FS
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
app := application.New(options.Application{
|
|
||||||
Name: "{{.ProjectName}}",
|
|
||||||
Description: "A demo of using raw HTML & CSS",
|
|
||||||
Mac: options.Mac{
|
|
||||||
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
// Create window
|
|
||||||
app.NewWebviewWindowWithOptions(&options.WebviewWindow{
|
|
||||||
Title: "Plain Bundle",
|
|
||||||
CSS: `body { background-color: rgba(255, 255, 255, 0); } .main { color: white; margin: 20%; }`,
|
|
||||||
Mac: options.MacWindow{
|
|
||||||
InvisibleTitleBarHeight: 50,
|
|
||||||
Backdrop: options.MacBackdropTranslucent,
|
|
||||||
TitleBar: options.TitleBarHiddenInset,
|
|
||||||
},
|
|
||||||
|
|
||||||
URL: "/",
|
|
||||||
Assets: options.Assets{
|
|
||||||
FS: assets,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
err := app.Run()
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
log.Fatal(err)
|
|
||||||
}
|
|
||||||
}
|
|
43
v3/internal/templates/react-swc-ts/main.go.tmpl
Normal file
43
v3/internal/templates/react-swc-ts/main.go.tmpl
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"embed"
|
||||||
|
_ "embed"
|
||||||
|
"log"
|
||||||
|
|
||||||
|
"github.com/wailsapp/wails/v3/pkg/application"
|
||||||
|
)
|
||||||
|
|
||||||
|
//go:embed frontend/dist
|
||||||
|
var assets embed.FS
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
app := application.New(application.Options{
|
||||||
|
Name: "{{.ProjectName}}",
|
||||||
|
Description: "A demo of using raw HTML & CSS",
|
||||||
|
Mac: application.MacOptions{
|
||||||
|
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
// Create window
|
||||||
|
app.NewWebviewWindowWithOptions(&application.WebviewWindowOptions{
|
||||||
|
Title: "Plain Bundle",
|
||||||
|
CSS: `body { background-color: rgba(255, 255, 255, 0); } .main { color: white; margin: 20%; }`,
|
||||||
|
Mac: application.MacWindow{
|
||||||
|
InvisibleTitleBarHeight: 50,
|
||||||
|
Backdrop: application.MacBackdropTranslucent,
|
||||||
|
TitleBar: application.MacTitleBarHiddenInset,
|
||||||
|
},
|
||||||
|
|
||||||
|
URL: "/",
|
||||||
|
Assets: application.AssetOptions{
|
||||||
|
FS: assets,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
err := app.Run()
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
}
|
@ -1,45 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"embed"
|
|
||||||
_ "embed"
|
|
||||||
"log"
|
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v3/pkg/options"
|
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v3/pkg/application"
|
|
||||||
)
|
|
||||||
|
|
||||||
//go:embed frontend/dist
|
|
||||||
var assets embed.FS
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
app := application.New(options.Application{
|
|
||||||
Name: "{{.ProjectName}}",
|
|
||||||
Description: "A demo of using raw HTML & CSS",
|
|
||||||
Mac: options.Mac{
|
|
||||||
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
// Create window
|
|
||||||
app.NewWebviewWindowWithOptions(&options.WebviewWindow{
|
|
||||||
Title: "Plain Bundle",
|
|
||||||
CSS: `body { background-color: rgba(255, 255, 255, 0); } .main { color: white; margin: 20%; }`,
|
|
||||||
Mac: options.MacWindow{
|
|
||||||
InvisibleTitleBarHeight: 50,
|
|
||||||
Backdrop: options.MacBackdropTranslucent,
|
|
||||||
TitleBar: options.TitleBarHiddenInset,
|
|
||||||
},
|
|
||||||
|
|
||||||
URL: "/",
|
|
||||||
Assets: options.Assets{
|
|
||||||
FS: assets,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
err := app.Run()
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
log.Fatal(err)
|
|
||||||
}
|
|
||||||
}
|
|
43
v3/internal/templates/react-swc/main.go.tmpl
Normal file
43
v3/internal/templates/react-swc/main.go.tmpl
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"embed"
|
||||||
|
_ "embed"
|
||||||
|
"log"
|
||||||
|
|
||||||
|
"github.com/wailsapp/wails/v3/pkg/application"
|
||||||
|
)
|
||||||
|
|
||||||
|
//go:embed frontend/dist
|
||||||
|
var assets embed.FS
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
app := application.New(application.Options{
|
||||||
|
Name: "{{.ProjectName}}",
|
||||||
|
Description: "A demo of using raw HTML & CSS",
|
||||||
|
Mac: application.MacOptions{
|
||||||
|
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
// Create window
|
||||||
|
app.NewWebviewWindowWithOptions(&application.WebviewWindowOptions{
|
||||||
|
Title: "Plain Bundle",
|
||||||
|
CSS: `body { background-color: rgba(255, 255, 255, 0); } .main { color: white; margin: 20%; }`,
|
||||||
|
Mac: application.MacWindow{
|
||||||
|
InvisibleTitleBarHeight: 50,
|
||||||
|
Backdrop: application.MacBackdropTranslucent,
|
||||||
|
TitleBar: application.MacTitleBarHiddenInset,
|
||||||
|
},
|
||||||
|
|
||||||
|
URL: "/",
|
||||||
|
Assets: application.AssetOptions{
|
||||||
|
FS: assets,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
err := app.Run()
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
}
|
@ -1,45 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"embed"
|
|
||||||
_ "embed"
|
|
||||||
"log"
|
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v3/pkg/options"
|
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v3/pkg/application"
|
|
||||||
)
|
|
||||||
|
|
||||||
//go:embed frontend/dist
|
|
||||||
var assets embed.FS
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
app := application.New(options.Application{
|
|
||||||
Name: "{{.ProjectName}}",
|
|
||||||
Description: "A demo of using raw HTML & CSS",
|
|
||||||
Mac: options.Mac{
|
|
||||||
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
// Create window
|
|
||||||
app.NewWebviewWindowWithOptions(&options.WebviewWindow{
|
|
||||||
Title: "Plain Bundle",
|
|
||||||
CSS: `body { background-color: rgba(255, 255, 255, 0); } .main { color: white; margin: 20%; }`,
|
|
||||||
Mac: options.MacWindow{
|
|
||||||
InvisibleTitleBarHeight: 50,
|
|
||||||
Backdrop: options.MacBackdropTranslucent,
|
|
||||||
TitleBar: options.TitleBarHiddenInset,
|
|
||||||
},
|
|
||||||
|
|
||||||
URL: "/",
|
|
||||||
Assets: options.Assets{
|
|
||||||
FS: assets,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
err := app.Run()
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
log.Fatal(err)
|
|
||||||
}
|
|
||||||
}
|
|
43
v3/internal/templates/react-ts/main.go.tmpl
Normal file
43
v3/internal/templates/react-ts/main.go.tmpl
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"embed"
|
||||||
|
_ "embed"
|
||||||
|
"log"
|
||||||
|
|
||||||
|
"github.com/wailsapp/wails/v3/pkg/application"
|
||||||
|
)
|
||||||
|
|
||||||
|
//go:embed frontend/dist
|
||||||
|
var assets embed.FS
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
app := application.New(application.Options{
|
||||||
|
Name: "{{.ProjectName}}",
|
||||||
|
Description: "A demo of using raw HTML & CSS",
|
||||||
|
Mac: application.MacOptions{
|
||||||
|
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
// Create window
|
||||||
|
app.NewWebviewWindowWithOptions(&application.WebviewWindowOptions{
|
||||||
|
Title: "Plain Bundle",
|
||||||
|
CSS: `body { background-color: rgba(255, 255, 255, 0); } .main { color: white; margin: 20%; }`,
|
||||||
|
Mac: application.MacWindow{
|
||||||
|
InvisibleTitleBarHeight: 50,
|
||||||
|
Backdrop: application.MacBackdropTranslucent,
|
||||||
|
TitleBar: application.MacTitleBarHiddenInset,
|
||||||
|
},
|
||||||
|
|
||||||
|
URL: "/",
|
||||||
|
Assets: application.AssetOptions{
|
||||||
|
FS: assets,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
err := app.Run()
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
}
|
@ -1,45 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"embed"
|
|
||||||
_ "embed"
|
|
||||||
"log"
|
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v3/pkg/options"
|
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v3/pkg/application"
|
|
||||||
)
|
|
||||||
|
|
||||||
//go:embed frontend/dist
|
|
||||||
var assets embed.FS
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
app := application.New(options.Application{
|
|
||||||
Name: "{{.ProjectName}}",
|
|
||||||
Description: "A demo of using raw HTML & CSS",
|
|
||||||
Mac: options.Mac{
|
|
||||||
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
// Create window
|
|
||||||
app.NewWebviewWindowWithOptions(&options.WebviewWindow{
|
|
||||||
Title: "Plain Bundle",
|
|
||||||
CSS: `body { background-color: rgba(255, 255, 255, 0); } .main { color: white; margin: 20%; }`,
|
|
||||||
Mac: options.MacWindow{
|
|
||||||
InvisibleTitleBarHeight: 50,
|
|
||||||
Backdrop: options.MacBackdropTranslucent,
|
|
||||||
TitleBar: options.TitleBarHiddenInset,
|
|
||||||
},
|
|
||||||
|
|
||||||
URL: "/",
|
|
||||||
Assets: options.Assets{
|
|
||||||
FS: assets,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
err := app.Run()
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
log.Fatal(err)
|
|
||||||
}
|
|
||||||
}
|
|
43
v3/internal/templates/react/main.go.tmpl
Normal file
43
v3/internal/templates/react/main.go.tmpl
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"embed"
|
||||||
|
_ "embed"
|
||||||
|
"log"
|
||||||
|
|
||||||
|
"github.com/wailsapp/wails/v3/pkg/application"
|
||||||
|
)
|
||||||
|
|
||||||
|
//go:embed frontend/dist
|
||||||
|
var assets embed.FS
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
app := application.New(application.Options{
|
||||||
|
Name: "{{.ProjectName}}",
|
||||||
|
Description: "A demo of using raw HTML & CSS",
|
||||||
|
Mac: application.MacOptions{
|
||||||
|
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
// Create window
|
||||||
|
app.NewWebviewWindowWithOptions(&application.WebviewWindowOptions{
|
||||||
|
Title: "Plain Bundle",
|
||||||
|
CSS: `body { background-color: rgba(255, 255, 255, 0); } .main { color: white; margin: 20%; }`,
|
||||||
|
Mac: application.MacWindow{
|
||||||
|
InvisibleTitleBarHeight: 50,
|
||||||
|
Backdrop: application.MacBackdropTranslucent,
|
||||||
|
TitleBar: application.MacTitleBarHiddenInset,
|
||||||
|
},
|
||||||
|
|
||||||
|
URL: "/",
|
||||||
|
Assets: application.AssetOptions{
|
||||||
|
FS: assets,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
err := app.Run()
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
}
|
@ -1,45 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"embed"
|
|
||||||
_ "embed"
|
|
||||||
"log"
|
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v3/pkg/options"
|
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v3/pkg/application"
|
|
||||||
)
|
|
||||||
|
|
||||||
//go:embed frontend/dist
|
|
||||||
var assets embed.FS
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
app := application.New(options.Application{
|
|
||||||
Name: "{{.ProjectName}}",
|
|
||||||
Description: "A demo of using raw HTML & CSS",
|
|
||||||
Mac: options.Mac{
|
|
||||||
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
// Create window
|
|
||||||
app.NewWebviewWindowWithOptions(&options.WebviewWindow{
|
|
||||||
Title: "Plain Bundle",
|
|
||||||
CSS: `body { background-color: rgba(255, 255, 255, 0); } .main { color: white; margin: 20%; }`,
|
|
||||||
Mac: options.MacWindow{
|
|
||||||
InvisibleTitleBarHeight: 50,
|
|
||||||
Backdrop: options.MacBackdropTranslucent,
|
|
||||||
TitleBar: options.TitleBarHiddenInset,
|
|
||||||
},
|
|
||||||
|
|
||||||
URL: "/",
|
|
||||||
Assets: options.Assets{
|
|
||||||
FS: assets,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
err := app.Run()
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
log.Fatal(err)
|
|
||||||
}
|
|
||||||
}
|
|
43
v3/internal/templates/svelte-ts/main.go.tmpl
Normal file
43
v3/internal/templates/svelte-ts/main.go.tmpl
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"embed"
|
||||||
|
_ "embed"
|
||||||
|
"log"
|
||||||
|
|
||||||
|
"github.com/wailsapp/wails/v3/pkg/application"
|
||||||
|
)
|
||||||
|
|
||||||
|
//go:embed frontend/dist
|
||||||
|
var assets embed.FS
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
app := application.New(application.Options{
|
||||||
|
Name: "{{.ProjectName}}",
|
||||||
|
Description: "A demo of using raw HTML & CSS",
|
||||||
|
Mac: application.MacOptions{
|
||||||
|
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
// Create window
|
||||||
|
app.NewWebviewWindowWithOptions(&application.WebviewWindowOptions{
|
||||||
|
Title: "Plain Bundle",
|
||||||
|
CSS: `body { background-color: rgba(255, 255, 255, 0); } .main { color: white; margin: 20%; }`,
|
||||||
|
Mac: application.MacWindow{
|
||||||
|
InvisibleTitleBarHeight: 50,
|
||||||
|
Backdrop: application.MacBackdropTranslucent,
|
||||||
|
TitleBar: application.MacTitleBarHiddenInset,
|
||||||
|
},
|
||||||
|
|
||||||
|
URL: "/",
|
||||||
|
Assets: application.AssetOptions{
|
||||||
|
FS: assets,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
err := app.Run()
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
}
|
@ -1,45 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"embed"
|
|
||||||
_ "embed"
|
|
||||||
"log"
|
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v3/pkg/options"
|
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v3/pkg/application"
|
|
||||||
)
|
|
||||||
|
|
||||||
//go:embed frontend/dist
|
|
||||||
var assets embed.FS
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
app := application.New(options.Application{
|
|
||||||
Name: "{{.ProjectName}}",
|
|
||||||
Description: "A demo of using raw HTML & CSS",
|
|
||||||
Mac: options.Mac{
|
|
||||||
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
// Create window
|
|
||||||
app.NewWebviewWindowWithOptions(&options.WebviewWindow{
|
|
||||||
Title: "Plain Bundle",
|
|
||||||
CSS: `body { background-color: rgba(255, 255, 255, 0); } .main { color: white; margin: 20%; }`,
|
|
||||||
Mac: options.MacWindow{
|
|
||||||
InvisibleTitleBarHeight: 50,
|
|
||||||
Backdrop: options.MacBackdropTranslucent,
|
|
||||||
TitleBar: options.TitleBarHiddenInset,
|
|
||||||
},
|
|
||||||
|
|
||||||
URL: "/",
|
|
||||||
Assets: options.Assets{
|
|
||||||
FS: assets,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
err := app.Run()
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
log.Fatal(err)
|
|
||||||
}
|
|
||||||
}
|
|
43
v3/internal/templates/svelte/main.go.tmpl
Normal file
43
v3/internal/templates/svelte/main.go.tmpl
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"embed"
|
||||||
|
_ "embed"
|
||||||
|
"log"
|
||||||
|
|
||||||
|
"github.com/wailsapp/wails/v3/pkg/application"
|
||||||
|
)
|
||||||
|
|
||||||
|
//go:embed frontend/dist
|
||||||
|
var assets embed.FS
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
app := application.New(application.Options{
|
||||||
|
Name: "{{.ProjectName}}",
|
||||||
|
Description: "A demo of using raw HTML & CSS",
|
||||||
|
Mac: application.MacOptions{
|
||||||
|
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
// Create window
|
||||||
|
app.NewWebviewWindowWithOptions(&application.WebviewWindowOptions{
|
||||||
|
Title: "Plain Bundle",
|
||||||
|
CSS: `body { background-color: rgba(255, 255, 255, 0); } .main { color: white; margin: 20%; }`,
|
||||||
|
Mac: application.MacWindow{
|
||||||
|
InvisibleTitleBarHeight: 50,
|
||||||
|
Backdrop: application.MacBackdropTranslucent,
|
||||||
|
TitleBar: application.MacTitleBarHiddenInset,
|
||||||
|
},
|
||||||
|
|
||||||
|
URL: "/",
|
||||||
|
Assets: application.AssetOptions{
|
||||||
|
FS: assets,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
err := app.Run()
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
}
|
@ -1,45 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"embed"
|
|
||||||
_ "embed"
|
|
||||||
"log"
|
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v3/pkg/options"
|
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v3/pkg/application"
|
|
||||||
)
|
|
||||||
|
|
||||||
//go:embed frontend/dist
|
|
||||||
var assets embed.FS
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
app := application.New(options.Application{
|
|
||||||
Name: "{{.ProjectName}}",
|
|
||||||
Description: "A demo of using raw HTML & CSS",
|
|
||||||
Mac: options.Mac{
|
|
||||||
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
// Create window
|
|
||||||
app.NewWebviewWindowWithOptions(&options.WebviewWindow{
|
|
||||||
Title: "Plain Bundle",
|
|
||||||
CSS: `body { background-color: rgba(255, 255, 255, 0); } .main { color: white; margin: 20%; }`,
|
|
||||||
Mac: options.MacWindow{
|
|
||||||
InvisibleTitleBarHeight: 50,
|
|
||||||
Backdrop: options.MacBackdropTranslucent,
|
|
||||||
TitleBar: options.TitleBarHiddenInset,
|
|
||||||
},
|
|
||||||
|
|
||||||
URL: "/",
|
|
||||||
Assets: options.Assets{
|
|
||||||
FS: assets,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
err := app.Run()
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
log.Fatal(err)
|
|
||||||
}
|
|
||||||
}
|
|
43
v3/internal/templates/vanilla-ts/main.go.tmpl
Normal file
43
v3/internal/templates/vanilla-ts/main.go.tmpl
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"embed"
|
||||||
|
_ "embed"
|
||||||
|
"log"
|
||||||
|
|
||||||
|
"github.com/wailsapp/wails/v3/pkg/application"
|
||||||
|
)
|
||||||
|
|
||||||
|
//go:embed frontend/dist
|
||||||
|
var assets embed.FS
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
app := application.New(application.Options{
|
||||||
|
Name: "{{.ProjectName}}",
|
||||||
|
Description: "A demo of using raw HTML & CSS",
|
||||||
|
Mac: application.MacOptions{
|
||||||
|
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
// Create window
|
||||||
|
app.NewWebviewWindowWithOptions(&application.WebviewWindowOptions{
|
||||||
|
Title: "Plain Bundle",
|
||||||
|
CSS: `body { background-color: rgba(255, 255, 255, 0); } .main { color: white; margin: 20%; }`,
|
||||||
|
Mac: application.MacWindow{
|
||||||
|
InvisibleTitleBarHeight: 50,
|
||||||
|
Backdrop: application.MacBackdropTranslucent,
|
||||||
|
TitleBar: application.MacTitleBarHiddenInset,
|
||||||
|
},
|
||||||
|
|
||||||
|
URL: "/",
|
||||||
|
Assets: application.AssetOptions{
|
||||||
|
FS: assets,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
err := app.Run()
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
}
|
@ -1,45 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"embed"
|
|
||||||
_ "embed"
|
|
||||||
"log"
|
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v3/pkg/options"
|
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v3/pkg/application"
|
|
||||||
)
|
|
||||||
|
|
||||||
//go:embed frontend/dist
|
|
||||||
var assets embed.FS
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
app := application.New(options.Application{
|
|
||||||
Name: "{{.ProjectName}}",
|
|
||||||
Description: "A demo of using raw HTML & CSS",
|
|
||||||
Mac: options.Mac{
|
|
||||||
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
// Create window
|
|
||||||
app.NewWebviewWindowWithOptions(&options.WebviewWindow{
|
|
||||||
Title: "Plain Bundle",
|
|
||||||
CSS: `body { background-color: rgba(255, 255, 255, 0); } .main { color: white; margin: 20%; }`,
|
|
||||||
Mac: options.MacWindow{
|
|
||||||
InvisibleTitleBarHeight: 50,
|
|
||||||
Backdrop: options.MacBackdropTranslucent,
|
|
||||||
TitleBar: options.TitleBarHiddenInset,
|
|
||||||
},
|
|
||||||
|
|
||||||
URL: "/",
|
|
||||||
Assets: options.Assets{
|
|
||||||
FS: assets,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
err := app.Run()
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
log.Fatal(err)
|
|
||||||
}
|
|
||||||
}
|
|
43
v3/internal/templates/vanilla/main.go.tmpl
Normal file
43
v3/internal/templates/vanilla/main.go.tmpl
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"embed"
|
||||||
|
_ "embed"
|
||||||
|
"log"
|
||||||
|
|
||||||
|
"github.com/wailsapp/wails/v3/pkg/application"
|
||||||
|
)
|
||||||
|
|
||||||
|
//go:embed frontend/dist
|
||||||
|
var assets embed.FS
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
app := application.New(application.Options{
|
||||||
|
Name: "{{.ProjectName}}",
|
||||||
|
Description: "A demo of using raw HTML & CSS",
|
||||||
|
Mac: application.MacOptions{
|
||||||
|
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
// Create window
|
||||||
|
app.NewWebviewWindowWithOptions(&application.WebviewWindowOptions{
|
||||||
|
Title: "Plain Bundle",
|
||||||
|
CSS: `body { background-color: rgba(255, 255, 255, 0); } .main { color: white; margin: 20%; }`,
|
||||||
|
Mac: application.MacWindow{
|
||||||
|
InvisibleTitleBarHeight: 50,
|
||||||
|
Backdrop: application.MacBackdropTranslucent,
|
||||||
|
TitleBar: application.MacTitleBarHiddenInset,
|
||||||
|
},
|
||||||
|
|
||||||
|
URL: "/",
|
||||||
|
Assets: application.AssetOptions{
|
||||||
|
FS: assets,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
err := app.Run()
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
}
|
@ -1,45 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"embed"
|
|
||||||
_ "embed"
|
|
||||||
"log"
|
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v3/pkg/options"
|
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v3/pkg/application"
|
|
||||||
)
|
|
||||||
|
|
||||||
//go:embed frontend/dist
|
|
||||||
var assets embed.FS
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
app := application.New(options.Application{
|
|
||||||
Name: "{{.ProjectName}}",
|
|
||||||
Description: "A demo of using raw HTML & CSS",
|
|
||||||
Mac: options.Mac{
|
|
||||||
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
// Create window
|
|
||||||
app.NewWebviewWindowWithOptions(&options.WebviewWindow{
|
|
||||||
Title: "Plain Bundle",
|
|
||||||
CSS: `body { background-color: rgba(255, 255, 255, 0); } .main { color: white; margin: 20%; }`,
|
|
||||||
Mac: options.MacWindow{
|
|
||||||
InvisibleTitleBarHeight: 50,
|
|
||||||
Backdrop: options.MacBackdropTranslucent,
|
|
||||||
TitleBar: options.TitleBarHiddenInset,
|
|
||||||
},
|
|
||||||
|
|
||||||
URL: "/",
|
|
||||||
Assets: options.Assets{
|
|
||||||
FS: assets,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
err := app.Run()
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
log.Fatal(err)
|
|
||||||
}
|
|
||||||
}
|
|
43
v3/internal/templates/vue-ts/main.go.tmpl
Normal file
43
v3/internal/templates/vue-ts/main.go.tmpl
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"embed"
|
||||||
|
_ "embed"
|
||||||
|
"log"
|
||||||
|
|
||||||
|
"github.com/wailsapp/wails/v3/pkg/application"
|
||||||
|
)
|
||||||
|
|
||||||
|
//go:embed frontend/dist
|
||||||
|
var assets embed.FS
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
app := application.New(application.Options{
|
||||||
|
Name: "{{.ProjectName}}",
|
||||||
|
Description: "A demo of using raw HTML & CSS",
|
||||||
|
Mac: application.MacOptions{
|
||||||
|
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
// Create window
|
||||||
|
app.NewWebviewWindowWithOptions(&application.WebviewWindowOptions{
|
||||||
|
Title: "Plain Bundle",
|
||||||
|
CSS: `body { background-color: rgba(255, 255, 255, 0); } .main { color: white; margin: 20%; }`,
|
||||||
|
Mac: application.MacWindow{
|
||||||
|
InvisibleTitleBarHeight: 50,
|
||||||
|
Backdrop: application.MacBackdropTranslucent,
|
||||||
|
TitleBar: application.MacTitleBarHiddenInset,
|
||||||
|
},
|
||||||
|
|
||||||
|
URL: "/",
|
||||||
|
Assets: application.AssetOptions{
|
||||||
|
FS: assets,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
err := app.Run()
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
}
|
@ -1,45 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"embed"
|
|
||||||
_ "embed"
|
|
||||||
"log"
|
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v3/pkg/options"
|
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v3/pkg/application"
|
|
||||||
)
|
|
||||||
|
|
||||||
//go:embed frontend/dist
|
|
||||||
var assets embed.FS
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
app := application.New(options.Application{
|
|
||||||
Name: "{{.ProjectName}}",
|
|
||||||
Description: "A demo of using raw HTML & CSS",
|
|
||||||
Mac: options.Mac{
|
|
||||||
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
// Create window
|
|
||||||
app.NewWebviewWindowWithOptions(&options.WebviewWindow{
|
|
||||||
Title: "Plain Bundle",
|
|
||||||
CSS: `body { background-color: rgba(255, 255, 255, 0); } .main { color: white; margin: 20%; }`,
|
|
||||||
Mac: options.MacWindow{
|
|
||||||
InvisibleTitleBarHeight: 50,
|
|
||||||
Backdrop: options.MacBackdropTranslucent,
|
|
||||||
TitleBar: options.TitleBarHiddenInset,
|
|
||||||
},
|
|
||||||
|
|
||||||
URL: "/",
|
|
||||||
Assets: options.Assets{
|
|
||||||
FS: assets,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
err := app.Run()
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
log.Fatal(err)
|
|
||||||
}
|
|
||||||
}
|
|
43
v3/internal/templates/vue/main.go.tmpl
Normal file
43
v3/internal/templates/vue/main.go.tmpl
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"embed"
|
||||||
|
_ "embed"
|
||||||
|
"log"
|
||||||
|
|
||||||
|
"github.com/wailsapp/wails/v3/pkg/application"
|
||||||
|
)
|
||||||
|
|
||||||
|
//go:embed frontend/dist
|
||||||
|
var assets embed.FS
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
app := application.New(application.Options{
|
||||||
|
Name: "{{.ProjectName}}",
|
||||||
|
Description: "A demo of using raw HTML & CSS",
|
||||||
|
Mac: application.MacOptions{
|
||||||
|
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
// Create window
|
||||||
|
app.NewWebviewWindowWithOptions(&application.WebviewWindowOptions{
|
||||||
|
Title: "Plain Bundle",
|
||||||
|
CSS: `body { background-color: rgba(255, 255, 255, 0); } .main { color: white; margin: 20%; }`,
|
||||||
|
Mac: application.MacWindow{
|
||||||
|
InvisibleTitleBarHeight: 50,
|
||||||
|
Backdrop: application.MacBackdropTranslucent,
|
||||||
|
TitleBar: application.MacTitleBarHiddenInset,
|
||||||
|
},
|
||||||
|
|
||||||
|
URL: "/",
|
||||||
|
Assets: application.AssetOptions{
|
||||||
|
FS: assets,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
err := app.Run()
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
}
|
@ -1,45 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"embed"
|
|
||||||
_ "embed"
|
|
||||||
"log"
|
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v3/pkg/options"
|
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v3/pkg/application"
|
|
||||||
)
|
|
||||||
|
|
||||||
//go:embed frontend/dist
|
|
||||||
var assets embed.FS
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
app := application.New(options.Application{
|
|
||||||
Name: "{{.ProjectName}}",
|
|
||||||
Description: "A demo of using raw HTML & CSS",
|
|
||||||
Mac: options.Mac{
|
|
||||||
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
// Create window
|
|
||||||
app.NewWebviewWindowWithOptions(&options.WebviewWindow{
|
|
||||||
Title: "Plain Bundle",
|
|
||||||
CSS: `body { background-color: rgba(255, 255, 255, 0); } .main { color: white; margin: 20%; }`,
|
|
||||||
Mac: options.MacWindow{
|
|
||||||
InvisibleTitleBarHeight: 50,
|
|
||||||
Backdrop: options.MacBackdropTranslucent,
|
|
||||||
TitleBar: options.TitleBarHiddenInset,
|
|
||||||
},
|
|
||||||
|
|
||||||
URL: "/",
|
|
||||||
Assets: options.Assets{
|
|
||||||
FS: assets,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
err := app.Run()
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
log.Fatal(err)
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,22 +1,17 @@
|
|||||||
//go:build darwin
|
//go:build darwin
|
||||||
|
|
||||||
#import "app_delegate.h"
|
#import "app_delegate.h"
|
||||||
#import "../events/events.h"
|
#import "../events/events.h"
|
||||||
|
|
||||||
extern bool hasListeners(unsigned int);
|
extern bool hasListeners(unsigned int);
|
||||||
|
|
||||||
@implementation AppDelegate
|
@implementation AppDelegate
|
||||||
- (void)dealloc
|
- (void)dealloc
|
||||||
{
|
{
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create the applicationShouldTerminateAfterLastWindowClosed: method
|
// Create the applicationShouldTerminateAfterLastWindowClosed: method
|
||||||
- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)theApplication
|
- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)theApplication
|
||||||
{
|
{
|
||||||
return self.shouldTerminateWhenLastWindowClosed;
|
return self.shouldTerminateWhenLastWindowClosed;
|
||||||
}
|
}
|
||||||
|
|
||||||
// GENERATED EVENTS START
|
// GENERATED EVENTS START
|
||||||
- (void)applicationDidBecomeActive:(NSNotification *)notification {
|
- (void)applicationDidBecomeActive:(NSNotification *)notification {
|
||||||
if( hasListeners(EventApplicationDidBecomeActive) ) {
|
if( hasListeners(EventApplicationDidBecomeActive) ) {
|
||||||
|
@ -230,6 +230,20 @@ func processURLRequest(windowID C.uint, wkUrlSchemeTask unsafe.Pointer) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//export processDragItems
|
||||||
|
func processDragItems(windowID C.uint, arr **C.char, length C.int) {
|
||||||
|
var filenames []string
|
||||||
|
// Convert the C array to a Go slice
|
||||||
|
goSlice := (*[1 << 30]*C.char)(unsafe.Pointer(arr))[:length:length]
|
||||||
|
for _, str := range goSlice {
|
||||||
|
filenames = append(filenames, C.GoString(str))
|
||||||
|
}
|
||||||
|
windowDragAndDropBuffer <- &dragAndDropMessage{
|
||||||
|
windowId: uint(windowID),
|
||||||
|
filenames: filenames,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//export processMenuItemClick
|
//export processMenuItemClick
|
||||||
func processMenuItemClick(menuID C.uint) {
|
func processMenuItemClick(menuID C.uint) {
|
||||||
menuItemClicked <- uint(menuID)
|
menuItemClicked <- uint(menuID)
|
||||||
|
@ -14,6 +14,7 @@ func newContext() *Context {
|
|||||||
const (
|
const (
|
||||||
clickedMenuItem string = "clickedMenuItem"
|
clickedMenuItem string = "clickedMenuItem"
|
||||||
menuItemIsChecked string = "menuItemIsChecked"
|
menuItemIsChecked string = "menuItemIsChecked"
|
||||||
|
contextMenuData string = "contextMenuData"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (c *Context) ClickedMenuItem() *MenuItem {
|
func (c *Context) ClickedMenuItem() *MenuItem {
|
||||||
@ -31,6 +32,9 @@ func (c *Context) IsChecked() bool {
|
|||||||
}
|
}
|
||||||
return result.(bool)
|
return result.(bool)
|
||||||
}
|
}
|
||||||
|
func (c *Context) ContextMenuData() any {
|
||||||
|
return c.data[contextMenuData]
|
||||||
|
}
|
||||||
|
|
||||||
func (c *Context) withClickedMenuItem(menuItem *MenuItem) *Context {
|
func (c *Context) withClickedMenuItem(menuItem *MenuItem) *Context {
|
||||||
c.data[clickedMenuItem] = menuItem
|
c.data[clickedMenuItem] = menuItem
|
||||||
@ -40,3 +44,11 @@ func (c *Context) withClickedMenuItem(menuItem *MenuItem) *Context {
|
|||||||
func (c *Context) withChecked(checked bool) {
|
func (c *Context) withChecked(checked bool) {
|
||||||
c.data[menuItemIsChecked] = checked
|
c.data[menuItemIsChecked] = checked
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *Context) withContextMenuData(data *ContextMenuData) *Context {
|
||||||
|
if data == nil {
|
||||||
|
return c
|
||||||
|
}
|
||||||
|
c.data[contextMenuData] = data.Data
|
||||||
|
return c
|
||||||
|
}
|
||||||
|
35
v3/pkg/application/context_window_event.go
Normal file
35
v3/pkg/application/context_window_event.go
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
package application
|
||||||
|
|
||||||
|
var blankWindowEventContext = &WindowEventContext{}
|
||||||
|
|
||||||
|
const (
|
||||||
|
// FilesDropped is the event name for when files are dropped on the window
|
||||||
|
droppedFiles = "droppedFiles"
|
||||||
|
)
|
||||||
|
|
||||||
|
type WindowEventContext struct {
|
||||||
|
// contains filtered or unexported fields
|
||||||
|
data map[string]any
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c WindowEventContext) DroppedFiles() []string {
|
||||||
|
files, ok := c.data[droppedFiles]
|
||||||
|
if !ok {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
result, ok := files.([]string)
|
||||||
|
if !ok {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c WindowEventContext) setDroppedFiles(files []string) {
|
||||||
|
c.data[droppedFiles] = files
|
||||||
|
}
|
||||||
|
|
||||||
|
func newWindowEventContext() *WindowEventContext {
|
||||||
|
return &WindowEventContext{
|
||||||
|
data: make(map[string]any),
|
||||||
|
}
|
||||||
|
}
|
@ -87,6 +87,12 @@ func (m *Menu) SetLabel(label string) {
|
|||||||
m.label = label
|
m.label = label
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *Menu) setContextData(data *ContextMenuData) {
|
||||||
|
for _, item := range m.items {
|
||||||
|
item.setContextData(data)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (a *App) NewMenu() *Menu {
|
func (a *App) NewMenu() *Menu {
|
||||||
return &Menu{}
|
return &Menu{}
|
||||||
}
|
}
|
||||||
|
@ -51,6 +51,7 @@ type MenuItem struct {
|
|||||||
itemType menuItemType
|
itemType menuItemType
|
||||||
accelerator *accelerator
|
accelerator *accelerator
|
||||||
role Role
|
role Role
|
||||||
|
contextMenuData *ContextMenuData
|
||||||
|
|
||||||
impl menuItemImpl
|
impl menuItemImpl
|
||||||
radioGroupMembers []*MenuItem
|
radioGroupMembers []*MenuItem
|
||||||
@ -187,7 +188,9 @@ func newServicesMenu() *MenuItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m *MenuItem) handleClick() {
|
func (m *MenuItem) handleClick() {
|
||||||
var ctx = newContext().withClickedMenuItem(m)
|
var ctx = newContext().
|
||||||
|
withClickedMenuItem(m).
|
||||||
|
withContextMenuData(m.contextMenuData)
|
||||||
if m.itemType == checkbox {
|
if m.itemType == checkbox {
|
||||||
m.checked = !m.checked
|
m.checked = !m.checked
|
||||||
ctx.withChecked(m.checked)
|
ctx.withChecked(m.checked)
|
||||||
@ -272,3 +275,10 @@ func (m *MenuItem) Tooltip() string {
|
|||||||
func (m *MenuItem) Enabled() bool {
|
func (m *MenuItem) Enabled() bool {
|
||||||
return !m.disabled
|
return !m.disabled
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *MenuItem) setContextData(data *ContextMenuData) {
|
||||||
|
m.contextMenuData = data
|
||||||
|
if m.submenu != nil {
|
||||||
|
m.submenu.setContextData(data)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
30
v3/pkg/application/messageprocessor_contextmenu.go
Normal file
30
v3/pkg/application/messageprocessor_contextmenu.go
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
package application
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
)
|
||||||
|
|
||||||
|
type ContextMenuData struct {
|
||||||
|
Id string `json:"id"`
|
||||||
|
X int `json:"x"`
|
||||||
|
Y int `json:"y"`
|
||||||
|
Data any `json:"data"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *MessageProcessor) processContextMenuMethod(method string, rw http.ResponseWriter, _ *http.Request, window *WebviewWindow, params QueryParams) {
|
||||||
|
|
||||||
|
switch method {
|
||||||
|
case "OpenContextMenu":
|
||||||
|
var data ContextMenuData
|
||||||
|
err := params.ToStruct(&data)
|
||||||
|
if err != nil {
|
||||||
|
m.httpError(rw, "error parsing contextmenu message: %s", err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
window.openContextMenu(&data)
|
||||||
|
m.ok(rw)
|
||||||
|
default:
|
||||||
|
m.httpError(rw, "Unknown clipboard method: %s", method)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
17
v3/pkg/application/options_application.go
Normal file
17
v3/pkg/application/options_application.go
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
package application
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/wailsapp/wails/v3/pkg/logger"
|
||||||
|
)
|
||||||
|
|
||||||
|
type Options struct {
|
||||||
|
Name string
|
||||||
|
Description string
|
||||||
|
Icon []byte
|
||||||
|
Mac MacOptions
|
||||||
|
Bind []any
|
||||||
|
Logger struct {
|
||||||
|
Silent bool
|
||||||
|
CustomLoggers []logger.Output
|
||||||
|
}
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
package options
|
package application
|
||||||
|
|
||||||
type ActivationPolicy int
|
type ActivationPolicy int
|
||||||
|
|
||||||
@ -10,7 +10,7 @@ const (
|
|||||||
ActivationPolicyProhibited
|
ActivationPolicyProhibited
|
||||||
)
|
)
|
||||||
|
|
||||||
type Mac struct {
|
type MacOptions struct {
|
||||||
// ActivationPolicy is the activation policy for the application. Defaults to
|
// ActivationPolicy is the activation policy for the application. Defaults to
|
||||||
// applicationActivationPolicyRegular.
|
// applicationActivationPolicyRegular.
|
||||||
ActivationPolicy ActivationPolicy
|
ActivationPolicy ActivationPolicy
|
||||||
@ -44,13 +44,13 @@ const (
|
|||||||
// MacWindow contains macOS specific options
|
// MacWindow contains macOS specific options
|
||||||
type MacWindow struct {
|
type MacWindow struct {
|
||||||
Backdrop MacBackdrop
|
Backdrop MacBackdrop
|
||||||
TitleBar TitleBar
|
TitleBar MacTitleBar
|
||||||
Appearance MacAppearanceType
|
Appearance MacAppearanceType
|
||||||
InvisibleTitleBarHeight int
|
InvisibleTitleBarHeight int
|
||||||
}
|
}
|
||||||
|
|
||||||
// TitleBar contains options for the Mac titlebar
|
// MacTitleBar contains options for the Mac titlebar
|
||||||
type TitleBar struct {
|
type MacTitleBar struct {
|
||||||
AppearsTransparent bool
|
AppearsTransparent bool
|
||||||
Hide bool
|
Hide bool
|
||||||
HideTitle bool
|
HideTitle bool
|
||||||
@ -60,8 +60,8 @@ type TitleBar struct {
|
|||||||
ToolbarStyle MacToolbarStyle
|
ToolbarStyle MacToolbarStyle
|
||||||
}
|
}
|
||||||
|
|
||||||
// TitleBarDefault results in the default Mac TitleBar
|
// MacTitleBarDefault results in the default Mac MacTitleBar
|
||||||
var TitleBarDefault = TitleBar{
|
var MacTitleBarDefault = MacTitleBar{
|
||||||
AppearsTransparent: false,
|
AppearsTransparent: false,
|
||||||
Hide: false,
|
Hide: false,
|
||||||
HideTitle: false,
|
HideTitle: false,
|
||||||
@ -72,10 +72,10 @@ var TitleBarDefault = TitleBar{
|
|||||||
|
|
||||||
// Credit: Comments from Electron site
|
// Credit: Comments from Electron site
|
||||||
|
|
||||||
// TitleBarHidden results in a hidden title bar and a full size content window,
|
// MacTitleBarHidden results in a hidden title bar and a full size content window,
|
||||||
// yet the title bar still has the standard window controls (“traffic lights”)
|
// yet the title bar still has the standard window controls (“traffic lights”)
|
||||||
// in the top left.
|
// in the top left.
|
||||||
var TitleBarHidden = TitleBar{
|
var MacTitleBarHidden = MacTitleBar{
|
||||||
AppearsTransparent: true,
|
AppearsTransparent: true,
|
||||||
Hide: false,
|
Hide: false,
|
||||||
HideTitle: true,
|
HideTitle: true,
|
||||||
@ -84,9 +84,9 @@ var TitleBarHidden = TitleBar{
|
|||||||
HideToolbarSeparator: false,
|
HideToolbarSeparator: false,
|
||||||
}
|
}
|
||||||
|
|
||||||
// TitleBarHiddenInset results in a hidden title bar with an alternative look where
|
// MacTitleBarHiddenInset results in a hidden title bar with an alternative look where
|
||||||
// the traffic light buttons are slightly more inset from the window edge.
|
// the traffic light buttons are slightly more inset from the window edge.
|
||||||
var TitleBarHiddenInset = TitleBar{
|
var MacTitleBarHiddenInset = MacTitleBar{
|
||||||
AppearsTransparent: true,
|
AppearsTransparent: true,
|
||||||
Hide: false,
|
Hide: false,
|
||||||
HideTitle: true,
|
HideTitle: true,
|
||||||
@ -95,9 +95,9 @@ var TitleBarHiddenInset = TitleBar{
|
|||||||
HideToolbarSeparator: true,
|
HideToolbarSeparator: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
// TitleBarHiddenInsetUnified results in a hidden title bar with an alternative look where
|
// MacTitleBarHiddenInsetUnified results in a hidden title bar with an alternative look where
|
||||||
// the traffic light buttons are even more inset from the window edge.
|
// the traffic light buttons are even more inset from the window edge.
|
||||||
var TitleBarHiddenInsetUnified = TitleBar{
|
var MacTitleBarHiddenInsetUnified = MacTitleBar{
|
||||||
AppearsTransparent: true,
|
AppearsTransparent: true,
|
||||||
Hide: false,
|
Hide: false,
|
||||||
HideTitle: true,
|
HideTitle: true,
|
7
v3/pkg/application/webview_drag.h
Normal file
7
v3/pkg/application/webview_drag.h
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
//go:build darwin
|
||||||
|
|
||||||
|
#import <AppKit/AppKit.h>
|
||||||
|
|
||||||
|
@interface WebviewDrag : NSView <NSDraggingDestination>
|
||||||
|
@property unsigned int windowId;
|
||||||
|
@end
|
59
v3/pkg/application/webview_drag.m
Normal file
59
v3/pkg/application/webview_drag.m
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
//go:build darwin
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
#import <AppKit/AppKit.h>
|
||||||
|
#import "webview_drag.h"
|
||||||
|
|
||||||
|
#import "../events/events.h"
|
||||||
|
|
||||||
|
extern void processDragItems(unsigned int windowId, char** arr, int length);
|
||||||
|
|
||||||
|
@implementation WebviewDrag
|
||||||
|
|
||||||
|
- (instancetype)initWithFrame:(NSRect)frameRect {
|
||||||
|
self = [super initWithFrame:frameRect];
|
||||||
|
if (self) {
|
||||||
|
[self registerForDraggedTypes:@[NSFilenamesPboardType]];
|
||||||
|
}
|
||||||
|
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSDragOperation)draggingEntered:(id<NSDraggingInfo>)sender {
|
||||||
|
NSPasteboard *pasteboard = [sender draggingPasteboard];
|
||||||
|
if ([[pasteboard types] containsObject:NSFilenamesPboardType]) {
|
||||||
|
processWindowEvent(self.windowId, EventWebViewDraggingEntered);
|
||||||
|
return NSDragOperationCopy;
|
||||||
|
}
|
||||||
|
return NSDragOperationNone;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
- (void)draggingExited:(id<NSDraggingInfo>)sender {
|
||||||
|
NSLog(@"I am here!!!!");
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL)prepareForDragOperation:(id<NSDraggingInfo>)sender {
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL)performDragOperation:(id<NSDraggingInfo>)sender {
|
||||||
|
NSPasteboard *pasteboard = [sender draggingPasteboard];
|
||||||
|
if ([[pasteboard types] containsObject:NSFilenamesPboardType]) {
|
||||||
|
NSArray *files = [pasteboard propertyListForType:NSFilenamesPboardType];
|
||||||
|
NSUInteger count = [files count];
|
||||||
|
char** cArray = (char**)malloc(count * sizeof(char*));
|
||||||
|
for (NSUInteger i = 0; i < count; i++) {
|
||||||
|
NSString* str = files[i];
|
||||||
|
cArray[i] = (char*)[str UTF8String];
|
||||||
|
}
|
||||||
|
processDragItems(self.windowId, cArray, (int)count);
|
||||||
|
free(cArray);
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface WebviewWindowDelegate : NSObject <NSWindowDelegate, WKScriptMessageHandler, WKNavigationDelegate, WKURLSchemeHandler>
|
@interface WebviewWindowDelegate : NSObject <NSWindowDelegate, WKScriptMessageHandler, WKNavigationDelegate, WKURLSchemeHandler, NSDraggingDestination>
|
||||||
|
|
||||||
@property bool hideOnClose;
|
@property bool hideOnClose;
|
||||||
@property (retain) WKWebView* webView;
|
@property (retain) WKWebView* webView;
|
||||||
@ -29,7 +29,6 @@
|
|||||||
- (void)handleLeftMouseUp:(NSWindow *)window;
|
- (void)handleLeftMouseUp:(NSWindow *)window;
|
||||||
- (void)handleLeftMouseDown:(NSEvent*)event;
|
- (void)handleLeftMouseDown:(NSEvent*)event;
|
||||||
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,16 +1,12 @@
|
|||||||
//go:build darwin
|
//go:build darwin
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
#import "webview_window.h"
|
#import "webview_window.h"
|
||||||
#import "../events/events.h"
|
#import "../events/events.h"
|
||||||
|
|
||||||
extern void processMessage(unsigned int, const char*);
|
extern void processMessage(unsigned int, const char*);
|
||||||
extern void processURLRequest(unsigned int, void *);
|
extern void processURLRequest(unsigned int, void *);
|
||||||
extern bool hasListeners(unsigned int);
|
extern bool hasListeners(unsigned int);
|
||||||
|
|
||||||
@implementation WebviewWindow
|
@implementation WebviewWindow
|
||||||
|
|
||||||
- (WebviewWindow*) initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)windowStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)deferCreation;
|
- (WebviewWindow*) initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)windowStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)deferCreation;
|
||||||
{
|
{
|
||||||
self = [super initWithContentRect:contentRect styleMask:windowStyle backing:bufferingType defer:deferCreation];
|
self = [super initWithContentRect:contentRect styleMask:windowStyle backing:bufferingType defer:deferCreation];
|
||||||
@ -20,11 +16,9 @@ extern bool hasListeners(unsigned int);
|
|||||||
[self setMovableByWindowBackground:YES];
|
[self setMovableByWindowBackground:YES];
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)canBecomeKeyWindow {
|
- (BOOL)canBecomeKeyWindow {
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL) canBecomeMainWindow {
|
- (BOOL) canBecomeMainWindow {
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
@ -38,9 +32,7 @@ extern bool hasListeners(unsigned int);
|
|||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation WebviewWindowDelegate
|
@implementation WebviewWindowDelegate
|
||||||
|
|
||||||
- (BOOL)windowShouldClose:(NSWindow *)sender {
|
- (BOOL)windowShouldClose:(NSWindow *)sender {
|
||||||
if( self.hideOnClose ) {
|
if( self.hideOnClose ) {
|
||||||
[NSApp hide:nil];
|
[NSApp hide:nil];
|
||||||
@ -48,7 +40,6 @@ extern bool hasListeners(unsigned int);
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle script messages from the external bridge
|
// Handle script messages from the external bridge
|
||||||
- (void)userContentController:(nonnull WKUserContentController *)userContentController didReceiveScriptMessage:(nonnull WKScriptMessage *)message {
|
- (void)userContentController:(nonnull WKUserContentController *)userContentController didReceiveScriptMessage:(nonnull WKScriptMessage *)message {
|
||||||
NSString *m = message.body;
|
NSString *m = message.body;
|
||||||
@ -83,11 +74,9 @@ extern bool hasListeners(unsigned int);
|
|||||||
- (void)handleLeftMouseUp:(NSWindow *)window {
|
- (void)handleLeftMouseUp:(NSWindow *)window {
|
||||||
self.leftMouseEvent = nil;
|
self.leftMouseEvent = nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)webView:(nonnull WKWebView *)webView startURLSchemeTask:(nonnull id<WKURLSchemeTask>)urlSchemeTask {
|
- (void)webView:(nonnull WKWebView *)webView startURLSchemeTask:(nonnull id<WKURLSchemeTask>)urlSchemeTask {
|
||||||
processURLRequest(self.windowId, urlSchemeTask);
|
processURLRequest(self.windowId, urlSchemeTask);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)webView:(nonnull WKWebView *)webView stopURLSchemeTask:(nonnull id<WKURLSchemeTask>)urlSchemeTask {
|
- (void)webView:(nonnull WKWebView *)webView stopURLSchemeTask:(nonnull id<WKURLSchemeTask>)urlSchemeTask {
|
||||||
NSInputStream *stream = urlSchemeTask.request.HTTPBodyStream;
|
NSInputStream *stream = urlSchemeTask.request.HTTPBodyStream;
|
||||||
if (stream) {
|
if (stream) {
|
||||||
@ -97,7 +86,6 @@ extern bool hasListeners(unsigned int);
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// GENERATED EVENTS START
|
// GENERATED EVENTS START
|
||||||
- (void)windowDidBecomeKey:(NSNotification *)notification {
|
- (void)windowDidBecomeKey:(NSNotification *)notification {
|
||||||
if( hasListeners(EventWindowDidBecomeKey) ) {
|
if( hasListeners(EventWindowDidBecomeKey) ) {
|
||||||
@ -561,5 +549,17 @@ extern bool hasListeners(unsigned int);
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)webView:(WKWebView *)webview draggingEntered:(WKNavigation *)navigation {
|
||||||
|
if( hasListeners(EventWebViewDraggingEntered) ) {
|
||||||
|
processWindowEvent(self.windowId, EventWebViewDraggingEntered);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)webView:(WKWebView *)webview draggingPerformed:(WKNavigation *)navigation {
|
||||||
|
if( hasListeners(EventWebViewDraggingPerformed) ) {
|
||||||
|
processWindowEvent(self.windowId, EventWebViewDraggingPerformed);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// GENERATED EVENTS END
|
// GENERATED EVENTS END
|
||||||
@end
|
@end
|
||||||
|
@ -3,6 +3,10 @@ package events
|
|||||||
type ApplicationEventType uint
|
type ApplicationEventType uint
|
||||||
type WindowEventType uint
|
type WindowEventType uint
|
||||||
|
|
||||||
|
const (
|
||||||
|
FilesDropped WindowEventType = iota
|
||||||
|
)
|
||||||
|
|
||||||
var Mac = newMacEvents()
|
var Mac = newMacEvents()
|
||||||
|
|
||||||
type macEvents struct {
|
type macEvents struct {
|
||||||
@ -126,129 +130,133 @@ type macEvents struct {
|
|||||||
WebViewDidReceiveServerRedirectForProvisionalNavigation WindowEventType
|
WebViewDidReceiveServerRedirectForProvisionalNavigation WindowEventType
|
||||||
WebViewDidFinishNavigation WindowEventType
|
WebViewDidFinishNavigation WindowEventType
|
||||||
WebViewDidCommitNavigation WindowEventType
|
WebViewDidCommitNavigation WindowEventType
|
||||||
|
WebViewDraggingEntered WindowEventType
|
||||||
|
WebViewDraggingPerformed WindowEventType
|
||||||
}
|
}
|
||||||
|
|
||||||
func newMacEvents() macEvents {
|
func newMacEvents() macEvents {
|
||||||
return macEvents{
|
return macEvents{
|
||||||
ApplicationDidBecomeActive: 0,
|
ApplicationDidBecomeActive: 1024,
|
||||||
ApplicationDidChangeBackingProperties: 1,
|
ApplicationDidChangeBackingProperties: 1025,
|
||||||
ApplicationDidChangeEffectiveAppearance: 2,
|
ApplicationDidChangeEffectiveAppearance: 1026,
|
||||||
ApplicationDidChangeIcon: 3,
|
ApplicationDidChangeIcon: 1027,
|
||||||
ApplicationDidChangeOcclusionState: 4,
|
ApplicationDidChangeOcclusionState: 1028,
|
||||||
ApplicationDidChangeScreenParameters: 5,
|
ApplicationDidChangeScreenParameters: 1029,
|
||||||
ApplicationDidChangeStatusBarFrame: 6,
|
ApplicationDidChangeStatusBarFrame: 1030,
|
||||||
ApplicationDidChangeStatusBarOrientation: 7,
|
ApplicationDidChangeStatusBarOrientation: 1031,
|
||||||
ApplicationDidFinishLaunching: 8,
|
ApplicationDidFinishLaunching: 1032,
|
||||||
ApplicationDidHide: 9,
|
ApplicationDidHide: 1033,
|
||||||
ApplicationDidResignActive: 10,
|
ApplicationDidResignActive: 1034,
|
||||||
ApplicationDidUnhide: 11,
|
ApplicationDidUnhide: 1035,
|
||||||
ApplicationDidUpdate: 12,
|
ApplicationDidUpdate: 1036,
|
||||||
ApplicationWillBecomeActive: 13,
|
ApplicationWillBecomeActive: 1037,
|
||||||
ApplicationWillFinishLaunching: 14,
|
ApplicationWillFinishLaunching: 1038,
|
||||||
ApplicationWillHide: 15,
|
ApplicationWillHide: 1039,
|
||||||
ApplicationWillResignActive: 16,
|
ApplicationWillResignActive: 1040,
|
||||||
ApplicationWillTerminate: 17,
|
ApplicationWillTerminate: 1041,
|
||||||
ApplicationWillUnhide: 18,
|
ApplicationWillUnhide: 1042,
|
||||||
ApplicationWillUpdate: 19,
|
ApplicationWillUpdate: 1043,
|
||||||
WindowDidBecomeKey: 20,
|
WindowDidBecomeKey: 1044,
|
||||||
WindowDidBecomeMain: 21,
|
WindowDidBecomeMain: 1045,
|
||||||
WindowDidBeginSheet: 22,
|
WindowDidBeginSheet: 1046,
|
||||||
WindowDidChangeAlpha: 23,
|
WindowDidChangeAlpha: 1047,
|
||||||
WindowDidChangeBackingLocation: 24,
|
WindowDidChangeBackingLocation: 1048,
|
||||||
WindowDidChangeBackingProperties: 25,
|
WindowDidChangeBackingProperties: 1049,
|
||||||
WindowDidChangeCollectionBehavior: 26,
|
WindowDidChangeCollectionBehavior: 1050,
|
||||||
WindowDidChangeEffectiveAppearance: 27,
|
WindowDidChangeEffectiveAppearance: 1051,
|
||||||
WindowDidChangeOcclusionState: 28,
|
WindowDidChangeOcclusionState: 1052,
|
||||||
WindowDidChangeOrderingMode: 29,
|
WindowDidChangeOrderingMode: 1053,
|
||||||
WindowDidChangeScreen: 30,
|
WindowDidChangeScreen: 1054,
|
||||||
WindowDidChangeScreenParameters: 31,
|
WindowDidChangeScreenParameters: 1055,
|
||||||
WindowDidChangeScreenProfile: 32,
|
WindowDidChangeScreenProfile: 1056,
|
||||||
WindowDidChangeScreenSpace: 33,
|
WindowDidChangeScreenSpace: 1057,
|
||||||
WindowDidChangeScreenSpaceProperties: 34,
|
WindowDidChangeScreenSpaceProperties: 1058,
|
||||||
WindowDidChangeSharingType: 35,
|
WindowDidChangeSharingType: 1059,
|
||||||
WindowDidChangeSpace: 36,
|
WindowDidChangeSpace: 1060,
|
||||||
WindowDidChangeSpaceOrderingMode: 37,
|
WindowDidChangeSpaceOrderingMode: 1061,
|
||||||
WindowDidChangeTitle: 38,
|
WindowDidChangeTitle: 1062,
|
||||||
WindowDidChangeToolbar: 39,
|
WindowDidChangeToolbar: 1063,
|
||||||
WindowDidChangeVisibility: 40,
|
WindowDidChangeVisibility: 1064,
|
||||||
WindowDidClose: 41,
|
WindowDidClose: 1065,
|
||||||
WindowDidDeminiaturize: 42,
|
WindowDidDeminiaturize: 1066,
|
||||||
WindowDidEndSheet: 43,
|
WindowDidEndSheet: 1067,
|
||||||
WindowDidEnterFullScreen: 44,
|
WindowDidEnterFullScreen: 1068,
|
||||||
WindowDidEnterVersionBrowser: 45,
|
WindowDidEnterVersionBrowser: 1069,
|
||||||
WindowDidExitFullScreen: 46,
|
WindowDidExitFullScreen: 1070,
|
||||||
WindowDidExitVersionBrowser: 47,
|
WindowDidExitVersionBrowser: 1071,
|
||||||
WindowDidExpose: 48,
|
WindowDidExpose: 1072,
|
||||||
WindowDidFocus: 49,
|
WindowDidFocus: 1073,
|
||||||
WindowDidMiniaturize: 50,
|
WindowDidMiniaturize: 1074,
|
||||||
WindowDidMove: 51,
|
WindowDidMove: 1075,
|
||||||
WindowDidOrderOffScreen: 52,
|
WindowDidOrderOffScreen: 1076,
|
||||||
WindowDidOrderOnScreen: 53,
|
WindowDidOrderOnScreen: 1077,
|
||||||
WindowDidResignKey: 54,
|
WindowDidResignKey: 1078,
|
||||||
WindowDidResignMain: 55,
|
WindowDidResignMain: 1079,
|
||||||
WindowDidResize: 56,
|
WindowDidResize: 1080,
|
||||||
WindowDidUnfocus: 57,
|
WindowDidUnfocus: 1081,
|
||||||
WindowDidUpdate: 58,
|
WindowDidUpdate: 1082,
|
||||||
WindowDidUpdateAlpha: 59,
|
WindowDidUpdateAlpha: 1083,
|
||||||
WindowDidUpdateCollectionBehavior: 60,
|
WindowDidUpdateCollectionBehavior: 1084,
|
||||||
WindowDidUpdateCollectionProperties: 61,
|
WindowDidUpdateCollectionProperties: 1085,
|
||||||
WindowDidUpdateShadow: 62,
|
WindowDidUpdateShadow: 1086,
|
||||||
WindowDidUpdateTitle: 63,
|
WindowDidUpdateTitle: 1087,
|
||||||
WindowDidUpdateToolbar: 64,
|
WindowDidUpdateToolbar: 1088,
|
||||||
WindowDidUpdateVisibility: 65,
|
WindowDidUpdateVisibility: 1089,
|
||||||
WindowWillBecomeKey: 66,
|
WindowWillBecomeKey: 1090,
|
||||||
WindowWillBecomeMain: 67,
|
WindowWillBecomeMain: 1091,
|
||||||
WindowWillBeginSheet: 68,
|
WindowWillBeginSheet: 1092,
|
||||||
WindowWillChangeOrderingMode: 69,
|
WindowWillChangeOrderingMode: 1093,
|
||||||
WindowWillClose: 70,
|
WindowWillClose: 1094,
|
||||||
WindowWillDeminiaturize: 71,
|
WindowWillDeminiaturize: 1095,
|
||||||
WindowWillEnterFullScreen: 72,
|
WindowWillEnterFullScreen: 1096,
|
||||||
WindowWillEnterVersionBrowser: 73,
|
WindowWillEnterVersionBrowser: 1097,
|
||||||
WindowWillExitFullScreen: 74,
|
WindowWillExitFullScreen: 1098,
|
||||||
WindowWillExitVersionBrowser: 75,
|
WindowWillExitVersionBrowser: 1099,
|
||||||
WindowWillFocus: 76,
|
WindowWillFocus: 1100,
|
||||||
WindowWillMiniaturize: 77,
|
WindowWillMiniaturize: 1101,
|
||||||
WindowWillMove: 78,
|
WindowWillMove: 1102,
|
||||||
WindowWillOrderOffScreen: 79,
|
WindowWillOrderOffScreen: 1103,
|
||||||
WindowWillOrderOnScreen: 80,
|
WindowWillOrderOnScreen: 1104,
|
||||||
WindowWillResignMain: 81,
|
WindowWillResignMain: 1105,
|
||||||
WindowWillResize: 82,
|
WindowWillResize: 1106,
|
||||||
WindowWillUnfocus: 83,
|
WindowWillUnfocus: 1107,
|
||||||
WindowWillUpdate: 84,
|
WindowWillUpdate: 1108,
|
||||||
WindowWillUpdateAlpha: 85,
|
WindowWillUpdateAlpha: 1109,
|
||||||
WindowWillUpdateCollectionBehavior: 86,
|
WindowWillUpdateCollectionBehavior: 1110,
|
||||||
WindowWillUpdateCollectionProperties: 87,
|
WindowWillUpdateCollectionProperties: 1111,
|
||||||
WindowWillUpdateShadow: 88,
|
WindowWillUpdateShadow: 1112,
|
||||||
WindowWillUpdateTitle: 89,
|
WindowWillUpdateTitle: 1113,
|
||||||
WindowWillUpdateToolbar: 90,
|
WindowWillUpdateToolbar: 1114,
|
||||||
WindowWillUpdateVisibility: 91,
|
WindowWillUpdateVisibility: 1115,
|
||||||
WindowWillUseStandardFrame: 92,
|
WindowWillUseStandardFrame: 1116,
|
||||||
MenuWillOpen: 93,
|
MenuWillOpen: 1117,
|
||||||
MenuDidOpen: 94,
|
MenuDidOpen: 1118,
|
||||||
MenuDidClose: 95,
|
MenuDidClose: 1119,
|
||||||
MenuWillSendAction: 96,
|
MenuWillSendAction: 1120,
|
||||||
MenuDidSendAction: 97,
|
MenuDidSendAction: 1121,
|
||||||
MenuWillHighlightItem: 98,
|
MenuWillHighlightItem: 1122,
|
||||||
MenuDidHighlightItem: 99,
|
MenuDidHighlightItem: 1123,
|
||||||
MenuWillDisplayItem: 100,
|
MenuWillDisplayItem: 1124,
|
||||||
MenuDidDisplayItem: 101,
|
MenuDidDisplayItem: 1125,
|
||||||
MenuWillAddItem: 102,
|
MenuWillAddItem: 1126,
|
||||||
MenuDidAddItem: 103,
|
MenuDidAddItem: 1127,
|
||||||
MenuWillRemoveItem: 104,
|
MenuWillRemoveItem: 1128,
|
||||||
MenuDidRemoveItem: 105,
|
MenuDidRemoveItem: 1129,
|
||||||
MenuWillBeginTracking: 106,
|
MenuWillBeginTracking: 1130,
|
||||||
MenuDidBeginTracking: 107,
|
MenuDidBeginTracking: 1131,
|
||||||
MenuWillEndTracking: 108,
|
MenuWillEndTracking: 1132,
|
||||||
MenuDidEndTracking: 109,
|
MenuDidEndTracking: 1133,
|
||||||
MenuWillUpdate: 110,
|
MenuWillUpdate: 1134,
|
||||||
MenuDidUpdate: 111,
|
MenuDidUpdate: 1135,
|
||||||
MenuWillPopUp: 112,
|
MenuWillPopUp: 1136,
|
||||||
MenuDidPopUp: 113,
|
MenuDidPopUp: 1137,
|
||||||
MenuWillSendActionToItem: 114,
|
MenuWillSendActionToItem: 1138,
|
||||||
MenuDidSendActionToItem: 115,
|
MenuDidSendActionToItem: 1139,
|
||||||
WebViewDidStartProvisionalNavigation: 116,
|
WebViewDidStartProvisionalNavigation: 1140,
|
||||||
WebViewDidReceiveServerRedirectForProvisionalNavigation: 117,
|
WebViewDidReceiveServerRedirectForProvisionalNavigation: 1141,
|
||||||
WebViewDidFinishNavigation: 118,
|
WebViewDidFinishNavigation: 1142,
|
||||||
WebViewDidCommitNavigation: 119,
|
WebViewDidCommitNavigation: 1143,
|
||||||
|
WebViewDraggingEntered: 1144,
|
||||||
|
WebViewDraggingPerformed: 1145,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,128 +6,130 @@
|
|||||||
extern void processApplicationEvent(unsigned int);
|
extern void processApplicationEvent(unsigned int);
|
||||||
extern void processWindowEvent(unsigned int, unsigned int);
|
extern void processWindowEvent(unsigned int, unsigned int);
|
||||||
|
|
||||||
#define EventApplicationDidBecomeActive 0
|
#define EventApplicationDidBecomeActive 1024
|
||||||
#define EventApplicationDidChangeBackingProperties 1
|
#define EventApplicationDidChangeBackingProperties 1025
|
||||||
#define EventApplicationDidChangeEffectiveAppearance 2
|
#define EventApplicationDidChangeEffectiveAppearance 1026
|
||||||
#define EventApplicationDidChangeIcon 3
|
#define EventApplicationDidChangeIcon 1027
|
||||||
#define EventApplicationDidChangeOcclusionState 4
|
#define EventApplicationDidChangeOcclusionState 1028
|
||||||
#define EventApplicationDidChangeScreenParameters 5
|
#define EventApplicationDidChangeScreenParameters 1029
|
||||||
#define EventApplicationDidChangeStatusBarFrame 6
|
#define EventApplicationDidChangeStatusBarFrame 1030
|
||||||
#define EventApplicationDidChangeStatusBarOrientation 7
|
#define EventApplicationDidChangeStatusBarOrientation 1031
|
||||||
#define EventApplicationDidFinishLaunching 8
|
#define EventApplicationDidFinishLaunching 1032
|
||||||
#define EventApplicationDidHide 9
|
#define EventApplicationDidHide 1033
|
||||||
#define EventApplicationDidResignActive 10
|
#define EventApplicationDidResignActive 1034
|
||||||
#define EventApplicationDidUnhide 11
|
#define EventApplicationDidUnhide 1035
|
||||||
#define EventApplicationDidUpdate 12
|
#define EventApplicationDidUpdate 1036
|
||||||
#define EventApplicationWillBecomeActive 13
|
#define EventApplicationWillBecomeActive 1037
|
||||||
#define EventApplicationWillFinishLaunching 14
|
#define EventApplicationWillFinishLaunching 1038
|
||||||
#define EventApplicationWillHide 15
|
#define EventApplicationWillHide 1039
|
||||||
#define EventApplicationWillResignActive 16
|
#define EventApplicationWillResignActive 1040
|
||||||
#define EventApplicationWillTerminate 17
|
#define EventApplicationWillTerminate 1041
|
||||||
#define EventApplicationWillUnhide 18
|
#define EventApplicationWillUnhide 1042
|
||||||
#define EventApplicationWillUpdate 19
|
#define EventApplicationWillUpdate 1043
|
||||||
#define EventWindowDidBecomeKey 20
|
#define EventWindowDidBecomeKey 1044
|
||||||
#define EventWindowDidBecomeMain 21
|
#define EventWindowDidBecomeMain 1045
|
||||||
#define EventWindowDidBeginSheet 22
|
#define EventWindowDidBeginSheet 1046
|
||||||
#define EventWindowDidChangeAlpha 23
|
#define EventWindowDidChangeAlpha 1047
|
||||||
#define EventWindowDidChangeBackingLocation 24
|
#define EventWindowDidChangeBackingLocation 1048
|
||||||
#define EventWindowDidChangeBackingProperties 25
|
#define EventWindowDidChangeBackingProperties 1049
|
||||||
#define EventWindowDidChangeCollectionBehavior 26
|
#define EventWindowDidChangeCollectionBehavior 1050
|
||||||
#define EventWindowDidChangeEffectiveAppearance 27
|
#define EventWindowDidChangeEffectiveAppearance 1051
|
||||||
#define EventWindowDidChangeOcclusionState 28
|
#define EventWindowDidChangeOcclusionState 1052
|
||||||
#define EventWindowDidChangeOrderingMode 29
|
#define EventWindowDidChangeOrderingMode 1053
|
||||||
#define EventWindowDidChangeScreen 30
|
#define EventWindowDidChangeScreen 1054
|
||||||
#define EventWindowDidChangeScreenParameters 31
|
#define EventWindowDidChangeScreenParameters 1055
|
||||||
#define EventWindowDidChangeScreenProfile 32
|
#define EventWindowDidChangeScreenProfile 1056
|
||||||
#define EventWindowDidChangeScreenSpace 33
|
#define EventWindowDidChangeScreenSpace 1057
|
||||||
#define EventWindowDidChangeScreenSpaceProperties 34
|
#define EventWindowDidChangeScreenSpaceProperties 1058
|
||||||
#define EventWindowDidChangeSharingType 35
|
#define EventWindowDidChangeSharingType 1059
|
||||||
#define EventWindowDidChangeSpace 36
|
#define EventWindowDidChangeSpace 1060
|
||||||
#define EventWindowDidChangeSpaceOrderingMode 37
|
#define EventWindowDidChangeSpaceOrderingMode 1061
|
||||||
#define EventWindowDidChangeTitle 38
|
#define EventWindowDidChangeTitle 1062
|
||||||
#define EventWindowDidChangeToolbar 39
|
#define EventWindowDidChangeToolbar 1063
|
||||||
#define EventWindowDidChangeVisibility 40
|
#define EventWindowDidChangeVisibility 1064
|
||||||
#define EventWindowDidClose 41
|
#define EventWindowDidClose 1065
|
||||||
#define EventWindowDidDeminiaturize 42
|
#define EventWindowDidDeminiaturize 1066
|
||||||
#define EventWindowDidEndSheet 43
|
#define EventWindowDidEndSheet 1067
|
||||||
#define EventWindowDidEnterFullScreen 44
|
#define EventWindowDidEnterFullScreen 1068
|
||||||
#define EventWindowDidEnterVersionBrowser 45
|
#define EventWindowDidEnterVersionBrowser 1069
|
||||||
#define EventWindowDidExitFullScreen 46
|
#define EventWindowDidExitFullScreen 1070
|
||||||
#define EventWindowDidExitVersionBrowser 47
|
#define EventWindowDidExitVersionBrowser 1071
|
||||||
#define EventWindowDidExpose 48
|
#define EventWindowDidExpose 1072
|
||||||
#define EventWindowDidFocus 49
|
#define EventWindowDidFocus 1073
|
||||||
#define EventWindowDidMiniaturize 50
|
#define EventWindowDidMiniaturize 1074
|
||||||
#define EventWindowDidMove 51
|
#define EventWindowDidMove 1075
|
||||||
#define EventWindowDidOrderOffScreen 52
|
#define EventWindowDidOrderOffScreen 1076
|
||||||
#define EventWindowDidOrderOnScreen 53
|
#define EventWindowDidOrderOnScreen 1077
|
||||||
#define EventWindowDidResignKey 54
|
#define EventWindowDidResignKey 1078
|
||||||
#define EventWindowDidResignMain 55
|
#define EventWindowDidResignMain 1079
|
||||||
#define EventWindowDidResize 56
|
#define EventWindowDidResize 1080
|
||||||
#define EventWindowDidUnfocus 57
|
#define EventWindowDidUnfocus 1081
|
||||||
#define EventWindowDidUpdate 58
|
#define EventWindowDidUpdate 1082
|
||||||
#define EventWindowDidUpdateAlpha 59
|
#define EventWindowDidUpdateAlpha 1083
|
||||||
#define EventWindowDidUpdateCollectionBehavior 60
|
#define EventWindowDidUpdateCollectionBehavior 1084
|
||||||
#define EventWindowDidUpdateCollectionProperties 61
|
#define EventWindowDidUpdateCollectionProperties 1085
|
||||||
#define EventWindowDidUpdateShadow 62
|
#define EventWindowDidUpdateShadow 1086
|
||||||
#define EventWindowDidUpdateTitle 63
|
#define EventWindowDidUpdateTitle 1087
|
||||||
#define EventWindowDidUpdateToolbar 64
|
#define EventWindowDidUpdateToolbar 1088
|
||||||
#define EventWindowDidUpdateVisibility 65
|
#define EventWindowDidUpdateVisibility 1089
|
||||||
#define EventWindowWillBecomeKey 66
|
#define EventWindowWillBecomeKey 1090
|
||||||
#define EventWindowWillBecomeMain 67
|
#define EventWindowWillBecomeMain 1091
|
||||||
#define EventWindowWillBeginSheet 68
|
#define EventWindowWillBeginSheet 1092
|
||||||
#define EventWindowWillChangeOrderingMode 69
|
#define EventWindowWillChangeOrderingMode 1093
|
||||||
#define EventWindowWillClose 70
|
#define EventWindowWillClose 1094
|
||||||
#define EventWindowWillDeminiaturize 71
|
#define EventWindowWillDeminiaturize 1095
|
||||||
#define EventWindowWillEnterFullScreen 72
|
#define EventWindowWillEnterFullScreen 1096
|
||||||
#define EventWindowWillEnterVersionBrowser 73
|
#define EventWindowWillEnterVersionBrowser 1097
|
||||||
#define EventWindowWillExitFullScreen 74
|
#define EventWindowWillExitFullScreen 1098
|
||||||
#define EventWindowWillExitVersionBrowser 75
|
#define EventWindowWillExitVersionBrowser 1099
|
||||||
#define EventWindowWillFocus 76
|
#define EventWindowWillFocus 1100
|
||||||
#define EventWindowWillMiniaturize 77
|
#define EventWindowWillMiniaturize 1101
|
||||||
#define EventWindowWillMove 78
|
#define EventWindowWillMove 1102
|
||||||
#define EventWindowWillOrderOffScreen 79
|
#define EventWindowWillOrderOffScreen 1103
|
||||||
#define EventWindowWillOrderOnScreen 80
|
#define EventWindowWillOrderOnScreen 1104
|
||||||
#define EventWindowWillResignMain 81
|
#define EventWindowWillResignMain 1105
|
||||||
#define EventWindowWillResize 82
|
#define EventWindowWillResize 1106
|
||||||
#define EventWindowWillUnfocus 83
|
#define EventWindowWillUnfocus 1107
|
||||||
#define EventWindowWillUpdate 84
|
#define EventWindowWillUpdate 1108
|
||||||
#define EventWindowWillUpdateAlpha 85
|
#define EventWindowWillUpdateAlpha 1109
|
||||||
#define EventWindowWillUpdateCollectionBehavior 86
|
#define EventWindowWillUpdateCollectionBehavior 1110
|
||||||
#define EventWindowWillUpdateCollectionProperties 87
|
#define EventWindowWillUpdateCollectionProperties 1111
|
||||||
#define EventWindowWillUpdateShadow 88
|
#define EventWindowWillUpdateShadow 1112
|
||||||
#define EventWindowWillUpdateTitle 89
|
#define EventWindowWillUpdateTitle 1113
|
||||||
#define EventWindowWillUpdateToolbar 90
|
#define EventWindowWillUpdateToolbar 1114
|
||||||
#define EventWindowWillUpdateVisibility 91
|
#define EventWindowWillUpdateVisibility 1115
|
||||||
#define EventWindowWillUseStandardFrame 92
|
#define EventWindowWillUseStandardFrame 1116
|
||||||
#define EventMenuWillOpen 93
|
#define EventMenuWillOpen 1117
|
||||||
#define EventMenuDidOpen 94
|
#define EventMenuDidOpen 1118
|
||||||
#define EventMenuDidClose 95
|
#define EventMenuDidClose 1119
|
||||||
#define EventMenuWillSendAction 96
|
#define EventMenuWillSendAction 1120
|
||||||
#define EventMenuDidSendAction 97
|
#define EventMenuDidSendAction 1121
|
||||||
#define EventMenuWillHighlightItem 98
|
#define EventMenuWillHighlightItem 1122
|
||||||
#define EventMenuDidHighlightItem 99
|
#define EventMenuDidHighlightItem 1123
|
||||||
#define EventMenuWillDisplayItem 100
|
#define EventMenuWillDisplayItem 1124
|
||||||
#define EventMenuDidDisplayItem 101
|
#define EventMenuDidDisplayItem 1125
|
||||||
#define EventMenuWillAddItem 102
|
#define EventMenuWillAddItem 1126
|
||||||
#define EventMenuDidAddItem 103
|
#define EventMenuDidAddItem 1127
|
||||||
#define EventMenuWillRemoveItem 104
|
#define EventMenuWillRemoveItem 1128
|
||||||
#define EventMenuDidRemoveItem 105
|
#define EventMenuDidRemoveItem 1129
|
||||||
#define EventMenuWillBeginTracking 106
|
#define EventMenuWillBeginTracking 1130
|
||||||
#define EventMenuDidBeginTracking 107
|
#define EventMenuDidBeginTracking 1131
|
||||||
#define EventMenuWillEndTracking 108
|
#define EventMenuWillEndTracking 1132
|
||||||
#define EventMenuDidEndTracking 109
|
#define EventMenuDidEndTracking 1133
|
||||||
#define EventMenuWillUpdate 110
|
#define EventMenuWillUpdate 1134
|
||||||
#define EventMenuDidUpdate 111
|
#define EventMenuDidUpdate 1135
|
||||||
#define EventMenuWillPopUp 112
|
#define EventMenuWillPopUp 1136
|
||||||
#define EventMenuDidPopUp 113
|
#define EventMenuDidPopUp 1137
|
||||||
#define EventMenuWillSendActionToItem 114
|
#define EventMenuWillSendActionToItem 1138
|
||||||
#define EventMenuDidSendActionToItem 115
|
#define EventMenuDidSendActionToItem 1139
|
||||||
#define EventWebViewDidStartProvisionalNavigation 116
|
#define EventWebViewDidStartProvisionalNavigation 1140
|
||||||
#define EventWebViewDidReceiveServerRedirectForProvisionalNavigation 117
|
#define EventWebViewDidReceiveServerRedirectForProvisionalNavigation 1141
|
||||||
#define EventWebViewDidFinishNavigation 118
|
#define EventWebViewDidFinishNavigation 1142
|
||||||
#define EventWebViewDidCommitNavigation 119
|
#define EventWebViewDidCommitNavigation 1143
|
||||||
|
#define EventWebViewDraggingEntered 1144
|
||||||
|
#define EventWebViewDraggingPerformed 1145
|
||||||
|
|
||||||
#define MAX_EVENTS 120
|
#define MAX_EVENTS 1146
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
@ -118,4 +118,7 @@ mac:WebViewDidStartProvisionalNavigation
|
|||||||
mac:WebViewDidReceiveServerRedirectForProvisionalNavigation
|
mac:WebViewDidReceiveServerRedirectForProvisionalNavigation
|
||||||
mac:WebViewDidFinishNavigation
|
mac:WebViewDidFinishNavigation
|
||||||
mac:WebViewDidCommitNavigation
|
mac:WebViewDidCommitNavigation
|
||||||
|
mac:WebViewDraggingEntered
|
||||||
|
mac:WebViewDraggingPerformed
|
||||||
|
|
||||||
|
|
||||||
|
@ -12,6 +12,10 @@ var eventsGo = `package events
|
|||||||
type ApplicationEventType uint
|
type ApplicationEventType uint
|
||||||
type WindowEventType uint
|
type WindowEventType uint
|
||||||
|
|
||||||
|
const (
|
||||||
|
FilesDropped WindowEventType = iota
|
||||||
|
)
|
||||||
|
|
||||||
var Mac = newMacEvents()
|
var Mac = newMacEvents()
|
||||||
|
|
||||||
type macEvents struct {
|
type macEvents struct {
|
||||||
@ -54,6 +58,9 @@ func main() {
|
|||||||
// Loop over each line in the file
|
// Loop over each line in the file
|
||||||
for id, line = range bytes.Split(eventNames, []byte{'\n'}) {
|
for id, line = range bytes.Split(eventNames, []byte{'\n'}) {
|
||||||
|
|
||||||
|
// First 1024 is reserved
|
||||||
|
id = id + 1024
|
||||||
|
|
||||||
// Skip empty lines
|
// Skip empty lines
|
||||||
if len(line) == 0 {
|
if len(line) == 0 {
|
||||||
continue
|
continue
|
||||||
@ -143,7 +150,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Load the window_delegate.m file
|
// Load the window_delegate.m file
|
||||||
windowDelegate, err := os.ReadFile("../../pkg/application/window_delegate.m")
|
windowDelegate, err := os.ReadFile("../../pkg/application/webview_window.m")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
@ -173,7 +180,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
err = os.WriteFile("../../pkg/application/window_delegate.m", buffer.Bytes(), 0755)
|
err = os.WriteFile("../../pkg/application/webview_window.m", buffer.Bytes(), 0755)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user