2024-08-25 04:08:24 +00:00
|
|
|
package qt
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qfontcombobox.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
import (
|
|
|
|
"runtime"
|
|
|
|
"runtime/cgo"
|
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
type QFontComboBox__FontFilter int
|
|
|
|
|
|
|
|
const (
|
2024-09-20 07:13:26 +00:00
|
|
|
QFontComboBox__AllFonts QFontComboBox__FontFilter = 0
|
|
|
|
QFontComboBox__ScalableFonts QFontComboBox__FontFilter = 1
|
|
|
|
QFontComboBox__NonScalableFonts QFontComboBox__FontFilter = 2
|
|
|
|
QFontComboBox__MonospacedFonts QFontComboBox__FontFilter = 4
|
|
|
|
QFontComboBox__ProportionalFonts QFontComboBox__FontFilter = 8
|
2024-09-04 06:54:22 +00:00
|
|
|
)
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
type QFontComboBox struct {
|
|
|
|
h *C.QFontComboBox
|
|
|
|
*QComboBox
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QFontComboBox) cPointer() *C.QFontComboBox {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
|
|
|
func newQFontComboBox(h *C.QFontComboBox) *QFontComboBox {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
return &QFontComboBox{h: h, QComboBox: newQComboBox_U(unsafe.Pointer(h))}
|
|
|
|
}
|
|
|
|
|
|
|
|
func newQFontComboBox_U(h unsafe.Pointer) *QFontComboBox {
|
|
|
|
return newQFontComboBox((*C.QFontComboBox)(h))
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQFontComboBox constructs a new QFontComboBox object.
|
|
|
|
func NewQFontComboBox() *QFontComboBox {
|
|
|
|
ret := C.QFontComboBox_new()
|
|
|
|
return newQFontComboBox(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQFontComboBox2 constructs a new QFontComboBox object.
|
|
|
|
func NewQFontComboBox2(parent *QWidget) *QFontComboBox {
|
|
|
|
ret := C.QFontComboBox_new2(parent.cPointer())
|
|
|
|
return newQFontComboBox(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QFontComboBox) MetaObject() *QMetaObject {
|
2024-09-17 07:30:27 +00:00
|
|
|
return newQMetaObject_U(unsafe.Pointer(C.QFontComboBox_MetaObject(this.h)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QFontComboBox_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.QFontComboBox_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 QFontComboBox_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.QFontComboBox_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 *QFontComboBox) SetWritingSystem(writingSystem QFontDatabase__WritingSystem) {
|
2024-09-18 00:12:02 +00:00
|
|
|
C.QFontComboBox_SetWritingSystem(this.h, (C.int)(writingSystem))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QFontComboBox) WritingSystem() QFontDatabase__WritingSystem {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (QFontDatabase__WritingSystem)(C.QFontComboBox_WritingSystem(this.h))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-20 06:40:03 +00:00
|
|
|
func (this *QFontComboBox) SetFontFilters(filters QFontComboBox__FontFilter) {
|
2024-09-18 01:33:50 +00:00
|
|
|
C.QFontComboBox_SetFontFilters(this.h, (C.int)(filters))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-20 06:40:03 +00:00
|
|
|
func (this *QFontComboBox) FontFilters() QFontComboBox__FontFilter {
|
|
|
|
return (QFontComboBox__FontFilter)(C.QFontComboBox_FontFilters(this.h))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QFontComboBox) CurrentFont() *QFont {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QFontComboBox_CurrentFont(this.h)
|
|
|
|
_goptr := newQFont(_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 *QFontComboBox) SizeHint() *QSize {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QFontComboBox_SizeHint(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 *QFontComboBox) SetCurrentFont(f *QFont) {
|
|
|
|
C.QFontComboBox_SetCurrentFont(this.h, f.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QFontComboBox) CurrentFontChanged(f *QFont) {
|
|
|
|
C.QFontComboBox_CurrentFontChanged(this.h, f.cPointer())
|
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
func (this *QFontComboBox) OnCurrentFontChanged(slot func(f *QFont)) {
|
|
|
|
C.QFontComboBox_connect_CurrentFontChanged(this.h, unsafe.Pointer(uintptr(cgo.NewHandle(slot))))
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
//export miqt_exec_callback_QFontComboBox_CurrentFontChanged
|
|
|
|
func miqt_exec_callback_QFontComboBox_CurrentFontChanged(cb *C.void, f *C.QFont) {
|
|
|
|
gofunc, ok := (cgo.Handle(uintptr(unsafe.Pointer(cb))).Value()).(func(f *QFont))
|
|
|
|
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 := newQFont_U(unsafe.Pointer(f))
|
2024-09-14 22:29:05 +00:00
|
|
|
|
|
|
|
gofunc(slotval1)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QFontComboBox_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.QFontComboBox_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 QFontComboBox_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.QFontComboBox_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 QFontComboBox_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.QFontComboBox_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 QFontComboBox_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.QFontComboBox_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 *QFontComboBox) Delete() {
|
|
|
|
C.QFontComboBox_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 *QFontComboBox) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QFontComboBox) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|