2024-08-25 04:08:24 +00:00
|
|
|
package qt
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qcolordialog.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
import (
|
|
|
|
"runtime"
|
|
|
|
"runtime/cgo"
|
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
type QColorDialog__ColorDialogOption int
|
|
|
|
|
|
|
|
const (
|
|
|
|
QColorDialog__ColorDialogOption__ShowAlphaChannel QColorDialog__ColorDialogOption = 1
|
|
|
|
QColorDialog__ColorDialogOption__NoButtons QColorDialog__ColorDialogOption = 2
|
|
|
|
QColorDialog__ColorDialogOption__DontUseNativeDialog QColorDialog__ColorDialogOption = 4
|
|
|
|
)
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
type QColorDialog struct {
|
|
|
|
h *C.QColorDialog
|
|
|
|
*QDialog
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QColorDialog) cPointer() *C.QColorDialog {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
|
|
|
func newQColorDialog(h *C.QColorDialog) *QColorDialog {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
return &QColorDialog{h: h, QDialog: newQDialog_U(unsafe.Pointer(h))}
|
|
|
|
}
|
|
|
|
|
|
|
|
func newQColorDialog_U(h unsafe.Pointer) *QColorDialog {
|
|
|
|
return newQColorDialog((*C.QColorDialog)(h))
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQColorDialog constructs a new QColorDialog object.
|
|
|
|
func NewQColorDialog() *QColorDialog {
|
|
|
|
ret := C.QColorDialog_new()
|
|
|
|
return newQColorDialog(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQColorDialog2 constructs a new QColorDialog object.
|
|
|
|
func NewQColorDialog2(initial *QColor) *QColorDialog {
|
|
|
|
ret := C.QColorDialog_new2(initial.cPointer())
|
|
|
|
return newQColorDialog(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQColorDialog3 constructs a new QColorDialog object.
|
|
|
|
func NewQColorDialog3(parent *QWidget) *QColorDialog {
|
|
|
|
ret := C.QColorDialog_new3(parent.cPointer())
|
|
|
|
return newQColorDialog(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQColorDialog4 constructs a new QColorDialog object.
|
|
|
|
func NewQColorDialog4(initial *QColor, parent *QWidget) *QColorDialog {
|
|
|
|
ret := C.QColorDialog_new4(initial.cPointer(), parent.cPointer())
|
|
|
|
return newQColorDialog(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QColorDialog) MetaObject() *QMetaObject {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QColorDialog_MetaObject(this.h)
|
|
|
|
return newQMetaObject_U(unsafe.Pointer(_ret))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QColorDialog_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.QColorDialog_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 QColorDialog_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.QColorDialog_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
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QColorDialog) SetCurrentColor(color *QColor) {
|
|
|
|
C.QColorDialog_SetCurrentColor(this.h, color.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QColorDialog) CurrentColor() *QColor {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QColorDialog_CurrentColor(this.h)
|
|
|
|
_goptr := newQColor(_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 *QColorDialog) SelectedColor() *QColor {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QColorDialog_SelectedColor(this.h)
|
|
|
|
_goptr := newQColor(_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
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QColorDialog) SetOption(option QColorDialog__ColorDialogOption) {
|
2024-08-29 07:01:51 +00:00
|
|
|
C.QColorDialog_SetOption(this.h, (C.uintptr_t)(option))
|
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QColorDialog) TestOption(option QColorDialog__ColorDialogOption) bool {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QColorDialog_TestOption(this.h, (C.uintptr_t)(option))
|
|
|
|
return (bool)(_ret)
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QColorDialog) SetOptions(options int) {
|
|
|
|
C.QColorDialog_SetOptions(this.h, (C.int)(options))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QColorDialog) Options() int {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QColorDialog_Options(this.h)
|
|
|
|
return (int)(_ret)
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QColorDialog) SetVisible(visible bool) {
|
|
|
|
C.QColorDialog_SetVisible(this.h, (C.bool)(visible))
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
func QColorDialog_GetColor() *QColor {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QColorDialog_GetColor()
|
|
|
|
_goptr := newQColor(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QColorDialog_GetRgba() uint {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QColorDialog_GetRgba()
|
|
|
|
return (uint)(_ret)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QColorDialog_CustomCount() int {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QColorDialog_CustomCount()
|
|
|
|
return (int)(_ret)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QColorDialog_CustomColor(index int) *QColor {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QColorDialog_CustomColor((C.int)(index))
|
|
|
|
_goptr := newQColor(_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 QColorDialog_SetCustomColor(index int, color QColor) {
|
|
|
|
C.QColorDialog_SetCustomColor((C.int)(index), color.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func QColorDialog_StandardColor(index int) *QColor {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QColorDialog_StandardColor((C.int)(index))
|
|
|
|
_goptr := newQColor(_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 QColorDialog_SetStandardColor(index int, color QColor) {
|
|
|
|
C.QColorDialog_SetStandardColor((C.int)(index), color.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QColorDialog) CurrentColorChanged(color *QColor) {
|
|
|
|
C.QColorDialog_CurrentColorChanged(this.h, color.cPointer())
|
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
func (this *QColorDialog) OnCurrentColorChanged(slot func(color *QColor)) {
|
|
|
|
C.QColorDialog_connect_CurrentColorChanged(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_QColorDialog_CurrentColorChanged
|
|
|
|
func miqt_exec_callback_QColorDialog_CurrentColorChanged(cb *C.void, color *C.QColor) {
|
|
|
|
gofunc, ok := (cgo.Handle(uintptr(unsafe.Pointer(cb))).Value()).(func(color *QColor))
|
|
|
|
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
|
|
|
|
color_ret := color
|
|
|
|
slotval1 := newQColor_U(unsafe.Pointer(color_ret))
|
|
|
|
|
|
|
|
gofunc(slotval1)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QColorDialog) ColorSelected(color *QColor) {
|
|
|
|
C.QColorDialog_ColorSelected(this.h, color.cPointer())
|
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
func (this *QColorDialog) OnColorSelected(slot func(color *QColor)) {
|
|
|
|
C.QColorDialog_connect_ColorSelected(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_QColorDialog_ColorSelected
|
|
|
|
func miqt_exec_callback_QColorDialog_ColorSelected(cb *C.void, color *C.QColor) {
|
|
|
|
gofunc, ok := (cgo.Handle(uintptr(unsafe.Pointer(cb))).Value()).(func(color *QColor))
|
|
|
|
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
|
|
|
|
color_ret := color
|
|
|
|
slotval1 := newQColor_U(unsafe.Pointer(color_ret))
|
|
|
|
|
|
|
|
gofunc(slotval1)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QColorDialog_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.QColorDialog_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 QColorDialog_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.QColorDialog_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 QColorDialog_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.QColorDialog_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 QColorDialog_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.QColorDialog_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-04 06:54:22 +00:00
|
|
|
func (this *QColorDialog) SetOption2(option QColorDialog__ColorDialogOption, on bool) {
|
2024-08-29 07:01:51 +00:00
|
|
|
C.QColorDialog_SetOption2(this.h, (C.uintptr_t)(option), (C.bool)(on))
|
|
|
|
}
|
|
|
|
|
|
|
|
func QColorDialog_GetColor1(initial *QColor) *QColor {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QColorDialog_GetColor1(initial.cPointer())
|
|
|
|
_goptr := newQColor(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QColorDialog_GetColor2(initial *QColor, parent *QWidget) *QColor {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QColorDialog_GetColor2(initial.cPointer(), parent.cPointer())
|
|
|
|
_goptr := newQColor(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QColorDialog_GetColor3(initial *QColor, parent *QWidget, title string) *QColor {
|
2024-09-14 22:29:05 +00:00
|
|
|
title_ms := miqt_strdupg(title)
|
|
|
|
defer C.free(title_ms)
|
|
|
|
_ret := C.QColorDialog_GetColor3(initial.cPointer(), parent.cPointer(), (*C.struct_miqt_string)(title_ms))
|
|
|
|
_goptr := newQColor(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QColorDialog_GetColor4(initial *QColor, parent *QWidget, title string, options int) *QColor {
|
2024-09-14 22:29:05 +00:00
|
|
|
title_ms := miqt_strdupg(title)
|
|
|
|
defer C.free(title_ms)
|
|
|
|
_ret := C.QColorDialog_GetColor4(initial.cPointer(), parent.cPointer(), (*C.struct_miqt_string)(title_ms), (C.int)(options))
|
|
|
|
_goptr := newQColor(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QColorDialog_GetRgba1(rgba uint) uint {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QColorDialog_GetRgba1((C.uint)(rgba))
|
|
|
|
return (uint)(_ret)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
func QColorDialog_GetRgba2(rgba uint, ok *bool) uint {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QColorDialog_GetRgba2((C.uint)(rgba), (*C.bool)(unsafe.Pointer(ok)))
|
|
|
|
return (uint)(_ret)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
func QColorDialog_GetRgba3(rgba uint, ok *bool, parent *QWidget) uint {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QColorDialog_GetRgba3((C.uint)(rgba), (*C.bool)(unsafe.Pointer(ok)), parent.cPointer())
|
|
|
|
return (uint)(_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 *QColorDialog) Delete() {
|
|
|
|
C.QColorDialog_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 *QColorDialog) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QColorDialog) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|