miqt/qt/gen_qsurface.go

95 lines
2.0 KiB
Go
Raw Normal View History

package qt
/*
#include "gen_qsurface.h"
#include <stdlib.h>
*/
import "C"
import (
"runtime"
"unsafe"
)
2024-09-04 06:54:22 +00:00
type QSurface__SurfaceClass int
const (
2024-09-20 07:13:26 +00:00
QSurface__Window QSurface__SurfaceClass = 0
QSurface__Offscreen QSurface__SurfaceClass = 1
2024-09-04 06:54:22 +00:00
)
type QSurface__SurfaceType int
const (
2024-09-20 07:13:26 +00:00
QSurface__RasterSurface QSurface__SurfaceType = 0
QSurface__OpenGLSurface QSurface__SurfaceType = 1
QSurface__RasterGLSurface QSurface__SurfaceType = 2
QSurface__OpenVGSurface QSurface__SurfaceType = 3
QSurface__VulkanSurface QSurface__SurfaceType = 4
QSurface__MetalSurface QSurface__SurfaceType = 5
2024-09-04 06:54:22 +00:00
)
type QSurface struct {
h *C.QSurface
}
func (this *QSurface) cPointer() *C.QSurface {
if this == nil {
return nil
}
return this.h
}
func newQSurface(h *C.QSurface) *QSurface {
2024-09-01 02:23:55 +00:00
if h == nil {
return nil
}
return &QSurface{h: h}
}
func newQSurface_U(h unsafe.Pointer) *QSurface {
return newQSurface((*C.QSurface)(h))
}
2024-09-04 06:54:22 +00:00
func (this *QSurface) SurfaceClass() QSurface__SurfaceClass {
return (QSurface__SurfaceClass)(C.QSurface_SurfaceClass(this.h))
2024-08-29 07:01:51 +00:00
}
func (this *QSurface) Format() *QSurfaceFormat {
_ret := C.QSurface_Format(this.h)
_goptr := newQSurfaceFormat(_ret)
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
2024-09-04 06:54:22 +00:00
func (this *QSurface) SurfaceType() QSurface__SurfaceType {
return (QSurface__SurfaceType)(C.QSurface_SurfaceType(this.h))
2024-08-29 07:01:51 +00:00
}
func (this *QSurface) SupportsOpenGL() bool {
return (bool)(C.QSurface_SupportsOpenGL(this.h))
}
func (this *QSurface) Size() *QSize {
_ret := C.QSurface_Size(this.h)
_goptr := newQSize(_ret)
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
// Delete this object from C++ memory.
func (this *QSurface) Delete() {
C.QSurface_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 *QSurface) GoGC() {
runtime.SetFinalizer(this, func(this *QSurface) {
this.Delete()
runtime.KeepAlive(this.h)
})
}