Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: Qt Frontend #3024

Closed
wants to merge 16 commits into from
6 changes: 4 additions & 2 deletions v2/examples/customlayout/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module changeme

go 1.18
go 1.21

toolchain go1.21.3

require github.com/wailsapp/wails/v2 v2.1.0

Expand All @@ -24,7 +26,7 @@ require (
github.com/tkrajina/go-reflector v0.5.6 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasttemplate v1.2.2 // indirect
github.com/wailsapp/go-webview2 v1.0.7 // indirect
github.com/wailsapp/go-webview2 v1.0.10 // indirect
github.com/wailsapp/mimetype v1.4.1 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 // indirect
Expand Down
1 change: 1 addition & 0 deletions v2/examples/customlayout/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQ
github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
github.com/wailsapp/go-webview2 v1.0.7 h1:s95+7irJsAsTy1RsjJ6N0cYX7tZ4gP7Uzawds0L2urs=
github.com/wailsapp/go-webview2 v1.0.7/go.mod h1:Uk2BePfCRzttBBjFrBmqKGJd41P6QIHeV9kTgIeOZNo=
github.com/wailsapp/go-webview2 v1.0.10/go.mod h1:Uk2BePfCRzttBBjFrBmqKGJd41P6QIHeV9kTgIeOZNo=
github.com/wailsapp/mimetype v1.4.1 h1:pQN9ycO7uo4vsUUuPeHEYoUkLVkaRntMnHJxVwYhwHs=
github.com/wailsapp/mimetype v1.4.1/go.mod h1:9aV5k31bBOv5z6u+QP8TltzvNGJPmNJD4XlAL3U+j3o=
golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc=
Expand Down
4 changes: 3 additions & 1 deletion v2/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module github.com/wailsapp/wails/v2

go 1.18
go 1.21

toolchain go1.21.3

require (
github.com/Masterminds/semver v1.5.0
Expand Down
5 changes: 3 additions & 2 deletions v2/internal/frontend/desktop/desktop_linux.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
//go:build linux
// +build linux
//go:build linux && !qt
// +build linux,!qt

package desktop

import (
"context"

"github.com/wailsapp/wails/v2/internal/binding"
"github.com/wailsapp/wails/v2/internal/frontend"
"github.com/wailsapp/wails/v2/internal/frontend/desktop/linux"
Expand Down
18 changes: 18 additions & 0 deletions v2/internal/frontend/desktop/desktop_qt.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//go:build qt
// +build qt

package desktop

import (
"context"

"github.com/wailsapp/wails/v2/internal/binding"
"github.com/wailsapp/wails/v2/internal/frontend"
"github.com/wailsapp/wails/v2/internal/frontend/desktop/qt"
"github.com/wailsapp/wails/v2/internal/logger"
"github.com/wailsapp/wails/v2/pkg/options"
)

func NewFrontend(ctx context.Context, appoptions *options.App, logger *logger.Logger, appBindings *binding.Bindings, dispatcher frontend.Dispatcher) frontend.Frontend {
return qt.NewFrontend(ctx, appoptions, logger, appBindings, dispatcher)
}
4 changes: 2 additions & 2 deletions v2/internal/frontend/desktop/linux/browser.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build linux
// +build linux
//go:build linux && !qt
// +build linux,!qt

package linux

Expand Down
4 changes: 2 additions & 2 deletions v2/internal/frontend/desktop/linux/calloc.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build linux
// +build linux
//go:build linux && !qt
// +build linux,!qt

package linux

Expand Down
4 changes: 2 additions & 2 deletions v2/internal/frontend/desktop/linux/clipboard.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build linux
// +build linux
//go:build linux && !qt
// +build linux,!qt

package linux

Expand Down
7 changes: 4 additions & 3 deletions v2/internal/frontend/desktop/linux/dialog.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
//go:build linux
// +build linux
//go:build linux && !qt
// +build linux,!qt

package linux

import (
"github.com/wailsapp/wails/v2/internal/frontend"
"unsafe"

"github.com/wailsapp/wails/v2/internal/frontend"
)

/*
Expand Down
5 changes: 2 additions & 3 deletions v2/internal/frontend/desktop/linux/frontend.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build linux
// +build linux
//go:build linux && !qt
// +build linux,!qt

package linux

Expand Down Expand Up @@ -105,7 +105,6 @@ const startURL = "wails://wails/"
var secondInstanceBuffer = make(chan options.SecondInstanceData, 1)

type Frontend struct {

// Context
ctx context.Context

Expand Down
4 changes: 2 additions & 2 deletions v2/internal/frontend/desktop/linux/gtk.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build linux
// +build linux
//go:build linux && !qt
// +build linux,!qt

package linux

Expand Down
4 changes: 2 additions & 2 deletions v2/internal/frontend/desktop/linux/invoke.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build linux
// +build linux
//go:build linux && !qt
// +build linux,!qt

package linux

Expand Down
4 changes: 2 additions & 2 deletions v2/internal/frontend/desktop/linux/keys.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build linux
// +build linux
//go:build linux && !qt
// +build linux,!qt

package linux

Expand Down
11 changes: 7 additions & 4 deletions v2/internal/frontend/desktop/linux/menu.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build linux
// +build linux
//go:build linux && !qt
// +build linux,!qt

package linux

Expand Down Expand Up @@ -32,8 +32,11 @@ void addAccelerator(GtkWidget* menuItem, GtkAccelGroup* group, guint key, GdkMod
}
*/
import "C"
import "github.com/wailsapp/wails/v2/pkg/menu"
import "unsafe"
import (
"unsafe"

"github.com/wailsapp/wails/v2/pkg/menu"
)

var menuIdCounter int
var menuItemToId map[*menu.MenuItem]int
Expand Down
4 changes: 2 additions & 2 deletions v2/internal/frontend/desktop/linux/screen.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build linux
// +build linux
//go:build linux && !qt
// +build linux,!qt

package linux

Expand Down
9 changes: 5 additions & 4 deletions v2/internal/frontend/desktop/linux/single_instance.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
//go:build linux
// +build linux
//go:build linux && !qt
// +build linux,!qt

package linux

import (
"encoding/json"
"github.com/godbus/dbus/v5"
"github.com/wailsapp/wails/v2/pkg/options"
"os"
"strings"

"github.com/godbus/dbus/v5"
"github.com/wailsapp/wails/v2/pkg/options"
)

type dbusHandler func(string)
Expand Down
2 changes: 1 addition & 1 deletion v2/internal/frontend/desktop/linux/webkit2.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:build linux
//go:build linux && !qt

package linux

Expand Down
4 changes: 2 additions & 2 deletions v2/internal/frontend/desktop/linux/window.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build linux
// +build linux
//go:build linux && !qt
// +build linux,!qt

package linux

Expand Down