mirror of
https://github.com/mappu/miqt.git
synced 2024-12-22 17:08:38 +00:00
180 lines
5.7 KiB
Go
180 lines
5.7 KiB
Go
|
package qprintsupport
|
||
|
|
||
|
/*
|
||
|
|
||
|
#include "gen_qabstractprintdialog.h"
|
||
|
#include <stdlib.h>
|
||
|
|
||
|
*/
|
||
|
import "C"
|
||
|
|
||
|
import (
|
||
|
"github.com/mappu/miqt/qt6"
|
||
|
"runtime"
|
||
|
"unsafe"
|
||
|
)
|
||
|
|
||
|
type QAbstractPrintDialog__PrintRange int
|
||
|
|
||
|
const (
|
||
|
QAbstractPrintDialog__AllPages QAbstractPrintDialog__PrintRange = 0
|
||
|
QAbstractPrintDialog__Selection QAbstractPrintDialog__PrintRange = 1
|
||
|
QAbstractPrintDialog__PageRange QAbstractPrintDialog__PrintRange = 2
|
||
|
QAbstractPrintDialog__CurrentPage QAbstractPrintDialog__PrintRange = 3
|
||
|
)
|
||
|
|
||
|
type QAbstractPrintDialog__PrintDialogOption int
|
||
|
|
||
|
const (
|
||
|
QAbstractPrintDialog__PrintToFile QAbstractPrintDialog__PrintDialogOption = 1
|
||
|
QAbstractPrintDialog__PrintSelection QAbstractPrintDialog__PrintDialogOption = 2
|
||
|
QAbstractPrintDialog__PrintPageRange QAbstractPrintDialog__PrintDialogOption = 4
|
||
|
QAbstractPrintDialog__PrintShowPageSize QAbstractPrintDialog__PrintDialogOption = 8
|
||
|
QAbstractPrintDialog__PrintCollateCopies QAbstractPrintDialog__PrintDialogOption = 16
|
||
|
QAbstractPrintDialog__PrintCurrentPage QAbstractPrintDialog__PrintDialogOption = 64
|
||
|
)
|
||
|
|
||
|
type QAbstractPrintDialog struct {
|
||
|
h *C.QAbstractPrintDialog
|
||
|
*qt6.QDialog
|
||
|
}
|
||
|
|
||
|
func (this *QAbstractPrintDialog) cPointer() *C.QAbstractPrintDialog {
|
||
|
if this == nil {
|
||
|
return nil
|
||
|
}
|
||
|
return this.h
|
||
|
}
|
||
|
|
||
|
func (this *QAbstractPrintDialog) UnsafePointer() unsafe.Pointer {
|
||
|
if this == nil {
|
||
|
return nil
|
||
|
}
|
||
|
return unsafe.Pointer(this.h)
|
||
|
}
|
||
|
|
||
|
func newQAbstractPrintDialog(h *C.QAbstractPrintDialog) *QAbstractPrintDialog {
|
||
|
if h == nil {
|
||
|
return nil
|
||
|
}
|
||
|
return &QAbstractPrintDialog{h: h, QDialog: qt6.UnsafeNewQDialog(unsafe.Pointer(h))}
|
||
|
}
|
||
|
|
||
|
func UnsafeNewQAbstractPrintDialog(h unsafe.Pointer) *QAbstractPrintDialog {
|
||
|
return newQAbstractPrintDialog((*C.QAbstractPrintDialog)(h))
|
||
|
}
|
||
|
|
||
|
// NewQAbstractPrintDialog constructs a new QAbstractPrintDialog object.
|
||
|
func NewQAbstractPrintDialog(printer *QPrinter) *QAbstractPrintDialog {
|
||
|
ret := C.QAbstractPrintDialog_new(printer.cPointer())
|
||
|
return newQAbstractPrintDialog(ret)
|
||
|
}
|
||
|
|
||
|
// NewQAbstractPrintDialog2 constructs a new QAbstractPrintDialog object.
|
||
|
func NewQAbstractPrintDialog2(printer *QPrinter, parent *qt6.QWidget) *QAbstractPrintDialog {
|
||
|
ret := C.QAbstractPrintDialog_new2(printer.cPointer(), (*C.QWidget)(parent.UnsafePointer()))
|
||
|
return newQAbstractPrintDialog(ret)
|
||
|
}
|
||
|
|
||
|
func (this *QAbstractPrintDialog) MetaObject() *qt6.QMetaObject {
|
||
|
return qt6.UnsafeNewQMetaObject(unsafe.Pointer(C.QAbstractPrintDialog_MetaObject(this.h)))
|
||
|
}
|
||
|
|
||
|
func (this *QAbstractPrintDialog) Metacast(param1 string) unsafe.Pointer {
|
||
|
param1_Cstring := C.CString(param1)
|
||
|
defer C.free(unsafe.Pointer(param1_Cstring))
|
||
|
return (unsafe.Pointer)(C.QAbstractPrintDialog_Metacast(this.h, param1_Cstring))
|
||
|
}
|
||
|
|
||
|
func QAbstractPrintDialog_Tr(s string) string {
|
||
|
s_Cstring := C.CString(s)
|
||
|
defer C.free(unsafe.Pointer(s_Cstring))
|
||
|
var _ms C.struct_miqt_string = C.QAbstractPrintDialog_Tr(s_Cstring)
|
||
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
||
|
C.free(unsafe.Pointer(_ms.data))
|
||
|
return _ret
|
||
|
}
|
||
|
|
||
|
func (this *QAbstractPrintDialog) SetOptionTabs(tabs []*qt6.QWidget) {
|
||
|
tabs_CArray := (*[0xffff]*C.QWidget)(C.malloc(C.size_t(8 * len(tabs))))
|
||
|
defer C.free(unsafe.Pointer(tabs_CArray))
|
||
|
for i := range tabs {
|
||
|
tabs_CArray[i] = (*C.QWidget)(tabs[i].UnsafePointer())
|
||
|
}
|
||
|
tabs_ma := &C.struct_miqt_array{len: C.size_t(len(tabs)), data: unsafe.Pointer(tabs_CArray)}
|
||
|
defer runtime.KeepAlive(unsafe.Pointer(tabs_ma))
|
||
|
C.QAbstractPrintDialog_SetOptionTabs(this.h, tabs_ma)
|
||
|
}
|
||
|
|
||
|
func (this *QAbstractPrintDialog) SetPrintRange(rangeVal QAbstractPrintDialog__PrintRange) {
|
||
|
C.QAbstractPrintDialog_SetPrintRange(this.h, (C.int)(rangeVal))
|
||
|
}
|
||
|
|
||
|
func (this *QAbstractPrintDialog) PrintRange() QAbstractPrintDialog__PrintRange {
|
||
|
return (QAbstractPrintDialog__PrintRange)(C.QAbstractPrintDialog_PrintRange(this.h))
|
||
|
}
|
||
|
|
||
|
func (this *QAbstractPrintDialog) SetMinMax(min int, max int) {
|
||
|
C.QAbstractPrintDialog_SetMinMax(this.h, (C.int)(min), (C.int)(max))
|
||
|
}
|
||
|
|
||
|
func (this *QAbstractPrintDialog) MinPage() int {
|
||
|
return (int)(C.QAbstractPrintDialog_MinPage(this.h))
|
||
|
}
|
||
|
|
||
|
func (this *QAbstractPrintDialog) MaxPage() int {
|
||
|
return (int)(C.QAbstractPrintDialog_MaxPage(this.h))
|
||
|
}
|
||
|
|
||
|
func (this *QAbstractPrintDialog) SetFromTo(fromPage int, toPage int) {
|
||
|
C.QAbstractPrintDialog_SetFromTo(this.h, (C.int)(fromPage), (C.int)(toPage))
|
||
|
}
|
||
|
|
||
|
func (this *QAbstractPrintDialog) FromPage() int {
|
||
|
return (int)(C.QAbstractPrintDialog_FromPage(this.h))
|
||
|
}
|
||
|
|
||
|
func (this *QAbstractPrintDialog) ToPage() int {
|
||
|
return (int)(C.QAbstractPrintDialog_ToPage(this.h))
|
||
|
}
|
||
|
|
||
|
func (this *QAbstractPrintDialog) Printer() *QPrinter {
|
||
|
return UnsafeNewQPrinter(unsafe.Pointer(C.QAbstractPrintDialog_Printer(this.h)))
|
||
|
}
|
||
|
|
||
|
func QAbstractPrintDialog_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.QAbstractPrintDialog_Tr2(s_Cstring, c_Cstring)
|
||
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
||
|
C.free(unsafe.Pointer(_ms.data))
|
||
|
return _ret
|
||
|
}
|
||
|
|
||
|
func QAbstractPrintDialog_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.QAbstractPrintDialog_Tr3(s_Cstring, c_Cstring, (C.int)(n))
|
||
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
||
|
C.free(unsafe.Pointer(_ms.data))
|
||
|
return _ret
|
||
|
}
|
||
|
|
||
|
// Delete this object from C++ memory.
|
||
|
func (this *QAbstractPrintDialog) Delete() {
|
||
|
C.QAbstractPrintDialog_Delete(this.h)
|
||
|
}
|
||
|
|
||
|
// 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 *QAbstractPrintDialog) GoGC() {
|
||
|
runtime.SetFinalizer(this, func(this *QAbstractPrintDialog) {
|
||
|
this.Delete()
|
||
|
runtime.KeepAlive(this.h)
|
||
|
})
|
||
|
}
|