miqt/qt/gen_qstylepainter.go

102 lines
2.9 KiB
Go
Raw Normal View History

package qt
/*
#include "gen_qstylepainter.h"
#include <stdlib.h>
*/
import "C"
import (
"unsafe"
)
type QStylePainter struct {
h *C.QStylePainter
*QPainter
}
func (this *QStylePainter) cPointer() *C.QStylePainter {
if this == nil {
return nil
}
return this.h
}
func newQStylePainter(h *C.QStylePainter) *QStylePainter {
2024-09-01 02:23:55 +00:00
if h == nil {
return nil
}
return &QStylePainter{h: h, QPainter: newQPainter_U(unsafe.Pointer(h))}
}
func newQStylePainter_U(h unsafe.Pointer) *QStylePainter {
return newQStylePainter((*C.QStylePainter)(h))
}
// NewQStylePainter constructs a new QStylePainter object.
func NewQStylePainter() *QStylePainter {
ret := C.QStylePainter_new()
return newQStylePainter(ret)
}
// NewQStylePainter2 constructs a new QStylePainter object.
func NewQStylePainter2(w *QWidget) *QStylePainter {
ret := C.QStylePainter_new2(w.cPointer())
return newQStylePainter(ret)
}
// NewQStylePainter3 constructs a new QStylePainter object.
func NewQStylePainter3(pd *QPaintDevice, w *QWidget) *QStylePainter {
ret := C.QStylePainter_new3(pd.cPointer(), w.cPointer())
return newQStylePainter(ret)
}
func (this *QStylePainter) Begin(w *QWidget) bool {
ret := C.QStylePainter_Begin(this.h, w.cPointer())
return (bool)(ret)
}
func (this *QStylePainter) Begin2(pd *QPaintDevice, w *QWidget) bool {
ret := C.QStylePainter_Begin2(this.h, pd.cPointer(), w.cPointer())
return (bool)(ret)
}
2024-09-04 06:54:22 +00:00
func (this *QStylePainter) DrawPrimitive(pe QStyle__PrimitiveElement, opt *QStyleOption) {
2024-08-29 07:01:51 +00:00
C.QStylePainter_DrawPrimitive(this.h, (C.uintptr_t)(pe), opt.cPointer())
}
2024-09-04 06:54:22 +00:00
func (this *QStylePainter) DrawControl(ce QStyle__ControlElement, opt *QStyleOption) {
2024-08-29 07:01:51 +00:00
C.QStylePainter_DrawControl(this.h, (C.uintptr_t)(ce), opt.cPointer())
}
2024-09-04 06:54:22 +00:00
func (this *QStylePainter) DrawComplexControl(cc QStyle__ComplexControl, opt *QStyleOptionComplex) {
2024-08-29 07:01:51 +00:00
C.QStylePainter_DrawComplexControl(this.h, (C.uintptr_t)(cc), opt.cPointer())
}
func (this *QStylePainter) DrawItemText(r *QRect, flags int, pal *QPalette, enabled bool, text string) {
text_Cstring := C.CString(text)
defer C.free(unsafe.Pointer(text_Cstring))
C.QStylePainter_DrawItemText(this.h, r.cPointer(), (C.int)(flags), pal.cPointer(), (C.bool)(enabled), text_Cstring, C.size_t(len(text)))
2024-08-29 07:01:51 +00:00
}
func (this *QStylePainter) DrawItemPixmap(r *QRect, flags int, pixmap *QPixmap) {
C.QStylePainter_DrawItemPixmap(this.h, r.cPointer(), (C.int)(flags), pixmap.cPointer())
}
func (this *QStylePainter) Style() *QStyle {
ret := C.QStylePainter_Style(this.h)
return newQStyle_U(unsafe.Pointer(ret))
}
2024-09-04 06:54:22 +00:00
func (this *QStylePainter) DrawItemText6(r *QRect, flags int, pal *QPalette, enabled bool, text string, textRole QPalette__ColorRole) {
2024-08-29 07:01:51 +00:00
text_Cstring := C.CString(text)
defer C.free(unsafe.Pointer(text_Cstring))
C.QStylePainter_DrawItemText6(this.h, r.cPointer(), (C.int)(flags), pal.cPointer(), (C.bool)(enabled), text_Cstring, C.size_t(len(text)), (C.uintptr_t)(textRole))
2024-08-29 07:01:51 +00:00
}
func (this *QStylePainter) Delete() {
C.QStylePainter_Delete(this.h)
}