mirror of
https://github.com/mappu/miqt.git
synced 2024-12-22 08:58:37 +00:00
208 lines
6.0 KiB
Go
208 lines
6.0 KiB
Go
package qt
|
|
|
|
/*
|
|
|
|
#include "gen_qfontcombobox.h"
|
|
#include <stdlib.h>
|
|
|
|
*/
|
|
import "C"
|
|
|
|
import (
|
|
"runtime"
|
|
"runtime/cgo"
|
|
"unsafe"
|
|
)
|
|
|
|
type QFontComboBox__FontFilter int
|
|
|
|
const (
|
|
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
|
|
)
|
|
|
|
type QFontComboBox struct {
|
|
h *C.QFontComboBox
|
|
*QComboBox
|
|
}
|
|
|
|
func (this *QFontComboBox) cPointer() *C.QFontComboBox {
|
|
if this == nil {
|
|
return nil
|
|
}
|
|
return this.h
|
|
}
|
|
|
|
func (this *QFontComboBox) UnsafePointer() unsafe.Pointer {
|
|
if this == nil {
|
|
return nil
|
|
}
|
|
return unsafe.Pointer(this.h)
|
|
}
|
|
|
|
func newQFontComboBox(h *C.QFontComboBox) *QFontComboBox {
|
|
if h == nil {
|
|
return nil
|
|
}
|
|
return &QFontComboBox{h: h, QComboBox: UnsafeNewQComboBox(unsafe.Pointer(h))}
|
|
}
|
|
|
|
func UnsafeNewQFontComboBox(h unsafe.Pointer) *QFontComboBox {
|
|
return newQFontComboBox((*C.QFontComboBox)(h))
|
|
}
|
|
|
|
// NewQFontComboBox constructs a new QFontComboBox object.
|
|
func NewQFontComboBox(parent *QWidget) *QFontComboBox {
|
|
ret := C.QFontComboBox_new(parent.cPointer())
|
|
return newQFontComboBox(ret)
|
|
}
|
|
|
|
// NewQFontComboBox2 constructs a new QFontComboBox object.
|
|
func NewQFontComboBox2() *QFontComboBox {
|
|
ret := C.QFontComboBox_new2()
|
|
return newQFontComboBox(ret)
|
|
}
|
|
|
|
func (this *QFontComboBox) MetaObject() *QMetaObject {
|
|
return UnsafeNewQMetaObject(unsafe.Pointer(C.QFontComboBox_MetaObject(this.h)))
|
|
}
|
|
|
|
func (this *QFontComboBox) Metacast(param1 string) unsafe.Pointer {
|
|
param1_Cstring := C.CString(param1)
|
|
defer C.free(unsafe.Pointer(param1_Cstring))
|
|
return (unsafe.Pointer)(C.QFontComboBox_Metacast(this.h, param1_Cstring))
|
|
}
|
|
|
|
func QFontComboBox_Tr(s string) string {
|
|
s_Cstring := C.CString(s)
|
|
defer C.free(unsafe.Pointer(s_Cstring))
|
|
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.data))
|
|
return _ret
|
|
}
|
|
|
|
func QFontComboBox_TrUtf8(s string) string {
|
|
s_Cstring := C.CString(s)
|
|
defer C.free(unsafe.Pointer(s_Cstring))
|
|
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.data))
|
|
return _ret
|
|
}
|
|
|
|
func (this *QFontComboBox) SetWritingSystem(writingSystem QFontDatabase__WritingSystem) {
|
|
C.QFontComboBox_SetWritingSystem(this.h, (C.int)(writingSystem))
|
|
}
|
|
|
|
func (this *QFontComboBox) WritingSystem() QFontDatabase__WritingSystem {
|
|
return (QFontDatabase__WritingSystem)(C.QFontComboBox_WritingSystem(this.h))
|
|
}
|
|
|
|
func (this *QFontComboBox) SetFontFilters(filters QFontComboBox__FontFilter) {
|
|
C.QFontComboBox_SetFontFilters(this.h, (C.int)(filters))
|
|
}
|
|
|
|
func (this *QFontComboBox) FontFilters() QFontComboBox__FontFilter {
|
|
return (QFontComboBox__FontFilter)(C.QFontComboBox_FontFilters(this.h))
|
|
}
|
|
|
|
func (this *QFontComboBox) CurrentFont() *QFont {
|
|
_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
|
|
}
|
|
|
|
func (this *QFontComboBox) SizeHint() *QSize {
|
|
_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
|
|
}
|
|
|
|
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())
|
|
}
|
|
func (this *QFontComboBox) OnCurrentFontChanged(slot func(f *QFont)) {
|
|
C.QFontComboBox_connect_CurrentFontChanged(this.h, C.intptr_t(cgo.NewHandle(slot)))
|
|
}
|
|
|
|
//export miqt_exec_callback_QFontComboBox_CurrentFontChanged
|
|
func miqt_exec_callback_QFontComboBox_CurrentFontChanged(cb C.intptr_t, f *C.QFont) {
|
|
gofunc, ok := cgo.Handle(cb).Value().(func(f *QFont))
|
|
if !ok {
|
|
panic("miqt: callback of non-callback type (heap corruption?)")
|
|
}
|
|
|
|
// Convert all CABI parameters to Go parameters
|
|
slotval1 := UnsafeNewQFont(unsafe.Pointer(f))
|
|
|
|
gofunc(slotval1)
|
|
}
|
|
|
|
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))
|
|
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.data))
|
|
return _ret
|
|
}
|
|
|
|
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))
|
|
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.data))
|
|
return _ret
|
|
}
|
|
|
|
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))
|
|
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.data))
|
|
return _ret
|
|
}
|
|
|
|
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))
|
|
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.data))
|
|
return _ret
|
|
}
|
|
|
|
// Delete this object from C++ memory.
|
|
func (this *QFontComboBox) Delete() {
|
|
C.QFontComboBox_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 *QFontComboBox) GoGC() {
|
|
runtime.SetFinalizer(this, func(this *QFontComboBox) {
|
|
this.Delete()
|
|
runtime.KeepAlive(this.h)
|
|
})
|
|
}
|