Merge pull request #199 from mappu/miqt-archlinux-qt69

Fixes for Arch Linux, Qt 6.9.0, and macOS Brew by splitting up Qt6Network and Qt6WebChannel packages
This commit is contained in:
mappu 2025-04-15 21:50:33 +12:00 committed by GitHub
commit 0a9b05ec3c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
48 changed files with 520 additions and 671 deletions

2
.gitignore vendored
View File

@ -41,6 +41,8 @@ examples/libraries/qt-svg/qt-svg
examples/libraries/qt-webengine/qt-webengine
examples/libraries/qt-webkit/qt-webkit
examples/libraries/qt6-multimedia/qt6-multimedia
examples/libraries/qt6-network/qt6-network
examples/libraries/qt6-network-sctp/qt6-network-sctp
examples/libraries/qt6-webengine/qt6-webengine
examples/libraries/restricted-extras-charts6/restricted-extras-charts6
examples/libraries/restricted-extras-qscintilla/restricted-extras-qscintilla

View File

@ -27,6 +27,10 @@ clean:
$(DOCKER) image rm -f miqt/genbindings:latest
rm -f $(BUILDSTAMPS)
.PHONY: clean-cache
clean-cache:
rm -f cmd/genbindings/cachedir/*.json
.PHONY: genbindings
genbindings: $(BUILDSTAMPS)
$(DOCKEREXEC) 'cd cmd/genbindings && go build && ./genbindings'

View File

@ -166,6 +166,12 @@ dnf install qt6-qtbase-devel qscintilla-qt6-devel qt6-qtcharts-devel qt6-qtmulti
# Manjaro
pamac install qt6-base qscintilla-qt6 qt6-charts qt6-multimedia qt6-svg qt6-webchannel qt6-webengine qt6-declarative go
# Arch Linux (Minimal)
pacman -S pkg-config gcc go qt6-base
# Arch Linux (Full)
pacman -S pkg-config gcc go qt6-base qscintilla-qt6 qt6-charts qt6-multimedia qt6-svg qt6-webchannel qt6-webengine qt6-declarative
```
2. Compile your application

View File

@ -200,6 +200,7 @@ func AllowClass(className string) bool {
"QPropertyBindingPrivatePtr", // Qt 6 qpropertyprivate.h. Appears in header but cannot be linked
"QDeferredDeleteEvent", // Qt 6. Hidden/undocumented class in Qt 6.4, moved to private header in Qt 6.7. Intended for test use only
"QQmlV4Function", // Qt 6. Not part of the interface
"QWebEngineQuotaRequest", // Qt 6 QWebEngine: Deprecated in Qt 6.9
"QUntypedPropertyData::InheritsQUntypedPropertyData", // qpropertyprivate.h . Hidden/undocumented class in Qt 6.4, removed in 6.7
"____last____":
@ -637,13 +638,15 @@ func ApplyQuirks(packageName, className string, mm *CppMethod) {
if mm.ReturnType.GetQtCppType().ParameterType == "Q_PID" {
// int64 on Linux, _PROCESS_INFORMATION* on Windows
mm.LinuxOnly = true
mm.RequireCpp = addr("defined(Q_OS_LINUX)")
mm.RequireGOOS = addr("linux")
}
if mm.ReturnType.GetQtCppType().ParameterType == "QSocketDescriptor::DescriptorType" ||
(len(mm.Parameters) > 0 && mm.Parameters[0].GetQtCppType().ParameterType == "QSocketDescriptor::DescriptorType") {
// uintptr_t-compatible on Linux, void* on Windows
mm.LinuxOnly = true
mm.RequireCpp = addr("defined(Q_OS_LINUX)")
mm.RequireGOOS = addr("linux")
}
if className == "QArrayData" && mm.MethodName == "needsDetach" && mm.IsConst {
@ -654,6 +657,15 @@ func ApplyQuirks(packageName, className string, mm *CppMethod) {
mm.ReturnType.BecomesConstInVersion = addr("6.9")
}
// macOS Brew does not have Qt6Network dtls functionality enabled, but we
// want these functions to exist on other platforms
// Can't block in Go-side
if (packageName == "qt6/network" || packageName == "qt/network") &&
className == "QSslConfiguration" &&
(mm.MethodName == "dtlsCookieVerificationEnabled" || mm.MethodName == "setDtlsCookieVerificationEnabled" || mm.MethodName == "defaultDtlsConfiguration" || mm.MethodName == "setDefaultDtlsConfiguration") {
mm.RequireCpp = addr("QT_CONFIG(dtls)")
}
if className == "QFileDialog" && mm.MethodName == "saveFileContent" && mm.IsStatic && len(mm.Parameters) > 1 {
// The prototype was changed from
// [Qt 5 - 6.6] void QFileDialog::saveFileContent(const QByteArray &fileContent, const QString &fileNameHint = QString())

View File

@ -8,6 +8,16 @@ import (
func ProcessLibraries(clangBin, outDir, extraLibsDir string) {
AllowAllHeaders := func(string) bool { return true }
OnlyHeaders := func(s ...string) func(fullpath string) bool {
return func(fullpath string) bool {
return slice_contains(s, filepath.Base(fullpath))
}
}
ExceptHeaders := func(s ...string) func(fullpath string) bool {
return func(fullpath string) bool {
return !slice_contains(s, filepath.Base(fullpath))
}
}
flushKnownTypes()
InsertTypedefs(false)
@ -74,12 +84,45 @@ func ProcessLibraries(clangBin, outDir, extraLibsDir string) {
ClangMatchSameHeaderDefinitionOnly,
)
// Qt 5 Network (1/3)
generate(
"qt/network",
[]string{
"/usr/include/x86_64-linux-gnu/qt5/QtNetwork",
},
AllowAllHeaders,
ExceptHeaders("qdtls.h", "qsctpserver.h", "qsctpsocket.h"),
clangBin,
pkgConfigCflags("Qt5Network"),
outDir,
ClangMatchSameHeaderDefinitionOnly,
)
// Qt 5 Network (2/3)
generate(
"qt/network/sctp",
[]string{
"/usr/include/x86_64-linux-gnu/qt5/QtNetwork",
},
OnlyHeaders("qsctpserver.h", "qsctpsocket.h"),
clangBin,
pkgConfigCflags("Qt5Network"),
outDir,
ClangMatchSameHeaderDefinitionOnly,
)
// Qt 5 Network (3/3) - split out DTLS into subpackage because macOS Brew is
// compiled with it disabled
// There are still some extra functions to move out from qsslconfiguration.h
// @ref https://github.com/mappu/miqt/issues/151
generate(
"qt/network/dtls",
[]string{
"/usr/include/x86_64-linux-gnu/qt5/QtNetwork",
},
OnlyHeaders("qdtls.h"),
clangBin,
pkgConfigCflags("Qt5Network"),
outDir,
@ -150,14 +193,7 @@ func ProcessLibraries(clangBin, outDir, extraLibsDir string) {
"/usr/include/x86_64-linux-gnu/qt5/QtWebEngineCore",
"/usr/include/x86_64-linux-gnu/qt5/QtWebEngineWidgets",
},
func(fullpath string) bool {
baseName := filepath.Base(fullpath)
if baseName == "qquickwebengineprofile.h" || baseName == "qquickwebenginescript.h" {
return false
}
return true
},
ExceptHeaders("qquickwebengineprofile.h", "qquickwebenginescript.h"),
clangBin,
pkgConfigCflags("Qt5WebEngineWidgets"),
outDir,
@ -274,16 +310,47 @@ func ProcessLibraries(clangBin, outDir, extraLibsDir string) {
ClangMatchSameHeaderDefinitionOnly,
)
// Qt 6 QtNetwork
// Qt 6 QtNetwork (1/3)
generate(
"qt6/network",
[]string{
"/usr/include/x86_64-linux-gnu/qt6/QtNetwork",
},
func(fullpath string) bool {
fname := filepath.Base(fullpath)
return fname != "qtnetwork-config.h"
ExceptHeaders("qtnetwork-config.h", "qsctpserver.h", "qsctpsocket.h", "qdtls.h"),
clangBin,
"--std=c++17 "+pkgConfigCflags("Qt6Network"),
outDir,
ClangMatchSameHeaderDefinitionOnly,
)
// Qt 6 Network (2/3) - split out SCTP into subpackage because Arch Linux is
// compiled with it disabled
// @ref https://github.com/mappu/miqt/issues/150
// @ref https://github.com/mappu/miqt/issues/194
generate(
"qt6/network/sctp",
[]string{
"/usr/include/x86_64-linux-gnu/qt6/QtNetwork",
},
OnlyHeaders("qsctpserver.h", "qsctpsocket.h"),
clangBin,
"--std=c++17 "+pkgConfigCflags("Qt6Network"),
outDir,
ClangMatchSameHeaderDefinitionOnly,
)
// Qt 6 Network (3/3) - split out DTLS into subpackage because macOS Brew is
// compiled with it disabled
// There are still some extra functions to move out from qsslconfiguration.h
// @ref https://github.com/mappu/miqt/issues/151
generate(
"qt6/network/dtls",
[]string{
"/usr/include/x86_64-linux-gnu/qt6/QtNetwork",
},
OnlyHeaders("qdtls.h"),
clangBin,
"--std=c++17 "+pkgConfigCflags("Qt6Network"),
outDir,
@ -317,13 +384,30 @@ func ProcessLibraries(clangBin, outDir, extraLibsDir string) {
ClangMatchSameHeaderDefinitionOnly,
)
// Qt 6 QWebChannel
// Qt 6 QWebChannel (1/2)
// Exclude qqmlwebchannel because Arch Linux packages it differently
// @ref https://github.com/mappu/miqt/issues/150
// @ref https://github.com/mappu/miqt/issues/194
generate(
"qt6/webchannel",
[]string{
"/usr/include/x86_64-linux-gnu/qt6/QtWebChannel",
},
AllowAllHeaders,
ExceptHeaders("qqmlwebchannel.h"),
clangBin,
"--std=c++17 "+pkgConfigCflags("Qt6WebChannel"),
outDir,
ClangMatchSameHeaderDefinitionOnly,
)
// Qt 6 WebChannel (2/2)
// Just the Qt Quick part of qqmlwebchannel
generate(
"qt6/webchannel/qmlwebchannel",
[]string{
"/usr/include/x86_64-linux-gnu/qt6/QtWebChannel",
},
OnlyHeaders("qqmlwebchannel.h"),
clangBin,
"--std=c++17 "+pkgConfigCflags("Qt6WebChannel"),
outDir,

View File

@ -771,11 +771,7 @@ func emitBindingHeader(src *CppParsedHeader, filename string, packageName string
includeGuard := "MIQT_" + strings.ToUpper(strings.Replace(strings.Replace(packageName, `/`, `_`, -1), `-`, `_`, -1)) + "_GEN_" + strings.ToUpper(strings.Replace(strings.Replace(filename, `.`, `_`, -1), `-`, `_`, -1))
bindingInclude := "../libmiqt/libmiqt.h"
if strings.Contains(packageName, `/`) {
bindingInclude = "../" + bindingInclude
}
bindingInclude := strings.Repeat(`../`, strings.Count(packageName, `/`)) + "../libmiqt/libmiqt.h"
ret.WriteString(`#pragma once
#ifndef ` + includeGuard + `
@ -1160,11 +1156,9 @@ extern "C" {
cabiClassName(c.ClassName) + "* " + cabiNewName(c, i) + "(" + emitParametersCabiConstructor(&c, &ctor) + ") {\n",
)
if ctor.LinuxOnly {
if ctor.RequireCpp != nil {
ret.WriteString(
"#ifndef Q_OS_LINUX\n" +
"\treturn nullptr;\n" +
"#else\n",
"#if " + *ctor.RequireCpp + "\n",
)
}
@ -1173,9 +1167,11 @@ extern "C" {
"\treturn new " + cppClassName + "(" + forwarding + ");\n",
)
if ctor.LinuxOnly {
if ctor.RequireCpp != nil {
ret.WriteString(
"#endif\n",
"#else\n" +
"\treturn nullptr;\n" +
"#endif\n",
)
}
@ -1236,22 +1232,29 @@ extern "C" {
callTarget = "(*self " + operator + " " + forwarding + ")"
}
if m.LinuxOnly {
if m.RequireCpp != nil {
var unavailableRetn string
if retnCabi := m.ReturnType.RenderTypeCabi(); retnCabi == "void" {
unavailableRetn = "\treturn;\n"
} else {
unavailableRetn = "\t" + retnCabi + " _ret_unavailable;\n" +
"\treturn _ret_unavailable;\n"
}
ret.WriteString(fmt.Sprintf(
"%s %s_%s(%s) {\n"+
"#ifdef Q_OS_LINUX\n"+
"#if "+*m.RequireCpp+"\n"+
"%s"+
"%s"+
"#else\n"+
"\t%s _ret_invalidOS;\n"+
"\treturn _ret_invalidOS;\n"+
"%s"+
"#endif\n"+
"}\n"+
"\n",
m.ReturnType.RenderTypeCabi(), methodPrefixName, m.SafeMethodName(), emitParametersCabi(m, ifv(m.IsConst, "const ", "")+methodPrefixName+"*"),
preamble,
emitAssignCppToCabi("\treturn ", m.ReturnType, callTarget),
m.ReturnType.RenderTypeCabi(),
unavailableRetn,
))
} else if m.BecomesNonConstInVersion != nil {

View File

@ -899,10 +899,10 @@ import "C"
`,
)
if ctor.LinuxOnly {
if ctor.RequireGOOS != nil {
gfs.imports["runtime"] = struct{}{}
ret.WriteString(`
if runtime.GOOS != "linux" {
if runtime.GOOS != "` + *ctor.RequireGOOS + `" {
panic("Unsupported OS")
}
`)
@ -941,10 +941,10 @@ import "C"
ret.WriteString(`
func ` + receiverAndMethod + `(` + gfs.emitParametersGo(m.Parameters) + `) ` + returnTypeDecl + ` {`)
if m.LinuxOnly {
if m.RequireGOOS != nil {
gfs.imports["runtime"] = struct{}{}
ret.WriteString(`
if runtime.GOOS != "linux" {
if runtime.GOOS != "` + *m.RequireGOOS + `" {
panic("Unsupported OS")
}
`)

View File

@ -254,7 +254,8 @@ type CppMethod struct {
HiddenParams []CppParameter // Populated if there is an overload with more parameters
// Special quirks
LinuxOnly bool
RequireGOOS *string // constructs a `if runtime.GOOS = {foo}` block in the Go side, no effect on CABI / C++ sides
RequireCpp *string // constructs a `#if {foo}` preprocessor block in the C++ side, no effect on Go / CABI sides
BecomesNonConstInVersion *string // "6,7"
}

View File

@ -53,4 +53,13 @@ func slice_copy[T comparable](input []T) []T {
ret[i] = elem
}
return ret
}
}
func slice_contains[T comparable](input []T, search T) bool {
for _, elem := range input {
if elem == search {
return true
}
}
return false // not found
}

View File

@ -0,0 +1,69 @@
package main
import (
"log"
"os"
qt "github.com/mappu/miqt/qt6"
"github.com/mappu/miqt/qt6/network"
"github.com/mappu/miqt/qt6/network/sctp"
)
func main() {
qt.NewQApplication(os.Args)
// Set up server
// `````````````
localAddr := network.NewQHostAddress7(network.QHostAddress__LocalHost)
srv := sctp.NewQSctpServer()
if !srv.ListenWithAddress(localAddr) {
log.Fatal("SCTP server: Listen failure")
}
srv.OnNewConnection(func() {
log.Println("SCTP server: got connection")
recv := srv.NextPendingDatagramConnection() // QSctpSocket
recv.OnChannelReadyRead(func(channel int) {
dg := recv.ReadDatagram()
log.Printf("SCTP server: channel %v: received message %q", channel, string(dg.Data()))
// Success, experiment over
os.Exit(0)
})
})
localPort := srv.ServerPort()
// Set up client
// `````````````
c := sctp.NewQSctpSocket()
c.OnErrorOccurred(func(param1 network.QAbstractSocket__SocketError) {
log.Println("SCTP client: error")
})
c.OnConnected(func() {
log.Println("SCTP client: connected, sending message...")
dg := network.NewQNetworkDatagram2([]byte("i am the client sending a message"))
ok := c.WriteDatagram(dg)
if !ok {
log.Fatalf("WriteDatagram failure")
}
log.Println("SCTP client: message sent OK")
})
log.Println("SCTP client: connecting...")
c.ConnectToHost2(localAddr, localPort)
// Blocking event loop
// ```````````````````
qt.QApplication_Exec()
}

View File

@ -0,0 +1,38 @@
package main
import (
"log"
"os"
qt "github.com/mappu/miqt/qt6"
"github.com/mappu/miqt/qt6/network"
)
func main() {
qt.NewQApplication(os.Args)
log.Printf("Looking up DNS info, please wait...")
dns := network.NewQDnsLookup2(network.QDnsLookup__A, "google.com")
dns.OnFinished(func() {
dns.DeleteLater()
if dns.Error() != network.QDnsLookup__NoError {
log.Printf("An error occurred: %v", dns.ErrorString())
return
}
results := dns.HostAddressRecords() // CanonicalNameRecords, TextRecords, ServiceRecords, ...
log.Printf("Found %d result(s).", len(results))
for _, record := range results {
log.Printf("- %s", record.Value().ToString())
}
qt.QCoreApplication_Exit()
})
dns.Lookup()
qt.QApplication_Exec()
}

View File

@ -883,12 +883,12 @@ int QProcess_state(const QProcess* self) {
}
long long QProcess_pid(const QProcess* self) {
#ifdef Q_OS_LINUX
#if defined(Q_OS_LINUX)
Q_PID _ret = self->pid();
return static_cast<long long>(_ret);
#else
long long _ret_invalidOS;
return _ret_invalidOS;
long long _ret_unavailable;
return _ret_unavailable;
#endif
}

View File

@ -451,10 +451,10 @@ void QSocketNotifier_delete(QSocketNotifier* self) {
}
QSocketDescriptor* QSocketDescriptor_new() {
#ifndef Q_OS_LINUX
return nullptr;
#else
#if defined(Q_OS_LINUX)
return new QSocketDescriptor();
#else
return nullptr;
#endif
}
@ -463,20 +463,20 @@ QSocketDescriptor* QSocketDescriptor_new2(QSocketDescriptor* param1) {
}
QSocketDescriptor* QSocketDescriptor_new3(int descriptor) {
#ifndef Q_OS_LINUX
return nullptr;
#else
#if defined(Q_OS_LINUX)
return new QSocketDescriptor(static_cast<QSocketDescriptor::DescriptorType>(descriptor));
#else
return nullptr;
#endif
}
int QSocketDescriptor_ToInt(const QSocketDescriptor* self) {
#ifdef Q_OS_LINUX
#if defined(Q_OS_LINUX)
QSocketDescriptor::DescriptorType _ret = self->operator int();
return static_cast<int>(_ret);
#else
int _ret_invalidOS;
return _ret_invalidOS;
int _ret_unavailable;
return _ret_unavailable;
#endif
}

View File

@ -0,0 +1,8 @@
package dtls
/*
#cgo CXXFLAGS: -std=c++11
#cgo CFLAGS: -std=gnu11
#cgo pkg-config: Qt5Network
*/
import "C"

View File

@ -1,4 +1,4 @@
package network
package dtls
/*
@ -10,6 +10,7 @@ import "C"
import (
"github.com/mappu/miqt/qt"
"github.com/mappu/miqt/qt/network"
"runtime"
"runtime/cgo"
"unsafe"
@ -124,7 +125,7 @@ func (this *QDtlsClientVerifier) CookieGeneratorParameters() *QDtlsClientVerifie
return _goptr
}
func (this *QDtlsClientVerifier) VerifyClient(socket *QUdpSocket, dgram []byte, address *QHostAddress, port uint16) bool {
func (this *QDtlsClientVerifier) VerifyClient(socket *network.QUdpSocket, dgram []byte, address *network.QHostAddress, port uint16) bool {
dgram_alias := C.struct_miqt_string{}
if len(dgram) > 0 {
dgram_alias.data = (*C.char)(unsafe.Pointer(&dgram[0]))
@ -132,7 +133,7 @@ func (this *QDtlsClientVerifier) VerifyClient(socket *QUdpSocket, dgram []byte,
dgram_alias.data = (*C.char)(unsafe.Pointer(nil))
}
dgram_alias.len = C.size_t(len(dgram))
return (bool)(C.QDtlsClientVerifier_verifyClient(this.h, socket.cPointer(), dgram_alias, address.cPointer(), (C.ushort)(port)))
return (bool)(C.QDtlsClientVerifier_verifyClient(this.h, (*C.QUdpSocket)(socket.UnsafePointer()), dgram_alias, (*C.QHostAddress)(address.UnsafePointer()), (C.ushort)(port)))
}
func (this *QDtlsClientVerifier) VerifiedHello() []byte {
@ -494,13 +495,13 @@ func UnsafeNewQDtls(h unsafe.Pointer) *QDtls {
}
// NewQDtls constructs a new QDtls object.
func NewQDtls(mode QSslSocket__SslMode) *QDtls {
func NewQDtls(mode network.QSslSocket__SslMode) *QDtls {
return newQDtls(C.QDtls_new((C.int)(mode)))
}
// NewQDtls2 constructs a new QDtls object.
func NewQDtls2(mode QSslSocket__SslMode, parent *qt.QObject) *QDtls {
func NewQDtls2(mode network.QSslSocket__SslMode, parent *qt.QObject) *QDtls {
return newQDtls(C.QDtls_new2((C.int)(mode), (*C.QObject)(parent.UnsafePointer())))
}
@ -533,8 +534,8 @@ func QDtls_TrUtf8(s string) string {
return _ret
}
func (this *QDtls) SetPeer(address *QHostAddress, port uint16) bool {
return (bool)(C.QDtls_setPeer(this.h, address.cPointer(), (C.ushort)(port)))
func (this *QDtls) SetPeer(address *network.QHostAddress, port uint16) bool {
return (bool)(C.QDtls_setPeer(this.h, (*C.QHostAddress)(address.UnsafePointer()), (C.ushort)(port)))
}
func (this *QDtls) SetPeerVerificationName(name string) bool {
@ -545,8 +546,8 @@ func (this *QDtls) SetPeerVerificationName(name string) bool {
return (bool)(C.QDtls_setPeerVerificationName(this.h, name_ms))
}
func (this *QDtls) PeerAddress() *QHostAddress {
_goptr := newQHostAddress(C.QDtls_peerAddress(this.h))
func (this *QDtls) PeerAddress() *network.QHostAddress {
_goptr := network.UnsafeNewQHostAddress(unsafe.Pointer(C.QDtls_peerAddress(this.h)))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
@ -562,8 +563,8 @@ func (this *QDtls) PeerVerificationName() string {
return _ret
}
func (this *QDtls) SslMode() QSslSocket__SslMode {
return (QSslSocket__SslMode)(C.QDtls_sslMode(this.h))
func (this *QDtls) SslMode() network.QSslSocket__SslMode {
return (network.QSslSocket__SslMode)(C.QDtls_sslMode(this.h))
}
func (this *QDtls) SetMtuHint(mtuHint uint16) {
@ -584,12 +585,12 @@ func (this *QDtls) CookieGeneratorParameters() *QDtlsClientVerifier__GeneratorPa
return _goptr
}
func (this *QDtls) SetDtlsConfiguration(configuration *QSslConfiguration) bool {
return (bool)(C.QDtls_setDtlsConfiguration(this.h, configuration.cPointer()))
func (this *QDtls) SetDtlsConfiguration(configuration *network.QSslConfiguration) bool {
return (bool)(C.QDtls_setDtlsConfiguration(this.h, (*C.QSslConfiguration)(configuration.UnsafePointer())))
}
func (this *QDtls) DtlsConfiguration() *QSslConfiguration {
_goptr := newQSslConfiguration(C.QDtls_dtlsConfiguration(this.h))
func (this *QDtls) DtlsConfiguration() *network.QSslConfiguration {
_goptr := network.UnsafeNewQSslConfiguration(unsafe.Pointer(C.QDtls_dtlsConfiguration(this.h)))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
@ -598,41 +599,41 @@ func (this *QDtls) HandshakeState() QDtls__HandshakeState {
return (QDtls__HandshakeState)(C.QDtls_handshakeState(this.h))
}
func (this *QDtls) DoHandshake(socket *QUdpSocket) bool {
return (bool)(C.QDtls_doHandshake(this.h, socket.cPointer()))
func (this *QDtls) DoHandshake(socket *network.QUdpSocket) bool {
return (bool)(C.QDtls_doHandshake(this.h, (*C.QUdpSocket)(socket.UnsafePointer())))
}
func (this *QDtls) HandleTimeout(socket *QUdpSocket) bool {
return (bool)(C.QDtls_handleTimeout(this.h, socket.cPointer()))
func (this *QDtls) HandleTimeout(socket *network.QUdpSocket) bool {
return (bool)(C.QDtls_handleTimeout(this.h, (*C.QUdpSocket)(socket.UnsafePointer())))
}
func (this *QDtls) ResumeHandshake(socket *QUdpSocket) bool {
return (bool)(C.QDtls_resumeHandshake(this.h, socket.cPointer()))
func (this *QDtls) ResumeHandshake(socket *network.QUdpSocket) bool {
return (bool)(C.QDtls_resumeHandshake(this.h, (*C.QUdpSocket)(socket.UnsafePointer())))
}
func (this *QDtls) AbortHandshake(socket *QUdpSocket) bool {
return (bool)(C.QDtls_abortHandshake(this.h, socket.cPointer()))
func (this *QDtls) AbortHandshake(socket *network.QUdpSocket) bool {
return (bool)(C.QDtls_abortHandshake(this.h, (*C.QUdpSocket)(socket.UnsafePointer())))
}
func (this *QDtls) Shutdown(socket *QUdpSocket) bool {
return (bool)(C.QDtls_shutdown(this.h, socket.cPointer()))
func (this *QDtls) Shutdown(socket *network.QUdpSocket) bool {
return (bool)(C.QDtls_shutdown(this.h, (*C.QUdpSocket)(socket.UnsafePointer())))
}
func (this *QDtls) IsConnectionEncrypted() bool {
return (bool)(C.QDtls_isConnectionEncrypted(this.h))
}
func (this *QDtls) SessionCipher() *QSslCipher {
_goptr := newQSslCipher(C.QDtls_sessionCipher(this.h))
func (this *QDtls) SessionCipher() *network.QSslCipher {
_goptr := network.UnsafeNewQSslCipher(unsafe.Pointer(C.QDtls_sessionCipher(this.h)))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QDtls) SessionProtocol() QSsl__SslProtocol {
return (QSsl__SslProtocol)(C.QDtls_sessionProtocol(this.h))
func (this *QDtls) SessionProtocol() network.QSsl__SslProtocol {
return (network.QSsl__SslProtocol)(C.QDtls_sessionProtocol(this.h))
}
func (this *QDtls) WriteDatagramEncrypted(socket *QUdpSocket, dgram []byte) int64 {
func (this *QDtls) WriteDatagramEncrypted(socket *network.QUdpSocket, dgram []byte) int64 {
dgram_alias := C.struct_miqt_string{}
if len(dgram) > 0 {
dgram_alias.data = (*C.char)(unsafe.Pointer(&dgram[0]))
@ -640,10 +641,10 @@ func (this *QDtls) WriteDatagramEncrypted(socket *QUdpSocket, dgram []byte) int6
dgram_alias.data = (*C.char)(unsafe.Pointer(nil))
}
dgram_alias.len = C.size_t(len(dgram))
return (int64)(C.QDtls_writeDatagramEncrypted(this.h, socket.cPointer(), dgram_alias))
return (int64)(C.QDtls_writeDatagramEncrypted(this.h, (*C.QUdpSocket)(socket.UnsafePointer()), dgram_alias))
}
func (this *QDtls) DecryptDatagram(socket *QUdpSocket, dgram []byte) []byte {
func (this *QDtls) DecryptDatagram(socket *network.QUdpSocket, dgram []byte) []byte {
dgram_alias := C.struct_miqt_string{}
if len(dgram) > 0 {
dgram_alias.data = (*C.char)(unsafe.Pointer(&dgram[0]))
@ -651,7 +652,7 @@ func (this *QDtls) DecryptDatagram(socket *QUdpSocket, dgram []byte) []byte {
dgram_alias.data = (*C.char)(unsafe.Pointer(nil))
}
dgram_alias.len = C.size_t(len(dgram))
var _bytearray C.struct_miqt_string = C.QDtls_decryptDatagram(this.h, socket.cPointer(), dgram_alias)
var _bytearray C.struct_miqt_string = C.QDtls_decryptDatagram(this.h, (*C.QUdpSocket)(socket.UnsafePointer()), dgram_alias)
_ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len)))
C.free(unsafe.Pointer(_bytearray.data))
return _ret
@ -668,44 +669,44 @@ func (this *QDtls) DtlsErrorString() string {
return _ret
}
func (this *QDtls) PeerVerificationErrors() []QSslError {
func (this *QDtls) PeerVerificationErrors() []network.QSslError {
var _ma C.struct_miqt_array = C.QDtls_peerVerificationErrors(this.h)
_ret := make([]QSslError, int(_ma.len))
_ret := make([]network.QSslError, int(_ma.len))
_outCast := (*[0xffff]*C.QSslError)(unsafe.Pointer(_ma.data)) // hey ya
for i := 0; i < int(_ma.len); i++ {
_vv_goptr := newQSslError(_outCast[i])
_vv_goptr := network.UnsafeNewQSslError(unsafe.Pointer(_outCast[i]))
_vv_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
_ret[i] = *_vv_goptr
}
return _ret
}
func (this *QDtls) IgnoreVerificationErrors(errorsToIgnore []QSslError) {
func (this *QDtls) IgnoreVerificationErrors(errorsToIgnore []network.QSslError) {
errorsToIgnore_CArray := (*[0xffff]*C.QSslError)(C.malloc(C.size_t(8 * len(errorsToIgnore))))
defer C.free(unsafe.Pointer(errorsToIgnore_CArray))
for i := range errorsToIgnore {
errorsToIgnore_CArray[i] = errorsToIgnore[i].cPointer()
errorsToIgnore_CArray[i] = (*C.QSslError)(errorsToIgnore[i].UnsafePointer())
}
errorsToIgnore_ma := C.struct_miqt_array{len: C.size_t(len(errorsToIgnore)), data: unsafe.Pointer(errorsToIgnore_CArray)}
C.QDtls_ignoreVerificationErrors(this.h, errorsToIgnore_ma)
}
func (this *QDtls) PskRequired(authenticator *QSslPreSharedKeyAuthenticator) {
C.QDtls_pskRequired(this.h, authenticator.cPointer())
func (this *QDtls) PskRequired(authenticator *network.QSslPreSharedKeyAuthenticator) {
C.QDtls_pskRequired(this.h, (*C.QSslPreSharedKeyAuthenticator)(authenticator.UnsafePointer()))
}
func (this *QDtls) OnPskRequired(slot func(authenticator *QSslPreSharedKeyAuthenticator)) {
func (this *QDtls) OnPskRequired(slot func(authenticator *network.QSslPreSharedKeyAuthenticator)) {
C.QDtls_connect_pskRequired(this.h, C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QDtls_pskRequired
func miqt_exec_callback_QDtls_pskRequired(cb C.intptr_t, authenticator *C.QSslPreSharedKeyAuthenticator) {
gofunc, ok := cgo.Handle(cb).Value().(func(authenticator *QSslPreSharedKeyAuthenticator))
gofunc, ok := cgo.Handle(cb).Value().(func(authenticator *network.QSslPreSharedKeyAuthenticator))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := newQSslPreSharedKeyAuthenticator(authenticator)
slotval1 := network.UnsafeNewQSslPreSharedKeyAuthenticator(unsafe.Pointer(authenticator))
gofunc(slotval1)
}
@ -771,15 +772,15 @@ func QDtls_TrUtf83(s string, c string, n int) string {
return _ret
}
func (this *QDtls) SetPeer2(address *QHostAddress, port uint16, verificationName string) bool {
func (this *QDtls) SetPeer2(address *network.QHostAddress, port uint16, verificationName string) bool {
verificationName_ms := C.struct_miqt_string{}
verificationName_ms.data = C.CString(verificationName)
verificationName_ms.len = C.size_t(len(verificationName))
defer C.free(unsafe.Pointer(verificationName_ms.data))
return (bool)(C.QDtls_setPeer2(this.h, address.cPointer(), (C.ushort)(port), verificationName_ms))
return (bool)(C.QDtls_setPeer2(this.h, (*C.QHostAddress)(address.UnsafePointer()), (C.ushort)(port), verificationName_ms))
}
func (this *QDtls) DoHandshake2(socket *QUdpSocket, dgram []byte) bool {
func (this *QDtls) DoHandshake2(socket *network.QUdpSocket, dgram []byte) bool {
dgram_alias := C.struct_miqt_string{}
if len(dgram) > 0 {
dgram_alias.data = (*C.char)(unsafe.Pointer(&dgram[0]))
@ -787,7 +788,7 @@ func (this *QDtls) DoHandshake2(socket *QUdpSocket, dgram []byte) bool {
dgram_alias.data = (*C.char)(unsafe.Pointer(nil))
}
dgram_alias.len = C.size_t(len(dgram))
return (bool)(C.QDtls_doHandshake2(this.h, socket.cPointer(), dgram_alias))
return (bool)(C.QDtls_doHandshake2(this.h, (*C.QUdpSocket)(socket.UnsafePointer()), dgram_alias))
}
// Sender can only be called from a QDtls that was directly constructed.

View File

@ -1,6 +1,6 @@
#pragma once
#ifndef MIQT_QT_NETWORK_GEN_QDTLS_H
#define MIQT_QT_NETWORK_GEN_QDTLS_H
#ifndef MIQT_QT_NETWORK_DTLS_GEN_QDTLS_H
#define MIQT_QT_NETWORK_DTLS_GEN_QDTLS_H
#include <stdbool.h>
#include <stddef.h>
@ -8,7 +8,7 @@
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#include "../../libmiqt/libmiqt.h"
#include "../../../libmiqt/libmiqt.h"
#ifdef __cplusplus
extern "C" {

View File

@ -338,19 +338,37 @@ void QSslConfiguration_setDefaultConfiguration(QSslConfiguration* configuration)
}
bool QSslConfiguration_dtlsCookieVerificationEnabled(const QSslConfiguration* self) {
#if QT_CONFIG(dtls)
return self->dtlsCookieVerificationEnabled();
#else
bool _ret_unavailable;
return _ret_unavailable;
#endif
}
void QSslConfiguration_setDtlsCookieVerificationEnabled(QSslConfiguration* self, bool enable) {
#if QT_CONFIG(dtls)
self->setDtlsCookieVerificationEnabled(enable);
#else
return;
#endif
}
QSslConfiguration* QSslConfiguration_defaultDtlsConfiguration() {
#if QT_CONFIG(dtls)
return new QSslConfiguration(QSslConfiguration::defaultDtlsConfiguration());
#else
QSslConfiguration* _ret_unavailable;
return _ret_unavailable;
#endif
}
void QSslConfiguration_setDefaultDtlsConfiguration(QSslConfiguration* configuration) {
#if QT_CONFIG(dtls)
QSslConfiguration::setDefaultDtlsConfiguration(*configuration);
#else
return;
#endif
}
void QSslConfiguration_setOcspStaplingEnabled(QSslConfiguration* self, bool enable) {

View File

@ -0,0 +1,8 @@
package sctp
/*
#cgo CXXFLAGS: -std=c++11
#cgo CFLAGS: -std=gnu11
#cgo pkg-config: Qt5Network
*/
import "C"

View File

@ -29,7 +29,6 @@
#include <QWebEngineHttpRequest>
#include <QWebEnginePage>
#include <QWebEngineProfile>
#include <QWebEngineQuotaRequest>
#include <QWebEngineRegisterProtocolHandlerRequest>
#include <QWebEngineScriptCollection>
#include <QWebEngineSettings>
@ -52,7 +51,6 @@ void miqt_exec_callback_QWebEnginePage_windowCloseRequested(intptr_t);
void miqt_exec_callback_QWebEnginePage_featurePermissionRequested(intptr_t, QUrl*, int);
void miqt_exec_callback_QWebEnginePage_featurePermissionRequestCanceled(intptr_t, QUrl*, int);
void miqt_exec_callback_QWebEnginePage_fullScreenRequested(intptr_t, QWebEngineFullScreenRequest*);
void miqt_exec_callback_QWebEnginePage_quotaRequested(intptr_t, QWebEngineQuotaRequest*);
void miqt_exec_callback_QWebEnginePage_registerProtocolHandlerRequested(intptr_t, QWebEngineRegisterProtocolHandlerRequest*);
void miqt_exec_callback_QWebEnginePage_selectClientCertificate(intptr_t, QWebEngineClientCertificateSelection*);
void miqt_exec_callback_QWebEnginePage_authenticationRequired(intptr_t, QUrl*, QAuthenticator*);
@ -903,17 +901,6 @@ void QWebEnginePage_connect_fullScreenRequested(QWebEnginePage* self, intptr_t s
});
}
void QWebEnginePage_quotaRequested(QWebEnginePage* self, QWebEngineQuotaRequest* quotaRequest) {
self->quotaRequested(*quotaRequest);
}
void QWebEnginePage_connect_quotaRequested(QWebEnginePage* self, intptr_t slot) {
MiqtVirtualQWebEnginePage::connect(self, static_cast<void (QWebEnginePage::*)(QWebEngineQuotaRequest)>(&QWebEnginePage::quotaRequested), self, [=](QWebEngineQuotaRequest quotaRequest) {
QWebEngineQuotaRequest* sigval1 = new QWebEngineQuotaRequest(quotaRequest);
miqt_exec_callback_QWebEnginePage_quotaRequested(slot, sigval1);
});
}
void QWebEnginePage_registerProtocolHandlerRequested(QWebEnginePage* self, QWebEngineRegisterProtocolHandlerRequest* request) {
self->registerProtocolHandlerRequested(*request);
}

View File

@ -713,28 +713,6 @@ func miqt_exec_callback_QWebEnginePage_fullScreenRequested(cb C.intptr_t, fullSc
gofunc(slotval1)
}
func (this *QWebEnginePage) QuotaRequested(quotaRequest QWebEngineQuotaRequest) {
C.QWebEnginePage_quotaRequested(this.h, quotaRequest.cPointer())
}
func (this *QWebEnginePage) OnQuotaRequested(slot func(quotaRequest QWebEngineQuotaRequest)) {
C.QWebEnginePage_connect_quotaRequested(this.h, C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QWebEnginePage_quotaRequested
func miqt_exec_callback_QWebEnginePage_quotaRequested(cb C.intptr_t, quotaRequest *C.QWebEngineQuotaRequest) {
gofunc, ok := cgo.Handle(cb).Value().(func(quotaRequest QWebEngineQuotaRequest))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
quotaRequest_goptr := newQWebEngineQuotaRequest(quotaRequest)
quotaRequest_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
slotval1 := *quotaRequest_goptr
gofunc(slotval1)
}
func (this *QWebEnginePage) RegisterProtocolHandlerRequested(request QWebEngineRegisterProtocolHandlerRequest) {
C.QWebEnginePage_registerProtocolHandlerRequested(this.h, request.cPointer())
}

View File

@ -41,7 +41,6 @@ class QWebEngineHistory;
class QWebEngineHttpRequest;
class QWebEnginePage;
class QWebEngineProfile;
class QWebEngineQuotaRequest;
class QWebEngineRegisterProtocolHandlerRequest;
class QWebEngineScriptCollection;
class QWebEngineSettings;
@ -74,7 +73,6 @@ typedef struct QWebEngineHistory QWebEngineHistory;
typedef struct QWebEngineHttpRequest QWebEngineHttpRequest;
typedef struct QWebEnginePage QWebEnginePage;
typedef struct QWebEngineProfile QWebEngineProfile;
typedef struct QWebEngineQuotaRequest QWebEngineQuotaRequest;
typedef struct QWebEngineRegisterProtocolHandlerRequest QWebEngineRegisterProtocolHandlerRequest;
typedef struct QWebEngineScriptCollection QWebEngineScriptCollection;
typedef struct QWebEngineSettings QWebEngineSettings;
@ -165,8 +163,6 @@ void QWebEnginePage_featurePermissionRequestCanceled(QWebEnginePage* self, QUrl*
void QWebEnginePage_connect_featurePermissionRequestCanceled(QWebEnginePage* self, intptr_t slot);
void QWebEnginePage_fullScreenRequested(QWebEnginePage* self, QWebEngineFullScreenRequest* fullScreenRequest);
void QWebEnginePage_connect_fullScreenRequested(QWebEnginePage* self, intptr_t slot);
void QWebEnginePage_quotaRequested(QWebEnginePage* self, QWebEngineQuotaRequest* quotaRequest);
void QWebEnginePage_connect_quotaRequested(QWebEnginePage* self, intptr_t slot);
void QWebEnginePage_registerProtocolHandlerRequested(QWebEnginePage* self, QWebEngineRegisterProtocolHandlerRequest* request);
void QWebEnginePage_connect_registerProtocolHandlerRequested(QWebEnginePage* self, intptr_t slot);
void QWebEnginePage_selectClientCertificate(QWebEnginePage* self, QWebEngineClientCertificateSelection* clientCertSelection);

View File

@ -1,50 +0,0 @@
#include <QUrl>
#include <QWebEngineQuotaRequest>
#include <qwebenginequotarequest.h>
#include "gen_qwebenginequotarequest.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
} /* extern C */
#endif
QWebEngineQuotaRequest* QWebEngineQuotaRequest_new() {
return new QWebEngineQuotaRequest();
}
QWebEngineQuotaRequest* QWebEngineQuotaRequest_new2(QWebEngineQuotaRequest* param1) {
return new QWebEngineQuotaRequest(*param1);
}
void QWebEngineQuotaRequest_accept(QWebEngineQuotaRequest* self) {
self->accept();
}
void QWebEngineQuotaRequest_reject(QWebEngineQuotaRequest* self) {
self->reject();
}
QUrl* QWebEngineQuotaRequest_origin(const QWebEngineQuotaRequest* self) {
return new QUrl(self->origin());
}
long long QWebEngineQuotaRequest_requestedSize(const QWebEngineQuotaRequest* self) {
qint64 _ret = self->requestedSize();
return static_cast<long long>(_ret);
}
bool QWebEngineQuotaRequest_operatorEqual(const QWebEngineQuotaRequest* self, QWebEngineQuotaRequest* that) {
return (*self == *that);
}
bool QWebEngineQuotaRequest_operatorNotEqual(const QWebEngineQuotaRequest* self, QWebEngineQuotaRequest* that) {
return (*self != *that);
}
void QWebEngineQuotaRequest_delete(QWebEngineQuotaRequest* self) {
delete self;
}

View File

@ -1,99 +0,0 @@
package webengine
/*
#include "gen_qwebenginequotarequest.h"
#include <stdlib.h>
*/
import "C"
import (
"github.com/mappu/miqt/qt"
"runtime"
"unsafe"
)
type QWebEngineQuotaRequest struct {
h *C.QWebEngineQuotaRequest
}
func (this *QWebEngineQuotaRequest) cPointer() *C.QWebEngineQuotaRequest {
if this == nil {
return nil
}
return this.h
}
func (this *QWebEngineQuotaRequest) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
// newQWebEngineQuotaRequest constructs the type using only CGO pointers.
func newQWebEngineQuotaRequest(h *C.QWebEngineQuotaRequest) *QWebEngineQuotaRequest {
if h == nil {
return nil
}
return &QWebEngineQuotaRequest{h: h}
}
// UnsafeNewQWebEngineQuotaRequest constructs the type using only unsafe pointers.
func UnsafeNewQWebEngineQuotaRequest(h unsafe.Pointer) *QWebEngineQuotaRequest {
return newQWebEngineQuotaRequest((*C.QWebEngineQuotaRequest)(h))
}
// NewQWebEngineQuotaRequest constructs a new QWebEngineQuotaRequest object.
func NewQWebEngineQuotaRequest() *QWebEngineQuotaRequest {
return newQWebEngineQuotaRequest(C.QWebEngineQuotaRequest_new())
}
// NewQWebEngineQuotaRequest2 constructs a new QWebEngineQuotaRequest object.
func NewQWebEngineQuotaRequest2(param1 *QWebEngineQuotaRequest) *QWebEngineQuotaRequest {
return newQWebEngineQuotaRequest(C.QWebEngineQuotaRequest_new2(param1.cPointer()))
}
func (this *QWebEngineQuotaRequest) Accept() {
C.QWebEngineQuotaRequest_accept(this.h)
}
func (this *QWebEngineQuotaRequest) Reject() {
C.QWebEngineQuotaRequest_reject(this.h)
}
func (this *QWebEngineQuotaRequest) Origin() *qt.QUrl {
_goptr := qt.UnsafeNewQUrl(unsafe.Pointer(C.QWebEngineQuotaRequest_origin(this.h)))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QWebEngineQuotaRequest) RequestedSize() int64 {
return (int64)(C.QWebEngineQuotaRequest_requestedSize(this.h))
}
func (this *QWebEngineQuotaRequest) OperatorEqual(that *QWebEngineQuotaRequest) bool {
return (bool)(C.QWebEngineQuotaRequest_operatorEqual(this.h, that.cPointer()))
}
func (this *QWebEngineQuotaRequest) OperatorNotEqual(that *QWebEngineQuotaRequest) bool {
return (bool)(C.QWebEngineQuotaRequest_operatorNotEqual(this.h, that.cPointer()))
}
// Delete this object from C++ memory.
func (this *QWebEngineQuotaRequest) Delete() {
C.QWebEngineQuotaRequest_delete(this.h)
}
// GoGC adds a Go Finalizer to this pointer, so that it will be deleted
// from C++ memory once it is unreachable from Go memory.
func (this *QWebEngineQuotaRequest) GoGC() {
runtime.SetFinalizer(this, func(this *QWebEngineQuotaRequest) {
this.Delete()
runtime.KeepAlive(this.h)
})
}

View File

@ -1,39 +0,0 @@
#pragma once
#ifndef MIQT_QT_WEBENGINE_GEN_QWEBENGINEQUOTAREQUEST_H
#define MIQT_QT_WEBENGINE_GEN_QWEBENGINEQUOTAREQUEST_H
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#include "../../libmiqt/libmiqt.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
class QUrl;
class QWebEngineQuotaRequest;
#else
typedef struct QUrl QUrl;
typedef struct QWebEngineQuotaRequest QWebEngineQuotaRequest;
#endif
QWebEngineQuotaRequest* QWebEngineQuotaRequest_new();
QWebEngineQuotaRequest* QWebEngineQuotaRequest_new2(QWebEngineQuotaRequest* param1);
void QWebEngineQuotaRequest_accept(QWebEngineQuotaRequest* self);
void QWebEngineQuotaRequest_reject(QWebEngineQuotaRequest* self);
QUrl* QWebEngineQuotaRequest_origin(const QWebEngineQuotaRequest* self);
long long QWebEngineQuotaRequest_requestedSize(const QWebEngineQuotaRequest* self);
bool QWebEngineQuotaRequest_operatorEqual(const QWebEngineQuotaRequest* self, QWebEngineQuotaRequest* that);
bool QWebEngineQuotaRequest_operatorNotEqual(const QWebEngineQuotaRequest* self, QWebEngineQuotaRequest* that);
void QWebEngineQuotaRequest_delete(QWebEngineQuotaRequest* self);
#ifdef __cplusplus
} /* extern C */
#endif
#endif

View File

@ -436,10 +436,10 @@ void QSocketNotifier_delete(QSocketNotifier* self) {
}
QSocketDescriptor* QSocketDescriptor_new() {
#ifndef Q_OS_LINUX
return nullptr;
#else
#if defined(Q_OS_LINUX)
return new QSocketDescriptor();
#else
return nullptr;
#endif
}
@ -448,20 +448,20 @@ QSocketDescriptor* QSocketDescriptor_new2(QSocketDescriptor* param1) {
}
QSocketDescriptor* QSocketDescriptor_new3(int descriptor) {
#ifndef Q_OS_LINUX
return nullptr;
#else
#if defined(Q_OS_LINUX)
return new QSocketDescriptor(static_cast<QSocketDescriptor::DescriptorType>(descriptor));
#else
return nullptr;
#endif
}
int QSocketDescriptor_ToInt(const QSocketDescriptor* self) {
#ifdef Q_OS_LINUX
#if defined(Q_OS_LINUX)
QSocketDescriptor::DescriptorType _ret = self->operator int();
return static_cast<int>(_ret);
#else
int _ret_invalidOS;
return _ret_invalidOS;
int _ret_unavailable;
return _ret_unavailable;
#endif
}

View File

@ -0,0 +1,6 @@
package dtls
/*
#cgo pkg-config: Qt6Network
*/
import "C"

View File

@ -1,4 +1,4 @@
package network
package dtls
/*
@ -10,6 +10,7 @@ import "C"
import (
"github.com/mappu/miqt/qt6"
"github.com/mappu/miqt/qt6/network"
"runtime"
"runtime/cgo"
"unsafe"
@ -115,7 +116,7 @@ func (this *QDtlsClientVerifier) CookieGeneratorParameters() *QDtlsClientVerifie
return _goptr
}
func (this *QDtlsClientVerifier) VerifyClient(socket *QUdpSocket, dgram []byte, address *QHostAddress, port uint16) bool {
func (this *QDtlsClientVerifier) VerifyClient(socket *network.QUdpSocket, dgram []byte, address *network.QHostAddress, port uint16) bool {
dgram_alias := C.struct_miqt_string{}
if len(dgram) > 0 {
dgram_alias.data = (*C.char)(unsafe.Pointer(&dgram[0]))
@ -123,7 +124,7 @@ func (this *QDtlsClientVerifier) VerifyClient(socket *QUdpSocket, dgram []byte,
dgram_alias.data = (*C.char)(unsafe.Pointer(nil))
}
dgram_alias.len = C.size_t(len(dgram))
return (bool)(C.QDtlsClientVerifier_verifyClient(this.h, socket.cPointer(), dgram_alias, address.cPointer(), (C.ushort)(port)))
return (bool)(C.QDtlsClientVerifier_verifyClient(this.h, (*C.QUdpSocket)(socket.UnsafePointer()), dgram_alias, (*C.QHostAddress)(address.UnsafePointer()), (C.ushort)(port)))
}
func (this *QDtlsClientVerifier) VerifiedHello() []byte {
@ -463,13 +464,13 @@ func UnsafeNewQDtls(h unsafe.Pointer) *QDtls {
}
// NewQDtls constructs a new QDtls object.
func NewQDtls(mode QSslSocket__SslMode) *QDtls {
func NewQDtls(mode network.QSslSocket__SslMode) *QDtls {
return newQDtls(C.QDtls_new((C.int)(mode)))
}
// NewQDtls2 constructs a new QDtls object.
func NewQDtls2(mode QSslSocket__SslMode, parent *qt6.QObject) *QDtls {
func NewQDtls2(mode network.QSslSocket__SslMode, parent *qt6.QObject) *QDtls {
return newQDtls(C.QDtls_new2((C.int)(mode), (*C.QObject)(parent.UnsafePointer())))
}
@ -493,8 +494,8 @@ func QDtls_Tr(s string) string {
return _ret
}
func (this *QDtls) SetPeer(address *QHostAddress, port uint16) bool {
return (bool)(C.QDtls_setPeer(this.h, address.cPointer(), (C.ushort)(port)))
func (this *QDtls) SetPeer(address *network.QHostAddress, port uint16) bool {
return (bool)(C.QDtls_setPeer(this.h, (*C.QHostAddress)(address.UnsafePointer()), (C.ushort)(port)))
}
func (this *QDtls) SetPeerVerificationName(name string) bool {
@ -505,8 +506,8 @@ func (this *QDtls) SetPeerVerificationName(name string) bool {
return (bool)(C.QDtls_setPeerVerificationName(this.h, name_ms))
}
func (this *QDtls) PeerAddress() *QHostAddress {
_goptr := newQHostAddress(C.QDtls_peerAddress(this.h))
func (this *QDtls) PeerAddress() *network.QHostAddress {
_goptr := network.UnsafeNewQHostAddress(unsafe.Pointer(C.QDtls_peerAddress(this.h)))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
@ -522,8 +523,8 @@ func (this *QDtls) PeerVerificationName() string {
return _ret
}
func (this *QDtls) SslMode() QSslSocket__SslMode {
return (QSslSocket__SslMode)(C.QDtls_sslMode(this.h))
func (this *QDtls) SslMode() network.QSslSocket__SslMode {
return (network.QSslSocket__SslMode)(C.QDtls_sslMode(this.h))
}
func (this *QDtls) SetMtuHint(mtuHint uint16) {
@ -544,12 +545,12 @@ func (this *QDtls) CookieGeneratorParameters() *QDtlsClientVerifier__GeneratorPa
return _goptr
}
func (this *QDtls) SetDtlsConfiguration(configuration *QSslConfiguration) bool {
return (bool)(C.QDtls_setDtlsConfiguration(this.h, configuration.cPointer()))
func (this *QDtls) SetDtlsConfiguration(configuration *network.QSslConfiguration) bool {
return (bool)(C.QDtls_setDtlsConfiguration(this.h, (*C.QSslConfiguration)(configuration.UnsafePointer())))
}
func (this *QDtls) DtlsConfiguration() *QSslConfiguration {
_goptr := newQSslConfiguration(C.QDtls_dtlsConfiguration(this.h))
func (this *QDtls) DtlsConfiguration() *network.QSslConfiguration {
_goptr := network.UnsafeNewQSslConfiguration(unsafe.Pointer(C.QDtls_dtlsConfiguration(this.h)))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
@ -558,41 +559,41 @@ func (this *QDtls) HandshakeState() QDtls__HandshakeState {
return (QDtls__HandshakeState)(C.QDtls_handshakeState(this.h))
}
func (this *QDtls) DoHandshake(socket *QUdpSocket) bool {
return (bool)(C.QDtls_doHandshake(this.h, socket.cPointer()))
func (this *QDtls) DoHandshake(socket *network.QUdpSocket) bool {
return (bool)(C.QDtls_doHandshake(this.h, (*C.QUdpSocket)(socket.UnsafePointer())))
}
func (this *QDtls) HandleTimeout(socket *QUdpSocket) bool {
return (bool)(C.QDtls_handleTimeout(this.h, socket.cPointer()))
func (this *QDtls) HandleTimeout(socket *network.QUdpSocket) bool {
return (bool)(C.QDtls_handleTimeout(this.h, (*C.QUdpSocket)(socket.UnsafePointer())))
}
func (this *QDtls) ResumeHandshake(socket *QUdpSocket) bool {
return (bool)(C.QDtls_resumeHandshake(this.h, socket.cPointer()))
func (this *QDtls) ResumeHandshake(socket *network.QUdpSocket) bool {
return (bool)(C.QDtls_resumeHandshake(this.h, (*C.QUdpSocket)(socket.UnsafePointer())))
}
func (this *QDtls) AbortHandshake(socket *QUdpSocket) bool {
return (bool)(C.QDtls_abortHandshake(this.h, socket.cPointer()))
func (this *QDtls) AbortHandshake(socket *network.QUdpSocket) bool {
return (bool)(C.QDtls_abortHandshake(this.h, (*C.QUdpSocket)(socket.UnsafePointer())))
}
func (this *QDtls) Shutdown(socket *QUdpSocket) bool {
return (bool)(C.QDtls_shutdown(this.h, socket.cPointer()))
func (this *QDtls) Shutdown(socket *network.QUdpSocket) bool {
return (bool)(C.QDtls_shutdown(this.h, (*C.QUdpSocket)(socket.UnsafePointer())))
}
func (this *QDtls) IsConnectionEncrypted() bool {
return (bool)(C.QDtls_isConnectionEncrypted(this.h))
}
func (this *QDtls) SessionCipher() *QSslCipher {
_goptr := newQSslCipher(C.QDtls_sessionCipher(this.h))
func (this *QDtls) SessionCipher() *network.QSslCipher {
_goptr := network.UnsafeNewQSslCipher(unsafe.Pointer(C.QDtls_sessionCipher(this.h)))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QDtls) SessionProtocol() QSsl__SslProtocol {
return (QSsl__SslProtocol)(C.QDtls_sessionProtocol(this.h))
func (this *QDtls) SessionProtocol() network.QSsl__SslProtocol {
return (network.QSsl__SslProtocol)(C.QDtls_sessionProtocol(this.h))
}
func (this *QDtls) WriteDatagramEncrypted(socket *QUdpSocket, dgram []byte) int64 {
func (this *QDtls) WriteDatagramEncrypted(socket *network.QUdpSocket, dgram []byte) int64 {
dgram_alias := C.struct_miqt_string{}
if len(dgram) > 0 {
dgram_alias.data = (*C.char)(unsafe.Pointer(&dgram[0]))
@ -600,10 +601,10 @@ func (this *QDtls) WriteDatagramEncrypted(socket *QUdpSocket, dgram []byte) int6
dgram_alias.data = (*C.char)(unsafe.Pointer(nil))
}
dgram_alias.len = C.size_t(len(dgram))
return (int64)(C.QDtls_writeDatagramEncrypted(this.h, socket.cPointer(), dgram_alias))
return (int64)(C.QDtls_writeDatagramEncrypted(this.h, (*C.QUdpSocket)(socket.UnsafePointer()), dgram_alias))
}
func (this *QDtls) DecryptDatagram(socket *QUdpSocket, dgram []byte) []byte {
func (this *QDtls) DecryptDatagram(socket *network.QUdpSocket, dgram []byte) []byte {
dgram_alias := C.struct_miqt_string{}
if len(dgram) > 0 {
dgram_alias.data = (*C.char)(unsafe.Pointer(&dgram[0]))
@ -611,7 +612,7 @@ func (this *QDtls) DecryptDatagram(socket *QUdpSocket, dgram []byte) []byte {
dgram_alias.data = (*C.char)(unsafe.Pointer(nil))
}
dgram_alias.len = C.size_t(len(dgram))
var _bytearray C.struct_miqt_string = C.QDtls_decryptDatagram(this.h, socket.cPointer(), dgram_alias)
var _bytearray C.struct_miqt_string = C.QDtls_decryptDatagram(this.h, (*C.QUdpSocket)(socket.UnsafePointer()), dgram_alias)
_ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len)))
C.free(unsafe.Pointer(_bytearray.data))
return _ret
@ -628,44 +629,44 @@ func (this *QDtls) DtlsErrorString() string {
return _ret
}
func (this *QDtls) PeerVerificationErrors() []QSslError {
func (this *QDtls) PeerVerificationErrors() []network.QSslError {
var _ma C.struct_miqt_array = C.QDtls_peerVerificationErrors(this.h)
_ret := make([]QSslError, int(_ma.len))
_ret := make([]network.QSslError, int(_ma.len))
_outCast := (*[0xffff]*C.QSslError)(unsafe.Pointer(_ma.data)) // hey ya
for i := 0; i < int(_ma.len); i++ {
_lv_goptr := newQSslError(_outCast[i])
_lv_goptr := network.UnsafeNewQSslError(unsafe.Pointer(_outCast[i]))
_lv_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
_ret[i] = *_lv_goptr
}
return _ret
}
func (this *QDtls) IgnoreVerificationErrors(errorsToIgnore []QSslError) {
func (this *QDtls) IgnoreVerificationErrors(errorsToIgnore []network.QSslError) {
errorsToIgnore_CArray := (*[0xffff]*C.QSslError)(C.malloc(C.size_t(8 * len(errorsToIgnore))))
defer C.free(unsafe.Pointer(errorsToIgnore_CArray))
for i := range errorsToIgnore {
errorsToIgnore_CArray[i] = errorsToIgnore[i].cPointer()
errorsToIgnore_CArray[i] = (*C.QSslError)(errorsToIgnore[i].UnsafePointer())
}
errorsToIgnore_ma := C.struct_miqt_array{len: C.size_t(len(errorsToIgnore)), data: unsafe.Pointer(errorsToIgnore_CArray)}
C.QDtls_ignoreVerificationErrors(this.h, errorsToIgnore_ma)
}
func (this *QDtls) PskRequired(authenticator *QSslPreSharedKeyAuthenticator) {
C.QDtls_pskRequired(this.h, authenticator.cPointer())
func (this *QDtls) PskRequired(authenticator *network.QSslPreSharedKeyAuthenticator) {
C.QDtls_pskRequired(this.h, (*C.QSslPreSharedKeyAuthenticator)(authenticator.UnsafePointer()))
}
func (this *QDtls) OnPskRequired(slot func(authenticator *QSslPreSharedKeyAuthenticator)) {
func (this *QDtls) OnPskRequired(slot func(authenticator *network.QSslPreSharedKeyAuthenticator)) {
C.QDtls_connect_pskRequired(this.h, C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QDtls_pskRequired
func miqt_exec_callback_QDtls_pskRequired(cb C.intptr_t, authenticator *C.QSslPreSharedKeyAuthenticator) {
gofunc, ok := cgo.Handle(cb).Value().(func(authenticator *QSslPreSharedKeyAuthenticator))
gofunc, ok := cgo.Handle(cb).Value().(func(authenticator *network.QSslPreSharedKeyAuthenticator))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := newQSslPreSharedKeyAuthenticator(authenticator)
slotval1 := network.UnsafeNewQSslPreSharedKeyAuthenticator(unsafe.Pointer(authenticator))
gofunc(slotval1)
}
@ -709,15 +710,15 @@ func QDtls_Tr3(s string, c string, n int) string {
return _ret
}
func (this *QDtls) SetPeer2(address *QHostAddress, port uint16, verificationName string) bool {
func (this *QDtls) SetPeer2(address *network.QHostAddress, port uint16, verificationName string) bool {
verificationName_ms := C.struct_miqt_string{}
verificationName_ms.data = C.CString(verificationName)
verificationName_ms.len = C.size_t(len(verificationName))
defer C.free(unsafe.Pointer(verificationName_ms.data))
return (bool)(C.QDtls_setPeer2(this.h, address.cPointer(), (C.ushort)(port), verificationName_ms))
return (bool)(C.QDtls_setPeer2(this.h, (*C.QHostAddress)(address.UnsafePointer()), (C.ushort)(port), verificationName_ms))
}
func (this *QDtls) DoHandshake2(socket *QUdpSocket, dgram []byte) bool {
func (this *QDtls) DoHandshake2(socket *network.QUdpSocket, dgram []byte) bool {
dgram_alias := C.struct_miqt_string{}
if len(dgram) > 0 {
dgram_alias.data = (*C.char)(unsafe.Pointer(&dgram[0]))
@ -725,7 +726,7 @@ func (this *QDtls) DoHandshake2(socket *QUdpSocket, dgram []byte) bool {
dgram_alias.data = (*C.char)(unsafe.Pointer(nil))
}
dgram_alias.len = C.size_t(len(dgram))
return (bool)(C.QDtls_doHandshake2(this.h, socket.cPointer(), dgram_alias))
return (bool)(C.QDtls_doHandshake2(this.h, (*C.QUdpSocket)(socket.UnsafePointer()), dgram_alias))
}
// Sender can only be called from a QDtls that was directly constructed.

View File

@ -1,6 +1,6 @@
#pragma once
#ifndef MIQT_QT6_NETWORK_GEN_QDTLS_H
#define MIQT_QT6_NETWORK_GEN_QDTLS_H
#ifndef MIQT_QT6_NETWORK_DTLS_GEN_QDTLS_H
#define MIQT_QT6_NETWORK_DTLS_GEN_QDTLS_H
#include <stdbool.h>
#include <stddef.h>
@ -8,7 +8,7 @@
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#include "../../libmiqt/libmiqt.h"
#include "../../../libmiqt/libmiqt.h"
#ifdef __cplusplus
extern "C" {

View File

@ -342,19 +342,37 @@ void QSslConfiguration_setDefaultConfiguration(QSslConfiguration* configuration)
}
bool QSslConfiguration_dtlsCookieVerificationEnabled(const QSslConfiguration* self) {
#if QT_CONFIG(dtls)
return self->dtlsCookieVerificationEnabled();
#else
bool _ret_unavailable;
return _ret_unavailable;
#endif
}
void QSslConfiguration_setDtlsCookieVerificationEnabled(QSslConfiguration* self, bool enable) {
#if QT_CONFIG(dtls)
self->setDtlsCookieVerificationEnabled(enable);
#else
return;
#endif
}
QSslConfiguration* QSslConfiguration_defaultDtlsConfiguration() {
#if QT_CONFIG(dtls)
return new QSslConfiguration(QSslConfiguration::defaultDtlsConfiguration());
#else
QSslConfiguration* _ret_unavailable;
return _ret_unavailable;
#endif
}
void QSslConfiguration_setDefaultDtlsConfiguration(QSslConfiguration* configuration) {
#if QT_CONFIG(dtls)
QSslConfiguration::setDefaultDtlsConfiguration(*configuration);
#else
return;
#endif
}
bool QSslConfiguration_handshakeMustInterruptOnError(const QSslConfiguration* self) {

View File

@ -0,0 +1,6 @@
package sctp
/*
#cgo pkg-config: Qt6Network
*/
import "C"

View File

@ -1,4 +1,4 @@
package network
package sctp
/*
@ -10,6 +10,7 @@ import "C"
import (
"github.com/mappu/miqt/qt6"
"github.com/mappu/miqt/qt6/network"
"runtime"
"runtime/cgo"
"unsafe"
@ -17,7 +18,7 @@ import (
type QSctpServer struct {
h *C.QSctpServer
*QTcpServer
*network.QTcpServer
}
func (this *QSctpServer) cPointer() *C.QSctpServer {
@ -43,7 +44,7 @@ func newQSctpServer(h *C.QSctpServer) *QSctpServer {
C.QSctpServer_virtbase(h, &outptr_QTcpServer)
return &QSctpServer{h: h,
QTcpServer: newQTcpServer(outptr_QTcpServer)}
QTcpServer: network.UnsafeNewQTcpServer(unsafe.Pointer(outptr_QTcpServer))}
}
// UnsafeNewQSctpServer constructs the type using only unsafe pointers.
@ -117,10 +118,10 @@ func QSctpServer_Tr3(s string, c string, n int) string {
}
// AddPendingConnection can only be called from a QSctpServer that was directly constructed.
func (this *QSctpServer) AddPendingConnection(socket *QTcpSocket) {
func (this *QSctpServer) AddPendingConnection(socket *network.QTcpSocket) {
var _dynamic_cast_ok C.bool = false
C.QSctpServer_protectedbase_addPendingConnection(&_dynamic_cast_ok, unsafe.Pointer(this.h), socket.cPointer())
C.QSctpServer_protectedbase_addPendingConnection(&_dynamic_cast_ok, unsafe.Pointer(this.h), (*C.QTcpSocket)(socket.UnsafePointer()))
if !_dynamic_cast_ok {
panic("miqt: can only call protected methods for directly constructed types")
@ -237,12 +238,12 @@ func miqt_exec_callback_QSctpServer_hasPendingConnections(self *C.QSctpServer, c
}
func (this *QSctpServer) callVirtualBase_NextPendingConnection() *QTcpSocket {
func (this *QSctpServer) callVirtualBase_NextPendingConnection() *network.QTcpSocket {
return newQTcpSocket(C.QSctpServer_virtualbase_nextPendingConnection(unsafe.Pointer(this.h)))
return network.UnsafeNewQTcpSocket(unsafe.Pointer(C.QSctpServer_virtualbase_nextPendingConnection(unsafe.Pointer(this.h))))
}
func (this *QSctpServer) OnNextPendingConnection(slot func(super func() *QTcpSocket) *QTcpSocket) {
func (this *QSctpServer) OnNextPendingConnection(slot func(super func() *network.QTcpSocket) *network.QTcpSocket) {
ok := C.QSctpServer_override_virtual_nextPendingConnection(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
@ -251,14 +252,14 @@ func (this *QSctpServer) OnNextPendingConnection(slot func(super func() *QTcpSoc
//export miqt_exec_callback_QSctpServer_nextPendingConnection
func miqt_exec_callback_QSctpServer_nextPendingConnection(self *C.QSctpServer, cb C.intptr_t) *C.QTcpSocket {
gofunc, ok := cgo.Handle(cb).Value().(func(super func() *QTcpSocket) *QTcpSocket)
gofunc, ok := cgo.Handle(cb).Value().(func(super func() *network.QTcpSocket) *network.QTcpSocket)
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
virtualReturn := gofunc((&QSctpServer{h: self}).callVirtualBase_NextPendingConnection)
return virtualReturn.cPointer()
return (*C.QTcpSocket)(virtualReturn.UnsafePointer())
}

View File

@ -1,6 +1,6 @@
#pragma once
#ifndef MIQT_QT6_NETWORK_GEN_QSCTPSERVER_H
#define MIQT_QT6_NETWORK_GEN_QSCTPSERVER_H
#ifndef MIQT_QT6_NETWORK_SCTP_GEN_QSCTPSERVER_H
#define MIQT_QT6_NETWORK_SCTP_GEN_QSCTPSERVER_H
#include <stdbool.h>
#include <stddef.h>
@ -8,7 +8,7 @@
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#include "../../libmiqt/libmiqt.h"
#include "../../../libmiqt/libmiqt.h"
#ifdef __cplusplus
extern "C" {

View File

@ -1,4 +1,4 @@
package network
package sctp
/*
@ -10,6 +10,7 @@ import "C"
import (
"github.com/mappu/miqt/qt6"
"github.com/mappu/miqt/qt6/network"
"runtime"
"runtime/cgo"
"unsafe"
@ -17,7 +18,7 @@ import (
type QSctpSocket struct {
h *C.QSctpSocket
*QTcpSocket
*network.QTcpSocket
}
func (this *QSctpSocket) cPointer() *C.QSctpSocket {
@ -43,7 +44,7 @@ func newQSctpSocket(h *C.QSctpSocket) *QSctpSocket {
C.QSctpSocket_virtbase(h, &outptr_QTcpSocket)
return &QSctpSocket{h: h,
QTcpSocket: newQTcpSocket(outptr_QTcpSocket)}
QTcpSocket: network.UnsafeNewQTcpSocket(unsafe.Pointer(outptr_QTcpSocket))}
}
// UnsafeNewQSctpSocket constructs the type using only unsafe pointers.
@ -102,14 +103,14 @@ func (this *QSctpSocket) IsInDatagramMode() bool {
return (bool)(C.QSctpSocket_isInDatagramMode(this.h))
}
func (this *QSctpSocket) ReadDatagram() *QNetworkDatagram {
_goptr := newQNetworkDatagram(C.QSctpSocket_readDatagram(this.h))
func (this *QSctpSocket) ReadDatagram() *network.QNetworkDatagram {
_goptr := network.UnsafeNewQNetworkDatagram(unsafe.Pointer(C.QSctpSocket_readDatagram(this.h)))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QSctpSocket) WriteDatagram(datagram *QNetworkDatagram) bool {
return (bool)(C.QSctpSocket_writeDatagram(this.h, datagram.cPointer()))
func (this *QSctpSocket) WriteDatagram(datagram *network.QNetworkDatagram) bool {
return (bool)(C.QSctpSocket_writeDatagram(this.h, (*C.QNetworkDatagram)(datagram.UnsafePointer())))
}
func QSctpSocket_Tr2(s string, c string) string {
@ -135,7 +136,7 @@ func QSctpSocket_Tr3(s string, c string, n int) string {
}
// SetSocketState can only be called from a QSctpSocket that was directly constructed.
func (this *QSctpSocket) SetSocketState(state QAbstractSocket__SocketState) {
func (this *QSctpSocket) SetSocketState(state network.QAbstractSocket__SocketState) {
var _dynamic_cast_ok C.bool = false
C.QSctpSocket_protectedbase_setSocketState(&_dynamic_cast_ok, unsafe.Pointer(this.h), (C.int)(state))
@ -147,7 +148,7 @@ func (this *QSctpSocket) SetSocketState(state QAbstractSocket__SocketState) {
}
// SetSocketError can only be called from a QSctpSocket that was directly constructed.
func (this *QSctpSocket) SetSocketError(socketError QAbstractSocket__SocketError) {
func (this *QSctpSocket) SetSocketError(socketError network.QAbstractSocket__SocketError) {
var _dynamic_cast_ok C.bool = false
C.QSctpSocket_protectedbase_setSocketError(&_dynamic_cast_ok, unsafe.Pointer(this.h), (C.int)(socketError))
@ -171,10 +172,10 @@ func (this *QSctpSocket) SetLocalPort(port uint16) {
}
// SetLocalAddress can only be called from a QSctpSocket that was directly constructed.
func (this *QSctpSocket) SetLocalAddress(address *QHostAddress) {
func (this *QSctpSocket) SetLocalAddress(address *network.QHostAddress) {
var _dynamic_cast_ok C.bool = false
C.QSctpSocket_protectedbase_setLocalAddress(&_dynamic_cast_ok, unsafe.Pointer(this.h), address.cPointer())
C.QSctpSocket_protectedbase_setLocalAddress(&_dynamic_cast_ok, unsafe.Pointer(this.h), (*C.QHostAddress)(address.UnsafePointer()))
if !_dynamic_cast_ok {
panic("miqt: can only call protected methods for directly constructed types")
@ -195,10 +196,10 @@ func (this *QSctpSocket) SetPeerPort(port uint16) {
}
// SetPeerAddress can only be called from a QSctpSocket that was directly constructed.
func (this *QSctpSocket) SetPeerAddress(address *QHostAddress) {
func (this *QSctpSocket) SetPeerAddress(address *network.QHostAddress) {
var _dynamic_cast_ok C.bool = false
C.QSctpSocket_protectedbase_setPeerAddress(&_dynamic_cast_ok, unsafe.Pointer(this.h), address.cPointer())
C.QSctpSocket_protectedbase_setPeerAddress(&_dynamic_cast_ok, unsafe.Pointer(this.h), (*C.QHostAddress)(address.UnsafePointer()))
if !_dynamic_cast_ok {
panic("miqt: can only call protected methods for directly constructed types")
@ -443,12 +444,12 @@ func miqt_exec_callback_QSctpSocket_resume(self *C.QSctpSocket, cb C.intptr_t) {
}
func (this *QSctpSocket) callVirtualBase_Bind(address *QHostAddress, port uint16, mode QAbstractSocket__BindFlag) bool {
func (this *QSctpSocket) callVirtualBase_Bind(address *network.QHostAddress, port uint16, mode network.QAbstractSocket__BindFlag) bool {
return (bool)(C.QSctpSocket_virtualbase_bind(unsafe.Pointer(this.h), address.cPointer(), (C.ushort)(port), (C.int)(mode)))
return (bool)(C.QSctpSocket_virtualbase_bind(unsafe.Pointer(this.h), (*C.QHostAddress)(address.UnsafePointer()), (C.ushort)(port), (C.int)(mode)))
}
func (this *QSctpSocket) OnBind(slot func(super func(address *QHostAddress, port uint16, mode QAbstractSocket__BindFlag) bool, address *QHostAddress, port uint16, mode QAbstractSocket__BindFlag) bool) {
func (this *QSctpSocket) OnBind(slot func(super func(address *network.QHostAddress, port uint16, mode network.QAbstractSocket__BindFlag) bool, address *network.QHostAddress, port uint16, mode network.QAbstractSocket__BindFlag) bool) {
ok := C.QSctpSocket_override_virtual_bind(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
@ -457,17 +458,17 @@ func (this *QSctpSocket) OnBind(slot func(super func(address *QHostAddress, port
//export miqt_exec_callback_QSctpSocket_bind
func miqt_exec_callback_QSctpSocket_bind(self *C.QSctpSocket, cb C.intptr_t, address *C.QHostAddress, port C.ushort, mode C.int) C.bool {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(address *QHostAddress, port uint16, mode QAbstractSocket__BindFlag) bool, address *QHostAddress, port uint16, mode QAbstractSocket__BindFlag) bool)
gofunc, ok := cgo.Handle(cb).Value().(func(super func(address *network.QHostAddress, port uint16, mode network.QAbstractSocket__BindFlag) bool, address *network.QHostAddress, port uint16, mode network.QAbstractSocket__BindFlag) bool)
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := newQHostAddress(address)
slotval1 := network.UnsafeNewQHostAddress(unsafe.Pointer(address))
slotval2 := (uint16)(port)
slotval3 := (QAbstractSocket__BindFlag)(mode)
slotval3 := (network.QAbstractSocket__BindFlag)(mode)
virtualReturn := gofunc((&QSctpSocket{h: self}).callVirtualBase_Bind, slotval1, slotval2, slotval3)
@ -475,7 +476,7 @@ func miqt_exec_callback_QSctpSocket_bind(self *C.QSctpSocket, cb C.intptr_t, add
}
func (this *QSctpSocket) callVirtualBase_ConnectToHost(hostName string, port uint16, mode qt6.QIODeviceBase__OpenModeFlag, protocol QAbstractSocket__NetworkLayerProtocol) {
func (this *QSctpSocket) callVirtualBase_ConnectToHost(hostName string, port uint16, mode qt6.QIODeviceBase__OpenModeFlag, protocol network.QAbstractSocket__NetworkLayerProtocol) {
hostName_ms := C.struct_miqt_string{}
hostName_ms.data = C.CString(hostName)
hostName_ms.len = C.size_t(len(hostName))
@ -484,7 +485,7 @@ func (this *QSctpSocket) callVirtualBase_ConnectToHost(hostName string, port uin
C.QSctpSocket_virtualbase_connectToHost(unsafe.Pointer(this.h), hostName_ms, (C.ushort)(port), (C.int)(mode), (C.int)(protocol))
}
func (this *QSctpSocket) OnConnectToHost(slot func(super func(hostName string, port uint16, mode qt6.QIODeviceBase__OpenModeFlag, protocol QAbstractSocket__NetworkLayerProtocol), hostName string, port uint16, mode qt6.QIODeviceBase__OpenModeFlag, protocol QAbstractSocket__NetworkLayerProtocol)) {
func (this *QSctpSocket) OnConnectToHost(slot func(super func(hostName string, port uint16, mode qt6.QIODeviceBase__OpenModeFlag, protocol network.QAbstractSocket__NetworkLayerProtocol), hostName string, port uint16, mode qt6.QIODeviceBase__OpenModeFlag, protocol network.QAbstractSocket__NetworkLayerProtocol)) {
ok := C.QSctpSocket_override_virtual_connectToHost(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
@ -493,7 +494,7 @@ func (this *QSctpSocket) OnConnectToHost(slot func(super func(hostName string, p
//export miqt_exec_callback_QSctpSocket_connectToHost
func miqt_exec_callback_QSctpSocket_connectToHost(self *C.QSctpSocket, cb C.intptr_t, hostName C.struct_miqt_string, port C.ushort, mode C.int, protocol C.int) {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(hostName string, port uint16, mode qt6.QIODeviceBase__OpenModeFlag, protocol QAbstractSocket__NetworkLayerProtocol), hostName string, port uint16, mode qt6.QIODeviceBase__OpenModeFlag, protocol QAbstractSocket__NetworkLayerProtocol))
gofunc, ok := cgo.Handle(cb).Value().(func(super func(hostName string, port uint16, mode qt6.QIODeviceBase__OpenModeFlag, protocol network.QAbstractSocket__NetworkLayerProtocol), hostName string, port uint16, mode qt6.QIODeviceBase__OpenModeFlag, protocol network.QAbstractSocket__NetworkLayerProtocol))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
@ -507,7 +508,7 @@ func miqt_exec_callback_QSctpSocket_connectToHost(self *C.QSctpSocket, cb C.intp
slotval3 := (qt6.QIODeviceBase__OpenModeFlag)(mode)
slotval4 := (QAbstractSocket__NetworkLayerProtocol)(protocol)
slotval4 := (network.QAbstractSocket__NetworkLayerProtocol)(protocol)
gofunc((&QSctpSocket{h: self}).callVirtualBase_ConnectToHost, slotval1, slotval2, slotval3, slotval4)
@ -614,12 +615,12 @@ func miqt_exec_callback_QSctpSocket_socketDescriptor(self *C.QSctpSocket, cb C.i
}
func (this *QSctpSocket) callVirtualBase_SetSocketDescriptor(socketDescriptor uintptr, state QAbstractSocket__SocketState, openMode qt6.QIODeviceBase__OpenModeFlag) bool {
func (this *QSctpSocket) callVirtualBase_SetSocketDescriptor(socketDescriptor uintptr, state network.QAbstractSocket__SocketState, openMode qt6.QIODeviceBase__OpenModeFlag) bool {
return (bool)(C.QSctpSocket_virtualbase_setSocketDescriptor(unsafe.Pointer(this.h), (C.intptr_t)(socketDescriptor), (C.int)(state), (C.int)(openMode)))
}
func (this *QSctpSocket) OnSetSocketDescriptor(slot func(super func(socketDescriptor uintptr, state QAbstractSocket__SocketState, openMode qt6.QIODeviceBase__OpenModeFlag) bool, socketDescriptor uintptr, state QAbstractSocket__SocketState, openMode qt6.QIODeviceBase__OpenModeFlag) bool) {
func (this *QSctpSocket) OnSetSocketDescriptor(slot func(super func(socketDescriptor uintptr, state network.QAbstractSocket__SocketState, openMode qt6.QIODeviceBase__OpenModeFlag) bool, socketDescriptor uintptr, state network.QAbstractSocket__SocketState, openMode qt6.QIODeviceBase__OpenModeFlag) bool) {
ok := C.QSctpSocket_override_virtual_setSocketDescriptor(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
@ -628,7 +629,7 @@ func (this *QSctpSocket) OnSetSocketDescriptor(slot func(super func(socketDescri
//export miqt_exec_callback_QSctpSocket_setSocketDescriptor
func miqt_exec_callback_QSctpSocket_setSocketDescriptor(self *C.QSctpSocket, cb C.intptr_t, socketDescriptor C.intptr_t, state C.int, openMode C.int) C.bool {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(socketDescriptor uintptr, state QAbstractSocket__SocketState, openMode qt6.QIODeviceBase__OpenModeFlag) bool, socketDescriptor uintptr, state QAbstractSocket__SocketState, openMode qt6.QIODeviceBase__OpenModeFlag) bool)
gofunc, ok := cgo.Handle(cb).Value().(func(super func(socketDescriptor uintptr, state network.QAbstractSocket__SocketState, openMode qt6.QIODeviceBase__OpenModeFlag) bool, socketDescriptor uintptr, state network.QAbstractSocket__SocketState, openMode qt6.QIODeviceBase__OpenModeFlag) bool)
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
@ -636,7 +637,7 @@ func miqt_exec_callback_QSctpSocket_setSocketDescriptor(self *C.QSctpSocket, cb
// Convert all CABI parameters to Go parameters
slotval1 := (uintptr)(socketDescriptor)
slotval2 := (QAbstractSocket__SocketState)(state)
slotval2 := (network.QAbstractSocket__SocketState)(state)
slotval3 := (qt6.QIODeviceBase__OpenModeFlag)(openMode)
@ -646,12 +647,12 @@ func miqt_exec_callback_QSctpSocket_setSocketDescriptor(self *C.QSctpSocket, cb
}
func (this *QSctpSocket) callVirtualBase_SetSocketOption(option QAbstractSocket__SocketOption, value *qt6.QVariant) {
func (this *QSctpSocket) callVirtualBase_SetSocketOption(option network.QAbstractSocket__SocketOption, value *qt6.QVariant) {
C.QSctpSocket_virtualbase_setSocketOption(unsafe.Pointer(this.h), (C.int)(option), (*C.QVariant)(value.UnsafePointer()))
}
func (this *QSctpSocket) OnSetSocketOption(slot func(super func(option QAbstractSocket__SocketOption, value *qt6.QVariant), option QAbstractSocket__SocketOption, value *qt6.QVariant)) {
func (this *QSctpSocket) OnSetSocketOption(slot func(super func(option network.QAbstractSocket__SocketOption, value *qt6.QVariant), option network.QAbstractSocket__SocketOption, value *qt6.QVariant)) {
ok := C.QSctpSocket_override_virtual_setSocketOption(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
@ -660,13 +661,13 @@ func (this *QSctpSocket) OnSetSocketOption(slot func(super func(option QAbstract
//export miqt_exec_callback_QSctpSocket_setSocketOption
func miqt_exec_callback_QSctpSocket_setSocketOption(self *C.QSctpSocket, cb C.intptr_t, option C.int, value *C.QVariant) {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(option QAbstractSocket__SocketOption, value *qt6.QVariant), option QAbstractSocket__SocketOption, value *qt6.QVariant))
gofunc, ok := cgo.Handle(cb).Value().(func(super func(option network.QAbstractSocket__SocketOption, value *qt6.QVariant), option network.QAbstractSocket__SocketOption, value *qt6.QVariant))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := (QAbstractSocket__SocketOption)(option)
slotval1 := (network.QAbstractSocket__SocketOption)(option)
slotval2 := qt6.UnsafeNewQVariant(unsafe.Pointer(value))
@ -674,14 +675,14 @@ func miqt_exec_callback_QSctpSocket_setSocketOption(self *C.QSctpSocket, cb C.in
}
func (this *QSctpSocket) callVirtualBase_SocketOption(option QAbstractSocket__SocketOption) *qt6.QVariant {
func (this *QSctpSocket) callVirtualBase_SocketOption(option network.QAbstractSocket__SocketOption) *qt6.QVariant {
_goptr := qt6.UnsafeNewQVariant(unsafe.Pointer(C.QSctpSocket_virtualbase_socketOption(unsafe.Pointer(this.h), (C.int)(option))))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QSctpSocket) OnSocketOption(slot func(super func(option QAbstractSocket__SocketOption) *qt6.QVariant, option QAbstractSocket__SocketOption) *qt6.QVariant) {
func (this *QSctpSocket) OnSocketOption(slot func(super func(option network.QAbstractSocket__SocketOption) *qt6.QVariant, option network.QAbstractSocket__SocketOption) *qt6.QVariant) {
ok := C.QSctpSocket_override_virtual_socketOption(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
@ -690,13 +691,13 @@ func (this *QSctpSocket) OnSocketOption(slot func(super func(option QAbstractSoc
//export miqt_exec_callback_QSctpSocket_socketOption
func miqt_exec_callback_QSctpSocket_socketOption(self *C.QSctpSocket, cb C.intptr_t, option C.int) *C.QVariant {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(option QAbstractSocket__SocketOption) *qt6.QVariant, option QAbstractSocket__SocketOption) *qt6.QVariant)
gofunc, ok := cgo.Handle(cb).Value().(func(super func(option network.QAbstractSocket__SocketOption) *qt6.QVariant, option network.QAbstractSocket__SocketOption) *qt6.QVariant)
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := (QAbstractSocket__SocketOption)(option)
slotval1 := (network.QAbstractSocket__SocketOption)(option)
virtualReturn := gofunc((&QSctpSocket{h: self}).callVirtualBase_SocketOption, slotval1)

View File

@ -1,6 +1,6 @@
#pragma once
#ifndef MIQT_QT6_NETWORK_GEN_QSCTPSOCKET_H
#define MIQT_QT6_NETWORK_GEN_QSCTPSOCKET_H
#ifndef MIQT_QT6_NETWORK_SCTP_GEN_QSCTPSOCKET_H
#define MIQT_QT6_NETWORK_SCTP_GEN_QSCTPSOCKET_H
#include <stdbool.h>
#include <stddef.h>
@ -8,7 +8,7 @@
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#include "../../libmiqt/libmiqt.h"
#include "../../../libmiqt/libmiqt.h"
#ifdef __cplusplus
extern "C" {

View File

@ -0,0 +1,6 @@
package qmlwebchannel
/*
#cgo pkg-config: Qt6WebChannel
*/
import "C"

View File

@ -1,4 +1,4 @@
package webchannel
package qmlwebchannel
/*
@ -10,6 +10,7 @@ import "C"
import (
"github.com/mappu/miqt/qt6"
"github.com/mappu/miqt/qt6/webchannel"
"runtime"
"runtime/cgo"
"unsafe"
@ -17,7 +18,7 @@ import (
type QQmlWebChannel struct {
h *C.QQmlWebChannel
*QWebChannel
*webchannel.QWebChannel
}
func (this *QQmlWebChannel) cPointer() *C.QQmlWebChannel {
@ -43,7 +44,7 @@ func newQQmlWebChannel(h *C.QQmlWebChannel) *QQmlWebChannel {
C.QQmlWebChannel_virtbase(h, &outptr_QWebChannel)
return &QQmlWebChannel{h: h,
QWebChannel: newQWebChannel(outptr_QWebChannel)}
QWebChannel: webchannel.UnsafeNewQWebChannel(unsafe.Pointer(outptr_QWebChannel))}
}
// UnsafeNewQQmlWebChannel constructs the type using only unsafe pointers.

View File

@ -1,6 +1,6 @@
#pragma once
#ifndef MIQT_QT6_WEBCHANNEL_GEN_QQMLWEBCHANNEL_H
#define MIQT_QT6_WEBCHANNEL_GEN_QQMLWEBCHANNEL_H
#ifndef MIQT_QT6_WEBCHANNEL_QMLWEBCHANNEL_GEN_QQMLWEBCHANNEL_H
#define MIQT_QT6_WEBCHANNEL_QMLWEBCHANNEL_GEN_QQMLWEBCHANNEL_H
#include <stdbool.h>
#include <stddef.h>
@ -8,7 +8,7 @@
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#include "../../libmiqt/libmiqt.h"
#include "../../../libmiqt/libmiqt.h"
#ifdef __cplusplus
extern "C" {

View File

@ -32,7 +32,6 @@
#include <QWebEngineNewWindowRequest>
#include <QWebEnginePage>
#include <QWebEngineProfile>
#include <QWebEngineQuotaRequest>
#include <QWebEngineRegisterProtocolHandlerRequest>
#include <QWebEngineScriptCollection>
#include <QWebEngineSettings>
@ -55,7 +54,6 @@ void miqt_exec_callback_QWebEnginePage_windowCloseRequested(intptr_t);
void miqt_exec_callback_QWebEnginePage_featurePermissionRequested(intptr_t, QUrl*, int);
void miqt_exec_callback_QWebEnginePage_featurePermissionRequestCanceled(intptr_t, QUrl*, int);
void miqt_exec_callback_QWebEnginePage_fullScreenRequested(intptr_t, QWebEngineFullScreenRequest*);
void miqt_exec_callback_QWebEnginePage_quotaRequested(intptr_t, QWebEngineQuotaRequest*);
void miqt_exec_callback_QWebEnginePage_registerProtocolHandlerRequested(intptr_t, QWebEngineRegisterProtocolHandlerRequest*);
void miqt_exec_callback_QWebEnginePage_fileSystemAccessRequested(intptr_t, QWebEngineFileSystemAccessRequest*);
void miqt_exec_callback_QWebEnginePage_selectClientCertificate(intptr_t, QWebEngineClientCertificateSelection*);
@ -863,17 +861,6 @@ void QWebEnginePage_connect_fullScreenRequested(QWebEnginePage* self, intptr_t s
});
}
void QWebEnginePage_quotaRequested(QWebEnginePage* self, QWebEngineQuotaRequest* quotaRequest) {
self->quotaRequested(*quotaRequest);
}
void QWebEnginePage_connect_quotaRequested(QWebEnginePage* self, intptr_t slot) {
MiqtVirtualQWebEnginePage::connect(self, static_cast<void (QWebEnginePage::*)(QWebEngineQuotaRequest)>(&QWebEnginePage::quotaRequested), self, [=](QWebEngineQuotaRequest quotaRequest) {
QWebEngineQuotaRequest* sigval1 = new QWebEngineQuotaRequest(quotaRequest);
miqt_exec_callback_QWebEnginePage_quotaRequested(slot, sigval1);
});
}
void QWebEnginePage_registerProtocolHandlerRequested(QWebEnginePage* self, QWebEngineRegisterProtocolHandlerRequest* request) {
self->registerProtocolHandlerRequested(*request);
}

View File

@ -690,28 +690,6 @@ func miqt_exec_callback_QWebEnginePage_fullScreenRequested(cb C.intptr_t, fullSc
gofunc(slotval1)
}
func (this *QWebEnginePage) QuotaRequested(quotaRequest QWebEngineQuotaRequest) {
C.QWebEnginePage_quotaRequested(this.h, quotaRequest.cPointer())
}
func (this *QWebEnginePage) OnQuotaRequested(slot func(quotaRequest QWebEngineQuotaRequest)) {
C.QWebEnginePage_connect_quotaRequested(this.h, C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QWebEnginePage_quotaRequested
func miqt_exec_callback_QWebEnginePage_quotaRequested(cb C.intptr_t, quotaRequest *C.QWebEngineQuotaRequest) {
gofunc, ok := cgo.Handle(cb).Value().(func(quotaRequest QWebEngineQuotaRequest))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
quotaRequest_goptr := newQWebEngineQuotaRequest(quotaRequest)
quotaRequest_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
slotval1 := *quotaRequest_goptr
gofunc(slotval1)
}
func (this *QWebEnginePage) RegisterProtocolHandlerRequested(request QWebEngineRegisterProtocolHandlerRequest) {
C.QWebEnginePage_registerProtocolHandlerRequested(this.h, request.cPointer())
}

View File

@ -44,7 +44,6 @@ class QWebEngineNavigationRequest;
class QWebEngineNewWindowRequest;
class QWebEnginePage;
class QWebEngineProfile;
class QWebEngineQuotaRequest;
class QWebEngineRegisterProtocolHandlerRequest;
class QWebEngineScriptCollection;
class QWebEngineSettings;
@ -79,7 +78,6 @@ typedef struct QWebEngineNavigationRequest QWebEngineNavigationRequest;
typedef struct QWebEngineNewWindowRequest QWebEngineNewWindowRequest;
typedef struct QWebEnginePage QWebEnginePage;
typedef struct QWebEngineProfile QWebEngineProfile;
typedef struct QWebEngineQuotaRequest QWebEngineQuotaRequest;
typedef struct QWebEngineRegisterProtocolHandlerRequest QWebEngineRegisterProtocolHandlerRequest;
typedef struct QWebEngineScriptCollection QWebEngineScriptCollection;
typedef struct QWebEngineSettings QWebEngineSettings;
@ -164,8 +162,6 @@ void QWebEnginePage_featurePermissionRequestCanceled(QWebEnginePage* self, QUrl*
void QWebEnginePage_connect_featurePermissionRequestCanceled(QWebEnginePage* self, intptr_t slot);
void QWebEnginePage_fullScreenRequested(QWebEnginePage* self, QWebEngineFullScreenRequest* fullScreenRequest);
void QWebEnginePage_connect_fullScreenRequested(QWebEnginePage* self, intptr_t slot);
void QWebEnginePage_quotaRequested(QWebEnginePage* self, QWebEngineQuotaRequest* quotaRequest);
void QWebEnginePage_connect_quotaRequested(QWebEnginePage* self, intptr_t slot);
void QWebEnginePage_registerProtocolHandlerRequested(QWebEnginePage* self, QWebEngineRegisterProtocolHandlerRequest* request);
void QWebEnginePage_connect_registerProtocolHandlerRequested(QWebEnginePage* self, intptr_t slot);
void QWebEnginePage_fileSystemAccessRequested(QWebEnginePage* self, QWebEngineFileSystemAccessRequest* request);

View File

@ -1,50 +0,0 @@
#include <QUrl>
#include <QWebEngineQuotaRequest>
#include <qwebenginequotarequest.h>
#include "gen_qwebenginequotarequest.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
} /* extern C */
#endif
QWebEngineQuotaRequest* QWebEngineQuotaRequest_new() {
return new QWebEngineQuotaRequest();
}
QWebEngineQuotaRequest* QWebEngineQuotaRequest_new2(QWebEngineQuotaRequest* param1) {
return new QWebEngineQuotaRequest(*param1);
}
void QWebEngineQuotaRequest_accept(QWebEngineQuotaRequest* self) {
self->accept();
}
void QWebEngineQuotaRequest_reject(QWebEngineQuotaRequest* self) {
self->reject();
}
QUrl* QWebEngineQuotaRequest_origin(const QWebEngineQuotaRequest* self) {
return new QUrl(self->origin());
}
long long QWebEngineQuotaRequest_requestedSize(const QWebEngineQuotaRequest* self) {
qint64 _ret = self->requestedSize();
return static_cast<long long>(_ret);
}
bool QWebEngineQuotaRequest_operatorEqual(const QWebEngineQuotaRequest* self, QWebEngineQuotaRequest* that) {
return (*self == *that);
}
bool QWebEngineQuotaRequest_operatorNotEqual(const QWebEngineQuotaRequest* self, QWebEngineQuotaRequest* that) {
return (*self != *that);
}
void QWebEngineQuotaRequest_delete(QWebEngineQuotaRequest* self) {
delete self;
}

View File

@ -1,99 +0,0 @@
package webengine
/*
#include "gen_qwebenginequotarequest.h"
#include <stdlib.h>
*/
import "C"
import (
"github.com/mappu/miqt/qt6"
"runtime"
"unsafe"
)
type QWebEngineQuotaRequest struct {
h *C.QWebEngineQuotaRequest
}
func (this *QWebEngineQuotaRequest) cPointer() *C.QWebEngineQuotaRequest {
if this == nil {
return nil
}
return this.h
}
func (this *QWebEngineQuotaRequest) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
// newQWebEngineQuotaRequest constructs the type using only CGO pointers.
func newQWebEngineQuotaRequest(h *C.QWebEngineQuotaRequest) *QWebEngineQuotaRequest {
if h == nil {
return nil
}
return &QWebEngineQuotaRequest{h: h}
}
// UnsafeNewQWebEngineQuotaRequest constructs the type using only unsafe pointers.
func UnsafeNewQWebEngineQuotaRequest(h unsafe.Pointer) *QWebEngineQuotaRequest {
return newQWebEngineQuotaRequest((*C.QWebEngineQuotaRequest)(h))
}
// NewQWebEngineQuotaRequest constructs a new QWebEngineQuotaRequest object.
func NewQWebEngineQuotaRequest() *QWebEngineQuotaRequest {
return newQWebEngineQuotaRequest(C.QWebEngineQuotaRequest_new())
}
// NewQWebEngineQuotaRequest2 constructs a new QWebEngineQuotaRequest object.
func NewQWebEngineQuotaRequest2(param1 *QWebEngineQuotaRequest) *QWebEngineQuotaRequest {
return newQWebEngineQuotaRequest(C.QWebEngineQuotaRequest_new2(param1.cPointer()))
}
func (this *QWebEngineQuotaRequest) Accept() {
C.QWebEngineQuotaRequest_accept(this.h)
}
func (this *QWebEngineQuotaRequest) Reject() {
C.QWebEngineQuotaRequest_reject(this.h)
}
func (this *QWebEngineQuotaRequest) Origin() *qt6.QUrl {
_goptr := qt6.UnsafeNewQUrl(unsafe.Pointer(C.QWebEngineQuotaRequest_origin(this.h)))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QWebEngineQuotaRequest) RequestedSize() int64 {
return (int64)(C.QWebEngineQuotaRequest_requestedSize(this.h))
}
func (this *QWebEngineQuotaRequest) OperatorEqual(that *QWebEngineQuotaRequest) bool {
return (bool)(C.QWebEngineQuotaRequest_operatorEqual(this.h, that.cPointer()))
}
func (this *QWebEngineQuotaRequest) OperatorNotEqual(that *QWebEngineQuotaRequest) bool {
return (bool)(C.QWebEngineQuotaRequest_operatorNotEqual(this.h, that.cPointer()))
}
// Delete this object from C++ memory.
func (this *QWebEngineQuotaRequest) Delete() {
C.QWebEngineQuotaRequest_delete(this.h)
}
// GoGC adds a Go Finalizer to this pointer, so that it will be deleted
// from C++ memory once it is unreachable from Go memory.
func (this *QWebEngineQuotaRequest) GoGC() {
runtime.SetFinalizer(this, func(this *QWebEngineQuotaRequest) {
this.Delete()
runtime.KeepAlive(this.h)
})
}

View File

@ -1,39 +0,0 @@
#pragma once
#ifndef MIQT_QT6_WEBENGINE_GEN_QWEBENGINEQUOTAREQUEST_H
#define MIQT_QT6_WEBENGINE_GEN_QWEBENGINEQUOTAREQUEST_H
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#include "../../libmiqt/libmiqt.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
class QUrl;
class QWebEngineQuotaRequest;
#else
typedef struct QUrl QUrl;
typedef struct QWebEngineQuotaRequest QWebEngineQuotaRequest;
#endif
QWebEngineQuotaRequest* QWebEngineQuotaRequest_new();
QWebEngineQuotaRequest* QWebEngineQuotaRequest_new2(QWebEngineQuotaRequest* param1);
void QWebEngineQuotaRequest_accept(QWebEngineQuotaRequest* self);
void QWebEngineQuotaRequest_reject(QWebEngineQuotaRequest* self);
QUrl* QWebEngineQuotaRequest_origin(const QWebEngineQuotaRequest* self);
long long QWebEngineQuotaRequest_requestedSize(const QWebEngineQuotaRequest* self);
bool QWebEngineQuotaRequest_operatorEqual(const QWebEngineQuotaRequest* self, QWebEngineQuotaRequest* that);
bool QWebEngineQuotaRequest_operatorNotEqual(const QWebEngineQuotaRequest* self, QWebEngineQuotaRequest* that);
void QWebEngineQuotaRequest_delete(QWebEngineQuotaRequest* self);
#ifdef __cplusplus
} /* extern C */
#endif
#endif