cutego/gui/qtextlayout.go

238 lines
5.8 KiB
Go
Raw Normal View History

2015-10-24 18:18:24 +03:00
package gui
//#include "qtextlayout.h"
import "C"
import (
"github.com/therecipe/qt"
"github.com/therecipe/qt/core"
"unsafe"
)
type QTextLayout struct {
ptr unsafe.Pointer
}
2015-11-09 20:23:42 +03:00
type QTextLayout_ITF interface {
QTextLayout_PTR() *QTextLayout
2015-10-24 18:18:24 +03:00
}
func (p *QTextLayout) Pointer() unsafe.Pointer {
return p.ptr
}
func (p *QTextLayout) SetPointer(ptr unsafe.Pointer) {
p.ptr = ptr
}
2015-11-09 20:23:42 +03:00
func PointerFromQTextLayout(ptr QTextLayout_ITF) unsafe.Pointer {
2015-10-24 18:18:24 +03:00
if ptr != nil {
2015-11-09 20:23:42 +03:00
return ptr.QTextLayout_PTR().Pointer()
2015-10-24 18:18:24 +03:00
}
return nil
}
2015-11-09 20:23:42 +03:00
func NewQTextLayoutFromPointer(ptr unsafe.Pointer) *QTextLayout {
2015-10-24 18:18:24 +03:00
var n = new(QTextLayout)
n.SetPointer(ptr)
return n
}
2015-11-09 20:23:42 +03:00
func (ptr *QTextLayout) QTextLayout_PTR() *QTextLayout {
2015-10-24 18:18:24 +03:00
return ptr
}
//QTextLayout::CursorMode
2015-11-09 20:23:42 +03:00
type QTextLayout__CursorMode int64
2015-10-24 18:18:24 +03:00
2015-11-09 20:23:42 +03:00
const (
2015-10-24 18:18:24 +03:00
QTextLayout__SkipCharacters = QTextLayout__CursorMode(0)
QTextLayout__SkipWords = QTextLayout__CursorMode(1)
)
2015-11-09 20:23:42 +03:00
func (ptr *QTextLayout) DrawCursor2(painter QPainter_ITF, position core.QPointF_ITF, cursorPosition int) {
2015-10-24 18:18:24 +03:00
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QTextLayout_DrawCursor2(ptr.Pointer(), PointerFromQPainter(painter), core.PointerFromQPointF(position), C.int(cursorPosition))
2015-10-24 18:18:24 +03:00
}
}
2015-11-09 20:23:42 +03:00
func (ptr *QTextLayout) DrawCursor(painter QPainter_ITF, position core.QPointF_ITF, cursorPosition int, width int) {
2015-10-24 18:18:24 +03:00
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QTextLayout_DrawCursor(ptr.Pointer(), PointerFromQPainter(painter), core.PointerFromQPointF(position), C.int(cursorPosition), C.int(width))
2015-10-24 18:18:24 +03:00
}
}
func NewQTextLayout() *QTextLayout {
2015-11-09 20:23:42 +03:00
return NewQTextLayoutFromPointer(C.QTextLayout_NewQTextLayout())
2015-10-24 18:18:24 +03:00
}
func NewQTextLayout2(text string) *QTextLayout {
2015-11-09 20:23:42 +03:00
return NewQTextLayoutFromPointer(C.QTextLayout_NewQTextLayout2(C.CString(text)))
2015-10-24 18:18:24 +03:00
}
2015-11-09 20:23:42 +03:00
func NewQTextLayout3(text string, font QFont_ITF, paintdevice QPaintDevice_ITF) *QTextLayout {
return NewQTextLayoutFromPointer(C.QTextLayout_NewQTextLayout3(C.CString(text), PointerFromQFont(font), PointerFromQPaintDevice(paintdevice)))
2015-10-24 18:18:24 +03:00
}
func (ptr *QTextLayout) BeginLayout() {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QTextLayout_BeginLayout(ptr.Pointer())
2015-10-24 18:18:24 +03:00
}
}
func (ptr *QTextLayout) CacheEnabled() bool {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
return C.QTextLayout_CacheEnabled(ptr.Pointer()) != 0
2015-10-24 18:18:24 +03:00
}
return false
}
func (ptr *QTextLayout) ClearAdditionalFormats() {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QTextLayout_ClearAdditionalFormats(ptr.Pointer())
2015-10-24 18:18:24 +03:00
}
}
func (ptr *QTextLayout) ClearLayout() {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QTextLayout_ClearLayout(ptr.Pointer())
2015-10-24 18:18:24 +03:00
}
}
func (ptr *QTextLayout) CursorMoveStyle() core.Qt__CursorMoveStyle {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
return core.Qt__CursorMoveStyle(C.QTextLayout_CursorMoveStyle(ptr.Pointer()))
2015-10-24 18:18:24 +03:00
}
return 0
}
func (ptr *QTextLayout) EndLayout() {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QTextLayout_EndLayout(ptr.Pointer())
2015-10-24 18:18:24 +03:00
}
}
func (ptr *QTextLayout) IsValidCursorPosition(pos int) bool {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
return C.QTextLayout_IsValidCursorPosition(ptr.Pointer(), C.int(pos)) != 0
2015-10-24 18:18:24 +03:00
}
return false
}
func (ptr *QTextLayout) LeftCursorPosition(oldPos int) int {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
return int(C.QTextLayout_LeftCursorPosition(ptr.Pointer(), C.int(oldPos)))
2015-10-24 18:18:24 +03:00
}
return 0
}
func (ptr *QTextLayout) LineCount() int {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
return int(C.QTextLayout_LineCount(ptr.Pointer()))
}
return 0
}
func (ptr *QTextLayout) MaximumWidth() float64 {
if ptr.Pointer() != nil {
return float64(C.QTextLayout_MaximumWidth(ptr.Pointer()))
}
return 0
}
func (ptr *QTextLayout) MinimumWidth() float64 {
if ptr.Pointer() != nil {
return float64(C.QTextLayout_MinimumWidth(ptr.Pointer()))
2015-10-24 18:18:24 +03:00
}
return 0
}
func (ptr *QTextLayout) NextCursorPosition(oldPos int, mode QTextLayout__CursorMode) int {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
return int(C.QTextLayout_NextCursorPosition(ptr.Pointer(), C.int(oldPos), C.int(mode)))
2015-10-24 18:18:24 +03:00
}
return 0
}
func (ptr *QTextLayout) PreeditAreaPosition() int {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
return int(C.QTextLayout_PreeditAreaPosition(ptr.Pointer()))
2015-10-24 18:18:24 +03:00
}
return 0
}
func (ptr *QTextLayout) PreeditAreaText() string {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
return C.GoString(C.QTextLayout_PreeditAreaText(ptr.Pointer()))
2015-10-24 18:18:24 +03:00
}
return ""
}
func (ptr *QTextLayout) PreviousCursorPosition(oldPos int, mode QTextLayout__CursorMode) int {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
return int(C.QTextLayout_PreviousCursorPosition(ptr.Pointer(), C.int(oldPos), C.int(mode)))
2015-10-24 18:18:24 +03:00
}
return 0
}
func (ptr *QTextLayout) RightCursorPosition(oldPos int) int {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
return int(C.QTextLayout_RightCursorPosition(ptr.Pointer(), C.int(oldPos)))
2015-10-24 18:18:24 +03:00
}
return 0
}
func (ptr *QTextLayout) SetCacheEnabled(enable bool) {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QTextLayout_SetCacheEnabled(ptr.Pointer(), C.int(qt.GoBoolToInt(enable)))
2015-10-24 18:18:24 +03:00
}
}
func (ptr *QTextLayout) SetCursorMoveStyle(style core.Qt__CursorMoveStyle) {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QTextLayout_SetCursorMoveStyle(ptr.Pointer(), C.int(style))
2015-10-24 18:18:24 +03:00
}
}
2015-11-09 20:23:42 +03:00
func (ptr *QTextLayout) SetFont(font QFont_ITF) {
2015-10-24 18:18:24 +03:00
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QTextLayout_SetFont(ptr.Pointer(), PointerFromQFont(font))
2015-10-24 18:18:24 +03:00
}
}
2015-11-09 20:23:42 +03:00
func (ptr *QTextLayout) SetPosition(p core.QPointF_ITF) {
2015-10-24 18:18:24 +03:00
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QTextLayout_SetPosition(ptr.Pointer(), core.PointerFromQPointF(p))
2015-10-24 18:18:24 +03:00
}
}
func (ptr *QTextLayout) SetPreeditArea(position int, text string) {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QTextLayout_SetPreeditArea(ptr.Pointer(), C.int(position), C.CString(text))
2015-10-24 18:18:24 +03:00
}
}
func (ptr *QTextLayout) SetText(stri string) {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QTextLayout_SetText(ptr.Pointer(), C.CString(stri))
2015-10-24 18:18:24 +03:00
}
}
2015-11-09 20:23:42 +03:00
func (ptr *QTextLayout) SetTextOption(option QTextOption_ITF) {
2015-10-24 18:18:24 +03:00
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QTextLayout_SetTextOption(ptr.Pointer(), PointerFromQTextOption(option))
2015-10-24 18:18:24 +03:00
}
}
func (ptr *QTextLayout) Text() string {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
return C.GoString(C.QTextLayout_Text(ptr.Pointer()))
2015-10-24 18:18:24 +03:00
}
return ""
}
func (ptr *QTextLayout) DestroyQTextLayout() {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QTextLayout_DestroyQTextLayout(ptr.Pointer())
2015-10-24 18:18:24 +03:00
}
}