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/gio"
13 "github.com/bnema/puregotk/v4/glib"
14 "github.com/bnema/puregotk/v4/gobject"
15 "github.com/bnema/puregotk/v4/gobject/types"
16 "github.com/bnema/puregotk/v4/pango"
17)
18
19type TextViewClass struct {
20 _ structs.HostLayout
21
22 ParentClass WidgetClass
23
24 xMoveCursor uintptr
25
26 xSetAnchor uintptr
27
28 xInsertAtCursor uintptr
29
30 xDeleteFromCursor uintptr
31
32 xBackspace uintptr
33
34 xCutClipboard uintptr
35
36 xCopyClipboard uintptr
37
38 xPasteClipboard uintptr
39
40 xToggleOverwrite uintptr
41
42 xCreateBuffer uintptr
43
44 xSnapshotLayer uintptr
45
46 xExtendSelection uintptr
47
48 xInsertEmoji uintptr
49
50 Padding [8]uintptr
51}
52
53func (x *TextViewClass) GoPointer() uintptr {
54 return uintptr(unsafe.Pointer(x))
55}
56
57// OverrideMoveCursor sets the "move_cursor" callback function.
58// The class handler for the `GtkTextView::move-cursor`
59//
60// keybinding signal.
61func (x *TextViewClass) OverrideMoveCursor(cb func(*TextView, MovementStep, int, bool)) {
62 if cb == nil {
63 x.xMoveCursor = 0
64 } else {
65 x.xMoveCursor = purego.NewCallback(func(TextViewVarp uintptr, StepVarp MovementStep, CountVarp int, ExtendSelectionVarp bool) {
66 cb(TextViewNewFromInternalPtr(TextViewVarp), StepVarp, CountVarp, ExtendSelectionVarp)
67 })
68 }
69}
70
71// GetMoveCursor gets the "move_cursor" callback function.
72// The class handler for the `GtkTextView::move-cursor`
73//
74// keybinding signal.
75func (x *TextViewClass) GetMoveCursor() func(*TextView, MovementStep, int, bool) {
76 if x.xMoveCursor == 0 {
77 return nil
78 }
79 var rawCallback func(TextViewVarp uintptr, StepVarp MovementStep, CountVarp int, ExtendSelectionVarp bool)
80 purego.RegisterFunc(&rawCallback, x.xMoveCursor)
81 return func(TextViewVar *TextView, StepVar MovementStep, CountVar int, ExtendSelectionVar bool) {
82 rawCallback(TextViewVar.GoPointer(), StepVar, CountVar, ExtendSelectionVar)
83 }
84}
85
86// OverrideSetAnchor sets the "set_anchor" callback function.
87// The class handler for the `GtkTextView::set-anchor`
88//
89// keybinding signal.
90func (x *TextViewClass) OverrideSetAnchor(cb func(*TextView)) {
91 if cb == nil {
92 x.xSetAnchor = 0
93 } else {
94 x.xSetAnchor = purego.NewCallback(func(TextViewVarp uintptr) {
95 cb(TextViewNewFromInternalPtr(TextViewVarp))
96 })
97 }
98}
99
100// GetSetAnchor gets the "set_anchor" callback function.
101// The class handler for the `GtkTextView::set-anchor`
102//
103// keybinding signal.
104func (x *TextViewClass) GetSetAnchor() func(*TextView) {
105 if x.xSetAnchor == 0 {
106 return nil
107 }
108 var rawCallback func(TextViewVarp uintptr)
109 purego.RegisterFunc(&rawCallback, x.xSetAnchor)
110 return func(TextViewVar *TextView) {
111 rawCallback(TextViewVar.GoPointer())
112 }
113}
114
115// OverrideInsertAtCursor sets the "insert_at_cursor" callback function.
116// The class handler for the `GtkTextView::insert-at-cursor`
117//
118// keybinding signal.
119func (x *TextViewClass) OverrideInsertAtCursor(cb func(*TextView, string)) {
120 if cb == nil {
121 x.xInsertAtCursor = 0
122 } else {
123 x.xInsertAtCursor = purego.NewCallback(func(TextViewVarp uintptr, StrVarp string) {
124 cb(TextViewNewFromInternalPtr(TextViewVarp), StrVarp)
125 })
126 }
127}
128
129// GetInsertAtCursor gets the "insert_at_cursor" callback function.
130// The class handler for the `GtkTextView::insert-at-cursor`
131//
132// keybinding signal.
133func (x *TextViewClass) GetInsertAtCursor() func(*TextView, string) {
134 if x.xInsertAtCursor == 0 {
135 return nil
136 }
137 var rawCallback func(TextViewVarp uintptr, StrVarp string)
138 purego.RegisterFunc(&rawCallback, x.xInsertAtCursor)
139 return func(TextViewVar *TextView, StrVar string) {
140 rawCallback(TextViewVar.GoPointer(), StrVar)
141 }
142}
143
144// OverrideDeleteFromCursor sets the "delete_from_cursor" callback function.
145// The class handler for the `GtkTextView::delete-from-cursor`
146//
147// keybinding signal.
148func (x *TextViewClass) OverrideDeleteFromCursor(cb func(*TextView, DeleteType, int)) {
149 if cb == nil {
150 x.xDeleteFromCursor = 0
151 } else {
152 x.xDeleteFromCursor = purego.NewCallback(func(TextViewVarp uintptr, TypeVarp DeleteType, CountVarp int) {
153 cb(TextViewNewFromInternalPtr(TextViewVarp), TypeVarp, CountVarp)
154 })
155 }
156}
157
158// GetDeleteFromCursor gets the "delete_from_cursor" callback function.
159// The class handler for the `GtkTextView::delete-from-cursor`
160//
161// keybinding signal.
162func (x *TextViewClass) GetDeleteFromCursor() func(*TextView, DeleteType, int) {
163 if x.xDeleteFromCursor == 0 {
164 return nil
165 }
166 var rawCallback func(TextViewVarp uintptr, TypeVarp DeleteType, CountVarp int)
167 purego.RegisterFunc(&rawCallback, x.xDeleteFromCursor)
168 return func(TextViewVar *TextView, TypeVar DeleteType, CountVar int) {
169 rawCallback(TextViewVar.GoPointer(), TypeVar, CountVar)
170 }
171}
172
173// OverrideBackspace sets the "backspace" callback function.
174// The class handler for the `GtkTextView::backspace`
175//
176// keybinding signal.
177func (x *TextViewClass) OverrideBackspace(cb func(*TextView)) {
178 if cb == nil {
179 x.xBackspace = 0
180 } else {
181 x.xBackspace = purego.NewCallback(func(TextViewVarp uintptr) {
182 cb(TextViewNewFromInternalPtr(TextViewVarp))
183 })
184 }
185}
186
187// GetBackspace gets the "backspace" callback function.
188// The class handler for the `GtkTextView::backspace`
189//
190// keybinding signal.
191func (x *TextViewClass) GetBackspace() func(*TextView) {
192 if x.xBackspace == 0 {
193 return nil
194 }
195 var rawCallback func(TextViewVarp uintptr)
196 purego.RegisterFunc(&rawCallback, x.xBackspace)
197 return func(TextViewVar *TextView) {
198 rawCallback(TextViewVar.GoPointer())
199 }
200}
201
202// OverrideCutClipboard sets the "cut_clipboard" callback function.
203// The class handler for the `GtkTextView::cut-clipboard`
204//
205// keybinding signal
206func (x *TextViewClass) OverrideCutClipboard(cb func(*TextView)) {
207 if cb == nil {
208 x.xCutClipboard = 0
209 } else {
210 x.xCutClipboard = purego.NewCallback(func(TextViewVarp uintptr) {
211 cb(TextViewNewFromInternalPtr(TextViewVarp))
212 })
213 }
214}
215
216// GetCutClipboard gets the "cut_clipboard" callback function.
217// The class handler for the `GtkTextView::cut-clipboard`
218//
219// keybinding signal
220func (x *TextViewClass) GetCutClipboard() func(*TextView) {
221 if x.xCutClipboard == 0 {
222 return nil
223 }
224 var rawCallback func(TextViewVarp uintptr)
225 purego.RegisterFunc(&rawCallback, x.xCutClipboard)
226 return func(TextViewVar *TextView) {
227 rawCallback(TextViewVar.GoPointer())
228 }
229}
230
231// OverrideCopyClipboard sets the "copy_clipboard" callback function.
232// The class handler for the `GtkTextView::copy-clipboard`
233//
234// keybinding signal.
235func (x *TextViewClass) OverrideCopyClipboard(cb func(*TextView)) {
236 if cb == nil {
237 x.xCopyClipboard = 0
238 } else {
239 x.xCopyClipboard = purego.NewCallback(func(TextViewVarp uintptr) {
240 cb(TextViewNewFromInternalPtr(TextViewVarp))
241 })
242 }
243}
244
245// GetCopyClipboard gets the "copy_clipboard" callback function.
246// The class handler for the `GtkTextView::copy-clipboard`
247//
248// keybinding signal.
249func (x *TextViewClass) GetCopyClipboard() func(*TextView) {
250 if x.xCopyClipboard == 0 {
251 return nil
252 }
253 var rawCallback func(TextViewVarp uintptr)
254 purego.RegisterFunc(&rawCallback, x.xCopyClipboard)
255 return func(TextViewVar *TextView) {
256 rawCallback(TextViewVar.GoPointer())
257 }
258}
259
260// OverridePasteClipboard sets the "paste_clipboard" callback function.
261// The class handler for the `GtkTextView::paste-clipboard`
262//
263// keybinding signal.
264func (x *TextViewClass) OverridePasteClipboard(cb func(*TextView)) {
265 if cb == nil {
266 x.xPasteClipboard = 0
267 } else {
268 x.xPasteClipboard = purego.NewCallback(func(TextViewVarp uintptr) {
269 cb(TextViewNewFromInternalPtr(TextViewVarp))
270 })
271 }
272}
273
274// GetPasteClipboard gets the "paste_clipboard" callback function.
275// The class handler for the `GtkTextView::paste-clipboard`
276//
277// keybinding signal.
278func (x *TextViewClass) GetPasteClipboard() func(*TextView) {
279 if x.xPasteClipboard == 0 {
280 return nil
281 }
282 var rawCallback func(TextViewVarp uintptr)
283 purego.RegisterFunc(&rawCallback, x.xPasteClipboard)
284 return func(TextViewVar *TextView) {
285 rawCallback(TextViewVar.GoPointer())
286 }
287}
288
289// OverrideToggleOverwrite sets the "toggle_overwrite" callback function.
290// The class handler for the `GtkTextView::toggle-overwrite`
291//
292// keybinding signal.
293func (x *TextViewClass) OverrideToggleOverwrite(cb func(*TextView)) {
294 if cb == nil {
295 x.xToggleOverwrite = 0
296 } else {
297 x.xToggleOverwrite = purego.NewCallback(func(TextViewVarp uintptr) {
298 cb(TextViewNewFromInternalPtr(TextViewVarp))
299 })
300 }
301}
302
303// GetToggleOverwrite gets the "toggle_overwrite" callback function.
304// The class handler for the `GtkTextView::toggle-overwrite`
305//
306// keybinding signal.
307func (x *TextViewClass) GetToggleOverwrite() func(*TextView) {
308 if x.xToggleOverwrite == 0 {
309 return nil
310 }
311 var rawCallback func(TextViewVarp uintptr)
312 purego.RegisterFunc(&rawCallback, x.xToggleOverwrite)
313 return func(TextViewVar *TextView) {
314 rawCallback(TextViewVar.GoPointer())
315 }
316}
317
318// OverrideCreateBuffer sets the "create_buffer" callback function.
319// The create_buffer vfunc is called to create a `GtkTextBuffer`
320//
321// for the text view. The default implementation is to just call
322// gtk_text_buffer_new().
323func (x *TextViewClass) OverrideCreateBuffer(cb func(*TextView) *TextBuffer) {
324 if cb == nil {
325 x.xCreateBuffer = 0
326 } else {
327 x.xCreateBuffer = purego.NewCallback(func(TextViewVarp uintptr) uintptr {
328 ret := cb(TextViewNewFromInternalPtr(TextViewVarp))
329 if ret == nil {
330 return 0
331 }
332 return ret.GoPointer()
333 })
334 }
335}
336
337// GetCreateBuffer gets the "create_buffer" callback function.
338// The create_buffer vfunc is called to create a `GtkTextBuffer`
339//
340// for the text view. The default implementation is to just call
341// gtk_text_buffer_new().
342func (x *TextViewClass) GetCreateBuffer() func(*TextView) *TextBuffer {
343 if x.xCreateBuffer == 0 {
344 return nil
345 }
346 var rawCallback func(TextViewVarp uintptr) uintptr
347 purego.RegisterFunc(&rawCallback, x.xCreateBuffer)
348 return func(TextViewVar *TextView) *TextBuffer {
349 rawRet := rawCallback(TextViewVar.GoPointer())
350 if rawRet == 0 {
351 return nil
352 }
353 ret := &TextBuffer{}
354 ret.Ptr = rawRet
355 return ret
356 }
357}
358
359// OverrideSnapshotLayer sets the "snapshot_layer" callback function.
360// The snapshot_layer vfunc is called before and after the text
361//
362// view is drawing its own text. Applications can override this vfunc
363// in a subclass to draw customized content underneath or above the
364// text. In the %GTK_TEXT_VIEW_LAYER_BELOW_TEXT and %GTK_TEXT_VIEW_LAYER_ABOVE_TEXT
365// layers the drawing is done in the buffer coordinate space.
366func (x *TextViewClass) OverrideSnapshotLayer(cb func(*TextView, TextViewLayer, *Snapshot)) {
367 if cb == nil {
368 x.xSnapshotLayer = 0
369 } else {
370 x.xSnapshotLayer = purego.NewCallback(func(TextViewVarp uintptr, LayerVarp TextViewLayer, SnapshotVarp uintptr) {
371 cb(TextViewNewFromInternalPtr(TextViewVarp), LayerVarp, SnapshotNewFromInternalPtr(SnapshotVarp))
372 })
373 }
374}
375
376// GetSnapshotLayer gets the "snapshot_layer" callback function.
377// The snapshot_layer vfunc is called before and after the text
378//
379// view is drawing its own text. Applications can override this vfunc
380// in a subclass to draw customized content underneath or above the
381// text. In the %GTK_TEXT_VIEW_LAYER_BELOW_TEXT and %GTK_TEXT_VIEW_LAYER_ABOVE_TEXT
382// layers the drawing is done in the buffer coordinate space.
383func (x *TextViewClass) GetSnapshotLayer() func(*TextView, TextViewLayer, *Snapshot) {
384 if x.xSnapshotLayer == 0 {
385 return nil
386 }
387 var rawCallback func(TextViewVarp uintptr, LayerVarp TextViewLayer, SnapshotVarp uintptr)
388 purego.RegisterFunc(&rawCallback, x.xSnapshotLayer)
389 return func(TextViewVar *TextView, LayerVar TextViewLayer, SnapshotVar *Snapshot) {
390 rawCallback(TextViewVar.GoPointer(), LayerVar, SnapshotVar.GoPointer())
391 }
392}
393
394// OverrideExtendSelection sets the "extend_selection" callback function.
395// The class handler for the `GtkTextView::extend-selection` signal.
396func (x *TextViewClass) OverrideExtendSelection(cb func(*TextView, TextExtendSelection, *TextIter, *TextIter, *TextIter) bool) {
397 if cb == nil {
398 x.xExtendSelection = 0
399 } else {
400 x.xExtendSelection = purego.NewCallback(func(TextViewVarp uintptr, GranularityVarp TextExtendSelection, LocationVarp *TextIter, StartVarp *TextIter, EndVarp *TextIter) bool {
401 return cb(TextViewNewFromInternalPtr(TextViewVarp), GranularityVarp, LocationVarp, StartVarp, EndVarp)
402 })
403 }
404}
405
406// GetExtendSelection gets the "extend_selection" callback function.
407// The class handler for the `GtkTextView::extend-selection` signal.
408func (x *TextViewClass) GetExtendSelection() func(*TextView, TextExtendSelection, *TextIter, *TextIter, *TextIter) bool {
409 if x.xExtendSelection == 0 {
410 return nil
411 }
412 var rawCallback func(TextViewVarp uintptr, GranularityVarp TextExtendSelection, LocationVarp *TextIter, StartVarp *TextIter, EndVarp *TextIter) bool
413 purego.RegisterFunc(&rawCallback, x.xExtendSelection)
414 return func(TextViewVar *TextView, GranularityVar TextExtendSelection, LocationVar *TextIter, StartVar *TextIter, EndVar *TextIter) bool {
415 return rawCallback(TextViewVar.GoPointer(), GranularityVar, LocationVar, StartVar, EndVar)
416 }
417}
418
419// OverrideInsertEmoji sets the "insert_emoji" callback function.
420// The class handler for the `GtkTextView::insert-emoji` signal.
421func (x *TextViewClass) OverrideInsertEmoji(cb func(*TextView)) {
422 if cb == nil {
423 x.xInsertEmoji = 0
424 } else {
425 x.xInsertEmoji = purego.NewCallback(func(TextViewVarp uintptr) {
426 cb(TextViewNewFromInternalPtr(TextViewVarp))
427 })
428 }
429}
430
431// GetInsertEmoji gets the "insert_emoji" callback function.
432// The class handler for the `GtkTextView::insert-emoji` signal.
433func (x *TextViewClass) GetInsertEmoji() func(*TextView) {
434 if x.xInsertEmoji == 0 {
435 return nil
436 }
437 var rawCallback func(TextViewVarp uintptr)
438 purego.RegisterFunc(&rawCallback, x.xInsertEmoji)
439 return func(TextViewVar *TextView) {
440 rawCallback(TextViewVar.GoPointer())
441 }
442}
443
444type TextViewPrivate struct {
445 _ structs.HostLayout
446}
447
448func (x *TextViewPrivate) GoPointer() uintptr {
449 return uintptr(unsafe.Pointer(x))
450}
451
452const (
453 // The priority at which the text view validates onscreen lines
454 // in an idle job in the background.
455 TEXT_VIEW_PRIORITY_VALIDATE int = 125
456)
457
458// Granularity types that extend the text selection. Use the
459// `GtkTextView::extend-selection` signal to customize the selection.
460type TextExtendSelection int
461
462var xTextExtendSelectionGLibType func() types.GType
463
464func TextExtendSelectionGLibType() types.GType {
465 return xTextExtendSelectionGLibType()
466}
467
468const (
469
470 // Selects the current word. It is triggered by
471 // a double-click for example.
472 TextExtendSelectionWordValue TextExtendSelection = 0
473 // Selects the current line. It is triggered by
474 // a triple-click for example.
475 TextExtendSelectionLineValue TextExtendSelection = 1
476)
477
478// Used to reference the layers of `GtkTextView` for the purpose of customized
479// drawing with the ::snapshot_layer vfunc.
480type TextViewLayer int
481
482var xTextViewLayerGLibType func() types.GType
483
484func TextViewLayerGLibType() types.GType {
485 return xTextViewLayerGLibType()
486}
487
488const (
489
490 // The layer rendered below the text (but above the background).
491 TextViewLayerBelowTextValue TextViewLayer = 0
492 // The layer rendered above the text.
493 TextViewLayerAboveTextValue TextViewLayer = 1
494)
495
496// Used to reference the parts of `GtkTextView`.
497type TextWindowType int
498
499var xTextWindowTypeGLibType func() types.GType
500
501func TextWindowTypeGLibType() types.GType {
502 return xTextWindowTypeGLibType()
503}
504
505const (
506
507 // Window that floats over scrolling areas.
508 TextWindowWidgetValue TextWindowType = 1
509 // Scrollable text window.
510 TextWindowTextValue TextWindowType = 2
511 // Left side border window.
512 TextWindowLeftValue TextWindowType = 3
513 // Right side border window.
514 TextWindowRightValue TextWindowType = 4
515 // Top border window.
516 TextWindowTopValue TextWindowType = 5
517 // Bottom border window.
518 TextWindowBottomValue TextWindowType = 6
519)
520
521// Displays the contents of a [class@Gtk.TextBuffer].
522//
523// <picture>
524//
525// <source srcset="multiline-text-dark.png" media="(prefers-color-scheme: dark)">
526// <img alt="An example GtkTextView" src="multiline-text.png">
527//
528// </picture>
529//
530// You may wish to begin by reading the [conceptual overview](section-text-widget.html),
531// which gives an overview of all the objects and data types related to the
532// text widget and how they work together.
533//
534// ## Shortcuts and Gestures
535//
536// `GtkTextView` supports the following keyboard shortcuts:
537//
538// - <kbd>Shift</kbd>+<kbd>F10</kbd> or <kbd>Menu</kbd> opens the context menu.
539// - <kbd>Ctrl</kbd>+<kbd>Z</kbd> undoes the last modification.
540// - <kbd>Ctrl</kbd>+<kbd>Y</kbd> or <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>Z</kbd>
541// redoes the last undone modification.
542// - <kbd>Clear</kbd> clears the content.
543//
544// Additionally, the following signals have default keybindings:
545//
546// - [signal@Gtk.TextView::backspace]
547// - [signal@Gtk.TextView::copy-clipboard]
548// - [signal@Gtk.TextView::cut-clipboard]
549// - [signal@Gtk.TextView::delete-from-cursor]
550// - [signal@Gtk.TextView::insert-emoji]
551// - [signal@Gtk.TextView::move-cursor]
552// - [signal@Gtk.TextView::paste-clipboard]
553// - [signal@Gtk.TextView::select-all]
554// - [signal@Gtk.TextView::toggle-cursor-visible]
555// - [signal@Gtk.TextView::toggle-overwrite]
556//
557// ## Actions
558//
559// `GtkTextView` defines a set of built-in actions:
560//
561// - `clipboard.copy` copies the contents to the clipboard.
562// - `clipboard.cut` copies the contents to the clipboard and deletes it from
563// the widget.
564// - `clipboard.paste` inserts the contents of the clipboard into the widget.
565// - `menu.popup` opens the context menu.
566// - `misc.insert-emoji` opens the Emoji chooser.
567// - `selection.delete` deletes the current selection.
568// - `selection.select-all` selects all of the widgets content.
569// - `text.redo` redoes the last change to the contents.
570// - `text.undo` undoes the last change to the contents.
571// - `text.clear` clears the content.
572//
573// ## CSS nodes
574//
575// ```
576// textview.view
577// ├── border.top
578// ├── border.left
579// ├── text
580// │ ╰── [selection]
581// ├── border.right
582// ├── border.bottom
583// ╰── [window.popup]
584// ```
585//
586// `GtkTextView` has a main css node with name textview and style class .view,
587// and subnodes for each of the border windows, and the main text area,
588// with names border and text, respectively. The border nodes each get
589// one of the style classes .left, .right, .top or .bottom.
590//
591// A node representing the selection will appear below the text node.
592//
593// If a context menu is opened, the window node will appear as a subnode
594// of the main node.
595//
596// ## Accessibility
597//
598// `GtkTextView` uses the [enum@Gtk.AccessibleRole.text_box] role.
599type TextView struct {
600 Widget
601}
602
603var xTextViewGLibType func() types.GType
604
605func TextViewGLibType() types.GType {
606 return xTextViewGLibType()
607}
608
609func TextViewNewFromInternalPtr(ptr uintptr) *TextView {
610 cls := &TextView{}
611 cls.Ptr = ptr
612 return cls
613}
614
615var xNewTextView func() uintptr
616
617// Creates a new `GtkTextView`.
618//
619// If you don’t call [method@Gtk.TextView.set_buffer] before using the
620// text view, an empty default buffer will be created for you. Get the
621// buffer with [method@Gtk.TextView.get_buffer]. If you want to specify
622// your own buffer, consider [ctor@Gtk.TextView.new_with_buffer].
623func NewTextView() *TextView {
624 var cls *TextView
625
626 cret := xNewTextView()
627
628 if cret == 0 {
629 return nil
630 }
631 gobject.IncreaseRef(cret)
632 cls = &TextView{}
633 cls.Ptr = cret
634 return cls
635}
636
637var xNewTextViewWithBuffer func(uintptr) uintptr
638
639// Creates a new `GtkTextView` widget displaying the buffer @buffer.
640//
641// One buffer can be shared among many widgets. @buffer may be %NULL
642// to create a default buffer, in which case this function is equivalent
643// to [ctor@Gtk.TextView.new]. The text view adds its own reference count
644// to the buffer; it does not take over an existing reference.
645func NewTextViewWithBuffer(BufferVar *TextBuffer) *TextView {
646 var cls *TextView
647
648 cret := xNewTextViewWithBuffer(BufferVar.GoPointer())
649
650 if cret == 0 {
651 return nil
652 }
653 gobject.IncreaseRef(cret)
654 cls = &TextView{}
655 cls.Ptr = cret
656 return cls
657}
658
659var xTextViewAddChildAtAnchor func(uintptr, uintptr, uintptr)
660
661// Adds a child widget in the text buffer, at the given @anchor.
662func (x *TextView) AddChildAtAnchor(ChildVar *Widget, AnchorVar *TextChildAnchor) {
663
664 xTextViewAddChildAtAnchor(x.GoPointer(), ChildVar.GoPointer(), AnchorVar.GoPointer())
665
666}
667
668var xTextViewAddOverlay func(uintptr, uintptr, int, int)
669
670// Adds @child at a fixed coordinate in the `GtkTextView`'s text window.
671//
672// The @xpos and @ypos must be in buffer coordinates (see
673// [method@Gtk.TextView.get_iter_location] to convert to
674// buffer coordinates).
675//
676// @child will scroll with the text view.
677//
678// If instead you want a widget that will not move with the
679// `GtkTextView` contents see `GtkOverlay`.
680func (x *TextView) AddOverlay(ChildVar *Widget, XposVar int, YposVar int) {
681
682 xTextViewAddOverlay(x.GoPointer(), ChildVar.GoPointer(), XposVar, YposVar)
683
684}
685
686var xTextViewBackwardDisplayLine func(uintptr, *TextIter) bool
687
688// Moves the given @iter backward by one display (wrapped) line.
689//
690// A display line is different from a paragraph. Paragraphs are
691// separated by newlines or other paragraph separator characters.
692// Display lines are created by line-wrapping a paragraph. If
693// wrapping is turned off, display lines and paragraphs will be the
694// same. Display lines are divided differently for each view, since
695// they depend on the view’s width; paragraphs are the same in all
696// views, since they depend on the contents of the `GtkTextBuffer`.
697func (x *TextView) BackwardDisplayLine(IterVar *TextIter) bool {
698
699 cret := xTextViewBackwardDisplayLine(x.GoPointer(), IterVar)
700 return cret
701}
702
703var xTextViewBackwardDisplayLineStart func(uintptr, *TextIter) bool
704
705// Moves the given @iter backward to the next display line start.
706//
707// A display line is different from a paragraph. Paragraphs are
708// separated by newlines or other paragraph separator characters.
709// Display lines are created by line-wrapping a paragraph. If
710// wrapping is turned off, display lines and paragraphs will be the
711// same. Display lines are divided differently for each view, since
712// they depend on the view’s width; paragraphs are the same in all
713// views, since they depend on the contents of the `GtkTextBuffer`.
714func (x *TextView) BackwardDisplayLineStart(IterVar *TextIter) bool {
715
716 cret := xTextViewBackwardDisplayLineStart(x.GoPointer(), IterVar)
717 return cret
718}
719
720var xTextViewBufferToWindowCoords func(uintptr, TextWindowType, int, int, *int, *int)
721
722// Converts buffer coordinates to window coordinates.
723func (x *TextView) BufferToWindowCoords(WinVar TextWindowType, BufferXVar int, BufferYVar int, WindowXVar *int, WindowYVar *int) {
724
725 xTextViewBufferToWindowCoords(x.GoPointer(), WinVar, BufferXVar, BufferYVar, WindowXVar, WindowYVar)
726
727}
728
729var xTextViewForwardDisplayLine func(uintptr, *TextIter) bool
730
731// Moves the given @iter forward by one display (wrapped) line.
732//
733// A display line is different from a paragraph. Paragraphs are
734// separated by newlines or other paragraph separator characters.
735// Display lines are created by line-wrapping a paragraph. If
736// wrapping is turned off, display lines and paragraphs will be the
737// same. Display lines are divided differently for each view, since
738// they depend on the view’s width; paragraphs are the same in all
739// views, since they depend on the contents of the `GtkTextBuffer`.
740func (x *TextView) ForwardDisplayLine(IterVar *TextIter) bool {
741
742 cret := xTextViewForwardDisplayLine(x.GoPointer(), IterVar)
743 return cret
744}
745
746var xTextViewForwardDisplayLineEnd func(uintptr, *TextIter) bool
747
748// Moves the given @iter forward to the next display line end.
749//
750// A display line is different from a paragraph. Paragraphs are
751// separated by newlines or other paragraph separator characters.
752// Display lines are created by line-wrapping a paragraph. If
753// wrapping is turned off, display lines and paragraphs will be the
754// same. Display lines are divided differently for each view, since
755// they depend on the view’s width; paragraphs are the same in all
756// views, since they depend on the contents of the `GtkTextBuffer`.
757func (x *TextView) ForwardDisplayLineEnd(IterVar *TextIter) bool {
758
759 cret := xTextViewForwardDisplayLineEnd(x.GoPointer(), IterVar)
760 return cret
761}
762
763var xTextViewGetAcceptsTab func(uintptr) bool
764
765// Returns whether pressing the <kbd>Tab</kbd> key inserts a tab characters.
766//
767// See [method@Gtk.TextView.set_accepts_tab].
768func (x *TextView) GetAcceptsTab() bool {
769
770 cret := xTextViewGetAcceptsTab(x.GoPointer())
771 return cret
772}
773
774var xTextViewGetBottomMargin func(uintptr) int
775
776// Gets the bottom margin for text in the @text_view.
777func (x *TextView) GetBottomMargin() int {
778
779 cret := xTextViewGetBottomMargin(x.GoPointer())
780 return cret
781}
782
783var xTextViewGetBuffer func(uintptr) uintptr
784
785// Returns the `GtkTextBuffer` being displayed by this text view.
786//
787// The reference count on the buffer is not incremented; the caller
788// of this function won’t own a new reference.
789func (x *TextView) GetBuffer() *TextBuffer {
790 var cls *TextBuffer
791
792 cret := xTextViewGetBuffer(x.GoPointer())
793
794 if cret == 0 {
795 return nil
796 }
797 gobject.IncreaseRef(cret)
798 cls = &TextBuffer{}
799 cls.Ptr = cret
800 return cls
801}
802
803var xTextViewGetCursorLocations func(uintptr, *TextIter, *gdk.Rectangle, *gdk.Rectangle)
804
805// Determine the positions of the strong and weak cursors if the
806// insertion point is at @iter.
807//
808// The position of each cursor is stored as a zero-width rectangle.
809// The strong cursor location is the location where characters of
810// the directionality equal to the base direction of the paragraph
811// are inserted. The weak cursor location is the location where
812// characters of the directionality opposite to the base direction
813// of the paragraph are inserted.
814//
815// If @iter is %NULL, the actual cursor position is used.
816//
817// Note that if @iter happens to be the actual cursor position, and
818// there is currently an IM preedit sequence being entered, the
819// returned locations will be adjusted to account for the preedit
820// cursor’s offset within the preedit sequence.
821//
822// The rectangle position is in buffer coordinates; use
823// [method@Gtk.TextView.buffer_to_window_coords] to convert these
824// coordinates to coordinates for one of the windows in the text view.
825func (x *TextView) GetCursorLocations(IterVar *TextIter, StrongVar *gdk.Rectangle, WeakVar *gdk.Rectangle) {
826
827 xTextViewGetCursorLocations(x.GoPointer(), IterVar, StrongVar, WeakVar)
828
829}
830
831var xTextViewGetCursorVisible func(uintptr) bool
832
833// Find out whether the cursor should be displayed.
834func (x *TextView) GetCursorVisible() bool {
835
836 cret := xTextViewGetCursorVisible(x.GoPointer())
837 return cret
838}
839
840var xTextViewGetEditable func(uintptr) bool
841
842// Returns the default editability of the `GtkTextView`.
843//
844// Tags in the buffer may override this setting for some ranges of text.
845func (x *TextView) GetEditable() bool {
846
847 cret := xTextViewGetEditable(x.GoPointer())
848 return cret
849}
850
851var xTextViewGetExtraMenu func(uintptr) uintptr
852
853// Gets the menu model that gets added to the context menu
854// or %NULL if none has been set.
855func (x *TextView) GetExtraMenu() *gio.MenuModel {
856 var cls *gio.MenuModel
857
858 cret := xTextViewGetExtraMenu(x.GoPointer())
859
860 if cret == 0 {
861 return nil
862 }
863 gobject.IncreaseRef(cret)
864 cls = &gio.MenuModel{}
865 cls.Ptr = cret
866 return cls
867}
868
869var xTextViewGetGutter func(uintptr, TextWindowType) uintptr
870
871// Gets a `GtkWidget` that has previously been set as gutter.
872//
873// See [method@Gtk.TextView.set_gutter].
874//
875// @win must be one of %GTK_TEXT_WINDOW_LEFT, %GTK_TEXT_WINDOW_RIGHT,
876// %GTK_TEXT_WINDOW_TOP, or %GTK_TEXT_WINDOW_BOTTOM.
877func (x *TextView) GetGutter(WinVar TextWindowType) *Widget {
878 var cls *Widget
879
880 cret := xTextViewGetGutter(x.GoPointer(), WinVar)
881
882 if cret == 0 {
883 return nil
884 }
885 gobject.IncreaseRef(cret)
886 cls = &Widget{}
887 cls.Ptr = cret
888 return cls
889}
890
891var xTextViewGetIndent func(uintptr) int
892
893// Gets the default indentation of paragraphs in @text_view.
894//
895// Tags in the view’s buffer may override the default.
896// The indentation may be negative.
897func (x *TextView) GetIndent() int {
898
899 cret := xTextViewGetIndent(x.GoPointer())
900 return cret
901}
902
903var xTextViewGetInputHints func(uintptr) InputHints
904
905// Gets the `input-hints` of the `GtkTextView`.
906func (x *TextView) GetInputHints() InputHints {
907
908 cret := xTextViewGetInputHints(x.GoPointer())
909 return cret
910}
911
912var xTextViewGetInputPurpose func(uintptr) InputPurpose
913
914// Gets the `input-purpose` of the `GtkTextView`.
915func (x *TextView) GetInputPurpose() InputPurpose {
916
917 cret := xTextViewGetInputPurpose(x.GoPointer())
918 return cret
919}
920
921var xTextViewGetIterAtLocation func(uintptr, *TextIter, int, int) bool
922
923// Retrieves the iterator at buffer coordinates @x and @y.
924//
925// Buffer coordinates are coordinates for the entire buffer, not just
926// the currently-displayed portion. If you have coordinates from an
927// event, you have to convert those to buffer coordinates with
928// [method@Gtk.TextView.window_to_buffer_coords].
929func (x *TextView) GetIterAtLocation(IterVar *TextIter, XVar int, YVar int) bool {
930
931 cret := xTextViewGetIterAtLocation(x.GoPointer(), IterVar, XVar, YVar)
932 return cret
933}
934
935var xTextViewGetIterAtPosition func(uintptr, *TextIter, *int, int, int) bool
936
937// Retrieves the iterator pointing to the character at buffer
938// coordinates @x and @y.
939//
940// Buffer coordinates are coordinates for the entire buffer, not just
941// the currently-displayed portion. If you have coordinates from an event,
942// you have to convert those to buffer coordinates with
943// [method@Gtk.TextView.window_to_buffer_coords].
944//
945// Note that this is different from [method@Gtk.TextView.get_iter_at_location],
946// which returns cursor locations, i.e. positions between characters.
947func (x *TextView) GetIterAtPosition(IterVar *TextIter, TrailingVar *int, XVar int, YVar int) bool {
948
949 cret := xTextViewGetIterAtPosition(x.GoPointer(), IterVar, TrailingVar, XVar, YVar)
950 return cret
951}
952
953var xTextViewGetIterLocation func(uintptr, *TextIter, *gdk.Rectangle)
954
955// Gets a rectangle which roughly contains the character at @iter.
956//
957// The rectangle position is in buffer coordinates; use
958// [method@Gtk.TextView.buffer_to_window_coords] to convert these
959// coordinates to coordinates for one of the windows in the text view.
960func (x *TextView) GetIterLocation(IterVar *TextIter, LocationVar *gdk.Rectangle) {
961
962 xTextViewGetIterLocation(x.GoPointer(), IterVar, LocationVar)
963
964}
965
966var xTextViewGetJustification func(uintptr) Justification
967
968// Gets the default justification of paragraphs in @text_view.
969//
970// Tags in the buffer may override the default.
971func (x *TextView) GetJustification() Justification {
972
973 cret := xTextViewGetJustification(x.GoPointer())
974 return cret
975}
976
977var xTextViewGetLeftMargin func(uintptr) int
978
979// Gets the default left margin size of paragraphs in the @text_view.
980//
981// Tags in the buffer may override the default.
982func (x *TextView) GetLeftMargin() int {
983
984 cret := xTextViewGetLeftMargin(x.GoPointer())
985 return cret
986}
987
988var xTextViewGetLineAtY func(uintptr, *TextIter, int, *int)
989
990// Gets the `GtkTextIter` at the start of the line containing
991// the coordinate @y.
992//
993// @y is in buffer coordinates, convert from window coordinates with
994// [method@Gtk.TextView.window_to_buffer_coords]. If non-%NULL,
995// @line_top will be filled with the coordinate of the top edge
996// of the line.
997func (x *TextView) GetLineAtY(TargetIterVar *TextIter, YVar int, LineTopVar *int) {
998
999 xTextViewGetLineAtY(x.GoPointer(), TargetIterVar, YVar, LineTopVar)
1000
1001}
1002
1003var xTextViewGetLineYrange func(uintptr, *TextIter, *int, *int)
1004
1005// Gets the y coordinate of the top of the line containing @iter,
1006// and the height of the line.
1007//
1008// The coordinate is a buffer coordinate; convert to window
1009// coordinates with [method@Gtk.TextView.buffer_to_window_coords].
1010func (x *TextView) GetLineYrange(IterVar *TextIter, YVar *int, HeightVar *int) {
1011
1012 xTextViewGetLineYrange(x.GoPointer(), IterVar, YVar, HeightVar)
1013
1014}
1015
1016var xTextViewGetLtrContext func(uintptr) uintptr
1017
1018// Gets the `PangoContext` that is used for rendering LTR directed
1019// text layouts.
1020//
1021// The context may be replaced when CSS changes occur.
1022func (x *TextView) GetLtrContext() *pango.Context {
1023 var cls *pango.Context
1024
1025 cret := xTextViewGetLtrContext(x.GoPointer())
1026
1027 if cret == 0 {
1028 return nil
1029 }
1030 gobject.IncreaseRef(cret)
1031 cls = &pango.Context{}
1032 cls.Ptr = cret
1033 return cls
1034}
1035
1036var xTextViewGetMonospace func(uintptr) bool
1037
1038// Gets whether the `GtkTextView` uses monospace styling.
1039func (x *TextView) GetMonospace() bool {
1040
1041 cret := xTextViewGetMonospace(x.GoPointer())
1042 return cret
1043}
1044
1045var xTextViewGetOverwrite func(uintptr) bool
1046
1047// Returns whether the `GtkTextView` is in overwrite mode or not.
1048func (x *TextView) GetOverwrite() bool {
1049
1050 cret := xTextViewGetOverwrite(x.GoPointer())
1051 return cret
1052}
1053
1054var xTextViewGetPixelsAboveLines func(uintptr) int
1055
1056// Gets the default number of pixels to put above paragraphs.
1057//
1058// Adding this function with [method@Gtk.TextView.get_pixels_below_lines]
1059// is equal to the line space between each paragraph.
1060func (x *TextView) GetPixelsAboveLines() int {
1061
1062 cret := xTextViewGetPixelsAboveLines(x.GoPointer())
1063 return cret
1064}
1065
1066var xTextViewGetPixelsBelowLines func(uintptr) int
1067
1068// Gets the default number of pixels to put below paragraphs.
1069//
1070// The line space is the sum of the value returned by this function and
1071// the value returned by [method@Gtk.TextView.get_pixels_above_lines].
1072func (x *TextView) GetPixelsBelowLines() int {
1073
1074 cret := xTextViewGetPixelsBelowLines(x.GoPointer())
1075 return cret
1076}
1077
1078var xTextViewGetPixelsInsideWrap func(uintptr) int
1079
1080// Gets the default number of pixels to put between wrapped lines
1081// inside a paragraph.
1082func (x *TextView) GetPixelsInsideWrap() int {
1083
1084 cret := xTextViewGetPixelsInsideWrap(x.GoPointer())
1085 return cret
1086}
1087
1088var xTextViewGetRightMargin func(uintptr) int
1089
1090// Gets the default right margin for text in @text_view.
1091//
1092// Tags in the buffer may override the default.
1093func (x *TextView) GetRightMargin() int {
1094
1095 cret := xTextViewGetRightMargin(x.GoPointer())
1096 return cret
1097}
1098
1099var xTextViewGetRtlContext func(uintptr) uintptr
1100
1101// Gets the `PangoContext` that is used for rendering RTL directed
1102// text layouts.
1103//
1104// The context may be replaced when CSS changes occur.
1105func (x *TextView) GetRtlContext() *pango.Context {
1106 var cls *pango.Context
1107
1108 cret := xTextViewGetRtlContext(x.GoPointer())
1109
1110 if cret == 0 {
1111 return nil
1112 }
1113 gobject.IncreaseRef(cret)
1114 cls = &pango.Context{}
1115 cls.Ptr = cret
1116 return cls
1117}
1118
1119var xTextViewGetTabs func(uintptr) *pango.TabArray
1120
1121// Gets the default tabs for @text_view.
1122//
1123// Tags in the buffer may override the defaults. The returned array
1124// will be %NULL if “standard” (8-space) tabs are used. Free the
1125// return value with [method@Pango.TabArray.free].
1126func (x *TextView) GetTabs() *pango.TabArray {
1127
1128 cret := xTextViewGetTabs(x.GoPointer())
1129 return cret
1130}
1131
1132var xTextViewGetTopMargin func(uintptr) int
1133
1134// Gets the top margin for text in the @text_view.
1135func (x *TextView) GetTopMargin() int {
1136
1137 cret := xTextViewGetTopMargin(x.GoPointer())
1138 return cret
1139}
1140
1141var xTextViewGetVisibleOffset func(uintptr, *float64, *float64)
1142
1143// Gets the X,Y offset in buffer coordinates of the top-left corner of
1144// the textview's text contents.
1145//
1146// This allows for more-precise positioning than what is provided by
1147// [method@Gtk.TextView.get_visible_rect] as you can discover what
1148// device pixel is being quantized for text positioning.
1149//
1150// You might want this when making ulterior widgets align with quantized
1151// device pixels of the textview contents such as line numbers.
1152func (x *TextView) GetVisibleOffset(XOffsetVar *float64, YOffsetVar *float64) {
1153
1154 xTextViewGetVisibleOffset(x.GoPointer(), XOffsetVar, YOffsetVar)
1155
1156}
1157
1158var xTextViewGetVisibleRect func(uintptr, *gdk.Rectangle)
1159
1160// Fills @visible_rect with the currently-visible
1161// region of the buffer, in buffer coordinates.
1162//
1163// Convert to window coordinates with
1164// [method@Gtk.TextView.buffer_to_window_coords].
1165func (x *TextView) GetVisibleRect(VisibleRectVar *gdk.Rectangle) {
1166
1167 xTextViewGetVisibleRect(x.GoPointer(), VisibleRectVar)
1168
1169}
1170
1171var xTextViewGetWrapMode func(uintptr) WrapMode
1172
1173// Gets the line wrapping for the view.
1174func (x *TextView) GetWrapMode() WrapMode {
1175
1176 cret := xTextViewGetWrapMode(x.GoPointer())
1177 return cret
1178}
1179
1180var xTextViewImContextFilterKeypress func(uintptr, uintptr) bool
1181
1182// Allow the `GtkTextView` input method to internally handle key press
1183// and release events.
1184//
1185// If this function returns %TRUE, then no further processing should be
1186// done for this key event. See [method@Gtk.IMContext.filter_keypress].
1187//
1188// Note that you are expected to call this function from your handler
1189// when overriding key event handling. This is needed in the case when
1190// you need to insert your own key handling between the input method
1191// and the default key event handling of the `GtkTextView`.
1192//
1193// ```c
1194// static gboolean
1195// gtk_foo_bar_key_press_event (GtkWidget *widget,
1196//
1197// GdkEvent *event)
1198//
1199// {
1200// guint keyval;
1201//
1202// gdk_event_get_keyval ((GdkEvent*)event, &keyval);
1203//
1204// if (keyval == GDK_KEY_Return || keyval == GDK_KEY_KP_Enter)
1205// {
1206// if (gtk_text_view_im_context_filter_keypress (GTK_TEXT_VIEW (widget), event))
1207// return TRUE;
1208// }
1209//
1210// // Do some stuff
1211//
1212// return GTK_WIDGET_CLASS (gtk_foo_bar_parent_class)->key_press_event (widget, event);
1213// }
1214//
1215// ```
1216func (x *TextView) ImContextFilterKeypress(EventVar *gdk.Event) bool {
1217
1218 cret := xTextViewImContextFilterKeypress(x.GoPointer(), EventVar.GoPointer())
1219 return cret
1220}
1221
1222var xTextViewMoveMarkOnscreen func(uintptr, uintptr) bool
1223
1224// Moves a mark within the buffer so that it's
1225// located within the currently-visible text area.
1226func (x *TextView) MoveMarkOnscreen(MarkVar *TextMark) bool {
1227
1228 cret := xTextViewMoveMarkOnscreen(x.GoPointer(), MarkVar.GoPointer())
1229 return cret
1230}
1231
1232var xTextViewMoveOverlay func(uintptr, uintptr, int, int)
1233
1234// Updates the position of a child.
1235//
1236// See [method@Gtk.TextView.add_overlay].
1237func (x *TextView) MoveOverlay(ChildVar *Widget, XposVar int, YposVar int) {
1238
1239 xTextViewMoveOverlay(x.GoPointer(), ChildVar.GoPointer(), XposVar, YposVar)
1240
1241}
1242
1243var xTextViewMoveVisually func(uintptr, *TextIter, int) bool
1244
1245// Move the iterator a given number of characters visually, treating
1246// it as the strong cursor position.
1247//
1248// If @count is positive, then the new strong cursor position will
1249// be @count positions to the right of the old cursor position.
1250// If @count is negative then the new strong cursor position will
1251// be @count positions to the left of the old cursor position.
1252//
1253// In the presence of bi-directional text, the correspondence
1254// between logical and visual order will depend on the direction
1255// of the current run, and there may be jumps when the cursor
1256// is moved off of the end of a run.
1257func (x *TextView) MoveVisually(IterVar *TextIter, CountVar int) bool {
1258
1259 cret := xTextViewMoveVisually(x.GoPointer(), IterVar, CountVar)
1260 return cret
1261}
1262
1263var xTextViewPlaceCursorOnscreen func(uintptr) bool
1264
1265// Moves the cursor to the currently visible region of the
1266// buffer.
1267func (x *TextView) PlaceCursorOnscreen() bool {
1268
1269 cret := xTextViewPlaceCursorOnscreen(x.GoPointer())
1270 return cret
1271}
1272
1273var xTextViewRemove func(uintptr, uintptr)
1274
1275// Removes a child widget from @text_view.
1276func (x *TextView) Remove(ChildVar *Widget) {
1277
1278 xTextViewRemove(x.GoPointer(), ChildVar.GoPointer())
1279
1280}
1281
1282var xTextViewResetCursorBlink func(uintptr)
1283
1284// Ensures that the cursor is shown.
1285//
1286// This also resets the time that it will stay blinking (or
1287// visible, in case blinking is disabled).
1288//
1289// This function should be called in response to user input
1290// (e.g. from derived classes that override the textview's
1291// event handlers).
1292func (x *TextView) ResetCursorBlink() {
1293
1294 xTextViewResetCursorBlink(x.GoPointer())
1295
1296}
1297
1298var xTextViewResetImContext func(uintptr)
1299
1300// Reset the input method context of the text view if needed.
1301//
1302// This can be necessary in the case where modifying the buffer
1303// would confuse on-going input method behavior.
1304func (x *TextView) ResetImContext() {
1305
1306 xTextViewResetImContext(x.GoPointer())
1307
1308}
1309
1310var xTextViewScrollMarkOnscreen func(uintptr, uintptr)
1311
1312// Scrolls @text_view the minimum distance such that @mark is contained
1313// within the visible area of the widget.
1314func (x *TextView) ScrollMarkOnscreen(MarkVar *TextMark) {
1315
1316 xTextViewScrollMarkOnscreen(x.GoPointer(), MarkVar.GoPointer())
1317
1318}
1319
1320var xTextViewScrollToIter func(uintptr, *TextIter, float64, bool, float64, float64) bool
1321
1322// Scrolls @text_view so that @iter is on the screen in the position
1323// indicated by @xalign and @yalign.
1324//
1325// An alignment of 0.0 indicates left or top, 1.0 indicates right or
1326// bottom, 0.5 means center. If @use_align is %FALSE, the text scrolls
1327// the minimal distance to get the mark onscreen, possibly not scrolling
1328// at all. The effective screen for purposes of this function is reduced
1329// by a margin of size @within_margin.
1330//
1331// Note that this function uses the currently-computed height of the
1332// lines in the text buffer. Line heights are computed in an idle
1333// handler; so this function may not have the desired effect if it’s
1334// called before the height computations. To avoid oddness, consider
1335// using [method@Gtk.TextView.scroll_to_mark] which saves a point to be
1336// scrolled to after line validation.
1337func (x *TextView) ScrollToIter(IterVar *TextIter, WithinMarginVar float64, UseAlignVar bool, XalignVar float64, YalignVar float64) bool {
1338
1339 cret := xTextViewScrollToIter(x.GoPointer(), IterVar, WithinMarginVar, UseAlignVar, XalignVar, YalignVar)
1340 return cret
1341}
1342
1343var xTextViewScrollToMark func(uintptr, uintptr, float64, bool, float64, float64)
1344
1345// Scrolls @text_view so that @mark is on the screen in the position
1346// indicated by @xalign and @yalign.
1347//
1348// An alignment of 0.0 indicates left or top, 1.0 indicates right or
1349// bottom, 0.5 means center. If @use_align is %FALSE, the text scrolls
1350// the minimal distance to get the mark onscreen, possibly not scrolling
1351// at all. The effective screen for purposes of this function is reduced
1352// by a margin of size @within_margin.
1353func (x *TextView) ScrollToMark(MarkVar *TextMark, WithinMarginVar float64, UseAlignVar bool, XalignVar float64, YalignVar float64) {
1354
1355 xTextViewScrollToMark(x.GoPointer(), MarkVar.GoPointer(), WithinMarginVar, UseAlignVar, XalignVar, YalignVar)
1356
1357}
1358
1359var xTextViewSetAcceptsTab func(uintptr, bool)
1360
1361// Sets the behavior of the text widget when the <kbd>Tab</kbd> key is pressed.
1362//
1363// If @accepts_tab is %TRUE, a tab character is inserted. If @accepts_tab
1364// is %FALSE the keyboard focus is moved to the next widget in the focus
1365// chain.
1366//
1367// Focus can always be moved using <kbd>Ctrl</kbd>+<kbd>Tab</kbd>.
1368func (x *TextView) SetAcceptsTab(AcceptsTabVar bool) {
1369
1370 xTextViewSetAcceptsTab(x.GoPointer(), AcceptsTabVar)
1371
1372}
1373
1374var xTextViewSetBottomMargin func(uintptr, int)
1375
1376// Sets the bottom margin for text in @text_view.
1377//
1378// Note that this function is confusingly named.
1379// In CSS terms, the value set here is padding.
1380func (x *TextView) SetBottomMargin(BottomMarginVar int) {
1381
1382 xTextViewSetBottomMargin(x.GoPointer(), BottomMarginVar)
1383
1384}
1385
1386var xTextViewSetBuffer func(uintptr, uintptr)
1387
1388// Sets @buffer as the buffer being displayed by @text_view.
1389//
1390// The previous buffer displayed by the text view is unreferenced, and
1391// a reference is added to @buffer. If you owned a reference to @buffer
1392// before passing it to this function, you must remove that reference
1393// yourself; `GtkTextView` will not “adopt” it.
1394func (x *TextView) SetBuffer(BufferVar *TextBuffer) {
1395
1396 xTextViewSetBuffer(x.GoPointer(), BufferVar.GoPointer())
1397
1398}
1399
1400var xTextViewSetCursorVisible func(uintptr, bool)
1401
1402// Toggles whether the insertion point should be displayed.
1403//
1404// A buffer with no editable text probably shouldn’t have a visible
1405// cursor, so you may want to turn the cursor off.
1406//
1407// Note that this property may be overridden by the
1408// [property@Gtk.Settings:gtk-keynav-use-caret] setting.
1409func (x *TextView) SetCursorVisible(SettingVar bool) {
1410
1411 xTextViewSetCursorVisible(x.GoPointer(), SettingVar)
1412
1413}
1414
1415var xTextViewSetEditable func(uintptr, bool)
1416
1417// Sets the default editability of the `GtkTextView`.
1418//
1419// You can override this default setting with tags in the buffer,
1420// using the “editable” attribute of tags.
1421func (x *TextView) SetEditable(SettingVar bool) {
1422
1423 xTextViewSetEditable(x.GoPointer(), SettingVar)
1424
1425}
1426
1427var xTextViewSetExtraMenu func(uintptr, uintptr)
1428
1429// Sets a menu model to add when constructing the context
1430// menu for @text_view.
1431//
1432// You can pass %NULL to remove a previously set extra menu.
1433func (x *TextView) SetExtraMenu(ModelVar *gio.MenuModel) {
1434
1435 xTextViewSetExtraMenu(x.GoPointer(), ModelVar.GoPointer())
1436
1437}
1438
1439var xTextViewSetGutter func(uintptr, TextWindowType, uintptr)
1440
1441// Places @widget into the gutter specified by @win.
1442//
1443// @win must be one of %GTK_TEXT_WINDOW_LEFT, %GTK_TEXT_WINDOW_RIGHT,
1444// %GTK_TEXT_WINDOW_TOP, or %GTK_TEXT_WINDOW_BOTTOM.
1445func (x *TextView) SetGutter(WinVar TextWindowType, WidgetVar *Widget) {
1446
1447 xTextViewSetGutter(x.GoPointer(), WinVar, WidgetVar.GoPointer())
1448
1449}
1450
1451var xTextViewSetIndent func(uintptr, int)
1452
1453// Sets the default indentation for paragraphs in @text_view.
1454//
1455// Tags in the buffer may override the default.
1456func (x *TextView) SetIndent(IndentVar int) {
1457
1458 xTextViewSetIndent(x.GoPointer(), IndentVar)
1459
1460}
1461
1462var xTextViewSetInputHints func(uintptr, InputHints)
1463
1464// Sets the `input-hints` of the `GtkTextView`.
1465//
1466// The `input-hints` allow input methods to fine-tune
1467// their behaviour.
1468func (x *TextView) SetInputHints(HintsVar InputHints) {
1469
1470 xTextViewSetInputHints(x.GoPointer(), HintsVar)
1471
1472}
1473
1474var xTextViewSetInputPurpose func(uintptr, InputPurpose)
1475
1476// Sets the `input-purpose` of the `GtkTextView`.
1477//
1478// The `input-purpose` can be used by on-screen keyboards
1479// and other input methods to adjust their behaviour.
1480func (x *TextView) SetInputPurpose(PurposeVar InputPurpose) {
1481
1482 xTextViewSetInputPurpose(x.GoPointer(), PurposeVar)
1483
1484}
1485
1486var xTextViewSetJustification func(uintptr, Justification)
1487
1488// Sets the default justification of text in @text_view.
1489//
1490// Tags in the view’s buffer may override the default.
1491func (x *TextView) SetJustification(JustificationVar Justification) {
1492
1493 xTextViewSetJustification(x.GoPointer(), JustificationVar)
1494
1495}
1496
1497var xTextViewSetLeftMargin func(uintptr, int)
1498
1499// Sets the default left margin for text in @text_view.
1500//
1501// Tags in the buffer may override the default.
1502//
1503// Note that this function is confusingly named.
1504// In CSS terms, the value set here is padding.
1505func (x *TextView) SetLeftMargin(LeftMarginVar int) {
1506
1507 xTextViewSetLeftMargin(x.GoPointer(), LeftMarginVar)
1508
1509}
1510
1511var xTextViewSetMonospace func(uintptr, bool)
1512
1513// Sets whether the `GtkTextView` should display text in
1514// monospace styling.
1515func (x *TextView) SetMonospace(MonospaceVar bool) {
1516
1517 xTextViewSetMonospace(x.GoPointer(), MonospaceVar)
1518
1519}
1520
1521var xTextViewSetOverwrite func(uintptr, bool)
1522
1523// Changes the `GtkTextView` overwrite mode.
1524func (x *TextView) SetOverwrite(OverwriteVar bool) {
1525
1526 xTextViewSetOverwrite(x.GoPointer(), OverwriteVar)
1527
1528}
1529
1530var xTextViewSetPixelsAboveLines func(uintptr, int)
1531
1532// Sets the default number of blank pixels above paragraphs in @text_view.
1533//
1534// Tags in the buffer for @text_view may override the defaults.
1535func (x *TextView) SetPixelsAboveLines(PixelsAboveLinesVar int) {
1536
1537 xTextViewSetPixelsAboveLines(x.GoPointer(), PixelsAboveLinesVar)
1538
1539}
1540
1541var xTextViewSetPixelsBelowLines func(uintptr, int)
1542
1543// Sets the default number of pixels of blank space
1544// to put below paragraphs in @text_view.
1545//
1546// May be overridden by tags applied to @text_view’s buffer.
1547func (x *TextView) SetPixelsBelowLines(PixelsBelowLinesVar int) {
1548
1549 xTextViewSetPixelsBelowLines(x.GoPointer(), PixelsBelowLinesVar)
1550
1551}
1552
1553var xTextViewSetPixelsInsideWrap func(uintptr, int)
1554
1555// Sets the default number of pixels of blank space to leave between
1556// display/wrapped lines within a paragraph.
1557//
1558// May be overridden by tags in @text_view’s buffer.
1559func (x *TextView) SetPixelsInsideWrap(PixelsInsideWrapVar int) {
1560
1561 xTextViewSetPixelsInsideWrap(x.GoPointer(), PixelsInsideWrapVar)
1562
1563}
1564
1565var xTextViewSetRightMargin func(uintptr, int)
1566
1567// Sets the default right margin for text in the text view.
1568//
1569// Tags in the buffer may override the default.
1570//
1571// Note that this function is confusingly named.
1572// In CSS terms, the value set here is padding.
1573func (x *TextView) SetRightMargin(RightMarginVar int) {
1574
1575 xTextViewSetRightMargin(x.GoPointer(), RightMarginVar)
1576
1577}
1578
1579var xTextViewSetTabs func(uintptr, *pango.TabArray)
1580
1581// Sets the default tab stops for paragraphs in @text_view.
1582//
1583// Tags in the buffer may override the default.
1584func (x *TextView) SetTabs(TabsVar *pango.TabArray) {
1585
1586 xTextViewSetTabs(x.GoPointer(), TabsVar)
1587
1588}
1589
1590var xTextViewSetTopMargin func(uintptr, int)
1591
1592// Sets the top margin for text in @text_view.
1593//
1594// Note that this function is confusingly named.
1595// In CSS terms, the value set here is padding.
1596func (x *TextView) SetTopMargin(TopMarginVar int) {
1597
1598 xTextViewSetTopMargin(x.GoPointer(), TopMarginVar)
1599
1600}
1601
1602var xTextViewSetWrapMode func(uintptr, WrapMode)
1603
1604// Sets the line wrapping for the view.
1605func (x *TextView) SetWrapMode(WrapModeVar WrapMode) {
1606
1607 xTextViewSetWrapMode(x.GoPointer(), WrapModeVar)
1608
1609}
1610
1611var xTextViewStartsDisplayLine func(uintptr, *TextIter) bool
1612
1613// Determines whether @iter is at the start of a display line.
1614//
1615// See [method@Gtk.TextView.forward_display_line] for an
1616// explanation of display lines vs. paragraphs.
1617func (x *TextView) StartsDisplayLine(IterVar *TextIter) bool {
1618
1619 cret := xTextViewStartsDisplayLine(x.GoPointer(), IterVar)
1620 return cret
1621}
1622
1623var xTextViewWindowToBufferCoords func(uintptr, TextWindowType, int, int, *int, *int)
1624
1625// Converts coordinates on the window identified by @win to buffer
1626// coordinates.
1627func (x *TextView) WindowToBufferCoords(WinVar TextWindowType, WindowXVar int, WindowYVar int, BufferXVar *int, BufferYVar *int) {
1628
1629 xTextViewWindowToBufferCoords(x.GoPointer(), WinVar, WindowXVar, WindowYVar, BufferXVar, BufferYVar)
1630
1631}
1632
1633func (c *TextView) GoPointer() uintptr {
1634 if c == nil {
1635 return 0
1636 }
1637 return c.Ptr
1638}
1639
1640func (c *TextView) SetGoPointer(ptr uintptr) {
1641 c.Ptr = ptr
1642}
1643
1644// SetPropertyAcceptsTab sets the "accepts-tab" property.
1645// Whether Tab will result in a tab character being entered.
1646func (x *TextView) SetPropertyAcceptsTab(value bool) {
1647 var v gobject.Value
1648 v.Init(gobject.TypeBooleanVal)
1649 v.SetBoolean(value)
1650 x.SetProperty("accepts-tab", &v)
1651}
1652
1653// GetPropertyAcceptsTab gets the "accepts-tab" property.
1654// Whether Tab will result in a tab character being entered.
1655func (x *TextView) GetPropertyAcceptsTab() bool {
1656 var v gobject.Value
1657 x.GetProperty("accepts-tab", &v)
1658 return v.GetBoolean()
1659}
1660
1661// SetPropertyBottomMargin sets the "bottom-margin" property.
1662// The bottom margin for text in the text view.
1663//
1664// Note that this property is confusingly named. In CSS terms,
1665// the value set here is padding, and it is applied in addition
1666// to the padding from the theme.
1667//
1668// Don't confuse this property with [property@Gtk.Widget:margin-bottom].
1669func (x *TextView) SetPropertyBottomMargin(value int) {
1670 var v gobject.Value
1671 v.Init(gobject.TypeIntVal)
1672 v.SetInt(value)
1673 x.SetProperty("bottom-margin", &v)
1674}
1675
1676// GetPropertyBottomMargin gets the "bottom-margin" property.
1677// The bottom margin for text in the text view.
1678//
1679// Note that this property is confusingly named. In CSS terms,
1680// the value set here is padding, and it is applied in addition
1681// to the padding from the theme.
1682//
1683// Don't confuse this property with [property@Gtk.Widget:margin-bottom].
1684func (x *TextView) GetPropertyBottomMargin() int {
1685 var v gobject.Value
1686 x.GetProperty("bottom-margin", &v)
1687 return v.GetInt()
1688}
1689
1690// SetPropertyCursorVisible sets the "cursor-visible" property.
1691// If the insertion cursor is shown.
1692func (x *TextView) SetPropertyCursorVisible(value bool) {
1693 var v gobject.Value
1694 v.Init(gobject.TypeBooleanVal)
1695 v.SetBoolean(value)
1696 x.SetProperty("cursor-visible", &v)
1697}
1698
1699// GetPropertyCursorVisible gets the "cursor-visible" property.
1700// If the insertion cursor is shown.
1701func (x *TextView) GetPropertyCursorVisible() bool {
1702 var v gobject.Value
1703 x.GetProperty("cursor-visible", &v)
1704 return v.GetBoolean()
1705}
1706
1707// SetPropertyEditable sets the "editable" property.
1708// Whether the text can be modified by the user.
1709func (x *TextView) SetPropertyEditable(value bool) {
1710 var v gobject.Value
1711 v.Init(gobject.TypeBooleanVal)
1712 v.SetBoolean(value)
1713 x.SetProperty("editable", &v)
1714}
1715
1716// GetPropertyEditable gets the "editable" property.
1717// Whether the text can be modified by the user.
1718func (x *TextView) GetPropertyEditable() bool {
1719 var v gobject.Value
1720 x.GetProperty("editable", &v)
1721 return v.GetBoolean()
1722}
1723
1724// SetPropertyImModule sets the "im-module" property.
1725// Which IM (input method) module should be used for this text_view.
1726//
1727// See [class@Gtk.IMMulticontext].
1728//
1729// Setting this to a non-%NULL value overrides the system-wide IM module
1730// setting. See the GtkSettings [property@Gtk.Settings:gtk-im-module] property.
1731func (x *TextView) SetPropertyImModule(value string) {
1732 var v gobject.Value
1733 v.Init(gobject.TypeStringVal)
1734 v.SetString(&value)
1735 x.SetProperty("im-module", &v)
1736}
1737
1738// GetPropertyImModule gets the "im-module" property.
1739// Which IM (input method) module should be used for this text_view.
1740//
1741// See [class@Gtk.IMMulticontext].
1742//
1743// Setting this to a non-%NULL value overrides the system-wide IM module
1744// setting. See the GtkSettings [property@Gtk.Settings:gtk-im-module] property.
1745func (x *TextView) GetPropertyImModule() string {
1746 var v gobject.Value
1747 x.GetProperty("im-module", &v)
1748 return v.GetString()
1749}
1750
1751// SetPropertyIndent sets the "indent" property.
1752// Amount to indent the paragraph, in pixels.
1753//
1754// A negative value of indent will produce a hanging indentation.
1755// That is, the first line will have the full width, and subsequent
1756// lines will be indented by the absolute value of indent.
1757func (x *TextView) SetPropertyIndent(value int) {
1758 var v gobject.Value
1759 v.Init(gobject.TypeIntVal)
1760 v.SetInt(value)
1761 x.SetProperty("indent", &v)
1762}
1763
1764// GetPropertyIndent gets the "indent" property.
1765// Amount to indent the paragraph, in pixels.
1766//
1767// A negative value of indent will produce a hanging indentation.
1768// That is, the first line will have the full width, and subsequent
1769// lines will be indented by the absolute value of indent.
1770func (x *TextView) GetPropertyIndent() int {
1771 var v gobject.Value
1772 x.GetProperty("indent", &v)
1773 return v.GetInt()
1774}
1775
1776// SetPropertyLeftMargin sets the "left-margin" property.
1777// The default left margin for text in the text view.
1778//
1779// Tags in the buffer may override the default.
1780//
1781// Note that this property is confusingly named. In CSS terms,
1782// the value set here is padding, and it is applied in addition
1783// to the padding from the theme.
1784func (x *TextView) SetPropertyLeftMargin(value int) {
1785 var v gobject.Value
1786 v.Init(gobject.TypeIntVal)
1787 v.SetInt(value)
1788 x.SetProperty("left-margin", &v)
1789}
1790
1791// GetPropertyLeftMargin gets the "left-margin" property.
1792// The default left margin for text in the text view.
1793//
1794// Tags in the buffer may override the default.
1795//
1796// Note that this property is confusingly named. In CSS terms,
1797// the value set here is padding, and it is applied in addition
1798// to the padding from the theme.
1799func (x *TextView) GetPropertyLeftMargin() int {
1800 var v gobject.Value
1801 x.GetProperty("left-margin", &v)
1802 return v.GetInt()
1803}
1804
1805// SetPropertyMonospace sets the "monospace" property.
1806// Whether text should be displayed in a monospace font.
1807//
1808// If %TRUE, set the .monospace style class on the
1809// text view to indicate that a monospace font is desired.
1810func (x *TextView) SetPropertyMonospace(value bool) {
1811 var v gobject.Value
1812 v.Init(gobject.TypeBooleanVal)
1813 v.SetBoolean(value)
1814 x.SetProperty("monospace", &v)
1815}
1816
1817// GetPropertyMonospace gets the "monospace" property.
1818// Whether text should be displayed in a monospace font.
1819//
1820// If %TRUE, set the .monospace style class on the
1821// text view to indicate that a monospace font is desired.
1822func (x *TextView) GetPropertyMonospace() bool {
1823 var v gobject.Value
1824 x.GetProperty("monospace", &v)
1825 return v.GetBoolean()
1826}
1827
1828// SetPropertyOverwrite sets the "overwrite" property.
1829// Whether entered text overwrites existing contents.
1830func (x *TextView) SetPropertyOverwrite(value bool) {
1831 var v gobject.Value
1832 v.Init(gobject.TypeBooleanVal)
1833 v.SetBoolean(value)
1834 x.SetProperty("overwrite", &v)
1835}
1836
1837// GetPropertyOverwrite gets the "overwrite" property.
1838// Whether entered text overwrites existing contents.
1839func (x *TextView) GetPropertyOverwrite() bool {
1840 var v gobject.Value
1841 x.GetProperty("overwrite", &v)
1842 return v.GetBoolean()
1843}
1844
1845// SetPropertyPixelsAboveLines sets the "pixels-above-lines" property.
1846// Pixels of blank space above paragraphs.
1847func (x *TextView) SetPropertyPixelsAboveLines(value int) {
1848 var v gobject.Value
1849 v.Init(gobject.TypeIntVal)
1850 v.SetInt(value)
1851 x.SetProperty("pixels-above-lines", &v)
1852}
1853
1854// GetPropertyPixelsAboveLines gets the "pixels-above-lines" property.
1855// Pixels of blank space above paragraphs.
1856func (x *TextView) GetPropertyPixelsAboveLines() int {
1857 var v gobject.Value
1858 x.GetProperty("pixels-above-lines", &v)
1859 return v.GetInt()
1860}
1861
1862// SetPropertyPixelsBelowLines sets the "pixels-below-lines" property.
1863// Pixels of blank space below paragraphs.
1864func (x *TextView) SetPropertyPixelsBelowLines(value int) {
1865 var v gobject.Value
1866 v.Init(gobject.TypeIntVal)
1867 v.SetInt(value)
1868 x.SetProperty("pixels-below-lines", &v)
1869}
1870
1871// GetPropertyPixelsBelowLines gets the "pixels-below-lines" property.
1872// Pixels of blank space below paragraphs.
1873func (x *TextView) GetPropertyPixelsBelowLines() int {
1874 var v gobject.Value
1875 x.GetProperty("pixels-below-lines", &v)
1876 return v.GetInt()
1877}
1878
1879// SetPropertyPixelsInsideWrap sets the "pixels-inside-wrap" property.
1880// Pixels of blank space between wrapped lines in a paragraph.
1881func (x *TextView) SetPropertyPixelsInsideWrap(value int) {
1882 var v gobject.Value
1883 v.Init(gobject.TypeIntVal)
1884 v.SetInt(value)
1885 x.SetProperty("pixels-inside-wrap", &v)
1886}
1887
1888// GetPropertyPixelsInsideWrap gets the "pixels-inside-wrap" property.
1889// Pixels of blank space between wrapped lines in a paragraph.
1890func (x *TextView) GetPropertyPixelsInsideWrap() int {
1891 var v gobject.Value
1892 x.GetProperty("pixels-inside-wrap", &v)
1893 return v.GetInt()
1894}
1895
1896// SetPropertyRightMargin sets the "right-margin" property.
1897// The default right margin for text in the text view.
1898//
1899// Tags in the buffer may override the default.
1900//
1901// Note that this property is confusingly named. In CSS terms,
1902// the value set here is padding, and it is applied in addition
1903// to the padding from the theme.
1904func (x *TextView) SetPropertyRightMargin(value int) {
1905 var v gobject.Value
1906 v.Init(gobject.TypeIntVal)
1907 v.SetInt(value)
1908 x.SetProperty("right-margin", &v)
1909}
1910
1911// GetPropertyRightMargin gets the "right-margin" property.
1912// The default right margin for text in the text view.
1913//
1914// Tags in the buffer may override the default.
1915//
1916// Note that this property is confusingly named. In CSS terms,
1917// the value set here is padding, and it is applied in addition
1918// to the padding from the theme.
1919func (x *TextView) GetPropertyRightMargin() int {
1920 var v gobject.Value
1921 x.GetProperty("right-margin", &v)
1922 return v.GetInt()
1923}
1924
1925// SetPropertyTabs sets the "tabs" property.
1926// Custom tabs for this text.
1927func (x *TextView) SetPropertyTabs(value uintptr) {
1928 var v gobject.Value
1929 v.Init(gobject.TypePointerVal)
1930 v.SetPointer(value)
1931 x.SetProperty("tabs", &v)
1932}
1933
1934// GetPropertyTabs gets the "tabs" property.
1935// Custom tabs for this text.
1936func (x *TextView) GetPropertyTabs() uintptr {
1937 var v gobject.Value
1938 x.GetProperty("tabs", &v)
1939 return v.GetPointer()
1940}
1941
1942// SetPropertyTopMargin sets the "top-margin" property.
1943// The top margin for text in the text view.
1944//
1945// Note that this property is confusingly named. In CSS terms,
1946// the value set here is padding, and it is applied in addition
1947// to the padding from the theme.
1948//
1949// Don't confuse this property with [property@Gtk.Widget:margin-top].
1950func (x *TextView) SetPropertyTopMargin(value int) {
1951 var v gobject.Value
1952 v.Init(gobject.TypeIntVal)
1953 v.SetInt(value)
1954 x.SetProperty("top-margin", &v)
1955}
1956
1957// GetPropertyTopMargin gets the "top-margin" property.
1958// The top margin for text in the text view.
1959//
1960// Note that this property is confusingly named. In CSS terms,
1961// the value set here is padding, and it is applied in addition
1962// to the padding from the theme.
1963//
1964// Don't confuse this property with [property@Gtk.Widget:margin-top].
1965func (x *TextView) GetPropertyTopMargin() int {
1966 var v gobject.Value
1967 x.GetProperty("top-margin", &v)
1968 return v.GetInt()
1969}
1970
1971// Gets emitted when the user asks for it.
1972//
1973// The ::backspace signal is a [keybinding signal](class.SignalAction.html).
1974//
1975// The default bindings for this signal are
1976// <kbd>Backspace</kbd> and <kbd>Shift</kbd>+<kbd>Backspace</kbd>.
1977func (x *TextView) ConnectBackspace(cb *func(TextView)) uint {
1978 cbPtr := uintptr(unsafe.Pointer(cb))
1979 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1980 handlerID := gobject.SignalConnect(x.GoPointer(), "backspace", cbRefPtr)
1981 glib.SaveHandlerMapping(handlerID, cbPtr)
1982 return handlerID
1983 }
1984
1985 fcb := func(clsPtr uintptr) {
1986 fa := TextView{}
1987 fa.Ptr = clsPtr
1988 cbFn := *cb
1989
1990 cbFn(fa)
1991
1992 }
1993 cbRefPtr := purego.NewCallback(fcb)
1994 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1995 handlerID := gobject.SignalConnect(x.GoPointer(), "backspace", cbRefPtr)
1996 glib.SaveHandlerMapping(handlerID, cbPtr)
1997 return handlerID
1998}
1999
2000// Gets emitted to copy the selection to the clipboard.
2001//
2002// The ::copy-clipboard signal is a [keybinding signal](class.SignalAction.html).
2003//
2004// The default bindings for this signal are
2005// <kbd>Ctrl</kbd>+<kbd>c</kbd> and
2006// <kbd>Ctrl</kbd>+<kbd>Insert</kbd>.
2007func (x *TextView) ConnectCopyClipboard(cb *func(TextView)) uint {
2008 cbPtr := uintptr(unsafe.Pointer(cb))
2009 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2010 handlerID := gobject.SignalConnect(x.GoPointer(), "copy-clipboard", cbRefPtr)
2011 glib.SaveHandlerMapping(handlerID, cbPtr)
2012 return handlerID
2013 }
2014
2015 fcb := func(clsPtr uintptr) {
2016 fa := TextView{}
2017 fa.Ptr = clsPtr
2018 cbFn := *cb
2019
2020 cbFn(fa)
2021
2022 }
2023 cbRefPtr := purego.NewCallback(fcb)
2024 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2025 handlerID := gobject.SignalConnect(x.GoPointer(), "copy-clipboard", cbRefPtr)
2026 glib.SaveHandlerMapping(handlerID, cbPtr)
2027 return handlerID
2028}
2029
2030// Gets emitted to cut the selection to the clipboard.
2031//
2032// The ::cut-clipboard signal is a [keybinding signal](class.SignalAction.html).
2033//
2034// The default bindings for this signal are
2035// <kbd>Ctrl</kbd>+<kbd>x</kbd> and
2036// <kbd>Shift</kbd>+<kbd>Delete</kbd>.
2037func (x *TextView) ConnectCutClipboard(cb *func(TextView)) uint {
2038 cbPtr := uintptr(unsafe.Pointer(cb))
2039 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2040 handlerID := gobject.SignalConnect(x.GoPointer(), "cut-clipboard", cbRefPtr)
2041 glib.SaveHandlerMapping(handlerID, cbPtr)
2042 return handlerID
2043 }
2044
2045 fcb := func(clsPtr uintptr) {
2046 fa := TextView{}
2047 fa.Ptr = clsPtr
2048 cbFn := *cb
2049
2050 cbFn(fa)
2051
2052 }
2053 cbRefPtr := purego.NewCallback(fcb)
2054 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2055 handlerID := gobject.SignalConnect(x.GoPointer(), "cut-clipboard", cbRefPtr)
2056 glib.SaveHandlerMapping(handlerID, cbPtr)
2057 return handlerID
2058}
2059
2060// Gets emitted when the user initiates a text deletion.
2061//
2062// The ::delete-from-cursor signal is a [keybinding signal](class.SignalAction.html).
2063//
2064// If the @type is %GTK_DELETE_CHARS, GTK deletes the selection
2065// if there is one, otherwise it deletes the requested number
2066// of characters.
2067//
2068// The default bindings for this signal are <kbd>Delete</kbd> for
2069// deleting a character, <kbd>Ctrl</kbd>+<kbd>Delete</kbd> for
2070// deleting a word and <kbd>Ctrl</kbd>+<kbd>Backspace</kbd> for
2071// deleting a word backwards.
2072func (x *TextView) ConnectDeleteFromCursor(cb *func(TextView, DeleteType, int)) uint {
2073 cbPtr := uintptr(unsafe.Pointer(cb))
2074 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2075 handlerID := gobject.SignalConnect(x.GoPointer(), "delete-from-cursor", cbRefPtr)
2076 glib.SaveHandlerMapping(handlerID, cbPtr)
2077 return handlerID
2078 }
2079
2080 fcb := func(clsPtr uintptr, TypeVarp DeleteType, CountVarp int) {
2081 fa := TextView{}
2082 fa.Ptr = clsPtr
2083 cbFn := *cb
2084
2085 cbFn(fa, TypeVarp, CountVarp)
2086
2087 }
2088 cbRefPtr := purego.NewCallback(fcb)
2089 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2090 handlerID := gobject.SignalConnect(x.GoPointer(), "delete-from-cursor", cbRefPtr)
2091 glib.SaveHandlerMapping(handlerID, cbPtr)
2092 return handlerID
2093}
2094
2095// Emitted when the selection needs to be extended at @location.
2096func (x *TextView) ConnectExtendSelection(cb *func(TextView, TextExtendSelection, uintptr, uintptr, uintptr) bool) uint {
2097 cbPtr := uintptr(unsafe.Pointer(cb))
2098 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2099 handlerID := gobject.SignalConnect(x.GoPointer(), "extend-selection", cbRefPtr)
2100 glib.SaveHandlerMapping(handlerID, cbPtr)
2101 return handlerID
2102 }
2103
2104 fcb := func(clsPtr uintptr, GranularityVarp TextExtendSelection, LocationVarp uintptr, StartVarp uintptr, EndVarp uintptr) bool {
2105 fa := TextView{}
2106 fa.Ptr = clsPtr
2107 cbFn := *cb
2108
2109 return cbFn(fa, GranularityVarp, LocationVarp, StartVarp, EndVarp)
2110
2111 }
2112 cbRefPtr := purego.NewCallback(fcb)
2113 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2114 handlerID := gobject.SignalConnect(x.GoPointer(), "extend-selection", cbRefPtr)
2115 glib.SaveHandlerMapping(handlerID, cbPtr)
2116 return handlerID
2117}
2118
2119// Gets emitted when the user initiates the insertion of a
2120// fixed string at the cursor.
2121//
2122// The ::insert-at-cursor signal is a [keybinding signal](class.SignalAction.html).
2123//
2124// This signal has no default bindings.
2125func (x *TextView) ConnectInsertAtCursor(cb *func(TextView, string)) uint {
2126 cbPtr := uintptr(unsafe.Pointer(cb))
2127 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2128 handlerID := gobject.SignalConnect(x.GoPointer(), "insert-at-cursor", cbRefPtr)
2129 glib.SaveHandlerMapping(handlerID, cbPtr)
2130 return handlerID
2131 }
2132
2133 fcb := func(clsPtr uintptr, StringVarp uintptr) {
2134 fa := TextView{}
2135 fa.Ptr = clsPtr
2136 cbFn := *cb
2137
2138 cbFn(fa, core.GoString(StringVarp))
2139
2140 }
2141 cbRefPtr := purego.NewCallback(fcb)
2142 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2143 handlerID := gobject.SignalConnect(x.GoPointer(), "insert-at-cursor", cbRefPtr)
2144 glib.SaveHandlerMapping(handlerID, cbPtr)
2145 return handlerID
2146}
2147
2148// Gets emitted to present the Emoji chooser for the @text_view.
2149//
2150// The ::insert-emoji signal is a [keybinding signal](class.SignalAction.html).
2151//
2152// The default bindings for this signal are
2153// <kbd>Ctrl</kbd>+<kbd>.</kbd> and
2154// <kbd>Ctrl</kbd>+<kbd>;</kbd>
2155func (x *TextView) ConnectInsertEmoji(cb *func(TextView)) uint {
2156 cbPtr := uintptr(unsafe.Pointer(cb))
2157 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2158 handlerID := gobject.SignalConnect(x.GoPointer(), "insert-emoji", cbRefPtr)
2159 glib.SaveHandlerMapping(handlerID, cbPtr)
2160 return handlerID
2161 }
2162
2163 fcb := func(clsPtr uintptr) {
2164 fa := TextView{}
2165 fa.Ptr = clsPtr
2166 cbFn := *cb
2167
2168 cbFn(fa)
2169
2170 }
2171 cbRefPtr := purego.NewCallback(fcb)
2172 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2173 handlerID := gobject.SignalConnect(x.GoPointer(), "insert-emoji", cbRefPtr)
2174 glib.SaveHandlerMapping(handlerID, cbPtr)
2175 return handlerID
2176}
2177
2178// Gets emitted when the user initiates a cursor movement.
2179//
2180// The ::move-cursor signal is a [keybinding signal](class.SignalAction.html).
2181// If the cursor is not visible in @text_view, this signal causes
2182// the viewport to be moved instead.
2183//
2184// Applications should not connect to it, but may emit it with
2185// g_signal_emit_by_name() if they need to control the cursor
2186// programmatically.
2187//
2188// The default bindings for this signal come in two variants,
2189// the variant with the <kbd>Shift</kbd> modifier extends the
2190// selection, the variant without it does not.
2191// There are too many key combinations to list them all here.
2192//
2193// - <kbd>←</kbd>, <kbd>→</kbd>, <kbd>↑</kbd>, <kbd>↓</kbd>
2194// move by individual characters/lines
2195// - <kbd>Ctrl</kbd>+<kbd>←</kbd>, etc. move by words/paragraphs
2196// - <kbd>Home</kbd> and <kbd>End</kbd> move to the ends of the buffer
2197// - <kbd>PgUp</kbd> and <kbd>PgDn</kbd> move vertically by pages
2198// - <kbd>Ctrl</kbd>+<kbd>PgUp</kbd> and <kbd>Ctrl</kbd>+<kbd>PgDn</kbd>
2199// move horizontally by pages
2200func (x *TextView) ConnectMoveCursor(cb *func(TextView, MovementStep, int, bool)) uint {
2201 cbPtr := uintptr(unsafe.Pointer(cb))
2202 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2203 handlerID := gobject.SignalConnect(x.GoPointer(), "move-cursor", cbRefPtr)
2204 glib.SaveHandlerMapping(handlerID, cbPtr)
2205 return handlerID
2206 }
2207
2208 fcb := func(clsPtr uintptr, StepVarp MovementStep, CountVarp int, ExtendSelectionVarp bool) {
2209 fa := TextView{}
2210 fa.Ptr = clsPtr
2211 cbFn := *cb
2212
2213 cbFn(fa, StepVarp, CountVarp, ExtendSelectionVarp)
2214
2215 }
2216 cbRefPtr := purego.NewCallback(fcb)
2217 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2218 handlerID := gobject.SignalConnect(x.GoPointer(), "move-cursor", cbRefPtr)
2219 glib.SaveHandlerMapping(handlerID, cbPtr)
2220 return handlerID
2221}
2222
2223// Gets emitted to move the viewport.
2224//
2225// The ::move-viewport signal is a [keybinding signal](class.SignalAction.html),
2226// which can be bound to key combinations to allow the user to move the viewport,
2227// i.e. change what part of the text view is visible in a containing scrolled
2228// window.
2229//
2230// There are no default bindings for this signal.
2231func (x *TextView) ConnectMoveViewport(cb *func(TextView, ScrollStep, int)) uint {
2232 cbPtr := uintptr(unsafe.Pointer(cb))
2233 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2234 handlerID := gobject.SignalConnect(x.GoPointer(), "move-viewport", cbRefPtr)
2235 glib.SaveHandlerMapping(handlerID, cbPtr)
2236 return handlerID
2237 }
2238
2239 fcb := func(clsPtr uintptr, StepVarp ScrollStep, CountVarp int) {
2240 fa := TextView{}
2241 fa.Ptr = clsPtr
2242 cbFn := *cb
2243
2244 cbFn(fa, StepVarp, CountVarp)
2245
2246 }
2247 cbRefPtr := purego.NewCallback(fcb)
2248 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2249 handlerID := gobject.SignalConnect(x.GoPointer(), "move-viewport", cbRefPtr)
2250 glib.SaveHandlerMapping(handlerID, cbPtr)
2251 return handlerID
2252}
2253
2254// Gets emitted to paste the contents of the clipboard
2255// into the text view.
2256//
2257// The ::paste-clipboard signal is a [keybinding signal](class.SignalAction.html).
2258//
2259// The default bindings for this signal are
2260// <kbd>Ctrl</kbd>+<kbd>v</kbd> and
2261// <kbd>Shift</kbd>+<kbd>Insert</kbd>.
2262func (x *TextView) ConnectPasteClipboard(cb *func(TextView)) uint {
2263 cbPtr := uintptr(unsafe.Pointer(cb))
2264 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2265 handlerID := gobject.SignalConnect(x.GoPointer(), "paste-clipboard", cbRefPtr)
2266 glib.SaveHandlerMapping(handlerID, cbPtr)
2267 return handlerID
2268 }
2269
2270 fcb := func(clsPtr uintptr) {
2271 fa := TextView{}
2272 fa.Ptr = clsPtr
2273 cbFn := *cb
2274
2275 cbFn(fa)
2276
2277 }
2278 cbRefPtr := purego.NewCallback(fcb)
2279 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2280 handlerID := gobject.SignalConnect(x.GoPointer(), "paste-clipboard", cbRefPtr)
2281 glib.SaveHandlerMapping(handlerID, cbPtr)
2282 return handlerID
2283}
2284
2285// Emitted when preedit text of the active IM changes.
2286//
2287// If an input method is used, the typed text will not immediately
2288// be committed to the buffer. So if you are interested in the text,
2289// connect to this signal.
2290//
2291// This signal is only emitted if the text at the given position
2292// is actually editable.
2293func (x *TextView) ConnectPreeditChanged(cb *func(TextView, string)) uint {
2294 cbPtr := uintptr(unsafe.Pointer(cb))
2295 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2296 handlerID := gobject.SignalConnect(x.GoPointer(), "preedit-changed", cbRefPtr)
2297 glib.SaveHandlerMapping(handlerID, cbPtr)
2298 return handlerID
2299 }
2300
2301 fcb := func(clsPtr uintptr, PreeditVarp uintptr) {
2302 fa := TextView{}
2303 fa.Ptr = clsPtr
2304 cbFn := *cb
2305
2306 cbFn(fa, core.GoString(PreeditVarp))
2307
2308 }
2309 cbRefPtr := purego.NewCallback(fcb)
2310 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2311 handlerID := gobject.SignalConnect(x.GoPointer(), "preedit-changed", cbRefPtr)
2312 glib.SaveHandlerMapping(handlerID, cbPtr)
2313 return handlerID
2314}
2315
2316// Gets emitted to select or unselect the complete contents of the text view.
2317//
2318// The ::select-all signal is a [keybinding signal](class.SignalAction.html).
2319//
2320// The default bindings for this signal are
2321// <kbd>Ctrl</kbd>+<kbd>a</kbd> and
2322// <kbd>Ctrl</kbd>+<kbd>/</kbd> for selecting and
2323// <kbd>Shift</kbd>+<kbd>Ctrl</kbd>+<kbd>a</kbd> and
2324// <kbd>Ctrl</kbd>+<kbd>\</kbd> for unselecting.
2325func (x *TextView) ConnectSelectAll(cb *func(TextView, bool)) uint {
2326 cbPtr := uintptr(unsafe.Pointer(cb))
2327 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2328 handlerID := gobject.SignalConnect(x.GoPointer(), "select-all", cbRefPtr)
2329 glib.SaveHandlerMapping(handlerID, cbPtr)
2330 return handlerID
2331 }
2332
2333 fcb := func(clsPtr uintptr, SelectVarp bool) {
2334 fa := TextView{}
2335 fa.Ptr = clsPtr
2336 cbFn := *cb
2337
2338 cbFn(fa, SelectVarp)
2339
2340 }
2341 cbRefPtr := purego.NewCallback(fcb)
2342 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2343 handlerID := gobject.SignalConnect(x.GoPointer(), "select-all", cbRefPtr)
2344 glib.SaveHandlerMapping(handlerID, cbPtr)
2345 return handlerID
2346}
2347
2348// Gets emitted when the user initiates settings the "anchor" mark.
2349//
2350// The ::set-anchor signal is a [keybinding signal](class.SignalAction.html)
2351// which gets emitted when the user initiates setting the "anchor"
2352// mark. The "anchor" mark gets placed at the same position as the
2353// "insert" mark.
2354//
2355// This signal has no default bindings.
2356func (x *TextView) ConnectSetAnchor(cb *func(TextView)) uint {
2357 cbPtr := uintptr(unsafe.Pointer(cb))
2358 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2359 handlerID := gobject.SignalConnect(x.GoPointer(), "set-anchor", cbRefPtr)
2360 glib.SaveHandlerMapping(handlerID, cbPtr)
2361 return handlerID
2362 }
2363
2364 fcb := func(clsPtr uintptr) {
2365 fa := TextView{}
2366 fa.Ptr = clsPtr
2367 cbFn := *cb
2368
2369 cbFn(fa)
2370
2371 }
2372 cbRefPtr := purego.NewCallback(fcb)
2373 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2374 handlerID := gobject.SignalConnect(x.GoPointer(), "set-anchor", cbRefPtr)
2375 glib.SaveHandlerMapping(handlerID, cbPtr)
2376 return handlerID
2377}
2378
2379// Gets emitted to toggle the `cursor-visible` property.
2380//
2381// The ::toggle-cursor-visible signal is a
2382// [keybinding signal](class.SignalAction.html).
2383//
2384// The default binding for this signal is <kbd>F7</kbd>.
2385func (x *TextView) ConnectToggleCursorVisible(cb *func(TextView)) uint {
2386 cbPtr := uintptr(unsafe.Pointer(cb))
2387 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2388 handlerID := gobject.SignalConnect(x.GoPointer(), "toggle-cursor-visible", cbRefPtr)
2389 glib.SaveHandlerMapping(handlerID, cbPtr)
2390 return handlerID
2391 }
2392
2393 fcb := func(clsPtr uintptr) {
2394 fa := TextView{}
2395 fa.Ptr = clsPtr
2396 cbFn := *cb
2397
2398 cbFn(fa)
2399
2400 }
2401 cbRefPtr := purego.NewCallback(fcb)
2402 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2403 handlerID := gobject.SignalConnect(x.GoPointer(), "toggle-cursor-visible", cbRefPtr)
2404 glib.SaveHandlerMapping(handlerID, cbPtr)
2405 return handlerID
2406}
2407
2408// Gets emitted to toggle the overwrite mode of the text view.
2409//
2410// The ::toggle-overwrite signal is a [keybinding signal](class.SignalAction.html).
2411//
2412// The default binding for this signal is <kbd>Insert</kbd>.
2413func (x *TextView) ConnectToggleOverwrite(cb *func(TextView)) uint {
2414 cbPtr := uintptr(unsafe.Pointer(cb))
2415 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2416 handlerID := gobject.SignalConnect(x.GoPointer(), "toggle-overwrite", cbRefPtr)
2417 glib.SaveHandlerMapping(handlerID, cbPtr)
2418 return handlerID
2419 }
2420
2421 fcb := func(clsPtr uintptr) {
2422 fa := TextView{}
2423 fa.Ptr = clsPtr
2424 cbFn := *cb
2425
2426 cbFn(fa)
2427
2428 }
2429 cbRefPtr := purego.NewCallback(fcb)
2430 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2431 handlerID := gobject.SignalConnect(x.GoPointer(), "toggle-overwrite", cbRefPtr)
2432 glib.SaveHandlerMapping(handlerID, cbPtr)
2433 return handlerID
2434}
2435
2436// Requests the user's screen reader to announce the given message.
2437//
2438// This kind of notification is useful for messages that
2439// either have only a visual representation or that are not
2440// exposed visually at all, e.g. a notification about a
2441// successful operation.
2442//
2443// Also, by using this API, you can ensure that the message
2444// does not interrupts the user's current screen reader output.
2445func (x *TextView) Announce(MessageVar string, PriorityVar AccessibleAnnouncementPriority) {
2446
2447 XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar)
2448
2449}
2450
2451// Retrieves the accessible parent for an accessible object.
2452//
2453// This function returns `NULL` for top level widgets.
2454func (x *TextView) GetAccessibleParent() *AccessibleBase {
2455 var cls *AccessibleBase
2456
2457 cret := XGtkAccessibleGetAccessibleParent(x.GoPointer())
2458
2459 if cret == 0 {
2460 return nil
2461 }
2462 cls = &AccessibleBase{}
2463 cls.Ptr = cret
2464 return cls
2465}
2466
2467// Retrieves the accessible role of an accessible object.
2468func (x *TextView) GetAccessibleRole() AccessibleRole {
2469
2470 cret := XGtkAccessibleGetAccessibleRole(x.GoPointer())
2471 return cret
2472}
2473
2474// Retrieves the implementation for the given accessible object.
2475func (x *TextView) GetAtContext() *ATContext {
2476 var cls *ATContext
2477
2478 cret := XGtkAccessibleGetAtContext(x.GoPointer())
2479
2480 if cret == 0 {
2481 return nil
2482 }
2483 cls = &ATContext{}
2484 cls.Ptr = cret
2485 return cls
2486}
2487
2488// Queries the coordinates and dimensions of this accessible
2489//
2490// This functionality can be overridden by `GtkAccessible`
2491// implementations, e.g. to get the bounds from an ignored
2492// child widget.
2493func (x *TextView) GetBounds(XVar *int, YVar *int, WidthVar *int, HeightVar *int) bool {
2494
2495 cret := XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar)
2496 return cret
2497}
2498
2499// Retrieves the first accessible child of an accessible object.
2500func (x *TextView) GetFirstAccessibleChild() *AccessibleBase {
2501 var cls *AccessibleBase
2502
2503 cret := XGtkAccessibleGetFirstAccessibleChild(x.GoPointer())
2504
2505 if cret == 0 {
2506 return nil
2507 }
2508 cls = &AccessibleBase{}
2509 cls.Ptr = cret
2510 return cls
2511}
2512
2513// Retrieves the next accessible sibling of an accessible object
2514func (x *TextView) GetNextAccessibleSibling() *AccessibleBase {
2515 var cls *AccessibleBase
2516
2517 cret := XGtkAccessibleGetNextAccessibleSibling(x.GoPointer())
2518
2519 if cret == 0 {
2520 return nil
2521 }
2522 cls = &AccessibleBase{}
2523 cls.Ptr = cret
2524 return cls
2525}
2526
2527// Queries a platform state, such as focus.
2528//
2529// This functionality can be overridden by `GtkAccessible`
2530// implementations, e.g. to get platform state from an ignored
2531// child widget, as is the case for `GtkText` wrappers.
2532func (x *TextView) GetPlatformState(StateVar AccessiblePlatformState) bool {
2533
2534 cret := XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar)
2535 return cret
2536}
2537
2538// Resets the accessible property to its default value.
2539func (x *TextView) ResetProperty(PropertyVar AccessibleProperty) {
2540
2541 XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar)
2542
2543}
2544
2545// Resets the accessible relation to its default value.
2546func (x *TextView) ResetRelation(RelationVar AccessibleRelation) {
2547
2548 XGtkAccessibleResetRelation(x.GoPointer(), RelationVar)
2549
2550}
2551
2552// Resets the accessible state to its default value.
2553func (x *TextView) ResetState(StateVar AccessibleState) {
2554
2555 XGtkAccessibleResetState(x.GoPointer(), StateVar)
2556
2557}
2558
2559// Sets the parent and sibling of an accessible object.
2560//
2561// This function is meant to be used by accessible implementations that are
2562// not part of the widget hierarchy, and but act as a logical bridge between
2563// widgets. For instance, if a widget creates an object that holds metadata
2564// for each child, and you want that object to implement the `GtkAccessible`
2565// interface, you will use this function to ensure that the parent of each
2566// child widget is the metadata object, and the parent of each metadata
2567// object is the container widget.
2568func (x *TextView) SetAccessibleParent(ParentVar Accessible, NextSiblingVar Accessible) {
2569
2570 XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer())
2571
2572}
2573
2574// Updates the next accessible sibling.
2575//
2576// That might be useful when a new child of a custom accessible
2577// is created, and it needs to be linked to a previous child.
2578func (x *TextView) UpdateNextAccessibleSibling(NewSiblingVar Accessible) {
2579
2580 XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer())
2581
2582}
2583
2584// Informs ATs that the platform state has changed.
2585//
2586// This function should be used by `GtkAccessible` implementations that
2587// have a platform state but are not widgets. Widgets handle platform
2588// states automatically.
2589func (x *TextView) UpdatePlatformState(StateVar AccessiblePlatformState) {
2590
2591 XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar)
2592
2593}
2594
2595// Updates a list of accessible properties.
2596//
2597// See the [enum@Gtk.AccessibleProperty] documentation for the
2598// value types of accessible properties.
2599//
2600// This function should be called by `GtkWidget` types whenever
2601// an accessible property change must be communicated to assistive
2602// technologies.
2603//
2604// Example:
2605// ```c
2606// value = gtk_adjustment_get_value (adjustment);
2607// gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button),
2608//
2609// GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value,
2610// -1);
2611//
2612// ```
2613func (x *TextView) UpdateProperty(FirstPropertyVar AccessibleProperty, varArgs ...interface{}) {
2614
2615 XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...)
2616
2617}
2618
2619// Updates an array of accessible properties.
2620//
2621// This function should be called by `GtkWidget` types whenever an accessible
2622// property change must be communicated to assistive technologies.
2623//
2624// This function is meant to be used by language bindings.
2625func (x *TextView) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []AccessibleProperty, ValuesVar []gobject.Value) {
2626
2627 XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar)
2628
2629}
2630
2631// Updates a list of accessible relations.
2632//
2633// This function should be called by `GtkWidget` types whenever an accessible
2634// relation change must be communicated to assistive technologies.
2635//
2636// If the [enum@Gtk.AccessibleRelation] requires a list of references,
2637// you should pass each reference individually, followed by `NULL`, e.g.
2638//
2639// ```c
2640// gtk_accessible_update_relation (accessible,
2641//
2642// GTK_ACCESSIBLE_RELATION_CONTROLS,
2643// ref1, NULL,
2644// GTK_ACCESSIBLE_RELATION_LABELLED_BY,
2645// ref1, ref2, ref3, NULL,
2646// -1);
2647//
2648// ```
2649func (x *TextView) UpdateRelation(FirstRelationVar AccessibleRelation, varArgs ...interface{}) {
2650
2651 XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...)
2652
2653}
2654
2655// Updates an array of accessible relations.
2656//
2657// This function should be called by `GtkWidget` types whenever an accessible
2658// relation change must be communicated to assistive technologies.
2659//
2660// This function is meant to be used by language bindings.
2661func (x *TextView) UpdateRelationValue(NRelationsVar int, RelationsVar []AccessibleRelation, ValuesVar []gobject.Value) {
2662
2663 XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar)
2664
2665}
2666
2667// Updates a list of accessible states.
2668//
2669// See the [enum@Gtk.AccessibleState] documentation for the
2670// value types of accessible states.
2671//
2672// This function should be called by `GtkWidget` types whenever
2673// an accessible state change must be communicated to assistive
2674// technologies.
2675//
2676// Example:
2677//
2678// ```c
2679// value = GTK_ACCESSIBLE_TRISTATE_MIXED;
2680// gtk_accessible_update_state (GTK_ACCESSIBLE (check_button),
2681//
2682// GTK_ACCESSIBLE_STATE_CHECKED, value,
2683// -1);
2684//
2685// ```
2686func (x *TextView) UpdateState(FirstStateVar AccessibleState, varArgs ...interface{}) {
2687
2688 XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...)
2689
2690}
2691
2692// Updates an array of accessible states.
2693//
2694// This function should be called by `GtkWidget` types whenever an accessible
2695// state change must be communicated to assistive technologies.
2696//
2697// This function is meant to be used by language bindings.
2698func (x *TextView) UpdateStateValue(NStatesVar int, StatesVar []AccessibleState, ValuesVar []gobject.Value) {
2699
2700 XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar)
2701
2702}
2703
2704// Updates the position of the caret.
2705//
2706// Implementations of the `GtkAccessibleText` interface should call this
2707// function every time the caret has moved, in order to notify assistive
2708// technologies.
2709func (x *TextView) UpdateCaretPosition() {
2710
2711 XGtkAccessibleTextUpdateCaretPosition(x.GoPointer())
2712
2713}
2714
2715// Notifies assistive technologies of a change in contents.
2716//
2717// Implementations of the `GtkAccessibleText` interface should call this
2718// function every time their contents change as the result of an operation,
2719// like an insertion or a removal.
2720//
2721// Note: If the change is a deletion, this function must be called *before*
2722// removing the contents, if it is an insertion, it must be called *after*
2723// inserting the new contents.
2724func (x *TextView) UpdateContents(ChangeVar AccessibleTextContentChange, StartVar uint, EndVar uint) {
2725
2726 XGtkAccessibleTextUpdateContents(x.GoPointer(), ChangeVar, StartVar, EndVar)
2727
2728}
2729
2730// Updates the boundary of the selection.
2731//
2732// Implementations of the `GtkAccessibleText` interface should call this
2733// function every time the selection has moved, in order to notify assistive
2734// technologies.
2735func (x *TextView) UpdateSelectionBound() {
2736
2737 XGtkAccessibleTextUpdateSelectionBound(x.GoPointer())
2738
2739}
2740
2741// Gets the ID of the @buildable object.
2742//
2743// `GtkBuilder` sets the name based on the ID attribute
2744// of the `<object>` tag used to construct the @buildable.
2745func (x *TextView) GetBuildableId() string {
2746
2747 cret := XGtkBuildableGetBuildableId(x.GoPointer())
2748 return cret
2749}
2750
2751// Returns the size of a non-scrolling border around the
2752// outside of the scrollable.
2753//
2754// An example for this would be treeview headers. GTK can use
2755// this information to display overlaid graphics, like the
2756// overshoot indication, at the right position.
2757func (x *TextView) GetBorder(BorderVar *Border) bool {
2758
2759 cret := XGtkScrollableGetBorder(x.GoPointer(), BorderVar)
2760 return cret
2761}
2762
2763// Retrieves the `GtkAdjustment` used for horizontal scrolling.
2764func (x *TextView) GetHadjustment() *Adjustment {
2765 var cls *Adjustment
2766
2767 cret := XGtkScrollableGetHadjustment(x.GoPointer())
2768
2769 if cret == 0 {
2770 return nil
2771 }
2772 gobject.IncreaseRef(cret)
2773 cls = &Adjustment{}
2774 cls.Ptr = cret
2775 return cls
2776}
2777
2778// Gets the horizontal `GtkScrollablePolicy`.
2779func (x *TextView) GetHscrollPolicy() ScrollablePolicy {
2780
2781 cret := XGtkScrollableGetHscrollPolicy(x.GoPointer())
2782 return cret
2783}
2784
2785// Retrieves the `GtkAdjustment` used for vertical scrolling.
2786func (x *TextView) GetVadjustment() *Adjustment {
2787 var cls *Adjustment
2788
2789 cret := XGtkScrollableGetVadjustment(x.GoPointer())
2790
2791 if cret == 0 {
2792 return nil
2793 }
2794 gobject.IncreaseRef(cret)
2795 cls = &Adjustment{}
2796 cls.Ptr = cret
2797 return cls
2798}
2799
2800// Gets the vertical `GtkScrollablePolicy`.
2801func (x *TextView) GetVscrollPolicy() ScrollablePolicy {
2802
2803 cret := XGtkScrollableGetVscrollPolicy(x.GoPointer())
2804 return cret
2805}
2806
2807// Sets the horizontal adjustment of the `GtkScrollable`.
2808func (x *TextView) SetHadjustment(HadjustmentVar *Adjustment) {
2809
2810 XGtkScrollableSetHadjustment(x.GoPointer(), HadjustmentVar.GoPointer())
2811
2812}
2813
2814// Sets the `GtkScrollablePolicy`.
2815//
2816// The policy determines whether horizontal scrolling should start
2817// below the minimum width or below the natural width.
2818func (x *TextView) SetHscrollPolicy(PolicyVar ScrollablePolicy) {
2819
2820 XGtkScrollableSetHscrollPolicy(x.GoPointer(), PolicyVar)
2821
2822}
2823
2824// Sets the vertical adjustment of the `GtkScrollable`.
2825func (x *TextView) SetVadjustment(VadjustmentVar *Adjustment) {
2826
2827 XGtkScrollableSetVadjustment(x.GoPointer(), VadjustmentVar.GoPointer())
2828
2829}
2830
2831// Sets the `GtkScrollablePolicy`.
2832//
2833// The policy determines whether vertical scrolling should start
2834// below the minimum height or below the natural height.
2835func (x *TextView) SetVscrollPolicy(PolicyVar ScrollablePolicy) {
2836
2837 XGtkScrollableSetVscrollPolicy(x.GoPointer(), PolicyVar)
2838
2839}
2840
2841func init() {
2842 core.SetPackageName("GTK", "gtk4")
2843 core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"})
2844 var libs []uintptr
2845 for _, libPath := range core.GetPaths("GTK") {
2846 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
2847 if err != nil {
2848 panic(err)
2849 }
2850 libs = append(libs, lib)
2851 }
2852
2853 core.PuregoSafeRegister(&xTextExtendSelectionGLibType, libs, "gtk_text_extend_selection_get_type")
2854
2855 core.PuregoSafeRegister(&xTextViewLayerGLibType, libs, "gtk_text_view_layer_get_type")
2856
2857 core.PuregoSafeRegister(&xTextWindowTypeGLibType, libs, "gtk_text_window_type_get_type")
2858
2859 core.PuregoSafeRegister(&xTextViewGLibType, libs, "gtk_text_view_get_type")
2860
2861 core.PuregoSafeRegister(&xNewTextView, libs, "gtk_text_view_new")
2862 core.PuregoSafeRegister(&xNewTextViewWithBuffer, libs, "gtk_text_view_new_with_buffer")
2863
2864 core.PuregoSafeRegister(&xTextViewAddChildAtAnchor, libs, "gtk_text_view_add_child_at_anchor")
2865 core.PuregoSafeRegister(&xTextViewAddOverlay, libs, "gtk_text_view_add_overlay")
2866 core.PuregoSafeRegister(&xTextViewBackwardDisplayLine, libs, "gtk_text_view_backward_display_line")
2867 core.PuregoSafeRegister(&xTextViewBackwardDisplayLineStart, libs, "gtk_text_view_backward_display_line_start")
2868 core.PuregoSafeRegister(&xTextViewBufferToWindowCoords, libs, "gtk_text_view_buffer_to_window_coords")
2869 core.PuregoSafeRegister(&xTextViewForwardDisplayLine, libs, "gtk_text_view_forward_display_line")
2870 core.PuregoSafeRegister(&xTextViewForwardDisplayLineEnd, libs, "gtk_text_view_forward_display_line_end")
2871 core.PuregoSafeRegister(&xTextViewGetAcceptsTab, libs, "gtk_text_view_get_accepts_tab")
2872 core.PuregoSafeRegister(&xTextViewGetBottomMargin, libs, "gtk_text_view_get_bottom_margin")
2873 core.PuregoSafeRegister(&xTextViewGetBuffer, libs, "gtk_text_view_get_buffer")
2874 core.PuregoSafeRegister(&xTextViewGetCursorLocations, libs, "gtk_text_view_get_cursor_locations")
2875 core.PuregoSafeRegister(&xTextViewGetCursorVisible, libs, "gtk_text_view_get_cursor_visible")
2876 core.PuregoSafeRegister(&xTextViewGetEditable, libs, "gtk_text_view_get_editable")
2877 core.PuregoSafeRegister(&xTextViewGetExtraMenu, libs, "gtk_text_view_get_extra_menu")
2878 core.PuregoSafeRegister(&xTextViewGetGutter, libs, "gtk_text_view_get_gutter")
2879 core.PuregoSafeRegister(&xTextViewGetIndent, libs, "gtk_text_view_get_indent")
2880 core.PuregoSafeRegister(&xTextViewGetInputHints, libs, "gtk_text_view_get_input_hints")
2881 core.PuregoSafeRegister(&xTextViewGetInputPurpose, libs, "gtk_text_view_get_input_purpose")
2882 core.PuregoSafeRegister(&xTextViewGetIterAtLocation, libs, "gtk_text_view_get_iter_at_location")
2883 core.PuregoSafeRegister(&xTextViewGetIterAtPosition, libs, "gtk_text_view_get_iter_at_position")
2884 core.PuregoSafeRegister(&xTextViewGetIterLocation, libs, "gtk_text_view_get_iter_location")
2885 core.PuregoSafeRegister(&xTextViewGetJustification, libs, "gtk_text_view_get_justification")
2886 core.PuregoSafeRegister(&xTextViewGetLeftMargin, libs, "gtk_text_view_get_left_margin")
2887 core.PuregoSafeRegister(&xTextViewGetLineAtY, libs, "gtk_text_view_get_line_at_y")
2888 core.PuregoSafeRegister(&xTextViewGetLineYrange, libs, "gtk_text_view_get_line_yrange")
2889 core.PuregoSafeRegister(&xTextViewGetLtrContext, libs, "gtk_text_view_get_ltr_context")
2890 core.PuregoSafeRegister(&xTextViewGetMonospace, libs, "gtk_text_view_get_monospace")
2891 core.PuregoSafeRegister(&xTextViewGetOverwrite, libs, "gtk_text_view_get_overwrite")
2892 core.PuregoSafeRegister(&xTextViewGetPixelsAboveLines, libs, "gtk_text_view_get_pixels_above_lines")
2893 core.PuregoSafeRegister(&xTextViewGetPixelsBelowLines, libs, "gtk_text_view_get_pixels_below_lines")
2894 core.PuregoSafeRegister(&xTextViewGetPixelsInsideWrap, libs, "gtk_text_view_get_pixels_inside_wrap")
2895 core.PuregoSafeRegister(&xTextViewGetRightMargin, libs, "gtk_text_view_get_right_margin")
2896 core.PuregoSafeRegister(&xTextViewGetRtlContext, libs, "gtk_text_view_get_rtl_context")
2897 core.PuregoSafeRegister(&xTextViewGetTabs, libs, "gtk_text_view_get_tabs")
2898 core.PuregoSafeRegister(&xTextViewGetTopMargin, libs, "gtk_text_view_get_top_margin")
2899 core.PuregoSafeRegister(&xTextViewGetVisibleOffset, libs, "gtk_text_view_get_visible_offset")
2900 core.PuregoSafeRegister(&xTextViewGetVisibleRect, libs, "gtk_text_view_get_visible_rect")
2901 core.PuregoSafeRegister(&xTextViewGetWrapMode, libs, "gtk_text_view_get_wrap_mode")
2902 core.PuregoSafeRegister(&xTextViewImContextFilterKeypress, libs, "gtk_text_view_im_context_filter_keypress")
2903 core.PuregoSafeRegister(&xTextViewMoveMarkOnscreen, libs, "gtk_text_view_move_mark_onscreen")
2904 core.PuregoSafeRegister(&xTextViewMoveOverlay, libs, "gtk_text_view_move_overlay")
2905 core.PuregoSafeRegister(&xTextViewMoveVisually, libs, "gtk_text_view_move_visually")
2906 core.PuregoSafeRegister(&xTextViewPlaceCursorOnscreen, libs, "gtk_text_view_place_cursor_onscreen")
2907 core.PuregoSafeRegister(&xTextViewRemove, libs, "gtk_text_view_remove")
2908 core.PuregoSafeRegister(&xTextViewResetCursorBlink, libs, "gtk_text_view_reset_cursor_blink")
2909 core.PuregoSafeRegister(&xTextViewResetImContext, libs, "gtk_text_view_reset_im_context")
2910 core.PuregoSafeRegister(&xTextViewScrollMarkOnscreen, libs, "gtk_text_view_scroll_mark_onscreen")
2911 core.PuregoSafeRegister(&xTextViewScrollToIter, libs, "gtk_text_view_scroll_to_iter")
2912 core.PuregoSafeRegister(&xTextViewScrollToMark, libs, "gtk_text_view_scroll_to_mark")
2913 core.PuregoSafeRegister(&xTextViewSetAcceptsTab, libs, "gtk_text_view_set_accepts_tab")
2914 core.PuregoSafeRegister(&xTextViewSetBottomMargin, libs, "gtk_text_view_set_bottom_margin")
2915 core.PuregoSafeRegister(&xTextViewSetBuffer, libs, "gtk_text_view_set_buffer")
2916 core.PuregoSafeRegister(&xTextViewSetCursorVisible, libs, "gtk_text_view_set_cursor_visible")
2917 core.PuregoSafeRegister(&xTextViewSetEditable, libs, "gtk_text_view_set_editable")
2918 core.PuregoSafeRegister(&xTextViewSetExtraMenu, libs, "gtk_text_view_set_extra_menu")
2919 core.PuregoSafeRegister(&xTextViewSetGutter, libs, "gtk_text_view_set_gutter")
2920 core.PuregoSafeRegister(&xTextViewSetIndent, libs, "gtk_text_view_set_indent")
2921 core.PuregoSafeRegister(&xTextViewSetInputHints, libs, "gtk_text_view_set_input_hints")
2922 core.PuregoSafeRegister(&xTextViewSetInputPurpose, libs, "gtk_text_view_set_input_purpose")
2923 core.PuregoSafeRegister(&xTextViewSetJustification, libs, "gtk_text_view_set_justification")
2924 core.PuregoSafeRegister(&xTextViewSetLeftMargin, libs, "gtk_text_view_set_left_margin")
2925 core.PuregoSafeRegister(&xTextViewSetMonospace, libs, "gtk_text_view_set_monospace")
2926 core.PuregoSafeRegister(&xTextViewSetOverwrite, libs, "gtk_text_view_set_overwrite")
2927 core.PuregoSafeRegister(&xTextViewSetPixelsAboveLines, libs, "gtk_text_view_set_pixels_above_lines")
2928 core.PuregoSafeRegister(&xTextViewSetPixelsBelowLines, libs, "gtk_text_view_set_pixels_below_lines")
2929 core.PuregoSafeRegister(&xTextViewSetPixelsInsideWrap, libs, "gtk_text_view_set_pixels_inside_wrap")
2930 core.PuregoSafeRegister(&xTextViewSetRightMargin, libs, "gtk_text_view_set_right_margin")
2931 core.PuregoSafeRegister(&xTextViewSetTabs, libs, "gtk_text_view_set_tabs")
2932 core.PuregoSafeRegister(&xTextViewSetTopMargin, libs, "gtk_text_view_set_top_margin")
2933 core.PuregoSafeRegister(&xTextViewSetWrapMode, libs, "gtk_text_view_set_wrap_mode")
2934 core.PuregoSafeRegister(&xTextViewStartsDisplayLine, libs, "gtk_text_view_starts_display_line")
2935 core.PuregoSafeRegister(&xTextViewWindowToBufferCoords, libs, "gtk_text_view_window_to_buffer_coords")
2936
2937}