Merge pull request #205 from rcalixte/qt_pdf

Add Qt PDF
This commit is contained in:
mappu 2025-04-24 21:51:43 +12:00 committed by GitHub
commit da7c82a719
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
72 changed files with 35074 additions and 4 deletions

2
.gitignore vendored
View File

@ -35,6 +35,7 @@ examples/modelview_color6/modelview_color6
examples/libraries/extras-scintillaedit/extras-scintillaedit examples/libraries/extras-scintillaedit/extras-scintillaedit
examples/libraries/qt-multimedia/qt-multimedia examples/libraries/qt-multimedia/qt-multimedia
examples/libraries/qt-network/qt-network examples/libraries/qt-network/qt-network
examples/libraries/qt-pdf/qt-pdf
examples/libraries/qt-printsupport/qt-printsupport examples/libraries/qt-printsupport/qt-printsupport
examples/libraries/qt-script/qt-script examples/libraries/qt-script/qt-script
examples/libraries/qt-svg/qt-svg examples/libraries/qt-svg/qt-svg
@ -43,6 +44,7 @@ examples/libraries/qt-webkit/qt-webkit
examples/libraries/qt6-multimedia/qt6-multimedia examples/libraries/qt6-multimedia/qt6-multimedia
examples/libraries/qt6-network/qt6-network examples/libraries/qt6-network/qt6-network
examples/libraries/qt6-network-sctp/qt6-network-sctp examples/libraries/qt6-network-sctp/qt6-network-sctp
examples/libraries/qt6-pdf/qt6-pdf
examples/libraries/qt6-webengine/qt6-webengine examples/libraries/qt6-webengine/qt6-webengine
examples/libraries/restricted-extras-charts6/restricted-extras-charts6 examples/libraries/restricted-extras-charts6/restricted-extras-charts6
examples/libraries/restricted-extras-qscintilla/restricted-extras-qscintilla examples/libraries/restricted-extras-qscintilla/restricted-extras-qscintilla

View File

@ -149,7 +149,7 @@ For dynamic linking, with the system Qt (Qt 5):
apt install qtbase5-dev build-essential golang-go apt install qtbase5-dev build-essential golang-go
# Debian / Ubuntu (Full) # Debian / Ubuntu (Full)
apt install qtbase5-dev libqscintilla2-qt5-dev libqt5svg5-dev libqt5webchannel5-dev libqt5webkit5-dev qtbase5-private-dev qtmultimedia5-dev qtwebengine5-dev qtwebengine5-private-dev build-essential golang-go apt install qtbase5-dev libqscintilla2-qt5-dev libqt5svg5-dev libqt5webchannel5-dev libqt5webkit5-dev qtbase5-private-dev qtmultimedia5-dev qtpdf5-dev qtwebengine5-dev qtwebengine5-private-dev build-essential golang-go
``` ```
For dynamic linking, with the system Qt (Qt 6): For dynamic linking, with the system Qt (Qt 6):
@ -159,10 +159,10 @@ For dynamic linking, with the system Qt (Qt 6):
apt install qt6-base-dev build-essential golang-go apt install qt6-base-dev build-essential golang-go
# Debian / Ubuntu (Full) # Debian / Ubuntu (Full)
apt install qt6-base-dev libqscintilla2-qt6-dev qt6-base-private-dev qt6-charts-dev qt6-multimedia-dev qt6-svg-dev qt6-webchannel-dev qt6-webengine-dev qt6-declarative-dev qml6-module-qtquick-{controls,shapes,layouts,templates,window} build-essential golang-go apt install qt6-base-dev libqscintilla2-qt6-dev qt6-base-private-dev qt6-charts-dev qt6-multimedia-dev qt6-pdf-dev qt6-svg-dev qt6-webchannel-dev qt6-webengine-dev qt6-declarative-dev qml6-module-qtquick-{controls,shapes,layouts,templates,window} build-essential golang-go
# Fedora # Fedora
dnf install qt6-qtbase-devel qscintilla-qt6-devel qt6-qtcharts-devel qt6-qtmultimedia-devel qt6-qtsvg-devel qt6-qtwebchannel-devel qt6-qtwebengine-devel qt6-qtdeclarative-devel golang dnf install qt6-qtbase-devel qscintilla-qt6-devel qt6-qtcharts-devel qt6-qtmultimedia-devel qt6-qtpdf-devel qt6-qtsvg-devel qt6-qtwebchannel-devel qt6-qtwebengine-devel qt6-qtdeclarative-devel golang
# Manjaro # Manjaro
pamac install qt6-base qscintilla-qt6 qt6-charts qt6-multimedia qt6-svg qt6-webchannel qt6-webengine qt6-declarative go pamac install qt6-base qscintilla-qt6 qt6-charts qt6-multimedia qt6-svg qt6-webchannel qt6-webengine qt6-declarative go
@ -260,7 +260,7 @@ To add an icon and other properties to the .exe, you can use [the go-winres tool
pkg install git pkg install git
pkg install devel/pkgconf pkg install devel/pkgconf
pkg install go pkg install go
pkg install qt6-base qt6-charts qt6-multimedia qt6-svg qt6-webchannel qt6-webengine qt6-declarative qscintilla2-qt6 pkg install qt6-base qt6-charts qt6-multimedia qt6-pdf qt6-svg qt6-webchannel qt6-webengine qt6-declarative qscintilla2-qt6
go build -ldflags '-s -w' go build -ldflags '-s -w'
``` ```

View File

@ -200,6 +200,22 @@ func ProcessLibraries(clangBin, outDir, extraLibsDir string) {
ClangMatchSameHeaderDefinitionOnly, ClangMatchSameHeaderDefinitionOnly,
) )
// Qt 5 PDF
// Depends on QtCore/Gui/Widgets
generate(
"qt/pdf",
[]string{
"/usr/include/x86_64-linux-gnu/qt5/QtPdf",
"/usr/include/x86_64-linux-gnu/qt5/QtPdfWidgets",
},
AllowAllHeaders,
clangBin,
pkgConfigCflags("Qt5PdfWidgets"),
outDir,
ClangMatchSameHeaderDefinitionOnly,
)
// Depends on QtCore/Gui/Widgets, QPrintSupport // Depends on QtCore/Gui/Widgets, QPrintSupport
generate( generate(
"qt-restricted-extras/qscintilla", "qt-restricted-extras/qscintilla",
@ -434,6 +450,23 @@ func ProcessLibraries(clangBin, outDir, extraLibsDir string) {
ClangMatchSameHeaderDefinitionOnly, ClangMatchSameHeaderDefinitionOnly,
) )
// Qt 6 PDF
generate(
"qt6/pdf",
[]string{
"/usr/include/x86_64-linux-gnu/qt6/QtPdf",
"/usr/include/x86_64-linux-gnu/qt6/QtPdfWidgets",
},
AllowAllHeaders,
clangBin,
"--std=c++17 "+pkgConfigCflags("Qt6PdfWidgets"),
outDir,
ClangMatchSameHeaderDefinitionOnly,
)
// Qt 6 Charts // Qt 6 Charts
// Depends on QtCore/Gui/Widgets // Depends on QtCore/Gui/Widgets
generate( generate(

View File

@ -5,6 +5,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
golang-go \ golang-go \
qtbase5-dev \ qtbase5-dev \
qtmultimedia5-dev \ qtmultimedia5-dev \
qtpdf5-dev \
qtscript5-dev \ qtscript5-dev \
libqt5svg5-dev \ libqt5svg5-dev \
libqt5webkit5-dev \ libqt5webkit5-dev \
@ -13,6 +14,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
qt6-charts-dev \ qt6-charts-dev \
qt6-declarative-dev \ qt6-declarative-dev \
qt6-multimedia-dev \ qt6-multimedia-dev \
qt6-pdf-dev \
qt6-svg-dev \ qt6-svg-dev \
qt6-webengine-dev \ qt6-webengine-dev \
libqscintilla2-qt5-dev \ libqscintilla2-qt5-dev \

Binary file not shown.

View File

@ -0,0 +1,27 @@
package main
import (
"os"
"github.com/mappu/miqt/qt"
"github.com/mappu/miqt/qt/pdf"
)
func main() {
qt.NewQApplication(os.Args)
d := pdf.NewQPdfDocument()
d.Load("example.pdf")
p := pdf.NewQPdfView2()
p.SetWindowTitle("Qt 5 PDF Example")
p.SetMinimumSize2(650, 600)
p.SetPageMode(pdf.QPdfView__MultiPage)
p.SetZoomMode(pdf.QPdfView__FitInView)
p.SetDocument(d)
p.Show()
qt.QApplication_Exec()
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

View File

@ -0,0 +1,27 @@
package main
import (
"os"
qt "github.com/mappu/miqt/qt6"
"github.com/mappu/miqt/qt6/pdf"
)
func main() {
qt.NewQApplication(os.Args)
d := pdf.NewQPdfDocument()
d.Load("example.pdf")
p := pdf.NewQPdfView2()
p.SetWindowTitle("Qt 6 PDF Example")
p.SetMinimumSize2(650, 600)
p.SetPageMode(pdf.QPdfView__MultiPage)
p.SetZoomMode(pdf.QPdfView__FitInView)
p.SetDocument(d)
p.Show()
qt.QApplication_Exec()
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

7
qt/pdf/cflags.go Normal file
View File

@ -0,0 +1,7 @@
package pdf
/*
#cgo pkg-config: Qt5PdfWidgets
*/
import "C"

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,187 @@
#pragma once
#ifndef MIQT_QT_PDF_GEN_QPDFBOOKMARKMODEL_H
#define MIQT_QT_PDF_GEN_QPDFBOOKMARKMODEL_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 QAbstractItemModel;
class QChildEvent;
class QDataStream;
class QEvent;
class QMetaMethod;
class QMetaObject;
class QMimeData;
class QModelIndex;
class QObject;
class QPdfBookmarkModel;
class QPdfDocument;
class QSize;
class QTimerEvent;
class QVariant;
#else
typedef struct QAbstractItemModel QAbstractItemModel;
typedef struct QChildEvent QChildEvent;
typedef struct QDataStream QDataStream;
typedef struct QEvent QEvent;
typedef struct QMetaMethod QMetaMethod;
typedef struct QMetaObject QMetaObject;
typedef struct QMimeData QMimeData;
typedef struct QModelIndex QModelIndex;
typedef struct QObject QObject;
typedef struct QPdfBookmarkModel QPdfBookmarkModel;
typedef struct QPdfDocument QPdfDocument;
typedef struct QSize QSize;
typedef struct QTimerEvent QTimerEvent;
typedef struct QVariant QVariant;
#endif
QPdfBookmarkModel* QPdfBookmarkModel_new();
QPdfBookmarkModel* QPdfBookmarkModel_new2(QObject* parent);
void QPdfBookmarkModel_virtbase(QPdfBookmarkModel* src, QAbstractItemModel** outptr_QAbstractItemModel);
QMetaObject* QPdfBookmarkModel_metaObject(const QPdfBookmarkModel* self);
void* QPdfBookmarkModel_metacast(QPdfBookmarkModel* self, const char* param1);
struct miqt_string QPdfBookmarkModel_tr(const char* s);
struct miqt_string QPdfBookmarkModel_trUtf8(const char* s);
QPdfDocument* QPdfBookmarkModel_document(const QPdfBookmarkModel* self);
void QPdfBookmarkModel_setDocument(QPdfBookmarkModel* self, QPdfDocument* document);
int QPdfBookmarkModel_structureMode(const QPdfBookmarkModel* self);
void QPdfBookmarkModel_setStructureMode(QPdfBookmarkModel* self, int mode);
QVariant* QPdfBookmarkModel_data(const QPdfBookmarkModel* self, QModelIndex* index, int role);
QModelIndex* QPdfBookmarkModel_index(const QPdfBookmarkModel* self, int row, int column, QModelIndex* parent);
QModelIndex* QPdfBookmarkModel_parent(const QPdfBookmarkModel* self, QModelIndex* index);
int QPdfBookmarkModel_rowCount(const QPdfBookmarkModel* self, QModelIndex* parent);
int QPdfBookmarkModel_columnCount(const QPdfBookmarkModel* self, QModelIndex* parent);
struct miqt_map /* of int to struct miqt_string */ QPdfBookmarkModel_roleNames(const QPdfBookmarkModel* self);
void QPdfBookmarkModel_documentChanged(QPdfBookmarkModel* self, QPdfDocument* document);
void QPdfBookmarkModel_connect_documentChanged(QPdfBookmarkModel* self, intptr_t slot);
void QPdfBookmarkModel_structureModeChanged(QPdfBookmarkModel* self, int structureMode);
void QPdfBookmarkModel_connect_structureModeChanged(QPdfBookmarkModel* self, intptr_t slot);
struct miqt_string QPdfBookmarkModel_tr2(const char* s, const char* c);
struct miqt_string QPdfBookmarkModel_tr3(const char* s, const char* c, int n);
struct miqt_string QPdfBookmarkModel_trUtf82(const char* s, const char* c);
struct miqt_string QPdfBookmarkModel_trUtf83(const char* s, const char* c, int n);
bool QPdfBookmarkModel_override_virtual_data(void* self, intptr_t slot);
QVariant* QPdfBookmarkModel_virtualbase_data(const void* self, QModelIndex* index, int role);
bool QPdfBookmarkModel_override_virtual_index(void* self, intptr_t slot);
QModelIndex* QPdfBookmarkModel_virtualbase_index(const void* self, int row, int column, QModelIndex* parent);
bool QPdfBookmarkModel_override_virtual_parent(void* self, intptr_t slot);
QModelIndex* QPdfBookmarkModel_virtualbase_parent(const void* self, QModelIndex* index);
bool QPdfBookmarkModel_override_virtual_rowCount(void* self, intptr_t slot);
int QPdfBookmarkModel_virtualbase_rowCount(const void* self, QModelIndex* parent);
bool QPdfBookmarkModel_override_virtual_columnCount(void* self, intptr_t slot);
int QPdfBookmarkModel_virtualbase_columnCount(const void* self, QModelIndex* parent);
bool QPdfBookmarkModel_override_virtual_roleNames(void* self, intptr_t slot);
struct miqt_map /* of int to struct miqt_string */ QPdfBookmarkModel_virtualbase_roleNames(const void* self);
bool QPdfBookmarkModel_override_virtual_sibling(void* self, intptr_t slot);
QModelIndex* QPdfBookmarkModel_virtualbase_sibling(const void* self, int row, int column, QModelIndex* idx);
bool QPdfBookmarkModel_override_virtual_hasChildren(void* self, intptr_t slot);
bool QPdfBookmarkModel_virtualbase_hasChildren(const void* self, QModelIndex* parent);
bool QPdfBookmarkModel_override_virtual_setData(void* self, intptr_t slot);
bool QPdfBookmarkModel_virtualbase_setData(void* self, QModelIndex* index, QVariant* value, int role);
bool QPdfBookmarkModel_override_virtual_headerData(void* self, intptr_t slot);
QVariant* QPdfBookmarkModel_virtualbase_headerData(const void* self, int section, int orientation, int role);
bool QPdfBookmarkModel_override_virtual_setHeaderData(void* self, intptr_t slot);
bool QPdfBookmarkModel_virtualbase_setHeaderData(void* self, int section, int orientation, QVariant* value, int role);
bool QPdfBookmarkModel_override_virtual_itemData(void* self, intptr_t slot);
struct miqt_map /* of int to QVariant* */ QPdfBookmarkModel_virtualbase_itemData(const void* self, QModelIndex* index);
bool QPdfBookmarkModel_override_virtual_setItemData(void* self, intptr_t slot);
bool QPdfBookmarkModel_virtualbase_setItemData(void* self, QModelIndex* index, struct miqt_map /* of int to QVariant* */ roles);
bool QPdfBookmarkModel_override_virtual_mimeTypes(void* self, intptr_t slot);
struct miqt_array /* of struct miqt_string */ QPdfBookmarkModel_virtualbase_mimeTypes(const void* self);
bool QPdfBookmarkModel_override_virtual_mimeData(void* self, intptr_t slot);
QMimeData* QPdfBookmarkModel_virtualbase_mimeData(const void* self, struct miqt_array /* of QModelIndex* */ indexes);
bool QPdfBookmarkModel_override_virtual_canDropMimeData(void* self, intptr_t slot);
bool QPdfBookmarkModel_virtualbase_canDropMimeData(const void* self, QMimeData* data, int action, int row, int column, QModelIndex* parent);
bool QPdfBookmarkModel_override_virtual_dropMimeData(void* self, intptr_t slot);
bool QPdfBookmarkModel_virtualbase_dropMimeData(void* self, QMimeData* data, int action, int row, int column, QModelIndex* parent);
bool QPdfBookmarkModel_override_virtual_supportedDropActions(void* self, intptr_t slot);
int QPdfBookmarkModel_virtualbase_supportedDropActions(const void* self);
bool QPdfBookmarkModel_override_virtual_supportedDragActions(void* self, intptr_t slot);
int QPdfBookmarkModel_virtualbase_supportedDragActions(const void* self);
bool QPdfBookmarkModel_override_virtual_insertRows(void* self, intptr_t slot);
bool QPdfBookmarkModel_virtualbase_insertRows(void* self, int row, int count, QModelIndex* parent);
bool QPdfBookmarkModel_override_virtual_insertColumns(void* self, intptr_t slot);
bool QPdfBookmarkModel_virtualbase_insertColumns(void* self, int column, int count, QModelIndex* parent);
bool QPdfBookmarkModel_override_virtual_removeRows(void* self, intptr_t slot);
bool QPdfBookmarkModel_virtualbase_removeRows(void* self, int row, int count, QModelIndex* parent);
bool QPdfBookmarkModel_override_virtual_removeColumns(void* self, intptr_t slot);
bool QPdfBookmarkModel_virtualbase_removeColumns(void* self, int column, int count, QModelIndex* parent);
bool QPdfBookmarkModel_override_virtual_moveRows(void* self, intptr_t slot);
bool QPdfBookmarkModel_virtualbase_moveRows(void* self, QModelIndex* sourceParent, int sourceRow, int count, QModelIndex* destinationParent, int destinationChild);
bool QPdfBookmarkModel_override_virtual_moveColumns(void* self, intptr_t slot);
bool QPdfBookmarkModel_virtualbase_moveColumns(void* self, QModelIndex* sourceParent, int sourceColumn, int count, QModelIndex* destinationParent, int destinationChild);
bool QPdfBookmarkModel_override_virtual_fetchMore(void* self, intptr_t slot);
void QPdfBookmarkModel_virtualbase_fetchMore(void* self, QModelIndex* parent);
bool QPdfBookmarkModel_override_virtual_canFetchMore(void* self, intptr_t slot);
bool QPdfBookmarkModel_virtualbase_canFetchMore(const void* self, QModelIndex* parent);
bool QPdfBookmarkModel_override_virtual_flags(void* self, intptr_t slot);
int QPdfBookmarkModel_virtualbase_flags(const void* self, QModelIndex* index);
bool QPdfBookmarkModel_override_virtual_sort(void* self, intptr_t slot);
void QPdfBookmarkModel_virtualbase_sort(void* self, int column, int order);
bool QPdfBookmarkModel_override_virtual_buddy(void* self, intptr_t slot);
QModelIndex* QPdfBookmarkModel_virtualbase_buddy(const void* self, QModelIndex* index);
bool QPdfBookmarkModel_override_virtual_match(void* self, intptr_t slot);
struct miqt_array /* of QModelIndex* */ QPdfBookmarkModel_virtualbase_match(const void* self, QModelIndex* start, int role, QVariant* value, int hits, int flags);
bool QPdfBookmarkModel_override_virtual_span(void* self, intptr_t slot);
QSize* QPdfBookmarkModel_virtualbase_span(const void* self, QModelIndex* index);
bool QPdfBookmarkModel_override_virtual_submit(void* self, intptr_t slot);
bool QPdfBookmarkModel_virtualbase_submit(void* self);
bool QPdfBookmarkModel_override_virtual_revert(void* self, intptr_t slot);
void QPdfBookmarkModel_virtualbase_revert(void* self);
bool QPdfBookmarkModel_override_virtual_event(void* self, intptr_t slot);
bool QPdfBookmarkModel_virtualbase_event(void* self, QEvent* event);
bool QPdfBookmarkModel_override_virtual_eventFilter(void* self, intptr_t slot);
bool QPdfBookmarkModel_virtualbase_eventFilter(void* self, QObject* watched, QEvent* event);
bool QPdfBookmarkModel_override_virtual_timerEvent(void* self, intptr_t slot);
void QPdfBookmarkModel_virtualbase_timerEvent(void* self, QTimerEvent* event);
bool QPdfBookmarkModel_override_virtual_childEvent(void* self, intptr_t slot);
void QPdfBookmarkModel_virtualbase_childEvent(void* self, QChildEvent* event);
bool QPdfBookmarkModel_override_virtual_customEvent(void* self, intptr_t slot);
void QPdfBookmarkModel_virtualbase_customEvent(void* self, QEvent* event);
bool QPdfBookmarkModel_override_virtual_connectNotify(void* self, intptr_t slot);
void QPdfBookmarkModel_virtualbase_connectNotify(void* self, QMetaMethod* signal);
bool QPdfBookmarkModel_override_virtual_disconnectNotify(void* self, intptr_t slot);
void QPdfBookmarkModel_virtualbase_disconnectNotify(void* self, QMetaMethod* signal);
void QPdfBookmarkModel_protectedbase_resetInternalData(bool* _dynamic_cast_ok, void* self);
QModelIndex* QPdfBookmarkModel_protectedbase_createIndex(bool* _dynamic_cast_ok, const void* self, int row, int column);
void QPdfBookmarkModel_protectedbase_encodeData(bool* _dynamic_cast_ok, const void* self, struct miqt_array /* of QModelIndex* */ indexes, QDataStream* stream);
bool QPdfBookmarkModel_protectedbase_decodeData(bool* _dynamic_cast_ok, void* self, int row, int column, QModelIndex* parent, QDataStream* stream);
void QPdfBookmarkModel_protectedbase_beginInsertRows(bool* _dynamic_cast_ok, void* self, QModelIndex* parent, int first, int last);
void QPdfBookmarkModel_protectedbase_endInsertRows(bool* _dynamic_cast_ok, void* self);
void QPdfBookmarkModel_protectedbase_beginRemoveRows(bool* _dynamic_cast_ok, void* self, QModelIndex* parent, int first, int last);
void QPdfBookmarkModel_protectedbase_endRemoveRows(bool* _dynamic_cast_ok, void* self);
bool QPdfBookmarkModel_protectedbase_beginMoveRows(bool* _dynamic_cast_ok, void* self, QModelIndex* sourceParent, int sourceFirst, int sourceLast, QModelIndex* destinationParent, int destinationRow);
void QPdfBookmarkModel_protectedbase_endMoveRows(bool* _dynamic_cast_ok, void* self);
void QPdfBookmarkModel_protectedbase_beginInsertColumns(bool* _dynamic_cast_ok, void* self, QModelIndex* parent, int first, int last);
void QPdfBookmarkModel_protectedbase_endInsertColumns(bool* _dynamic_cast_ok, void* self);
void QPdfBookmarkModel_protectedbase_beginRemoveColumns(bool* _dynamic_cast_ok, void* self, QModelIndex* parent, int first, int last);
void QPdfBookmarkModel_protectedbase_endRemoveColumns(bool* _dynamic_cast_ok, void* self);
bool QPdfBookmarkModel_protectedbase_beginMoveColumns(bool* _dynamic_cast_ok, void* self, QModelIndex* sourceParent, int sourceFirst, int sourceLast, QModelIndex* destinationParent, int destinationColumn);
void QPdfBookmarkModel_protectedbase_endMoveColumns(bool* _dynamic_cast_ok, void* self);
void QPdfBookmarkModel_protectedbase_beginResetModel(bool* _dynamic_cast_ok, void* self);
void QPdfBookmarkModel_protectedbase_endResetModel(bool* _dynamic_cast_ok, void* self);
void QPdfBookmarkModel_protectedbase_changePersistentIndex(bool* _dynamic_cast_ok, void* self, QModelIndex* from, QModelIndex* to);
void QPdfBookmarkModel_protectedbase_changePersistentIndexList(bool* _dynamic_cast_ok, void* self, struct miqt_array /* of QModelIndex* */ from, struct miqt_array /* of QModelIndex* */ to);
struct miqt_array /* of QModelIndex* */ QPdfBookmarkModel_protectedbase_persistentIndexList(bool* _dynamic_cast_ok, const void* self);
QObject* QPdfBookmarkModel_protectedbase_sender(bool* _dynamic_cast_ok, const void* self);
int QPdfBookmarkModel_protectedbase_senderSignalIndex(bool* _dynamic_cast_ok, const void* self);
int QPdfBookmarkModel_protectedbase_receivers(bool* _dynamic_cast_ok, const void* self, const char* signal);
bool QPdfBookmarkModel_protectedbase_isSignalConnected(bool* _dynamic_cast_ok, const void* self, QMetaMethod* signal);
void QPdfBookmarkModel_delete(QPdfBookmarkModel* self);
#ifdef __cplusplus
} /* extern C */
#endif
#endif

View File

@ -0,0 +1,46 @@
#include <QPdfDestination>
#include <QPointF>
#include <qpdfdestination.h>
#include "gen_qpdfdestination.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
} /* extern C */
#endif
QPdfDestination* QPdfDestination_new(QPdfDestination* other) {
return new QPdfDestination(*other);
}
void QPdfDestination_operatorAssign(QPdfDestination* self, QPdfDestination* other) {
self->operator=(*other);
}
void QPdfDestination_swap(QPdfDestination* self, QPdfDestination* other) {
self->swap(*other);
}
bool QPdfDestination_isValid(const QPdfDestination* self) {
return self->isValid();
}
int QPdfDestination_page(const QPdfDestination* self) {
return self->page();
}
QPointF* QPdfDestination_location(const QPdfDestination* self) {
return new QPointF(self->location());
}
double QPdfDestination_zoom(const QPdfDestination* self) {
qreal _ret = self->zoom();
return static_cast<double>(_ret);
}
void QPdfDestination_delete(QPdfDestination* self) {
delete self;
}

View File

@ -0,0 +1,93 @@
package pdf
/*
#include "gen_qpdfdestination.h"
#include <stdlib.h>
*/
import "C"
import (
"github.com/mappu/miqt/qt"
"runtime"
"unsafe"
)
type QPdfDestination struct {
h *C.QPdfDestination
}
func (this *QPdfDestination) cPointer() *C.QPdfDestination {
if this == nil {
return nil
}
return this.h
}
func (this *QPdfDestination) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
// newQPdfDestination constructs the type using only CGO pointers.
func newQPdfDestination(h *C.QPdfDestination) *QPdfDestination {
if h == nil {
return nil
}
return &QPdfDestination{h: h}
}
// UnsafeNewQPdfDestination constructs the type using only unsafe pointers.
func UnsafeNewQPdfDestination(h unsafe.Pointer) *QPdfDestination {
return newQPdfDestination((*C.QPdfDestination)(h))
}
// NewQPdfDestination constructs a new QPdfDestination object.
func NewQPdfDestination(other *QPdfDestination) *QPdfDestination {
return newQPdfDestination(C.QPdfDestination_new(other.cPointer()))
}
func (this *QPdfDestination) OperatorAssign(other *QPdfDestination) {
C.QPdfDestination_operatorAssign(this.h, other.cPointer())
}
func (this *QPdfDestination) Swap(other *QPdfDestination) {
C.QPdfDestination_swap(this.h, other.cPointer())
}
func (this *QPdfDestination) IsValid() bool {
return (bool)(C.QPdfDestination_isValid(this.h))
}
func (this *QPdfDestination) Page() int {
return (int)(C.QPdfDestination_page(this.h))
}
func (this *QPdfDestination) Location() *qt.QPointF {
_goptr := qt.UnsafeNewQPointF(unsafe.Pointer(C.QPdfDestination_location(this.h)))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QPdfDestination) Zoom() float64 {
return (float64)(C.QPdfDestination_zoom(this.h))
}
// Delete this object from C++ memory.
func (this *QPdfDestination) Delete() {
C.QPdfDestination_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 *QPdfDestination) GoGC() {
runtime.SetFinalizer(this, func(this *QPdfDestination) {
this.Delete()
runtime.KeepAlive(this.h)
})
}

View File

@ -0,0 +1,38 @@
#pragma once
#ifndef MIQT_QT_PDF_GEN_QPDFDESTINATION_H
#define MIQT_QT_PDF_GEN_QPDFDESTINATION_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 QPdfDestination;
class QPointF;
#else
typedef struct QPdfDestination QPdfDestination;
typedef struct QPointF QPointF;
#endif
QPdfDestination* QPdfDestination_new(QPdfDestination* other);
void QPdfDestination_operatorAssign(QPdfDestination* self, QPdfDestination* other);
void QPdfDestination_swap(QPdfDestination* self, QPdfDestination* other);
bool QPdfDestination_isValid(const QPdfDestination* self);
int QPdfDestination_page(const QPdfDestination* self);
QPointF* QPdfDestination_location(const QPdfDestination* self);
double QPdfDestination_zoom(const QPdfDestination* self);
void QPdfDestination_delete(QPdfDestination* self);
#ifdef __cplusplus
} /* extern C */
#endif
#endif

560
qt/pdf/gen_qpdfdocument.cpp Normal file
View File

@ -0,0 +1,560 @@
#include <QChildEvent>
#include <QEvent>
#include <QIODevice>
#include <QImage>
#include <QMetaMethod>
#include <QMetaObject>
#include <QObject>
#include <QPdfDocument>
#include <QPdfDocumentRenderOptions>
#include <QPdfSelection>
#include <QPointF>
#include <QSize>
#include <QSizeF>
#include <QString>
#include <QByteArray>
#include <cstring>
#include <QTimerEvent>
#include <QVariant>
#include <qpdfdocument.h>
#include "gen_qpdfdocument.h"
#ifdef __cplusplus
extern "C" {
#endif
void miqt_exec_callback_QPdfDocument_passwordChanged(intptr_t);
void miqt_exec_callback_QPdfDocument_passwordRequired(intptr_t);
void miqt_exec_callback_QPdfDocument_statusChanged(intptr_t, int);
void miqt_exec_callback_QPdfDocument_pageCountChanged(intptr_t, int);
bool miqt_exec_callback_QPdfDocument_event(QPdfDocument*, intptr_t, QEvent*);
bool miqt_exec_callback_QPdfDocument_eventFilter(QPdfDocument*, intptr_t, QObject*, QEvent*);
void miqt_exec_callback_QPdfDocument_timerEvent(QPdfDocument*, intptr_t, QTimerEvent*);
void miqt_exec_callback_QPdfDocument_childEvent(QPdfDocument*, intptr_t, QChildEvent*);
void miqt_exec_callback_QPdfDocument_customEvent(QPdfDocument*, intptr_t, QEvent*);
void miqt_exec_callback_QPdfDocument_connectNotify(QPdfDocument*, intptr_t, QMetaMethod*);
void miqt_exec_callback_QPdfDocument_disconnectNotify(QPdfDocument*, intptr_t, QMetaMethod*);
#ifdef __cplusplus
} /* extern C */
#endif
class MiqtVirtualQPdfDocument final : public QPdfDocument {
public:
MiqtVirtualQPdfDocument(): QPdfDocument() {};
MiqtVirtualQPdfDocument(QObject* parent): QPdfDocument(parent) {};
virtual ~MiqtVirtualQPdfDocument() override = default;
// cgo.Handle value for overwritten implementation
intptr_t handle__event = 0;
// Subclass to allow providing a Go implementation
virtual bool event(QEvent* event) override {
if (handle__event == 0) {
return QPdfDocument::event(event);
}
QEvent* sigval1 = event;
bool callback_return_value = miqt_exec_callback_QPdfDocument_event(this, handle__event, sigval1);
return callback_return_value;
}
friend bool QPdfDocument_virtualbase_event(void* self, QEvent* event);
// cgo.Handle value for overwritten implementation
intptr_t handle__eventFilter = 0;
// Subclass to allow providing a Go implementation
virtual bool eventFilter(QObject* watched, QEvent* event) override {
if (handle__eventFilter == 0) {
return QPdfDocument::eventFilter(watched, event);
}
QObject* sigval1 = watched;
QEvent* sigval2 = event;
bool callback_return_value = miqt_exec_callback_QPdfDocument_eventFilter(this, handle__eventFilter, sigval1, sigval2);
return callback_return_value;
}
friend bool QPdfDocument_virtualbase_eventFilter(void* self, QObject* watched, QEvent* event);
// cgo.Handle value for overwritten implementation
intptr_t handle__timerEvent = 0;
// Subclass to allow providing a Go implementation
virtual void timerEvent(QTimerEvent* event) override {
if (handle__timerEvent == 0) {
QPdfDocument::timerEvent(event);
return;
}
QTimerEvent* sigval1 = event;
miqt_exec_callback_QPdfDocument_timerEvent(this, handle__timerEvent, sigval1);
}
friend void QPdfDocument_virtualbase_timerEvent(void* self, QTimerEvent* event);
// cgo.Handle value for overwritten implementation
intptr_t handle__childEvent = 0;
// Subclass to allow providing a Go implementation
virtual void childEvent(QChildEvent* event) override {
if (handle__childEvent == 0) {
QPdfDocument::childEvent(event);
return;
}
QChildEvent* sigval1 = event;
miqt_exec_callback_QPdfDocument_childEvent(this, handle__childEvent, sigval1);
}
friend void QPdfDocument_virtualbase_childEvent(void* self, QChildEvent* event);
// cgo.Handle value for overwritten implementation
intptr_t handle__customEvent = 0;
// Subclass to allow providing a Go implementation
virtual void customEvent(QEvent* event) override {
if (handle__customEvent == 0) {
QPdfDocument::customEvent(event);
return;
}
QEvent* sigval1 = event;
miqt_exec_callback_QPdfDocument_customEvent(this, handle__customEvent, sigval1);
}
friend void QPdfDocument_virtualbase_customEvent(void* self, QEvent* event);
// cgo.Handle value for overwritten implementation
intptr_t handle__connectNotify = 0;
// Subclass to allow providing a Go implementation
virtual void connectNotify(const QMetaMethod& signal) override {
if (handle__connectNotify == 0) {
QPdfDocument::connectNotify(signal);
return;
}
const QMetaMethod& signal_ret = signal;
// Cast returned reference into pointer
QMetaMethod* sigval1 = const_cast<QMetaMethod*>(&signal_ret);
miqt_exec_callback_QPdfDocument_connectNotify(this, handle__connectNotify, sigval1);
}
friend void QPdfDocument_virtualbase_connectNotify(void* self, QMetaMethod* signal);
// cgo.Handle value for overwritten implementation
intptr_t handle__disconnectNotify = 0;
// Subclass to allow providing a Go implementation
virtual void disconnectNotify(const QMetaMethod& signal) override {
if (handle__disconnectNotify == 0) {
QPdfDocument::disconnectNotify(signal);
return;
}
const QMetaMethod& signal_ret = signal;
// Cast returned reference into pointer
QMetaMethod* sigval1 = const_cast<QMetaMethod*>(&signal_ret);
miqt_exec_callback_QPdfDocument_disconnectNotify(this, handle__disconnectNotify, sigval1);
}
friend void QPdfDocument_virtualbase_disconnectNotify(void* self, QMetaMethod* signal);
// Wrappers to allow calling protected methods:
friend QObject* QPdfDocument_protectedbase_sender(bool* _dynamic_cast_ok, const void* self);
friend int QPdfDocument_protectedbase_senderSignalIndex(bool* _dynamic_cast_ok, const void* self);
friend int QPdfDocument_protectedbase_receivers(bool* _dynamic_cast_ok, const void* self, const char* signal);
friend bool QPdfDocument_protectedbase_isSignalConnected(bool* _dynamic_cast_ok, const void* self, QMetaMethod* signal);
};
QPdfDocument* QPdfDocument_new() {
return new MiqtVirtualQPdfDocument();
}
QPdfDocument* QPdfDocument_new2(QObject* parent) {
return new MiqtVirtualQPdfDocument(parent);
}
void QPdfDocument_virtbase(QPdfDocument* src, QObject** outptr_QObject) {
*outptr_QObject = static_cast<QObject*>(src);
}
QMetaObject* QPdfDocument_metaObject(const QPdfDocument* self) {
return (QMetaObject*) self->metaObject();
}
void* QPdfDocument_metacast(QPdfDocument* self, const char* param1) {
return self->qt_metacast(param1);
}
struct miqt_string QPdfDocument_tr(const char* s) {
QString _ret = QPdfDocument::tr(s);
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
struct miqt_string _ms;
_ms.len = _b.length();
_ms.data = static_cast<char*>(malloc(_ms.len));
memcpy(_ms.data, _b.data(), _ms.len);
return _ms;
}
struct miqt_string QPdfDocument_trUtf8(const char* s) {
QString _ret = QPdfDocument::trUtf8(s);
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
struct miqt_string _ms;
_ms.len = _b.length();
_ms.data = static_cast<char*>(malloc(_ms.len));
memcpy(_ms.data, _b.data(), _ms.len);
return _ms;
}
int QPdfDocument_load(QPdfDocument* self, struct miqt_string fileName) {
QString fileName_QString = QString::fromUtf8(fileName.data, fileName.len);
QPdfDocument::DocumentError _ret = self->load(fileName_QString);
return static_cast<int>(_ret);
}
int QPdfDocument_status(const QPdfDocument* self) {
QPdfDocument::Status _ret = self->status();
return static_cast<int>(_ret);
}
void QPdfDocument_loadWithDevice(QPdfDocument* self, QIODevice* device) {
self->load(device);
}
void QPdfDocument_setPassword(QPdfDocument* self, struct miqt_string password) {
QString password_QString = QString::fromUtf8(password.data, password.len);
self->setPassword(password_QString);
}
struct miqt_string QPdfDocument_password(const QPdfDocument* self) {
QString _ret = self->password();
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
struct miqt_string _ms;
_ms.len = _b.length();
_ms.data = static_cast<char*>(malloc(_ms.len));
memcpy(_ms.data, _b.data(), _ms.len);
return _ms;
}
QVariant* QPdfDocument_metaData(const QPdfDocument* self, int field) {
return new QVariant(self->metaData(static_cast<QPdfDocument::MetaDataField>(field)));
}
int QPdfDocument_error(const QPdfDocument* self) {
QPdfDocument::DocumentError _ret = self->error();
return static_cast<int>(_ret);
}
void QPdfDocument_close(QPdfDocument* self) {
self->close();
}
int QPdfDocument_pageCount(const QPdfDocument* self) {
return self->pageCount();
}
QSizeF* QPdfDocument_pageSize(const QPdfDocument* self, int page) {
return new QSizeF(self->pageSize(static_cast<int>(page)));
}
QImage* QPdfDocument_render(QPdfDocument* self, int page, QSize* imageSize) {
return new QImage(self->render(static_cast<int>(page), *imageSize));
}
QPdfSelection* QPdfDocument_getSelection(QPdfDocument* self, int page, QPointF* start, QPointF* end) {
return new QPdfSelection(self->getSelection(static_cast<int>(page), *start, *end));
}
QPdfSelection* QPdfDocument_getSelectionAtIndex(QPdfDocument* self, int page, int startIndex, int maxLength) {
return new QPdfSelection(self->getSelectionAtIndex(static_cast<int>(page), static_cast<int>(startIndex), static_cast<int>(maxLength)));
}
QPdfSelection* QPdfDocument_getAllText(QPdfDocument* self, int page) {
return new QPdfSelection(self->getAllText(static_cast<int>(page)));
}
void QPdfDocument_passwordChanged(QPdfDocument* self) {
self->passwordChanged();
}
void QPdfDocument_connect_passwordChanged(QPdfDocument* self, intptr_t slot) {
MiqtVirtualQPdfDocument::connect(self, static_cast<void (QPdfDocument::*)()>(&QPdfDocument::passwordChanged), self, [=]() {
miqt_exec_callback_QPdfDocument_passwordChanged(slot);
});
}
void QPdfDocument_passwordRequired(QPdfDocument* self) {
self->passwordRequired();
}
void QPdfDocument_connect_passwordRequired(QPdfDocument* self, intptr_t slot) {
MiqtVirtualQPdfDocument::connect(self, static_cast<void (QPdfDocument::*)()>(&QPdfDocument::passwordRequired), self, [=]() {
miqt_exec_callback_QPdfDocument_passwordRequired(slot);
});
}
void QPdfDocument_statusChanged(QPdfDocument* self, int status) {
self->statusChanged(static_cast<QPdfDocument::Status>(status));
}
void QPdfDocument_connect_statusChanged(QPdfDocument* self, intptr_t slot) {
MiqtVirtualQPdfDocument::connect(self, static_cast<void (QPdfDocument::*)(QPdfDocument::Status)>(&QPdfDocument::statusChanged), self, [=](QPdfDocument::Status status) {
QPdfDocument::Status status_ret = status;
int sigval1 = static_cast<int>(status_ret);
miqt_exec_callback_QPdfDocument_statusChanged(slot, sigval1);
});
}
void QPdfDocument_pageCountChanged(QPdfDocument* self, int pageCount) {
self->pageCountChanged(static_cast<int>(pageCount));
}
void QPdfDocument_connect_pageCountChanged(QPdfDocument* self, intptr_t slot) {
MiqtVirtualQPdfDocument::connect(self, static_cast<void (QPdfDocument::*)(int)>(&QPdfDocument::pageCountChanged), self, [=](int pageCount) {
int sigval1 = pageCount;
miqt_exec_callback_QPdfDocument_pageCountChanged(slot, sigval1);
});
}
struct miqt_string QPdfDocument_tr2(const char* s, const char* c) {
QString _ret = QPdfDocument::tr(s, c);
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
struct miqt_string _ms;
_ms.len = _b.length();
_ms.data = static_cast<char*>(malloc(_ms.len));
memcpy(_ms.data, _b.data(), _ms.len);
return _ms;
}
struct miqt_string QPdfDocument_tr3(const char* s, const char* c, int n) {
QString _ret = QPdfDocument::tr(s, c, static_cast<int>(n));
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
struct miqt_string _ms;
_ms.len = _b.length();
_ms.data = static_cast<char*>(malloc(_ms.len));
memcpy(_ms.data, _b.data(), _ms.len);
return _ms;
}
struct miqt_string QPdfDocument_trUtf82(const char* s, const char* c) {
QString _ret = QPdfDocument::trUtf8(s, c);
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
struct miqt_string _ms;
_ms.len = _b.length();
_ms.data = static_cast<char*>(malloc(_ms.len));
memcpy(_ms.data, _b.data(), _ms.len);
return _ms;
}
struct miqt_string QPdfDocument_trUtf83(const char* s, const char* c, int n) {
QString _ret = QPdfDocument::trUtf8(s, c, static_cast<int>(n));
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
struct miqt_string _ms;
_ms.len = _b.length();
_ms.data = static_cast<char*>(malloc(_ms.len));
memcpy(_ms.data, _b.data(), _ms.len);
return _ms;
}
QImage* QPdfDocument_render2(QPdfDocument* self, int page, QSize* imageSize, QPdfDocumentRenderOptions* options) {
return new QImage(self->render(static_cast<int>(page), *imageSize, *options));
}
bool QPdfDocument_override_virtual_event(void* self, intptr_t slot) {
MiqtVirtualQPdfDocument* self_cast = dynamic_cast<MiqtVirtualQPdfDocument*>( (QPdfDocument*)(self) );
if (self_cast == nullptr) {
return false;
}
self_cast->handle__event = slot;
return true;
}
bool QPdfDocument_virtualbase_event(void* self, QEvent* event) {
return ( (MiqtVirtualQPdfDocument*)(self) )->QPdfDocument::event(event);
}
bool QPdfDocument_override_virtual_eventFilter(void* self, intptr_t slot) {
MiqtVirtualQPdfDocument* self_cast = dynamic_cast<MiqtVirtualQPdfDocument*>( (QPdfDocument*)(self) );
if (self_cast == nullptr) {
return false;
}
self_cast->handle__eventFilter = slot;
return true;
}
bool QPdfDocument_virtualbase_eventFilter(void* self, QObject* watched, QEvent* event) {
return ( (MiqtVirtualQPdfDocument*)(self) )->QPdfDocument::eventFilter(watched, event);
}
bool QPdfDocument_override_virtual_timerEvent(void* self, intptr_t slot) {
MiqtVirtualQPdfDocument* self_cast = dynamic_cast<MiqtVirtualQPdfDocument*>( (QPdfDocument*)(self) );
if (self_cast == nullptr) {
return false;
}
self_cast->handle__timerEvent = slot;
return true;
}
void QPdfDocument_virtualbase_timerEvent(void* self, QTimerEvent* event) {
( (MiqtVirtualQPdfDocument*)(self) )->QPdfDocument::timerEvent(event);
}
bool QPdfDocument_override_virtual_childEvent(void* self, intptr_t slot) {
MiqtVirtualQPdfDocument* self_cast = dynamic_cast<MiqtVirtualQPdfDocument*>( (QPdfDocument*)(self) );
if (self_cast == nullptr) {
return false;
}
self_cast->handle__childEvent = slot;
return true;
}
void QPdfDocument_virtualbase_childEvent(void* self, QChildEvent* event) {
( (MiqtVirtualQPdfDocument*)(self) )->QPdfDocument::childEvent(event);
}
bool QPdfDocument_override_virtual_customEvent(void* self, intptr_t slot) {
MiqtVirtualQPdfDocument* self_cast = dynamic_cast<MiqtVirtualQPdfDocument*>( (QPdfDocument*)(self) );
if (self_cast == nullptr) {
return false;
}
self_cast->handle__customEvent = slot;
return true;
}
void QPdfDocument_virtualbase_customEvent(void* self, QEvent* event) {
( (MiqtVirtualQPdfDocument*)(self) )->QPdfDocument::customEvent(event);
}
bool QPdfDocument_override_virtual_connectNotify(void* self, intptr_t slot) {
MiqtVirtualQPdfDocument* self_cast = dynamic_cast<MiqtVirtualQPdfDocument*>( (QPdfDocument*)(self) );
if (self_cast == nullptr) {
return false;
}
self_cast->handle__connectNotify = slot;
return true;
}
void QPdfDocument_virtualbase_connectNotify(void* self, QMetaMethod* signal) {
( (MiqtVirtualQPdfDocument*)(self) )->QPdfDocument::connectNotify(*signal);
}
bool QPdfDocument_override_virtual_disconnectNotify(void* self, intptr_t slot) {
MiqtVirtualQPdfDocument* self_cast = dynamic_cast<MiqtVirtualQPdfDocument*>( (QPdfDocument*)(self) );
if (self_cast == nullptr) {
return false;
}
self_cast->handle__disconnectNotify = slot;
return true;
}
void QPdfDocument_virtualbase_disconnectNotify(void* self, QMetaMethod* signal) {
( (MiqtVirtualQPdfDocument*)(self) )->QPdfDocument::disconnectNotify(*signal);
}
QObject* QPdfDocument_protectedbase_sender(bool* _dynamic_cast_ok, const void* self) {
MiqtVirtualQPdfDocument* self_cast = dynamic_cast<MiqtVirtualQPdfDocument*>( (QPdfDocument*)(self) );
if (self_cast == nullptr) {
*_dynamic_cast_ok = false;
return nullptr;
}
*_dynamic_cast_ok = true;
return self_cast->sender();
}
int QPdfDocument_protectedbase_senderSignalIndex(bool* _dynamic_cast_ok, const void* self) {
MiqtVirtualQPdfDocument* self_cast = dynamic_cast<MiqtVirtualQPdfDocument*>( (QPdfDocument*)(self) );
if (self_cast == nullptr) {
*_dynamic_cast_ok = false;
return 0;
}
*_dynamic_cast_ok = true;
return self_cast->senderSignalIndex();
}
int QPdfDocument_protectedbase_receivers(bool* _dynamic_cast_ok, const void* self, const char* signal) {
MiqtVirtualQPdfDocument* self_cast = dynamic_cast<MiqtVirtualQPdfDocument*>( (QPdfDocument*)(self) );
if (self_cast == nullptr) {
*_dynamic_cast_ok = false;
return 0;
}
*_dynamic_cast_ok = true;
return self_cast->receivers(signal);
}
bool QPdfDocument_protectedbase_isSignalConnected(bool* _dynamic_cast_ok, const void* self, QMetaMethod* signal) {
MiqtVirtualQPdfDocument* self_cast = dynamic_cast<MiqtVirtualQPdfDocument*>( (QPdfDocument*)(self) );
if (self_cast == nullptr) {
*_dynamic_cast_ok = false;
return false;
}
*_dynamic_cast_ok = true;
return self_cast->isSignalConnected(*signal);
}
void QPdfDocument_delete(QPdfDocument* self) {
delete self;
}

590
qt/pdf/gen_qpdfdocument.go Normal file
View File

@ -0,0 +1,590 @@
package pdf
/*
#include "gen_qpdfdocument.h"
#include <stdlib.h>
*/
import "C"
import (
"github.com/mappu/miqt/qt"
"runtime"
"runtime/cgo"
"unsafe"
)
type QPdfDocument__Status int
const (
QPdfDocument__Null QPdfDocument__Status = 0
QPdfDocument__Loading QPdfDocument__Status = 1
QPdfDocument__Ready QPdfDocument__Status = 2
QPdfDocument__Unloading QPdfDocument__Status = 3
QPdfDocument__Error QPdfDocument__Status = 4
)
type QPdfDocument__DocumentError int
const (
QPdfDocument__NoError QPdfDocument__DocumentError = 0
QPdfDocument__UnknownError QPdfDocument__DocumentError = 1
QPdfDocument__DataNotYetAvailableError QPdfDocument__DocumentError = 2
QPdfDocument__FileNotFoundError QPdfDocument__DocumentError = 3
QPdfDocument__InvalidFileFormatError QPdfDocument__DocumentError = 4
QPdfDocument__IncorrectPasswordError QPdfDocument__DocumentError = 5
QPdfDocument__UnsupportedSecuritySchemeError QPdfDocument__DocumentError = 6
)
type QPdfDocument__MetaDataField int
const (
QPdfDocument__Title QPdfDocument__MetaDataField = 0
QPdfDocument__Subject QPdfDocument__MetaDataField = 1
QPdfDocument__Author QPdfDocument__MetaDataField = 2
QPdfDocument__Keywords QPdfDocument__MetaDataField = 3
QPdfDocument__Producer QPdfDocument__MetaDataField = 4
QPdfDocument__Creator QPdfDocument__MetaDataField = 5
QPdfDocument__CreationDate QPdfDocument__MetaDataField = 6
QPdfDocument__ModificationDate QPdfDocument__MetaDataField = 7
)
type QPdfDocument struct {
h *C.QPdfDocument
*qt.QObject
}
func (this *QPdfDocument) cPointer() *C.QPdfDocument {
if this == nil {
return nil
}
return this.h
}
func (this *QPdfDocument) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
// newQPdfDocument constructs the type using only CGO pointers.
func newQPdfDocument(h *C.QPdfDocument) *QPdfDocument {
if h == nil {
return nil
}
var outptr_QObject *C.QObject = nil
C.QPdfDocument_virtbase(h, &outptr_QObject)
return &QPdfDocument{h: h,
QObject: qt.UnsafeNewQObject(unsafe.Pointer(outptr_QObject))}
}
// UnsafeNewQPdfDocument constructs the type using only unsafe pointers.
func UnsafeNewQPdfDocument(h unsafe.Pointer) *QPdfDocument {
return newQPdfDocument((*C.QPdfDocument)(h))
}
// NewQPdfDocument constructs a new QPdfDocument object.
func NewQPdfDocument() *QPdfDocument {
return newQPdfDocument(C.QPdfDocument_new())
}
// NewQPdfDocument2 constructs a new QPdfDocument object.
func NewQPdfDocument2(parent *qt.QObject) *QPdfDocument {
return newQPdfDocument(C.QPdfDocument_new2((*C.QObject)(parent.UnsafePointer())))
}
func (this *QPdfDocument) MetaObject() *qt.QMetaObject {
return qt.UnsafeNewQMetaObject(unsafe.Pointer(C.QPdfDocument_metaObject(this.h)))
}
func (this *QPdfDocument) Metacast(param1 string) unsafe.Pointer {
param1_Cstring := C.CString(param1)
defer C.free(unsafe.Pointer(param1_Cstring))
return (unsafe.Pointer)(C.QPdfDocument_metacast(this.h, param1_Cstring))
}
func QPdfDocument_Tr(s string) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
var _ms C.struct_miqt_string = C.QPdfDocument_tr(s_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func QPdfDocument_TrUtf8(s string) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
var _ms C.struct_miqt_string = C.QPdfDocument_trUtf8(s_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func (this *QPdfDocument) Load(fileName string) QPdfDocument__DocumentError {
fileName_ms := C.struct_miqt_string{}
fileName_ms.data = C.CString(fileName)
fileName_ms.len = C.size_t(len(fileName))
defer C.free(unsafe.Pointer(fileName_ms.data))
return (QPdfDocument__DocumentError)(C.QPdfDocument_load(this.h, fileName_ms))
}
func (this *QPdfDocument) Status() QPdfDocument__Status {
return (QPdfDocument__Status)(C.QPdfDocument_status(this.h))
}
func (this *QPdfDocument) LoadWithDevice(device *qt.QIODevice) {
C.QPdfDocument_loadWithDevice(this.h, (*C.QIODevice)(device.UnsafePointer()))
}
func (this *QPdfDocument) SetPassword(password string) {
password_ms := C.struct_miqt_string{}
password_ms.data = C.CString(password)
password_ms.len = C.size_t(len(password))
defer C.free(unsafe.Pointer(password_ms.data))
C.QPdfDocument_setPassword(this.h, password_ms)
}
func (this *QPdfDocument) Password() string {
var _ms C.struct_miqt_string = C.QPdfDocument_password(this.h)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func (this *QPdfDocument) MetaData(field QPdfDocument__MetaDataField) *qt.QVariant {
_goptr := qt.UnsafeNewQVariant(unsafe.Pointer(C.QPdfDocument_metaData(this.h, (C.int)(field))))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QPdfDocument) Error() QPdfDocument__DocumentError {
return (QPdfDocument__DocumentError)(C.QPdfDocument_error(this.h))
}
func (this *QPdfDocument) Close() {
C.QPdfDocument_close(this.h)
}
func (this *QPdfDocument) PageCount() int {
return (int)(C.QPdfDocument_pageCount(this.h))
}
func (this *QPdfDocument) PageSize(page int) *qt.QSizeF {
_goptr := qt.UnsafeNewQSizeF(unsafe.Pointer(C.QPdfDocument_pageSize(this.h, (C.int)(page))))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QPdfDocument) Render(page int, imageSize qt.QSize) *qt.QImage {
_goptr := qt.UnsafeNewQImage(unsafe.Pointer(C.QPdfDocument_render(this.h, (C.int)(page), (*C.QSize)(imageSize.UnsafePointer()))))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QPdfDocument) GetSelection(page int, start qt.QPointF, end qt.QPointF) *QPdfSelection {
_goptr := newQPdfSelection(C.QPdfDocument_getSelection(this.h, (C.int)(page), (*C.QPointF)(start.UnsafePointer()), (*C.QPointF)(end.UnsafePointer())))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QPdfDocument) GetSelectionAtIndex(page int, startIndex int, maxLength int) *QPdfSelection {
_goptr := newQPdfSelection(C.QPdfDocument_getSelectionAtIndex(this.h, (C.int)(page), (C.int)(startIndex), (C.int)(maxLength)))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QPdfDocument) GetAllText(page int) *QPdfSelection {
_goptr := newQPdfSelection(C.QPdfDocument_getAllText(this.h, (C.int)(page)))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QPdfDocument) PasswordChanged() {
C.QPdfDocument_passwordChanged(this.h)
}
func (this *QPdfDocument) OnPasswordChanged(slot func()) {
C.QPdfDocument_connect_passwordChanged(this.h, C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QPdfDocument_passwordChanged
func miqt_exec_callback_QPdfDocument_passwordChanged(cb C.intptr_t) {
gofunc, ok := cgo.Handle(cb).Value().(func())
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
gofunc()
}
func (this *QPdfDocument) PasswordRequired() {
C.QPdfDocument_passwordRequired(this.h)
}
func (this *QPdfDocument) OnPasswordRequired(slot func()) {
C.QPdfDocument_connect_passwordRequired(this.h, C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QPdfDocument_passwordRequired
func miqt_exec_callback_QPdfDocument_passwordRequired(cb C.intptr_t) {
gofunc, ok := cgo.Handle(cb).Value().(func())
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
gofunc()
}
func (this *QPdfDocument) StatusChanged(status QPdfDocument__Status) {
C.QPdfDocument_statusChanged(this.h, (C.int)(status))
}
func (this *QPdfDocument) OnStatusChanged(slot func(status QPdfDocument__Status)) {
C.QPdfDocument_connect_statusChanged(this.h, C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QPdfDocument_statusChanged
func miqt_exec_callback_QPdfDocument_statusChanged(cb C.intptr_t, status C.int) {
gofunc, ok := cgo.Handle(cb).Value().(func(status QPdfDocument__Status))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := (QPdfDocument__Status)(status)
gofunc(slotval1)
}
func (this *QPdfDocument) PageCountChanged(pageCount int) {
C.QPdfDocument_pageCountChanged(this.h, (C.int)(pageCount))
}
func (this *QPdfDocument) OnPageCountChanged(slot func(pageCount int)) {
C.QPdfDocument_connect_pageCountChanged(this.h, C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QPdfDocument_pageCountChanged
func miqt_exec_callback_QPdfDocument_pageCountChanged(cb C.intptr_t, pageCount C.int) {
gofunc, ok := cgo.Handle(cb).Value().(func(pageCount int))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := (int)(pageCount)
gofunc(slotval1)
}
func QPdfDocument_Tr2(s string, c string) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
c_Cstring := C.CString(c)
defer C.free(unsafe.Pointer(c_Cstring))
var _ms C.struct_miqt_string = C.QPdfDocument_tr2(s_Cstring, c_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func QPdfDocument_Tr3(s string, c string, n int) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
c_Cstring := C.CString(c)
defer C.free(unsafe.Pointer(c_Cstring))
var _ms C.struct_miqt_string = C.QPdfDocument_tr3(s_Cstring, c_Cstring, (C.int)(n))
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func QPdfDocument_TrUtf82(s string, c string) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
c_Cstring := C.CString(c)
defer C.free(unsafe.Pointer(c_Cstring))
var _ms C.struct_miqt_string = C.QPdfDocument_trUtf82(s_Cstring, c_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func QPdfDocument_TrUtf83(s string, c string, n int) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
c_Cstring := C.CString(c)
defer C.free(unsafe.Pointer(c_Cstring))
var _ms C.struct_miqt_string = C.QPdfDocument_trUtf83(s_Cstring, c_Cstring, (C.int)(n))
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func (this *QPdfDocument) Render2(page int, imageSize qt.QSize, options QPdfDocumentRenderOptions) *qt.QImage {
_goptr := qt.UnsafeNewQImage(unsafe.Pointer(C.QPdfDocument_render2(this.h, (C.int)(page), (*C.QSize)(imageSize.UnsafePointer()), options.cPointer())))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
// Sender can only be called from a QPdfDocument that was directly constructed.
func (this *QPdfDocument) Sender() *qt.QObject {
var _dynamic_cast_ok C.bool = false
_method_ret := qt.UnsafeNewQObject(unsafe.Pointer(C.QPdfDocument_protectedbase_sender(&_dynamic_cast_ok, unsafe.Pointer(this.h))))
if !_dynamic_cast_ok {
panic("miqt: can only call protected methods for directly constructed types")
}
return _method_ret
}
// SenderSignalIndex can only be called from a QPdfDocument that was directly constructed.
func (this *QPdfDocument) SenderSignalIndex() int {
var _dynamic_cast_ok C.bool = false
_method_ret := (int)(C.QPdfDocument_protectedbase_senderSignalIndex(&_dynamic_cast_ok, unsafe.Pointer(this.h)))
if !_dynamic_cast_ok {
panic("miqt: can only call protected methods for directly constructed types")
}
return _method_ret
}
// Receivers can only be called from a QPdfDocument that was directly constructed.
func (this *QPdfDocument) Receivers(signal string) int {
signal_Cstring := C.CString(signal)
defer C.free(unsafe.Pointer(signal_Cstring))
var _dynamic_cast_ok C.bool = false
_method_ret := (int)(C.QPdfDocument_protectedbase_receivers(&_dynamic_cast_ok, unsafe.Pointer(this.h), signal_Cstring))
if !_dynamic_cast_ok {
panic("miqt: can only call protected methods for directly constructed types")
}
return _method_ret
}
// IsSignalConnected can only be called from a QPdfDocument that was directly constructed.
func (this *QPdfDocument) IsSignalConnected(signal *qt.QMetaMethod) bool {
var _dynamic_cast_ok C.bool = false
_method_ret := (bool)(C.QPdfDocument_protectedbase_isSignalConnected(&_dynamic_cast_ok, unsafe.Pointer(this.h), (*C.QMetaMethod)(signal.UnsafePointer())))
if !_dynamic_cast_ok {
panic("miqt: can only call protected methods for directly constructed types")
}
return _method_ret
}
func (this *QPdfDocument) callVirtualBase_Event(event *qt.QEvent) bool {
return (bool)(C.QPdfDocument_virtualbase_event(unsafe.Pointer(this.h), (*C.QEvent)(event.UnsafePointer())))
}
func (this *QPdfDocument) OnEvent(slot func(super func(event *qt.QEvent) bool, event *qt.QEvent) bool) {
ok := C.QPdfDocument_override_virtual_event(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
}
}
//export miqt_exec_callback_QPdfDocument_event
func miqt_exec_callback_QPdfDocument_event(self *C.QPdfDocument, cb C.intptr_t, event *C.QEvent) C.bool {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(event *qt.QEvent) bool, event *qt.QEvent) bool)
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := qt.UnsafeNewQEvent(unsafe.Pointer(event))
virtualReturn := gofunc((&QPdfDocument{h: self}).callVirtualBase_Event, slotval1)
return (C.bool)(virtualReturn)
}
func (this *QPdfDocument) callVirtualBase_EventFilter(watched *qt.QObject, event *qt.QEvent) bool {
return (bool)(C.QPdfDocument_virtualbase_eventFilter(unsafe.Pointer(this.h), (*C.QObject)(watched.UnsafePointer()), (*C.QEvent)(event.UnsafePointer())))
}
func (this *QPdfDocument) OnEventFilter(slot func(super func(watched *qt.QObject, event *qt.QEvent) bool, watched *qt.QObject, event *qt.QEvent) bool) {
ok := C.QPdfDocument_override_virtual_eventFilter(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
}
}
//export miqt_exec_callback_QPdfDocument_eventFilter
func miqt_exec_callback_QPdfDocument_eventFilter(self *C.QPdfDocument, cb C.intptr_t, watched *C.QObject, event *C.QEvent) C.bool {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(watched *qt.QObject, event *qt.QEvent) bool, watched *qt.QObject, event *qt.QEvent) bool)
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := qt.UnsafeNewQObject(unsafe.Pointer(watched))
slotval2 := qt.UnsafeNewQEvent(unsafe.Pointer(event))
virtualReturn := gofunc((&QPdfDocument{h: self}).callVirtualBase_EventFilter, slotval1, slotval2)
return (C.bool)(virtualReturn)
}
func (this *QPdfDocument) callVirtualBase_TimerEvent(event *qt.QTimerEvent) {
C.QPdfDocument_virtualbase_timerEvent(unsafe.Pointer(this.h), (*C.QTimerEvent)(event.UnsafePointer()))
}
func (this *QPdfDocument) OnTimerEvent(slot func(super func(event *qt.QTimerEvent), event *qt.QTimerEvent)) {
ok := C.QPdfDocument_override_virtual_timerEvent(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
}
}
//export miqt_exec_callback_QPdfDocument_timerEvent
func miqt_exec_callback_QPdfDocument_timerEvent(self *C.QPdfDocument, cb C.intptr_t, event *C.QTimerEvent) {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(event *qt.QTimerEvent), event *qt.QTimerEvent))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := qt.UnsafeNewQTimerEvent(unsafe.Pointer(event))
gofunc((&QPdfDocument{h: self}).callVirtualBase_TimerEvent, slotval1)
}
func (this *QPdfDocument) callVirtualBase_ChildEvent(event *qt.QChildEvent) {
C.QPdfDocument_virtualbase_childEvent(unsafe.Pointer(this.h), (*C.QChildEvent)(event.UnsafePointer()))
}
func (this *QPdfDocument) OnChildEvent(slot func(super func(event *qt.QChildEvent), event *qt.QChildEvent)) {
ok := C.QPdfDocument_override_virtual_childEvent(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
}
}
//export miqt_exec_callback_QPdfDocument_childEvent
func miqt_exec_callback_QPdfDocument_childEvent(self *C.QPdfDocument, cb C.intptr_t, event *C.QChildEvent) {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(event *qt.QChildEvent), event *qt.QChildEvent))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := qt.UnsafeNewQChildEvent(unsafe.Pointer(event))
gofunc((&QPdfDocument{h: self}).callVirtualBase_ChildEvent, slotval1)
}
func (this *QPdfDocument) callVirtualBase_CustomEvent(event *qt.QEvent) {
C.QPdfDocument_virtualbase_customEvent(unsafe.Pointer(this.h), (*C.QEvent)(event.UnsafePointer()))
}
func (this *QPdfDocument) OnCustomEvent(slot func(super func(event *qt.QEvent), event *qt.QEvent)) {
ok := C.QPdfDocument_override_virtual_customEvent(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
}
}
//export miqt_exec_callback_QPdfDocument_customEvent
func miqt_exec_callback_QPdfDocument_customEvent(self *C.QPdfDocument, cb C.intptr_t, event *C.QEvent) {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(event *qt.QEvent), event *qt.QEvent))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := qt.UnsafeNewQEvent(unsafe.Pointer(event))
gofunc((&QPdfDocument{h: self}).callVirtualBase_CustomEvent, slotval1)
}
func (this *QPdfDocument) callVirtualBase_ConnectNotify(signal *qt.QMetaMethod) {
C.QPdfDocument_virtualbase_connectNotify(unsafe.Pointer(this.h), (*C.QMetaMethod)(signal.UnsafePointer()))
}
func (this *QPdfDocument) OnConnectNotify(slot func(super func(signal *qt.QMetaMethod), signal *qt.QMetaMethod)) {
ok := C.QPdfDocument_override_virtual_connectNotify(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
}
}
//export miqt_exec_callback_QPdfDocument_connectNotify
func miqt_exec_callback_QPdfDocument_connectNotify(self *C.QPdfDocument, cb C.intptr_t, signal *C.QMetaMethod) {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(signal *qt.QMetaMethod), signal *qt.QMetaMethod))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := qt.UnsafeNewQMetaMethod(unsafe.Pointer(signal))
gofunc((&QPdfDocument{h: self}).callVirtualBase_ConnectNotify, slotval1)
}
func (this *QPdfDocument) callVirtualBase_DisconnectNotify(signal *qt.QMetaMethod) {
C.QPdfDocument_virtualbase_disconnectNotify(unsafe.Pointer(this.h), (*C.QMetaMethod)(signal.UnsafePointer()))
}
func (this *QPdfDocument) OnDisconnectNotify(slot func(super func(signal *qt.QMetaMethod), signal *qt.QMetaMethod)) {
ok := C.QPdfDocument_override_virtual_disconnectNotify(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
}
}
//export miqt_exec_callback_QPdfDocument_disconnectNotify
func miqt_exec_callback_QPdfDocument_disconnectNotify(self *C.QPdfDocument, cb C.intptr_t, signal *C.QMetaMethod) {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(signal *qt.QMetaMethod), signal *qt.QMetaMethod))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := qt.UnsafeNewQMetaMethod(unsafe.Pointer(signal))
gofunc((&QPdfDocument{h: self}).callVirtualBase_DisconnectNotify, slotval1)
}
// Delete this object from C++ memory.
func (this *QPdfDocument) Delete() {
C.QPdfDocument_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 *QPdfDocument) GoGC() {
runtime.SetFinalizer(this, func(this *QPdfDocument) {
this.Delete()
runtime.KeepAlive(this.h)
})
}

109
qt/pdf/gen_qpdfdocument.h Normal file
View File

@ -0,0 +1,109 @@
#pragma once
#ifndef MIQT_QT_PDF_GEN_QPDFDOCUMENT_H
#define MIQT_QT_PDF_GEN_QPDFDOCUMENT_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 QChildEvent;
class QEvent;
class QIODevice;
class QImage;
class QMetaMethod;
class QMetaObject;
class QObject;
class QPdfDocument;
class QPdfDocumentRenderOptions;
class QPdfSelection;
class QPointF;
class QSize;
class QSizeF;
class QTimerEvent;
class QVariant;
#else
typedef struct QChildEvent QChildEvent;
typedef struct QEvent QEvent;
typedef struct QIODevice QIODevice;
typedef struct QImage QImage;
typedef struct QMetaMethod QMetaMethod;
typedef struct QMetaObject QMetaObject;
typedef struct QObject QObject;
typedef struct QPdfDocument QPdfDocument;
typedef struct QPdfDocumentRenderOptions QPdfDocumentRenderOptions;
typedef struct QPdfSelection QPdfSelection;
typedef struct QPointF QPointF;
typedef struct QSize QSize;
typedef struct QSizeF QSizeF;
typedef struct QTimerEvent QTimerEvent;
typedef struct QVariant QVariant;
#endif
QPdfDocument* QPdfDocument_new();
QPdfDocument* QPdfDocument_new2(QObject* parent);
void QPdfDocument_virtbase(QPdfDocument* src, QObject** outptr_QObject);
QMetaObject* QPdfDocument_metaObject(const QPdfDocument* self);
void* QPdfDocument_metacast(QPdfDocument* self, const char* param1);
struct miqt_string QPdfDocument_tr(const char* s);
struct miqt_string QPdfDocument_trUtf8(const char* s);
int QPdfDocument_load(QPdfDocument* self, struct miqt_string fileName);
int QPdfDocument_status(const QPdfDocument* self);
void QPdfDocument_loadWithDevice(QPdfDocument* self, QIODevice* device);
void QPdfDocument_setPassword(QPdfDocument* self, struct miqt_string password);
struct miqt_string QPdfDocument_password(const QPdfDocument* self);
QVariant* QPdfDocument_metaData(const QPdfDocument* self, int field);
int QPdfDocument_error(const QPdfDocument* self);
void QPdfDocument_close(QPdfDocument* self);
int QPdfDocument_pageCount(const QPdfDocument* self);
QSizeF* QPdfDocument_pageSize(const QPdfDocument* self, int page);
QImage* QPdfDocument_render(QPdfDocument* self, int page, QSize* imageSize);
QPdfSelection* QPdfDocument_getSelection(QPdfDocument* self, int page, QPointF* start, QPointF* end);
QPdfSelection* QPdfDocument_getSelectionAtIndex(QPdfDocument* self, int page, int startIndex, int maxLength);
QPdfSelection* QPdfDocument_getAllText(QPdfDocument* self, int page);
void QPdfDocument_passwordChanged(QPdfDocument* self);
void QPdfDocument_connect_passwordChanged(QPdfDocument* self, intptr_t slot);
void QPdfDocument_passwordRequired(QPdfDocument* self);
void QPdfDocument_connect_passwordRequired(QPdfDocument* self, intptr_t slot);
void QPdfDocument_statusChanged(QPdfDocument* self, int status);
void QPdfDocument_connect_statusChanged(QPdfDocument* self, intptr_t slot);
void QPdfDocument_pageCountChanged(QPdfDocument* self, int pageCount);
void QPdfDocument_connect_pageCountChanged(QPdfDocument* self, intptr_t slot);
struct miqt_string QPdfDocument_tr2(const char* s, const char* c);
struct miqt_string QPdfDocument_tr3(const char* s, const char* c, int n);
struct miqt_string QPdfDocument_trUtf82(const char* s, const char* c);
struct miqt_string QPdfDocument_trUtf83(const char* s, const char* c, int n);
QImage* QPdfDocument_render2(QPdfDocument* self, int page, QSize* imageSize, QPdfDocumentRenderOptions* options);
bool QPdfDocument_override_virtual_event(void* self, intptr_t slot);
bool QPdfDocument_virtualbase_event(void* self, QEvent* event);
bool QPdfDocument_override_virtual_eventFilter(void* self, intptr_t slot);
bool QPdfDocument_virtualbase_eventFilter(void* self, QObject* watched, QEvent* event);
bool QPdfDocument_override_virtual_timerEvent(void* self, intptr_t slot);
void QPdfDocument_virtualbase_timerEvent(void* self, QTimerEvent* event);
bool QPdfDocument_override_virtual_childEvent(void* self, intptr_t slot);
void QPdfDocument_virtualbase_childEvent(void* self, QChildEvent* event);
bool QPdfDocument_override_virtual_customEvent(void* self, intptr_t slot);
void QPdfDocument_virtualbase_customEvent(void* self, QEvent* event);
bool QPdfDocument_override_virtual_connectNotify(void* self, intptr_t slot);
void QPdfDocument_virtualbase_connectNotify(void* self, QMetaMethod* signal);
bool QPdfDocument_override_virtual_disconnectNotify(void* self, intptr_t slot);
void QPdfDocument_virtualbase_disconnectNotify(void* self, QMetaMethod* signal);
QObject* QPdfDocument_protectedbase_sender(bool* _dynamic_cast_ok, const void* self);
int QPdfDocument_protectedbase_senderSignalIndex(bool* _dynamic_cast_ok, const void* self);
int QPdfDocument_protectedbase_receivers(bool* _dynamic_cast_ok, const void* self, const char* signal);
bool QPdfDocument_protectedbase_isSignalConnected(bool* _dynamic_cast_ok, const void* self, QMetaMethod* signal);
void QPdfDocument_delete(QPdfDocument* self);
#ifdef __cplusplus
} /* extern C */
#endif
#endif

View File

@ -0,0 +1,60 @@
#include <QPdfDocumentRenderOptions>
#include <QRect>
#include <QSize>
#include <qpdfdocumentrenderoptions.h>
#include "gen_qpdfdocumentrenderoptions.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
} /* extern C */
#endif
QPdfDocumentRenderOptions* QPdfDocumentRenderOptions_new() {
return new QPdfDocumentRenderOptions();
}
QPdfDocumentRenderOptions* QPdfDocumentRenderOptions_new2(QPdfDocumentRenderOptions* param1) {
return new QPdfDocumentRenderOptions(*param1);
}
int QPdfDocumentRenderOptions_rotation(const QPdfDocumentRenderOptions* self) {
QPdf::Rotation _ret = self->rotation();
return static_cast<int>(_ret);
}
void QPdfDocumentRenderOptions_setRotation(QPdfDocumentRenderOptions* self, int r) {
self->setRotation(static_cast<QPdf::Rotation>(r));
}
int QPdfDocumentRenderOptions_renderFlags(const QPdfDocumentRenderOptions* self) {
QPdf::RenderFlags _ret = self->renderFlags();
return static_cast<int>(_ret);
}
void QPdfDocumentRenderOptions_setRenderFlags(QPdfDocumentRenderOptions* self, int r) {
self->setRenderFlags(static_cast<QPdf::RenderFlags>(r));
}
QRect* QPdfDocumentRenderOptions_scaledClipRect(const QPdfDocumentRenderOptions* self) {
return new QRect(self->scaledClipRect());
}
void QPdfDocumentRenderOptions_setScaledClipRect(QPdfDocumentRenderOptions* self, QRect* r) {
self->setScaledClipRect(*r);
}
QSize* QPdfDocumentRenderOptions_scaledSize(const QPdfDocumentRenderOptions* self) {
return new QSize(self->scaledSize());
}
void QPdfDocumentRenderOptions_setScaledSize(QPdfDocumentRenderOptions* self, QSize* s) {
self->setScaledSize(*s);
}
void QPdfDocumentRenderOptions_delete(QPdfDocumentRenderOptions* self) {
delete self;
}

View File

@ -0,0 +1,109 @@
package pdf
/*
#include "gen_qpdfdocumentrenderoptions.h"
#include <stdlib.h>
*/
import "C"
import (
"github.com/mappu/miqt/qt"
"runtime"
"unsafe"
)
type QPdfDocumentRenderOptions struct {
h *C.QPdfDocumentRenderOptions
}
func (this *QPdfDocumentRenderOptions) cPointer() *C.QPdfDocumentRenderOptions {
if this == nil {
return nil
}
return this.h
}
func (this *QPdfDocumentRenderOptions) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
// newQPdfDocumentRenderOptions constructs the type using only CGO pointers.
func newQPdfDocumentRenderOptions(h *C.QPdfDocumentRenderOptions) *QPdfDocumentRenderOptions {
if h == nil {
return nil
}
return &QPdfDocumentRenderOptions{h: h}
}
// UnsafeNewQPdfDocumentRenderOptions constructs the type using only unsafe pointers.
func UnsafeNewQPdfDocumentRenderOptions(h unsafe.Pointer) *QPdfDocumentRenderOptions {
return newQPdfDocumentRenderOptions((*C.QPdfDocumentRenderOptions)(h))
}
// NewQPdfDocumentRenderOptions constructs a new QPdfDocumentRenderOptions object.
func NewQPdfDocumentRenderOptions() *QPdfDocumentRenderOptions {
return newQPdfDocumentRenderOptions(C.QPdfDocumentRenderOptions_new())
}
// NewQPdfDocumentRenderOptions2 constructs a new QPdfDocumentRenderOptions object.
func NewQPdfDocumentRenderOptions2(param1 *QPdfDocumentRenderOptions) *QPdfDocumentRenderOptions {
return newQPdfDocumentRenderOptions(C.QPdfDocumentRenderOptions_new2(param1.cPointer()))
}
func (this *QPdfDocumentRenderOptions) Rotation() QPdf__Rotation {
return (QPdf__Rotation)(C.QPdfDocumentRenderOptions_rotation(this.h))
}
func (this *QPdfDocumentRenderOptions) SetRotation(r QPdf__Rotation) {
C.QPdfDocumentRenderOptions_setRotation(this.h, (C.int)(r))
}
func (this *QPdfDocumentRenderOptions) RenderFlags() QPdf__RenderFlag {
return (QPdf__RenderFlag)(C.QPdfDocumentRenderOptions_renderFlags(this.h))
}
func (this *QPdfDocumentRenderOptions) SetRenderFlags(r QPdf__RenderFlag) {
C.QPdfDocumentRenderOptions_setRenderFlags(this.h, (C.int)(r))
}
func (this *QPdfDocumentRenderOptions) ScaledClipRect() *qt.QRect {
_goptr := qt.UnsafeNewQRect(unsafe.Pointer(C.QPdfDocumentRenderOptions_scaledClipRect(this.h)))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QPdfDocumentRenderOptions) SetScaledClipRect(r *qt.QRect) {
C.QPdfDocumentRenderOptions_setScaledClipRect(this.h, (*C.QRect)(r.UnsafePointer()))
}
func (this *QPdfDocumentRenderOptions) ScaledSize() *qt.QSize {
_goptr := qt.UnsafeNewQSize(unsafe.Pointer(C.QPdfDocumentRenderOptions_scaledSize(this.h)))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QPdfDocumentRenderOptions) SetScaledSize(s *qt.QSize) {
C.QPdfDocumentRenderOptions_setScaledSize(this.h, (*C.QSize)(s.UnsafePointer()))
}
// Delete this object from C++ memory.
func (this *QPdfDocumentRenderOptions) Delete() {
C.QPdfDocumentRenderOptions_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 *QPdfDocumentRenderOptions) GoGC() {
runtime.SetFinalizer(this, func(this *QPdfDocumentRenderOptions) {
this.Delete()
runtime.KeepAlive(this.h)
})
}

View File

@ -0,0 +1,43 @@
#pragma once
#ifndef MIQT_QT_PDF_GEN_QPDFDOCUMENTRENDEROPTIONS_H
#define MIQT_QT_PDF_GEN_QPDFDOCUMENTRENDEROPTIONS_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 QPdfDocumentRenderOptions;
class QRect;
class QSize;
#else
typedef struct QPdfDocumentRenderOptions QPdfDocumentRenderOptions;
typedef struct QRect QRect;
typedef struct QSize QSize;
#endif
QPdfDocumentRenderOptions* QPdfDocumentRenderOptions_new();
QPdfDocumentRenderOptions* QPdfDocumentRenderOptions_new2(QPdfDocumentRenderOptions* param1);
int QPdfDocumentRenderOptions_rotation(const QPdfDocumentRenderOptions* self);
void QPdfDocumentRenderOptions_setRotation(QPdfDocumentRenderOptions* self, int r);
int QPdfDocumentRenderOptions_renderFlags(const QPdfDocumentRenderOptions* self);
void QPdfDocumentRenderOptions_setRenderFlags(QPdfDocumentRenderOptions* self, int r);
QRect* QPdfDocumentRenderOptions_scaledClipRect(const QPdfDocumentRenderOptions* self);
void QPdfDocumentRenderOptions_setScaledClipRect(QPdfDocumentRenderOptions* self, QRect* r);
QSize* QPdfDocumentRenderOptions_scaledSize(const QPdfDocumentRenderOptions* self);
void QPdfDocumentRenderOptions_setScaledSize(QPdfDocumentRenderOptions* self, QSize* s);
void QPdfDocumentRenderOptions_delete(QPdfDocumentRenderOptions* self);
#ifdef __cplusplus
} /* extern C */
#endif
#endif

View File

@ -0,0 +1,11 @@
#include <qpdfnamespace.h>
#include "gen_qpdfnamespace.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
} /* extern C */
#endif

View File

@ -0,0 +1,31 @@
package pdf
/*
#include "gen_qpdfnamespace.h"
#include <stdlib.h>
*/
import "C"
type QPdf__Rotation int
const (
QPdf__Rotate0 QPdf__Rotation = 0
QPdf__Rotate90 QPdf__Rotation = 1
QPdf__Rotate180 QPdf__Rotation = 2
QPdf__Rotate270 QPdf__Rotation = 3
)
type QPdf__RenderFlag int
const (
QPdf__NoRenderFlags QPdf__RenderFlag = 0
QPdf__RenderAnnotations QPdf__RenderFlag = 1
QPdf__RenderOptimizedForLcd QPdf__RenderFlag = 2
QPdf__RenderGrayscale QPdf__RenderFlag = 4
QPdf__RenderForceHalftone QPdf__RenderFlag = 8
QPdf__RenderTextAliased QPdf__RenderFlag = 16
QPdf__RenderImageAliased QPdf__RenderFlag = 32
QPdf__RenderPathAliased QPdf__RenderFlag = 64
)

View File

@ -0,0 +1,25 @@
#pragma once
#ifndef MIQT_QT_PDF_GEN_QPDFNAMESPACE_H
#define MIQT_QT_PDF_GEN_QPDFNAMESPACE_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
#else
#endif
#ifdef __cplusplus
} /* extern C */
#endif
#endif

View File

@ -0,0 +1,530 @@
#include <QChildEvent>
#include <QEvent>
#include <QMetaMethod>
#include <QMetaObject>
#include <QObject>
#include <QPdfDocument>
#include <QPdfPageNavigation>
#include <QString>
#include <QByteArray>
#include <cstring>
#include <QTimerEvent>
#include <qpdfpagenavigation.h>
#include "gen_qpdfpagenavigation.h"
#ifdef __cplusplus
extern "C" {
#endif
void miqt_exec_callback_QPdfPageNavigation_documentChanged(intptr_t, QPdfDocument*);
void miqt_exec_callback_QPdfPageNavigation_currentPageChanged(intptr_t, int);
void miqt_exec_callback_QPdfPageNavigation_pageCountChanged(intptr_t, int);
void miqt_exec_callback_QPdfPageNavigation_canGoToPreviousPageChanged(intptr_t, bool);
void miqt_exec_callback_QPdfPageNavigation_canGoToNextPageChanged(intptr_t, bool);
bool miqt_exec_callback_QPdfPageNavigation_event(QPdfPageNavigation*, intptr_t, QEvent*);
bool miqt_exec_callback_QPdfPageNavigation_eventFilter(QPdfPageNavigation*, intptr_t, QObject*, QEvent*);
void miqt_exec_callback_QPdfPageNavigation_timerEvent(QPdfPageNavigation*, intptr_t, QTimerEvent*);
void miqt_exec_callback_QPdfPageNavigation_childEvent(QPdfPageNavigation*, intptr_t, QChildEvent*);
void miqt_exec_callback_QPdfPageNavigation_customEvent(QPdfPageNavigation*, intptr_t, QEvent*);
void miqt_exec_callback_QPdfPageNavigation_connectNotify(QPdfPageNavigation*, intptr_t, QMetaMethod*);
void miqt_exec_callback_QPdfPageNavigation_disconnectNotify(QPdfPageNavigation*, intptr_t, QMetaMethod*);
#ifdef __cplusplus
} /* extern C */
#endif
class MiqtVirtualQPdfPageNavigation final : public QPdfPageNavigation {
public:
MiqtVirtualQPdfPageNavigation(): QPdfPageNavigation() {};
MiqtVirtualQPdfPageNavigation(QObject* parent): QPdfPageNavigation(parent) {};
virtual ~MiqtVirtualQPdfPageNavigation() override = default;
// cgo.Handle value for overwritten implementation
intptr_t handle__event = 0;
// Subclass to allow providing a Go implementation
virtual bool event(QEvent* event) override {
if (handle__event == 0) {
return QPdfPageNavigation::event(event);
}
QEvent* sigval1 = event;
bool callback_return_value = miqt_exec_callback_QPdfPageNavigation_event(this, handle__event, sigval1);
return callback_return_value;
}
friend bool QPdfPageNavigation_virtualbase_event(void* self, QEvent* event);
// cgo.Handle value for overwritten implementation
intptr_t handle__eventFilter = 0;
// Subclass to allow providing a Go implementation
virtual bool eventFilter(QObject* watched, QEvent* event) override {
if (handle__eventFilter == 0) {
return QPdfPageNavigation::eventFilter(watched, event);
}
QObject* sigval1 = watched;
QEvent* sigval2 = event;
bool callback_return_value = miqt_exec_callback_QPdfPageNavigation_eventFilter(this, handle__eventFilter, sigval1, sigval2);
return callback_return_value;
}
friend bool QPdfPageNavigation_virtualbase_eventFilter(void* self, QObject* watched, QEvent* event);
// cgo.Handle value for overwritten implementation
intptr_t handle__timerEvent = 0;
// Subclass to allow providing a Go implementation
virtual void timerEvent(QTimerEvent* event) override {
if (handle__timerEvent == 0) {
QPdfPageNavigation::timerEvent(event);
return;
}
QTimerEvent* sigval1 = event;
miqt_exec_callback_QPdfPageNavigation_timerEvent(this, handle__timerEvent, sigval1);
}
friend void QPdfPageNavigation_virtualbase_timerEvent(void* self, QTimerEvent* event);
// cgo.Handle value for overwritten implementation
intptr_t handle__childEvent = 0;
// Subclass to allow providing a Go implementation
virtual void childEvent(QChildEvent* event) override {
if (handle__childEvent == 0) {
QPdfPageNavigation::childEvent(event);
return;
}
QChildEvent* sigval1 = event;
miqt_exec_callback_QPdfPageNavigation_childEvent(this, handle__childEvent, sigval1);
}
friend void QPdfPageNavigation_virtualbase_childEvent(void* self, QChildEvent* event);
// cgo.Handle value for overwritten implementation
intptr_t handle__customEvent = 0;
// Subclass to allow providing a Go implementation
virtual void customEvent(QEvent* event) override {
if (handle__customEvent == 0) {
QPdfPageNavigation::customEvent(event);
return;
}
QEvent* sigval1 = event;
miqt_exec_callback_QPdfPageNavigation_customEvent(this, handle__customEvent, sigval1);
}
friend void QPdfPageNavigation_virtualbase_customEvent(void* self, QEvent* event);
// cgo.Handle value for overwritten implementation
intptr_t handle__connectNotify = 0;
// Subclass to allow providing a Go implementation
virtual void connectNotify(const QMetaMethod& signal) override {
if (handle__connectNotify == 0) {
QPdfPageNavigation::connectNotify(signal);
return;
}
const QMetaMethod& signal_ret = signal;
// Cast returned reference into pointer
QMetaMethod* sigval1 = const_cast<QMetaMethod*>(&signal_ret);
miqt_exec_callback_QPdfPageNavigation_connectNotify(this, handle__connectNotify, sigval1);
}
friend void QPdfPageNavigation_virtualbase_connectNotify(void* self, QMetaMethod* signal);
// cgo.Handle value for overwritten implementation
intptr_t handle__disconnectNotify = 0;
// Subclass to allow providing a Go implementation
virtual void disconnectNotify(const QMetaMethod& signal) override {
if (handle__disconnectNotify == 0) {
QPdfPageNavigation::disconnectNotify(signal);
return;
}
const QMetaMethod& signal_ret = signal;
// Cast returned reference into pointer
QMetaMethod* sigval1 = const_cast<QMetaMethod*>(&signal_ret);
miqt_exec_callback_QPdfPageNavigation_disconnectNotify(this, handle__disconnectNotify, sigval1);
}
friend void QPdfPageNavigation_virtualbase_disconnectNotify(void* self, QMetaMethod* signal);
// Wrappers to allow calling protected methods:
friend QObject* QPdfPageNavigation_protectedbase_sender(bool* _dynamic_cast_ok, const void* self);
friend int QPdfPageNavigation_protectedbase_senderSignalIndex(bool* _dynamic_cast_ok, const void* self);
friend int QPdfPageNavigation_protectedbase_receivers(bool* _dynamic_cast_ok, const void* self, const char* signal);
friend bool QPdfPageNavigation_protectedbase_isSignalConnected(bool* _dynamic_cast_ok, const void* self, QMetaMethod* signal);
};
QPdfPageNavigation* QPdfPageNavigation_new() {
return new MiqtVirtualQPdfPageNavigation();
}
QPdfPageNavigation* QPdfPageNavigation_new2(QObject* parent) {
return new MiqtVirtualQPdfPageNavigation(parent);
}
void QPdfPageNavigation_virtbase(QPdfPageNavigation* src, QObject** outptr_QObject) {
*outptr_QObject = static_cast<QObject*>(src);
}
QMetaObject* QPdfPageNavigation_metaObject(const QPdfPageNavigation* self) {
return (QMetaObject*) self->metaObject();
}
void* QPdfPageNavigation_metacast(QPdfPageNavigation* self, const char* param1) {
return self->qt_metacast(param1);
}
struct miqt_string QPdfPageNavigation_tr(const char* s) {
QString _ret = QPdfPageNavigation::tr(s);
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
struct miqt_string _ms;
_ms.len = _b.length();
_ms.data = static_cast<char*>(malloc(_ms.len));
memcpy(_ms.data, _b.data(), _ms.len);
return _ms;
}
struct miqt_string QPdfPageNavigation_trUtf8(const char* s) {
QString _ret = QPdfPageNavigation::trUtf8(s);
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
struct miqt_string _ms;
_ms.len = _b.length();
_ms.data = static_cast<char*>(malloc(_ms.len));
memcpy(_ms.data, _b.data(), _ms.len);
return _ms;
}
QPdfDocument* QPdfPageNavigation_document(const QPdfPageNavigation* self) {
return self->document();
}
void QPdfPageNavigation_setDocument(QPdfPageNavigation* self, QPdfDocument* document) {
self->setDocument(document);
}
int QPdfPageNavigation_currentPage(const QPdfPageNavigation* self) {
return self->currentPage();
}
void QPdfPageNavigation_setCurrentPage(QPdfPageNavigation* self, int currentPage) {
self->setCurrentPage(static_cast<int>(currentPage));
}
int QPdfPageNavigation_pageCount(const QPdfPageNavigation* self) {
return self->pageCount();
}
bool QPdfPageNavigation_canGoToPreviousPage(const QPdfPageNavigation* self) {
return self->canGoToPreviousPage();
}
bool QPdfPageNavigation_canGoToNextPage(const QPdfPageNavigation* self) {
return self->canGoToNextPage();
}
void QPdfPageNavigation_goToPreviousPage(QPdfPageNavigation* self) {
self->goToPreviousPage();
}
void QPdfPageNavigation_goToNextPage(QPdfPageNavigation* self) {
self->goToNextPage();
}
void QPdfPageNavigation_documentChanged(QPdfPageNavigation* self, QPdfDocument* document) {
self->documentChanged(document);
}
void QPdfPageNavigation_connect_documentChanged(QPdfPageNavigation* self, intptr_t slot) {
MiqtVirtualQPdfPageNavigation::connect(self, static_cast<void (QPdfPageNavigation::*)(QPdfDocument*)>(&QPdfPageNavigation::documentChanged), self, [=](QPdfDocument* document) {
QPdfDocument* sigval1 = document;
miqt_exec_callback_QPdfPageNavigation_documentChanged(slot, sigval1);
});
}
void QPdfPageNavigation_currentPageChanged(QPdfPageNavigation* self, int currentPage) {
self->currentPageChanged(static_cast<int>(currentPage));
}
void QPdfPageNavigation_connect_currentPageChanged(QPdfPageNavigation* self, intptr_t slot) {
MiqtVirtualQPdfPageNavigation::connect(self, static_cast<void (QPdfPageNavigation::*)(int)>(&QPdfPageNavigation::currentPageChanged), self, [=](int currentPage) {
int sigval1 = currentPage;
miqt_exec_callback_QPdfPageNavigation_currentPageChanged(slot, sigval1);
});
}
void QPdfPageNavigation_pageCountChanged(QPdfPageNavigation* self, int pageCount) {
self->pageCountChanged(static_cast<int>(pageCount));
}
void QPdfPageNavigation_connect_pageCountChanged(QPdfPageNavigation* self, intptr_t slot) {
MiqtVirtualQPdfPageNavigation::connect(self, static_cast<void (QPdfPageNavigation::*)(int)>(&QPdfPageNavigation::pageCountChanged), self, [=](int pageCount) {
int sigval1 = pageCount;
miqt_exec_callback_QPdfPageNavigation_pageCountChanged(slot, sigval1);
});
}
void QPdfPageNavigation_canGoToPreviousPageChanged(QPdfPageNavigation* self, bool canGo) {
self->canGoToPreviousPageChanged(canGo);
}
void QPdfPageNavigation_connect_canGoToPreviousPageChanged(QPdfPageNavigation* self, intptr_t slot) {
MiqtVirtualQPdfPageNavigation::connect(self, static_cast<void (QPdfPageNavigation::*)(bool)>(&QPdfPageNavigation::canGoToPreviousPageChanged), self, [=](bool canGo) {
bool sigval1 = canGo;
miqt_exec_callback_QPdfPageNavigation_canGoToPreviousPageChanged(slot, sigval1);
});
}
void QPdfPageNavigation_canGoToNextPageChanged(QPdfPageNavigation* self, bool canGo) {
self->canGoToNextPageChanged(canGo);
}
void QPdfPageNavigation_connect_canGoToNextPageChanged(QPdfPageNavigation* self, intptr_t slot) {
MiqtVirtualQPdfPageNavigation::connect(self, static_cast<void (QPdfPageNavigation::*)(bool)>(&QPdfPageNavigation::canGoToNextPageChanged), self, [=](bool canGo) {
bool sigval1 = canGo;
miqt_exec_callback_QPdfPageNavigation_canGoToNextPageChanged(slot, sigval1);
});
}
struct miqt_string QPdfPageNavigation_tr2(const char* s, const char* c) {
QString _ret = QPdfPageNavigation::tr(s, c);
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
struct miqt_string _ms;
_ms.len = _b.length();
_ms.data = static_cast<char*>(malloc(_ms.len));
memcpy(_ms.data, _b.data(), _ms.len);
return _ms;
}
struct miqt_string QPdfPageNavigation_tr3(const char* s, const char* c, int n) {
QString _ret = QPdfPageNavigation::tr(s, c, static_cast<int>(n));
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
struct miqt_string _ms;
_ms.len = _b.length();
_ms.data = static_cast<char*>(malloc(_ms.len));
memcpy(_ms.data, _b.data(), _ms.len);
return _ms;
}
struct miqt_string QPdfPageNavigation_trUtf82(const char* s, const char* c) {
QString _ret = QPdfPageNavigation::trUtf8(s, c);
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
struct miqt_string _ms;
_ms.len = _b.length();
_ms.data = static_cast<char*>(malloc(_ms.len));
memcpy(_ms.data, _b.data(), _ms.len);
return _ms;
}
struct miqt_string QPdfPageNavigation_trUtf83(const char* s, const char* c, int n) {
QString _ret = QPdfPageNavigation::trUtf8(s, c, static_cast<int>(n));
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
struct miqt_string _ms;
_ms.len = _b.length();
_ms.data = static_cast<char*>(malloc(_ms.len));
memcpy(_ms.data, _b.data(), _ms.len);
return _ms;
}
bool QPdfPageNavigation_override_virtual_event(void* self, intptr_t slot) {
MiqtVirtualQPdfPageNavigation* self_cast = dynamic_cast<MiqtVirtualQPdfPageNavigation*>( (QPdfPageNavigation*)(self) );
if (self_cast == nullptr) {
return false;
}
self_cast->handle__event = slot;
return true;
}
bool QPdfPageNavigation_virtualbase_event(void* self, QEvent* event) {
return ( (MiqtVirtualQPdfPageNavigation*)(self) )->QPdfPageNavigation::event(event);
}
bool QPdfPageNavigation_override_virtual_eventFilter(void* self, intptr_t slot) {
MiqtVirtualQPdfPageNavigation* self_cast = dynamic_cast<MiqtVirtualQPdfPageNavigation*>( (QPdfPageNavigation*)(self) );
if (self_cast == nullptr) {
return false;
}
self_cast->handle__eventFilter = slot;
return true;
}
bool QPdfPageNavigation_virtualbase_eventFilter(void* self, QObject* watched, QEvent* event) {
return ( (MiqtVirtualQPdfPageNavigation*)(self) )->QPdfPageNavigation::eventFilter(watched, event);
}
bool QPdfPageNavigation_override_virtual_timerEvent(void* self, intptr_t slot) {
MiqtVirtualQPdfPageNavigation* self_cast = dynamic_cast<MiqtVirtualQPdfPageNavigation*>( (QPdfPageNavigation*)(self) );
if (self_cast == nullptr) {
return false;
}
self_cast->handle__timerEvent = slot;
return true;
}
void QPdfPageNavigation_virtualbase_timerEvent(void* self, QTimerEvent* event) {
( (MiqtVirtualQPdfPageNavigation*)(self) )->QPdfPageNavigation::timerEvent(event);
}
bool QPdfPageNavigation_override_virtual_childEvent(void* self, intptr_t slot) {
MiqtVirtualQPdfPageNavigation* self_cast = dynamic_cast<MiqtVirtualQPdfPageNavigation*>( (QPdfPageNavigation*)(self) );
if (self_cast == nullptr) {
return false;
}
self_cast->handle__childEvent = slot;
return true;
}
void QPdfPageNavigation_virtualbase_childEvent(void* self, QChildEvent* event) {
( (MiqtVirtualQPdfPageNavigation*)(self) )->QPdfPageNavigation::childEvent(event);
}
bool QPdfPageNavigation_override_virtual_customEvent(void* self, intptr_t slot) {
MiqtVirtualQPdfPageNavigation* self_cast = dynamic_cast<MiqtVirtualQPdfPageNavigation*>( (QPdfPageNavigation*)(self) );
if (self_cast == nullptr) {
return false;
}
self_cast->handle__customEvent = slot;
return true;
}
void QPdfPageNavigation_virtualbase_customEvent(void* self, QEvent* event) {
( (MiqtVirtualQPdfPageNavigation*)(self) )->QPdfPageNavigation::customEvent(event);
}
bool QPdfPageNavigation_override_virtual_connectNotify(void* self, intptr_t slot) {
MiqtVirtualQPdfPageNavigation* self_cast = dynamic_cast<MiqtVirtualQPdfPageNavigation*>( (QPdfPageNavigation*)(self) );
if (self_cast == nullptr) {
return false;
}
self_cast->handle__connectNotify = slot;
return true;
}
void QPdfPageNavigation_virtualbase_connectNotify(void* self, QMetaMethod* signal) {
( (MiqtVirtualQPdfPageNavigation*)(self) )->QPdfPageNavigation::connectNotify(*signal);
}
bool QPdfPageNavigation_override_virtual_disconnectNotify(void* self, intptr_t slot) {
MiqtVirtualQPdfPageNavigation* self_cast = dynamic_cast<MiqtVirtualQPdfPageNavigation*>( (QPdfPageNavigation*)(self) );
if (self_cast == nullptr) {
return false;
}
self_cast->handle__disconnectNotify = slot;
return true;
}
void QPdfPageNavigation_virtualbase_disconnectNotify(void* self, QMetaMethod* signal) {
( (MiqtVirtualQPdfPageNavigation*)(self) )->QPdfPageNavigation::disconnectNotify(*signal);
}
QObject* QPdfPageNavigation_protectedbase_sender(bool* _dynamic_cast_ok, const void* self) {
MiqtVirtualQPdfPageNavigation* self_cast = dynamic_cast<MiqtVirtualQPdfPageNavigation*>( (QPdfPageNavigation*)(self) );
if (self_cast == nullptr) {
*_dynamic_cast_ok = false;
return nullptr;
}
*_dynamic_cast_ok = true;
return self_cast->sender();
}
int QPdfPageNavigation_protectedbase_senderSignalIndex(bool* _dynamic_cast_ok, const void* self) {
MiqtVirtualQPdfPageNavigation* self_cast = dynamic_cast<MiqtVirtualQPdfPageNavigation*>( (QPdfPageNavigation*)(self) );
if (self_cast == nullptr) {
*_dynamic_cast_ok = false;
return 0;
}
*_dynamic_cast_ok = true;
return self_cast->senderSignalIndex();
}
int QPdfPageNavigation_protectedbase_receivers(bool* _dynamic_cast_ok, const void* self, const char* signal) {
MiqtVirtualQPdfPageNavigation* self_cast = dynamic_cast<MiqtVirtualQPdfPageNavigation*>( (QPdfPageNavigation*)(self) );
if (self_cast == nullptr) {
*_dynamic_cast_ok = false;
return 0;
}
*_dynamic_cast_ok = true;
return self_cast->receivers(signal);
}
bool QPdfPageNavigation_protectedbase_isSignalConnected(bool* _dynamic_cast_ok, const void* self, QMetaMethod* signal) {
MiqtVirtualQPdfPageNavigation* self_cast = dynamic_cast<MiqtVirtualQPdfPageNavigation*>( (QPdfPageNavigation*)(self) );
if (self_cast == nullptr) {
*_dynamic_cast_ok = false;
return false;
}
*_dynamic_cast_ok = true;
return self_cast->isSignalConnected(*signal);
}
void QPdfPageNavigation_delete(QPdfPageNavigation* self) {
delete self;
}

View File

@ -0,0 +1,532 @@
package pdf
/*
#include "gen_qpdfpagenavigation.h"
#include <stdlib.h>
*/
import "C"
import (
"github.com/mappu/miqt/qt"
"runtime"
"runtime/cgo"
"unsafe"
)
type QPdfPageNavigation struct {
h *C.QPdfPageNavigation
*qt.QObject
}
func (this *QPdfPageNavigation) cPointer() *C.QPdfPageNavigation {
if this == nil {
return nil
}
return this.h
}
func (this *QPdfPageNavigation) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
// newQPdfPageNavigation constructs the type using only CGO pointers.
func newQPdfPageNavigation(h *C.QPdfPageNavigation) *QPdfPageNavigation {
if h == nil {
return nil
}
var outptr_QObject *C.QObject = nil
C.QPdfPageNavigation_virtbase(h, &outptr_QObject)
return &QPdfPageNavigation{h: h,
QObject: qt.UnsafeNewQObject(unsafe.Pointer(outptr_QObject))}
}
// UnsafeNewQPdfPageNavigation constructs the type using only unsafe pointers.
func UnsafeNewQPdfPageNavigation(h unsafe.Pointer) *QPdfPageNavigation {
return newQPdfPageNavigation((*C.QPdfPageNavigation)(h))
}
// NewQPdfPageNavigation constructs a new QPdfPageNavigation object.
func NewQPdfPageNavigation() *QPdfPageNavigation {
return newQPdfPageNavigation(C.QPdfPageNavigation_new())
}
// NewQPdfPageNavigation2 constructs a new QPdfPageNavigation object.
func NewQPdfPageNavigation2(parent *qt.QObject) *QPdfPageNavigation {
return newQPdfPageNavigation(C.QPdfPageNavigation_new2((*C.QObject)(parent.UnsafePointer())))
}
func (this *QPdfPageNavigation) MetaObject() *qt.QMetaObject {
return qt.UnsafeNewQMetaObject(unsafe.Pointer(C.QPdfPageNavigation_metaObject(this.h)))
}
func (this *QPdfPageNavigation) Metacast(param1 string) unsafe.Pointer {
param1_Cstring := C.CString(param1)
defer C.free(unsafe.Pointer(param1_Cstring))
return (unsafe.Pointer)(C.QPdfPageNavigation_metacast(this.h, param1_Cstring))
}
func QPdfPageNavigation_Tr(s string) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
var _ms C.struct_miqt_string = C.QPdfPageNavigation_tr(s_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func QPdfPageNavigation_TrUtf8(s string) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
var _ms C.struct_miqt_string = C.QPdfPageNavigation_trUtf8(s_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func (this *QPdfPageNavigation) Document() *QPdfDocument {
return newQPdfDocument(C.QPdfPageNavigation_document(this.h))
}
func (this *QPdfPageNavigation) SetDocument(document *QPdfDocument) {
C.QPdfPageNavigation_setDocument(this.h, document.cPointer())
}
func (this *QPdfPageNavigation) CurrentPage() int {
return (int)(C.QPdfPageNavigation_currentPage(this.h))
}
func (this *QPdfPageNavigation) SetCurrentPage(currentPage int) {
C.QPdfPageNavigation_setCurrentPage(this.h, (C.int)(currentPage))
}
func (this *QPdfPageNavigation) PageCount() int {
return (int)(C.QPdfPageNavigation_pageCount(this.h))
}
func (this *QPdfPageNavigation) CanGoToPreviousPage() bool {
return (bool)(C.QPdfPageNavigation_canGoToPreviousPage(this.h))
}
func (this *QPdfPageNavigation) CanGoToNextPage() bool {
return (bool)(C.QPdfPageNavigation_canGoToNextPage(this.h))
}
func (this *QPdfPageNavigation) GoToPreviousPage() {
C.QPdfPageNavigation_goToPreviousPage(this.h)
}
func (this *QPdfPageNavigation) GoToNextPage() {
C.QPdfPageNavigation_goToNextPage(this.h)
}
func (this *QPdfPageNavigation) DocumentChanged(document *QPdfDocument) {
C.QPdfPageNavigation_documentChanged(this.h, document.cPointer())
}
func (this *QPdfPageNavigation) OnDocumentChanged(slot func(document *QPdfDocument)) {
C.QPdfPageNavigation_connect_documentChanged(this.h, C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QPdfPageNavigation_documentChanged
func miqt_exec_callback_QPdfPageNavigation_documentChanged(cb C.intptr_t, document *C.QPdfDocument) {
gofunc, ok := cgo.Handle(cb).Value().(func(document *QPdfDocument))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := newQPdfDocument(document)
gofunc(slotval1)
}
func (this *QPdfPageNavigation) CurrentPageChanged(currentPage int) {
C.QPdfPageNavigation_currentPageChanged(this.h, (C.int)(currentPage))
}
func (this *QPdfPageNavigation) OnCurrentPageChanged(slot func(currentPage int)) {
C.QPdfPageNavigation_connect_currentPageChanged(this.h, C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QPdfPageNavigation_currentPageChanged
func miqt_exec_callback_QPdfPageNavigation_currentPageChanged(cb C.intptr_t, currentPage C.int) {
gofunc, ok := cgo.Handle(cb).Value().(func(currentPage int))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := (int)(currentPage)
gofunc(slotval1)
}
func (this *QPdfPageNavigation) PageCountChanged(pageCount int) {
C.QPdfPageNavigation_pageCountChanged(this.h, (C.int)(pageCount))
}
func (this *QPdfPageNavigation) OnPageCountChanged(slot func(pageCount int)) {
C.QPdfPageNavigation_connect_pageCountChanged(this.h, C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QPdfPageNavigation_pageCountChanged
func miqt_exec_callback_QPdfPageNavigation_pageCountChanged(cb C.intptr_t, pageCount C.int) {
gofunc, ok := cgo.Handle(cb).Value().(func(pageCount int))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := (int)(pageCount)
gofunc(slotval1)
}
func (this *QPdfPageNavigation) CanGoToPreviousPageChanged(canGo bool) {
C.QPdfPageNavigation_canGoToPreviousPageChanged(this.h, (C.bool)(canGo))
}
func (this *QPdfPageNavigation) OnCanGoToPreviousPageChanged(slot func(canGo bool)) {
C.QPdfPageNavigation_connect_canGoToPreviousPageChanged(this.h, C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QPdfPageNavigation_canGoToPreviousPageChanged
func miqt_exec_callback_QPdfPageNavigation_canGoToPreviousPageChanged(cb C.intptr_t, canGo C.bool) {
gofunc, ok := cgo.Handle(cb).Value().(func(canGo bool))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := (bool)(canGo)
gofunc(slotval1)
}
func (this *QPdfPageNavigation) CanGoToNextPageChanged(canGo bool) {
C.QPdfPageNavigation_canGoToNextPageChanged(this.h, (C.bool)(canGo))
}
func (this *QPdfPageNavigation) OnCanGoToNextPageChanged(slot func(canGo bool)) {
C.QPdfPageNavigation_connect_canGoToNextPageChanged(this.h, C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QPdfPageNavigation_canGoToNextPageChanged
func miqt_exec_callback_QPdfPageNavigation_canGoToNextPageChanged(cb C.intptr_t, canGo C.bool) {
gofunc, ok := cgo.Handle(cb).Value().(func(canGo bool))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := (bool)(canGo)
gofunc(slotval1)
}
func QPdfPageNavigation_Tr2(s string, c string) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
c_Cstring := C.CString(c)
defer C.free(unsafe.Pointer(c_Cstring))
var _ms C.struct_miqt_string = C.QPdfPageNavigation_tr2(s_Cstring, c_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func QPdfPageNavigation_Tr3(s string, c string, n int) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
c_Cstring := C.CString(c)
defer C.free(unsafe.Pointer(c_Cstring))
var _ms C.struct_miqt_string = C.QPdfPageNavigation_tr3(s_Cstring, c_Cstring, (C.int)(n))
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func QPdfPageNavigation_TrUtf82(s string, c string) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
c_Cstring := C.CString(c)
defer C.free(unsafe.Pointer(c_Cstring))
var _ms C.struct_miqt_string = C.QPdfPageNavigation_trUtf82(s_Cstring, c_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func QPdfPageNavigation_TrUtf83(s string, c string, n int) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
c_Cstring := C.CString(c)
defer C.free(unsafe.Pointer(c_Cstring))
var _ms C.struct_miqt_string = C.QPdfPageNavigation_trUtf83(s_Cstring, c_Cstring, (C.int)(n))
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
// Sender can only be called from a QPdfPageNavigation that was directly constructed.
func (this *QPdfPageNavigation) Sender() *qt.QObject {
var _dynamic_cast_ok C.bool = false
_method_ret := qt.UnsafeNewQObject(unsafe.Pointer(C.QPdfPageNavigation_protectedbase_sender(&_dynamic_cast_ok, unsafe.Pointer(this.h))))
if !_dynamic_cast_ok {
panic("miqt: can only call protected methods for directly constructed types")
}
return _method_ret
}
// SenderSignalIndex can only be called from a QPdfPageNavigation that was directly constructed.
func (this *QPdfPageNavigation) SenderSignalIndex() int {
var _dynamic_cast_ok C.bool = false
_method_ret := (int)(C.QPdfPageNavigation_protectedbase_senderSignalIndex(&_dynamic_cast_ok, unsafe.Pointer(this.h)))
if !_dynamic_cast_ok {
panic("miqt: can only call protected methods for directly constructed types")
}
return _method_ret
}
// Receivers can only be called from a QPdfPageNavigation that was directly constructed.
func (this *QPdfPageNavigation) Receivers(signal string) int {
signal_Cstring := C.CString(signal)
defer C.free(unsafe.Pointer(signal_Cstring))
var _dynamic_cast_ok C.bool = false
_method_ret := (int)(C.QPdfPageNavigation_protectedbase_receivers(&_dynamic_cast_ok, unsafe.Pointer(this.h), signal_Cstring))
if !_dynamic_cast_ok {
panic("miqt: can only call protected methods for directly constructed types")
}
return _method_ret
}
// IsSignalConnected can only be called from a QPdfPageNavigation that was directly constructed.
func (this *QPdfPageNavigation) IsSignalConnected(signal *qt.QMetaMethod) bool {
var _dynamic_cast_ok C.bool = false
_method_ret := (bool)(C.QPdfPageNavigation_protectedbase_isSignalConnected(&_dynamic_cast_ok, unsafe.Pointer(this.h), (*C.QMetaMethod)(signal.UnsafePointer())))
if !_dynamic_cast_ok {
panic("miqt: can only call protected methods for directly constructed types")
}
return _method_ret
}
func (this *QPdfPageNavigation) callVirtualBase_Event(event *qt.QEvent) bool {
return (bool)(C.QPdfPageNavigation_virtualbase_event(unsafe.Pointer(this.h), (*C.QEvent)(event.UnsafePointer())))
}
func (this *QPdfPageNavigation) OnEvent(slot func(super func(event *qt.QEvent) bool, event *qt.QEvent) bool) {
ok := C.QPdfPageNavigation_override_virtual_event(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
}
}
//export miqt_exec_callback_QPdfPageNavigation_event
func miqt_exec_callback_QPdfPageNavigation_event(self *C.QPdfPageNavigation, cb C.intptr_t, event *C.QEvent) C.bool {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(event *qt.QEvent) bool, event *qt.QEvent) bool)
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := qt.UnsafeNewQEvent(unsafe.Pointer(event))
virtualReturn := gofunc((&QPdfPageNavigation{h: self}).callVirtualBase_Event, slotval1)
return (C.bool)(virtualReturn)
}
func (this *QPdfPageNavigation) callVirtualBase_EventFilter(watched *qt.QObject, event *qt.QEvent) bool {
return (bool)(C.QPdfPageNavigation_virtualbase_eventFilter(unsafe.Pointer(this.h), (*C.QObject)(watched.UnsafePointer()), (*C.QEvent)(event.UnsafePointer())))
}
func (this *QPdfPageNavigation) OnEventFilter(slot func(super func(watched *qt.QObject, event *qt.QEvent) bool, watched *qt.QObject, event *qt.QEvent) bool) {
ok := C.QPdfPageNavigation_override_virtual_eventFilter(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
}
}
//export miqt_exec_callback_QPdfPageNavigation_eventFilter
func miqt_exec_callback_QPdfPageNavigation_eventFilter(self *C.QPdfPageNavigation, cb C.intptr_t, watched *C.QObject, event *C.QEvent) C.bool {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(watched *qt.QObject, event *qt.QEvent) bool, watched *qt.QObject, event *qt.QEvent) bool)
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := qt.UnsafeNewQObject(unsafe.Pointer(watched))
slotval2 := qt.UnsafeNewQEvent(unsafe.Pointer(event))
virtualReturn := gofunc((&QPdfPageNavigation{h: self}).callVirtualBase_EventFilter, slotval1, slotval2)
return (C.bool)(virtualReturn)
}
func (this *QPdfPageNavigation) callVirtualBase_TimerEvent(event *qt.QTimerEvent) {
C.QPdfPageNavigation_virtualbase_timerEvent(unsafe.Pointer(this.h), (*C.QTimerEvent)(event.UnsafePointer()))
}
func (this *QPdfPageNavigation) OnTimerEvent(slot func(super func(event *qt.QTimerEvent), event *qt.QTimerEvent)) {
ok := C.QPdfPageNavigation_override_virtual_timerEvent(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
}
}
//export miqt_exec_callback_QPdfPageNavigation_timerEvent
func miqt_exec_callback_QPdfPageNavigation_timerEvent(self *C.QPdfPageNavigation, cb C.intptr_t, event *C.QTimerEvent) {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(event *qt.QTimerEvent), event *qt.QTimerEvent))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := qt.UnsafeNewQTimerEvent(unsafe.Pointer(event))
gofunc((&QPdfPageNavigation{h: self}).callVirtualBase_TimerEvent, slotval1)
}
func (this *QPdfPageNavigation) callVirtualBase_ChildEvent(event *qt.QChildEvent) {
C.QPdfPageNavigation_virtualbase_childEvent(unsafe.Pointer(this.h), (*C.QChildEvent)(event.UnsafePointer()))
}
func (this *QPdfPageNavigation) OnChildEvent(slot func(super func(event *qt.QChildEvent), event *qt.QChildEvent)) {
ok := C.QPdfPageNavigation_override_virtual_childEvent(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
}
}
//export miqt_exec_callback_QPdfPageNavigation_childEvent
func miqt_exec_callback_QPdfPageNavigation_childEvent(self *C.QPdfPageNavigation, cb C.intptr_t, event *C.QChildEvent) {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(event *qt.QChildEvent), event *qt.QChildEvent))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := qt.UnsafeNewQChildEvent(unsafe.Pointer(event))
gofunc((&QPdfPageNavigation{h: self}).callVirtualBase_ChildEvent, slotval1)
}
func (this *QPdfPageNavigation) callVirtualBase_CustomEvent(event *qt.QEvent) {
C.QPdfPageNavigation_virtualbase_customEvent(unsafe.Pointer(this.h), (*C.QEvent)(event.UnsafePointer()))
}
func (this *QPdfPageNavigation) OnCustomEvent(slot func(super func(event *qt.QEvent), event *qt.QEvent)) {
ok := C.QPdfPageNavigation_override_virtual_customEvent(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
}
}
//export miqt_exec_callback_QPdfPageNavigation_customEvent
func miqt_exec_callback_QPdfPageNavigation_customEvent(self *C.QPdfPageNavigation, cb C.intptr_t, event *C.QEvent) {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(event *qt.QEvent), event *qt.QEvent))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := qt.UnsafeNewQEvent(unsafe.Pointer(event))
gofunc((&QPdfPageNavigation{h: self}).callVirtualBase_CustomEvent, slotval1)
}
func (this *QPdfPageNavigation) callVirtualBase_ConnectNotify(signal *qt.QMetaMethod) {
C.QPdfPageNavigation_virtualbase_connectNotify(unsafe.Pointer(this.h), (*C.QMetaMethod)(signal.UnsafePointer()))
}
func (this *QPdfPageNavigation) OnConnectNotify(slot func(super func(signal *qt.QMetaMethod), signal *qt.QMetaMethod)) {
ok := C.QPdfPageNavigation_override_virtual_connectNotify(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
}
}
//export miqt_exec_callback_QPdfPageNavigation_connectNotify
func miqt_exec_callback_QPdfPageNavigation_connectNotify(self *C.QPdfPageNavigation, cb C.intptr_t, signal *C.QMetaMethod) {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(signal *qt.QMetaMethod), signal *qt.QMetaMethod))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := qt.UnsafeNewQMetaMethod(unsafe.Pointer(signal))
gofunc((&QPdfPageNavigation{h: self}).callVirtualBase_ConnectNotify, slotval1)
}
func (this *QPdfPageNavigation) callVirtualBase_DisconnectNotify(signal *qt.QMetaMethod) {
C.QPdfPageNavigation_virtualbase_disconnectNotify(unsafe.Pointer(this.h), (*C.QMetaMethod)(signal.UnsafePointer()))
}
func (this *QPdfPageNavigation) OnDisconnectNotify(slot func(super func(signal *qt.QMetaMethod), signal *qt.QMetaMethod)) {
ok := C.QPdfPageNavigation_override_virtual_disconnectNotify(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
}
}
//export miqt_exec_callback_QPdfPageNavigation_disconnectNotify
func miqt_exec_callback_QPdfPageNavigation_disconnectNotify(self *C.QPdfPageNavigation, cb C.intptr_t, signal *C.QMetaMethod) {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(signal *qt.QMetaMethod), signal *qt.QMetaMethod))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := qt.UnsafeNewQMetaMethod(unsafe.Pointer(signal))
gofunc((&QPdfPageNavigation{h: self}).callVirtualBase_DisconnectNotify, slotval1)
}
// Delete this object from C++ memory.
func (this *QPdfPageNavigation) Delete() {
C.QPdfPageNavigation_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 *QPdfPageNavigation) GoGC() {
runtime.SetFinalizer(this, func(this *QPdfPageNavigation) {
this.Delete()
runtime.KeepAlive(this.h)
})
}

View File

@ -0,0 +1,91 @@
#pragma once
#ifndef MIQT_QT_PDF_GEN_QPDFPAGENAVIGATION_H
#define MIQT_QT_PDF_GEN_QPDFPAGENAVIGATION_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 QChildEvent;
class QEvent;
class QMetaMethod;
class QMetaObject;
class QObject;
class QPdfDocument;
class QPdfPageNavigation;
class QTimerEvent;
#else
typedef struct QChildEvent QChildEvent;
typedef struct QEvent QEvent;
typedef struct QMetaMethod QMetaMethod;
typedef struct QMetaObject QMetaObject;
typedef struct QObject QObject;
typedef struct QPdfDocument QPdfDocument;
typedef struct QPdfPageNavigation QPdfPageNavigation;
typedef struct QTimerEvent QTimerEvent;
#endif
QPdfPageNavigation* QPdfPageNavigation_new();
QPdfPageNavigation* QPdfPageNavigation_new2(QObject* parent);
void QPdfPageNavigation_virtbase(QPdfPageNavigation* src, QObject** outptr_QObject);
QMetaObject* QPdfPageNavigation_metaObject(const QPdfPageNavigation* self);
void* QPdfPageNavigation_metacast(QPdfPageNavigation* self, const char* param1);
struct miqt_string QPdfPageNavigation_tr(const char* s);
struct miqt_string QPdfPageNavigation_trUtf8(const char* s);
QPdfDocument* QPdfPageNavigation_document(const QPdfPageNavigation* self);
void QPdfPageNavigation_setDocument(QPdfPageNavigation* self, QPdfDocument* document);
int QPdfPageNavigation_currentPage(const QPdfPageNavigation* self);
void QPdfPageNavigation_setCurrentPage(QPdfPageNavigation* self, int currentPage);
int QPdfPageNavigation_pageCount(const QPdfPageNavigation* self);
bool QPdfPageNavigation_canGoToPreviousPage(const QPdfPageNavigation* self);
bool QPdfPageNavigation_canGoToNextPage(const QPdfPageNavigation* self);
void QPdfPageNavigation_goToPreviousPage(QPdfPageNavigation* self);
void QPdfPageNavigation_goToNextPage(QPdfPageNavigation* self);
void QPdfPageNavigation_documentChanged(QPdfPageNavigation* self, QPdfDocument* document);
void QPdfPageNavigation_connect_documentChanged(QPdfPageNavigation* self, intptr_t slot);
void QPdfPageNavigation_currentPageChanged(QPdfPageNavigation* self, int currentPage);
void QPdfPageNavigation_connect_currentPageChanged(QPdfPageNavigation* self, intptr_t slot);
void QPdfPageNavigation_pageCountChanged(QPdfPageNavigation* self, int pageCount);
void QPdfPageNavigation_connect_pageCountChanged(QPdfPageNavigation* self, intptr_t slot);
void QPdfPageNavigation_canGoToPreviousPageChanged(QPdfPageNavigation* self, bool canGo);
void QPdfPageNavigation_connect_canGoToPreviousPageChanged(QPdfPageNavigation* self, intptr_t slot);
void QPdfPageNavigation_canGoToNextPageChanged(QPdfPageNavigation* self, bool canGo);
void QPdfPageNavigation_connect_canGoToNextPageChanged(QPdfPageNavigation* self, intptr_t slot);
struct miqt_string QPdfPageNavigation_tr2(const char* s, const char* c);
struct miqt_string QPdfPageNavigation_tr3(const char* s, const char* c, int n);
struct miqt_string QPdfPageNavigation_trUtf82(const char* s, const char* c);
struct miqt_string QPdfPageNavigation_trUtf83(const char* s, const char* c, int n);
bool QPdfPageNavigation_override_virtual_event(void* self, intptr_t slot);
bool QPdfPageNavigation_virtualbase_event(void* self, QEvent* event);
bool QPdfPageNavigation_override_virtual_eventFilter(void* self, intptr_t slot);
bool QPdfPageNavigation_virtualbase_eventFilter(void* self, QObject* watched, QEvent* event);
bool QPdfPageNavigation_override_virtual_timerEvent(void* self, intptr_t slot);
void QPdfPageNavigation_virtualbase_timerEvent(void* self, QTimerEvent* event);
bool QPdfPageNavigation_override_virtual_childEvent(void* self, intptr_t slot);
void QPdfPageNavigation_virtualbase_childEvent(void* self, QChildEvent* event);
bool QPdfPageNavigation_override_virtual_customEvent(void* self, intptr_t slot);
void QPdfPageNavigation_virtualbase_customEvent(void* self, QEvent* event);
bool QPdfPageNavigation_override_virtual_connectNotify(void* self, intptr_t slot);
void QPdfPageNavigation_virtualbase_connectNotify(void* self, QMetaMethod* signal);
bool QPdfPageNavigation_override_virtual_disconnectNotify(void* self, intptr_t slot);
void QPdfPageNavigation_virtualbase_disconnectNotify(void* self, QMetaMethod* signal);
QObject* QPdfPageNavigation_protectedbase_sender(bool* _dynamic_cast_ok, const void* self);
int QPdfPageNavigation_protectedbase_senderSignalIndex(bool* _dynamic_cast_ok, const void* self);
int QPdfPageNavigation_protectedbase_receivers(bool* _dynamic_cast_ok, const void* self, const char* signal);
bool QPdfPageNavigation_protectedbase_isSignalConnected(bool* _dynamic_cast_ok, const void* self, QMetaMethod* signal);
void QPdfPageNavigation_delete(QPdfPageNavigation* self);
#ifdef __cplusplus
} /* extern C */
#endif
#endif

View File

@ -0,0 +1,508 @@
#include <QChildEvent>
#include <QEvent>
#include <QImage>
#include <QMetaMethod>
#include <QMetaObject>
#include <QObject>
#include <QPdfDocument>
#include <QPdfDocumentRenderOptions>
#include <QPdfPageRenderer>
#include <QSize>
#include <QString>
#include <QByteArray>
#include <cstring>
#include <QTimerEvent>
#include <qpdfpagerenderer.h>
#include "gen_qpdfpagerenderer.h"
#ifdef __cplusplus
extern "C" {
#endif
void miqt_exec_callback_QPdfPageRenderer_documentChanged(intptr_t, QPdfDocument*);
void miqt_exec_callback_QPdfPageRenderer_renderModeChanged(intptr_t, int);
void miqt_exec_callback_QPdfPageRenderer_pageRendered(intptr_t, int, QSize*, QImage*, QPdfDocumentRenderOptions*, unsigned long long);
bool miqt_exec_callback_QPdfPageRenderer_event(QPdfPageRenderer*, intptr_t, QEvent*);
bool miqt_exec_callback_QPdfPageRenderer_eventFilter(QPdfPageRenderer*, intptr_t, QObject*, QEvent*);
void miqt_exec_callback_QPdfPageRenderer_timerEvent(QPdfPageRenderer*, intptr_t, QTimerEvent*);
void miqt_exec_callback_QPdfPageRenderer_childEvent(QPdfPageRenderer*, intptr_t, QChildEvent*);
void miqt_exec_callback_QPdfPageRenderer_customEvent(QPdfPageRenderer*, intptr_t, QEvent*);
void miqt_exec_callback_QPdfPageRenderer_connectNotify(QPdfPageRenderer*, intptr_t, QMetaMethod*);
void miqt_exec_callback_QPdfPageRenderer_disconnectNotify(QPdfPageRenderer*, intptr_t, QMetaMethod*);
#ifdef __cplusplus
} /* extern C */
#endif
class MiqtVirtualQPdfPageRenderer final : public QPdfPageRenderer {
public:
MiqtVirtualQPdfPageRenderer(): QPdfPageRenderer() {};
MiqtVirtualQPdfPageRenderer(QObject* parent): QPdfPageRenderer(parent) {};
virtual ~MiqtVirtualQPdfPageRenderer() override = default;
// cgo.Handle value for overwritten implementation
intptr_t handle__event = 0;
// Subclass to allow providing a Go implementation
virtual bool event(QEvent* event) override {
if (handle__event == 0) {
return QPdfPageRenderer::event(event);
}
QEvent* sigval1 = event;
bool callback_return_value = miqt_exec_callback_QPdfPageRenderer_event(this, handle__event, sigval1);
return callback_return_value;
}
friend bool QPdfPageRenderer_virtualbase_event(void* self, QEvent* event);
// cgo.Handle value for overwritten implementation
intptr_t handle__eventFilter = 0;
// Subclass to allow providing a Go implementation
virtual bool eventFilter(QObject* watched, QEvent* event) override {
if (handle__eventFilter == 0) {
return QPdfPageRenderer::eventFilter(watched, event);
}
QObject* sigval1 = watched;
QEvent* sigval2 = event;
bool callback_return_value = miqt_exec_callback_QPdfPageRenderer_eventFilter(this, handle__eventFilter, sigval1, sigval2);
return callback_return_value;
}
friend bool QPdfPageRenderer_virtualbase_eventFilter(void* self, QObject* watched, QEvent* event);
// cgo.Handle value for overwritten implementation
intptr_t handle__timerEvent = 0;
// Subclass to allow providing a Go implementation
virtual void timerEvent(QTimerEvent* event) override {
if (handle__timerEvent == 0) {
QPdfPageRenderer::timerEvent(event);
return;
}
QTimerEvent* sigval1 = event;
miqt_exec_callback_QPdfPageRenderer_timerEvent(this, handle__timerEvent, sigval1);
}
friend void QPdfPageRenderer_virtualbase_timerEvent(void* self, QTimerEvent* event);
// cgo.Handle value for overwritten implementation
intptr_t handle__childEvent = 0;
// Subclass to allow providing a Go implementation
virtual void childEvent(QChildEvent* event) override {
if (handle__childEvent == 0) {
QPdfPageRenderer::childEvent(event);
return;
}
QChildEvent* sigval1 = event;
miqt_exec_callback_QPdfPageRenderer_childEvent(this, handle__childEvent, sigval1);
}
friend void QPdfPageRenderer_virtualbase_childEvent(void* self, QChildEvent* event);
// cgo.Handle value for overwritten implementation
intptr_t handle__customEvent = 0;
// Subclass to allow providing a Go implementation
virtual void customEvent(QEvent* event) override {
if (handle__customEvent == 0) {
QPdfPageRenderer::customEvent(event);
return;
}
QEvent* sigval1 = event;
miqt_exec_callback_QPdfPageRenderer_customEvent(this, handle__customEvent, sigval1);
}
friend void QPdfPageRenderer_virtualbase_customEvent(void* self, QEvent* event);
// cgo.Handle value for overwritten implementation
intptr_t handle__connectNotify = 0;
// Subclass to allow providing a Go implementation
virtual void connectNotify(const QMetaMethod& signal) override {
if (handle__connectNotify == 0) {
QPdfPageRenderer::connectNotify(signal);
return;
}
const QMetaMethod& signal_ret = signal;
// Cast returned reference into pointer
QMetaMethod* sigval1 = const_cast<QMetaMethod*>(&signal_ret);
miqt_exec_callback_QPdfPageRenderer_connectNotify(this, handle__connectNotify, sigval1);
}
friend void QPdfPageRenderer_virtualbase_connectNotify(void* self, QMetaMethod* signal);
// cgo.Handle value for overwritten implementation
intptr_t handle__disconnectNotify = 0;
// Subclass to allow providing a Go implementation
virtual void disconnectNotify(const QMetaMethod& signal) override {
if (handle__disconnectNotify == 0) {
QPdfPageRenderer::disconnectNotify(signal);
return;
}
const QMetaMethod& signal_ret = signal;
// Cast returned reference into pointer
QMetaMethod* sigval1 = const_cast<QMetaMethod*>(&signal_ret);
miqt_exec_callback_QPdfPageRenderer_disconnectNotify(this, handle__disconnectNotify, sigval1);
}
friend void QPdfPageRenderer_virtualbase_disconnectNotify(void* self, QMetaMethod* signal);
// Wrappers to allow calling protected methods:
friend QObject* QPdfPageRenderer_protectedbase_sender(bool* _dynamic_cast_ok, const void* self);
friend int QPdfPageRenderer_protectedbase_senderSignalIndex(bool* _dynamic_cast_ok, const void* self);
friend int QPdfPageRenderer_protectedbase_receivers(bool* _dynamic_cast_ok, const void* self, const char* signal);
friend bool QPdfPageRenderer_protectedbase_isSignalConnected(bool* _dynamic_cast_ok, const void* self, QMetaMethod* signal);
};
QPdfPageRenderer* QPdfPageRenderer_new() {
return new MiqtVirtualQPdfPageRenderer();
}
QPdfPageRenderer* QPdfPageRenderer_new2(QObject* parent) {
return new MiqtVirtualQPdfPageRenderer(parent);
}
void QPdfPageRenderer_virtbase(QPdfPageRenderer* src, QObject** outptr_QObject) {
*outptr_QObject = static_cast<QObject*>(src);
}
QMetaObject* QPdfPageRenderer_metaObject(const QPdfPageRenderer* self) {
return (QMetaObject*) self->metaObject();
}
void* QPdfPageRenderer_metacast(QPdfPageRenderer* self, const char* param1) {
return self->qt_metacast(param1);
}
struct miqt_string QPdfPageRenderer_tr(const char* s) {
QString _ret = QPdfPageRenderer::tr(s);
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
struct miqt_string _ms;
_ms.len = _b.length();
_ms.data = static_cast<char*>(malloc(_ms.len));
memcpy(_ms.data, _b.data(), _ms.len);
return _ms;
}
struct miqt_string QPdfPageRenderer_trUtf8(const char* s) {
QString _ret = QPdfPageRenderer::trUtf8(s);
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
struct miqt_string _ms;
_ms.len = _b.length();
_ms.data = static_cast<char*>(malloc(_ms.len));
memcpy(_ms.data, _b.data(), _ms.len);
return _ms;
}
int QPdfPageRenderer_renderMode(const QPdfPageRenderer* self) {
QPdfPageRenderer::RenderMode _ret = self->renderMode();
return static_cast<int>(_ret);
}
void QPdfPageRenderer_setRenderMode(QPdfPageRenderer* self, int mode) {
self->setRenderMode(static_cast<QPdfPageRenderer::RenderMode>(mode));
}
QPdfDocument* QPdfPageRenderer_document(const QPdfPageRenderer* self) {
return self->document();
}
void QPdfPageRenderer_setDocument(QPdfPageRenderer* self, QPdfDocument* document) {
self->setDocument(document);
}
unsigned long long QPdfPageRenderer_requestPage(QPdfPageRenderer* self, int pageNumber, QSize* imageSize) {
quint64 _ret = self->requestPage(static_cast<int>(pageNumber), *imageSize);
return static_cast<unsigned long long>(_ret);
}
void QPdfPageRenderer_documentChanged(QPdfPageRenderer* self, QPdfDocument* document) {
self->documentChanged(document);
}
void QPdfPageRenderer_connect_documentChanged(QPdfPageRenderer* self, intptr_t slot) {
MiqtVirtualQPdfPageRenderer::connect(self, static_cast<void (QPdfPageRenderer::*)(QPdfDocument*)>(&QPdfPageRenderer::documentChanged), self, [=](QPdfDocument* document) {
QPdfDocument* sigval1 = document;
miqt_exec_callback_QPdfPageRenderer_documentChanged(slot, sigval1);
});
}
void QPdfPageRenderer_renderModeChanged(QPdfPageRenderer* self, int renderMode) {
self->renderModeChanged(static_cast<QPdfPageRenderer::RenderMode>(renderMode));
}
void QPdfPageRenderer_connect_renderModeChanged(QPdfPageRenderer* self, intptr_t slot) {
MiqtVirtualQPdfPageRenderer::connect(self, static_cast<void (QPdfPageRenderer::*)(QPdfPageRenderer::RenderMode)>(&QPdfPageRenderer::renderModeChanged), self, [=](QPdfPageRenderer::RenderMode renderMode) {
QPdfPageRenderer::RenderMode renderMode_ret = renderMode;
int sigval1 = static_cast<int>(renderMode_ret);
miqt_exec_callback_QPdfPageRenderer_renderModeChanged(slot, sigval1);
});
}
void QPdfPageRenderer_pageRendered(QPdfPageRenderer* self, int pageNumber, QSize* imageSize, QImage* image, QPdfDocumentRenderOptions* options, unsigned long long requestId) {
self->pageRendered(static_cast<int>(pageNumber), *imageSize, *image, *options, static_cast<quint64>(requestId));
}
void QPdfPageRenderer_connect_pageRendered(QPdfPageRenderer* self, intptr_t slot) {
MiqtVirtualQPdfPageRenderer::connect(self, static_cast<void (QPdfPageRenderer::*)(int, QSize, const QImage&, QPdfDocumentRenderOptions, quint64)>(&QPdfPageRenderer::pageRendered), self, [=](int pageNumber, QSize imageSize, const QImage& image, QPdfDocumentRenderOptions options, quint64 requestId) {
int sigval1 = pageNumber;
QSize* sigval2 = new QSize(imageSize);
const QImage& image_ret = image;
// Cast returned reference into pointer
QImage* sigval3 = const_cast<QImage*>(&image_ret);
QPdfDocumentRenderOptions* sigval4 = new QPdfDocumentRenderOptions(options);
quint64 requestId_ret = requestId;
unsigned long long sigval5 = static_cast<unsigned long long>(requestId_ret);
miqt_exec_callback_QPdfPageRenderer_pageRendered(slot, sigval1, sigval2, sigval3, sigval4, sigval5);
});
}
struct miqt_string QPdfPageRenderer_tr2(const char* s, const char* c) {
QString _ret = QPdfPageRenderer::tr(s, c);
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
struct miqt_string _ms;
_ms.len = _b.length();
_ms.data = static_cast<char*>(malloc(_ms.len));
memcpy(_ms.data, _b.data(), _ms.len);
return _ms;
}
struct miqt_string QPdfPageRenderer_tr3(const char* s, const char* c, int n) {
QString _ret = QPdfPageRenderer::tr(s, c, static_cast<int>(n));
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
struct miqt_string _ms;
_ms.len = _b.length();
_ms.data = static_cast<char*>(malloc(_ms.len));
memcpy(_ms.data, _b.data(), _ms.len);
return _ms;
}
struct miqt_string QPdfPageRenderer_trUtf82(const char* s, const char* c) {
QString _ret = QPdfPageRenderer::trUtf8(s, c);
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
struct miqt_string _ms;
_ms.len = _b.length();
_ms.data = static_cast<char*>(malloc(_ms.len));
memcpy(_ms.data, _b.data(), _ms.len);
return _ms;
}
struct miqt_string QPdfPageRenderer_trUtf83(const char* s, const char* c, int n) {
QString _ret = QPdfPageRenderer::trUtf8(s, c, static_cast<int>(n));
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
struct miqt_string _ms;
_ms.len = _b.length();
_ms.data = static_cast<char*>(malloc(_ms.len));
memcpy(_ms.data, _b.data(), _ms.len);
return _ms;
}
unsigned long long QPdfPageRenderer_requestPage2(QPdfPageRenderer* self, int pageNumber, QSize* imageSize, QPdfDocumentRenderOptions* options) {
quint64 _ret = self->requestPage(static_cast<int>(pageNumber), *imageSize, *options);
return static_cast<unsigned long long>(_ret);
}
bool QPdfPageRenderer_override_virtual_event(void* self, intptr_t slot) {
MiqtVirtualQPdfPageRenderer* self_cast = dynamic_cast<MiqtVirtualQPdfPageRenderer*>( (QPdfPageRenderer*)(self) );
if (self_cast == nullptr) {
return false;
}
self_cast->handle__event = slot;
return true;
}
bool QPdfPageRenderer_virtualbase_event(void* self, QEvent* event) {
return ( (MiqtVirtualQPdfPageRenderer*)(self) )->QPdfPageRenderer::event(event);
}
bool QPdfPageRenderer_override_virtual_eventFilter(void* self, intptr_t slot) {
MiqtVirtualQPdfPageRenderer* self_cast = dynamic_cast<MiqtVirtualQPdfPageRenderer*>( (QPdfPageRenderer*)(self) );
if (self_cast == nullptr) {
return false;
}
self_cast->handle__eventFilter = slot;
return true;
}
bool QPdfPageRenderer_virtualbase_eventFilter(void* self, QObject* watched, QEvent* event) {
return ( (MiqtVirtualQPdfPageRenderer*)(self) )->QPdfPageRenderer::eventFilter(watched, event);
}
bool QPdfPageRenderer_override_virtual_timerEvent(void* self, intptr_t slot) {
MiqtVirtualQPdfPageRenderer* self_cast = dynamic_cast<MiqtVirtualQPdfPageRenderer*>( (QPdfPageRenderer*)(self) );
if (self_cast == nullptr) {
return false;
}
self_cast->handle__timerEvent = slot;
return true;
}
void QPdfPageRenderer_virtualbase_timerEvent(void* self, QTimerEvent* event) {
( (MiqtVirtualQPdfPageRenderer*)(self) )->QPdfPageRenderer::timerEvent(event);
}
bool QPdfPageRenderer_override_virtual_childEvent(void* self, intptr_t slot) {
MiqtVirtualQPdfPageRenderer* self_cast = dynamic_cast<MiqtVirtualQPdfPageRenderer*>( (QPdfPageRenderer*)(self) );
if (self_cast == nullptr) {
return false;
}
self_cast->handle__childEvent = slot;
return true;
}
void QPdfPageRenderer_virtualbase_childEvent(void* self, QChildEvent* event) {
( (MiqtVirtualQPdfPageRenderer*)(self) )->QPdfPageRenderer::childEvent(event);
}
bool QPdfPageRenderer_override_virtual_customEvent(void* self, intptr_t slot) {
MiqtVirtualQPdfPageRenderer* self_cast = dynamic_cast<MiqtVirtualQPdfPageRenderer*>( (QPdfPageRenderer*)(self) );
if (self_cast == nullptr) {
return false;
}
self_cast->handle__customEvent = slot;
return true;
}
void QPdfPageRenderer_virtualbase_customEvent(void* self, QEvent* event) {
( (MiqtVirtualQPdfPageRenderer*)(self) )->QPdfPageRenderer::customEvent(event);
}
bool QPdfPageRenderer_override_virtual_connectNotify(void* self, intptr_t slot) {
MiqtVirtualQPdfPageRenderer* self_cast = dynamic_cast<MiqtVirtualQPdfPageRenderer*>( (QPdfPageRenderer*)(self) );
if (self_cast == nullptr) {
return false;
}
self_cast->handle__connectNotify = slot;
return true;
}
void QPdfPageRenderer_virtualbase_connectNotify(void* self, QMetaMethod* signal) {
( (MiqtVirtualQPdfPageRenderer*)(self) )->QPdfPageRenderer::connectNotify(*signal);
}
bool QPdfPageRenderer_override_virtual_disconnectNotify(void* self, intptr_t slot) {
MiqtVirtualQPdfPageRenderer* self_cast = dynamic_cast<MiqtVirtualQPdfPageRenderer*>( (QPdfPageRenderer*)(self) );
if (self_cast == nullptr) {
return false;
}
self_cast->handle__disconnectNotify = slot;
return true;
}
void QPdfPageRenderer_virtualbase_disconnectNotify(void* self, QMetaMethod* signal) {
( (MiqtVirtualQPdfPageRenderer*)(self) )->QPdfPageRenderer::disconnectNotify(*signal);
}
QObject* QPdfPageRenderer_protectedbase_sender(bool* _dynamic_cast_ok, const void* self) {
MiqtVirtualQPdfPageRenderer* self_cast = dynamic_cast<MiqtVirtualQPdfPageRenderer*>( (QPdfPageRenderer*)(self) );
if (self_cast == nullptr) {
*_dynamic_cast_ok = false;
return nullptr;
}
*_dynamic_cast_ok = true;
return self_cast->sender();
}
int QPdfPageRenderer_protectedbase_senderSignalIndex(bool* _dynamic_cast_ok, const void* self) {
MiqtVirtualQPdfPageRenderer* self_cast = dynamic_cast<MiqtVirtualQPdfPageRenderer*>( (QPdfPageRenderer*)(self) );
if (self_cast == nullptr) {
*_dynamic_cast_ok = false;
return 0;
}
*_dynamic_cast_ok = true;
return self_cast->senderSignalIndex();
}
int QPdfPageRenderer_protectedbase_receivers(bool* _dynamic_cast_ok, const void* self, const char* signal) {
MiqtVirtualQPdfPageRenderer* self_cast = dynamic_cast<MiqtVirtualQPdfPageRenderer*>( (QPdfPageRenderer*)(self) );
if (self_cast == nullptr) {
*_dynamic_cast_ok = false;
return 0;
}
*_dynamic_cast_ok = true;
return self_cast->receivers(signal);
}
bool QPdfPageRenderer_protectedbase_isSignalConnected(bool* _dynamic_cast_ok, const void* self, QMetaMethod* signal) {
MiqtVirtualQPdfPageRenderer* self_cast = dynamic_cast<MiqtVirtualQPdfPageRenderer*>( (QPdfPageRenderer*)(self) );
if (self_cast == nullptr) {
*_dynamic_cast_ok = false;
return false;
}
*_dynamic_cast_ok = true;
return self_cast->isSignalConnected(*signal);
}
void QPdfPageRenderer_delete(QPdfPageRenderer* self) {
delete self;
}

View File

@ -0,0 +1,499 @@
package pdf
/*
#include "gen_qpdfpagerenderer.h"
#include <stdlib.h>
*/
import "C"
import (
"github.com/mappu/miqt/qt"
"runtime"
"runtime/cgo"
"unsafe"
)
type QPdfPageRenderer__RenderMode int
const (
QPdfPageRenderer__MultiThreaded QPdfPageRenderer__RenderMode = 0
QPdfPageRenderer__SingleThreaded QPdfPageRenderer__RenderMode = 1
)
type QPdfPageRenderer struct {
h *C.QPdfPageRenderer
*qt.QObject
}
func (this *QPdfPageRenderer) cPointer() *C.QPdfPageRenderer {
if this == nil {
return nil
}
return this.h
}
func (this *QPdfPageRenderer) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
// newQPdfPageRenderer constructs the type using only CGO pointers.
func newQPdfPageRenderer(h *C.QPdfPageRenderer) *QPdfPageRenderer {
if h == nil {
return nil
}
var outptr_QObject *C.QObject = nil
C.QPdfPageRenderer_virtbase(h, &outptr_QObject)
return &QPdfPageRenderer{h: h,
QObject: qt.UnsafeNewQObject(unsafe.Pointer(outptr_QObject))}
}
// UnsafeNewQPdfPageRenderer constructs the type using only unsafe pointers.
func UnsafeNewQPdfPageRenderer(h unsafe.Pointer) *QPdfPageRenderer {
return newQPdfPageRenderer((*C.QPdfPageRenderer)(h))
}
// NewQPdfPageRenderer constructs a new QPdfPageRenderer object.
func NewQPdfPageRenderer() *QPdfPageRenderer {
return newQPdfPageRenderer(C.QPdfPageRenderer_new())
}
// NewQPdfPageRenderer2 constructs a new QPdfPageRenderer object.
func NewQPdfPageRenderer2(parent *qt.QObject) *QPdfPageRenderer {
return newQPdfPageRenderer(C.QPdfPageRenderer_new2((*C.QObject)(parent.UnsafePointer())))
}
func (this *QPdfPageRenderer) MetaObject() *qt.QMetaObject {
return qt.UnsafeNewQMetaObject(unsafe.Pointer(C.QPdfPageRenderer_metaObject(this.h)))
}
func (this *QPdfPageRenderer) Metacast(param1 string) unsafe.Pointer {
param1_Cstring := C.CString(param1)
defer C.free(unsafe.Pointer(param1_Cstring))
return (unsafe.Pointer)(C.QPdfPageRenderer_metacast(this.h, param1_Cstring))
}
func QPdfPageRenderer_Tr(s string) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
var _ms C.struct_miqt_string = C.QPdfPageRenderer_tr(s_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func QPdfPageRenderer_TrUtf8(s string) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
var _ms C.struct_miqt_string = C.QPdfPageRenderer_trUtf8(s_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func (this *QPdfPageRenderer) RenderMode() QPdfPageRenderer__RenderMode {
return (QPdfPageRenderer__RenderMode)(C.QPdfPageRenderer_renderMode(this.h))
}
func (this *QPdfPageRenderer) SetRenderMode(mode QPdfPageRenderer__RenderMode) {
C.QPdfPageRenderer_setRenderMode(this.h, (C.int)(mode))
}
func (this *QPdfPageRenderer) Document() *QPdfDocument {
return newQPdfDocument(C.QPdfPageRenderer_document(this.h))
}
func (this *QPdfPageRenderer) SetDocument(document *QPdfDocument) {
C.QPdfPageRenderer_setDocument(this.h, document.cPointer())
}
func (this *QPdfPageRenderer) RequestPage(pageNumber int, imageSize qt.QSize) uint64 {
return (uint64)(C.QPdfPageRenderer_requestPage(this.h, (C.int)(pageNumber), (*C.QSize)(imageSize.UnsafePointer())))
}
func (this *QPdfPageRenderer) DocumentChanged(document *QPdfDocument) {
C.QPdfPageRenderer_documentChanged(this.h, document.cPointer())
}
func (this *QPdfPageRenderer) OnDocumentChanged(slot func(document *QPdfDocument)) {
C.QPdfPageRenderer_connect_documentChanged(this.h, C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QPdfPageRenderer_documentChanged
func miqt_exec_callback_QPdfPageRenderer_documentChanged(cb C.intptr_t, document *C.QPdfDocument) {
gofunc, ok := cgo.Handle(cb).Value().(func(document *QPdfDocument))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := newQPdfDocument(document)
gofunc(slotval1)
}
func (this *QPdfPageRenderer) RenderModeChanged(renderMode QPdfPageRenderer__RenderMode) {
C.QPdfPageRenderer_renderModeChanged(this.h, (C.int)(renderMode))
}
func (this *QPdfPageRenderer) OnRenderModeChanged(slot func(renderMode QPdfPageRenderer__RenderMode)) {
C.QPdfPageRenderer_connect_renderModeChanged(this.h, C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QPdfPageRenderer_renderModeChanged
func miqt_exec_callback_QPdfPageRenderer_renderModeChanged(cb C.intptr_t, renderMode C.int) {
gofunc, ok := cgo.Handle(cb).Value().(func(renderMode QPdfPageRenderer__RenderMode))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := (QPdfPageRenderer__RenderMode)(renderMode)
gofunc(slotval1)
}
func (this *QPdfPageRenderer) PageRendered(pageNumber int, imageSize qt.QSize, image *qt.QImage, options QPdfDocumentRenderOptions, requestId uint64) {
C.QPdfPageRenderer_pageRendered(this.h, (C.int)(pageNumber), (*C.QSize)(imageSize.UnsafePointer()), (*C.QImage)(image.UnsafePointer()), options.cPointer(), (C.ulonglong)(requestId))
}
func (this *QPdfPageRenderer) OnPageRendered(slot func(pageNumber int, imageSize qt.QSize, image *qt.QImage, options QPdfDocumentRenderOptions, requestId uint64)) {
C.QPdfPageRenderer_connect_pageRendered(this.h, C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QPdfPageRenderer_pageRendered
func miqt_exec_callback_QPdfPageRenderer_pageRendered(cb C.intptr_t, pageNumber C.int, imageSize *C.QSize, image *C.QImage, options *C.QPdfDocumentRenderOptions, requestId C.ulonglong) {
gofunc, ok := cgo.Handle(cb).Value().(func(pageNumber int, imageSize qt.QSize, image *qt.QImage, options QPdfDocumentRenderOptions, requestId uint64))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := (int)(pageNumber)
imageSize_goptr := qt.UnsafeNewQSize(unsafe.Pointer(imageSize))
imageSize_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
slotval2 := *imageSize_goptr
slotval3 := qt.UnsafeNewQImage(unsafe.Pointer(image))
options_goptr := newQPdfDocumentRenderOptions(options)
options_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
slotval4 := *options_goptr
slotval5 := (uint64)(requestId)
gofunc(slotval1, slotval2, slotval3, slotval4, slotval5)
}
func QPdfPageRenderer_Tr2(s string, c string) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
c_Cstring := C.CString(c)
defer C.free(unsafe.Pointer(c_Cstring))
var _ms C.struct_miqt_string = C.QPdfPageRenderer_tr2(s_Cstring, c_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func QPdfPageRenderer_Tr3(s string, c string, n int) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
c_Cstring := C.CString(c)
defer C.free(unsafe.Pointer(c_Cstring))
var _ms C.struct_miqt_string = C.QPdfPageRenderer_tr3(s_Cstring, c_Cstring, (C.int)(n))
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func QPdfPageRenderer_TrUtf82(s string, c string) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
c_Cstring := C.CString(c)
defer C.free(unsafe.Pointer(c_Cstring))
var _ms C.struct_miqt_string = C.QPdfPageRenderer_trUtf82(s_Cstring, c_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func QPdfPageRenderer_TrUtf83(s string, c string, n int) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
c_Cstring := C.CString(c)
defer C.free(unsafe.Pointer(c_Cstring))
var _ms C.struct_miqt_string = C.QPdfPageRenderer_trUtf83(s_Cstring, c_Cstring, (C.int)(n))
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func (this *QPdfPageRenderer) RequestPage2(pageNumber int, imageSize qt.QSize, options QPdfDocumentRenderOptions) uint64 {
return (uint64)(C.QPdfPageRenderer_requestPage2(this.h, (C.int)(pageNumber), (*C.QSize)(imageSize.UnsafePointer()), options.cPointer()))
}
// Sender can only be called from a QPdfPageRenderer that was directly constructed.
func (this *QPdfPageRenderer) Sender() *qt.QObject {
var _dynamic_cast_ok C.bool = false
_method_ret := qt.UnsafeNewQObject(unsafe.Pointer(C.QPdfPageRenderer_protectedbase_sender(&_dynamic_cast_ok, unsafe.Pointer(this.h))))
if !_dynamic_cast_ok {
panic("miqt: can only call protected methods for directly constructed types")
}
return _method_ret
}
// SenderSignalIndex can only be called from a QPdfPageRenderer that was directly constructed.
func (this *QPdfPageRenderer) SenderSignalIndex() int {
var _dynamic_cast_ok C.bool = false
_method_ret := (int)(C.QPdfPageRenderer_protectedbase_senderSignalIndex(&_dynamic_cast_ok, unsafe.Pointer(this.h)))
if !_dynamic_cast_ok {
panic("miqt: can only call protected methods for directly constructed types")
}
return _method_ret
}
// Receivers can only be called from a QPdfPageRenderer that was directly constructed.
func (this *QPdfPageRenderer) Receivers(signal string) int {
signal_Cstring := C.CString(signal)
defer C.free(unsafe.Pointer(signal_Cstring))
var _dynamic_cast_ok C.bool = false
_method_ret := (int)(C.QPdfPageRenderer_protectedbase_receivers(&_dynamic_cast_ok, unsafe.Pointer(this.h), signal_Cstring))
if !_dynamic_cast_ok {
panic("miqt: can only call protected methods for directly constructed types")
}
return _method_ret
}
// IsSignalConnected can only be called from a QPdfPageRenderer that was directly constructed.
func (this *QPdfPageRenderer) IsSignalConnected(signal *qt.QMetaMethod) bool {
var _dynamic_cast_ok C.bool = false
_method_ret := (bool)(C.QPdfPageRenderer_protectedbase_isSignalConnected(&_dynamic_cast_ok, unsafe.Pointer(this.h), (*C.QMetaMethod)(signal.UnsafePointer())))
if !_dynamic_cast_ok {
panic("miqt: can only call protected methods for directly constructed types")
}
return _method_ret
}
func (this *QPdfPageRenderer) callVirtualBase_Event(event *qt.QEvent) bool {
return (bool)(C.QPdfPageRenderer_virtualbase_event(unsafe.Pointer(this.h), (*C.QEvent)(event.UnsafePointer())))
}
func (this *QPdfPageRenderer) OnEvent(slot func(super func(event *qt.QEvent) bool, event *qt.QEvent) bool) {
ok := C.QPdfPageRenderer_override_virtual_event(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
}
}
//export miqt_exec_callback_QPdfPageRenderer_event
func miqt_exec_callback_QPdfPageRenderer_event(self *C.QPdfPageRenderer, cb C.intptr_t, event *C.QEvent) C.bool {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(event *qt.QEvent) bool, event *qt.QEvent) bool)
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := qt.UnsafeNewQEvent(unsafe.Pointer(event))
virtualReturn := gofunc((&QPdfPageRenderer{h: self}).callVirtualBase_Event, slotval1)
return (C.bool)(virtualReturn)
}
func (this *QPdfPageRenderer) callVirtualBase_EventFilter(watched *qt.QObject, event *qt.QEvent) bool {
return (bool)(C.QPdfPageRenderer_virtualbase_eventFilter(unsafe.Pointer(this.h), (*C.QObject)(watched.UnsafePointer()), (*C.QEvent)(event.UnsafePointer())))
}
func (this *QPdfPageRenderer) OnEventFilter(slot func(super func(watched *qt.QObject, event *qt.QEvent) bool, watched *qt.QObject, event *qt.QEvent) bool) {
ok := C.QPdfPageRenderer_override_virtual_eventFilter(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
}
}
//export miqt_exec_callback_QPdfPageRenderer_eventFilter
func miqt_exec_callback_QPdfPageRenderer_eventFilter(self *C.QPdfPageRenderer, cb C.intptr_t, watched *C.QObject, event *C.QEvent) C.bool {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(watched *qt.QObject, event *qt.QEvent) bool, watched *qt.QObject, event *qt.QEvent) bool)
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := qt.UnsafeNewQObject(unsafe.Pointer(watched))
slotval2 := qt.UnsafeNewQEvent(unsafe.Pointer(event))
virtualReturn := gofunc((&QPdfPageRenderer{h: self}).callVirtualBase_EventFilter, slotval1, slotval2)
return (C.bool)(virtualReturn)
}
func (this *QPdfPageRenderer) callVirtualBase_TimerEvent(event *qt.QTimerEvent) {
C.QPdfPageRenderer_virtualbase_timerEvent(unsafe.Pointer(this.h), (*C.QTimerEvent)(event.UnsafePointer()))
}
func (this *QPdfPageRenderer) OnTimerEvent(slot func(super func(event *qt.QTimerEvent), event *qt.QTimerEvent)) {
ok := C.QPdfPageRenderer_override_virtual_timerEvent(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
}
}
//export miqt_exec_callback_QPdfPageRenderer_timerEvent
func miqt_exec_callback_QPdfPageRenderer_timerEvent(self *C.QPdfPageRenderer, cb C.intptr_t, event *C.QTimerEvent) {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(event *qt.QTimerEvent), event *qt.QTimerEvent))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := qt.UnsafeNewQTimerEvent(unsafe.Pointer(event))
gofunc((&QPdfPageRenderer{h: self}).callVirtualBase_TimerEvent, slotval1)
}
func (this *QPdfPageRenderer) callVirtualBase_ChildEvent(event *qt.QChildEvent) {
C.QPdfPageRenderer_virtualbase_childEvent(unsafe.Pointer(this.h), (*C.QChildEvent)(event.UnsafePointer()))
}
func (this *QPdfPageRenderer) OnChildEvent(slot func(super func(event *qt.QChildEvent), event *qt.QChildEvent)) {
ok := C.QPdfPageRenderer_override_virtual_childEvent(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
}
}
//export miqt_exec_callback_QPdfPageRenderer_childEvent
func miqt_exec_callback_QPdfPageRenderer_childEvent(self *C.QPdfPageRenderer, cb C.intptr_t, event *C.QChildEvent) {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(event *qt.QChildEvent), event *qt.QChildEvent))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := qt.UnsafeNewQChildEvent(unsafe.Pointer(event))
gofunc((&QPdfPageRenderer{h: self}).callVirtualBase_ChildEvent, slotval1)
}
func (this *QPdfPageRenderer) callVirtualBase_CustomEvent(event *qt.QEvent) {
C.QPdfPageRenderer_virtualbase_customEvent(unsafe.Pointer(this.h), (*C.QEvent)(event.UnsafePointer()))
}
func (this *QPdfPageRenderer) OnCustomEvent(slot func(super func(event *qt.QEvent), event *qt.QEvent)) {
ok := C.QPdfPageRenderer_override_virtual_customEvent(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
}
}
//export miqt_exec_callback_QPdfPageRenderer_customEvent
func miqt_exec_callback_QPdfPageRenderer_customEvent(self *C.QPdfPageRenderer, cb C.intptr_t, event *C.QEvent) {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(event *qt.QEvent), event *qt.QEvent))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := qt.UnsafeNewQEvent(unsafe.Pointer(event))
gofunc((&QPdfPageRenderer{h: self}).callVirtualBase_CustomEvent, slotval1)
}
func (this *QPdfPageRenderer) callVirtualBase_ConnectNotify(signal *qt.QMetaMethod) {
C.QPdfPageRenderer_virtualbase_connectNotify(unsafe.Pointer(this.h), (*C.QMetaMethod)(signal.UnsafePointer()))
}
func (this *QPdfPageRenderer) OnConnectNotify(slot func(super func(signal *qt.QMetaMethod), signal *qt.QMetaMethod)) {
ok := C.QPdfPageRenderer_override_virtual_connectNotify(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
}
}
//export miqt_exec_callback_QPdfPageRenderer_connectNotify
func miqt_exec_callback_QPdfPageRenderer_connectNotify(self *C.QPdfPageRenderer, cb C.intptr_t, signal *C.QMetaMethod) {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(signal *qt.QMetaMethod), signal *qt.QMetaMethod))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := qt.UnsafeNewQMetaMethod(unsafe.Pointer(signal))
gofunc((&QPdfPageRenderer{h: self}).callVirtualBase_ConnectNotify, slotval1)
}
func (this *QPdfPageRenderer) callVirtualBase_DisconnectNotify(signal *qt.QMetaMethod) {
C.QPdfPageRenderer_virtualbase_disconnectNotify(unsafe.Pointer(this.h), (*C.QMetaMethod)(signal.UnsafePointer()))
}
func (this *QPdfPageRenderer) OnDisconnectNotify(slot func(super func(signal *qt.QMetaMethod), signal *qt.QMetaMethod)) {
ok := C.QPdfPageRenderer_override_virtual_disconnectNotify(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
}
}
//export miqt_exec_callback_QPdfPageRenderer_disconnectNotify
func miqt_exec_callback_QPdfPageRenderer_disconnectNotify(self *C.QPdfPageRenderer, cb C.intptr_t, signal *C.QMetaMethod) {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(signal *qt.QMetaMethod), signal *qt.QMetaMethod))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := qt.UnsafeNewQMetaMethod(unsafe.Pointer(signal))
gofunc((&QPdfPageRenderer{h: self}).callVirtualBase_DisconnectNotify, slotval1)
}
// Delete this object from C++ memory.
func (this *QPdfPageRenderer) Delete() {
C.QPdfPageRenderer_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 *QPdfPageRenderer) GoGC() {
runtime.SetFinalizer(this, func(this *QPdfPageRenderer) {
this.Delete()
runtime.KeepAlive(this.h)
})
}

View File

@ -0,0 +1,90 @@
#pragma once
#ifndef MIQT_QT_PDF_GEN_QPDFPAGERENDERER_H
#define MIQT_QT_PDF_GEN_QPDFPAGERENDERER_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 QChildEvent;
class QEvent;
class QImage;
class QMetaMethod;
class QMetaObject;
class QObject;
class QPdfDocument;
class QPdfDocumentRenderOptions;
class QPdfPageRenderer;
class QSize;
class QTimerEvent;
#else
typedef struct QChildEvent QChildEvent;
typedef struct QEvent QEvent;
typedef struct QImage QImage;
typedef struct QMetaMethod QMetaMethod;
typedef struct QMetaObject QMetaObject;
typedef struct QObject QObject;
typedef struct QPdfDocument QPdfDocument;
typedef struct QPdfDocumentRenderOptions QPdfDocumentRenderOptions;
typedef struct QPdfPageRenderer QPdfPageRenderer;
typedef struct QSize QSize;
typedef struct QTimerEvent QTimerEvent;
#endif
QPdfPageRenderer* QPdfPageRenderer_new();
QPdfPageRenderer* QPdfPageRenderer_new2(QObject* parent);
void QPdfPageRenderer_virtbase(QPdfPageRenderer* src, QObject** outptr_QObject);
QMetaObject* QPdfPageRenderer_metaObject(const QPdfPageRenderer* self);
void* QPdfPageRenderer_metacast(QPdfPageRenderer* self, const char* param1);
struct miqt_string QPdfPageRenderer_tr(const char* s);
struct miqt_string QPdfPageRenderer_trUtf8(const char* s);
int QPdfPageRenderer_renderMode(const QPdfPageRenderer* self);
void QPdfPageRenderer_setRenderMode(QPdfPageRenderer* self, int mode);
QPdfDocument* QPdfPageRenderer_document(const QPdfPageRenderer* self);
void QPdfPageRenderer_setDocument(QPdfPageRenderer* self, QPdfDocument* document);
unsigned long long QPdfPageRenderer_requestPage(QPdfPageRenderer* self, int pageNumber, QSize* imageSize);
void QPdfPageRenderer_documentChanged(QPdfPageRenderer* self, QPdfDocument* document);
void QPdfPageRenderer_connect_documentChanged(QPdfPageRenderer* self, intptr_t slot);
void QPdfPageRenderer_renderModeChanged(QPdfPageRenderer* self, int renderMode);
void QPdfPageRenderer_connect_renderModeChanged(QPdfPageRenderer* self, intptr_t slot);
void QPdfPageRenderer_pageRendered(QPdfPageRenderer* self, int pageNumber, QSize* imageSize, QImage* image, QPdfDocumentRenderOptions* options, unsigned long long requestId);
void QPdfPageRenderer_connect_pageRendered(QPdfPageRenderer* self, intptr_t slot);
struct miqt_string QPdfPageRenderer_tr2(const char* s, const char* c);
struct miqt_string QPdfPageRenderer_tr3(const char* s, const char* c, int n);
struct miqt_string QPdfPageRenderer_trUtf82(const char* s, const char* c);
struct miqt_string QPdfPageRenderer_trUtf83(const char* s, const char* c, int n);
unsigned long long QPdfPageRenderer_requestPage2(QPdfPageRenderer* self, int pageNumber, QSize* imageSize, QPdfDocumentRenderOptions* options);
bool QPdfPageRenderer_override_virtual_event(void* self, intptr_t slot);
bool QPdfPageRenderer_virtualbase_event(void* self, QEvent* event);
bool QPdfPageRenderer_override_virtual_eventFilter(void* self, intptr_t slot);
bool QPdfPageRenderer_virtualbase_eventFilter(void* self, QObject* watched, QEvent* event);
bool QPdfPageRenderer_override_virtual_timerEvent(void* self, intptr_t slot);
void QPdfPageRenderer_virtualbase_timerEvent(void* self, QTimerEvent* event);
bool QPdfPageRenderer_override_virtual_childEvent(void* self, intptr_t slot);
void QPdfPageRenderer_virtualbase_childEvent(void* self, QChildEvent* event);
bool QPdfPageRenderer_override_virtual_customEvent(void* self, intptr_t slot);
void QPdfPageRenderer_virtualbase_customEvent(void* self, QEvent* event);
bool QPdfPageRenderer_override_virtual_connectNotify(void* self, intptr_t slot);
void QPdfPageRenderer_virtualbase_connectNotify(void* self, QMetaMethod* signal);
bool QPdfPageRenderer_override_virtual_disconnectNotify(void* self, intptr_t slot);
void QPdfPageRenderer_virtualbase_disconnectNotify(void* self, QMetaMethod* signal);
QObject* QPdfPageRenderer_protectedbase_sender(bool* _dynamic_cast_ok, const void* self);
int QPdfPageRenderer_protectedbase_senderSignalIndex(bool* _dynamic_cast_ok, const void* self);
int QPdfPageRenderer_protectedbase_receivers(bool* _dynamic_cast_ok, const void* self, const char* signal);
bool QPdfPageRenderer_protectedbase_isSignalConnected(bool* _dynamic_cast_ok, const void* self, QMetaMethod* signal);
void QPdfPageRenderer_delete(QPdfPageRenderer* self);
#ifdef __cplusplus
} /* extern C */
#endif
#endif

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,186 @@
#pragma once
#ifndef MIQT_QT_PDF_GEN_QPDFSEARCHMODEL_H
#define MIQT_QT_PDF_GEN_QPDFSEARCHMODEL_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 QAbstractItemModel;
class QAbstractListModel;
class QChildEvent;
class QDataStream;
class QEvent;
class QMetaMethod;
class QMetaObject;
class QMimeData;
class QModelIndex;
class QObject;
class QPdfDocument;
class QPdfSearchModel;
class QPdfSearchResult;
class QSize;
class QTimerEvent;
class QVariant;
#else
typedef struct QAbstractItemModel QAbstractItemModel;
typedef struct QAbstractListModel QAbstractListModel;
typedef struct QChildEvent QChildEvent;
typedef struct QDataStream QDataStream;
typedef struct QEvent QEvent;
typedef struct QMetaMethod QMetaMethod;
typedef struct QMetaObject QMetaObject;
typedef struct QMimeData QMimeData;
typedef struct QModelIndex QModelIndex;
typedef struct QObject QObject;
typedef struct QPdfDocument QPdfDocument;
typedef struct QPdfSearchModel QPdfSearchModel;
typedef struct QPdfSearchResult QPdfSearchResult;
typedef struct QSize QSize;
typedef struct QTimerEvent QTimerEvent;
typedef struct QVariant QVariant;
#endif
QPdfSearchModel* QPdfSearchModel_new();
QPdfSearchModel* QPdfSearchModel_new2(QObject* parent);
void QPdfSearchModel_virtbase(QPdfSearchModel* src, QAbstractListModel** outptr_QAbstractListModel);
QMetaObject* QPdfSearchModel_metaObject(const QPdfSearchModel* self);
void* QPdfSearchModel_metacast(QPdfSearchModel* self, const char* param1);
struct miqt_string QPdfSearchModel_tr(const char* s);
struct miqt_string QPdfSearchModel_trUtf8(const char* s);
struct miqt_array /* of QPdfSearchResult* */ QPdfSearchModel_resultsOnPage(const QPdfSearchModel* self, int page);
QPdfSearchResult* QPdfSearchModel_resultAtIndex(const QPdfSearchModel* self, int index);
QPdfDocument* QPdfSearchModel_document(const QPdfSearchModel* self);
struct miqt_string QPdfSearchModel_searchString(const QPdfSearchModel* self);
struct miqt_map /* of int to struct miqt_string */ QPdfSearchModel_roleNames(const QPdfSearchModel* self);
int QPdfSearchModel_rowCount(const QPdfSearchModel* self, QModelIndex* parent);
QVariant* QPdfSearchModel_data(const QPdfSearchModel* self, QModelIndex* index, int role);
void QPdfSearchModel_setSearchString(QPdfSearchModel* self, struct miqt_string searchString);
void QPdfSearchModel_setDocument(QPdfSearchModel* self, QPdfDocument* document);
void QPdfSearchModel_documentChanged(QPdfSearchModel* self);
void QPdfSearchModel_connect_documentChanged(QPdfSearchModel* self, intptr_t slot);
void QPdfSearchModel_searchStringChanged(QPdfSearchModel* self);
void QPdfSearchModel_connect_searchStringChanged(QPdfSearchModel* self, intptr_t slot);
void QPdfSearchModel_timerEvent(QPdfSearchModel* self, QTimerEvent* event);
struct miqt_string QPdfSearchModel_tr2(const char* s, const char* c);
struct miqt_string QPdfSearchModel_tr3(const char* s, const char* c, int n);
struct miqt_string QPdfSearchModel_trUtf82(const char* s, const char* c);
struct miqt_string QPdfSearchModel_trUtf83(const char* s, const char* c, int n);
bool QPdfSearchModel_override_virtual_roleNames(void* self, intptr_t slot);
struct miqt_map /* of int to struct miqt_string */ QPdfSearchModel_virtualbase_roleNames(const void* self);
bool QPdfSearchModel_override_virtual_rowCount(void* self, intptr_t slot);
int QPdfSearchModel_virtualbase_rowCount(const void* self, QModelIndex* parent);
bool QPdfSearchModel_override_virtual_data(void* self, intptr_t slot);
QVariant* QPdfSearchModel_virtualbase_data(const void* self, QModelIndex* index, int role);
bool QPdfSearchModel_override_virtual_timerEvent(void* self, intptr_t slot);
void QPdfSearchModel_virtualbase_timerEvent(void* self, QTimerEvent* event);
bool QPdfSearchModel_override_virtual_index(void* self, intptr_t slot);
QModelIndex* QPdfSearchModel_virtualbase_index(const void* self, int row, int column, QModelIndex* parent);
bool QPdfSearchModel_override_virtual_sibling(void* self, intptr_t slot);
QModelIndex* QPdfSearchModel_virtualbase_sibling(const void* self, int row, int column, QModelIndex* idx);
bool QPdfSearchModel_override_virtual_dropMimeData(void* self, intptr_t slot);
bool QPdfSearchModel_virtualbase_dropMimeData(void* self, QMimeData* data, int action, int row, int column, QModelIndex* parent);
bool QPdfSearchModel_override_virtual_flags(void* self, intptr_t slot);
int QPdfSearchModel_virtualbase_flags(const void* self, QModelIndex* index);
bool QPdfSearchModel_override_virtual_setData(void* self, intptr_t slot);
bool QPdfSearchModel_virtualbase_setData(void* self, QModelIndex* index, QVariant* value, int role);
bool QPdfSearchModel_override_virtual_headerData(void* self, intptr_t slot);
QVariant* QPdfSearchModel_virtualbase_headerData(const void* self, int section, int orientation, int role);
bool QPdfSearchModel_override_virtual_setHeaderData(void* self, intptr_t slot);
bool QPdfSearchModel_virtualbase_setHeaderData(void* self, int section, int orientation, QVariant* value, int role);
bool QPdfSearchModel_override_virtual_itemData(void* self, intptr_t slot);
struct miqt_map /* of int to QVariant* */ QPdfSearchModel_virtualbase_itemData(const void* self, QModelIndex* index);
bool QPdfSearchModel_override_virtual_setItemData(void* self, intptr_t slot);
bool QPdfSearchModel_virtualbase_setItemData(void* self, QModelIndex* index, struct miqt_map /* of int to QVariant* */ roles);
bool QPdfSearchModel_override_virtual_mimeTypes(void* self, intptr_t slot);
struct miqt_array /* of struct miqt_string */ QPdfSearchModel_virtualbase_mimeTypes(const void* self);
bool QPdfSearchModel_override_virtual_mimeData(void* self, intptr_t slot);
QMimeData* QPdfSearchModel_virtualbase_mimeData(const void* self, struct miqt_array /* of QModelIndex* */ indexes);
bool QPdfSearchModel_override_virtual_canDropMimeData(void* self, intptr_t slot);
bool QPdfSearchModel_virtualbase_canDropMimeData(const void* self, QMimeData* data, int action, int row, int column, QModelIndex* parent);
bool QPdfSearchModel_override_virtual_supportedDropActions(void* self, intptr_t slot);
int QPdfSearchModel_virtualbase_supportedDropActions(const void* self);
bool QPdfSearchModel_override_virtual_supportedDragActions(void* self, intptr_t slot);
int QPdfSearchModel_virtualbase_supportedDragActions(const void* self);
bool QPdfSearchModel_override_virtual_insertRows(void* self, intptr_t slot);
bool QPdfSearchModel_virtualbase_insertRows(void* self, int row, int count, QModelIndex* parent);
bool QPdfSearchModel_override_virtual_insertColumns(void* self, intptr_t slot);
bool QPdfSearchModel_virtualbase_insertColumns(void* self, int column, int count, QModelIndex* parent);
bool QPdfSearchModel_override_virtual_removeRows(void* self, intptr_t slot);
bool QPdfSearchModel_virtualbase_removeRows(void* self, int row, int count, QModelIndex* parent);
bool QPdfSearchModel_override_virtual_removeColumns(void* self, intptr_t slot);
bool QPdfSearchModel_virtualbase_removeColumns(void* self, int column, int count, QModelIndex* parent);
bool QPdfSearchModel_override_virtual_moveRows(void* self, intptr_t slot);
bool QPdfSearchModel_virtualbase_moveRows(void* self, QModelIndex* sourceParent, int sourceRow, int count, QModelIndex* destinationParent, int destinationChild);
bool QPdfSearchModel_override_virtual_moveColumns(void* self, intptr_t slot);
bool QPdfSearchModel_virtualbase_moveColumns(void* self, QModelIndex* sourceParent, int sourceColumn, int count, QModelIndex* destinationParent, int destinationChild);
bool QPdfSearchModel_override_virtual_fetchMore(void* self, intptr_t slot);
void QPdfSearchModel_virtualbase_fetchMore(void* self, QModelIndex* parent);
bool QPdfSearchModel_override_virtual_canFetchMore(void* self, intptr_t slot);
bool QPdfSearchModel_virtualbase_canFetchMore(const void* self, QModelIndex* parent);
bool QPdfSearchModel_override_virtual_sort(void* self, intptr_t slot);
void QPdfSearchModel_virtualbase_sort(void* self, int column, int order);
bool QPdfSearchModel_override_virtual_buddy(void* self, intptr_t slot);
QModelIndex* QPdfSearchModel_virtualbase_buddy(const void* self, QModelIndex* index);
bool QPdfSearchModel_override_virtual_match(void* self, intptr_t slot);
struct miqt_array /* of QModelIndex* */ QPdfSearchModel_virtualbase_match(const void* self, QModelIndex* start, int role, QVariant* value, int hits, int flags);
bool QPdfSearchModel_override_virtual_span(void* self, intptr_t slot);
QSize* QPdfSearchModel_virtualbase_span(const void* self, QModelIndex* index);
bool QPdfSearchModel_override_virtual_submit(void* self, intptr_t slot);
bool QPdfSearchModel_virtualbase_submit(void* self);
bool QPdfSearchModel_override_virtual_revert(void* self, intptr_t slot);
void QPdfSearchModel_virtualbase_revert(void* self);
bool QPdfSearchModel_override_virtual_event(void* self, intptr_t slot);
bool QPdfSearchModel_virtualbase_event(void* self, QEvent* event);
bool QPdfSearchModel_override_virtual_eventFilter(void* self, intptr_t slot);
bool QPdfSearchModel_virtualbase_eventFilter(void* self, QObject* watched, QEvent* event);
bool QPdfSearchModel_override_virtual_childEvent(void* self, intptr_t slot);
void QPdfSearchModel_virtualbase_childEvent(void* self, QChildEvent* event);
bool QPdfSearchModel_override_virtual_customEvent(void* self, intptr_t slot);
void QPdfSearchModel_virtualbase_customEvent(void* self, QEvent* event);
bool QPdfSearchModel_override_virtual_connectNotify(void* self, intptr_t slot);
void QPdfSearchModel_virtualbase_connectNotify(void* self, QMetaMethod* signal);
bool QPdfSearchModel_override_virtual_disconnectNotify(void* self, intptr_t slot);
void QPdfSearchModel_virtualbase_disconnectNotify(void* self, QMetaMethod* signal);
void QPdfSearchModel_protectedbase_updatePage(bool* _dynamic_cast_ok, void* self, int page);
void QPdfSearchModel_protectedbase_resetInternalData(bool* _dynamic_cast_ok, void* self);
QModelIndex* QPdfSearchModel_protectedbase_createIndex(bool* _dynamic_cast_ok, const void* self, int row, int column);
void QPdfSearchModel_protectedbase_encodeData(bool* _dynamic_cast_ok, const void* self, struct miqt_array /* of QModelIndex* */ indexes, QDataStream* stream);
bool QPdfSearchModel_protectedbase_decodeData(bool* _dynamic_cast_ok, void* self, int row, int column, QModelIndex* parent, QDataStream* stream);
void QPdfSearchModel_protectedbase_beginInsertRows(bool* _dynamic_cast_ok, void* self, QModelIndex* parent, int first, int last);
void QPdfSearchModel_protectedbase_endInsertRows(bool* _dynamic_cast_ok, void* self);
void QPdfSearchModel_protectedbase_beginRemoveRows(bool* _dynamic_cast_ok, void* self, QModelIndex* parent, int first, int last);
void QPdfSearchModel_protectedbase_endRemoveRows(bool* _dynamic_cast_ok, void* self);
bool QPdfSearchModel_protectedbase_beginMoveRows(bool* _dynamic_cast_ok, void* self, QModelIndex* sourceParent, int sourceFirst, int sourceLast, QModelIndex* destinationParent, int destinationRow);
void QPdfSearchModel_protectedbase_endMoveRows(bool* _dynamic_cast_ok, void* self);
void QPdfSearchModel_protectedbase_beginInsertColumns(bool* _dynamic_cast_ok, void* self, QModelIndex* parent, int first, int last);
void QPdfSearchModel_protectedbase_endInsertColumns(bool* _dynamic_cast_ok, void* self);
void QPdfSearchModel_protectedbase_beginRemoveColumns(bool* _dynamic_cast_ok, void* self, QModelIndex* parent, int first, int last);
void QPdfSearchModel_protectedbase_endRemoveColumns(bool* _dynamic_cast_ok, void* self);
bool QPdfSearchModel_protectedbase_beginMoveColumns(bool* _dynamic_cast_ok, void* self, QModelIndex* sourceParent, int sourceFirst, int sourceLast, QModelIndex* destinationParent, int destinationColumn);
void QPdfSearchModel_protectedbase_endMoveColumns(bool* _dynamic_cast_ok, void* self);
void QPdfSearchModel_protectedbase_beginResetModel(bool* _dynamic_cast_ok, void* self);
void QPdfSearchModel_protectedbase_endResetModel(bool* _dynamic_cast_ok, void* self);
void QPdfSearchModel_protectedbase_changePersistentIndex(bool* _dynamic_cast_ok, void* self, QModelIndex* from, QModelIndex* to);
void QPdfSearchModel_protectedbase_changePersistentIndexList(bool* _dynamic_cast_ok, void* self, struct miqt_array /* of QModelIndex* */ from, struct miqt_array /* of QModelIndex* */ to);
struct miqt_array /* of QModelIndex* */ QPdfSearchModel_protectedbase_persistentIndexList(bool* _dynamic_cast_ok, const void* self);
QObject* QPdfSearchModel_protectedbase_sender(bool* _dynamic_cast_ok, const void* self);
int QPdfSearchModel_protectedbase_senderSignalIndex(bool* _dynamic_cast_ok, const void* self);
int QPdfSearchModel_protectedbase_receivers(bool* _dynamic_cast_ok, const void* self, const char* signal);
bool QPdfSearchModel_protectedbase_isSignalConnected(bool* _dynamic_cast_ok, const void* self, QMetaMethod* signal);
void QPdfSearchModel_delete(QPdfSearchModel* self);
#ifdef __cplusplus
} /* extern C */
#endif
#endif

View File

@ -0,0 +1,69 @@
#include <QPdfDestination>
#include <QPdfSearchResult>
#include <QRectF>
#include <QString>
#include <QByteArray>
#include <cstring>
#include <QVector>
#include <qpdfsearchresult.h>
#include "gen_qpdfsearchresult.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
} /* extern C */
#endif
QPdfSearchResult* QPdfSearchResult_new() {
return new QPdfSearchResult();
}
QPdfSearchResult* QPdfSearchResult_new2(QPdfSearchResult* param1) {
return new QPdfSearchResult(*param1);
}
void QPdfSearchResult_virtbase(QPdfSearchResult* src, QPdfDestination** outptr_QPdfDestination) {
*outptr_QPdfDestination = static_cast<QPdfDestination*>(src);
}
struct miqt_string QPdfSearchResult_contextBefore(const QPdfSearchResult* self) {
QString _ret = self->contextBefore();
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
struct miqt_string _ms;
_ms.len = _b.length();
_ms.data = static_cast<char*>(malloc(_ms.len));
memcpy(_ms.data, _b.data(), _ms.len);
return _ms;
}
struct miqt_string QPdfSearchResult_contextAfter(const QPdfSearchResult* self) {
QString _ret = self->contextAfter();
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
struct miqt_string _ms;
_ms.len = _b.length();
_ms.data = static_cast<char*>(malloc(_ms.len));
memcpy(_ms.data, _b.data(), _ms.len);
return _ms;
}
struct miqt_array /* of QRectF* */ QPdfSearchResult_rectangles(const QPdfSearchResult* self) {
QVector<QRectF> _ret = self->rectangles();
// Convert QList<> from C++ memory to manually-managed C memory
QRectF** _arr = static_cast<QRectF**>(malloc(sizeof(QRectF*) * _ret.length()));
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
_arr[i] = new QRectF(_ret[i]);
}
struct miqt_array _out;
_out.len = _ret.length();
_out.data = static_cast<void*>(_arr);
return _out;
}
void QPdfSearchResult_delete(QPdfSearchResult* self) {
delete self;
}

View File

@ -0,0 +1,103 @@
package pdf
/*
#include "gen_qpdfsearchresult.h"
#include <stdlib.h>
*/
import "C"
import (
"github.com/mappu/miqt/qt"
"runtime"
"unsafe"
)
type QPdfSearchResult struct {
h *C.QPdfSearchResult
*QPdfDestination
}
func (this *QPdfSearchResult) cPointer() *C.QPdfSearchResult {
if this == nil {
return nil
}
return this.h
}
func (this *QPdfSearchResult) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
// newQPdfSearchResult constructs the type using only CGO pointers.
func newQPdfSearchResult(h *C.QPdfSearchResult) *QPdfSearchResult {
if h == nil {
return nil
}
var outptr_QPdfDestination *C.QPdfDestination = nil
C.QPdfSearchResult_virtbase(h, &outptr_QPdfDestination)
return &QPdfSearchResult{h: h,
QPdfDestination: newQPdfDestination(outptr_QPdfDestination)}
}
// UnsafeNewQPdfSearchResult constructs the type using only unsafe pointers.
func UnsafeNewQPdfSearchResult(h unsafe.Pointer) *QPdfSearchResult {
return newQPdfSearchResult((*C.QPdfSearchResult)(h))
}
// NewQPdfSearchResult constructs a new QPdfSearchResult object.
func NewQPdfSearchResult() *QPdfSearchResult {
return newQPdfSearchResult(C.QPdfSearchResult_new())
}
// NewQPdfSearchResult2 constructs a new QPdfSearchResult object.
func NewQPdfSearchResult2(param1 *QPdfSearchResult) *QPdfSearchResult {
return newQPdfSearchResult(C.QPdfSearchResult_new2(param1.cPointer()))
}
func (this *QPdfSearchResult) ContextBefore() string {
var _ms C.struct_miqt_string = C.QPdfSearchResult_contextBefore(this.h)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func (this *QPdfSearchResult) ContextAfter() string {
var _ms C.struct_miqt_string = C.QPdfSearchResult_contextAfter(this.h)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func (this *QPdfSearchResult) Rectangles() []qt.QRectF {
var _ma C.struct_miqt_array = C.QPdfSearchResult_rectangles(this.h)
_ret := make([]qt.QRectF, int(_ma.len))
_outCast := (*[0xffff]*C.QRectF)(unsafe.Pointer(_ma.data)) // hey ya
for i := 0; i < int(_ma.len); i++ {
_vv_goptr := qt.UnsafeNewQRectF(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
}
// Delete this object from C++ memory.
func (this *QPdfSearchResult) Delete() {
C.QPdfSearchResult_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 *QPdfSearchResult) GoGC() {
runtime.SetFinalizer(this, func(this *QPdfSearchResult) {
this.Delete()
runtime.KeepAlive(this.h)
})
}

View File

@ -0,0 +1,39 @@
#pragma once
#ifndef MIQT_QT_PDF_GEN_QPDFSEARCHRESULT_H
#define MIQT_QT_PDF_GEN_QPDFSEARCHRESULT_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 QPdfDestination;
class QPdfSearchResult;
class QRectF;
#else
typedef struct QPdfDestination QPdfDestination;
typedef struct QPdfSearchResult QPdfSearchResult;
typedef struct QRectF QRectF;
#endif
QPdfSearchResult* QPdfSearchResult_new();
QPdfSearchResult* QPdfSearchResult_new2(QPdfSearchResult* param1);
void QPdfSearchResult_virtbase(QPdfSearchResult* src, QPdfDestination** outptr_QPdfDestination);
struct miqt_string QPdfSearchResult_contextBefore(const QPdfSearchResult* self);
struct miqt_string QPdfSearchResult_contextAfter(const QPdfSearchResult* self);
struct miqt_array /* of QRectF* */ QPdfSearchResult_rectangles(const QPdfSearchResult* self);
void QPdfSearchResult_delete(QPdfSearchResult* self);
#ifdef __cplusplus
} /* extern C */
#endif
#endif

View File

@ -0,0 +1,67 @@
#include <QPdfSelection>
#include <QRectF>
#include <QString>
#include <QByteArray>
#include <cstring>
#include <qpdfselection.h>
#include "gen_qpdfselection.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
} /* extern C */
#endif
QPdfSelection* QPdfSelection_new(QPdfSelection* other) {
return new QPdfSelection(*other);
}
void QPdfSelection_operatorAssign(QPdfSelection* self, QPdfSelection* other) {
self->operator=(*other);
}
void QPdfSelection_swap(QPdfSelection* self, QPdfSelection* other) {
self->swap(*other);
}
bool QPdfSelection_isValid(const QPdfSelection* self) {
return self->isValid();
}
struct miqt_string QPdfSelection_text(const QPdfSelection* self) {
QString _ret = self->text();
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
struct miqt_string _ms;
_ms.len = _b.length();
_ms.data = static_cast<char*>(malloc(_ms.len));
memcpy(_ms.data, _b.data(), _ms.len);
return _ms;
}
QRectF* QPdfSelection_boundingRectangle(const QPdfSelection* self) {
return new QRectF(self->boundingRectangle());
}
int QPdfSelection_startIndex(const QPdfSelection* self) {
return self->startIndex();
}
int QPdfSelection_endIndex(const QPdfSelection* self) {
return self->endIndex();
}
void QPdfSelection_copyToClipboard(const QPdfSelection* self) {
self->copyToClipboard();
}
void QPdfSelection_copyToClipboardWithMode(const QPdfSelection* self, int mode) {
self->copyToClipboard(static_cast<QClipboard::Mode>(mode));
}
void QPdfSelection_delete(QPdfSelection* self) {
delete self;
}

108
qt/pdf/gen_qpdfselection.go Normal file
View File

@ -0,0 +1,108 @@
package pdf
/*
#include "gen_qpdfselection.h"
#include <stdlib.h>
*/
import "C"
import (
"github.com/mappu/miqt/qt"
"runtime"
"unsafe"
)
type QPdfSelection struct {
h *C.QPdfSelection
}
func (this *QPdfSelection) cPointer() *C.QPdfSelection {
if this == nil {
return nil
}
return this.h
}
func (this *QPdfSelection) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
// newQPdfSelection constructs the type using only CGO pointers.
func newQPdfSelection(h *C.QPdfSelection) *QPdfSelection {
if h == nil {
return nil
}
return &QPdfSelection{h: h}
}
// UnsafeNewQPdfSelection constructs the type using only unsafe pointers.
func UnsafeNewQPdfSelection(h unsafe.Pointer) *QPdfSelection {
return newQPdfSelection((*C.QPdfSelection)(h))
}
// NewQPdfSelection constructs a new QPdfSelection object.
func NewQPdfSelection(other *QPdfSelection) *QPdfSelection {
return newQPdfSelection(C.QPdfSelection_new(other.cPointer()))
}
func (this *QPdfSelection) OperatorAssign(other *QPdfSelection) {
C.QPdfSelection_operatorAssign(this.h, other.cPointer())
}
func (this *QPdfSelection) Swap(other *QPdfSelection) {
C.QPdfSelection_swap(this.h, other.cPointer())
}
func (this *QPdfSelection) IsValid() bool {
return (bool)(C.QPdfSelection_isValid(this.h))
}
func (this *QPdfSelection) Text() string {
var _ms C.struct_miqt_string = C.QPdfSelection_text(this.h)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func (this *QPdfSelection) BoundingRectangle() *qt.QRectF {
_goptr := qt.UnsafeNewQRectF(unsafe.Pointer(C.QPdfSelection_boundingRectangle(this.h)))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QPdfSelection) StartIndex() int {
return (int)(C.QPdfSelection_startIndex(this.h))
}
func (this *QPdfSelection) EndIndex() int {
return (int)(C.QPdfSelection_endIndex(this.h))
}
func (this *QPdfSelection) CopyToClipboard() {
C.QPdfSelection_copyToClipboard(this.h)
}
func (this *QPdfSelection) CopyToClipboardWithMode(mode qt.QClipboard__Mode) {
C.QPdfSelection_copyToClipboardWithMode(this.h, (C.int)(mode))
}
// Delete this object from C++ memory.
func (this *QPdfSelection) Delete() {
C.QPdfSelection_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 *QPdfSelection) GoGC() {
runtime.SetFinalizer(this, func(this *QPdfSelection) {
this.Delete()
runtime.KeepAlive(this.h)
})
}

View File

@ -0,0 +1,41 @@
#pragma once
#ifndef MIQT_QT_PDF_GEN_QPDFSELECTION_H
#define MIQT_QT_PDF_GEN_QPDFSELECTION_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 QPdfSelection;
class QRectF;
#else
typedef struct QPdfSelection QPdfSelection;
typedef struct QRectF QRectF;
#endif
QPdfSelection* QPdfSelection_new(QPdfSelection* other);
void QPdfSelection_operatorAssign(QPdfSelection* self, QPdfSelection* other);
void QPdfSelection_swap(QPdfSelection* self, QPdfSelection* other);
bool QPdfSelection_isValid(const QPdfSelection* self);
struct miqt_string QPdfSelection_text(const QPdfSelection* self);
QRectF* QPdfSelection_boundingRectangle(const QPdfSelection* self);
int QPdfSelection_startIndex(const QPdfSelection* self);
int QPdfSelection_endIndex(const QPdfSelection* self);
void QPdfSelection_copyToClipboard(const QPdfSelection* self);
void QPdfSelection_copyToClipboardWithMode(const QPdfSelection* self, int mode);
void QPdfSelection_delete(QPdfSelection* self);
#ifdef __cplusplus
} /* extern C */
#endif
#endif

2295
qt/pdf/gen_qpdfview.cpp Normal file

File diff suppressed because it is too large Load Diff

1877
qt/pdf/gen_qpdfview.go Normal file

File diff suppressed because it is too large Load Diff

257
qt/pdf/gen_qpdfview.h Normal file
View File

@ -0,0 +1,257 @@
#pragma once
#ifndef MIQT_QT_PDF_GEN_QPDFVIEW_H
#define MIQT_QT_PDF_GEN_QPDFVIEW_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 QAbstractScrollArea;
class QActionEvent;
class QChildEvent;
class QCloseEvent;
class QContextMenuEvent;
class QDragEnterEvent;
class QDragLeaveEvent;
class QDragMoveEvent;
class QDropEvent;
class QEvent;
class QFocusEvent;
class QFrame;
class QHideEvent;
class QInputMethodEvent;
class QKeyEvent;
class QMargins;
class QMetaMethod;
class QMetaObject;
class QMouseEvent;
class QMoveEvent;
class QObject;
class QPaintDevice;
class QPaintEngine;
class QPaintEvent;
class QPainter;
class QPdfDocument;
class QPdfPageNavigation;
class QPdfView;
class QPoint;
class QResizeEvent;
class QShowEvent;
class QSize;
class QStyleOptionFrame;
class QTabletEvent;
class QTimerEvent;
class QVariant;
class QWheelEvent;
class QWidget;
#else
typedef struct QAbstractScrollArea QAbstractScrollArea;
typedef struct QActionEvent QActionEvent;
typedef struct QChildEvent QChildEvent;
typedef struct QCloseEvent QCloseEvent;
typedef struct QContextMenuEvent QContextMenuEvent;
typedef struct QDragEnterEvent QDragEnterEvent;
typedef struct QDragLeaveEvent QDragLeaveEvent;
typedef struct QDragMoveEvent QDragMoveEvent;
typedef struct QDropEvent QDropEvent;
typedef struct QEvent QEvent;
typedef struct QFocusEvent QFocusEvent;
typedef struct QFrame QFrame;
typedef struct QHideEvent QHideEvent;
typedef struct QInputMethodEvent QInputMethodEvent;
typedef struct QKeyEvent QKeyEvent;
typedef struct QMargins QMargins;
typedef struct QMetaMethod QMetaMethod;
typedef struct QMetaObject QMetaObject;
typedef struct QMouseEvent QMouseEvent;
typedef struct QMoveEvent QMoveEvent;
typedef struct QObject QObject;
typedef struct QPaintDevice QPaintDevice;
typedef struct QPaintEngine QPaintEngine;
typedef struct QPaintEvent QPaintEvent;
typedef struct QPainter QPainter;
typedef struct QPdfDocument QPdfDocument;
typedef struct QPdfPageNavigation QPdfPageNavigation;
typedef struct QPdfView QPdfView;
typedef struct QPoint QPoint;
typedef struct QResizeEvent QResizeEvent;
typedef struct QShowEvent QShowEvent;
typedef struct QSize QSize;
typedef struct QStyleOptionFrame QStyleOptionFrame;
typedef struct QTabletEvent QTabletEvent;
typedef struct QTimerEvent QTimerEvent;
typedef struct QVariant QVariant;
typedef struct QWheelEvent QWheelEvent;
typedef struct QWidget QWidget;
#endif
QPdfView* QPdfView_new(QWidget* parent);
QPdfView* QPdfView_new2();
void QPdfView_virtbase(QPdfView* src, QAbstractScrollArea** outptr_QAbstractScrollArea);
QMetaObject* QPdfView_metaObject(const QPdfView* self);
void* QPdfView_metacast(QPdfView* self, const char* param1);
struct miqt_string QPdfView_tr(const char* s);
struct miqt_string QPdfView_trUtf8(const char* s);
void QPdfView_setDocument(QPdfView* self, QPdfDocument* document);
QPdfDocument* QPdfView_document(const QPdfView* self);
QPdfPageNavigation* QPdfView_pageNavigation(const QPdfView* self);
int QPdfView_pageMode(const QPdfView* self);
int QPdfView_zoomMode(const QPdfView* self);
double QPdfView_zoomFactor(const QPdfView* self);
int QPdfView_pageSpacing(const QPdfView* self);
void QPdfView_setPageSpacing(QPdfView* self, int spacing);
QMargins* QPdfView_documentMargins(const QPdfView* self);
void QPdfView_setDocumentMargins(QPdfView* self, QMargins* margins);
void QPdfView_setPageMode(QPdfView* self, int mode);
void QPdfView_setZoomMode(QPdfView* self, int mode);
void QPdfView_setZoomFactor(QPdfView* self, double factor);
void QPdfView_documentChanged(QPdfView* self, QPdfDocument* document);
void QPdfView_connect_documentChanged(QPdfView* self, intptr_t slot);
void QPdfView_pageModeChanged(QPdfView* self, int pageMode);
void QPdfView_connect_pageModeChanged(QPdfView* self, intptr_t slot);
void QPdfView_zoomModeChanged(QPdfView* self, int zoomMode);
void QPdfView_connect_zoomModeChanged(QPdfView* self, intptr_t slot);
void QPdfView_zoomFactorChanged(QPdfView* self, double zoomFactor);
void QPdfView_connect_zoomFactorChanged(QPdfView* self, intptr_t slot);
void QPdfView_pageSpacingChanged(QPdfView* self, int pageSpacing);
void QPdfView_connect_pageSpacingChanged(QPdfView* self, intptr_t slot);
void QPdfView_documentMarginsChanged(QPdfView* self, QMargins* documentMargins);
void QPdfView_connect_documentMarginsChanged(QPdfView* self, intptr_t slot);
void QPdfView_paintEvent(QPdfView* self, QPaintEvent* event);
void QPdfView_resizeEvent(QPdfView* self, QResizeEvent* event);
void QPdfView_scrollContentsBy(QPdfView* self, int dx, int dy);
struct miqt_string QPdfView_tr2(const char* s, const char* c);
struct miqt_string QPdfView_tr3(const char* s, const char* c, int n);
struct miqt_string QPdfView_trUtf82(const char* s, const char* c);
struct miqt_string QPdfView_trUtf83(const char* s, const char* c, int n);
bool QPdfView_override_virtual_paintEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_paintEvent(void* self, QPaintEvent* event);
bool QPdfView_override_virtual_resizeEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_resizeEvent(void* self, QResizeEvent* event);
bool QPdfView_override_virtual_scrollContentsBy(void* self, intptr_t slot);
void QPdfView_virtualbase_scrollContentsBy(void* self, int dx, int dy);
bool QPdfView_override_virtual_minimumSizeHint(void* self, intptr_t slot);
QSize* QPdfView_virtualbase_minimumSizeHint(const void* self);
bool QPdfView_override_virtual_sizeHint(void* self, intptr_t slot);
QSize* QPdfView_virtualbase_sizeHint(const void* self);
bool QPdfView_override_virtual_setupViewport(void* self, intptr_t slot);
void QPdfView_virtualbase_setupViewport(void* self, QWidget* viewport);
bool QPdfView_override_virtual_eventFilter(void* self, intptr_t slot);
bool QPdfView_virtualbase_eventFilter(void* self, QObject* param1, QEvent* param2);
bool QPdfView_override_virtual_event(void* self, intptr_t slot);
bool QPdfView_virtualbase_event(void* self, QEvent* param1);
bool QPdfView_override_virtual_viewportEvent(void* self, intptr_t slot);
bool QPdfView_virtualbase_viewportEvent(void* self, QEvent* param1);
bool QPdfView_override_virtual_mousePressEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_mousePressEvent(void* self, QMouseEvent* param1);
bool QPdfView_override_virtual_mouseReleaseEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_mouseReleaseEvent(void* self, QMouseEvent* param1);
bool QPdfView_override_virtual_mouseDoubleClickEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_mouseDoubleClickEvent(void* self, QMouseEvent* param1);
bool QPdfView_override_virtual_mouseMoveEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_mouseMoveEvent(void* self, QMouseEvent* param1);
bool QPdfView_override_virtual_wheelEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_wheelEvent(void* self, QWheelEvent* param1);
bool QPdfView_override_virtual_contextMenuEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_contextMenuEvent(void* self, QContextMenuEvent* param1);
bool QPdfView_override_virtual_dragEnterEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_dragEnterEvent(void* self, QDragEnterEvent* param1);
bool QPdfView_override_virtual_dragMoveEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_dragMoveEvent(void* self, QDragMoveEvent* param1);
bool QPdfView_override_virtual_dragLeaveEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_dragLeaveEvent(void* self, QDragLeaveEvent* param1);
bool QPdfView_override_virtual_dropEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_dropEvent(void* self, QDropEvent* param1);
bool QPdfView_override_virtual_keyPressEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_keyPressEvent(void* self, QKeyEvent* param1);
bool QPdfView_override_virtual_viewportSizeHint(void* self, intptr_t slot);
QSize* QPdfView_virtualbase_viewportSizeHint(const void* self);
bool QPdfView_override_virtual_changeEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_changeEvent(void* self, QEvent* param1);
bool QPdfView_override_virtual_devType(void* self, intptr_t slot);
int QPdfView_virtualbase_devType(const void* self);
bool QPdfView_override_virtual_setVisible(void* self, intptr_t slot);
void QPdfView_virtualbase_setVisible(void* self, bool visible);
bool QPdfView_override_virtual_heightForWidth(void* self, intptr_t slot);
int QPdfView_virtualbase_heightForWidth(const void* self, int param1);
bool QPdfView_override_virtual_hasHeightForWidth(void* self, intptr_t slot);
bool QPdfView_virtualbase_hasHeightForWidth(const void* self);
bool QPdfView_override_virtual_paintEngine(void* self, intptr_t slot);
QPaintEngine* QPdfView_virtualbase_paintEngine(const void* self);
bool QPdfView_override_virtual_keyReleaseEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_keyReleaseEvent(void* self, QKeyEvent* event);
bool QPdfView_override_virtual_focusInEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_focusInEvent(void* self, QFocusEvent* event);
bool QPdfView_override_virtual_focusOutEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_focusOutEvent(void* self, QFocusEvent* event);
bool QPdfView_override_virtual_enterEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_enterEvent(void* self, QEvent* event);
bool QPdfView_override_virtual_leaveEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_leaveEvent(void* self, QEvent* event);
bool QPdfView_override_virtual_moveEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_moveEvent(void* self, QMoveEvent* event);
bool QPdfView_override_virtual_closeEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_closeEvent(void* self, QCloseEvent* event);
bool QPdfView_override_virtual_tabletEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_tabletEvent(void* self, QTabletEvent* event);
bool QPdfView_override_virtual_actionEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_actionEvent(void* self, QActionEvent* event);
bool QPdfView_override_virtual_showEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_showEvent(void* self, QShowEvent* event);
bool QPdfView_override_virtual_hideEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_hideEvent(void* self, QHideEvent* event);
bool QPdfView_override_virtual_nativeEvent(void* self, intptr_t slot);
bool QPdfView_virtualbase_nativeEvent(void* self, struct miqt_string eventType, void* message, long* result);
bool QPdfView_override_virtual_metric(void* self, intptr_t slot);
int QPdfView_virtualbase_metric(const void* self, int param1);
bool QPdfView_override_virtual_initPainter(void* self, intptr_t slot);
void QPdfView_virtualbase_initPainter(const void* self, QPainter* painter);
bool QPdfView_override_virtual_redirected(void* self, intptr_t slot);
QPaintDevice* QPdfView_virtualbase_redirected(const void* self, QPoint* offset);
bool QPdfView_override_virtual_sharedPainter(void* self, intptr_t slot);
QPainter* QPdfView_virtualbase_sharedPainter(const void* self);
bool QPdfView_override_virtual_inputMethodEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_inputMethodEvent(void* self, QInputMethodEvent* param1);
bool QPdfView_override_virtual_inputMethodQuery(void* self, intptr_t slot);
QVariant* QPdfView_virtualbase_inputMethodQuery(const void* self, int param1);
bool QPdfView_override_virtual_focusNextPrevChild(void* self, intptr_t slot);
bool QPdfView_virtualbase_focusNextPrevChild(void* self, bool next);
bool QPdfView_override_virtual_timerEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_timerEvent(void* self, QTimerEvent* event);
bool QPdfView_override_virtual_childEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_childEvent(void* self, QChildEvent* event);
bool QPdfView_override_virtual_customEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_customEvent(void* self, QEvent* event);
bool QPdfView_override_virtual_connectNotify(void* self, intptr_t slot);
void QPdfView_virtualbase_connectNotify(void* self, QMetaMethod* signal);
bool QPdfView_override_virtual_disconnectNotify(void* self, intptr_t slot);
void QPdfView_virtualbase_disconnectNotify(void* self, QMetaMethod* signal);
void QPdfView_protectedbase_setViewportMargins(bool* _dynamic_cast_ok, void* self, int left, int top, int right, int bottom);
QMargins* QPdfView_protectedbase_viewportMargins(bool* _dynamic_cast_ok, const void* self);
void QPdfView_protectedbase_drawFrame(bool* _dynamic_cast_ok, void* self, QPainter* param1);
void QPdfView_protectedbase_initStyleOption(bool* _dynamic_cast_ok, const void* self, QStyleOptionFrame* option);
void QPdfView_protectedbase_updateMicroFocus(bool* _dynamic_cast_ok, void* self);
void QPdfView_protectedbase_create(bool* _dynamic_cast_ok, void* self);
void QPdfView_protectedbase_destroy(bool* _dynamic_cast_ok, void* self);
bool QPdfView_protectedbase_focusNextChild(bool* _dynamic_cast_ok, void* self);
bool QPdfView_protectedbase_focusPreviousChild(bool* _dynamic_cast_ok, void* self);
QObject* QPdfView_protectedbase_sender(bool* _dynamic_cast_ok, const void* self);
int QPdfView_protectedbase_senderSignalIndex(bool* _dynamic_cast_ok, const void* self);
int QPdfView_protectedbase_receivers(bool* _dynamic_cast_ok, const void* self, const char* signal);
bool QPdfView_protectedbase_isSignalConnected(bool* _dynamic_cast_ok, const void* self, QMetaMethod* signal);
void QPdfView_delete(QPdfView* self);
#ifdef __cplusplus
} /* extern C */
#endif
#endif

7
qt6/pdf/cflags.go Normal file
View File

@ -0,0 +1,7 @@
package pdf
/*
#cgo pkg-config: Qt6PdfWidgets
*/
import "C"

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,187 @@
#pragma once
#ifndef MIQT_QT6_PDF_GEN_QPDFBOOKMARKMODEL_H
#define MIQT_QT6_PDF_GEN_QPDFBOOKMARKMODEL_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 QAbstractItemModel;
class QChildEvent;
class QDataStream;
class QEvent;
class QMetaMethod;
class QMetaObject;
class QMimeData;
class QModelIndex;
class QModelRoleDataSpan;
class QObject;
class QPdfBookmarkModel;
class QPdfDocument;
class QSize;
class QTimerEvent;
class QVariant;
#else
typedef struct QAbstractItemModel QAbstractItemModel;
typedef struct QChildEvent QChildEvent;
typedef struct QDataStream QDataStream;
typedef struct QEvent QEvent;
typedef struct QMetaMethod QMetaMethod;
typedef struct QMetaObject QMetaObject;
typedef struct QMimeData QMimeData;
typedef struct QModelIndex QModelIndex;
typedef struct QModelRoleDataSpan QModelRoleDataSpan;
typedef struct QObject QObject;
typedef struct QPdfBookmarkModel QPdfBookmarkModel;
typedef struct QPdfDocument QPdfDocument;
typedef struct QSize QSize;
typedef struct QTimerEvent QTimerEvent;
typedef struct QVariant QVariant;
#endif
QPdfBookmarkModel* QPdfBookmarkModel_new();
QPdfBookmarkModel* QPdfBookmarkModel_new2(QObject* parent);
void QPdfBookmarkModel_virtbase(QPdfBookmarkModel* src, QAbstractItemModel** outptr_QAbstractItemModel);
QMetaObject* QPdfBookmarkModel_metaObject(const QPdfBookmarkModel* self);
void* QPdfBookmarkModel_metacast(QPdfBookmarkModel* self, const char* param1);
struct miqt_string QPdfBookmarkModel_tr(const char* s);
QPdfDocument* QPdfBookmarkModel_document(const QPdfBookmarkModel* self);
void QPdfBookmarkModel_setDocument(QPdfBookmarkModel* self, QPdfDocument* document);
QVariant* QPdfBookmarkModel_data(const QPdfBookmarkModel* self, QModelIndex* index, int role);
QModelIndex* QPdfBookmarkModel_index(const QPdfBookmarkModel* self, int row, int column, QModelIndex* parent);
QModelIndex* QPdfBookmarkModel_parent(const QPdfBookmarkModel* self, QModelIndex* index);
int QPdfBookmarkModel_rowCount(const QPdfBookmarkModel* self, QModelIndex* parent);
int QPdfBookmarkModel_columnCount(const QPdfBookmarkModel* self, QModelIndex* parent);
struct miqt_map /* of int to struct miqt_string */ QPdfBookmarkModel_roleNames(const QPdfBookmarkModel* self);
void QPdfBookmarkModel_documentChanged(QPdfBookmarkModel* self, QPdfDocument* document);
void QPdfBookmarkModel_connect_documentChanged(QPdfBookmarkModel* self, intptr_t slot);
struct miqt_string QPdfBookmarkModel_tr2(const char* s, const char* c);
struct miqt_string QPdfBookmarkModel_tr3(const char* s, const char* c, int n);
bool QPdfBookmarkModel_override_virtual_data(void* self, intptr_t slot);
QVariant* QPdfBookmarkModel_virtualbase_data(const void* self, QModelIndex* index, int role);
bool QPdfBookmarkModel_override_virtual_index(void* self, intptr_t slot);
QModelIndex* QPdfBookmarkModel_virtualbase_index(const void* self, int row, int column, QModelIndex* parent);
bool QPdfBookmarkModel_override_virtual_parent(void* self, intptr_t slot);
QModelIndex* QPdfBookmarkModel_virtualbase_parent(const void* self, QModelIndex* index);
bool QPdfBookmarkModel_override_virtual_rowCount(void* self, intptr_t slot);
int QPdfBookmarkModel_virtualbase_rowCount(const void* self, QModelIndex* parent);
bool QPdfBookmarkModel_override_virtual_columnCount(void* self, intptr_t slot);
int QPdfBookmarkModel_virtualbase_columnCount(const void* self, QModelIndex* parent);
bool QPdfBookmarkModel_override_virtual_roleNames(void* self, intptr_t slot);
struct miqt_map /* of int to struct miqt_string */ QPdfBookmarkModel_virtualbase_roleNames(const void* self);
bool QPdfBookmarkModel_override_virtual_sibling(void* self, intptr_t slot);
QModelIndex* QPdfBookmarkModel_virtualbase_sibling(const void* self, int row, int column, QModelIndex* idx);
bool QPdfBookmarkModel_override_virtual_hasChildren(void* self, intptr_t slot);
bool QPdfBookmarkModel_virtualbase_hasChildren(const void* self, QModelIndex* parent);
bool QPdfBookmarkModel_override_virtual_setData(void* self, intptr_t slot);
bool QPdfBookmarkModel_virtualbase_setData(void* self, QModelIndex* index, QVariant* value, int role);
bool QPdfBookmarkModel_override_virtual_headerData(void* self, intptr_t slot);
QVariant* QPdfBookmarkModel_virtualbase_headerData(const void* self, int section, int orientation, int role);
bool QPdfBookmarkModel_override_virtual_setHeaderData(void* self, intptr_t slot);
bool QPdfBookmarkModel_virtualbase_setHeaderData(void* self, int section, int orientation, QVariant* value, int role);
bool QPdfBookmarkModel_override_virtual_itemData(void* self, intptr_t slot);
struct miqt_map /* of int to QVariant* */ QPdfBookmarkModel_virtualbase_itemData(const void* self, QModelIndex* index);
bool QPdfBookmarkModel_override_virtual_setItemData(void* self, intptr_t slot);
bool QPdfBookmarkModel_virtualbase_setItemData(void* self, QModelIndex* index, struct miqt_map /* of int to QVariant* */ roles);
bool QPdfBookmarkModel_override_virtual_clearItemData(void* self, intptr_t slot);
bool QPdfBookmarkModel_virtualbase_clearItemData(void* self, QModelIndex* index);
bool QPdfBookmarkModel_override_virtual_mimeTypes(void* self, intptr_t slot);
struct miqt_array /* of struct miqt_string */ QPdfBookmarkModel_virtualbase_mimeTypes(const void* self);
bool QPdfBookmarkModel_override_virtual_mimeData(void* self, intptr_t slot);
QMimeData* QPdfBookmarkModel_virtualbase_mimeData(const void* self, struct miqt_array /* of QModelIndex* */ indexes);
bool QPdfBookmarkModel_override_virtual_canDropMimeData(void* self, intptr_t slot);
bool QPdfBookmarkModel_virtualbase_canDropMimeData(const void* self, QMimeData* data, int action, int row, int column, QModelIndex* parent);
bool QPdfBookmarkModel_override_virtual_dropMimeData(void* self, intptr_t slot);
bool QPdfBookmarkModel_virtualbase_dropMimeData(void* self, QMimeData* data, int action, int row, int column, QModelIndex* parent);
bool QPdfBookmarkModel_override_virtual_supportedDropActions(void* self, intptr_t slot);
int QPdfBookmarkModel_virtualbase_supportedDropActions(const void* self);
bool QPdfBookmarkModel_override_virtual_supportedDragActions(void* self, intptr_t slot);
int QPdfBookmarkModel_virtualbase_supportedDragActions(const void* self);
bool QPdfBookmarkModel_override_virtual_insertRows(void* self, intptr_t slot);
bool QPdfBookmarkModel_virtualbase_insertRows(void* self, int row, int count, QModelIndex* parent);
bool QPdfBookmarkModel_override_virtual_insertColumns(void* self, intptr_t slot);
bool QPdfBookmarkModel_virtualbase_insertColumns(void* self, int column, int count, QModelIndex* parent);
bool QPdfBookmarkModel_override_virtual_removeRows(void* self, intptr_t slot);
bool QPdfBookmarkModel_virtualbase_removeRows(void* self, int row, int count, QModelIndex* parent);
bool QPdfBookmarkModel_override_virtual_removeColumns(void* self, intptr_t slot);
bool QPdfBookmarkModel_virtualbase_removeColumns(void* self, int column, int count, QModelIndex* parent);
bool QPdfBookmarkModel_override_virtual_moveRows(void* self, intptr_t slot);
bool QPdfBookmarkModel_virtualbase_moveRows(void* self, QModelIndex* sourceParent, int sourceRow, int count, QModelIndex* destinationParent, int destinationChild);
bool QPdfBookmarkModel_override_virtual_moveColumns(void* self, intptr_t slot);
bool QPdfBookmarkModel_virtualbase_moveColumns(void* self, QModelIndex* sourceParent, int sourceColumn, int count, QModelIndex* destinationParent, int destinationChild);
bool QPdfBookmarkModel_override_virtual_fetchMore(void* self, intptr_t slot);
void QPdfBookmarkModel_virtualbase_fetchMore(void* self, QModelIndex* parent);
bool QPdfBookmarkModel_override_virtual_canFetchMore(void* self, intptr_t slot);
bool QPdfBookmarkModel_virtualbase_canFetchMore(const void* self, QModelIndex* parent);
bool QPdfBookmarkModel_override_virtual_flags(void* self, intptr_t slot);
int QPdfBookmarkModel_virtualbase_flags(const void* self, QModelIndex* index);
bool QPdfBookmarkModel_override_virtual_sort(void* self, intptr_t slot);
void QPdfBookmarkModel_virtualbase_sort(void* self, int column, int order);
bool QPdfBookmarkModel_override_virtual_buddy(void* self, intptr_t slot);
QModelIndex* QPdfBookmarkModel_virtualbase_buddy(const void* self, QModelIndex* index);
bool QPdfBookmarkModel_override_virtual_match(void* self, intptr_t slot);
struct miqt_array /* of QModelIndex* */ QPdfBookmarkModel_virtualbase_match(const void* self, QModelIndex* start, int role, QVariant* value, int hits, int flags);
bool QPdfBookmarkModel_override_virtual_span(void* self, intptr_t slot);
QSize* QPdfBookmarkModel_virtualbase_span(const void* self, QModelIndex* index);
bool QPdfBookmarkModel_override_virtual_multiData(void* self, intptr_t slot);
void QPdfBookmarkModel_virtualbase_multiData(const void* self, QModelIndex* index, QModelRoleDataSpan* roleDataSpan);
bool QPdfBookmarkModel_override_virtual_submit(void* self, intptr_t slot);
bool QPdfBookmarkModel_virtualbase_submit(void* self);
bool QPdfBookmarkModel_override_virtual_revert(void* self, intptr_t slot);
void QPdfBookmarkModel_virtualbase_revert(void* self);
bool QPdfBookmarkModel_override_virtual_resetInternalData(void* self, intptr_t slot);
void QPdfBookmarkModel_virtualbase_resetInternalData(void* self);
bool QPdfBookmarkModel_override_virtual_event(void* self, intptr_t slot);
bool QPdfBookmarkModel_virtualbase_event(void* self, QEvent* event);
bool QPdfBookmarkModel_override_virtual_eventFilter(void* self, intptr_t slot);
bool QPdfBookmarkModel_virtualbase_eventFilter(void* self, QObject* watched, QEvent* event);
bool QPdfBookmarkModel_override_virtual_timerEvent(void* self, intptr_t slot);
void QPdfBookmarkModel_virtualbase_timerEvent(void* self, QTimerEvent* event);
bool QPdfBookmarkModel_override_virtual_childEvent(void* self, intptr_t slot);
void QPdfBookmarkModel_virtualbase_childEvent(void* self, QChildEvent* event);
bool QPdfBookmarkModel_override_virtual_customEvent(void* self, intptr_t slot);
void QPdfBookmarkModel_virtualbase_customEvent(void* self, QEvent* event);
bool QPdfBookmarkModel_override_virtual_connectNotify(void* self, intptr_t slot);
void QPdfBookmarkModel_virtualbase_connectNotify(void* self, QMetaMethod* signal);
bool QPdfBookmarkModel_override_virtual_disconnectNotify(void* self, intptr_t slot);
void QPdfBookmarkModel_virtualbase_disconnectNotify(void* self, QMetaMethod* signal);
QModelIndex* QPdfBookmarkModel_protectedbase_createIndex(bool* _dynamic_cast_ok, const void* self, int row, int column);
void QPdfBookmarkModel_protectedbase_encodeData(bool* _dynamic_cast_ok, const void* self, struct miqt_array /* of QModelIndex* */ indexes, QDataStream* stream);
bool QPdfBookmarkModel_protectedbase_decodeData(bool* _dynamic_cast_ok, void* self, int row, int column, QModelIndex* parent, QDataStream* stream);
void QPdfBookmarkModel_protectedbase_beginInsertRows(bool* _dynamic_cast_ok, void* self, QModelIndex* parent, int first, int last);
void QPdfBookmarkModel_protectedbase_endInsertRows(bool* _dynamic_cast_ok, void* self);
void QPdfBookmarkModel_protectedbase_beginRemoveRows(bool* _dynamic_cast_ok, void* self, QModelIndex* parent, int first, int last);
void QPdfBookmarkModel_protectedbase_endRemoveRows(bool* _dynamic_cast_ok, void* self);
bool QPdfBookmarkModel_protectedbase_beginMoveRows(bool* _dynamic_cast_ok, void* self, QModelIndex* sourceParent, int sourceFirst, int sourceLast, QModelIndex* destinationParent, int destinationRow);
void QPdfBookmarkModel_protectedbase_endMoveRows(bool* _dynamic_cast_ok, void* self);
void QPdfBookmarkModel_protectedbase_beginInsertColumns(bool* _dynamic_cast_ok, void* self, QModelIndex* parent, int first, int last);
void QPdfBookmarkModel_protectedbase_endInsertColumns(bool* _dynamic_cast_ok, void* self);
void QPdfBookmarkModel_protectedbase_beginRemoveColumns(bool* _dynamic_cast_ok, void* self, QModelIndex* parent, int first, int last);
void QPdfBookmarkModel_protectedbase_endRemoveColumns(bool* _dynamic_cast_ok, void* self);
bool QPdfBookmarkModel_protectedbase_beginMoveColumns(bool* _dynamic_cast_ok, void* self, QModelIndex* sourceParent, int sourceFirst, int sourceLast, QModelIndex* destinationParent, int destinationColumn);
void QPdfBookmarkModel_protectedbase_endMoveColumns(bool* _dynamic_cast_ok, void* self);
void QPdfBookmarkModel_protectedbase_beginResetModel(bool* _dynamic_cast_ok, void* self);
void QPdfBookmarkModel_protectedbase_endResetModel(bool* _dynamic_cast_ok, void* self);
void QPdfBookmarkModel_protectedbase_changePersistentIndex(bool* _dynamic_cast_ok, void* self, QModelIndex* from, QModelIndex* to);
void QPdfBookmarkModel_protectedbase_changePersistentIndexList(bool* _dynamic_cast_ok, void* self, struct miqt_array /* of QModelIndex* */ from, struct miqt_array /* of QModelIndex* */ to);
struct miqt_array /* of QModelIndex* */ QPdfBookmarkModel_protectedbase_persistentIndexList(bool* _dynamic_cast_ok, const void* self);
QObject* QPdfBookmarkModel_protectedbase_sender(bool* _dynamic_cast_ok, const void* self);
int QPdfBookmarkModel_protectedbase_senderSignalIndex(bool* _dynamic_cast_ok, const void* self);
int QPdfBookmarkModel_protectedbase_receivers(bool* _dynamic_cast_ok, const void* self, const char* signal);
bool QPdfBookmarkModel_protectedbase_isSignalConnected(bool* _dynamic_cast_ok, const void* self, QMetaMethod* signal);
void QPdfBookmarkModel_delete(QPdfBookmarkModel* self);
#ifdef __cplusplus
} /* extern C */
#endif
#endif

View File

@ -0,0 +1,554 @@
#include <QAbstractListModel>
#include <QChildEvent>
#include <QEvent>
#include <QIODevice>
#include <QImage>
#include <QMetaMethod>
#include <QMetaObject>
#include <QObject>
#include <QPdfDocument>
#include <QPdfDocumentRenderOptions>
#include <QPdfSelection>
#include <QPointF>
#include <QSize>
#include <QSizeF>
#include <QString>
#include <QByteArray>
#include <cstring>
#include <QTimerEvent>
#include <QVariant>
#include <qpdfdocument.h>
#include "gen_qpdfdocument.h"
#ifdef __cplusplus
extern "C" {
#endif
void miqt_exec_callback_QPdfDocument_passwordChanged(intptr_t);
void miqt_exec_callback_QPdfDocument_passwordRequired(intptr_t);
void miqt_exec_callback_QPdfDocument_statusChanged(intptr_t, int);
void miqt_exec_callback_QPdfDocument_pageCountChanged(intptr_t, int);
void miqt_exec_callback_QPdfDocument_pageModelChanged(intptr_t);
bool miqt_exec_callback_QPdfDocument_event(QPdfDocument*, intptr_t, QEvent*);
bool miqt_exec_callback_QPdfDocument_eventFilter(QPdfDocument*, intptr_t, QObject*, QEvent*);
void miqt_exec_callback_QPdfDocument_timerEvent(QPdfDocument*, intptr_t, QTimerEvent*);
void miqt_exec_callback_QPdfDocument_childEvent(QPdfDocument*, intptr_t, QChildEvent*);
void miqt_exec_callback_QPdfDocument_customEvent(QPdfDocument*, intptr_t, QEvent*);
void miqt_exec_callback_QPdfDocument_connectNotify(QPdfDocument*, intptr_t, QMetaMethod*);
void miqt_exec_callback_QPdfDocument_disconnectNotify(QPdfDocument*, intptr_t, QMetaMethod*);
#ifdef __cplusplus
} /* extern C */
#endif
class MiqtVirtualQPdfDocument final : public QPdfDocument {
public:
MiqtVirtualQPdfDocument(): QPdfDocument() {};
MiqtVirtualQPdfDocument(QObject* parent): QPdfDocument(parent) {};
virtual ~MiqtVirtualQPdfDocument() override = default;
// cgo.Handle value for overwritten implementation
intptr_t handle__event = 0;
// Subclass to allow providing a Go implementation
virtual bool event(QEvent* event) override {
if (handle__event == 0) {
return QPdfDocument::event(event);
}
QEvent* sigval1 = event;
bool callback_return_value = miqt_exec_callback_QPdfDocument_event(this, handle__event, sigval1);
return callback_return_value;
}
friend bool QPdfDocument_virtualbase_event(void* self, QEvent* event);
// cgo.Handle value for overwritten implementation
intptr_t handle__eventFilter = 0;
// Subclass to allow providing a Go implementation
virtual bool eventFilter(QObject* watched, QEvent* event) override {
if (handle__eventFilter == 0) {
return QPdfDocument::eventFilter(watched, event);
}
QObject* sigval1 = watched;
QEvent* sigval2 = event;
bool callback_return_value = miqt_exec_callback_QPdfDocument_eventFilter(this, handle__eventFilter, sigval1, sigval2);
return callback_return_value;
}
friend bool QPdfDocument_virtualbase_eventFilter(void* self, QObject* watched, QEvent* event);
// cgo.Handle value for overwritten implementation
intptr_t handle__timerEvent = 0;
// Subclass to allow providing a Go implementation
virtual void timerEvent(QTimerEvent* event) override {
if (handle__timerEvent == 0) {
QPdfDocument::timerEvent(event);
return;
}
QTimerEvent* sigval1 = event;
miqt_exec_callback_QPdfDocument_timerEvent(this, handle__timerEvent, sigval1);
}
friend void QPdfDocument_virtualbase_timerEvent(void* self, QTimerEvent* event);
// cgo.Handle value for overwritten implementation
intptr_t handle__childEvent = 0;
// Subclass to allow providing a Go implementation
virtual void childEvent(QChildEvent* event) override {
if (handle__childEvent == 0) {
QPdfDocument::childEvent(event);
return;
}
QChildEvent* sigval1 = event;
miqt_exec_callback_QPdfDocument_childEvent(this, handle__childEvent, sigval1);
}
friend void QPdfDocument_virtualbase_childEvent(void* self, QChildEvent* event);
// cgo.Handle value for overwritten implementation
intptr_t handle__customEvent = 0;
// Subclass to allow providing a Go implementation
virtual void customEvent(QEvent* event) override {
if (handle__customEvent == 0) {
QPdfDocument::customEvent(event);
return;
}
QEvent* sigval1 = event;
miqt_exec_callback_QPdfDocument_customEvent(this, handle__customEvent, sigval1);
}
friend void QPdfDocument_virtualbase_customEvent(void* self, QEvent* event);
// cgo.Handle value for overwritten implementation
intptr_t handle__connectNotify = 0;
// Subclass to allow providing a Go implementation
virtual void connectNotify(const QMetaMethod& signal) override {
if (handle__connectNotify == 0) {
QPdfDocument::connectNotify(signal);
return;
}
const QMetaMethod& signal_ret = signal;
// Cast returned reference into pointer
QMetaMethod* sigval1 = const_cast<QMetaMethod*>(&signal_ret);
miqt_exec_callback_QPdfDocument_connectNotify(this, handle__connectNotify, sigval1);
}
friend void QPdfDocument_virtualbase_connectNotify(void* self, QMetaMethod* signal);
// cgo.Handle value for overwritten implementation
intptr_t handle__disconnectNotify = 0;
// Subclass to allow providing a Go implementation
virtual void disconnectNotify(const QMetaMethod& signal) override {
if (handle__disconnectNotify == 0) {
QPdfDocument::disconnectNotify(signal);
return;
}
const QMetaMethod& signal_ret = signal;
// Cast returned reference into pointer
QMetaMethod* sigval1 = const_cast<QMetaMethod*>(&signal_ret);
miqt_exec_callback_QPdfDocument_disconnectNotify(this, handle__disconnectNotify, sigval1);
}
friend void QPdfDocument_virtualbase_disconnectNotify(void* self, QMetaMethod* signal);
// Wrappers to allow calling protected methods:
friend QObject* QPdfDocument_protectedbase_sender(bool* _dynamic_cast_ok, const void* self);
friend int QPdfDocument_protectedbase_senderSignalIndex(bool* _dynamic_cast_ok, const void* self);
friend int QPdfDocument_protectedbase_receivers(bool* _dynamic_cast_ok, const void* self, const char* signal);
friend bool QPdfDocument_protectedbase_isSignalConnected(bool* _dynamic_cast_ok, const void* self, QMetaMethod* signal);
};
QPdfDocument* QPdfDocument_new() {
return new MiqtVirtualQPdfDocument();
}
QPdfDocument* QPdfDocument_new2(QObject* parent) {
return new MiqtVirtualQPdfDocument(parent);
}
void QPdfDocument_virtbase(QPdfDocument* src, QObject** outptr_QObject) {
*outptr_QObject = static_cast<QObject*>(src);
}
QMetaObject* QPdfDocument_metaObject(const QPdfDocument* self) {
return (QMetaObject*) self->metaObject();
}
void* QPdfDocument_metacast(QPdfDocument* self, const char* param1) {
return self->qt_metacast(param1);
}
struct miqt_string QPdfDocument_tr(const char* s) {
QString _ret = QPdfDocument::tr(s);
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
struct miqt_string _ms;
_ms.len = _b.length();
_ms.data = static_cast<char*>(malloc(_ms.len));
memcpy(_ms.data, _b.data(), _ms.len);
return _ms;
}
int QPdfDocument_load(QPdfDocument* self, struct miqt_string fileName) {
QString fileName_QString = QString::fromUtf8(fileName.data, fileName.len);
QPdfDocument::Error _ret = self->load(fileName_QString);
return static_cast<int>(_ret);
}
int QPdfDocument_status(const QPdfDocument* self) {
QPdfDocument::Status _ret = self->status();
return static_cast<int>(_ret);
}
void QPdfDocument_loadWithDevice(QPdfDocument* self, QIODevice* device) {
self->load(device);
}
void QPdfDocument_setPassword(QPdfDocument* self, struct miqt_string password) {
QString password_QString = QString::fromUtf8(password.data, password.len);
self->setPassword(password_QString);
}
struct miqt_string QPdfDocument_password(const QPdfDocument* self) {
QString _ret = self->password();
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
struct miqt_string _ms;
_ms.len = _b.length();
_ms.data = static_cast<char*>(malloc(_ms.len));
memcpy(_ms.data, _b.data(), _ms.len);
return _ms;
}
QVariant* QPdfDocument_metaData(const QPdfDocument* self, int field) {
return new QVariant(self->metaData(static_cast<QPdfDocument::MetaDataField>(field)));
}
int QPdfDocument_error(const QPdfDocument* self) {
QPdfDocument::Error _ret = self->error();
return static_cast<int>(_ret);
}
void QPdfDocument_close(QPdfDocument* self) {
self->close();
}
int QPdfDocument_pageCount(const QPdfDocument* self) {
return self->pageCount();
}
QSizeF* QPdfDocument_pagePointSize(const QPdfDocument* self, int page) {
return new QSizeF(self->pagePointSize(static_cast<int>(page)));
}
struct miqt_string QPdfDocument_pageLabel(QPdfDocument* self, int page) {
QString _ret = self->pageLabel(static_cast<int>(page));
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
struct miqt_string _ms;
_ms.len = _b.length();
_ms.data = static_cast<char*>(malloc(_ms.len));
memcpy(_ms.data, _b.data(), _ms.len);
return _ms;
}
QAbstractListModel* QPdfDocument_pageModel(QPdfDocument* self) {
return self->pageModel();
}
QImage* QPdfDocument_render(QPdfDocument* self, int page, QSize* imageSize) {
return new QImage(self->render(static_cast<int>(page), *imageSize));
}
QPdfSelection* QPdfDocument_getSelection(QPdfDocument* self, int page, QPointF* start, QPointF* end) {
return new QPdfSelection(self->getSelection(static_cast<int>(page), *start, *end));
}
QPdfSelection* QPdfDocument_getSelectionAtIndex(QPdfDocument* self, int page, int startIndex, int maxLength) {
return new QPdfSelection(self->getSelectionAtIndex(static_cast<int>(page), static_cast<int>(startIndex), static_cast<int>(maxLength)));
}
QPdfSelection* QPdfDocument_getAllText(QPdfDocument* self, int page) {
return new QPdfSelection(self->getAllText(static_cast<int>(page)));
}
void QPdfDocument_passwordChanged(QPdfDocument* self) {
self->passwordChanged();
}
void QPdfDocument_connect_passwordChanged(QPdfDocument* self, intptr_t slot) {
MiqtVirtualQPdfDocument::connect(self, static_cast<void (QPdfDocument::*)()>(&QPdfDocument::passwordChanged), self, [=]() {
miqt_exec_callback_QPdfDocument_passwordChanged(slot);
});
}
void QPdfDocument_passwordRequired(QPdfDocument* self) {
self->passwordRequired();
}
void QPdfDocument_connect_passwordRequired(QPdfDocument* self, intptr_t slot) {
MiqtVirtualQPdfDocument::connect(self, static_cast<void (QPdfDocument::*)()>(&QPdfDocument::passwordRequired), self, [=]() {
miqt_exec_callback_QPdfDocument_passwordRequired(slot);
});
}
void QPdfDocument_statusChanged(QPdfDocument* self, int status) {
self->statusChanged(static_cast<QPdfDocument::Status>(status));
}
void QPdfDocument_connect_statusChanged(QPdfDocument* self, intptr_t slot) {
MiqtVirtualQPdfDocument::connect(self, static_cast<void (QPdfDocument::*)(QPdfDocument::Status)>(&QPdfDocument::statusChanged), self, [=](QPdfDocument::Status status) {
QPdfDocument::Status status_ret = status;
int sigval1 = static_cast<int>(status_ret);
miqt_exec_callback_QPdfDocument_statusChanged(slot, sigval1);
});
}
void QPdfDocument_pageCountChanged(QPdfDocument* self, int pageCount) {
self->pageCountChanged(static_cast<int>(pageCount));
}
void QPdfDocument_connect_pageCountChanged(QPdfDocument* self, intptr_t slot) {
MiqtVirtualQPdfDocument::connect(self, static_cast<void (QPdfDocument::*)(int)>(&QPdfDocument::pageCountChanged), self, [=](int pageCount) {
int sigval1 = pageCount;
miqt_exec_callback_QPdfDocument_pageCountChanged(slot, sigval1);
});
}
void QPdfDocument_pageModelChanged(QPdfDocument* self) {
self->pageModelChanged();
}
void QPdfDocument_connect_pageModelChanged(QPdfDocument* self, intptr_t slot) {
MiqtVirtualQPdfDocument::connect(self, static_cast<void (QPdfDocument::*)()>(&QPdfDocument::pageModelChanged), self, [=]() {
miqt_exec_callback_QPdfDocument_pageModelChanged(slot);
});
}
struct miqt_string QPdfDocument_tr2(const char* s, const char* c) {
QString _ret = QPdfDocument::tr(s, c);
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
struct miqt_string _ms;
_ms.len = _b.length();
_ms.data = static_cast<char*>(malloc(_ms.len));
memcpy(_ms.data, _b.data(), _ms.len);
return _ms;
}
struct miqt_string QPdfDocument_tr3(const char* s, const char* c, int n) {
QString _ret = QPdfDocument::tr(s, c, static_cast<int>(n));
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
struct miqt_string _ms;
_ms.len = _b.length();
_ms.data = static_cast<char*>(malloc(_ms.len));
memcpy(_ms.data, _b.data(), _ms.len);
return _ms;
}
QImage* QPdfDocument_render2(QPdfDocument* self, int page, QSize* imageSize, QPdfDocumentRenderOptions* options) {
return new QImage(self->render(static_cast<int>(page), *imageSize, *options));
}
bool QPdfDocument_override_virtual_event(void* self, intptr_t slot) {
MiqtVirtualQPdfDocument* self_cast = dynamic_cast<MiqtVirtualQPdfDocument*>( (QPdfDocument*)(self) );
if (self_cast == nullptr) {
return false;
}
self_cast->handle__event = slot;
return true;
}
bool QPdfDocument_virtualbase_event(void* self, QEvent* event) {
return ( (MiqtVirtualQPdfDocument*)(self) )->QPdfDocument::event(event);
}
bool QPdfDocument_override_virtual_eventFilter(void* self, intptr_t slot) {
MiqtVirtualQPdfDocument* self_cast = dynamic_cast<MiqtVirtualQPdfDocument*>( (QPdfDocument*)(self) );
if (self_cast == nullptr) {
return false;
}
self_cast->handle__eventFilter = slot;
return true;
}
bool QPdfDocument_virtualbase_eventFilter(void* self, QObject* watched, QEvent* event) {
return ( (MiqtVirtualQPdfDocument*)(self) )->QPdfDocument::eventFilter(watched, event);
}
bool QPdfDocument_override_virtual_timerEvent(void* self, intptr_t slot) {
MiqtVirtualQPdfDocument* self_cast = dynamic_cast<MiqtVirtualQPdfDocument*>( (QPdfDocument*)(self) );
if (self_cast == nullptr) {
return false;
}
self_cast->handle__timerEvent = slot;
return true;
}
void QPdfDocument_virtualbase_timerEvent(void* self, QTimerEvent* event) {
( (MiqtVirtualQPdfDocument*)(self) )->QPdfDocument::timerEvent(event);
}
bool QPdfDocument_override_virtual_childEvent(void* self, intptr_t slot) {
MiqtVirtualQPdfDocument* self_cast = dynamic_cast<MiqtVirtualQPdfDocument*>( (QPdfDocument*)(self) );
if (self_cast == nullptr) {
return false;
}
self_cast->handle__childEvent = slot;
return true;
}
void QPdfDocument_virtualbase_childEvent(void* self, QChildEvent* event) {
( (MiqtVirtualQPdfDocument*)(self) )->QPdfDocument::childEvent(event);
}
bool QPdfDocument_override_virtual_customEvent(void* self, intptr_t slot) {
MiqtVirtualQPdfDocument* self_cast = dynamic_cast<MiqtVirtualQPdfDocument*>( (QPdfDocument*)(self) );
if (self_cast == nullptr) {
return false;
}
self_cast->handle__customEvent = slot;
return true;
}
void QPdfDocument_virtualbase_customEvent(void* self, QEvent* event) {
( (MiqtVirtualQPdfDocument*)(self) )->QPdfDocument::customEvent(event);
}
bool QPdfDocument_override_virtual_connectNotify(void* self, intptr_t slot) {
MiqtVirtualQPdfDocument* self_cast = dynamic_cast<MiqtVirtualQPdfDocument*>( (QPdfDocument*)(self) );
if (self_cast == nullptr) {
return false;
}
self_cast->handle__connectNotify = slot;
return true;
}
void QPdfDocument_virtualbase_connectNotify(void* self, QMetaMethod* signal) {
( (MiqtVirtualQPdfDocument*)(self) )->QPdfDocument::connectNotify(*signal);
}
bool QPdfDocument_override_virtual_disconnectNotify(void* self, intptr_t slot) {
MiqtVirtualQPdfDocument* self_cast = dynamic_cast<MiqtVirtualQPdfDocument*>( (QPdfDocument*)(self) );
if (self_cast == nullptr) {
return false;
}
self_cast->handle__disconnectNotify = slot;
return true;
}
void QPdfDocument_virtualbase_disconnectNotify(void* self, QMetaMethod* signal) {
( (MiqtVirtualQPdfDocument*)(self) )->QPdfDocument::disconnectNotify(*signal);
}
QObject* QPdfDocument_protectedbase_sender(bool* _dynamic_cast_ok, const void* self) {
MiqtVirtualQPdfDocument* self_cast = dynamic_cast<MiqtVirtualQPdfDocument*>( (QPdfDocument*)(self) );
if (self_cast == nullptr) {
*_dynamic_cast_ok = false;
return nullptr;
}
*_dynamic_cast_ok = true;
return self_cast->sender();
}
int QPdfDocument_protectedbase_senderSignalIndex(bool* _dynamic_cast_ok, const void* self) {
MiqtVirtualQPdfDocument* self_cast = dynamic_cast<MiqtVirtualQPdfDocument*>( (QPdfDocument*)(self) );
if (self_cast == nullptr) {
*_dynamic_cast_ok = false;
return 0;
}
*_dynamic_cast_ok = true;
return self_cast->senderSignalIndex();
}
int QPdfDocument_protectedbase_receivers(bool* _dynamic_cast_ok, const void* self, const char* signal) {
MiqtVirtualQPdfDocument* self_cast = dynamic_cast<MiqtVirtualQPdfDocument*>( (QPdfDocument*)(self) );
if (self_cast == nullptr) {
*_dynamic_cast_ok = false;
return 0;
}
*_dynamic_cast_ok = true;
return self_cast->receivers(signal);
}
bool QPdfDocument_protectedbase_isSignalConnected(bool* _dynamic_cast_ok, const void* self, QMetaMethod* signal) {
MiqtVirtualQPdfDocument* self_cast = dynamic_cast<MiqtVirtualQPdfDocument*>( (QPdfDocument*)(self) );
if (self_cast == nullptr) {
*_dynamic_cast_ok = false;
return false;
}
*_dynamic_cast_ok = true;
return self_cast->isSignalConnected(*signal);
}
void QPdfDocument_delete(QPdfDocument* self) {
delete self;
}

595
qt6/pdf/gen_qpdfdocument.go Normal file
View File

@ -0,0 +1,595 @@
package pdf
/*
#include "gen_qpdfdocument.h"
#include <stdlib.h>
*/
import "C"
import (
"github.com/mappu/miqt/qt6"
"runtime"
"runtime/cgo"
"unsafe"
)
type QPdfDocument__Status int
const (
QPdfDocument__Status__Null QPdfDocument__Status = 0
QPdfDocument__Status__Loading QPdfDocument__Status = 1
QPdfDocument__Status__Ready QPdfDocument__Status = 2
QPdfDocument__Status__Unloading QPdfDocument__Status = 3
QPdfDocument__Status__Error QPdfDocument__Status = 4
)
type QPdfDocument__Error int
const (
QPdfDocument__None QPdfDocument__Error = 0
QPdfDocument__Unknown QPdfDocument__Error = 1
QPdfDocument__DataNotYetAvailable QPdfDocument__Error = 2
QPdfDocument__FileNotFound QPdfDocument__Error = 3
QPdfDocument__InvalidFileFormat QPdfDocument__Error = 4
QPdfDocument__IncorrectPassword QPdfDocument__Error = 5
QPdfDocument__UnsupportedSecurityScheme QPdfDocument__Error = 6
)
type QPdfDocument__MetaDataField int
const (
QPdfDocument__Title QPdfDocument__MetaDataField = 0
QPdfDocument__Subject QPdfDocument__MetaDataField = 1
QPdfDocument__Author QPdfDocument__MetaDataField = 2
QPdfDocument__Keywords QPdfDocument__MetaDataField = 3
QPdfDocument__Producer QPdfDocument__MetaDataField = 4
QPdfDocument__Creator QPdfDocument__MetaDataField = 5
QPdfDocument__CreationDate QPdfDocument__MetaDataField = 6
QPdfDocument__ModificationDate QPdfDocument__MetaDataField = 7
)
type QPdfDocument__PageModelRole int
const (
QPdfDocument__Label QPdfDocument__PageModelRole = 256
QPdfDocument__PointSize QPdfDocument__PageModelRole = 257
QPdfDocument__NRoles QPdfDocument__PageModelRole = 258
)
type QPdfDocument struct {
h *C.QPdfDocument
*qt6.QObject
}
func (this *QPdfDocument) cPointer() *C.QPdfDocument {
if this == nil {
return nil
}
return this.h
}
func (this *QPdfDocument) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
// newQPdfDocument constructs the type using only CGO pointers.
func newQPdfDocument(h *C.QPdfDocument) *QPdfDocument {
if h == nil {
return nil
}
var outptr_QObject *C.QObject = nil
C.QPdfDocument_virtbase(h, &outptr_QObject)
return &QPdfDocument{h: h,
QObject: qt6.UnsafeNewQObject(unsafe.Pointer(outptr_QObject))}
}
// UnsafeNewQPdfDocument constructs the type using only unsafe pointers.
func UnsafeNewQPdfDocument(h unsafe.Pointer) *QPdfDocument {
return newQPdfDocument((*C.QPdfDocument)(h))
}
// NewQPdfDocument constructs a new QPdfDocument object.
func NewQPdfDocument() *QPdfDocument {
return newQPdfDocument(C.QPdfDocument_new())
}
// NewQPdfDocument2 constructs a new QPdfDocument object.
func NewQPdfDocument2(parent *qt6.QObject) *QPdfDocument {
return newQPdfDocument(C.QPdfDocument_new2((*C.QObject)(parent.UnsafePointer())))
}
func (this *QPdfDocument) MetaObject() *qt6.QMetaObject {
return qt6.UnsafeNewQMetaObject(unsafe.Pointer(C.QPdfDocument_metaObject(this.h)))
}
func (this *QPdfDocument) Metacast(param1 string) unsafe.Pointer {
param1_Cstring := C.CString(param1)
defer C.free(unsafe.Pointer(param1_Cstring))
return (unsafe.Pointer)(C.QPdfDocument_metacast(this.h, param1_Cstring))
}
func QPdfDocument_Tr(s string) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
var _ms C.struct_miqt_string = C.QPdfDocument_tr(s_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func (this *QPdfDocument) Load(fileName string) QPdfDocument__Error {
fileName_ms := C.struct_miqt_string{}
fileName_ms.data = C.CString(fileName)
fileName_ms.len = C.size_t(len(fileName))
defer C.free(unsafe.Pointer(fileName_ms.data))
return (QPdfDocument__Error)(C.QPdfDocument_load(this.h, fileName_ms))
}
func (this *QPdfDocument) Status() QPdfDocument__Status {
return (QPdfDocument__Status)(C.QPdfDocument_status(this.h))
}
func (this *QPdfDocument) LoadWithDevice(device *qt6.QIODevice) {
C.QPdfDocument_loadWithDevice(this.h, (*C.QIODevice)(device.UnsafePointer()))
}
func (this *QPdfDocument) SetPassword(password string) {
password_ms := C.struct_miqt_string{}
password_ms.data = C.CString(password)
password_ms.len = C.size_t(len(password))
defer C.free(unsafe.Pointer(password_ms.data))
C.QPdfDocument_setPassword(this.h, password_ms)
}
func (this *QPdfDocument) Password() string {
var _ms C.struct_miqt_string = C.QPdfDocument_password(this.h)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func (this *QPdfDocument) MetaData(field QPdfDocument__MetaDataField) *qt6.QVariant {
_goptr := qt6.UnsafeNewQVariant(unsafe.Pointer(C.QPdfDocument_metaData(this.h, (C.int)(field))))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QPdfDocument) Error() QPdfDocument__Error {
return (QPdfDocument__Error)(C.QPdfDocument_error(this.h))
}
func (this *QPdfDocument) Close() {
C.QPdfDocument_close(this.h)
}
func (this *QPdfDocument) PageCount() int {
return (int)(C.QPdfDocument_pageCount(this.h))
}
func (this *QPdfDocument) PagePointSize(page int) *qt6.QSizeF {
_goptr := qt6.UnsafeNewQSizeF(unsafe.Pointer(C.QPdfDocument_pagePointSize(this.h, (C.int)(page))))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QPdfDocument) PageLabel(page int) string {
var _ms C.struct_miqt_string = C.QPdfDocument_pageLabel(this.h, (C.int)(page))
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func (this *QPdfDocument) PageModel() *qt6.QAbstractListModel {
return qt6.UnsafeNewQAbstractListModel(unsafe.Pointer(C.QPdfDocument_pageModel(this.h)))
}
func (this *QPdfDocument) Render(page int, imageSize qt6.QSize) *qt6.QImage {
_goptr := qt6.UnsafeNewQImage(unsafe.Pointer(C.QPdfDocument_render(this.h, (C.int)(page), (*C.QSize)(imageSize.UnsafePointer()))))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QPdfDocument) GetSelection(page int, start qt6.QPointF, end qt6.QPointF) *QPdfSelection {
_goptr := newQPdfSelection(C.QPdfDocument_getSelection(this.h, (C.int)(page), (*C.QPointF)(start.UnsafePointer()), (*C.QPointF)(end.UnsafePointer())))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QPdfDocument) GetSelectionAtIndex(page int, startIndex int, maxLength int) *QPdfSelection {
_goptr := newQPdfSelection(C.QPdfDocument_getSelectionAtIndex(this.h, (C.int)(page), (C.int)(startIndex), (C.int)(maxLength)))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QPdfDocument) GetAllText(page int) *QPdfSelection {
_goptr := newQPdfSelection(C.QPdfDocument_getAllText(this.h, (C.int)(page)))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QPdfDocument) PasswordChanged() {
C.QPdfDocument_passwordChanged(this.h)
}
func (this *QPdfDocument) OnPasswordChanged(slot func()) {
C.QPdfDocument_connect_passwordChanged(this.h, C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QPdfDocument_passwordChanged
func miqt_exec_callback_QPdfDocument_passwordChanged(cb C.intptr_t) {
gofunc, ok := cgo.Handle(cb).Value().(func())
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
gofunc()
}
func (this *QPdfDocument) PasswordRequired() {
C.QPdfDocument_passwordRequired(this.h)
}
func (this *QPdfDocument) OnPasswordRequired(slot func()) {
C.QPdfDocument_connect_passwordRequired(this.h, C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QPdfDocument_passwordRequired
func miqt_exec_callback_QPdfDocument_passwordRequired(cb C.intptr_t) {
gofunc, ok := cgo.Handle(cb).Value().(func())
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
gofunc()
}
func (this *QPdfDocument) StatusChanged(status QPdfDocument__Status) {
C.QPdfDocument_statusChanged(this.h, (C.int)(status))
}
func (this *QPdfDocument) OnStatusChanged(slot func(status QPdfDocument__Status)) {
C.QPdfDocument_connect_statusChanged(this.h, C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QPdfDocument_statusChanged
func miqt_exec_callback_QPdfDocument_statusChanged(cb C.intptr_t, status C.int) {
gofunc, ok := cgo.Handle(cb).Value().(func(status QPdfDocument__Status))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := (QPdfDocument__Status)(status)
gofunc(slotval1)
}
func (this *QPdfDocument) PageCountChanged(pageCount int) {
C.QPdfDocument_pageCountChanged(this.h, (C.int)(pageCount))
}
func (this *QPdfDocument) OnPageCountChanged(slot func(pageCount int)) {
C.QPdfDocument_connect_pageCountChanged(this.h, C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QPdfDocument_pageCountChanged
func miqt_exec_callback_QPdfDocument_pageCountChanged(cb C.intptr_t, pageCount C.int) {
gofunc, ok := cgo.Handle(cb).Value().(func(pageCount int))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := (int)(pageCount)
gofunc(slotval1)
}
func (this *QPdfDocument) PageModelChanged() {
C.QPdfDocument_pageModelChanged(this.h)
}
func (this *QPdfDocument) OnPageModelChanged(slot func()) {
C.QPdfDocument_connect_pageModelChanged(this.h, C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QPdfDocument_pageModelChanged
func miqt_exec_callback_QPdfDocument_pageModelChanged(cb C.intptr_t) {
gofunc, ok := cgo.Handle(cb).Value().(func())
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
gofunc()
}
func QPdfDocument_Tr2(s string, c string) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
c_Cstring := C.CString(c)
defer C.free(unsafe.Pointer(c_Cstring))
var _ms C.struct_miqt_string = C.QPdfDocument_tr2(s_Cstring, c_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func QPdfDocument_Tr3(s string, c string, n int) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
c_Cstring := C.CString(c)
defer C.free(unsafe.Pointer(c_Cstring))
var _ms C.struct_miqt_string = C.QPdfDocument_tr3(s_Cstring, c_Cstring, (C.int)(n))
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func (this *QPdfDocument) Render2(page int, imageSize qt6.QSize, options QPdfDocumentRenderOptions) *qt6.QImage {
_goptr := qt6.UnsafeNewQImage(unsafe.Pointer(C.QPdfDocument_render2(this.h, (C.int)(page), (*C.QSize)(imageSize.UnsafePointer()), options.cPointer())))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
// Sender can only be called from a QPdfDocument that was directly constructed.
func (this *QPdfDocument) Sender() *qt6.QObject {
var _dynamic_cast_ok C.bool = false
_method_ret := qt6.UnsafeNewQObject(unsafe.Pointer(C.QPdfDocument_protectedbase_sender(&_dynamic_cast_ok, unsafe.Pointer(this.h))))
if !_dynamic_cast_ok {
panic("miqt: can only call protected methods for directly constructed types")
}
return _method_ret
}
// SenderSignalIndex can only be called from a QPdfDocument that was directly constructed.
func (this *QPdfDocument) SenderSignalIndex() int {
var _dynamic_cast_ok C.bool = false
_method_ret := (int)(C.QPdfDocument_protectedbase_senderSignalIndex(&_dynamic_cast_ok, unsafe.Pointer(this.h)))
if !_dynamic_cast_ok {
panic("miqt: can only call protected methods for directly constructed types")
}
return _method_ret
}
// Receivers can only be called from a QPdfDocument that was directly constructed.
func (this *QPdfDocument) Receivers(signal string) int {
signal_Cstring := C.CString(signal)
defer C.free(unsafe.Pointer(signal_Cstring))
var _dynamic_cast_ok C.bool = false
_method_ret := (int)(C.QPdfDocument_protectedbase_receivers(&_dynamic_cast_ok, unsafe.Pointer(this.h), signal_Cstring))
if !_dynamic_cast_ok {
panic("miqt: can only call protected methods for directly constructed types")
}
return _method_ret
}
// IsSignalConnected can only be called from a QPdfDocument that was directly constructed.
func (this *QPdfDocument) IsSignalConnected(signal *qt6.QMetaMethod) bool {
var _dynamic_cast_ok C.bool = false
_method_ret := (bool)(C.QPdfDocument_protectedbase_isSignalConnected(&_dynamic_cast_ok, unsafe.Pointer(this.h), (*C.QMetaMethod)(signal.UnsafePointer())))
if !_dynamic_cast_ok {
panic("miqt: can only call protected methods for directly constructed types")
}
return _method_ret
}
func (this *QPdfDocument) callVirtualBase_Event(event *qt6.QEvent) bool {
return (bool)(C.QPdfDocument_virtualbase_event(unsafe.Pointer(this.h), (*C.QEvent)(event.UnsafePointer())))
}
func (this *QPdfDocument) OnEvent(slot func(super func(event *qt6.QEvent) bool, event *qt6.QEvent) bool) {
ok := C.QPdfDocument_override_virtual_event(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
}
}
//export miqt_exec_callback_QPdfDocument_event
func miqt_exec_callback_QPdfDocument_event(self *C.QPdfDocument, cb C.intptr_t, event *C.QEvent) C.bool {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(event *qt6.QEvent) bool, event *qt6.QEvent) bool)
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := qt6.UnsafeNewQEvent(unsafe.Pointer(event))
virtualReturn := gofunc((&QPdfDocument{h: self}).callVirtualBase_Event, slotval1)
return (C.bool)(virtualReturn)
}
func (this *QPdfDocument) callVirtualBase_EventFilter(watched *qt6.QObject, event *qt6.QEvent) bool {
return (bool)(C.QPdfDocument_virtualbase_eventFilter(unsafe.Pointer(this.h), (*C.QObject)(watched.UnsafePointer()), (*C.QEvent)(event.UnsafePointer())))
}
func (this *QPdfDocument) OnEventFilter(slot func(super func(watched *qt6.QObject, event *qt6.QEvent) bool, watched *qt6.QObject, event *qt6.QEvent) bool) {
ok := C.QPdfDocument_override_virtual_eventFilter(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
}
}
//export miqt_exec_callback_QPdfDocument_eventFilter
func miqt_exec_callback_QPdfDocument_eventFilter(self *C.QPdfDocument, cb C.intptr_t, watched *C.QObject, event *C.QEvent) C.bool {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(watched *qt6.QObject, event *qt6.QEvent) bool, watched *qt6.QObject, event *qt6.QEvent) bool)
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := qt6.UnsafeNewQObject(unsafe.Pointer(watched))
slotval2 := qt6.UnsafeNewQEvent(unsafe.Pointer(event))
virtualReturn := gofunc((&QPdfDocument{h: self}).callVirtualBase_EventFilter, slotval1, slotval2)
return (C.bool)(virtualReturn)
}
func (this *QPdfDocument) callVirtualBase_TimerEvent(event *qt6.QTimerEvent) {
C.QPdfDocument_virtualbase_timerEvent(unsafe.Pointer(this.h), (*C.QTimerEvent)(event.UnsafePointer()))
}
func (this *QPdfDocument) OnTimerEvent(slot func(super func(event *qt6.QTimerEvent), event *qt6.QTimerEvent)) {
ok := C.QPdfDocument_override_virtual_timerEvent(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
}
}
//export miqt_exec_callback_QPdfDocument_timerEvent
func miqt_exec_callback_QPdfDocument_timerEvent(self *C.QPdfDocument, cb C.intptr_t, event *C.QTimerEvent) {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(event *qt6.QTimerEvent), event *qt6.QTimerEvent))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := qt6.UnsafeNewQTimerEvent(unsafe.Pointer(event))
gofunc((&QPdfDocument{h: self}).callVirtualBase_TimerEvent, slotval1)
}
func (this *QPdfDocument) callVirtualBase_ChildEvent(event *qt6.QChildEvent) {
C.QPdfDocument_virtualbase_childEvent(unsafe.Pointer(this.h), (*C.QChildEvent)(event.UnsafePointer()))
}
func (this *QPdfDocument) OnChildEvent(slot func(super func(event *qt6.QChildEvent), event *qt6.QChildEvent)) {
ok := C.QPdfDocument_override_virtual_childEvent(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
}
}
//export miqt_exec_callback_QPdfDocument_childEvent
func miqt_exec_callback_QPdfDocument_childEvent(self *C.QPdfDocument, cb C.intptr_t, event *C.QChildEvent) {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(event *qt6.QChildEvent), event *qt6.QChildEvent))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := qt6.UnsafeNewQChildEvent(unsafe.Pointer(event))
gofunc((&QPdfDocument{h: self}).callVirtualBase_ChildEvent, slotval1)
}
func (this *QPdfDocument) callVirtualBase_CustomEvent(event *qt6.QEvent) {
C.QPdfDocument_virtualbase_customEvent(unsafe.Pointer(this.h), (*C.QEvent)(event.UnsafePointer()))
}
func (this *QPdfDocument) OnCustomEvent(slot func(super func(event *qt6.QEvent), event *qt6.QEvent)) {
ok := C.QPdfDocument_override_virtual_customEvent(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
}
}
//export miqt_exec_callback_QPdfDocument_customEvent
func miqt_exec_callback_QPdfDocument_customEvent(self *C.QPdfDocument, cb C.intptr_t, event *C.QEvent) {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(event *qt6.QEvent), event *qt6.QEvent))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := qt6.UnsafeNewQEvent(unsafe.Pointer(event))
gofunc((&QPdfDocument{h: self}).callVirtualBase_CustomEvent, slotval1)
}
func (this *QPdfDocument) callVirtualBase_ConnectNotify(signal *qt6.QMetaMethod) {
C.QPdfDocument_virtualbase_connectNotify(unsafe.Pointer(this.h), (*C.QMetaMethod)(signal.UnsafePointer()))
}
func (this *QPdfDocument) OnConnectNotify(slot func(super func(signal *qt6.QMetaMethod), signal *qt6.QMetaMethod)) {
ok := C.QPdfDocument_override_virtual_connectNotify(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
}
}
//export miqt_exec_callback_QPdfDocument_connectNotify
func miqt_exec_callback_QPdfDocument_connectNotify(self *C.QPdfDocument, cb C.intptr_t, signal *C.QMetaMethod) {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(signal *qt6.QMetaMethod), signal *qt6.QMetaMethod))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := qt6.UnsafeNewQMetaMethod(unsafe.Pointer(signal))
gofunc((&QPdfDocument{h: self}).callVirtualBase_ConnectNotify, slotval1)
}
func (this *QPdfDocument) callVirtualBase_DisconnectNotify(signal *qt6.QMetaMethod) {
C.QPdfDocument_virtualbase_disconnectNotify(unsafe.Pointer(this.h), (*C.QMetaMethod)(signal.UnsafePointer()))
}
func (this *QPdfDocument) OnDisconnectNotify(slot func(super func(signal *qt6.QMetaMethod), signal *qt6.QMetaMethod)) {
ok := C.QPdfDocument_override_virtual_disconnectNotify(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
}
}
//export miqt_exec_callback_QPdfDocument_disconnectNotify
func miqt_exec_callback_QPdfDocument_disconnectNotify(self *C.QPdfDocument, cb C.intptr_t, signal *C.QMetaMethod) {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(signal *qt6.QMetaMethod), signal *qt6.QMetaMethod))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := qt6.UnsafeNewQMetaMethod(unsafe.Pointer(signal))
gofunc((&QPdfDocument{h: self}).callVirtualBase_DisconnectNotify, slotval1)
}
// Delete this object from C++ memory.
func (this *QPdfDocument) Delete() {
C.QPdfDocument_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 *QPdfDocument) GoGC() {
runtime.SetFinalizer(this, func(this *QPdfDocument) {
this.Delete()
runtime.KeepAlive(this.h)
})
}

112
qt6/pdf/gen_qpdfdocument.h Normal file
View File

@ -0,0 +1,112 @@
#pragma once
#ifndef MIQT_QT6_PDF_GEN_QPDFDOCUMENT_H
#define MIQT_QT6_PDF_GEN_QPDFDOCUMENT_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 QAbstractListModel;
class QChildEvent;
class QEvent;
class QIODevice;
class QImage;
class QMetaMethod;
class QMetaObject;
class QObject;
class QPdfDocument;
class QPdfDocumentRenderOptions;
class QPdfSelection;
class QPointF;
class QSize;
class QSizeF;
class QTimerEvent;
class QVariant;
#else
typedef struct QAbstractListModel QAbstractListModel;
typedef struct QChildEvent QChildEvent;
typedef struct QEvent QEvent;
typedef struct QIODevice QIODevice;
typedef struct QImage QImage;
typedef struct QMetaMethod QMetaMethod;
typedef struct QMetaObject QMetaObject;
typedef struct QObject QObject;
typedef struct QPdfDocument QPdfDocument;
typedef struct QPdfDocumentRenderOptions QPdfDocumentRenderOptions;
typedef struct QPdfSelection QPdfSelection;
typedef struct QPointF QPointF;
typedef struct QSize QSize;
typedef struct QSizeF QSizeF;
typedef struct QTimerEvent QTimerEvent;
typedef struct QVariant QVariant;
#endif
QPdfDocument* QPdfDocument_new();
QPdfDocument* QPdfDocument_new2(QObject* parent);
void QPdfDocument_virtbase(QPdfDocument* src, QObject** outptr_QObject);
QMetaObject* QPdfDocument_metaObject(const QPdfDocument* self);
void* QPdfDocument_metacast(QPdfDocument* self, const char* param1);
struct miqt_string QPdfDocument_tr(const char* s);
int QPdfDocument_load(QPdfDocument* self, struct miqt_string fileName);
int QPdfDocument_status(const QPdfDocument* self);
void QPdfDocument_loadWithDevice(QPdfDocument* self, QIODevice* device);
void QPdfDocument_setPassword(QPdfDocument* self, struct miqt_string password);
struct miqt_string QPdfDocument_password(const QPdfDocument* self);
QVariant* QPdfDocument_metaData(const QPdfDocument* self, int field);
int QPdfDocument_error(const QPdfDocument* self);
void QPdfDocument_close(QPdfDocument* self);
int QPdfDocument_pageCount(const QPdfDocument* self);
QSizeF* QPdfDocument_pagePointSize(const QPdfDocument* self, int page);
struct miqt_string QPdfDocument_pageLabel(QPdfDocument* self, int page);
QAbstractListModel* QPdfDocument_pageModel(QPdfDocument* self);
QImage* QPdfDocument_render(QPdfDocument* self, int page, QSize* imageSize);
QPdfSelection* QPdfDocument_getSelection(QPdfDocument* self, int page, QPointF* start, QPointF* end);
QPdfSelection* QPdfDocument_getSelectionAtIndex(QPdfDocument* self, int page, int startIndex, int maxLength);
QPdfSelection* QPdfDocument_getAllText(QPdfDocument* self, int page);
void QPdfDocument_passwordChanged(QPdfDocument* self);
void QPdfDocument_connect_passwordChanged(QPdfDocument* self, intptr_t slot);
void QPdfDocument_passwordRequired(QPdfDocument* self);
void QPdfDocument_connect_passwordRequired(QPdfDocument* self, intptr_t slot);
void QPdfDocument_statusChanged(QPdfDocument* self, int status);
void QPdfDocument_connect_statusChanged(QPdfDocument* self, intptr_t slot);
void QPdfDocument_pageCountChanged(QPdfDocument* self, int pageCount);
void QPdfDocument_connect_pageCountChanged(QPdfDocument* self, intptr_t slot);
void QPdfDocument_pageModelChanged(QPdfDocument* self);
void QPdfDocument_connect_pageModelChanged(QPdfDocument* self, intptr_t slot);
struct miqt_string QPdfDocument_tr2(const char* s, const char* c);
struct miqt_string QPdfDocument_tr3(const char* s, const char* c, int n);
QImage* QPdfDocument_render2(QPdfDocument* self, int page, QSize* imageSize, QPdfDocumentRenderOptions* options);
bool QPdfDocument_override_virtual_event(void* self, intptr_t slot);
bool QPdfDocument_virtualbase_event(void* self, QEvent* event);
bool QPdfDocument_override_virtual_eventFilter(void* self, intptr_t slot);
bool QPdfDocument_virtualbase_eventFilter(void* self, QObject* watched, QEvent* event);
bool QPdfDocument_override_virtual_timerEvent(void* self, intptr_t slot);
void QPdfDocument_virtualbase_timerEvent(void* self, QTimerEvent* event);
bool QPdfDocument_override_virtual_childEvent(void* self, intptr_t slot);
void QPdfDocument_virtualbase_childEvent(void* self, QChildEvent* event);
bool QPdfDocument_override_virtual_customEvent(void* self, intptr_t slot);
void QPdfDocument_virtualbase_customEvent(void* self, QEvent* event);
bool QPdfDocument_override_virtual_connectNotify(void* self, intptr_t slot);
void QPdfDocument_virtualbase_connectNotify(void* self, QMetaMethod* signal);
bool QPdfDocument_override_virtual_disconnectNotify(void* self, intptr_t slot);
void QPdfDocument_virtualbase_disconnectNotify(void* self, QMetaMethod* signal);
QObject* QPdfDocument_protectedbase_sender(bool* _dynamic_cast_ok, const void* self);
int QPdfDocument_protectedbase_senderSignalIndex(bool* _dynamic_cast_ok, const void* self);
int QPdfDocument_protectedbase_receivers(bool* _dynamic_cast_ok, const void* self, const char* signal);
bool QPdfDocument_protectedbase_isSignalConnected(bool* _dynamic_cast_ok, const void* self, QMetaMethod* signal);
void QPdfDocument_delete(QPdfDocument* self);
#ifdef __cplusplus
} /* extern C */
#endif
#endif

View File

@ -0,0 +1,60 @@
#include <QPdfDocumentRenderOptions>
#include <QRect>
#include <QSize>
#include <qpdfdocumentrenderoptions.h>
#include "gen_qpdfdocumentrenderoptions.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
} /* extern C */
#endif
QPdfDocumentRenderOptions* QPdfDocumentRenderOptions_new() {
return new QPdfDocumentRenderOptions();
}
QPdfDocumentRenderOptions* QPdfDocumentRenderOptions_new2(QPdfDocumentRenderOptions* param1) {
return new QPdfDocumentRenderOptions(*param1);
}
int QPdfDocumentRenderOptions_rotation(const QPdfDocumentRenderOptions* self) {
QPdfDocumentRenderOptions::Rotation _ret = self->rotation();
return static_cast<int>(_ret);
}
void QPdfDocumentRenderOptions_setRotation(QPdfDocumentRenderOptions* self, int r) {
self->setRotation(static_cast<QPdfDocumentRenderOptions::Rotation>(r));
}
int QPdfDocumentRenderOptions_renderFlags(const QPdfDocumentRenderOptions* self) {
QPdfDocumentRenderOptions::RenderFlags _ret = self->renderFlags();
return static_cast<int>(_ret);
}
void QPdfDocumentRenderOptions_setRenderFlags(QPdfDocumentRenderOptions* self, int r) {
self->setRenderFlags(static_cast<QPdfDocumentRenderOptions::RenderFlags>(r));
}
QRect* QPdfDocumentRenderOptions_scaledClipRect(const QPdfDocumentRenderOptions* self) {
return new QRect(self->scaledClipRect());
}
void QPdfDocumentRenderOptions_setScaledClipRect(QPdfDocumentRenderOptions* self, QRect* r) {
self->setScaledClipRect(*r);
}
QSize* QPdfDocumentRenderOptions_scaledSize(const QPdfDocumentRenderOptions* self) {
return new QSize(self->scaledSize());
}
void QPdfDocumentRenderOptions_setScaledSize(QPdfDocumentRenderOptions* self, QSize* s) {
self->setScaledSize(*s);
}
void QPdfDocumentRenderOptions_delete(QPdfDocumentRenderOptions* self) {
delete self;
}

View File

@ -0,0 +1,131 @@
package pdf
/*
#include "gen_qpdfdocumentrenderoptions.h"
#include <stdlib.h>
*/
import "C"
import (
"github.com/mappu/miqt/qt6"
"runtime"
"unsafe"
)
type QPdfDocumentRenderOptions__Rotation int
const (
QPdfDocumentRenderOptions__Rotation__None QPdfDocumentRenderOptions__Rotation = 0
QPdfDocumentRenderOptions__Rotation__Clockwise90 QPdfDocumentRenderOptions__Rotation = 1
QPdfDocumentRenderOptions__Rotation__Clockwise180 QPdfDocumentRenderOptions__Rotation = 2
QPdfDocumentRenderOptions__Rotation__Clockwise270 QPdfDocumentRenderOptions__Rotation = 3
)
type QPdfDocumentRenderOptions__RenderFlag int
const (
QPdfDocumentRenderOptions__RenderFlag__None QPdfDocumentRenderOptions__RenderFlag = 0
QPdfDocumentRenderOptions__RenderFlag__Annotations QPdfDocumentRenderOptions__RenderFlag = 1
QPdfDocumentRenderOptions__RenderFlag__OptimizedForLcd QPdfDocumentRenderOptions__RenderFlag = 2
QPdfDocumentRenderOptions__RenderFlag__Grayscale QPdfDocumentRenderOptions__RenderFlag = 4
QPdfDocumentRenderOptions__RenderFlag__ForceHalftone QPdfDocumentRenderOptions__RenderFlag = 8
QPdfDocumentRenderOptions__RenderFlag__TextAliased QPdfDocumentRenderOptions__RenderFlag = 16
QPdfDocumentRenderOptions__RenderFlag__ImageAliased QPdfDocumentRenderOptions__RenderFlag = 32
QPdfDocumentRenderOptions__RenderFlag__PathAliased QPdfDocumentRenderOptions__RenderFlag = 64
)
type QPdfDocumentRenderOptions struct {
h *C.QPdfDocumentRenderOptions
}
func (this *QPdfDocumentRenderOptions) cPointer() *C.QPdfDocumentRenderOptions {
if this == nil {
return nil
}
return this.h
}
func (this *QPdfDocumentRenderOptions) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
// newQPdfDocumentRenderOptions constructs the type using only CGO pointers.
func newQPdfDocumentRenderOptions(h *C.QPdfDocumentRenderOptions) *QPdfDocumentRenderOptions {
if h == nil {
return nil
}
return &QPdfDocumentRenderOptions{h: h}
}
// UnsafeNewQPdfDocumentRenderOptions constructs the type using only unsafe pointers.
func UnsafeNewQPdfDocumentRenderOptions(h unsafe.Pointer) *QPdfDocumentRenderOptions {
return newQPdfDocumentRenderOptions((*C.QPdfDocumentRenderOptions)(h))
}
// NewQPdfDocumentRenderOptions constructs a new QPdfDocumentRenderOptions object.
func NewQPdfDocumentRenderOptions() *QPdfDocumentRenderOptions {
return newQPdfDocumentRenderOptions(C.QPdfDocumentRenderOptions_new())
}
// NewQPdfDocumentRenderOptions2 constructs a new QPdfDocumentRenderOptions object.
func NewQPdfDocumentRenderOptions2(param1 *QPdfDocumentRenderOptions) *QPdfDocumentRenderOptions {
return newQPdfDocumentRenderOptions(C.QPdfDocumentRenderOptions_new2(param1.cPointer()))
}
func (this *QPdfDocumentRenderOptions) Rotation() QPdfDocumentRenderOptions__Rotation {
return (QPdfDocumentRenderOptions__Rotation)(C.QPdfDocumentRenderOptions_rotation(this.h))
}
func (this *QPdfDocumentRenderOptions) SetRotation(r QPdfDocumentRenderOptions__Rotation) {
C.QPdfDocumentRenderOptions_setRotation(this.h, (C.int)(r))
}
func (this *QPdfDocumentRenderOptions) RenderFlags() QPdfDocumentRenderOptions__RenderFlag {
return (QPdfDocumentRenderOptions__RenderFlag)(C.QPdfDocumentRenderOptions_renderFlags(this.h))
}
func (this *QPdfDocumentRenderOptions) SetRenderFlags(r QPdfDocumentRenderOptions__RenderFlag) {
C.QPdfDocumentRenderOptions_setRenderFlags(this.h, (C.int)(r))
}
func (this *QPdfDocumentRenderOptions) ScaledClipRect() *qt6.QRect {
_goptr := qt6.UnsafeNewQRect(unsafe.Pointer(C.QPdfDocumentRenderOptions_scaledClipRect(this.h)))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QPdfDocumentRenderOptions) SetScaledClipRect(r *qt6.QRect) {
C.QPdfDocumentRenderOptions_setScaledClipRect(this.h, (*C.QRect)(r.UnsafePointer()))
}
func (this *QPdfDocumentRenderOptions) ScaledSize() *qt6.QSize {
_goptr := qt6.UnsafeNewQSize(unsafe.Pointer(C.QPdfDocumentRenderOptions_scaledSize(this.h)))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QPdfDocumentRenderOptions) SetScaledSize(s *qt6.QSize) {
C.QPdfDocumentRenderOptions_setScaledSize(this.h, (*C.QSize)(s.UnsafePointer()))
}
// Delete this object from C++ memory.
func (this *QPdfDocumentRenderOptions) Delete() {
C.QPdfDocumentRenderOptions_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 *QPdfDocumentRenderOptions) GoGC() {
runtime.SetFinalizer(this, func(this *QPdfDocumentRenderOptions) {
this.Delete()
runtime.KeepAlive(this.h)
})
}

View File

@ -0,0 +1,43 @@
#pragma once
#ifndef MIQT_QT6_PDF_GEN_QPDFDOCUMENTRENDEROPTIONS_H
#define MIQT_QT6_PDF_GEN_QPDFDOCUMENTRENDEROPTIONS_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 QPdfDocumentRenderOptions;
class QRect;
class QSize;
#else
typedef struct QPdfDocumentRenderOptions QPdfDocumentRenderOptions;
typedef struct QRect QRect;
typedef struct QSize QSize;
#endif
QPdfDocumentRenderOptions* QPdfDocumentRenderOptions_new();
QPdfDocumentRenderOptions* QPdfDocumentRenderOptions_new2(QPdfDocumentRenderOptions* param1);
int QPdfDocumentRenderOptions_rotation(const QPdfDocumentRenderOptions* self);
void QPdfDocumentRenderOptions_setRotation(QPdfDocumentRenderOptions* self, int r);
int QPdfDocumentRenderOptions_renderFlags(const QPdfDocumentRenderOptions* self);
void QPdfDocumentRenderOptions_setRenderFlags(QPdfDocumentRenderOptions* self, int r);
QRect* QPdfDocumentRenderOptions_scaledClipRect(const QPdfDocumentRenderOptions* self);
void QPdfDocumentRenderOptions_setScaledClipRect(QPdfDocumentRenderOptions* self, QRect* r);
QSize* QPdfDocumentRenderOptions_scaledSize(const QPdfDocumentRenderOptions* self);
void QPdfDocumentRenderOptions_setScaledSize(QPdfDocumentRenderOptions* self, QSize* s);
void QPdfDocumentRenderOptions_delete(QPdfDocumentRenderOptions* self);
#ifdef __cplusplus
} /* extern C */
#endif
#endif

114
qt6/pdf/gen_qpdflink.cpp Normal file
View File

@ -0,0 +1,114 @@
#include <QList>
#include <QPdfLink>
#include <QPointF>
#include <QRectF>
#include <QString>
#include <QByteArray>
#include <cstring>
#include <QUrl>
#include <qpdflink.h>
#include "gen_qpdflink.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
} /* extern C */
#endif
QPdfLink* QPdfLink_new() {
return new QPdfLink();
}
QPdfLink* QPdfLink_new2(QPdfLink* other) {
return new QPdfLink(*other);
}
void QPdfLink_operatorAssign(QPdfLink* self, QPdfLink* other) {
self->operator=(*other);
}
void QPdfLink_swap(QPdfLink* self, QPdfLink* other) {
self->swap(*other);
}
bool QPdfLink_isValid(const QPdfLink* self) {
return self->isValid();
}
int QPdfLink_page(const QPdfLink* self) {
return self->page();
}
QPointF* QPdfLink_location(const QPdfLink* self) {
return new QPointF(self->location());
}
double QPdfLink_zoom(const QPdfLink* self) {
qreal _ret = self->zoom();
return static_cast<double>(_ret);
}
QUrl* QPdfLink_url(const QPdfLink* self) {
return new QUrl(self->url());
}
struct miqt_string QPdfLink_contextBefore(const QPdfLink* self) {
QString _ret = self->contextBefore();
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
struct miqt_string _ms;
_ms.len = _b.length();
_ms.data = static_cast<char*>(malloc(_ms.len));
memcpy(_ms.data, _b.data(), _ms.len);
return _ms;
}
struct miqt_string QPdfLink_contextAfter(const QPdfLink* self) {
QString _ret = self->contextAfter();
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
struct miqt_string _ms;
_ms.len = _b.length();
_ms.data = static_cast<char*>(malloc(_ms.len));
memcpy(_ms.data, _b.data(), _ms.len);
return _ms;
}
struct miqt_array /* of QRectF* */ QPdfLink_rectangles(const QPdfLink* self) {
QList<QRectF> _ret = self->rectangles();
// Convert QList<> from C++ memory to manually-managed C memory
QRectF** _arr = static_cast<QRectF**>(malloc(sizeof(QRectF*) * _ret.length()));
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
_arr[i] = new QRectF(_ret[i]);
}
struct miqt_array _out;
_out.len = _ret.length();
_out.data = static_cast<void*>(_arr);
return _out;
}
struct miqt_string QPdfLink_toString(const QPdfLink* self) {
QString _ret = self->toString();
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
struct miqt_string _ms;
_ms.len = _b.length();
_ms.data = static_cast<char*>(malloc(_ms.len));
memcpy(_ms.data, _b.data(), _ms.len);
return _ms;
}
void QPdfLink_copyToClipboard(const QPdfLink* self) {
self->copyToClipboard();
}
void QPdfLink_copyToClipboardWithMode(const QPdfLink* self, int mode) {
self->copyToClipboard(static_cast<QClipboard::Mode>(mode));
}
void QPdfLink_delete(QPdfLink* self) {
delete self;
}

146
qt6/pdf/gen_qpdflink.go Normal file
View File

@ -0,0 +1,146 @@
package pdf
/*
#include "gen_qpdflink.h"
#include <stdlib.h>
*/
import "C"
import (
"github.com/mappu/miqt/qt6"
"runtime"
"unsafe"
)
type QPdfLink struct {
h *C.QPdfLink
}
func (this *QPdfLink) cPointer() *C.QPdfLink {
if this == nil {
return nil
}
return this.h
}
func (this *QPdfLink) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
// newQPdfLink constructs the type using only CGO pointers.
func newQPdfLink(h *C.QPdfLink) *QPdfLink {
if h == nil {
return nil
}
return &QPdfLink{h: h}
}
// UnsafeNewQPdfLink constructs the type using only unsafe pointers.
func UnsafeNewQPdfLink(h unsafe.Pointer) *QPdfLink {
return newQPdfLink((*C.QPdfLink)(h))
}
// NewQPdfLink constructs a new QPdfLink object.
func NewQPdfLink() *QPdfLink {
return newQPdfLink(C.QPdfLink_new())
}
// NewQPdfLink2 constructs a new QPdfLink object.
func NewQPdfLink2(other *QPdfLink) *QPdfLink {
return newQPdfLink(C.QPdfLink_new2(other.cPointer()))
}
func (this *QPdfLink) OperatorAssign(other *QPdfLink) {
C.QPdfLink_operatorAssign(this.h, other.cPointer())
}
func (this *QPdfLink) Swap(other *QPdfLink) {
C.QPdfLink_swap(this.h, other.cPointer())
}
func (this *QPdfLink) IsValid() bool {
return (bool)(C.QPdfLink_isValid(this.h))
}
func (this *QPdfLink) Page() int {
return (int)(C.QPdfLink_page(this.h))
}
func (this *QPdfLink) Location() *qt6.QPointF {
_goptr := qt6.UnsafeNewQPointF(unsafe.Pointer(C.QPdfLink_location(this.h)))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QPdfLink) Zoom() float64 {
return (float64)(C.QPdfLink_zoom(this.h))
}
func (this *QPdfLink) Url() *qt6.QUrl {
_goptr := qt6.UnsafeNewQUrl(unsafe.Pointer(C.QPdfLink_url(this.h)))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QPdfLink) ContextBefore() string {
var _ms C.struct_miqt_string = C.QPdfLink_contextBefore(this.h)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func (this *QPdfLink) ContextAfter() string {
var _ms C.struct_miqt_string = C.QPdfLink_contextAfter(this.h)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func (this *QPdfLink) Rectangles() []qt6.QRectF {
var _ma C.struct_miqt_array = C.QPdfLink_rectangles(this.h)
_ret := make([]qt6.QRectF, int(_ma.len))
_outCast := (*[0xffff]*C.QRectF)(unsafe.Pointer(_ma.data)) // hey ya
for i := 0; i < int(_ma.len); i++ {
_lv_goptr := qt6.UnsafeNewQRectF(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 *QPdfLink) ToString() string {
var _ms C.struct_miqt_string = C.QPdfLink_toString(this.h)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func (this *QPdfLink) CopyToClipboard() {
C.QPdfLink_copyToClipboard(this.h)
}
func (this *QPdfLink) CopyToClipboardWithMode(mode qt6.QClipboard__Mode) {
C.QPdfLink_copyToClipboardWithMode(this.h, (C.int)(mode))
}
// Delete this object from C++ memory.
func (this *QPdfLink) Delete() {
C.QPdfLink_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 *QPdfLink) GoGC() {
runtime.SetFinalizer(this, func(this *QPdfLink) {
this.Delete()
runtime.KeepAlive(this.h)
})
}

50
qt6/pdf/gen_qpdflink.h Normal file
View File

@ -0,0 +1,50 @@
#pragma once
#ifndef MIQT_QT6_PDF_GEN_QPDFLINK_H
#define MIQT_QT6_PDF_GEN_QPDFLINK_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 QPdfLink;
class QPointF;
class QRectF;
class QUrl;
#else
typedef struct QPdfLink QPdfLink;
typedef struct QPointF QPointF;
typedef struct QRectF QRectF;
typedef struct QUrl QUrl;
#endif
QPdfLink* QPdfLink_new();
QPdfLink* QPdfLink_new2(QPdfLink* other);
void QPdfLink_operatorAssign(QPdfLink* self, QPdfLink* other);
void QPdfLink_swap(QPdfLink* self, QPdfLink* other);
bool QPdfLink_isValid(const QPdfLink* self);
int QPdfLink_page(const QPdfLink* self);
QPointF* QPdfLink_location(const QPdfLink* self);
double QPdfLink_zoom(const QPdfLink* self);
QUrl* QPdfLink_url(const QPdfLink* self);
struct miqt_string QPdfLink_contextBefore(const QPdfLink* self);
struct miqt_string QPdfLink_contextAfter(const QPdfLink* self);
struct miqt_array /* of QRectF* */ QPdfLink_rectangles(const QPdfLink* self);
struct miqt_string QPdfLink_toString(const QPdfLink* self);
void QPdfLink_copyToClipboard(const QPdfLink* self);
void QPdfLink_copyToClipboardWithMode(const QPdfLink* self, int mode);
void QPdfLink_delete(QPdfLink* self);
#ifdef __cplusplus
} /* extern C */
#endif
#endif

View File

@ -0,0 +1,538 @@
#include <QChildEvent>
#include <QEvent>
#include <QMetaMethod>
#include <QMetaObject>
#include <QObject>
#include <QPdfLink>
#include <QPdfPageNavigator>
#include <QPointF>
#include <QString>
#include <QByteArray>
#include <cstring>
#include <QTimerEvent>
#include <qpdfpagenavigator.h>
#include "gen_qpdfpagenavigator.h"
#ifdef __cplusplus
extern "C" {
#endif
void miqt_exec_callback_QPdfPageNavigator_currentPageChanged(intptr_t, int);
void miqt_exec_callback_QPdfPageNavigator_currentLocationChanged(intptr_t, QPointF*);
void miqt_exec_callback_QPdfPageNavigator_currentZoomChanged(intptr_t, double);
void miqt_exec_callback_QPdfPageNavigator_backAvailableChanged(intptr_t, bool);
void miqt_exec_callback_QPdfPageNavigator_forwardAvailableChanged(intptr_t, bool);
void miqt_exec_callback_QPdfPageNavigator_jumped(intptr_t, QPdfLink*);
bool miqt_exec_callback_QPdfPageNavigator_event(QPdfPageNavigator*, intptr_t, QEvent*);
bool miqt_exec_callback_QPdfPageNavigator_eventFilter(QPdfPageNavigator*, intptr_t, QObject*, QEvent*);
void miqt_exec_callback_QPdfPageNavigator_timerEvent(QPdfPageNavigator*, intptr_t, QTimerEvent*);
void miqt_exec_callback_QPdfPageNavigator_childEvent(QPdfPageNavigator*, intptr_t, QChildEvent*);
void miqt_exec_callback_QPdfPageNavigator_customEvent(QPdfPageNavigator*, intptr_t, QEvent*);
void miqt_exec_callback_QPdfPageNavigator_connectNotify(QPdfPageNavigator*, intptr_t, QMetaMethod*);
void miqt_exec_callback_QPdfPageNavigator_disconnectNotify(QPdfPageNavigator*, intptr_t, QMetaMethod*);
#ifdef __cplusplus
} /* extern C */
#endif
class MiqtVirtualQPdfPageNavigator final : public QPdfPageNavigator {
public:
MiqtVirtualQPdfPageNavigator(): QPdfPageNavigator() {};
MiqtVirtualQPdfPageNavigator(QObject* parent): QPdfPageNavigator(parent) {};
virtual ~MiqtVirtualQPdfPageNavigator() override = default;
// cgo.Handle value for overwritten implementation
intptr_t handle__event = 0;
// Subclass to allow providing a Go implementation
virtual bool event(QEvent* event) override {
if (handle__event == 0) {
return QPdfPageNavigator::event(event);
}
QEvent* sigval1 = event;
bool callback_return_value = miqt_exec_callback_QPdfPageNavigator_event(this, handle__event, sigval1);
return callback_return_value;
}
friend bool QPdfPageNavigator_virtualbase_event(void* self, QEvent* event);
// cgo.Handle value for overwritten implementation
intptr_t handle__eventFilter = 0;
// Subclass to allow providing a Go implementation
virtual bool eventFilter(QObject* watched, QEvent* event) override {
if (handle__eventFilter == 0) {
return QPdfPageNavigator::eventFilter(watched, event);
}
QObject* sigval1 = watched;
QEvent* sigval2 = event;
bool callback_return_value = miqt_exec_callback_QPdfPageNavigator_eventFilter(this, handle__eventFilter, sigval1, sigval2);
return callback_return_value;
}
friend bool QPdfPageNavigator_virtualbase_eventFilter(void* self, QObject* watched, QEvent* event);
// cgo.Handle value for overwritten implementation
intptr_t handle__timerEvent = 0;
// Subclass to allow providing a Go implementation
virtual void timerEvent(QTimerEvent* event) override {
if (handle__timerEvent == 0) {
QPdfPageNavigator::timerEvent(event);
return;
}
QTimerEvent* sigval1 = event;
miqt_exec_callback_QPdfPageNavigator_timerEvent(this, handle__timerEvent, sigval1);
}
friend void QPdfPageNavigator_virtualbase_timerEvent(void* self, QTimerEvent* event);
// cgo.Handle value for overwritten implementation
intptr_t handle__childEvent = 0;
// Subclass to allow providing a Go implementation
virtual void childEvent(QChildEvent* event) override {
if (handle__childEvent == 0) {
QPdfPageNavigator::childEvent(event);
return;
}
QChildEvent* sigval1 = event;
miqt_exec_callback_QPdfPageNavigator_childEvent(this, handle__childEvent, sigval1);
}
friend void QPdfPageNavigator_virtualbase_childEvent(void* self, QChildEvent* event);
// cgo.Handle value for overwritten implementation
intptr_t handle__customEvent = 0;
// Subclass to allow providing a Go implementation
virtual void customEvent(QEvent* event) override {
if (handle__customEvent == 0) {
QPdfPageNavigator::customEvent(event);
return;
}
QEvent* sigval1 = event;
miqt_exec_callback_QPdfPageNavigator_customEvent(this, handle__customEvent, sigval1);
}
friend void QPdfPageNavigator_virtualbase_customEvent(void* self, QEvent* event);
// cgo.Handle value for overwritten implementation
intptr_t handle__connectNotify = 0;
// Subclass to allow providing a Go implementation
virtual void connectNotify(const QMetaMethod& signal) override {
if (handle__connectNotify == 0) {
QPdfPageNavigator::connectNotify(signal);
return;
}
const QMetaMethod& signal_ret = signal;
// Cast returned reference into pointer
QMetaMethod* sigval1 = const_cast<QMetaMethod*>(&signal_ret);
miqt_exec_callback_QPdfPageNavigator_connectNotify(this, handle__connectNotify, sigval1);
}
friend void QPdfPageNavigator_virtualbase_connectNotify(void* self, QMetaMethod* signal);
// cgo.Handle value for overwritten implementation
intptr_t handle__disconnectNotify = 0;
// Subclass to allow providing a Go implementation
virtual void disconnectNotify(const QMetaMethod& signal) override {
if (handle__disconnectNotify == 0) {
QPdfPageNavigator::disconnectNotify(signal);
return;
}
const QMetaMethod& signal_ret = signal;
// Cast returned reference into pointer
QMetaMethod* sigval1 = const_cast<QMetaMethod*>(&signal_ret);
miqt_exec_callback_QPdfPageNavigator_disconnectNotify(this, handle__disconnectNotify, sigval1);
}
friend void QPdfPageNavigator_virtualbase_disconnectNotify(void* self, QMetaMethod* signal);
// Wrappers to allow calling protected methods:
friend QPdfLink* QPdfPageNavigator_protectedbase_currentLink(bool* _dynamic_cast_ok, const void* self);
friend QObject* QPdfPageNavigator_protectedbase_sender(bool* _dynamic_cast_ok, const void* self);
friend int QPdfPageNavigator_protectedbase_senderSignalIndex(bool* _dynamic_cast_ok, const void* self);
friend int QPdfPageNavigator_protectedbase_receivers(bool* _dynamic_cast_ok, const void* self, const char* signal);
friend bool QPdfPageNavigator_protectedbase_isSignalConnected(bool* _dynamic_cast_ok, const void* self, QMetaMethod* signal);
};
QPdfPageNavigator* QPdfPageNavigator_new() {
return new MiqtVirtualQPdfPageNavigator();
}
QPdfPageNavigator* QPdfPageNavigator_new2(QObject* parent) {
return new MiqtVirtualQPdfPageNavigator(parent);
}
void QPdfPageNavigator_virtbase(QPdfPageNavigator* src, QObject** outptr_QObject) {
*outptr_QObject = static_cast<QObject*>(src);
}
QMetaObject* QPdfPageNavigator_metaObject(const QPdfPageNavigator* self) {
return (QMetaObject*) self->metaObject();
}
void* QPdfPageNavigator_metacast(QPdfPageNavigator* self, const char* param1) {
return self->qt_metacast(param1);
}
struct miqt_string QPdfPageNavigator_tr(const char* s) {
QString _ret = QPdfPageNavigator::tr(s);
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
struct miqt_string _ms;
_ms.len = _b.length();
_ms.data = static_cast<char*>(malloc(_ms.len));
memcpy(_ms.data, _b.data(), _ms.len);
return _ms;
}
int QPdfPageNavigator_currentPage(const QPdfPageNavigator* self) {
return self->currentPage();
}
QPointF* QPdfPageNavigator_currentLocation(const QPdfPageNavigator* self) {
return new QPointF(self->currentLocation());
}
double QPdfPageNavigator_currentZoom(const QPdfPageNavigator* self) {
qreal _ret = self->currentZoom();
return static_cast<double>(_ret);
}
bool QPdfPageNavigator_backAvailable(const QPdfPageNavigator* self) {
return self->backAvailable();
}
bool QPdfPageNavigator_forwardAvailable(const QPdfPageNavigator* self) {
return self->forwardAvailable();
}
void QPdfPageNavigator_clear(QPdfPageNavigator* self) {
self->clear();
}
void QPdfPageNavigator_jump(QPdfPageNavigator* self, QPdfLink* destination) {
self->jump(*destination);
}
void QPdfPageNavigator_jump2(QPdfPageNavigator* self, int page, QPointF* location) {
self->jump(static_cast<int>(page), *location);
}
void QPdfPageNavigator_update(QPdfPageNavigator* self, int page, QPointF* location, double zoom) {
self->update(static_cast<int>(page), *location, static_cast<qreal>(zoom));
}
void QPdfPageNavigator_forward(QPdfPageNavigator* self) {
self->forward();
}
void QPdfPageNavigator_back(QPdfPageNavigator* self) {
self->back();
}
void QPdfPageNavigator_currentPageChanged(QPdfPageNavigator* self, int page) {
self->currentPageChanged(static_cast<int>(page));
}
void QPdfPageNavigator_connect_currentPageChanged(QPdfPageNavigator* self, intptr_t slot) {
MiqtVirtualQPdfPageNavigator::connect(self, static_cast<void (QPdfPageNavigator::*)(int)>(&QPdfPageNavigator::currentPageChanged), self, [=](int page) {
int sigval1 = page;
miqt_exec_callback_QPdfPageNavigator_currentPageChanged(slot, sigval1);
});
}
void QPdfPageNavigator_currentLocationChanged(QPdfPageNavigator* self, QPointF* location) {
self->currentLocationChanged(*location);
}
void QPdfPageNavigator_connect_currentLocationChanged(QPdfPageNavigator* self, intptr_t slot) {
MiqtVirtualQPdfPageNavigator::connect(self, static_cast<void (QPdfPageNavigator::*)(QPointF)>(&QPdfPageNavigator::currentLocationChanged), self, [=](QPointF location) {
QPointF* sigval1 = new QPointF(location);
miqt_exec_callback_QPdfPageNavigator_currentLocationChanged(slot, sigval1);
});
}
void QPdfPageNavigator_currentZoomChanged(QPdfPageNavigator* self, double zoom) {
self->currentZoomChanged(static_cast<qreal>(zoom));
}
void QPdfPageNavigator_connect_currentZoomChanged(QPdfPageNavigator* self, intptr_t slot) {
MiqtVirtualQPdfPageNavigator::connect(self, static_cast<void (QPdfPageNavigator::*)(qreal)>(&QPdfPageNavigator::currentZoomChanged), self, [=](qreal zoom) {
qreal zoom_ret = zoom;
double sigval1 = static_cast<double>(zoom_ret);
miqt_exec_callback_QPdfPageNavigator_currentZoomChanged(slot, sigval1);
});
}
void QPdfPageNavigator_backAvailableChanged(QPdfPageNavigator* self, bool available) {
self->backAvailableChanged(available);
}
void QPdfPageNavigator_connect_backAvailableChanged(QPdfPageNavigator* self, intptr_t slot) {
MiqtVirtualQPdfPageNavigator::connect(self, static_cast<void (QPdfPageNavigator::*)(bool)>(&QPdfPageNavigator::backAvailableChanged), self, [=](bool available) {
bool sigval1 = available;
miqt_exec_callback_QPdfPageNavigator_backAvailableChanged(slot, sigval1);
});
}
void QPdfPageNavigator_forwardAvailableChanged(QPdfPageNavigator* self, bool available) {
self->forwardAvailableChanged(available);
}
void QPdfPageNavigator_connect_forwardAvailableChanged(QPdfPageNavigator* self, intptr_t slot) {
MiqtVirtualQPdfPageNavigator::connect(self, static_cast<void (QPdfPageNavigator::*)(bool)>(&QPdfPageNavigator::forwardAvailableChanged), self, [=](bool available) {
bool sigval1 = available;
miqt_exec_callback_QPdfPageNavigator_forwardAvailableChanged(slot, sigval1);
});
}
void QPdfPageNavigator_jumped(QPdfPageNavigator* self, QPdfLink* current) {
self->jumped(*current);
}
void QPdfPageNavigator_connect_jumped(QPdfPageNavigator* self, intptr_t slot) {
MiqtVirtualQPdfPageNavigator::connect(self, static_cast<void (QPdfPageNavigator::*)(QPdfLink)>(&QPdfPageNavigator::jumped), self, [=](QPdfLink current) {
QPdfLink* sigval1 = new QPdfLink(current);
miqt_exec_callback_QPdfPageNavigator_jumped(slot, sigval1);
});
}
struct miqt_string QPdfPageNavigator_tr2(const char* s, const char* c) {
QString _ret = QPdfPageNavigator::tr(s, c);
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
struct miqt_string _ms;
_ms.len = _b.length();
_ms.data = static_cast<char*>(malloc(_ms.len));
memcpy(_ms.data, _b.data(), _ms.len);
return _ms;
}
struct miqt_string QPdfPageNavigator_tr3(const char* s, const char* c, int n) {
QString _ret = QPdfPageNavigator::tr(s, c, static_cast<int>(n));
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
struct miqt_string _ms;
_ms.len = _b.length();
_ms.data = static_cast<char*>(malloc(_ms.len));
memcpy(_ms.data, _b.data(), _ms.len);
return _ms;
}
void QPdfPageNavigator_jump3(QPdfPageNavigator* self, int page, QPointF* location, double zoom) {
self->jump(static_cast<int>(page), *location, static_cast<qreal>(zoom));
}
bool QPdfPageNavigator_override_virtual_event(void* self, intptr_t slot) {
MiqtVirtualQPdfPageNavigator* self_cast = dynamic_cast<MiqtVirtualQPdfPageNavigator*>( (QPdfPageNavigator*)(self) );
if (self_cast == nullptr) {
return false;
}
self_cast->handle__event = slot;
return true;
}
bool QPdfPageNavigator_virtualbase_event(void* self, QEvent* event) {
return ( (MiqtVirtualQPdfPageNavigator*)(self) )->QPdfPageNavigator::event(event);
}
bool QPdfPageNavigator_override_virtual_eventFilter(void* self, intptr_t slot) {
MiqtVirtualQPdfPageNavigator* self_cast = dynamic_cast<MiqtVirtualQPdfPageNavigator*>( (QPdfPageNavigator*)(self) );
if (self_cast == nullptr) {
return false;
}
self_cast->handle__eventFilter = slot;
return true;
}
bool QPdfPageNavigator_virtualbase_eventFilter(void* self, QObject* watched, QEvent* event) {
return ( (MiqtVirtualQPdfPageNavigator*)(self) )->QPdfPageNavigator::eventFilter(watched, event);
}
bool QPdfPageNavigator_override_virtual_timerEvent(void* self, intptr_t slot) {
MiqtVirtualQPdfPageNavigator* self_cast = dynamic_cast<MiqtVirtualQPdfPageNavigator*>( (QPdfPageNavigator*)(self) );
if (self_cast == nullptr) {
return false;
}
self_cast->handle__timerEvent = slot;
return true;
}
void QPdfPageNavigator_virtualbase_timerEvent(void* self, QTimerEvent* event) {
( (MiqtVirtualQPdfPageNavigator*)(self) )->QPdfPageNavigator::timerEvent(event);
}
bool QPdfPageNavigator_override_virtual_childEvent(void* self, intptr_t slot) {
MiqtVirtualQPdfPageNavigator* self_cast = dynamic_cast<MiqtVirtualQPdfPageNavigator*>( (QPdfPageNavigator*)(self) );
if (self_cast == nullptr) {
return false;
}
self_cast->handle__childEvent = slot;
return true;
}
void QPdfPageNavigator_virtualbase_childEvent(void* self, QChildEvent* event) {
( (MiqtVirtualQPdfPageNavigator*)(self) )->QPdfPageNavigator::childEvent(event);
}
bool QPdfPageNavigator_override_virtual_customEvent(void* self, intptr_t slot) {
MiqtVirtualQPdfPageNavigator* self_cast = dynamic_cast<MiqtVirtualQPdfPageNavigator*>( (QPdfPageNavigator*)(self) );
if (self_cast == nullptr) {
return false;
}
self_cast->handle__customEvent = slot;
return true;
}
void QPdfPageNavigator_virtualbase_customEvent(void* self, QEvent* event) {
( (MiqtVirtualQPdfPageNavigator*)(self) )->QPdfPageNavigator::customEvent(event);
}
bool QPdfPageNavigator_override_virtual_connectNotify(void* self, intptr_t slot) {
MiqtVirtualQPdfPageNavigator* self_cast = dynamic_cast<MiqtVirtualQPdfPageNavigator*>( (QPdfPageNavigator*)(self) );
if (self_cast == nullptr) {
return false;
}
self_cast->handle__connectNotify = slot;
return true;
}
void QPdfPageNavigator_virtualbase_connectNotify(void* self, QMetaMethod* signal) {
( (MiqtVirtualQPdfPageNavigator*)(self) )->QPdfPageNavigator::connectNotify(*signal);
}
bool QPdfPageNavigator_override_virtual_disconnectNotify(void* self, intptr_t slot) {
MiqtVirtualQPdfPageNavigator* self_cast = dynamic_cast<MiqtVirtualQPdfPageNavigator*>( (QPdfPageNavigator*)(self) );
if (self_cast == nullptr) {
return false;
}
self_cast->handle__disconnectNotify = slot;
return true;
}
void QPdfPageNavigator_virtualbase_disconnectNotify(void* self, QMetaMethod* signal) {
( (MiqtVirtualQPdfPageNavigator*)(self) )->QPdfPageNavigator::disconnectNotify(*signal);
}
QPdfLink* QPdfPageNavigator_protectedbase_currentLink(bool* _dynamic_cast_ok, const void* self) {
MiqtVirtualQPdfPageNavigator* self_cast = dynamic_cast<MiqtVirtualQPdfPageNavigator*>( (QPdfPageNavigator*)(self) );
if (self_cast == nullptr) {
*_dynamic_cast_ok = false;
return nullptr;
}
*_dynamic_cast_ok = true;
return new QPdfLink(self_cast->currentLink());
}
QObject* QPdfPageNavigator_protectedbase_sender(bool* _dynamic_cast_ok, const void* self) {
MiqtVirtualQPdfPageNavigator* self_cast = dynamic_cast<MiqtVirtualQPdfPageNavigator*>( (QPdfPageNavigator*)(self) );
if (self_cast == nullptr) {
*_dynamic_cast_ok = false;
return nullptr;
}
*_dynamic_cast_ok = true;
return self_cast->sender();
}
int QPdfPageNavigator_protectedbase_senderSignalIndex(bool* _dynamic_cast_ok, const void* self) {
MiqtVirtualQPdfPageNavigator* self_cast = dynamic_cast<MiqtVirtualQPdfPageNavigator*>( (QPdfPageNavigator*)(self) );
if (self_cast == nullptr) {
*_dynamic_cast_ok = false;
return 0;
}
*_dynamic_cast_ok = true;
return self_cast->senderSignalIndex();
}
int QPdfPageNavigator_protectedbase_receivers(bool* _dynamic_cast_ok, const void* self, const char* signal) {
MiqtVirtualQPdfPageNavigator* self_cast = dynamic_cast<MiqtVirtualQPdfPageNavigator*>( (QPdfPageNavigator*)(self) );
if (self_cast == nullptr) {
*_dynamic_cast_ok = false;
return 0;
}
*_dynamic_cast_ok = true;
return self_cast->receivers(signal);
}
bool QPdfPageNavigator_protectedbase_isSignalConnected(bool* _dynamic_cast_ok, const void* self, QMetaMethod* signal) {
MiqtVirtualQPdfPageNavigator* self_cast = dynamic_cast<MiqtVirtualQPdfPageNavigator*>( (QPdfPageNavigator*)(self) );
if (self_cast == nullptr) {
*_dynamic_cast_ok = false;
return false;
}
*_dynamic_cast_ok = true;
return self_cast->isSignalConnected(*signal);
}
void QPdfPageNavigator_delete(QPdfPageNavigator* self) {
delete self;
}

View File

@ -0,0 +1,555 @@
package pdf
/*
#include "gen_qpdfpagenavigator.h"
#include <stdlib.h>
*/
import "C"
import (
"github.com/mappu/miqt/qt6"
"runtime"
"runtime/cgo"
"unsafe"
)
type QPdfPageNavigator struct {
h *C.QPdfPageNavigator
*qt6.QObject
}
func (this *QPdfPageNavigator) cPointer() *C.QPdfPageNavigator {
if this == nil {
return nil
}
return this.h
}
func (this *QPdfPageNavigator) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
// newQPdfPageNavigator constructs the type using only CGO pointers.
func newQPdfPageNavigator(h *C.QPdfPageNavigator) *QPdfPageNavigator {
if h == nil {
return nil
}
var outptr_QObject *C.QObject = nil
C.QPdfPageNavigator_virtbase(h, &outptr_QObject)
return &QPdfPageNavigator{h: h,
QObject: qt6.UnsafeNewQObject(unsafe.Pointer(outptr_QObject))}
}
// UnsafeNewQPdfPageNavigator constructs the type using only unsafe pointers.
func UnsafeNewQPdfPageNavigator(h unsafe.Pointer) *QPdfPageNavigator {
return newQPdfPageNavigator((*C.QPdfPageNavigator)(h))
}
// NewQPdfPageNavigator constructs a new QPdfPageNavigator object.
func NewQPdfPageNavigator() *QPdfPageNavigator {
return newQPdfPageNavigator(C.QPdfPageNavigator_new())
}
// NewQPdfPageNavigator2 constructs a new QPdfPageNavigator object.
func NewQPdfPageNavigator2(parent *qt6.QObject) *QPdfPageNavigator {
return newQPdfPageNavigator(C.QPdfPageNavigator_new2((*C.QObject)(parent.UnsafePointer())))
}
func (this *QPdfPageNavigator) MetaObject() *qt6.QMetaObject {
return qt6.UnsafeNewQMetaObject(unsafe.Pointer(C.QPdfPageNavigator_metaObject(this.h)))
}
func (this *QPdfPageNavigator) Metacast(param1 string) unsafe.Pointer {
param1_Cstring := C.CString(param1)
defer C.free(unsafe.Pointer(param1_Cstring))
return (unsafe.Pointer)(C.QPdfPageNavigator_metacast(this.h, param1_Cstring))
}
func QPdfPageNavigator_Tr(s string) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
var _ms C.struct_miqt_string = C.QPdfPageNavigator_tr(s_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func (this *QPdfPageNavigator) CurrentPage() int {
return (int)(C.QPdfPageNavigator_currentPage(this.h))
}
func (this *QPdfPageNavigator) CurrentLocation() *qt6.QPointF {
_goptr := qt6.UnsafeNewQPointF(unsafe.Pointer(C.QPdfPageNavigator_currentLocation(this.h)))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QPdfPageNavigator) CurrentZoom() float64 {
return (float64)(C.QPdfPageNavigator_currentZoom(this.h))
}
func (this *QPdfPageNavigator) BackAvailable() bool {
return (bool)(C.QPdfPageNavigator_backAvailable(this.h))
}
func (this *QPdfPageNavigator) ForwardAvailable() bool {
return (bool)(C.QPdfPageNavigator_forwardAvailable(this.h))
}
func (this *QPdfPageNavigator) Clear() {
C.QPdfPageNavigator_clear(this.h)
}
func (this *QPdfPageNavigator) Jump(destination QPdfLink) {
C.QPdfPageNavigator_jump(this.h, destination.cPointer())
}
func (this *QPdfPageNavigator) Jump2(page int, location *qt6.QPointF) {
C.QPdfPageNavigator_jump2(this.h, (C.int)(page), (*C.QPointF)(location.UnsafePointer()))
}
func (this *QPdfPageNavigator) Update(page int, location *qt6.QPointF, zoom float64) {
C.QPdfPageNavigator_update(this.h, (C.int)(page), (*C.QPointF)(location.UnsafePointer()), (C.double)(zoom))
}
func (this *QPdfPageNavigator) Forward() {
C.QPdfPageNavigator_forward(this.h)
}
func (this *QPdfPageNavigator) Back() {
C.QPdfPageNavigator_back(this.h)
}
func (this *QPdfPageNavigator) CurrentPageChanged(page int) {
C.QPdfPageNavigator_currentPageChanged(this.h, (C.int)(page))
}
func (this *QPdfPageNavigator) OnCurrentPageChanged(slot func(page int)) {
C.QPdfPageNavigator_connect_currentPageChanged(this.h, C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QPdfPageNavigator_currentPageChanged
func miqt_exec_callback_QPdfPageNavigator_currentPageChanged(cb C.intptr_t, page C.int) {
gofunc, ok := cgo.Handle(cb).Value().(func(page int))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := (int)(page)
gofunc(slotval1)
}
func (this *QPdfPageNavigator) CurrentLocationChanged(location qt6.QPointF) {
C.QPdfPageNavigator_currentLocationChanged(this.h, (*C.QPointF)(location.UnsafePointer()))
}
func (this *QPdfPageNavigator) OnCurrentLocationChanged(slot func(location qt6.QPointF)) {
C.QPdfPageNavigator_connect_currentLocationChanged(this.h, C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QPdfPageNavigator_currentLocationChanged
func miqt_exec_callback_QPdfPageNavigator_currentLocationChanged(cb C.intptr_t, location *C.QPointF) {
gofunc, ok := cgo.Handle(cb).Value().(func(location qt6.QPointF))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
location_goptr := qt6.UnsafeNewQPointF(unsafe.Pointer(location))
location_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
slotval1 := *location_goptr
gofunc(slotval1)
}
func (this *QPdfPageNavigator) CurrentZoomChanged(zoom float64) {
C.QPdfPageNavigator_currentZoomChanged(this.h, (C.double)(zoom))
}
func (this *QPdfPageNavigator) OnCurrentZoomChanged(slot func(zoom float64)) {
C.QPdfPageNavigator_connect_currentZoomChanged(this.h, C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QPdfPageNavigator_currentZoomChanged
func miqt_exec_callback_QPdfPageNavigator_currentZoomChanged(cb C.intptr_t, zoom C.double) {
gofunc, ok := cgo.Handle(cb).Value().(func(zoom float64))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := (float64)(zoom)
gofunc(slotval1)
}
func (this *QPdfPageNavigator) BackAvailableChanged(available bool) {
C.QPdfPageNavigator_backAvailableChanged(this.h, (C.bool)(available))
}
func (this *QPdfPageNavigator) OnBackAvailableChanged(slot func(available bool)) {
C.QPdfPageNavigator_connect_backAvailableChanged(this.h, C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QPdfPageNavigator_backAvailableChanged
func miqt_exec_callback_QPdfPageNavigator_backAvailableChanged(cb C.intptr_t, available C.bool) {
gofunc, ok := cgo.Handle(cb).Value().(func(available bool))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := (bool)(available)
gofunc(slotval1)
}
func (this *QPdfPageNavigator) ForwardAvailableChanged(available bool) {
C.QPdfPageNavigator_forwardAvailableChanged(this.h, (C.bool)(available))
}
func (this *QPdfPageNavigator) OnForwardAvailableChanged(slot func(available bool)) {
C.QPdfPageNavigator_connect_forwardAvailableChanged(this.h, C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QPdfPageNavigator_forwardAvailableChanged
func miqt_exec_callback_QPdfPageNavigator_forwardAvailableChanged(cb C.intptr_t, available C.bool) {
gofunc, ok := cgo.Handle(cb).Value().(func(available bool))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := (bool)(available)
gofunc(slotval1)
}
func (this *QPdfPageNavigator) Jumped(current QPdfLink) {
C.QPdfPageNavigator_jumped(this.h, current.cPointer())
}
func (this *QPdfPageNavigator) OnJumped(slot func(current QPdfLink)) {
C.QPdfPageNavigator_connect_jumped(this.h, C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QPdfPageNavigator_jumped
func miqt_exec_callback_QPdfPageNavigator_jumped(cb C.intptr_t, current *C.QPdfLink) {
gofunc, ok := cgo.Handle(cb).Value().(func(current QPdfLink))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
current_goptr := newQPdfLink(current)
current_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
slotval1 := *current_goptr
gofunc(slotval1)
}
func QPdfPageNavigator_Tr2(s string, c string) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
c_Cstring := C.CString(c)
defer C.free(unsafe.Pointer(c_Cstring))
var _ms C.struct_miqt_string = C.QPdfPageNavigator_tr2(s_Cstring, c_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func QPdfPageNavigator_Tr3(s string, c string, n int) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
c_Cstring := C.CString(c)
defer C.free(unsafe.Pointer(c_Cstring))
var _ms C.struct_miqt_string = C.QPdfPageNavigator_tr3(s_Cstring, c_Cstring, (C.int)(n))
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func (this *QPdfPageNavigator) Jump3(page int, location *qt6.QPointF, zoom float64) {
C.QPdfPageNavigator_jump3(this.h, (C.int)(page), (*C.QPointF)(location.UnsafePointer()), (C.double)(zoom))
}
// CurrentLink can only be called from a QPdfPageNavigator that was directly constructed.
func (this *QPdfPageNavigator) CurrentLink() QPdfLink {
var _dynamic_cast_ok C.bool = false
_goptr := newQPdfLink(C.QPdfPageNavigator_protectedbase_currentLink(&_dynamic_cast_ok, unsafe.Pointer(this.h)))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
_method_ret := *_goptr
if !_dynamic_cast_ok {
panic("miqt: can only call protected methods for directly constructed types")
}
return _method_ret
}
// Sender can only be called from a QPdfPageNavigator that was directly constructed.
func (this *QPdfPageNavigator) Sender() *qt6.QObject {
var _dynamic_cast_ok C.bool = false
_method_ret := qt6.UnsafeNewQObject(unsafe.Pointer(C.QPdfPageNavigator_protectedbase_sender(&_dynamic_cast_ok, unsafe.Pointer(this.h))))
if !_dynamic_cast_ok {
panic("miqt: can only call protected methods for directly constructed types")
}
return _method_ret
}
// SenderSignalIndex can only be called from a QPdfPageNavigator that was directly constructed.
func (this *QPdfPageNavigator) SenderSignalIndex() int {
var _dynamic_cast_ok C.bool = false
_method_ret := (int)(C.QPdfPageNavigator_protectedbase_senderSignalIndex(&_dynamic_cast_ok, unsafe.Pointer(this.h)))
if !_dynamic_cast_ok {
panic("miqt: can only call protected methods for directly constructed types")
}
return _method_ret
}
// Receivers can only be called from a QPdfPageNavigator that was directly constructed.
func (this *QPdfPageNavigator) Receivers(signal string) int {
signal_Cstring := C.CString(signal)
defer C.free(unsafe.Pointer(signal_Cstring))
var _dynamic_cast_ok C.bool = false
_method_ret := (int)(C.QPdfPageNavigator_protectedbase_receivers(&_dynamic_cast_ok, unsafe.Pointer(this.h), signal_Cstring))
if !_dynamic_cast_ok {
panic("miqt: can only call protected methods for directly constructed types")
}
return _method_ret
}
// IsSignalConnected can only be called from a QPdfPageNavigator that was directly constructed.
func (this *QPdfPageNavigator) IsSignalConnected(signal *qt6.QMetaMethod) bool {
var _dynamic_cast_ok C.bool = false
_method_ret := (bool)(C.QPdfPageNavigator_protectedbase_isSignalConnected(&_dynamic_cast_ok, unsafe.Pointer(this.h), (*C.QMetaMethod)(signal.UnsafePointer())))
if !_dynamic_cast_ok {
panic("miqt: can only call protected methods for directly constructed types")
}
return _method_ret
}
func (this *QPdfPageNavigator) callVirtualBase_Event(event *qt6.QEvent) bool {
return (bool)(C.QPdfPageNavigator_virtualbase_event(unsafe.Pointer(this.h), (*C.QEvent)(event.UnsafePointer())))
}
func (this *QPdfPageNavigator) OnEvent(slot func(super func(event *qt6.QEvent) bool, event *qt6.QEvent) bool) {
ok := C.QPdfPageNavigator_override_virtual_event(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
}
}
//export miqt_exec_callback_QPdfPageNavigator_event
func miqt_exec_callback_QPdfPageNavigator_event(self *C.QPdfPageNavigator, cb C.intptr_t, event *C.QEvent) C.bool {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(event *qt6.QEvent) bool, event *qt6.QEvent) bool)
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := qt6.UnsafeNewQEvent(unsafe.Pointer(event))
virtualReturn := gofunc((&QPdfPageNavigator{h: self}).callVirtualBase_Event, slotval1)
return (C.bool)(virtualReturn)
}
func (this *QPdfPageNavigator) callVirtualBase_EventFilter(watched *qt6.QObject, event *qt6.QEvent) bool {
return (bool)(C.QPdfPageNavigator_virtualbase_eventFilter(unsafe.Pointer(this.h), (*C.QObject)(watched.UnsafePointer()), (*C.QEvent)(event.UnsafePointer())))
}
func (this *QPdfPageNavigator) OnEventFilter(slot func(super func(watched *qt6.QObject, event *qt6.QEvent) bool, watched *qt6.QObject, event *qt6.QEvent) bool) {
ok := C.QPdfPageNavigator_override_virtual_eventFilter(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
}
}
//export miqt_exec_callback_QPdfPageNavigator_eventFilter
func miqt_exec_callback_QPdfPageNavigator_eventFilter(self *C.QPdfPageNavigator, cb C.intptr_t, watched *C.QObject, event *C.QEvent) C.bool {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(watched *qt6.QObject, event *qt6.QEvent) bool, watched *qt6.QObject, event *qt6.QEvent) bool)
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := qt6.UnsafeNewQObject(unsafe.Pointer(watched))
slotval2 := qt6.UnsafeNewQEvent(unsafe.Pointer(event))
virtualReturn := gofunc((&QPdfPageNavigator{h: self}).callVirtualBase_EventFilter, slotval1, slotval2)
return (C.bool)(virtualReturn)
}
func (this *QPdfPageNavigator) callVirtualBase_TimerEvent(event *qt6.QTimerEvent) {
C.QPdfPageNavigator_virtualbase_timerEvent(unsafe.Pointer(this.h), (*C.QTimerEvent)(event.UnsafePointer()))
}
func (this *QPdfPageNavigator) OnTimerEvent(slot func(super func(event *qt6.QTimerEvent), event *qt6.QTimerEvent)) {
ok := C.QPdfPageNavigator_override_virtual_timerEvent(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
}
}
//export miqt_exec_callback_QPdfPageNavigator_timerEvent
func miqt_exec_callback_QPdfPageNavigator_timerEvent(self *C.QPdfPageNavigator, cb C.intptr_t, event *C.QTimerEvent) {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(event *qt6.QTimerEvent), event *qt6.QTimerEvent))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := qt6.UnsafeNewQTimerEvent(unsafe.Pointer(event))
gofunc((&QPdfPageNavigator{h: self}).callVirtualBase_TimerEvent, slotval1)
}
func (this *QPdfPageNavigator) callVirtualBase_ChildEvent(event *qt6.QChildEvent) {
C.QPdfPageNavigator_virtualbase_childEvent(unsafe.Pointer(this.h), (*C.QChildEvent)(event.UnsafePointer()))
}
func (this *QPdfPageNavigator) OnChildEvent(slot func(super func(event *qt6.QChildEvent), event *qt6.QChildEvent)) {
ok := C.QPdfPageNavigator_override_virtual_childEvent(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
}
}
//export miqt_exec_callback_QPdfPageNavigator_childEvent
func miqt_exec_callback_QPdfPageNavigator_childEvent(self *C.QPdfPageNavigator, cb C.intptr_t, event *C.QChildEvent) {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(event *qt6.QChildEvent), event *qt6.QChildEvent))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := qt6.UnsafeNewQChildEvent(unsafe.Pointer(event))
gofunc((&QPdfPageNavigator{h: self}).callVirtualBase_ChildEvent, slotval1)
}
func (this *QPdfPageNavigator) callVirtualBase_CustomEvent(event *qt6.QEvent) {
C.QPdfPageNavigator_virtualbase_customEvent(unsafe.Pointer(this.h), (*C.QEvent)(event.UnsafePointer()))
}
func (this *QPdfPageNavigator) OnCustomEvent(slot func(super func(event *qt6.QEvent), event *qt6.QEvent)) {
ok := C.QPdfPageNavigator_override_virtual_customEvent(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
}
}
//export miqt_exec_callback_QPdfPageNavigator_customEvent
func miqt_exec_callback_QPdfPageNavigator_customEvent(self *C.QPdfPageNavigator, cb C.intptr_t, event *C.QEvent) {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(event *qt6.QEvent), event *qt6.QEvent))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := qt6.UnsafeNewQEvent(unsafe.Pointer(event))
gofunc((&QPdfPageNavigator{h: self}).callVirtualBase_CustomEvent, slotval1)
}
func (this *QPdfPageNavigator) callVirtualBase_ConnectNotify(signal *qt6.QMetaMethod) {
C.QPdfPageNavigator_virtualbase_connectNotify(unsafe.Pointer(this.h), (*C.QMetaMethod)(signal.UnsafePointer()))
}
func (this *QPdfPageNavigator) OnConnectNotify(slot func(super func(signal *qt6.QMetaMethod), signal *qt6.QMetaMethod)) {
ok := C.QPdfPageNavigator_override_virtual_connectNotify(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
}
}
//export miqt_exec_callback_QPdfPageNavigator_connectNotify
func miqt_exec_callback_QPdfPageNavigator_connectNotify(self *C.QPdfPageNavigator, cb C.intptr_t, signal *C.QMetaMethod) {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(signal *qt6.QMetaMethod), signal *qt6.QMetaMethod))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := qt6.UnsafeNewQMetaMethod(unsafe.Pointer(signal))
gofunc((&QPdfPageNavigator{h: self}).callVirtualBase_ConnectNotify, slotval1)
}
func (this *QPdfPageNavigator) callVirtualBase_DisconnectNotify(signal *qt6.QMetaMethod) {
C.QPdfPageNavigator_virtualbase_disconnectNotify(unsafe.Pointer(this.h), (*C.QMetaMethod)(signal.UnsafePointer()))
}
func (this *QPdfPageNavigator) OnDisconnectNotify(slot func(super func(signal *qt6.QMetaMethod), signal *qt6.QMetaMethod)) {
ok := C.QPdfPageNavigator_override_virtual_disconnectNotify(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
}
}
//export miqt_exec_callback_QPdfPageNavigator_disconnectNotify
func miqt_exec_callback_QPdfPageNavigator_disconnectNotify(self *C.QPdfPageNavigator, cb C.intptr_t, signal *C.QMetaMethod) {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(signal *qt6.QMetaMethod), signal *qt6.QMetaMethod))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := qt6.UnsafeNewQMetaMethod(unsafe.Pointer(signal))
gofunc((&QPdfPageNavigator{h: self}).callVirtualBase_DisconnectNotify, slotval1)
}
// Delete this object from C++ memory.
func (this *QPdfPageNavigator) Delete() {
C.QPdfPageNavigator_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 *QPdfPageNavigator) GoGC() {
runtime.SetFinalizer(this, func(this *QPdfPageNavigator) {
this.Delete()
runtime.KeepAlive(this.h)
})
}

View File

@ -0,0 +1,96 @@
#pragma once
#ifndef MIQT_QT6_PDF_GEN_QPDFPAGENAVIGATOR_H
#define MIQT_QT6_PDF_GEN_QPDFPAGENAVIGATOR_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 QChildEvent;
class QEvent;
class QMetaMethod;
class QMetaObject;
class QObject;
class QPdfLink;
class QPdfPageNavigator;
class QPointF;
class QTimerEvent;
#else
typedef struct QChildEvent QChildEvent;
typedef struct QEvent QEvent;
typedef struct QMetaMethod QMetaMethod;
typedef struct QMetaObject QMetaObject;
typedef struct QObject QObject;
typedef struct QPdfLink QPdfLink;
typedef struct QPdfPageNavigator QPdfPageNavigator;
typedef struct QPointF QPointF;
typedef struct QTimerEvent QTimerEvent;
#endif
QPdfPageNavigator* QPdfPageNavigator_new();
QPdfPageNavigator* QPdfPageNavigator_new2(QObject* parent);
void QPdfPageNavigator_virtbase(QPdfPageNavigator* src, QObject** outptr_QObject);
QMetaObject* QPdfPageNavigator_metaObject(const QPdfPageNavigator* self);
void* QPdfPageNavigator_metacast(QPdfPageNavigator* self, const char* param1);
struct miqt_string QPdfPageNavigator_tr(const char* s);
int QPdfPageNavigator_currentPage(const QPdfPageNavigator* self);
QPointF* QPdfPageNavigator_currentLocation(const QPdfPageNavigator* self);
double QPdfPageNavigator_currentZoom(const QPdfPageNavigator* self);
bool QPdfPageNavigator_backAvailable(const QPdfPageNavigator* self);
bool QPdfPageNavigator_forwardAvailable(const QPdfPageNavigator* self);
void QPdfPageNavigator_clear(QPdfPageNavigator* self);
void QPdfPageNavigator_jump(QPdfPageNavigator* self, QPdfLink* destination);
void QPdfPageNavigator_jump2(QPdfPageNavigator* self, int page, QPointF* location);
void QPdfPageNavigator_update(QPdfPageNavigator* self, int page, QPointF* location, double zoom);
void QPdfPageNavigator_forward(QPdfPageNavigator* self);
void QPdfPageNavigator_back(QPdfPageNavigator* self);
void QPdfPageNavigator_currentPageChanged(QPdfPageNavigator* self, int page);
void QPdfPageNavigator_connect_currentPageChanged(QPdfPageNavigator* self, intptr_t slot);
void QPdfPageNavigator_currentLocationChanged(QPdfPageNavigator* self, QPointF* location);
void QPdfPageNavigator_connect_currentLocationChanged(QPdfPageNavigator* self, intptr_t slot);
void QPdfPageNavigator_currentZoomChanged(QPdfPageNavigator* self, double zoom);
void QPdfPageNavigator_connect_currentZoomChanged(QPdfPageNavigator* self, intptr_t slot);
void QPdfPageNavigator_backAvailableChanged(QPdfPageNavigator* self, bool available);
void QPdfPageNavigator_connect_backAvailableChanged(QPdfPageNavigator* self, intptr_t slot);
void QPdfPageNavigator_forwardAvailableChanged(QPdfPageNavigator* self, bool available);
void QPdfPageNavigator_connect_forwardAvailableChanged(QPdfPageNavigator* self, intptr_t slot);
void QPdfPageNavigator_jumped(QPdfPageNavigator* self, QPdfLink* current);
void QPdfPageNavigator_connect_jumped(QPdfPageNavigator* self, intptr_t slot);
struct miqt_string QPdfPageNavigator_tr2(const char* s, const char* c);
struct miqt_string QPdfPageNavigator_tr3(const char* s, const char* c, int n);
void QPdfPageNavigator_jump3(QPdfPageNavigator* self, int page, QPointF* location, double zoom);
bool QPdfPageNavigator_override_virtual_event(void* self, intptr_t slot);
bool QPdfPageNavigator_virtualbase_event(void* self, QEvent* event);
bool QPdfPageNavigator_override_virtual_eventFilter(void* self, intptr_t slot);
bool QPdfPageNavigator_virtualbase_eventFilter(void* self, QObject* watched, QEvent* event);
bool QPdfPageNavigator_override_virtual_timerEvent(void* self, intptr_t slot);
void QPdfPageNavigator_virtualbase_timerEvent(void* self, QTimerEvent* event);
bool QPdfPageNavigator_override_virtual_childEvent(void* self, intptr_t slot);
void QPdfPageNavigator_virtualbase_childEvent(void* self, QChildEvent* event);
bool QPdfPageNavigator_override_virtual_customEvent(void* self, intptr_t slot);
void QPdfPageNavigator_virtualbase_customEvent(void* self, QEvent* event);
bool QPdfPageNavigator_override_virtual_connectNotify(void* self, intptr_t slot);
void QPdfPageNavigator_virtualbase_connectNotify(void* self, QMetaMethod* signal);
bool QPdfPageNavigator_override_virtual_disconnectNotify(void* self, intptr_t slot);
void QPdfPageNavigator_virtualbase_disconnectNotify(void* self, QMetaMethod* signal);
QPdfLink* QPdfPageNavigator_protectedbase_currentLink(bool* _dynamic_cast_ok, const void* self);
QObject* QPdfPageNavigator_protectedbase_sender(bool* _dynamic_cast_ok, const void* self);
int QPdfPageNavigator_protectedbase_senderSignalIndex(bool* _dynamic_cast_ok, const void* self);
int QPdfPageNavigator_protectedbase_receivers(bool* _dynamic_cast_ok, const void* self, const char* signal);
bool QPdfPageNavigator_protectedbase_isSignalConnected(bool* _dynamic_cast_ok, const void* self, QMetaMethod* signal);
void QPdfPageNavigator_delete(QPdfPageNavigator* self);
#ifdef __cplusplus
} /* extern C */
#endif
#endif

View File

@ -0,0 +1,475 @@
#include <QChildEvent>
#include <QEvent>
#include <QImage>
#include <QMetaMethod>
#include <QMetaObject>
#include <QObject>
#include <QPdfDocument>
#include <QPdfDocumentRenderOptions>
#include <QPdfPageRenderer>
#include <QSize>
#include <QString>
#include <QByteArray>
#include <cstring>
#include <QTimerEvent>
#include <qpdfpagerenderer.h>
#include "gen_qpdfpagerenderer.h"
#ifdef __cplusplus
extern "C" {
#endif
void miqt_exec_callback_QPdfPageRenderer_documentChanged(intptr_t, QPdfDocument*);
void miqt_exec_callback_QPdfPageRenderer_renderModeChanged(intptr_t, int);
void miqt_exec_callback_QPdfPageRenderer_pageRendered(intptr_t, int, QSize*, QImage*, QPdfDocumentRenderOptions*, unsigned long long);
bool miqt_exec_callback_QPdfPageRenderer_event(QPdfPageRenderer*, intptr_t, QEvent*);
bool miqt_exec_callback_QPdfPageRenderer_eventFilter(QPdfPageRenderer*, intptr_t, QObject*, QEvent*);
void miqt_exec_callback_QPdfPageRenderer_timerEvent(QPdfPageRenderer*, intptr_t, QTimerEvent*);
void miqt_exec_callback_QPdfPageRenderer_childEvent(QPdfPageRenderer*, intptr_t, QChildEvent*);
void miqt_exec_callback_QPdfPageRenderer_customEvent(QPdfPageRenderer*, intptr_t, QEvent*);
void miqt_exec_callback_QPdfPageRenderer_connectNotify(QPdfPageRenderer*, intptr_t, QMetaMethod*);
void miqt_exec_callback_QPdfPageRenderer_disconnectNotify(QPdfPageRenderer*, intptr_t, QMetaMethod*);
#ifdef __cplusplus
} /* extern C */
#endif
class MiqtVirtualQPdfPageRenderer final : public QPdfPageRenderer {
public:
MiqtVirtualQPdfPageRenderer(): QPdfPageRenderer() {};
MiqtVirtualQPdfPageRenderer(QObject* parent): QPdfPageRenderer(parent) {};
virtual ~MiqtVirtualQPdfPageRenderer() override = default;
// cgo.Handle value for overwritten implementation
intptr_t handle__event = 0;
// Subclass to allow providing a Go implementation
virtual bool event(QEvent* event) override {
if (handle__event == 0) {
return QPdfPageRenderer::event(event);
}
QEvent* sigval1 = event;
bool callback_return_value = miqt_exec_callback_QPdfPageRenderer_event(this, handle__event, sigval1);
return callback_return_value;
}
friend bool QPdfPageRenderer_virtualbase_event(void* self, QEvent* event);
// cgo.Handle value for overwritten implementation
intptr_t handle__eventFilter = 0;
// Subclass to allow providing a Go implementation
virtual bool eventFilter(QObject* watched, QEvent* event) override {
if (handle__eventFilter == 0) {
return QPdfPageRenderer::eventFilter(watched, event);
}
QObject* sigval1 = watched;
QEvent* sigval2 = event;
bool callback_return_value = miqt_exec_callback_QPdfPageRenderer_eventFilter(this, handle__eventFilter, sigval1, sigval2);
return callback_return_value;
}
friend bool QPdfPageRenderer_virtualbase_eventFilter(void* self, QObject* watched, QEvent* event);
// cgo.Handle value for overwritten implementation
intptr_t handle__timerEvent = 0;
// Subclass to allow providing a Go implementation
virtual void timerEvent(QTimerEvent* event) override {
if (handle__timerEvent == 0) {
QPdfPageRenderer::timerEvent(event);
return;
}
QTimerEvent* sigval1 = event;
miqt_exec_callback_QPdfPageRenderer_timerEvent(this, handle__timerEvent, sigval1);
}
friend void QPdfPageRenderer_virtualbase_timerEvent(void* self, QTimerEvent* event);
// cgo.Handle value for overwritten implementation
intptr_t handle__childEvent = 0;
// Subclass to allow providing a Go implementation
virtual void childEvent(QChildEvent* event) override {
if (handle__childEvent == 0) {
QPdfPageRenderer::childEvent(event);
return;
}
QChildEvent* sigval1 = event;
miqt_exec_callback_QPdfPageRenderer_childEvent(this, handle__childEvent, sigval1);
}
friend void QPdfPageRenderer_virtualbase_childEvent(void* self, QChildEvent* event);
// cgo.Handle value for overwritten implementation
intptr_t handle__customEvent = 0;
// Subclass to allow providing a Go implementation
virtual void customEvent(QEvent* event) override {
if (handle__customEvent == 0) {
QPdfPageRenderer::customEvent(event);
return;
}
QEvent* sigval1 = event;
miqt_exec_callback_QPdfPageRenderer_customEvent(this, handle__customEvent, sigval1);
}
friend void QPdfPageRenderer_virtualbase_customEvent(void* self, QEvent* event);
// cgo.Handle value for overwritten implementation
intptr_t handle__connectNotify = 0;
// Subclass to allow providing a Go implementation
virtual void connectNotify(const QMetaMethod& signal) override {
if (handle__connectNotify == 0) {
QPdfPageRenderer::connectNotify(signal);
return;
}
const QMetaMethod& signal_ret = signal;
// Cast returned reference into pointer
QMetaMethod* sigval1 = const_cast<QMetaMethod*>(&signal_ret);
miqt_exec_callback_QPdfPageRenderer_connectNotify(this, handle__connectNotify, sigval1);
}
friend void QPdfPageRenderer_virtualbase_connectNotify(void* self, QMetaMethod* signal);
// cgo.Handle value for overwritten implementation
intptr_t handle__disconnectNotify = 0;
// Subclass to allow providing a Go implementation
virtual void disconnectNotify(const QMetaMethod& signal) override {
if (handle__disconnectNotify == 0) {
QPdfPageRenderer::disconnectNotify(signal);
return;
}
const QMetaMethod& signal_ret = signal;
// Cast returned reference into pointer
QMetaMethod* sigval1 = const_cast<QMetaMethod*>(&signal_ret);
miqt_exec_callback_QPdfPageRenderer_disconnectNotify(this, handle__disconnectNotify, sigval1);
}
friend void QPdfPageRenderer_virtualbase_disconnectNotify(void* self, QMetaMethod* signal);
// Wrappers to allow calling protected methods:
friend QObject* QPdfPageRenderer_protectedbase_sender(bool* _dynamic_cast_ok, const void* self);
friend int QPdfPageRenderer_protectedbase_senderSignalIndex(bool* _dynamic_cast_ok, const void* self);
friend int QPdfPageRenderer_protectedbase_receivers(bool* _dynamic_cast_ok, const void* self, const char* signal);
friend bool QPdfPageRenderer_protectedbase_isSignalConnected(bool* _dynamic_cast_ok, const void* self, QMetaMethod* signal);
};
QPdfPageRenderer* QPdfPageRenderer_new() {
return new MiqtVirtualQPdfPageRenderer();
}
QPdfPageRenderer* QPdfPageRenderer_new2(QObject* parent) {
return new MiqtVirtualQPdfPageRenderer(parent);
}
void QPdfPageRenderer_virtbase(QPdfPageRenderer* src, QObject** outptr_QObject) {
*outptr_QObject = static_cast<QObject*>(src);
}
QMetaObject* QPdfPageRenderer_metaObject(const QPdfPageRenderer* self) {
return (QMetaObject*) self->metaObject();
}
void* QPdfPageRenderer_metacast(QPdfPageRenderer* self, const char* param1) {
return self->qt_metacast(param1);
}
struct miqt_string QPdfPageRenderer_tr(const char* s) {
QString _ret = QPdfPageRenderer::tr(s);
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
struct miqt_string _ms;
_ms.len = _b.length();
_ms.data = static_cast<char*>(malloc(_ms.len));
memcpy(_ms.data, _b.data(), _ms.len);
return _ms;
}
int QPdfPageRenderer_renderMode(const QPdfPageRenderer* self) {
QPdfPageRenderer::RenderMode _ret = self->renderMode();
return static_cast<int>(_ret);
}
void QPdfPageRenderer_setRenderMode(QPdfPageRenderer* self, int mode) {
self->setRenderMode(static_cast<QPdfPageRenderer::RenderMode>(mode));
}
QPdfDocument* QPdfPageRenderer_document(const QPdfPageRenderer* self) {
return self->document();
}
void QPdfPageRenderer_setDocument(QPdfPageRenderer* self, QPdfDocument* document) {
self->setDocument(document);
}
unsigned long long QPdfPageRenderer_requestPage(QPdfPageRenderer* self, int pageNumber, QSize* imageSize) {
quint64 _ret = self->requestPage(static_cast<int>(pageNumber), *imageSize);
return static_cast<unsigned long long>(_ret);
}
void QPdfPageRenderer_documentChanged(QPdfPageRenderer* self, QPdfDocument* document) {
self->documentChanged(document);
}
void QPdfPageRenderer_connect_documentChanged(QPdfPageRenderer* self, intptr_t slot) {
MiqtVirtualQPdfPageRenderer::connect(self, static_cast<void (QPdfPageRenderer::*)(QPdfDocument*)>(&QPdfPageRenderer::documentChanged), self, [=](QPdfDocument* document) {
QPdfDocument* sigval1 = document;
miqt_exec_callback_QPdfPageRenderer_documentChanged(slot, sigval1);
});
}
void QPdfPageRenderer_renderModeChanged(QPdfPageRenderer* self, int renderMode) {
self->renderModeChanged(static_cast<QPdfPageRenderer::RenderMode>(renderMode));
}
void QPdfPageRenderer_connect_renderModeChanged(QPdfPageRenderer* self, intptr_t slot) {
MiqtVirtualQPdfPageRenderer::connect(self, static_cast<void (QPdfPageRenderer::*)(QPdfPageRenderer::RenderMode)>(&QPdfPageRenderer::renderModeChanged), self, [=](QPdfPageRenderer::RenderMode renderMode) {
QPdfPageRenderer::RenderMode renderMode_ret = renderMode;
int sigval1 = static_cast<int>(renderMode_ret);
miqt_exec_callback_QPdfPageRenderer_renderModeChanged(slot, sigval1);
});
}
void QPdfPageRenderer_pageRendered(QPdfPageRenderer* self, int pageNumber, QSize* imageSize, QImage* image, QPdfDocumentRenderOptions* options, unsigned long long requestId) {
self->pageRendered(static_cast<int>(pageNumber), *imageSize, *image, *options, static_cast<quint64>(requestId));
}
void QPdfPageRenderer_connect_pageRendered(QPdfPageRenderer* self, intptr_t slot) {
MiqtVirtualQPdfPageRenderer::connect(self, static_cast<void (QPdfPageRenderer::*)(int, QSize, const QImage&, QPdfDocumentRenderOptions, quint64)>(&QPdfPageRenderer::pageRendered), self, [=](int pageNumber, QSize imageSize, const QImage& image, QPdfDocumentRenderOptions options, quint64 requestId) {
int sigval1 = pageNumber;
QSize* sigval2 = new QSize(imageSize);
const QImage& image_ret = image;
// Cast returned reference into pointer
QImage* sigval3 = const_cast<QImage*>(&image_ret);
QPdfDocumentRenderOptions* sigval4 = new QPdfDocumentRenderOptions(options);
quint64 requestId_ret = requestId;
unsigned long long sigval5 = static_cast<unsigned long long>(requestId_ret);
miqt_exec_callback_QPdfPageRenderer_pageRendered(slot, sigval1, sigval2, sigval3, sigval4, sigval5);
});
}
struct miqt_string QPdfPageRenderer_tr2(const char* s, const char* c) {
QString _ret = QPdfPageRenderer::tr(s, c);
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
struct miqt_string _ms;
_ms.len = _b.length();
_ms.data = static_cast<char*>(malloc(_ms.len));
memcpy(_ms.data, _b.data(), _ms.len);
return _ms;
}
struct miqt_string QPdfPageRenderer_tr3(const char* s, const char* c, int n) {
QString _ret = QPdfPageRenderer::tr(s, c, static_cast<int>(n));
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
struct miqt_string _ms;
_ms.len = _b.length();
_ms.data = static_cast<char*>(malloc(_ms.len));
memcpy(_ms.data, _b.data(), _ms.len);
return _ms;
}
unsigned long long QPdfPageRenderer_requestPage2(QPdfPageRenderer* self, int pageNumber, QSize* imageSize, QPdfDocumentRenderOptions* options) {
quint64 _ret = self->requestPage(static_cast<int>(pageNumber), *imageSize, *options);
return static_cast<unsigned long long>(_ret);
}
bool QPdfPageRenderer_override_virtual_event(void* self, intptr_t slot) {
MiqtVirtualQPdfPageRenderer* self_cast = dynamic_cast<MiqtVirtualQPdfPageRenderer*>( (QPdfPageRenderer*)(self) );
if (self_cast == nullptr) {
return false;
}
self_cast->handle__event = slot;
return true;
}
bool QPdfPageRenderer_virtualbase_event(void* self, QEvent* event) {
return ( (MiqtVirtualQPdfPageRenderer*)(self) )->QPdfPageRenderer::event(event);
}
bool QPdfPageRenderer_override_virtual_eventFilter(void* self, intptr_t slot) {
MiqtVirtualQPdfPageRenderer* self_cast = dynamic_cast<MiqtVirtualQPdfPageRenderer*>( (QPdfPageRenderer*)(self) );
if (self_cast == nullptr) {
return false;
}
self_cast->handle__eventFilter = slot;
return true;
}
bool QPdfPageRenderer_virtualbase_eventFilter(void* self, QObject* watched, QEvent* event) {
return ( (MiqtVirtualQPdfPageRenderer*)(self) )->QPdfPageRenderer::eventFilter(watched, event);
}
bool QPdfPageRenderer_override_virtual_timerEvent(void* self, intptr_t slot) {
MiqtVirtualQPdfPageRenderer* self_cast = dynamic_cast<MiqtVirtualQPdfPageRenderer*>( (QPdfPageRenderer*)(self) );
if (self_cast == nullptr) {
return false;
}
self_cast->handle__timerEvent = slot;
return true;
}
void QPdfPageRenderer_virtualbase_timerEvent(void* self, QTimerEvent* event) {
( (MiqtVirtualQPdfPageRenderer*)(self) )->QPdfPageRenderer::timerEvent(event);
}
bool QPdfPageRenderer_override_virtual_childEvent(void* self, intptr_t slot) {
MiqtVirtualQPdfPageRenderer* self_cast = dynamic_cast<MiqtVirtualQPdfPageRenderer*>( (QPdfPageRenderer*)(self) );
if (self_cast == nullptr) {
return false;
}
self_cast->handle__childEvent = slot;
return true;
}
void QPdfPageRenderer_virtualbase_childEvent(void* self, QChildEvent* event) {
( (MiqtVirtualQPdfPageRenderer*)(self) )->QPdfPageRenderer::childEvent(event);
}
bool QPdfPageRenderer_override_virtual_customEvent(void* self, intptr_t slot) {
MiqtVirtualQPdfPageRenderer* self_cast = dynamic_cast<MiqtVirtualQPdfPageRenderer*>( (QPdfPageRenderer*)(self) );
if (self_cast == nullptr) {
return false;
}
self_cast->handle__customEvent = slot;
return true;
}
void QPdfPageRenderer_virtualbase_customEvent(void* self, QEvent* event) {
( (MiqtVirtualQPdfPageRenderer*)(self) )->QPdfPageRenderer::customEvent(event);
}
bool QPdfPageRenderer_override_virtual_connectNotify(void* self, intptr_t slot) {
MiqtVirtualQPdfPageRenderer* self_cast = dynamic_cast<MiqtVirtualQPdfPageRenderer*>( (QPdfPageRenderer*)(self) );
if (self_cast == nullptr) {
return false;
}
self_cast->handle__connectNotify = slot;
return true;
}
void QPdfPageRenderer_virtualbase_connectNotify(void* self, QMetaMethod* signal) {
( (MiqtVirtualQPdfPageRenderer*)(self) )->QPdfPageRenderer::connectNotify(*signal);
}
bool QPdfPageRenderer_override_virtual_disconnectNotify(void* self, intptr_t slot) {
MiqtVirtualQPdfPageRenderer* self_cast = dynamic_cast<MiqtVirtualQPdfPageRenderer*>( (QPdfPageRenderer*)(self) );
if (self_cast == nullptr) {
return false;
}
self_cast->handle__disconnectNotify = slot;
return true;
}
void QPdfPageRenderer_virtualbase_disconnectNotify(void* self, QMetaMethod* signal) {
( (MiqtVirtualQPdfPageRenderer*)(self) )->QPdfPageRenderer::disconnectNotify(*signal);
}
QObject* QPdfPageRenderer_protectedbase_sender(bool* _dynamic_cast_ok, const void* self) {
MiqtVirtualQPdfPageRenderer* self_cast = dynamic_cast<MiqtVirtualQPdfPageRenderer*>( (QPdfPageRenderer*)(self) );
if (self_cast == nullptr) {
*_dynamic_cast_ok = false;
return nullptr;
}
*_dynamic_cast_ok = true;
return self_cast->sender();
}
int QPdfPageRenderer_protectedbase_senderSignalIndex(bool* _dynamic_cast_ok, const void* self) {
MiqtVirtualQPdfPageRenderer* self_cast = dynamic_cast<MiqtVirtualQPdfPageRenderer*>( (QPdfPageRenderer*)(self) );
if (self_cast == nullptr) {
*_dynamic_cast_ok = false;
return 0;
}
*_dynamic_cast_ok = true;
return self_cast->senderSignalIndex();
}
int QPdfPageRenderer_protectedbase_receivers(bool* _dynamic_cast_ok, const void* self, const char* signal) {
MiqtVirtualQPdfPageRenderer* self_cast = dynamic_cast<MiqtVirtualQPdfPageRenderer*>( (QPdfPageRenderer*)(self) );
if (self_cast == nullptr) {
*_dynamic_cast_ok = false;
return 0;
}
*_dynamic_cast_ok = true;
return self_cast->receivers(signal);
}
bool QPdfPageRenderer_protectedbase_isSignalConnected(bool* _dynamic_cast_ok, const void* self, QMetaMethod* signal) {
MiqtVirtualQPdfPageRenderer* self_cast = dynamic_cast<MiqtVirtualQPdfPageRenderer*>( (QPdfPageRenderer*)(self) );
if (self_cast == nullptr) {
*_dynamic_cast_ok = false;
return false;
}
*_dynamic_cast_ok = true;
return self_cast->isSignalConnected(*signal);
}
void QPdfPageRenderer_delete(QPdfPageRenderer* self) {
delete self;
}

View File

@ -0,0 +1,468 @@
package pdf
/*
#include "gen_qpdfpagerenderer.h"
#include <stdlib.h>
*/
import "C"
import (
"github.com/mappu/miqt/qt6"
"runtime"
"runtime/cgo"
"unsafe"
)
type QPdfPageRenderer__RenderMode int
const (
QPdfPageRenderer__MultiThreaded QPdfPageRenderer__RenderMode = 0
QPdfPageRenderer__SingleThreaded QPdfPageRenderer__RenderMode = 1
)
type QPdfPageRenderer struct {
h *C.QPdfPageRenderer
*qt6.QObject
}
func (this *QPdfPageRenderer) cPointer() *C.QPdfPageRenderer {
if this == nil {
return nil
}
return this.h
}
func (this *QPdfPageRenderer) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
// newQPdfPageRenderer constructs the type using only CGO pointers.
func newQPdfPageRenderer(h *C.QPdfPageRenderer) *QPdfPageRenderer {
if h == nil {
return nil
}
var outptr_QObject *C.QObject = nil
C.QPdfPageRenderer_virtbase(h, &outptr_QObject)
return &QPdfPageRenderer{h: h,
QObject: qt6.UnsafeNewQObject(unsafe.Pointer(outptr_QObject))}
}
// UnsafeNewQPdfPageRenderer constructs the type using only unsafe pointers.
func UnsafeNewQPdfPageRenderer(h unsafe.Pointer) *QPdfPageRenderer {
return newQPdfPageRenderer((*C.QPdfPageRenderer)(h))
}
// NewQPdfPageRenderer constructs a new QPdfPageRenderer object.
func NewQPdfPageRenderer() *QPdfPageRenderer {
return newQPdfPageRenderer(C.QPdfPageRenderer_new())
}
// NewQPdfPageRenderer2 constructs a new QPdfPageRenderer object.
func NewQPdfPageRenderer2(parent *qt6.QObject) *QPdfPageRenderer {
return newQPdfPageRenderer(C.QPdfPageRenderer_new2((*C.QObject)(parent.UnsafePointer())))
}
func (this *QPdfPageRenderer) MetaObject() *qt6.QMetaObject {
return qt6.UnsafeNewQMetaObject(unsafe.Pointer(C.QPdfPageRenderer_metaObject(this.h)))
}
func (this *QPdfPageRenderer) Metacast(param1 string) unsafe.Pointer {
param1_Cstring := C.CString(param1)
defer C.free(unsafe.Pointer(param1_Cstring))
return (unsafe.Pointer)(C.QPdfPageRenderer_metacast(this.h, param1_Cstring))
}
func QPdfPageRenderer_Tr(s string) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
var _ms C.struct_miqt_string = C.QPdfPageRenderer_tr(s_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func (this *QPdfPageRenderer) RenderMode() QPdfPageRenderer__RenderMode {
return (QPdfPageRenderer__RenderMode)(C.QPdfPageRenderer_renderMode(this.h))
}
func (this *QPdfPageRenderer) SetRenderMode(mode QPdfPageRenderer__RenderMode) {
C.QPdfPageRenderer_setRenderMode(this.h, (C.int)(mode))
}
func (this *QPdfPageRenderer) Document() *QPdfDocument {
return newQPdfDocument(C.QPdfPageRenderer_document(this.h))
}
func (this *QPdfPageRenderer) SetDocument(document *QPdfDocument) {
C.QPdfPageRenderer_setDocument(this.h, document.cPointer())
}
func (this *QPdfPageRenderer) RequestPage(pageNumber int, imageSize qt6.QSize) uint64 {
return (uint64)(C.QPdfPageRenderer_requestPage(this.h, (C.int)(pageNumber), (*C.QSize)(imageSize.UnsafePointer())))
}
func (this *QPdfPageRenderer) DocumentChanged(document *QPdfDocument) {
C.QPdfPageRenderer_documentChanged(this.h, document.cPointer())
}
func (this *QPdfPageRenderer) OnDocumentChanged(slot func(document *QPdfDocument)) {
C.QPdfPageRenderer_connect_documentChanged(this.h, C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QPdfPageRenderer_documentChanged
func miqt_exec_callback_QPdfPageRenderer_documentChanged(cb C.intptr_t, document *C.QPdfDocument) {
gofunc, ok := cgo.Handle(cb).Value().(func(document *QPdfDocument))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := newQPdfDocument(document)
gofunc(slotval1)
}
func (this *QPdfPageRenderer) RenderModeChanged(renderMode QPdfPageRenderer__RenderMode) {
C.QPdfPageRenderer_renderModeChanged(this.h, (C.int)(renderMode))
}
func (this *QPdfPageRenderer) OnRenderModeChanged(slot func(renderMode QPdfPageRenderer__RenderMode)) {
C.QPdfPageRenderer_connect_renderModeChanged(this.h, C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QPdfPageRenderer_renderModeChanged
func miqt_exec_callback_QPdfPageRenderer_renderModeChanged(cb C.intptr_t, renderMode C.int) {
gofunc, ok := cgo.Handle(cb).Value().(func(renderMode QPdfPageRenderer__RenderMode))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := (QPdfPageRenderer__RenderMode)(renderMode)
gofunc(slotval1)
}
func (this *QPdfPageRenderer) PageRendered(pageNumber int, imageSize qt6.QSize, image *qt6.QImage, options QPdfDocumentRenderOptions, requestId uint64) {
C.QPdfPageRenderer_pageRendered(this.h, (C.int)(pageNumber), (*C.QSize)(imageSize.UnsafePointer()), (*C.QImage)(image.UnsafePointer()), options.cPointer(), (C.ulonglong)(requestId))
}
func (this *QPdfPageRenderer) OnPageRendered(slot func(pageNumber int, imageSize qt6.QSize, image *qt6.QImage, options QPdfDocumentRenderOptions, requestId uint64)) {
C.QPdfPageRenderer_connect_pageRendered(this.h, C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QPdfPageRenderer_pageRendered
func miqt_exec_callback_QPdfPageRenderer_pageRendered(cb C.intptr_t, pageNumber C.int, imageSize *C.QSize, image *C.QImage, options *C.QPdfDocumentRenderOptions, requestId C.ulonglong) {
gofunc, ok := cgo.Handle(cb).Value().(func(pageNumber int, imageSize qt6.QSize, image *qt6.QImage, options QPdfDocumentRenderOptions, requestId uint64))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := (int)(pageNumber)
imageSize_goptr := qt6.UnsafeNewQSize(unsafe.Pointer(imageSize))
imageSize_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
slotval2 := *imageSize_goptr
slotval3 := qt6.UnsafeNewQImage(unsafe.Pointer(image))
options_goptr := newQPdfDocumentRenderOptions(options)
options_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
slotval4 := *options_goptr
slotval5 := (uint64)(requestId)
gofunc(slotval1, slotval2, slotval3, slotval4, slotval5)
}
func QPdfPageRenderer_Tr2(s string, c string) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
c_Cstring := C.CString(c)
defer C.free(unsafe.Pointer(c_Cstring))
var _ms C.struct_miqt_string = C.QPdfPageRenderer_tr2(s_Cstring, c_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func QPdfPageRenderer_Tr3(s string, c string, n int) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
c_Cstring := C.CString(c)
defer C.free(unsafe.Pointer(c_Cstring))
var _ms C.struct_miqt_string = C.QPdfPageRenderer_tr3(s_Cstring, c_Cstring, (C.int)(n))
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func (this *QPdfPageRenderer) RequestPage2(pageNumber int, imageSize qt6.QSize, options QPdfDocumentRenderOptions) uint64 {
return (uint64)(C.QPdfPageRenderer_requestPage2(this.h, (C.int)(pageNumber), (*C.QSize)(imageSize.UnsafePointer()), options.cPointer()))
}
// Sender can only be called from a QPdfPageRenderer that was directly constructed.
func (this *QPdfPageRenderer) Sender() *qt6.QObject {
var _dynamic_cast_ok C.bool = false
_method_ret := qt6.UnsafeNewQObject(unsafe.Pointer(C.QPdfPageRenderer_protectedbase_sender(&_dynamic_cast_ok, unsafe.Pointer(this.h))))
if !_dynamic_cast_ok {
panic("miqt: can only call protected methods for directly constructed types")
}
return _method_ret
}
// SenderSignalIndex can only be called from a QPdfPageRenderer that was directly constructed.
func (this *QPdfPageRenderer) SenderSignalIndex() int {
var _dynamic_cast_ok C.bool = false
_method_ret := (int)(C.QPdfPageRenderer_protectedbase_senderSignalIndex(&_dynamic_cast_ok, unsafe.Pointer(this.h)))
if !_dynamic_cast_ok {
panic("miqt: can only call protected methods for directly constructed types")
}
return _method_ret
}
// Receivers can only be called from a QPdfPageRenderer that was directly constructed.
func (this *QPdfPageRenderer) Receivers(signal string) int {
signal_Cstring := C.CString(signal)
defer C.free(unsafe.Pointer(signal_Cstring))
var _dynamic_cast_ok C.bool = false
_method_ret := (int)(C.QPdfPageRenderer_protectedbase_receivers(&_dynamic_cast_ok, unsafe.Pointer(this.h), signal_Cstring))
if !_dynamic_cast_ok {
panic("miqt: can only call protected methods for directly constructed types")
}
return _method_ret
}
// IsSignalConnected can only be called from a QPdfPageRenderer that was directly constructed.
func (this *QPdfPageRenderer) IsSignalConnected(signal *qt6.QMetaMethod) bool {
var _dynamic_cast_ok C.bool = false
_method_ret := (bool)(C.QPdfPageRenderer_protectedbase_isSignalConnected(&_dynamic_cast_ok, unsafe.Pointer(this.h), (*C.QMetaMethod)(signal.UnsafePointer())))
if !_dynamic_cast_ok {
panic("miqt: can only call protected methods for directly constructed types")
}
return _method_ret
}
func (this *QPdfPageRenderer) callVirtualBase_Event(event *qt6.QEvent) bool {
return (bool)(C.QPdfPageRenderer_virtualbase_event(unsafe.Pointer(this.h), (*C.QEvent)(event.UnsafePointer())))
}
func (this *QPdfPageRenderer) OnEvent(slot func(super func(event *qt6.QEvent) bool, event *qt6.QEvent) bool) {
ok := C.QPdfPageRenderer_override_virtual_event(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
}
}
//export miqt_exec_callback_QPdfPageRenderer_event
func miqt_exec_callback_QPdfPageRenderer_event(self *C.QPdfPageRenderer, cb C.intptr_t, event *C.QEvent) C.bool {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(event *qt6.QEvent) bool, event *qt6.QEvent) bool)
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := qt6.UnsafeNewQEvent(unsafe.Pointer(event))
virtualReturn := gofunc((&QPdfPageRenderer{h: self}).callVirtualBase_Event, slotval1)
return (C.bool)(virtualReturn)
}
func (this *QPdfPageRenderer) callVirtualBase_EventFilter(watched *qt6.QObject, event *qt6.QEvent) bool {
return (bool)(C.QPdfPageRenderer_virtualbase_eventFilter(unsafe.Pointer(this.h), (*C.QObject)(watched.UnsafePointer()), (*C.QEvent)(event.UnsafePointer())))
}
func (this *QPdfPageRenderer) OnEventFilter(slot func(super func(watched *qt6.QObject, event *qt6.QEvent) bool, watched *qt6.QObject, event *qt6.QEvent) bool) {
ok := C.QPdfPageRenderer_override_virtual_eventFilter(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
}
}
//export miqt_exec_callback_QPdfPageRenderer_eventFilter
func miqt_exec_callback_QPdfPageRenderer_eventFilter(self *C.QPdfPageRenderer, cb C.intptr_t, watched *C.QObject, event *C.QEvent) C.bool {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(watched *qt6.QObject, event *qt6.QEvent) bool, watched *qt6.QObject, event *qt6.QEvent) bool)
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := qt6.UnsafeNewQObject(unsafe.Pointer(watched))
slotval2 := qt6.UnsafeNewQEvent(unsafe.Pointer(event))
virtualReturn := gofunc((&QPdfPageRenderer{h: self}).callVirtualBase_EventFilter, slotval1, slotval2)
return (C.bool)(virtualReturn)
}
func (this *QPdfPageRenderer) callVirtualBase_TimerEvent(event *qt6.QTimerEvent) {
C.QPdfPageRenderer_virtualbase_timerEvent(unsafe.Pointer(this.h), (*C.QTimerEvent)(event.UnsafePointer()))
}
func (this *QPdfPageRenderer) OnTimerEvent(slot func(super func(event *qt6.QTimerEvent), event *qt6.QTimerEvent)) {
ok := C.QPdfPageRenderer_override_virtual_timerEvent(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
}
}
//export miqt_exec_callback_QPdfPageRenderer_timerEvent
func miqt_exec_callback_QPdfPageRenderer_timerEvent(self *C.QPdfPageRenderer, cb C.intptr_t, event *C.QTimerEvent) {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(event *qt6.QTimerEvent), event *qt6.QTimerEvent))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := qt6.UnsafeNewQTimerEvent(unsafe.Pointer(event))
gofunc((&QPdfPageRenderer{h: self}).callVirtualBase_TimerEvent, slotval1)
}
func (this *QPdfPageRenderer) callVirtualBase_ChildEvent(event *qt6.QChildEvent) {
C.QPdfPageRenderer_virtualbase_childEvent(unsafe.Pointer(this.h), (*C.QChildEvent)(event.UnsafePointer()))
}
func (this *QPdfPageRenderer) OnChildEvent(slot func(super func(event *qt6.QChildEvent), event *qt6.QChildEvent)) {
ok := C.QPdfPageRenderer_override_virtual_childEvent(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
}
}
//export miqt_exec_callback_QPdfPageRenderer_childEvent
func miqt_exec_callback_QPdfPageRenderer_childEvent(self *C.QPdfPageRenderer, cb C.intptr_t, event *C.QChildEvent) {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(event *qt6.QChildEvent), event *qt6.QChildEvent))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := qt6.UnsafeNewQChildEvent(unsafe.Pointer(event))
gofunc((&QPdfPageRenderer{h: self}).callVirtualBase_ChildEvent, slotval1)
}
func (this *QPdfPageRenderer) callVirtualBase_CustomEvent(event *qt6.QEvent) {
C.QPdfPageRenderer_virtualbase_customEvent(unsafe.Pointer(this.h), (*C.QEvent)(event.UnsafePointer()))
}
func (this *QPdfPageRenderer) OnCustomEvent(slot func(super func(event *qt6.QEvent), event *qt6.QEvent)) {
ok := C.QPdfPageRenderer_override_virtual_customEvent(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
}
}
//export miqt_exec_callback_QPdfPageRenderer_customEvent
func miqt_exec_callback_QPdfPageRenderer_customEvent(self *C.QPdfPageRenderer, cb C.intptr_t, event *C.QEvent) {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(event *qt6.QEvent), event *qt6.QEvent))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := qt6.UnsafeNewQEvent(unsafe.Pointer(event))
gofunc((&QPdfPageRenderer{h: self}).callVirtualBase_CustomEvent, slotval1)
}
func (this *QPdfPageRenderer) callVirtualBase_ConnectNotify(signal *qt6.QMetaMethod) {
C.QPdfPageRenderer_virtualbase_connectNotify(unsafe.Pointer(this.h), (*C.QMetaMethod)(signal.UnsafePointer()))
}
func (this *QPdfPageRenderer) OnConnectNotify(slot func(super func(signal *qt6.QMetaMethod), signal *qt6.QMetaMethod)) {
ok := C.QPdfPageRenderer_override_virtual_connectNotify(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
}
}
//export miqt_exec_callback_QPdfPageRenderer_connectNotify
func miqt_exec_callback_QPdfPageRenderer_connectNotify(self *C.QPdfPageRenderer, cb C.intptr_t, signal *C.QMetaMethod) {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(signal *qt6.QMetaMethod), signal *qt6.QMetaMethod))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := qt6.UnsafeNewQMetaMethod(unsafe.Pointer(signal))
gofunc((&QPdfPageRenderer{h: self}).callVirtualBase_ConnectNotify, slotval1)
}
func (this *QPdfPageRenderer) callVirtualBase_DisconnectNotify(signal *qt6.QMetaMethod) {
C.QPdfPageRenderer_virtualbase_disconnectNotify(unsafe.Pointer(this.h), (*C.QMetaMethod)(signal.UnsafePointer()))
}
func (this *QPdfPageRenderer) OnDisconnectNotify(slot func(super func(signal *qt6.QMetaMethod), signal *qt6.QMetaMethod)) {
ok := C.QPdfPageRenderer_override_virtual_disconnectNotify(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
}
}
//export miqt_exec_callback_QPdfPageRenderer_disconnectNotify
func miqt_exec_callback_QPdfPageRenderer_disconnectNotify(self *C.QPdfPageRenderer, cb C.intptr_t, signal *C.QMetaMethod) {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(signal *qt6.QMetaMethod), signal *qt6.QMetaMethod))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := qt6.UnsafeNewQMetaMethod(unsafe.Pointer(signal))
gofunc((&QPdfPageRenderer{h: self}).callVirtualBase_DisconnectNotify, slotval1)
}
// Delete this object from C++ memory.
func (this *QPdfPageRenderer) Delete() {
C.QPdfPageRenderer_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 *QPdfPageRenderer) GoGC() {
runtime.SetFinalizer(this, func(this *QPdfPageRenderer) {
this.Delete()
runtime.KeepAlive(this.h)
})
}

View File

@ -0,0 +1,87 @@
#pragma once
#ifndef MIQT_QT6_PDF_GEN_QPDFPAGERENDERER_H
#define MIQT_QT6_PDF_GEN_QPDFPAGERENDERER_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 QChildEvent;
class QEvent;
class QImage;
class QMetaMethod;
class QMetaObject;
class QObject;
class QPdfDocument;
class QPdfDocumentRenderOptions;
class QPdfPageRenderer;
class QSize;
class QTimerEvent;
#else
typedef struct QChildEvent QChildEvent;
typedef struct QEvent QEvent;
typedef struct QImage QImage;
typedef struct QMetaMethod QMetaMethod;
typedef struct QMetaObject QMetaObject;
typedef struct QObject QObject;
typedef struct QPdfDocument QPdfDocument;
typedef struct QPdfDocumentRenderOptions QPdfDocumentRenderOptions;
typedef struct QPdfPageRenderer QPdfPageRenderer;
typedef struct QSize QSize;
typedef struct QTimerEvent QTimerEvent;
#endif
QPdfPageRenderer* QPdfPageRenderer_new();
QPdfPageRenderer* QPdfPageRenderer_new2(QObject* parent);
void QPdfPageRenderer_virtbase(QPdfPageRenderer* src, QObject** outptr_QObject);
QMetaObject* QPdfPageRenderer_metaObject(const QPdfPageRenderer* self);
void* QPdfPageRenderer_metacast(QPdfPageRenderer* self, const char* param1);
struct miqt_string QPdfPageRenderer_tr(const char* s);
int QPdfPageRenderer_renderMode(const QPdfPageRenderer* self);
void QPdfPageRenderer_setRenderMode(QPdfPageRenderer* self, int mode);
QPdfDocument* QPdfPageRenderer_document(const QPdfPageRenderer* self);
void QPdfPageRenderer_setDocument(QPdfPageRenderer* self, QPdfDocument* document);
unsigned long long QPdfPageRenderer_requestPage(QPdfPageRenderer* self, int pageNumber, QSize* imageSize);
void QPdfPageRenderer_documentChanged(QPdfPageRenderer* self, QPdfDocument* document);
void QPdfPageRenderer_connect_documentChanged(QPdfPageRenderer* self, intptr_t slot);
void QPdfPageRenderer_renderModeChanged(QPdfPageRenderer* self, int renderMode);
void QPdfPageRenderer_connect_renderModeChanged(QPdfPageRenderer* self, intptr_t slot);
void QPdfPageRenderer_pageRendered(QPdfPageRenderer* self, int pageNumber, QSize* imageSize, QImage* image, QPdfDocumentRenderOptions* options, unsigned long long requestId);
void QPdfPageRenderer_connect_pageRendered(QPdfPageRenderer* self, intptr_t slot);
struct miqt_string QPdfPageRenderer_tr2(const char* s, const char* c);
struct miqt_string QPdfPageRenderer_tr3(const char* s, const char* c, int n);
unsigned long long QPdfPageRenderer_requestPage2(QPdfPageRenderer* self, int pageNumber, QSize* imageSize, QPdfDocumentRenderOptions* options);
bool QPdfPageRenderer_override_virtual_event(void* self, intptr_t slot);
bool QPdfPageRenderer_virtualbase_event(void* self, QEvent* event);
bool QPdfPageRenderer_override_virtual_eventFilter(void* self, intptr_t slot);
bool QPdfPageRenderer_virtualbase_eventFilter(void* self, QObject* watched, QEvent* event);
bool QPdfPageRenderer_override_virtual_timerEvent(void* self, intptr_t slot);
void QPdfPageRenderer_virtualbase_timerEvent(void* self, QTimerEvent* event);
bool QPdfPageRenderer_override_virtual_childEvent(void* self, intptr_t slot);
void QPdfPageRenderer_virtualbase_childEvent(void* self, QChildEvent* event);
bool QPdfPageRenderer_override_virtual_customEvent(void* self, intptr_t slot);
void QPdfPageRenderer_virtualbase_customEvent(void* self, QEvent* event);
bool QPdfPageRenderer_override_virtual_connectNotify(void* self, intptr_t slot);
void QPdfPageRenderer_virtualbase_connectNotify(void* self, QMetaMethod* signal);
bool QPdfPageRenderer_override_virtual_disconnectNotify(void* self, intptr_t slot);
void QPdfPageRenderer_virtualbase_disconnectNotify(void* self, QMetaMethod* signal);
QObject* QPdfPageRenderer_protectedbase_sender(bool* _dynamic_cast_ok, const void* self);
int QPdfPageRenderer_protectedbase_senderSignalIndex(bool* _dynamic_cast_ok, const void* self);
int QPdfPageRenderer_protectedbase_receivers(bool* _dynamic_cast_ok, const void* self, const char* signal);
bool QPdfPageRenderer_protectedbase_isSignalConnected(bool* _dynamic_cast_ok, const void* self, QMetaMethod* signal);
void QPdfPageRenderer_delete(QPdfPageRenderer* self);
#ifdef __cplusplus
} /* extern C */
#endif
#endif

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,190 @@
#pragma once
#ifndef MIQT_QT6_PDF_GEN_QPDFSEARCHMODEL_H
#define MIQT_QT6_PDF_GEN_QPDFSEARCHMODEL_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 QAbstractItemModel;
class QAbstractListModel;
class QChildEvent;
class QDataStream;
class QEvent;
class QMetaMethod;
class QMetaObject;
class QMimeData;
class QModelIndex;
class QModelRoleDataSpan;
class QObject;
class QPdfDocument;
class QPdfLink;
class QPdfSearchModel;
class QSize;
class QTimerEvent;
class QVariant;
#else
typedef struct QAbstractItemModel QAbstractItemModel;
typedef struct QAbstractListModel QAbstractListModel;
typedef struct QChildEvent QChildEvent;
typedef struct QDataStream QDataStream;
typedef struct QEvent QEvent;
typedef struct QMetaMethod QMetaMethod;
typedef struct QMetaObject QMetaObject;
typedef struct QMimeData QMimeData;
typedef struct QModelIndex QModelIndex;
typedef struct QModelRoleDataSpan QModelRoleDataSpan;
typedef struct QObject QObject;
typedef struct QPdfDocument QPdfDocument;
typedef struct QPdfLink QPdfLink;
typedef struct QPdfSearchModel QPdfSearchModel;
typedef struct QSize QSize;
typedef struct QTimerEvent QTimerEvent;
typedef struct QVariant QVariant;
#endif
QPdfSearchModel* QPdfSearchModel_new();
QPdfSearchModel* QPdfSearchModel_new2(QObject* parent);
void QPdfSearchModel_virtbase(QPdfSearchModel* src, QAbstractListModel** outptr_QAbstractListModel);
QMetaObject* QPdfSearchModel_metaObject(const QPdfSearchModel* self);
void* QPdfSearchModel_metacast(QPdfSearchModel* self, const char* param1);
struct miqt_string QPdfSearchModel_tr(const char* s);
struct miqt_array /* of QPdfLink* */ QPdfSearchModel_resultsOnPage(const QPdfSearchModel* self, int page);
QPdfLink* QPdfSearchModel_resultAtIndex(const QPdfSearchModel* self, int index);
QPdfDocument* QPdfSearchModel_document(const QPdfSearchModel* self);
struct miqt_string QPdfSearchModel_searchString(const QPdfSearchModel* self);
struct miqt_map /* of int to struct miqt_string */ QPdfSearchModel_roleNames(const QPdfSearchModel* self);
int QPdfSearchModel_rowCount(const QPdfSearchModel* self, QModelIndex* parent);
QVariant* QPdfSearchModel_data(const QPdfSearchModel* self, QModelIndex* index, int role);
void QPdfSearchModel_setSearchString(QPdfSearchModel* self, struct miqt_string searchString);
void QPdfSearchModel_setDocument(QPdfSearchModel* self, QPdfDocument* document);
void QPdfSearchModel_documentChanged(QPdfSearchModel* self);
void QPdfSearchModel_connect_documentChanged(QPdfSearchModel* self, intptr_t slot);
void QPdfSearchModel_searchStringChanged(QPdfSearchModel* self);
void QPdfSearchModel_connect_searchStringChanged(QPdfSearchModel* self, intptr_t slot);
void QPdfSearchModel_timerEvent(QPdfSearchModel* self, QTimerEvent* event);
struct miqt_string QPdfSearchModel_tr2(const char* s, const char* c);
struct miqt_string QPdfSearchModel_tr3(const char* s, const char* c, int n);
bool QPdfSearchModel_override_virtual_roleNames(void* self, intptr_t slot);
struct miqt_map /* of int to struct miqt_string */ QPdfSearchModel_virtualbase_roleNames(const void* self);
bool QPdfSearchModel_override_virtual_rowCount(void* self, intptr_t slot);
int QPdfSearchModel_virtualbase_rowCount(const void* self, QModelIndex* parent);
bool QPdfSearchModel_override_virtual_data(void* self, intptr_t slot);
QVariant* QPdfSearchModel_virtualbase_data(const void* self, QModelIndex* index, int role);
bool QPdfSearchModel_override_virtual_timerEvent(void* self, intptr_t slot);
void QPdfSearchModel_virtualbase_timerEvent(void* self, QTimerEvent* event);
bool QPdfSearchModel_override_virtual_index(void* self, intptr_t slot);
QModelIndex* QPdfSearchModel_virtualbase_index(const void* self, int row, int column, QModelIndex* parent);
bool QPdfSearchModel_override_virtual_sibling(void* self, intptr_t slot);
QModelIndex* QPdfSearchModel_virtualbase_sibling(const void* self, int row, int column, QModelIndex* idx);
bool QPdfSearchModel_override_virtual_dropMimeData(void* self, intptr_t slot);
bool QPdfSearchModel_virtualbase_dropMimeData(void* self, QMimeData* data, int action, int row, int column, QModelIndex* parent);
bool QPdfSearchModel_override_virtual_flags(void* self, intptr_t slot);
int QPdfSearchModel_virtualbase_flags(const void* self, QModelIndex* index);
bool QPdfSearchModel_override_virtual_setData(void* self, intptr_t slot);
bool QPdfSearchModel_virtualbase_setData(void* self, QModelIndex* index, QVariant* value, int role);
bool QPdfSearchModel_override_virtual_headerData(void* self, intptr_t slot);
QVariant* QPdfSearchModel_virtualbase_headerData(const void* self, int section, int orientation, int role);
bool QPdfSearchModel_override_virtual_setHeaderData(void* self, intptr_t slot);
bool QPdfSearchModel_virtualbase_setHeaderData(void* self, int section, int orientation, QVariant* value, int role);
bool QPdfSearchModel_override_virtual_itemData(void* self, intptr_t slot);
struct miqt_map /* of int to QVariant* */ QPdfSearchModel_virtualbase_itemData(const void* self, QModelIndex* index);
bool QPdfSearchModel_override_virtual_setItemData(void* self, intptr_t slot);
bool QPdfSearchModel_virtualbase_setItemData(void* self, QModelIndex* index, struct miqt_map /* of int to QVariant* */ roles);
bool QPdfSearchModel_override_virtual_clearItemData(void* self, intptr_t slot);
bool QPdfSearchModel_virtualbase_clearItemData(void* self, QModelIndex* index);
bool QPdfSearchModel_override_virtual_mimeTypes(void* self, intptr_t slot);
struct miqt_array /* of struct miqt_string */ QPdfSearchModel_virtualbase_mimeTypes(const void* self);
bool QPdfSearchModel_override_virtual_mimeData(void* self, intptr_t slot);
QMimeData* QPdfSearchModel_virtualbase_mimeData(const void* self, struct miqt_array /* of QModelIndex* */ indexes);
bool QPdfSearchModel_override_virtual_canDropMimeData(void* self, intptr_t slot);
bool QPdfSearchModel_virtualbase_canDropMimeData(const void* self, QMimeData* data, int action, int row, int column, QModelIndex* parent);
bool QPdfSearchModel_override_virtual_supportedDropActions(void* self, intptr_t slot);
int QPdfSearchModel_virtualbase_supportedDropActions(const void* self);
bool QPdfSearchModel_override_virtual_supportedDragActions(void* self, intptr_t slot);
int QPdfSearchModel_virtualbase_supportedDragActions(const void* self);
bool QPdfSearchModel_override_virtual_insertRows(void* self, intptr_t slot);
bool QPdfSearchModel_virtualbase_insertRows(void* self, int row, int count, QModelIndex* parent);
bool QPdfSearchModel_override_virtual_insertColumns(void* self, intptr_t slot);
bool QPdfSearchModel_virtualbase_insertColumns(void* self, int column, int count, QModelIndex* parent);
bool QPdfSearchModel_override_virtual_removeRows(void* self, intptr_t slot);
bool QPdfSearchModel_virtualbase_removeRows(void* self, int row, int count, QModelIndex* parent);
bool QPdfSearchModel_override_virtual_removeColumns(void* self, intptr_t slot);
bool QPdfSearchModel_virtualbase_removeColumns(void* self, int column, int count, QModelIndex* parent);
bool QPdfSearchModel_override_virtual_moveRows(void* self, intptr_t slot);
bool QPdfSearchModel_virtualbase_moveRows(void* self, QModelIndex* sourceParent, int sourceRow, int count, QModelIndex* destinationParent, int destinationChild);
bool QPdfSearchModel_override_virtual_moveColumns(void* self, intptr_t slot);
bool QPdfSearchModel_virtualbase_moveColumns(void* self, QModelIndex* sourceParent, int sourceColumn, int count, QModelIndex* destinationParent, int destinationChild);
bool QPdfSearchModel_override_virtual_fetchMore(void* self, intptr_t slot);
void QPdfSearchModel_virtualbase_fetchMore(void* self, QModelIndex* parent);
bool QPdfSearchModel_override_virtual_canFetchMore(void* self, intptr_t slot);
bool QPdfSearchModel_virtualbase_canFetchMore(const void* self, QModelIndex* parent);
bool QPdfSearchModel_override_virtual_sort(void* self, intptr_t slot);
void QPdfSearchModel_virtualbase_sort(void* self, int column, int order);
bool QPdfSearchModel_override_virtual_buddy(void* self, intptr_t slot);
QModelIndex* QPdfSearchModel_virtualbase_buddy(const void* self, QModelIndex* index);
bool QPdfSearchModel_override_virtual_match(void* self, intptr_t slot);
struct miqt_array /* of QModelIndex* */ QPdfSearchModel_virtualbase_match(const void* self, QModelIndex* start, int role, QVariant* value, int hits, int flags);
bool QPdfSearchModel_override_virtual_span(void* self, intptr_t slot);
QSize* QPdfSearchModel_virtualbase_span(const void* self, QModelIndex* index);
bool QPdfSearchModel_override_virtual_multiData(void* self, intptr_t slot);
void QPdfSearchModel_virtualbase_multiData(const void* self, QModelIndex* index, QModelRoleDataSpan* roleDataSpan);
bool QPdfSearchModel_override_virtual_submit(void* self, intptr_t slot);
bool QPdfSearchModel_virtualbase_submit(void* self);
bool QPdfSearchModel_override_virtual_revert(void* self, intptr_t slot);
void QPdfSearchModel_virtualbase_revert(void* self);
bool QPdfSearchModel_override_virtual_resetInternalData(void* self, intptr_t slot);
void QPdfSearchModel_virtualbase_resetInternalData(void* self);
bool QPdfSearchModel_override_virtual_event(void* self, intptr_t slot);
bool QPdfSearchModel_virtualbase_event(void* self, QEvent* event);
bool QPdfSearchModel_override_virtual_eventFilter(void* self, intptr_t slot);
bool QPdfSearchModel_virtualbase_eventFilter(void* self, QObject* watched, QEvent* event);
bool QPdfSearchModel_override_virtual_childEvent(void* self, intptr_t slot);
void QPdfSearchModel_virtualbase_childEvent(void* self, QChildEvent* event);
bool QPdfSearchModel_override_virtual_customEvent(void* self, intptr_t slot);
void QPdfSearchModel_virtualbase_customEvent(void* self, QEvent* event);
bool QPdfSearchModel_override_virtual_connectNotify(void* self, intptr_t slot);
void QPdfSearchModel_virtualbase_connectNotify(void* self, QMetaMethod* signal);
bool QPdfSearchModel_override_virtual_disconnectNotify(void* self, intptr_t slot);
void QPdfSearchModel_virtualbase_disconnectNotify(void* self, QMetaMethod* signal);
void QPdfSearchModel_protectedbase_updatePage(bool* _dynamic_cast_ok, void* self, int page);
QModelIndex* QPdfSearchModel_protectedbase_createIndex(bool* _dynamic_cast_ok, const void* self, int row, int column);
void QPdfSearchModel_protectedbase_encodeData(bool* _dynamic_cast_ok, const void* self, struct miqt_array /* of QModelIndex* */ indexes, QDataStream* stream);
bool QPdfSearchModel_protectedbase_decodeData(bool* _dynamic_cast_ok, void* self, int row, int column, QModelIndex* parent, QDataStream* stream);
void QPdfSearchModel_protectedbase_beginInsertRows(bool* _dynamic_cast_ok, void* self, QModelIndex* parent, int first, int last);
void QPdfSearchModel_protectedbase_endInsertRows(bool* _dynamic_cast_ok, void* self);
void QPdfSearchModel_protectedbase_beginRemoveRows(bool* _dynamic_cast_ok, void* self, QModelIndex* parent, int first, int last);
void QPdfSearchModel_protectedbase_endRemoveRows(bool* _dynamic_cast_ok, void* self);
bool QPdfSearchModel_protectedbase_beginMoveRows(bool* _dynamic_cast_ok, void* self, QModelIndex* sourceParent, int sourceFirst, int sourceLast, QModelIndex* destinationParent, int destinationRow);
void QPdfSearchModel_protectedbase_endMoveRows(bool* _dynamic_cast_ok, void* self);
void QPdfSearchModel_protectedbase_beginInsertColumns(bool* _dynamic_cast_ok, void* self, QModelIndex* parent, int first, int last);
void QPdfSearchModel_protectedbase_endInsertColumns(bool* _dynamic_cast_ok, void* self);
void QPdfSearchModel_protectedbase_beginRemoveColumns(bool* _dynamic_cast_ok, void* self, QModelIndex* parent, int first, int last);
void QPdfSearchModel_protectedbase_endRemoveColumns(bool* _dynamic_cast_ok, void* self);
bool QPdfSearchModel_protectedbase_beginMoveColumns(bool* _dynamic_cast_ok, void* self, QModelIndex* sourceParent, int sourceFirst, int sourceLast, QModelIndex* destinationParent, int destinationColumn);
void QPdfSearchModel_protectedbase_endMoveColumns(bool* _dynamic_cast_ok, void* self);
void QPdfSearchModel_protectedbase_beginResetModel(bool* _dynamic_cast_ok, void* self);
void QPdfSearchModel_protectedbase_endResetModel(bool* _dynamic_cast_ok, void* self);
void QPdfSearchModel_protectedbase_changePersistentIndex(bool* _dynamic_cast_ok, void* self, QModelIndex* from, QModelIndex* to);
void QPdfSearchModel_protectedbase_changePersistentIndexList(bool* _dynamic_cast_ok, void* self, struct miqt_array /* of QModelIndex* */ from, struct miqt_array /* of QModelIndex* */ to);
struct miqt_array /* of QModelIndex* */ QPdfSearchModel_protectedbase_persistentIndexList(bool* _dynamic_cast_ok, const void* self);
QObject* QPdfSearchModel_protectedbase_sender(bool* _dynamic_cast_ok, const void* self);
int QPdfSearchModel_protectedbase_senderSignalIndex(bool* _dynamic_cast_ok, const void* self);
int QPdfSearchModel_protectedbase_receivers(bool* _dynamic_cast_ok, const void* self, const char* signal);
bool QPdfSearchModel_protectedbase_isSignalConnected(bool* _dynamic_cast_ok, const void* self, QMetaMethod* signal);
void QPdfSearchModel_delete(QPdfSearchModel* self);
#ifdef __cplusplus
} /* extern C */
#endif
#endif

View File

@ -0,0 +1,67 @@
#include <QPdfSelection>
#include <QRectF>
#include <QString>
#include <QByteArray>
#include <cstring>
#include <qpdfselection.h>
#include "gen_qpdfselection.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
} /* extern C */
#endif
QPdfSelection* QPdfSelection_new(QPdfSelection* other) {
return new QPdfSelection(*other);
}
void QPdfSelection_operatorAssign(QPdfSelection* self, QPdfSelection* other) {
self->operator=(*other);
}
void QPdfSelection_swap(QPdfSelection* self, QPdfSelection* other) {
self->swap(*other);
}
bool QPdfSelection_isValid(const QPdfSelection* self) {
return self->isValid();
}
struct miqt_string QPdfSelection_text(const QPdfSelection* self) {
QString _ret = self->text();
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
struct miqt_string _ms;
_ms.len = _b.length();
_ms.data = static_cast<char*>(malloc(_ms.len));
memcpy(_ms.data, _b.data(), _ms.len);
return _ms;
}
QRectF* QPdfSelection_boundingRectangle(const QPdfSelection* self) {
return new QRectF(self->boundingRectangle());
}
int QPdfSelection_startIndex(const QPdfSelection* self) {
return self->startIndex();
}
int QPdfSelection_endIndex(const QPdfSelection* self) {
return self->endIndex();
}
void QPdfSelection_copyToClipboard(const QPdfSelection* self) {
self->copyToClipboard();
}
void QPdfSelection_copyToClipboardWithMode(const QPdfSelection* self, int mode) {
self->copyToClipboard(static_cast<QClipboard::Mode>(mode));
}
void QPdfSelection_delete(QPdfSelection* self) {
delete self;
}

View File

@ -0,0 +1,108 @@
package pdf
/*
#include "gen_qpdfselection.h"
#include <stdlib.h>
*/
import "C"
import (
"github.com/mappu/miqt/qt6"
"runtime"
"unsafe"
)
type QPdfSelection struct {
h *C.QPdfSelection
}
func (this *QPdfSelection) cPointer() *C.QPdfSelection {
if this == nil {
return nil
}
return this.h
}
func (this *QPdfSelection) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
// newQPdfSelection constructs the type using only CGO pointers.
func newQPdfSelection(h *C.QPdfSelection) *QPdfSelection {
if h == nil {
return nil
}
return &QPdfSelection{h: h}
}
// UnsafeNewQPdfSelection constructs the type using only unsafe pointers.
func UnsafeNewQPdfSelection(h unsafe.Pointer) *QPdfSelection {
return newQPdfSelection((*C.QPdfSelection)(h))
}
// NewQPdfSelection constructs a new QPdfSelection object.
func NewQPdfSelection(other *QPdfSelection) *QPdfSelection {
return newQPdfSelection(C.QPdfSelection_new(other.cPointer()))
}
func (this *QPdfSelection) OperatorAssign(other *QPdfSelection) {
C.QPdfSelection_operatorAssign(this.h, other.cPointer())
}
func (this *QPdfSelection) Swap(other *QPdfSelection) {
C.QPdfSelection_swap(this.h, other.cPointer())
}
func (this *QPdfSelection) IsValid() bool {
return (bool)(C.QPdfSelection_isValid(this.h))
}
func (this *QPdfSelection) Text() string {
var _ms C.struct_miqt_string = C.QPdfSelection_text(this.h)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func (this *QPdfSelection) BoundingRectangle() *qt6.QRectF {
_goptr := qt6.UnsafeNewQRectF(unsafe.Pointer(C.QPdfSelection_boundingRectangle(this.h)))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QPdfSelection) StartIndex() int {
return (int)(C.QPdfSelection_startIndex(this.h))
}
func (this *QPdfSelection) EndIndex() int {
return (int)(C.QPdfSelection_endIndex(this.h))
}
func (this *QPdfSelection) CopyToClipboard() {
C.QPdfSelection_copyToClipboard(this.h)
}
func (this *QPdfSelection) CopyToClipboardWithMode(mode qt6.QClipboard__Mode) {
C.QPdfSelection_copyToClipboardWithMode(this.h, (C.int)(mode))
}
// Delete this object from C++ memory.
func (this *QPdfSelection) Delete() {
C.QPdfSelection_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 *QPdfSelection) GoGC() {
runtime.SetFinalizer(this, func(this *QPdfSelection) {
this.Delete()
runtime.KeepAlive(this.h)
})
}

View File

@ -0,0 +1,41 @@
#pragma once
#ifndef MIQT_QT6_PDF_GEN_QPDFSELECTION_H
#define MIQT_QT6_PDF_GEN_QPDFSELECTION_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 QPdfSelection;
class QRectF;
#else
typedef struct QPdfSelection QPdfSelection;
typedef struct QRectF QRectF;
#endif
QPdfSelection* QPdfSelection_new(QPdfSelection* other);
void QPdfSelection_operatorAssign(QPdfSelection* self, QPdfSelection* other);
void QPdfSelection_swap(QPdfSelection* self, QPdfSelection* other);
bool QPdfSelection_isValid(const QPdfSelection* self);
struct miqt_string QPdfSelection_text(const QPdfSelection* self);
QRectF* QPdfSelection_boundingRectangle(const QPdfSelection* self);
int QPdfSelection_startIndex(const QPdfSelection* self);
int QPdfSelection_endIndex(const QPdfSelection* self);
void QPdfSelection_copyToClipboard(const QPdfSelection* self);
void QPdfSelection_copyToClipboardWithMode(const QPdfSelection* self, int mode);
void QPdfSelection_delete(QPdfSelection* self);
#ifdef __cplusplus
} /* extern C */
#endif
#endif

2286
qt6/pdf/gen_qpdfview.cpp Normal file

File diff suppressed because it is too large Load Diff

1860
qt6/pdf/gen_qpdfview.go Normal file

File diff suppressed because it is too large Load Diff

257
qt6/pdf/gen_qpdfview.h Normal file
View File

@ -0,0 +1,257 @@
#pragma once
#ifndef MIQT_QT6_PDF_GEN_QPDFVIEW_H
#define MIQT_QT6_PDF_GEN_QPDFVIEW_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 QAbstractScrollArea;
class QActionEvent;
class QChildEvent;
class QCloseEvent;
class QContextMenuEvent;
class QDragEnterEvent;
class QDragLeaveEvent;
class QDragMoveEvent;
class QDropEvent;
class QEnterEvent;
class QEvent;
class QFocusEvent;
class QFrame;
class QHideEvent;
class QInputMethodEvent;
class QKeyEvent;
class QMargins;
class QMetaMethod;
class QMetaObject;
class QMouseEvent;
class QMoveEvent;
class QObject;
class QPaintDevice;
class QPaintEngine;
class QPaintEvent;
class QPainter;
class QPdfDocument;
class QPdfPageNavigator;
class QPdfView;
class QPoint;
class QResizeEvent;
class QShowEvent;
class QSize;
class QStyleOptionFrame;
class QTabletEvent;
class QTimerEvent;
class QVariant;
class QWheelEvent;
class QWidget;
#else
typedef struct QAbstractScrollArea QAbstractScrollArea;
typedef struct QActionEvent QActionEvent;
typedef struct QChildEvent QChildEvent;
typedef struct QCloseEvent QCloseEvent;
typedef struct QContextMenuEvent QContextMenuEvent;
typedef struct QDragEnterEvent QDragEnterEvent;
typedef struct QDragLeaveEvent QDragLeaveEvent;
typedef struct QDragMoveEvent QDragMoveEvent;
typedef struct QDropEvent QDropEvent;
typedef struct QEnterEvent QEnterEvent;
typedef struct QEvent QEvent;
typedef struct QFocusEvent QFocusEvent;
typedef struct QFrame QFrame;
typedef struct QHideEvent QHideEvent;
typedef struct QInputMethodEvent QInputMethodEvent;
typedef struct QKeyEvent QKeyEvent;
typedef struct QMargins QMargins;
typedef struct QMetaMethod QMetaMethod;
typedef struct QMetaObject QMetaObject;
typedef struct QMouseEvent QMouseEvent;
typedef struct QMoveEvent QMoveEvent;
typedef struct QObject QObject;
typedef struct QPaintDevice QPaintDevice;
typedef struct QPaintEngine QPaintEngine;
typedef struct QPaintEvent QPaintEvent;
typedef struct QPainter QPainter;
typedef struct QPdfDocument QPdfDocument;
typedef struct QPdfPageNavigator QPdfPageNavigator;
typedef struct QPdfView QPdfView;
typedef struct QPoint QPoint;
typedef struct QResizeEvent QResizeEvent;
typedef struct QShowEvent QShowEvent;
typedef struct QSize QSize;
typedef struct QStyleOptionFrame QStyleOptionFrame;
typedef struct QTabletEvent QTabletEvent;
typedef struct QTimerEvent QTimerEvent;
typedef struct QVariant QVariant;
typedef struct QWheelEvent QWheelEvent;
typedef struct QWidget QWidget;
#endif
QPdfView* QPdfView_new(QWidget* parent);
QPdfView* QPdfView_new2();
void QPdfView_virtbase(QPdfView* src, QAbstractScrollArea** outptr_QAbstractScrollArea);
QMetaObject* QPdfView_metaObject(const QPdfView* self);
void* QPdfView_metacast(QPdfView* self, const char* param1);
struct miqt_string QPdfView_tr(const char* s);
void QPdfView_setDocument(QPdfView* self, QPdfDocument* document);
QPdfDocument* QPdfView_document(const QPdfView* self);
QPdfPageNavigator* QPdfView_pageNavigator(const QPdfView* self);
int QPdfView_pageMode(const QPdfView* self);
int QPdfView_zoomMode(const QPdfView* self);
double QPdfView_zoomFactor(const QPdfView* self);
int QPdfView_pageSpacing(const QPdfView* self);
void QPdfView_setPageSpacing(QPdfView* self, int spacing);
QMargins* QPdfView_documentMargins(const QPdfView* self);
void QPdfView_setDocumentMargins(QPdfView* self, QMargins* margins);
void QPdfView_setPageMode(QPdfView* self, int mode);
void QPdfView_setZoomMode(QPdfView* self, int mode);
void QPdfView_setZoomFactor(QPdfView* self, double factor);
void QPdfView_documentChanged(QPdfView* self, QPdfDocument* document);
void QPdfView_connect_documentChanged(QPdfView* self, intptr_t slot);
void QPdfView_pageModeChanged(QPdfView* self, int pageMode);
void QPdfView_connect_pageModeChanged(QPdfView* self, intptr_t slot);
void QPdfView_zoomModeChanged(QPdfView* self, int zoomMode);
void QPdfView_connect_zoomModeChanged(QPdfView* self, intptr_t slot);
void QPdfView_zoomFactorChanged(QPdfView* self, double zoomFactor);
void QPdfView_connect_zoomFactorChanged(QPdfView* self, intptr_t slot);
void QPdfView_pageSpacingChanged(QPdfView* self, int pageSpacing);
void QPdfView_connect_pageSpacingChanged(QPdfView* self, intptr_t slot);
void QPdfView_documentMarginsChanged(QPdfView* self, QMargins* documentMargins);
void QPdfView_connect_documentMarginsChanged(QPdfView* self, intptr_t slot);
void QPdfView_paintEvent(QPdfView* self, QPaintEvent* event);
void QPdfView_resizeEvent(QPdfView* self, QResizeEvent* event);
void QPdfView_scrollContentsBy(QPdfView* self, int dx, int dy);
struct miqt_string QPdfView_tr2(const char* s, const char* c);
struct miqt_string QPdfView_tr3(const char* s, const char* c, int n);
bool QPdfView_override_virtual_paintEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_paintEvent(void* self, QPaintEvent* event);
bool QPdfView_override_virtual_resizeEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_resizeEvent(void* self, QResizeEvent* event);
bool QPdfView_override_virtual_scrollContentsBy(void* self, intptr_t slot);
void QPdfView_virtualbase_scrollContentsBy(void* self, int dx, int dy);
bool QPdfView_override_virtual_minimumSizeHint(void* self, intptr_t slot);
QSize* QPdfView_virtualbase_minimumSizeHint(const void* self);
bool QPdfView_override_virtual_sizeHint(void* self, intptr_t slot);
QSize* QPdfView_virtualbase_sizeHint(const void* self);
bool QPdfView_override_virtual_setupViewport(void* self, intptr_t slot);
void QPdfView_virtualbase_setupViewport(void* self, QWidget* viewport);
bool QPdfView_override_virtual_eventFilter(void* self, intptr_t slot);
bool QPdfView_virtualbase_eventFilter(void* self, QObject* param1, QEvent* param2);
bool QPdfView_override_virtual_event(void* self, intptr_t slot);
bool QPdfView_virtualbase_event(void* self, QEvent* param1);
bool QPdfView_override_virtual_viewportEvent(void* self, intptr_t slot);
bool QPdfView_virtualbase_viewportEvent(void* self, QEvent* param1);
bool QPdfView_override_virtual_mousePressEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_mousePressEvent(void* self, QMouseEvent* param1);
bool QPdfView_override_virtual_mouseReleaseEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_mouseReleaseEvent(void* self, QMouseEvent* param1);
bool QPdfView_override_virtual_mouseDoubleClickEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_mouseDoubleClickEvent(void* self, QMouseEvent* param1);
bool QPdfView_override_virtual_mouseMoveEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_mouseMoveEvent(void* self, QMouseEvent* param1);
bool QPdfView_override_virtual_wheelEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_wheelEvent(void* self, QWheelEvent* param1);
bool QPdfView_override_virtual_contextMenuEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_contextMenuEvent(void* self, QContextMenuEvent* param1);
bool QPdfView_override_virtual_dragEnterEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_dragEnterEvent(void* self, QDragEnterEvent* param1);
bool QPdfView_override_virtual_dragMoveEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_dragMoveEvent(void* self, QDragMoveEvent* param1);
bool QPdfView_override_virtual_dragLeaveEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_dragLeaveEvent(void* self, QDragLeaveEvent* param1);
bool QPdfView_override_virtual_dropEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_dropEvent(void* self, QDropEvent* param1);
bool QPdfView_override_virtual_keyPressEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_keyPressEvent(void* self, QKeyEvent* param1);
bool QPdfView_override_virtual_viewportSizeHint(void* self, intptr_t slot);
QSize* QPdfView_virtualbase_viewportSizeHint(const void* self);
bool QPdfView_override_virtual_changeEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_changeEvent(void* self, QEvent* param1);
bool QPdfView_override_virtual_initStyleOption(void* self, intptr_t slot);
void QPdfView_virtualbase_initStyleOption(const void* self, QStyleOptionFrame* option);
bool QPdfView_override_virtual_devType(void* self, intptr_t slot);
int QPdfView_virtualbase_devType(const void* self);
bool QPdfView_override_virtual_setVisible(void* self, intptr_t slot);
void QPdfView_virtualbase_setVisible(void* self, bool visible);
bool QPdfView_override_virtual_heightForWidth(void* self, intptr_t slot);
int QPdfView_virtualbase_heightForWidth(const void* self, int param1);
bool QPdfView_override_virtual_hasHeightForWidth(void* self, intptr_t slot);
bool QPdfView_virtualbase_hasHeightForWidth(const void* self);
bool QPdfView_override_virtual_paintEngine(void* self, intptr_t slot);
QPaintEngine* QPdfView_virtualbase_paintEngine(const void* self);
bool QPdfView_override_virtual_keyReleaseEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_keyReleaseEvent(void* self, QKeyEvent* event);
bool QPdfView_override_virtual_focusInEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_focusInEvent(void* self, QFocusEvent* event);
bool QPdfView_override_virtual_focusOutEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_focusOutEvent(void* self, QFocusEvent* event);
bool QPdfView_override_virtual_enterEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_enterEvent(void* self, QEnterEvent* event);
bool QPdfView_override_virtual_leaveEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_leaveEvent(void* self, QEvent* event);
bool QPdfView_override_virtual_moveEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_moveEvent(void* self, QMoveEvent* event);
bool QPdfView_override_virtual_closeEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_closeEvent(void* self, QCloseEvent* event);
bool QPdfView_override_virtual_tabletEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_tabletEvent(void* self, QTabletEvent* event);
bool QPdfView_override_virtual_actionEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_actionEvent(void* self, QActionEvent* event);
bool QPdfView_override_virtual_showEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_showEvent(void* self, QShowEvent* event);
bool QPdfView_override_virtual_hideEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_hideEvent(void* self, QHideEvent* event);
bool QPdfView_override_virtual_nativeEvent(void* self, intptr_t slot);
bool QPdfView_virtualbase_nativeEvent(void* self, struct miqt_string eventType, void* message, intptr_t* result);
bool QPdfView_override_virtual_metric(void* self, intptr_t slot);
int QPdfView_virtualbase_metric(const void* self, int param1);
bool QPdfView_override_virtual_initPainter(void* self, intptr_t slot);
void QPdfView_virtualbase_initPainter(const void* self, QPainter* painter);
bool QPdfView_override_virtual_redirected(void* self, intptr_t slot);
QPaintDevice* QPdfView_virtualbase_redirected(const void* self, QPoint* offset);
bool QPdfView_override_virtual_sharedPainter(void* self, intptr_t slot);
QPainter* QPdfView_virtualbase_sharedPainter(const void* self);
bool QPdfView_override_virtual_inputMethodEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_inputMethodEvent(void* self, QInputMethodEvent* param1);
bool QPdfView_override_virtual_inputMethodQuery(void* self, intptr_t slot);
QVariant* QPdfView_virtualbase_inputMethodQuery(const void* self, int param1);
bool QPdfView_override_virtual_focusNextPrevChild(void* self, intptr_t slot);
bool QPdfView_virtualbase_focusNextPrevChild(void* self, bool next);
bool QPdfView_override_virtual_timerEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_timerEvent(void* self, QTimerEvent* event);
bool QPdfView_override_virtual_childEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_childEvent(void* self, QChildEvent* event);
bool QPdfView_override_virtual_customEvent(void* self, intptr_t slot);
void QPdfView_virtualbase_customEvent(void* self, QEvent* event);
bool QPdfView_override_virtual_connectNotify(void* self, intptr_t slot);
void QPdfView_virtualbase_connectNotify(void* self, QMetaMethod* signal);
bool QPdfView_override_virtual_disconnectNotify(void* self, intptr_t slot);
void QPdfView_virtualbase_disconnectNotify(void* self, QMetaMethod* signal);
void QPdfView_protectedbase_setViewportMargins(bool* _dynamic_cast_ok, void* self, int left, int top, int right, int bottom);
QMargins* QPdfView_protectedbase_viewportMargins(bool* _dynamic_cast_ok, const void* self);
void QPdfView_protectedbase_drawFrame(bool* _dynamic_cast_ok, void* self, QPainter* param1);
void QPdfView_protectedbase_updateMicroFocus(bool* _dynamic_cast_ok, void* self);
void QPdfView_protectedbase_create(bool* _dynamic_cast_ok, void* self);
void QPdfView_protectedbase_destroy(bool* _dynamic_cast_ok, void* self);
bool QPdfView_protectedbase_focusNextChild(bool* _dynamic_cast_ok, void* self);
bool QPdfView_protectedbase_focusPreviousChild(bool* _dynamic_cast_ok, void* self);
QObject* QPdfView_protectedbase_sender(bool* _dynamic_cast_ok, const void* self);
int QPdfView_protectedbase_senderSignalIndex(bool* _dynamic_cast_ok, const void* self);
int QPdfView_protectedbase_receivers(bool* _dynamic_cast_ok, const void* self, const char* signal);
bool QPdfView_protectedbase_isSignalConnected(bool* _dynamic_cast_ok, const void* self, QMetaMethod* signal);
void QPdfView_delete(QPdfView* self);
#ifdef __cplusplus
} /* extern C */
#endif
#endif