cutego/sailfish/sailfish.go
therecipe 0506a9f95d re-gen and make the cgo-less version the default one
This commit replaces the default (cgo) binding with a cgo-less one, which was generated by setting "QT_GEN_GO=true" prior running qtsetup.

The cgo-less version is still experimental and also lacking integration with most of the advanced features provided by qtmoc and qtrcc, but it should already be sufficiently stable and cover a great part of the basic features.

The intention for these changes are to simplify and speedup onboarding of new users, speedup development circles of existing users, simplify the usage of this package in a go module context and also to have the portable therecipe/qt runtime (http://github.com/therecipe/box) tested more broadly.

Also since this version removes all dependencies on cgo, one is now able to "go get" an project that makes use of therecipe/qt like this: ("go get -ldflags="-w" github.com/therecipe/examples/basic/widgets && $(go env GOPATH)/bin/widgets") without any additional requirements.
2020-08-17 19:25:49 +02:00

119 lines
2 KiB
Go

// +build !sailfish,!sailfish_emulator
package sailfish
import (
"github.com/therecipe/qt/core"
"github.com/therecipe/qt/gui"
"github.com/therecipe/qt/internal"
"github.com/therecipe/qt/quick"
"strings"
"unsafe"
)
func unpackStringList(s string) []string {
if len(s) == 0 {
return make([]string, 0)
}
return strings.Split(s, "¡¦!")
}
type SailfishApp struct {
internal.Internal
}
type SailfishApp_ITF interface {
SailfishApp_PTR() *SailfishApp
}
func (ptr *SailfishApp) SailfishApp_PTR() *SailfishApp {
return ptr
}
func (ptr *SailfishApp) Pointer() unsafe.Pointer {
if ptr != nil {
return unsafe.Pointer(ptr.Internal.Pointer())
}
return nil
}
func (ptr *SailfishApp) SetPointer(p unsafe.Pointer) {
if ptr != nil {
ptr.Internal.SetPointer(uintptr(p))
}
}
func PointerFromSailfishApp(ptr SailfishApp_ITF) unsafe.Pointer {
if ptr != nil {
return ptr.SailfishApp_PTR().Pointer()
}
return nil
}
func (n *SailfishApp) ClassNameInternalF() string {
return n.Internal.ClassNameInternalF()
}
func NewSailfishAppFromPointer(ptr unsafe.Pointer) (n *SailfishApp) {
n = new(SailfishApp)
n.InitFromInternal(uintptr(ptr), "sailfish.SailfishApp")
return
}
func (ptr *SailfishApp) DestroySailfishApp() {
}
func SailfishApp_Application(argc int, argv []string) *gui.QGuiApplication {
return nil
}
func (ptr *SailfishApp) Application(argc int, argv []string) *gui.QGuiApplication {
return nil
}
func SailfishApp_Main(argc int, argv []string) int {
return 0
}
func (ptr *SailfishApp) Main(argc int, argv []string) int {
return 0
}
func SailfishApp_CreateView() *quick.QQuickView {
return nil
}
func (ptr *SailfishApp) CreateView() *quick.QQuickView {
return nil
}
func SailfishApp_PathTo(filename string) *core.QUrl {
return nil
}
func (ptr *SailfishApp) PathTo(filename string) *core.QUrl {
return nil
}
func SailfishApp_PathToMainQml() *core.QUrl {
return nil
}
func (ptr *SailfishApp) PathToMainQml() *core.QUrl {
return nil
}
func init() {
internal.ConstructorTable["sailfish.SailfishApp"] = NewSailfishAppFromPointer
}