mirror of
https://github.com/mappu/miqt.git
synced 2025-04-27 15:40:21 +00:00
qt: rebuild (split sctp, dtls, qt6qmlwebchannel; invert linux ifdefs)
This commit is contained in:
parent
2c2344e786
commit
858536e378
@ -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
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -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.
|
@ -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" {
|
@ -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) {
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -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.
|
@ -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" {
|
@ -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) {
|
||||
|
@ -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())
|
||||
|
||||
}
|
||||
|
@ -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" {
|
@ -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)
|
||||
|
@ -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" {
|
@ -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.
|
@ -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" {
|
@ -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);
|
||||
}
|
||||
|
@ -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())
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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)
|
||||
})
|
||||
}
|
@ -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
|
Loading…
x
Reference in New Issue
Block a user