2024-08-25 04:08:24 +00:00
|
|
|
package qt
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qstylepainter.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
import (
|
2024-09-14 22:29:05 +00:00
|
|
|
"runtime"
|
2024-08-25 04:08:24 +00:00
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
|
|
|
type QStylePainter struct {
|
2024-11-19 06:29:06 +00:00
|
|
|
h *C.QStylePainter
|
|
|
|
isSubclass bool
|
2024-08-25 04:08:24 +00:00
|
|
|
*QPainter
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QStylePainter) cPointer() *C.QStylePainter {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func (this *QStylePainter) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// newQStylePainter constructs the type using only CGO pointers.
|
|
|
|
func newQStylePainter(h *C.QStylePainter, h_QPainter *C.QPainter) *QStylePainter {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-11-19 06:29:06 +00:00
|
|
|
return &QStylePainter{h: h,
|
|
|
|
QPainter: newQPainter(h_QPainter)}
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// UnsafeNewQStylePainter constructs the type using only unsafe pointers.
|
|
|
|
func UnsafeNewQStylePainter(h unsafe.Pointer, h_QPainter unsafe.Pointer) *QStylePainter {
|
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
return &QStylePainter{h: (*C.QStylePainter)(h),
|
|
|
|
QPainter: UnsafeNewQPainter(h_QPainter)}
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQStylePainter constructs a new QStylePainter object.
|
2024-10-26 00:46:42 +00:00
|
|
|
func NewQStylePainter(w *QWidget) *QStylePainter {
|
2024-11-19 06:29:06 +00:00
|
|
|
var outptr_QStylePainter *C.QStylePainter = nil
|
|
|
|
var outptr_QPainter *C.QPainter = nil
|
|
|
|
|
|
|
|
C.QStylePainter_new(w.cPointer(), &outptr_QStylePainter, &outptr_QPainter)
|
|
|
|
ret := newQStylePainter(outptr_QStylePainter, outptr_QPainter)
|
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQStylePainter2 constructs a new QStylePainter object.
|
2024-10-26 00:46:42 +00:00
|
|
|
func NewQStylePainter2() *QStylePainter {
|
2024-11-19 06:29:06 +00:00
|
|
|
var outptr_QStylePainter *C.QStylePainter = nil
|
|
|
|
var outptr_QPainter *C.QPainter = nil
|
|
|
|
|
|
|
|
C.QStylePainter_new2(&outptr_QStylePainter, &outptr_QPainter)
|
|
|
|
ret := newQStylePainter(outptr_QStylePainter, outptr_QPainter)
|
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQStylePainter3 constructs a new QStylePainter object.
|
|
|
|
func NewQStylePainter3(pd *QPaintDevice, w *QWidget) *QStylePainter {
|
2024-11-19 06:29:06 +00:00
|
|
|
var outptr_QStylePainter *C.QStylePainter = nil
|
|
|
|
var outptr_QPainter *C.QPainter = nil
|
|
|
|
|
|
|
|
C.QStylePainter_new3(pd.cPointer(), w.cPointer(), &outptr_QStylePainter, &outptr_QPainter)
|
|
|
|
ret := newQStylePainter(outptr_QStylePainter, outptr_QPainter)
|
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QStylePainter) Begin(w *QWidget) bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QStylePainter_Begin(this.h, w.cPointer()))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QStylePainter) Begin2(pd *QPaintDevice, w *QWidget) bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QStylePainter_Begin2(this.h, pd.cPointer(), w.cPointer()))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QStylePainter) DrawPrimitive(pe QStyle__PrimitiveElement, opt *QStyleOption) {
|
2024-09-18 00:12:02 +00:00
|
|
|
C.QStylePainter_DrawPrimitive(this.h, (C.int)(pe), opt.cPointer())
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QStylePainter) DrawControl(ce QStyle__ControlElement, opt *QStyleOption) {
|
2024-09-18 00:12:02 +00:00
|
|
|
C.QStylePainter_DrawControl(this.h, (C.int)(ce), opt.cPointer())
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QStylePainter) DrawComplexControl(cc QStyle__ComplexControl, opt *QStyleOptionComplex) {
|
2024-09-18 00:12:02 +00:00
|
|
|
C.QStylePainter_DrawComplexControl(this.h, (C.int)(cc), opt.cPointer())
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QStylePainter) DrawItemText(r *QRect, flags int, pal *QPalette, enabled bool, text string) {
|
2024-10-18 23:53:33 +00:00
|
|
|
text_ms := C.struct_miqt_string{}
|
|
|
|
text_ms.data = C.CString(text)
|
|
|
|
text_ms.len = C.size_t(len(text))
|
|
|
|
defer C.free(unsafe.Pointer(text_ms.data))
|
|
|
|
C.QStylePainter_DrawItemText(this.h, r.cPointer(), (C.int)(flags), pal.cPointer(), (C.bool)(enabled), text_ms)
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +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 {
|
2024-11-19 06:29:06 +00:00
|
|
|
return UnsafeNewQStyle(unsafe.Pointer(C.QStylePainter_Style(this.h)), nil)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
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-10-18 23:53:33 +00:00
|
|
|
text_ms := C.struct_miqt_string{}
|
|
|
|
text_ms.data = C.CString(text)
|
|
|
|
text_ms.len = C.size_t(len(text))
|
|
|
|
defer C.free(unsafe.Pointer(text_ms.data))
|
|
|
|
C.QStylePainter_DrawItemText6(this.h, r.cPointer(), (C.int)(flags), pal.cPointer(), (C.bool)(enabled), text_ms, (C.int)(textRole))
|
2024-08-29 07:01:51 +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 *QStylePainter) Delete() {
|
2024-11-19 06:29:06 +00:00
|
|
|
C.QStylePainter_Delete(this.h, C.bool(this.isSubclass))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
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 *QStylePainter) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QStylePainter) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|