miqt/qt6/gen_qaccessibleobject.go

174 lines
5.0 KiB
Go
Raw Normal View History

2024-10-20 18:21:03 +13:00
package qt6
/*
#include "gen_qaccessibleobject.h"
#include <stdlib.h>
*/
import "C"
import (
"runtime"
"unsafe"
)
type QAccessibleObject struct {
h *C.QAccessibleObject
2024-10-20 18:21:03 +13:00
*QAccessibleInterface
}
func (this *QAccessibleObject) cPointer() *C.QAccessibleObject {
if this == nil {
return nil
}
return this.h
}
func (this *QAccessibleObject) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
2024-11-19 19:29:06 +13:00
// newQAccessibleObject constructs the type using only CGO pointers.
2024-12-07 17:15:57 +13:00
func newQAccessibleObject(h *C.QAccessibleObject) *QAccessibleObject {
2024-10-20 18:21:03 +13:00
if h == nil {
return nil
}
2024-12-07 17:15:57 +13:00
var outptr_QAccessibleInterface *C.QAccessibleInterface = nil
C.QAccessibleObject_virtbase(h, &outptr_QAccessibleInterface)
2024-11-19 19:29:06 +13:00
return &QAccessibleObject{h: h,
2024-12-07 17:15:57 +13:00
QAccessibleInterface: newQAccessibleInterface(outptr_QAccessibleInterface)}
2024-10-20 18:21:03 +13:00
}
2024-11-19 19:29:06 +13:00
// UnsafeNewQAccessibleObject constructs the type using only unsafe pointers.
2024-12-07 17:15:57 +13:00
func UnsafeNewQAccessibleObject(h unsafe.Pointer) *QAccessibleObject {
return newQAccessibleObject((*C.QAccessibleObject)(h))
2024-10-20 18:21:03 +13:00
}
func (this *QAccessibleObject) IsValid() bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QAccessibleObject_isValid(this.h))
2024-10-20 18:21:03 +13:00
}
func (this *QAccessibleObject) Object() *QObject {
2025-02-01 13:45:16 +13:00
return newQObject(C.QAccessibleObject_object(this.h))
2024-10-20 18:21:03 +13:00
}
func (this *QAccessibleObject) Rect() *QRect {
2025-02-01 13:45:16 +13:00
_goptr := newQRect(C.QAccessibleObject_rect(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 *QAccessibleObject) SetText(t QAccessible__Text, text string) {
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))
2025-02-01 13:45:16 +13:00
C.QAccessibleObject_setText(this.h, (C.int)(t), text_ms)
2024-10-20 18:21:03 +13:00
}
func (this *QAccessibleObject) ChildAt(x int, y int) *QAccessibleInterface {
2025-02-01 13:45:16 +13:00
return newQAccessibleInterface(C.QAccessibleObject_childAt(this.h, (C.int)(x), (C.int)(y)))
2024-10-20 18:21:03 +13:00
}
type QAccessibleApplication struct {
h *C.QAccessibleApplication
2024-10-20 18:21:03 +13:00
*QAccessibleObject
}
func (this *QAccessibleApplication) cPointer() *C.QAccessibleApplication {
if this == nil {
return nil
}
return this.h
}
func (this *QAccessibleApplication) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
2024-11-19 19:29:06 +13:00
// newQAccessibleApplication constructs the type using only CGO pointers.
2024-12-07 17:15:57 +13:00
func newQAccessibleApplication(h *C.QAccessibleApplication) *QAccessibleApplication {
2024-10-20 18:21:03 +13:00
if h == nil {
return nil
}
2024-12-07 17:15:57 +13:00
var outptr_QAccessibleObject *C.QAccessibleObject = nil
C.QAccessibleApplication_virtbase(h, &outptr_QAccessibleObject)
2024-11-19 19:29:06 +13:00
return &QAccessibleApplication{h: h,
2024-12-07 17:15:57 +13:00
QAccessibleObject: newQAccessibleObject(outptr_QAccessibleObject)}
2024-10-20 18:21:03 +13:00
}
2024-11-19 19:29:06 +13:00
// UnsafeNewQAccessibleApplication constructs the type using only unsafe pointers.
2024-12-07 17:15:57 +13:00
func UnsafeNewQAccessibleApplication(h unsafe.Pointer) *QAccessibleApplication {
return newQAccessibleApplication((*C.QAccessibleApplication)(h))
2024-10-20 18:21:03 +13:00
}
// NewQAccessibleApplication constructs a new QAccessibleApplication object.
func NewQAccessibleApplication() *QAccessibleApplication {
2024-11-19 19:29:06 +13:00
return newQAccessibleApplication(C.QAccessibleApplication_new())
2024-10-20 18:21:03 +13:00
}
func (this *QAccessibleApplication) Window() *QWindow {
2025-02-01 13:45:16 +13:00
return newQWindow(C.QAccessibleApplication_window(this.h))
2024-10-20 18:21:03 +13:00
}
func (this *QAccessibleApplication) ChildCount() int {
2025-02-01 13:45:16 +13:00
return (int)(C.QAccessibleApplication_childCount(this.h))
2024-10-20 18:21:03 +13:00
}
func (this *QAccessibleApplication) IndexOfChild(param1 *QAccessibleInterface) int {
2025-02-01 13:45:16 +13:00
return (int)(C.QAccessibleApplication_indexOfChild(this.h, param1.cPointer()))
2024-10-20 18:21:03 +13:00
}
func (this *QAccessibleApplication) FocusChild() *QAccessibleInterface {
2025-02-01 13:45:16 +13:00
return newQAccessibleInterface(C.QAccessibleApplication_focusChild(this.h))
2024-10-20 18:21:03 +13:00
}
func (this *QAccessibleApplication) Parent() *QAccessibleInterface {
2025-02-01 13:45:16 +13:00
return newQAccessibleInterface(C.QAccessibleApplication_parent(this.h))
2024-10-20 18:21:03 +13:00
}
func (this *QAccessibleApplication) Child(index int) *QAccessibleInterface {
2025-02-01 13:45:16 +13:00
return newQAccessibleInterface(C.QAccessibleApplication_child(this.h, (C.int)(index)))
2024-10-20 18:21:03 +13:00
}
func (this *QAccessibleApplication) Text(t QAccessible__Text) string {
2025-02-01 13:45:16 +13:00
var _ms C.struct_miqt_string = C.QAccessibleApplication_text(this.h, (C.int)(t))
2024-10-20 18:21:03 +13:00
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func (this *QAccessibleApplication) Role() QAccessible__Role {
2025-02-01 13:45:16 +13:00
return (QAccessible__Role)(C.QAccessibleApplication_role(this.h))
2024-10-20 18:21:03 +13:00
}
func (this *QAccessibleApplication) State() *QAccessible__State {
2025-02-01 13:45:16 +13:00
_goptr := newQAccessible__State(C.QAccessibleApplication_state(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 *QAccessibleApplication) Delete() {
2025-02-01 13:45:16 +13:00
C.QAccessibleApplication_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 *QAccessibleApplication) GoGC() {
runtime.SetFinalizer(this, func(this *QAccessibleApplication) {
this.Delete()
runtime.KeepAlive(this.h)
})
}