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 WindowHandleClass struct {
16 _ structs.HostLayout
17
18 ParentClass WidgetClass
19}
20
21func (x *WindowHandleClass) GoPointer() uintptr {
22 return uintptr(unsafe.Pointer(x))
23}
24
25// Implements titlebar functionality for a window.
26//
27// When added into a window, it can be dragged to move the window,
28// and it implements the right click, double click and middle click
29// behaviors that are expected of a titlebar.
30//
31// # CSS nodes
32//
33// `GtkWindowHandle` has a single CSS node with the name `windowhandle`.
34//
35// # Accessibility
36//
37// Until GTK 4.10, `GtkWindowHandle` used the [enum@Gtk.AccessibleRole.group] role.
38//
39// Starting from GTK 4.12, `GtkWindowHandle` uses the [enum@Gtk.AccessibleRole.generic]
40// role.
41type WindowHandle struct {
42 Widget
43}
44
45var xWindowHandleGLibType func() types.GType
46
47func WindowHandleGLibType() types.GType {
48 return xWindowHandleGLibType()
49}
50
51func WindowHandleNewFromInternalPtr(ptr uintptr) *WindowHandle {
52 cls := &WindowHandle{}
53 cls.Ptr = ptr
54 return cls
55}
56
57var xNewWindowHandle func() uintptr
58
59// Creates a new `GtkWindowHandle`.
60func NewWindowHandle() *WindowHandle {
61 var cls *WindowHandle
62
63 cret := xNewWindowHandle()
64
65 if cret == 0 {
66 return nil
67 }
68 gobject.IncreaseRef(cret)
69 cls = &WindowHandle{}
70 cls.Ptr = cret
71 return cls
72}
73
74var xWindowHandleGetChild func(uintptr) uintptr
75
76// Gets the child widget of @self.
77func (x *WindowHandle) GetChild() *Widget {
78 var cls *Widget
79
80 cret := xWindowHandleGetChild(x.GoPointer())
81
82 if cret == 0 {
83 return nil
84 }
85 gobject.IncreaseRef(cret)
86 cls = &Widget{}
87 cls.Ptr = cret
88 return cls
89}
90
91var xWindowHandleSetChild func(uintptr, uintptr)
92
93// Sets the child widget of @self.
94func (x *WindowHandle) SetChild(ChildVar *Widget) {
95
96 xWindowHandleSetChild(x.GoPointer(), ChildVar.GoPointer())
97
98}
99
100func (c *WindowHandle) GoPointer() uintptr {
101 if c == nil {
102 return 0
103 }
104 return c.Ptr
105}
106
107func (c *WindowHandle) SetGoPointer(ptr uintptr) {
108 c.Ptr = ptr
109}
110
111// Requests the user's screen reader to announce the given message.
112//
113// This kind of notification is useful for messages that
114// either have only a visual representation or that are not
115// exposed visually at all, e.g. a notification about a
116// successful operation.
117//
118// Also, by using this API, you can ensure that the message
119// does not interrupts the user's current screen reader output.
120func (x *WindowHandle) Announce(MessageVar string, PriorityVar AccessibleAnnouncementPriority) {
121
122 XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar)
123
124}
125
126// Retrieves the accessible parent for an accessible object.
127//
128// This function returns `NULL` for top level widgets.
129func (x *WindowHandle) GetAccessibleParent() *AccessibleBase {
130 var cls *AccessibleBase
131
132 cret := XGtkAccessibleGetAccessibleParent(x.GoPointer())
133
134 if cret == 0 {
135 return nil
136 }
137 cls = &AccessibleBase{}
138 cls.Ptr = cret
139 return cls
140}
141
142// Retrieves the accessible role of an accessible object.
143func (x *WindowHandle) GetAccessibleRole() AccessibleRole {
144
145 cret := XGtkAccessibleGetAccessibleRole(x.GoPointer())
146 return cret
147}
148
149// Retrieves the implementation for the given accessible object.
150func (x *WindowHandle) GetAtContext() *ATContext {
151 var cls *ATContext
152
153 cret := XGtkAccessibleGetAtContext(x.GoPointer())
154
155 if cret == 0 {
156 return nil
157 }
158 cls = &ATContext{}
159 cls.Ptr = cret
160 return cls
161}
162
163// Queries the coordinates and dimensions of this accessible
164//
165// This functionality can be overridden by `GtkAccessible`
166// implementations, e.g. to get the bounds from an ignored
167// child widget.
168func (x *WindowHandle) GetBounds(XVar *int, YVar *int, WidthVar *int, HeightVar *int) bool {
169
170 cret := XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar)
171 return cret
172}
173
174// Retrieves the first accessible child of an accessible object.
175func (x *WindowHandle) GetFirstAccessibleChild() *AccessibleBase {
176 var cls *AccessibleBase
177
178 cret := XGtkAccessibleGetFirstAccessibleChild(x.GoPointer())
179
180 if cret == 0 {
181 return nil
182 }
183 cls = &AccessibleBase{}
184 cls.Ptr = cret
185 return cls
186}
187
188// Retrieves the next accessible sibling of an accessible object
189func (x *WindowHandle) GetNextAccessibleSibling() *AccessibleBase {
190 var cls *AccessibleBase
191
192 cret := XGtkAccessibleGetNextAccessibleSibling(x.GoPointer())
193
194 if cret == 0 {
195 return nil
196 }
197 cls = &AccessibleBase{}
198 cls.Ptr = cret
199 return cls
200}
201
202// Queries a platform state, such as focus.
203//
204// This functionality can be overridden by `GtkAccessible`
205// implementations, e.g. to get platform state from an ignored
206// child widget, as is the case for `GtkText` wrappers.
207func (x *WindowHandle) GetPlatformState(StateVar AccessiblePlatformState) bool {
208
209 cret := XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar)
210 return cret
211}
212
213// Resets the accessible property to its default value.
214func (x *WindowHandle) ResetProperty(PropertyVar AccessibleProperty) {
215
216 XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar)
217
218}
219
220// Resets the accessible relation to its default value.
221func (x *WindowHandle) ResetRelation(RelationVar AccessibleRelation) {
222
223 XGtkAccessibleResetRelation(x.GoPointer(), RelationVar)
224
225}
226
227// Resets the accessible state to its default value.
228func (x *WindowHandle) ResetState(StateVar AccessibleState) {
229
230 XGtkAccessibleResetState(x.GoPointer(), StateVar)
231
232}
233
234// Sets the parent and sibling of an accessible object.
235//
236// This function is meant to be used by accessible implementations that are
237// not part of the widget hierarchy, and but act as a logical bridge between
238// widgets. For instance, if a widget creates an object that holds metadata
239// for each child, and you want that object to implement the `GtkAccessible`
240// interface, you will use this function to ensure that the parent of each
241// child widget is the metadata object, and the parent of each metadata
242// object is the container widget.
243func (x *WindowHandle) SetAccessibleParent(ParentVar Accessible, NextSiblingVar Accessible) {
244
245 XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer())
246
247}
248
249// Updates the next accessible sibling.
250//
251// That might be useful when a new child of a custom accessible
252// is created, and it needs to be linked to a previous child.
253func (x *WindowHandle) UpdateNextAccessibleSibling(NewSiblingVar Accessible) {
254
255 XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer())
256
257}
258
259// Informs ATs that the platform state has changed.
260//
261// This function should be used by `GtkAccessible` implementations that
262// have a platform state but are not widgets. Widgets handle platform
263// states automatically.
264func (x *WindowHandle) UpdatePlatformState(StateVar AccessiblePlatformState) {
265
266 XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar)
267
268}
269
270// Updates a list of accessible properties.
271//
272// See the [enum@Gtk.AccessibleProperty] documentation for the
273// value types of accessible properties.
274//
275// This function should be called by `GtkWidget` types whenever
276// an accessible property change must be communicated to assistive
277// technologies.
278//
279// Example:
280// ```c
281// value = gtk_adjustment_get_value (adjustment);
282// gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button),
283//
284// GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value,
285// -1);
286//
287// ```
288func (x *WindowHandle) UpdateProperty(FirstPropertyVar AccessibleProperty, varArgs ...interface{}) {
289
290 XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...)
291
292}
293
294// Updates an array of accessible properties.
295//
296// This function should be called by `GtkWidget` types whenever an accessible
297// property change must be communicated to assistive technologies.
298//
299// This function is meant to be used by language bindings.
300func (x *WindowHandle) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []AccessibleProperty, ValuesVar []gobject.Value) {
301
302 XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar)
303
304}
305
306// Updates a list of accessible relations.
307//
308// This function should be called by `GtkWidget` types whenever an accessible
309// relation change must be communicated to assistive technologies.
310//
311// If the [enum@Gtk.AccessibleRelation] requires a list of references,
312// you should pass each reference individually, followed by `NULL`, e.g.
313//
314// ```c
315// gtk_accessible_update_relation (accessible,
316//
317// GTK_ACCESSIBLE_RELATION_CONTROLS,
318// ref1, NULL,
319// GTK_ACCESSIBLE_RELATION_LABELLED_BY,
320// ref1, ref2, ref3, NULL,
321// -1);
322//
323// ```
324func (x *WindowHandle) UpdateRelation(FirstRelationVar AccessibleRelation, varArgs ...interface{}) {
325
326 XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...)
327
328}
329
330// Updates an array of accessible relations.
331//
332// This function should be called by `GtkWidget` types whenever an accessible
333// relation change must be communicated to assistive technologies.
334//
335// This function is meant to be used by language bindings.
336func (x *WindowHandle) UpdateRelationValue(NRelationsVar int, RelationsVar []AccessibleRelation, ValuesVar []gobject.Value) {
337
338 XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar)
339
340}
341
342// Updates a list of accessible states.
343//
344// See the [enum@Gtk.AccessibleState] documentation for the
345// value types of accessible states.
346//
347// This function should be called by `GtkWidget` types whenever
348// an accessible state change must be communicated to assistive
349// technologies.
350//
351// Example:
352//
353// ```c
354// value = GTK_ACCESSIBLE_TRISTATE_MIXED;
355// gtk_accessible_update_state (GTK_ACCESSIBLE (check_button),
356//
357// GTK_ACCESSIBLE_STATE_CHECKED, value,
358// -1);
359//
360// ```
361func (x *WindowHandle) UpdateState(FirstStateVar AccessibleState, varArgs ...interface{}) {
362
363 XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...)
364
365}
366
367// Updates an array of accessible states.
368//
369// This function should be called by `GtkWidget` types whenever an accessible
370// state change must be communicated to assistive technologies.
371//
372// This function is meant to be used by language bindings.
373func (x *WindowHandle) UpdateStateValue(NStatesVar int, StatesVar []AccessibleState, ValuesVar []gobject.Value) {
374
375 XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar)
376
377}
378
379// Gets the ID of the @buildable object.
380//
381// `GtkBuilder` sets the name based on the ID attribute
382// of the `<object>` tag used to construct the @buildable.
383func (x *WindowHandle) GetBuildableId() string {
384
385 cret := XGtkBuildableGetBuildableId(x.GoPointer())
386 return cret
387}
388
389func init() {
390 core.SetPackageName("GTK", "gtk4")
391 core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"})
392 var libs []uintptr
393 for _, libPath := range core.GetPaths("GTK") {
394 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
395 if err != nil {
396 panic(err)
397 }
398 libs = append(libs, lib)
399 }
400
401 core.PuregoSafeRegister(&xWindowHandleGLibType, libs, "gtk_window_handle_get_type")
402
403 core.PuregoSafeRegister(&xNewWindowHandle, libs, "gtk_window_handle_new")
404
405 core.PuregoSafeRegister(&xWindowHandleGetChild, libs, "gtk_window_handle_get_child")
406 core.PuregoSafeRegister(&xWindowHandleSetChild, libs, "gtk_window_handle_set_child")
407
408}