miqt/qt6/printsupport/gen_qprintengine.cpp
Jacek Sieka a0c6344ecd Avoid dependency on exported go header
The expected type of the callback is already known from the AST - this
change reduces dependency on cgo specifics and makes the generated C ABI
entirely cgo-independent - in particular, there is no need to include
`_cgo_export.h` any more.
2025-01-07 12:55:40 +01:00

51 lines
1.2 KiB
C++

#include <QPrintEngine>
#include <QVariant>
#include <qprintengine.h>
#include "gen_qprintengine.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
} /* extern C */
#endif
void QPrintEngine_SetProperty(QPrintEngine* self, int key, QVariant* value) {
self->setProperty(static_cast<QPrintEngine::PrintEnginePropertyKey>(key), *value);
}
QVariant* QPrintEngine_Property(const QPrintEngine* self, int key) {
return new QVariant(self->property(static_cast<QPrintEngine::PrintEnginePropertyKey>(key)));
}
bool QPrintEngine_NewPage(QPrintEngine* self) {
return self->newPage();
}
bool QPrintEngine_Abort(QPrintEngine* self) {
return self->abort();
}
int QPrintEngine_Metric(const QPrintEngine* self, int param1) {
return self->metric(static_cast<QPaintDevice::PaintDeviceMetric>(param1));
}
int QPrintEngine_PrinterState(const QPrintEngine* self) {
QPrinter::PrinterState _ret = self->printerState();
return static_cast<int>(_ret);
}
void QPrintEngine_OperatorAssign(QPrintEngine* self, QPrintEngine* param1) {
self->operator=(*param1);
}
void QPrintEngine_Delete(QPrintEngine* self, bool isSubclass) {
if (isSubclass) {
delete dynamic_cast<QPrintEngine*>( self );
} else {
delete self;
}
}