Skip to content

Commit

Permalink
qt: rebuild (hide private classes, fix qintptr pointers)
Browse files Browse the repository at this point in the history
  • Loading branch information
mappu committed Nov 19, 2024
1 parent 392a924 commit 3902c9d
Show file tree
Hide file tree
Showing 118 changed files with 750 additions and 5,912 deletions.
9 changes: 0 additions & 9 deletions qt/gen_qarraydata.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include <QArrayData>
#define WORKAROUND_INNER_CLASS_DEFINITION_QtPrivate__QContainerImplHelper
#include <qarraydata.h>
#include "gen_qarraydata.h"
#include "_cgo_export.h"
Expand Down Expand Up @@ -62,11 +61,3 @@ void QArrayData_Delete(QArrayData* self, bool isSubclass) {
}
}

void QtPrivate__QContainerImplHelper_Delete(QtPrivate__QContainerImplHelper* self, bool isSubclass) {
if (isSubclass) {
delete dynamic_cast<QtPrivate::QContainerImplHelper*>( self );
} else {
delete self;
}
}

50 changes: 0 additions & 50 deletions qt/gen_qarraydata.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,53 +129,3 @@ func (this *QArrayData) GoGC() {
runtime.KeepAlive(this.h)
})
}

type QtPrivate__QContainerImplHelper struct {
h *C.QtPrivate__QContainerImplHelper
isSubclass bool
}

func (this *QtPrivate__QContainerImplHelper) cPointer() *C.QtPrivate__QContainerImplHelper {
if this == nil {
return nil
}
return this.h
}

func (this *QtPrivate__QContainerImplHelper) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}

// newQtPrivate__QContainerImplHelper constructs the type using only CGO pointers.
func newQtPrivate__QContainerImplHelper(h *C.QtPrivate__QContainerImplHelper) *QtPrivate__QContainerImplHelper {
if h == nil {
return nil
}
return &QtPrivate__QContainerImplHelper{h: h}
}

// UnsafeNewQtPrivate__QContainerImplHelper constructs the type using only unsafe pointers.
func UnsafeNewQtPrivate__QContainerImplHelper(h unsafe.Pointer) *QtPrivate__QContainerImplHelper {
if h == nil {
return nil
}

return &QtPrivate__QContainerImplHelper{h: (*C.QtPrivate__QContainerImplHelper)(h)}
}

// Delete this object from C++ memory.
func (this *QtPrivate__QContainerImplHelper) Delete() {
C.QtPrivate__QContainerImplHelper_Delete(this.h, C.bool(this.isSubclass))
}

// 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 *QtPrivate__QContainerImplHelper) GoGC() {
runtime.SetFinalizer(this, func(this *QtPrivate__QContainerImplHelper) {
this.Delete()
runtime.KeepAlive(this.h)
})
}
8 changes: 0 additions & 8 deletions qt/gen_qarraydata.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,8 @@ extern "C" {

#ifdef __cplusplus
class QArrayData;
#if defined(WORKAROUND_INNER_CLASS_DEFINITION_QtPrivate__QContainerImplHelper)
typedef QtPrivate::QContainerImplHelper QtPrivate__QContainerImplHelper;
#else
class QtPrivate__QContainerImplHelper;
#endif
#else
typedef struct QArrayData QArrayData;
typedef struct QtPrivate__QContainerImplHelper QtPrivate__QContainerImplHelper;
#endif

void* QArrayData_Data(QArrayData* self);
Expand All @@ -40,8 +34,6 @@ QArrayData* QArrayData_Allocate4(size_t objectSize, size_t alignment, size_t cap
QArrayData* QArrayData_ReallocateUnaligned4(QArrayData* data, size_t objectSize, size_t newCapacity, int newOptions);
void QArrayData_Delete(QArrayData* self, bool isSubclass);

void QtPrivate__QContainerImplHelper_Delete(QtPrivate__QContainerImplHelper* self, bool isSubclass);

#ifdef __cplusplus
} /* extern C */
#endif
Expand Down
14 changes: 0 additions & 14 deletions qt/gen_qdatastream.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include <QByteArray>
#include <QDataStream>
#include <QIODevice>
#define WORKAROUND_INNER_CLASS_DEFINITION_QtPrivate__StreamStateSaver
#include <qdatastream.h>
#include "gen_qdatastream.h"
#include "_cgo_export.h"
Expand Down Expand Up @@ -219,16 +218,3 @@ void QDataStream_Delete(QDataStream* self, bool isSubclass) {
}
}

void QtPrivate__StreamStateSaver_new(QDataStream* s, QtPrivate__StreamStateSaver** outptr_QtPrivate__StreamStateSaver) {
QtPrivate::StreamStateSaver* ret = new QtPrivate::StreamStateSaver(s);
*outptr_QtPrivate__StreamStateSaver = ret;
}

void QtPrivate__StreamStateSaver_Delete(QtPrivate__StreamStateSaver* self, bool isSubclass) {
if (isSubclass) {
delete dynamic_cast<QtPrivate::StreamStateSaver*>( self );
} else {
delete self;
}
}

60 changes: 0 additions & 60 deletions qt/gen_qdatastream.go
Original file line number Diff line number Diff line change
Expand Up @@ -352,63 +352,3 @@ func (this *QDataStream) GoGC() {
runtime.KeepAlive(this.h)
})
}

type QtPrivate__StreamStateSaver struct {
h *C.QtPrivate__StreamStateSaver
isSubclass bool
}

func (this *QtPrivate__StreamStateSaver) cPointer() *C.QtPrivate__StreamStateSaver {
if this == nil {
return nil
}
return this.h
}

func (this *QtPrivate__StreamStateSaver) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}

// newQtPrivate__StreamStateSaver constructs the type using only CGO pointers.
func newQtPrivate__StreamStateSaver(h *C.QtPrivate__StreamStateSaver) *QtPrivate__StreamStateSaver {
if h == nil {
return nil
}
return &QtPrivate__StreamStateSaver{h: h}
}

// UnsafeNewQtPrivate__StreamStateSaver constructs the type using only unsafe pointers.
func UnsafeNewQtPrivate__StreamStateSaver(h unsafe.Pointer) *QtPrivate__StreamStateSaver {
if h == nil {
return nil
}

return &QtPrivate__StreamStateSaver{h: (*C.QtPrivate__StreamStateSaver)(h)}
}

// NewQtPrivate__StreamStateSaver constructs a new QtPrivate::StreamStateSaver object.
func NewQtPrivate__StreamStateSaver(s *QDataStream) *QtPrivate__StreamStateSaver {
var outptr_QtPrivate__StreamStateSaver *C.QtPrivate__StreamStateSaver = nil

C.QtPrivate__StreamStateSaver_new(s.cPointer(), &outptr_QtPrivate__StreamStateSaver)
ret := newQtPrivate__StreamStateSaver(outptr_QtPrivate__StreamStateSaver)
ret.isSubclass = true
return ret
}

// Delete this object from C++ memory.
func (this *QtPrivate__StreamStateSaver) Delete() {
C.QtPrivate__StreamStateSaver_Delete(this.h, C.bool(this.isSubclass))
}

// 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 *QtPrivate__StreamStateSaver) GoGC() {
runtime.SetFinalizer(this, func(this *QtPrivate__StreamStateSaver) {
this.Delete()
runtime.KeepAlive(this.h)
})
}
9 changes: 0 additions & 9 deletions qt/gen_qdatastream.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,10 @@ extern "C" {
class QByteArray;
class QDataStream;
class QIODevice;
#if defined(WORKAROUND_INNER_CLASS_DEFINITION_QtPrivate__StreamStateSaver)
typedef QtPrivate::StreamStateSaver QtPrivate__StreamStateSaver;
#else
class QtPrivate__StreamStateSaver;
#endif
#else
typedef struct QByteArray QByteArray;
typedef struct QDataStream QDataStream;
typedef struct QIODevice QIODevice;
typedef struct QtPrivate__StreamStateSaver QtPrivate__StreamStateSaver;
#endif

void QDataStream_new(QDataStream** outptr_QDataStream);
Expand Down Expand Up @@ -81,9 +75,6 @@ void QDataStream_RollbackTransaction(QDataStream* self);
void QDataStream_AbortTransaction(QDataStream* self);
void QDataStream_Delete(QDataStream* self, bool isSubclass);

void QtPrivate__StreamStateSaver_new(QDataStream* s, QtPrivate__StreamStateSaver** outptr_QtPrivate__StreamStateSaver);
void QtPrivate__StreamStateSaver_Delete(QtPrivate__StreamStateSaver* self, bool isSubclass);

#ifdef __cplusplus
} /* extern C */
#endif
Expand Down
39 changes: 0 additions & 39 deletions qt/gen_qexception.cpp

This file was deleted.

136 changes: 0 additions & 136 deletions qt/gen_qexception.go

This file was deleted.

Loading

0 comments on commit 3902c9d

Please sign in to comment.