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.
This commit is contained in:
therecipe 2020-06-01 21:27:56 +02:00
parent bb0c051b43
commit 4e7b8703b1
83 changed files with 9572 additions and 154 deletions

2
.gitignore vendored
View file

@ -17,6 +17,8 @@ Mfile*
*/minimal_*
*/*.d.ts
interop/moc*
/internal/binding/dump/*
/internal/binding/runtime/moc*
/internal/cmd/moc/test/**/moc*

View file

@ -1,26 +1,28 @@
Introduction
------------
[Qt](https://en.wikipedia.org/wiki/Qt_(software)) is a cross-platform application framework that is used for developing application software that can be run on various software and hardware platforms with little or no change in the underlying codebase.
[Qt](https://en.wikipedia.org/wiki/Qt_(software)) is a free and open-source widget toolkit for creating graphical user interfaces as well as cross-platform applications that run on various software and hardware platforms with little or no change in the underlying codebase.
[Go](https://en.wikipedia.org/wiki/Go_(programming_language)) (often referred to as golang) is a programming language created at Google.
[Go](https://en.wikipedia.org/wiki/Go_(programming_language)), also known as Golang, is a programming language designed at Google.
This package allows you to write Qt applications entirely in Go and makes deploying them later very easy.
[therecipe/qt](https://github.com/therecipe/qt) allows you to write Qt applications entirely in Go or JavaScript.
[Gallery](https://github.com/therecipe/qt/wiki/Gallery) of example applications making use of this package.
Beside the language bindings provided, `therecipe/qt` also greatly simplifies the deployment of Qt applications to various software and hardware platforms.
[WebAssembly Demo (new)](https://therecipe.github.io/entry) | *[repo](https://github.com/therecipe/entry)*
At the time of writing, almost all Qt functions and classes are accessible from Go and JavaScript, and you should be able to find everything you need to build fully featured Qt applications.
[WebAssembly Demo (old)](https://therecipe.github.io/widgets_playground) | *[repo](https://github.com/therecipe/widgets_playground)*
Impressions
-----------
Status
------
[Gallery](https://github.com/therecipe/qt/wiki/Gallery) of example applications.
Almost all Qt functions and classes are accessible from Go and you should be able to find everything you need to build fully featured applications.
[JavaScript Demo](https://therecipe.github.io/entry) | *[source](https://github.com/therecipe/entry)*
Installation
------------
The following instructions assume that you already installed [Go](https://golang.org/dl/)
##### Windows [(more info)](https://github.com/therecipe/qt/wiki/Installation-on-Windows)
```powershell
@ -43,7 +45,7 @@ export GO111MODULE=off; go get -v github.com/therecipe/qt/cmd/... && $(go env GO
Resources
---------
- [General Installation](https://github.com/therecipe/qt/wiki/Installation)
- [Installation](https://github.com/therecipe/qt/wiki/Installation)
- [Getting Started](https://github.com/therecipe/qt/wiki/Getting-Started)
- [Wiki](https://github.com/therecipe/qt/wiki)
- [Qt Documentation](https://doc.qt.io/qt-5/classes.html)
@ -76,4 +78,4 @@ License
This package is released under [LGPLv3](https://opensource.org/licenses/LGPL-3.0)
Qt is available under multiple [licenses](https://www.qt.io/licensing)
Qt itself is licensed and available under multiple [licenses](https://www.qt.io/licensing).

View file

@ -59,7 +59,8 @@ func NewQAndroidActivityResultReceiverFromPointer(ptr unsafe.Pointer) (n *QAndro
return
}
func (ptr *QAndroidActivityResultReceiver) DestroyQAndroidActivityResultReceiver() {}
func (ptr *QAndroidActivityResultReceiver) DestroyQAndroidActivityResultReceiver() {
}
func (ptr *QAndroidActivityResultReceiver) ConnectHandleActivityResult(f func(receiverRequestCode int, resultCode int, data *QAndroidJniObject)) {
@ -111,7 +112,8 @@ func NewQAndroidBinderFromPointer(ptr unsafe.Pointer) (n *QAndroidBinder) {
return
}
func (ptr *QAndroidBinder) DestroyQAndroidBinder() {}
func (ptr *QAndroidBinder) DestroyQAndroidBinder() {
}
//go:generate stringer -type=QAndroidBinder__CallType
//QAndroidBinder::CallType
@ -180,7 +182,8 @@ func NewQAndroidIntentFromPointer(ptr unsafe.Pointer) (n *QAndroidIntent) {
return
}
func (ptr *QAndroidIntent) DestroyQAndroidIntent() {}
func (ptr *QAndroidIntent) DestroyQAndroidIntent() {
}
func NewQAndroidIntent() *QAndroidIntent {
@ -1070,7 +1073,8 @@ func NewQAndroidParcelFromPointer(ptr unsafe.Pointer) (n *QAndroidParcel) {
return
}
func (ptr *QAndroidParcel) DestroyQAndroidParcel() {}
func (ptr *QAndroidParcel) DestroyQAndroidParcel() {
}
func NewQAndroidParcel() *QAndroidParcel {
@ -1162,7 +1166,8 @@ func NewQAndroidServiceFromPointer(ptr unsafe.Pointer) (n *QAndroidService) {
return
}
func (ptr *QAndroidService) DestroyQAndroidService() {}
func (ptr *QAndroidService) DestroyQAndroidService() {
}
func NewQAndroidService(argc int, argv []string) *QAndroidService {
@ -1324,7 +1329,8 @@ func NewQAndroidServiceConnectionFromPointer(ptr unsafe.Pointer) (n *QAndroidSer
return
}
func (ptr *QAndroidServiceConnection) DestroyQAndroidServiceConnection() {}
func (ptr *QAndroidServiceConnection) DestroyQAndroidServiceConnection() {
}
func NewQAndroidServiceConnection() *QAndroidServiceConnection {
@ -1403,7 +1409,8 @@ func NewQtAndroidFromPointer(ptr unsafe.Pointer) (n *QtAndroid) {
return
}
func (ptr *QtAndroid) DestroyQtAndroid() {}
func (ptr *QtAndroid) DestroyQtAndroid() {
}
//go:generate stringer -type=QtAndroid__BindFlag
//QtAndroid::BindFlag

View file

@ -27,7 +27,7 @@ func cGoUnpackBytes(s C.struct_QtAndroidExtras_PackedString) []byte {
defer cGoFreePacked(s.ptr)
if int(s.len) == -1 {
gs := C.GoString(s.data)
return *(*[]byte)(unsafe.Pointer(&gs))
return []byte(gs)
}
return C.GoBytes(unsafe.Pointer(s.data), C.int(s.len))
}

View file

@ -28,7 +28,7 @@ func cGoUnpackBytes(s C.struct_QtBluetooth_PackedString) []byte {
defer cGoFreePacked(s.ptr)
if int(s.len) == -1 {
gs := C.GoString(s.data)
return *(*[]byte)(unsafe.Pointer(&gs))
return []byte(gs)
}
return C.GoBytes(unsafe.Pointer(s.data), C.int(s.len))
}

View file

@ -28,7 +28,7 @@ func cGoUnpackBytes(s C.struct_QtCharts_PackedString) []byte {
defer cGoFreePacked(s.ptr)
if int(s.len) == -1 {
gs := C.GoString(s.data)
return *(*[]byte)(unsafe.Pointer(&gs))
return []byte(gs)
}
return C.GoBytes(unsafe.Pointer(s.data), C.int(s.len))
}

View file

@ -12297,6 +12297,26 @@ long long QLibrary_LoadHints(void* ptr)
return static_cast<QLibrary*>(ptr)->loadHints();
}
void* QLibrary_Resolve(void* ptr, char* symbol)
{
return reinterpret_cast<void*>(static_cast<QLibrary*>(ptr)->resolve(const_cast<const char*>(symbol)));
}
void* QLibrary_QLibrary_Resolve2(struct QtCore_PackedString fileName, char* symbol)
{
return reinterpret_cast<void*>(QLibrary::resolve(QString::fromUtf8(fileName.data, fileName.len), const_cast<const char*>(symbol)));
}
void* QLibrary_QLibrary_Resolve3(struct QtCore_PackedString fileName, int verNum, char* symbol)
{
return reinterpret_cast<void*>(QLibrary::resolve(QString::fromUtf8(fileName.data, fileName.len), verNum, const_cast<const char*>(symbol)));
}
void* QLibrary_QLibrary_Resolve4(struct QtCore_PackedString fileName, struct QtCore_PackedString version, char* symbol)
{
return reinterpret_cast<void*>(QLibrary::resolve(QString::fromUtf8(fileName.data, fileName.len), QString::fromUtf8(version.data, version.len), const_cast<const char*>(symbol)));
}
void QLibrary_SetFileName(void* ptr, struct QtCore_PackedString fileName)
{
static_cast<QLibrary*>(ptr)->setFileName(QString::fromUtf8(fileName.data, fileName.len));

View file

@ -28,7 +28,7 @@ func cGoUnpackBytes(s C.struct_QtCore_PackedString) []byte {
defer cGoFreePacked(s.ptr)
if int(s.len) == -1 {
gs := C.GoString(s.data)
return *(*[]byte)(unsafe.Pointer(&gs))
return []byte(gs)
}
return C.GoBytes(unsafe.Pointer(s.data), C.int(s.len))
}
@ -26409,6 +26409,112 @@ func (ptr *QLibrary) LoadHints() QLibrary__LoadHint {
return 0
}
func (ptr *QLibrary) Resolve(symbol string) unsafe.Pointer {
if ptr.Pointer() != nil {
var symbolC *C.char
if symbol != "" {
symbolC = C.CString(symbol)
defer C.free(unsafe.Pointer(symbolC))
}
return C.QLibrary_Resolve(ptr.Pointer(), symbolC)
}
return nil
}
func QLibrary_Resolve2(fileName string, symbol string) unsafe.Pointer {
var fileNameC *C.char
if fileName != "" {
fileNameC = C.CString(fileName)
defer C.free(unsafe.Pointer(fileNameC))
}
var symbolC *C.char
if symbol != "" {
symbolC = C.CString(symbol)
defer C.free(unsafe.Pointer(symbolC))
}
return C.QLibrary_QLibrary_Resolve2(C.struct_QtCore_PackedString{data: fileNameC, len: C.longlong(len(fileName))}, symbolC)
}
func (ptr *QLibrary) Resolve2(fileName string, symbol string) unsafe.Pointer {
var fileNameC *C.char
if fileName != "" {
fileNameC = C.CString(fileName)
defer C.free(unsafe.Pointer(fileNameC))
}
var symbolC *C.char
if symbol != "" {
symbolC = C.CString(symbol)
defer C.free(unsafe.Pointer(symbolC))
}
return C.QLibrary_QLibrary_Resolve2(C.struct_QtCore_PackedString{data: fileNameC, len: C.longlong(len(fileName))}, symbolC)
}
func QLibrary_Resolve3(fileName string, verNum int, symbol string) unsafe.Pointer {
var fileNameC *C.char
if fileName != "" {
fileNameC = C.CString(fileName)
defer C.free(unsafe.Pointer(fileNameC))
}
var symbolC *C.char
if symbol != "" {
symbolC = C.CString(symbol)
defer C.free(unsafe.Pointer(symbolC))
}
return C.QLibrary_QLibrary_Resolve3(C.struct_QtCore_PackedString{data: fileNameC, len: C.longlong(len(fileName))}, C.int(int32(verNum)), symbolC)
}
func (ptr *QLibrary) Resolve3(fileName string, verNum int, symbol string) unsafe.Pointer {
var fileNameC *C.char
if fileName != "" {
fileNameC = C.CString(fileName)
defer C.free(unsafe.Pointer(fileNameC))
}
var symbolC *C.char
if symbol != "" {
symbolC = C.CString(symbol)
defer C.free(unsafe.Pointer(symbolC))
}
return C.QLibrary_QLibrary_Resolve3(C.struct_QtCore_PackedString{data: fileNameC, len: C.longlong(len(fileName))}, C.int(int32(verNum)), symbolC)
}
func QLibrary_Resolve4(fileName string, version string, symbol string) unsafe.Pointer {
var fileNameC *C.char
if fileName != "" {
fileNameC = C.CString(fileName)
defer C.free(unsafe.Pointer(fileNameC))
}
var versionC *C.char
if version != "" {
versionC = C.CString(version)
defer C.free(unsafe.Pointer(versionC))
}
var symbolC *C.char
if symbol != "" {
symbolC = C.CString(symbol)
defer C.free(unsafe.Pointer(symbolC))
}
return C.QLibrary_QLibrary_Resolve4(C.struct_QtCore_PackedString{data: fileNameC, len: C.longlong(len(fileName))}, C.struct_QtCore_PackedString{data: versionC, len: C.longlong(len(version))}, symbolC)
}
func (ptr *QLibrary) Resolve4(fileName string, version string, symbol string) unsafe.Pointer {
var fileNameC *C.char
if fileName != "" {
fileNameC = C.CString(fileName)
defer C.free(unsafe.Pointer(fileNameC))
}
var versionC *C.char
if version != "" {
versionC = C.CString(version)
defer C.free(unsafe.Pointer(versionC))
}
var symbolC *C.char
if symbol != "" {
symbolC = C.CString(symbol)
defer C.free(unsafe.Pointer(symbolC))
}
return C.QLibrary_QLibrary_Resolve4(C.struct_QtCore_PackedString{data: fileNameC, len: C.longlong(len(fileName))}, C.struct_QtCore_PackedString{data: versionC, len: C.longlong(len(version))}, symbolC)
}
func (ptr *QLibrary) SetFileName(fileName string) {
if ptr.Pointer() != nil {
var fileNameC *C.char
@ -54984,7 +55090,7 @@ func NewQVariant1(i interface{}) *QVariant {
return NewQVariant1(uint64(s.Interface().(uintptr)))
}
if s.Type().ConvertibleTo(reflect.TypeOf(int8(0))) {
if i != nil && s.Type().ConvertibleTo(reflect.TypeOf(int8(0))) {
if s.Kind() == reflect.Int64 {
return NewQVariant1(s.Convert(reflect.TypeOf(int64(0))).Interface())
}
@ -61256,6 +61362,11 @@ func init() {
qt.ItfMap["core.QArrayData_ITF"] = QArrayData{}
qt.ItfMap["core.QArrayDataPointer_ITF"] = QArrayDataPointer{}
qt.ItfMap["core.QAssociativeIterable_ITF"] = QAssociativeIterable{}
qt.ItfMap["core.QAtomicInt_ITF"] = QAtomicInt{}
qt.ItfMap["core.QAtomicInteger_ITF"] = QAtomicInteger{}
qt.ItfMap["core.QAtomicOps_ITF"] = QAtomicOps{}
qt.ItfMap["core.QAtomicPointer_ITF"] = QAtomicPointer{}
qt.ItfMap["core.QAtomicTraits_ITF"] = QAtomicTraits{}
qt.ItfMap["core.QBEInteger_ITF"] = QBEInteger{}
qt.ItfMap["core.QBasicAtomicInteger_ITF"] = QBasicAtomicInteger{}
qt.ItfMap["core.QBasicAtomicPointer_ITF"] = QBasicAtomicPointer{}
@ -61297,6 +61408,7 @@ func init() {
qt.FuncMap["core.NewQByteArrayMatcher3"] = NewQByteArrayMatcher3
qt.FuncMap["core.NewQByteArrayMatcher4"] = NewQByteArrayMatcher4
qt.ItfMap["core.QByteRef_ITF"] = QByteRef{}
qt.ItfMap["core.QCache_ITF"] = QCache{}
qt.ItfMap["core.QCborArray_ITF"] = QCborArray{}
qt.FuncMap["core.NewQCborArray"] = NewQCborArray
qt.FuncMap["core.NewQCborArray2"] = NewQCborArray2
@ -61325,6 +61437,7 @@ func init() {
qt.FuncMap["core.QCborMap_FromJsonObject"] = QCborMap_FromJsonObject
qt.FuncMap["core.QCborMap_FromVariantHash"] = QCborMap_FromVariantHash
qt.ItfMap["core.QCborParserError_ITF"] = QCborParserError{}
qt.ItfMap["core.QCborStreamReader_ITF"] = QCborStreamReader{}
qt.EnumMap["core.QCborStreamReader__UnsignedInteger"] = int64(QCborStreamReader__UnsignedInteger)
qt.EnumMap["core.QCborStreamReader__NegativeInteger"] = int64(QCborStreamReader__NegativeInteger)
qt.EnumMap["core.QCborStreamReader__ByteString"] = int64(QCborStreamReader__ByteString)
@ -61343,6 +61456,8 @@ func init() {
qt.EnumMap["core.QCborStreamReader__EndOfString"] = int64(QCborStreamReader__EndOfString)
qt.EnumMap["core.QCborStreamReader__Ok"] = int64(QCborStreamReader__Ok)
qt.EnumMap["core.QCborStreamReader__Error"] = int64(QCborStreamReader__Error)
qt.ItfMap["core.QCborStreamWriter_ITF"] = QCborStreamWriter{}
qt.ItfMap["core.QCborValue_ITF"] = QCborValue{}
qt.EnumMap["core.QCborValue__SortKeysInMaps"] = int64(QCborValue__SortKeysInMaps)
qt.EnumMap["core.QCborValue__UseFloat"] = int64(QCborValue__UseFloat)
qt.EnumMap["core.QCborValue__UseFloat16"] = int64(QCborValue__UseFloat16)
@ -61695,6 +61810,7 @@ func init() {
qt.EnumMap["core.QCommandLineParser__ParseAsPositionalArguments"] = int64(QCommandLineParser__ParseAsPositionalArguments)
qt.ItfMap["core.QConcatenateTablesProxyModel_ITF"] = QConcatenateTablesProxyModel{}
qt.FuncMap["core.NewQConcatenateTablesProxyModel"] = NewQConcatenateTablesProxyModel
qt.ItfMap["core.QContiguousCache_ITF"] = QContiguousCache{}
qt.ItfMap["core.QContiguousCacheData_ITF"] = QContiguousCacheData{}
qt.ItfMap["core.QContiguousCacheTypedData_ITF"] = QContiguousCacheTypedData{}
qt.ItfMap["core.QCoreApplication_ITF"] = QCoreApplication{}
@ -61908,6 +62024,7 @@ func init() {
qt.EnumMap["core.QDir__LocaleAware"] = int64(QDir__LocaleAware)
qt.EnumMap["core.QDir__Type"] = int64(QDir__Type)
qt.EnumMap["core.QDir__NoSort"] = int64(QDir__NoSort)
qt.ItfMap["core.QDirIterator_ITF"] = QDirIterator{}
qt.EnumMap["core.QDirIterator__NoIteratorFlags"] = int64(QDirIterator__NoIteratorFlags)
qt.EnumMap["core.QDirIterator__FollowSymlinks"] = int64(QDirIterator__FollowSymlinks)
qt.EnumMap["core.QDirIterator__Subdirectories"] = int64(QDirIterator__Subdirectories)
@ -62169,6 +62286,8 @@ func init() {
qt.ItfMap["core.QEventTransition_ITF"] = QEventTransition{}
qt.FuncMap["core.NewQEventTransition"] = NewQEventTransition
qt.FuncMap["core.NewQEventTransition2"] = NewQEventTransition2
qt.ItfMap["core.QException_ITF"] = QException{}
qt.ItfMap["core.QExplicitlySharedDataPointer_ITF"] = QExplicitlySharedDataPointer{}
qt.ItfMap["core.QFactoryInterface_ITF"] = QFactoryInterface{}
qt.ItfMap["core.QFile_ITF"] = QFile{}
qt.FuncMap["core.NewQFile"] = NewQFile
@ -62242,15 +62361,23 @@ func init() {
qt.FuncMap["core.NewQFlag2"] = NewQFlag2
qt.FuncMap["core.NewQFlag3"] = NewQFlag3
qt.FuncMap["core.NewQFlag4"] = NewQFlag4
qt.ItfMap["core.QFlags_ITF"] = QFlags{}
qt.ItfMap["core.QFuture_ITF"] = QFuture{}
qt.ItfMap["core.QFutureInterface_ITF"] = QFutureInterface{}
qt.ItfMap["core.QFutureInterfaceBase_ITF"] = QFutureInterfaceBase{}
qt.ItfMap["core.QFutureIterator_ITF"] = QFutureIterator{}
qt.ItfMap["core.QFutureSynchronizer_ITF"] = QFutureSynchronizer{}
qt.ItfMap["core.QFutureWatcher_ITF"] = QFutureWatcher{}
qt.ItfMap["core.QFutureWatcherBase_ITF"] = QFutureWatcherBase{}
qt.ItfMap["core.QGenericArgument_ITF"] = QGenericArgument{}
qt.FuncMap["core.NewQGenericArgument"] = NewQGenericArgument
qt.ItfMap["core.QGenericAtomicOps_ITF"] = QGenericAtomicOps{}
qt.ItfMap["core.QGenericReturnArgument_ITF"] = QGenericReturnArgument{}
qt.FuncMap["core.NewQGenericReturnArgument"] = NewQGenericReturnArgument
qt.ItfMap["core.QGlobalStatic_ITF"] = QGlobalStatic{}
qt.ItfMap["core.QHash_ITF"] = QHash{}
qt.ItfMap["core.QHashData_ITF"] = QHashData{}
qt.ItfMap["core.QHashIterator_ITF"] = QHashIterator{}
qt.ItfMap["core.QHashNode_ITF"] = QHashNode{}
qt.ItfMap["core.QHistoryState_ITF"] = QHistoryState{}
qt.FuncMap["core.NewQHistoryState"] = NewQHistoryState
@ -62361,6 +62488,7 @@ func init() {
qt.EnumMap["core.QJsonValue__Undefined"] = int64(QJsonValue__Undefined)
qt.ItfMap["core.QJsonValuePtr_ITF"] = QJsonValuePtr{}
qt.ItfMap["core.QJsonValueRefPtr_ITF"] = QJsonValueRefPtr{}
qt.ItfMap["core.QKeyValueIterator_ITF"] = QKeyValueIterator{}
qt.ItfMap["core.QLEInteger_ITF"] = QLEInteger{}
qt.ItfMap["core.QLatin1Char_ITF"] = QLatin1Char{}
qt.FuncMap["core.NewQLatin1Char"] = NewQLatin1Char
@ -62376,6 +62504,9 @@ func init() {
qt.FuncMap["core.NewQLibrary3"] = NewQLibrary3
qt.FuncMap["core.NewQLibrary4"] = NewQLibrary4
qt.FuncMap["core.QLibrary_IsLibrary"] = QLibrary_IsLibrary
qt.FuncMap["core.QLibrary_Resolve2"] = QLibrary_Resolve2
qt.FuncMap["core.QLibrary_Resolve3"] = QLibrary_Resolve3
qt.FuncMap["core.QLibrary_Resolve4"] = QLibrary_Resolve4
qt.EnumMap["core.QLibrary__ResolveAllSymbolsHint"] = int64(QLibrary__ResolveAllSymbolsHint)
qt.EnumMap["core.QLibrary__ExportExternalSymbolsHint"] = int64(QLibrary__ExportExternalSymbolsHint)
qt.EnumMap["core.QLibrary__LoadArchiveMemberHint"] = int64(QLibrary__LoadArchiveMemberHint)
@ -62413,8 +62544,11 @@ func init() {
qt.EnumMap["core.QLineF__NoIntersection"] = int64(QLineF__NoIntersection)
qt.EnumMap["core.QLineF__BoundedIntersection"] = int64(QLineF__BoundedIntersection)
qt.EnumMap["core.QLineF__UnboundedIntersection"] = int64(QLineF__UnboundedIntersection)
qt.ItfMap["core.QLinkedList_ITF"] = QLinkedList{}
qt.ItfMap["core.QLinkedListIterator_ITF"] = QLinkedListIterator{}
qt.ItfMap["core.QLinkedListNode_ITF"] = QLinkedListNode{}
qt.ItfMap["core.QListData_ITF"] = QListData{}
qt.ItfMap["core.QListIterator_ITF"] = QListIterator{}
qt.ItfMap["core.QListSpecialMethods_ITF"] = QListSpecialMethods{}
qt.ItfMap["core.QLittleEndianStorageType_ITF"] = QLittleEndianStorageType{}
qt.ItfMap["core.QLocale_ITF"] = QLocale{}
@ -63262,8 +63396,10 @@ func init() {
qt.FuncMap["core.NewQLoggingCategory2"] = NewQLoggingCategory2
qt.FuncMap["core.QLoggingCategory_DefaultCategory"] = QLoggingCategory_DefaultCategory
qt.FuncMap["core.QLoggingCategory_SetFilterRules"] = QLoggingCategory_SetFilterRules
qt.ItfMap["core.QMap_ITF"] = QMap{}
qt.ItfMap["core.QMapData_ITF"] = QMapData{}
qt.ItfMap["core.QMapDataBase_ITF"] = QMapDataBase{}
qt.ItfMap["core.QMapIterator_ITF"] = QMapIterator{}
qt.ItfMap["core.QMapNode_ITF"] = QMapNode{}
qt.ItfMap["core.QMapNodeBase_ITF"] = QMapNodeBase{}
qt.ItfMap["core.QMargins_ITF"] = QMargins{}
@ -63427,6 +63563,14 @@ func init() {
qt.FuncMap["core.NewQMimeType2"] = NewQMimeType2
qt.ItfMap["core.QModelIndex_ITF"] = QModelIndex{}
qt.FuncMap["core.NewQModelIndex"] = NewQModelIndex
qt.ItfMap["core.QMultiHash_ITF"] = QMultiHash{}
qt.ItfMap["core.QMultiMap_ITF"] = QMultiMap{}
qt.ItfMap["core.QMutableHashIterator_ITF"] = QMutableHashIterator{}
qt.ItfMap["core.QMutableLinkedListIterator_ITF"] = QMutableLinkedListIterator{}
qt.ItfMap["core.QMutableListIterator_ITF"] = QMutableListIterator{}
qt.ItfMap["core.QMutableMapIterator_ITF"] = QMutableMapIterator{}
qt.ItfMap["core.QMutableSetIterator_ITF"] = QMutableSetIterator{}
qt.ItfMap["core.QMutableVectorIterator_ITF"] = QMutableVectorIterator{}
qt.ItfMap["core.QMutex_ITF"] = QMutex{}
qt.FuncMap["core.NewQMutex"] = NewQMutex
qt.EnumMap["core.QMutex__NonRecursive"] = int64(QMutex__NonRecursive)
@ -63475,6 +63619,7 @@ func init() {
qt.EnumMap["core.QOperatingSystemVersion__TvOS"] = int64(QOperatingSystemVersion__TvOS)
qt.EnumMap["core.QOperatingSystemVersion__WatchOS"] = int64(QOperatingSystemVersion__WatchOS)
qt.EnumMap["core.QOperatingSystemVersion__Android"] = int64(QOperatingSystemVersion__Android)
qt.ItfMap["core.QPair_ITF"] = QPair{}
qt.ItfMap["core.QParallelAnimationGroup_ITF"] = QParallelAnimationGroup{}
qt.FuncMap["core.NewQParallelAnimationGroup"] = NewQParallelAnimationGroup
qt.ItfMap["core.QPauseAnimation_ITF"] = QPauseAnimation{}
@ -63497,6 +63642,7 @@ func init() {
qt.FuncMap["core.NewQPointF2"] = NewQPointF2
qt.FuncMap["core.NewQPointF3"] = NewQPointF3
qt.FuncMap["core.QPointF_DotProduct"] = QPointF_DotProduct
qt.ItfMap["core.QPointer_ITF"] = QPointer{}
qt.ItfMap["core.QProcess_ITF"] = QProcess{}
qt.FuncMap["core.NewQProcess"] = NewQProcess
qt.FuncMap["core.QProcess_Execute"] = QProcess_Execute
@ -63532,6 +63678,7 @@ func init() {
qt.ItfMap["core.QPropertyAnimation_ITF"] = QPropertyAnimation{}
qt.FuncMap["core.NewQPropertyAnimation"] = NewQPropertyAnimation
qt.FuncMap["core.NewQPropertyAnimation2"] = NewQPropertyAnimation2
qt.ItfMap["core.QQueue_ITF"] = QQueue{}
qt.ItfMap["core.QRandomGenerator_ITF"] = QRandomGenerator{}
qt.FuncMap["core.NewQRandomGenerator"] = NewQRandomGenerator
qt.FuncMap["core.NewQRandomGenerator5"] = NewQRandomGenerator5
@ -63598,6 +63745,7 @@ func init() {
qt.ItfMap["core.QRegularExpressionMatch_ITF"] = QRegularExpressionMatch{}
qt.FuncMap["core.NewQRegularExpressionMatch"] = NewQRegularExpressionMatch
qt.FuncMap["core.NewQRegularExpressionMatch2"] = NewQRegularExpressionMatch2
qt.ItfMap["core.QRegularExpressionMatchIterator_ITF"] = QRegularExpressionMatchIterator{}
qt.ItfMap["core.QResource_ITF"] = QResource{}
qt.FuncMap["core.NewQResource"] = NewQResource
qt.FuncMap["core.QResource_RegisterResource"] = QResource_RegisterResource
@ -63614,10 +63762,14 @@ func init() {
qt.FuncMap["core.NewQSaveFile"] = NewQSaveFile
qt.FuncMap["core.NewQSaveFile2"] = NewQSaveFile2
qt.FuncMap["core.NewQSaveFile3"] = NewQSaveFile3
qt.ItfMap["core.QScopeGuard_ITF"] = QScopeGuard{}
qt.ItfMap["core.QScopedArrayPointer_ITF"] = QScopedArrayPointer{}
qt.ItfMap["core.QScopedPointer_ITF"] = QScopedPointer{}
qt.ItfMap["core.QScopedPointerArrayDeleter_ITF"] = QScopedPointerArrayDeleter{}
qt.ItfMap["core.QScopedPointerDeleter_ITF"] = QScopedPointerDeleter{}
qt.ItfMap["core.QScopedPointerObjectDeleteLater_ITF"] = QScopedPointerObjectDeleteLater{}
qt.ItfMap["core.QScopedPointerPodDeleter_ITF"] = QScopedPointerPodDeleter{}
qt.ItfMap["core.QScopedValueRollback_ITF"] = QScopedValueRollback{}
qt.ItfMap["core.QSemaphore_ITF"] = QSemaphore{}
qt.FuncMap["core.NewQSemaphore"] = NewQSemaphore
qt.ItfMap["core.QSemaphoreReleaser_ITF"] = QSemaphoreReleaser{}
@ -63627,6 +63779,8 @@ func init() {
qt.ItfMap["core.QSequentialAnimationGroup_ITF"] = QSequentialAnimationGroup{}
qt.FuncMap["core.NewQSequentialAnimationGroup"] = NewQSequentialAnimationGroup
qt.ItfMap["core.QSequentialIterable_ITF"] = QSequentialIterable{}
qt.ItfMap["core.QSet_ITF"] = QSet{}
qt.ItfMap["core.QSetIterator_ITF"] = QSetIterator{}
qt.ItfMap["core.QSettings_ITF"] = QSettings{}
qt.FuncMap["core.NewQSettings"] = NewQSettings
qt.FuncMap["core.NewQSettings2"] = NewQSettings2
@ -63666,6 +63820,7 @@ func init() {
qt.ItfMap["core.QSharedData_ITF"] = QSharedData{}
qt.FuncMap["core.NewQSharedData"] = NewQSharedData
qt.FuncMap["core.NewQSharedData2"] = NewQSharedData2
qt.ItfMap["core.QSharedDataPointer_ITF"] = QSharedDataPointer{}
qt.ItfMap["core.QSharedMemory_ITF"] = QSharedMemory{}
qt.FuncMap["core.NewQSharedMemory"] = NewQSharedMemory
qt.FuncMap["core.NewQSharedMemory2"] = NewQSharedMemory2
@ -63680,9 +63835,11 @@ func init() {
qt.EnumMap["core.QSharedMemory__LockError"] = int64(QSharedMemory__LockError)
qt.EnumMap["core.QSharedMemory__OutOfResources"] = int64(QSharedMemory__OutOfResources)
qt.EnumMap["core.QSharedMemory__UnknownError"] = int64(QSharedMemory__UnknownError)
qt.ItfMap["core.QSharedPointer_ITF"] = QSharedPointer{}
qt.ItfMap["core.QSignalBlocker_ITF"] = QSignalBlocker{}
qt.FuncMap["core.NewQSignalBlocker"] = NewQSignalBlocker
qt.FuncMap["core.NewQSignalBlocker2"] = NewQSignalBlocker2
qt.ItfMap["core.QSignalMapper_ITF"] = QSignalMapper{}
qt.ItfMap["core.QSignalTransition_ITF"] = QSignalTransition{}
qt.FuncMap["core.NewQSignalTransition"] = NewQSignalTransition
qt.FuncMap["core.NewQSignalTransition2"] = NewQSignalTransition2
@ -63700,6 +63857,7 @@ func init() {
qt.ItfMap["core.QSortFilterProxyModel_ITF"] = QSortFilterProxyModel{}
qt.FuncMap["core.NewQSortFilterProxyModel"] = NewQSortFilterProxyModel
qt.ItfMap["core.QSpecialInteger_ITF"] = QSpecialInteger{}
qt.ItfMap["core.QStack_ITF"] = QStack{}
qt.ItfMap["core.QStandardPaths_ITF"] = QStandardPaths{}
qt.FuncMap["core.QStandardPaths_DisplayName"] = QStandardPaths_DisplayName
qt.FuncMap["core.QStandardPaths_FindExecutable"] = QStandardPaths_FindExecutable
@ -63747,6 +63905,7 @@ func init() {
qt.EnumMap["core.QStateMachine__NoDefaultStateInHistoryStateError"] = int64(QStateMachine__NoDefaultStateInHistoryStateError)
qt.EnumMap["core.QStateMachine__NoCommonAncestorForTransitionError"] = int64(QStateMachine__NoCommonAncestorForTransitionError)
qt.ItfMap["core.QStaticByteArrayData_ITF"] = QStaticByteArrayData{}
qt.ItfMap["core.QStaticByteArrayMatcher_ITF"] = QStaticByteArrayMatcher{}
qt.ItfMap["core.QStaticPlugin_ITF"] = QStaticPlugin{}
qt.ItfMap["core.QStaticStringData_ITF"] = QStaticStringData{}
qt.ItfMap["core.QStorageInfo_ITF"] = QStorageInfo{}
@ -63756,6 +63915,7 @@ func init() {
qt.FuncMap["core.NewQStorageInfo4"] = NewQStorageInfo4
qt.FuncMap["core.QStorageInfo_MountedVolumes"] = QStorageInfo_MountedVolumes
qt.FuncMap["core.QStorageInfo_Root"] = QStorageInfo_Root
qt.ItfMap["core.QString_ITF"] = QString{}
qt.EnumMap["core.QString__SectionDefault"] = int64(QString__SectionDefault)
qt.EnumMap["core.QString__SectionSkipEmpty"] = int64(QString__SectionSkipEmpty)
qt.EnumMap["core.QString__SectionIncludeLeadingSep"] = int64(QString__SectionIncludeLeadingSep)
@ -63768,6 +63928,7 @@ func init() {
qt.EnumMap["core.QString__NormalizationForm_KD"] = int64(QString__NormalizationForm_KD)
qt.EnumMap["core.QString__NormalizationForm_KC"] = int64(QString__NormalizationForm_KC)
qt.ItfMap["core.QStringBuilderCommon_ITF"] = QStringBuilderCommon{}
qt.ItfMap["core.QStringList_ITF"] = QStringList{}
qt.ItfMap["core.QStringListModel_ITF"] = QStringListModel{}
qt.FuncMap["core.NewQStringListModel"] = NewQStringListModel
qt.FuncMap["core.NewQStringListModel2"] = NewQStringListModel2
@ -63905,6 +64066,7 @@ func init() {
qt.ItfMap["core.QThreadPool_ITF"] = QThreadPool{}
qt.FuncMap["core.NewQThreadPool"] = NewQThreadPool
qt.FuncMap["core.QThreadPool_GlobalInstance"] = QThreadPool_GlobalInstance
qt.ItfMap["core.QThreadStorage_ITF"] = QThreadStorage{}
qt.ItfMap["core.QThreadStorageData_ITF"] = QThreadStorageData{}
qt.ItfMap["core.QTime_ITF"] = QTime{}
qt.FuncMap["core.NewQTime2"] = NewQTime2
@ -64043,6 +64205,7 @@ func init() {
qt.EnumMap["core.QUuid__WithBraces"] = int64(QUuid__WithBraces)
qt.EnumMap["core.QUuid__WithoutBraces"] = int64(QUuid__WithoutBraces)
qt.EnumMap["core.QUuid__Id128"] = int64(QUuid__Id128)
qt.ItfMap["core.QVarLengthArray_ITF"] = QVarLengthArray{}
qt.ItfMap["core.QVariant_ITF"] = QVariant{}
qt.FuncMap["core.NewQVariant"] = NewQVariant
qt.FuncMap["core.NewQVariant2"] = NewQVariant2
@ -64154,6 +64317,8 @@ func init() {
qt.EnumMap["core.QVariant__LastType"] = int64(QVariant__LastType)
qt.ItfMap["core.QVariantAnimation_ITF"] = QVariantAnimation{}
qt.FuncMap["core.NewQVariantAnimation"] = NewQVariantAnimation
qt.ItfMap["core.QVector_ITF"] = QVector{}
qt.ItfMap["core.QVectorIterator_ITF"] = QVectorIterator{}
qt.ItfMap["core.QVersionNumber_ITF"] = QVersionNumber{}
qt.FuncMap["core.NewQVersionNumber"] = NewQVersionNumber
qt.FuncMap["core.NewQVersionNumber2"] = NewQVersionNumber2
@ -64168,6 +64333,8 @@ func init() {
qt.FuncMap["core.QVersionNumber_FromString3"] = QVersionNumber_FromString3
qt.ItfMap["core.QWaitCondition_ITF"] = QWaitCondition{}
qt.FuncMap["core.NewQWaitCondition"] = NewQWaitCondition
qt.ItfMap["core.QWeakPointer_ITF"] = QWeakPointer{}
qt.ItfMap["core.QWinEventNotifier_ITF"] = QWinEventNotifier{}
qt.ItfMap["core.QWriteLocker_ITF"] = QWriteLocker{}
qt.FuncMap["core.NewQWriteLocker"] = NewQWriteLocker
qt.ItfMap["core.QXmlStreamAttribute_ITF"] = QXmlStreamAttribute{}
@ -65415,4 +65582,5 @@ func init() {
qt.FuncMap["core.QtGlobal_qgetenv"] = QtGlobal_qgetenv
qt.FuncMap["core.QtGlobal_qputenv"] = QtGlobal_qputenv
qt.FuncMap["core.QtGlobal_qunsetenv"] = QtGlobal_qunsetenv
qt.ItfMap["core.qfloat16_ITF"] = qfloat16{}
}

View file

@ -1823,6 +1823,10 @@ char QLibrary_QLibrary_IsLibrary(struct QtCore_PackedString fileName);
char QLibrary_IsLoaded(void* ptr);
char QLibrary_Load(void* ptr);
long long QLibrary_LoadHints(void* ptr);
void* QLibrary_Resolve(void* ptr, char* symbol);
void* QLibrary_QLibrary_Resolve2(struct QtCore_PackedString fileName, char* symbol);
void* QLibrary_QLibrary_Resolve3(struct QtCore_PackedString fileName, int verNum, char* symbol);
void* QLibrary_QLibrary_Resolve4(struct QtCore_PackedString fileName, struct QtCore_PackedString version, char* symbol);
void QLibrary_SetFileName(void* ptr, struct QtCore_PackedString fileName);
void QLibrary_SetFileNameAndVersion(void* ptr, struct QtCore_PackedString fileName, int versionNumber);
void QLibrary_SetFileNameAndVersion2(void* ptr, struct QtCore_PackedString fileName, struct QtCore_PackedString version);

View file

@ -27,7 +27,7 @@ func cGoUnpackBytes(s C.struct_QtDataVisualization_PackedString) []byte {
defer cGoFreePacked(s.ptr)
if int(s.len) == -1 {
gs := C.GoString(s.data)
return *(*[]byte)(unsafe.Pointer(&gs))
return []byte(gs)
}
return C.GoBytes(unsafe.Pointer(s.data), C.int(s.len))
}
@ -18379,6 +18379,7 @@ func init() {
qt.EnumMap["datavisualization.QAbstract3DAxis__AxisTypeNone"] = int64(QAbstract3DAxis__AxisTypeNone)
qt.EnumMap["datavisualization.QAbstract3DAxis__AxisTypeCategory"] = int64(QAbstract3DAxis__AxisTypeCategory)
qt.EnumMap["datavisualization.QAbstract3DAxis__AxisTypeValue"] = int64(QAbstract3DAxis__AxisTypeValue)
qt.ItfMap["datavisualization.QAbstract3DGraph_ITF"] = QAbstract3DGraph{}
qt.EnumMap["datavisualization.QAbstract3DGraph__SelectionNone"] = int64(QAbstract3DGraph__SelectionNone)
qt.EnumMap["datavisualization.QAbstract3DGraph__SelectionItem"] = int64(QAbstract3DGraph__SelectionItem)
qt.EnumMap["datavisualization.QAbstract3DGraph__SelectionRow"] = int64(QAbstract3DGraph__SelectionRow)

View file

@ -26,7 +26,7 @@ func cGoUnpackBytes(s C.struct_QtDBus_PackedString) []byte {
defer cGoFreePacked(s.ptr)
if int(s.len) == -1 {
gs := C.GoString(s.data)
return *(*[]byte)(unsafe.Pointer(&gs))
return []byte(gs)
}
return C.GoBytes(unsafe.Pointer(s.data), C.int(s.len))
}
@ -5870,7 +5870,9 @@ func init() {
qt.FuncMap["dbus.QDBusPendingCall_FromError"] = QDBusPendingCall_FromError
qt.ItfMap["dbus.QDBusPendingCallWatcher_ITF"] = QDBusPendingCallWatcher{}
qt.FuncMap["dbus.NewQDBusPendingCallWatcher"] = NewQDBusPendingCallWatcher
qt.ItfMap["dbus.QDBusPendingReply_ITF"] = QDBusPendingReply{}
qt.ItfMap["dbus.QDBusPendingReplyData_ITF"] = QDBusPendingReplyData{}
qt.ItfMap["dbus.QDBusReply_ITF"] = QDBusReply{}
qt.ItfMap["dbus.QDBusServer_ITF"] = QDBusServer{}
qt.FuncMap["dbus.NewQDBusServer"] = NewQDBusServer
qt.FuncMap["dbus.NewQDBusServer2"] = NewQDBusServer2

View file

@ -28,7 +28,7 @@ func cGoUnpackBytes(s C.struct_QtDesigner_PackedString) []byte {
defer cGoFreePacked(s.ptr)
if int(s.len) == -1 {
gs := C.GoString(s.data)
return *(*[]byte)(unsafe.Pointer(&gs))
return []byte(gs)
}
return C.GoBytes(unsafe.Pointer(s.data), C.int(s.len))
}
@ -18761,17 +18761,34 @@ func NewVersionDialogFromPointer(ptr unsafe.Pointer) (n *VersionDialog) {
return
}
func init() {
qt.ItfMap["designer.AppFontDialog_ITF"] = AppFontDialog{}
qt.ItfMap["designer.AppFontWidget_ITF"] = AppFontWidget{}
qt.ItfMap["designer.AppearanceOptions_ITF"] = AppearanceOptions{}
qt.ItfMap["designer.AssistantClient_ITF"] = AssistantClient{}
qt.ItfMap["designer.DockedMainWindow_ITF"] = DockedMainWindow{}
qt.ItfMap["designer.DockedMdiArea_ITF"] = DockedMdiArea{}
qt.ItfMap["designer.MainWindowBase_ITF"] = MainWindowBase{}
qt.ItfMap["designer.NewForm_ITF"] = NewForm{}
qt.ItfMap["designer.PreferencesDialog_ITF"] = PreferencesDialog{}
qt.ItfMap["designer.QAbstractExtensionFactory_ITF"] = QAbstractExtensionFactory{}
qt.ItfMap["designer.QAbstractExtensionManager_ITF"] = QAbstractExtensionManager{}
qt.ItfMap["designer.QAbstractFormBuilder_ITF"] = QAbstractFormBuilder{}
qt.FuncMap["designer.NewQAbstractFormBuilder"] = NewQAbstractFormBuilder
qt.ItfMap["designer.QDesigner_ITF"] = QDesigner{}
qt.ItfMap["designer.QDesignerActionEditorInterface_ITF"] = QDesignerActionEditorInterface{}
qt.FuncMap["designer.NewQDesignerActionEditorInterface"] = NewQDesignerActionEditorInterface
qt.ItfMap["designer.QDesignerActions_ITF"] = QDesignerActions{}
qt.ItfMap["designer.QDesignerAppearanceOptionsPage_ITF"] = QDesignerAppearanceOptionsPage{}
qt.ItfMap["designer.QDesignerAppearanceOptionsWidget_ITF"] = QDesignerAppearanceOptionsWidget{}
qt.ItfMap["designer.QDesignerClient_ITF"] = QDesignerClient{}
qt.ItfMap["designer.QDesignerComponents_ITF"] = QDesignerComponents{}
qt.ItfMap["designer.QDesignerContainerExtension_ITF"] = QDesignerContainerExtension{}
qt.ItfMap["designer.QDesignerCustomWidgetCollectionInterface_ITF"] = QDesignerCustomWidgetCollectionInterface{}
qt.ItfMap["designer.QDesignerCustomWidgetInterface_ITF"] = QDesignerCustomWidgetInterface{}
qt.ItfMap["designer.QDesignerDynamicPropertySheetExtension_ITF"] = QDesignerDynamicPropertySheetExtension{}
qt.ItfMap["designer.QDesignerFormEditorInterface_ITF"] = QDesignerFormEditorInterface{}
qt.FuncMap["designer.NewQDesignerFormEditorInterface"] = NewQDesignerFormEditorInterface
qt.ItfMap["designer.QDesignerFormWindow_ITF"] = QDesignerFormWindow{}
qt.ItfMap["designer.QDesignerFormWindowCursorInterface_ITF"] = QDesignerFormWindowCursorInterface{}
qt.EnumMap["designer.QDesignerFormWindowCursorInterface__NoMove"] = int64(QDesignerFormWindowCursorInterface__NoMove)
qt.EnumMap["designer.QDesignerFormWindowCursorInterface__Start"] = int64(QDesignerFormWindowCursorInterface__Start)
@ -18824,12 +18841,20 @@ func init() {
qt.FuncMap["designer.NewQDesignerPropertyEditorInterface"] = NewQDesignerPropertyEditorInterface
qt.ItfMap["designer.QDesignerPropertySheetExtension_ITF"] = QDesignerPropertySheetExtension{}
qt.ItfMap["designer.QDesignerResourceBrowserInterface_ITF"] = QDesignerResourceBrowserInterface{}
qt.ItfMap["designer.QDesignerServer_ITF"] = QDesignerServer{}
qt.ItfMap["designer.QDesignerSettings_ITF"] = QDesignerSettings{}
qt.ItfMap["designer.QDesignerTaskMenuExtension_ITF"] = QDesignerTaskMenuExtension{}
qt.ItfMap["designer.QDesignerToolWindow_ITF"] = QDesignerToolWindow{}
qt.ItfMap["designer.QDesignerWidgetBoxInterface_ITF"] = QDesignerWidgetBoxInterface{}
qt.ItfMap["designer.QDesignerWorkbench_ITF"] = QDesignerWorkbench{}
qt.ItfMap["designer.QExtensionFactory_ITF"] = QExtensionFactory{}
qt.FuncMap["designer.NewQExtensionFactory"] = NewQExtensionFactory
qt.ItfMap["designer.QExtensionManager_ITF"] = QExtensionManager{}
qt.FuncMap["designer.NewQExtensionManager"] = NewQExtensionManager
qt.ItfMap["designer.QFormBuilder_ITF"] = QFormBuilder{}
qt.FuncMap["designer.NewQFormBuilder"] = NewQFormBuilder
qt.ItfMap["designer.SaveFormAsTemplate_ITF"] = SaveFormAsTemplate{}
qt.ItfMap["designer.ToolBarManager_ITF"] = ToolBarManager{}
qt.ItfMap["designer.ToolWindowFontSettings_ITF"] = ToolWindowFontSettings{}
qt.ItfMap["designer.VersionDialog_ITF"] = VersionDialog{}
}

232
flutter/embedder.go Normal file
View file

@ -0,0 +1,232 @@
package flutter
// #cgo darwin LDFLAGS: -F ${SRCDIR} -framework FlutterEmbedder -Wl,-rpath,${SRCDIR}
// #cgo windows LDFLAGS: -L ${SRCDIR} -l flutter_engine
// #cgo linux LDFLAGS: -L ${SRCDIR} -l flutter_engine -Wl,-rpath,${SRCDIR}
/*
#include "stdlib.h"
#include "embedder.h"
FlutterEngine enginePtr;
extern bool make_current(void*);
extern bool clear_current(void*);
extern bool present(void*);
extern uint32_t fbo_callback(void*);
extern bool make_resource_current(void*);
extern void* gl_proc_resolver(void*, char*);
extern void platform_message_callback(FlutterPlatformMessage*, void*);
extern void data_callback(uint8_t*, size_t, void*);
void RunFlutterEngine(char* assets_path, char* icu_data_path) {
FlutterRendererConfig config = {};
config.type = kOpenGL;
config.open_gl.struct_size = sizeof(config.open_gl);
config.open_gl.make_current = make_current;
config.open_gl.clear_current = clear_current;
config.open_gl.present = present;
config.open_gl.fbo_callback = fbo_callback;
config.open_gl.make_resource_current = make_resource_current;
config.open_gl.gl_proc_resolver = gl_proc_resolver;
FlutterProjectArgs args = {};
args.struct_size = sizeof(args);
args.assets_path = assets_path;
args.icu_data_path = icu_data_path;
args.platform_message_callback = platform_message_callback;
FlutterEngineRun(1, &config, &args, enginePtr, &enginePtr);
}
*/
import "C"
import (
"encoding/json"
"os"
"path/filepath"
"runtime"
"time"
"unsafe"
"github.com/therecipe/qt/core"
)
func FlutterEngineRun() {
var (
assets_path string
icu_data_path string
)
pwd, _ := os.Getwd()
for _, path := range []string{pwd, core.QCoreApplication_ApplicationDirPath()} {
assets_path = filepath.Join(path, "build", "flutter_assets")
if _, err := os.Stat(assets_path); err != nil {
assets_path = filepath.Join(path, "flutter_assets")
}
//TODO: support flutter-rs aot engine builds as well
switch runtime.GOOS {
case "darwin":
icu_data_path = filepath.Join(path, "FlutterEmbedder.framework", "Versions", "A", "Resources", "icudtl.dat")
if _, err := os.Stat(icu_data_path); err != nil {
icu_data_path = filepath.Join(path, "..", "Frameworks", "FlutterEmbedder.framework", "Versions", "A", "Resources", "icudtl.dat")
}
case "windows", "linux":
icu_data_path = filepath.Join(path, "icudtl.dat")
}
if _, err := os.Stat(assets_path); err == nil {
break
}
}
C.RunFlutterEngine(C.CString(assets_path), C.CString(icu_data_path))
FlutterEngineSendWindowMetricsEvent(win.Width(), win.Height())
}
func FlutterEngineSendWindowMetricsEvent(w, h int) {
e := C.FlutterWindowMetricsEvent{}
e.struct_size = C.size_t(unsafe.Sizeof(e))
e.width = C.size_t(float64(w) * devicePixelRatio)
e.height = C.size_t(float64(h) * devicePixelRatio)
e.pixel_ratio = C.double(devicePixelRatio)
C.FlutterEngineSendWindowMetricsEvent(C.enginePtr, &e)
}
var pointerPhase C.FlutterPointerPhase = C.kCancel
func FlutterEngineSendPointerEvent(phase C.FlutterPointerPhase, x int, y int) {
switch phase {
case C.kAdd, C.kHover:
if !(pointerPhase == C.kCancel || pointerPhase == C.kRemove) {
if phase == C.kHover && pointerPhase == C.kAdd { //needed for resizing issues
break
}
return
} else {
phase = C.kAdd
pointerPhase = phase
}
case C.kRemove:
if !(pointerPhase == C.kCancel || pointerPhase == C.kAdd) {
return
} else {
pointerPhase = phase
}
default:
if !(pointerPhase == C.kCancel || pointerPhase == C.kAdd) {
return
}
}
e := C.FlutterPointerEvent{}
e.struct_size = C.size_t(unsafe.Sizeof(e))
e.phase = phase
e.x = C.double(float64(x) * devicePixelRatio)
e.y = C.double(float64(y) * devicePixelRatio)
e.timestamp = C.size_t(time.Now().Unix() / 1e3)
C.FlutterEngineSendPointerEvent(C.enginePtr, &e, 1)
}
func FlutterEngineSendPointerScrollEvent(x int, y int, xd int, yd int) {
if !(pointerPhase == C.kCancel || pointerPhase == C.kAdd) {
return
}
e := C.FlutterPointerEvent{}
e.struct_size = C.size_t(unsafe.Sizeof(e))
e.phase = C.kHover
e.x = C.double(float64(x) * devicePixelRatio)
e.y = C.double(float64(y) * devicePixelRatio)
e.scroll_delta_x = C.double(xd)
e.scroll_delta_y = C.double(yd)
e.signal_kind = C.kFlutterPointerSignalKindScroll
e.timestamp = C.size_t(time.Now().Unix() / 1e3)
C.FlutterEngineSendPointerEvent(C.enginePtr, &e, 1)
}
func FlutterEngineSendPlatformMessage(ch string, msg []byte) {
var handle *C.FlutterPlatformMessageResponseHandle
C.FlutterPlatformMessageCreateResponseHandle(C.enginePtr, (*[0]byte)(C.data_callback), unsafe.Pointer(C.enginePtr), &handle)
channel := C.CString(ch)
message := C.CBytes(msg)
cPlatformMessage := C.FlutterPlatformMessage{}
cPlatformMessage.struct_size = C.size_t(unsafe.Sizeof(cPlatformMessage))
cPlatformMessage.channel = channel
cPlatformMessage.message = (*C.uint8_t)(message)
cPlatformMessage.message_size = C.size_t(len(msg))
cPlatformMessage.response_handle = (*C.FlutterPlatformMessageResponseHandle)(unsafe.Pointer(handle))
C.FlutterEngineSendPlatformMessage(C.enginePtr, &cPlatformMessage)
C.free(unsafe.Pointer(channel))
C.free(unsafe.Pointer(message))
C.FlutterPlatformMessageReleaseResponseHandle(C.enginePtr, handle)
}
func handleKeyEvent(key int, typeKey string, scancode uint) {
type MethodCall struct {
Method string `json:"method"`
Args interface{} `json:"args"`
}
switch core.Qt__Key(key) {
case core.Qt__Key_Escape:
msg, _ := json.Marshal(MethodCall{Method: "popRoute"})
FlutterEngineSendPlatformMessage("flutter/navigation", msg)
case core.Qt__Key_Enter, core.Qt__Key_Return:
msg, _ := json.Marshal(MethodCall{Method: "TextInputClient.performAction", Args: []interface{}{textInputHelper.Property("clientID").ToInterface(), textInputHelper.Property("action").ToInterface()}})
FlutterEngineSendPlatformMessage("flutter/textinput", msg)
default:
km := runtime.GOOS
if km == "darwin" {
km = "macos"
}
event := struct {
KeyCode int `json:"keyCode"`
Type string `json:"type"`
ScanCode int `json:"scanCode"`
Modifiers int `json:"modifiers"`
Keymap string `json:"keymap"`
}{
KeyCode: int(key),
Type: typeKey,
ScanCode: int(scancode),
Modifiers: int(0), //TODO:
Keymap: km,
}
msg, _ := json.Marshal(event)
FlutterEngineSendPlatformMessage("flutter/keyevent", msg)
if textInputHelper != nil && textInputHelper.Property("clientID").ToDouble(nil) == 0 {
return
}
state := struct {
Text string `json:"text"`
SelectionBase int `json:"selectionBase"`
SelectionExtent int `json:"selectionExtent"`
SelectionAffinity string `json:"selectionAffinity"`
}{
Text: textInputHelper.ToPlainText(),
SelectionBase: textInputHelper.TextCursor().SelectionStart(),
SelectionExtent: textInputHelper.TextCursor().SelectionEnd(),
SelectionAffinity: "TextAffinity.downstream",
}
msg, _ = json.Marshal(MethodCall{Method: "TextInputClient.updateEditingState", Args: []interface{}{textInputHelper.Property("clientID").ToInterface(), state}})
FlutterEngineSendPlatformMessage("flutter/textinput", msg)
}
}

1738
flutter/embedder.h Normal file

File diff suppressed because it is too large Load diff

546
flutter/widget.go Normal file
View file

@ -0,0 +1,546 @@
package flutter
//#include "embedder.h"
import "C"
import (
"encoding/json"
"os"
"runtime"
"sync"
"time"
"unsafe"
"github.com/therecipe/qt/core"
"github.com/therecipe/qt/gui"
"github.com/therecipe/qt/widgets"
"github.com/therecipe/qt/interop"
_ "github.com/therecipe/qt/interop/dart"
)
var (
USE_ALTERNATIVE_OFFSCREEN_RENDERING = (runtime.GOOS == "windows" && os.Getenv("QT_ALT_RENDERING") != "false") || os.Getenv("QT_ALT_RENDERING") == "true"
DEBUG = DEBUG_HOT || false
DEBUG_HOT = false
IGNORE_THREADS = true //TODO: make resizing thread safe; (race condition with the flutter and the main thread sharing the widgets openglcontext)
TEST_RESIZING = false
)
var (
win *FlutterWidget
devicePixelRatio float64
frameMutex = new(sync.Mutex)
offScreenSur *gui.QOffscreenSurface
offScreenCtx *gui.QOpenGLContext
offScreenCtxShared *gui.QOpenGLContext
offScreenFBO *gui.QOpenGLFramebufferObject
offScreenFBO_Frame *gui.QImage
textInputHelper *widgets.QPlainTextEdit
resizePhase int
)
//
func init() {
core.QCoreApplication_SetAttribute(core.Qt__AA_DontCheckOpenGLContextThreadAffinity, IGNORE_THREADS)
if runtime.GOOS == "windows" && os.Getenv("COMPUTERNAME") == "VAGRANT-2012" {
core.QCoreApplication_SetAttribute(core.Qt__AA_UseSoftwareOpenGL, true)
}
//TODO: manually set the format for each surface?
format := gui.QSurfaceFormat_DefaultFormat()
format.SetVersion(3, 2)
format.SetProfile(gui.QSurfaceFormat__CoreProfile)
gui.QSurfaceFormat_SetDefaultFormat(format)
}
type FlutterWidget struct{ *widgets.QOpenGLWidget }
func NewFlutterWidget(parent widgets.QWidget_ITF) *FlutterWidget {
if USE_ALTERNATIVE_OFFSCREEN_RENDERING {
devicePixelRatio = 1
} else {
devicePixelRatio = gui.QGuiApplication_PrimaryScreen().DevicePixelRatio()
}
win = &FlutterWidget{widgets.NewQOpenGLWidget(parent, 0)}
win.SetMouseTracking(true)
win.Resize2(400, 300)
offScreenCtx = gui.NewQOpenGLContext(nil)
ok := offScreenCtx.Create()
if !ok {
println("couldn't create valid offScreenCtx")
}
offScreenCtxShared = gui.NewQOpenGLContext(nil)
if USE_ALTERNATIVE_OFFSCREEN_RENDERING {
offScreenCtxShared.SetShareContext(offScreenCtx)
} else {
offScreenCtxShared.SetShareContext(win.Context())
}
ok = offScreenCtxShared.Create()
if !ok {
println("couldn't create valid offScreenCtxShared")
}
offScreenSur = gui.NewQOffscreenSurface2(nil)
offScreenSur.Create()
//
//paint events
win.ConnectPaintEvent(func(event *gui.QPaintEvent) {
if !USE_ALTERNATIVE_OFFSCREEN_RENDERING || offScreenFBO_Frame.Pointer() == nil {
return
}
painter := gui.NewQPainter2(win)
painter.DrawImage6(core.NewQRect4(0, 0, int(win.Width()), int(win.Height())), offScreenFBO_Frame)
painter.DestroyQPainter()
})
win.ConnectAboutToCompose(func() {
frameMutex.Lock()
//win.MakeCurrent() //TODO: needed for windows 10 with def rendering ?
})
win.ConnectFrameSwapped(func() {
//win.DoneCurrent() //TODO: needed for windows 10 with def rendering ?
resizePhase = 0
frameMutex.Unlock()
})
win.ConnectResizeEvent(func(event *gui.QResizeEvent) {
frameMutex.Lock()
defer frameMutex.Unlock()
if resizePhase != 0 {
return
}
resizePhase = 1
if win.ParentWidget().Pointer() != nil {
win.ParentWidget().SetUpdatesEnabled(false)
}
win.SetUpdatesEnabled(false)
win.ResizeEventDefault(event)
FlutterEngineSendWindowMetricsEvent(win.Width(), win.Height())
})
//mouse events
win.ConnectMousePressEvent(func(event *gui.QMouseEvent) {
FlutterEngineSendPointerEvent(C.kDown, event.Pos().X(), event.Pos().Y())
})
win.ConnectMouseReleaseEvent(func(event *gui.QMouseEvent) {
FlutterEngineSendPointerEvent(C.kUp, event.Pos().X(), event.Pos().Y())
})
win.ConnectEnterEvent(func(event *core.QEvent) {
if gui.QGuiApplication_MouseButtons() != core.Qt__NoButton {
return
}
e := gui.NewQEnterEventFromPointer(event.Pointer())
FlutterEngineSendPointerEvent(C.kAdd, e.Pos().X(), e.Pos().Y())
})
win.ConnectLeaveEvent(func(event *core.QEvent) {
if gui.QGuiApplication_MouseButtons() != core.Qt__NoButton {
return
}
FlutterEngineSendPointerEvent(C.kRemove, 0, 0)
})
win.ConnectMouseMoveEvent(func(event *gui.QMouseEvent) {
if event.Buttons() != core.Qt__NoButton {
FlutterEngineSendPointerEvent(C.kMove, event.Pos().X(), event.Pos().Y())
} else {
FlutterEngineSendPointerEvent(C.kHover, event.Pos().X(), event.Pos().Y())
}
})
win.ConnectWheelEvent(func(event *gui.QWheelEvent) {
angleDelta := event.AngleDelta()
deltaX := angleDelta.X()
deltaY := angleDelta.Y()
if event.Inverted() { //for natural scrolling of the touchpad on macOS
deltaY *= -1
deltaX *= -1
}
FlutterEngineSendPointerScrollEvent(event.Pos().X(), event.Pos().Y(), deltaX, deltaY)
})
//keyboard events
win.ConnectKeyPressEvent(func(event *gui.QKeyEvent) {
handleKeyEvent(event.Key(), "keydown", event.NativeVirtualKey())
})
win.ConnectKeyReleaseEvent(func(event *gui.QKeyEvent) {
handleKeyEvent(event.Key(), "keyup", event.NativeVirtualKey())
})
//simple resize test
if TEST_RESIZING {
go func() {
time.Sleep(5 * time.Second)
for {
time.Sleep(time.Second / 15)
RunOnMainBlocking(func() {
if win.Width() < widgets.QApplication_Desktop().Screen(0).Width() {
win.Resize2(win.Width()+1, win.Height()+1)
}
if win.Width() >= widgets.QApplication_Desktop().Screen(0).Width() {
win.Resize2(400, 300)
}
})
}
}()
}
win.Show() //TODO: make sure opengl context (or paintable surface?) is initialized before running the flutter engine without using Show
win.DoneCurrent() //needed for windows 10 with def rendering
go func() {
runtime.LockOSThread()
FlutterEngineRun()
//flutter event loop hack using a deprecated api
//TODO: replace with custom_task_runners
for {
time.Sleep(time.Second / 60)
C.__FlutterEngineFlushPendingTasksNow()
}
}()
return win
}
//
func MoveToMainThread(ctx *gui.QOpenGLContext) {
if IGNORE_THREADS {
return
}
ctxThread := ctx.Thread().Pointer()
mainThread := core.QCoreApplication_Instance().Thread()
if ctxThread == mainThread.Pointer() {
return
}
if ctxThread != core.QThread_CurrentThread().Pointer() {
panic("COULDN'T MOVE CONTEXT FROM CURRENT THREAD TO MAIN THREAD")
return
}
ctx.MoveToThread(mainThread)
}
func MoveToCurrentThread(ctx *gui.QOpenGLContext) {
if IGNORE_THREADS {
return
}
ctxThread := ctx.Thread().Pointer()
curThread := core.QThread_CurrentThread()
if ctxThread == curThread.Pointer() {
return
}
if ctxThread != core.QCoreApplication_Instance().Thread().Pointer() {
panic("COULDN'T MOVE CONTEXT FROM MAIN THREAD TO CURRENT THREAD")
return
}
RunOnMainBlocking(func() {
ctx.MoveToThread(curThread)
})
}
func RunOnMainBlocking(f func()) {
if core.QThread_CurrentThread().Pointer() == core.QCoreApplication_Instance().Thread().Pointer() {
f()
return
}
done := make(chan bool, 0)
interop.Helper.RunOnMainThread(func() { f(); done <- true })
<-done
}
//
//paint hot path functions
//
//export make_current
func make_current(unsafe.Pointer) bool {
if DEBUG_HOT {
println("make_current")
}
frameMutex.Lock()
defer frameMutex.Unlock()
/* TODO: mark these contexts as done for windows 10 ?
if gui.QOpenGLContext_CurrentContext().Pointer() != nil {
gui.QOpenGLContext_CurrentContext().DoneCurrent()
}
*/
if !USE_ALTERNATIVE_OFFSCREEN_RENDERING {
MoveToCurrentThread(win.Context())
win.MakeCurrent()
return true
}
//
MoveToCurrentThread(offScreenCtx)
offScreenCtx.MakeCurrent(offScreenSur)
if win.Width() != offScreenFBO.Width() || win.Height() != offScreenFBO.Height() {
if offScreenFBO.Pointer() != nil {
offScreenFBO.DestroyQOpenGLFramebufferObjectDefault()
}
offScreenFBO = gui.NewQOpenGLFramebufferObject2(win.Width(), win.Height(), 3553) //GL_TEXTURE_2D
return true
}
return offScreenFBO.Bind()
}
//export present
func present(unsafe.Pointer) bool {
if DEBUG_HOT {
println("present")
}
frameMutex.Lock()
defer frameMutex.Unlock()
switch resizePhase {
case 0, 3:
if !USE_ALTERNATIVE_OFFSCREEN_RENDERING {
win.Context().Functions().GlFlush()
//win.DoneCurrent() //TODO: needed for windows 10 with def rendering ?
MoveToMainThread(win.Context())
} else {
offScreenFBO_Frame = offScreenFBO.ToImage2()
}
win.SetUpdatesEnabled(true)
win.Update()
if win.ParentWidget().Pointer() != nil {
win.ParentWidget().SetUpdatesEnabled(true)
win.ParentWidget().Update()
}
case 1:
resizePhase = 2
FlutterEngineSendPointerEvent(C.kAdd, 0, 0)
case 2:
resizePhase = 3
FlutterEngineSendPointerEvent(C.kRemove, 0, 0)
}
return true
}
//
//general painting helper functions
//
//export clear_current
func clear_current(unsafe.Pointer) bool {
if DEBUG {
println("clear_current")
}
frameMutex.Lock()
defer frameMutex.Unlock()
if !USE_ALTERNATIVE_OFFSCREEN_RENDERING {
win.DoneCurrent()
MoveToMainThread(win.Context())
} else {
offScreenCtx.DoneCurrent()
MoveToMainThread(offScreenCtx)
}
return true
}
//export fbo_callback
func fbo_callback(unsafe.Pointer) uint32 {
if DEBUG {
println("fbo_callback")
}
if !USE_ALTERNATIVE_OFFSCREEN_RENDERING {
return uint32(0) //uint32(win.Context().DefaultFramebufferObject())
}
return uint32(offScreenFBO.Handle())
}
//export gl_proc_resolver
func gl_proc_resolver(_ unsafe.Pointer, procName *C.char) unsafe.Pointer {
if DEBUG {
println("gl_proc_resolver")
}
return gui.QOpenGLContext_CurrentContext().GetProcAddress2(C.GoString(procName))
}
//export make_resource_current
func make_resource_current(unsafe.Pointer) bool {
if DEBUG {
println("make_resource_current")
}
MoveToCurrentThread(offScreenCtxShared)
return offScreenCtxShared.MakeCurrent(offScreenSur)
}
//
//platform plugin functions
//
//export data_callback
func data_callback(*C.char, C.size_t, unsafe.Pointer) {}
//export platform_message_callback
func platform_message_callback(msgC *C.FlutterPlatformMessage, _ unsafe.Pointer) {
channel := C.GoString(msgC.channel)
message := C.GoBytes(unsafe.Pointer(msgC.message), C.int(msgC.message_size))
var msg struct {
Method string `json:"method"`
Args []interface{} `json:"args"`
}
json.Unmarshal(message, &msg)
method := msg.Method
switch channel {
case "flutter/platform":
switch method {
case "SystemChrome.setSystemUIOverlayStyle", "HapticFeedback.vibrate", "SystemSound.play", "SystemNavigator.pop":
//TODO:
case "Clipboard.setData", "Clipboard.getData":
//TODO:
case "SystemChrome.setApplicationSwitcherDescription":
var m struct {
Args struct {
Label string `json:"label"`
PrimaryColor int64 `json:"primaryColor"`
} `json:"args"`
}
json.Unmarshal(message, &m)
RunOnMainBlocking(func() {
win.SetWindowTitle(m.Args.Label)
})
default:
println("TODO implement:", channel, method, string(message))
}
case "flutter/textinput":
switch method {
case "TextInput.show", "TextInput.hide", "TextInput.setStyle", "TextInput.setEditableSizeAndTransform", "TextInput.requestAutofill":
//TODO:
case "TextInput.setClient":
var m struct {
Args []struct {
InputType struct {
Name string `json:"name"`
Signed interface{} `json:"signed"`
Decimal interface{} `json:"decimal"`
} `json:"inputType"`
ObscureText bool `json:"obscureText"`
Autocorrect bool `json:"autocorrect"`
SmartDashesType string `json:"smartDashesType"`
SmartQuotesType string `json:"smartQuotesType"`
EnableSuggestions bool `json:"enableSuggestions"`
ActionLabel interface{} `json:"actionLabel"`
InputAction string `json:"inputAction"`
TextCapitalization string `json:"textCapitalization"`
KeyboardAppearance string `json:"keyboardAppearance"`
} `json:"args"`
}
json.Unmarshal(message, &m)
RunOnMainBlocking(func() {
textInputHelper = widgets.NewQPlainTextEdit(nil)
textInputHelper.SetProperty("clientID", core.NewQVariant1(msg.Args[0].(float64)))
textInputHelper.SetProperty("action", core.NewQVariant1(m.Args[1].InputAction))
textInputHelper.GrabKeyboard()
textInputHelper.ConnectKeyPressEvent(func(event *gui.QKeyEvent) {
textInputHelper.KeyPressEventDefault(event)
win.KeyPressEvent(event)
})
textInputHelper.ConnectKeyReleaseEvent(func(event *gui.QKeyEvent) {
textInputHelper.KeyReleaseEventDefault(event)
win.KeyReleaseEvent(event)
})
})
case "TextInput.clearClient":
textInputHelper.DeleteLater()
case "TextInput.setEditingState":
var m struct {
Args struct {
Text string `json:"text"`
SelectionBase int `json:"selectionBase"`
SelectionExtent int `json:"selectionExtent"`
SelectionAffinity string `json:"selectionAffinity"`
SelectionIsDirectional bool `json:"selectionIsDirectional"`
ComposingBase int `json:"composingBase"`
ComposingExtent int `json:"composingExtent"`
} `json:"args"`
}
json.Unmarshal(message, &m)
RunOnMainBlocking(func() {
textInputHelper.SetPlainTextDefault(m.Args.Text)
if m.Args.SelectionBase == -1 {
return
}
tc := textInputHelper.TextCursor()
tc.SetPosition(m.Args.SelectionBase, 0)
tc.SetPosition(m.Args.SelectionExtent, 1)
textInputHelper.SetTextCursor(tc)
})
default:
println("TODO implement:", channel, method, string(message))
}
case "flutter/isolate":
//TODO:
default:
println("TODO implement:", channel, method, string(message))
}
}

View file

@ -26,7 +26,7 @@ func cGoUnpackBytes(s C.struct_QtGamepad_PackedString) []byte {
defer cGoFreePacked(s.ptr)
if int(s.len) == -1 {
gs := C.GoString(s.data)
return *(*[]byte)(unsafe.Pointer(&gs))
return []byte(gs)
}
return C.GoBytes(unsafe.Pointer(s.data), C.int(s.len))
}

View file

@ -6675,6 +6675,11 @@ void QGuiApplication_PaletteChanged(void* ptr, void* palette)
static_cast<QGuiApplication*>(ptr)->paletteChanged(*static_cast<QPalette*>(palette));
}
void* QGuiApplication_QGuiApplication_PlatformFunction(void* function)
{
return reinterpret_cast<void*>(QGuiApplication::platformFunction(*static_cast<QByteArray*>(function)));
}
struct QtGui_PackedString QGuiApplication_QGuiApplication_PlatformName()
{
return ({ QByteArray* t498934 = new QByteArray(QGuiApplication::platformName().toUtf8()); QtGui_PackedString { const_cast<char*>(t498934->prepend("WHITESPACE").constData()+10), t498934->size()-10, t498934 }; });
@ -12129,6 +12134,16 @@ void* QOpenGLContext_Functions(void* ptr)
return static_cast<QOpenGLContext*>(ptr)->functions();
}
void* QOpenGLContext_GetProcAddress(void* ptr, void* procName)
{
return reinterpret_cast<void*>(static_cast<QOpenGLContext*>(ptr)->getProcAddress(*static_cast<QByteArray*>(procName)));
}
void* QOpenGLContext_GetProcAddress2(void* ptr, char* procName)
{
return reinterpret_cast<void*>(static_cast<QOpenGLContext*>(ptr)->getProcAddress(const_cast<const char*>(procName)));
}
void* QOpenGLContext_QOpenGLContext_GlobalShareContext()
{
return QOpenGLContext::globalShareContext();
@ -22488,6 +22503,11 @@ void QPixmap_DestroyQPixmapDefault(void* ptr)
}
void* QPixmap_ToVariant(void* ptr)
{
return new QVariant(*static_cast<QPixmap*>(ptr));
}
void* QPixmap_PaintEngine(void* ptr)
{
return static_cast<QPixmap*>(ptr)->paintEngine();

View file

@ -27,7 +27,7 @@ func cGoUnpackBytes(s C.struct_QtGui_PackedString) []byte {
defer cGoFreePacked(s.ptr)
if int(s.len) == -1 {
gs := C.GoString(s.data)
return *(*[]byte)(unsafe.Pointer(&gs))
return []byte(gs)
}
return C.GoBytes(unsafe.Pointer(s.data), C.int(s.len))
}
@ -14907,6 +14907,14 @@ func (ptr *QGuiApplication) PaletteChanged(palette QPalette_ITF) {
}
}
func QGuiApplication_PlatformFunction(function core.QByteArray_ITF) unsafe.Pointer {
return C.QGuiApplication_QGuiApplication_PlatformFunction(core.PointerFromQByteArray(function))
}
func (ptr *QGuiApplication) PlatformFunction(function core.QByteArray_ITF) unsafe.Pointer {
return C.QGuiApplication_QGuiApplication_PlatformFunction(core.PointerFromQByteArray(function))
}
func QGuiApplication_PlatformName() string {
return cGoUnpackString(C.QGuiApplication_QGuiApplication_PlatformName())
}
@ -26132,6 +26140,25 @@ func (ptr *QOpenGLContext) Functions() *QOpenGLFunctions {
return nil
}
func (ptr *QOpenGLContext) GetProcAddress(procName core.QByteArray_ITF) unsafe.Pointer {
if ptr.Pointer() != nil {
return C.QOpenGLContext_GetProcAddress(ptr.Pointer(), core.PointerFromQByteArray(procName))
}
return nil
}
func (ptr *QOpenGLContext) GetProcAddress2(procName string) unsafe.Pointer {
if ptr.Pointer() != nil {
var procNameC *C.char
if procName != "" {
procNameC = C.CString(procName)
defer C.free(unsafe.Pointer(procNameC))
}
return C.QOpenGLContext_GetProcAddress2(ptr.Pointer(), procNameC)
}
return nil
}
func QOpenGLContext_GlobalShareContext() *QOpenGLContext {
tmpValue := NewQOpenGLContextFromPointer(C.QOpenGLContext_QOpenGLContext_GlobalShareContext())
if !qt.ExistsSignal(tmpValue.Pointer(), "destroyed") {
@ -46829,6 +46856,15 @@ func (ptr *QPixmap) DestroyQPixmapDefault() {
}
}
func (ptr *QPixmap) ToVariant() *core.QVariant {
if ptr.Pointer() != nil {
tmpValue := core.NewQVariantFromPointer(C.QPixmap_ToVariant(ptr.Pointer()))
qt.SetFinalizer(tmpValue, (*core.QVariant).DestroyQVariant)
return tmpValue
}
return nil
}
//export callbackQPixmap_PaintEngine
func callbackQPixmap_PaintEngine(ptr unsafe.Pointer) unsafe.Pointer {
if signal := qt.GetSignal(ptr, "paintEngine"); signal != nil {
@ -72558,6 +72594,7 @@ func (ptr *QWindowStateChangeEvent) OldState() core.Qt__WindowState {
}
func init() {
qt.ItfMap["gui.QAbstractOpenGLFunctions_ITF"] = QAbstractOpenGLFunctions{}
qt.ItfMap["gui.QAbstractTextDocumentLayout_ITF"] = QAbstractTextDocumentLayout{}
qt.ItfMap["gui.QAbstractUndoItem_ITF"] = QAbstractUndoItem{}
qt.ItfMap["gui.QAccessible_ITF"] = QAccessible{}
@ -72901,6 +72938,7 @@ func init() {
qt.FuncMap["gui.NewQEnterEvent"] = NewQEnterEvent
qt.ItfMap["gui.QExposeEvent_ITF"] = QExposeEvent{}
qt.FuncMap["gui.NewQExposeEvent"] = NewQExposeEvent
qt.ItfMap["gui.QFileDialogOptions_ITF"] = QFileDialogOptions{}
qt.ItfMap["gui.QFileOpenEvent_ITF"] = QFileOpenEvent{}
qt.ItfMap["gui.QFocusEvent_ITF"] = QFocusEvent{}
qt.FuncMap["gui.NewQFocusEvent"] = NewQFocusEvent
@ -73037,6 +73075,7 @@ func init() {
qt.FuncMap["gui.NewQFontMetricsF3"] = NewQFontMetricsF3
qt.FuncMap["gui.NewQFontMetricsF4"] = NewQFontMetricsF4
qt.FuncMap["gui.NewQFontMetricsF5"] = NewQFontMetricsF5
qt.ItfMap["gui.QGenericMatrix_ITF"] = QGenericMatrix{}
qt.ItfMap["gui.QGenericPlugin_ITF"] = QGenericPlugin{}
qt.FuncMap["gui.NewQGenericPlugin"] = NewQGenericPlugin
qt.ItfMap["gui.QGenericPluginFactory_ITF"] = QGenericPluginFactory{}
@ -73253,6 +73292,7 @@ func init() {
qt.FuncMap["gui.QGuiApplication_MouseButtons"] = QGuiApplication_MouseButtons
qt.FuncMap["gui.QGuiApplication_OverrideCursor"] = QGuiApplication_OverrideCursor
qt.FuncMap["gui.QGuiApplication_Palette"] = QGuiApplication_Palette
qt.FuncMap["gui.QGuiApplication_PlatformFunction"] = QGuiApplication_PlatformFunction
qt.FuncMap["gui.QGuiApplication_PlatformName"] = QGuiApplication_PlatformName
qt.FuncMap["gui.QGuiApplication_PrimaryScreen"] = QGuiApplication_PrimaryScreen
qt.FuncMap["gui.QGuiApplication_QueryKeyboardModifiers"] = QGuiApplication_QueryKeyboardModifiers
@ -73544,6 +73584,7 @@ func init() {
qt.FuncMap["gui.NewQMatrix4x43"] = NewQMatrix4x43
qt.FuncMap["gui.NewQMatrix4x44"] = NewQMatrix4x44
qt.FuncMap["gui.NewQMatrix4x46"] = NewQMatrix4x46
qt.ItfMap["gui.QMessageDialogOptions_ITF"] = QMessageDialogOptions{}
qt.ItfMap["gui.QMouseEvent_ITF"] = QMouseEvent{}
qt.FuncMap["gui.NewQMouseEvent"] = NewQMouseEvent
qt.FuncMap["gui.NewQMouseEvent2"] = NewQMouseEvent2
@ -73689,6 +73730,60 @@ func init() {
qt.EnumMap["gui.QOpenGLFunctions__TextureRGFormats"] = int64(QOpenGLFunctions__TextureRGFormats)
qt.EnumMap["gui.QOpenGLFunctions__MultipleRenderTargets"] = int64(QOpenGLFunctions__MultipleRenderTargets)
qt.EnumMap["gui.QOpenGLFunctions__BlendEquationAdvanced"] = int64(QOpenGLFunctions__BlendEquationAdvanced)
qt.ItfMap["gui.QOpenGLFunctions_1_0_ITF"] = QOpenGLFunctions_1_0{}
qt.ItfMap["gui.QOpenGLFunctions_1_0_CoreBackend_ITF"] = QOpenGLFunctions_1_0_CoreBackend{}
qt.ItfMap["gui.QOpenGLFunctions_1_0_DeprecatedBackend_ITF"] = QOpenGLFunctions_1_0_DeprecatedBackend{}
qt.ItfMap["gui.QOpenGLFunctions_1_1_ITF"] = QOpenGLFunctions_1_1{}
qt.ItfMap["gui.QOpenGLFunctions_1_1_CoreBackend_ITF"] = QOpenGLFunctions_1_1_CoreBackend{}
qt.ItfMap["gui.QOpenGLFunctions_1_1_DeprecatedBackend_ITF"] = QOpenGLFunctions_1_1_DeprecatedBackend{}
qt.ItfMap["gui.QOpenGLFunctions_1_2_ITF"] = QOpenGLFunctions_1_2{}
qt.ItfMap["gui.QOpenGLFunctions_1_2_CoreBackend_ITF"] = QOpenGLFunctions_1_2_CoreBackend{}
qt.ItfMap["gui.QOpenGLFunctions_1_2_DeprecatedBackend_ITF"] = QOpenGLFunctions_1_2_DeprecatedBackend{}
qt.ItfMap["gui.QOpenGLFunctions_1_3_ITF"] = QOpenGLFunctions_1_3{}
qt.ItfMap["gui.QOpenGLFunctions_1_3_CoreBackend_ITF"] = QOpenGLFunctions_1_3_CoreBackend{}
qt.ItfMap["gui.QOpenGLFunctions_1_3_DeprecatedBackend_ITF"] = QOpenGLFunctions_1_3_DeprecatedBackend{}
qt.ItfMap["gui.QOpenGLFunctions_1_4_ITF"] = QOpenGLFunctions_1_4{}
qt.ItfMap["gui.QOpenGLFunctions_1_4_CoreBackend_ITF"] = QOpenGLFunctions_1_4_CoreBackend{}
qt.ItfMap["gui.QOpenGLFunctions_1_4_DeprecatedBackend_ITF"] = QOpenGLFunctions_1_4_DeprecatedBackend{}
qt.ItfMap["gui.QOpenGLFunctions_1_5_ITF"] = QOpenGLFunctions_1_5{}
qt.ItfMap["gui.QOpenGLFunctions_1_5_CoreBackend_ITF"] = QOpenGLFunctions_1_5_CoreBackend{}
qt.ItfMap["gui.QOpenGLFunctions_2_0_ITF"] = QOpenGLFunctions_2_0{}
qt.ItfMap["gui.QOpenGLFunctions_2_0_CoreBackend_ITF"] = QOpenGLFunctions_2_0_CoreBackend{}
qt.ItfMap["gui.QOpenGLFunctions_2_0_DeprecatedBackend_ITF"] = QOpenGLFunctions_2_0_DeprecatedBackend{}
qt.ItfMap["gui.QOpenGLFunctions_2_1_ITF"] = QOpenGLFunctions_2_1{}
qt.ItfMap["gui.QOpenGLFunctions_2_1_CoreBackend_ITF"] = QOpenGLFunctions_2_1_CoreBackend{}
qt.ItfMap["gui.QOpenGLFunctions_3_0_ITF"] = QOpenGLFunctions_3_0{}
qt.ItfMap["gui.QOpenGLFunctions_3_0_CoreBackend_ITF"] = QOpenGLFunctions_3_0_CoreBackend{}
qt.ItfMap["gui.QOpenGLFunctions_3_0_DeprecatedBackend_ITF"] = QOpenGLFunctions_3_0_DeprecatedBackend{}
qt.ItfMap["gui.QOpenGLFunctions_3_1_ITF"] = QOpenGLFunctions_3_1{}
qt.ItfMap["gui.QOpenGLFunctions_3_1_CoreBackend_ITF"] = QOpenGLFunctions_3_1_CoreBackend{}
qt.ItfMap["gui.QOpenGLFunctions_3_2_Compatibility_ITF"] = QOpenGLFunctions_3_2_Compatibility{}
qt.ItfMap["gui.QOpenGLFunctions_3_2_Core_ITF"] = QOpenGLFunctions_3_2_Core{}
qt.ItfMap["gui.QOpenGLFunctions_3_2_CoreBackend_ITF"] = QOpenGLFunctions_3_2_CoreBackend{}
qt.ItfMap["gui.QOpenGLFunctions_3_3_Compatibility_ITF"] = QOpenGLFunctions_3_3_Compatibility{}
qt.ItfMap["gui.QOpenGLFunctions_3_3_Core_ITF"] = QOpenGLFunctions_3_3_Core{}
qt.ItfMap["gui.QOpenGLFunctions_3_3_CoreBackend_ITF"] = QOpenGLFunctions_3_3_CoreBackend{}
qt.ItfMap["gui.QOpenGLFunctions_3_3_DeprecatedBackend_ITF"] = QOpenGLFunctions_3_3_DeprecatedBackend{}
qt.ItfMap["gui.QOpenGLFunctions_4_0_Compatibility_ITF"] = QOpenGLFunctions_4_0_Compatibility{}
qt.ItfMap["gui.QOpenGLFunctions_4_0_Core_ITF"] = QOpenGLFunctions_4_0_Core{}
qt.ItfMap["gui.QOpenGLFunctions_4_0_CoreBackend_ITF"] = QOpenGLFunctions_4_0_CoreBackend{}
qt.ItfMap["gui.QOpenGLFunctions_4_1_Compatibility_ITF"] = QOpenGLFunctions_4_1_Compatibility{}
qt.ItfMap["gui.QOpenGLFunctions_4_1_Core_ITF"] = QOpenGLFunctions_4_1_Core{}
qt.ItfMap["gui.QOpenGLFunctions_4_1_CoreBackend_ITF"] = QOpenGLFunctions_4_1_CoreBackend{}
qt.ItfMap["gui.QOpenGLFunctions_4_2_Compatibility_ITF"] = QOpenGLFunctions_4_2_Compatibility{}
qt.ItfMap["gui.QOpenGLFunctions_4_2_Core_ITF"] = QOpenGLFunctions_4_2_Core{}
qt.ItfMap["gui.QOpenGLFunctions_4_2_CoreBackend_ITF"] = QOpenGLFunctions_4_2_CoreBackend{}
qt.ItfMap["gui.QOpenGLFunctions_4_3_Compatibility_ITF"] = QOpenGLFunctions_4_3_Compatibility{}
qt.ItfMap["gui.QOpenGLFunctions_4_3_Core_ITF"] = QOpenGLFunctions_4_3_Core{}
qt.ItfMap["gui.QOpenGLFunctions_4_3_CoreBackend_ITF"] = QOpenGLFunctions_4_3_CoreBackend{}
qt.ItfMap["gui.QOpenGLFunctions_4_4_Compatibility_ITF"] = QOpenGLFunctions_4_4_Compatibility{}
qt.ItfMap["gui.QOpenGLFunctions_4_4_Core_ITF"] = QOpenGLFunctions_4_4_Core{}
qt.ItfMap["gui.QOpenGLFunctions_4_4_CoreBackend_ITF"] = QOpenGLFunctions_4_4_CoreBackend{}
qt.ItfMap["gui.QOpenGLFunctions_4_5_Compatibility_ITF"] = QOpenGLFunctions_4_5_Compatibility{}
qt.ItfMap["gui.QOpenGLFunctions_4_5_Core_ITF"] = QOpenGLFunctions_4_5_Core{}
qt.ItfMap["gui.QOpenGLFunctions_4_5_CoreBackend_ITF"] = QOpenGLFunctions_4_5_CoreBackend{}
qt.ItfMap["gui.QOpenGLFunctions_4_5_DeprecatedBackend_ITF"] = QOpenGLFunctions_4_5_DeprecatedBackend{}
qt.ItfMap["gui.QOpenGLFunctions_ES2_ITF"] = QOpenGLFunctions_ES2{}
qt.ItfMap["gui.QOpenGLPaintDevice_ITF"] = QOpenGLPaintDevice{}
qt.FuncMap["gui.NewQOpenGLPaintDevice"] = NewQOpenGLPaintDevice
qt.FuncMap["gui.NewQOpenGLPaintDevice2"] = NewQOpenGLPaintDevice2
@ -74549,10 +74644,19 @@ func init() {
qt.FuncMap["gui.QPixmapCache_Insert"] = QPixmapCache_Insert
qt.FuncMap["gui.QPixmapCache_Remove"] = QPixmapCache_Remove
qt.FuncMap["gui.QPixmapCache_SetCacheLimit"] = QPixmapCache_SetCacheLimit
qt.ItfMap["gui.QPlatformDragQtResponse_ITF"] = QPlatformDragQtResponse{}
qt.ItfMap["gui.QPlatformDropQtResponse_ITF"] = QPlatformDropQtResponse{}
qt.ItfMap["gui.QPlatformIntegrationPlugin_ITF"] = QPlatformIntegrationPlugin{}
qt.ItfMap["gui.QPlatformMenu_ITF"] = QPlatformMenu{}
qt.ItfMap["gui.QPlatformMenuBar_ITF"] = QPlatformMenuBar{}
qt.ItfMap["gui.QPlatformMenuItem_ITF"] = QPlatformMenuItem{}
qt.ItfMap["gui.QPlatformOffscreenSurface_ITF"] = QPlatformOffscreenSurface{}
qt.ItfMap["gui.QPlatformSessionManager_ITF"] = QPlatformSessionManager{}
qt.ItfMap["gui.QPlatformSurfaceEvent_ITF"] = QPlatformSurfaceEvent{}
qt.FuncMap["gui.NewQPlatformSurfaceEvent"] = NewQPlatformSurfaceEvent
qt.EnumMap["gui.QPlatformSurfaceEvent__SurfaceCreated"] = int64(QPlatformSurfaceEvent__SurfaceCreated)
qt.EnumMap["gui.QPlatformSurfaceEvent__SurfaceAboutToBeDestroyed"] = int64(QPlatformSurfaceEvent__SurfaceAboutToBeDestroyed)
qt.ItfMap["gui.QPlatformTextureList_ITF"] = QPlatformTextureList{}
qt.ItfMap["gui.QPointingDeviceUniqueId_ITF"] = QPointingDeviceUniqueId{}
qt.FuncMap["gui.NewQPointingDeviceUniqueId"] = NewQPointingDeviceUniqueId
qt.FuncMap["gui.QPointingDeviceUniqueId_FromNumericId"] = QPointingDeviceUniqueId_FromNumericId
@ -74591,6 +74695,7 @@ func init() {
qt.FuncMap["gui.NewQRadialGradient5"] = NewQRadialGradient5
qt.FuncMap["gui.NewQRadialGradient6"] = NewQRadialGradient6
qt.FuncMap["gui.NewQRadialGradient7"] = NewQRadialGradient7
qt.ItfMap["gui.QRasterPaintEngine_ITF"] = QRasterPaintEngine{}
qt.ItfMap["gui.QRasterWindow_ITF"] = QRasterWindow{}
qt.FuncMap["gui.NewQRasterWindow"] = NewQRasterWindow
qt.ItfMap["gui.QRawFont_ITF"] = QRawFont{}
@ -74662,6 +74767,7 @@ func init() {
qt.ItfMap["gui.QStatusTipEvent_ITF"] = QStatusTipEvent{}
qt.FuncMap["gui.NewQStatusTipEvent"] = NewQStatusTipEvent
qt.ItfMap["gui.QStyleHints_ITF"] = QStyleHints{}
qt.ItfMap["gui.QSupportedWritingSystems_ITF"] = QSupportedWritingSystems{}
qt.ItfMap["gui.QSurface_ITF"] = QSurface{}
qt.EnumMap["gui.QSurface__Window"] = int64(QSurface__Window)
qt.EnumMap["gui.QSurface__Offscreen"] = int64(QSurface__Offscreen)
@ -75066,8 +75172,16 @@ func init() {
qt.FuncMap["gui.NewQVector4D8"] = NewQVector4D8
qt.FuncMap["gui.NewQVector4D9"] = NewQVector4D9
qt.FuncMap["gui.QVector4D_DotProduct"] = QVector4D_DotProduct
qt.ItfMap["gui.QVulkanDeviceFunctions_ITF"] = QVulkanDeviceFunctions{}
qt.ItfMap["gui.QVulkanExtension_ITF"] = QVulkanExtension{}
qt.ItfMap["gui.QVulkanFunctions_ITF"] = QVulkanFunctions{}
qt.ItfMap["gui.QVulkanInfoVector_ITF"] = QVulkanInfoVector{}
qt.ItfMap["gui.QVulkanInstance_ITF"] = QVulkanInstance{}
qt.EnumMap["gui.QVulkanInstance__NoDebugOutputRedirect"] = int64(QVulkanInstance__NoDebugOutputRedirect)
qt.ItfMap["gui.QVulkanLayer_ITF"] = QVulkanLayer{}
qt.ItfMap["gui.QVulkanWindow_ITF"] = QVulkanWindow{}
qt.EnumMap["gui.QVulkanWindow__PersistentResources"] = int64(QVulkanWindow__PersistentResources)
qt.ItfMap["gui.QVulkanWindowRenderer_ITF"] = QVulkanWindowRenderer{}
qt.ItfMap["gui.QWhatsThisClickedEvent_ITF"] = QWhatsThisClickedEvent{}
qt.FuncMap["gui.NewQWhatsThisClickedEvent"] = NewQWhatsThisClickedEvent
qt.ItfMap["gui.QWheelEvent_ITF"] = QWheelEvent{}

View file

@ -1074,6 +1074,7 @@ void* QGuiApplication_QGuiApplication_Palette();
void QGuiApplication_ConnectPaletteChanged(void* ptr, long long t);
void QGuiApplication_DisconnectPaletteChanged(void* ptr);
void QGuiApplication_PaletteChanged(void* ptr, void* palette);
void* QGuiApplication_QGuiApplication_PlatformFunction(void* function);
struct QtGui_PackedString QGuiApplication_QGuiApplication_PlatformName();
void* QGuiApplication_QGuiApplication_PrimaryScreen();
void QGuiApplication_ConnectPrimaryScreenChanged(void* ptr, long long t);
@ -1951,6 +1952,8 @@ void QOpenGLContext_DoneCurrent(void* ptr);
void* QOpenGLContext_ExtraFunctions(void* ptr);
void* QOpenGLContext_Format(void* ptr);
void* QOpenGLContext_Functions(void* ptr);
void* QOpenGLContext_GetProcAddress(void* ptr, void* procName);
void* QOpenGLContext_GetProcAddress2(void* ptr, char* procName);
void* QOpenGLContext_QOpenGLContext_GlobalShareContext();
char QOpenGLContext_HasExtension(void* ptr, void* extension);
char QOpenGLContext_IsOpenGLES(void* ptr);
@ -3703,6 +3706,7 @@ void* QPixmap_QPixmap_TrueMatrix(void* matrix, int width, int height);
void* QPixmap_QPixmap_TrueMatrix2(void* m, int w, int h);
void QPixmap_DestroyQPixmap(void* ptr);
void QPixmap_DestroyQPixmapDefault(void* ptr);
void* QPixmap_ToVariant(void* ptr);
void* QPixmap_PaintEngine(void* ptr);
void* QPixmap_PaintEngineDefault(void* ptr);
int QPixmapCache_QPixmapCache_CacheLimit();

View file

@ -28,7 +28,7 @@ func cGoUnpackBytes(s C.struct_QtHelp_PackedString) []byte {
defer cGoFreePacked(s.ptr)
if int(s.len) == -1 {
gs := C.GoString(s.data)
return *(*[]byte)(unsafe.Pointer(&gs))
return []byte(gs)
}
return C.GoBytes(unsafe.Pointer(s.data), C.int(s.len))
}

View file

@ -820,6 +820,9 @@ func _cppOutput(name, value string, f *parser.Function) string {
{
if value == "void" || value == "T" {
if strings.Contains(vOld, "*") {
if f.OgOutput == "QFunctionPointer" {
return fmt.Sprintf("reinterpret_cast<void*>(%v)", name)
}
if strings.Contains(vOld, "const") {
return fmt.Sprintf("const_cast<void*>(%v)", name)
}
@ -919,7 +922,7 @@ func _cppOutput(name, value string, f *parser.Function) string {
}
switch f.Fullname {
case "QColor::toVariant", "QFont::toVariant", "QImage::toVariant", "QObject::toVariant", "QIcon::toVariant", "QBrush::toVariant":
case "QColor::toVariant", "QFont::toVariant", "QImage::toVariant", "QObject::toVariant", "QIcon::toVariant", "QBrush::toVariant", "QPixmap::toVariant":
{
if f.Fullname == "QObject::toVariant" {
return fmt.Sprintf("new %v(QVariant::fromValue(%v))", value, strings.Split(name, "->")[0])
@ -927,7 +930,7 @@ func _cppOutput(name, value string, f *parser.Function) string {
return fmt.Sprintf("new %v(*%v)", value, strings.Split(name, "->")[0])
}
case "QVariant::toColor", "QVariant::toFont", "QVariant::toImage", "QVariant::toObject", "QVariant::toIcon", "QVariant::toBrush":
case "QVariant::toColor", "QVariant::toFont", "QVariant::toImage", "QVariant::toObject", "QVariant::toIcon", "QVariant::toBrush", "QVariant::toPixmap":
{
f.NeedsFinalizer = false

View file

@ -25,7 +25,7 @@ type ptr_itf interface {
func Z_initEngine(engine QJSEngine_ITF) {
ptr := engine.QJSEngine_PTR()
ptr.ConnectDestroyed(func(ptr *core.QObject) {
ptr.QObject.ConnectDestroyed(func(ptr *core.QObject) {
finalizerMapMutex.Lock()
pointers := finalizerMap[ptr.Pointer()]
delete(finalizerMap, ptr.Pointer())
@ -129,7 +129,8 @@ func Z_initEngine(engine QJSEngine_ITF) {
func Z_wrapperFunction(jsvals *QJSValue) *QJSValue {
var m reflect.Value
if cn, fn := jsvals.Property2(2).ToString(), jsvals.Property2(3).ToString(); fn == "" {
cn, fn := jsvals.Property2(2).ToString(), jsvals.Property2(3).ToString()
if fn == "" {
v, _ := qt.GetFuncMap(cn)
m = reflect.ValueOf(v)
@ -151,34 +152,78 @@ func Z_wrapperFunction(jsvals *QJSValue) *QJSValue {
m = o.MethodByName(fn)
}
//
engine := QJSEngine_qjsEngine(core.NewQObjectFromPointer(unsafe.Pointer(uintptr(jsvals.Property2(0).ToVariant().ToULongLong(nil)))))
input := make([]reflect.Value, m.Type().NumIn())
for i := 0; i < len(input); i++ {
input[i] = engine.fromJsToRef(m.Type().In(i), jsvals.Property2(uint(4+i)))
}
if fn == "NewGoType" || (fn == "NewQVariant1" && cn == "core.QVariant") {
//
input := make([]interface{}, jsvals.Property("length").ToInt()-4)
for i := 0; i < len(input); i++ {
ret := m.Call(input)
if len(ret) == 0 {
return NewQJSValue(QJSValue__UndefinedValue)
}
in := jsvals.Property2(uint(4 + i))
rret := engine.NewGoType(ret[0].Interface())
if reflect.TypeOf(ret[0].Interface()).Implements(reflect.TypeOf((*core.QObject_ITF)(nil)).Elem()) { //TODO: check for destroyed signal instead, or simply override the destructor instead ?
if qt.ExistsSignal(ret[0].Interface().(ptr_itf).Pointer(), "destroyed") {
engine.GlobalObject().Property("___connectDestroyed").Call([]*QJSValue{rret}) //TODO: connect destroyed/destructor from go instead ?
switch in.ToVariant().Type() {
case core.QVariant__List:
var o []interface{}
engine.ToGoType(in, &o)
input[i] = o
case core.QVariant__Map:
var o map[string]interface{}
engine.ToGoType(in, &o)
input[i] = o
default:
input[i] = in.ToVariant().ToInterface()
}
}
}
return rret
if fn == "NewQVariant1" {
return engine.NewGoType(core.NewQVariant1(input[0]))
}
if cn != "qml.QJSEngine" {
refInput := make([]reflect.Value, len(input))
for i, v := range input {
if jsv := jsvals.Property2(uint(4 + i)); jsv.IsCallable() {
refInput[i] = reflect.ValueOf(func(i interface{}) interface{} { //TODO: remote needs to provide infos about the expected arguments (needed for the callbacks for Qml created in the remote)
return jsv.Call([]*QJSValue{engine.NewGoType(i)}).ToVariant().ToInterface()
})
} else {
refInput[i] = reflect.ValueOf(v)
}
}
return engine.NewGoType(m.Call(refInput)[0].Interface())
}
return engine.NewGoType(engine.NewGoType(input...))
} else {
input := make([]reflect.Value, m.Type().NumIn())
for i := 0; i < len(input); i++ {
input[i] = engine.fromJsToRef(m.Type().In(i), jsvals.Property2(uint(4+i)))
}
ret := m.Call(input)
if len(ret) == 0 {
return NewQJSValue(QJSValue__UndefinedValue)
}
rret := engine.NewGoType(ret[0].Interface())
if reflect.TypeOf(ret[0].Interface()).Implements(reflect.TypeOf((*core.QObject_ITF)(nil)).Elem()) { //TODO: check for destroyed signal instead, or simply override the destructor instead ?
if qt.ExistsSignal(ret[0].Interface().(ptr_itf).Pointer(), "destroyed") {
engine.GlobalObject().Property("___connectDestroyed").Call([]*QJSValue{rret}) //TODO: connect destroyed/destructor from go instead ?
}
}
return rret
}
}
func (ptr *QJSEngine) ToGoType(jsval *QJSValue, dst interface{}) {
reflect.ValueOf(dst).Elem().Set(ptr.fromJsToRef(reflect.TypeOf(dst), jsval).Elem())
out := ptr.fromJsToRef(reflect.TypeOf(dst), jsval)
if out.Type().Kind() == reflect.Ptr {
out = out.Elem()
}
reflect.ValueOf(dst).Elem().Set(out)
}
func (ptr *QJSEngine) fromJsToRef(tofi reflect.Type, jsval *QJSValue) reflect.Value {
@ -517,17 +562,23 @@ func (ptr *QJSEngine) makeFuncWrapper(fn string) *QJSValue {
retV := ptr.GlobalObject().Property("___factory_single_func").Call([]*QJSValue{NewQJSValue8(fn), NewQJSValue8("")})
//only needed for generic binding >>>
retV.SetProperty("callable", ptr.NewGoType(true))
retV.SetProperty("callableLocal", ptr.NewGoType(true))
retV.SetProperty("callableName", ptr.NewGoType(fn))
//<<<
//TODO: allow creation of funcs in arbitrary module depth
var jsv *QJSValue
if m := ptr.GlobalObject().Property(strings.Split(fn, ".")[0]); m.IsUndefined() {
jsv = ptr.NewObject()
ptr.GlobalObject().SetProperty(strings.Split(fn, ".")[0], jsv)
} else {
jsv = m
}
if strings.Count(fn, ".") == 0 {
ptr.GlobalObject().SetProperty(fn, retV)
} else {
var jsv *QJSValue
if m := ptr.GlobalObject().Property(strings.Split(fn, ".")[0]); m.IsUndefined() {
jsv = ptr.NewObject()
ptr.GlobalObject().SetProperty(strings.Split(fn, ".")[0], jsv)
} else {
jsv = m
}
jsv.SetProperty(strings.Split(fn, ".")[1], retV)
}

View file

@ -5,6 +5,7 @@ import (
"encoding/hex"
"fmt"
"os"
"sort"
"strconv"
"strings"
"sync"
@ -79,6 +80,14 @@ func (c *Class) GetBases() []string {
return []string{c.Bases}
}
func (c *Class) GetBasesSorted() []string {
b := c.GetBases()
sort.SliceStable(b, func(i int, j int) bool {
return (b[j] == "QObject") || (len(State.ClassMap[b[i]].GetAllBases()) > len(State.ClassMap[b[j]].GetAllBases()))
})
return b
}
func (c *Class) GetAllBases() []string {
var out, _ = c.GetAllBasesRecursiveCheckFailed(0)
return out
@ -419,6 +428,15 @@ func (c *Class) GetFunction(fname string) *Function {
return nil
}
func (c *Class) GetTitledFunction(fname string) *Function {
for _, f := range c.Functions {
if strings.Title(f.Name) == strings.Title(fname) {
return f
}
}
return nil
}
//
func (c *Class) Hash() string {

View file

@ -15,7 +15,7 @@ func (c *Class) add() {
func (c *Class) addGeneralFuncs() {
switch c.Name {
case "QColor", "QFont", "QImage", "QObject", "QIcon", "QBrush":
case "QColor", "QFont", "QImage", "QObject", "QIcon", "QBrush", "QPixmap": //TODO: add missing https://doc.qt.io/qt-5/qmetatype.html#Type-enum
{
if c.Name == "QObject" {
c.Functions = append(c.Functions, &Function{

View file

@ -43,6 +43,7 @@ type Function struct {
Exception bool
IsMap bool
OgParameters []Parameter
OgOutput string
IsMocFunction bool
IsMocProperty bool
PureGoOutput string

View file

@ -307,6 +307,12 @@ func (f *Function) fixGenericOutput() {
{
f.Output = "QList<QNetworkCacheMetaData::RawHeader>"
}
case "QFunctionPointer":
{
f.OgOutput = f.Output
f.Output = "void*"
}
}
}

View file

@ -154,7 +154,8 @@ func CleanName(name, value string) string {
"runtime",
"time",
"hex",
"script":
"script",
"final":
{
return name[:len(name)-2]
}

View file

@ -26,6 +26,15 @@ func GoTemplate(module string, stub bool, mode int, pkg, target, tags string) []
cont = "package qml"
}
utils.Save(utils.GoQtPkgPath(strings.ToLower(module), "utils-qml.go"), cont)
//TODO: make layer generic instead
cont = strings.Replace(cont, "package qml", "package interop", -1)
cont = strings.Replace(cont, "qml.", "interop.", -1)
cont = strings.Replace(cont, "QJSValue", "PseudoQJSValue", -1)
cont = strings.Replace(cont, "QJSEngine", "PseudoQJSEngine", -1)
if utils.ExistsDir(utils.GoQtPkgPath(strings.ToLower("interop"))) {
utils.Save(utils.GoQtPkgPath(strings.ToLower("interop"), "interop.go"), cont)
}
}
utils.Log.WithField("module", module).Debug("generating go")
@ -45,7 +54,7 @@ func GoTemplate(module string, stub bool, mode int, pkg, target, tags string) []
}
fmt.Fprintf(bb, "func cGoFreePacked(ptr unsafe.Pointer) { %vNewQByteArrayFromPointer(ptr).DestroyQByteArray() }\n", m)
fmt.Fprintf(bb, "func cGoUnpackString(s C.struct_%v_PackedString) string { defer cGoFreePacked(s.ptr)\n if int(s.len) == -1 {\n return C.GoString(s.data)\n }\n return C.GoStringN(s.data, C.int(s.len)) }\n", strings.Title(module))
fmt.Fprintf(bb, "func cGoUnpackBytes(s C.struct_%v_PackedString) []byte { defer cGoFreePacked(s.ptr)\n if int(s.len) == -1 {\n gs := C.GoString(s.data)\n return *(*[]byte)(unsafe.Pointer(&gs))\n }\n return C.GoBytes(unsafe.Pointer(s.data), C.int(s.len)) }\n", strings.Title(module))
fmt.Fprintf(bb, "func cGoUnpackBytes(s C.struct_%v_PackedString) []byte { defer cGoFreePacked(s.ptr)\n if int(s.len) == -1 {\n gs := C.GoString(s.data)\n return []byte(gs)\n }\n return C.GoBytes(unsafe.Pointer(s.data), C.int(s.len)) }\n", strings.Title(module))
}
if UseJs() {
@ -213,7 +222,7 @@ func New%vFromPointer(ptr unsafe.Pointer) (n *%[2]v) {
if !class.HasDestructor() {
if UseStub(stub, module, mode) {
fmt.Fprintf(bb, "\nfunc (ptr *%v) Destroy%v() {}\n\n", class.Name, strings.Title(class.Name))
fmt.Fprintf(bb, "\nfunc (ptr *%v) Destroy%v() {\n}\n\n", class.Name, strings.Title(class.Name))
} else if !class.IsSubClassOfQObject() {
var ds string
if class.HasCallbackFunctions() {
@ -569,7 +578,7 @@ switch s.Kind() {
return NewQVariant1(uint64(s.Interface().(uintptr)))
}
if s.Type().ConvertibleTo(reflect.TypeOf(int8(0))) {
if i != nil && s.Type().ConvertibleTo(reflect.TypeOf(int8(0))) {
if s.Kind() == reflect.Int64 {
return NewQVariant1(s.Convert(reflect.TypeOf(int64(0))).Interface())
}
@ -745,6 +754,8 @@ default:
fmt.Fprintln(bb, "\tqt.RegisterConnectionType(ptr.Pointer(), strings.ToLower(fn[:1])+fn[1:], int64(t))")
fmt.Fprintln(bb, "\treflect.ValueOf(f).Call([]reflect.Value{reflect.ValueOf(a)})")
fmt.Fprintln(bb, "}\n")
//TODO: invokeMethod
}
}
cTemplate(bb, class, goEnum, goFunction, "\n\n", true)
@ -814,11 +825,24 @@ default:
}
return module
}()))
} else if utils.QT_GEN_DART() {
gosplitted = strings.Split(bb.String(), "\n")
fmt.Fprint(tsd, "import '../internal.dart';\n")
fmt.Fprint(tsd, "bool inited = false;\nvoid initModule() {\nif (inited) { return; }\ninited = true;\n")
for _, c := range parser.SortedClassesForModule(module, true) {
if c.IsSupported() || (c.Export && mode == MINIMAL) {
fmt.Fprintf(tsd, "constructorTable[\"%v.%v\"] = New%vFromPointer;\n", goModule(c.Module), c.Name, strings.Title(c.Name))
}
}
fmt.Fprint(tsd, "\ninit();\n")
fmt.Fprint(tsd, "\n___IMPORTPLACEHOLDER___\n}\n")
}
for _, c := range parser.SortedClassesForModule(module, true) {
if c.IsSupported() && (cmd.ImportsQmlOrQuick() || mode == NONE) {
if c.IsSupported() && (cmd.ImportsQmlOrQuick() || cmd.ImportsInterop()) || mode == NONE {
bb.WriteString(fmt.Sprintf("qt.ItfMap[\"%[1]v.%[2]v_ITF\"] = %[2]v{}\n", goModule(func() string {
if mode == MOC {
return pkg
@ -887,10 +911,10 @@ default:
tsd.WriteString("\t\t___pointer: number;\n")
if c.Name == "QJSEngine" {
fmt.Fprint(tsd, "\t\tToGoType(jsval:QJSValue, dst:any):void\n")
if c.Name == "QJSEngine" { //TODO: also NewQVariant1 + toInterface function
//fmt.Fprint(tsd, "\t\tNewGoType(i:any[]):QJSValue\n") //TODO: only possible for the webbrowser js api?
//fmt.Fprint(tsd, "\t\tToGoType(jsval:QJSValue, dst:any):void\n") //TODO: only possible for the webbrowser js api?
fmt.Fprint(tsd, "\t\tNewJSType(property:QJSValue, name:string, i:any):void\n")
fmt.Fprint(tsd, "\t\tNewGoType(i:any[]):QJSValue\n")
}
for _, l := range gosplitted {
@ -900,6 +924,87 @@ default:
}
}
fmt.Fprint(tsd, "\t}\n")
} else if utils.QT_GEN_DART() {
var parents []string
for _, parentClassName := range c.GetBasesSorted() {
var parentClass, ok = parser.State.ClassMap[parentClassName]
if !ok {
continue
}
if parentClass.Module == c.Module {
parents = append(parents, fmt.Sprintf("%v_ITF", parentClassName))
} else {
parents = append(parents, fmt.Sprintf("%v.%v_ITF", goModule(parentClass.Module), parentClassName))
}
}
if len(parents) != 0 && !(strings.HasPrefix(strings.Title(c.Name), "Generic") && c.Module == "QtSensors") {
var with string
if len(parents) > 1 {
with = " with "
for i, p := range parents {
if i == 0 {
continue
}
with += p + ", "
}
with = strings.TrimSuffix(with, ", ")
}
fmt.Fprintf(tsd, "\tabstract class %v_ITF extends %v%v {\n\t\t%v\t}\n\n",
c.Name,
parents[0],
with,
fmt.Sprintf("%[1]v %[1]v_PTR();\n", c.Name),
)
} else {
fmt.Fprintf(tsd, "\tabstract class %v_ITF {\n\t\t%v\t}\n\n",
c.Name,
fmt.Sprintf("%[1]v %[1]v_PTR();\n", c.Name),
)
}
if len(parents) != 0 && !(strings.HasPrefix(strings.Title(c.Name), "Generic") && c.Module == "QtSensors") {
var with string
if len(parents) > 1 {
with = " with "
for i, p := range parents {
if i == 0 {
continue
}
p = strings.TrimSuffix(p, "_ITF")
with += p + ", "
}
with = strings.TrimSuffix(with, ", ")
}
fmt.Fprintf(tsd, "\tclass %[1]v extends %v%v implements %[1]v_ITF {\n",
c.Name,
strings.TrimSuffix(parents[0], "_ITF"),
with,
)
} else {
fmt.Fprintf(tsd, "\tclass %[1]v extends Internal implements %[1]v_ITF {\n",
c.Name,
)
}
if c.Name == "QJSEngine" { //TODO: also NewQVariant1 + toInterface function
fmt.Fprint(tsd, "\t\tQJSValue NewGoType(List<dynamic> i) { return callLocalFunction([\"\",this.Pointer(),this.className,\"NewGoType\",i]); }\n") //TODO: check if one of the args is a function
//fmt.Fprint(tsd, "\t\tToGoType(jsval:QJSValue, dst:any):void\n") //TODO: only possible with reflection in dart
//fmt.Fprint(tsd, "\t\tvoid NewJSType(QJSValue property, String name, dynamic i) { callLocalFunction([\"\",this.Pointer(),this.className,\"NewJSType\",property, name, i]); }\n") //TODO: check if one of the args is a function
}
for _, l := range gosplitted {
out := convertToDart(c.Name, l, true)
if out != "" {
tsd.WriteString("\t\t" + out + "\n")
}
}
fmt.Fprint(tsd, "\t}\n")
}
}
@ -941,7 +1046,7 @@ default:
bb.WriteString(out)
}
}
if cmd.ImportsQmlOrQuick() || mode == NONE {
if cmd.ImportsQmlOrQuick() || cmd.ImportsInterop() || mode == NONE {
out := fmt.Sprintf("qt.FuncMap[\"%[1]v.%[2]v\"] = %[2]v\n", goModule(func() string {
if mode == MOC {
return pkg
@ -962,16 +1067,24 @@ default:
fmt.Fprint(bb, "module.Set(\"NewQVariant1\", func(i interface{}) *js.Object { return qt.MakeWrapper(NewQVariant1(i)) })\n")
}
}
if cmd.ImportsQmlOrQuick() || mode == NONE {
if cmd.ImportsQmlOrQuick() || cmd.ImportsInterop() || mode == NONE {
fmt.Fprint(bb, "qt.FuncMap[\"core.NewQVariant1\"] = NewQVariant1\n")
}
}
if utils.QT_GEN_TSD() && c.IsSupported() {
if (utils.QT_GEN_TSD() || utils.QT_GEN_DART()) && c.IsSupported() {
for _, l := range gosplitted {
out := convertToTypeScriptDefinition(c.Name, l, false)
if out != "" {
tsd.WriteString("\t" + out + ";\n")
var out string
if utils.QT_GEN_TSD() {
out = convertToTypeScriptDefinition(c.Name, l, false)
if out != "" {
tsd.WriteString("\t" + out + ";\n")
}
} else {
out = convertToDart(c.Name, l, false)
if out != "" {
tsd.WriteString("\t" + out + "\n")
}
}
}
}
@ -989,7 +1102,7 @@ default:
} else if parser.UseJs() {
fmt.Fprintf(bb, "module.Set(\"%v__%v\", int64(%v__%v))\n", strings.Split(e.Fullname, "::")[0], v.Name, strings.Split(e.Fullname, "::")[0], v.Name)
}
if cmd.ImportsQmlOrQuick() || mode == NONE {
if cmd.ImportsQmlOrQuick() || cmd.ImportsInterop() || mode == NONE {
bb.WriteString(fmt.Sprintf("qt.EnumMap[\"%[1]v.%[2]v__%[3]v\"] = int64(%[2]v__%[3]v)\n", goModule(module), strings.Split(e.Fullname, "::")[0], v.Name))
if utils.QT_GEN_TSD() {
@ -1090,6 +1203,7 @@ import "C"
}
}
var dartInput []string
fmt.Fprint(bb, "import (\n")
for _, m := range append(parser.GetLibs(), "qt", "strings", "unsafe", "log", "runtime", "fmt", "errors", "js", "time", "hex", "reflect", "math", "sync", "strconv") {
mlow := strings.ToLower(m)
@ -1128,6 +1242,9 @@ import "C"
if utils.QT_GEN_TSD() {
fmt.Fprintf(tsdbb, "/// <reference path=\"%v.d.ts\" />\n", mlow)
} else if utils.QT_GEN_DART() {
fmt.Fprintf(tsdbb, "import '%[1]v.dart' as %[1]v;\n", mlow)
dartInput = append(dartInput, fmt.Sprintf("%v.initModule();", mlow))
}
if mode == MOC {
@ -1187,7 +1304,7 @@ import "C"
if module == "gui" && utils.QT_API_NUM(utils.QT_VERSION()) >= 5050 {
if mode == NONE {
fmt.Fprintln(bb, "_ \"github.com/therecipe/qt/internal/binding/runtime\"")
} else if mode == MINIMAL && cmd.ImportsQmlOrQuick() {
} else if mode == MINIMAL && (cmd.ImportsQmlOrQuick() || cmd.ImportsInterop()) {
fmt.Fprintln(bb, "_ \"github.com/therecipe/qt/internal/binding/runtime\"")
}
}
@ -1264,9 +1381,17 @@ import "C"
out = []byte(pre)
}
if utils.QT_GEN_TSD() && (mode == NONE || mode == MINIMAL) {
tsdbb.Write(tsd.Bytes())
utils.SaveBytes(utils.GoQtPkgPath(goModule(module), goModule(module)+".d.ts"), tsdbb.Bytes())
if (utils.QT_GEN_TSD() || utils.QT_GEN_DART()) && (mode == NONE || mode == MINIMAL) {
tsdBytes := tsd.Bytes()
if utils.QT_GEN_DART() {
tsdBytes = bytes.Replace(tsdBytes, []byte("\n___IMPORTPLACEHOLDER___"), []byte(strings.Join(dartInput, "\n")), -1)
}
tsdbb.Write(tsdBytes)
ending := ".d.ts"
if utils.QT_GEN_DART() {
ending = ".dart"
}
utils.SaveBytes(utils.GoQtPkgPath(goModule(module), goModule(module)+ending), tsdbb.Bytes())
}
return out
@ -1295,7 +1420,7 @@ func convertToTypeScriptDefinition(className string, l string, convertClassMetho
}
if (strings.Contains(l, "ptr *"+className+")") && !strings.Contains(l, " __") && convertClassMethods) ||
(strings.HasPrefix(l, "func New"+className) && !strings.Contains(l, "FromPointer(") && !convertClassMethods) ||
(strings.HasPrefix(l, "func New"+className) && strings.Contains(l, className+"{") && !strings.Contains(l, "FromPointer(") && !convertClassMethods) ||
(strings.HasPrefix(l, "func "+className+"_") && !convertClassMethods) {
l = strings.Replace(l, " ", " ", -1)
l = strings.Replace(l, "func (", "function(", -1)
@ -1415,3 +1540,310 @@ func convertToTypeScriptDefinition(className string, l string, convertClassMetho
}
return ""
}
func convertToDart(className string, l string, convertClassMethods bool) string {
l = strings.TrimSpace(l)
if strings.HasPrefix(l, "func New"+className+"FromPointer") && !convertClassMethods {
return fmt.Sprintf("%[1]v New%[1]vFromPointer(int ptr) { final r = new %[1]v(); r.initFrom(ptr, \"%[2]v.%[1]v\"); return r; }", className, goModule(parser.State.ClassMap[className].Module))
}
if (strings.Contains(l, "ptr *"+className+")") && !strings.Contains(l, " __") && convertClassMethods) ||
(strings.HasPrefix(l, "func New"+className) && strings.Contains(l, className+"{") && !strings.Contains(l, "FromPointer(") && !convertClassMethods) ||
(strings.HasPrefix(l, "func "+className+"_") && !convertClassMethods) {
l = strings.Replace(l, " ", " ", -1)
l = strings.Replace(l, "func (", "function(", -1)
l = strings.Replace(l, "func New", "function_New", -1)
l = strings.Replace(l, "func "+className, "function_"+className, -1)
l = strings.Replace(l, ") )", "))", -1)
l = strings.Replace(l, ", ", ",", -1)
l = strings.Replace(l, "*", "", -1)
if convertClassMethods {
l = strings.Join(strings.Split(l, ") ")[1:], ") ")
}
l = strings.TrimSpace(strings.TrimSuffix(l, "{"))
l = strings.Replace(l, " ", ":", -1)
for _, v := range [][]string{{"string", "String"}, {"[]byte", "String"}, {"interface{}", "dynamic"}, {"...interface{}", "List<dynamic>"}} {
l = strings.Replace(l, ":"+v[0], ":"+v[1], -1)
}
for _, v := range []string{"string"} {
l = strings.Replace(l, ":[]"+v, ":[]String", -1)
l = strings.Replace(l, "["+v+"]", "[String]", -1)
l = strings.Replace(l, "]"+v+")", "]String)", -1)
l = strings.Replace(l, "]"+v, "]String", -1)
}
for _, v := range []string{"uint8", "int8", "uint16", "int16", "uint32", "int32", "uint64", "int64", "uintptr", "uint", "int", "float32", "float64", "unsafe.Pointer"} {
l = strings.Replace(l, ":"+v, ":int", -1)
l = strings.Replace(l, ":[]"+v, ":[]int", -1)
l = strings.Replace(l, "["+v+"]", "[int]", -1)
}
l = strings.Replace(l, "in:", "i:", -1)
ls := strings.Split(l, ":")
for i, lss := range ls {
for _, sc := range []string{")", ",", ";"} {
lsss := strings.Split(lss, sc)
if strings.Contains(lsss[0], "[]") {
for _, scc := range []string{",", ")", ";"} {
lssss := strings.Split(lsss[0], scc)
for j := range lssss {
if strings.Contains(lssss[j], "[]") {
lssss[j] = "List<" + strings.Replace(lssss[j], "[]", "", -1) + ">"
}
}
lsss[0] = strings.Join(lssss, scc)
}
}
if strings.Contains(lsss[0], "map[") {
lsss[0] = strings.Replace(lsss[0], "map[", "Map<", -1)
for _, scc := range []string{",", ")", ";"} {
lssss := strings.Split(lsss[0], scc)
for j := range lssss {
if strings.Contains(lssss[j], "]") {
lssss[j] = strings.Replace(lssss[j], "]", "#", -1) + ">"
}
}
lsss[0] = strings.Join(lssss, scc)
}
}
//TODO: support enums
if strings.Contains(lsss[0], "__") {
index := strings.IndexAny(lsss[0], "),;")
if index != -1 {
lsss[0] = "int" + lsss[0][index:]
} else {
lsss[0] = "int"
}
}
lss = strings.Join(lsss, sc)
}
ls[i] = lss
}
l = strings.Join(ls, ":")
ls = strings.Split(l, "function(")
for i, lss := range ls {
if i == 0 {
continue
}
lse := strings.Split(lss, ")")
for j := range lse {
if j == 0 || j == len(lse)-1 {
continue
}
if strings.HasPrefix(lse[j], ":") {
lse[j] = "=>" + strings.TrimPrefix(lse[j], ":")
}
}
ls[i] = strings.Join(lse, ")")
}
l = strings.Join(ls, "(")
if strings.HasSuffix(l, ")") && !strings.Contains(l, "):(") {
l += ":void"
}
l = strings.Replace(l, "))", ")=>void)", -1)
if strings.Contains(l, "):(") {
ls = strings.Split(l, "):(")
ls[1] = strings.TrimSuffix(ls[1], ")")
if strings.Contains(ls[1], ",") {
ls[1] = "[" + ls[1] + "]"
}
for _, v := range [][]string{{"error", "String"}} {
ls[1] = strings.Replace(ls[1], v[0], v[1], -1)
}
l = strings.Join(ls, "):")
}
l = strings.Replace(l, "function_New", "New", -1)
l = strings.Replace(l, "function_"+className, className, -1)
l = strings.Replace(l, "function:", "func:", -1)
l = strings.Replace(l, "[_BLOCKING_]", "[]", -1)
///
///
///
var params []string
l = strings.Replace(l, ":(", ":Function(", -1)
if in := getInner(l); in != "" {
n, c := switchParameters(in)
params = c
l = strings.Replace(l, in, n, -1)
}
l = strings.Replace(l, "#", ",", -1)
ls = strings.Split(l, ":")
if len(ls) == 2 {
ls[0], ls[1] = ls[1], ls[0]
l = strings.Join(ls, " ")
}
ls = strings.Split(strings.Split(l, "(")[0], " ")
ret, name := ls[0], ls[1]
ret = strings.TrimSpace(ret)
name = strings.TrimSpace(name)
//needed because dart isn't supporting overloading: https://github.com/dart-lang/sdk/issues/26488
if c, ok := parser.State.ClassMap[className]; ok {
var (
f *parser.Function
classes = append([]string{c.Name}, c.GetAllBases()...)
)
for i, bcn := range classes {
if f == nil {
f = parser.State.ClassMap[bcn].GetTitledFunction(name)
if f == nil {
lookupName := name
switch {
case strings.HasPrefix(name, "Connect"):
lookupName = strings.TrimPrefix(lookupName, "Connect")
case strings.HasPrefix(name, "Disconnect"):
lookupName = strings.TrimPrefix(lookupName, "Disconnect")
case strings.HasSuffix(name, "Default"):
lookupName = strings.TrimSuffix(lookupName, "Default")
}
if lookupName != name {
f = parser.State.ClassMap[bcn].GetTitledFunction(lookupName)
}
}
continue
}
compareFunc := parser.State.ClassMap[bcn].GetTitledFunction(f.Name)
if compareFunc == nil {
compareFunc = parser.State.ClassMap[bcn].GetTitledFunction(name)
if compareFunc == nil {
continue
}
}
if bcf := compareFunc; bcf != nil &&
((len(bcf.Parameters) != len(f.Parameters)) || (bcf.Output != f.Output)) {
l = strings.Replace(l, name+"(", name+"_"+classes[i-1]+"(", -1)
break
}
var br bool
for j, p := range compareFunc.Parameters {
if p.Value != f.Parameters[j].Value {
l = strings.Replace(l, name+"(", name+"_"+classes[i-1]+"(", -1)
br = true
break
}
}
if br {
break
}
}
}
if name == "String" || name == "Map" { //TODO:
l = strings.Replace(l, name+"(", name+"_Function(", -1)
}
//
var input string
if len(params) > 0 {
input = "," + strings.Join(params, ",")
}
var (
return_prefix string
return_suffix string
)
if ret != "void" {
return_prefix = "return "
}
if strings.HasPrefix(ret, "List<") || strings.HasPrefix(ret, "Map<") {
return_prefix = "return " + ret + ".from("
return_suffix = ")"
}
if convertClassMethods {
//TODO: lookup Connect/Disconnect functions to figure out if they are really a signal/slot or virtual function
if strings.HasPrefix(name, "Connect") && len(params) == 1 {
l += fmt.Sprintf("{ callLocalAndRegisterRemoteFunction([\"\",this.Pointer(),this.className,\"%v\",\"___REMOTE_CALLBACK___\"]%v); }", name, input)
} else if strings.HasPrefix(name, "Disconnect") && len(params) == 0 {
l += fmt.Sprintf("{ callLocalAndDeregisterRemoteFunction([\"\",this.Pointer(),this.className,\"%v\"]); }", name)
} else {
l += fmt.Sprintf("{ %vcallLocalFunction([\"\",this.Pointer(),this.className,\"%v\"%v])%v; }", return_prefix, name, input, return_suffix)
}
} else {
//TODO: call enum function
l += fmt.Sprintf("{ initModule(); %vcallLocalFunction([\"\",\"\",\"%v.%v\",\"\"%v])%v; }", return_prefix, goModule(parser.State.ClassMap[className].Module), name, input, return_suffix)
}
if !(name == "Pointer" || name == "SetPointer") {
return l
}
}
return ""
}
func getInner(i string) string {
pres := strings.Split(i, "(")
if len(pres) > 1 {
pres = strings.Split(strings.Join(pres[1:], "("), ")")
return strings.Join(pres[:len(pres)-1], ")")
}
return ""
}
func switchParameters(i string) (string, []string) {
in := getInner(i)
if in != "" {
i = strings.Replace(i, in, "___PLACEHOLDER___", -1)
}
var pNames []string
if strings.Contains(i, ":") {
cs := strings.Split(i, ",")
for i, v := range cs {
vs := strings.Split(v, ":")
if len(vs) == 1 {
continue
}
var retval string
if strings.Contains(vs[1], "=>") {
vss := strings.Split(vs[1], "=>")
vs[1] = vss[0]
retval = vss[1]
}
pNames = append(pNames, vs[0])
vs[0], vs[1] = vs[1], vs[0]
cs[i] = strings.Join(vs, " ")
if retval != "" {
cs[i] = retval + " " + cs[i]
}
}
i = strings.Join(cs, ",")
}
if in != "" {
n, _ := switchParameters(in)
i = strings.Replace(i, "___PLACEHOLDER___", n, -1)
}
return i, pNames
}

View file

@ -67,6 +67,13 @@ func bundle(mode, target, path, name, depPath string, tagsCustom string, fast bo
utils.MkdirAll(assets)
copy(assets+"/.", filepath.Join(depPath, name+".app"))
if cmd.ImportsFlutter() {
utils.MkdirAll(filepath.Join(depPath, name+".app", "Contents", "Frameworks"))
copy(filepath.Join(path, "build", "flutter_assets"), filepath.Join(depPath, name+".app", "Contents", "MacOS", "flutter_assets"))
copy(filepath.Join(path, "FlutterEmbedder.framework"), filepath.Join(depPath, name+".app", "Contents", "Frameworks", "FlutterEmbedder.framework"))
}
if utils.QT_STATIC() {
break
}
@ -162,6 +169,18 @@ func bundle(mode, target, path, name, depPath string, tagsCustom string, fast bo
utils.MkdirAll(assets)
copy(assets+"/.", depPath)
if cmd.ImportsFlutter() {
libDir := "lib"
if name == libDir {
libDir = "libs"
}
utils.MkdirAll(filepath.Join(depPath, libDir))
copy(filepath.Join(path, "build", "flutter_assets"), filepath.Join(depPath, "flutter_assets"))
copy(filepath.Join(path, "libflutter_engine.so"), filepath.Join(depPath, "lib", "libflutter_engine.so"))
copy(filepath.Join(path, "icudtl.dat"), filepath.Join(depPath, "icudtl.dat"))
}
if utils.QT_STATIC() || utils.QT_PKG_CONFIG() {
break
}
@ -349,6 +368,14 @@ func bundle(mode, target, path, name, depPath string, tagsCustom string, fast bo
utils.MkdirAll(assets)
copy(assets+string(filepath.Separator)+".", depPath)
if cmd.ImportsFlutter() {
utils.MkdirAll(filepath.Join(depPath, "flutter_assets"))
copy(filepath.Join(path, "build", "flutter_assets"+string(filepath.Separator)+"."), filepath.Join(depPath, "flutter_assets"))
copy(filepath.Join(path, "flutter_engine.dll"), filepath.Join(depPath, "flutter_engine.dll"))
copy(filepath.Join(path, "icudtl.dat"), filepath.Join(depPath, "icudtl.dat"))
}
//TODO: -->
switch {
case runtime.GOOS != target:

View file

@ -110,6 +110,10 @@ func Deploy(mode, target, path string, docker bool, ldFlags, tags string, fast b
minimal.Minimal(path, target, tags, true)
}
if cmd.ImportsFlutter() {
flutter(target, path)
}
build(mode, target, path, ldFlags, tags, name, depPath, fast, comply)
if !(fast || ((utils.QT_DEBUG_QML() || utils.QT_FELGO_LIVE()) && target == runtime.GOOS)) || (target == "js" || target == "wasm") {

View file

@ -0,0 +1,200 @@
package deploy
import (
"archive/zip"
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
"os"
"os/exec"
"path/filepath"
"strings"
"github.com/therecipe/qt/internal/utils"
)
func flutter(target string, path string) {
fPath, err := exec.LookPath("flutter")
if err != nil {
utils.Log.WithError(err).Error("failed to find the flutter binary in your PATH")
return
}
//check cache
switch target {
case "windows":
if utils.ExistsFile(filepath.Join(path, "flutter_engine.dll")) {
utils.Log.Debugf("flutter deps already cached; skipping download for %v", target)
return
}
case "darwin":
if utils.ExistsDir(filepath.Join(path, "FlutterEmbedder.framework")) {
utils.Log.Debugf("flutter deps already cached; skipping download for %v", target)
return
}
case "linux":
if utils.ExistsFile(filepath.Join(path, "libflutter_engine.so")) {
utils.Log.Debugf("flutter deps already cached; skipping download for %v", target)
return
}
}
//get engine version
cmd := exec.Command(fPath, "build", "bundle")
cmd.Dir = path
utils.RunCmd(cmd, "build the flutter bundle")
var vs struct {
Channel string `json:"channel"`
EngineRevision string `json:"engineRevision"`
}
err = json.Unmarshal([]byte(utils.RunCmd(exec.Command(fPath, "--machine", "--version"), "readout the flutter engine version")), &vs)
if err != nil {
utils.Log.WithError(err).Error("failed to unmarshal the flutter engine version response")
}
//download and symlink engine
url := fmt.Sprintf("https://storage.googleapis.com/flutter_infra/flutter/%v/%v-x64/", vs.EngineRevision, target)
switch target {
case "windows":
url += "windows-x64-embedder.zip"
case "darwin":
url += "FlutterEmbedder.framework.zip"
case "linux":
url += "linux-x64-embedder"
}
unzip(download(url), path, target)
switch target {
case "windows":
for _, f := range []string{"flutter_engine.dll", "flutter_engine.dll.lib"} {
utils.RemoveAll(utils.GoQtPkgPath("flutter", f))
os.Symlink(filepath.Join(path, f), utils.GoQtPkgPath("flutter", f))
}
case "darwin":
f := "FlutterEmbedder.framework"
utils.RemoveAll(utils.GoQtPkgPath("flutter", f))
os.Symlink(filepath.Join(path, f), utils.GoQtPkgPath("flutter", f))
case "linux":
f := "libflutter_engine.so"
utils.RemoveAll(utils.GoQtPkgPath("flutter", f))
os.Symlink(filepath.Join(path, f), utils.GoQtPkgPath("flutter", f))
}
//download additional artifacts
if target != "darwin" {
unzip(download(fmt.Sprintf("https://storage.googleapis.com/flutter_infra/flutter/%v/%v-x64/artifacts.zip", vs.EngineRevision, target)), path, target)
}
}
func download(url string) []byte {
resp, err := http.Get(url)
if err != nil {
utils.Log.WithError(err).Errorf("failed to download %v", url)
return nil
}
bb := new(bytes.Buffer)
copyWithProgress(bb, resp.Body, func(off int64) {
utils.Log.Debugf("%v => %v%%\n", filepath.Base(url), off/(resp.ContentLength/100))
})
resp.Body.Close()
return bb.Bytes()
}
func copyWithProgress(w io.Writer, r io.Reader, callback func(off int64)) error {
tee := io.TeeReader(r, w)
buf := make([]byte, bytes.MinRead*10)
off := int64(0)
for count := 0; ; count++ {
n, err := tee.Read(buf)
off += int64(n)
if count%100 == 0 {
callback(off)
}
if err == io.EOF {
break
}
if err != nil {
return err
}
}
callback(off)
return nil
}
func unzip(data []byte, dst string, target string) {
r, err := zip.NewReader(bytes.NewReader(data), int64(len(data)))
if err != nil {
utils.Log.WithError(err).Errorf("failed to read zip archive for %v", target)
}
for _, f := range r.File {
if f.FileInfo().IsDir() {
os.MkdirAll(filepath.Join(dst, f.Name), f.Mode())
continue
}
if f.Mode()&os.ModeSymlink != 0 {
fr, errR := f.Open()
if errR != nil {
utils.Log.WithError(errR).Error("failed to read file")
}
bb := new(bytes.Buffer)
io.Copy(bb, fr)
fr.Close()
os.Symlink(filepath.Join(filepath.Dir(filepath.Join(dst, f.Name)), bb.String()), filepath.Join(dst, f.Name))
continue
}
if strings.HasSuffix(f.Name, ".zip") {
dst = filepath.Join(dst, strings.TrimSuffix(f.Name, ".zip"))
utils.MkdirAll(dst)
fr, errR := f.Open()
if errR != nil {
utils.Log.WithError(errR).Error("failed to read file")
}
bb := new(bytes.Buffer)
io.Copy(bb, fr)
fr.Close()
unzip(bb.Bytes(), dst, target)
continue
}
if ((f.Name == "libflutter_engine.so" || f.Name == "flutter_engine.dll" ||
f.Name == "flutter_engine.dll.lib" || f.Name == "icudtl.dat") && target != "darwin") || target == "darwin" {
fw, errC := os.OpenFile(filepath.Join(dst, f.Name), os.O_WRONLY|os.O_CREATE|os.O_TRUNC, f.Mode())
if errC != nil {
utils.Log.WithError(errC).Error("failed to create file")
}
fr, errR := f.Open()
if errR != nil {
utils.Log.WithError(errR).Error("failed to read file")
}
io.Copy(fw, fr)
fw.Close()
fr.Close()
}
}
}

View file

@ -23,7 +23,7 @@ import (
func Minimal(path, target, tags string, skipSetup bool) {
rootPath := path
defer func() {
if cmd.ImportsQmlOrQuick() { //TODO: and not deploying + reinstate on moc.moc with deploying ?
if cmd.ImportsQmlOrQuick() || cmd.ImportsInterop() { //TODO: and not deploying + reinstate on moc.moc with deploying ?
if pkg_path := utils.GoQtPkgPath("internal/binding/runtime"); utils.QT_NOT_CACHED() || !utils.ExistsFile(filepath.Join(pkg_path, templater.CgoFileNames(pkg_path, target, templater.MOC)[0])) {
filepath.Walk(pkg_path, func(path string, info os.FileInfo, err error) error {
if err != nil || info.IsDir() {
@ -129,16 +129,20 @@ func Minimal(path, target, tags string, skipSetup bool) {
files = append(files, file)
fileMutex.Unlock()
}
if target == "js" || cmd.ImportsQmlOrQuick() { //TODO: wasm as well
if target == "js" || cmd.ImportsQmlOrQuick() || cmd.ImportsInterop() { //TODO: wasm as well
filepath.Walk(path, func(path string, info os.FileInfo, err error) error {
if err != nil || info.IsDir() || strings.HasPrefix(path, filepath.Join(rootPath, "deploy")) {
return err
}
if filepath.Ext(path) == ".js" || (filepath.Ext(path) == ".ts" && !strings.HasSuffix(path, ".d.ts")) || filepath.Ext(path) == ".qml" {
utils.Log.WithField("path", path).Debug("analyse js for minimal")
if filepath.Ext(path) == ".js" || (filepath.Ext(path) == ".ts" && !strings.HasSuffix(path, ".d.ts")) || filepath.Ext(path) == ".qml" || filepath.Ext(path) == ".dart" {
file := utils.Load(path)
fileMutex.Lock()
files = append(files, file)
if strings.Contains(file, utils.PackageName) {
files = append(files, file)
utils.Log.WithField("path", path).Debug("analyse for minimal")
} else {
utils.Log.WithField("path", path).Debug("ignore for minimal")
}
fileMutex.Unlock()
}
return nil
@ -233,6 +237,9 @@ func Minimal(path, target, tags string, skipSetup bool) {
}
exportClass(parser.State.ClassMap["QSvgWidget"], files)
case "android", "android-emulator":
exportClass(parser.State.ClassMap["QSvgWidget"], files)
case "rpi1", "rpi2", "rpi3":
if !utils.QT_RPI() {
break
@ -301,7 +308,7 @@ func Minimal(path, target, tags string, skipSetup bool) {
if _, ok := parser.State.ClassMap["QVariant"]; ok {
exportClass(parser.State.ClassMap["QVariant"], files)
for _, fn := range []string{"type", "canConvert", "toList", "toMap", "isValid", "toString"} {
for _, fn := range []string{"type", "canConvert", "toList", "toMap", "isValid", "toString", "isNull"} {
exportFunction(parser.State.ClassMap["QVariant"].GetFunction(fn), files)
}

View file

@ -180,7 +180,7 @@ func Test(target string, docker, vagrant bool, vagrantsystem string) {
)
templater.CleanupDepsForCI()
templater.CleanupDepsForCI = func() {}
cmd.CleanupImportsQmlOrQuickForCI()
cmd.CleanupRegisteredImportsForCI()
}
}
}

View file

@ -23,6 +23,8 @@ var (
importedStd = make(map[string]struct{})
importedStdMutex = new(sync.Mutex)
importsQmlOrQuick string
importsInterop string
importsFlutter string
)
func IsStdPkg(pkg string) bool {
@ -90,6 +92,58 @@ func GetImports(path, target, tagsCustom string, level int, onlyDirect bool) []s
utils.Log.WithField("path", path).Debug("project depends on qml or quick: " + importsQmlOrQuick)
}
if importsInterop == "" {
stdImport := make([]string, len(importedStd)+1)
var c int
for k := range importedStd {
stdImport[c] = k
c++
}
stdImport[len(stdImport)-1] = "github.com/therecipe/qt/internal/binding/runtime"
cmd := utils.GoList(fmt.Sprintf("{{if not .Standard}}{{if eq .ImportPath \"%v\"}}{{else}}{{range .Imports}}{{if eq . \"github.com/therecipe/qt/interop\"}}{{.}}{{end}}{{end}}{{end}}{{end}}", strings.Join(stdImport, "\" \"")), "-deps", utils.BuildTags(tags))
if !utils.UseGOMOD(path) || (utils.UseGOMOD(path) && !strings.Contains(strings.Replace(path, "\\", "/", -1), "/vendor/")) {
cmd.Dir = path
} else if utils.UseGOMOD(path) && strings.Contains(strings.Replace(path, "\\", "/", -1), "/vendor/") {
cmd.Dir = filepath.Dir(utils.GOMOD(path))
vl := strings.Split(strings.Replace(path, "\\", "/", -1), "/vendor/")
cmd.Args = append(cmd.Args, vl[len(vl)-1])
}
for k, v := range env {
cmd.Env = append(cmd.Env, fmt.Sprintf("%v=%v", k, v))
}
importsInterop = fmt.Sprint(strings.TrimSpace(utils.RunCmd(cmd, "go list imports interop")) != "")
utils.Log.WithField("path", path).Debug("project depends on interop: " + importsInterop)
}
if importsFlutter == "" {
stdImport := make([]string, len(importedStd)+1)
var c int
for k := range importedStd {
stdImport[c] = k
c++
}
stdImport[len(stdImport)-1] = "github.com/therecipe/qt/internal/binding/runtime"
cmd := utils.GoList(fmt.Sprintf("{{if not .Standard}}{{if eq .ImportPath \"%v\"}}{{else}}{{range .Imports}}{{if eq . \"github.com/therecipe/qt/flutter\"}}{{.}}{{end}}{{end}}{{end}}{{end}}", strings.Join(stdImport, "\" \"")), "-deps", utils.BuildTags(tags))
if !utils.UseGOMOD(path) || (utils.UseGOMOD(path) && !strings.Contains(strings.Replace(path, "\\", "/", -1), "/vendor/")) {
cmd.Dir = path
} else if utils.UseGOMOD(path) && strings.Contains(strings.Replace(path, "\\", "/", -1), "/vendor/") {
cmd.Dir = filepath.Dir(utils.GOMOD(path))
vl := strings.Split(strings.Replace(path, "\\", "/", -1), "/vendor/")
cmd.Args = append(cmd.Args, vl[len(vl)-1])
}
for k, v := range env {
cmd.Env = append(cmd.Env, fmt.Sprintf("%v=%v", k, v))
}
importsFlutter = fmt.Sprint(strings.TrimSpace(utils.RunCmd(cmd, "go list imports flutter")) != "")
utils.Log.WithField("path", path).Debug("project depends on flutter: " + importsFlutter)
}
importedStdMutex.Unlock()
}()
}
@ -143,7 +197,7 @@ func GetImports(path, target, tagsCustom string, level int, onlyDirect bool) []s
wg.Done()
}()
if strings.Contains(l, "github.com/therecipe/qt") && !strings.Contains(l, "qt/internal") {
if strings.Contains(l, "github.com/therecipe/qt") && !(strings.Contains(l, "qt/internal") || strings.Contains(l, "qt/flutter") || strings.Contains(l, "qt/interop")) {
if strings.Contains(l, "github.com/therecipe/qt/") {
importedStdMutex.Lock()
importedStd[l] = struct{}{}
@ -192,7 +246,22 @@ func ImportsQmlOrQuick() (o bool) {
importedStdMutex.Unlock()
return
}
func CleanupImportsQmlOrQuickForCI() { importsQmlOrQuick = "" }
func ImportsInterop() (o bool) {
importedStdMutex.Lock()
o = importsInterop == "true"
importedStdMutex.Unlock()
return
}
func ImportsFlutter() (o bool) {
importedStdMutex.Lock()
o = importsFlutter == "true"
importedStdMutex.Unlock()
return
}
func CleanupRegisteredImportsForCI() { importsQmlOrQuick = ""; importsInterop = ""; importsFlutter = "" }
func GetGoFiles(path, target, tagsCustom string) []string {
utils.Log.WithField("path", path).WithField("target", target).WithField("tagsCustom", tagsCustom).Debug("get go files")

View file

@ -20,4 +20,4 @@ jobs:
GO111MODULE: on
steps:
-
script: 'md C:\\Users\\VssAdministrator\\go\\src && cd C:\\Users\\VssAdministrator\\go\\src && git clone https://github.com/therecipe/examples.git && cd ./examples && go install -v -tags=no_env github.com/therecipe/qt/cmd/... && go mod vendor && git clone https://github.com/therecipe/env_windows_amd64_513.git vendor/github.com/therecipe/env_windows_amd64_513 && C:\Users\VssAdministrator\go\bin\qtsetup && C:\Users\VssAdministrator\go\bin\qtdeploy test desktop ./basic/widgets'
script: 'md C:\Users\VssAdministrator\go\src && git clone https://github.com/therecipe/examples.git C:\Users\VssAdministrator\go\src\examples && cd C:\Users\VssAdministrator\go\src\examples && go install -v -tags=no_env github.com/therecipe/qt/cmd/... && go mod vendor && git clone https://github.com/therecipe/env_windows_amd64_513.git vendor/github.com/therecipe/env_windows_amd64_513 && C:\Users\VssAdministrator\go\bin\qtsetup && C:\Users\VssAdministrator\go\bin\qtdeploy test desktop ./basic/widgets'

View file

@ -520,3 +520,7 @@ func QT_RESOURCES_BIG() bool {
func QT_GEN_TSD() bool {
return os.Getenv("QT_GEN_TSD") == "true"
}
func QT_GEN_DART() bool {
return os.Getenv("QT_GEN_DART") == "true"
}

62
interop/dart/dart.go Normal file
View file

@ -0,0 +1,62 @@
package dart
/*
#include "stdlib.h"
#include "dart_native_api.h"
typedef char* (*syncCallIntoRemote) (char*);
char* postSync(syncCallIntoRemote postFunc, char* work_addr){
return postFunc(work_addr);
}
typedef const bool (*asyncCallIntoRemote) (Dart_Port, Dart_CObject*);
void postSomething(asyncCallIntoRemote postFunc, int64_t send_port, char* work_addr){
Dart_CObject dart_object;
dart_object.type = Dart_CObject_kString;
dart_object.value.as_string = work_addr;
postFunc(send_port, &dart_object);
}
*/
import "C"
import (
"unsafe"
"github.com/therecipe/qt/interop"
)
var (
syncCallIntoRemote C.syncCallIntoRemote
asyncCallIntoRemote C.asyncCallIntoRemote
port int64
)
func init() {
interop.SyncCallIntoRemote = func(s string) string {
i := C.CString(s)
o := C.postSync(syncCallIntoRemote, i)
ret := C.GoString(o)
C.free(unsafe.Pointer(i))
C.free(unsafe.Pointer(o))
return ret
}
interop.AsyncCallIntoRemote = func(s string) {
i := C.CString(s)
C.postSomething(asyncCallIntoRemote, C.int64_t(port), i)
C.free(unsafe.Pointer(i))
}
}
//
func _syncCallIntoRemoteRegister(fp unsafe.Pointer) {
syncCallIntoRemote = C.syncCallIntoRemote(fp)
}
func _asyncCallIntoRemoteRegister(p int64, fp unsafe.Pointer) {
port = p
asyncCallIntoRemote = C.asyncCallIntoRemote(fp)
}

3664
interop/dart/dart_api.h Normal file

File diff suppressed because it is too large Load diff

16
interop/dart/dart_exp.go Normal file
View file

@ -0,0 +1,16 @@
package dart
import "C"
import (
"unsafe"
)
//export syncCallIntoRemoteRegister
func syncCallIntoRemoteRegister(fun unsafe.Pointer) {
_syncCallIntoRemoteRegister(fun)
}
//export asyncCallIntoRemoteRegister
func asyncCallIntoRemoteRegister(port int64, fun unsafe.Pointer) {
_asyncCallIntoRemoteRegister(port, fun)
}

View file

@ -0,0 +1,192 @@
/*
* Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
* for details. All rights reserved. Use of this source code is governed by a
* BSD-style license that can be found in the LICENSE file.
*/
#ifndef RUNTIME_INCLUDE_DART_NATIVE_API_H_
#define RUNTIME_INCLUDE_DART_NATIVE_API_H_
#include "dart_api.h" /* NOLINT */
/*
* ==========================================
* Message sending/receiving from native code
* ==========================================
*/
/**
* A Dart_CObject is used for representing Dart objects as native C
* data outside the Dart heap. These objects are totally detached from
* the Dart heap. Only a subset of the Dart objects have a
* representation as a Dart_CObject.
*
* The string encoding in the 'value.as_string' is UTF-8.
*
* All the different types from dart:typed_data are exposed as type
* kTypedData. The specific type from dart:typed_data is in the type
* field of the as_typed_data structure. The length in the
* as_typed_data structure is always in bytes.
*
* The data for kTypedData is copied on message send and ownership remains with
* the caller. The ownership of data for kExternalTyped is passed to the VM on
* message send and returned when the VM invokes the
* Dart_WeakPersistentHandleFinalizer callback; a non-NULL callback must be
* provided.
*/
typedef enum {
Dart_CObject_kNull = 0,
Dart_CObject_kBool,
Dart_CObject_kInt32,
Dart_CObject_kInt64,
Dart_CObject_kDouble,
Dart_CObject_kString,
Dart_CObject_kArray,
Dart_CObject_kTypedData,
Dart_CObject_kExternalTypedData,
Dart_CObject_kSendPort,
Dart_CObject_kCapability,
Dart_CObject_kUnsupported,
Dart_CObject_kNumberOfTypes
} Dart_CObject_Type;
typedef struct _Dart_CObject {
Dart_CObject_Type type;
union {
bool as_bool;
int32_t as_int32;
int64_t as_int64;
double as_double;
char* as_string;
struct {
Dart_Port id;
Dart_Port origin_id;
} as_send_port;
struct {
int64_t id;
} as_capability;
struct {
intptr_t length;
struct _Dart_CObject** values;
} as_array;
struct {
Dart_TypedData_Type type;
intptr_t length;
uint8_t* values;
} as_typed_data;
struct {
Dart_TypedData_Type type;
intptr_t length;
uint8_t* data;
void* peer;
Dart_WeakPersistentHandleFinalizer callback;
} as_external_typed_data;
} value;
} Dart_CObject;
/**
* Posts a message on some port. The message will contain the Dart_CObject
* object graph rooted in 'message'.
*
* While the message is being sent the state of the graph of Dart_CObject
* structures rooted in 'message' should not be accessed, as the message
* generation will make temporary modifications to the data. When the message
* has been sent the graph will be fully restored.
*
* If true is returned, the message was enqueued, and finalizers for external
* typed data will eventually run, even if the receiving isolate shuts down
* before processing the message. If false is returned, the message was not
* enqueued and ownership of external typed data in the message remains with the
* caller.
*
* This function may be called on any thread when the VM is running (that is,
* after Dart_Initialize has returned and before Dart_Cleanup has been called).
*
* \param port_id The destination port.
* \param message The message to send.
*
* \return True if the message was posted.
*/
DART_EXPORT bool Dart_PostCObject(Dart_Port port_id, Dart_CObject* message);
/**
* Posts a message on some port. The message will contain the integer 'message'.
*
* \param port_id The destination port.
* \param message The message to send.
*
* \return True if the message was posted.
*/
DART_EXPORT bool Dart_PostInteger(Dart_Port port_id, int64_t message);
/**
* A native message handler.
*
* This handler is associated with a native port by calling
* Dart_NewNativePort.
*
* The message received is decoded into the message structure. The
* lifetime of the message data is controlled by the caller. All the
* data references from the message are allocated by the caller and
* will be reclaimed when returning to it.
*/
typedef void (*Dart_NativeMessageHandler)(Dart_Port dest_port_id,
Dart_CObject* message);
/**
* Creates a new native port. When messages are received on this
* native port, then they will be dispatched to the provided native
* message handler.
*
* \param name The name of this port in debugging messages.
* \param handler The C handler to run when messages arrive on the port.
* \param handle_concurrently Is it okay to process requests on this
* native port concurrently?
*
* \return If successful, returns the port id for the native port. In
* case of error, returns ILLEGAL_PORT.
*/
DART_EXPORT Dart_Port Dart_NewNativePort(const char* name,
Dart_NativeMessageHandler handler,
bool handle_concurrently);
/* TODO(turnidge): Currently handle_concurrently is ignored. */
/**
* Closes the native port with the given id.
*
* The port must have been allocated by a call to Dart_NewNativePort.
*
* \param native_port_id The id of the native port to close.
*
* \return Returns true if the port was closed successfully.
*/
DART_EXPORT bool Dart_CloseNativePort(Dart_Port native_port_id);
/*
* ==================
* Verification Tools
* ==================
*/
/**
* Forces all loaded classes and functions to be compiled eagerly in
* the current isolate..
*
* TODO(turnidge): Document.
*/
DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle Dart_CompileAll();
DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle Dart_ReadAllBytecode();
/**
* Finalizes all classes.
*/
DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle Dart_FinalizeAllClasses();
/* This function is intentionally undocumented.
*
* It should not be used outside internal tests.
*/
DART_EXPORT void* Dart_ExecuteInternalCommand(const char* command, void* arg);
#endif /* INCLUDE_DART_NATIVE_API_H_ */ /* NOLINT */

621
interop/interop.go Normal file
View file

@ -0,0 +1,621 @@
package interop
import (
"math"
"reflect"
"runtime"
"strings"
"sync"
"unsafe"
"github.com/therecipe/qt"
"github.com/therecipe/qt/core"
)
var (
Z_newEngineHelper func(p core.QObject_ITF) *core.QObject
finalizerMap = make(map[unsafe.Pointer][]*core.QObject)
finalizerMapMutex sync.Mutex
)
type ptr_itf interface {
Pointer() unsafe.Pointer
}
func Z_initEngine(engine PseudoQJSEngine_ITF) {
ptr := engine.PseudoQJSEngine_PTR()
ptr.QObject.ConnectDestroyed(func(ptr *core.QObject) {
finalizerMapMutex.Lock()
pointers := finalizerMap[ptr.Pointer()]
delete(finalizerMap, ptr.Pointer())
finalizerMapMutex.Unlock()
for _, o := range pointers {
o.DestroyQObject()
}
runtime.GC()
})
if !ptr.GlobalObject().Property("___engineHelper").IsUndefined() || Z_newEngineHelper == nil {
return
}
ptr.GlobalObject().SetProperty("nil", NewPseudoQJSValue(PseudoQJSValue__UndefinedValue))
helper := Z_newEngineHelper(engine)
ptr.GlobalObject().SetProperty("___engineHelper", ptr.NewQObject(helper))
ptr.GlobalObject().SetProperty("___engineHelperPointer", ptr.NewGoType(helper.Pointer()))
ptr.GlobalObject().SetProperty("___factory_single_func", ptr.Evaluate(`
(function(cn, fn) {
return function() {
var callArgs = [___engineHelperPointer, this.___pointer, cn, fn];
for (var i = 0; i < arguments.length; i++) { callArgs.push(arguments[i]) }
return ___engineHelper.wrapperFunction(callArgs);
};
});
`, "", 0))
ptr.GlobalObject().SetProperty("___factory_batch_funcs", ptr.Evaluate(`
(function(that, cn, fns) {
fns.forEach(function(fn) {
that[fn] = ___factory_single_func(cn, fn);
})
});
`, "", 0))
ptr.GlobalObject().SetProperty("___factory_batch_global_funcs", ptr.Evaluate(`
(function(that, pfx, fns) {
fns.forEach(function(fn) {
that[fn] = ___factory_single_func(pfx+"."+fn, "");
})
});
`, "", 0))
ptr.GlobalObject().SetProperty("___factory_batch_global_enums", ptr.Evaluate(`
(function(that, ens) {
ens.forEach(function(en) {
that[en[0]] = en[1];
})
});
`, "", 0))
ptr.GlobalObject().SetProperty("___connectDestroyed", ptr.Evaluate(`
(function(that) {
that.ConnectDestroyed(function(){ that.___pointer = nil })
});
`, "", 0))
prefE := make(map[string][][]interface{})
qt.EnumMapMutex.Lock()
for en, ev := range qt.EnumMap {
pfx := strings.Split(en, ".")
prefE[pfx[0]] = append(prefE[pfx[0]], []interface{}{pfx[1], ev})
}
qt.EnumMapMutex.Unlock()
for pfx, ens := range prefE {
var jsv *PseudoQJSValue
if m := ptr.GlobalObject().Property(pfx); m.IsUndefined() {
jsv = ptr.NewObject()
ptr.GlobalObject().SetProperty(pfx, jsv)
} else {
jsv = m
}
inp := ptr.NewGoType(ens)
ptr.GlobalObject().Property("___factory_batch_global_enums").Call([]*PseudoQJSValue{jsv, inp})
inp.DestroyPseudoQJSValue()
}
pref := make(map[string][]string)
qt.FuncMapMutex.Lock()
for fn := range qt.FuncMap {
pfx := strings.Split(fn, ".")
if len(pfx) == 2 { //TODO: re-register 3rdparty functions?
pref[pfx[0]] = append(pref[pfx[0]], pfx[1])
}
}
qt.FuncMapMutex.Unlock()
for pfx, fns := range pref {
var jsv *PseudoQJSValue
if m := ptr.GlobalObject().Property(pfx); m.IsUndefined() {
jsv = ptr.NewObject()
ptr.GlobalObject().SetProperty(pfx, jsv)
} else {
jsv = m
}
inp := ptr.NewGoType(fns)
ptr.GlobalObject().Property("___factory_batch_global_funcs").Call([]*PseudoQJSValue{jsv, NewPseudoQJSValue8(pfx), inp})
inp.DestroyPseudoQJSValue()
}
}
func Z_wrapperFunction(jsvals *PseudoQJSValue) *PseudoQJSValue {
var m reflect.Value
cn, fn := jsvals.Property2(2).ToString(), jsvals.Property2(3).ToString()
if fn == "" {
v, _ := qt.GetFuncMap(cn)
m = reflect.ValueOf(v)
} else {
var rt reflect.Type
if t, ok := qt.GetItfMap(cn + "_ITF"); ok {
rt = reflect.TypeOf(t)
} else {
t, _ = qt.GetItfMap(cn)
rt = reflect.TypeOf(t)
}
//TODO: use ptr_itf instead ?
//TODO: use *FromPointer instead
//TODO: make SetPointer work as backup, for classes that don't support *FromPointer -> needs manual registration like for *FromPointer
o := reflect.New(rt)
o.MethodByName("SetPointer").Call([]reflect.Value{reflect.ValueOf(unsafe.Pointer(uintptr(jsvals.Property2(1).ToVariant().ToULongLong(nil))))})
m = o.MethodByName(fn)
}
engine := PseudoQJSEngine_qjsEngine(core.NewQObjectFromPointer(unsafe.Pointer(uintptr(jsvals.Property2(0).ToVariant().ToULongLong(nil)))))
if fn == "NewGoType" || (fn == "NewQVariant1" && cn == "core.QVariant") {
input := make([]interface{}, jsvals.Property("length").ToInt()-4)
for i := 0; i < len(input); i++ {
in := jsvals.Property2(uint(4 + i))
switch in.ToVariant().Type() {
case core.QVariant__List:
var o []interface{}
engine.ToGoType(in, &o)
input[i] = o
case core.QVariant__Map:
var o map[string]interface{}
engine.ToGoType(in, &o)
input[i] = o
default:
input[i] = in.ToVariant().ToInterface()
}
}
if fn == "NewQVariant1" {
return engine.NewGoType(core.NewQVariant1(input[0]))
}
if cn != "interop.PseudoQJSEngine" {
refInput := make([]reflect.Value, len(input))
for i, v := range input {
if jsv := jsvals.Property2(uint(4 + i)); jsv.IsCallable() {
refInput[i] = reflect.ValueOf(func(i interface{}) interface{} { //TODO: remote needs to provide infos about the expected arguments (needed for the callbacks for Qml created in the remote)
return jsv.Call([]*PseudoQJSValue{engine.NewGoType(i)}).ToVariant().ToInterface()
})
} else {
refInput[i] = reflect.ValueOf(v)
}
}
return engine.NewGoType(m.Call(refInput)[0].Interface())
}
return engine.NewGoType(engine.NewGoType(input...))
} else {
input := make([]reflect.Value, m.Type().NumIn())
for i := 0; i < len(input); i++ {
input[i] = engine.fromJsToRef(m.Type().In(i), jsvals.Property2(uint(4+i)))
}
ret := m.Call(input)
if len(ret) == 0 {
return NewPseudoQJSValue(PseudoQJSValue__UndefinedValue)
}
rret := engine.NewGoType(ret[0].Interface())
if reflect.TypeOf(ret[0].Interface()).Implements(reflect.TypeOf((*core.QObject_ITF)(nil)).Elem()) { //TODO: check for destroyed signal instead, or simply override the destructor instead ?
if qt.ExistsSignal(ret[0].Interface().(ptr_itf).Pointer(), "destroyed") {
engine.GlobalObject().Property("___connectDestroyed").Call([]*PseudoQJSValue{rret}) //TODO: connect destroyed/destructor from go instead ?
}
}
return rret
}
}
func (ptr *PseudoQJSEngine) ToGoType(jsval *PseudoQJSValue, dst interface{}) {
out := ptr.fromJsToRef(reflect.TypeOf(dst), jsval)
if out.Type().Kind() == reflect.Ptr {
out = out.Elem()
}
reflect.ValueOf(dst).Elem().Set(out)
}
func (ptr *PseudoQJSEngine) fromJsToRef(tofi reflect.Type, jsval *PseudoQJSValue) reflect.Value {
tofiO := tofi
if tofi.Kind() == reflect.Ptr {
tofi = tofi.Elem()
}
t, ok := qt.GetItfMap(tofi.String() + "_ITF")
if ok {
tofi = reflect.TypeOf(t)
} else {
t, ok = qt.GetItfMap(tofi.String())
if ok {
tofi = reflect.TypeOf(t)
}
}
switch {
case tofi.Kind() == reflect.UnsafePointer:
return reflect.ValueOf(unsafe.Pointer(uintptr(jsval.ToVariant().ToULongLong(nil))))
case tofi.Kind() == reflect.Uintptr:
return reflect.ValueOf(uintptr(jsval.ToVariant().ToULongLong(nil)))
case tofi.Kind() == reflect.Func:
return reflect.MakeFunc(tofi, func(args []reflect.Value) []reflect.Value {
input := make([]*PseudoQJSValue, len(args))
for i, arg := range args {
input[i] = ptr.NewGoType(arg.Interface())
}
if ret := jsval.Call(input); tofi.NumOut() != 0 {
return []reflect.Value{ptr.fromJsToRef(tofi.Out(0), ret)}
}
return nil
})
//TODO: merge into (*core.QVariant).ToGoType ? >>>
case tofiO.ConvertibleTo(reflect.TypeOf(int8(0))):
switch tofi.Kind() {
case reflect.Float32, reflect.Float64:
return reflect.ValueOf(jsval.ToVariant().ToDouble(nil)).Convert(tofi)
}
return reflect.ValueOf(jsval.ToVariant().ToLongLong(nil)).Convert(tofi)
//<<<
case tofi.Kind() == reflect.Slice, tofi.Kind() == reflect.Array:
var rv reflect.Value
if ls := jsval.Property("length").ToInt(); tofi.Kind() == reflect.Slice {
rv = reflect.MakeSlice(tofi, ls, ls)
} else {
rv = reflect.New(tofi).Elem()
}
for is := 0; is < rv.Len(); is++ {
rv.Index(is).Set(ptr.fromJsToRef(tofi.Elem(), jsval.Property2(uint(is))))
}
return rv
case tofi.Kind() == reflect.Map:
rv := reflect.MakeMapWithSize(tofi, jsval.Property("length").ToInt())
for k, _ := range jsval.ToVariant().ToMap() { //TODO: get keys from js function instead ?
rv.SetMapIndex(reflect.ValueOf(k).Convert(tofi.Key()), ptr.fromJsToRef(tofi.Elem(), jsval.Property(k)))
}
return rv
case ok:
if tofi.String() == "interop.PseudoQJSValue" {
if className := jsval.Property("___className").ToString(); className != "interop.PseudoQJSValue" {
t, ok := qt.GetItfMap(className + "_ITF")
if ok {
tofi = reflect.TypeOf(t)
} else {
t, ok = qt.GetItfMap(className)
if ok {
tofi = reflect.TypeOf(t)
}
}
if ok {
rv := reflect.New(tofi)
rv.MethodByName("SetPointer").Call([]reflect.Value{reflect.ValueOf(unsafe.Pointer(uintptr(jsval.Property("___pointer").ToVariant().ToULongLong(nil))))})
return reflect.ValueOf(ptr.NewGoType(rv.Interface()))
}
}
}
if tofi.String() == "core.QVariant" && jsval.IsUndefined() {
return reflect.ValueOf(core.NewQVariant())
}
//TODO: use ptr_itf instead ?
//TODO: use *FromPointer instead
//TODO: make SetPointer work as backup, for classes that don't support *FromPointer -> needs manual registration like for *FromPointer
rv := reflect.New(tofi)
rv.MethodByName("SetPointer").Call([]reflect.Value{reflect.ValueOf(unsafe.Pointer(uintptr(jsval.Property("___pointer").ToVariant().ToULongLong(nil))))})
return rv
case tofi.Kind() == reflect.Struct && !tofiO.Implements(reflect.TypeOf((*ptr_itf)(nil)).Elem()): //TODO: support pure go types (i.e. types that don't support ptr_itf as well)
rv := reflect.New(tofi).Elem()
for k, _ := range jsval.ToVariant().ToMap() { //TODO: get keys from js function instead ?
val := jsval.Property(k)
realName := k
toInt := false
for id := 0; id < rv.NumField(); id++ {
if tag, ok := rv.Type().Field(id).Tag.Lookup("json"); ok {
switch {
case strings.Count(tag, ",") == 0:
if k == tag {
realName = rv.Type().Field(id).Name
}
default:
tags := strings.Split(tag, ",")
if k == tags[0] || (len(tags[0]) == 0 && k == rv.Type().Field(id).Name) {
realName = rv.Type().Field(id).Name
if tags[1] == "string" {
toInt = true
}
}
}
}
}
field := rv.FieldByName(realName)
if !field.IsValid() {
continue
}
if toInt {
field.Set(reflect.ValueOf(val.ToVariant().ToLongLong(nil)).Convert(field.Type())) //TODO: pure go type conversion
} else {
field.Set(ptr.fromJsToRef(field.Type(), val))
}
}
if tofiO.Kind() == reflect.Ptr {
return rv.Addr()
}
return rv
case jsval.IsCallable():
return reflect.ValueOf(jsval)
case jsval.IsUndefined(), jsval.IsNull():
return reflect.Zero(tofi)
}
ii := reflect.New(tofi)
jsval.ToVariant().ToGoType(ii.Interface()) //TODO: does ToGoType support QObject or ptr_itf types inside maps/slices/structs ?
if tofiO.Kind() == reflect.Ptr {
return reflect.ValueOf(ii.Interface())
}
return reflect.ValueOf(ii.Elem().Interface())
}
//TODO: NewPseudoQJSValue1
func (ptr *PseudoQJSEngine) NewJSType(property *PseudoQJSValue, name string, i *PseudoQJSValue) { //TODO: support for js functions
ptr.newGoType(property, name, i)
}
func (ptr *PseudoQJSEngine) NewGoType(i ...interface{}) *PseudoQJSValue {
return ptr.newGoType(nil, "", i...)
}
func (ptr *PseudoQJSEngine) newGoType(property *PseudoQJSValue, name string, i ...interface{}) *PseudoQJSValue {
rv := reflect.ValueOf(i[0])
if len(i) > 1 {
rv = reflect.ValueOf(i[1])
}
//TODO: merged into core.NewQVariant1; can probably be removed after testing >>>
switch rv.Kind() {
case reflect.UnsafePointer:
return ptr.ToScriptValue(core.NewQVariant1(uint64(uintptr(rv.Interface().(unsafe.Pointer)))))
case reflect.Uintptr:
return ptr.ToScriptValue(core.NewQVariant1(uint64(rv.Interface().(uintptr))))
}
if rv.Type().ConvertibleTo(reflect.TypeOf(int8(0))) {
if rv.Kind() == reflect.Int64 {
return ptr.ToScriptValue(core.NewQVariant1(rv.Convert(reflect.TypeOf(int64(0))).Interface()))
}
return ptr.ToScriptValue(core.NewQVariant1(rv.Interface()))
}
//<<<
switch rv.Kind() {
case reflect.Func:
var fn string
if len(i) > 1 {
fn = i[0].(string)
} else {
fn = runtime.FuncForPC(rv.Pointer()).Name()
if strings.Contains(fn, "/") {
fns := strings.Split(fn, "/")
fn = fns[len(fns)-1]
}
}
if _, ok := qt.GetFuncMap(fn); !ok {
qt.SetFuncMap(fn, rv.Interface())
}
return ptr.makeFuncWrapper(fn)
case reflect.Slice, reflect.Array:
jsv := ptr.NewArray(uint(rv.Len()))
for i := 0; i < rv.Len(); i++ {
inp := ptr.NewGoType(rv.Index(i).Interface())
jsv.SetProperty2(uint(i), inp)
inp.DestroyPseudoQJSValue()
}
return jsv
case reflect.Map:
jsv := ptr.NewObject()
for _, k := range rv.MapKeys() {
if key := core.NewQVariant1(k.Interface()); key.CanConvert(int(core.QMetaType__QString)) { //TODO: replace with pure go (int -> string) conversion
jsv.SetProperty(key.ToString(), ptr.NewGoType(rv.MapIndex(k).Interface()))
}
}
return jsv
case reflect.Struct:
jsv := ptr.NewObject()
for id := 0; id < rv.NumField(); id++ {
if key := core.NewQVariant1(rv.Type().Field(id).Name); key.CanConvert(int(core.QMetaType__QString)) { //TODO: replace with pure go (int -> string) conversion
field := rv.Field(id)
if !field.CanInterface() {
continue
}
if tag, ok := rv.Type().Field(id).Tag.Lookup("json"); ok {
switch {
case (strings.HasSuffix(tag, ",omitempty") && isZero(field)) || tag == "-":
case strings.Count(tag, ",") == 0:
jsv.SetProperty(tag, ptr.NewGoType(field.Interface()))
default:
tags := strings.Split(tag, ",")
name := rv.Type().Field(id).Name
if len(tags[0]) != 0 {
name = tags[0]
}
v := ptr.NewGoType(field.Interface())
if tags[1] == "string" {
v = ptr.NewGoType(v.ToString()) //TODO: pure go type conversion
}
jsv.SetProperty(name, v)
}
} else {
jsv.SetProperty(rv.Type().Field(id).Name, ptr.NewGoType(field.Interface()))
}
}
}
return jsv
}
var jsv *PseudoQJSValue
if reflect.TypeOf(i[0]).Implements(reflect.TypeOf((*ptr_itf)(nil)).Elem()) {
jsv = ptr.NewObject()
} else {
jsv = ptr.ToScriptValue(core.NewQVariant1(i[0]))
}
if rv.Type().String() == "*interop.PseudoQJSValue" {
className := rv.Interface().(*PseudoQJSValue).Property("___className").ToString()
if className != "interop.PseudoQJSValue" {
var tofi reflect.Type
t, ok := qt.GetItfMap(className + "_ITF")
if ok {
tofi = reflect.TypeOf(t)
} else {
t, ok = qt.GetItfMap(className)
if ok {
tofi = reflect.TypeOf(t)
}
}
if ok {
rvn := reflect.New(tofi)
rvn.MethodByName("SetPointer").Call([]reflect.Value{reflect.ValueOf(unsafe.Pointer(uintptr(rv.Interface().(*PseudoQJSValue).Property("___pointer").ToVariant().ToULongLong(nil))))})
ptr.makeObjectWrapper(rvn.Interface(), jsv)
}
}
}
if property == nil {
if reflect.TypeOf(i[0]).Implements(reflect.TypeOf((*ptr_itf)(nil)).Elem()) {
ptr.makeObjectWrapper(i[0], jsv)
}
} else {
property.SetProperty(name, jsv)
}
return jsv
}
func isZero(v reflect.Value) bool {
switch v.Kind() {
case reflect.Bool:
return !v.Bool()
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
return v.Int() == 0
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
return v.Uint() == 0
case reflect.Float32, reflect.Float64:
return math.Float64bits(v.Float()) == 0
case reflect.Complex64, reflect.Complex128:
c := v.Complex()
return math.Float64bits(real(c)) == 0 && math.Float64bits(imag(c)) == 0
case reflect.Array:
for i := 0; i < v.Len(); i++ {
if !isZero(v.Index(i)) {
return false
}
}
return true
case reflect.Chan, reflect.Func, reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice, reflect.UnsafePointer:
return v.IsNil()
case reflect.String:
return v.Len() == 0
case reflect.Struct:
for i := 0; i < v.NumField(); i++ {
if !isZero(v.Field(i)) {
return false
}
}
return true
default:
// This should never happens, but will act as a safeguard for
// later, as a default value doesn't makes sense here.
panic(&reflect.ValueError{"reflect.Value.IsZero", v.Kind()})
}
}
func (ptr *PseudoQJSEngine) makeFuncWrapper(fn string) *PseudoQJSValue {
retV := ptr.GlobalObject().Property("___factory_single_func").Call([]*PseudoQJSValue{NewPseudoQJSValue8(fn), NewPseudoQJSValue8("")})
//only needed for generic binding >>>
retV.SetProperty("callable", ptr.NewGoType(true))
retV.SetProperty("callableLocal", ptr.NewGoType(true))
retV.SetProperty("callableName", ptr.NewGoType(fn))
//<<<
//TODO: allow creation of funcs in arbitrary module depth
if strings.Count(fn, ".") == 0 {
ptr.GlobalObject().SetProperty(fn, retV)
} else {
var jsv *PseudoQJSValue
if m := ptr.GlobalObject().Property(strings.Split(fn, ".")[0]); m.IsUndefined() {
jsv = ptr.NewObject()
ptr.GlobalObject().SetProperty(strings.Split(fn, ".")[0], jsv)
} else {
jsv = m
}
jsv.SetProperty(strings.Split(fn, ".")[1], retV)
}
return retV
}
func (ptr *PseudoQJSEngine) makeObjectWrapper(in interface{}, jsv *PseudoQJSValue) {
jsv.SetProperty("___pointer", ptr.ToScriptValue(core.NewQVariant1(uint64(uintptr(in.(ptr_itf).Pointer()))))) //TODO: can be shortened once NewQVariant1 supports unsafe.Pointer
rv := reflect.ValueOf(in)
className := rv.Type().Elem().String()
jsv.SetProperty("___className", NewPseudoQJSValue8(className))
_, ok1 := qt.GetItfMap(className + "_ITF")
if _, ok2 := qt.GetItfMap(className); !(ok1 || ok2) {
qt.SetItfMap(className, rv.Elem().Interface())
}
/* TODO:
if rv.Kind() == reflect.Ptr {
rv = rv.Elem()
}
*/
fns := make([]string, rv.NumMethod())
for i := 0; i < rv.NumMethod(); i++ {
fns[i] = rv.Type().Method(i).Name
}
ptr.GlobalObject().Property("___factory_batch_funcs").Call([]*PseudoQJSValue{jsv, NewPseudoQJSValue8(className), ptr.ToScriptValue(core.NewQVariant1(fns))})
if qt.HasFinalizer(in) {
buoy := core.NewQObject(nil)
buoy.ConnectDestroyed(func(*core.QObject) { runtime.KeepAlive(in) })
jsv.SetProperty("___buoy", ptr.NewQObject(buoy))
finalizerMapMutex.Lock()
finalizerMap[ptr.Pointer()] = append(finalizerMap[ptr.Pointer()], buoy)
finalizerMapMutex.Unlock()
}
}

178
interop/interop_api.go Normal file
View file

@ -0,0 +1,178 @@
package interop
import (
"encoding/json"
"strings"
"github.com/therecipe/qt/core"
)
var (
syncCallChan = make(chan string, 0)
asyncCallChan = make(chan string, 0)
mainThreadIsBlockedAlready bool
SyncCallIntoRemote func(string) string
AsyncCallIntoRemote func(string)
)
func RunOnMainBlockingWithWorkerQueue(f func()) {
done := make(chan bool, 0)
Helper.RunOnMainThread(func() { f(); done <- true })
for {
select {
case s := <-syncCallChan:
syncCallChan <- SyncCallIntoRemote(s)
case <-done:
goto br
}
}
br:
}
//
//
//
var Helper = NewHelper(nil)
type helper struct {
core.QObject
_ func() `constructor:"init"`
_ func(f func()) `slot:"runOnMainThread"`
}
func (h *helper) init() {
h.ConnectRunOnMainThread(func(f func()) { f() })
}
//
//
//
func _syncCallIntoLocal(s string) string {
//println("input:", s)
var i []interface{}
json.Unmarshal([]byte(s), &i)
pseudoIn := NewPseudoQJSValue1(i)
for j := uint(0); j < pseudoIn.Property("length").ToUInt(nil); j++ {
if v := pseudoIn.Property2(j); strings.HasPrefix(v.ToString(), "___REMOTE_CALLBACK___") {
f := map[string]interface{}{
"___pointer": pseudoIn.Property2(1).ToULongLong(nil),
"callable": true,
"callableLocal": false,
"callableName": pseudoIn.Property2(3).ToString(),
}
if vs := v.ToString(); strings.Contains(vs, ":") {
f["callableName"] = strings.Split(vs, ":")[1]
}
fun := NewPseudoQJSValue1(f)
pseudoIn.SetProperty2(j, fun)
//TODO: allow creation of funcs in arbitrary module depth
if pseudoIn.Property2(3).ToString() == "NewGoType" {
ptr := PseudoQJSEngine_qjsEngine(nil)
fn := f["callableName"].(string)
if strings.Count(fn, ".") == 0 {
ptr.GlobalObject().SetProperty(fn, fun)
} else {
var jsv *PseudoQJSValue
if m := ptr.GlobalObject().Property(strings.Split(fn, ".")[0]); m.IsUndefined() {
jsv = ptr.NewObject()
//ptr.GlobalObject().SetProperty(strings.Split(fn, ".")[0], jsv) //TODO: look below
} else {
jsv = m
}
//TODO: PseudoQJSValue should instead automatically update it's parent(s) instead, so it behaves similar to qml.QJSValue
jsv.SetProperty(strings.Split(fn, ".")[1], fun)
ptr.GlobalObject().SetProperty(strings.Split(fn, ".")[0], jsv)
}
}
}
}
var ret *PseudoQJSValue
RunOnMainBlockingWithWorkerQueue(func() {
mainThreadIsBlockedAlready = true
ret = Z_wrapperFunction(pseudoIn)
mainThreadIsBlockedAlready = false
})
var o []byte
if ret == nil {
var someOutput []interface{}
o, _ = json.Marshal(someOutput)
} else {
eg := PseudoQJSEngine_qjsEngine(nil)
//TODO: use reflection and/or recursion instead
switch ret.Type() {
case core.QVariant__Map:
var typ core.QVariant__Type
for _, v := range ret.ToMap() {
typ = v.Type()
break
}
switch typ {
case core.QVariant__Map:
var someOutput map[string]map[string]interface{}
eg.ToGoType(ret, &someOutput)
o, _ = json.Marshal(someOutput)
case core.QVariant__List:
var someOutput map[string][]interface{}
eg.ToGoType(ret, &someOutput)
o, _ = json.Marshal(someOutput)
default:
var someOutput map[string]interface{}
eg.ToGoType(ret, &someOutput)
o, _ = json.Marshal(someOutput)
}
case core.QVariant__List:
var typ core.QVariant__Type
for _, v := range ret.ToList() {
typ = v.Type()
break
}
switch typ {
case core.QVariant__Map:
var someOutput []map[string]interface{}
eg.ToGoType(ret, &someOutput)
o, _ = json.Marshal(someOutput)
case core.QVariant__List:
var someOutput [][]interface{}
eg.ToGoType(ret, &someOutput)
o, _ = json.Marshal(someOutput)
default:
var someOutput []interface{}
eg.ToGoType(ret, &someOutput)
o, _ = json.Marshal(someOutput)
}
default:
var someOutput interface{}
eg.ToGoType(ret, &someOutput)
o, _ = json.Marshal(someOutput)
}
//<<<
}
//println("output:", string(o))
return string(o)
}
func _asyncCallIntoRemoteResponse(s string) { asyncCallChan <- s }

13
interop/interop_c_api.go Normal file
View file

@ -0,0 +1,13 @@
package interop
import "C"
//export syncCallIntoLocal
func syncCallIntoLocal(i *C.char) *C.char {
return C.CString(_syncCallIntoLocal(C.GoString(i)))
}
//export asyncCallIntoRemoteResponse
func asyncCallIntoRemoteResponse(i *C.char) {
_asyncCallIntoRemoteResponse(C.GoString(i))
}

View file

@ -0,0 +1 @@
package interop

13
interop/pseudo.go Normal file
View file

@ -0,0 +1,13 @@
package interop
import "github.com/therecipe/qt"
func init() {
qt.ItfMap["interop.PseudoQJSEngine_ITF"] = PseudoQJSEngine{}
qt.FuncMap["interop.PseudoQJSEngine_qjsEngine"] = PseudoQJSEngine_qjsEngine
qt.ItfMap["interop.PseudoQJSValue_ITF"] = PseudoQJSValue{}
qt.FuncMap["interop.NewPseudoQJSValue"] = NewPseudoQJSValue
qt.FuncMap["interop.NewPseudoQJSValue1"] = NewPseudoQJSValue1
qt.FuncMap["interop.NewPseudoQJSValue2"] = NewPseudoQJSValue2
qt.FuncMap["interop.NewPseudoQJSValue8"] = NewPseudoQJSValue8
}

87
interop/pseudo_engine.go Normal file
View file

@ -0,0 +1,87 @@
package interop
import (
"unsafe"
"github.com/therecipe/qt"
"github.com/therecipe/qt/core"
)
//TODO: this == nil checks
var globalEngine *PseudoQJSEngine
type PseudoQJSEngine struct {
QObject core.QObject //TODO: make it possible to subclass without invoking qtmoc
_globalObject *PseudoQJSValue
}
type PseudoQJSEngine_ITF interface {
core.QObject_ITF
PseudoQJSEngine_PTR() *PseudoQJSEngine
}
//TODO: make it possible to subclass without invoking qtmoc
func (this *PseudoQJSEngine) Pointer() unsafe.Pointer {
return this.QObject.Pointer()
}
func (this *PseudoQJSEngine) SetPointer(ptr unsafe.Pointer) {
this.QObject.SetPointer(ptr)
}
func (this *PseudoQJSEngine) QObject_PTR() *core.QObject {
return this.QObject.QObject_PTR()
}
//<<<
//public >>>
func PseudoQJSEngine_qjsEngine(i *core.QObject) *PseudoQJSEngine {
if globalEngine != nil {
return globalEngine
}
globalEngine = &PseudoQJSEngine{*core.NewQObject(nil), NewPseudoQJSValue1(make(map[string]interface{}))}
qt.Register(globalEngine.Pointer(), globalEngine)
return globalEngine
}
func (this *PseudoQJSEngine) NewObject() *PseudoQJSValue {
return NewPseudoQJSValue1(make(map[string]interface{}))
}
func (this *PseudoQJSEngine) NewArray(l uint) *PseudoQJSValue {
return NewPseudoQJSValue1(make([]interface{}, l))
}
func (this *PseudoQJSEngine) GlobalObject() *PseudoQJSValue {
o, _ := qt.Receive(this.Pointer())
return o.(*PseudoQJSEngine)._globalObject
}
func (this *PseudoQJSEngine) PseudoQJSEngine_PTR() *PseudoQJSEngine {
return this
}
//<<< public
func (this *PseudoQJSEngine) ToScriptValue(i *core.QVariant) *PseudoQJSValue {
return NewPseudoQJSValue2(i)
}
func (this *PseudoQJSEngine) NewQObject(i *core.QObject) *PseudoQJSValue {
o, _ := qt.Receive(this.Pointer())
i.SetParent(o.(*PseudoQJSEngine))
return NewPseudoQJSValue1(i)
}
func (this *PseudoQJSEngine) Evaluate(string, string, int) *PseudoQJSValue {
return NewPseudoQJSValue(1) //TODO: can be used to dynamically generate bindings on the remote side
}
func (this *PseudoQJSEngine) DestroyPseudoQJSEngine() {
this.QObject.DestroyQObject()
}

243
interop/pseudo_value.go Normal file
View file

@ -0,0 +1,243 @@
package interop
import (
"encoding/json"
"github.com/therecipe/qt/core"
"github.com/therecipe/qt"
)
//TODO: this == nil checks
const PseudoQJSValue__UndefinedValue int64 = 0
type PseudoQJSValue struct{ core.QVariant }
type PseudoQJSValue_ITF interface {
core.QVariant_ITF
PseudoQJSValue_PTR() *PseudoQJSValue
}
func NewPseudoQJSValue(i int64) *PseudoQJSValue {
return new(PseudoQJSValue)
}
func NewPseudoQJSValue1(i interface{}) *PseudoQJSValue {
return NewPseudoQJSValue2(core.NewQVariant1(i))
}
func NewPseudoQJSValue2(d *core.QVariant) *PseudoQJSValue {
if d != nil {
qt.SetFinalizer(d, nil) //there is the need to re-assign the finalizer to the PseudoQJSValue pointer to prevent double freeing the QVariant >>>
ret := &PseudoQJSValue{*d}
qt.SetFinalizer(ret, (*PseudoQJSValue).DestroyPseudoQJSValue) //<<< by the finalizer in case it was manually destroyed earlier by the destructor
return ret
}
return &PseudoQJSValue{}
}
func NewPseudoQJSValue8(i string) *PseudoQJSValue {
return NewPseudoQJSValue1(i)
}
func (this *PseudoQJSValue) ToInt() int {
return this.QVariant.ToInt(nil)
}
func (this *PseudoQJSValue) IsUndefined() bool {
return this == nil || this.Pointer() == nil
}
//public >>>
func (this *PseudoQJSValue) QPseudoQJSValue_PTR() *PseudoQJSValue {
return this
}
func (this *PseudoQJSValue) Length() int {
if this.IsObject() {
return len(this.ToMap())
} else if this.IsArray() {
return len(this.ToList())
}
return 0
}
func (this *PseudoQJSValue) IsArray() bool {
return this.QVariant.Type() == core.QVariant__List
}
func (this *PseudoQJSValue) IsObject() bool {
return this.QVariant.Type() == core.QVariant__Map
}
func (this *PseudoQJSValue) IsCallable() bool {
return this.Property("callable").ToBool()
}
func (this *PseudoQJSValue) HasProperty(n string) bool {
if this.IsObject() {
if _, ok := this.QVariant.ToMap()[n]; ok {
return ok
}
}
return false
}
func (this *PseudoQJSValue) Property(n string) *PseudoQJSValue {
if n == "length" && !this.HasProperty(n) {
return NewPseudoQJSValue1(this.Length())
}
if this.IsObject() {
return NewPseudoQJSValue2(this.ToMap()[n])
}
//TODO: make list usable as well?
return NewPseudoQJSValue(1)
}
func (this *PseudoQJSValue) Property2(n uint) *PseudoQJSValue {
if this.IsArray() {
return NewPseudoQJSValue2(this.ToList()[n])
}
//TODO: make map usable as well?
return NewPseudoQJSValue(1)
}
func (this *PseudoQJSValue) SetProperty(n string, v *PseudoQJSValue) {
if this.IsObject() {
data := this.ToMap()
data[n] = v.ToVariant()
this.Swap(core.NewQVariant1(data))
}
//TODO: make list usable as well?
}
func (this *PseudoQJSValue) SetProperty2(n uint, v *PseudoQJSValue) {
if this.IsArray() {
data := this.ToList()
data[n] = v.ToVariant()
this.Swap(core.NewQVariant1(data))
}
//TODO: make map usable as well?
}
func (this *PseudoQJSValue) DeleteProperty(n string) bool {
if this.IsObject() {
data := this.ToMap()
if _, ok := data[n]; ok {
delete(data, n)
this.Swap(core.NewQVariant1(data))
}
return true
}
return false
}
func (this *PseudoQJSValue) ToVariant() *core.QVariant {
return &this.QVariant
}
func (this *PseudoQJSValue) DestroyPseudoQJSValue() {
this.DestroyQVariant()
}
func (this *PseudoQJSValue) Call(in []*PseudoQJSValue) *PseudoQJSValue {
if !this.IsCallable() {
return NewPseudoQJSValue1(make(map[string]interface{}))
}
if this.Property("callableLocal").ToBool() {
_, ok := qt.GetFuncMap(this.Property("callableName").ToString())
if !ok {
return NewPseudoQJSValue1(make(map[string]interface{}))
}
return callLocalStaticFunction(this.Property("callableName").ToString(), in)
}
return this.callRemote(in)
}
func (this *PseudoQJSValue) callRemote(in []*PseudoQJSValue) *PseudoQJSValue {
i := []interface{}{this.Property("___pointer").ToInterface(), this.Property("callableName").ToInterface()}
for _, v := range in {
if v.Property("___pointer").ToString() != "" {
i = append(i, struct {
Pointer interface{} `json:"___pointer"`
ClassName interface{} `json:"___className"`
}{
v.Property("___pointer").ToInterface(),
v.Property("___className").ToInterface(),
})
} else {
switch v.Type() {
case core.QVariant__List:
var o []interface{}
PseudoQJSEngine_qjsEngine(nil).ToGoType(v, &o)
i = append(i, o)
case core.QVariant__Map:
var o map[string]interface{}
PseudoQJSEngine_qjsEngine(nil).ToGoType(v, &o)
i = append(i, o)
default:
i = append(i, v.ToInterface())
}
}
}
ib, _ := json.Marshal(i)
var ret string
if mainThreadIsBlockedAlready {
syncCallChan <- string(ib)
for { //blocks main thread and therefore needs core.QCoreApplication_ProcessEvents
select {
case ret = <-syncCallChan:
goto br
default:
core.QCoreApplication_ProcessEvents2(core.QEventLoop__AllEvents, 7) //TODO: is there some better way?
}
}
} else {
AsyncCallIntoRemote(string(ib))
for { //blocks main thread and therefore needs core.QCoreApplication_ProcessEvents
select {
case ret = <-asyncCallChan:
goto br
default:
core.QCoreApplication_ProcessEvents2(core.QEventLoop__AllEvents, 7) //TODO: is there some better way?
}
}
}
br:
var o interface{}
json.Unmarshal([]byte(ret), &o)
return NewPseudoQJSValue1(o)
}
func (this *PseudoQJSValue) CallMethod(name string, in []*PseudoQJSValue) *PseudoQJSValue {
//enginePtr, objPtr, className, funcName
input := []interface{}{"", this.Property("___pointer").ToInterface(), this.Property("___className").ToInterface(), name}
for _, v := range in {
input = append(input, v.ToInterface())
}
return Z_wrapperFunction(NewPseudoQJSValue1(input))
}
//<<< public
func callLocalStaticFunction(name string, in []*PseudoQJSValue) *PseudoQJSValue {
//enginePtr, objPtr, funcName, empty
input := []interface{}{"", "", name, ""}
for _, v := range in {
input = append(input, v.ToInterface())
}
return Z_wrapperFunction(NewPseudoQJSValue1(input))
}

View file

@ -27,7 +27,7 @@ func cGoUnpackBytes(s C.struct_QtLocation_PackedString) []byte {
defer cGoFreePacked(s.ptr)
if int(s.len) == -1 {
gs := C.GoString(s.data)
return *(*[]byte)(unsafe.Pointer(&gs))
return []byte(gs)
}
return C.GoBytes(unsafe.Pointer(s.data), C.int(s.len))
}
@ -6366,6 +6366,7 @@ func NewQPlaceUserFromPointer(ptr unsafe.Pointer) (n *QPlaceUser) {
return
}
func init() {
qt.ItfMap["location.QGeoCodeReply_ITF"] = QGeoCodeReply{}
qt.EnumMap["location.QGeoCodeReply__NoError"] = int64(QGeoCodeReply__NoError)
qt.EnumMap["location.QGeoCodeReply__EngineNotSetError"] = int64(QGeoCodeReply__EngineNotSetError)
qt.EnumMap["location.QGeoCodeReply__CommunicationError"] = int64(QGeoCodeReply__CommunicationError)
@ -6373,6 +6374,9 @@ func init() {
qt.EnumMap["location.QGeoCodeReply__UnsupportedOptionError"] = int64(QGeoCodeReply__UnsupportedOptionError)
qt.EnumMap["location.QGeoCodeReply__CombinationError"] = int64(QGeoCodeReply__CombinationError)
qt.EnumMap["location.QGeoCodeReply__UnknownError"] = int64(QGeoCodeReply__UnknownError)
qt.ItfMap["location.QGeoCodingManager_ITF"] = QGeoCodingManager{}
qt.ItfMap["location.QGeoCodingManagerEngine_ITF"] = QGeoCodingManagerEngine{}
qt.ItfMap["location.QGeoJson_ITF"] = QGeoJson{}
qt.ItfMap["location.QGeoManeuver_ITF"] = QGeoManeuver{}
qt.FuncMap["location.NewQGeoManeuver"] = NewQGeoManeuver
qt.FuncMap["location.NewQGeoManeuver2"] = NewQGeoManeuver2
@ -6487,20 +6491,41 @@ func init() {
qt.EnumMap["location.QGeoServiceProvider__OfflineNavigationFeature"] = int64(QGeoServiceProvider__OfflineNavigationFeature)
qt.EnumMap["location.QGeoServiceProvider__AnyNavigationFeatures"] = int64(QGeoServiceProvider__AnyNavigationFeatures)
qt.ItfMap["location.QGeoServiceProviderFactory_ITF"] = QGeoServiceProviderFactory{}
qt.ItfMap["location.QGeoServiceProviderFactoryV2_ITF"] = QGeoServiceProviderFactoryV2{}
qt.ItfMap["location.QGeoServiceProviderFactoryV3_ITF"] = QGeoServiceProviderFactoryV3{}
qt.ItfMap["location.QLocation_ITF"] = QLocation{}
qt.EnumMap["location.QLocation__UnspecifiedVisibility"] = int64(QLocation__UnspecifiedVisibility)
qt.EnumMap["location.QLocation__DeviceVisibility"] = int64(QLocation__DeviceVisibility)
qt.EnumMap["location.QLocation__PrivateVisibility"] = int64(QLocation__PrivateVisibility)
qt.EnumMap["location.QLocation__PublicVisibility"] = int64(QLocation__PublicVisibility)
qt.ItfMap["location.QPlace_ITF"] = QPlace{}
qt.ItfMap["location.QPlaceAttribute_ITF"] = QPlaceAttribute{}
qt.ItfMap["location.QPlaceCategory_ITF"] = QPlaceCategory{}
qt.ItfMap["location.QPlaceContactDetail_ITF"] = QPlaceContactDetail{}
qt.ItfMap["location.QPlaceContent_ITF"] = QPlaceContent{}
qt.EnumMap["location.QPlaceContent__NoType"] = int64(QPlaceContent__NoType)
qt.EnumMap["location.QPlaceContent__ImageType"] = int64(QPlaceContent__ImageType)
qt.EnumMap["location.QPlaceContent__ReviewType"] = int64(QPlaceContent__ReviewType)
qt.EnumMap["location.QPlaceContent__EditorialType"] = int64(QPlaceContent__EditorialType)
qt.EnumMap["location.QPlaceContent__CustomType"] = int64(QPlaceContent__CustomType)
qt.ItfMap["location.QPlaceContentReply_ITF"] = QPlaceContentReply{}
qt.ItfMap["location.QPlaceContentRequest_ITF"] = QPlaceContentRequest{}
qt.ItfMap["location.QPlaceDetailsReply_ITF"] = QPlaceDetailsReply{}
qt.ItfMap["location.QPlaceEditorial_ITF"] = QPlaceEditorial{}
qt.ItfMap["location.QPlaceIcon_ITF"] = QPlaceIcon{}
qt.ItfMap["location.QPlaceIdReply_ITF"] = QPlaceIdReply{}
qt.EnumMap["location.QPlaceIdReply__SavePlace"] = int64(QPlaceIdReply__SavePlace)
qt.EnumMap["location.QPlaceIdReply__SaveCategory"] = int64(QPlaceIdReply__SaveCategory)
qt.EnumMap["location.QPlaceIdReply__RemovePlace"] = int64(QPlaceIdReply__RemovePlace)
qt.EnumMap["location.QPlaceIdReply__RemoveCategory"] = int64(QPlaceIdReply__RemoveCategory)
qt.ItfMap["location.QPlaceImage_ITF"] = QPlaceImage{}
qt.ItfMap["location.QPlaceManager_ITF"] = QPlaceManager{}
qt.ItfMap["location.QPlaceManagerEngine_ITF"] = QPlaceManagerEngine{}
qt.ItfMap["location.QPlaceMatchReply_ITF"] = QPlaceMatchReply{}
qt.ItfMap["location.QPlaceMatchRequest_ITF"] = QPlaceMatchRequest{}
qt.ItfMap["location.QPlaceProposedSearchResult_ITF"] = QPlaceProposedSearchResult{}
qt.ItfMap["location.QPlaceRatings_ITF"] = QPlaceRatings{}
qt.ItfMap["location.QPlaceReply_ITF"] = QPlaceReply{}
qt.EnumMap["location.QPlaceReply__NoError"] = int64(QPlaceReply__NoError)
qt.EnumMap["location.QPlaceReply__PlaceDoesNotExistError"] = int64(QPlaceReply__PlaceDoesNotExistError)
qt.EnumMap["location.QPlaceReply__CategoryDoesNotExistError"] = int64(QPlaceReply__CategoryDoesNotExistError)
@ -6518,10 +6543,18 @@ func init() {
qt.EnumMap["location.QPlaceReply__ContentReply"] = int64(QPlaceReply__ContentReply)
qt.EnumMap["location.QPlaceReply__IdReply"] = int64(QPlaceReply__IdReply)
qt.EnumMap["location.QPlaceReply__MatchReply"] = int64(QPlaceReply__MatchReply)
qt.ItfMap["location.QPlaceResult_ITF"] = QPlaceResult{}
qt.ItfMap["location.QPlaceReview_ITF"] = QPlaceReview{}
qt.ItfMap["location.QPlaceSearchReply_ITF"] = QPlaceSearchReply{}
qt.ItfMap["location.QPlaceSearchRequest_ITF"] = QPlaceSearchRequest{}
qt.EnumMap["location.QPlaceSearchRequest__UnspecifiedHint"] = int64(QPlaceSearchRequest__UnspecifiedHint)
qt.EnumMap["location.QPlaceSearchRequest__DistanceHint"] = int64(QPlaceSearchRequest__DistanceHint)
qt.EnumMap["location.QPlaceSearchRequest__LexicalPlaceNameHint"] = int64(QPlaceSearchRequest__LexicalPlaceNameHint)
qt.ItfMap["location.QPlaceSearchResult_ITF"] = QPlaceSearchResult{}
qt.EnumMap["location.QPlaceSearchResult__UnknownSearchResult"] = int64(QPlaceSearchResult__UnknownSearchResult)
qt.EnumMap["location.QPlaceSearchResult__PlaceResult"] = int64(QPlaceSearchResult__PlaceResult)
qt.EnumMap["location.QPlaceSearchResult__ProposedSearchResult"] = int64(QPlaceSearchResult__ProposedSearchResult)
qt.ItfMap["location.QPlaceSearchSuggestionReply_ITF"] = QPlaceSearchSuggestionReply{}
qt.ItfMap["location.QPlaceSupplier_ITF"] = QPlaceSupplier{}
qt.ItfMap["location.QPlaceUser_ITF"] = QPlaceUser{}
}

View file

@ -27,7 +27,7 @@ func cGoUnpackBytes(s C.struct_QtMacExtras_PackedString) []byte {
defer cGoFreePacked(s.ptr)
if int(s.len) == -1 {
gs := C.GoString(s.data)
return *(*[]byte)(unsafe.Pointer(&gs))
return []byte(gs)
}
return C.GoBytes(unsafe.Pointer(s.data), C.int(s.len))
}

View file

@ -29,7 +29,7 @@ func cGoUnpackBytes(s C.struct_QtMultimedia_PackedString) []byte {
defer cGoFreePacked(s.ptr)
if int(s.len) == -1 {
gs := C.GoString(s.data)
return *(*[]byte)(unsafe.Pointer(&gs))
return []byte(gs)
}
return C.GoBytes(unsafe.Pointer(s.data), C.int(s.len))
}
@ -59897,6 +59897,190 @@ func NewWindowGrabberImageFromPointer(ptr unsafe.Pointer) (n *WindowGrabberImage
return
}
func init() {
qt.ItfMap["multimedia.AVFAudioEncoderSettingsControl_ITF"] = AVFAudioEncoderSettingsControl{}
qt.ItfMap["multimedia.AVFAudioInputSelectorControl_ITF"] = AVFAudioInputSelectorControl{}
qt.ItfMap["multimedia.AVFCameraControl_ITF"] = AVFCameraControl{}
qt.ItfMap["multimedia.AVFCameraDeviceControl_ITF"] = AVFCameraDeviceControl{}
qt.ItfMap["multimedia.AVFCameraExposureControl_ITF"] = AVFCameraExposureControl{}
qt.ItfMap["multimedia.AVFCameraFlashControl_ITF"] = AVFCameraFlashControl{}
qt.ItfMap["multimedia.AVFCameraFocusControl_ITF"] = AVFCameraFocusControl{}
qt.ItfMap["multimedia.AVFCameraInfo_ITF"] = AVFCameraInfo{}
qt.ItfMap["multimedia.AVFCameraInfoControl_ITF"] = AVFCameraInfoControl{}
qt.ItfMap["multimedia.AVFCameraMetaDataControl_ITF"] = AVFCameraMetaDataControl{}
qt.ItfMap["multimedia.AVFCameraRendererControl_ITF"] = AVFCameraRendererControl{}
qt.ItfMap["multimedia.AVFCameraService_ITF"] = AVFCameraService{}
qt.ItfMap["multimedia.AVFCameraSession_ITF"] = AVFCameraSession{}
qt.ItfMap["multimedia.AVFCameraViewfinderSettingsControl_ITF"] = AVFCameraViewfinderSettingsControl{}
qt.ItfMap["multimedia.AVFCameraViewfinderSettingsControl2_ITF"] = AVFCameraViewfinderSettingsControl2{}
qt.ItfMap["multimedia.AVFCameraZoomControl_ITF"] = AVFCameraZoomControl{}
qt.ItfMap["multimedia.AVFConfigurationLock_ITF"] = AVFConfigurationLock{}
qt.ItfMap["multimedia.AVFDisplayLink_ITF"] = AVFDisplayLink{}
qt.ItfMap["multimedia.AVFImageCaptureControl_ITF"] = AVFImageCaptureControl{}
qt.ItfMap["multimedia.AVFImageEncoderControl_ITF"] = AVFImageEncoderControl{}
qt.ItfMap["multimedia.AVFMediaContainerControl_ITF"] = AVFMediaContainerControl{}
qt.ItfMap["multimedia.AVFMediaPlayerControl_ITF"] = AVFMediaPlayerControl{}
qt.ItfMap["multimedia.AVFMediaPlayerMetaDataControl_ITF"] = AVFMediaPlayerMetaDataControl{}
qt.ItfMap["multimedia.AVFMediaPlayerService_ITF"] = AVFMediaPlayerService{}
qt.ItfMap["multimedia.AVFMediaPlayerServicePlugin_ITF"] = AVFMediaPlayerServicePlugin{}
qt.ItfMap["multimedia.AVFMediaPlayerSession_ITF"] = AVFMediaPlayerSession{}
qt.ItfMap["multimedia.AVFMediaRecorderControl_ITF"] = AVFMediaRecorderControl{}
qt.ItfMap["multimedia.AVFMediaRecorderControlIOS_ITF"] = AVFMediaRecorderControlIOS{}
qt.ItfMap["multimedia.AVFMediaVideoProbeControl_ITF"] = AVFMediaVideoProbeControl{}
qt.ItfMap["multimedia.AVFObjectDeleter_ITF"] = AVFObjectDeleter{}
qt.ItfMap["multimedia.AVFScopedPointer_ITF"] = AVFScopedPointer{}
qt.ItfMap["multimedia.AVFServicePlugin_ITF"] = AVFServicePlugin{}
qt.ItfMap["multimedia.AVFStorageLocation_ITF"] = AVFStorageLocation{}
qt.ItfMap["multimedia.AVFVideoEncoderSettingsControl_ITF"] = AVFVideoEncoderSettingsControl{}
qt.ItfMap["multimedia.AVFVideoFrameRenderer_ITF"] = AVFVideoFrameRenderer{}
qt.ItfMap["multimedia.AVFVideoOutput_ITF"] = AVFVideoOutput{}
qt.ItfMap["multimedia.AVFVideoRendererControl_ITF"] = AVFVideoRendererControl{}
qt.ItfMap["multimedia.AVFVideoWidget_ITF"] = AVFVideoWidget{}
qt.ItfMap["multimedia.AVFVideoWidgetControl_ITF"] = AVFVideoWidgetControl{}
qt.ItfMap["multimedia.AVFVideoWindowControl_ITF"] = AVFVideoWindowControl{}
qt.ItfMap["multimedia.AndroidCamcorderProfile_ITF"] = AndroidCamcorderProfile{}
qt.ItfMap["multimedia.AndroidCamera_ITF"] = AndroidCamera{}
qt.ItfMap["multimedia.AndroidMediaMetadataRetriever_ITF"] = AndroidMediaMetadataRetriever{}
qt.ItfMap["multimedia.AndroidMediaPlayer_ITF"] = AndroidMediaPlayer{}
qt.ItfMap["multimedia.AndroidMediaRecorder_ITF"] = AndroidMediaRecorder{}
qt.ItfMap["multimedia.AndroidMultimediaUtils_ITF"] = AndroidMultimediaUtils{}
qt.ItfMap["multimedia.AndroidSurfaceHolder_ITF"] = AndroidSurfaceHolder{}
qt.ItfMap["multimedia.AndroidSurfaceTexture_ITF"] = AndroidSurfaceTexture{}
qt.ItfMap["multimedia.AndroidSurfaceView_ITF"] = AndroidSurfaceView{}
qt.ItfMap["multimedia.AsyncCallback_ITF"] = AsyncCallback{}
qt.ItfMap["multimedia.AudioCaptureProbeControl_ITF"] = AudioCaptureProbeControl{}
qt.ItfMap["multimedia.AudioCaptureService_ITF"] = AudioCaptureService{}
qt.ItfMap["multimedia.AudioCaptureServicePlugin_ITF"] = AudioCaptureServicePlugin{}
qt.ItfMap["multimedia.AudioCaptureSession_ITF"] = AudioCaptureSession{}
qt.ItfMap["multimedia.AudioContainerControl_ITF"] = AudioContainerControl{}
qt.ItfMap["multimedia.AudioEncoderControl_ITF"] = AudioEncoderControl{}
qt.ItfMap["multimedia.AudioInputSelector_ITF"] = AudioInputSelector{}
qt.ItfMap["multimedia.AudioInterface_ITF"] = AudioInterface{}
qt.ItfMap["multimedia.AudioMediaRecorderControl_ITF"] = AudioMediaRecorderControl{}
qt.ItfMap["multimedia.AudioSampleGrabberCallback_ITF"] = AudioSampleGrabberCallback{}
qt.ItfMap["multimedia.BbCameraAudioEncoderSettingsControl_ITF"] = BbCameraAudioEncoderSettingsControl{}
qt.ItfMap["multimedia.BbCameraCaptureBufferFormatControl_ITF"] = BbCameraCaptureBufferFormatControl{}
qt.ItfMap["multimedia.BbCameraCaptureDestinationControl_ITF"] = BbCameraCaptureDestinationControl{}
qt.ItfMap["multimedia.BbCameraControl_ITF"] = BbCameraControl{}
qt.ItfMap["multimedia.BbCameraExposureControl_ITF"] = BbCameraExposureControl{}
qt.ItfMap["multimedia.BbCameraFlashControl_ITF"] = BbCameraFlashControl{}
qt.ItfMap["multimedia.BbCameraFocusControl_ITF"] = BbCameraFocusControl{}
qt.ItfMap["multimedia.BbCameraImageCaptureControl_ITF"] = BbCameraImageCaptureControl{}
qt.ItfMap["multimedia.BbCameraImageProcessingControl_ITF"] = BbCameraImageProcessingControl{}
qt.ItfMap["multimedia.BbCameraInfoControl_ITF"] = BbCameraInfoControl{}
qt.ItfMap["multimedia.BbCameraLocksControl_ITF"] = BbCameraLocksControl{}
qt.ItfMap["multimedia.BbCameraMediaRecorderControl_ITF"] = BbCameraMediaRecorderControl{}
qt.ItfMap["multimedia.BbCameraOrientationHandler_ITF"] = BbCameraOrientationHandler{}
qt.ItfMap["multimedia.BbCameraService_ITF"] = BbCameraService{}
qt.ItfMap["multimedia.BbCameraSession_ITF"] = BbCameraSession{}
qt.ItfMap["multimedia.BbCameraVideoEncoderSettingsControl_ITF"] = BbCameraVideoEncoderSettingsControl{}
qt.ItfMap["multimedia.BbCameraViewfinderSettingsControl_ITF"] = BbCameraViewfinderSettingsControl{}
qt.ItfMap["multimedia.BbCameraZoomControl_ITF"] = BbCameraZoomControl{}
qt.ItfMap["multimedia.BbImageEncoderControl_ITF"] = BbImageEncoderControl{}
qt.ItfMap["multimedia.BbMediaStorageLocation_ITF"] = BbMediaStorageLocation{}
qt.ItfMap["multimedia.BbVideoDeviceSelectorControl_ITF"] = BbVideoDeviceSelectorControl{}
qt.ItfMap["multimedia.BbVideoRendererControl_ITF"] = BbVideoRendererControl{}
qt.ItfMap["multimedia.CameraBinAudioEncoder_ITF"] = CameraBinAudioEncoder{}
qt.ItfMap["multimedia.CameraBinCaptureBufferFormat_ITF"] = CameraBinCaptureBufferFormat{}
qt.ItfMap["multimedia.CameraBinCaptureDestination_ITF"] = CameraBinCaptureDestination{}
qt.ItfMap["multimedia.CameraBinContainer_ITF"] = CameraBinContainer{}
qt.ItfMap["multimedia.CameraBinControl_ITF"] = CameraBinControl{}
qt.ItfMap["multimedia.CameraBinExposure_ITF"] = CameraBinExposure{}
qt.ItfMap["multimedia.CameraBinFlash_ITF"] = CameraBinFlash{}
qt.ItfMap["multimedia.CameraBinFocus_ITF"] = CameraBinFocus{}
qt.ItfMap["multimedia.CameraBinImageCapture_ITF"] = CameraBinImageCapture{}
qt.ItfMap["multimedia.CameraBinImageEncoder_ITF"] = CameraBinImageEncoder{}
qt.ItfMap["multimedia.CameraBinImageProcessing_ITF"] = CameraBinImageProcessing{}
qt.ItfMap["multimedia.CameraBinInfoControl_ITF"] = CameraBinInfoControl{}
qt.ItfMap["multimedia.CameraBinLocks_ITF"] = CameraBinLocks{}
qt.ItfMap["multimedia.CameraBinMetaData_ITF"] = CameraBinMetaData{}
qt.ItfMap["multimedia.CameraBinRecorder_ITF"] = CameraBinRecorder{}
qt.ItfMap["multimedia.CameraBinService_ITF"] = CameraBinService{}
qt.ItfMap["multimedia.CameraBinServicePlugin_ITF"] = CameraBinServicePlugin{}
qt.ItfMap["multimedia.CameraBinSession_ITF"] = CameraBinSession{}
qt.ItfMap["multimedia.CameraBinV4LImageProcessing_ITF"] = CameraBinV4LImageProcessing{}
qt.ItfMap["multimedia.CameraBinVideoEncoder_ITF"] = CameraBinVideoEncoder{}
qt.ItfMap["multimedia.CameraBinViewfinderSettings_ITF"] = CameraBinViewfinderSettings{}
qt.ItfMap["multimedia.CameraBinViewfinderSettings2_ITF"] = CameraBinViewfinderSettings2{}
qt.ItfMap["multimedia.CameraBinZoom_ITF"] = CameraBinZoom{}
qt.ItfMap["multimedia.CamerabinResourcePolicy_ITF"] = CamerabinResourcePolicy{}
qt.ItfMap["multimedia.CoreAudioBufferList_ITF"] = CoreAudioBufferList{}
qt.ItfMap["multimedia.CoreAudioDeviceInfo_ITF"] = CoreAudioDeviceInfo{}
qt.ItfMap["multimedia.CoreAudioInput_ITF"] = CoreAudioInput{}
qt.ItfMap["multimedia.CoreAudioInputBuffer_ITF"] = CoreAudioInputBuffer{}
qt.ItfMap["multimedia.CoreAudioInputDevice_ITF"] = CoreAudioInputDevice{}
qt.ItfMap["multimedia.CoreAudioOutput_ITF"] = CoreAudioOutput{}
qt.ItfMap["multimedia.CoreAudioOutputBuffer_ITF"] = CoreAudioOutputBuffer{}
qt.ItfMap["multimedia.CoreAudioOutputDevice_ITF"] = CoreAudioOutputDevice{}
qt.ItfMap["multimedia.CoreAudioPacketFeeder_ITF"] = CoreAudioPacketFeeder{}
qt.ItfMap["multimedia.CoreAudioPlugin_ITF"] = CoreAudioPlugin{}
qt.ItfMap["multimedia.CoreAudioRingBuffer_ITF"] = CoreAudioRingBuffer{}
qt.ItfMap["multimedia.CoreAudioSessionManager_ITF"] = CoreAudioSessionManager{}
qt.ItfMap["multimedia.CoreAudioUtils_ITF"] = CoreAudioUtils{}
qt.ItfMap["multimedia.D3DPresentEngine_ITF"] = D3DPresentEngine{}
qt.ItfMap["multimedia.DSCameraControl_ITF"] = DSCameraControl{}
qt.ItfMap["multimedia.DSCameraImageProcessingControl_ITF"] = DSCameraImageProcessingControl{}
qt.ItfMap["multimedia.DSCameraService_ITF"] = DSCameraService{}
qt.ItfMap["multimedia.DSCameraSession_ITF"] = DSCameraSession{}
qt.ItfMap["multimedia.DSCameraViewfinderSettingsControl_ITF"] = DSCameraViewfinderSettingsControl{}
qt.ItfMap["multimedia.DSImageCaptureControl_ITF"] = DSImageCaptureControl{}
qt.ItfMap["multimedia.DSServicePlugin_ITF"] = DSServicePlugin{}
qt.ItfMap["multimedia.DSVideoDeviceControl_ITF"] = DSVideoDeviceControl{}
qt.ItfMap["multimedia.DSVideoRendererControl_ITF"] = DSVideoRendererControl{}
qt.ItfMap["multimedia.DirectShowAudioEndpointControl_ITF"] = DirectShowAudioEndpointControl{}
qt.ItfMap["multimedia.DirectShowAudioProbeControl_ITF"] = DirectShowAudioProbeControl{}
qt.ItfMap["multimedia.DirectShowBaseFilter_ITF"] = DirectShowBaseFilter{}
qt.ItfMap["multimedia.DirectShowCameraCaptureBufferFormatControl_ITF"] = DirectShowCameraCaptureBufferFormatControl{}
qt.ItfMap["multimedia.DirectShowCameraCaptureDestinationControl_ITF"] = DirectShowCameraCaptureDestinationControl{}
qt.ItfMap["multimedia.DirectShowCameraExposureControl_ITF"] = DirectShowCameraExposureControl{}
qt.ItfMap["multimedia.DirectShowCameraImageEncoderControl_ITF"] = DirectShowCameraImageEncoderControl{}
qt.ItfMap["multimedia.DirectShowCameraZoomControl_ITF"] = DirectShowCameraZoomControl{}
qt.ItfMap["multimedia.DirectShowEventLoop_ITF"] = DirectShowEventLoop{}
qt.ItfMap["multimedia.DirectShowEvrVideoWindowControl_ITF"] = DirectShowEvrVideoWindowControl{}
qt.ItfMap["multimedia.DirectShowIOReader_ITF"] = DirectShowIOReader{}
qt.ItfMap["multimedia.DirectShowIOSource_ITF"] = DirectShowIOSource{}
qt.ItfMap["multimedia.DirectShowInputPin_ITF"] = DirectShowInputPin{}
qt.ItfMap["multimedia.DirectShowMediaType_ITF"] = DirectShowMediaType{}
qt.ItfMap["multimedia.DirectShowMediaTypeEnum_ITF"] = DirectShowMediaTypeEnum{}
qt.ItfMap["multimedia.DirectShowMetaDataControl_ITF"] = DirectShowMetaDataControl{}
qt.ItfMap["multimedia.DirectShowOutputPin_ITF"] = DirectShowOutputPin{}
qt.ItfMap["multimedia.DirectShowPin_ITF"] = DirectShowPin{}
qt.ItfMap["multimedia.DirectShowPinEnum_ITF"] = DirectShowPinEnum{}
qt.ItfMap["multimedia.DirectShowPlayerControl_ITF"] = DirectShowPlayerControl{}
qt.ItfMap["multimedia.DirectShowPlayerService_ITF"] = DirectShowPlayerService{}
qt.ItfMap["multimedia.DirectShowSampleGrabber_ITF"] = DirectShowSampleGrabber{}
qt.ItfMap["multimedia.DirectShowVideoBuffer_ITF"] = DirectShowVideoBuffer{}
qt.ItfMap["multimedia.DirectShowVideoProbeControl_ITF"] = DirectShowVideoProbeControl{}
qt.ItfMap["multimedia.DirectShowVideoRendererControl_ITF"] = DirectShowVideoRendererControl{}
qt.ItfMap["multimedia.EVRCustomPresenter_ITF"] = EVRCustomPresenter{}
qt.ItfMap["multimedia.EvrVideoWindowControl_ITF"] = EvrVideoWindowControl{}
qt.ItfMap["multimedia.FileProbeProxy_ITF"] = FileProbeProxy{}
qt.ItfMap["multimedia.MFAbstractActivate_ITF"] = MFAbstractActivate{}
qt.ItfMap["multimedia.MFAudioDecoderControl_ITF"] = MFAudioDecoderControl{}
qt.ItfMap["multimedia.MFAudioDecoderService_ITF"] = MFAudioDecoderService{}
qt.ItfMap["multimedia.MFAudioEndpointControl_ITF"] = MFAudioEndpointControl{}
qt.ItfMap["multimedia.MFAudioProbeControl_ITF"] = MFAudioProbeControl{}
qt.ItfMap["multimedia.MFDecoderSourceReader_ITF"] = MFDecoderSourceReader{}
qt.ItfMap["multimedia.MFEvrVideoWindowControl_ITF"] = MFEvrVideoWindowControl{}
qt.ItfMap["multimedia.MFMetaDataControl_ITF"] = MFMetaDataControl{}
qt.ItfMap["multimedia.MFPlayerControl_ITF"] = MFPlayerControl{}
qt.ItfMap["multimedia.MFPlayerService_ITF"] = MFPlayerService{}
qt.ItfMap["multimedia.MFPlayerSession_ITF"] = MFPlayerSession{}
qt.ItfMap["multimedia.MFStream_ITF"] = MFStream{}
qt.ItfMap["multimedia.MFTransform_ITF"] = MFTransform{}
qt.ItfMap["multimedia.MFVideoProbeControl_ITF"] = MFVideoProbeControl{}
qt.ItfMap["multimedia.MFVideoRendererControl_ITF"] = MFVideoRendererControl{}
qt.ItfMap["multimedia.MmRendererAudioRoleControl_ITF"] = MmRendererAudioRoleControl{}
qt.ItfMap["multimedia.MmRendererCustomAudioRoleControl_ITF"] = MmRendererCustomAudioRoleControl{}
qt.ItfMap["multimedia.MmRendererMediaPlayerControl_ITF"] = MmRendererMediaPlayerControl{}
qt.ItfMap["multimedia.MmRendererMediaPlayerService_ITF"] = MmRendererMediaPlayerService{}
qt.ItfMap["multimedia.MmRendererMetaData_ITF"] = MmRendererMetaData{}
qt.ItfMap["multimedia.MmRendererMetaDataReaderControl_ITF"] = MmRendererMetaDataReaderControl{}
qt.ItfMap["multimedia.MmRendererPlayerVideoRendererControl_ITF"] = MmRendererPlayerVideoRendererControl{}
qt.ItfMap["multimedia.MmRendererVideoWindowControl_ITF"] = MmRendererVideoWindowControl{}
qt.ItfMap["multimedia.MmrEventMediaPlayerControl_ITF"] = MmrEventMediaPlayerControl{}
qt.ItfMap["multimedia.MmrEventThread_ITF"] = MmrEventThread{}
qt.ItfMap["multimedia.NeutrinoServicePlugin_ITF"] = NeutrinoServicePlugin{}
qt.ItfMap["multimedia.OpenGLResourcesDeleter_ITF"] = OpenGLResourcesDeleter{}
qt.ItfMap["multimedia.QAbstractAudioDeviceInfo_ITF"] = QAbstractAudioDeviceInfo{}
qt.ItfMap["multimedia.QAbstractAudioInput_ITF"] = QAbstractAudioInput{}
qt.ItfMap["multimedia.QAbstractAudioOutput_ITF"] = QAbstractAudioOutput{}
@ -59923,6 +60107,45 @@ func init() {
qt.EnumMap["multimedia.QAbstractVideoSurface__IncorrectFormatError"] = int64(QAbstractVideoSurface__IncorrectFormatError)
qt.EnumMap["multimedia.QAbstractVideoSurface__StoppedError"] = int64(QAbstractVideoSurface__StoppedError)
qt.EnumMap["multimedia.QAbstractVideoSurface__ResourceError"] = int64(QAbstractVideoSurface__ResourceError)
qt.ItfMap["multimedia.QAlsaAudioDeviceInfo_ITF"] = QAlsaAudioDeviceInfo{}
qt.ItfMap["multimedia.QAlsaAudioInput_ITF"] = QAlsaAudioInput{}
qt.ItfMap["multimedia.QAlsaAudioOutput_ITF"] = QAlsaAudioOutput{}
qt.ItfMap["multimedia.QAlsaPlugin_ITF"] = QAlsaPlugin{}
qt.ItfMap["multimedia.QAndroidAudioEncoderSettingsControl_ITF"] = QAndroidAudioEncoderSettingsControl{}
qt.ItfMap["multimedia.QAndroidAudioInputSelectorControl_ITF"] = QAndroidAudioInputSelectorControl{}
qt.ItfMap["multimedia.QAndroidAudioRoleControl_ITF"] = QAndroidAudioRoleControl{}
qt.ItfMap["multimedia.QAndroidCameraCaptureBufferFormatControl_ITF"] = QAndroidCameraCaptureBufferFormatControl{}
qt.ItfMap["multimedia.QAndroidCameraCaptureDestinationControl_ITF"] = QAndroidCameraCaptureDestinationControl{}
qt.ItfMap["multimedia.QAndroidCameraControl_ITF"] = QAndroidCameraControl{}
qt.ItfMap["multimedia.QAndroidCameraExposureControl_ITF"] = QAndroidCameraExposureControl{}
qt.ItfMap["multimedia.QAndroidCameraFlashControl_ITF"] = QAndroidCameraFlashControl{}
qt.ItfMap["multimedia.QAndroidCameraFocusControl_ITF"] = QAndroidCameraFocusControl{}
qt.ItfMap["multimedia.QAndroidCameraImageCaptureControl_ITF"] = QAndroidCameraImageCaptureControl{}
qt.ItfMap["multimedia.QAndroidCameraImageProcessingControl_ITF"] = QAndroidCameraImageProcessingControl{}
qt.ItfMap["multimedia.QAndroidCameraInfoControl_ITF"] = QAndroidCameraInfoControl{}
qt.ItfMap["multimedia.QAndroidCameraLocksControl_ITF"] = QAndroidCameraLocksControl{}
qt.ItfMap["multimedia.QAndroidCameraSession_ITF"] = QAndroidCameraSession{}
qt.ItfMap["multimedia.QAndroidCameraVideoRendererControl_ITF"] = QAndroidCameraVideoRendererControl{}
qt.ItfMap["multimedia.QAndroidCameraZoomControl_ITF"] = QAndroidCameraZoomControl{}
qt.ItfMap["multimedia.QAndroidCaptureService_ITF"] = QAndroidCaptureService{}
qt.ItfMap["multimedia.QAndroidCaptureSession_ITF"] = QAndroidCaptureSession{}
qt.ItfMap["multimedia.QAndroidCustomAudioRoleControl_ITF"] = QAndroidCustomAudioRoleControl{}
qt.ItfMap["multimedia.QAndroidImageEncoderControl_ITF"] = QAndroidImageEncoderControl{}
qt.ItfMap["multimedia.QAndroidMediaContainerControl_ITF"] = QAndroidMediaContainerControl{}
qt.ItfMap["multimedia.QAndroidMediaPlayerControl_ITF"] = QAndroidMediaPlayerControl{}
qt.ItfMap["multimedia.QAndroidMediaPlayerVideoRendererControl_ITF"] = QAndroidMediaPlayerVideoRendererControl{}
qt.ItfMap["multimedia.QAndroidMediaRecorderControl_ITF"] = QAndroidMediaRecorderControl{}
qt.ItfMap["multimedia.QAndroidMediaService_ITF"] = QAndroidMediaService{}
qt.ItfMap["multimedia.QAndroidMediaServicePlugin_ITF"] = QAndroidMediaServicePlugin{}
qt.ItfMap["multimedia.QAndroidMediaVideoProbeControl_ITF"] = QAndroidMediaVideoProbeControl{}
qt.ItfMap["multimedia.QAndroidMetaDataReaderControl_ITF"] = QAndroidMetaDataReaderControl{}
qt.ItfMap["multimedia.QAndroidSGVideoNode_ITF"] = QAndroidSGVideoNode{}
qt.ItfMap["multimedia.QAndroidSGVideoNodeFactoryPlugin_ITF"] = QAndroidSGVideoNodeFactoryPlugin{}
qt.ItfMap["multimedia.QAndroidTextureVideoOutput_ITF"] = QAndroidTextureVideoOutput{}
qt.ItfMap["multimedia.QAndroidVideoDeviceSelectorControl_ITF"] = QAndroidVideoDeviceSelectorControl{}
qt.ItfMap["multimedia.QAndroidVideoEncoderSettingsControl_ITF"] = QAndroidVideoEncoderSettingsControl{}
qt.ItfMap["multimedia.QAndroidVideoOutput_ITF"] = QAndroidVideoOutput{}
qt.ItfMap["multimedia.QAndroidViewfinderSettingsControl2_ITF"] = QAndroidViewfinderSettingsControl2{}
qt.ItfMap["multimedia.QAudio_ITF"] = QAudio{}
qt.FuncMap["multimedia.QAudio_ConvertVolume"] = QAudio_ConvertVolume
qt.EnumMap["multimedia.QAudio__NoError"] = int64(QAudio__NoError)
@ -60215,11 +60438,35 @@ func init() {
qt.FuncMap["multimedia.NewQCameraZoomControl"] = NewQCameraZoomControl
qt.ItfMap["multimedia.QCustomAudioRoleControl_ITF"] = QCustomAudioRoleControl{}
qt.FuncMap["multimedia.NewQCustomAudioRoleControl"] = NewQCustomAudioRoleControl
qt.ItfMap["multimedia.QGStreamerAvailabilityControl_ITF"] = QGStreamerAvailabilityControl{}
qt.ItfMap["multimedia.QGstreamerAudioDecoderControl_ITF"] = QGstreamerAudioDecoderControl{}
qt.ItfMap["multimedia.QGstreamerAudioDecoderService_ITF"] = QGstreamerAudioDecoderService{}
qt.ItfMap["multimedia.QGstreamerAudioDecoderServicePlugin_ITF"] = QGstreamerAudioDecoderServicePlugin{}
qt.ItfMap["multimedia.QGstreamerAudioDecoderSession_ITF"] = QGstreamerAudioDecoderSession{}
qt.ItfMap["multimedia.QGstreamerAudioEncode_ITF"] = QGstreamerAudioEncode{}
qt.ItfMap["multimedia.QGstreamerCameraControl_ITF"] = QGstreamerCameraControl{}
qt.ItfMap["multimedia.QGstreamerCaptureMetaDataControl_ITF"] = QGstreamerCaptureMetaDataControl{}
qt.ItfMap["multimedia.QGstreamerCaptureService_ITF"] = QGstreamerCaptureService{}
qt.ItfMap["multimedia.QGstreamerCaptureServicePlugin_ITF"] = QGstreamerCaptureServicePlugin{}
qt.ItfMap["multimedia.QGstreamerCaptureSession_ITF"] = QGstreamerCaptureSession{}
qt.ItfMap["multimedia.QGstreamerElementFactory_ITF"] = QGstreamerElementFactory{}
qt.ItfMap["multimedia.QGstreamerImageCaptureControl_ITF"] = QGstreamerImageCaptureControl{}
qt.ItfMap["multimedia.QGstreamerImageEncode_ITF"] = QGstreamerImageEncode{}
qt.ItfMap["multimedia.QGstreamerMediaContainerControl_ITF"] = QGstreamerMediaContainerControl{}
qt.ItfMap["multimedia.QGstreamerMetaDataProvider_ITF"] = QGstreamerMetaDataProvider{}
qt.ItfMap["multimedia.QGstreamerPlayerService_ITF"] = QGstreamerPlayerService{}
qt.ItfMap["multimedia.QGstreamerPlayerServicePlugin_ITF"] = QGstreamerPlayerServicePlugin{}
qt.ItfMap["multimedia.QGstreamerRecorderControl_ITF"] = QGstreamerRecorderControl{}
qt.ItfMap["multimedia.QGstreamerStreamsControl_ITF"] = QGstreamerStreamsControl{}
qt.ItfMap["multimedia.QGstreamerV4L2Input_ITF"] = QGstreamerV4L2Input{}
qt.ItfMap["multimedia.QGstreamerVideoEncode_ITF"] = QGstreamerVideoEncode{}
qt.ItfMap["multimedia.QGstreamerVideoInput_ITF"] = QGstreamerVideoInput{}
qt.ItfMap["multimedia.QImageEncoderControl_ITF"] = QImageEncoderControl{}
qt.FuncMap["multimedia.NewQImageEncoderControl"] = NewQImageEncoderControl
qt.ItfMap["multimedia.QImageEncoderSettings_ITF"] = QImageEncoderSettings{}
qt.FuncMap["multimedia.NewQImageEncoderSettings"] = NewQImageEncoderSettings
qt.FuncMap["multimedia.NewQImageEncoderSettings2"] = NewQImageEncoderSettings2
qt.ItfMap["multimedia.QM3uPlaylistPlugin_ITF"] = QM3uPlaylistPlugin{}
qt.ItfMap["multimedia.QMediaAudioProbeControl_ITF"] = QMediaAudioProbeControl{}
qt.FuncMap["multimedia.NewQMediaAudioProbeControl"] = NewQMediaAudioProbeControl
qt.ItfMap["multimedia.QMediaAvailabilityControl_ITF"] = QMediaAvailabilityControl{}
@ -60352,6 +60599,16 @@ func init() {
qt.EnumMap["multimedia.QMultimedia__NormalQuality"] = int64(QMultimedia__NormalQuality)
qt.EnumMap["multimedia.QMultimedia__HighQuality"] = int64(QMultimedia__HighQuality)
qt.EnumMap["multimedia.QMultimedia__VeryHighQuality"] = int64(QMultimedia__VeryHighQuality)
qt.ItfMap["multimedia.QOpenSLESAudioInput_ITF"] = QOpenSLESAudioInput{}
qt.ItfMap["multimedia.QOpenSLESAudioOutput_ITF"] = QOpenSLESAudioOutput{}
qt.ItfMap["multimedia.QOpenSLESDeviceInfo_ITF"] = QOpenSLESDeviceInfo{}
qt.ItfMap["multimedia.QOpenSLESEngine_ITF"] = QOpenSLESEngine{}
qt.ItfMap["multimedia.QOpenSLESPlugin_ITF"] = QOpenSLESPlugin{}
qt.ItfMap["multimedia.QPulseAudioDeviceInfo_ITF"] = QPulseAudioDeviceInfo{}
qt.ItfMap["multimedia.QPulseAudioEngine_ITF"] = QPulseAudioEngine{}
qt.ItfMap["multimedia.QPulseAudioInput_ITF"] = QPulseAudioInput{}
qt.ItfMap["multimedia.QPulseAudioOutput_ITF"] = QPulseAudioOutput{}
qt.ItfMap["multimedia.QPulseAudioPlugin_ITF"] = QPulseAudioPlugin{}
qt.ItfMap["multimedia.QRadioData_ITF"] = QRadioData{}
qt.FuncMap["multimedia.NewQRadioData"] = NewQRadioData
qt.EnumMap["multimedia.QRadioData__NoError"] = int64(QRadioData__NoError)
@ -60427,6 +60684,13 @@ func init() {
qt.EnumMap["multimedia.QRadioTuner__ActiveState"] = int64(QRadioTuner__ActiveState)
qt.EnumMap["multimedia.QRadioTuner__StoppedState"] = int64(QRadioTuner__StoppedState)
qt.ItfMap["multimedia.QRadioTunerControl_ITF"] = QRadioTunerControl{}
qt.ItfMap["multimedia.QSGVideoMaterial_EGL_ITF"] = QSGVideoMaterial_EGL{}
qt.ItfMap["multimedia.QSGVideoNodeFactory_EGL_ITF"] = QSGVideoNodeFactory_EGL{}
qt.ItfMap["multimedia.QSGVideoNode_EGL_ITF"] = QSGVideoNode_EGL{}
qt.ItfMap["multimedia.QSGVivanteVideoMaterial_ITF"] = QSGVivanteVideoMaterial{}
qt.ItfMap["multimedia.QSGVivanteVideoMaterialShader_ITF"] = QSGVivanteVideoMaterialShader{}
qt.ItfMap["multimedia.QSGVivanteVideoNode_ITF"] = QSGVivanteVideoNode{}
qt.ItfMap["multimedia.QSGVivanteVideoNodeFactory_ITF"] = QSGVivanteVideoNodeFactory{}
qt.ItfMap["multimedia.QSound_ITF"] = QSound{}
qt.FuncMap["multimedia.NewQSound"] = NewQSound
qt.FuncMap["multimedia.QSound_Play"] = QSound_Play
@ -60517,4 +60781,50 @@ func init() {
qt.ItfMap["multimedia.QVideoWidgetControl_ITF"] = QVideoWidgetControl{}
qt.ItfMap["multimedia.QVideoWindowControl_ITF"] = QVideoWindowControl{}
qt.FuncMap["multimedia.NewQVideoWindowControl"] = NewQVideoWindowControl
qt.ItfMap["multimedia.QWasapiAudioDeviceInfo_ITF"] = QWasapiAudioDeviceInfo{}
qt.ItfMap["multimedia.QWasapiAudioInput_ITF"] = QWasapiAudioInput{}
qt.ItfMap["multimedia.QWasapiAudioOutput_ITF"] = QWasapiAudioOutput{}
qt.ItfMap["multimedia.QWasapiPlugin_ITF"] = QWasapiPlugin{}
qt.ItfMap["multimedia.QWasapiProcessThread_ITF"] = QWasapiProcessThread{}
qt.ItfMap["multimedia.QWinRTAbstractVideoRendererControl_ITF"] = QWinRTAbstractVideoRendererControl{}
qt.ItfMap["multimedia.QWinRTCameraControl_ITF"] = QWinRTCameraControl{}
qt.ItfMap["multimedia.QWinRTCameraFlashControl_ITF"] = QWinRTCameraFlashControl{}
qt.ItfMap["multimedia.QWinRTCameraFocusControl_ITF"] = QWinRTCameraFocusControl{}
qt.ItfMap["multimedia.QWinRTCameraImageCaptureControl_ITF"] = QWinRTCameraImageCaptureControl{}
qt.ItfMap["multimedia.QWinRTCameraInfoControl_ITF"] = QWinRTCameraInfoControl{}
qt.ItfMap["multimedia.QWinRTCameraLocksControl_ITF"] = QWinRTCameraLocksControl{}
qt.ItfMap["multimedia.QWinRTCameraService_ITF"] = QWinRTCameraService{}
qt.ItfMap["multimedia.QWinRTCameraVideoRendererControl_ITF"] = QWinRTCameraVideoRendererControl{}
qt.ItfMap["multimedia.QWinRTImageEncoderControl_ITF"] = QWinRTImageEncoderControl{}
qt.ItfMap["multimedia.QWinRTMediaPlayerControl_ITF"] = QWinRTMediaPlayerControl{}
qt.ItfMap["multimedia.QWinRTMediaPlayerService_ITF"] = QWinRTMediaPlayerService{}
qt.ItfMap["multimedia.QWinRTPlayerRendererControl_ITF"] = QWinRTPlayerRendererControl{}
qt.ItfMap["multimedia.QWinRTServicePlugin_ITF"] = QWinRTServicePlugin{}
qt.ItfMap["multimedia.QWinRTVideoDeviceSelectorControl_ITF"] = QWinRTVideoDeviceSelectorControl{}
qt.ItfMap["multimedia.QWinRTVideoProbeControl_ITF"] = QWinRTVideoProbeControl{}
qt.ItfMap["multimedia.QWindowsAudioDeviceInfo_ITF"] = QWindowsAudioDeviceInfo{}
qt.ItfMap["multimedia.QWindowsAudioInput_ITF"] = QWindowsAudioInput{}
qt.ItfMap["multimedia.QWindowsAudioOutput_ITF"] = QWindowsAudioOutput{}
qt.ItfMap["multimedia.QWindowsAudioPlugin_ITF"] = QWindowsAudioPlugin{}
qt.ItfMap["multimedia.QnxAudioDeviceInfo_ITF"] = QnxAudioDeviceInfo{}
qt.ItfMap["multimedia.QnxAudioInput_ITF"] = QnxAudioInput{}
qt.ItfMap["multimedia.QnxAudioOutput_ITF"] = QnxAudioOutput{}
qt.ItfMap["multimedia.QnxAudioPlugin_ITF"] = QnxAudioPlugin{}
qt.ItfMap["multimedia.QnxPushIODevice_ITF"] = QnxPushIODevice{}
qt.ItfMap["multimedia.ResourcePolicyImpl_ITF"] = ResourcePolicyImpl{}
qt.ItfMap["multimedia.ResourcePolicyInt_ITF"] = ResourcePolicyInt{}
qt.ItfMap["multimedia.ResourcePolicyPlugin_ITF"] = ResourcePolicyPlugin{}
qt.ItfMap["multimedia.RingBuffer_ITF"] = RingBuffer{}
qt.ItfMap["multimedia.SampleGrabberCallback_ITF"] = SampleGrabberCallback{}
qt.ItfMap["multimedia.SamplePool_ITF"] = SamplePool{}
qt.ItfMap["multimedia.Scheduler_ITF"] = Scheduler{}
qt.ItfMap["multimedia.SourceResolver_ITF"] = SourceResolver{}
qt.ItfMap["multimedia.V4LRadioControl_ITF"] = V4LRadioControl{}
qt.ItfMap["multimedia.V4LRadioService_ITF"] = V4LRadioService{}
qt.ItfMap["multimedia.V4LServicePlugin_ITF"] = V4LServicePlugin{}
qt.ItfMap["multimedia.VideoSurfaceFilter_ITF"] = VideoSurfaceFilter{}
qt.ItfMap["multimedia.Vmr9VideoWindowControl_ITF"] = Vmr9VideoWindowControl{}
qt.ItfMap["multimedia.WMFServicePlugin_ITF"] = WMFServicePlugin{}
qt.ItfMap["multimedia.WindowGrabber_ITF"] = WindowGrabber{}
qt.ItfMap["multimedia.WindowGrabberImage_ITF"] = WindowGrabberImage{}
}

View file

@ -27,7 +27,7 @@ func cGoUnpackBytes(s C.struct_QtNetwork_PackedString) []byte {
defer cGoFreePacked(s.ptr)
if int(s.len) == -1 {
gs := C.GoString(s.data)
return *(*[]byte)(unsafe.Pointer(&gs))
return []byte(gs)
}
return C.GoBytes(unsafe.Pointer(s.data), C.int(s.len))
}
@ -20554,6 +20554,7 @@ func init() {
qt.ItfMap["network.QDnsTextRecord_ITF"] = QDnsTextRecord{}
qt.FuncMap["network.NewQDnsTextRecord"] = NewQDnsTextRecord
qt.FuncMap["network.NewQDnsTextRecord2"] = NewQDnsTextRecord2
qt.ItfMap["network.QDtls_ITF"] = QDtls{}
qt.EnumMap["network.QDtls__NoError"] = int64(QDtls__NoError)
qt.EnumMap["network.QDtls__InvalidInputParameters"] = int64(QDtls__InvalidInputParameters)
qt.EnumMap["network.QDtls__InvalidOperation"] = int64(QDtls__InvalidOperation)
@ -20567,6 +20568,7 @@ func init() {
qt.EnumMap["network.QDtls__HandshakeInProgress"] = int64(QDtls__HandshakeInProgress)
qt.EnumMap["network.QDtls__PeerVerificationFailed"] = int64(QDtls__PeerVerificationFailed)
qt.EnumMap["network.QDtls__HandshakeComplete"] = int64(QDtls__HandshakeComplete)
qt.ItfMap["network.QDtlsClientVerifier_ITF"] = QDtlsClientVerifier{}
qt.ItfMap["network.QHostAddress_ITF"] = QHostAddress{}
qt.FuncMap["network.NewQHostAddress"] = NewQHostAddress
qt.FuncMap["network.NewQHostAddress2"] = NewQHostAddress2
@ -20907,6 +20909,9 @@ func init() {
qt.EnumMap["network.QOcspResponse__CessationOfOperation"] = int64(QOcspResponse__CessationOfOperation)
qt.EnumMap["network.QOcspResponse__CertificateHold"] = int64(QOcspResponse__CertificateHold)
qt.EnumMap["network.QOcspResponse__RemoveFromCRL"] = int64(QOcspResponse__RemoveFromCRL)
qt.ItfMap["network.QPasswordDigestor_ITF"] = QPasswordDigestor{}
qt.ItfMap["network.QSctpServer_ITF"] = QSctpServer{}
qt.ItfMap["network.QSctpSocket_ITF"] = QSctpSocket{}
qt.ItfMap["network.QSsl_ITF"] = QSsl{}
qt.EnumMap["network.QSsl__PrivateKey"] = int64(QSsl__PrivateKey)
qt.EnumMap["network.QSsl__PublicKey"] = int64(QSsl__PublicKey)

View file

@ -26,7 +26,7 @@ func cGoUnpackBytes(s C.struct_QtNfc_PackedString) []byte {
defer cGoFreePacked(s.ptr)
if int(s.len) == -1 {
gs := C.GoString(s.data)
return *(*[]byte)(unsafe.Pointer(&gs))
return []byte(gs)
}
return C.GoBytes(unsafe.Pointer(s.data), C.int(s.len))
}

View file

@ -26,7 +26,7 @@ func cGoUnpackBytes(s C.struct_QtPositioning_PackedString) []byte {
defer cGoFreePacked(s.ptr)
if int(s.len) == -1 {
gs := C.GoString(s.data)
return *(*[]byte)(unsafe.Pointer(&gs))
return []byte(gs)
}
return C.GoBytes(unsafe.Pointer(s.data), C.int(s.len))
}
@ -5852,6 +5852,7 @@ func callbackQNmeaPositionInfoSource_Error2(ptr unsafe.Pointer, positioningError
}
func init() {
qt.ItfMap["positioning.LocationSingleton_ITF"] = LocationSingleton{}
qt.ItfMap["positioning.QGeoAddress_ITF"] = QGeoAddress{}
qt.FuncMap["positioning.NewQGeoAddress"] = NewQGeoAddress
qt.FuncMap["positioning.NewQGeoAddress2"] = NewQGeoAddress2
@ -5888,6 +5889,7 @@ func init() {
qt.EnumMap["positioning.QGeoCoordinate__DegreesMinutesWithHemisphere"] = int64(QGeoCoordinate__DegreesMinutesWithHemisphere)
qt.EnumMap["positioning.QGeoCoordinate__DegreesMinutesSeconds"] = int64(QGeoCoordinate__DegreesMinutesSeconds)
qt.EnumMap["positioning.QGeoCoordinate__DegreesMinutesSecondsWithHemisphere"] = int64(QGeoCoordinate__DegreesMinutesSecondsWithHemisphere)
qt.ItfMap["positioning.QGeoLocation_ITF"] = QGeoLocation{}
qt.ItfMap["positioning.QGeoPath_ITF"] = QGeoPath{}
qt.FuncMap["positioning.NewQGeoPath"] = NewQGeoPath
qt.FuncMap["positioning.NewQGeoPath2"] = NewQGeoPath2

View file

@ -28,7 +28,7 @@ func cGoUnpackBytes(s C.struct_QtPrintSupport_PackedString) []byte {
defer cGoFreePacked(s.ptr)
if int(s.len) == -1 {
gs := C.GoString(s.data)
return *(*[]byte)(unsafe.Pointer(&gs))
return []byte(gs)
}
return C.GoBytes(unsafe.Pointer(s.data), C.int(s.len))
}
@ -8438,6 +8438,8 @@ func init() {
qt.ItfMap["printsupport.QPageSetupDialog_ITF"] = QPageSetupDialog{}
qt.FuncMap["printsupport.NewQPageSetupDialog"] = NewQPageSetupDialog
qt.FuncMap["printsupport.NewQPageSetupDialog2"] = NewQPageSetupDialog2
qt.ItfMap["printsupport.QPlatformPrintDevice_ITF"] = QPlatformPrintDevice{}
qt.ItfMap["printsupport.QPlatformPrinterSupportPlugin_ITF"] = QPlatformPrinterSupportPlugin{}
qt.ItfMap["printsupport.QPrintDialog_ITF"] = QPrintDialog{}
qt.FuncMap["printsupport.NewQPrintDialog"] = NewQPrintDialog
qt.ItfMap["printsupport.QPrintEngine_ITF"] = QPrintEngine{}

View file

@ -26,7 +26,7 @@ func cGoUnpackBytes(s C.struct_QtPurchasing_PackedString) []byte {
defer cGoFreePacked(s.ptr)
if int(s.len) == -1 {
gs := C.GoString(s.data)
return *(*[]byte)(unsafe.Pointer(&gs))
return []byte(gs)
}
return C.GoBytes(unsafe.Pointer(s.data), C.int(s.len))
}

View file

@ -29,7 +29,7 @@ func cGoUnpackBytes(s C.struct_QtQml_PackedString) []byte {
defer cGoFreePacked(s.ptr)
if int(s.len) == -1 {
gs := C.GoString(s.data)
return *(*[]byte)(unsafe.Pointer(&gs))
return []byte(gs)
}
return C.GoBytes(unsafe.Pointer(s.data), C.int(s.len))
}
@ -7638,6 +7638,7 @@ func init() {
qt.EnumMap["qml.QQmlIncubator__Loading"] = int64(QQmlIncubator__Loading)
qt.EnumMap["qml.QQmlIncubator__Error"] = int64(QQmlIncubator__Error)
qt.ItfMap["qml.QQmlInfo_ITF"] = QQmlInfo{}
qt.ItfMap["qml.QQmlListProperty_ITF"] = QQmlListProperty{}
qt.ItfMap["qml.QQmlListReference_ITF"] = QQmlListReference{}
qt.FuncMap["qml.NewQQmlListReference"] = NewQQmlListReference
qt.FuncMap["qml.NewQQmlListReference2"] = NewQQmlListReference2

View file

@ -25,7 +25,7 @@ type ptr_itf interface {
func Z_initEngine(engine QJSEngine_ITF) {
ptr := engine.QJSEngine_PTR()
ptr.ConnectDestroyed(func(ptr *core.QObject) {
ptr.QObject.ConnectDestroyed(func(ptr *core.QObject) {
finalizerMapMutex.Lock()
pointers := finalizerMap[ptr.Pointer()]
delete(finalizerMap, ptr.Pointer())
@ -129,7 +129,8 @@ func Z_initEngine(engine QJSEngine_ITF) {
func Z_wrapperFunction(jsvals *QJSValue) *QJSValue {
var m reflect.Value
if cn, fn := jsvals.Property2(2).ToString(), jsvals.Property2(3).ToString(); fn == "" {
cn, fn := jsvals.Property2(2).ToString(), jsvals.Property2(3).ToString()
if fn == "" {
v, _ := qt.GetFuncMap(cn)
m = reflect.ValueOf(v)
@ -151,34 +152,78 @@ func Z_wrapperFunction(jsvals *QJSValue) *QJSValue {
m = o.MethodByName(fn)
}
//
engine := QJSEngine_qjsEngine(core.NewQObjectFromPointer(unsafe.Pointer(uintptr(jsvals.Property2(0).ToVariant().ToULongLong(nil)))))
input := make([]reflect.Value, m.Type().NumIn())
for i := 0; i < len(input); i++ {
input[i] = engine.fromJsToRef(m.Type().In(i), jsvals.Property2(uint(4+i)))
}
if fn == "NewGoType" || (fn == "NewQVariant1" && cn == "core.QVariant") {
//
input := make([]interface{}, jsvals.Property("length").ToInt()-4)
for i := 0; i < len(input); i++ {
ret := m.Call(input)
if len(ret) == 0 {
return NewQJSValue(QJSValue__UndefinedValue)
}
in := jsvals.Property2(uint(4 + i))
rret := engine.NewGoType(ret[0].Interface())
if reflect.TypeOf(ret[0].Interface()).Implements(reflect.TypeOf((*core.QObject_ITF)(nil)).Elem()) { //TODO: check for destroyed signal instead, or simply override the destructor instead ?
if qt.ExistsSignal(ret[0].Interface().(ptr_itf).Pointer(), "destroyed") {
engine.GlobalObject().Property("___connectDestroyed").Call([]*QJSValue{rret}) //TODO: connect destroyed/destructor from go instead ?
switch in.ToVariant().Type() {
case core.QVariant__List:
var o []interface{}
engine.ToGoType(in, &o)
input[i] = o
case core.QVariant__Map:
var o map[string]interface{}
engine.ToGoType(in, &o)
input[i] = o
default:
input[i] = in.ToVariant().ToInterface()
}
}
}
return rret
if fn == "NewQVariant1" {
return engine.NewGoType(core.NewQVariant1(input[0]))
}
if cn != "qml.QJSEngine" {
refInput := make([]reflect.Value, len(input))
for i, v := range input {
if jsv := jsvals.Property2(uint(4 + i)); jsv.IsCallable() {
refInput[i] = reflect.ValueOf(func(i interface{}) interface{} { //TODO: remote needs to provide infos about the expected arguments (needed for the callbacks for Qml created in the remote)
return jsv.Call([]*QJSValue{engine.NewGoType(i)}).ToVariant().ToInterface()
})
} else {
refInput[i] = reflect.ValueOf(v)
}
}
return engine.NewGoType(m.Call(refInput)[0].Interface())
}
return engine.NewGoType(engine.NewGoType(input...))
} else {
input := make([]reflect.Value, m.Type().NumIn())
for i := 0; i < len(input); i++ {
input[i] = engine.fromJsToRef(m.Type().In(i), jsvals.Property2(uint(4+i)))
}
ret := m.Call(input)
if len(ret) == 0 {
return NewQJSValue(QJSValue__UndefinedValue)
}
rret := engine.NewGoType(ret[0].Interface())
if reflect.TypeOf(ret[0].Interface()).Implements(reflect.TypeOf((*core.QObject_ITF)(nil)).Elem()) { //TODO: check for destroyed signal instead, or simply override the destructor instead ?
if qt.ExistsSignal(ret[0].Interface().(ptr_itf).Pointer(), "destroyed") {
engine.GlobalObject().Property("___connectDestroyed").Call([]*QJSValue{rret}) //TODO: connect destroyed/destructor from go instead ?
}
}
return rret
}
}
func (ptr *QJSEngine) ToGoType(jsval *QJSValue, dst interface{}) {
reflect.ValueOf(dst).Elem().Set(ptr.fromJsToRef(reflect.TypeOf(dst), jsval).Elem())
out := ptr.fromJsToRef(reflect.TypeOf(dst), jsval)
if out.Type().Kind() == reflect.Ptr {
out = out.Elem()
}
reflect.ValueOf(dst).Elem().Set(out)
}
func (ptr *QJSEngine) fromJsToRef(tofi reflect.Type, jsval *QJSValue) reflect.Value {
@ -517,17 +562,23 @@ func (ptr *QJSEngine) makeFuncWrapper(fn string) *QJSValue {
retV := ptr.GlobalObject().Property("___factory_single_func").Call([]*QJSValue{NewQJSValue8(fn), NewQJSValue8("")})
//only needed for generic binding >>>
retV.SetProperty("callable", ptr.NewGoType(true))
retV.SetProperty("callableLocal", ptr.NewGoType(true))
retV.SetProperty("callableName", ptr.NewGoType(fn))
//<<<
//TODO: allow creation of funcs in arbitrary module depth
var jsv *QJSValue
if m := ptr.GlobalObject().Property(strings.Split(fn, ".")[0]); m.IsUndefined() {
jsv = ptr.NewObject()
ptr.GlobalObject().SetProperty(strings.Split(fn, ".")[0], jsv)
} else {
jsv = m
}
if strings.Count(fn, ".") == 0 {
ptr.GlobalObject().SetProperty(fn, retV)
} else {
var jsv *QJSValue
if m := ptr.GlobalObject().Property(strings.Split(fn, ".")[0]); m.IsUndefined() {
jsv = ptr.NewObject()
ptr.GlobalObject().SetProperty(strings.Split(fn, ".")[0], jsv)
} else {
jsv = m
}
jsv.SetProperty(strings.Split(fn, ".")[1], retV)
}

View file

@ -29,7 +29,7 @@ func cGoUnpackBytes(s C.struct_QtQuick_PackedString) []byte {
defer cGoFreePacked(s.ptr)
if int(s.len) == -1 {
gs := C.GoString(s.data)
return *(*[]byte)(unsafe.Pointer(&gs))
return []byte(gs)
}
return C.GoBytes(unsafe.Pointer(s.data), C.int(s.len))
}
@ -20385,12 +20385,42 @@ func (ptr *ValueLookupJob) DestroyValueLookupJob() {
}
}
func init() {
qt.ItfMap["quick.BacktraceJob_ITF"] = BacktraceJob{}
qt.ItfMap["quick.CollectJob_ITF"] = CollectJob{}
qt.ItfMap["quick.EvalJob_ITF"] = EvalJob{}
qt.ItfMap["quick.ExpressionEvalJob_ITF"] = ExpressionEvalJob{}
qt.ItfMap["quick.FrameJob_ITF"] = FrameJob{}
qt.ItfMap["quick.GatherSourcesJob_ITF"] = GatherSourcesJob{}
qt.ItfMap["quick.JavaScriptJob_ITF"] = JavaScriptJob{}
qt.ItfMap["quick.QDebugMessageServiceFactory_ITF"] = QDebugMessageServiceFactory{}
qt.ItfMap["quick.QDebugMessageServiceImpl_ITF"] = QDebugMessageServiceImpl{}
qt.ItfMap["quick.QLocalClientConnectionFactory_ITF"] = QLocalClientConnectionFactory{}
qt.ItfMap["quick.QOpenVGMatrix_ITF"] = QOpenVGMatrix{}
qt.ItfMap["quick.QOpenVGOffscreenSurface_ITF"] = QOpenVGOffscreenSurface{}
qt.ItfMap["quick.QQmlDebugServerFactory_ITF"] = QQmlDebugServerFactory{}
qt.ItfMap["quick.QQmlDebuggerServiceFactory_ITF"] = QQmlDebuggerServiceFactory{}
qt.ItfMap["quick.QQmlEngineControlServiceImpl_ITF"] = QQmlEngineControlServiceImpl{}
qt.ItfMap["quick.QQmlEngineDebugServiceImpl_ITF"] = QQmlEngineDebugServiceImpl{}
qt.ItfMap["quick.QQmlInspectorServiceFactory_ITF"] = QQmlInspectorServiceFactory{}
qt.ItfMap["quick.QQmlNativeDebugConnector_ITF"] = QQmlNativeDebugConnector{}
qt.ItfMap["quick.QQmlNativeDebugConnectorFactory_ITF"] = QQmlNativeDebugConnectorFactory{}
qt.ItfMap["quick.QQmlNativeDebugServiceFactory_ITF"] = QQmlNativeDebugServiceFactory{}
qt.ItfMap["quick.QQmlNativeDebugServiceImpl_ITF"] = QQmlNativeDebugServiceImpl{}
qt.ItfMap["quick.QQmlPreviewBlacklist_ITF"] = QQmlPreviewBlacklist{}
qt.ItfMap["quick.QQmlPreviewFileEngine_ITF"] = QQmlPreviewFileEngine{}
qt.ItfMap["quick.QQmlPreviewFileEngineHandler_ITF"] = QQmlPreviewFileEngineHandler{}
qt.ItfMap["quick.QQmlPreviewFileLoader_ITF"] = QQmlPreviewFileLoader{}
qt.ItfMap["quick.QQmlPreviewHandler_ITF"] = QQmlPreviewHandler{}
qt.ItfMap["quick.QQmlPreviewPosition_ITF"] = QQmlPreviewPosition{}
qt.ItfMap["quick.QQmlPreviewServiceFactory_ITF"] = QQmlPreviewServiceFactory{}
qt.ItfMap["quick.QQmlPreviewServiceImpl_ITF"] = QQmlPreviewServiceImpl{}
qt.ItfMap["quick.QQmlProfilerAdapter_ITF"] = QQmlProfilerAdapter{}
qt.ItfMap["quick.QQmlProfilerServiceFactory_ITF"] = QQmlProfilerServiceFactory{}
qt.ItfMap["quick.QQmlProfilerServiceImpl_ITF"] = QQmlProfilerServiceImpl{}
qt.ItfMap["quick.QQmlWatcher_ITF"] = QQmlWatcher{}
qt.ItfMap["quick.QQuickAsyncImageProvider_ITF"] = QQuickAsyncImageProvider{}
qt.FuncMap["quick.NewQQuickAsyncImageProvider"] = NewQQuickAsyncImageProvider
qt.ItfMap["quick.QQuickFolderListModel_ITF"] = QQuickFolderListModel{}
qt.ItfMap["quick.QQuickFramebufferObject_ITF"] = QQuickFramebufferObject{}
qt.ItfMap["quick.QQuickImageProvider_ITF"] = QQuickImageProvider{}
qt.FuncMap["quick.NewQQuickImageProvider"] = NewQQuickImageProvider
@ -20430,6 +20460,7 @@ func init() {
qt.EnumMap["quick.QQuickPaintedItem__FramebufferObject"] = int64(QQuickPaintedItem__FramebufferObject)
qt.EnumMap["quick.QQuickPaintedItem__InvertedYFramebufferObject"] = int64(QQuickPaintedItem__InvertedYFramebufferObject)
qt.EnumMap["quick.QQuickPaintedItem__FastFBOResizing"] = int64(QQuickPaintedItem__FastFBOResizing)
qt.ItfMap["quick.QQuickProfilerAdapter_ITF"] = QQuickProfilerAdapter{}
qt.ItfMap["quick.QQuickProfilerAdapterFactory_ITF"] = QQuickProfilerAdapterFactory{}
qt.ItfMap["quick.QQuickRenderControl_ITF"] = QQuickRenderControl{}
qt.FuncMap["quick.NewQQuickRenderControl"] = NewQQuickRenderControl
@ -20571,6 +20602,19 @@ func init() {
qt.FuncMap["quick.NewQSGOpacityNode"] = NewQSGOpacityNode
qt.ItfMap["quick.QSGOpaqueTextureMaterial_ITF"] = QSGOpaqueTextureMaterial{}
qt.FuncMap["quick.NewQSGOpaqueTextureMaterial"] = NewQSGOpaqueTextureMaterial
qt.ItfMap["quick.QSGOpenVGFontGlyphCache_ITF"] = QSGOpenVGFontGlyphCache{}
qt.ItfMap["quick.QSGOpenVGFontGlyphCacheManager_ITF"] = QSGOpenVGFontGlyphCacheManager{}
qt.ItfMap["quick.QSGOpenVGImageNode_ITF"] = QSGOpenVGImageNode{}
qt.ItfMap["quick.QSGOpenVGInternalImageNode_ITF"] = QSGOpenVGInternalImageNode{}
qt.ItfMap["quick.QSGOpenVGInternalRectangleNode_ITF"] = QSGOpenVGInternalRectangleNode{}
qt.ItfMap["quick.QSGOpenVGLayer_ITF"] = QSGOpenVGLayer{}
qt.ItfMap["quick.QSGOpenVGNinePatchNode_ITF"] = QSGOpenVGNinePatchNode{}
qt.ItfMap["quick.QSGOpenVGNodeVisitor_ITF"] = QSGOpenVGNodeVisitor{}
qt.ItfMap["quick.QSGOpenVGPainterNode_ITF"] = QSGOpenVGPainterNode{}
qt.ItfMap["quick.QSGOpenVGRectangleNode_ITF"] = QSGOpenVGRectangleNode{}
qt.ItfMap["quick.QSGOpenVGRenderable_ITF"] = QSGOpenVGRenderable{}
qt.ItfMap["quick.QSGOpenVGSpriteNode_ITF"] = QSGOpenVGSpriteNode{}
qt.ItfMap["quick.QSGOpenVGTexture_ITF"] = QSGOpenVGTexture{}
qt.ItfMap["quick.QSGRectangleNode_ITF"] = QSGRectangleNode{}
qt.ItfMap["quick.QSGRenderNode_ITF"] = QSGRenderNode{}
qt.EnumMap["quick.QSGRenderNode__DepthState"] = int64(QSGRenderNode__DepthState)
@ -20602,6 +20646,9 @@ func init() {
qt.EnumMap["quick.QSGRendererInterface__ShaderSourceString"] = int64(QSGRendererInterface__ShaderSourceString)
qt.EnumMap["quick.QSGRendererInterface__ShaderSourceFile"] = int64(QSGRendererInterface__ShaderSourceFile)
qt.EnumMap["quick.QSGRendererInterface__ShaderByteCode"] = int64(QSGRendererInterface__ShaderByteCode)
qt.ItfMap["quick.QSGSimpleMaterial_ITF"] = QSGSimpleMaterial{}
qt.ItfMap["quick.QSGSimpleMaterialComparableMaterial_ITF"] = QSGSimpleMaterialComparableMaterial{}
qt.ItfMap["quick.QSGSimpleMaterialShader_ITF"] = QSGSimpleMaterialShader{}
qt.ItfMap["quick.QSGSimpleRectNode_ITF"] = QSGSimpleRectNode{}
qt.FuncMap["quick.NewQSGSimpleRectNode"] = NewQSGSimpleRectNode
qt.FuncMap["quick.NewQSGSimpleRectNode2"] = NewQSGSimpleRectNode2
@ -20630,4 +20677,14 @@ func init() {
qt.ItfMap["quick.QSGVertexColorMaterial_ITF"] = QSGVertexColorMaterial{}
qt.FuncMap["quick.NewQSGVertexColorMaterial"] = NewQSGVertexColorMaterial
qt.ItfMap["quick.QTcpServerConnectionFactory_ITF"] = QTcpServerConnectionFactory{}
qt.ItfMap["quick.QV4DataCollector_ITF"] = QV4DataCollector{}
qt.ItfMap["quick.QV4DebugJob_ITF"] = QV4DebugJob{}
qt.ItfMap["quick.QV4DebugServiceImpl_ITF"] = QV4DebugServiceImpl{}
qt.ItfMap["quick.QV4Debugger_ITF"] = QV4Debugger{}
qt.ItfMap["quick.QV4DebuggerAgent_ITF"] = QV4DebuggerAgent{}
qt.ItfMap["quick.QV4ProfilerAdapter_ITF"] = QV4ProfilerAdapter{}
qt.ItfMap["quick.QWavefrontMesh_ITF"] = QWavefrontMesh{}
qt.ItfMap["quick.ScopeJob_ITF"] = ScopeJob{}
qt.ItfMap["quick.SharedImageProvider_ITF"] = SharedImageProvider{}
qt.ItfMap["quick.ValueLookupJob_ITF"] = ValueLookupJob{}
}

View file

@ -26,7 +26,7 @@ func cGoUnpackBytes(s C.struct_QtQuickControls2_PackedString) []byte {
defer cGoFreePacked(s.ptr)
if int(s.len) == -1 {
gs := C.GoString(s.data)
return *(*[]byte)(unsafe.Pointer(&gs))
return []byte(gs)
}
return C.GoBytes(unsafe.Pointer(s.data), C.int(s.len))
}

View file

@ -26,7 +26,7 @@ func cGoUnpackBytes(s C.struct_QtRemoteObjects_PackedString) []byte {
defer cGoFreePacked(s.ptr)
if int(s.len) == -1 {
gs := C.GoString(s.data)
return *(*[]byte)(unsafe.Pointer(&gs))
return []byte(gs)
}
return C.GoBytes(unsafe.Pointer(s.data), C.int(s.len))
}
@ -4756,8 +4756,14 @@ func (ptr *SourceApiMap) DestroySourceApiMap() {
}
}
func init() {
qt.ItfMap["remoteobjects.DataEntries_ITF"] = DataEntries{}
qt.ItfMap["remoteobjects.IndexValuePair_ITF"] = IndexValuePair{}
qt.ItfMap["remoteobjects.ModelIndex_ITF"] = ModelIndex{}
qt.ItfMap["remoteobjects.QAbstractItemModelReplica_ITF"] = QAbstractItemModelReplica{}
qt.ItfMap["remoteobjects.QIOQnxSource_ITF"] = QIOQnxSource{}
qt.ItfMap["remoteobjects.QMetaTypeId_ITF"] = QMetaTypeId{}
qt.ItfMap["remoteobjects.QQnxNativeIo_ITF"] = QQnxNativeIo{}
qt.ItfMap["remoteobjects.QQnxNativeServer_ITF"] = QQnxNativeServer{}
qt.ItfMap["remoteobjects.QRemoteObjectAbstractPersistedStore_ITF"] = QRemoteObjectAbstractPersistedStore{}
qt.FuncMap["remoteobjects.NewQRemoteObjectAbstractPersistedStore"] = NewQRemoteObjectAbstractPersistedStore
qt.ItfMap["remoteobjects.QRemoteObjectDynamicReplica_ITF"] = QRemoteObjectDynamicReplica{}
@ -4798,4 +4804,7 @@ func init() {
qt.ItfMap["remoteobjects.QRemoteObjectSettingsStore_ITF"] = QRemoteObjectSettingsStore{}
qt.ItfMap["remoteobjects.QRemoteObjectSourceLocationInfo_ITF"] = QRemoteObjectSourceLocationInfo{}
qt.ItfMap["remoteobjects.QTypeInfo_ITF"] = QTypeInfo{}
qt.ItfMap["remoteobjects.QtROClientFactory_ITF"] = QtROClientFactory{}
qt.ItfMap["remoteobjects.QtROServerFactory_ITF"] = QtROServerFactory{}
qt.ItfMap["remoteobjects.SourceApiMap_ITF"] = SourceApiMap{}
}

View file

@ -56,7 +56,8 @@ func NewSailfishAppFromPointer(ptr unsafe.Pointer) (n *SailfishApp) {
return
}
func (ptr *SailfishApp) DestroySailfishApp() {}
func (ptr *SailfishApp) DestroySailfishApp() {
}
func SailfishApp_Application(argc int, argv []string) *gui.QGuiApplication {

View file

@ -28,7 +28,7 @@ func cGoUnpackBytes(s C.struct_QtSailfish_PackedString) []byte {
defer cGoFreePacked(s.ptr)
if int(s.len) == -1 {
gs := C.GoString(s.data)
return *(*[]byte)(unsafe.Pointer(&gs))
return []byte(gs)
}
return C.GoBytes(unsafe.Pointer(s.data), C.int(s.len))
}

View file

@ -26,7 +26,7 @@ func cGoUnpackBytes(s C.struct_QtScript_PackedString) []byte {
defer cGoFreePacked(s.ptr)
if int(s.len) == -1 {
gs := C.GoString(s.data)
return *(*[]byte)(unsafe.Pointer(&gs))
return []byte(gs)
}
return C.GoBytes(unsafe.Pointer(s.data), C.int(s.len))
}
@ -3819,6 +3819,7 @@ func init() {
qt.EnumMap["script.QScriptClass__HandlesWriteAccess"] = int64(QScriptClass__HandlesWriteAccess)
qt.EnumMap["script.QScriptClass__Callable"] = int64(QScriptClass__Callable)
qt.EnumMap["script.QScriptClass__HasInstance"] = int64(QScriptClass__HasInstance)
qt.ItfMap["script.QScriptClassPropertyIterator_ITF"] = QScriptClassPropertyIterator{}
qt.ItfMap["script.QScriptContext_ITF"] = QScriptContext{}
qt.EnumMap["script.QScriptContext__NormalState"] = int64(QScriptContext__NormalState)
qt.EnumMap["script.QScriptContext__ExceptionState"] = int64(QScriptContext__ExceptionState)
@ -3894,5 +3895,6 @@ func init() {
qt.EnumMap["script.QScriptValue__QObjectMember"] = int64(QScriptValue__QObjectMember)
qt.EnumMap["script.QScriptValue__KeepExistingFlags"] = int64(QScriptValue__KeepExistingFlags)
qt.EnumMap["script.QScriptValue__UserRange"] = int64(QScriptValue__UserRange)
qt.ItfMap["script.QScriptValueIterator_ITF"] = QScriptValueIterator{}
qt.ItfMap["script.QScriptable_ITF"] = QScriptable{}
}

View file

@ -28,7 +28,7 @@ func cGoUnpackBytes(s C.struct_QtScriptTools_PackedString) []byte {
defer cGoFreePacked(s.ptr)
if int(s.len) == -1 {
gs := C.GoString(s.data)
return *(*[]byte)(unsafe.Pointer(&gs))
return []byte(gs)
}
return C.GoBytes(unsafe.Pointer(s.data), C.int(s.len))
}

View file

@ -26,7 +26,7 @@ func cGoUnpackBytes(s C.struct_QtScxml_PackedString) []byte {
defer cGoFreePacked(s.ptr)
if int(s.len) == -1 {
gs := C.GoString(s.data)
return *(*[]byte)(unsafe.Pointer(&gs))
return []byte(gs)
}
return C.GoBytes(unsafe.Pointer(s.data), C.int(s.len))
}

View file

@ -26,7 +26,7 @@ func cGoUnpackBytes(s C.struct_QtSensors_PackedString) []byte {
defer cGoFreePacked(s.ptr)
if int(s.len) == -1 {
gs := C.GoString(s.data)
return *(*[]byte)(unsafe.Pointer(&gs))
return []byte(gs)
}
return C.GoBytes(unsafe.Pointer(s.data), C.int(s.len))
}
@ -13861,6 +13861,27 @@ func NewSensorfwaccelerometerFromPointer(ptr unsafe.Pointer) (n *sensorfwacceler
return
}
func init() {
qt.ItfMap["sensors.AndroidAccelerometer_ITF"] = AndroidAccelerometer{}
qt.ItfMap["sensors.AndroidCompass_ITF"] = AndroidCompass{}
qt.ItfMap["sensors.AndroidGyroscope_ITF"] = AndroidGyroscope{}
qt.ItfMap["sensors.AndroidLight_ITF"] = AndroidLight{}
qt.ItfMap["sensors.AndroidMagnetometer_ITF"] = AndroidMagnetometer{}
qt.ItfMap["sensors.AndroidPressure_ITF"] = AndroidPressure{}
qt.ItfMap["sensors.AndroidProximity_ITF"] = AndroidProximity{}
qt.ItfMap["sensors.AndroidRotation_ITF"] = AndroidRotation{}
qt.ItfMap["sensors.AndroidTemperature_ITF"] = AndroidTemperature{}
qt.ItfMap["sensors.FunctionEvent_ITF"] = FunctionEvent{}
qt.ItfMap["sensors.GenericTiltSensor_ITF"] = GenericTiltSensor{}
qt.ItfMap["sensors.IIOSensorProxyCompass_ITF"] = IIOSensorProxyCompass{}
qt.ItfMap["sensors.IIOSensorProxyLightSensor_ITF"] = IIOSensorProxyLightSensor{}
qt.ItfMap["sensors.IIOSensorProxyOrientationSensor_ITF"] = IIOSensorProxyOrientationSensor{}
qt.ItfMap["sensors.IIOSensorProxySensorBase_ITF"] = IIOSensorProxySensorBase{}
qt.ItfMap["sensors.IOSAccelerometer_ITF"] = IOSAccelerometer{}
qt.ItfMap["sensors.IOSCompass_ITF"] = IOSCompass{}
qt.ItfMap["sensors.IOSGyroscope_ITF"] = IOSGyroscope{}
qt.ItfMap["sensors.IOSMagnetometer_ITF"] = IOSMagnetometer{}
qt.ItfMap["sensors.IOSProximitySensor_ITF"] = IOSProximitySensor{}
qt.ItfMap["sensors.LinuxSysAccelerometer_ITF"] = LinuxSysAccelerometer{}
qt.ItfMap["sensors.QAccelerometer_ITF"] = QAccelerometer{}
qt.FuncMap["sensors.NewQAccelerometer"] = NewQAccelerometer
qt.EnumMap["sensors.QAccelerometer__Combined"] = int64(QAccelerometer__Combined)
@ -14004,4 +14025,94 @@ func init() {
qt.ItfMap["sensors.QTiltReading_ITF"] = QTiltReading{}
qt.ItfMap["sensors.QTiltSensor_ITF"] = QTiltSensor{}
qt.FuncMap["sensors.NewQTiltSensor"] = NewQTiltSensor
qt.ItfMap["sensors.QmlAccelerometer_ITF"] = QmlAccelerometer{}
qt.ItfMap["sensors.QmlAccelerometerReading_ITF"] = QmlAccelerometerReading{}
qt.ItfMap["sensors.QmlAltimeter_ITF"] = QmlAltimeter{}
qt.ItfMap["sensors.QmlAltimeterReading_ITF"] = QmlAltimeterReading{}
qt.ItfMap["sensors.QmlAmbientLightSensor_ITF"] = QmlAmbientLightSensor{}
qt.ItfMap["sensors.QmlAmbientLightSensorReading_ITF"] = QmlAmbientLightSensorReading{}
qt.ItfMap["sensors.QmlAmbientTemperatureReading_ITF"] = QmlAmbientTemperatureReading{}
qt.ItfMap["sensors.QmlAmbientTemperatureSensor_ITF"] = QmlAmbientTemperatureSensor{}
qt.ItfMap["sensors.QmlCompass_ITF"] = QmlCompass{}
qt.ItfMap["sensors.QmlCompassReading_ITF"] = QmlCompassReading{}
qt.ItfMap["sensors.QmlDistanceReading_ITF"] = QmlDistanceReading{}
qt.ItfMap["sensors.QmlDistanceSensor_ITF"] = QmlDistanceSensor{}
qt.ItfMap["sensors.QmlGyroscope_ITF"] = QmlGyroscope{}
qt.ItfMap["sensors.QmlGyroscopeReading_ITF"] = QmlGyroscopeReading{}
qt.ItfMap["sensors.QmlHolsterReading_ITF"] = QmlHolsterReading{}
qt.ItfMap["sensors.QmlHolsterSensor_ITF"] = QmlHolsterSensor{}
qt.ItfMap["sensors.QmlHumidityReading_ITF"] = QmlHumidityReading{}
qt.ItfMap["sensors.QmlHumiditySensor_ITF"] = QmlHumiditySensor{}
qt.ItfMap["sensors.QmlIRProximitySensor_ITF"] = QmlIRProximitySensor{}
qt.ItfMap["sensors.QmlIRProximitySensorReading_ITF"] = QmlIRProximitySensorReading{}
qt.ItfMap["sensors.QmlLidReading_ITF"] = QmlLidReading{}
qt.ItfMap["sensors.QmlLidSensor_ITF"] = QmlLidSensor{}
qt.ItfMap["sensors.QmlLightSensor_ITF"] = QmlLightSensor{}
qt.ItfMap["sensors.QmlLightSensorReading_ITF"] = QmlLightSensorReading{}
qt.ItfMap["sensors.QmlMagnetometer_ITF"] = QmlMagnetometer{}
qt.ItfMap["sensors.QmlMagnetometerReading_ITF"] = QmlMagnetometerReading{}
qt.ItfMap["sensors.QmlOrientationSensor_ITF"] = QmlOrientationSensor{}
qt.ItfMap["sensors.QmlOrientationSensorReading_ITF"] = QmlOrientationSensorReading{}
qt.ItfMap["sensors.QmlPressureReading_ITF"] = QmlPressureReading{}
qt.ItfMap["sensors.QmlPressureSensor_ITF"] = QmlPressureSensor{}
qt.ItfMap["sensors.QmlProximitySensor_ITF"] = QmlProximitySensor{}
qt.ItfMap["sensors.QmlProximitySensorReading_ITF"] = QmlProximitySensorReading{}
qt.ItfMap["sensors.QmlRotationSensor_ITF"] = QmlRotationSensor{}
qt.ItfMap["sensors.QmlRotationSensorReading_ITF"] = QmlRotationSensorReading{}
qt.ItfMap["sensors.QmlSensor_ITF"] = QmlSensor{}
qt.ItfMap["sensors.QmlSensorGesture_ITF"] = QmlSensorGesture{}
qt.ItfMap["sensors.QmlSensorGlobal_ITF"] = QmlSensorGlobal{}
qt.ItfMap["sensors.QmlSensorOutputRange_ITF"] = QmlSensorOutputRange{}
qt.ItfMap["sensors.QmlSensorRange_ITF"] = QmlSensorRange{}
qt.ItfMap["sensors.QmlSensorReading_ITF"] = QmlSensorReading{}
qt.ItfMap["sensors.QmlTapSensor_ITF"] = QmlTapSensor{}
qt.ItfMap["sensors.QmlTapSensorReading_ITF"] = QmlTapSensorReading{}
qt.ItfMap["sensors.QmlTiltSensor_ITF"] = QmlTiltSensor{}
qt.ItfMap["sensors.QmlTiltSensorReading_ITF"] = QmlTiltSensorReading{}
qt.ItfMap["sensors.SensorEventQueue_ITF"] = SensorEventQueue{}
qt.ItfMap["sensors.SensorManager_ITF"] = SensorManager{}
qt.ItfMap["sensors.SensorTagAccelerometer_ITF"] = SensorTagAccelerometer{}
qt.ItfMap["sensors.SensorTagAls_ITF"] = SensorTagAls{}
qt.ItfMap["sensors.SensorTagBase_ITF"] = SensorTagBase{}
qt.ItfMap["sensors.SensorTagGyroscope_ITF"] = SensorTagGyroscope{}
qt.ItfMap["sensors.SensorTagHumiditySensor_ITF"] = SensorTagHumiditySensor{}
qt.ItfMap["sensors.SensorTagLightSensor_ITF"] = SensorTagLightSensor{}
qt.ItfMap["sensors.SensorTagMagnetometer_ITF"] = SensorTagMagnetometer{}
qt.ItfMap["sensors.SensorTagPressureSensor_ITF"] = SensorTagPressureSensor{}
qt.ItfMap["sensors.SensorTagTemperatureSensor_ITF"] = SensorTagTemperatureSensor{}
qt.ItfMap["sensors.SensorfwCompass_ITF"] = SensorfwCompass{}
qt.ItfMap["sensors.SensorfwGyroscope_ITF"] = SensorfwGyroscope{}
qt.ItfMap["sensors.SensorfwIrProximitySensor_ITF"] = SensorfwIrProximitySensor{}
qt.ItfMap["sensors.SensorfwLidSensor_ITF"] = SensorfwLidSensor{}
qt.ItfMap["sensors.SensorfwLightSensor_ITF"] = SensorfwLightSensor{}
qt.ItfMap["sensors.SensorfwMagnetometer_ITF"] = SensorfwMagnetometer{}
qt.ItfMap["sensors.SensorfwOrientationSensor_ITF"] = SensorfwOrientationSensor{}
qt.ItfMap["sensors.SensorfwProximitySensor_ITF"] = SensorfwProximitySensor{}
qt.ItfMap["sensors.SensorfwRotationSensor_ITF"] = SensorfwRotationSensor{}
qt.ItfMap["sensors.SensorfwSensorBase_ITF"] = SensorfwSensorBase{}
qt.ItfMap["sensors.SensorfwTapSensor_ITF"] = SensorfwTapSensor{}
qt.ItfMap["sensors.Sensorfwals_ITF"] = Sensorfwals{}
qt.ItfMap["sensors.SensorsConnection_ITF"] = SensorsConnection{}
qt.ItfMap["sensors.SimulatorAccelerometer_ITF"] = SimulatorAccelerometer{}
qt.ItfMap["sensors.SimulatorAmbientLightSensor_ITF"] = SimulatorAmbientLightSensor{}
qt.ItfMap["sensors.SimulatorCommon_ITF"] = SimulatorCommon{}
qt.ItfMap["sensors.SimulatorCompass_ITF"] = SimulatorCompass{}
qt.ItfMap["sensors.SimulatorIRProximitySensor_ITF"] = SimulatorIRProximitySensor{}
qt.ItfMap["sensors.SimulatorLightSensor_ITF"] = SimulatorLightSensor{}
qt.ItfMap["sensors.SimulatorMagnetometer_ITF"] = SimulatorMagnetometer{}
qt.ItfMap["sensors.SimulatorProximitySensor_ITF"] = SimulatorProximitySensor{}
qt.ItfMap["sensors.ThreadSafeSensorBackend_ITF"] = ThreadSafeSensorBackend{}
qt.ItfMap["sensors.WinRtAccelerometer_ITF"] = WinRtAccelerometer{}
qt.ItfMap["sensors.WinRtAmbientLightSensor_ITF"] = WinRtAmbientLightSensor{}
qt.ItfMap["sensors.WinRtCompass_ITF"] = WinRtCompass{}
qt.ItfMap["sensors.WinRtGyroscope_ITF"] = WinRtGyroscope{}
qt.ItfMap["sensors.WinRtOrientationSensor_ITF"] = WinRtOrientationSensor{}
qt.ItfMap["sensors.WinRtRotationSensor_ITF"] = WinRtRotationSensor{}
qt.ItfMap["sensors.dummyaccelerometer_ITF"] = dummyaccelerometer{}
qt.ItfMap["sensors.dummycommon_ITF"] = dummycommon{}
qt.ItfMap["sensors.dummylightsensor_ITF"] = dummylightsensor{}
qt.ItfMap["sensors.genericalssensor_ITF"] = genericalssensor{}
qt.ItfMap["sensors.genericorientationsensor_ITF"] = genericorientationsensor{}
qt.ItfMap["sensors.genericrotationsensor_ITF"] = genericrotationsensor{}
qt.ItfMap["sensors.sensorfwaccelerometer_ITF"] = sensorfwaccelerometer{}
}

View file

@ -27,7 +27,7 @@ func cGoUnpackBytes(s C.struct_QtSerialBus_PackedString) []byte {
defer cGoFreePacked(s.ptr)
if int(s.len) == -1 {
gs := C.GoString(s.data)
return *(*[]byte)(unsafe.Pointer(&gs))
return []byte(gs)
}
return C.GoBytes(unsafe.Pointer(s.data), C.int(s.len))
}

View file

@ -27,7 +27,7 @@ func cGoUnpackBytes(s C.struct_QtSerialPort_PackedString) []byte {
defer cGoFreePacked(s.ptr)
if int(s.len) == -1 {
gs := C.GoString(s.data)
return *(*[]byte)(unsafe.Pointer(&gs))
return []byte(gs)
}
return C.GoBytes(unsafe.Pointer(s.data), C.int(s.len))
}

View file

@ -26,7 +26,7 @@ func cGoUnpackBytes(s C.struct_QtSpeech_PackedString) []byte {
defer cGoFreePacked(s.ptr)
if int(s.len) == -1 {
gs := C.GoString(s.data)
return *(*[]byte)(unsafe.Pointer(&gs))
return []byte(gs)
}
return C.GoBytes(unsafe.Pointer(s.data), C.int(s.len))
}
@ -3116,7 +3116,22 @@ func init() {
qt.FuncMap["speech.NewQTextToSpeechEngine"] = NewQTextToSpeechEngine
qt.FuncMap["speech.QTextToSpeechEngine_CreateVoice"] = QTextToSpeechEngine_CreateVoice
qt.FuncMap["speech.QTextToSpeechEngine_VoiceData"] = QTextToSpeechEngine_VoiceData
qt.ItfMap["speech.QTextToSpeechEngineAndroid_ITF"] = QTextToSpeechEngineAndroid{}
qt.ItfMap["speech.QTextToSpeechEngineFlite_ITF"] = QTextToSpeechEngineFlite{}
qt.ItfMap["speech.QTextToSpeechEngineIos_ITF"] = QTextToSpeechEngineIos{}
qt.ItfMap["speech.QTextToSpeechEngineOsx_ITF"] = QTextToSpeechEngineOsx{}
qt.ItfMap["speech.QTextToSpeechEngineSapi_ITF"] = QTextToSpeechEngineSapi{}
qt.ItfMap["speech.QTextToSpeechEngineSpeechd_ITF"] = QTextToSpeechEngineSpeechd{}
qt.ItfMap["speech.QTextToSpeechEngineWinRT_ITF"] = QTextToSpeechEngineWinRT{}
qt.ItfMap["speech.QTextToSpeechPlugin_ITF"] = QTextToSpeechPlugin{}
qt.ItfMap["speech.QTextToSpeechPluginAndroid_ITF"] = QTextToSpeechPluginAndroid{}
qt.ItfMap["speech.QTextToSpeechPluginFlite_ITF"] = QTextToSpeechPluginFlite{}
qt.ItfMap["speech.QTextToSpeechPluginIos_ITF"] = QTextToSpeechPluginIos{}
qt.ItfMap["speech.QTextToSpeechPluginOsx_ITF"] = QTextToSpeechPluginOsx{}
qt.ItfMap["speech.QTextToSpeechPluginSapi_ITF"] = QTextToSpeechPluginSapi{}
qt.ItfMap["speech.QTextToSpeechPluginSpeechd_ITF"] = QTextToSpeechPluginSpeechd{}
qt.ItfMap["speech.QTextToSpeechPluginWinRT_ITF"] = QTextToSpeechPluginWinRT{}
qt.ItfMap["speech.QTextToSpeechProcessorFlite_ITF"] = QTextToSpeechProcessorFlite{}
qt.ItfMap["speech.QVoice_ITF"] = QVoice{}
qt.FuncMap["speech.QVoice_AgeName"] = QVoice_AgeName
qt.FuncMap["speech.QVoice_GenderName"] = QVoice_GenderName

View file

@ -28,7 +28,7 @@ func cGoUnpackBytes(s C.struct_QtSql_PackedString) []byte {
defer cGoFreePacked(s.ptr)
if int(s.len) == -1 {
gs := C.GoString(s.data)
return *(*[]byte)(unsafe.Pointer(&gs))
return []byte(gs)
}
return C.GoBytes(unsafe.Pointer(s.data), C.int(s.len))
}
@ -9383,6 +9383,7 @@ func init() {
qt.EnumMap["sql.QSqlDriver__UnknownSource"] = int64(QSqlDriver__UnknownSource)
qt.EnumMap["sql.QSqlDriver__SelfSource"] = int64(QSqlDriver__SelfSource)
qt.EnumMap["sql.QSqlDriver__OtherSource"] = int64(QSqlDriver__OtherSource)
qt.ItfMap["sql.QSqlDriverCreator_ITF"] = QSqlDriverCreator{}
qt.ItfMap["sql.QSqlDriverCreatorBase_ITF"] = QSqlDriverCreatorBase{}
qt.ItfMap["sql.QSqlDriverPlugin_ITF"] = QSqlDriverPlugin{}
qt.FuncMap["sql.NewQSqlDriverPlugin"] = NewQSqlDriverPlugin

View file

@ -28,7 +28,7 @@ func cGoUnpackBytes(s C.struct_QtSvg_PackedString) []byte {
defer cGoFreePacked(s.ptr)
if int(s.len) == -1 {
gs := C.GoString(s.data)
return *(*[]byte)(unsafe.Pointer(&gs))
return []byte(gs)
}
return C.GoBytes(unsafe.Pointer(s.data), C.int(s.len))
}
@ -3685,6 +3685,8 @@ func init() {
qt.FuncMap["svg.NewQGraphicsSvgItem2"] = NewQGraphicsSvgItem2
qt.ItfMap["svg.QSvgGenerator_ITF"] = QSvgGenerator{}
qt.FuncMap["svg.NewQSvgGenerator"] = NewQSvgGenerator
qt.ItfMap["svg.QSvgIOHandler_ITF"] = QSvgIOHandler{}
qt.ItfMap["svg.QSvgIconEngine_ITF"] = QSvgIconEngine{}
qt.ItfMap["svg.QSvgRenderer_ITF"] = QSvgRenderer{}
qt.FuncMap["svg.NewQSvgRenderer"] = NewQSvgRenderer
qt.FuncMap["svg.NewQSvgRenderer2"] = NewQSvgRenderer2

View file

@ -27,7 +27,7 @@ func cGoUnpackBytes(s C.struct_QtTestLib_PackedString) []byte {
defer cGoFreePacked(s.ptr)
if int(s.len) == -1 {
gs := C.GoString(s.data)
return *(*[]byte)(unsafe.Pointer(&gs))
return []byte(gs)
}
return C.GoBytes(unsafe.Pointer(s.data), C.int(s.len))
}
@ -1216,6 +1216,7 @@ func init() {
qt.ItfMap["testlib.QSignalSpy_ITF"] = QSignalSpy{}
qt.FuncMap["testlib.NewQSignalSpy"] = NewQSignalSpy
qt.ItfMap["testlib.QSpontaneKeyEvent_ITF"] = QSpontaneKeyEvent{}
qt.ItfMap["testlib.QTest_ITF"] = QTest{}
qt.EnumMap["testlib.QTest__Abort"] = int64(QTest__Abort)
qt.EnumMap["testlib.QTest__Continue"] = int64(QTest__Continue)
qt.EnumMap["testlib.QTest__FramesPerSecond"] = int64(QTest__FramesPerSecond)

View file

@ -27,7 +27,7 @@ func cGoUnpackBytes(s C.struct_QtUiTools_PackedString) []byte {
defer cGoFreePacked(s.ptr)
if int(s.len) == -1 {
gs := C.GoString(s.data)
return *(*[]byte)(unsafe.Pointer(&gs))
return []byte(gs)
}
return C.GoBytes(unsafe.Pointer(s.data), C.int(s.len))
}

View file

@ -2585,9 +2585,9 @@ void QVirtualKeyboardTrace_SetChannels(void* ptr, struct QtVirtualKeyboard_Packe
static_cast<QVirtualKeyboardTrace*>(ptr)->setChannels(QString::fromUtf8(channels.data, channels.len).split("¡¦!", QString::SkipEmptyParts));
}
void QVirtualKeyboardTrace_SetFinal(void* ptr, char final)
void QVirtualKeyboardTrace_SetFinal(void* ptr, char fin)
{
static_cast<QVirtualKeyboardTrace*>(ptr)->setFinal(final != 0);
static_cast<QVirtualKeyboardTrace*>(ptr)->setFinal(fin != 0);
}
void QVirtualKeyboardTrace_SetOpacity(void* ptr, double opacity)

View file

@ -26,7 +26,7 @@ func cGoUnpackBytes(s C.struct_QtVirtualKeyboard_PackedString) []byte {
defer cGoFreePacked(s.ptr)
if int(s.len) == -1 {
gs := C.GoString(s.data)
return *(*[]byte)(unsafe.Pointer(&gs))
return []byte(gs)
}
return C.GoBytes(unsafe.Pointer(s.data), C.int(s.len))
}
@ -6028,9 +6028,9 @@ func (ptr *QVirtualKeyboardTrace) SetChannels(channels []string) {
}
}
func (ptr *QVirtualKeyboardTrace) SetFinal(final bool) {
func (ptr *QVirtualKeyboardTrace) SetFinal(fin bool) {
if ptr.Pointer() != nil {
C.QVirtualKeyboardTrace_SetFinal(ptr.Pointer(), C.char(int8(qt.GoBoolToInt(final))))
C.QVirtualKeyboardTrace_SetFinal(ptr.Pointer(), C.char(int8(qt.GoBoolToInt(fin))))
}
}

View file

@ -458,7 +458,7 @@ struct QtVirtualKeyboard_PackedList QVirtualKeyboardTrace_Points(void* ptr, int
void QVirtualKeyboardTrace_SetCanceled(void* ptr, char canceled);
void QVirtualKeyboardTrace_SetChannelData(void* ptr, struct QtVirtualKeyboard_PackedString channel, int index, void* data);
void QVirtualKeyboardTrace_SetChannels(void* ptr, struct QtVirtualKeyboard_PackedString channels);
void QVirtualKeyboardTrace_SetFinal(void* ptr, char final);
void QVirtualKeyboardTrace_SetFinal(void* ptr, char fin);
void QVirtualKeyboardTrace_SetOpacity(void* ptr, double opacity);
void QVirtualKeyboardTrace_SetTraceId(void* ptr, int id);
int QVirtualKeyboardTrace_TraceId(void* ptr);

View file

@ -26,7 +26,7 @@ func cGoUnpackBytes(s C.struct_QtWebChannel_PackedString) []byte {
defer cGoFreePacked(s.ptr)
if int(s.len) == -1 {
gs := C.GoString(s.data)
return *(*[]byte)(unsafe.Pointer(&gs))
return []byte(gs)
}
return C.GoBytes(unsafe.Pointer(s.data), C.int(s.len))
}

View file

@ -31,7 +31,7 @@ func cGoUnpackBytes(s C.struct_QtWebEngine_PackedString) []byte {
defer cGoFreePacked(s.ptr)
if int(s.len) == -1 {
gs := C.GoString(s.data)
return *(*[]byte)(unsafe.Pointer(&gs))
return []byte(gs)
}
return C.GoBytes(unsafe.Pointer(s.data), C.int(s.len))
}
@ -10866,6 +10866,11 @@ func (ptr *WebEventFactory) DestroyWebEventFactory() {
}
}
func init() {
qt.ItfMap["webengine.CertificateErrorController_ITF"] = CertificateErrorController{}
qt.ItfMap["webengine.ClientCertSelectController_ITF"] = ClientCertSelectController{}
qt.ItfMap["webengine.CommandLinePrefStoreQt_ITF"] = CommandLinePrefStoreQt{}
qt.ItfMap["webengine.GLContextHelper_ITF"] = GLContextHelper{}
qt.ItfMap["webengine.ProxyConfigServiceQt_ITF"] = ProxyConfigServiceQt{}
qt.ItfMap["webengine.QQuickWebEngineProfile_ITF"] = QQuickWebEngineProfile{}
qt.FuncMap["webengine.NewQQuickWebEngineProfile"] = NewQQuickWebEngineProfile
qt.FuncMap["webengine.QQuickWebEngineProfile_DefaultProfile"] = QQuickWebEngineProfile_DefaultProfile
@ -11121,4 +11126,11 @@ func init() {
qt.FuncMap["webengine.QWebEngineView_Tr"] = QWebEngineView_Tr
qt.ItfMap["webengine.QtWebEngine_ITF"] = QtWebEngine{}
qt.FuncMap["webengine.QtWebEngine_Initialize"] = QtWebEngine_Initialize
qt.ItfMap["webengine.RenderViewObserverQt_ITF"] = RenderViewObserverQt{}
qt.ItfMap["webengine.ServiceQt_ITF"] = ServiceQt{}
qt.ItfMap["webengine.UserResourceController_ITF"] = UserResourceController{}
qt.ItfMap["webengine.UserScriptData_ITF"] = UserScriptData{}
qt.ItfMap["webengine.WebEngineError_ITF"] = WebEngineError{}
qt.ItfMap["webengine.WebEngineLibraryInfo_ITF"] = WebEngineLibraryInfo{}
qt.ItfMap["webengine.WebEventFactory_ITF"] = WebEventFactory{}
}

View file

@ -27,7 +27,7 @@ func cGoUnpackBytes(s C.struct_QtWebSockets_PackedString) []byte {
defer cGoFreePacked(s.ptr)
if int(s.len) == -1 {
gs := C.GoString(s.data)
return *(*[]byte)(unsafe.Pointer(&gs))
return []byte(gs)
}
return C.GoBytes(unsafe.Pointer(s.data), C.int(s.len))
}
@ -3161,6 +3161,8 @@ func (ptr *QtWebSocketsDeclarativeModule) DestroyQtWebSocketsDeclarativeModule()
func init() {
qt.ItfMap["websockets.QMaskGenerator_ITF"] = QMaskGenerator{}
qt.FuncMap["websockets.NewQMaskGenerator2"] = NewQMaskGenerator2
qt.ItfMap["websockets.QQmlWebSocket_ITF"] = QQmlWebSocket{}
qt.ItfMap["websockets.QQmlWebSocketServer_ITF"] = QQmlWebSocketServer{}
qt.ItfMap["websockets.QWebSocket_ITF"] = QWebSocket{}
qt.FuncMap["websockets.NewQWebSocket2"] = NewQWebSocket2
qt.ItfMap["websockets.QWebSocketCorsAuthenticator_ITF"] = QWebSocketCorsAuthenticator{}

View file

@ -26,7 +26,7 @@ func cGoUnpackBytes(s C.struct_QtWebView_PackedString) []byte {
defer cGoFreePacked(s.ptr)
if int(s.len) == -1 {
gs := C.GoString(s.data)
return *(*[]byte)(unsafe.Pointer(&gs))
return []byte(gs)
}
return C.GoBytes(unsafe.Pointer(s.data), C.int(s.len))
}

View file

@ -27,7 +27,7 @@ func cGoUnpackBytes(s C.struct_QtWidgets_PackedString) []byte {
defer cGoFreePacked(s.ptr)
if int(s.len) == -1 {
gs := C.GoString(s.data)
return *(*[]byte)(unsafe.Pointer(&gs))
return []byte(gs)
}
return C.GoBytes(unsafe.Pointer(s.data), C.int(s.len))
}
@ -110434,6 +110434,7 @@ func init() {
qt.EnumMap["widgets.QInputDialog__DoubleInput"] = int64(QInputDialog__DoubleInput)
qt.ItfMap["widgets.QItemDelegate_ITF"] = QItemDelegate{}
qt.FuncMap["widgets.NewQItemDelegate"] = NewQItemDelegate
qt.ItfMap["widgets.QItemEditorCreator_ITF"] = QItemEditorCreator{}
qt.ItfMap["widgets.QItemEditorCreatorBase_ITF"] = QItemEditorCreatorBase{}
qt.ItfMap["widgets.QItemEditorFactory_ITF"] = QItemEditorFactory{}
qt.FuncMap["widgets.NewQItemEditorFactory"] = NewQItemEditorFactory
@ -110741,6 +110742,7 @@ func init() {
qt.EnumMap["widgets.QStackedLayout__StackAll"] = int64(QStackedLayout__StackAll)
qt.ItfMap["widgets.QStackedWidget_ITF"] = QStackedWidget{}
qt.FuncMap["widgets.NewQStackedWidget"] = NewQStackedWidget
qt.ItfMap["widgets.QStandardItemEditorCreator_ITF"] = QStandardItemEditorCreator{}
qt.ItfMap["widgets.QStatusBar_ITF"] = QStatusBar{}
qt.FuncMap["widgets.NewQStatusBar"] = NewQStatusBar
qt.ItfMap["widgets.QStyle_ITF"] = QStyle{}
@ -111683,6 +111685,7 @@ func init() {
qt.EnumMap["widgets.QTreeWidgetItem__ShowIndicator"] = int64(QTreeWidgetItem__ShowIndicator)
qt.EnumMap["widgets.QTreeWidgetItem__DontShowIndicator"] = int64(QTreeWidgetItem__DontShowIndicator)
qt.EnumMap["widgets.QTreeWidgetItem__DontShowIndicatorWhenChildless"] = int64(QTreeWidgetItem__DontShowIndicatorWhenChildless)
qt.ItfMap["widgets.QTreeWidgetItemIterator_ITF"] = QTreeWidgetItemIterator{}
qt.EnumMap["widgets.QTreeWidgetItemIterator__All"] = int64(QTreeWidgetItemIterator__All)
qt.EnumMap["widgets.QTreeWidgetItemIterator__Hidden"] = int64(QTreeWidgetItemIterator__Hidden)
qt.EnumMap["widgets.QTreeWidgetItemIterator__NotHidden"] = int64(QTreeWidgetItemIterator__NotHidden)

View file

@ -26,7 +26,7 @@ func cGoUnpackBytes(s C.struct_QtXml_PackedString) []byte {
defer cGoFreePacked(s.ptr)
if int(s.len) == -1 {
gs := C.GoString(s.data)
return *(*[]byte)(unsafe.Pointer(&gs))
return []byte(gs)
}
return C.GoBytes(unsafe.Pointer(s.data), C.int(s.len))
}

View file

@ -27,7 +27,7 @@ func cGoUnpackBytes(s C.struct_QtXmlPatterns_PackedString) []byte {
defer cGoFreePacked(s.ptr)
if int(s.len) == -1 {
gs := C.GoString(s.data)
return *(*[]byte)(unsafe.Pointer(&gs))
return []byte(gs)
}
return C.GoBytes(unsafe.Pointer(s.data), C.int(s.len))
}