miqt/qt6/gen_qpagedpaintdevice.go

109 lines
3.0 KiB
Go
Raw Normal View History

2024-10-20 18:21:03 +13:00
package qt6
/*
#include "gen_qpagedpaintdevice.h"
#include <stdlib.h>
*/
import "C"
import (
"runtime"
"unsafe"
)
type QPagedPaintDevice__PdfVersion int
const (
QPagedPaintDevice__PdfVersion_1_4 QPagedPaintDevice__PdfVersion = 0
QPagedPaintDevice__PdfVersion_A1b QPagedPaintDevice__PdfVersion = 1
QPagedPaintDevice__PdfVersion_1_6 QPagedPaintDevice__PdfVersion = 2
)
type QPagedPaintDevice struct {
h *C.QPagedPaintDevice
2024-10-20 18:21:03 +13:00
*QPaintDevice
}
func (this *QPagedPaintDevice) cPointer() *C.QPagedPaintDevice {
if this == nil {
return nil
}
return this.h
}
func (this *QPagedPaintDevice) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
2024-11-19 19:29:06 +13:00
// newQPagedPaintDevice constructs the type using only CGO pointers.
2024-12-07 17:15:57 +13:00
func newQPagedPaintDevice(h *C.QPagedPaintDevice) *QPagedPaintDevice {
2024-10-20 18:21:03 +13:00
if h == nil {
return nil
}
2024-12-07 17:15:57 +13:00
var outptr_QPaintDevice *C.QPaintDevice = nil
C.QPagedPaintDevice_virtbase(h, &outptr_QPaintDevice)
2024-11-19 19:29:06 +13:00
return &QPagedPaintDevice{h: h,
2024-12-07 17:15:57 +13:00
QPaintDevice: newQPaintDevice(outptr_QPaintDevice)}
2024-10-20 18:21:03 +13:00
}
2024-11-19 19:29:06 +13:00
// UnsafeNewQPagedPaintDevice constructs the type using only unsafe pointers.
2024-12-07 17:15:57 +13:00
func UnsafeNewQPagedPaintDevice(h unsafe.Pointer) *QPagedPaintDevice {
return newQPagedPaintDevice((*C.QPagedPaintDevice)(h))
2024-10-20 18:21:03 +13:00
}
func (this *QPagedPaintDevice) NewPage() bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QPagedPaintDevice_newPage(this.h))
2024-10-20 18:21:03 +13:00
}
func (this *QPagedPaintDevice) SetPageLayout(pageLayout *QPageLayout) bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QPagedPaintDevice_setPageLayout(this.h, pageLayout.cPointer()))
2024-10-20 18:21:03 +13:00
}
func (this *QPagedPaintDevice) SetPageSize(pageSize *QPageSize) bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QPagedPaintDevice_setPageSize(this.h, pageSize.cPointer()))
2024-10-20 18:21:03 +13:00
}
func (this *QPagedPaintDevice) SetPageOrientation(orientation QPageLayout__Orientation) bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QPagedPaintDevice_setPageOrientation(this.h, (C.int)(orientation)))
2024-10-20 18:21:03 +13:00
}
2024-11-19 19:29:06 +13:00
func (this *QPagedPaintDevice) SetPageMargins(margins *QMarginsF, units QPageLayout__Unit) bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QPagedPaintDevice_setPageMargins(this.h, margins.cPointer(), (C.int)(units)))
2024-10-20 18:21:03 +13:00
}
func (this *QPagedPaintDevice) PageLayout() *QPageLayout {
2025-02-01 13:45:16 +13:00
_goptr := newQPageLayout(C.QPagedPaintDevice_pageLayout(this.h))
2024-10-20 18:21:03 +13:00
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QPagedPaintDevice) SetPageRanges(ranges *QPageRanges) {
2025-02-01 13:45:16 +13:00
C.QPagedPaintDevice_setPageRanges(this.h, ranges.cPointer())
2024-10-20 18:21:03 +13:00
}
func (this *QPagedPaintDevice) PageRanges() *QPageRanges {
2025-02-01 13:45:16 +13:00
_goptr := newQPageRanges(C.QPagedPaintDevice_pageRanges(this.h))
2024-10-20 18:21:03 +13: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 *QPagedPaintDevice) Delete() {
2025-02-01 13:45:16 +13:00
C.QPagedPaintDevice_delete(this.h)
2024-10-20 18:21:03 +13: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 *QPagedPaintDevice) GoGC() {
runtime.SetFinalizer(this, func(this *QPagedPaintDevice) {
this.Delete()
runtime.KeepAlive(this.h)
})
}