miqt/qt/gen_qbackingstore.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

82 lines
1.8 KiB
C++

#include <QBackingStore>
#include <QPaintDevice>
#include <QPoint>
#include <QRegion>
#include <QSize>
#include <QWindow>
#include <qbackingstore.h>
#include "gen_qbackingstore.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
} /* extern C */
#endif
QBackingStore* QBackingStore_new(QWindow* window) {
return new QBackingStore(window);
}
QWindow* QBackingStore_Window(const QBackingStore* self) {
return self->window();
}
QPaintDevice* QBackingStore_PaintDevice(QBackingStore* self) {
return self->paintDevice();
}
void QBackingStore_Flush(QBackingStore* self, QRegion* region) {
self->flush(*region);
}
void QBackingStore_Resize(QBackingStore* self, QSize* size) {
self->resize(*size);
}
QSize* QBackingStore_Size(const QBackingStore* self) {
return new QSize(self->size());
}
bool QBackingStore_Scroll(QBackingStore* self, QRegion* area, int dx, int dy) {
return self->scroll(*area, static_cast<int>(dx), static_cast<int>(dy));
}
void QBackingStore_BeginPaint(QBackingStore* self, QRegion* param1) {
self->beginPaint(*param1);
}
void QBackingStore_EndPaint(QBackingStore* self) {
self->endPaint();
}
void QBackingStore_SetStaticContents(QBackingStore* self, QRegion* region) {
self->setStaticContents(*region);
}
QRegion* QBackingStore_StaticContents(const QBackingStore* self) {
return new QRegion(self->staticContents());
}
bool QBackingStore_HasStaticContents(const QBackingStore* self) {
return self->hasStaticContents();
}
void QBackingStore_Flush2(QBackingStore* self, QRegion* region, QWindow* window) {
self->flush(*region, window);
}
void QBackingStore_Flush3(QBackingStore* self, QRegion* region, QWindow* window, QPoint* offset) {
self->flush(*region, window, *offset);
}
void QBackingStore_Delete(QBackingStore* self, bool isSubclass) {
if (isSubclass) {
delete dynamic_cast<QBackingStore*>( self );
} else {
delete self;
}
}