gtktextchild.go RawHistoryFolder
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/gobject"
12 "github.com/bnema/puregotk/v4/gobject/types"
13)
14
15type TextChildAnchorClass struct {
16 _ structs.HostLayout
17
18 ParentClass gobject.ObjectClass
19
20 xGtkReserved1 uintptr
21
22 xGtkReserved2 uintptr
23
24 xGtkReserved3 uintptr
25
26 xGtkReserved4 uintptr
27}
28
29func (x *TextChildAnchorClass) GoPointer() uintptr {
30 return uintptr(unsafe.Pointer(x))
31}
32
33// OverrideGtkReserved1 sets the "_gtk_reserved1" callback function.
34func (x *TextChildAnchorClass) OverrideGtkReserved1(cb func()) {
35 if cb == nil {
36 x.xGtkReserved1 = 0
37 } else {
38 x.xGtkReserved1 = purego.NewCallback(func() {
39 cb()
40 })
41 }
42}
43
44// GetGtkReserved1 gets the "_gtk_reserved1" callback function.
45func (x *TextChildAnchorClass) GetGtkReserved1() func() {
46 if x.xGtkReserved1 == 0 {
47 return nil
48 }
49 var rawCallback func()
50 purego.RegisterFunc(&rawCallback, x.xGtkReserved1)
51 return func() {
52 rawCallback()
53 }
54}
55
56// OverrideGtkReserved2 sets the "_gtk_reserved2" callback function.
57func (x *TextChildAnchorClass) OverrideGtkReserved2(cb func()) {
58 if cb == nil {
59 x.xGtkReserved2 = 0
60 } else {
61 x.xGtkReserved2 = purego.NewCallback(func() {
62 cb()
63 })
64 }
65}
66
67// GetGtkReserved2 gets the "_gtk_reserved2" callback function.
68func (x *TextChildAnchorClass) GetGtkReserved2() func() {
69 if x.xGtkReserved2 == 0 {
70 return nil
71 }
72 var rawCallback func()
73 purego.RegisterFunc(&rawCallback, x.xGtkReserved2)
74 return func() {
75 rawCallback()
76 }
77}
78
79// OverrideGtkReserved3 sets the "_gtk_reserved3" callback function.
80func (x *TextChildAnchorClass) OverrideGtkReserved3(cb func()) {
81 if cb == nil {
82 x.xGtkReserved3 = 0
83 } else {
84 x.xGtkReserved3 = purego.NewCallback(func() {
85 cb()
86 })
87 }
88}
89
90// GetGtkReserved3 gets the "_gtk_reserved3" callback function.
91func (x *TextChildAnchorClass) GetGtkReserved3() func() {
92 if x.xGtkReserved3 == 0 {
93 return nil
94 }
95 var rawCallback func()
96 purego.RegisterFunc(&rawCallback, x.xGtkReserved3)
97 return func() {
98 rawCallback()
99 }
100}
101
102// OverrideGtkReserved4 sets the "_gtk_reserved4" callback function.
103func (x *TextChildAnchorClass) OverrideGtkReserved4(cb func()) {
104 if cb == nil {
105 x.xGtkReserved4 = 0
106 } else {
107 x.xGtkReserved4 = purego.NewCallback(func() {
108 cb()
109 })
110 }
111}
112
113// GetGtkReserved4 gets the "_gtk_reserved4" callback function.
114func (x *TextChildAnchorClass) GetGtkReserved4() func() {
115 if x.xGtkReserved4 == 0 {
116 return nil
117 }
118 var rawCallback func()
119 purego.RegisterFunc(&rawCallback, x.xGtkReserved4)
120 return func() {
121 rawCallback()
122 }
123}
124
125// Marks a spot in a `GtkTextBuffer` where child widgets can be “anchored”.
126//
127// The anchor can have multiple widgets anchored, to allow for multiple views.
128type TextChildAnchor struct {
129 gobject.Object
130}
131
132var xTextChildAnchorGLibType func() types.GType
133
134func TextChildAnchorGLibType() types.GType {
135 return xTextChildAnchorGLibType()
136}
137
138func TextChildAnchorNewFromInternalPtr(ptr uintptr) *TextChildAnchor {
139 cls := &TextChildAnchor{}
140 cls.Ptr = ptr
141 return cls
142}
143
144var xNewTextChildAnchor func() uintptr
145
146// Creates a new `GtkTextChildAnchor`.
147//
148// Usually you would then insert it into a `GtkTextBuffer` with
149// [method@Gtk.TextBuffer.insert_child_anchor]. To perform the
150// creation and insertion in one step, use the convenience
151// function [method@Gtk.TextBuffer.create_child_anchor].
152func NewTextChildAnchor() *TextChildAnchor {
153 var cls *TextChildAnchor
154
155 cret := xNewTextChildAnchor()
156
157 if cret == 0 {
158 return nil
159 }
160 cls = &TextChildAnchor{}
161 cls.Ptr = cret
162 return cls
163}
164
165var xNewTextChildAnchorWithReplacement func(string) uintptr
166
167// Creates a new `GtkTextChildAnchor` with the given replacement character.
168//
169// Usually you would then insert it into a `GtkTextBuffer` with
170// [method@Gtk.TextBuffer.insert_child_anchor].
171func NewTextChildAnchorWithReplacement(CharacterVar string) *TextChildAnchor {
172 var cls *TextChildAnchor
173
174 cret := xNewTextChildAnchorWithReplacement(CharacterVar)
175
176 if cret == 0 {
177 return nil
178 }
179 cls = &TextChildAnchor{}
180 cls.Ptr = cret
181 return cls
182}
183
184var xTextChildAnchorGetDeleted func(uintptr) bool
185
186// Determines whether a child anchor has been deleted from
187// the buffer.
188//
189// Keep in mind that the child anchor will be unreferenced
190// when removed from the buffer, so you need to hold your own
191// reference (with g_object_ref()) if you plan to use this
192// function — otherwise all deleted child anchors will also
193// be finalized.
194func (x *TextChildAnchor) GetDeleted() bool {
195
196 cret := xTextChildAnchorGetDeleted(x.GoPointer())
197 return cret
198}
199
200var xTextChildAnchorGetWidgets func(uintptr, *uint) uintptr
201
202// Gets a list of all widgets anchored at this child anchor.
203//
204// The order in which the widgets are returned is not defined.
205func (x *TextChildAnchor) GetWidgets(OutLenVar *uint) uintptr {
206
207 cret := xTextChildAnchorGetWidgets(x.GoPointer(), OutLenVar)
208 return cret
209}
210
211func (c *TextChildAnchor) GoPointer() uintptr {
212 if c == nil {
213 return 0
214 }
215 return c.Ptr
216}
217
218func (c *TextChildAnchor) SetGoPointer(ptr uintptr) {
219 c.Ptr = ptr
220}
221
222func init() {
223 core.SetPackageName("GTK", "gtk4")
224 core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"})
225 var libs []uintptr
226 for _, libPath := range core.GetPaths("GTK") {
227 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
228 if err != nil {
229 panic(err)
230 }
231 libs = append(libs, lib)
232 }
233
234 core.PuregoSafeRegister(&xTextChildAnchorGLibType, libs, "gtk_text_child_anchor_get_type")
235
236 core.PuregoSafeRegister(&xNewTextChildAnchor, libs, "gtk_text_child_anchor_new")
237 core.PuregoSafeRegister(&xNewTextChildAnchorWithReplacement, libs, "gtk_text_child_anchor_new_with_replacement")
238
239 core.PuregoSafeRegister(&xTextChildAnchorGetDeleted, libs, "gtk_text_child_anchor_get_deleted")
240 core.PuregoSafeRegister(&xTextChildAnchorGetWidgets, libs, "gtk_text_child_anchor_get_widgets")
241
242}