miqt/qt6/gen_qsurface.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

45 lines
889 B
C++

#include <QSize>
#include <QSurface>
#include <QSurfaceFormat>
#include <qsurface.h>
#include "gen_qsurface.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
} /* extern C */
#endif
int QSurface_SurfaceClass(const QSurface* self) {
QSurface::SurfaceClass _ret = self->surfaceClass();
return static_cast<int>(_ret);
}
QSurfaceFormat* QSurface_Format(const QSurface* self) {
return new QSurfaceFormat(self->format());
}
int QSurface_SurfaceType(const QSurface* self) {
QSurface::SurfaceType _ret = self->surfaceType();
return static_cast<int>(_ret);
}
bool QSurface_SupportsOpenGL(const QSurface* self) {
return self->supportsOpenGL();
}
QSize* QSurface_Size(const QSurface* self) {
return new QSize(self->size());
}
void QSurface_Delete(QSurface* self, bool isSubclass) {
if (isSubclass) {
delete dynamic_cast<QSurface*>( self );
} else {
delete self;
}
}