miqt/qt/gen_qstatictext.go

169 lines
4.2 KiB
Go
Raw Normal View History

package qt
/*
#include "gen_qstatictext.h"
#include <stdlib.h>
*/
import "C"
import (
"github.com/mappu/miqt/libmiqt"
"runtime"
"unsafe"
)
2024-09-04 06:54:22 +00:00
type QStaticText__PerformanceHint int
const (
2024-09-20 07:13:26 +00:00
QStaticText__ModerateCaching QStaticText__PerformanceHint = 0
QStaticText__AggressiveCaching QStaticText__PerformanceHint = 1
2024-09-04 06:54:22 +00:00
)
type QStaticText struct {
h *C.QStaticText
}
func (this *QStaticText) cPointer() *C.QStaticText {
if this == nil {
return nil
}
return this.h
}
func (this *QStaticText) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
func newQStaticText(h *C.QStaticText) *QStaticText {
2024-09-01 02:23:55 +00:00
if h == nil {
return nil
}
return &QStaticText{h: h}
}
func UnsafeNewQStaticText(h unsafe.Pointer) *QStaticText {
return newQStaticText((*C.QStaticText)(h))
}
// NewQStaticText constructs a new QStaticText object.
func NewQStaticText() *QStaticText {
ret := C.QStaticText_new()
return newQStaticText(ret)
}
// NewQStaticText2 constructs a new QStaticText object.
func NewQStaticText2(text string) *QStaticText {
text_ms := libmiqt.Strdupg(text)
defer C.free(text_ms)
ret := C.QStaticText_new2((*C.struct_miqt_string)(text_ms))
return newQStaticText(ret)
}
// NewQStaticText3 constructs a new QStaticText object.
func NewQStaticText3(other *QStaticText) *QStaticText {
ret := C.QStaticText_new3(other.cPointer())
return newQStaticText(ret)
}
func (this *QStaticText) OperatorAssign(param1 *QStaticText) {
C.QStaticText_OperatorAssign(this.h, param1.cPointer())
}
func (this *QStaticText) Swap(other *QStaticText) {
C.QStaticText_Swap(this.h, other.cPointer())
}
func (this *QStaticText) SetText(text string) {
text_ms := libmiqt.Strdupg(text)
defer C.free(text_ms)
C.QStaticText_SetText(this.h, (*C.struct_miqt_string)(text_ms))
}
func (this *QStaticText) Text() string {
var _ms *C.struct_miqt_string = C.QStaticText_Text(this.h)
_ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms))
return _ret
}
2024-09-04 06:54:22 +00:00
func (this *QStaticText) SetTextFormat(textFormat TextFormat) {
C.QStaticText_SetTextFormat(this.h, (C.int)(textFormat))
2024-08-29 07:01:51 +00:00
}
2024-09-04 06:54:22 +00:00
func (this *QStaticText) TextFormat() TextFormat {
return (TextFormat)(C.QStaticText_TextFormat(this.h))
2024-08-29 07:01:51 +00:00
}
func (this *QStaticText) SetTextWidth(textWidth float64) {
C.QStaticText_SetTextWidth(this.h, (C.double)(textWidth))
}
func (this *QStaticText) TextWidth() float64 {
return (float64)(C.QStaticText_TextWidth(this.h))
}
func (this *QStaticText) SetTextOption(textOption *QTextOption) {
C.QStaticText_SetTextOption(this.h, textOption.cPointer())
}
func (this *QStaticText) TextOption() *QTextOption {
_ret := C.QStaticText_TextOption(this.h)
_goptr := newQTextOption(_ret)
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QStaticText) Size() *QSizeF {
_ret := C.QStaticText_Size(this.h)
_goptr := newQSizeF(_ret)
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QStaticText) Prepare() {
C.QStaticText_Prepare(this.h)
}
2024-09-04 06:54:22 +00:00
func (this *QStaticText) SetPerformanceHint(performanceHint QStaticText__PerformanceHint) {
C.QStaticText_SetPerformanceHint(this.h, (C.int)(performanceHint))
2024-08-29 07:01:51 +00:00
}
2024-09-04 06:54:22 +00:00
func (this *QStaticText) PerformanceHint() QStaticText__PerformanceHint {
return (QStaticText__PerformanceHint)(C.QStaticText_PerformanceHint(this.h))
2024-08-29 07:01:51 +00:00
}
func (this *QStaticText) OperatorEqual(param1 *QStaticText) bool {
return (bool)(C.QStaticText_OperatorEqual(this.h, param1.cPointer()))
}
func (this *QStaticText) OperatorNotEqual(param1 *QStaticText) bool {
return (bool)(C.QStaticText_OperatorNotEqual(this.h, param1.cPointer()))
}
func (this *QStaticText) Prepare1(matrix *QTransform) {
C.QStaticText_Prepare1(this.h, matrix.cPointer())
}
func (this *QStaticText) Prepare2(matrix *QTransform, font *QFont) {
C.QStaticText_Prepare2(this.h, matrix.cPointer(), font.cPointer())
}
// Delete this object from C++ memory.
func (this *QStaticText) Delete() {
C.QStaticText_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 *QStaticText) GoGC() {
runtime.SetFinalizer(this, func(this *QStaticText) {
this.Delete()
runtime.KeepAlive(this.h)
})
}