miqt/qt6/gen_qfontinfo.go

156 lines
3.4 KiB
Go
Raw Permalink Normal View History

2024-10-20 05:21:03 +00:00
package qt6
/*
#include "gen_qfontinfo.h"
#include <stdlib.h>
*/
import "C"
import (
"runtime"
"unsafe"
)
type QFontInfo struct {
2024-11-19 06:29:06 +00:00
h *C.QFontInfo
isSubclass bool
2024-10-20 05:21:03 +00:00
}
func (this *QFontInfo) cPointer() *C.QFontInfo {
if this == nil {
return nil
}
return this.h
}
func (this *QFontInfo) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
2024-11-19 06:29:06 +00:00
// newQFontInfo constructs the type using only CGO pointers.
2024-10-20 05:21:03 +00:00
func newQFontInfo(h *C.QFontInfo) *QFontInfo {
if h == nil {
return nil
}
2024-12-07 04:15:57 +00:00
2024-10-20 05:21:03 +00:00
return &QFontInfo{h: h}
}
2024-11-19 06:29:06 +00:00
// UnsafeNewQFontInfo constructs the type using only unsafe pointers.
2024-10-20 05:21:03 +00:00
func UnsafeNewQFontInfo(h unsafe.Pointer) *QFontInfo {
2024-12-07 04:15:57 +00:00
return newQFontInfo((*C.QFontInfo)(h))
2024-10-20 05:21:03 +00:00
}
// NewQFontInfo constructs a new QFontInfo object.
func NewQFontInfo(param1 *QFont) *QFontInfo {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQFontInfo(C.QFontInfo_new(param1.cPointer()))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 05:21:03 +00:00
}
// NewQFontInfo2 constructs a new QFontInfo object.
func NewQFontInfo2(param1 *QFontInfo) *QFontInfo {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQFontInfo(C.QFontInfo_new2(param1.cPointer()))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 05:21:03 +00:00
}
func (this *QFontInfo) OperatorAssign(param1 *QFontInfo) {
C.QFontInfo_OperatorAssign(this.h, param1.cPointer())
}
func (this *QFontInfo) Swap(other *QFontInfo) {
C.QFontInfo_Swap(this.h, other.cPointer())
}
func (this *QFontInfo) Family() string {
var _ms C.struct_miqt_string = C.QFontInfo_Family(this.h)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func (this *QFontInfo) StyleName() string {
var _ms C.struct_miqt_string = C.QFontInfo_StyleName(this.h)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func (this *QFontInfo) PixelSize() int {
return (int)(C.QFontInfo_PixelSize(this.h))
}
func (this *QFontInfo) PointSize() int {
return (int)(C.QFontInfo_PointSize(this.h))
}
func (this *QFontInfo) PointSizeF() float64 {
return (float64)(C.QFontInfo_PointSizeF(this.h))
}
func (this *QFontInfo) Italic() bool {
return (bool)(C.QFontInfo_Italic(this.h))
}
func (this *QFontInfo) Style() QFont__Style {
return (QFont__Style)(C.QFontInfo_Style(this.h))
}
func (this *QFontInfo) Weight() int {
return (int)(C.QFontInfo_Weight(this.h))
}
func (this *QFontInfo) Bold() bool {
return (bool)(C.QFontInfo_Bold(this.h))
}
func (this *QFontInfo) Underline() bool {
return (bool)(C.QFontInfo_Underline(this.h))
}
func (this *QFontInfo) Overline() bool {
return (bool)(C.QFontInfo_Overline(this.h))
}
func (this *QFontInfo) StrikeOut() bool {
return (bool)(C.QFontInfo_StrikeOut(this.h))
}
func (this *QFontInfo) FixedPitch() bool {
return (bool)(C.QFontInfo_FixedPitch(this.h))
}
func (this *QFontInfo) StyleHint() QFont__StyleHint {
return (QFont__StyleHint)(C.QFontInfo_StyleHint(this.h))
}
func (this *QFontInfo) LegacyWeight() int {
return (int)(C.QFontInfo_LegacyWeight(this.h))
}
func (this *QFontInfo) ExactMatch() bool {
return (bool)(C.QFontInfo_ExactMatch(this.h))
}
// Delete this object from C++ memory.
func (this *QFontInfo) Delete() {
2024-11-19 06:29:06 +00:00
C.QFontInfo_Delete(this.h, C.bool(this.isSubclass))
2024-10-20 05:21:03 +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 *QFontInfo) GoGC() {
runtime.SetFinalizer(this, func(this *QFontInfo) {
this.Delete()
runtime.KeepAlive(this.h)
})
}