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 (
|
2024-09-20 07:13:26 +00:00
|
|
|
QColorDialog__ShowAlphaChannel QColorDialog__ColorDialogOption = 1
|
|
|
|
QColorDialog__NoButtons QColorDialog__ColorDialogOption = 2
|
|
|
|
QColorDialog__DontUseNativeDialog QColorDialog__ColorDialogOption = 4
|
2024-09-04 06:54:22 +00:00
|
|
|
)
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func (this *QColorDialog) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func newQColorDialog(h *C.QColorDialog) *QColorDialog {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-10-16 05:07:56 +00:00
|
|
|
return &QColorDialog{h: h, QDialog: UnsafeNewQDialog(unsafe.Pointer(h))}
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func UnsafeNewQColorDialog(h unsafe.Pointer) *QColorDialog {
|
2024-08-25 04:08:24 +00:00
|
|
|
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-10-16 05:07:56 +00:00
|
|
|
return UnsafeNewQMetaObject(unsafe.Pointer(C.QColorDialog_MetaObject(this.h)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-20 22:32:57 +00:00
|
|
|
func (this *QColorDialog) Metacast(param1 string) unsafe.Pointer {
|
|
|
|
param1_Cstring := C.CString(param1)
|
|
|
|
defer C.free(unsafe.Pointer(param1_Cstring))
|
2024-10-18 23:53:33 +00:00
|
|
|
return (unsafe.Pointer)(C.QColorDialog_Metacast(this.h, param1_Cstring))
|
2024-09-20 22:32:57 +00:00
|
|
|
}
|
|
|
|
|
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-10-18 23:53:33 +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.data))
|
2024-09-14 22:29:05 +00:00
|
|
|
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-10-18 23:53:33 +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.data))
|
2024-09-14 22:29:05 +00:00
|
|
|
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-09-18 00:12:02 +00:00
|
|
|
C.QColorDialog_SetOption(this.h, (C.int)(option))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QColorDialog) TestOption(option QColorDialog__ColorDialogOption) bool {
|
2024-09-18 00:12:02 +00:00
|
|
|
return (bool)(C.QColorDialog_TestOption(this.h, (C.int)(option)))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-20 06:40:03 +00:00
|
|
|
func (this *QColorDialog) SetOptions(options QColorDialog__ColorDialogOption) {
|
2024-09-18 01:33:50 +00:00
|
|
|
C.QColorDialog_SetOptions(this.h, (C.int)(options))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-20 06:40:03 +00:00
|
|
|
func (this *QColorDialog) Options() QColorDialog__ColorDialogOption {
|
|
|
|
return (QColorDialog__ColorDialogOption)(C.QColorDialog_Options(this.h))
|
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-17 07:30:27 +00:00
|
|
|
return (uint)(C.QColorDialog_GetRgba())
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QColorDialog_CustomCount() int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QColorDialog_CustomCount())
|
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)) {
|
2024-10-13 06:06:06 +00:00
|
|
|
C.QColorDialog_connect_CurrentColorChanged(this.h, C.intptr_t(cgo.NewHandle(slot)))
|
2024-09-14 22:29:05 +00:00
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
//export miqt_exec_callback_QColorDialog_CurrentColorChanged
|
2024-10-13 06:06:06 +00:00
|
|
|
func miqt_exec_callback_QColorDialog_CurrentColorChanged(cb C.intptr_t, color *C.QColor) {
|
|
|
|
gofunc, ok := cgo.Handle(cb).Value().(func(color *QColor))
|
2024-09-14 22:29:05 +00:00
|
|
|
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
|
2024-10-16 05:07:56 +00:00
|
|
|
slotval1 := UnsafeNewQColor(unsafe.Pointer(color))
|
2024-09-14 22:29:05 +00:00
|
|
|
|
|
|
|
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)) {
|
2024-10-13 06:06:06 +00:00
|
|
|
C.QColorDialog_connect_ColorSelected(this.h, C.intptr_t(cgo.NewHandle(slot)))
|
2024-09-14 22:29:05 +00:00
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
//export miqt_exec_callback_QColorDialog_ColorSelected
|
2024-10-13 06:06:06 +00:00
|
|
|
func miqt_exec_callback_QColorDialog_ColorSelected(cb C.intptr_t, color *C.QColor) {
|
|
|
|
gofunc, ok := cgo.Handle(cb).Value().(func(color *QColor))
|
2024-09-14 22:29:05 +00:00
|
|
|
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
|
2024-10-16 05:07:56 +00:00
|
|
|
slotval1 := UnsafeNewQColor(unsafe.Pointer(color))
|
2024-09-14 22:29:05 +00:00
|
|
|
|
|
|
|
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-10-18 23:53:33 +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.data))
|
2024-09-14 22:29:05 +00:00
|
|
|
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-10-18 23:53:33 +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.data))
|
2024-09-14 22:29:05 +00:00
|
|
|
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-10-18 23:53:33 +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.data))
|
2024-09-14 22:29:05 +00:00
|
|
|
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-10-18 23:53:33 +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.data))
|
2024-09-14 22:29:05 +00:00
|
|
|
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-09-18 00:12:02 +00:00
|
|
|
C.QColorDialog_SetOption2(this.h, (C.int)(option), (C.bool)(on))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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-10-18 23:53:33 +00:00
|
|
|
title_ms := C.struct_miqt_string{}
|
|
|
|
title_ms.data = C.CString(title)
|
|
|
|
title_ms.len = C.size_t(len(title))
|
|
|
|
defer C.free(unsafe.Pointer(title_ms.data))
|
|
|
|
_ret := C.QColorDialog_GetColor3(initial.cPointer(), parent.cPointer(), title_ms)
|
2024-09-14 22:29:05 +00:00
|
|
|
_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
|
|
|
}
|
|
|
|
|
2024-09-20 06:40:03 +00:00
|
|
|
func QColorDialog_GetColor4(initial *QColor, parent *QWidget, title string, options QColorDialog__ColorDialogOption) *QColor {
|
2024-10-18 23:53:33 +00:00
|
|
|
title_ms := C.struct_miqt_string{}
|
|
|
|
title_ms.data = C.CString(title)
|
|
|
|
title_ms.len = C.size_t(len(title))
|
|
|
|
defer C.free(unsafe.Pointer(title_ms.data))
|
|
|
|
_ret := C.QColorDialog_GetColor4(initial.cPointer(), parent.cPointer(), title_ms, (C.int)(options))
|
2024-09-14 22:29:05 +00:00
|
|
|
_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-17 07:30:27 +00:00
|
|
|
return (uint)(C.QColorDialog_GetRgba1((C.uint)(rgba)))
|
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-17 07:30:27 +00:00
|
|
|
return (uint)(C.QColorDialog_GetRgba2((C.uint)(rgba), (*C.bool)(unsafe.Pointer(ok))))
|
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-17 07:30:27 +00:00
|
|
|
return (uint)(C.QColorDialog_GetRgba3((C.uint)(rgba), (*C.bool)(unsafe.Pointer(ok)), parent.cPointer()))
|
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)
|
|
|
|
})
|
|
|
|
}
|