miqt/qt-restricted-extras/qscintilla/gen_qscidocument.go

82 lines
1.7 KiB
Go
Raw Permalink Normal View History

2024-10-20 04:59:23 +00:00
package qscintilla
/*
#include "gen_qscidocument.h"
#include <stdlib.h>
*/
import "C"
import (
"runtime"
"unsafe"
)
type QsciDocument struct {
2024-11-19 06:29:06 +00:00
h *C.QsciDocument
isSubclass bool
2024-10-20 04:59:23 +00:00
}
func (this *QsciDocument) cPointer() *C.QsciDocument {
if this == nil {
return nil
}
return this.h
}
func (this *QsciDocument) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
2024-11-19 06:29:06 +00:00
// newQsciDocument constructs the type using only CGO pointers.
2024-10-20 04:59:23 +00:00
func newQsciDocument(h *C.QsciDocument) *QsciDocument {
if h == nil {
return nil
}
2024-12-07 04:15:57 +00:00
2024-10-20 04:59:23 +00:00
return &QsciDocument{h: h}
}
2024-11-19 06:29:06 +00:00
// UnsafeNewQsciDocument constructs the type using only unsafe pointers.
2024-10-20 04:59:23 +00:00
func UnsafeNewQsciDocument(h unsafe.Pointer) *QsciDocument {
2024-12-07 04:15:57 +00:00
return newQsciDocument((*C.QsciDocument)(h))
2024-10-20 04:59:23 +00:00
}
// NewQsciDocument constructs a new QsciDocument object.
func NewQsciDocument() *QsciDocument {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQsciDocument(C.QsciDocument_new())
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 04:59:23 +00:00
}
// NewQsciDocument2 constructs a new QsciDocument object.
func NewQsciDocument2(param1 *QsciDocument) *QsciDocument {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQsciDocument(C.QsciDocument_new2(param1.cPointer()))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 04:59:23 +00:00
}
func (this *QsciDocument) OperatorAssign(param1 *QsciDocument) {
C.QsciDocument_OperatorAssign(this.h, param1.cPointer())
}
// Delete this object from C++ memory.
func (this *QsciDocument) Delete() {
2024-11-19 06:29:06 +00:00
C.QsciDocument_Delete(this.h, C.bool(this.isSubclass))
2024-10-20 04:59:23 +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 *QsciDocument) GoGC() {
runtime.SetFinalizer(this, func(this *QsciDocument) {
this.Delete()
runtime.KeepAlive(this.h)
})
}