cutego/sailfish/sailfish.go

112 lines
1.9 KiB
Go
Raw Normal View History

// +build !sailfish,!sailfish_emulator
2016-06-19 05:24:38 +03:00
package sailfish
import (
2023-01-23 17:12:32 +03:00
"github.com/bluszcz/cutego"
"github.com/bluszcz/cutego/core"
"github.com/bluszcz/cutego/gui"
"github.com/bluszcz/cutego/quick"
"strings"
2016-06-19 05:24:38 +03:00
"unsafe"
)
type SailfishApp struct {
internal.Internal
2016-06-19 05:24:38 +03:00
}
type SailfishApp_ITF interface {
SailfishApp_PTR() *SailfishApp
}
2017-01-14 02:36:20 +03:00
func (ptr *SailfishApp) SailfishApp_PTR() *SailfishApp {
return ptr
2016-06-19 05:24:38 +03:00
}
2017-01-14 02:36:20 +03:00
func (ptr *SailfishApp) Pointer() unsafe.Pointer {
if ptr != nil {
return unsafe.Pointer(ptr.Internal.Pointer())
2016-06-19 05:24:38 +03:00
}
return nil
}
2017-01-14 02:36:20 +03:00
func (ptr *SailfishApp) SetPointer(p unsafe.Pointer) {
if ptr != nil {
ptr.Internal.SetPointer(uintptr(p))
2016-06-19 05:24:38 +03:00
}
}
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
2016-06-19 05:24:38 +03:00
}
initial commit of the interop engine + new flutter module + fixes for minor issues this commit introduces the new experimental `interop` module, which is used to allow the use of `therecipe/qt` from languages other than go or javascript. as a start, there was support for the dart language added (currently only in combination with a custom flutter embedder engine, but plain dart support should follow soon). the interop module makes great use of the qml/js interop functions and logic that were written to make `https://github.com/therecipe/entry` possible. additional languages that are planned to be supported in the near future are: swift, kotlin and haxe (maybe with support for the c#, python and java targets, but if this isn't possible in some clean way then these languages will receive standalone bindings as well). people using `therecipe/qt` from these new languages should then be able to use flutter (and dart) in combination with qt (and go/js) through this binding and also be able to easily communicate across the language barriers with the help of the interop functions. the interop engine theoretically also makes a cgo-less `therecipe/qt` usage possible, which could be used to workaround the ever growing annoyances that are experienced when using cgo projects in combination with go modules. the code for the custom flutter embedder that was created to make the flutter/dart binding work can be found in the `flutter` module. it currently only supports debug builds for the desktop targets, but if there is enough interest, then it shouldn't be too difficult to make release builds there, and on the mobile targets work as well (or even on "embedded" systems such as an raspberry pi for that matter). an example repo how to use the new flutter/dart binding, will be published in the next few days.
2020-06-01 22:27:56 +03:00
func (ptr *SailfishApp) DestroySailfishApp() {
}
2016-06-19 05:24:38 +03:00
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
}