miqt/qt6/printsupport/gen_qprinterinfo.go

271 lines
8.0 KiB
Go
Raw Normal View History

package printsupport
2024-10-20 06:00:06 +00:00
/*
#include "gen_qprinterinfo.h"
#include <stdlib.h>
*/
import "C"
import (
"github.com/mappu/miqt/qt6"
"runtime"
"unsafe"
)
type QPrinterInfo struct {
2024-11-19 06:29:06 +00:00
h *C.QPrinterInfo
isSubclass bool
2024-10-20 06:00:06 +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-20 06:00:06 +00:00
func newQPrinterInfo(h *C.QPrinterInfo) *QPrinterInfo {
if h == nil {
return nil
}
return &QPrinterInfo{h: h}
}
2024-11-19 06:29:06 +00:00
// UnsafeNewQPrinterInfo constructs the type using only unsafe pointers.
2024-10-20 06:00:06 +00:00
func UnsafeNewQPrinterInfo(h unsafe.Pointer) *QPrinterInfo {
2024-11-19 06:29:06 +00:00
if h == nil {
return nil
}
return &QPrinterInfo{h: (*C.QPrinterInfo)(h)}
2024-10-20 06:00:06 +00:00
}
// NewQPrinterInfo constructs a new QPrinterInfo object.
func NewQPrinterInfo() *QPrinterInfo {
2024-11-19 06:29:06 +00:00
var outptr_QPrinterInfo *C.QPrinterInfo = nil
C.QPrinterInfo_new(&outptr_QPrinterInfo)
ret := newQPrinterInfo(outptr_QPrinterInfo)
ret.isSubclass = true
return ret
2024-10-20 06:00:06 +00:00
}
// NewQPrinterInfo2 constructs a new QPrinterInfo object.
func NewQPrinterInfo2(other *QPrinterInfo) *QPrinterInfo {
2024-11-19 06:29:06 +00:00
var outptr_QPrinterInfo *C.QPrinterInfo = nil
C.QPrinterInfo_new2(other.cPointer(), &outptr_QPrinterInfo)
ret := newQPrinterInfo(outptr_QPrinterInfo)
ret.isSubclass = true
return ret
2024-10-20 06:00:06 +00:00
}
// NewQPrinterInfo3 constructs a new QPrinterInfo object.
func NewQPrinterInfo3(printer *QPrinter) *QPrinterInfo {
2024-11-19 06:29:06 +00:00
var outptr_QPrinterInfo *C.QPrinterInfo = nil
C.QPrinterInfo_new3(printer.cPointer(), &outptr_QPrinterInfo)
ret := newQPrinterInfo(outptr_QPrinterInfo)
ret.isSubclass = true
return ret
2024-10-20 06:00:06 +00:00
}
func (this *QPrinterInfo) OperatorAssign(other *QPrinterInfo) {
C.QPrinterInfo_OperatorAssign(this.h, other.cPointer())
}
func (this *QPrinterInfo) PrinterName() string {
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))
return _ret
}
func (this *QPrinterInfo) Description() string {
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))
return _ret
}
func (this *QPrinterInfo) Location() string {
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))
return _ret
}
func (this *QPrinterInfo) MakeAndModel() string {
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))
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() []qt6.QPageSize {
var _ma C.struct_miqt_array = C.QPrinterInfo_SupportedPageSizes(this.h)
2024-10-20 06:00:06 +00:00
_ret := make([]qt6.QPageSize, int(_ma.len))
_outCast := (*[0xffff]*C.QPageSize)(unsafe.Pointer(_ma.data)) // hey ya
for i := 0; i < int(_ma.len); i++ {
_lv_ret := _outCast[i]
_lv_goptr := qt6.UnsafeNewQPageSize(unsafe.Pointer(_lv_ret))
_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() *qt6.QPageSize {
_ret := C.QPrinterInfo_DefaultPageSize(this.h)
_goptr := qt6.UnsafeNewQPageSize(unsafe.Pointer(_ret))
_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() *qt6.QPageSize {
_ret := C.QPrinterInfo_MinimumPhysicalPageSize(this.h)
_goptr := qt6.UnsafeNewQPageSize(unsafe.Pointer(_ret))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QPrinterInfo) MaximumPhysicalPageSize() *qt6.QPageSize {
_ret := C.QPrinterInfo_MaximumPhysicalPageSize(this.h)
_goptr := qt6.UnsafeNewQPageSize(unsafe.Pointer(_ret))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QPrinterInfo) SupportedResolutions() []int {
var _ma C.struct_miqt_array = C.QPrinterInfo_SupportedResolutions(this.h)
2024-10-20 06:00:06 +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 {
var _ma C.struct_miqt_array = C.QPrinterInfo_SupportedDuplexModes(this.h)
2024-10-20 06:00:06 +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 {
var _ma C.struct_miqt_array = C.QPrinterInfo_SupportedColorModes(this.h)
2024-10-20 06:00:06 +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 {
var _ma C.struct_miqt_array = C.QPrinterInfo_AvailablePrinterNames()
2024-10-20 06:00:06 +00:00
_ret := make([]string, int(_ma.len))
_outCast := (*[0xffff]C.struct_miqt_string)(unsafe.Pointer(_ma.data)) // hey ya
for i := 0; i < int(_ma.len); i++ {
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))
_ret[i] = _lv_ret
}
return _ret
}
func QPrinterInfo_AvailablePrinters() []QPrinterInfo {
var _ma C.struct_miqt_array = C.QPrinterInfo_AvailablePrinters()
2024-10-20 06:00:06 +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++ {
_lv_ret := _outCast[i]
_lv_goptr := newQPrinterInfo(_lv_ret)
_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 {
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))
return _ret
}
func QPrinterInfo_DefaultPrinter() *QPrinterInfo {
_ret := C.QPrinterInfo_DefaultPrinter()
_goptr := newQPrinterInfo(_ret)
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func QPrinterInfo_PrinterInfo(printerName string) *QPrinterInfo {
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))
_ret := C.QPrinterInfo_PrinterInfo(printerName_ms)
_goptr := newQPrinterInfo(_ret)
_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-20 06:00:06 +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)
})
}