mirror of
https://github.com/mappu/miqt.git
synced 2025-01-03 14:18:37 +00:00
208 lines
5.7 KiB
Go
208 lines
5.7 KiB
Go
package qt
|
|
|
|
/*
|
|
|
|
#cgo CFLAGS: -fPIC
|
|
#cgo pkg-config: Qt5Widgets
|
|
#include "gen_qproxystyle.h"
|
|
#include <stdlib.h>
|
|
|
|
*/
|
|
import "C"
|
|
|
|
import (
|
|
"runtime"
|
|
"unsafe"
|
|
)
|
|
|
|
type QProxyStyle struct {
|
|
h *C.QProxyStyle
|
|
*QCommonStyle
|
|
}
|
|
|
|
func (this *QProxyStyle) cPointer() *C.QProxyStyle {
|
|
if this == nil {
|
|
return nil
|
|
}
|
|
return this.h
|
|
}
|
|
|
|
func newQProxyStyle(h *C.QProxyStyle) *QProxyStyle {
|
|
return &QProxyStyle{h: h, QCommonStyle: newQCommonStyle_U(unsafe.Pointer(h))}
|
|
}
|
|
|
|
func newQProxyStyle_U(h unsafe.Pointer) *QProxyStyle {
|
|
return newQProxyStyle((*C.QProxyStyle)(h))
|
|
}
|
|
|
|
// NewQProxyStyle constructs a new QProxyStyle object.
|
|
func NewQProxyStyle() *QProxyStyle {
|
|
ret := C.QProxyStyle_new()
|
|
return newQProxyStyle(ret)
|
|
}
|
|
|
|
// NewQProxyStyle2 constructs a new QProxyStyle object.
|
|
func NewQProxyStyle2(key string) *QProxyStyle {
|
|
key_Cstring := C.CString(key)
|
|
defer C.free(unsafe.Pointer(key_Cstring))
|
|
ret := C.QProxyStyle_new2(key_Cstring, C.ulong(len(key)))
|
|
return newQProxyStyle(ret)
|
|
}
|
|
|
|
// NewQProxyStyle3 constructs a new QProxyStyle object.
|
|
func NewQProxyStyle3(style *QStyle) *QProxyStyle {
|
|
ret := C.QProxyStyle_new3(style.cPointer())
|
|
return newQProxyStyle(ret)
|
|
}
|
|
|
|
func (this *QProxyStyle) MetaObject() *QMetaObject {
|
|
ret := C.QProxyStyle_MetaObject(this.h)
|
|
return newQMetaObject_U(unsafe.Pointer(ret))
|
|
}
|
|
|
|
func QProxyStyle_Tr(s string) string {
|
|
s_Cstring := C.CString(s)
|
|
defer C.free(unsafe.Pointer(s_Cstring))
|
|
var _out *C.char = nil
|
|
var _out_Strlen C.int = 0
|
|
C.QProxyStyle_Tr(s_Cstring, &_out, &_out_Strlen)
|
|
ret := C.GoStringN(_out, _out_Strlen)
|
|
C.free(unsafe.Pointer(_out))
|
|
return ret
|
|
}
|
|
|
|
func QProxyStyle_TrUtf8(s string) string {
|
|
s_Cstring := C.CString(s)
|
|
defer C.free(unsafe.Pointer(s_Cstring))
|
|
var _out *C.char = nil
|
|
var _out_Strlen C.int = 0
|
|
C.QProxyStyle_TrUtf8(s_Cstring, &_out, &_out_Strlen)
|
|
ret := C.GoStringN(_out, _out_Strlen)
|
|
C.free(unsafe.Pointer(_out))
|
|
return ret
|
|
}
|
|
|
|
func (this *QProxyStyle) BaseStyle() *QStyle {
|
|
ret := C.QProxyStyle_BaseStyle(this.h)
|
|
return newQStyle_U(unsafe.Pointer(ret))
|
|
}
|
|
|
|
func (this *QProxyStyle) SetBaseStyle(style *QStyle) {
|
|
C.QProxyStyle_SetBaseStyle(this.h, style.cPointer())
|
|
}
|
|
|
|
func (this *QProxyStyle) DrawItemPixmap(painter *QPainter, rect *QRect, alignment int, pixmap *QPixmap) {
|
|
C.QProxyStyle_DrawItemPixmap(this.h, painter.cPointer(), rect.cPointer(), (C.int)(alignment), pixmap.cPointer())
|
|
}
|
|
|
|
func (this *QProxyStyle) ItemTextRect(fm *QFontMetrics, r *QRect, flags int, enabled bool, text string) *QRect {
|
|
text_Cstring := C.CString(text)
|
|
defer C.free(unsafe.Pointer(text_Cstring))
|
|
ret := C.QProxyStyle_ItemTextRect(this.h, fm.cPointer(), r.cPointer(), (C.int)(flags), (C.bool)(enabled), text_Cstring, C.ulong(len(text)))
|
|
// Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
ret1 := newQRect(ret)
|
|
runtime.SetFinalizer(ret1, func(ret2 *QRect) {
|
|
ret2.Delete()
|
|
runtime.KeepAlive(ret2.h)
|
|
})
|
|
return ret1
|
|
}
|
|
|
|
func (this *QProxyStyle) ItemPixmapRect(r *QRect, flags int, pixmap *QPixmap) *QRect {
|
|
ret := C.QProxyStyle_ItemPixmapRect(this.h, r.cPointer(), (C.int)(flags), pixmap.cPointer())
|
|
// Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
ret1 := newQRect(ret)
|
|
runtime.SetFinalizer(ret1, func(ret2 *QRect) {
|
|
ret2.Delete()
|
|
runtime.KeepAlive(ret2.h)
|
|
})
|
|
return ret1
|
|
}
|
|
|
|
func (this *QProxyStyle) StandardPalette() *QPalette {
|
|
ret := C.QProxyStyle_StandardPalette(this.h)
|
|
// Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
ret1 := newQPalette(ret)
|
|
runtime.SetFinalizer(ret1, func(ret2 *QPalette) {
|
|
ret2.Delete()
|
|
runtime.KeepAlive(ret2.h)
|
|
})
|
|
return ret1
|
|
}
|
|
|
|
func (this *QProxyStyle) Polish(widget *QWidget) {
|
|
C.QProxyStyle_Polish(this.h, widget.cPointer())
|
|
}
|
|
|
|
func (this *QProxyStyle) PolishWithPal(pal *QPalette) {
|
|
C.QProxyStyle_PolishWithPal(this.h, pal.cPointer())
|
|
}
|
|
|
|
func (this *QProxyStyle) PolishWithApp(app *QApplication) {
|
|
C.QProxyStyle_PolishWithApp(this.h, app.cPointer())
|
|
}
|
|
|
|
func (this *QProxyStyle) Unpolish(widget *QWidget) {
|
|
C.QProxyStyle_Unpolish(this.h, widget.cPointer())
|
|
}
|
|
|
|
func (this *QProxyStyle) UnpolishWithApp(app *QApplication) {
|
|
C.QProxyStyle_UnpolishWithApp(this.h, app.cPointer())
|
|
}
|
|
|
|
func QProxyStyle_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 _out *C.char = nil
|
|
var _out_Strlen C.int = 0
|
|
C.QProxyStyle_Tr2(s_Cstring, c_Cstring, &_out, &_out_Strlen)
|
|
ret := C.GoStringN(_out, _out_Strlen)
|
|
C.free(unsafe.Pointer(_out))
|
|
return ret
|
|
}
|
|
|
|
func QProxyStyle_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 _out *C.char = nil
|
|
var _out_Strlen C.int = 0
|
|
C.QProxyStyle_Tr3(s_Cstring, c_Cstring, (C.int)(n), &_out, &_out_Strlen)
|
|
ret := C.GoStringN(_out, _out_Strlen)
|
|
C.free(unsafe.Pointer(_out))
|
|
return ret
|
|
}
|
|
|
|
func QProxyStyle_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 _out *C.char = nil
|
|
var _out_Strlen C.int = 0
|
|
C.QProxyStyle_TrUtf82(s_Cstring, c_Cstring, &_out, &_out_Strlen)
|
|
ret := C.GoStringN(_out, _out_Strlen)
|
|
C.free(unsafe.Pointer(_out))
|
|
return ret
|
|
}
|
|
|
|
func QProxyStyle_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 _out *C.char = nil
|
|
var _out_Strlen C.int = 0
|
|
C.QProxyStyle_TrUtf83(s_Cstring, c_Cstring, (C.int)(n), &_out, &_out_Strlen)
|
|
ret := C.GoStringN(_out, _out_Strlen)
|
|
C.free(unsafe.Pointer(_out))
|
|
return ret
|
|
}
|
|
|
|
func (this *QProxyStyle) Delete() {
|
|
C.QProxyStyle_Delete(this.h)
|
|
}
|