2024-08-25 04:08:24 +00:00
|
|
|
package qt
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qtextlayout.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
import (
|
|
|
|
"runtime"
|
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
type QTextLayout__CursorMode int
|
|
|
|
|
|
|
|
const (
|
2024-09-20 07:13:26 +00:00
|
|
|
QTextLayout__SkipCharacters QTextLayout__CursorMode = 0
|
|
|
|
QTextLayout__SkipWords QTextLayout__CursorMode = 1
|
2024-09-04 06:54:22 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type QTextLine__Edge int
|
|
|
|
|
|
|
|
const (
|
2024-09-20 07:13:26 +00:00
|
|
|
QTextLine__Leading QTextLine__Edge = 0
|
|
|
|
QTextLine__Trailing QTextLine__Edge = 1
|
2024-09-04 06:54:22 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type QTextLine__CursorPosition int
|
|
|
|
|
|
|
|
const (
|
2024-09-20 07:13:26 +00:00
|
|
|
QTextLine__CursorBetweenCharacters QTextLine__CursorPosition = 0
|
|
|
|
QTextLine__CursorOnCharacter QTextLine__CursorPosition = 1
|
2024-09-04 06:54:22 +00:00
|
|
|
)
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
type QTextInlineObject struct {
|
2024-11-19 06:29:06 +00:00
|
|
|
h *C.QTextInlineObject
|
|
|
|
isSubclass bool
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextInlineObject) cPointer() *C.QTextInlineObject {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func (this *QTextInlineObject) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// newQTextInlineObject constructs the type using only CGO pointers.
|
2024-08-25 04:08:24 +00:00
|
|
|
func newQTextInlineObject(h *C.QTextInlineObject) *QTextInlineObject {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
return &QTextInlineObject{h: h}
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// UnsafeNewQTextInlineObject constructs the type using only unsafe pointers.
|
2024-10-16 05:07:56 +00:00
|
|
|
func UnsafeNewQTextInlineObject(h unsafe.Pointer) *QTextInlineObject {
|
2024-11-19 06:29:06 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
return &QTextInlineObject{h: (*C.QTextInlineObject)(h)}
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQTextInlineObject constructs a new QTextInlineObject object.
|
|
|
|
func NewQTextInlineObject() *QTextInlineObject {
|
2024-11-19 06:29:06 +00:00
|
|
|
var outptr_QTextInlineObject *C.QTextInlineObject = nil
|
|
|
|
|
|
|
|
C.QTextInlineObject_new(&outptr_QTextInlineObject)
|
|
|
|
ret := newQTextInlineObject(outptr_QTextInlineObject)
|
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextInlineObject) IsValid() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QTextInlineObject_IsValid(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextInlineObject) Rect() *QRectF {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QTextInlineObject_Rect(this.h)
|
|
|
|
_goptr := newQRectF(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextInlineObject) Width() float64 {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (float64)(C.QTextInlineObject_Width(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextInlineObject) Ascent() float64 {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (float64)(C.QTextInlineObject_Ascent(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextInlineObject) Descent() float64 {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (float64)(C.QTextInlineObject_Descent(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextInlineObject) Height() float64 {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (float64)(C.QTextInlineObject_Height(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QTextInlineObject) TextDirection() LayoutDirection {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (LayoutDirection)(C.QTextInlineObject_TextDirection(this.h))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QTextInlineObject) SetWidth(w float64) {
|
|
|
|
C.QTextInlineObject_SetWidth(this.h, (C.double)(w))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextInlineObject) SetAscent(a float64) {
|
|
|
|
C.QTextInlineObject_SetAscent(this.h, (C.double)(a))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextInlineObject) SetDescent(d float64) {
|
|
|
|
C.QTextInlineObject_SetDescent(this.h, (C.double)(d))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextInlineObject) TextPosition() int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QTextInlineObject_TextPosition(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextInlineObject) FormatIndex() int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QTextInlineObject_FormatIndex(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextInlineObject) Format() *QTextFormat {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QTextInlineObject_Format(this.h)
|
|
|
|
_goptr := newQTextFormat(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
// Delete this object from C++ memory.
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QTextInlineObject) Delete() {
|
2024-11-19 06:29:06 +00:00
|
|
|
C.QTextInlineObject_Delete(this.h, C.bool(this.isSubclass))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +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 *QTextInlineObject) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QTextInlineObject) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
type QTextLayout struct {
|
2024-11-19 06:29:06 +00:00
|
|
|
h *C.QTextLayout
|
|
|
|
isSubclass bool
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLayout) cPointer() *C.QTextLayout {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func (this *QTextLayout) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// newQTextLayout constructs the type using only CGO pointers.
|
2024-08-25 04:08:24 +00:00
|
|
|
func newQTextLayout(h *C.QTextLayout) *QTextLayout {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
return &QTextLayout{h: h}
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// UnsafeNewQTextLayout constructs the type using only unsafe pointers.
|
2024-10-16 05:07:56 +00:00
|
|
|
func UnsafeNewQTextLayout(h unsafe.Pointer) *QTextLayout {
|
2024-11-19 06:29:06 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
return &QTextLayout{h: (*C.QTextLayout)(h)}
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQTextLayout constructs a new QTextLayout object.
|
|
|
|
func NewQTextLayout() *QTextLayout {
|
2024-11-19 06:29:06 +00:00
|
|
|
var outptr_QTextLayout *C.QTextLayout = nil
|
|
|
|
|
|
|
|
C.QTextLayout_new(&outptr_QTextLayout)
|
|
|
|
ret := newQTextLayout(outptr_QTextLayout)
|
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQTextLayout2 constructs a new QTextLayout object.
|
|
|
|
func NewQTextLayout2(text string) *QTextLayout {
|
2024-10-18 23:53:33 +00:00
|
|
|
text_ms := C.struct_miqt_string{}
|
|
|
|
text_ms.data = C.CString(text)
|
|
|
|
text_ms.len = C.size_t(len(text))
|
|
|
|
defer C.free(unsafe.Pointer(text_ms.data))
|
2024-11-19 06:29:06 +00:00
|
|
|
var outptr_QTextLayout *C.QTextLayout = nil
|
|
|
|
|
|
|
|
C.QTextLayout_new2(text_ms, &outptr_QTextLayout)
|
|
|
|
ret := newQTextLayout(outptr_QTextLayout)
|
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQTextLayout3 constructs a new QTextLayout object.
|
|
|
|
func NewQTextLayout3(text string, font *QFont) *QTextLayout {
|
2024-10-18 23:53:33 +00:00
|
|
|
text_ms := C.struct_miqt_string{}
|
|
|
|
text_ms.data = C.CString(text)
|
|
|
|
text_ms.len = C.size_t(len(text))
|
|
|
|
defer C.free(unsafe.Pointer(text_ms.data))
|
2024-11-19 06:29:06 +00:00
|
|
|
var outptr_QTextLayout *C.QTextLayout = nil
|
|
|
|
|
|
|
|
C.QTextLayout_new3(text_ms, font.cPointer(), &outptr_QTextLayout)
|
|
|
|
ret := newQTextLayout(outptr_QTextLayout)
|
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQTextLayout4 constructs a new QTextLayout object.
|
|
|
|
func NewQTextLayout4(b *QTextBlock) *QTextLayout {
|
2024-11-19 06:29:06 +00:00
|
|
|
var outptr_QTextLayout *C.QTextLayout = nil
|
|
|
|
|
|
|
|
C.QTextLayout_new4(b.cPointer(), &outptr_QTextLayout)
|
|
|
|
ret := newQTextLayout(outptr_QTextLayout)
|
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQTextLayout5 constructs a new QTextLayout object.
|
|
|
|
func NewQTextLayout5(text string, font *QFont, paintdevice *QPaintDevice) *QTextLayout {
|
2024-10-18 23:53:33 +00:00
|
|
|
text_ms := C.struct_miqt_string{}
|
|
|
|
text_ms.data = C.CString(text)
|
|
|
|
text_ms.len = C.size_t(len(text))
|
|
|
|
defer C.free(unsafe.Pointer(text_ms.data))
|
2024-11-19 06:29:06 +00:00
|
|
|
var outptr_QTextLayout *C.QTextLayout = nil
|
|
|
|
|
|
|
|
C.QTextLayout_new5(text_ms, font.cPointer(), paintdevice.cPointer(), &outptr_QTextLayout)
|
|
|
|
ret := newQTextLayout(outptr_QTextLayout)
|
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLayout) SetFont(f *QFont) {
|
|
|
|
C.QTextLayout_SetFont(this.h, f.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLayout) Font() *QFont {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QTextLayout_Font(this.h)
|
|
|
|
_goptr := newQFont(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLayout) SetRawFont(rawFont *QRawFont) {
|
|
|
|
C.QTextLayout_SetRawFont(this.h, rawFont.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLayout) SetText(stringVal string) {
|
2024-10-18 23:53:33 +00:00
|
|
|
stringVal_ms := C.struct_miqt_string{}
|
|
|
|
stringVal_ms.data = C.CString(stringVal)
|
|
|
|
stringVal_ms.len = C.size_t(len(stringVal))
|
|
|
|
defer C.free(unsafe.Pointer(stringVal_ms.data))
|
|
|
|
C.QTextLayout_SetText(this.h, stringVal_ms)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLayout) Text() string {
|
2024-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QTextLayout_Text(this.h)
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLayout) SetTextOption(option *QTextOption) {
|
|
|
|
C.QTextLayout_SetTextOption(this.h, option.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLayout) TextOption() *QTextOption {
|
2024-10-16 05:07:56 +00:00
|
|
|
return UnsafeNewQTextOption(unsafe.Pointer(C.QTextLayout_TextOption(this.h)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLayout) SetPreeditArea(position int, text string) {
|
2024-10-18 23:53:33 +00:00
|
|
|
text_ms := C.struct_miqt_string{}
|
|
|
|
text_ms.data = C.CString(text)
|
|
|
|
text_ms.len = C.size_t(len(text))
|
|
|
|
defer C.free(unsafe.Pointer(text_ms.data))
|
|
|
|
C.QTextLayout_SetPreeditArea(this.h, (C.int)(position), text_ms)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLayout) PreeditAreaPosition() int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QTextLayout_PreeditAreaPosition(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLayout) PreeditAreaText() string {
|
2024-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QTextLayout_PreeditAreaText(this.h)
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
func (this *QTextLayout) SetAdditionalFormats(overrides []QTextLayout__FormatRange) {
|
2024-09-01 05:51:28 +00:00
|
|
|
overrides_CArray := (*[0xffff]*C.QTextLayout__FormatRange)(C.malloc(C.size_t(8 * len(overrides))))
|
2024-08-29 07:01:51 +00:00
|
|
|
defer C.free(unsafe.Pointer(overrides_CArray))
|
|
|
|
for i := range overrides {
|
|
|
|
overrides_CArray[i] = overrides[i].cPointer()
|
|
|
|
}
|
2024-11-04 07:18:27 +00:00
|
|
|
overrides_ma := C.struct_miqt_array{len: C.size_t(len(overrides)), data: unsafe.Pointer(overrides_CArray)}
|
2024-09-14 22:29:05 +00:00
|
|
|
C.QTextLayout_SetAdditionalFormats(this.h, overrides_ma)
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLayout) AdditionalFormats() []QTextLayout__FormatRange {
|
2024-11-04 07:18:27 +00:00
|
|
|
var _ma C.struct_miqt_array = C.QTextLayout_AdditionalFormats(this.h)
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := make([]QTextLayout__FormatRange, int(_ma.len))
|
2024-09-17 07:30:27 +00:00
|
|
|
_outCast := (*[0xffff]*C.QTextLayout__FormatRange)(unsafe.Pointer(_ma.data)) // hey ya
|
2024-09-14 22:29:05 +00:00
|
|
|
for i := 0; i < int(_ma.len); i++ {
|
2024-09-17 07:30:27 +00:00
|
|
|
_lv_ret := _outCast[i]
|
|
|
|
_lv_goptr := newQTextLayout__FormatRange(_lv_ret)
|
|
|
|
_lv_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
_ret[i] = *_lv_goptr
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QTextLayout) ClearAdditionalFormats() {
|
|
|
|
C.QTextLayout_ClearAdditionalFormats(this.h)
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
func (this *QTextLayout) SetFormats(overrides []QTextLayout__FormatRange) {
|
2024-09-01 05:51:28 +00:00
|
|
|
overrides_CArray := (*[0xffff]*C.QTextLayout__FormatRange)(C.malloc(C.size_t(8 * len(overrides))))
|
2024-08-29 07:01:51 +00:00
|
|
|
defer C.free(unsafe.Pointer(overrides_CArray))
|
|
|
|
for i := range overrides {
|
|
|
|
overrides_CArray[i] = overrides[i].cPointer()
|
|
|
|
}
|
2024-11-04 07:18:27 +00:00
|
|
|
overrides_ma := C.struct_miqt_array{len: C.size_t(len(overrides)), data: unsafe.Pointer(overrides_CArray)}
|
2024-09-14 22:29:05 +00:00
|
|
|
C.QTextLayout_SetFormats(this.h, overrides_ma)
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLayout) Formats() []QTextLayout__FormatRange {
|
2024-11-04 07:18:27 +00:00
|
|
|
var _ma C.struct_miqt_array = C.QTextLayout_Formats(this.h)
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := make([]QTextLayout__FormatRange, int(_ma.len))
|
2024-09-17 07:30:27 +00:00
|
|
|
_outCast := (*[0xffff]*C.QTextLayout__FormatRange)(unsafe.Pointer(_ma.data)) // hey ya
|
2024-09-14 22:29:05 +00:00
|
|
|
for i := 0; i < int(_ma.len); i++ {
|
2024-09-17 07:30:27 +00:00
|
|
|
_vv_ret := _outCast[i]
|
|
|
|
_vv_goptr := newQTextLayout__FormatRange(_vv_ret)
|
|
|
|
_vv_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
_ret[i] = *_vv_goptr
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QTextLayout) ClearFormats() {
|
|
|
|
C.QTextLayout_ClearFormats(this.h)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLayout) SetCacheEnabled(enable bool) {
|
|
|
|
C.QTextLayout_SetCacheEnabled(this.h, (C.bool)(enable))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLayout) CacheEnabled() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QTextLayout_CacheEnabled(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QTextLayout) SetCursorMoveStyle(style CursorMoveStyle) {
|
2024-09-18 00:12:02 +00:00
|
|
|
C.QTextLayout_SetCursorMoveStyle(this.h, (C.int)(style))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QTextLayout) CursorMoveStyle() CursorMoveStyle {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (CursorMoveStyle)(C.QTextLayout_CursorMoveStyle(this.h))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QTextLayout) BeginLayout() {
|
|
|
|
C.QTextLayout_BeginLayout(this.h)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLayout) EndLayout() {
|
|
|
|
C.QTextLayout_EndLayout(this.h)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLayout) ClearLayout() {
|
|
|
|
C.QTextLayout_ClearLayout(this.h)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLayout) CreateLine() *QTextLine {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QTextLayout_CreateLine(this.h)
|
|
|
|
_goptr := newQTextLine(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLayout) LineCount() int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QTextLayout_LineCount(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLayout) LineAt(i int) *QTextLine {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QTextLayout_LineAt(this.h, (C.int)(i))
|
|
|
|
_goptr := newQTextLine(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLayout) LineForTextPosition(pos int) *QTextLine {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QTextLayout_LineForTextPosition(this.h, (C.int)(pos))
|
|
|
|
_goptr := newQTextLine(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLayout) IsValidCursorPosition(pos int) bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QTextLayout_IsValidCursorPosition(this.h, (C.int)(pos)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
func (this *QTextLayout) NextCursorPosition(oldPos int) int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QTextLayout_NextCursorPosition(this.h, (C.int)(oldPos)))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLayout) PreviousCursorPosition(oldPos int) int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QTextLayout_PreviousCursorPosition(this.h, (C.int)(oldPos)))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QTextLayout) LeftCursorPosition(oldPos int) int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QTextLayout_LeftCursorPosition(this.h, (C.int)(oldPos)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLayout) RightCursorPosition(oldPos int) int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QTextLayout_RightCursorPosition(this.h, (C.int)(oldPos)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
func (this *QTextLayout) Draw(p *QPainter, pos *QPointF) {
|
|
|
|
C.QTextLayout_Draw(this.h, p.cPointer(), pos.cPointer())
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QTextLayout) DrawCursor(p *QPainter, pos *QPointF, cursorPosition int) {
|
|
|
|
C.QTextLayout_DrawCursor(this.h, p.cPointer(), pos.cPointer(), (C.int)(cursorPosition))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLayout) DrawCursor2(p *QPainter, pos *QPointF, cursorPosition int, width int) {
|
|
|
|
C.QTextLayout_DrawCursor2(this.h, p.cPointer(), pos.cPointer(), (C.int)(cursorPosition), (C.int)(width))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLayout) Position() *QPointF {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QTextLayout_Position(this.h)
|
|
|
|
_goptr := newQPointF(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLayout) SetPosition(p *QPointF) {
|
|
|
|
C.QTextLayout_SetPosition(this.h, p.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLayout) BoundingRect() *QRectF {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QTextLayout_BoundingRect(this.h)
|
|
|
|
_goptr := newQRectF(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLayout) MinimumWidth() float64 {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (float64)(C.QTextLayout_MinimumWidth(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLayout) MaximumWidth() float64 {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (float64)(C.QTextLayout_MaximumWidth(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLayout) GlyphRuns() []QGlyphRun {
|
2024-11-04 07:18:27 +00:00
|
|
|
var _ma C.struct_miqt_array = C.QTextLayout_GlyphRuns(this.h)
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := make([]QGlyphRun, int(_ma.len))
|
2024-09-17 07:30:27 +00:00
|
|
|
_outCast := (*[0xffff]*C.QGlyphRun)(unsafe.Pointer(_ma.data)) // hey ya
|
2024-09-14 22:29:05 +00:00
|
|
|
for i := 0; i < int(_ma.len); i++ {
|
2024-09-17 07:30:27 +00:00
|
|
|
_lv_ret := _outCast[i]
|
|
|
|
_lv_goptr := newQGlyphRun(_lv_ret)
|
|
|
|
_lv_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
_ret[i] = *_lv_goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLayout) SetFlags(flags int) {
|
|
|
|
C.QTextLayout_SetFlags(this.h, (C.int)(flags))
|
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QTextLayout) NextCursorPosition2(oldPos int, mode QTextLayout__CursorMode) int {
|
2024-09-18 00:12:02 +00:00
|
|
|
return (int)(C.QTextLayout_NextCursorPosition2(this.h, (C.int)(oldPos), (C.int)(mode)))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QTextLayout) PreviousCursorPosition2(oldPos int, mode QTextLayout__CursorMode) int {
|
2024-09-18 00:12:02 +00:00
|
|
|
return (int)(C.QTextLayout_PreviousCursorPosition2(this.h, (C.int)(oldPos), (C.int)(mode)))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLayout) Draw3(p *QPainter, pos *QPointF, selections []QTextLayout__FormatRange) {
|
2024-09-01 05:51:28 +00:00
|
|
|
selections_CArray := (*[0xffff]*C.QTextLayout__FormatRange)(C.malloc(C.size_t(8 * len(selections))))
|
2024-08-29 07:01:51 +00:00
|
|
|
defer C.free(unsafe.Pointer(selections_CArray))
|
|
|
|
for i := range selections {
|
|
|
|
selections_CArray[i] = selections[i].cPointer()
|
|
|
|
}
|
2024-11-04 07:18:27 +00:00
|
|
|
selections_ma := C.struct_miqt_array{len: C.size_t(len(selections)), data: unsafe.Pointer(selections_CArray)}
|
2024-09-14 22:29:05 +00:00
|
|
|
C.QTextLayout_Draw3(this.h, p.cPointer(), pos.cPointer(), selections_ma)
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLayout) Draw4(p *QPainter, pos *QPointF, selections []QTextLayout__FormatRange, clip *QRectF) {
|
2024-09-01 05:51:28 +00:00
|
|
|
selections_CArray := (*[0xffff]*C.QTextLayout__FormatRange)(C.malloc(C.size_t(8 * len(selections))))
|
2024-08-29 07:01:51 +00:00
|
|
|
defer C.free(unsafe.Pointer(selections_CArray))
|
|
|
|
for i := range selections {
|
|
|
|
selections_CArray[i] = selections[i].cPointer()
|
|
|
|
}
|
2024-11-04 07:18:27 +00:00
|
|
|
selections_ma := C.struct_miqt_array{len: C.size_t(len(selections)), data: unsafe.Pointer(selections_CArray)}
|
2024-09-14 22:29:05 +00:00
|
|
|
C.QTextLayout_Draw4(this.h, p.cPointer(), pos.cPointer(), selections_ma, clip.cPointer())
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QTextLayout) GlyphRuns1(from int) []QGlyphRun {
|
2024-11-04 07:18:27 +00:00
|
|
|
var _ma C.struct_miqt_array = C.QTextLayout_GlyphRuns1(this.h, (C.int)(from))
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := make([]QGlyphRun, int(_ma.len))
|
2024-09-17 07:30:27 +00:00
|
|
|
_outCast := (*[0xffff]*C.QGlyphRun)(unsafe.Pointer(_ma.data)) // hey ya
|
2024-09-14 22:29:05 +00:00
|
|
|
for i := 0; i < int(_ma.len); i++ {
|
2024-09-17 07:30:27 +00:00
|
|
|
_lv_ret := _outCast[i]
|
|
|
|
_lv_goptr := newQGlyphRun(_lv_ret)
|
|
|
|
_lv_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
_ret[i] = *_lv_goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLayout) GlyphRuns2(from int, length int) []QGlyphRun {
|
2024-11-04 07:18:27 +00:00
|
|
|
var _ma C.struct_miqt_array = C.QTextLayout_GlyphRuns2(this.h, (C.int)(from), (C.int)(length))
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := make([]QGlyphRun, int(_ma.len))
|
2024-09-17 07:30:27 +00:00
|
|
|
_outCast := (*[0xffff]*C.QGlyphRun)(unsafe.Pointer(_ma.data)) // hey ya
|
2024-09-14 22:29:05 +00:00
|
|
|
for i := 0; i < int(_ma.len); i++ {
|
2024-09-17 07:30:27 +00:00
|
|
|
_lv_ret := _outCast[i]
|
|
|
|
_lv_goptr := newQGlyphRun(_lv_ret)
|
|
|
|
_lv_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
_ret[i] = *_lv_goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
// Delete this object from C++ memory.
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QTextLayout) Delete() {
|
2024-11-19 06:29:06 +00:00
|
|
|
C.QTextLayout_Delete(this.h, C.bool(this.isSubclass))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +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 *QTextLayout) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QTextLayout) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
type QTextLine struct {
|
2024-11-19 06:29:06 +00:00
|
|
|
h *C.QTextLine
|
|
|
|
isSubclass bool
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLine) cPointer() *C.QTextLine {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func (this *QTextLine) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// newQTextLine constructs the type using only CGO pointers.
|
2024-08-25 04:08:24 +00:00
|
|
|
func newQTextLine(h *C.QTextLine) *QTextLine {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
return &QTextLine{h: h}
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// UnsafeNewQTextLine constructs the type using only unsafe pointers.
|
2024-10-16 05:07:56 +00:00
|
|
|
func UnsafeNewQTextLine(h unsafe.Pointer) *QTextLine {
|
2024-11-19 06:29:06 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
return &QTextLine{h: (*C.QTextLine)(h)}
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQTextLine constructs a new QTextLine object.
|
|
|
|
func NewQTextLine() *QTextLine {
|
2024-11-19 06:29:06 +00:00
|
|
|
var outptr_QTextLine *C.QTextLine = nil
|
|
|
|
|
|
|
|
C.QTextLine_new(&outptr_QTextLine)
|
|
|
|
ret := newQTextLine(outptr_QTextLine)
|
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLine) IsValid() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QTextLine_IsValid(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLine) Rect() *QRectF {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QTextLine_Rect(this.h)
|
|
|
|
_goptr := newQRectF(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLine) X() float64 {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (float64)(C.QTextLine_X(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLine) Y() float64 {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (float64)(C.QTextLine_Y(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLine) Width() float64 {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (float64)(C.QTextLine_Width(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLine) Ascent() float64 {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (float64)(C.QTextLine_Ascent(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLine) Descent() float64 {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (float64)(C.QTextLine_Descent(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLine) Height() float64 {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (float64)(C.QTextLine_Height(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLine) Leading() float64 {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (float64)(C.QTextLine_Leading(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLine) SetLeadingIncluded(included bool) {
|
|
|
|
C.QTextLine_SetLeadingIncluded(this.h, (C.bool)(included))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLine) LeadingIncluded() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QTextLine_LeadingIncluded(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLine) NaturalTextWidth() float64 {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (float64)(C.QTextLine_NaturalTextWidth(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLine) HorizontalAdvance() float64 {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (float64)(C.QTextLine_HorizontalAdvance(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLine) NaturalTextRect() *QRectF {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QTextLine_NaturalTextRect(this.h)
|
|
|
|
_goptr := newQRectF(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
func (this *QTextLine) CursorToX(cursorPos *int) float64 {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (float64)(C.QTextLine_CursorToX(this.h, (*C.int)(unsafe.Pointer(cursorPos))))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLine) CursorToXWithCursorPos(cursorPos int) float64 {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (float64)(C.QTextLine_CursorToXWithCursorPos(this.h, (C.int)(cursorPos)))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLine) XToCursor(x float64) int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QTextLine_XToCursor(this.h, (C.double)(x)))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QTextLine) SetLineWidth(width float64) {
|
|
|
|
C.QTextLine_SetLineWidth(this.h, (C.double)(width))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLine) SetNumColumns(columns int) {
|
|
|
|
C.QTextLine_SetNumColumns(this.h, (C.int)(columns))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLine) SetNumColumns2(columns int, alignmentWidth float64) {
|
|
|
|
C.QTextLine_SetNumColumns2(this.h, (C.int)(columns), (C.double)(alignmentWidth))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLine) SetPosition(pos *QPointF) {
|
|
|
|
C.QTextLine_SetPosition(this.h, pos.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLine) Position() *QPointF {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QTextLine_Position(this.h)
|
|
|
|
_goptr := newQPointF(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLine) TextStart() int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QTextLine_TextStart(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLine) TextLength() int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QTextLine_TextLength(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLine) LineNumber() int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QTextLine_LineNumber(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
func (this *QTextLine) Draw(p *QPainter, point *QPointF) {
|
|
|
|
C.QTextLine_Draw(this.h, p.cPointer(), point.cPointer())
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QTextLine) GlyphRuns() []QGlyphRun {
|
2024-11-04 07:18:27 +00:00
|
|
|
var _ma C.struct_miqt_array = C.QTextLine_GlyphRuns(this.h)
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := make([]QGlyphRun, int(_ma.len))
|
2024-09-17 07:30:27 +00:00
|
|
|
_outCast := (*[0xffff]*C.QGlyphRun)(unsafe.Pointer(_ma.data)) // hey ya
|
2024-09-14 22:29:05 +00:00
|
|
|
for i := 0; i < int(_ma.len); i++ {
|
2024-09-17 07:30:27 +00:00
|
|
|
_lv_ret := _outCast[i]
|
|
|
|
_lv_goptr := newQGlyphRun(_lv_ret)
|
|
|
|
_lv_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
_ret[i] = *_lv_goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QTextLine) CursorToX2(cursorPos *int, edge QTextLine__Edge) float64 {
|
2024-09-18 00:12:02 +00:00
|
|
|
return (float64)(C.QTextLine_CursorToX2(this.h, (*C.int)(unsafe.Pointer(cursorPos)), (C.int)(edge)))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QTextLine) CursorToX22(cursorPos int, edge QTextLine__Edge) float64 {
|
2024-09-18 00:12:02 +00:00
|
|
|
return (float64)(C.QTextLine_CursorToX22(this.h, (C.int)(cursorPos), (C.int)(edge)))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QTextLine) XToCursor2(x float64, param2 QTextLine__CursorPosition) int {
|
2024-09-18 00:12:02 +00:00
|
|
|
return (int)(C.QTextLine_XToCursor2(this.h, (C.double)(x), (C.int)(param2)))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLine) Draw3(p *QPainter, point *QPointF, selection *QTextLayout__FormatRange) {
|
|
|
|
C.QTextLine_Draw3(this.h, p.cPointer(), point.cPointer(), selection.cPointer())
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QTextLine) GlyphRuns1(from int) []QGlyphRun {
|
2024-11-04 07:18:27 +00:00
|
|
|
var _ma C.struct_miqt_array = C.QTextLine_GlyphRuns1(this.h, (C.int)(from))
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := make([]QGlyphRun, int(_ma.len))
|
2024-09-17 07:30:27 +00:00
|
|
|
_outCast := (*[0xffff]*C.QGlyphRun)(unsafe.Pointer(_ma.data)) // hey ya
|
2024-09-14 22:29:05 +00:00
|
|
|
for i := 0; i < int(_ma.len); i++ {
|
2024-09-17 07:30:27 +00:00
|
|
|
_lv_ret := _outCast[i]
|
|
|
|
_lv_goptr := newQGlyphRun(_lv_ret)
|
|
|
|
_lv_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
_ret[i] = *_lv_goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLine) GlyphRuns2(from int, length int) []QGlyphRun {
|
2024-11-04 07:18:27 +00:00
|
|
|
var _ma C.struct_miqt_array = C.QTextLine_GlyphRuns2(this.h, (C.int)(from), (C.int)(length))
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := make([]QGlyphRun, int(_ma.len))
|
2024-09-17 07:30:27 +00:00
|
|
|
_outCast := (*[0xffff]*C.QGlyphRun)(unsafe.Pointer(_ma.data)) // hey ya
|
2024-09-14 22:29:05 +00:00
|
|
|
for i := 0; i < int(_ma.len); i++ {
|
2024-09-17 07:30:27 +00:00
|
|
|
_lv_ret := _outCast[i]
|
|
|
|
_lv_goptr := newQGlyphRun(_lv_ret)
|
|
|
|
_lv_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
_ret[i] = *_lv_goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
// Delete this object from C++ memory.
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QTextLine) Delete() {
|
2024-11-19 06:29:06 +00:00
|
|
|
C.QTextLine_Delete(this.h, C.bool(this.isSubclass))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-08-29 07:01:51 +00:00
|
|
|
|
2024-09-14 22:29:05 +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 *QTextLine) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QTextLine) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
type QTextLayout__FormatRange struct {
|
2024-11-19 06:29:06 +00:00
|
|
|
h *C.QTextLayout__FormatRange
|
|
|
|
isSubclass bool
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextLayout__FormatRange) cPointer() *C.QTextLayout__FormatRange {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func (this *QTextLayout__FormatRange) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// newQTextLayout__FormatRange constructs the type using only CGO pointers.
|
2024-08-29 07:01:51 +00:00
|
|
|
func newQTextLayout__FormatRange(h *C.QTextLayout__FormatRange) *QTextLayout__FormatRange {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-08-29 07:01:51 +00:00
|
|
|
return &QTextLayout__FormatRange{h: h}
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// UnsafeNewQTextLayout__FormatRange constructs the type using only unsafe pointers.
|
2024-10-16 05:07:56 +00:00
|
|
|
func UnsafeNewQTextLayout__FormatRange(h unsafe.Pointer) *QTextLayout__FormatRange {
|
2024-11-19 06:29:06 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
return &QTextLayout__FormatRange{h: (*C.QTextLayout__FormatRange)(h)}
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
// Delete this object from C++ memory.
|
2024-08-29 07:01:51 +00:00
|
|
|
func (this *QTextLayout__FormatRange) Delete() {
|
2024-11-19 06:29:06 +00:00
|
|
|
C.QTextLayout__FormatRange_Delete(this.h, C.bool(this.isSubclass))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +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 *QTextLayout__FormatRange) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QTextLayout__FormatRange) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|