1// Package gtk was automatically generated by github.com/bnema/puregotk DO NOT EDIT
2package gtk
3
4import (
5 "structs"
6 "unsafe"
7
8 "github.com/ebitengine/purego"
9
10 "github.com/bnema/puregotk/pkg/core"
11 "github.com/bnema/puregotk/v4/gdk"
12 "github.com/bnema/puregotk/v4/glib"
13 "github.com/bnema/puregotk/v4/gobject"
14 "github.com/bnema/puregotk/v4/gobject/types"
15)
16
17// A notification callback used by [method@Gtk.TextBuffer.add_commit_notify].
18//
19// You may not modify the [class@Gtk.TextBuffer] from a
20// [callback@Gtk.TextBufferCommitNotify] callback and that is enforced
21// by the [class@Gtk.TextBuffer] API.
22//
23// [callback@Gtk.TextBufferCommitNotify] may be used to be notified about
24// changes to the underlying buffer right before-or-after the changes are
25// committed to the underlying B-Tree. This is useful if you want to observe
26// changes to the buffer without other signal handlers potentially modifying
27// state on the way to the default signal handler.
28//
29// When @flags is `GTK_TEXT_BUFFER_NOTIFY_BEFORE_INSERT`, `position` is set to
30// the offset in characters from the start of the buffer where the insertion
31// will occur. `length` is set to the number of characters to be inserted. You
32// may not yet retrieve the text until it has been inserted. You may access the
33// text from `GTK_TEXT_BUFFER_NOTIFY_AFTER_INSERT` using
34// [method@Gtk.TextBuffer.get_slice].
35//
36// When @flags is `GTK_TEXT_BUFFER_NOTIFY_AFTER_INSERT`, `position` is set to
37// offset in characters where the insertion occurred and `length` is set
38// to the number of characters inserted.
39//
40// When @flags is `GTK_TEXT_BUFFER_NOTIFY_BEFORE_DELETE`, `position` is set to
41// offset in characters where the deletion will occur and `length` is set
42// to the number of characters that will be removed. You may still retrieve
43// the text from this handler using `position` and `length`.
44//
45// When @flags is `GTK_TEXT_BUFFER_NOTIFY_AFTER_DELETE`, `length` is set to
46// zero to denote that the delete-range has already been committed to the
47// underlying B-Tree. You may no longer retrieve the text that has been
48// deleted from the [class@Gtk.TextBuffer].
49type TextBufferCommitNotify func(uintptr, TextBufferNotifyFlags, uint, uint, uintptr)
50
51// The class structure for `GtkTextBuffer`.
52type TextBufferClass struct {
53 _ structs.HostLayout
54
55 ParentClass gobject.ObjectClass
56
57 xInsertText uintptr
58
59 xInsertPaintable uintptr
60
61 xInsertChildAnchor uintptr
62
63 xDeleteRange uintptr
64
65 xChanged uintptr
66
67 xModifiedChanged uintptr
68
69 xMarkSet uintptr
70
71 xMarkDeleted uintptr
72
73 xApplyTag uintptr
74
75 xRemoveTag uintptr
76
77 xBeginUserAction uintptr
78
79 xEndUserAction uintptr
80
81 xPasteDone uintptr
82
83 xUndo uintptr
84
85 xRedo uintptr
86
87 xGtkReserved1 uintptr
88
89 xGtkReserved2 uintptr
90
91 xGtkReserved3 uintptr
92
93 xGtkReserved4 uintptr
94}
95
96func (x *TextBufferClass) GoPointer() uintptr {
97 return uintptr(unsafe.Pointer(x))
98}
99
100// OverrideInsertText sets the "insert_text" callback function.
101// The class handler for the `GtkTextBuffer::insert-text` signal.
102func (x *TextBufferClass) OverrideInsertText(cb func(*TextBuffer, *TextIter, string, int)) {
103 if cb == nil {
104 x.xInsertText = 0
105 } else {
106 x.xInsertText = purego.NewCallback(func(BufferVarp uintptr, PosVarp *TextIter, NewTextVarp string, NewTextLengthVarp int) {
107 cb(TextBufferNewFromInternalPtr(BufferVarp), PosVarp, NewTextVarp, NewTextLengthVarp)
108 })
109 }
110}
111
112// GetInsertText gets the "insert_text" callback function.
113// The class handler for the `GtkTextBuffer::insert-text` signal.
114func (x *TextBufferClass) GetInsertText() func(*TextBuffer, *TextIter, string, int) {
115 if x.xInsertText == 0 {
116 return nil
117 }
118 var rawCallback func(BufferVarp uintptr, PosVarp *TextIter, NewTextVarp string, NewTextLengthVarp int)
119 purego.RegisterFunc(&rawCallback, x.xInsertText)
120 return func(BufferVar *TextBuffer, PosVar *TextIter, NewTextVar string, NewTextLengthVar int) {
121 rawCallback(BufferVar.GoPointer(), PosVar, NewTextVar, NewTextLengthVar)
122 }
123}
124
125// OverrideInsertPaintable sets the "insert_paintable" callback function.
126// The class handler for the `GtkTextBuffer::insert-paintable` signal.
127func (x *TextBufferClass) OverrideInsertPaintable(cb func(*TextBuffer, *TextIter, gdk.Paintable)) {
128 if cb == nil {
129 x.xInsertPaintable = 0
130 } else {
131 x.xInsertPaintable = purego.NewCallback(func(BufferVarp uintptr, IterVarp *TextIter, PaintableVarp uintptr) {
132 cb(TextBufferNewFromInternalPtr(BufferVarp), IterVarp, &gdk.PaintableBase{Ptr: PaintableVarp})
133 })
134 }
135}
136
137// GetInsertPaintable gets the "insert_paintable" callback function.
138// The class handler for the `GtkTextBuffer::insert-paintable` signal.
139func (x *TextBufferClass) GetInsertPaintable() func(*TextBuffer, *TextIter, gdk.Paintable) {
140 if x.xInsertPaintable == 0 {
141 return nil
142 }
143 var rawCallback func(BufferVarp uintptr, IterVarp *TextIter, PaintableVarp uintptr)
144 purego.RegisterFunc(&rawCallback, x.xInsertPaintable)
145 return func(BufferVar *TextBuffer, IterVar *TextIter, PaintableVar gdk.Paintable) {
146 rawCallback(BufferVar.GoPointer(), IterVar, PaintableVar.GoPointer())
147 }
148}
149
150// OverrideInsertChildAnchor sets the "insert_child_anchor" callback function.
151// The class handler for the `GtkTextBuffer::insert-child-anchor` signal.
152func (x *TextBufferClass) OverrideInsertChildAnchor(cb func(*TextBuffer, *TextIter, *TextChildAnchor)) {
153 if cb == nil {
154 x.xInsertChildAnchor = 0
155 } else {
156 x.xInsertChildAnchor = purego.NewCallback(func(BufferVarp uintptr, IterVarp *TextIter, AnchorVarp uintptr) {
157 cb(TextBufferNewFromInternalPtr(BufferVarp), IterVarp, TextChildAnchorNewFromInternalPtr(AnchorVarp))
158 })
159 }
160}
161
162// GetInsertChildAnchor gets the "insert_child_anchor" callback function.
163// The class handler for the `GtkTextBuffer::insert-child-anchor` signal.
164func (x *TextBufferClass) GetInsertChildAnchor() func(*TextBuffer, *TextIter, *TextChildAnchor) {
165 if x.xInsertChildAnchor == 0 {
166 return nil
167 }
168 var rawCallback func(BufferVarp uintptr, IterVarp *TextIter, AnchorVarp uintptr)
169 purego.RegisterFunc(&rawCallback, x.xInsertChildAnchor)
170 return func(BufferVar *TextBuffer, IterVar *TextIter, AnchorVar *TextChildAnchor) {
171 rawCallback(BufferVar.GoPointer(), IterVar, AnchorVar.GoPointer())
172 }
173}
174
175// OverrideDeleteRange sets the "delete_range" callback function.
176// The class handler for the `GtkTextBuffer::delete-range` signal.
177func (x *TextBufferClass) OverrideDeleteRange(cb func(*TextBuffer, *TextIter, *TextIter)) {
178 if cb == nil {
179 x.xDeleteRange = 0
180 } else {
181 x.xDeleteRange = purego.NewCallback(func(BufferVarp uintptr, StartVarp *TextIter, EndVarp *TextIter) {
182 cb(TextBufferNewFromInternalPtr(BufferVarp), StartVarp, EndVarp)
183 })
184 }
185}
186
187// GetDeleteRange gets the "delete_range" callback function.
188// The class handler for the `GtkTextBuffer::delete-range` signal.
189func (x *TextBufferClass) GetDeleteRange() func(*TextBuffer, *TextIter, *TextIter) {
190 if x.xDeleteRange == 0 {
191 return nil
192 }
193 var rawCallback func(BufferVarp uintptr, StartVarp *TextIter, EndVarp *TextIter)
194 purego.RegisterFunc(&rawCallback, x.xDeleteRange)
195 return func(BufferVar *TextBuffer, StartVar *TextIter, EndVar *TextIter) {
196 rawCallback(BufferVar.GoPointer(), StartVar, EndVar)
197 }
198}
199
200// OverrideChanged sets the "changed" callback function.
201// The class handler for the `GtkTextBuffer::changed` signal.
202func (x *TextBufferClass) OverrideChanged(cb func(*TextBuffer)) {
203 if cb == nil {
204 x.xChanged = 0
205 } else {
206 x.xChanged = purego.NewCallback(func(BufferVarp uintptr) {
207 cb(TextBufferNewFromInternalPtr(BufferVarp))
208 })
209 }
210}
211
212// GetChanged gets the "changed" callback function.
213// The class handler for the `GtkTextBuffer::changed` signal.
214func (x *TextBufferClass) GetChanged() func(*TextBuffer) {
215 if x.xChanged == 0 {
216 return nil
217 }
218 var rawCallback func(BufferVarp uintptr)
219 purego.RegisterFunc(&rawCallback, x.xChanged)
220 return func(BufferVar *TextBuffer) {
221 rawCallback(BufferVar.GoPointer())
222 }
223}
224
225// OverrideModifiedChanged sets the "modified_changed" callback function.
226// The class handler for the `GtkTextBuffer::modified-changed` signal.
227func (x *TextBufferClass) OverrideModifiedChanged(cb func(*TextBuffer)) {
228 if cb == nil {
229 x.xModifiedChanged = 0
230 } else {
231 x.xModifiedChanged = purego.NewCallback(func(BufferVarp uintptr) {
232 cb(TextBufferNewFromInternalPtr(BufferVarp))
233 })
234 }
235}
236
237// GetModifiedChanged gets the "modified_changed" callback function.
238// The class handler for the `GtkTextBuffer::modified-changed` signal.
239func (x *TextBufferClass) GetModifiedChanged() func(*TextBuffer) {
240 if x.xModifiedChanged == 0 {
241 return nil
242 }
243 var rawCallback func(BufferVarp uintptr)
244 purego.RegisterFunc(&rawCallback, x.xModifiedChanged)
245 return func(BufferVar *TextBuffer) {
246 rawCallback(BufferVar.GoPointer())
247 }
248}
249
250// OverrideMarkSet sets the "mark_set" callback function.
251// The class handler for the `GtkTextBuffer::mark-set` signal.
252func (x *TextBufferClass) OverrideMarkSet(cb func(*TextBuffer, *TextIter, *TextMark)) {
253 if cb == nil {
254 x.xMarkSet = 0
255 } else {
256 x.xMarkSet = purego.NewCallback(func(BufferVarp uintptr, LocationVarp *TextIter, MarkVarp uintptr) {
257 cb(TextBufferNewFromInternalPtr(BufferVarp), LocationVarp, TextMarkNewFromInternalPtr(MarkVarp))
258 })
259 }
260}
261
262// GetMarkSet gets the "mark_set" callback function.
263// The class handler for the `GtkTextBuffer::mark-set` signal.
264func (x *TextBufferClass) GetMarkSet() func(*TextBuffer, *TextIter, *TextMark) {
265 if x.xMarkSet == 0 {
266 return nil
267 }
268 var rawCallback func(BufferVarp uintptr, LocationVarp *TextIter, MarkVarp uintptr)
269 purego.RegisterFunc(&rawCallback, x.xMarkSet)
270 return func(BufferVar *TextBuffer, LocationVar *TextIter, MarkVar *TextMark) {
271 rawCallback(BufferVar.GoPointer(), LocationVar, MarkVar.GoPointer())
272 }
273}
274
275// OverrideMarkDeleted sets the "mark_deleted" callback function.
276// The class handler for the `GtkTextBuffer::mark-deleted` signal.
277func (x *TextBufferClass) OverrideMarkDeleted(cb func(*TextBuffer, *TextMark)) {
278 if cb == nil {
279 x.xMarkDeleted = 0
280 } else {
281 x.xMarkDeleted = purego.NewCallback(func(BufferVarp uintptr, MarkVarp uintptr) {
282 cb(TextBufferNewFromInternalPtr(BufferVarp), TextMarkNewFromInternalPtr(MarkVarp))
283 })
284 }
285}
286
287// GetMarkDeleted gets the "mark_deleted" callback function.
288// The class handler for the `GtkTextBuffer::mark-deleted` signal.
289func (x *TextBufferClass) GetMarkDeleted() func(*TextBuffer, *TextMark) {
290 if x.xMarkDeleted == 0 {
291 return nil
292 }
293 var rawCallback func(BufferVarp uintptr, MarkVarp uintptr)
294 purego.RegisterFunc(&rawCallback, x.xMarkDeleted)
295 return func(BufferVar *TextBuffer, MarkVar *TextMark) {
296 rawCallback(BufferVar.GoPointer(), MarkVar.GoPointer())
297 }
298}
299
300// OverrideApplyTag sets the "apply_tag" callback function.
301// The class handler for the `GtkTextBuffer::apply-tag` signal.
302func (x *TextBufferClass) OverrideApplyTag(cb func(*TextBuffer, *TextTag, *TextIter, *TextIter)) {
303 if cb == nil {
304 x.xApplyTag = 0
305 } else {
306 x.xApplyTag = purego.NewCallback(func(BufferVarp uintptr, TagVarp uintptr, StartVarp *TextIter, EndVarp *TextIter) {
307 cb(TextBufferNewFromInternalPtr(BufferVarp), TextTagNewFromInternalPtr(TagVarp), StartVarp, EndVarp)
308 })
309 }
310}
311
312// GetApplyTag gets the "apply_tag" callback function.
313// The class handler for the `GtkTextBuffer::apply-tag` signal.
314func (x *TextBufferClass) GetApplyTag() func(*TextBuffer, *TextTag, *TextIter, *TextIter) {
315 if x.xApplyTag == 0 {
316 return nil
317 }
318 var rawCallback func(BufferVarp uintptr, TagVarp uintptr, StartVarp *TextIter, EndVarp *TextIter)
319 purego.RegisterFunc(&rawCallback, x.xApplyTag)
320 return func(BufferVar *TextBuffer, TagVar *TextTag, StartVar *TextIter, EndVar *TextIter) {
321 rawCallback(BufferVar.GoPointer(), TagVar.GoPointer(), StartVar, EndVar)
322 }
323}
324
325// OverrideRemoveTag sets the "remove_tag" callback function.
326// The class handler for the `GtkTextBuffer::remove-tag` signal.
327func (x *TextBufferClass) OverrideRemoveTag(cb func(*TextBuffer, *TextTag, *TextIter, *TextIter)) {
328 if cb == nil {
329 x.xRemoveTag = 0
330 } else {
331 x.xRemoveTag = purego.NewCallback(func(BufferVarp uintptr, TagVarp uintptr, StartVarp *TextIter, EndVarp *TextIter) {
332 cb(TextBufferNewFromInternalPtr(BufferVarp), TextTagNewFromInternalPtr(TagVarp), StartVarp, EndVarp)
333 })
334 }
335}
336
337// GetRemoveTag gets the "remove_tag" callback function.
338// The class handler for the `GtkTextBuffer::remove-tag` signal.
339func (x *TextBufferClass) GetRemoveTag() func(*TextBuffer, *TextTag, *TextIter, *TextIter) {
340 if x.xRemoveTag == 0 {
341 return nil
342 }
343 var rawCallback func(BufferVarp uintptr, TagVarp uintptr, StartVarp *TextIter, EndVarp *TextIter)
344 purego.RegisterFunc(&rawCallback, x.xRemoveTag)
345 return func(BufferVar *TextBuffer, TagVar *TextTag, StartVar *TextIter, EndVar *TextIter) {
346 rawCallback(BufferVar.GoPointer(), TagVar.GoPointer(), StartVar, EndVar)
347 }
348}
349
350// OverrideBeginUserAction sets the "begin_user_action" callback function.
351// The class handler for the `GtkTextBuffer::begin-user-action` signal.
352func (x *TextBufferClass) OverrideBeginUserAction(cb func(*TextBuffer)) {
353 if cb == nil {
354 x.xBeginUserAction = 0
355 } else {
356 x.xBeginUserAction = purego.NewCallback(func(BufferVarp uintptr) {
357 cb(TextBufferNewFromInternalPtr(BufferVarp))
358 })
359 }
360}
361
362// GetBeginUserAction gets the "begin_user_action" callback function.
363// The class handler for the `GtkTextBuffer::begin-user-action` signal.
364func (x *TextBufferClass) GetBeginUserAction() func(*TextBuffer) {
365 if x.xBeginUserAction == 0 {
366 return nil
367 }
368 var rawCallback func(BufferVarp uintptr)
369 purego.RegisterFunc(&rawCallback, x.xBeginUserAction)
370 return func(BufferVar *TextBuffer) {
371 rawCallback(BufferVar.GoPointer())
372 }
373}
374
375// OverrideEndUserAction sets the "end_user_action" callback function.
376// The class handler for the `GtkTextBuffer::end-user-action` signal.
377func (x *TextBufferClass) OverrideEndUserAction(cb func(*TextBuffer)) {
378 if cb == nil {
379 x.xEndUserAction = 0
380 } else {
381 x.xEndUserAction = purego.NewCallback(func(BufferVarp uintptr) {
382 cb(TextBufferNewFromInternalPtr(BufferVarp))
383 })
384 }
385}
386
387// GetEndUserAction gets the "end_user_action" callback function.
388// The class handler for the `GtkTextBuffer::end-user-action` signal.
389func (x *TextBufferClass) GetEndUserAction() func(*TextBuffer) {
390 if x.xEndUserAction == 0 {
391 return nil
392 }
393 var rawCallback func(BufferVarp uintptr)
394 purego.RegisterFunc(&rawCallback, x.xEndUserAction)
395 return func(BufferVar *TextBuffer) {
396 rawCallback(BufferVar.GoPointer())
397 }
398}
399
400// OverridePasteDone sets the "paste_done" callback function.
401// The class handler for the `GtkTextBuffer::paste-done` signal.
402func (x *TextBufferClass) OverridePasteDone(cb func(*TextBuffer, *gdk.Clipboard)) {
403 if cb == nil {
404 x.xPasteDone = 0
405 } else {
406 x.xPasteDone = purego.NewCallback(func(BufferVarp uintptr, ClipboardVarp uintptr) {
407 cb(TextBufferNewFromInternalPtr(BufferVarp), gdk.ClipboardNewFromInternalPtr(ClipboardVarp))
408 })
409 }
410}
411
412// GetPasteDone gets the "paste_done" callback function.
413// The class handler for the `GtkTextBuffer::paste-done` signal.
414func (x *TextBufferClass) GetPasteDone() func(*TextBuffer, *gdk.Clipboard) {
415 if x.xPasteDone == 0 {
416 return nil
417 }
418 var rawCallback func(BufferVarp uintptr, ClipboardVarp uintptr)
419 purego.RegisterFunc(&rawCallback, x.xPasteDone)
420 return func(BufferVar *TextBuffer, ClipboardVar *gdk.Clipboard) {
421 rawCallback(BufferVar.GoPointer(), ClipboardVar.GoPointer())
422 }
423}
424
425// OverrideUndo sets the "undo" callback function.
426// The class handler for the `GtkTextBuffer::undo` signal
427func (x *TextBufferClass) OverrideUndo(cb func(*TextBuffer)) {
428 if cb == nil {
429 x.xUndo = 0
430 } else {
431 x.xUndo = purego.NewCallback(func(BufferVarp uintptr) {
432 cb(TextBufferNewFromInternalPtr(BufferVarp))
433 })
434 }
435}
436
437// GetUndo gets the "undo" callback function.
438// The class handler for the `GtkTextBuffer::undo` signal
439func (x *TextBufferClass) GetUndo() func(*TextBuffer) {
440 if x.xUndo == 0 {
441 return nil
442 }
443 var rawCallback func(BufferVarp uintptr)
444 purego.RegisterFunc(&rawCallback, x.xUndo)
445 return func(BufferVar *TextBuffer) {
446 rawCallback(BufferVar.GoPointer())
447 }
448}
449
450// OverrideRedo sets the "redo" callback function.
451// The class handler for the `GtkTextBuffer::redo` signal
452func (x *TextBufferClass) OverrideRedo(cb func(*TextBuffer)) {
453 if cb == nil {
454 x.xRedo = 0
455 } else {
456 x.xRedo = purego.NewCallback(func(BufferVarp uintptr) {
457 cb(TextBufferNewFromInternalPtr(BufferVarp))
458 })
459 }
460}
461
462// GetRedo gets the "redo" callback function.
463// The class handler for the `GtkTextBuffer::redo` signal
464func (x *TextBufferClass) GetRedo() func(*TextBuffer) {
465 if x.xRedo == 0 {
466 return nil
467 }
468 var rawCallback func(BufferVarp uintptr)
469 purego.RegisterFunc(&rawCallback, x.xRedo)
470 return func(BufferVar *TextBuffer) {
471 rawCallback(BufferVar.GoPointer())
472 }
473}
474
475// OverrideGtkReserved1 sets the "_gtk_reserved1" callback function.
476func (x *TextBufferClass) OverrideGtkReserved1(cb func()) {
477 if cb == nil {
478 x.xGtkReserved1 = 0
479 } else {
480 x.xGtkReserved1 = purego.NewCallback(func() {
481 cb()
482 })
483 }
484}
485
486// GetGtkReserved1 gets the "_gtk_reserved1" callback function.
487func (x *TextBufferClass) GetGtkReserved1() func() {
488 if x.xGtkReserved1 == 0 {
489 return nil
490 }
491 var rawCallback func()
492 purego.RegisterFunc(&rawCallback, x.xGtkReserved1)
493 return func() {
494 rawCallback()
495 }
496}
497
498// OverrideGtkReserved2 sets the "_gtk_reserved2" callback function.
499func (x *TextBufferClass) OverrideGtkReserved2(cb func()) {
500 if cb == nil {
501 x.xGtkReserved2 = 0
502 } else {
503 x.xGtkReserved2 = purego.NewCallback(func() {
504 cb()
505 })
506 }
507}
508
509// GetGtkReserved2 gets the "_gtk_reserved2" callback function.
510func (x *TextBufferClass) GetGtkReserved2() func() {
511 if x.xGtkReserved2 == 0 {
512 return nil
513 }
514 var rawCallback func()
515 purego.RegisterFunc(&rawCallback, x.xGtkReserved2)
516 return func() {
517 rawCallback()
518 }
519}
520
521// OverrideGtkReserved3 sets the "_gtk_reserved3" callback function.
522func (x *TextBufferClass) OverrideGtkReserved3(cb func()) {
523 if cb == nil {
524 x.xGtkReserved3 = 0
525 } else {
526 x.xGtkReserved3 = purego.NewCallback(func() {
527 cb()
528 })
529 }
530}
531
532// GetGtkReserved3 gets the "_gtk_reserved3" callback function.
533func (x *TextBufferClass) GetGtkReserved3() func() {
534 if x.xGtkReserved3 == 0 {
535 return nil
536 }
537 var rawCallback func()
538 purego.RegisterFunc(&rawCallback, x.xGtkReserved3)
539 return func() {
540 rawCallback()
541 }
542}
543
544// OverrideGtkReserved4 sets the "_gtk_reserved4" callback function.
545func (x *TextBufferClass) OverrideGtkReserved4(cb func()) {
546 if cb == nil {
547 x.xGtkReserved4 = 0
548 } else {
549 x.xGtkReserved4 = purego.NewCallback(func() {
550 cb()
551 })
552 }
553}
554
555// GetGtkReserved4 gets the "_gtk_reserved4" callback function.
556func (x *TextBufferClass) GetGtkReserved4() func() {
557 if x.xGtkReserved4 == 0 {
558 return nil
559 }
560 var rawCallback func()
561 purego.RegisterFunc(&rawCallback, x.xGtkReserved4)
562 return func() {
563 rawCallback()
564 }
565}
566
567type TextBufferPrivate struct {
568 _ structs.HostLayout
569}
570
571func (x *TextBufferPrivate) GoPointer() uintptr {
572 return uintptr(unsafe.Pointer(x))
573}
574
575// Stores text and attributes for display in a `GtkTextView`.
576//
577// You may wish to begin by reading the
578// [text widget conceptual overview](section-text-widget.html),
579// which gives an overview of all the objects and data types
580// related to the text widget and how they work together.
581//
582// GtkTextBuffer can support undoing changes to the buffer
583// content, see [method@Gtk.TextBuffer.set_enable_undo].
584type TextBuffer struct {
585 gobject.Object
586}
587
588var xTextBufferGLibType func() types.GType
589
590func TextBufferGLibType() types.GType {
591 return xTextBufferGLibType()
592}
593
594func TextBufferNewFromInternalPtr(ptr uintptr) *TextBuffer {
595 cls := &TextBuffer{}
596 cls.Ptr = ptr
597 return cls
598}
599
600var xNewTextBuffer func(uintptr) uintptr
601
602// Creates a new text buffer.
603func NewTextBuffer(TableVar *TextTagTable) *TextBuffer {
604 var cls *TextBuffer
605
606 cret := xNewTextBuffer(TableVar.GoPointer())
607
608 if cret == 0 {
609 return nil
610 }
611 cls = &TextBuffer{}
612 cls.Ptr = cret
613 return cls
614}
615
616var xTextBufferAddCommitNotify func(uintptr, TextBufferNotifyFlags, uintptr, uintptr, uintptr) uint
617
618// Adds a [callback@Gtk.TextBufferCommitNotify] to be called when a change
619// is to be made to the [type@Gtk.TextBuffer].
620//
621// Functions are explicitly forbidden from making changes to the
622// [type@Gtk.TextBuffer] from this callback. It is intended for tracking
623// changes to the buffer only.
624//
625// It may be advantageous to use [callback@Gtk.TextBufferCommitNotify] over
626// connecting to the [signal@Gtk.TextBuffer::insert-text] or
627// [signal@Gtk.TextBuffer::delete-range] signals to avoid ordering issues with
628// other signal handlers which may further modify the [type@Gtk.TextBuffer].
629func (x *TextBuffer) AddCommitNotify(FlagsVar TextBufferNotifyFlags, CommitNotifyVar *TextBufferCommitNotify, UserDataVar uintptr, DestroyVar *glib.DestroyNotify) uint {
630
631 var CommitNotifyVarRef uintptr
632 if CommitNotifyVar != nil {
633 CommitNotifyVarPtr := uintptr(unsafe.Pointer(CommitNotifyVar))
634 if cbRefPtr, ok := glib.GetCallback(CommitNotifyVarPtr); ok {
635 CommitNotifyVarRef = cbRefPtr
636 } else {
637 fcb := func(arg0 uintptr, arg1 TextBufferNotifyFlags, arg2 uint, arg3 uint, arg4 uintptr) {
638 cbFn := *CommitNotifyVar
639 cbFn(arg0, arg1, arg2, arg3, arg4)
640 }
641 CommitNotifyVarRef = purego.NewCallback(fcb)
642 glib.SaveCallbackWithClosure(CommitNotifyVarPtr, CommitNotifyVarRef, CommitNotifyVar)
643 }
644 }
645
646 var DestroyVarRef uintptr
647 if DestroyVar != nil {
648 DestroyVarPtr := uintptr(unsafe.Pointer(DestroyVar))
649 if cbRefPtr, ok := glib.GetCallback(DestroyVarPtr); ok {
650 DestroyVarRef = cbRefPtr
651 } else {
652 fcb := func(arg0 uintptr) {
653 cbFn := *DestroyVar
654 cbFn(arg0)
655 }
656 DestroyVarRef = purego.NewCallback(fcb)
657 glib.SaveCallbackWithClosure(DestroyVarPtr, DestroyVarRef, DestroyVar)
658 }
659 }
660
661 cret := xTextBufferAddCommitNotify(x.GoPointer(), FlagsVar, CommitNotifyVarRef, UserDataVar, DestroyVarRef)
662 return cret
663}
664
665var xTextBufferAddMark func(uintptr, uintptr, *TextIter)
666
667// Adds the mark at position @where.
668//
669// The mark must not be added to another buffer, and if its name
670// is not %NULL then there must not be another mark in the buffer
671// with the same name.
672//
673// Emits the [signal@Gtk.TextBuffer::mark-set] signal as notification
674// of the mark's initial placement.
675func (x *TextBuffer) AddMark(MarkVar *TextMark, WhereVar *TextIter) {
676
677 xTextBufferAddMark(x.GoPointer(), MarkVar.GoPointer(), WhereVar)
678
679}
680
681var xTextBufferAddSelectionClipboard func(uintptr, uintptr)
682
683// Adds @clipboard to the list of clipboards in which the selection
684// contents of @buffer are available.
685//
686// In most cases, @clipboard will be the `GdkClipboard` returned by
687// [method@Gtk.Widget.get_primary_clipboard] for a view of @buffer.
688func (x *TextBuffer) AddSelectionClipboard(ClipboardVar *gdk.Clipboard) {
689
690 xTextBufferAddSelectionClipboard(x.GoPointer(), ClipboardVar.GoPointer())
691
692}
693
694var xTextBufferApplyTag func(uintptr, uintptr, *TextIter, *TextIter)
695
696// Emits the “apply-tag” signal on @buffer.
697//
698// The default handler for the signal applies
699// @tag to the given range. @start and @end do
700// not have to be in order.
701func (x *TextBuffer) ApplyTag(TagVar *TextTag, StartVar *TextIter, EndVar *TextIter) {
702
703 xTextBufferApplyTag(x.GoPointer(), TagVar.GoPointer(), StartVar, EndVar)
704
705}
706
707var xTextBufferApplyTagByName func(uintptr, string, *TextIter, *TextIter)
708
709// Emits the “apply-tag” signal on @buffer.
710//
711// Calls [method@Gtk.TextTagTable.lookup] on the buffer’s
712// tag table to get a `GtkTextTag`, then calls
713// [method@Gtk.TextBuffer.apply_tag].
714func (x *TextBuffer) ApplyTagByName(NameVar string, StartVar *TextIter, EndVar *TextIter) {
715
716 xTextBufferApplyTagByName(x.GoPointer(), NameVar, StartVar, EndVar)
717
718}
719
720var xTextBufferBackspace func(uintptr, *TextIter, bool, bool) bool
721
722// Performs the appropriate action as if the user hit the delete
723// key with the cursor at the position specified by @iter.
724//
725// In the normal case a single character will be deleted, but when
726// combining accents are involved, more than one character can
727// be deleted, and when precomposed character and accent combinations
728// are involved, less than one character will be deleted.
729//
730// Because the buffer is modified, all outstanding iterators become
731// invalid after calling this function; however, the @iter will be
732// re-initialized to point to the location where text was deleted.
733func (x *TextBuffer) Backspace(IterVar *TextIter, InteractiveVar bool, DefaultEditableVar bool) bool {
734
735 cret := xTextBufferBackspace(x.GoPointer(), IterVar, InteractiveVar, DefaultEditableVar)
736 return cret
737}
738
739var xTextBufferBeginIrreversibleAction func(uintptr)
740
741// Denotes the beginning of an action that may not be undone.
742//
743// This will cause any previous operations in the undo/redo queue
744// to be cleared.
745//
746// This should be paired with a call to
747// [method@Gtk.TextBuffer.end_irreversible_action] after the irreversible
748// action has completed.
749//
750// You may nest calls to gtk_text_buffer_begin_irreversible_action()
751// and gtk_text_buffer_end_irreversible_action() pairs.
752func (x *TextBuffer) BeginIrreversibleAction() {
753
754 xTextBufferBeginIrreversibleAction(x.GoPointer())
755
756}
757
758var xTextBufferBeginUserAction func(uintptr)
759
760// Called to indicate that the buffer operations between here and a
761// call to gtk_text_buffer_end_user_action() are part of a single
762// user-visible operation.
763//
764// The operations between gtk_text_buffer_begin_user_action() and
765// gtk_text_buffer_end_user_action() can then be grouped when creating
766// an undo stack. `GtkTextBuffer` maintains a count of calls to
767// gtk_text_buffer_begin_user_action() that have not been closed with
768// a call to gtk_text_buffer_end_user_action(), and emits the
769// “begin-user-action” and “end-user-action” signals only for the
770// outermost pair of calls. This allows you to build user actions
771// from other user actions.
772//
773// The “interactive” buffer mutation functions, such as
774// [method@Gtk.TextBuffer.insert_interactive], automatically call
775// begin/end user action around the buffer operations they perform,
776// so there's no need to add extra calls if you user action consists
777// solely of a single call to one of those functions.
778func (x *TextBuffer) BeginUserAction() {
779
780 xTextBufferBeginUserAction(x.GoPointer())
781
782}
783
784var xTextBufferCopyClipboard func(uintptr, uintptr)
785
786// Copies the currently-selected text to a clipboard.
787func (x *TextBuffer) CopyClipboard(ClipboardVar *gdk.Clipboard) {
788
789 xTextBufferCopyClipboard(x.GoPointer(), ClipboardVar.GoPointer())
790
791}
792
793var xTextBufferCreateChildAnchor func(uintptr, *TextIter) uintptr
794
795// Creates and inserts a child anchor.
796//
797// This is a convenience function which simply creates a child anchor
798// with [ctor@Gtk.TextChildAnchor.new] and inserts it into the buffer
799// with [method@Gtk.TextBuffer.insert_child_anchor].
800//
801// The new anchor is owned by the buffer; no reference count is
802// returned to the caller of this function.
803func (x *TextBuffer) CreateChildAnchor(IterVar *TextIter) *TextChildAnchor {
804 var cls *TextChildAnchor
805
806 cret := xTextBufferCreateChildAnchor(x.GoPointer(), IterVar)
807
808 if cret == 0 {
809 return nil
810 }
811 gobject.IncreaseRef(cret)
812 cls = &TextChildAnchor{}
813 cls.Ptr = cret
814 return cls
815}
816
817var xTextBufferCreateMark func(uintptr, uintptr, *TextIter, bool) uintptr
818
819// Creates a mark at position @where.
820//
821// If @mark_name is %NULL, the mark is anonymous; otherwise, the mark
822// can be retrieved by name using [method@Gtk.TextBuffer.get_mark].
823// If a mark has left gravity, and text is inserted at the mark’s
824// current location, the mark will be moved to the left of the
825// newly-inserted text. If the mark has right gravity
826// (@left_gravity = %FALSE), the mark will end up on the right of
827// newly-inserted text. The standard left-to-right cursor is a mark
828// with right gravity (when you type, the cursor stays on the right
829// side of the text you’re typing).
830//
831// The caller of this function does not own a
832// reference to the returned `GtkTextMark`, so you can ignore the
833// return value if you like. Marks are owned by the buffer and go
834// away when the buffer does.
835//
836// Emits the [signal@Gtk.TextBuffer::mark-set] signal as notification
837// of the mark's initial placement.
838func (x *TextBuffer) CreateMark(MarkNameVar *string, WhereVar *TextIter, LeftGravityVar bool) *TextMark {
839 var cls *TextMark
840
841 MarkNameVarPtr := core.GStrdupNullable(MarkNameVar)
842 defer core.GFreeNullable(MarkNameVarPtr)
843
844 cret := xTextBufferCreateMark(x.GoPointer(), MarkNameVarPtr, WhereVar, LeftGravityVar)
845
846 if cret == 0 {
847 return nil
848 }
849 gobject.IncreaseRef(cret)
850 cls = &TextMark{}
851 cls.Ptr = cret
852 return cls
853}
854
855var xTextBufferCreateTag func(uintptr, uintptr, uintptr, ...interface{}) uintptr
856
857// Creates a tag and adds it to the tag table for @buffer.
858//
859// Equivalent to calling [ctor@Gtk.TextTag.new] and then adding the
860// tag to the buffer’s tag table. The returned tag is owned by
861// the buffer’s tag table, so the ref count will be equal to one.
862//
863// If @tag_name is %NULL, the tag is anonymous.
864//
865// If @tag_name is non-%NULL, a tag called @tag_name must not already
866// exist in the tag table for this buffer.
867//
868// The @first_property_name argument and subsequent arguments are a list
869// of properties to set on the tag, as with g_object_set().
870func (x *TextBuffer) CreateTag(TagNameVar *string, FirstPropertyNameVar *string, varArgs ...interface{}) *TextTag {
871 var cls *TextTag
872
873 TagNameVarPtr := core.GStrdupNullable(TagNameVar)
874 defer core.GFreeNullable(TagNameVarPtr)
875
876 FirstPropertyNameVarPtr := core.GStrdupNullable(FirstPropertyNameVar)
877 defer core.GFreeNullable(FirstPropertyNameVarPtr)
878
879 cret := xTextBufferCreateTag(x.GoPointer(), TagNameVarPtr, FirstPropertyNameVarPtr, varArgs...)
880
881 if cret == 0 {
882 return nil
883 }
884 gobject.IncreaseRef(cret)
885 cls = &TextTag{}
886 cls.Ptr = cret
887 return cls
888}
889
890var xTextBufferCutClipboard func(uintptr, uintptr, bool)
891
892// Copies the currently-selected text to a clipboard,
893// then deletes said text if it’s editable.
894func (x *TextBuffer) CutClipboard(ClipboardVar *gdk.Clipboard, DefaultEditableVar bool) {
895
896 xTextBufferCutClipboard(x.GoPointer(), ClipboardVar.GoPointer(), DefaultEditableVar)
897
898}
899
900var xTextBufferDelete func(uintptr, *TextIter, *TextIter)
901
902// Deletes text between @start and @end.
903//
904// The order of @start and @end is not actually relevant;
905// gtk_text_buffer_delete() will reorder them.
906//
907// This function actually emits the “delete-range” signal, and
908// the default handler of that signal deletes the text. Because the
909// buffer is modified, all outstanding iterators become invalid after
910// calling this function; however, the @start and @end will be
911// re-initialized to point to the location where text was deleted.
912func (x *TextBuffer) Delete(StartVar *TextIter, EndVar *TextIter) {
913
914 xTextBufferDelete(x.GoPointer(), StartVar, EndVar)
915
916}
917
918var xTextBufferDeleteInteractive func(uintptr, *TextIter, *TextIter, bool) bool
919
920// Deletes all editable text in the given range.
921//
922// Calls [method@Gtk.TextBuffer.delete] for each editable
923// sub-range of [@start,@end). @start and @end are revalidated
924// to point to the location of the last deleted range, or left
925// untouched if no text was deleted.
926func (x *TextBuffer) DeleteInteractive(StartIterVar *TextIter, EndIterVar *TextIter, DefaultEditableVar bool) bool {
927
928 cret := xTextBufferDeleteInteractive(x.GoPointer(), StartIterVar, EndIterVar, DefaultEditableVar)
929 return cret
930}
931
932var xTextBufferDeleteMark func(uintptr, uintptr)
933
934// Deletes @mark, so that it’s no longer located anywhere in the
935// buffer.
936//
937// Removes the reference the buffer holds to the mark, so if
938// you haven’t called g_object_ref() on the mark, it will be freed.
939// Even if the mark isn’t freed, most operations on @mark become
940// invalid, until it gets added to a buffer again with
941// [method@Gtk.TextBuffer.add_mark]. Use [method@Gtk.TextMark.get_deleted]
942// to find out if a mark has been removed from its buffer.
943//
944// The [signal@Gtk.TextBuffer::mark-deleted] signal will be emitted as
945// notification after the mark is deleted.
946func (x *TextBuffer) DeleteMark(MarkVar *TextMark) {
947
948 xTextBufferDeleteMark(x.GoPointer(), MarkVar.GoPointer())
949
950}
951
952var xTextBufferDeleteMarkByName func(uintptr, string)
953
954// Deletes the mark named @name; the mark must exist.
955//
956// See [method@Gtk.TextBuffer.delete_mark] for details.
957func (x *TextBuffer) DeleteMarkByName(NameVar string) {
958
959 xTextBufferDeleteMarkByName(x.GoPointer(), NameVar)
960
961}
962
963var xTextBufferDeleteSelection func(uintptr, bool, bool) bool
964
965// Deletes the range between the “insert” and “selection_bound” marks,
966// that is, the currently-selected text.
967//
968// If @interactive is %TRUE, the editability of the selection will be
969// considered (users can’t delete uneditable text).
970func (x *TextBuffer) DeleteSelection(InteractiveVar bool, DefaultEditableVar bool) bool {
971
972 cret := xTextBufferDeleteSelection(x.GoPointer(), InteractiveVar, DefaultEditableVar)
973 return cret
974}
975
976var xTextBufferEndIrreversibleAction func(uintptr)
977
978// Denotes the end of an action that may not be undone.
979//
980// This will cause any previous operations in the undo/redo
981// queue to be cleared.
982//
983// This should be called after completing modifications to the
984// text buffer after [method@Gtk.TextBuffer.begin_irreversible_action]
985// was called.
986//
987// You may nest calls to gtk_text_buffer_begin_irreversible_action()
988// and gtk_text_buffer_end_irreversible_action() pairs.
989func (x *TextBuffer) EndIrreversibleAction() {
990
991 xTextBufferEndIrreversibleAction(x.GoPointer())
992
993}
994
995var xTextBufferEndUserAction func(uintptr)
996
997// Ends a user-visible operation.
998//
999// Should be paired with a call to
1000// [method@Gtk.TextBuffer.begin_user_action].
1001// See that function for a full explanation.
1002func (x *TextBuffer) EndUserAction() {
1003
1004 xTextBufferEndUserAction(x.GoPointer())
1005
1006}
1007
1008var xTextBufferGetBounds func(uintptr, *TextIter, *TextIter)
1009
1010// Retrieves the first and last iterators in the buffer, i.e. the
1011// entire buffer lies within the range [@start,@end).
1012func (x *TextBuffer) GetBounds(StartVar *TextIter, EndVar *TextIter) {
1013
1014 xTextBufferGetBounds(x.GoPointer(), StartVar, EndVar)
1015
1016}
1017
1018var xTextBufferGetCanRedo func(uintptr) bool
1019
1020// Gets whether there is a redoable action in the history.
1021func (x *TextBuffer) GetCanRedo() bool {
1022
1023 cret := xTextBufferGetCanRedo(x.GoPointer())
1024 return cret
1025}
1026
1027var xTextBufferGetCanUndo func(uintptr) bool
1028
1029// Gets whether there is an undoable action in the history.
1030func (x *TextBuffer) GetCanUndo() bool {
1031
1032 cret := xTextBufferGetCanUndo(x.GoPointer())
1033 return cret
1034}
1035
1036var xTextBufferGetCharCount func(uintptr) int
1037
1038// Gets the number of characters in the buffer.
1039//
1040// Note that characters and bytes are not the same, you can’t e.g.
1041// expect the contents of the buffer in string form to be this
1042// many bytes long.
1043//
1044// The character count is cached, so this function is very fast.
1045func (x *TextBuffer) GetCharCount() int {
1046
1047 cret := xTextBufferGetCharCount(x.GoPointer())
1048 return cret
1049}
1050
1051var xTextBufferGetEnableUndo func(uintptr) bool
1052
1053// Gets whether the buffer is saving modifications to the buffer
1054// to allow for undo and redo actions.
1055//
1056// See [method@Gtk.TextBuffer.begin_irreversible_action] and
1057// [method@Gtk.TextBuffer.end_irreversible_action] to create
1058// changes to the buffer that cannot be undone.
1059func (x *TextBuffer) GetEnableUndo() bool {
1060
1061 cret := xTextBufferGetEnableUndo(x.GoPointer())
1062 return cret
1063}
1064
1065var xTextBufferGetEndIter func(uintptr, *TextIter)
1066
1067// Initializes @iter with the “end iterator,” one past the last valid
1068// character in the text buffer.
1069//
1070// If dereferenced with [method@Gtk.TextIter.get_char], the end
1071// iterator has a character value of 0.
1072// The entire buffer lies in the range from the first position in
1073// the buffer (call [method@Gtk.TextBuffer.get_start_iter] to get
1074// character position 0) to the end iterator.
1075func (x *TextBuffer) GetEndIter(IterVar *TextIter) {
1076
1077 xTextBufferGetEndIter(x.GoPointer(), IterVar)
1078
1079}
1080
1081var xTextBufferGetHasSelection func(uintptr) bool
1082
1083// Indicates whether the buffer has some text currently selected.
1084func (x *TextBuffer) GetHasSelection() bool {
1085
1086 cret := xTextBufferGetHasSelection(x.GoPointer())
1087 return cret
1088}
1089
1090var xTextBufferGetInsert func(uintptr) uintptr
1091
1092// Returns the mark that represents the cursor (insertion point).
1093//
1094// Equivalent to calling [method@Gtk.TextBuffer.get_mark]
1095// to get the mark named “insert”, but very slightly more
1096// efficient, and involves less typing.
1097func (x *TextBuffer) GetInsert() *TextMark {
1098 var cls *TextMark
1099
1100 cret := xTextBufferGetInsert(x.GoPointer())
1101
1102 if cret == 0 {
1103 return nil
1104 }
1105 gobject.IncreaseRef(cret)
1106 cls = &TextMark{}
1107 cls.Ptr = cret
1108 return cls
1109}
1110
1111var xTextBufferGetIterAtChildAnchor func(uintptr, *TextIter, uintptr)
1112
1113// Obtains the location of @anchor within @buffer.
1114func (x *TextBuffer) GetIterAtChildAnchor(IterVar *TextIter, AnchorVar *TextChildAnchor) {
1115
1116 xTextBufferGetIterAtChildAnchor(x.GoPointer(), IterVar, AnchorVar.GoPointer())
1117
1118}
1119
1120var xTextBufferGetIterAtLine func(uintptr, *TextIter, int) bool
1121
1122// Initializes @iter to the start of the given line.
1123//
1124// If @line_number is greater than or equal to the number of lines
1125// in the @buffer, the end iterator is returned.
1126func (x *TextBuffer) GetIterAtLine(IterVar *TextIter, LineNumberVar int) bool {
1127
1128 cret := xTextBufferGetIterAtLine(x.GoPointer(), IterVar, LineNumberVar)
1129 return cret
1130}
1131
1132var xTextBufferGetIterAtLineIndex func(uintptr, *TextIter, int, int) bool
1133
1134// Obtains an iterator pointing to @byte_index within the given line.
1135//
1136// @byte_index must be the start of a UTF-8 character. Note bytes, not
1137// characters; UTF-8 may encode one character as multiple bytes.
1138//
1139// If @line_number is greater than or equal to the number of lines in the @buffer,
1140// the end iterator is returned. And if @byte_index is off the
1141// end of the line, the iterator at the end of the line is returned.
1142func (x *TextBuffer) GetIterAtLineIndex(IterVar *TextIter, LineNumberVar int, ByteIndexVar int) bool {
1143
1144 cret := xTextBufferGetIterAtLineIndex(x.GoPointer(), IterVar, LineNumberVar, ByteIndexVar)
1145 return cret
1146}
1147
1148var xTextBufferGetIterAtLineOffset func(uintptr, *TextIter, int, int) bool
1149
1150// Obtains an iterator pointing to @char_offset within the given line.
1151//
1152// Note characters, not bytes; UTF-8 may encode one character as multiple
1153// bytes.
1154//
1155// If @line_number is greater than or equal to the number of lines in the @buffer,
1156// the end iterator is returned. And if @char_offset is off the
1157// end of the line, the iterator at the end of the line is returned.
1158func (x *TextBuffer) GetIterAtLineOffset(IterVar *TextIter, LineNumberVar int, CharOffsetVar int) bool {
1159
1160 cret := xTextBufferGetIterAtLineOffset(x.GoPointer(), IterVar, LineNumberVar, CharOffsetVar)
1161 return cret
1162}
1163
1164var xTextBufferGetIterAtMark func(uintptr, *TextIter, uintptr)
1165
1166// Initializes @iter with the current position of @mark.
1167func (x *TextBuffer) GetIterAtMark(IterVar *TextIter, MarkVar *TextMark) {
1168
1169 xTextBufferGetIterAtMark(x.GoPointer(), IterVar, MarkVar.GoPointer())
1170
1171}
1172
1173var xTextBufferGetIterAtOffset func(uintptr, *TextIter, int)
1174
1175// Initializes @iter to a position @char_offset chars from the start
1176// of the entire buffer.
1177//
1178// If @char_offset is -1 or greater than the number
1179// of characters in the buffer, @iter is initialized to the end iterator,
1180// the iterator one past the last valid character in the buffer.
1181func (x *TextBuffer) GetIterAtOffset(IterVar *TextIter, CharOffsetVar int) {
1182
1183 xTextBufferGetIterAtOffset(x.GoPointer(), IterVar, CharOffsetVar)
1184
1185}
1186
1187var xTextBufferGetLineCount func(uintptr) int
1188
1189// Obtains the number of lines in the buffer.
1190//
1191// This value is cached, so the function is very fast.
1192func (x *TextBuffer) GetLineCount() int {
1193
1194 cret := xTextBufferGetLineCount(x.GoPointer())
1195 return cret
1196}
1197
1198var xTextBufferGetMark func(uintptr, string) uintptr
1199
1200// Returns the mark named @name in buffer @buffer, or %NULL if no such
1201// mark exists in the buffer.
1202func (x *TextBuffer) GetMark(NameVar string) *TextMark {
1203 var cls *TextMark
1204
1205 cret := xTextBufferGetMark(x.GoPointer(), NameVar)
1206
1207 if cret == 0 {
1208 return nil
1209 }
1210 gobject.IncreaseRef(cret)
1211 cls = &TextMark{}
1212 cls.Ptr = cret
1213 return cls
1214}
1215
1216var xTextBufferGetMaxUndoLevels func(uintptr) uint
1217
1218// Gets the maximum number of undo levels to perform.
1219//
1220// If 0, unlimited undo actions may be performed. Note that this may
1221// have a memory usage impact as it requires storing an additional
1222// copy of the inserted or removed text within the text buffer.
1223func (x *TextBuffer) GetMaxUndoLevels() uint {
1224
1225 cret := xTextBufferGetMaxUndoLevels(x.GoPointer())
1226 return cret
1227}
1228
1229var xTextBufferGetModified func(uintptr) bool
1230
1231// Indicates whether the buffer has been modified since the last call
1232// to [method@Gtk.TextBuffer.set_modified] set the modification flag to
1233// %FALSE.
1234//
1235// Used for example to enable a “save” function in a text editor.
1236func (x *TextBuffer) GetModified() bool {
1237
1238 cret := xTextBufferGetModified(x.GoPointer())
1239 return cret
1240}
1241
1242var xTextBufferGetSelectionBound func(uintptr) uintptr
1243
1244// Returns the mark that represents the selection bound.
1245//
1246// Equivalent to calling [method@Gtk.TextBuffer.get_mark]
1247// to get the mark named “selection_bound”, but very slightly
1248// more efficient, and involves less typing.
1249//
1250// The currently-selected text in @buffer is the region between the
1251// “selection_bound” and “insert” marks. If “selection_bound” and
1252// “insert” are in the same place, then there is no current selection.
1253// [method@Gtk.TextBuffer.get_selection_bounds] is another convenient
1254// function for handling the selection, if you just want to know whether
1255// there’s a selection and what its bounds are.
1256func (x *TextBuffer) GetSelectionBound() *TextMark {
1257 var cls *TextMark
1258
1259 cret := xTextBufferGetSelectionBound(x.GoPointer())
1260
1261 if cret == 0 {
1262 return nil
1263 }
1264 gobject.IncreaseRef(cret)
1265 cls = &TextMark{}
1266 cls.Ptr = cret
1267 return cls
1268}
1269
1270var xTextBufferGetSelectionBounds func(uintptr, *TextIter, *TextIter) bool
1271
1272// Returns %TRUE if some text is selected; places the bounds
1273// of the selection in @start and @end.
1274//
1275// If the selection has length 0, then @start and @end are filled
1276// in with the same value. @start and @end will be in ascending order.
1277// If @start and @end are %NULL, then they are not filled in, but the
1278// return value still indicates whether text is selected.
1279func (x *TextBuffer) GetSelectionBounds(StartVar *TextIter, EndVar *TextIter) bool {
1280
1281 cret := xTextBufferGetSelectionBounds(x.GoPointer(), StartVar, EndVar)
1282 return cret
1283}
1284
1285var xTextBufferGetSelectionContent func(uintptr) uintptr
1286
1287// Get a content provider for this buffer.
1288//
1289// It can be used to make the content of @buffer available
1290// in a `GdkClipboard`, see [method@Gdk.Clipboard.set_content].
1291func (x *TextBuffer) GetSelectionContent() *gdk.ContentProvider {
1292 var cls *gdk.ContentProvider
1293
1294 cret := xTextBufferGetSelectionContent(x.GoPointer())
1295
1296 if cret == 0 {
1297 return nil
1298 }
1299 cls = &gdk.ContentProvider{}
1300 cls.Ptr = cret
1301 return cls
1302}
1303
1304var xTextBufferGetSlice func(uintptr, *TextIter, *TextIter, bool) string
1305
1306// Returns the text in the range [@start,@end).
1307//
1308// Excludes undisplayed text (text marked with tags that set the
1309// invisibility attribute) if @include_hidden_chars is %FALSE.
1310// The returned string includes a 0xFFFC character whenever the
1311// buffer contains embedded images, so byte and character indexes
1312// into the returned string do correspond to byte and character
1313// indexes into the buffer. Contrast with [method@Gtk.TextBuffer.get_text].
1314// Note that 0xFFFC can occur in normal text as well, so it is not a
1315// reliable indicator that a paintable or widget is in the buffer.
1316func (x *TextBuffer) GetSlice(StartVar *TextIter, EndVar *TextIter, IncludeHiddenCharsVar bool) string {
1317
1318 cret := xTextBufferGetSlice(x.GoPointer(), StartVar, EndVar, IncludeHiddenCharsVar)
1319 return cret
1320}
1321
1322var xTextBufferGetStartIter func(uintptr, *TextIter)
1323
1324// Initialized @iter with the first position in the text buffer.
1325//
1326// This is the same as using [method@Gtk.TextBuffer.get_iter_at_offset]
1327// to get the iter at character offset 0.
1328func (x *TextBuffer) GetStartIter(IterVar *TextIter) {
1329
1330 xTextBufferGetStartIter(x.GoPointer(), IterVar)
1331
1332}
1333
1334var xTextBufferGetTagTable func(uintptr) uintptr
1335
1336// Get the `GtkTextTagTable` associated with this buffer.
1337func (x *TextBuffer) GetTagTable() *TextTagTable {
1338 var cls *TextTagTable
1339
1340 cret := xTextBufferGetTagTable(x.GoPointer())
1341
1342 if cret == 0 {
1343 return nil
1344 }
1345 gobject.IncreaseRef(cret)
1346 cls = &TextTagTable{}
1347 cls.Ptr = cret
1348 return cls
1349}
1350
1351var xTextBufferGetText func(uintptr, *TextIter, *TextIter, bool) string
1352
1353// Returns the text in the range [@start,@end).
1354//
1355// Excludes undisplayed text (text marked with tags that set the
1356// invisibility attribute) if @include_hidden_chars is %FALSE.
1357// Does not include characters representing embedded images, so
1358// byte and character indexes into the returned string do not
1359// correspond to byte and character indexes into the buffer.
1360// Contrast with [method@Gtk.TextBuffer.get_slice].
1361func (x *TextBuffer) GetText(StartVar *TextIter, EndVar *TextIter, IncludeHiddenCharsVar bool) string {
1362
1363 cret := xTextBufferGetText(x.GoPointer(), StartVar, EndVar, IncludeHiddenCharsVar)
1364 return cret
1365}
1366
1367var xTextBufferInsert func(uintptr, *TextIter, string, int)
1368
1369// Inserts @len bytes of @text at position @iter.
1370//
1371// If @len is -1, @text must be nul-terminated and will be inserted in its
1372// entirety. Emits the “insert-text” signal; insertion actually occurs
1373// in the default handler for the signal. @iter is invalidated when
1374// insertion occurs (because the buffer contents change), but the
1375// default signal handler revalidates it to point to the end of the
1376// inserted text.
1377func (x *TextBuffer) Insert(IterVar *TextIter, TextVar string, LenVar int) {
1378
1379 xTextBufferInsert(x.GoPointer(), IterVar, TextVar, LenVar)
1380
1381}
1382
1383var xTextBufferInsertAtCursor func(uintptr, string, int)
1384
1385// Inserts @text in @buffer.
1386//
1387// Simply calls [method@Gtk.TextBuffer.insert],
1388// using the current cursor position as the insertion point.
1389func (x *TextBuffer) InsertAtCursor(TextVar string, LenVar int) {
1390
1391 xTextBufferInsertAtCursor(x.GoPointer(), TextVar, LenVar)
1392
1393}
1394
1395var xTextBufferInsertChildAnchor func(uintptr, *TextIter, uintptr)
1396
1397// Inserts a child widget anchor into the text buffer at @iter.
1398//
1399// The anchor will be counted as one character in character counts, and
1400// when obtaining the buffer contents as a string, will be represented
1401// by the Unicode “object replacement character” 0xFFFC. Note that the
1402// “slice” variants for obtaining portions of the buffer as a string
1403// include this character for child anchors, but the “text” variants do
1404// not. E.g. see [method@Gtk.TextBuffer.get_slice] and
1405// [method@Gtk.TextBuffer.get_text].
1406//
1407// Consider [method@Gtk.TextBuffer.create_child_anchor] as a more
1408// convenient alternative to this function. The buffer will add a
1409// reference to the anchor, so you can unref it after insertion.
1410func (x *TextBuffer) InsertChildAnchor(IterVar *TextIter, AnchorVar *TextChildAnchor) {
1411
1412 xTextBufferInsertChildAnchor(x.GoPointer(), IterVar, AnchorVar.GoPointer())
1413
1414}
1415
1416var xTextBufferInsertInteractive func(uintptr, *TextIter, string, int, bool) bool
1417
1418// Inserts @text in @buffer.
1419//
1420// Like [method@Gtk.TextBuffer.insert], but the insertion will not occur
1421// if @iter is at a non-editable location in the buffer. Usually you
1422// want to prevent insertions at ineditable locations if the insertion
1423// results from a user action (is interactive).
1424//
1425// @default_editable indicates the editability of text that doesn't
1426// have a tag affecting editability applied to it. Typically the
1427// result of [method@Gtk.TextView.get_editable] is appropriate here.
1428func (x *TextBuffer) InsertInteractive(IterVar *TextIter, TextVar string, LenVar int, DefaultEditableVar bool) bool {
1429
1430 cret := xTextBufferInsertInteractive(x.GoPointer(), IterVar, TextVar, LenVar, DefaultEditableVar)
1431 return cret
1432}
1433
1434var xTextBufferInsertInteractiveAtCursor func(uintptr, string, int, bool) bool
1435
1436// Inserts @text in @buffer.
1437//
1438// Calls [method@Gtk.TextBuffer.insert_interactive]
1439// at the cursor position.
1440//
1441// @default_editable indicates the editability of text that doesn't
1442// have a tag affecting editability applied to it. Typically the
1443// result of [method@Gtk.TextView.get_editable] is appropriate here.
1444func (x *TextBuffer) InsertInteractiveAtCursor(TextVar string, LenVar int, DefaultEditableVar bool) bool {
1445
1446 cret := xTextBufferInsertInteractiveAtCursor(x.GoPointer(), TextVar, LenVar, DefaultEditableVar)
1447 return cret
1448}
1449
1450var xTextBufferInsertMarkup func(uintptr, *TextIter, string, int)
1451
1452// Inserts the text in @markup at position @iter.
1453//
1454// @markup will be inserted in its entirety and must be nul-terminated
1455// and valid UTF-8. Emits the [signal@Gtk.TextBuffer::insert-text] signal,
1456// possibly multiple times; insertion actually occurs in the default handler
1457// for the signal. @iter will point to the end of the inserted text on return.
1458func (x *TextBuffer) InsertMarkup(IterVar *TextIter, MarkupVar string, LenVar int) {
1459
1460 xTextBufferInsertMarkup(x.GoPointer(), IterVar, MarkupVar, LenVar)
1461
1462}
1463
1464var xTextBufferInsertPaintable func(uintptr, *TextIter, uintptr)
1465
1466// Inserts an image into the text buffer at @iter.
1467//
1468// The image will be counted as one character in character counts,
1469// and when obtaining the buffer contents as a string, will be
1470// represented by the Unicode “object replacement character” 0xFFFC.
1471// Note that the “slice” variants for obtaining portions of the buffer
1472// as a string include this character for paintable, but the “text”
1473// variants do not. e.g. see [method@Gtk.TextBuffer.get_slice] and
1474// [method@Gtk.TextBuffer.get_text].
1475func (x *TextBuffer) InsertPaintable(IterVar *TextIter, PaintableVar gdk.Paintable) {
1476
1477 xTextBufferInsertPaintable(x.GoPointer(), IterVar, PaintableVar.GoPointer())
1478
1479}
1480
1481var xTextBufferInsertRange func(uintptr, *TextIter, *TextIter, *TextIter)
1482
1483// Copies text, tags, and paintables between @start and @end
1484// and inserts the copy at @iter.
1485//
1486// The order of @start and @end doesn’t matter.
1487//
1488// Used instead of simply getting/inserting text because it preserves
1489// images and tags. If @start and @end are in a different buffer from
1490// @buffer, the two buffers must share the same tag table.
1491//
1492// Implemented via emissions of the ::insert-text and ::apply-tag signals,
1493// so expect those.
1494func (x *TextBuffer) InsertRange(IterVar *TextIter, StartVar *TextIter, EndVar *TextIter) {
1495
1496 xTextBufferInsertRange(x.GoPointer(), IterVar, StartVar, EndVar)
1497
1498}
1499
1500var xTextBufferInsertRangeInteractive func(uintptr, *TextIter, *TextIter, *TextIter, bool) bool
1501
1502// Copies text, tags, and paintables between @start and @end
1503// and inserts the copy at @iter.
1504//
1505// Same as [method@Gtk.TextBuffer.insert_range], but does nothing
1506// if the insertion point isn’t editable. The @default_editable
1507// parameter indicates whether the text is editable at @iter if
1508// no tags enclosing @iter affect editability. Typically the result
1509// of [method@Gtk.TextView.get_editable] is appropriate here.
1510func (x *TextBuffer) InsertRangeInteractive(IterVar *TextIter, StartVar *TextIter, EndVar *TextIter, DefaultEditableVar bool) bool {
1511
1512 cret := xTextBufferInsertRangeInteractive(x.GoPointer(), IterVar, StartVar, EndVar, DefaultEditableVar)
1513 return cret
1514}
1515
1516var xTextBufferInsertWithTags func(uintptr, *TextIter, string, int, uintptr, ...interface{})
1517
1518// Inserts @text into @buffer at @iter, applying the list of tags to
1519// the newly-inserted text.
1520//
1521// The last tag specified must be %NULL to terminate the list.
1522// Equivalent to calling [method@Gtk.TextBuffer.insert],
1523// then [method@Gtk.TextBuffer.apply_tag] on the inserted text;
1524// this is just a convenience function.
1525func (x *TextBuffer) InsertWithTags(IterVar *TextIter, TextVar string, LenVar int, FirstTagVar *TextTag, varArgs ...interface{}) {
1526
1527 xTextBufferInsertWithTags(x.GoPointer(), IterVar, TextVar, LenVar, FirstTagVar.GoPointer(), varArgs...)
1528
1529}
1530
1531var xTextBufferInsertWithTagsByName func(uintptr, *TextIter, string, int, string, ...interface{})
1532
1533// Inserts @text into @buffer at @iter, applying the list of tags to
1534// the newly-inserted text.
1535//
1536// Same as [method@Gtk.TextBuffer.insert_with_tags], but allows you
1537// to pass in tag names instead of tag objects.
1538func (x *TextBuffer) InsertWithTagsByName(IterVar *TextIter, TextVar string, LenVar int, FirstTagNameVar string, varArgs ...interface{}) {
1539
1540 xTextBufferInsertWithTagsByName(x.GoPointer(), IterVar, TextVar, LenVar, FirstTagNameVar, varArgs...)
1541
1542}
1543
1544var xTextBufferMoveMark func(uintptr, uintptr, *TextIter)
1545
1546// Moves @mark to the new location @where.
1547//
1548// Emits the [signal@Gtk.TextBuffer::mark-set] signal
1549// as notification of the move.
1550func (x *TextBuffer) MoveMark(MarkVar *TextMark, WhereVar *TextIter) {
1551
1552 xTextBufferMoveMark(x.GoPointer(), MarkVar.GoPointer(), WhereVar)
1553
1554}
1555
1556var xTextBufferMoveMarkByName func(uintptr, string, *TextIter)
1557
1558// Moves the mark named @name (which must exist) to location @where.
1559//
1560// See [method@Gtk.TextBuffer.move_mark] for details.
1561func (x *TextBuffer) MoveMarkByName(NameVar string, WhereVar *TextIter) {
1562
1563 xTextBufferMoveMarkByName(x.GoPointer(), NameVar, WhereVar)
1564
1565}
1566
1567var xTextBufferPasteClipboard func(uintptr, uintptr, *TextIter, bool)
1568
1569// Pastes the contents of a clipboard.
1570//
1571// If @override_location is %NULL, the pasted text will be inserted
1572// at the cursor position, or the buffer selection will be replaced
1573// if the selection is non-empty.
1574//
1575// Note: pasting is asynchronous, that is, we’ll ask for the paste data
1576// and return, and at some point later after the main loop runs, the paste
1577// data will be inserted.
1578func (x *TextBuffer) PasteClipboard(ClipboardVar *gdk.Clipboard, OverrideLocationVar *TextIter, DefaultEditableVar bool) {
1579
1580 xTextBufferPasteClipboard(x.GoPointer(), ClipboardVar.GoPointer(), OverrideLocationVar, DefaultEditableVar)
1581
1582}
1583
1584var xTextBufferPlaceCursor func(uintptr, *TextIter)
1585
1586// This function moves the “insert” and “selection_bound” marks
1587// simultaneously.
1588//
1589// If you move them to the same place in two steps with
1590// [method@Gtk.TextBuffer.move_mark], you will temporarily select a
1591// region in between their old and new locations, which can be pretty
1592// inefficient since the temporarily-selected region will force stuff
1593// to be recalculated. This function moves them as a unit, which can
1594// be optimized.
1595func (x *TextBuffer) PlaceCursor(WhereVar *TextIter) {
1596
1597 xTextBufferPlaceCursor(x.GoPointer(), WhereVar)
1598
1599}
1600
1601var xTextBufferRedo func(uintptr)
1602
1603// Redoes the next redoable action on the buffer, if there is one.
1604func (x *TextBuffer) Redo() {
1605
1606 xTextBufferRedo(x.GoPointer())
1607
1608}
1609
1610var xTextBufferRemoveAllTags func(uintptr, *TextIter, *TextIter)
1611
1612// Removes all tags in the range between @start and @end.
1613//
1614// Be careful with this function; it could remove tags added in code
1615// unrelated to the code you’re currently writing. That is, using this
1616// function is probably a bad idea if you have two or more unrelated
1617// code sections that add tags.
1618func (x *TextBuffer) RemoveAllTags(StartVar *TextIter, EndVar *TextIter) {
1619
1620 xTextBufferRemoveAllTags(x.GoPointer(), StartVar, EndVar)
1621
1622}
1623
1624var xTextBufferRemoveCommitNotify func(uintptr, uint)
1625
1626// Removes the `GtkTextBufferCommitNotify` handler previously registered
1627// with [method@Gtk.TextBuffer.add_commit_notify].
1628//
1629// This may result in the `user_data_destroy` being called that was passed when registering
1630// the commit notify functions.
1631func (x *TextBuffer) RemoveCommitNotify(CommitNotifyHandlerVar uint) {
1632
1633 xTextBufferRemoveCommitNotify(x.GoPointer(), CommitNotifyHandlerVar)
1634
1635}
1636
1637var xTextBufferRemoveSelectionClipboard func(uintptr, uintptr)
1638
1639// Removes a `GdkClipboard` added with
1640// [method@Gtk.TextBuffer.add_selection_clipboard]
1641func (x *TextBuffer) RemoveSelectionClipboard(ClipboardVar *gdk.Clipboard) {
1642
1643 xTextBufferRemoveSelectionClipboard(x.GoPointer(), ClipboardVar.GoPointer())
1644
1645}
1646
1647var xTextBufferRemoveTag func(uintptr, uintptr, *TextIter, *TextIter)
1648
1649// Emits the “remove-tag” signal.
1650//
1651// The default handler for the signal removes all occurrences
1652// of @tag from the given range. @start and @end don’t have
1653// to be in order.
1654func (x *TextBuffer) RemoveTag(TagVar *TextTag, StartVar *TextIter, EndVar *TextIter) {
1655
1656 xTextBufferRemoveTag(x.GoPointer(), TagVar.GoPointer(), StartVar, EndVar)
1657
1658}
1659
1660var xTextBufferRemoveTagByName func(uintptr, string, *TextIter, *TextIter)
1661
1662// Emits the “remove-tag” signal.
1663//
1664// Calls [method@Gtk.TextTagTable.lookup] on the buffer’s
1665// tag table to get a `GtkTextTag`, then calls
1666// [method@Gtk.TextBuffer.remove_tag].
1667func (x *TextBuffer) RemoveTagByName(NameVar string, StartVar *TextIter, EndVar *TextIter) {
1668
1669 xTextBufferRemoveTagByName(x.GoPointer(), NameVar, StartVar, EndVar)
1670
1671}
1672
1673var xTextBufferSelectRange func(uintptr, *TextIter, *TextIter)
1674
1675// This function moves the “insert” and “selection_bound” marks
1676// simultaneously.
1677//
1678// If you move them in two steps with
1679// [method@Gtk.TextBuffer.move_mark], you will temporarily select a
1680// region in between their old and new locations, which can be pretty
1681// inefficient since the temporarily-selected region will force stuff
1682// to be recalculated. This function moves them as a unit, which can
1683// be optimized.
1684func (x *TextBuffer) SelectRange(InsVar *TextIter, BoundVar *TextIter) {
1685
1686 xTextBufferSelectRange(x.GoPointer(), InsVar, BoundVar)
1687
1688}
1689
1690var xTextBufferSetEnableUndo func(uintptr, bool)
1691
1692// Sets whether or not to enable undoable actions in the text buffer.
1693//
1694// Undoable actions in this context are changes to the text content of
1695// the buffer. Changes to tags and marks are not tracked.
1696//
1697// If enabled, the user will be able to undo the last number of actions
1698// up to [method@Gtk.TextBuffer.get_max_undo_levels].
1699//
1700// See [method@Gtk.TextBuffer.begin_irreversible_action] and
1701// [method@Gtk.TextBuffer.end_irreversible_action] to create
1702// changes to the buffer that cannot be undone.
1703func (x *TextBuffer) SetEnableUndo(EnableUndoVar bool) {
1704
1705 xTextBufferSetEnableUndo(x.GoPointer(), EnableUndoVar)
1706
1707}
1708
1709var xTextBufferSetMaxUndoLevels func(uintptr, uint)
1710
1711// Sets the maximum number of undo levels to perform.
1712//
1713// If 0, unlimited undo actions may be performed. Note that this may
1714// have a memory usage impact as it requires storing an additional
1715// copy of the inserted or removed text within the text buffer.
1716func (x *TextBuffer) SetMaxUndoLevels(MaxUndoLevelsVar uint) {
1717
1718 xTextBufferSetMaxUndoLevels(x.GoPointer(), MaxUndoLevelsVar)
1719
1720}
1721
1722var xTextBufferSetModified func(uintptr, bool)
1723
1724// Used to keep track of whether the buffer has been
1725// modified since the last time it was saved.
1726//
1727// Whenever the buffer is saved to disk, call
1728// `gtk_text_buffer_set_modified (@buffer, FALSE)`.
1729// When the buffer is modified, it will automatically
1730// toggle on the modified bit again. When the modified
1731// bit flips, the buffer emits the
1732// [signal@Gtk.TextBuffer::modified-changed] signal.
1733func (x *TextBuffer) SetModified(SettingVar bool) {
1734
1735 xTextBufferSetModified(x.GoPointer(), SettingVar)
1736
1737}
1738
1739var xTextBufferSetText func(uintptr, string, int)
1740
1741// Deletes current contents of @buffer, and inserts @text instead. This is
1742// automatically marked as an irreversible action in the undo stack. If you
1743// wish to mark this action as part of a larger undo operation, call
1744// [method@TextBuffer.delete] and [method@TextBuffer.insert] directly instead.
1745//
1746// If @len is -1, @text must be nul-terminated.
1747// @text must be valid UTF-8.
1748func (x *TextBuffer) SetText(TextVar string, LenVar int) {
1749
1750 xTextBufferSetText(x.GoPointer(), TextVar, LenVar)
1751
1752}
1753
1754var xTextBufferUndo func(uintptr)
1755
1756// Undoes the last undoable action on the buffer, if there is one.
1757func (x *TextBuffer) Undo() {
1758
1759 xTextBufferUndo(x.GoPointer())
1760
1761}
1762
1763func (c *TextBuffer) GoPointer() uintptr {
1764 if c == nil {
1765 return 0
1766 }
1767 return c.Ptr
1768}
1769
1770func (c *TextBuffer) SetGoPointer(ptr uintptr) {
1771 c.Ptr = ptr
1772}
1773
1774// GetPropertyCanRedo gets the "can-redo" property.
1775// Denotes that the buffer can reapply the last undone action.
1776func (x *TextBuffer) GetPropertyCanRedo() bool {
1777 var v gobject.Value
1778 x.GetProperty("can-redo", &v)
1779 return v.GetBoolean()
1780}
1781
1782// GetPropertyCanUndo gets the "can-undo" property.
1783// Denotes that the buffer can undo the last applied action.
1784func (x *TextBuffer) GetPropertyCanUndo() bool {
1785 var v gobject.Value
1786 x.GetProperty("can-undo", &v)
1787 return v.GetBoolean()
1788}
1789
1790// GetPropertyCursorPosition gets the "cursor-position" property.
1791// The position of the insert mark.
1792//
1793// This is an offset from the beginning of the buffer.
1794// It is useful for getting notified when the cursor moves.
1795func (x *TextBuffer) GetPropertyCursorPosition() int {
1796 var v gobject.Value
1797 x.GetProperty("cursor-position", &v)
1798 return v.GetInt()
1799}
1800
1801// SetPropertyEnableUndo sets the "enable-undo" property.
1802// Denotes if support for undoing and redoing changes to the buffer is allowed.
1803func (x *TextBuffer) SetPropertyEnableUndo(value bool) {
1804 var v gobject.Value
1805 v.Init(gobject.TypeBooleanVal)
1806 v.SetBoolean(value)
1807 x.SetProperty("enable-undo", &v)
1808}
1809
1810// GetPropertyEnableUndo gets the "enable-undo" property.
1811// Denotes if support for undoing and redoing changes to the buffer is allowed.
1812func (x *TextBuffer) GetPropertyEnableUndo() bool {
1813 var v gobject.Value
1814 x.GetProperty("enable-undo", &v)
1815 return v.GetBoolean()
1816}
1817
1818// GetPropertyHasSelection gets the "has-selection" property.
1819// Whether the buffer has some text currently selected.
1820func (x *TextBuffer) GetPropertyHasSelection() bool {
1821 var v gobject.Value
1822 x.GetProperty("has-selection", &v)
1823 return v.GetBoolean()
1824}
1825
1826// SetPropertyText sets the "text" property.
1827// The text content of the buffer.
1828//
1829// Without child widgets and images,
1830// see [method@Gtk.TextBuffer.get_text] for more information.
1831func (x *TextBuffer) SetPropertyText(value string) {
1832 var v gobject.Value
1833 v.Init(gobject.TypeStringVal)
1834 v.SetString(&value)
1835 x.SetProperty("text", &v)
1836}
1837
1838// GetPropertyText gets the "text" property.
1839// The text content of the buffer.
1840//
1841// Without child widgets and images,
1842// see [method@Gtk.TextBuffer.get_text] for more information.
1843func (x *TextBuffer) GetPropertyText() string {
1844 var v gobject.Value
1845 x.GetProperty("text", &v)
1846 return v.GetString()
1847}
1848
1849// Emitted to apply a tag to a range of text in a `GtkTextBuffer`.
1850//
1851// Applying actually occurs in the default handler.
1852//
1853// Note that if your handler runs before the default handler
1854// it must not invalidate the @start and @end iters (or has to
1855// revalidate them).
1856//
1857// See also:
1858// [method@Gtk.TextBuffer.apply_tag],
1859// [method@Gtk.TextBuffer.insert_with_tags],
1860// [method@Gtk.TextBuffer.insert_range].
1861func (x *TextBuffer) ConnectApplyTag(cb *func(TextBuffer, uintptr, uintptr, uintptr)) uint {
1862 cbPtr := uintptr(unsafe.Pointer(cb))
1863 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1864 handlerID := gobject.SignalConnect(x.GoPointer(), "apply-tag", cbRefPtr)
1865 glib.SaveHandlerMapping(handlerID, cbPtr)
1866 return handlerID
1867 }
1868
1869 fcb := func(clsPtr uintptr, TagVarp uintptr, StartVarp uintptr, EndVarp uintptr) {
1870 fa := TextBuffer{}
1871 fa.Ptr = clsPtr
1872 cbFn := *cb
1873
1874 cbFn(fa, TagVarp, StartVarp, EndVarp)
1875
1876 }
1877 cbRefPtr := purego.NewCallback(fcb)
1878 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1879 handlerID := gobject.SignalConnect(x.GoPointer(), "apply-tag", cbRefPtr)
1880 glib.SaveHandlerMapping(handlerID, cbPtr)
1881 return handlerID
1882}
1883
1884// Emitted at the beginning of a single user-visible
1885// operation on a `GtkTextBuffer`.
1886//
1887// See also:
1888// [method@Gtk.TextBuffer.begin_user_action],
1889// [method@Gtk.TextBuffer.insert_interactive],
1890// [method@Gtk.TextBuffer.insert_range_interactive],
1891// [method@Gtk.TextBuffer.delete_interactive],
1892// [method@Gtk.TextBuffer.backspace],
1893// [method@Gtk.TextBuffer.delete_selection].
1894func (x *TextBuffer) ConnectBeginUserAction(cb *func(TextBuffer)) uint {
1895 cbPtr := uintptr(unsafe.Pointer(cb))
1896 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1897 handlerID := gobject.SignalConnect(x.GoPointer(), "begin-user-action", cbRefPtr)
1898 glib.SaveHandlerMapping(handlerID, cbPtr)
1899 return handlerID
1900 }
1901
1902 fcb := func(clsPtr uintptr) {
1903 fa := TextBuffer{}
1904 fa.Ptr = clsPtr
1905 cbFn := *cb
1906
1907 cbFn(fa)
1908
1909 }
1910 cbRefPtr := purego.NewCallback(fcb)
1911 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1912 handlerID := gobject.SignalConnect(x.GoPointer(), "begin-user-action", cbRefPtr)
1913 glib.SaveHandlerMapping(handlerID, cbPtr)
1914 return handlerID
1915}
1916
1917// Emitted when the content of a `GtkTextBuffer` has changed.
1918func (x *TextBuffer) ConnectChanged(cb *func(TextBuffer)) uint {
1919 cbPtr := uintptr(unsafe.Pointer(cb))
1920 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1921 handlerID := gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)
1922 glib.SaveHandlerMapping(handlerID, cbPtr)
1923 return handlerID
1924 }
1925
1926 fcb := func(clsPtr uintptr) {
1927 fa := TextBuffer{}
1928 fa.Ptr = clsPtr
1929 cbFn := *cb
1930
1931 cbFn(fa)
1932
1933 }
1934 cbRefPtr := purego.NewCallback(fcb)
1935 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1936 handlerID := gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)
1937 glib.SaveHandlerMapping(handlerID, cbPtr)
1938 return handlerID
1939}
1940
1941// Emitted to delete a range from a `GtkTextBuffer`.
1942//
1943// Note that if your handler runs before the default handler
1944// it must not invalidate the @start and @end iters (or has
1945// to revalidate them). The default signal handler revalidates
1946// the @start and @end iters to both point to the location
1947// where text was deleted. Handlers which run after the default
1948// handler (see g_signal_connect_after()) do not have access to
1949// the deleted text.
1950//
1951// See also: [method@Gtk.TextBuffer.delete].
1952func (x *TextBuffer) ConnectDeleteRange(cb *func(TextBuffer, uintptr, uintptr)) uint {
1953 cbPtr := uintptr(unsafe.Pointer(cb))
1954 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1955 handlerID := gobject.SignalConnect(x.GoPointer(), "delete-range", cbRefPtr)
1956 glib.SaveHandlerMapping(handlerID, cbPtr)
1957 return handlerID
1958 }
1959
1960 fcb := func(clsPtr uintptr, StartVarp uintptr, EndVarp uintptr) {
1961 fa := TextBuffer{}
1962 fa.Ptr = clsPtr
1963 cbFn := *cb
1964
1965 cbFn(fa, StartVarp, EndVarp)
1966
1967 }
1968 cbRefPtr := purego.NewCallback(fcb)
1969 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1970 handlerID := gobject.SignalConnect(x.GoPointer(), "delete-range", cbRefPtr)
1971 glib.SaveHandlerMapping(handlerID, cbPtr)
1972 return handlerID
1973}
1974
1975// Emitted at the end of a single user-visible
1976// operation on the `GtkTextBuffer`.
1977//
1978// See also:
1979// [method@Gtk.TextBuffer.end_user_action],
1980// [method@Gtk.TextBuffer.insert_interactive],
1981// [method@Gtk.TextBuffer.insert_range_interactive],
1982// [method@Gtk.TextBuffer.delete_interactive],
1983// [method@Gtk.TextBuffer.backspace],
1984// [method@Gtk.TextBuffer.delete_selection],
1985// [method@Gtk.TextBuffer.backspace].
1986func (x *TextBuffer) ConnectEndUserAction(cb *func(TextBuffer)) uint {
1987 cbPtr := uintptr(unsafe.Pointer(cb))
1988 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1989 handlerID := gobject.SignalConnect(x.GoPointer(), "end-user-action", cbRefPtr)
1990 glib.SaveHandlerMapping(handlerID, cbPtr)
1991 return handlerID
1992 }
1993
1994 fcb := func(clsPtr uintptr) {
1995 fa := TextBuffer{}
1996 fa.Ptr = clsPtr
1997 cbFn := *cb
1998
1999 cbFn(fa)
2000
2001 }
2002 cbRefPtr := purego.NewCallback(fcb)
2003 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2004 handlerID := gobject.SignalConnect(x.GoPointer(), "end-user-action", cbRefPtr)
2005 glib.SaveHandlerMapping(handlerID, cbPtr)
2006 return handlerID
2007}
2008
2009// Emitted to insert a `GtkTextChildAnchor` in a `GtkTextBuffer`.
2010//
2011// Insertion actually occurs in the default handler.
2012//
2013// Note that if your handler runs before the default handler
2014// it must not invalidate the @location iter (or has to
2015// revalidate it). The default signal handler revalidates
2016// it to be placed after the inserted @anchor.
2017//
2018// See also: [method@Gtk.TextBuffer.insert_child_anchor].
2019func (x *TextBuffer) ConnectInsertChildAnchor(cb *func(TextBuffer, uintptr, uintptr)) uint {
2020 cbPtr := uintptr(unsafe.Pointer(cb))
2021 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2022 handlerID := gobject.SignalConnect(x.GoPointer(), "insert-child-anchor", cbRefPtr)
2023 glib.SaveHandlerMapping(handlerID, cbPtr)
2024 return handlerID
2025 }
2026
2027 fcb := func(clsPtr uintptr, LocationVarp uintptr, AnchorVarp uintptr) {
2028 fa := TextBuffer{}
2029 fa.Ptr = clsPtr
2030 cbFn := *cb
2031
2032 cbFn(fa, LocationVarp, AnchorVarp)
2033
2034 }
2035 cbRefPtr := purego.NewCallback(fcb)
2036 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2037 handlerID := gobject.SignalConnect(x.GoPointer(), "insert-child-anchor", cbRefPtr)
2038 glib.SaveHandlerMapping(handlerID, cbPtr)
2039 return handlerID
2040}
2041
2042// Emitted to insert a `GdkPaintable` in a `GtkTextBuffer`.
2043//
2044// Insertion actually occurs in the default handler.
2045//
2046// Note that if your handler runs before the default handler
2047// it must not invalidate the @location iter (or has to
2048// revalidate it). The default signal handler revalidates
2049// it to be placed after the inserted @paintable.
2050//
2051// See also: [method@Gtk.TextBuffer.insert_paintable].
2052func (x *TextBuffer) ConnectInsertPaintable(cb *func(TextBuffer, uintptr, uintptr)) uint {
2053 cbPtr := uintptr(unsafe.Pointer(cb))
2054 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2055 handlerID := gobject.SignalConnect(x.GoPointer(), "insert-paintable", cbRefPtr)
2056 glib.SaveHandlerMapping(handlerID, cbPtr)
2057 return handlerID
2058 }
2059
2060 fcb := func(clsPtr uintptr, LocationVarp uintptr, PaintableVarp uintptr) {
2061 fa := TextBuffer{}
2062 fa.Ptr = clsPtr
2063 cbFn := *cb
2064
2065 cbFn(fa, LocationVarp, PaintableVarp)
2066
2067 }
2068 cbRefPtr := purego.NewCallback(fcb)
2069 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2070 handlerID := gobject.SignalConnect(x.GoPointer(), "insert-paintable", cbRefPtr)
2071 glib.SaveHandlerMapping(handlerID, cbPtr)
2072 return handlerID
2073}
2074
2075// Emitted to insert text in a `GtkTextBuffer`.
2076//
2077// Insertion actually occurs in the default handler.
2078//
2079// Note that if your handler runs before the default handler
2080// it must not invalidate the @location iter (or has to
2081// revalidate it). The default signal handler revalidates
2082// it to point to the end of the inserted text.
2083//
2084// See also: [method@Gtk.TextBuffer.insert],
2085// [method@Gtk.TextBuffer.insert_range].
2086func (x *TextBuffer) ConnectInsertText(cb *func(TextBuffer, uintptr, string, int)) uint {
2087 cbPtr := uintptr(unsafe.Pointer(cb))
2088 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2089 handlerID := gobject.SignalConnect(x.GoPointer(), "insert-text", cbRefPtr)
2090 glib.SaveHandlerMapping(handlerID, cbPtr)
2091 return handlerID
2092 }
2093
2094 fcb := func(clsPtr uintptr, LocationVarp uintptr, TextVarp uintptr, LenVarp int) {
2095 fa := TextBuffer{}
2096 fa.Ptr = clsPtr
2097 cbFn := *cb
2098
2099 cbFn(fa, LocationVarp, core.GoString(TextVarp), LenVarp)
2100
2101 }
2102 cbRefPtr := purego.NewCallback(fcb)
2103 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2104 handlerID := gobject.SignalConnect(x.GoPointer(), "insert-text", cbRefPtr)
2105 glib.SaveHandlerMapping(handlerID, cbPtr)
2106 return handlerID
2107}
2108
2109// Emitted as notification after a `GtkTextMark` is deleted.
2110//
2111// See also: [method@Gtk.TextBuffer.delete_mark].
2112func (x *TextBuffer) ConnectMarkDeleted(cb *func(TextBuffer, uintptr)) uint {
2113 cbPtr := uintptr(unsafe.Pointer(cb))
2114 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2115 handlerID := gobject.SignalConnect(x.GoPointer(), "mark-deleted", cbRefPtr)
2116 glib.SaveHandlerMapping(handlerID, cbPtr)
2117 return handlerID
2118 }
2119
2120 fcb := func(clsPtr uintptr, MarkVarp uintptr) {
2121 fa := TextBuffer{}
2122 fa.Ptr = clsPtr
2123 cbFn := *cb
2124
2125 cbFn(fa, MarkVarp)
2126
2127 }
2128 cbRefPtr := purego.NewCallback(fcb)
2129 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2130 handlerID := gobject.SignalConnect(x.GoPointer(), "mark-deleted", cbRefPtr)
2131 glib.SaveHandlerMapping(handlerID, cbPtr)
2132 return handlerID
2133}
2134
2135// Emitted as notification after a `GtkTextMark` is set.
2136//
2137// See also:
2138// [method@Gtk.TextBuffer.create_mark],
2139// [method@Gtk.TextBuffer.move_mark].
2140func (x *TextBuffer) ConnectMarkSet(cb *func(TextBuffer, uintptr, uintptr)) uint {
2141 cbPtr := uintptr(unsafe.Pointer(cb))
2142 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2143 handlerID := gobject.SignalConnect(x.GoPointer(), "mark-set", cbRefPtr)
2144 glib.SaveHandlerMapping(handlerID, cbPtr)
2145 return handlerID
2146 }
2147
2148 fcb := func(clsPtr uintptr, LocationVarp uintptr, MarkVarp uintptr) {
2149 fa := TextBuffer{}
2150 fa.Ptr = clsPtr
2151 cbFn := *cb
2152
2153 cbFn(fa, LocationVarp, MarkVarp)
2154
2155 }
2156 cbRefPtr := purego.NewCallback(fcb)
2157 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2158 handlerID := gobject.SignalConnect(x.GoPointer(), "mark-set", cbRefPtr)
2159 glib.SaveHandlerMapping(handlerID, cbPtr)
2160 return handlerID
2161}
2162
2163// Emitted when the modified bit of a `GtkTextBuffer` flips.
2164//
2165// See also: [method@Gtk.TextBuffer.set_modified].
2166func (x *TextBuffer) ConnectModifiedChanged(cb *func(TextBuffer)) uint {
2167 cbPtr := uintptr(unsafe.Pointer(cb))
2168 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2169 handlerID := gobject.SignalConnect(x.GoPointer(), "modified-changed", cbRefPtr)
2170 glib.SaveHandlerMapping(handlerID, cbPtr)
2171 return handlerID
2172 }
2173
2174 fcb := func(clsPtr uintptr) {
2175 fa := TextBuffer{}
2176 fa.Ptr = clsPtr
2177 cbFn := *cb
2178
2179 cbFn(fa)
2180
2181 }
2182 cbRefPtr := purego.NewCallback(fcb)
2183 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2184 handlerID := gobject.SignalConnect(x.GoPointer(), "modified-changed", cbRefPtr)
2185 glib.SaveHandlerMapping(handlerID, cbPtr)
2186 return handlerID
2187}
2188
2189// Emitted after paste operation has been completed.
2190//
2191// This is useful to properly scroll the view to the end
2192// of the pasted text. See [method@Gtk.TextBuffer.paste_clipboard]
2193// for more details.
2194func (x *TextBuffer) ConnectPasteDone(cb *func(TextBuffer, uintptr)) uint {
2195 cbPtr := uintptr(unsafe.Pointer(cb))
2196 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2197 handlerID := gobject.SignalConnect(x.GoPointer(), "paste-done", cbRefPtr)
2198 glib.SaveHandlerMapping(handlerID, cbPtr)
2199 return handlerID
2200 }
2201
2202 fcb := func(clsPtr uintptr, ClipboardVarp uintptr) {
2203 fa := TextBuffer{}
2204 fa.Ptr = clsPtr
2205 cbFn := *cb
2206
2207 cbFn(fa, ClipboardVarp)
2208
2209 }
2210 cbRefPtr := purego.NewCallback(fcb)
2211 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2212 handlerID := gobject.SignalConnect(x.GoPointer(), "paste-done", cbRefPtr)
2213 glib.SaveHandlerMapping(handlerID, cbPtr)
2214 return handlerID
2215}
2216
2217// Emitted when a request has been made to redo the
2218// previously undone operation.
2219func (x *TextBuffer) ConnectRedo(cb *func(TextBuffer)) uint {
2220 cbPtr := uintptr(unsafe.Pointer(cb))
2221 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2222 handlerID := gobject.SignalConnect(x.GoPointer(), "redo", cbRefPtr)
2223 glib.SaveHandlerMapping(handlerID, cbPtr)
2224 return handlerID
2225 }
2226
2227 fcb := func(clsPtr uintptr) {
2228 fa := TextBuffer{}
2229 fa.Ptr = clsPtr
2230 cbFn := *cb
2231
2232 cbFn(fa)
2233
2234 }
2235 cbRefPtr := purego.NewCallback(fcb)
2236 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2237 handlerID := gobject.SignalConnect(x.GoPointer(), "redo", cbRefPtr)
2238 glib.SaveHandlerMapping(handlerID, cbPtr)
2239 return handlerID
2240}
2241
2242// Emitted to remove all occurrences of @tag from a range
2243// of text in a `GtkTextBuffer`.
2244//
2245// Removal actually occurs in the default handler.
2246//
2247// Note that if your handler runs before the default handler
2248// it must not invalidate the @start and @end iters (or has
2249// to revalidate them).
2250//
2251// See also: [method@Gtk.TextBuffer.remove_tag].
2252func (x *TextBuffer) ConnectRemoveTag(cb *func(TextBuffer, uintptr, uintptr, uintptr)) uint {
2253 cbPtr := uintptr(unsafe.Pointer(cb))
2254 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2255 handlerID := gobject.SignalConnect(x.GoPointer(), "remove-tag", cbRefPtr)
2256 glib.SaveHandlerMapping(handlerID, cbPtr)
2257 return handlerID
2258 }
2259
2260 fcb := func(clsPtr uintptr, TagVarp uintptr, StartVarp uintptr, EndVarp uintptr) {
2261 fa := TextBuffer{}
2262 fa.Ptr = clsPtr
2263 cbFn := *cb
2264
2265 cbFn(fa, TagVarp, StartVarp, EndVarp)
2266
2267 }
2268 cbRefPtr := purego.NewCallback(fcb)
2269 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2270 handlerID := gobject.SignalConnect(x.GoPointer(), "remove-tag", cbRefPtr)
2271 glib.SaveHandlerMapping(handlerID, cbPtr)
2272 return handlerID
2273}
2274
2275// Emitted when a request has been made to undo the
2276// previous operation or set of operations that have
2277// been grouped together.
2278func (x *TextBuffer) ConnectUndo(cb *func(TextBuffer)) uint {
2279 cbPtr := uintptr(unsafe.Pointer(cb))
2280 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2281 handlerID := gobject.SignalConnect(x.GoPointer(), "undo", cbRefPtr)
2282 glib.SaveHandlerMapping(handlerID, cbPtr)
2283 return handlerID
2284 }
2285
2286 fcb := func(clsPtr uintptr) {
2287 fa := TextBuffer{}
2288 fa.Ptr = clsPtr
2289 cbFn := *cb
2290
2291 cbFn(fa)
2292
2293 }
2294 cbRefPtr := purego.NewCallback(fcb)
2295 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2296 handlerID := gobject.SignalConnect(x.GoPointer(), "undo", cbRefPtr)
2297 glib.SaveHandlerMapping(handlerID, cbPtr)
2298 return handlerID
2299}
2300
2301func init() {
2302 core.SetPackageName("GTK", "gtk4")
2303 core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"})
2304 var libs []uintptr
2305 for _, libPath := range core.GetPaths("GTK") {
2306 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
2307 if err != nil {
2308 panic(err)
2309 }
2310 libs = append(libs, lib)
2311 }
2312
2313 core.PuregoSafeRegister(&xTextBufferGLibType, libs, "gtk_text_buffer_get_type")
2314
2315 core.PuregoSafeRegister(&xNewTextBuffer, libs, "gtk_text_buffer_new")
2316
2317 core.PuregoSafeRegister(&xTextBufferAddCommitNotify, libs, "gtk_text_buffer_add_commit_notify")
2318 core.PuregoSafeRegister(&xTextBufferAddMark, libs, "gtk_text_buffer_add_mark")
2319 core.PuregoSafeRegister(&xTextBufferAddSelectionClipboard, libs, "gtk_text_buffer_add_selection_clipboard")
2320 core.PuregoSafeRegister(&xTextBufferApplyTag, libs, "gtk_text_buffer_apply_tag")
2321 core.PuregoSafeRegister(&xTextBufferApplyTagByName, libs, "gtk_text_buffer_apply_tag_by_name")
2322 core.PuregoSafeRegister(&xTextBufferBackspace, libs, "gtk_text_buffer_backspace")
2323 core.PuregoSafeRegister(&xTextBufferBeginIrreversibleAction, libs, "gtk_text_buffer_begin_irreversible_action")
2324 core.PuregoSafeRegister(&xTextBufferBeginUserAction, libs, "gtk_text_buffer_begin_user_action")
2325 core.PuregoSafeRegister(&xTextBufferCopyClipboard, libs, "gtk_text_buffer_copy_clipboard")
2326 core.PuregoSafeRegister(&xTextBufferCreateChildAnchor, libs, "gtk_text_buffer_create_child_anchor")
2327 core.PuregoSafeRegister(&xTextBufferCreateMark, libs, "gtk_text_buffer_create_mark")
2328 core.PuregoSafeRegister(&xTextBufferCreateTag, libs, "gtk_text_buffer_create_tag")
2329 core.PuregoSafeRegister(&xTextBufferCutClipboard, libs, "gtk_text_buffer_cut_clipboard")
2330 core.PuregoSafeRegister(&xTextBufferDelete, libs, "gtk_text_buffer_delete")
2331 core.PuregoSafeRegister(&xTextBufferDeleteInteractive, libs, "gtk_text_buffer_delete_interactive")
2332 core.PuregoSafeRegister(&xTextBufferDeleteMark, libs, "gtk_text_buffer_delete_mark")
2333 core.PuregoSafeRegister(&xTextBufferDeleteMarkByName, libs, "gtk_text_buffer_delete_mark_by_name")
2334 core.PuregoSafeRegister(&xTextBufferDeleteSelection, libs, "gtk_text_buffer_delete_selection")
2335 core.PuregoSafeRegister(&xTextBufferEndIrreversibleAction, libs, "gtk_text_buffer_end_irreversible_action")
2336 core.PuregoSafeRegister(&xTextBufferEndUserAction, libs, "gtk_text_buffer_end_user_action")
2337 core.PuregoSafeRegister(&xTextBufferGetBounds, libs, "gtk_text_buffer_get_bounds")
2338 core.PuregoSafeRegister(&xTextBufferGetCanRedo, libs, "gtk_text_buffer_get_can_redo")
2339 core.PuregoSafeRegister(&xTextBufferGetCanUndo, libs, "gtk_text_buffer_get_can_undo")
2340 core.PuregoSafeRegister(&xTextBufferGetCharCount, libs, "gtk_text_buffer_get_char_count")
2341 core.PuregoSafeRegister(&xTextBufferGetEnableUndo, libs, "gtk_text_buffer_get_enable_undo")
2342 core.PuregoSafeRegister(&xTextBufferGetEndIter, libs, "gtk_text_buffer_get_end_iter")
2343 core.PuregoSafeRegister(&xTextBufferGetHasSelection, libs, "gtk_text_buffer_get_has_selection")
2344 core.PuregoSafeRegister(&xTextBufferGetInsert, libs, "gtk_text_buffer_get_insert")
2345 core.PuregoSafeRegister(&xTextBufferGetIterAtChildAnchor, libs, "gtk_text_buffer_get_iter_at_child_anchor")
2346 core.PuregoSafeRegister(&xTextBufferGetIterAtLine, libs, "gtk_text_buffer_get_iter_at_line")
2347 core.PuregoSafeRegister(&xTextBufferGetIterAtLineIndex, libs, "gtk_text_buffer_get_iter_at_line_index")
2348 core.PuregoSafeRegister(&xTextBufferGetIterAtLineOffset, libs, "gtk_text_buffer_get_iter_at_line_offset")
2349 core.PuregoSafeRegister(&xTextBufferGetIterAtMark, libs, "gtk_text_buffer_get_iter_at_mark")
2350 core.PuregoSafeRegister(&xTextBufferGetIterAtOffset, libs, "gtk_text_buffer_get_iter_at_offset")
2351 core.PuregoSafeRegister(&xTextBufferGetLineCount, libs, "gtk_text_buffer_get_line_count")
2352 core.PuregoSafeRegister(&xTextBufferGetMark, libs, "gtk_text_buffer_get_mark")
2353 core.PuregoSafeRegister(&xTextBufferGetMaxUndoLevels, libs, "gtk_text_buffer_get_max_undo_levels")
2354 core.PuregoSafeRegister(&xTextBufferGetModified, libs, "gtk_text_buffer_get_modified")
2355 core.PuregoSafeRegister(&xTextBufferGetSelectionBound, libs, "gtk_text_buffer_get_selection_bound")
2356 core.PuregoSafeRegister(&xTextBufferGetSelectionBounds, libs, "gtk_text_buffer_get_selection_bounds")
2357 core.PuregoSafeRegister(&xTextBufferGetSelectionContent, libs, "gtk_text_buffer_get_selection_content")
2358 core.PuregoSafeRegister(&xTextBufferGetSlice, libs, "gtk_text_buffer_get_slice")
2359 core.PuregoSafeRegister(&xTextBufferGetStartIter, libs, "gtk_text_buffer_get_start_iter")
2360 core.PuregoSafeRegister(&xTextBufferGetTagTable, libs, "gtk_text_buffer_get_tag_table")
2361 core.PuregoSafeRegister(&xTextBufferGetText, libs, "gtk_text_buffer_get_text")
2362 core.PuregoSafeRegister(&xTextBufferInsert, libs, "gtk_text_buffer_insert")
2363 core.PuregoSafeRegister(&xTextBufferInsertAtCursor, libs, "gtk_text_buffer_insert_at_cursor")
2364 core.PuregoSafeRegister(&xTextBufferInsertChildAnchor, libs, "gtk_text_buffer_insert_child_anchor")
2365 core.PuregoSafeRegister(&xTextBufferInsertInteractive, libs, "gtk_text_buffer_insert_interactive")
2366 core.PuregoSafeRegister(&xTextBufferInsertInteractiveAtCursor, libs, "gtk_text_buffer_insert_interactive_at_cursor")
2367 core.PuregoSafeRegister(&xTextBufferInsertMarkup, libs, "gtk_text_buffer_insert_markup")
2368 core.PuregoSafeRegister(&xTextBufferInsertPaintable, libs, "gtk_text_buffer_insert_paintable")
2369 core.PuregoSafeRegister(&xTextBufferInsertRange, libs, "gtk_text_buffer_insert_range")
2370 core.PuregoSafeRegister(&xTextBufferInsertRangeInteractive, libs, "gtk_text_buffer_insert_range_interactive")
2371 core.PuregoSafeRegister(&xTextBufferInsertWithTags, libs, "gtk_text_buffer_insert_with_tags")
2372 core.PuregoSafeRegister(&xTextBufferInsertWithTagsByName, libs, "gtk_text_buffer_insert_with_tags_by_name")
2373 core.PuregoSafeRegister(&xTextBufferMoveMark, libs, "gtk_text_buffer_move_mark")
2374 core.PuregoSafeRegister(&xTextBufferMoveMarkByName, libs, "gtk_text_buffer_move_mark_by_name")
2375 core.PuregoSafeRegister(&xTextBufferPasteClipboard, libs, "gtk_text_buffer_paste_clipboard")
2376 core.PuregoSafeRegister(&xTextBufferPlaceCursor, libs, "gtk_text_buffer_place_cursor")
2377 core.PuregoSafeRegister(&xTextBufferRedo, libs, "gtk_text_buffer_redo")
2378 core.PuregoSafeRegister(&xTextBufferRemoveAllTags, libs, "gtk_text_buffer_remove_all_tags")
2379 core.PuregoSafeRegister(&xTextBufferRemoveCommitNotify, libs, "gtk_text_buffer_remove_commit_notify")
2380 core.PuregoSafeRegister(&xTextBufferRemoveSelectionClipboard, libs, "gtk_text_buffer_remove_selection_clipboard")
2381 core.PuregoSafeRegister(&xTextBufferRemoveTag, libs, "gtk_text_buffer_remove_tag")
2382 core.PuregoSafeRegister(&xTextBufferRemoveTagByName, libs, "gtk_text_buffer_remove_tag_by_name")
2383 core.PuregoSafeRegister(&xTextBufferSelectRange, libs, "gtk_text_buffer_select_range")
2384 core.PuregoSafeRegister(&xTextBufferSetEnableUndo, libs, "gtk_text_buffer_set_enable_undo")
2385 core.PuregoSafeRegister(&xTextBufferSetMaxUndoLevels, libs, "gtk_text_buffer_set_max_undo_levels")
2386 core.PuregoSafeRegister(&xTextBufferSetModified, libs, "gtk_text_buffer_set_modified")
2387 core.PuregoSafeRegister(&xTextBufferSetText, libs, "gtk_text_buffer_set_text")
2388 core.PuregoSafeRegister(&xTextBufferUndo, libs, "gtk_text_buffer_undo")
2389
2390}