miqt/qt6/gen_qpaintdevice.go

143 lines
3.7 KiB
Go
Raw Permalink Normal View History

2024-10-20 05:21:03 +00:00
package qt6
/*
#include "gen_qpaintdevice.h"
#include <stdlib.h>
*/
import "C"
import (
"runtime"
"unsafe"
)
type QPaintDevice__PaintDeviceMetric int
const (
QPaintDevice__PdmWidth QPaintDevice__PaintDeviceMetric = 1
QPaintDevice__PdmHeight QPaintDevice__PaintDeviceMetric = 2
QPaintDevice__PdmWidthMM QPaintDevice__PaintDeviceMetric = 3
QPaintDevice__PdmHeightMM QPaintDevice__PaintDeviceMetric = 4
QPaintDevice__PdmNumColors QPaintDevice__PaintDeviceMetric = 5
QPaintDevice__PdmDepth QPaintDevice__PaintDeviceMetric = 6
QPaintDevice__PdmDpiX QPaintDevice__PaintDeviceMetric = 7
QPaintDevice__PdmDpiY QPaintDevice__PaintDeviceMetric = 8
QPaintDevice__PdmPhysicalDpiX QPaintDevice__PaintDeviceMetric = 9
QPaintDevice__PdmPhysicalDpiY QPaintDevice__PaintDeviceMetric = 10
QPaintDevice__PdmDevicePixelRatio QPaintDevice__PaintDeviceMetric = 11
QPaintDevice__PdmDevicePixelRatioScaled QPaintDevice__PaintDeviceMetric = 12
)
type QPaintDevice struct {
2024-11-19 06:29:06 +00:00
h *C.QPaintDevice
isSubclass bool
2024-10-20 05:21:03 +00:00
}
func (this *QPaintDevice) cPointer() *C.QPaintDevice {
if this == nil {
return nil
}
return this.h
}
func (this *QPaintDevice) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
2024-11-19 06:29:06 +00:00
// newQPaintDevice constructs the type using only CGO pointers.
2024-10-20 05:21:03 +00:00
func newQPaintDevice(h *C.QPaintDevice) *QPaintDevice {
if h == nil {
return nil
}
2024-12-07 04:15:57 +00:00
2024-10-20 05:21:03 +00:00
return &QPaintDevice{h: h}
}
2024-11-19 06:29:06 +00:00
// UnsafeNewQPaintDevice constructs the type using only unsafe pointers.
2024-10-20 05:21:03 +00:00
func UnsafeNewQPaintDevice(h unsafe.Pointer) *QPaintDevice {
2024-12-07 04:15:57 +00:00
return newQPaintDevice((*C.QPaintDevice)(h))
2024-10-20 05:21:03 +00:00
}
func (this *QPaintDevice) DevType() int {
return (int)(C.QPaintDevice_DevType(this.h))
}
func (this *QPaintDevice) PaintingActive() bool {
return (bool)(C.QPaintDevice_PaintingActive(this.h))
}
func (this *QPaintDevice) PaintEngine() *QPaintEngine {
return newQPaintEngine(C.QPaintDevice_PaintEngine(this.h))
2024-10-20 05:21:03 +00:00
}
func (this *QPaintDevice) Width() int {
return (int)(C.QPaintDevice_Width(this.h))
}
func (this *QPaintDevice) Height() int {
return (int)(C.QPaintDevice_Height(this.h))
}
func (this *QPaintDevice) WidthMM() int {
return (int)(C.QPaintDevice_WidthMM(this.h))
}
func (this *QPaintDevice) HeightMM() int {
return (int)(C.QPaintDevice_HeightMM(this.h))
}
func (this *QPaintDevice) LogicalDpiX() int {
return (int)(C.QPaintDevice_LogicalDpiX(this.h))
}
func (this *QPaintDevice) LogicalDpiY() int {
return (int)(C.QPaintDevice_LogicalDpiY(this.h))
}
func (this *QPaintDevice) PhysicalDpiX() int {
return (int)(C.QPaintDevice_PhysicalDpiX(this.h))
}
func (this *QPaintDevice) PhysicalDpiY() int {
return (int)(C.QPaintDevice_PhysicalDpiY(this.h))
}
func (this *QPaintDevice) DevicePixelRatio() float64 {
return (float64)(C.QPaintDevice_DevicePixelRatio(this.h))
}
func (this *QPaintDevice) DevicePixelRatioF() float64 {
return (float64)(C.QPaintDevice_DevicePixelRatioF(this.h))
}
func (this *QPaintDevice) ColorCount() int {
return (int)(C.QPaintDevice_ColorCount(this.h))
}
func (this *QPaintDevice) Depth() int {
return (int)(C.QPaintDevice_Depth(this.h))
}
func QPaintDevice_DevicePixelRatioFScale() float64 {
return (float64)(C.QPaintDevice_DevicePixelRatioFScale())
}
// Delete this object from C++ memory.
func (this *QPaintDevice) Delete() {
2024-11-19 06:29:06 +00:00
C.QPaintDevice_Delete(this.h, C.bool(this.isSubclass))
2024-10-20 05:21:03 +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 *QPaintDevice) GoGC() {
runtime.SetFinalizer(this, func(this *QPaintDevice) {
this.Delete()
runtime.KeepAlive(this.h)
})
}