This repository has been archived by the owner on Nov 20, 2023. It is now read-only.
/
text_container.go
217 lines (178 loc) · 6.95 KB
/
text_container.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
// auto-generated code, do not modify
package appkit
import (
"unsafe"
"github.com/hsiafan/cocoa/foundation"
"github.com/hsiafan/cocoa/objc"
)
var TextContainerClass = _TextContainerClass{objc.GetClass("NSTextContainer")}
type _TextContainerClass struct {
objc.Class
}
type ITextContainer interface {
objc.IObject
ReplaceLayoutManager(newLayoutManager ILayoutManager)
LineFragmentRectForProposedRect_AtIndex_WritingDirection_RemainingRect(proposedRect foundation.Rect, characterIndex uint, baseWritingDirection WritingDirection, remainingRect *foundation.Rect) foundation.Rect
// deprecated
LineFragmentRectForProposedRect_SweepDirection_MovementDirection_RemainingRect(proposedRect foundation.Rect, sweepDirection LineSweepDirection, movementDirection LineMovementDirection, remainingRect *foundation.Rect) foundation.Rect
// deprecated
ContainsPoint(point foundation.Point) bool
LayoutManager() LayoutManager
SetLayoutManager(value ILayoutManager)
TextLayoutManager() TextLayoutManager
TextView() TextView
SetTextView(value ITextView)
Size() foundation.Size
SetSize(value foundation.Size)
ExclusionPaths() []BezierPath
SetExclusionPaths(value []IBezierPath)
LineBreakMode() LineBreakMode
SetLineBreakMode(value LineBreakMode)
WidthTracksTextView() bool
SetWidthTracksTextView(value bool)
HeightTracksTextView() bool
SetHeightTracksTextView(value bool)
MaximumNumberOfLines() uint
SetMaximumNumberOfLines(value uint)
LineFragmentPadding() float64
SetLineFragmentPadding(value float64)
IsSimpleRectangularTextContainer() bool
// deprecated
ContainerSize() foundation.Size
// deprecated
SetContainerSize(value foundation.Size)
}
type TextContainer struct {
objc.Object
}
func MakeTextContainer(ptr unsafe.Pointer) TextContainer {
return TextContainer{
Object: objc.MakeObject(ptr),
}
}
func (t_ TextContainer) InitWithSize(size foundation.Size) TextContainer {
rv := objc.CallMethod[TextContainer](t_, objc.SEL("initWithSize:"), size)
return rv
}
func (t_ TextContainer) InitWithContainerSize(aContainerSize foundation.Size) TextContainer {
rv := objc.CallMethod[TextContainer](t_, objc.SEL("initWithContainerSize:"), aContainerSize)
return rv
}
func (tc _TextContainerClass) Alloc() TextContainer {
rv := objc.CallMethod[TextContainer](tc, objc.SEL("alloc"))
return rv
}
func (tc _TextContainerClass) New() TextContainer {
rv := objc.CallMethod[TextContainer](tc, objc.SEL("new"))
rv.Autorelease()
return rv
}
func NewTextContainer() TextContainer {
return TextContainerClass.New()
}
func (t_ TextContainer) Init() TextContainer {
rv := objc.CallMethod[TextContainer](t_, objc.SEL("init"))
return rv
}
func (t_ TextContainer) ReplaceLayoutManager(newLayoutManager ILayoutManager) {
objc.CallMethod[objc.Void](t_, objc.SEL("replaceLayoutManager:"), objc.ExtractPtr(newLayoutManager))
}
func (t_ TextContainer) LineFragmentRectForProposedRect_AtIndex_WritingDirection_RemainingRect(proposedRect foundation.Rect, characterIndex uint, baseWritingDirection WritingDirection, remainingRect *foundation.Rect) foundation.Rect {
rv := objc.CallMethod[foundation.Rect](t_, objc.SEL("lineFragmentRectForProposedRect:atIndex:writingDirection:remainingRect:"), proposedRect, characterIndex, baseWritingDirection, remainingRect)
return rv
}
// deprecated
func (t_ TextContainer) LineFragmentRectForProposedRect_SweepDirection_MovementDirection_RemainingRect(proposedRect foundation.Rect, sweepDirection LineSweepDirection, movementDirection LineMovementDirection, remainingRect *foundation.Rect) foundation.Rect {
rv := objc.CallMethod[foundation.Rect](t_, objc.SEL("lineFragmentRectForProposedRect:sweepDirection:movementDirection:remainingRect:"), proposedRect, sweepDirection, movementDirection, remainingRect)
return rv
}
// deprecated
func (t_ TextContainer) ContainsPoint(point foundation.Point) bool {
rv := objc.CallMethod[bool](t_, objc.SEL("containsPoint:"), point)
return rv
}
// weak property
func (t_ TextContainer) LayoutManager() LayoutManager {
rv := objc.CallMethod[LayoutManager](t_, objc.SEL("layoutManager"))
return rv
}
// weak property
func (t_ TextContainer) SetLayoutManager(value ILayoutManager) {
objc.CallMethod[objc.Void](t_, objc.SEL("setLayoutManager:"), objc.ExtractPtr(value))
}
// weak property
func (t_ TextContainer) TextLayoutManager() TextLayoutManager {
rv := objc.CallMethod[TextLayoutManager](t_, objc.SEL("textLayoutManager"))
return rv
}
// weak property
func (t_ TextContainer) TextView() TextView {
rv := objc.CallMethod[TextView](t_, objc.SEL("textView"))
return rv
}
// weak property
func (t_ TextContainer) SetTextView(value ITextView) {
objc.CallMethod[objc.Void](t_, objc.SEL("setTextView:"), objc.ExtractPtr(value))
}
func (t_ TextContainer) Size() foundation.Size {
rv := objc.CallMethod[foundation.Size](t_, objc.SEL("size"))
return rv
}
func (t_ TextContainer) SetSize(value foundation.Size) {
objc.CallMethod[objc.Void](t_, objc.SEL("setSize:"), value)
}
func (t_ TextContainer) ExclusionPaths() []BezierPath {
rv := objc.CallMethod[[]BezierPath](t_, objc.SEL("exclusionPaths"))
return rv
}
func (t_ TextContainer) SetExclusionPaths(value []IBezierPath) {
objc.CallMethod[objc.Void](t_, objc.SEL("setExclusionPaths:"), value)
}
func (t_ TextContainer) LineBreakMode() LineBreakMode {
rv := objc.CallMethod[LineBreakMode](t_, objc.SEL("lineBreakMode"))
return rv
}
func (t_ TextContainer) SetLineBreakMode(value LineBreakMode) {
objc.CallMethod[objc.Void](t_, objc.SEL("setLineBreakMode:"), value)
}
func (t_ TextContainer) WidthTracksTextView() bool {
rv := objc.CallMethod[bool](t_, objc.SEL("widthTracksTextView"))
return rv
}
func (t_ TextContainer) SetWidthTracksTextView(value bool) {
objc.CallMethod[objc.Void](t_, objc.SEL("setWidthTracksTextView:"), value)
}
func (t_ TextContainer) HeightTracksTextView() bool {
rv := objc.CallMethod[bool](t_, objc.SEL("heightTracksTextView"))
return rv
}
func (t_ TextContainer) SetHeightTracksTextView(value bool) {
objc.CallMethod[objc.Void](t_, objc.SEL("setHeightTracksTextView:"), value)
}
func (t_ TextContainer) MaximumNumberOfLines() uint {
rv := objc.CallMethod[uint](t_, objc.SEL("maximumNumberOfLines"))
return rv
}
func (t_ TextContainer) SetMaximumNumberOfLines(value uint) {
objc.CallMethod[objc.Void](t_, objc.SEL("setMaximumNumberOfLines:"), value)
}
func (t_ TextContainer) LineFragmentPadding() float64 {
rv := objc.CallMethod[float64](t_, objc.SEL("lineFragmentPadding"))
return rv
}
func (t_ TextContainer) SetLineFragmentPadding(value float64) {
objc.CallMethod[objc.Void](t_, objc.SEL("setLineFragmentPadding:"), value)
}
func (t_ TextContainer) IsSimpleRectangularTextContainer() bool {
rv := objc.CallMethod[bool](t_, objc.SEL("isSimpleRectangularTextContainer"))
return rv
}
// deprecated
func (t_ TextContainer) ContainerSize() foundation.Size {
rv := objc.CallMethod[foundation.Size](t_, objc.SEL("containerSize"))
return rv
}
// deprecated
func (t_ TextContainer) SetContainerSize(value foundation.Size) {
objc.CallMethod[objc.Void](t_, objc.SEL("setContainerSize:"), value)
}