Skip to content

Commit

Permalink
support for Qt 5.12
Browse files Browse the repository at this point in the history
* use clang for android builds
* official windows builds are 64 bit now
  • Loading branch information
therecipe committed Dec 17, 2018
1 parent 5251d34 commit 5746a84
Show file tree
Hide file tree
Showing 179 changed files with 560,505 additions and 4,617 deletions.
22 changes: 13 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
.DS_Store
*.log
*.pro
*.pro.user
*.qmake.stash
*.qmlc
*.so
*.trace
*.vagrant
*.log
*/cgo_*
*/minimal_*
.DS_Store
Mfile*

*/*-minimal.*
*/*.o
*/*_string.go
/internal/examples/**/deploy
/internal/examples/**/rcc*
/internal/examples/**/moc*
*/cgo_*
*/minimal_*

/internal/binding/dump/*
/internal/cmd/moc/test/**/moc*
*.so
*/*.o
/internal/examples/**/deploy
/internal/examples/**/moc*
/internal/examples/**/rcc*
5 changes: 5 additions & 0 deletions androidextras/androidextras.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,11 @@ func (ptr *QAndroidJniEnvironment) JavaVM() unsafe.Pointer {
return nil
}

func (ptr *QAndroidJniEnvironment) FindClass(className string) unsafe.Pointer {

return nil
}

func (ptr *QAndroidJniEnvironment) DestroyQAndroidJniEnvironment() {

}
Expand Down
5 changes: 5 additions & 0 deletions androidextras/androidextras_android.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,11 @@ void* QAndroidJniEnvironment_QAndroidJniEnvironment_JavaVM()
return QAndroidJniEnvironment::javaVM();
}

void* QAndroidJniEnvironment_FindClass(void* ptr, char* className)
{
return static_cast<QAndroidJniEnvironment*>(ptr)->findClass(const_cast<const char*>(className));
}

void QAndroidJniEnvironment_DestroyQAndroidJniEnvironment(void* ptr)
{
static_cast<QAndroidJniEnvironment*>(ptr)->~QAndroidJniEnvironment();
Expand Down
12 changes: 12 additions & 0 deletions androidextras/androidextras_android.go
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,18 @@ func (ptr *QAndroidJniEnvironment) JavaVM() unsafe.Pointer {
return unsafe.Pointer(C.QAndroidJniEnvironment_QAndroidJniEnvironment_JavaVM())
}

func (ptr *QAndroidJniEnvironment) FindClass(className string) unsafe.Pointer {
if ptr.Pointer() != nil {
var classNameC *C.char
if className != "" {
classNameC = C.CString(className)
defer C.free(unsafe.Pointer(classNameC))
}
return unsafe.Pointer(C.QAndroidJniEnvironment_FindClass(ptr.Pointer(), classNameC))
}
return nil
}

func (ptr *QAndroidJniEnvironment) DestroyQAndroidJniEnvironment() {
if ptr.Pointer() != nil {
C.QAndroidJniEnvironment_DestroyQAndroidJniEnvironment(ptr.Pointer())
Expand Down
1 change: 1 addition & 0 deletions androidextras/androidextras_android.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ void QAndroidIntent_DestroyQAndroidIntentDefault(void* ptr);
void* QAndroidIntent_Handle(void* ptr);
void* QAndroidJniEnvironment_NewQAndroidJniEnvironment();
void* QAndroidJniEnvironment_QAndroidJniEnvironment_JavaVM();
void* QAndroidJniEnvironment_FindClass(void* ptr, char* className);
void QAndroidJniEnvironment_DestroyQAndroidJniEnvironment(void* ptr);
char QAndroidJniEnvironment_QAndroidJniEnvironment_ExceptionCheck();
void QAndroidJniEnvironment_QAndroidJniEnvironment_ExceptionDescribe();
Expand Down
64 changes: 59 additions & 5 deletions bluetooth/bluetooth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
#include <QTimerEvent>
#include <QUuid>
#include <QVariant>
#include <QVector>
#include <QWidget>
#include <QWindow>

Expand Down Expand Up @@ -109,6 +110,7 @@ class MyQBluetoothDeviceDiscoveryAgent: public QBluetoothDeviceDiscoveryAgent
MyQBluetoothDeviceDiscoveryAgent(const QBluetoothAddress &deviceAdapter, QObject *parent = Q_NULLPTR) : QBluetoothDeviceDiscoveryAgent(deviceAdapter, parent) {QBluetoothDeviceDiscoveryAgent_QBluetoothDeviceDiscoveryAgent_QRegisterMetaType();};
void Signal_Canceled() { callbackQBluetoothDeviceDiscoveryAgent_Canceled(this); };
void Signal_DeviceDiscovered(const QBluetoothDeviceInfo & info) { callbackQBluetoothDeviceDiscoveryAgent_DeviceDiscovered(this, const_cast<QBluetoothDeviceInfo*>(&info)); };
void Signal_DeviceUpdated(const QBluetoothDeviceInfo & info, QBluetoothDeviceInfo::Fields updatedFields) { callbackQBluetoothDeviceDiscoveryAgent_DeviceUpdated(this, const_cast<QBluetoothDeviceInfo*>(&info), updatedFields); };
void Signal_Error2(QBluetoothDeviceDiscoveryAgent::Error error) { callbackQBluetoothDeviceDiscoveryAgent_Error2(this, error); };
void Signal_Finished() { callbackQBluetoothDeviceDiscoveryAgent_Finished(this); };
void start() { callbackQBluetoothDeviceDiscoveryAgent_Start(this); };
Expand Down Expand Up @@ -255,6 +257,21 @@ void QBluetoothDeviceDiscoveryAgent_DeviceDiscovered(void* ptr, void* info)
static_cast<QBluetoothDeviceDiscoveryAgent*>(ptr)->deviceDiscovered(*static_cast<QBluetoothDeviceInfo*>(info));
}

void QBluetoothDeviceDiscoveryAgent_ConnectDeviceUpdated(void* ptr)
{
QObject::connect(static_cast<QBluetoothDeviceDiscoveryAgent*>(ptr), static_cast<void (QBluetoothDeviceDiscoveryAgent::*)(const QBluetoothDeviceInfo &, QBluetoothDeviceInfo::Fields)>(&QBluetoothDeviceDiscoveryAgent::deviceUpdated), static_cast<MyQBluetoothDeviceDiscoveryAgent*>(ptr), static_cast<void (MyQBluetoothDeviceDiscoveryAgent::*)(const QBluetoothDeviceInfo &, QBluetoothDeviceInfo::Fields)>(&MyQBluetoothDeviceDiscoveryAgent::Signal_DeviceUpdated));
}

void QBluetoothDeviceDiscoveryAgent_DisconnectDeviceUpdated(void* ptr)
{
QObject::disconnect(static_cast<QBluetoothDeviceDiscoveryAgent*>(ptr), static_cast<void (QBluetoothDeviceDiscoveryAgent::*)(const QBluetoothDeviceInfo &, QBluetoothDeviceInfo::Fields)>(&QBluetoothDeviceDiscoveryAgent::deviceUpdated), static_cast<MyQBluetoothDeviceDiscoveryAgent*>(ptr), static_cast<void (MyQBluetoothDeviceDiscoveryAgent::*)(const QBluetoothDeviceInfo &, QBluetoothDeviceInfo::Fields)>(&MyQBluetoothDeviceDiscoveryAgent::Signal_DeviceUpdated));
}

void QBluetoothDeviceDiscoveryAgent_DeviceUpdated(void* ptr, void* info, long long updatedFields)
{
static_cast<QBluetoothDeviceDiscoveryAgent*>(ptr)->deviceUpdated(*static_cast<QBluetoothDeviceInfo*>(info), static_cast<QBluetoothDeviceInfo::Field>(updatedFields));
}

void QBluetoothDeviceDiscoveryAgent_ConnectError2(void* ptr)
{
qRegisterMetaType<QBluetoothDeviceDiscoveryAgent::Error>();
Expand Down Expand Up @@ -529,6 +546,11 @@ void* QBluetoothDeviceInfo_NewQBluetoothDeviceInfo3(void* uuid, struct QtBluetoo
return new QBluetoothDeviceInfo(*static_cast<QBluetoothUuid*>(uuid), QString::fromUtf8(name.data, name.len), classOfDevice);
}

char QBluetoothDeviceInfo_SetManufacturerData(void* ptr, unsigned short manufacturerId, void* data)
{
return static_cast<QBluetoothDeviceInfo*>(ptr)->setManufacturerData(manufacturerId, *static_cast<QByteArray*>(data));
}

void QBluetoothDeviceInfo_SetCached(void* ptr, char cached)
{
static_cast<QBluetoothDeviceInfo*>(ptr)->setCached(cached != 0);
Expand Down Expand Up @@ -594,6 +616,11 @@ struct QtBluetooth_PackedString QBluetoothDeviceInfo_Name(void* ptr)
return ({ QByteArray t605955 = static_cast<QBluetoothDeviceInfo*>(ptr)->name().toUtf8(); QtBluetooth_PackedString { const_cast<char*>(t605955.prepend("WHITESPACE").constData()+10), t605955.size()-10 }; });
}

struct QtBluetooth_PackedList QBluetoothDeviceInfo_ManufacturerIds(void* ptr)
{
return ({ QVector<quint16>* tmpValue = new QVector<quint16>(static_cast<QBluetoothDeviceInfo*>(ptr)->manufacturerIds()); QtBluetooth_PackedList { tmpValue, tmpValue->size() }; });
}

char QBluetoothDeviceInfo_IsCached(void* ptr)
{
return static_cast<QBluetoothDeviceInfo*>(ptr)->isCached();
Expand Down Expand Up @@ -646,6 +673,38 @@ void* QBluetoothDeviceInfo___serviceUuids_newList(void* ptr)
return new QList<QBluetoothUuid>();
}

unsigned short QBluetoothDeviceInfo___manufacturerIds_atList(void* ptr, int i)
{
return ({quint16 tmp = static_cast<QVector<quint16>*>(ptr)->at(i); if (i == static_cast<QVector<quint16>*>(ptr)->size()-1) { static_cast<QVector<quint16>*>(ptr)->~QVector(); free(ptr); }; tmp; });
}

void QBluetoothDeviceInfo___manufacturerIds_setList(void* ptr, unsigned short i)
{
static_cast<QVector<quint16>*>(ptr)->append(i);
}

void* QBluetoothDeviceInfo___manufacturerIds_newList(void* ptr)
{
Q_UNUSED(ptr);
return new QVector<quint16>();
}

unsigned short QBluetoothDeviceInfo_____manufacturerData_keyList_atList2(void* ptr, int i)
{
return ({quint16 tmp = static_cast<QList<quint16>*>(ptr)->at(i); if (i == static_cast<QList<quint16>*>(ptr)->size()-1) { static_cast<QList<quint16>*>(ptr)->~QList(); free(ptr); }; tmp; });
}

void QBluetoothDeviceInfo_____manufacturerData_keyList_setList2(void* ptr, unsigned short i)
{
static_cast<QList<quint16>*>(ptr)->append(i);
}

void* QBluetoothDeviceInfo_____manufacturerData_keyList_newList2(void* ptr)
{
Q_UNUSED(ptr);
return new QList<quint16>();
}

void* QBluetoothHostInfo_NewQBluetoothHostInfo()
{
return new QBluetoothHostInfo();
Expand Down Expand Up @@ -3305,11 +3364,6 @@ void QLowEnergyAdvertisingData_DestroyQLowEnergyAdvertisingData(void* ptr)
static_cast<QLowEnergyAdvertisingData*>(ptr)->~QLowEnergyAdvertisingData();
}

void* QLowEnergyAdvertisingData_ManufacturerData(void* ptr)
{
return new QByteArray(static_cast<QLowEnergyAdvertisingData*>(ptr)->manufacturerData());
}

void* QLowEnergyAdvertisingData_RawData(void* ptr)
{
return new QByteArray(static_cast<QLowEnergyAdvertisingData*>(ptr)->rawData());
Expand Down
115 changes: 106 additions & 9 deletions bluetooth/bluetooth.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ const (
OSXBluetooth__characteristicRead OSXBluetooth__OperationTimeout = OSXBluetooth__OperationTimeout(4)
OSXBluetooth__descriptorsDiscovery OSXBluetooth__OperationTimeout = OSXBluetooth__OperationTimeout(5)
OSXBluetooth__descriptorRead OSXBluetooth__OperationTimeout = OSXBluetooth__OperationTimeout(6)
OSXBluetooth__characteristicWrite OSXBluetooth__OperationTimeout = OSXBluetooth__OperationTimeout(7)
)

type QBluetooth struct {
Expand Down Expand Up @@ -509,6 +510,45 @@ func (ptr *QBluetoothDeviceDiscoveryAgent) DeviceDiscovered(info QBluetoothDevic
}
}

//export callbackQBluetoothDeviceDiscoveryAgent_DeviceUpdated
func callbackQBluetoothDeviceDiscoveryAgent_DeviceUpdated(ptr unsafe.Pointer, info unsafe.Pointer, updatedFields C.longlong) {
if signal := qt.GetSignal(ptr, "deviceUpdated"); signal != nil {
signal.(func(*QBluetoothDeviceInfo, QBluetoothDeviceInfo__Field))(NewQBluetoothDeviceInfoFromPointer(info), QBluetoothDeviceInfo__Field(updatedFields))
}

}

func (ptr *QBluetoothDeviceDiscoveryAgent) ConnectDeviceUpdated(f func(info *QBluetoothDeviceInfo, updatedFields QBluetoothDeviceInfo__Field)) {
if ptr.Pointer() != nil {

if !qt.ExistsSignal(ptr.Pointer(), "deviceUpdated") {
C.QBluetoothDeviceDiscoveryAgent_ConnectDeviceUpdated(ptr.Pointer())
}

if signal := qt.LendSignal(ptr.Pointer(), "deviceUpdated"); signal != nil {
qt.ConnectSignal(ptr.Pointer(), "deviceUpdated", func(info *QBluetoothDeviceInfo, updatedFields QBluetoothDeviceInfo__Field) {
signal.(func(*QBluetoothDeviceInfo, QBluetoothDeviceInfo__Field))(info, updatedFields)
f(info, updatedFields)
})
} else {
qt.ConnectSignal(ptr.Pointer(), "deviceUpdated", f)
}
}
}

func (ptr *QBluetoothDeviceDiscoveryAgent) DisconnectDeviceUpdated() {
if ptr.Pointer() != nil {
C.QBluetoothDeviceDiscoveryAgent_DisconnectDeviceUpdated(ptr.Pointer())
qt.DisconnectSignal(ptr.Pointer(), "deviceUpdated")
}
}

func (ptr *QBluetoothDeviceDiscoveryAgent) DeviceUpdated(info QBluetoothDeviceInfo_ITF, updatedFields QBluetoothDeviceInfo__Field) {
if ptr.Pointer() != nil {
C.QBluetoothDeviceDiscoveryAgent_DeviceUpdated(ptr.Pointer(), PointerFromQBluetoothDeviceInfo(info), C.longlong(updatedFields))
}
}

//export callbackQBluetoothDeviceDiscoveryAgent_Error2
func callbackQBluetoothDeviceDiscoveryAgent_Error2(ptr unsafe.Pointer, error C.longlong) {
if signal := qt.GetSignal(ptr, "error2"); signal != nil {
Expand Down Expand Up @@ -1157,6 +1197,17 @@ const (
QBluetoothDeviceInfo__DataUnavailable QBluetoothDeviceInfo__DataCompleteness = QBluetoothDeviceInfo__DataCompleteness(2)
)

//go:generate stringer -type=QBluetoothDeviceInfo__Field
//QBluetoothDeviceInfo::Field
type QBluetoothDeviceInfo__Field int64

const (
QBluetoothDeviceInfo__None QBluetoothDeviceInfo__Field = QBluetoothDeviceInfo__Field(0x0000)
QBluetoothDeviceInfo__RSSI QBluetoothDeviceInfo__Field = QBluetoothDeviceInfo__Field(0x0001)
QBluetoothDeviceInfo__ManufacturerData QBluetoothDeviceInfo__Field = QBluetoothDeviceInfo__Field(0x0002)
QBluetoothDeviceInfo__All QBluetoothDeviceInfo__Field = QBluetoothDeviceInfo__Field(0x7fff)
)

//go:generate stringer -type=QBluetoothDeviceInfo__MajorDeviceClass
//QBluetoothDeviceInfo::MajorDeviceClass
type QBluetoothDeviceInfo__MajorDeviceClass int64
Expand Down Expand Up @@ -1370,6 +1421,13 @@ func NewQBluetoothDeviceInfo3(uuid QBluetoothUuid_ITF, name string, classOfDevic
return tmpValue
}

func (ptr *QBluetoothDeviceInfo) SetManufacturerData(manufacturerId uint16, data core.QByteArray_ITF) bool {
if ptr.Pointer() != nil {
return int8(C.QBluetoothDeviceInfo_SetManufacturerData(ptr.Pointer(), C.ushort(manufacturerId), core.PointerFromQByteArray(data))) != 0
}
return false
}

func (ptr *QBluetoothDeviceInfo) SetCached(cached bool) {
if ptr.Pointer() != nil {
C.QBluetoothDeviceInfo_SetCached(ptr.Pointer(), C.char(int8(qt.GoBoolToInt(cached))))
Expand Down Expand Up @@ -1467,6 +1525,20 @@ func (ptr *QBluetoothDeviceInfo) Name() string {
return ""
}

func (ptr *QBluetoothDeviceInfo) ManufacturerIds() []uint16 {
if ptr.Pointer() != nil {
return func(l C.struct_QtBluetooth_PackedList) []uint16 {
out := make([]uint16, int(l.len))
tmpList := NewQBluetoothDeviceInfoFromPointer(l.data)
for i := 0; i < len(out); i++ {
out[i] = tmpList.__manufacturerIds_atList(i)
}
return out
}(C.QBluetoothDeviceInfo_ManufacturerIds(ptr.Pointer()))
}
return make([]uint16, 0)
}

func (ptr *QBluetoothDeviceInfo) IsCached() bool {
if ptr.Pointer() != nil {
return int8(C.QBluetoothDeviceInfo_IsCached(ptr.Pointer())) != 0
Expand Down Expand Up @@ -1533,6 +1605,40 @@ func (ptr *QBluetoothDeviceInfo) __serviceUuids_newList() unsafe.Pointer {
return C.QBluetoothDeviceInfo___serviceUuids_newList(ptr.Pointer())
}

func (ptr *QBluetoothDeviceInfo) __manufacturerIds_atList(i int) uint16 {
if ptr.Pointer() != nil {
return uint16(C.QBluetoothDeviceInfo___manufacturerIds_atList(ptr.Pointer(), C.int(int32(i))))
}
return 0
}

func (ptr *QBluetoothDeviceInfo) __manufacturerIds_setList(i uint16) {
if ptr.Pointer() != nil {
C.QBluetoothDeviceInfo___manufacturerIds_setList(ptr.Pointer(), C.ushort(i))
}
}

func (ptr *QBluetoothDeviceInfo) __manufacturerIds_newList() unsafe.Pointer {
return C.QBluetoothDeviceInfo___manufacturerIds_newList(ptr.Pointer())
}

func (ptr *QBluetoothDeviceInfo) ____manufacturerData_keyList_atList2(i int) uint16 {
if ptr.Pointer() != nil {
return uint16(C.QBluetoothDeviceInfo_____manufacturerData_keyList_atList2(ptr.Pointer(), C.int(int32(i))))
}
return 0
}

func (ptr *QBluetoothDeviceInfo) ____manufacturerData_keyList_setList2(i uint16) {
if ptr.Pointer() != nil {
C.QBluetoothDeviceInfo_____manufacturerData_keyList_setList2(ptr.Pointer(), C.ushort(i))
}
}

func (ptr *QBluetoothDeviceInfo) ____manufacturerData_keyList_newList2() unsafe.Pointer {
return C.QBluetoothDeviceInfo_____manufacturerData_keyList_newList2(ptr.Pointer())
}

type QBluetoothHostInfo struct {
ptr unsafe.Pointer
}
Expand Down Expand Up @@ -7352,15 +7458,6 @@ func (ptr *QLowEnergyAdvertisingData) DestroyQLowEnergyAdvertisingData() {
}
}

func (ptr *QLowEnergyAdvertisingData) ManufacturerData() *core.QByteArray {
if ptr.Pointer() != nil {
tmpValue := core.NewQByteArrayFromPointer(C.QLowEnergyAdvertisingData_ManufacturerData(ptr.Pointer()))
runtime.SetFinalizer(tmpValue, (*core.QByteArray).DestroyQByteArray)
return tmpValue
}
return nil
}

func (ptr *QLowEnergyAdvertisingData) RawData() *core.QByteArray {
if ptr.Pointer() != nil {
tmpValue := core.NewQByteArrayFromPointer(C.QLowEnergyAdvertisingData_RawData(ptr.Pointer()))
Expand Down
Loading

0 comments on commit 5746a84

Please sign in to comment.