2024-11-04 09:13:59 +00:00
|
|
|
package printsupport
|
2024-10-16 05:08:07 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qprinterinfo.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/mappu/miqt/qt"
|
|
|
|
"runtime"
|
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
|
|
|
type QPrinterInfo struct {
|
2024-11-19 06:29:06 +00:00
|
|
|
h *C.QPrinterInfo
|
|
|
|
isSubclass bool
|
2024-10-16 05:08:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPrinterInfo) cPointer() *C.QPrinterInfo {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPrinterInfo) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// newQPrinterInfo constructs the type using only CGO pointers.
|
2024-10-16 05:08:07 +00:00
|
|
|
func newQPrinterInfo(h *C.QPrinterInfo) *QPrinterInfo {
|
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-12-07 04:15:57 +00:00
|
|
|
|
2024-10-16 05:08:07 +00:00
|
|
|
return &QPrinterInfo{h: h}
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// UnsafeNewQPrinterInfo constructs the type using only unsafe pointers.
|
2024-10-16 05:08:07 +00:00
|
|
|
func UnsafeNewQPrinterInfo(h unsafe.Pointer) *QPrinterInfo {
|
2024-12-07 04:15:57 +00:00
|
|
|
return newQPrinterInfo((*C.QPrinterInfo)(h))
|
2024-10-16 05:08:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQPrinterInfo constructs a new QPrinterInfo object.
|
|
|
|
func NewQPrinterInfo() *QPrinterInfo {
|
2024-11-19 06:29:06 +00:00
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
ret := newQPrinterInfo(C.QPrinterInfo_new())
|
2024-11-19 06:29:06 +00:00
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-10-16 05:08:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQPrinterInfo2 constructs a new QPrinterInfo object.
|
|
|
|
func NewQPrinterInfo2(other *QPrinterInfo) *QPrinterInfo {
|
2024-11-19 06:29:06 +00:00
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
ret := newQPrinterInfo(C.QPrinterInfo_new2(other.cPointer()))
|
2024-11-19 06:29:06 +00:00
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-10-16 05:08:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQPrinterInfo3 constructs a new QPrinterInfo object.
|
|
|
|
func NewQPrinterInfo3(printer *QPrinter) *QPrinterInfo {
|
2024-11-19 06:29:06 +00:00
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
ret := newQPrinterInfo(C.QPrinterInfo_new3(printer.cPointer()))
|
2024-11-19 06:29:06 +00:00
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-10-16 05:08:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPrinterInfo) OperatorAssign(other *QPrinterInfo) {
|
|
|
|
C.QPrinterInfo_OperatorAssign(this.h, other.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPrinterInfo) PrinterName() string {
|
2024-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QPrinterInfo_PrinterName(this.h)
|
|
|
|
_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 *QPrinterInfo) Description() string {
|
2024-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QPrinterInfo_Description(this.h)
|
|
|
|
_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 *QPrinterInfo) Location() string {
|
2024-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QPrinterInfo_Location(this.h)
|
|
|
|
_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 *QPrinterInfo) MakeAndModel() string {
|
2024-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QPrinterInfo_MakeAndModel(this.h)
|
|
|
|
_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 *QPrinterInfo) IsNull() bool {
|
|
|
|
return (bool)(C.QPrinterInfo_IsNull(this.h))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPrinterInfo) IsDefault() bool {
|
|
|
|
return (bool)(C.QPrinterInfo_IsDefault(this.h))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPrinterInfo) IsRemote() bool {
|
|
|
|
return (bool)(C.QPrinterInfo_IsRemote(this.h))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPrinterInfo) State() QPrinter__PrinterState {
|
|
|
|
return (QPrinter__PrinterState)(C.QPrinterInfo_State(this.h))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPrinterInfo) SupportedPageSizes() []qt.QPageSize {
|
2024-11-04 07:18:27 +00:00
|
|
|
var _ma C.struct_miqt_array = C.QPrinterInfo_SupportedPageSizes(this.h)
|
2024-10-16 05:08:07 +00:00
|
|
|
_ret := make([]qt.QPageSize, int(_ma.len))
|
|
|
|
_outCast := (*[0xffff]*C.QPageSize)(unsafe.Pointer(_ma.data)) // hey ya
|
|
|
|
for i := 0; i < int(_ma.len); i++ {
|
2024-12-07 02:02:06 +00:00
|
|
|
_lv_goptr := qt.UnsafeNewQPageSize(unsafe.Pointer(_outCast[i]))
|
2024-10-16 05:08:07 +00:00
|
|
|
_lv_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
_ret[i] = *_lv_goptr
|
|
|
|
}
|
|
|
|
return _ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPrinterInfo) DefaultPageSize() *qt.QPageSize {
|
2024-12-07 02:02:06 +00:00
|
|
|
_goptr := qt.UnsafeNewQPageSize(unsafe.Pointer(C.QPrinterInfo_DefaultPageSize(this.h)))
|
2024-10-16 05:08:07 +00:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPrinterInfo) SupportsCustomPageSizes() bool {
|
|
|
|
return (bool)(C.QPrinterInfo_SupportsCustomPageSizes(this.h))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPrinterInfo) MinimumPhysicalPageSize() *qt.QPageSize {
|
2024-12-07 02:02:06 +00:00
|
|
|
_goptr := qt.UnsafeNewQPageSize(unsafe.Pointer(C.QPrinterInfo_MinimumPhysicalPageSize(this.h)))
|
2024-10-16 05:08:07 +00:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPrinterInfo) MaximumPhysicalPageSize() *qt.QPageSize {
|
2024-12-07 02:02:06 +00:00
|
|
|
_goptr := qt.UnsafeNewQPageSize(unsafe.Pointer(C.QPrinterInfo_MaximumPhysicalPageSize(this.h)))
|
2024-10-16 05:08:07 +00:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPrinterInfo) SupportedPaperSizes() []qt.QPagedPaintDevice__PageSize {
|
2024-11-04 07:18:27 +00:00
|
|
|
var _ma C.struct_miqt_array = C.QPrinterInfo_SupportedPaperSizes(this.h)
|
2024-10-16 05:08:07 +00:00
|
|
|
_ret := make([]qt.QPagedPaintDevice__PageSize, int(_ma.len))
|
|
|
|
_outCast := (*[0xffff]C.int)(unsafe.Pointer(_ma.data)) // hey ya
|
|
|
|
for i := 0; i < int(_ma.len); i++ {
|
|
|
|
_ret[i] = (qt.QPagedPaintDevice__PageSize)(_outCast[i])
|
|
|
|
}
|
|
|
|
return _ret
|
|
|
|
}
|
|
|
|
|
2024-11-17 06:21:37 +00:00
|
|
|
func (this *QPrinterInfo) SupportedSizesWithNames() []struct {
|
|
|
|
First string
|
|
|
|
Second qt.QSizeF
|
|
|
|
} {
|
|
|
|
var _ma C.struct_miqt_array = C.QPrinterInfo_SupportedSizesWithNames(this.h)
|
|
|
|
_ret := make([]struct {
|
|
|
|
First string
|
|
|
|
Second qt.QSizeF
|
|
|
|
}, int(_ma.len))
|
|
|
|
_outCast := (*[0xffff]C.struct_miqt_map)(unsafe.Pointer(_ma.data)) // hey ya
|
|
|
|
for i := 0; i < int(_ma.len); i++ {
|
|
|
|
var _lv_mm C.struct_miqt_map = _outCast[i]
|
|
|
|
_lv_First_CArray := (*[0xffff]C.struct_miqt_string)(unsafe.Pointer(_lv_mm.keys))
|
|
|
|
_lv_Second_CArray := (*[0xffff]*C.QSizeF)(unsafe.Pointer(_lv_mm.values))
|
|
|
|
var _lv_first_ms C.struct_miqt_string = _lv_First_CArray[0]
|
|
|
|
_lv_first_ret := C.GoStringN(_lv_first_ms.data, C.int(int64(_lv_first_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_lv_first_ms.data))
|
|
|
|
_lv_entry_First := _lv_first_ret
|
2024-12-07 02:02:06 +00:00
|
|
|
_lv_second_goptr := qt.UnsafeNewQSizeF(unsafe.Pointer(_lv_Second_CArray[0]))
|
2024-11-17 06:21:37 +00:00
|
|
|
_lv_second_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
_lv_entry_Second := *_lv_second_goptr
|
|
|
|
|
|
|
|
_ret[i] = struct {
|
|
|
|
First string
|
|
|
|
Second qt.QSizeF
|
|
|
|
}{First: _lv_entry_First, Second: _lv_entry_Second}
|
|
|
|
}
|
|
|
|
return _ret
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:08:07 +00:00
|
|
|
func (this *QPrinterInfo) SupportedResolutions() []int {
|
2024-11-04 07:18:27 +00:00
|
|
|
var _ma C.struct_miqt_array = C.QPrinterInfo_SupportedResolutions(this.h)
|
2024-10-16 05:08:07 +00:00
|
|
|
_ret := make([]int, int(_ma.len))
|
|
|
|
_outCast := (*[0xffff]C.int)(unsafe.Pointer(_ma.data)) // hey ya
|
|
|
|
for i := 0; i < int(_ma.len); i++ {
|
|
|
|
_ret[i] = (int)(_outCast[i])
|
|
|
|
}
|
|
|
|
return _ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPrinterInfo) DefaultDuplexMode() QPrinter__DuplexMode {
|
|
|
|
return (QPrinter__DuplexMode)(C.QPrinterInfo_DefaultDuplexMode(this.h))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPrinterInfo) SupportedDuplexModes() []QPrinter__DuplexMode {
|
2024-11-04 07:18:27 +00:00
|
|
|
var _ma C.struct_miqt_array = C.QPrinterInfo_SupportedDuplexModes(this.h)
|
2024-10-16 05:08:07 +00:00
|
|
|
_ret := make([]QPrinter__DuplexMode, int(_ma.len))
|
|
|
|
_outCast := (*[0xffff]C.int)(unsafe.Pointer(_ma.data)) // hey ya
|
|
|
|
for i := 0; i < int(_ma.len); i++ {
|
|
|
|
_ret[i] = (QPrinter__DuplexMode)(_outCast[i])
|
|
|
|
}
|
|
|
|
return _ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPrinterInfo) DefaultColorMode() QPrinter__ColorMode {
|
|
|
|
return (QPrinter__ColorMode)(C.QPrinterInfo_DefaultColorMode(this.h))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPrinterInfo) SupportedColorModes() []QPrinter__ColorMode {
|
2024-11-04 07:18:27 +00:00
|
|
|
var _ma C.struct_miqt_array = C.QPrinterInfo_SupportedColorModes(this.h)
|
2024-10-16 05:08:07 +00:00
|
|
|
_ret := make([]QPrinter__ColorMode, int(_ma.len))
|
|
|
|
_outCast := (*[0xffff]C.int)(unsafe.Pointer(_ma.data)) // hey ya
|
|
|
|
for i := 0; i < int(_ma.len); i++ {
|
|
|
|
_ret[i] = (QPrinter__ColorMode)(_outCast[i])
|
|
|
|
}
|
|
|
|
return _ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func QPrinterInfo_AvailablePrinterNames() []string {
|
2024-11-04 07:18:27 +00:00
|
|
|
var _ma C.struct_miqt_array = C.QPrinterInfo_AvailablePrinterNames()
|
2024-10-16 05:08:07 +00:00
|
|
|
_ret := make([]string, int(_ma.len))
|
2024-10-18 23:53:33 +00:00
|
|
|
_outCast := (*[0xffff]C.struct_miqt_string)(unsafe.Pointer(_ma.data)) // hey ya
|
2024-10-16 05:08:07 +00:00
|
|
|
for i := 0; i < int(_ma.len); i++ {
|
2024-10-18 23:53:33 +00:00
|
|
|
var _lv_ms C.struct_miqt_string = _outCast[i]
|
|
|
|
_lv_ret := C.GoStringN(_lv_ms.data, C.int(int64(_lv_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_lv_ms.data))
|
2024-10-16 05:08:07 +00:00
|
|
|
_ret[i] = _lv_ret
|
|
|
|
}
|
|
|
|
return _ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func QPrinterInfo_AvailablePrinters() []QPrinterInfo {
|
2024-11-04 07:18:27 +00:00
|
|
|
var _ma C.struct_miqt_array = C.QPrinterInfo_AvailablePrinters()
|
2024-10-16 05:08:07 +00:00
|
|
|
_ret := make([]QPrinterInfo, int(_ma.len))
|
|
|
|
_outCast := (*[0xffff]*C.QPrinterInfo)(unsafe.Pointer(_ma.data)) // hey ya
|
|
|
|
for i := 0; i < int(_ma.len); i++ {
|
2024-12-07 02:02:06 +00:00
|
|
|
_lv_goptr := newQPrinterInfo(_outCast[i])
|
2024-10-16 05:08:07 +00:00
|
|
|
_lv_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
_ret[i] = *_lv_goptr
|
|
|
|
}
|
|
|
|
return _ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func QPrinterInfo_DefaultPrinterName() string {
|
2024-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QPrinterInfo_DefaultPrinterName()
|
|
|
|
_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 QPrinterInfo_DefaultPrinter() *QPrinterInfo {
|
2024-12-07 02:02:06 +00:00
|
|
|
_goptr := newQPrinterInfo(C.QPrinterInfo_DefaultPrinter())
|
2024-10-16 05:08:07 +00:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func QPrinterInfo_PrinterInfo(printerName string) *QPrinterInfo {
|
2024-10-18 23:53:33 +00:00
|
|
|
printerName_ms := C.struct_miqt_string{}
|
|
|
|
printerName_ms.data = C.CString(printerName)
|
|
|
|
printerName_ms.len = C.size_t(len(printerName))
|
|
|
|
defer C.free(unsafe.Pointer(printerName_ms.data))
|
2024-12-07 02:02:06 +00:00
|
|
|
_goptr := newQPrinterInfo(C.QPrinterInfo_PrinterInfo(printerName_ms))
|
2024-10-16 05:08:07 +00:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
// Delete this object from C++ memory.
|
|
|
|
func (this *QPrinterInfo) Delete() {
|
2024-11-19 06:29:06 +00:00
|
|
|
C.QPrinterInfo_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 *QPrinterInfo) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QPrinterInfo) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|