miqt/qt-restricted-extras/qscintilla/gen_qscicommandset.go

97 lines
2.6 KiB
Go
Raw Normal View History

2024-10-20 04:59:23 +00:00
package qscintilla
/*
#include "gen_qscicommandset.h"
#include <stdlib.h>
*/
import "C"
import (
"github.com/mappu/miqt/qt"
"unsafe"
)
type QsciCommandSet struct {
2024-11-19 06:29:06 +00:00
h *C.QsciCommandSet
isSubclass bool
2024-10-20 04:59:23 +00:00
}
func (this *QsciCommandSet) cPointer() *C.QsciCommandSet {
if this == nil {
return nil
}
return this.h
}
func (this *QsciCommandSet) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
2024-11-19 06:29:06 +00:00
// newQsciCommandSet constructs the type using only CGO pointers.
2024-10-20 04:59:23 +00:00
func newQsciCommandSet(h *C.QsciCommandSet) *QsciCommandSet {
if h == nil {
return nil
}
return &QsciCommandSet{h: h}
}
2024-11-19 06:29:06 +00:00
// UnsafeNewQsciCommandSet constructs the type using only unsafe pointers.
2024-10-20 04:59:23 +00:00
func UnsafeNewQsciCommandSet(h unsafe.Pointer) *QsciCommandSet {
2024-11-19 06:29:06 +00:00
if h == nil {
return nil
}
return &QsciCommandSet{h: (*C.QsciCommandSet)(h)}
2024-10-20 04:59:23 +00:00
}
func (this *QsciCommandSet) ReadSettings(qs *qt.QSettings) bool {
return (bool)(C.QsciCommandSet_ReadSettings(this.h, (*C.QSettings)(qs.UnsafePointer())))
}
func (this *QsciCommandSet) WriteSettings(qs *qt.QSettings) bool {
return (bool)(C.QsciCommandSet_WriteSettings(this.h, (*C.QSettings)(qs.UnsafePointer())))
}
func (this *QsciCommandSet) Commands() []*QsciCommand {
var _ma C.struct_miqt_array = C.QsciCommandSet_Commands(this.h)
2024-10-20 04:59:23 +00:00
_ret := make([]*QsciCommand, int(_ma.len))
_outCast := (*[0xffff]*C.QsciCommand)(unsafe.Pointer(_ma.data)) // hey ya
for i := 0; i < int(_ma.len); i++ {
_ret[i] = UnsafeNewQsciCommand(unsafe.Pointer(_outCast[i]))
}
return _ret
}
func (this *QsciCommandSet) ClearKeys() {
C.QsciCommandSet_ClearKeys(this.h)
}
func (this *QsciCommandSet) ClearAlternateKeys() {
C.QsciCommandSet_ClearAlternateKeys(this.h)
}
func (this *QsciCommandSet) BoundTo(key int) *QsciCommand {
return UnsafeNewQsciCommand(unsafe.Pointer(C.QsciCommandSet_BoundTo(this.h, (C.int)(key))))
}
func (this *QsciCommandSet) Find(command QsciCommand__Command) *QsciCommand {
return UnsafeNewQsciCommand(unsafe.Pointer(C.QsciCommandSet_Find(this.h, (C.int)(command))))
}
func (this *QsciCommandSet) ReadSettings2(qs *qt.QSettings, prefix string) bool {
prefix_Cstring := C.CString(prefix)
defer C.free(unsafe.Pointer(prefix_Cstring))
return (bool)(C.QsciCommandSet_ReadSettings2(this.h, (*C.QSettings)(qs.UnsafePointer()), prefix_Cstring))
}
func (this *QsciCommandSet) WriteSettings2(qs *qt.QSettings, prefix string) bool {
prefix_Cstring := C.CString(prefix)
defer C.free(unsafe.Pointer(prefix_Cstring))
return (bool)(C.QsciCommandSet_WriteSettings2(this.h, (*C.QSettings)(qs.UnsafePointer()), prefix_Cstring))
}