miqt/qt/printsupport/gen_qprintdialog.go

328 lines
9.7 KiB
Go
Raw Normal View History

package printsupport
2024-10-16 05:08:07 +00:00
/*
#include "gen_qprintdialog.h"
#include <stdlib.h>
*/
import "C"
import (
"github.com/mappu/miqt/qt"
"runtime"
"runtime/cgo"
"unsafe"
)
type QPrintDialog struct {
2024-11-19 06:29:06 +00:00
h *C.QPrintDialog
isSubclass bool
2024-10-16 05:08:07 +00:00
*QAbstractPrintDialog
}
func (this *QPrintDialog) cPointer() *C.QPrintDialog {
if this == nil {
return nil
}
return this.h
}
func (this *QPrintDialog) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
2024-11-19 06:29:06 +00:00
// newQPrintDialog constructs the type using only CGO pointers.
2024-12-07 04:15:57 +00:00
func newQPrintDialog(h *C.QPrintDialog) *QPrintDialog {
2024-10-16 05:08:07 +00:00
if h == nil {
return nil
}
2024-12-07 04:15:57 +00:00
var outptr_QAbstractPrintDialog *C.QAbstractPrintDialog = nil
C.QPrintDialog_virtbase(h, &outptr_QAbstractPrintDialog)
2024-11-19 06:29:06 +00:00
return &QPrintDialog{h: h,
2024-12-07 04:15:57 +00:00
QAbstractPrintDialog: newQAbstractPrintDialog(outptr_QAbstractPrintDialog)}
2024-10-16 05:08:07 +00:00
}
2024-11-19 06:29:06 +00:00
// UnsafeNewQPrintDialog constructs the type using only unsafe pointers.
2024-12-07 04:15:57 +00:00
func UnsafeNewQPrintDialog(h unsafe.Pointer) *QPrintDialog {
return newQPrintDialog((*C.QPrintDialog)(h))
2024-10-16 05:08:07 +00:00
}
// NewQPrintDialog constructs a new QPrintDialog object.
func NewQPrintDialog(parent *qt.QWidget) *QPrintDialog {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQPrintDialog(C.QPrintDialog_new((*C.QWidget)(parent.UnsafePointer())))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-16 05:08:07 +00:00
}
// NewQPrintDialog2 constructs a new QPrintDialog object.
func NewQPrintDialog2(printer *QPrinter) *QPrintDialog {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQPrintDialog(C.QPrintDialog_new2(printer.cPointer()))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-16 05:08:07 +00:00
}
// NewQPrintDialog3 constructs a new QPrintDialog object.
func NewQPrintDialog3() *QPrintDialog {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQPrintDialog(C.QPrintDialog_new3())
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-16 05:08:07 +00:00
}
// NewQPrintDialog4 constructs a new QPrintDialog object.
func NewQPrintDialog4(printer *QPrinter, parent *qt.QWidget) *QPrintDialog {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQPrintDialog(C.QPrintDialog_new4(printer.cPointer(), (*C.QWidget)(parent.UnsafePointer())))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-16 05:08:07 +00:00
}
func (this *QPrintDialog) MetaObject() *qt.QMetaObject {
return qt.UnsafeNewQMetaObject(unsafe.Pointer(C.QPrintDialog_MetaObject(this.h)))
}
func (this *QPrintDialog) Metacast(param1 string) unsafe.Pointer {
param1_Cstring := C.CString(param1)
defer C.free(unsafe.Pointer(param1_Cstring))
return (unsafe.Pointer)(C.QPrintDialog_Metacast(this.h, param1_Cstring))
2024-10-16 05:08:07 +00:00
}
func QPrintDialog_Tr(s string) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
var _ms C.struct_miqt_string = C.QPrintDialog_Tr(s_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
2024-10-16 05:08:07 +00:00
return _ret
}
func QPrintDialog_TrUtf8(s string) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
var _ms C.struct_miqt_string = C.QPrintDialog_TrUtf8(s_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
2024-10-16 05:08:07 +00:00
return _ret
}
func (this *QPrintDialog) Exec() int {
return (int)(C.QPrintDialog_Exec(this.h))
}
func (this *QPrintDialog) Accept() {
C.QPrintDialog_Accept(this.h)
}
func (this *QPrintDialog) Done(result int) {
C.QPrintDialog_Done(this.h, (C.int)(result))
}
func (this *QPrintDialog) SetOption(option QAbstractPrintDialog__PrintDialogOption) {
C.QPrintDialog_SetOption(this.h, (C.int)(option))
}
func (this *QPrintDialog) TestOption(option QAbstractPrintDialog__PrintDialogOption) bool {
return (bool)(C.QPrintDialog_TestOption(this.h, (C.int)(option)))
}
func (this *QPrintDialog) SetOptions(options QAbstractPrintDialog__PrintDialogOption) {
C.QPrintDialog_SetOptions(this.h, (C.int)(options))
}
func (this *QPrintDialog) Options() QAbstractPrintDialog__PrintDialogOption {
return (QAbstractPrintDialog__PrintDialogOption)(C.QPrintDialog_Options(this.h))
}
func (this *QPrintDialog) SetVisible(visible bool) {
C.QPrintDialog_SetVisible(this.h, (C.bool)(visible))
}
func (this *QPrintDialog) Accepted(printer *QPrinter) {
C.QPrintDialog_Accepted(this.h, printer.cPointer())
}
func (this *QPrintDialog) OnAccepted(slot func(printer *QPrinter)) {
C.QPrintDialog_connect_Accepted(this.h, C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QPrintDialog_Accepted
func miqt_exec_callback_QPrintDialog_Accepted(cb C.intptr_t, printer *C.QPrinter) {
gofunc, ok := cgo.Handle(cb).Value().(func(printer *QPrinter))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
2024-12-07 04:15:57 +00:00
slotval1 := newQPrinter(printer)
2024-10-16 05:08:07 +00:00
gofunc(slotval1)
}
func QPrintDialog_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 _ms C.struct_miqt_string = C.QPrintDialog_Tr2(s_Cstring, c_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
2024-10-16 05:08:07 +00:00
return _ret
}
func QPrintDialog_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 _ms C.struct_miqt_string = C.QPrintDialog_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-10-16 05:08:07 +00:00
return _ret
}
func QPrintDialog_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 _ms C.struct_miqt_string = C.QPrintDialog_TrUtf82(s_Cstring, c_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
2024-10-16 05:08:07 +00:00
return _ret
}
func QPrintDialog_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 _ms C.struct_miqt_string = C.QPrintDialog_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-10-16 05:08:07 +00:00
return _ret
}
func (this *QPrintDialog) SetOption2(option QAbstractPrintDialog__PrintDialogOption, on bool) {
C.QPrintDialog_SetOption2(this.h, (C.int)(option), (C.bool)(on))
}
2024-11-19 06:29:06 +00:00
func (this *QPrintDialog) callVirtualBase_Exec() int {
return (int)(C.QPrintDialog_virtualbase_Exec(unsafe.Pointer(this.h)))
}
func (this *QPrintDialog) OnExec(slot func(super func() int) int) {
if !this.isSubclass {
panic("miqt: can only override virtual methods for directly constructed types")
}
2024-11-19 06:29:06 +00:00
C.QPrintDialog_override_virtual_Exec(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QPrintDialog_Exec
func miqt_exec_callback_QPrintDialog_Exec(self *C.QPrintDialog, cb C.intptr_t) C.int {
gofunc, ok := cgo.Handle(cb).Value().(func(super func() int) int)
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
virtualReturn := gofunc((&QPrintDialog{h: self}).callVirtualBase_Exec)
return (C.int)(virtualReturn)
}
func (this *QPrintDialog) callVirtualBase_Accept() {
C.QPrintDialog_virtualbase_Accept(unsafe.Pointer(this.h))
}
func (this *QPrintDialog) OnAccept(slot func(super func())) {
if !this.isSubclass {
panic("miqt: can only override virtual methods for directly constructed types")
}
2024-11-19 06:29:06 +00:00
C.QPrintDialog_override_virtual_Accept(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QPrintDialog_Accept
func miqt_exec_callback_QPrintDialog_Accept(self *C.QPrintDialog, cb C.intptr_t) {
gofunc, ok := cgo.Handle(cb).Value().(func(super func()))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
gofunc((&QPrintDialog{h: self}).callVirtualBase_Accept)
}
func (this *QPrintDialog) callVirtualBase_Done(result int) {
C.QPrintDialog_virtualbase_Done(unsafe.Pointer(this.h), (C.int)(result))
}
func (this *QPrintDialog) OnDone(slot func(super func(result int), result int)) {
if !this.isSubclass {
panic("miqt: can only override virtual methods for directly constructed types")
}
2024-11-19 06:29:06 +00:00
C.QPrintDialog_override_virtual_Done(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QPrintDialog_Done
func miqt_exec_callback_QPrintDialog_Done(self *C.QPrintDialog, cb C.intptr_t, result C.int) {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(result int), result int))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := (int)(result)
gofunc((&QPrintDialog{h: self}).callVirtualBase_Done, slotval1)
}
func (this *QPrintDialog) callVirtualBase_SetVisible(visible bool) {
C.QPrintDialog_virtualbase_SetVisible(unsafe.Pointer(this.h), (C.bool)(visible))
}
func (this *QPrintDialog) OnSetVisible(slot func(super func(visible bool), visible bool)) {
if !this.isSubclass {
panic("miqt: can only override virtual methods for directly constructed types")
}
2024-11-19 06:29:06 +00:00
C.QPrintDialog_override_virtual_SetVisible(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QPrintDialog_SetVisible
func miqt_exec_callback_QPrintDialog_SetVisible(self *C.QPrintDialog, cb C.intptr_t, visible C.bool) {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(visible bool), visible bool))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := (bool)(visible)
gofunc((&QPrintDialog{h: self}).callVirtualBase_SetVisible, slotval1)
}
2024-10-16 05:08:07 +00:00
// Delete this object from C++ memory.
func (this *QPrintDialog) Delete() {
2024-11-19 06:29:06 +00:00
C.QPrintDialog_Delete(this.h, C.bool(this.isSubclass))
2024-10-16 05:08:07 +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 *QPrintDialog) GoGC() {
runtime.SetFinalizer(this, func(this *QPrintDialog) {
this.Delete()
runtime.KeepAlive(this.h)
})
}