2024-08-25 04:08:24 +00:00
|
|
|
package qt
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qoffscreensurface.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
import (
|
|
|
|
"runtime"
|
|
|
|
"runtime/cgo"
|
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
|
|
|
type QOffscreenSurface struct {
|
|
|
|
h *C.QOffscreenSurface
|
|
|
|
*QObject
|
|
|
|
*QSurface
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QOffscreenSurface) cPointer() *C.QOffscreenSurface {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
|
|
|
func newQOffscreenSurface(h *C.QOffscreenSurface) *QOffscreenSurface {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
return &QOffscreenSurface{h: h, QObject: newQObject_U(unsafe.Pointer(h)), QSurface: newQSurface_U(unsafe.Pointer(h))}
|
|
|
|
}
|
|
|
|
|
|
|
|
func newQOffscreenSurface_U(h unsafe.Pointer) *QOffscreenSurface {
|
|
|
|
return newQOffscreenSurface((*C.QOffscreenSurface)(h))
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQOffscreenSurface constructs a new QOffscreenSurface object.
|
|
|
|
func NewQOffscreenSurface(screen *QScreen, parent *QObject) *QOffscreenSurface {
|
|
|
|
ret := C.QOffscreenSurface_new(screen.cPointer(), parent.cPointer())
|
|
|
|
return newQOffscreenSurface(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQOffscreenSurface2 constructs a new QOffscreenSurface object.
|
|
|
|
func NewQOffscreenSurface2() *QOffscreenSurface {
|
|
|
|
ret := C.QOffscreenSurface_new2()
|
|
|
|
return newQOffscreenSurface(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQOffscreenSurface3 constructs a new QOffscreenSurface object.
|
|
|
|
func NewQOffscreenSurface3(screen *QScreen) *QOffscreenSurface {
|
|
|
|
ret := C.QOffscreenSurface_new3(screen.cPointer())
|
|
|
|
return newQOffscreenSurface(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QOffscreenSurface) MetaObject() *QMetaObject {
|
2024-09-17 07:30:27 +00:00
|
|
|
return newQMetaObject_U(unsafe.Pointer(C.QOffscreenSurface_MetaObject(this.h)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-20 22:32:57 +00:00
|
|
|
func (this *QOffscreenSurface) Metacast(param1 string) unsafe.Pointer {
|
|
|
|
param1_Cstring := C.CString(param1)
|
|
|
|
defer C.free(unsafe.Pointer(param1_Cstring))
|
|
|
|
return C.QOffscreenSurface_Metacast(this.h, param1_Cstring)
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func QOffscreenSurface_Tr(s string) string {
|
|
|
|
s_Cstring := C.CString(s)
|
|
|
|
defer C.free(unsafe.Pointer(s_Cstring))
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QOffscreenSurface_Tr(s_Cstring)
|
|
|
|
_ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QOffscreenSurface_TrUtf8(s string) string {
|
|
|
|
s_Cstring := C.CString(s)
|
|
|
|
defer C.free(unsafe.Pointer(s_Cstring))
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QOffscreenSurface_TrUtf8(s_Cstring)
|
|
|
|
_ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QOffscreenSurface) SurfaceType() QSurface__SurfaceType {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (QSurface__SurfaceType)(C.QOffscreenSurface_SurfaceType(this.h))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QOffscreenSurface) Create() {
|
|
|
|
C.QOffscreenSurface_Create(this.h)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QOffscreenSurface) Destroy() {
|
|
|
|
C.QOffscreenSurface_Destroy(this.h)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QOffscreenSurface) IsValid() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QOffscreenSurface_IsValid(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QOffscreenSurface) SetFormat(format *QSurfaceFormat) {
|
|
|
|
C.QOffscreenSurface_SetFormat(this.h, format.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QOffscreenSurface) Format() *QSurfaceFormat {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QOffscreenSurface_Format(this.h)
|
|
|
|
_goptr := newQSurfaceFormat(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QOffscreenSurface) RequestedFormat() *QSurfaceFormat {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QOffscreenSurface_RequestedFormat(this.h)
|
|
|
|
_goptr := newQSurfaceFormat(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QOffscreenSurface) Size() *QSize {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QOffscreenSurface_Size(this.h)
|
|
|
|
_goptr := newQSize(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QOffscreenSurface) Screen() *QScreen {
|
2024-09-17 07:30:27 +00:00
|
|
|
return newQScreen_U(unsafe.Pointer(C.QOffscreenSurface_Screen(this.h)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QOffscreenSurface) SetScreen(screen *QScreen) {
|
|
|
|
C.QOffscreenSurface_SetScreen(this.h, screen.cPointer())
|
|
|
|
}
|
|
|
|
|
2024-09-20 22:32:57 +00:00
|
|
|
func (this *QOffscreenSurface) NativeHandle() unsafe.Pointer {
|
|
|
|
return C.QOffscreenSurface_NativeHandle(this.h)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QOffscreenSurface) SetNativeHandle(handle unsafe.Pointer) {
|
|
|
|
C.QOffscreenSurface_SetNativeHandle(this.h, handle)
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QOffscreenSurface) ScreenChanged(screen *QScreen) {
|
|
|
|
C.QOffscreenSurface_ScreenChanged(this.h, screen.cPointer())
|
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
func (this *QOffscreenSurface) OnScreenChanged(slot func(screen *QScreen)) {
|
2024-10-13 06:06:06 +00:00
|
|
|
C.QOffscreenSurface_connect_ScreenChanged(this.h, C.intptr_t(cgo.NewHandle(slot)))
|
2024-09-14 22:29:05 +00:00
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
//export miqt_exec_callback_QOffscreenSurface_ScreenChanged
|
2024-10-13 06:06:06 +00:00
|
|
|
func miqt_exec_callback_QOffscreenSurface_ScreenChanged(cb C.intptr_t, screen *C.QScreen) {
|
|
|
|
gofunc, ok := cgo.Handle(cb).Value().(func(screen *QScreen))
|
2024-09-14 22:29:05 +00:00
|
|
|
if !ok {
|
|
|
|
panic("miqt: callback of non-callback type (heap corruption?)")
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
// Convert all CABI parameters to Go parameters
|
2024-09-17 07:30:27 +00:00
|
|
|
slotval1 := newQScreen_U(unsafe.Pointer(screen))
|
2024-09-14 22:29:05 +00:00
|
|
|
|
|
|
|
gofunc(slotval1)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QOffscreenSurface_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))
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QOffscreenSurface_Tr2(s_Cstring, c_Cstring)
|
|
|
|
_ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QOffscreenSurface_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))
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QOffscreenSurface_Tr3(s_Cstring, c_Cstring, (C.int)(n))
|
|
|
|
_ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QOffscreenSurface_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))
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QOffscreenSurface_TrUtf82(s_Cstring, c_Cstring)
|
|
|
|
_ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QOffscreenSurface_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))
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QOffscreenSurface_TrUtf83(s_Cstring, c_Cstring, (C.int)(n))
|
|
|
|
_ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
// Delete this object from C++ memory.
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QOffscreenSurface) Delete() {
|
|
|
|
C.QOffscreenSurface_Delete(this.h)
|
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
|
|
|
|
// 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 *QOffscreenSurface) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QOffscreenSurface) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|