detached eae1610

Gen: Re-run script

commit
eae1610c7d83f854f1f5ca132ae5392905192913
author
Jeroen Wijenbergh · · 2025-10-22 07:52 UTC
parent
048deed
signature
SSH UnverifiedSHA256:8N5EoON8reSTMm461SyWlzRhib6IymBjUHb1p62kwyw The key is unknown
113 files · +4663 -3979

this diff holds invisible characters (direction controls, zero-width characters). They are shown as <U+XXXX> markers, never applied.

M v4/adw/adw-application.go +18 -0
@@ -36,6 +36,15 @@ func (x *ApplicationClass) GoPointer() uintptr {
3636 //
3737 // ## Automatic Resources
3838 //
39+// ### Shortcuts Dialog
40+//
41+// If there's a resource located at `shortcuts-dialog.ui` which defines an
42+// [class@ShortcutsDialog] with the ID `shortcuts_dialog`, `AdwApplication`
43+// will set up an `app.shortcuts` action that creates and presents this dialog,
44+// as well as a &lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;?&lt;/kbd&gt; accelerator for it.
45+//
46+// ### Stylesheet
47+//
3948 // `AdwApplication` will automatically load stylesheets located in the
4049 // application's resource base path (see
4150 // [method@Gio.Application.set_resource_base_path], if they're present.
@@ -52,6 +61,15 @@ func (x *ApplicationClass) GoPointer() uintptr {
5261 //
5362 // - `style-hc-dark.css` contains styles used when the system high contrast
5463 // preference is enabled and [property@StyleManager:dark] is `TRUE`.
64+//
65+// :::note
66+//
67+// `style.css` can contain styles for dark and high contrast appearance as
68+// well, using media queries:
69+//
70+// - `prefers-color-scheme: dark` for styles used only for dark appearance.
71+// - `prefers-contrast: more` for styles used only when the system high
72+// contrast preference is enabled.
5573 type Application struct {
5674 gtk.Application
5775 }
M v4/adw/adw-preferences-group.go +34 -0
@@ -7,6 +7,8 @@ import (
77
88 "github.com/jwijenbergh/purego"
99 "github.com/jwijenbergh/puregotk/pkg/core"
10+ "github.com/jwijenbergh/puregotk/v4/gio"
11+ "github.com/jwijenbergh/puregotk/v4/glib"
1012 "github.com/jwijenbergh/puregotk/v4/gobject"
1113 "github.com/jwijenbergh/puregotk/v4/gobject/types"
1214 "github.com/jwijenbergh/puregotk/v4/gtk"
@@ -104,6 +106,17 @@ func (x *PreferencesGroup) Add(ChildVar *gtk.Widget) {
104106
105107 }
106108
109+var xPreferencesGroupBindModel func(uintptr, uintptr, uintptr, uintptr, uintptr)
110+
111+// Binds @model to @self.
112+//
113+// See [method@Gtk.ListBox.bind_model].
114+func (x *PreferencesGroup) BindModel(ModelVar gio.ListModel, CreateRowFuncVar *gtk.ListBoxCreateWidgetFunc, UserDataVar uintptr, UserDataFreeFuncVar *glib.DestroyNotify) {
115+
116+ xPreferencesGroupBindModel(x.GoPointer(), ModelVar.GoPointer(), glib.NewCallbackNullable(CreateRowFuncVar), UserDataVar, glib.NewCallback(UserDataFreeFuncVar))
117+
118+}
119+
107120 var xPreferencesGroupGetDescription func(uintptr) string
108121
109122 // Gets the description of @self.
@@ -130,6 +143,25 @@ func (x *PreferencesGroup) GetHeaderSuffix() *gtk.Widget {
130143 return cls
131144 }
132145
146+var xPreferencesGroupGetRow func(uintptr, uint) uintptr
147+
148+// Gets the row at @index.
149+//
150+// Can return `NULL` if @index is larger than the number of rows in the group.
151+func (x *PreferencesGroup) GetRow(IndexVar uint) *gtk.Widget {
152+ var cls *gtk.Widget
153+
154+ cret := xPreferencesGroupGetRow(x.GoPointer(), IndexVar)
155+
156+ if cret == 0 {
157+ return nil
158+ }
159+ gobject.IncreaseRef(cret)
160+ cls = &gtk.Widget{}
161+ cls.Ptr = cret
162+ return cls
163+}
164+
133165 var xPreferencesGroupGetSeparateRows func(uintptr) bool
134166
135167 // Gets whether @self's rows are separated.
@@ -507,8 +539,10 @@ func init() {
507539 core.PuregoSafeRegister(&xNewPreferencesGroup, libs, "adw_preferences_group_new")
508540
509541 core.PuregoSafeRegister(&xPreferencesGroupAdd, libs, "adw_preferences_group_add")
542+ core.PuregoSafeRegister(&xPreferencesGroupBindModel, libs, "adw_preferences_group_bind_model")
510543 core.PuregoSafeRegister(&xPreferencesGroupGetDescription, libs, "adw_preferences_group_get_description")
511544 core.PuregoSafeRegister(&xPreferencesGroupGetHeaderSuffix, libs, "adw_preferences_group_get_header_suffix")
545+ core.PuregoSafeRegister(&xPreferencesGroupGetRow, libs, "adw_preferences_group_get_row")
512546 core.PuregoSafeRegister(&xPreferencesGroupGetSeparateRows, libs, "adw_preferences_group_get_separate_rows")
513547 core.PuregoSafeRegister(&xPreferencesGroupGetTitle, libs, "adw_preferences_group_get_title")
514548 core.PuregoSafeRegister(&xPreferencesGroupRemove, libs, "adw_preferences_group_remove")
M v4/adw/adw-preferences-page.go +33 -0
@@ -120,6 +120,25 @@ func (x *PreferencesPage) GetDescriptionCentered() bool {
120120 return cret
121121 }
122122
123+var xPreferencesPageGetGroup func(uintptr, uint) uintptr
124+
125+// Gets the group at @index.
126+//
127+// Can return `NULL` if @index is larger than the number of groups in the page.
128+func (x *PreferencesPage) GetGroup(IndexVar uint) *PreferencesGroup {
129+ var cls *PreferencesGroup
130+
131+ cret := xPreferencesPageGetGroup(x.GoPointer(), IndexVar)
132+
133+ if cret == 0 {
134+ return nil
135+ }
136+ gobject.IncreaseRef(cret)
137+ cls = &PreferencesGroup{}
138+ cls.Ptr = cret
139+ return cls
140+}
141+
123142 var xPreferencesPageGetIconName func(uintptr) string
124143
125144 // Gets the icon name for @self.
@@ -156,6 +175,18 @@ func (x *PreferencesPage) GetUseUnderline() bool {
156175 return cret
157176 }
158177
178+var xPreferencesPageInsert func(uintptr, uintptr, int)
179+
180+// Inserts a preferences group to @self at @index.
181+//
182+// If @index is negative or larger than the number of groups, appends the group,
183+// same as [method@PreferencesPage.add].
184+func (x *PreferencesPage) Insert(GroupVar *PreferencesGroup, IndexVar int) {
185+
186+ xPreferencesPageInsert(x.GoPointer(), GroupVar.GoPointer(), IndexVar)
187+
188+}
189+
159190 var xPreferencesPageRemove func(uintptr, uintptr)
160191
161192 // Removes a group from @self.
@@ -548,10 +579,12 @@ func init() {
548579 core.PuregoSafeRegister(&xPreferencesPageGetBanner, libs, "adw_preferences_page_get_banner")
549580 core.PuregoSafeRegister(&xPreferencesPageGetDescription, libs, "adw_preferences_page_get_description")
550581 core.PuregoSafeRegister(&xPreferencesPageGetDescriptionCentered, libs, "adw_preferences_page_get_description_centered")
582+ core.PuregoSafeRegister(&xPreferencesPageGetGroup, libs, "adw_preferences_page_get_group")
551583 core.PuregoSafeRegister(&xPreferencesPageGetIconName, libs, "adw_preferences_page_get_icon_name")
552584 core.PuregoSafeRegister(&xPreferencesPageGetName, libs, "adw_preferences_page_get_name")
553585 core.PuregoSafeRegister(&xPreferencesPageGetTitle, libs, "adw_preferences_page_get_title")
554586 core.PuregoSafeRegister(&xPreferencesPageGetUseUnderline, libs, "adw_preferences_page_get_use_underline")
587+ core.PuregoSafeRegister(&xPreferencesPageInsert, libs, "adw_preferences_page_insert")
555588 core.PuregoSafeRegister(&xPreferencesPageRemove, libs, "adw_preferences_page_remove")
556589 core.PuregoSafeRegister(&xPreferencesPageScrollToTop, libs, "adw_preferences_page_scroll_to_top")
557590 core.PuregoSafeRegister(&xPreferencesPageSetBanner, libs, "adw_preferences_page_set_banner")
A v4/adw/adw-shortcut-label.go +471 -0
@@ -0,0 +1,471 @@
1+// Package adw was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT
2+package adw
3+
4+import (
5+ "structs"
6+ "unsafe"
7+
8+ "github.com/jwijenbergh/purego"
9+ "github.com/jwijenbergh/puregotk/pkg/core"
10+ "github.com/jwijenbergh/puregotk/v4/gobject"
11+ "github.com/jwijenbergh/puregotk/v4/gobject/types"
12+ "github.com/jwijenbergh/puregotk/v4/gtk"
13+)
14+
15+type ShortcutLabelClass struct {
16+ _ structs.HostLayout
17+
18+ ParentClass gtk.WidgetClass
19+}
20+
21+func (x *ShortcutLabelClass) GoPointer() uintptr {
22+ return uintptr(unsafe.Pointer(x))
23+}
24+
25+// A widget that displays a keyboard shortcut.
26+//
27+// &lt;picture&gt;
28+//
29+// &lt;source srcset="shortcut-label-dark.png" media="(prefers-color-scheme: dark)"&gt;
30+// &lt;img src="shortcut-label.png" alt="shortcut-label"&gt;
31+//
32+// &lt;/picture&gt;
33+//
34+// The shown shortcut can be set using the [property@ShortcutLabel:accelerator]
35+// property.
36+//
37+// Optionally, if no shortcut is set, `AdwShortcutLabel` will display a
38+// placeholder set with the [property@ShortcutLabel:disabled-text] property.
39+//
40+// The following types of shortcuts can be displayed:
41+//
42+// - A single shortcut in [func@Gtk.accelerator_parse] format, e.g. `&lt;Control&gt;C`:
43+//
44+// &lt;picture&gt;
45+// &lt;source srcset="shortcut-label-single-dark.png" media="(prefers-color-scheme: dark)"&gt;
46+// &lt;img src="shortcut-label-single.png" alt="shortcut-label-single"&gt;
47+// &lt;/picture&gt;
48+//
49+// - Multiple alternative shortcuts, separated with spaces, e.g. `&lt;Shift&gt;A Home`:
50+//
51+// &lt;picture&gt;
52+// &lt;source srcset="shortcut-label-alternative-dark.png" media="(prefers-color-scheme: dark)"&gt;
53+// &lt;img src="shortcut-label-alternative.png" alt="shortcut-label-alternative"&gt;
54+// &lt;/picture&gt;
55+//
56+// - A range of shortcuts, separated with `...`, e.g. `&lt;Alt&gt;1...9`:
57+//
58+// &lt;picture&gt;
59+// &lt;source srcset="shortcut-label-range-dark.png" media="(prefers-color-scheme: dark)"&gt;
60+// &lt;img src="shortcut-label-range.png" alt="shortcut-label-range"&gt;
61+// &lt;/picture&gt;
62+//
63+// - Multiple keys pressed at once, separated with `&amp;`, e.g. `Control_L&amp;Control_R`:
64+//
65+// &lt;picture&gt;
66+// &lt;source srcset="shortcut-label-multiple-dark.png" media="(prefers-color-scheme: dark)"&gt;
67+// &lt;img src="shortcut-label-multiple.png" alt="shortcut-label-multiple"&gt;
68+// &lt;/picture&gt;
69+//
70+// - Multiple shortcuts or keys, pressed sequentially, separated with `+`, e.g. `&lt;Control&gt;C+&lt;Control&gt;X`:
71+//
72+// &lt;picture&gt;
73+// &lt;source srcset="shortcut-label-sequence-dark.png" media="(prefers-color-scheme: dark)"&gt;
74+// &lt;img src="shortcut-label-sequence.png" alt="shortcut-label-sequence"&gt;
75+// &lt;/picture&gt;
76+//
77+// ::: note
78+//
79+// `&lt;`, `&gt;` and `&amp;` need to be escaped as `&amp;lt;`, `&amp;gt;` and `&amp;amp;` when used in UI files.
80+//
81+// ## CSS nodes
82+//
83+// `AdwShortcutLabel` has a single CSS node with name `shortcut-label`. The
84+// individual keycap labels each have the `.keycap` style class, while the
85+// labels separating them have the `.dimmed` style class.
86+//
87+// ## Accessibility
88+//
89+// `AdwShortcutLabel` uses the `GTK_ACCESSIBLE_ROLE_GENERIC` role.
90+//
91+// See also: [class@ShortcutsDialog].
92+type ShortcutLabel struct {
93+ gtk.Widget
94+}
95+
96+var xShortcutLabelGLibType func() types.GType
97+
98+func ShortcutLabelGLibType() types.GType {
99+ return xShortcutLabelGLibType()
100+}
101+
102+func ShortcutLabelNewFromInternalPtr(ptr uintptr) *ShortcutLabel {
103+ cls := &ShortcutLabel{}
104+ cls.Ptr = ptr
105+ return cls
106+}
107+
108+var xNewShortcutLabel func(string) uintptr
109+
110+// Creates a new `AdwShortcutLabel` showing @accelerator.
111+func NewShortcutLabel(AcceleratorVar string) *ShortcutLabel {
112+ var cls *ShortcutLabel
113+
114+ cret := xNewShortcutLabel(AcceleratorVar)
115+
116+ if cret == 0 {
117+ return nil
118+ }
119+ gobject.IncreaseRef(cret)
120+ cls = &ShortcutLabel{}
121+ cls.Ptr = cret
122+ return cls
123+}
124+
125+var xShortcutLabelGetAccelerator func(uintptr) string
126+
127+// Gets the accelerator displayed by @self.
128+func (x *ShortcutLabel) GetAccelerator() string {
129+
130+ cret := xShortcutLabelGetAccelerator(x.GoPointer())
131+ return cret
132+}
133+
134+var xShortcutLabelGetDisabledText func(uintptr) string
135+
136+// Gets the text displayed by @self when no accelerator is set.
137+func (x *ShortcutLabel) GetDisabledText() string {
138+
139+ cret := xShortcutLabelGetDisabledText(x.GoPointer())
140+ return cret
141+}
142+
143+var xShortcutLabelSetAccelerator func(uintptr, string)
144+
145+// Sets the accelerator to be displayed by @self.
146+func (x *ShortcutLabel) SetAccelerator(AcceleratorVar string) {
147+
148+ xShortcutLabelSetAccelerator(x.GoPointer(), AcceleratorVar)
149+
150+}
151+
152+var xShortcutLabelSetDisabledText func(uintptr, string)
153+
154+// Sets the text to be displayed by @self when no accelerator is set.
155+func (x *ShortcutLabel) SetDisabledText(DisabledTextVar string) {
156+
157+ xShortcutLabelSetDisabledText(x.GoPointer(), DisabledTextVar)
158+
159+}
160+
161+func (c *ShortcutLabel) GoPointer() uintptr {
162+ if c == nil {
163+ return 0
164+ }
165+ return c.Ptr
166+}
167+
168+func (c *ShortcutLabel) SetGoPointer(ptr uintptr) {
169+ c.Ptr = ptr
170+}
171+
172+// Requests the user's screen reader to announce the given message.
173+//
174+// This kind of notification is useful for messages that
175+// either have only a visual representation or that are not
176+// exposed visually at all, e.g. a notification about a
177+// successful operation.
178+//
179+// Also, by using this API, you can ensure that the message
180+// does not interrupts the user's current screen reader output.
181+func (x *ShortcutLabel) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) {
182+
183+ gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar)
184+
185+}
186+
187+// Retrieves the accessible parent for an accessible object.
188+//
189+// This function returns `NULL` for top level widgets.
190+func (x *ShortcutLabel) GetAccessibleParent() *gtk.AccessibleBase {
191+ var cls *gtk.AccessibleBase
192+
193+ cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer())
194+
195+ if cret == 0 {
196+ return nil
197+ }
198+ cls = &gtk.AccessibleBase{}
199+ cls.Ptr = cret
200+ return cls
201+}
202+
203+// Retrieves the accessible role of an accessible object.
204+func (x *ShortcutLabel) GetAccessibleRole() gtk.AccessibleRole {
205+
206+ cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer())
207+ return cret
208+}
209+
210+// Retrieves the implementation for the given accessible object.
211+func (x *ShortcutLabel) GetAtContext() *gtk.ATContext {
212+ var cls *gtk.ATContext
213+
214+ cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer())
215+
216+ if cret == 0 {
217+ return nil
218+ }
219+ cls = &gtk.ATContext{}
220+ cls.Ptr = cret
221+ return cls
222+}
223+
224+// Queries the coordinates and dimensions of this accessible
225+//
226+// This functionality can be overridden by `GtkAccessible`
227+// implementations, e.g. to get the bounds from an ignored
228+// child widget.
229+func (x *ShortcutLabel) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool {
230+
231+ cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar)
232+ return cret
233+}
234+
235+// Retrieves the first accessible child of an accessible object.
236+func (x *ShortcutLabel) GetFirstAccessibleChild() *gtk.AccessibleBase {
237+ var cls *gtk.AccessibleBase
238+
239+ cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer())
240+
241+ if cret == 0 {
242+ return nil
243+ }
244+ cls = &gtk.AccessibleBase{}
245+ cls.Ptr = cret
246+ return cls
247+}
248+
249+// Retrieves the next accessible sibling of an accessible object
250+func (x *ShortcutLabel) GetNextAccessibleSibling() *gtk.AccessibleBase {
251+ var cls *gtk.AccessibleBase
252+
253+ cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer())
254+
255+ if cret == 0 {
256+ return nil
257+ }
258+ cls = &gtk.AccessibleBase{}
259+ cls.Ptr = cret
260+ return cls
261+}
262+
263+// Queries a platform state, such as focus.
264+//
265+// This functionality can be overridden by `GtkAccessible`
266+// implementations, e.g. to get platform state from an ignored
267+// child widget, as is the case for `GtkText` wrappers.
268+func (x *ShortcutLabel) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool {
269+
270+ cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar)
271+ return cret
272+}
273+
274+// Resets the accessible property to its default value.
275+func (x *ShortcutLabel) ResetProperty(PropertyVar gtk.AccessibleProperty) {
276+
277+ gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar)
278+
279+}
280+
281+// Resets the accessible relation to its default value.
282+func (x *ShortcutLabel) ResetRelation(RelationVar gtk.AccessibleRelation) {
283+
284+ gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar)
285+
286+}
287+
288+// Resets the accessible state to its default value.
289+func (x *ShortcutLabel) ResetState(StateVar gtk.AccessibleState) {
290+
291+ gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar)
292+
293+}
294+
295+// Sets the parent and sibling of an accessible object.
296+//
297+// This function is meant to be used by accessible implementations that are
298+// not part of the widget hierarchy, and but act as a logical bridge between
299+// widgets. For instance, if a widget creates an object that holds metadata
300+// for each child, and you want that object to implement the `GtkAccessible`
301+// interface, you will use this function to ensure that the parent of each
302+// child widget is the metadata object, and the parent of each metadata
303+// object is the container widget.
304+func (x *ShortcutLabel) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) {
305+
306+ gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer())
307+
308+}
309+
310+// Updates the next accessible sibling.
311+//
312+// That might be useful when a new child of a custom accessible
313+// is created, and it needs to be linked to a previous child.
314+func (x *ShortcutLabel) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) {
315+
316+ gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer())
317+
318+}
319+
320+// Informs ATs that the platform state has changed.
321+//
322+// This function should be used by `GtkAccessible` implementations that
323+// have a platform state but are not widgets. Widgets handle platform
324+// states automatically.
325+func (x *ShortcutLabel) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) {
326+
327+ gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar)
328+
329+}
330+
331+// Updates a list of accessible properties.
332+//
333+// See the [enum@Gtk.AccessibleProperty] documentation for the
334+// value types of accessible properties.
335+//
336+// This function should be called by `GtkWidget` types whenever
337+// an accessible property change must be communicated to assistive
338+// technologies.
339+//
340+// Example:
341+// ```c
342+// value = gtk_adjustment_get_value (adjustment);
343+// gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button),
344+//
345+// GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value,
346+// -1);
347+//
348+// ```
349+func (x *ShortcutLabel) UpdateProperty(FirstPropertyVar gtk.AccessibleProperty, varArgs ...interface{}) {
350+
351+ gtk.XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...)
352+
353+}
354+
355+// Updates an array of accessible properties.
356+//
357+// This function should be called by `GtkWidget` types whenever an accessible
358+// property change must be communicated to assistive technologies.
359+//
360+// This function is meant to be used by language bindings.
361+func (x *ShortcutLabel) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gtk.AccessibleProperty, ValuesVar []gobject.Value) {
362+
363+ gtk.XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar)
364+
365+}
366+
367+// Updates a list of accessible relations.
368+//
369+// This function should be called by `GtkWidget` types whenever an accessible
370+// relation change must be communicated to assistive technologies.
371+//
372+// If the [enum@Gtk.AccessibleRelation] requires a list of references,
373+// you should pass each reference individually, followed by `NULL`, e.g.
374+//
375+// ```c
376+// gtk_accessible_update_relation (accessible,
377+//
378+// GTK_ACCESSIBLE_RELATION_CONTROLS,
379+// ref1, NULL,
380+// GTK_ACCESSIBLE_RELATION_LABELLED_BY,
381+// ref1, ref2, ref3, NULL,
382+// -1);
383+//
384+// ```
385+func (x *ShortcutLabel) UpdateRelation(FirstRelationVar gtk.AccessibleRelation, varArgs ...interface{}) {
386+
387+ gtk.XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...)
388+
389+}
390+
391+// Updates an array of accessible relations.
392+//
393+// This function should be called by `GtkWidget` types whenever an accessible
394+// relation change must be communicated to assistive technologies.
395+//
396+// This function is meant to be used by language bindings.
397+func (x *ShortcutLabel) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk.AccessibleRelation, ValuesVar []gobject.Value) {
398+
399+ gtk.XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar)
400+
401+}
402+
403+// Updates a list of accessible states.
404+//
405+// See the [enum@Gtk.AccessibleState] documentation for the
406+// value types of accessible states.
407+//
408+// This function should be called by `GtkWidget` types whenever
409+// an accessible state change must be communicated to assistive
410+// technologies.
411+//
412+// Example:
413+//
414+// ```c
415+// value = GTK_ACCESSIBLE_TRISTATE_MIXED;
416+// gtk_accessible_update_state (GTK_ACCESSIBLE (check_button),
417+//
418+// GTK_ACCESSIBLE_STATE_CHECKED, value,
419+// -1);
420+//
421+// ```
422+func (x *ShortcutLabel) UpdateState(FirstStateVar gtk.AccessibleState, varArgs ...interface{}) {
423+
424+ gtk.XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...)
425+
426+}
427+
428+// Updates an array of accessible states.
429+//
430+// This function should be called by `GtkWidget` types whenever an accessible
431+// state change must be communicated to assistive technologies.
432+//
433+// This function is meant to be used by language bindings.
434+func (x *ShortcutLabel) UpdateStateValue(NStatesVar int, StatesVar []gtk.AccessibleState, ValuesVar []gobject.Value) {
435+
436+ gtk.XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar)
437+
438+}
439+
440+// Gets the ID of the @buildable object.
441+//
442+// `GtkBuilder` sets the name based on the ID attribute
443+// of the `&lt;object&gt;` tag used to construct the @buildable.
444+func (x *ShortcutLabel) GetBuildableId() string {
445+
446+ cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer())
447+ return cret
448+}
449+
450+func init() {
451+ core.SetPackageName("ADW", "libadwaita-1")
452+ core.SetSharedLibraries("ADW", []string{"libadwaita-1.so.0"})
453+ var libs []uintptr
454+ for _, libPath := range core.GetPaths("ADW") {
455+ lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
456+ if err != nil {
457+ panic(err)
458+ }
459+ libs = append(libs, lib)
460+ }
461+
462+ core.PuregoSafeRegister(&xShortcutLabelGLibType, libs, "adw_shortcut_label_get_type")
463+
464+ core.PuregoSafeRegister(&xNewShortcutLabel, libs, "adw_shortcut_label_new")
465+
466+ core.PuregoSafeRegister(&xShortcutLabelGetAccelerator, libs, "adw_shortcut_label_get_accelerator")
467+ core.PuregoSafeRegister(&xShortcutLabelGetDisabledText, libs, "adw_shortcut_label_get_disabled_text")
468+ core.PuregoSafeRegister(&xShortcutLabelSetAccelerator, libs, "adw_shortcut_label_set_accelerator")
469+ core.PuregoSafeRegister(&xShortcutLabelSetDisabledText, libs, "adw_shortcut_label_set_disabled_text")
470+
471+}
A v4/adw/adw-shortcuts-dialog.go +465 -0
@@ -0,0 +1,465 @@
1+// Package adw was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT
2+package adw
3+
4+import (
5+ "structs"
6+ "unsafe"
7+
8+ "github.com/jwijenbergh/purego"
9+ "github.com/jwijenbergh/puregotk/pkg/core"
10+ "github.com/jwijenbergh/puregotk/v4/gobject"
11+ "github.com/jwijenbergh/puregotk/v4/gobject/types"
12+ "github.com/jwijenbergh/puregotk/v4/gtk"
13+)
14+
15+type ShortcutsDialogClass struct {
16+ _ structs.HostLayout
17+
18+ ParentClass DialogClass
19+}
20+
21+func (x *ShortcutsDialogClass) GoPointer() uintptr {
22+ return uintptr(unsafe.Pointer(x))
23+}
24+
25+// A dialog that displays application's keyboard shortcuts.
26+//
27+// &lt;picture&gt;
28+//
29+// &lt;source srcset="shortcuts-dialog-dark.png" media="(prefers-color-scheme: dark)"&gt;
30+// &lt;img src="shortcuts-dialog.png" alt="shortcuts-dialog"&gt;
31+//
32+// &lt;/picture&gt;
33+//
34+// Shortcuts are grouped into sections, represented by [class@ShortcutsSection]
35+// objects. Each section has one or more items, represented by
36+// [class@ShortcutsItem] objects.
37+//
38+// To add a section to the dialog, use [method@ShortcutsDialog.add], or add it
39+// as a child when using UI files.
40+//
41+// Sections without titles can be used to further subdivide each section into
42+// groups.
43+//
44+// Example of an `AdwShortcutsDialog` UI definition:
45+//
46+// ```xml
47+// &lt;object class="AdwShortcutsDialog" id="shortcuts_dialog"&gt;
48+//
49+// &lt;child&gt;
50+// &lt;object class="AdwShortcutsSection"&gt;
51+// &lt;property name="title" translatable="yes"&gt;General&lt;/property&gt;
52+// &lt;child&gt;
53+// &lt;object class="AdwShortcutsItem"&gt;
54+// &lt;property name="title" translatable="yes"&gt;Open Menu&lt;/property&gt;
55+// &lt;property name="accelerator"&gt;F10&lt;/property&gt;
56+// &lt;/object&gt;
57+// &lt;/child&gt;
58+// &lt;child&gt;
59+// &lt;object class="AdwShortcutsItem"&gt;
60+// &lt;property name="title" translatable="yes"&gt;Quit&lt;/property&gt;
61+// &lt;property name="action-name"&gt;app.quit&lt;/property&gt;
62+// &lt;/object&gt;
63+// &lt;/child&gt;
64+// &lt;/object&gt;
65+// &lt;/child&gt;
66+// &lt;child&gt;
67+// &lt;object class="AdwShortcutsSection"&gt;
68+// &lt;child&gt;
69+// &lt;object class="AdwShortcutsItem"&gt;
70+// &lt;property name="title" translatable="yes"&gt;Move Tab Left&lt;/property&gt;
71+// &lt;property name="accelerator"&gt;&amp;lt;Shift&amp;gt;&amp;lt;Ctrl&amp;gt;Page_Up&lt;/property&gt;
72+// &lt;property name="direction"&gt;ltr&lt;/property&gt;
73+// &lt;/object&gt;
74+// &lt;/child&gt;
75+// &lt;child&gt;
76+// &lt;object class="AdwShortcutsItem"&gt;
77+// &lt;property name="title" translatable="yes"&gt;Move Tab Right&lt;/property&gt;
78+// &lt;property name="accelerator"&gt;&amp;lt;Shift&amp;gt;&amp;lt;Ctrl&amp;gt;Page_Down&lt;/property&gt;
79+// &lt;property name="direction"&gt;ltr&lt;/property&gt;
80+// &lt;/object&gt;
81+// &lt;/child&gt;
82+// &lt;child&gt;
83+// &lt;object class="AdwShortcutsItem"&gt;
84+// &lt;property name="title" translatable="yes"&gt;Move Tab Right&lt;/property&gt;
85+// &lt;property name="accelerator"&gt;&amp;lt;Shift&amp;gt;&amp;lt;Ctrl&amp;gt;Page_Up&lt;/property&gt;
86+// &lt;property name="direction"&gt;rtl&lt;/property&gt;
87+// &lt;/object&gt;
88+// &lt;/child&gt;
89+// &lt;child&gt;
90+// &lt;object class="AdwShortcutsItem"&gt;
91+// &lt;property name="title" translatable="yes"&gt;Move Tab Left&lt;/property&gt;
92+// &lt;property name="accelerator"&gt;&amp;lt;Shift&amp;gt;&amp;lt;Ctrl&amp;gt;Page_Down&lt;/property&gt;
93+// &lt;property name="direction"&gt;rtl&lt;/property&gt;
94+// &lt;/object&gt;
95+// &lt;/child&gt;
96+// &lt;/object&gt;
97+// &lt;/child&gt;
98+//
99+// &lt;/object&gt;
100+// ```
101+//
102+// If the `app.quit` action has the &lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;Q&lt;/kbd&gt; accelerator
103+// associated with it, the result will look as follows:
104+//
105+// &lt;picture&gt;
106+//
107+// &lt;source srcset="shortcuts-dialog-example-dark.png" media="(prefers-color-scheme: dark)"&gt;
108+// &lt;img src="shortcuts-dialog-example.png" alt="shortcuts-dialog-example"&gt;
109+//
110+// &lt;/picture&gt;
111+//
112+// The recommended way to use `AdwShortcutsDialog` is via [class@Application]'s
113+// automatic resource loading.
114+//
115+// See also: [class@ShortcutLabel].
116+type ShortcutsDialog struct {
117+ Dialog
118+}
119+
120+var xShortcutsDialogGLibType func() types.GType
121+
122+func ShortcutsDialogGLibType() types.GType {
123+ return xShortcutsDialogGLibType()
124+}
125+
126+func ShortcutsDialogNewFromInternalPtr(ptr uintptr) *ShortcutsDialog {
127+ cls := &ShortcutsDialog{}
128+ cls.Ptr = ptr
129+ return cls
130+}
131+
132+var xNewShortcutsDialog func() uintptr
133+
134+// Creates a new `AdwShortcutsDialog`.
135+func NewShortcutsDialog() *ShortcutsDialog {
136+ var cls *ShortcutsDialog
137+
138+ cret := xNewShortcutsDialog()
139+
140+ if cret == 0 {
141+ return nil
142+ }
143+ gobject.IncreaseRef(cret)
144+ cls = &ShortcutsDialog{}
145+ cls.Ptr = cret
146+ return cls
147+}
148+
149+var xShortcutsDialogAdd func(uintptr, uintptr)
150+
151+// Adds @section to @self.
152+func (x *ShortcutsDialog) Add(SectionVar *ShortcutsSection) {
153+
154+ xShortcutsDialogAdd(x.GoPointer(), SectionVar.GoPointer())
155+
156+}
157+
158+func (c *ShortcutsDialog) GoPointer() uintptr {
159+ if c == nil {
160+ return 0
161+ }
162+ return c.Ptr
163+}
164+
165+func (c *ShortcutsDialog) SetGoPointer(ptr uintptr) {
166+ c.Ptr = ptr
167+}
168+
169+// Requests the user's screen reader to announce the given message.
170+//
171+// This kind of notification is useful for messages that
172+// either have only a visual representation or that are not
173+// exposed visually at all, e.g. a notification about a
174+// successful operation.
175+//
176+// Also, by using this API, you can ensure that the message
177+// does not interrupts the user's current screen reader output.
178+func (x *ShortcutsDialog) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) {
179+
180+ gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar)
181+
182+}
183+
184+// Retrieves the accessible parent for an accessible object.
185+//
186+// This function returns `NULL` for top level widgets.
187+func (x *ShortcutsDialog) GetAccessibleParent() *gtk.AccessibleBase {
188+ var cls *gtk.AccessibleBase
189+
190+ cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer())
191+
192+ if cret == 0 {
193+ return nil
194+ }
195+ cls = &gtk.AccessibleBase{}
196+ cls.Ptr = cret
197+ return cls
198+}
199+
200+// Retrieves the accessible role of an accessible object.
201+func (x *ShortcutsDialog) GetAccessibleRole() gtk.AccessibleRole {
202+
203+ cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer())
204+ return cret
205+}
206+
207+// Retrieves the implementation for the given accessible object.
208+func (x *ShortcutsDialog) GetAtContext() *gtk.ATContext {
209+ var cls *gtk.ATContext
210+
211+ cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer())
212+
213+ if cret == 0 {
214+ return nil
215+ }
216+ cls = &gtk.ATContext{}
217+ cls.Ptr = cret
218+ return cls
219+}
220+
221+// Queries the coordinates and dimensions of this accessible
222+//
223+// This functionality can be overridden by `GtkAccessible`
224+// implementations, e.g. to get the bounds from an ignored
225+// child widget.
226+func (x *ShortcutsDialog) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool {
227+
228+ cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar)
229+ return cret
230+}
231+
232+// Retrieves the first accessible child of an accessible object.
233+func (x *ShortcutsDialog) GetFirstAccessibleChild() *gtk.AccessibleBase {
234+ var cls *gtk.AccessibleBase
235+
236+ cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer())
237+
238+ if cret == 0 {
239+ return nil
240+ }
241+ cls = &gtk.AccessibleBase{}
242+ cls.Ptr = cret
243+ return cls
244+}
245+
246+// Retrieves the next accessible sibling of an accessible object
247+func (x *ShortcutsDialog) GetNextAccessibleSibling() *gtk.AccessibleBase {
248+ var cls *gtk.AccessibleBase
249+
250+ cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer())
251+
252+ if cret == 0 {
253+ return nil
254+ }
255+ cls = &gtk.AccessibleBase{}
256+ cls.Ptr = cret
257+ return cls
258+}
259+
260+// Queries a platform state, such as focus.
261+//
262+// This functionality can be overridden by `GtkAccessible`
263+// implementations, e.g. to get platform state from an ignored
264+// child widget, as is the case for `GtkText` wrappers.
265+func (x *ShortcutsDialog) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool {
266+
267+ cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar)
268+ return cret
269+}
270+
271+// Resets the accessible property to its default value.
272+func (x *ShortcutsDialog) ResetProperty(PropertyVar gtk.AccessibleProperty) {
273+
274+ gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar)
275+
276+}
277+
278+// Resets the accessible relation to its default value.
279+func (x *ShortcutsDialog) ResetRelation(RelationVar gtk.AccessibleRelation) {
280+
281+ gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar)
282+
283+}
284+
285+// Resets the accessible state to its default value.
286+func (x *ShortcutsDialog) ResetState(StateVar gtk.AccessibleState) {
287+
288+ gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar)
289+
290+}
291+
292+// Sets the parent and sibling of an accessible object.
293+//
294+// This function is meant to be used by accessible implementations that are
295+// not part of the widget hierarchy, and but act as a logical bridge between
296+// widgets. For instance, if a widget creates an object that holds metadata
297+// for each child, and you want that object to implement the `GtkAccessible`
298+// interface, you will use this function to ensure that the parent of each
299+// child widget is the metadata object, and the parent of each metadata
300+// object is the container widget.
301+func (x *ShortcutsDialog) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) {
302+
303+ gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer())
304+
305+}
306+
307+// Updates the next accessible sibling.
308+//
309+// That might be useful when a new child of a custom accessible
310+// is created, and it needs to be linked to a previous child.
311+func (x *ShortcutsDialog) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) {
312+
313+ gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer())
314+
315+}
316+
317+// Informs ATs that the platform state has changed.
318+//
319+// This function should be used by `GtkAccessible` implementations that
320+// have a platform state but are not widgets. Widgets handle platform
321+// states automatically.
322+func (x *ShortcutsDialog) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) {
323+
324+ gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar)
325+
326+}
327+
328+// Updates a list of accessible properties.
329+//
330+// See the [enum@Gtk.AccessibleProperty] documentation for the
331+// value types of accessible properties.
332+//
333+// This function should be called by `GtkWidget` types whenever
334+// an accessible property change must be communicated to assistive
335+// technologies.
336+//
337+// Example:
338+// ```c
339+// value = gtk_adjustment_get_value (adjustment);
340+// gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button),
341+//
342+// GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value,
343+// -1);
344+//
345+// ```
346+func (x *ShortcutsDialog) UpdateProperty(FirstPropertyVar gtk.AccessibleProperty, varArgs ...interface{}) {
347+
348+ gtk.XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...)
349+
350+}
351+
352+// Updates an array of accessible properties.
353+//
354+// This function should be called by `GtkWidget` types whenever an accessible
355+// property change must be communicated to assistive technologies.
356+//
357+// This function is meant to be used by language bindings.
358+func (x *ShortcutsDialog) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gtk.AccessibleProperty, ValuesVar []gobject.Value) {
359+
360+ gtk.XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar)
361+
362+}
363+
364+// Updates a list of accessible relations.
365+//
366+// This function should be called by `GtkWidget` types whenever an accessible
367+// relation change must be communicated to assistive technologies.
368+//
369+// If the [enum@Gtk.AccessibleRelation] requires a list of references,
370+// you should pass each reference individually, followed by `NULL`, e.g.
371+//
372+// ```c
373+// gtk_accessible_update_relation (accessible,
374+//
375+// GTK_ACCESSIBLE_RELATION_CONTROLS,
376+// ref1, NULL,
377+// GTK_ACCESSIBLE_RELATION_LABELLED_BY,
378+// ref1, ref2, ref3, NULL,
379+// -1);
380+//
381+// ```
382+func (x *ShortcutsDialog) UpdateRelation(FirstRelationVar gtk.AccessibleRelation, varArgs ...interface{}) {
383+
384+ gtk.XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...)
385+
386+}
387+
388+// Updates an array of accessible relations.
389+//
390+// This function should be called by `GtkWidget` types whenever an accessible
391+// relation change must be communicated to assistive technologies.
392+//
393+// This function is meant to be used by language bindings.
394+func (x *ShortcutsDialog) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk.AccessibleRelation, ValuesVar []gobject.Value) {
395+
396+ gtk.XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar)
397+
398+}
399+
400+// Updates a list of accessible states.
401+//
402+// See the [enum@Gtk.AccessibleState] documentation for the
403+// value types of accessible states.
404+//
405+// This function should be called by `GtkWidget` types whenever
406+// an accessible state change must be communicated to assistive
407+// technologies.
408+//
409+// Example:
410+//
411+// ```c
412+// value = GTK_ACCESSIBLE_TRISTATE_MIXED;
413+// gtk_accessible_update_state (GTK_ACCESSIBLE (check_button),
414+//
415+// GTK_ACCESSIBLE_STATE_CHECKED, value,
416+// -1);
417+//
418+// ```
419+func (x *ShortcutsDialog) UpdateState(FirstStateVar gtk.AccessibleState, varArgs ...interface{}) {
420+
421+ gtk.XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...)
422+
423+}
424+
425+// Updates an array of accessible states.
426+//
427+// This function should be called by `GtkWidget` types whenever an accessible
428+// state change must be communicated to assistive technologies.
429+//
430+// This function is meant to be used by language bindings.
431+func (x *ShortcutsDialog) UpdateStateValue(NStatesVar int, StatesVar []gtk.AccessibleState, ValuesVar []gobject.Value) {
432+
433+ gtk.XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar)
434+
435+}
436+
437+// Gets the ID of the @buildable object.
438+//
439+// `GtkBuilder` sets the name based on the ID attribute
440+// of the `&lt;object&gt;` tag used to construct the @buildable.
441+func (x *ShortcutsDialog) GetBuildableId() string {
442+
443+ cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer())
444+ return cret
445+}
446+
447+func init() {
448+ core.SetPackageName("ADW", "libadwaita-1")
449+ core.SetSharedLibraries("ADW", []string{"libadwaita-1.so.0"})
450+ var libs []uintptr
451+ for _, libPath := range core.GetPaths("ADW") {
452+ lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
453+ if err != nil {
454+ panic(err)
455+ }
456+ libs = append(libs, lib)
457+ }
458+
459+ core.PuregoSafeRegister(&xShortcutsDialogGLibType, libs, "adw_shortcuts_dialog_get_type")
460+
461+ core.PuregoSafeRegister(&xNewShortcutsDialog, libs, "adw_shortcuts_dialog_new")
462+
463+ core.PuregoSafeRegister(&xShortcutsDialogAdd, libs, "adw_shortcuts_dialog_add")
464+
465+}
A v4/adw/adw-shortcuts-item.go +223 -0
@@ -0,0 +1,223 @@
1+// Package adw was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT
2+package adw
3+
4+import (
5+ "structs"
6+ "unsafe"
7+
8+ "github.com/jwijenbergh/purego"
9+ "github.com/jwijenbergh/puregotk/pkg/core"
10+ "github.com/jwijenbergh/puregotk/v4/gobject"
11+ "github.com/jwijenbergh/puregotk/v4/gobject/types"
12+ "github.com/jwijenbergh/puregotk/v4/gtk"
13+)
14+
15+type ShortcutsItemClass struct {
16+ _ structs.HostLayout
17+
18+ ParentClass gobject.ObjectClass
19+}
20+
21+func (x *ShortcutsItemClass) GoPointer() uintptr {
22+ return uintptr(unsafe.Pointer(x))
23+}
24+
25+// An object representing an individual shortcut in [class@ShortcutsSection].
26+//
27+// A shortcut has a title, an optional subtitle, and an accelerator.
28+//
29+// Accelerator must be specified in the format [class@ShortcutLabel] accepts.
30+//
31+// Alternatively, the [property@ShortcutsItem:action-name] property can be used
32+// to automatically get accelerator associated with the specified action, as set
33+// via [method@Gtk.Application.set_accels_for_action].
34+//
35+// If both are specified, the accelerator will be used if the action couldn't
36+// be found or doesn't have an accelerator associated for it.
37+//
38+// If [property@ShortcutsItem:direction] is set, the shortcut will only be
39+// displayed for the specified text direction. This allows to display different
40+// shortcuts for different text directions.
41+type ShortcutsItem struct {
42+ gobject.Object
43+}
44+
45+var xShortcutsItemGLibType func() types.GType
46+
47+func ShortcutsItemGLibType() types.GType {
48+ return xShortcutsItemGLibType()
49+}
50+
51+func ShortcutsItemNewFromInternalPtr(ptr uintptr) *ShortcutsItem {
52+ cls := &ShortcutsItem{}
53+ cls.Ptr = ptr
54+ return cls
55+}
56+
57+var xNewShortcutsItem func(string, string) uintptr
58+
59+// Creates a new `AdwShortcutsItem` with @title and @accelerator.
60+func NewShortcutsItem(TitleVar string, AcceleratorVar string) *ShortcutsItem {
61+ var cls *ShortcutsItem
62+
63+ cret := xNewShortcutsItem(TitleVar, AcceleratorVar)
64+
65+ if cret == 0 {
66+ return nil
67+ }
68+ cls = &ShortcutsItem{}
69+ cls.Ptr = cret
70+ return cls
71+}
72+
73+var xNewShortcutsItemFromAction func(string, string) uintptr
74+
75+// Creates a new `AdwShortcutsItem` with @title and @action_name.
76+func NewShortcutsItemFromAction(TitleVar string, ActionNameVar string) *ShortcutsItem {
77+ var cls *ShortcutsItem
78+
79+ cret := xNewShortcutsItemFromAction(TitleVar, ActionNameVar)
80+
81+ if cret == 0 {
82+ return nil
83+ }
84+ cls = &ShortcutsItem{}
85+ cls.Ptr = cret
86+ return cls
87+}
88+
89+var xShortcutsItemGetAccelerator func(uintptr) string
90+
91+// Gets the accelerator of @self.
92+func (x *ShortcutsItem) GetAccelerator() string {
93+
94+ cret := xShortcutsItemGetAccelerator(x.GoPointer())
95+ return cret
96+}
97+
98+var xShortcutsItemGetActionName func(uintptr) string
99+
100+// Gets the action name to get the accelerator from.
101+func (x *ShortcutsItem) GetActionName() string {
102+
103+ cret := xShortcutsItemGetActionName(x.GoPointer())
104+ return cret
105+}
106+
107+var xShortcutsItemGetDirection func(uintptr) gtk.TextDirection
108+
109+// Gets the direction of @self.
110+func (x *ShortcutsItem) GetDirection() gtk.TextDirection {
111+
112+ cret := xShortcutsItemGetDirection(x.GoPointer())
113+ return cret
114+}
115+
116+var xShortcutsItemGetSubtitle func(uintptr) string
117+
118+// Gets the subtitle of @self.
119+func (x *ShortcutsItem) GetSubtitle() string {
120+
121+ cret := xShortcutsItemGetSubtitle(x.GoPointer())
122+ return cret
123+}
124+
125+var xShortcutsItemGetTitle func(uintptr) string
126+
127+// Gets the title of @self.
128+func (x *ShortcutsItem) GetTitle() string {
129+
130+ cret := xShortcutsItemGetTitle(x.GoPointer())
131+ return cret
132+}
133+
134+var xShortcutsItemSetAccelerator func(uintptr, string)
135+
136+// Sets the accelerator of @self.
137+//
138+// @accelerator must be in the format [class@ShortcutLabel] accepts.
139+func (x *ShortcutsItem) SetAccelerator(AcceleratorVar string) {
140+
141+ xShortcutsItemSetAccelerator(x.GoPointer(), AcceleratorVar)
142+
143+}
144+
145+var xShortcutsItemSetActionName func(uintptr, string)
146+
147+// Sets the action name to get the accelerator from.
148+func (x *ShortcutsItem) SetActionName(ActionNameVar string) {
149+
150+ xShortcutsItemSetActionName(x.GoPointer(), ActionNameVar)
151+
152+}
153+
154+var xShortcutsItemSetDirection func(uintptr, gtk.TextDirection)
155+
156+// Sets the direction of @self.
157+//
158+// If set to [enum@Gtk.TextDirection.LTR] or [enum@Gtk.TextDirection.RTL], the
159+// shortcut will only be displayed for this direction.
160+func (x *ShortcutsItem) SetDirection(DirectionVar gtk.TextDirection) {
161+
162+ xShortcutsItemSetDirection(x.GoPointer(), DirectionVar)
163+
164+}
165+
166+var xShortcutsItemSetSubtitle func(uintptr, string)
167+
168+// Sets the subtitle of @self.
169+func (x *ShortcutsItem) SetSubtitle(SubtitleVar string) {
170+
171+ xShortcutsItemSetSubtitle(x.GoPointer(), SubtitleVar)
172+
173+}
174+
175+var xShortcutsItemSetTitle func(uintptr, string)
176+
177+// Sets the title of @self.
178+func (x *ShortcutsItem) SetTitle(TitleVar string) {
179+
180+ xShortcutsItemSetTitle(x.GoPointer(), TitleVar)
181+
182+}
183+
184+func (c *ShortcutsItem) GoPointer() uintptr {
185+ if c == nil {
186+ return 0
187+ }
188+ return c.Ptr
189+}
190+
191+func (c *ShortcutsItem) SetGoPointer(ptr uintptr) {
192+ c.Ptr = ptr
193+}
194+
195+func init() {
196+ core.SetPackageName("ADW", "libadwaita-1")
197+ core.SetSharedLibraries("ADW", []string{"libadwaita-1.so.0"})
198+ var libs []uintptr
199+ for _, libPath := range core.GetPaths("ADW") {
200+ lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
201+ if err != nil {
202+ panic(err)
203+ }
204+ libs = append(libs, lib)
205+ }
206+
207+ core.PuregoSafeRegister(&xShortcutsItemGLibType, libs, "adw_shortcuts_item_get_type")
208+
209+ core.PuregoSafeRegister(&xNewShortcutsItem, libs, "adw_shortcuts_item_new")
210+ core.PuregoSafeRegister(&xNewShortcutsItemFromAction, libs, "adw_shortcuts_item_new_from_action")
211+
212+ core.PuregoSafeRegister(&xShortcutsItemGetAccelerator, libs, "adw_shortcuts_item_get_accelerator")
213+ core.PuregoSafeRegister(&xShortcutsItemGetActionName, libs, "adw_shortcuts_item_get_action_name")
214+ core.PuregoSafeRegister(&xShortcutsItemGetDirection, libs, "adw_shortcuts_item_get_direction")
215+ core.PuregoSafeRegister(&xShortcutsItemGetSubtitle, libs, "adw_shortcuts_item_get_subtitle")
216+ core.PuregoSafeRegister(&xShortcutsItemGetTitle, libs, "adw_shortcuts_item_get_title")
217+ core.PuregoSafeRegister(&xShortcutsItemSetAccelerator, libs, "adw_shortcuts_item_set_accelerator")
218+ core.PuregoSafeRegister(&xShortcutsItemSetActionName, libs, "adw_shortcuts_item_set_action_name")
219+ core.PuregoSafeRegister(&xShortcutsItemSetDirection, libs, "adw_shortcuts_item_set_direction")
220+ core.PuregoSafeRegister(&xShortcutsItemSetSubtitle, libs, "adw_shortcuts_item_set_subtitle")
221+ core.PuregoSafeRegister(&xShortcutsItemSetTitle, libs, "adw_shortcuts_item_set_title")
222+
223+}
A v4/adw/adw-shortcuts-section.go +228 -0
@@ -0,0 +1,228 @@
1+// Package adw was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT
2+package adw
3+
4+import (
5+ "structs"
6+ "unsafe"
7+
8+ "github.com/jwijenbergh/purego"
9+ "github.com/jwijenbergh/puregotk/pkg/core"
10+ "github.com/jwijenbergh/puregotk/v4/gio"
11+ "github.com/jwijenbergh/puregotk/v4/gobject"
12+ "github.com/jwijenbergh/puregotk/v4/gobject/types"
13+ "github.com/jwijenbergh/puregotk/v4/gtk"
14+)
15+
16+type ShortcutsSectionClass struct {
17+ _ structs.HostLayout
18+
19+ ParentClass gobject.ObjectClass
20+}
21+
22+func (x *ShortcutsSectionClass) GoPointer() uintptr {
23+ return uintptr(unsafe.Pointer(x))
24+}
25+
26+// An object representing a section in [class@ShortcutsDialog].
27+//
28+// It contains [class@ShortcutsItem] objects, use [method@ShortcutsSection.add] to
29+// add them.
30+//
31+// `AdwShortcutsSection` implements the [iface@Gio.ListModel] interface and
32+// allows to access the added shortcut items through it.
33+//
34+// ## `AdwShortcutsSection` as `GtkBuildable`
35+//
36+// `AdwShortcutsSection` allows adding `AdwShortcutsItem` objects as children.
37+type ShortcutsSection struct {
38+ gobject.Object
39+}
40+
41+var xShortcutsSectionGLibType func() types.GType
42+
43+func ShortcutsSectionGLibType() types.GType {
44+ return xShortcutsSectionGLibType()
45+}
46+
47+func ShortcutsSectionNewFromInternalPtr(ptr uintptr) *ShortcutsSection {
48+ cls := &ShortcutsSection{}
49+ cls.Ptr = ptr
50+ return cls
51+}
52+
53+var xNewShortcutsSection func(string) uintptr
54+
55+// Creates a new `AdwShortcutsSection` with @title as its title if provided.
56+func NewShortcutsSection(TitleVar string) *ShortcutsSection {
57+ var cls *ShortcutsSection
58+
59+ cret := xNewShortcutsSection(TitleVar)
60+
61+ if cret == 0 {
62+ return nil
63+ }
64+ cls = &ShortcutsSection{}
65+ cls.Ptr = cret
66+ return cls
67+}
68+
69+var xShortcutsSectionAdd func(uintptr, uintptr)
70+
71+// Adds @item to @self.
72+func (x *ShortcutsSection) Add(ItemVar *ShortcutsItem) {
73+
74+ xShortcutsSectionAdd(x.GoPointer(), ItemVar.GoPointer())
75+
76+}
77+
78+var xShortcutsSectionGetTitle func(uintptr) string
79+
80+// Gets the title of @self.
81+func (x *ShortcutsSection) GetTitle() string {
82+
83+ cret := xShortcutsSectionGetTitle(x.GoPointer())
84+ return cret
85+}
86+
87+var xShortcutsSectionSetTitle func(uintptr, string)
88+
89+// Sets the title of @self.
90+func (x *ShortcutsSection) SetTitle(TitleVar string) {
91+
92+ xShortcutsSectionSetTitle(x.GoPointer(), TitleVar)
93+
94+}
95+
96+func (c *ShortcutsSection) GoPointer() uintptr {
97+ if c == nil {
98+ return 0
99+ }
100+ return c.Ptr
101+}
102+
103+func (c *ShortcutsSection) SetGoPointer(ptr uintptr) {
104+ c.Ptr = ptr
105+}
106+
107+// Get the item at @position.
108+//
109+// If @position is greater than the number of items in @list, %NULL is
110+// returned.
111+//
112+// %NULL is never returned for an index that is smaller than the length
113+// of the list.
114+//
115+// See also: g_list_model_get_n_items()
116+func (x *ShortcutsSection) GetItem(PositionVar uint) uintptr {
117+
118+ cret := gio.XGListModelGetItem(x.GoPointer(), PositionVar)
119+ return cret
120+}
121+
122+// Gets the type of the items in @list.
123+//
124+// All items returned from g_list_model_get_item() are of the type
125+// returned by this function, or a subtype, or if the type is an
126+// interface, they are an implementation of that interface.
127+//
128+// The item type of a #GListModel can not change during the life of the
129+// model.
130+func (x *ShortcutsSection) GetItemType() types.GType {
131+
132+ cret := gio.XGListModelGetItemType(x.GoPointer())
133+ return cret
134+}
135+
136+// Gets the number of items in @list.
137+//
138+// Depending on the model implementation, calling this function may be
139+// less efficient than iterating the list with increasing values for
140+// @position until g_list_model_get_item() returns %NULL.
141+func (x *ShortcutsSection) GetNItems() uint {
142+
143+ cret := gio.XGListModelGetNItems(x.GoPointer())
144+ return cret
145+}
146+
147+// Get the item at @position.
148+//
149+// If @position is greater than the number of items in @list, %NULL is
150+// returned.
151+//
152+// %NULL is never returned for an index that is smaller than the length
153+// of the list.
154+//
155+// This function is meant to be used by language bindings in place
156+// of g_list_model_get_item().
157+//
158+// See also: g_list_model_get_n_items()
159+func (x *ShortcutsSection) GetObject(PositionVar uint) *gobject.Object {
160+ var cls *gobject.Object
161+
162+ cret := gio.XGListModelGetObject(x.GoPointer(), PositionVar)
163+
164+ if cret == 0 {
165+ return nil
166+ }
167+ cls = &gobject.Object{}
168+ cls.Ptr = cret
169+ return cls
170+}
171+
172+// Emits the #GListModel::items-changed signal on @list.
173+//
174+// This function should only be called by classes implementing
175+// #GListModel. It has to be called after the internal representation
176+// of @list has been updated, because handlers connected to this signal
177+// might query the new state of the list.
178+//
179+// Implementations must only make changes to the model (as visible to
180+// its consumer) in places that will not cause problems for that
181+// consumer. For models that are driven directly by a write API (such
182+// as #GListStore), changes can be reported in response to uses of that
183+// API. For models that represent remote data, changes should only be
184+// made from a fresh mainloop dispatch. It is particularly not
185+// permitted to make changes in response to a call to the #GListModel
186+// consumer API.
187+//
188+// Stated another way: in general, it is assumed that code making a
189+// series of accesses to the model via the API, without returning to the
190+// mainloop, and without calling other code, will continue to view the
191+// same contents of the model.
192+func (x *ShortcutsSection) ItemsChanged(PositionVar uint, RemovedVar uint, AddedVar uint) {
193+
194+ gio.XGListModelItemsChanged(x.GoPointer(), PositionVar, RemovedVar, AddedVar)
195+
196+}
197+
198+// Gets the ID of the @buildable object.
199+//
200+// `GtkBuilder` sets the name based on the ID attribute
201+// of the `&lt;object&gt;` tag used to construct the @buildable.
202+func (x *ShortcutsSection) GetBuildableId() string {
203+
204+ cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer())
205+ return cret
206+}
207+
208+func init() {
209+ core.SetPackageName("ADW", "libadwaita-1")
210+ core.SetSharedLibraries("ADW", []string{"libadwaita-1.so.0"})
211+ var libs []uintptr
212+ for _, libPath := range core.GetPaths("ADW") {
213+ lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
214+ if err != nil {
215+ panic(err)
216+ }
217+ libs = append(libs, lib)
218+ }
219+
220+ core.PuregoSafeRegister(&xShortcutsSectionGLibType, libs, "adw_shortcuts_section_get_type")
221+
222+ core.PuregoSafeRegister(&xNewShortcutsSection, libs, "adw_shortcuts_section_new")
223+
224+ core.PuregoSafeRegister(&xShortcutsSectionAdd, libs, "adw_shortcuts_section_add")
225+ core.PuregoSafeRegister(&xShortcutsSectionGetTitle, libs, "adw_shortcuts_section_get_title")
226+ core.PuregoSafeRegister(&xShortcutsSectionSetTitle, libs, "adw_shortcuts_section_set_title")
227+
228+}
M v4/adw/adw-style-manager.go +1 -1
@@ -146,7 +146,7 @@ var xStyleManagerGetDocumentFontName func(uintptr) string
146146 // Gets the system document font.
147147 //
148148 // The font is in the same format as [property@Gtk.Settings:gtk-font-name],
149-// e.g. "Adwaita Sans 11".
149+// e.g. "Adwaita Sans 12".
150150 //
151151 // Use [func@Pango.FontDescription.from_string] to parse it.
152152 func (x *StyleManager) GetDocumentFontName() string {
M v4/adw/adw-version.go +3 -3
@@ -10,12 +10,12 @@ const (
1010 // Adwaita major version component (e.g. 1 if the version is 1.2.3).
1111 MAJOR_VERSION int = 1
1212 // Adwaita micro version component (e.g. 3 if the version is 1.2.3).
13- MICRO_VERSION int = 7
13+ MICRO_VERSION int = 1
1414 // Adwaita minor version component (e.g. 2 if the version is 1.2.3).
15- MINOR_VERSION int = 7
15+ MINOR_VERSION int = 8
1616 // Adwaita version, encoded as a string, useful for printing and
1717 // concatenation.
18- VERSION_S string = "1.7.7"
18+ VERSION_S string = "1.8.1"
1919 )
2020
2121 var xGetMajorVersion func() uint
M v4/adw/adw-wrap-box.go +10 -0
@@ -275,6 +275,15 @@ func (x *WrapBox) Remove(ChildVar *gtk.Widget) {
275275
276276 }
277277
278+var xWrapBoxRemoveAll func(uintptr)
279+
280+// Removes all children from @self.
281+func (x *WrapBox) RemoveAll() {
282+
283+ xWrapBoxRemoveAll(x.GoPointer())
284+
285+}
286+
278287 var xWrapBoxReorderChildAfter func(uintptr, uintptr, uintptr)
279288
280289 // Moves @child to the position after @sibling in the list of @self children.
@@ -796,6 +805,7 @@ func init() {
796805 core.PuregoSafeRegister(&xWrapBoxInsertChildAfter, libs, "adw_wrap_box_insert_child_after")
797806 core.PuregoSafeRegister(&xWrapBoxPrepend, libs, "adw_wrap_box_prepend")
798807 core.PuregoSafeRegister(&xWrapBoxRemove, libs, "adw_wrap_box_remove")
808+ core.PuregoSafeRegister(&xWrapBoxRemoveAll, libs, "adw_wrap_box_remove_all")
799809 core.PuregoSafeRegister(&xWrapBoxReorderChildAfter, libs, "adw_wrap_box_reorder_child_after")
800810 core.PuregoSafeRegister(&xWrapBoxSetAlign, libs, "adw_wrap_box_set_align")
801811 core.PuregoSafeRegister(&xWrapBoxSetChildSpacing, libs, "adw_wrap_box_set_child_spacing")
M v4/cairo/main.go +42 -0
@@ -182,6 +182,44 @@ func (x *RectangleInt) GoPointer() uintptr {
182182 return uintptr(unsafe.Pointer(x))
183183 }
184184
185+type Glyph struct {
186+ _ structs.HostLayout
187+
188+ Index uint32
189+
190+ X float64
191+
192+ Y float64
193+}
194+
195+var xGlyphGLibType func() types.GType
196+
197+func GlyphGLibType() types.GType {
198+ return xGlyphGLibType()
199+}
200+
201+func (x *Glyph) GoPointer() uintptr {
202+ return uintptr(unsafe.Pointer(x))
203+}
204+
205+type TextCluster struct {
206+ _ structs.HostLayout
207+
208+ NumBytes int
209+
210+ NumGlyphs int
211+}
212+
213+var xTextClusterGLibType func() types.GType
214+
215+func TextClusterGLibType() types.GType {
216+ return xTextClusterGLibType()
217+}
218+
219+func (x *TextCluster) GoPointer() uintptr {
220+ return uintptr(unsafe.Pointer(x))
221+}
222+
185223 type Status int
186224
187225 var xStatusGLibType func() types.GType
@@ -836,4 +874,8 @@ func init() {
836874
837875 core.PuregoSafeRegister(&xRectangleIntGLibType, libs, "cairo_gobject_rectangle_int_get_type")
838876
877+ core.PuregoSafeRegister(&xGlyphGLibType, libs, "cairo_gobject_glyph_get_type")
878+
879+ core.PuregoSafeRegister(&xTextClusterGLibType, libs, "cairo_gobject_text_cluster_get_type")
880+
839881 }
M v4/gdk/gdkclipboard.go +1 -1
@@ -245,7 +245,7 @@ var xClipboardSet func(uintptr, types.GType, ...interface{})
245245 // [func@GObject.signal_emit].
246246 //
247247 // ```c
248-// gdk_clipboard_set (clipboard, GTK_TYPE_STRING, "Hello World");
248+// gdk_clipboard_set (clipboard, G_TYPE_STRING, "Hello World");
249249 //
250250 // gdk_clipboard_set (clipboard, GDK_TYPE_TEXTURE, some_texture);
251251 // ```
M v4/gdk/gdkcontentdeserializer.go +4 -0
@@ -46,6 +46,10 @@ func ContentDeserializeFinish(ResultVar gio.AsyncResult, ValueVar *gobject.Value
4646 var xContentRegisterDeserializer func(string, types.GType, uintptr, uintptr, uintptr)
4747
4848 // Registers a function to deserialize object of a given type.
49+//
50+// Since 4.20, when looking up a deserializer to use, GTK will
51+// use the last registered deserializer for a given mime type,
52+// so applications can override the built-in deserializers.
4953 func ContentRegisterDeserializer(MimeTypeVar string, TypeVar types.GType, DeserializeVar *ContentDeserializeFunc, DataVar uintptr, NotifyVar *glib.DestroyNotify) {
5054
5155 xContentRegisterDeserializer(MimeTypeVar, TypeVar, glib.NewCallback(DeserializeVar), DataVar, glib.NewCallback(NotifyVar))
M v4/gdk/gdkcontentserializer.go +4 -0
@@ -20,6 +20,10 @@ type ContentSerializeFunc func(uintptr)
2020 var xContentRegisterSerializer func(types.GType, string, uintptr, uintptr, uintptr)
2121
2222 // Registers a function to serialize objects of a given type.
23+//
24+// Since 4.20, when looking up a serializer to use, GTK will
25+// use the last registered serializer for a given mime type,
26+// so applications can override the built-in serializers.
2327 func ContentRegisterSerializer(TypeVar types.GType, MimeTypeVar string, SerializeVar *ContentSerializeFunc, DataVar uintptr, NotifyVar *glib.DestroyNotify) {
2428
2529 xContentRegisterSerializer(TypeVar, MimeTypeVar, glib.NewCallback(SerializeVar), DataVar, glib.NewCallback(NotifyVar))
M v4/gdk/gdkdisplay.go +2 -0
@@ -183,6 +183,8 @@ var xDisplayGetDmabufFormats func(uintptr) *DmabufFormats
183183 // buffer formats with producers such as v4l, pipewire or GStreamer.
184184 //
185185 // To learn more about dma-bufs, see [class@Gdk.DmabufTextureBuilder].
186+//
187+// This function is threadsafe. It can be called from any thread.
186188 func (x *Display) GetDmabufFormats() *DmabufFormats {
187189
188190 cret := xDisplayGetDmabufFormats(x.GoPointer())
M v4/gdk/gdkdrag.go +1 -1
@@ -35,7 +35,7 @@ var xDragActionIsUnique func(DragAction) bool
3535 // Checks if @action represents a single action or includes
3636 // multiple actions.
3737 //
38-// When @action is 0 - ie no action was given, %TRUE
38+// When @action is `GDK_ACTION_NONE` - ie no action was given, `TRUE`
3939 // is returned.
4040 func DragActionIsUnique(ActionVar DragAction) bool {
4141
M v4/gdk/gdkdrop.go +7 -7
@@ -13,8 +13,8 @@ import (
1313 // Represents the target of an ongoing DND operation.
1414 //
1515 // Possible drop sites get informed about the status of the ongoing drag
16-// operation with events of type %GDK_DRAG_ENTER, %GDK_DRAG_LEAVE,
17-// %GDK_DRAG_MOTION and %GDK_DROP_START. The `GdkDrop` object can be obtained
16+// operation with events of type `GDK_DRAG_ENTER`, `GDK_DRAG_LEAVE`,
17+// `GDK_DRAG_MOTION` and `GDK_DROP_START`. The `GdkDrop` object can be obtained
1818 // from these [class@Gdk.Event] types using [method@Gdk.DNDEvent.get_drop].
1919 //
2020 // The actual data transfer is initiated from the target side via an async
@@ -57,11 +57,11 @@ var xDropGetActions func(uintptr) DragAction
5757 // Returns the possible actions for this `GdkDrop`.
5858 //
5959 // If this value contains multiple actions - i.e.
60-// [func@Gdk.DragAction.is_unique] returns %FALSE for the result -
60+// [func@Gdk.DragAction.is_unique] returns false for the result -
6161 // [method@Gdk.Drop.finish] must choose the action to use when
6262 // accepting the drop. This will only happen if you passed
63-// %GDK_ACTION_ASK as one of the possible actions in
64-// [method@Gdk.Drop.status]. %GDK_ACTION_ASK itself will not
63+// `GDK_ACTION_ASK` as one of the possible actions in
64+// [method@Gdk.Drop.status]. `GDK_ACTION_ASK` itself will not
6565 // be included in the actions returned by this function.
6666 //
6767 // This value may change over the lifetime of the [class@Gdk.Drop]
@@ -113,7 +113,7 @@ var xDropGetDrag func(uintptr) uintptr
113113 // If this is an in-app drag-and-drop operation, returns the `GdkDrag`
114114 // that corresponds to this drop.
115115 //
116-// If it is not, %NULL is returned.
116+// If it is not, `NULL` is returned.
117117 func (x *Drop) GetDrag() *Drag {
118118 var cls *Drag
119119
@@ -235,7 +235,7 @@ var xDropStatus func(uintptr, DragAction, DragAction)
235235 // action to use when multiple actions are possible.
236236 //
237237 // This function should be called by drag destinations in response to
238-// %GDK_DRAG_ENTER or %GDK_DRAG_MOTION events. If the destination does
238+// `GDK_DRAG_ENTER` or `GDK_DRAG_MOTION` events. If the destination does
239239 // not yet know the exact actions it supports, it should set any possible
240240 // actions first and then later call this function again.
241241 func (x *Drop) Status(ActionsVar DragAction, PreferredVar DragAction) {
M v4/gdk/gdkenums.go +471 -1
@@ -60,6 +60,8 @@ func DragActionGLibType() types.GType {
6060
6161 const (
6262
63+ // No action.
64+ ActionNoneValue DragAction = 0
6365 // Copy the data.
6466 ActionCopyValue DragAction = 1
6567 // Move the data, i.e. first copy it, then delete
@@ -357,9 +359,477 @@ const (
357359 MemoryR8g8b8x8Value MemoryFormat = 31
358360 // 4 bytes; for unused, blue, green, red.
359361 MemoryX8b8g8r8Value MemoryFormat = 32
362+ // Multiplane format with 2 planes.
363+ //
364+ // The first plane contains the first channel, usually containing
365+ // luma values.
366+ // The second plane with interleaved chroma values, Cb followed by Cr.
367+ // Subsampled in both the X and Y direction.
368+ //
369+ // Commonly known by the fourcc "NV12".
370+ MemoryG8B8r8420Value MemoryFormat = 33
371+ // Multiplane format with 2 planes.
372+ //
373+ // The first plane contains the first channel, usually containing
374+ // luma values.
375+ // The second plane with interleaved chroma values, Cr followed by Cb.
376+ // Subsampled in both the X and Y direction.
377+ //
378+ // Commonly known by the fourcc "NV21".
379+ MemoryG8R8b8420Value MemoryFormat = 34
380+ // Multiplane format with 2 planes.
381+ //
382+ // The first plane contains the first channel, usually containing
383+ // luma values.
384+ // The second plane with interleaved chroma values, Cb followed by Cr.
385+ // Subsampled in the X direction.
386+ //
387+ // Commonly known by the fourcc "NV16".
388+ MemoryG8B8r8422Value MemoryFormat = 35
389+ // Multiplane format with 2 planes.
390+ //
391+ // The first plane contains the first channel, usually containing
392+ // luma values.
393+ // The second plane with interleaved chroma values, Cr followed by Cb.
394+ // Subsampled in the X direction.
395+ //
396+ // Commonly known by the fourcc "NV61".
397+ MemoryG8R8b8422Value MemoryFormat = 36
398+ // Multiplane format with 2 planes.
399+ //
400+ // The first plane contains the first channel, usually containing
401+ // luma values.
402+ // The second plane with interleaved chroma values, Cb followed by Cr.
403+ // This format is not subsampled.
404+ //
405+ // Commonly known by the fourcc "NV24".
406+ MemoryG8B8r8444Value MemoryFormat = 37
407+ // Multiplane format with 2 planes.
408+ //
409+ // The first plane contains the first channel, usually containing
410+ // luma values.
411+ // The second plane with interleaved chroma values, Cr followed by Cb.
412+ // This format is not subsampled.
413+ //
414+ // Commonly known by the fourcc "NV42".
415+ MemoryG8R8b8444Value MemoryFormat = 38
416+ // Multiplane format with 2 planes.
417+ //
418+ // Each channel is a 16 bit integer, but only the highest 10 bits are used.
419+ //
420+ // The first plane contains the first channel, usually containing
421+ // luma values.
422+ // The second plane with interleaved chroma values, Cr followed by Cb.
423+ // This format is not subsampled.
424+ //
425+ // Commonly known by the fourcc "P010".
426+ MemoryG10x6B10x6r10x6420Value MemoryFormat = 39
427+ // Multiplane format with 2 planes.
428+ //
429+ // Each channel is a 16 bit integer, but only the highest 10 bits are used.
430+ //
431+ // The first plane contains the first channel, usually containing
432+ // luma values.
433+ // The second plane with interleaved chroma values, Cr followed by Cb.
434+ // This format is not subsampled.
435+ //
436+ // Commonly known by the fourcc "P012".
437+ MemoryG12x4B12x4r12x4420Value MemoryFormat = 40
438+ // Multiplane format with 2 planes.
439+ //
440+ // Each channel is a 16 bit integer.
441+ //
442+ // The first plane contains the first channel, usually containing
443+ // luma values.
444+ // The second plane with interleaved chroma values, Cr followed by Cb.
445+ // This format is not subsampled.
446+ //
447+ // Commonly known by the fourcc "P016".
448+ MemoryG16B16r16420Value MemoryFormat = 41
449+ // Multiplane format with 3 planes.
450+ //
451+ // Each channel is a 8 bit integer.
452+ //
453+ // The first plane usually contains the luma channel. It is mapped
454+ // into the 2nd channel.
455+ //
456+ // The second plane usually contains the first chroma chanel.
457+ // Subsampled in both the X and Y direction with 4:1 ratio. It is
458+ // mapped into the 3rd channel.
459+ //
460+ // The third plane usually contains the second chroma channel.
461+ // Subsampled in both the X and Y direction with 4:1 ratio. It is
462+ // mapped into the 1st channel.
463+ //
464+ // Commonly known by the fourcc "YUV410".
465+ MemoryG8B8R8410Value MemoryFormat = 42
466+ // Multiplane format with 3 planes.
467+ //
468+ // Each channel is a 8 bit integer.
469+ //
470+ // The first plane usually contains the luma channel. It is mapped
471+ // into the 2nd channel.
472+ //
473+ // The second plane usually contains the second chroma chanel.
474+ // Subsampled in both the X and Y direction with 4:1 ratio. It is
475+ // mapped into the 1st channel.
476+ //
477+ // The third plane usually contains the first chroma channel.
478+ // Subsampled in both the X and Y direction with 4:1 ratio. It is
479+ // mapped into the 3rd channel.
480+ //
481+ // Commonly known by the fourcc "YVU410".
482+ MemoryG8R8B8410Value MemoryFormat = 43
483+ // Multiplane format with 3 planes.
484+ //
485+ // Each channel is a 8 bit integer.
486+ //
487+ // The first plane usually contains the luma channel. It is mapped
488+ // into the 2nd channel.
489+ //
490+ // The second plane usually contains the first chroma chanel.
491+ // Subsampled in the X direction with 4:1 ratio. It is
492+ // mapped into the 3rd channel.
493+ //
494+ // The third plane usually contains the second chroma channel.
495+ // Subsampled in the X direction with 4:1 ratio. It is
496+ // mapped into the 1st channel.
497+ //
498+ // Commonly known by the fourcc "YUV411".
499+ MemoryG8B8R8411Value MemoryFormat = 44
500+ // Multiplane format with 3 planes.
501+ //
502+ // Each channel is a 8 bit integer.
503+ //
504+ // The first plane usually contains the luma channel. It is mapped
505+ // into the 2nd channel.
506+ //
507+ // The second plane usually contains the second chroma chanel.
508+ // Subsampled in the X direction with 4:1 ratio. It is
509+ // mapped into the 1st channel.
510+ //
511+ // The third plane usually contains the first chroma channel.
512+ // Subsampled in the X direction with 4:1 ratio. It is
513+ // mapped into the 3rd channel.
514+ //
515+ // Commonly known by the fourcc "YVU411".
516+ MemoryG8R8B8411Value MemoryFormat = 45
517+ // Multiplane format with 3 planes.
518+ //
519+ // Each channel is a 8 bit integer.
520+ //
521+ // The first plane usually contains the luma channel. It is mapped
522+ // into the 2nd channel.
523+ //
524+ // The second plane usually contains the first chroma chanel.
525+ // Subsampled in both the X and Y direction. It is mapped into the
526+ // 3rd channel.
527+ //
528+ // The third plane usually contains the second chroma channel.
529+ // Subsampled in both the X and Y direction. It is mapped into the
530+ // 1st channel.
531+ //
532+ // Commonly known by the fourcc "YUV420".
533+ MemoryG8B8R8420Value MemoryFormat = 46
534+ // Multiplane format with 3 planes.
535+ //
536+ // Each channel is a 8 bit integer.
537+ //
538+ // The first plane usually contains the luma channel. It is mapped
539+ // into the 2nd channel.
540+ //
541+ // The second plane usually contains the second chroma chanel.
542+ // Subsampled in both the X and Y direction. It is mapped into the
543+ // 1st channel.
544+ //
545+ // The third plane usually contains the first chroma channel.
546+ // Subsampled in both the X and Y direction. It is mapped into the
547+ // 3rd channel.
548+ //
549+ // Commonly known by the fourcc "YVU420".
550+ MemoryG8R8B8420Value MemoryFormat = 47
551+ // Multiplane format with 3 planes.
552+ //
553+ // Each channel is a 8 bit integer.
554+ //
555+ // The first plane usually contains the luma channel. It is mapped
556+ // into the 2nd channel.
557+ //
558+ // The second plane usually contains the first chroma chanel.
559+ // Subsampled in the X direction. It is mapped into the 3rd channel.
560+ //
561+ // The third plane usually contains the second chroma channel.
562+ // Subsampled in the X direction. It is mapped into the 1st channel.
563+ //
564+ // Commonly known by the fourcc "YUV422".
565+ MemoryG8B8R8422Value MemoryFormat = 48
566+ // Multiplane format with 3 planes.
567+ //
568+ // Each channel is a 8 bit integer.
569+ //
570+ // The first plane usually contains the luma channel. It is mapped
571+ // into the 2nd channel.
572+ //
573+ // The second plane usually contains the second chroma chanel.
574+ // Subsampled in the X direction. It is mapped into the 1st channel.
575+ //
576+ // The third plane usually contains the first chroma channel.
577+ // Subsampled in the X direction. It is mapped into the 3rd channel.
578+ //
579+ // Commonly known by the fourcc "YVU422".
580+ MemoryG8R8B8422Value MemoryFormat = 49
581+ // Multiplane format with 3 planes.
582+ //
583+ // Each channel is a 8 bit integer.
584+ //
585+ // The first plane usually contains the luma channel. It is mapped
586+ // into the 2nd channel.
587+ //
588+ // The second plane usually contains the first chroma chanel. It is
589+ // mapped into the 3rd channel.
590+ //
591+ // The third plane usually contains the second chroma channel. It is
592+ // mapped into the 1st channel.
593+ //
594+ // Commonly known by the fourcc "YUV444".
595+ MemoryG8B8R8444Value MemoryFormat = 50
596+ // Multiplane format with 3 planes.
597+ //
598+ // Each channel is a 8 bit integer.
599+ //
600+ // The first plane usually contains the luma channel. It is mapped
601+ // into the 2nd channel.
602+ //
603+ // The second plane usually contains the second chroma chanel.
604+ // Subsampled in the X direction. It is mapped into the 1st channel.
605+ //
606+ // The third plane usually contains the first chroma channel.
607+ // Subsampled in the X direction. It is mapped into the 3rd channel.
608+ //
609+ // Commonly known by the fourcc "YVU444".
610+ MemoryG8R8B8444Value MemoryFormat = 51
611+ // Packed format with subsampled channels.
612+ //
613+ // Each channel is a 8 bit integer. The red and blue/chroma channels
614+ // are subsampled and interleaved with the green/luma channel.
615+ //
616+ // Each block contains 2 pixels, so the width must be a multiple of
617+ // 2.
618+ //
619+ // Commonly known by the fourcc "YUYV".
620+ MemoryG8b8g8r8422Value MemoryFormat = 52
621+ // Packed format with subsampled channels.
622+ //
623+ // Each channel is a 8 bit integer. The red and blue/chroma channels
624+ // are subsampled and interleaved with the green/luma channel.
625+ //
626+ // Each block contains 2 pixels, so the width must be a multiple of
627+ // 2.
628+ //
629+ // Commonly known by the fourcc "YVYU".
630+ MemoryG8r8g8b8422Value MemoryFormat = 53
631+ // Packed format with subsampled channels.
632+ //
633+ // Each channel is a 8 bit integer. The red and blue/chroma channels
634+ // are subsampled and interleaved with the green/luma channel.
635+ //
636+ // Each block contains 2 pixels, so the width must be a multiple of
637+ // 2.
638+ //
639+ // Commonly known by the fourcc "VYUY".
640+ MemoryR8g8b8g8422Value MemoryFormat = 54
641+ // Packed format with subsampled channels.
642+ //
643+ // Each channel is a 8 bit integer. The red and blue/chroma channels
644+ // are subsampled and interleaved with the green/luma channel.
645+ //
646+ // Each block contains 2 pixels, so the width must be a multiple of
647+ // 2.
648+ //
649+ // Commonly known by the fourcc "UYVY".
650+ MemoryB8g8r8g8422Value MemoryFormat = 55
651+ // Multiplane format with 3 planes.
652+ //
653+ // Each channel is a 16 bit integer.
654+ //
655+ // Only the 10 lower bits are used. The remaining ones must be set to 0 by the
656+ // producer.
657+ //
658+ // The first plane usually contains the luma channel. It is mapped
659+ // into the 2nd channel.
660+ //
661+ // The second plane usually contains the first chroma chanel.
662+ // Subsampled in both the X and Y direction. It is mapped into the
663+ // 3rd channel.
664+ //
665+ // The third plane usually contains the second chroma channel.
666+ // Subsampled in both the X and Y direction. It is mapped into the
667+ // 1st channel.
668+ //
669+ // Commonly known by the fourcc "S010".
670+ MemoryX6g10X6b10X6r10420Value MemoryFormat = 56
671+ // Multiplane format with 3 planes.
672+ //
673+ // Each channel is a 16 bit integer.
674+ //
675+ // Only the 10 lower bits are used. The remaining ones must be set to 0 by the
676+ // producer.
677+ //
678+ // The first plane usually contains the luma channel. It is mapped
679+ // into the 2nd channel.
680+ //
681+ // The second plane usually contains the first chroma chanel.
682+ // Subsampled in the X direction. It is mapped into the 3rd channel.
683+ //
684+ // The third plane usually contains the second chroma channel.
685+ // Subsampled in the X direction. It is mapped into the 1st channel.
686+ //
687+ // Commonly known by the fourcc "S210".
688+ MemoryX6g10X6b10X6r10422Value MemoryFormat = 57
689+ // Multiplane format with 3 planes.
690+ //
691+ // Each channel is a 16 bit integer.
692+ //
693+ // Only the 10 lower bits are used. The remaining ones must be set to 0 by the
694+ // producer.
695+ //
696+ // The first plane usually contains the luma channel. It is mapped
697+ // into the 2nd channel.
698+ //
699+ // The second plane usually contains the first chroma chanel. It is
700+ // mapped into the 3rd channel.
701+ //
702+ // The third plane usually contains the second chroma channel. It is
703+ // mapped into the 1st channel.
704+ //
705+ // Commonly known by the fourcc "S410".
706+ MemoryX6g10X6b10X6r10444Value MemoryFormat = 58
707+ // Multiplane format with 3 planes.
708+ //
709+ // Each channel is a 16 bit integer.
710+ //
711+ // Only the 12 lower bits are used. The remaining ones must be set to 0 by the
712+ // producer.
713+ //
714+ // The first plane usually contains the luma channel. It is mapped
715+ // into the 2nd channel.
716+ //
717+ // The second plane usually contains the first chroma chanel.
718+ // Subsampled in both the X and Y direction. It is mapped into the
719+ // 3rd channel.
720+ //
721+ // The third plane usually contains the second chroma channel.
722+ // Subsampled in both the X and Y direction. It is mapped into the
723+ // 1st channel.
724+ //
725+ // Commonly known by the fourcc "S012".
726+ MemoryX4g12X4b12X4r12420Value MemoryFormat = 59
727+ // Multiplane format with 3 planes.
728+ //
729+ // Each channel is a 16 bit integer.
730+ //
731+ // Only the 12 lower bits are used. The remaining ones must be set to 0 by the
732+ // producer.
733+ //
734+ // The first plane usually contains the luma channel. It is mapped
735+ // into the 2nd channel.
736+ //
737+ // The second plane usually contains the first chroma chanel.
738+ // Subsampled in the X direction. It is mapped into the 3rd channel.
739+ //
740+ // The third plane usually contains the second chroma channel.
741+ // Subsampled in the X direction. It is mapped into the 1st channel.
742+ //
743+ // Commonly known by the fourcc "S212".
744+ MemoryX4g12X4b12X4r12422Value MemoryFormat = 60
745+ // Multiplane format with 3 planes.
746+ //
747+ // Each channel is a 16 bit integer.
748+ //
749+ // Only the 12 lower bits are used. The remaining ones must be set to 0 by the
750+ // producer.
751+ //
752+ // The first plane usually contains the luma channel. It is mapped
753+ // into the 2nd channel.
754+ //
755+ // The second plane usually contains the first chroma chanel. It is
756+ // mapped into the 3rd channel.
757+ //
758+ // The third plane usually contains the second chroma channel. It is
759+ // mapped into the 1st channel.
760+ //
761+ // Commonly known by the fourcc "S412".
762+ MemoryX4g12X4b12X4r12444Value MemoryFormat = 61
763+ // Multiplane format with 3 planes.
764+ //
765+ // Each channel is a 16 bit integer.
766+ //
767+ // The first plane usually contains the luma channel. It is mapped
768+ // into the 2nd channel.
769+ //
770+ // The second plane usually contains the first chroma chanel.
771+ // Subsampled in both the X and Y direction. It is mapped into the
772+ // 3rd channel.
773+ //
774+ // The third plane usually contains the second chroma channel.
775+ // Subsampled in both the X and Y direction. It is mapped into the
776+ // 1st channel.
777+ //
778+ // Commonly known by the fourcc "S016".
779+ MemoryG16B16R16420Value MemoryFormat = 62
780+ // Multiplane format with 3 planes.
781+ //
782+ // Each channel is a 16 bit integer.
783+ //
784+ // The first plane usually contains the luma channel. It is mapped
785+ // into the 2nd channel.
786+ //
787+ // The second plane usually contains the first chroma chanel.
788+ // Subsampled in the X direction. It is mapped into the 3rd channel.
789+ //
790+ // The third plane usually contains the second chroma channel.
791+ // Subsampled in the X direction. It is mapped into the 1st channel.
792+ //
793+ // Commonly known by the fourcc "S216".
794+ MemoryG16B16R16422Value MemoryFormat = 63
795+ // Multiplane format with 3 planes.
796+ //
797+ // Each channel is a 16 bit integer.
798+ //
799+ // The first plane usually contains the luma channel. It is mapped
800+ // into the 2nd channel.
801+ //
802+ // The second plane usually contains the first chroma chanel. It is
803+ // mapped into the 3rd channel.
804+ //
805+ // The third plane usually contains the second chroma channel. It is
806+ // mapped into the 1st channel.
807+ //
808+ // Commonly known by the fourcc "S416".
809+ MemoryG16B16R16444Value MemoryFormat = 64
360810 // The number of formats. This value will change as
361811 // more formats get added, so do not rely on its concrete integer.
362- MemoryNFormatsValue MemoryFormat = 33
812+ MemoryNFormatsValue MemoryFormat = 65
813+)
814+
815+// Used in scroll events, to announce the direction relative
816+// to physical motion.
817+type ScrollRelativeDirection int
818+
819+var xScrollRelativeDirectionGLibType func() types.GType
820+
821+func ScrollRelativeDirectionGLibType() types.GType {
822+ return xScrollRelativeDirectionGLibType()
823+}
824+
825+const (
826+
827+ // Physical motion and event motion are the same
828+ ScrollRelativeDirectionIdenticalValue ScrollRelativeDirection = 0
829+ // Physical motion is inverted relative to event motion
830+ ScrollRelativeDirectionInvertedValue ScrollRelativeDirection = 1
831+ // Relative motion is unknown on this device or backend
832+ ScrollRelativeDirectionUnknownValue ScrollRelativeDirection = 2
363833 )
364834
365835 // Error enumeration for `GdkVulkanContext`.
M v4/gdk/gdkevents.go +13 -1
@@ -159,8 +159,10 @@ const (
159159 // A touchpad hold gesture event, the current state is determined by its phase
160160 // field.
161161 TouchpadHoldValue EventType = 28
162+ // A tablet pad axis event from a "dial".
163+ PadDialValue EventType = 29
162164 // marks the end of the GdkEventType enumeration.
163- EventLastValue EventType = 29
165+ EventLastValue EventType = 30
164166 )
165167
166168 // Describes how well an event matches a given keyval and modifiers.
@@ -1237,6 +1239,14 @@ func (c *ScrollEvent) SetGoPointer(ptr uintptr) {
12371239 c.Ptr = ptr
12381240 }
12391241
1242+var xScrollEventGetRelativeDirection func(uintptr) ScrollRelativeDirection
1243+
1244+func ScrollEventGetRelativeDirection(EventVar *Event) ScrollRelativeDirection {
1245+
1246+ cret := xScrollEventGetRelativeDirection(EventVar.GoPointer())
1247+ return cret
1248+}
1249+
12401250 // An event related to a touch-based device.
12411251 type TouchEvent struct {
12421252 Event
@@ -1460,6 +1470,8 @@ func init() {
14601470 core.PuregoSafeRegister(&xScrollEventGetUnit, libs, "gdk_scroll_event_get_unit")
14611471 core.PuregoSafeRegister(&xScrollEventIsStop, libs, "gdk_scroll_event_is_stop")
14621472
1473+ core.PuregoSafeRegister(&xScrollEventGetRelativeDirection, libs, "gdk_scroll_event_get_relative_direction")
1474+
14631475 core.PuregoSafeRegister(&xTouchEventGLibType, libs, "gdk_touch_event_get_type")
14641476
14651477 core.PuregoSafeRegister(&xTouchEventGetEmulatingPointer, libs, "gdk_touch_event_get_emulating_pointer")
M v4/gdk/gdkmemorytexturebuilder.go +44 -2
@@ -124,6 +124,15 @@ func (x *MemoryTextureBuilder) GetHeight() int {
124124 return cret
125125 }
126126
127+var xMemoryTextureBuilderGetOffset func(uintptr, uint) uint
128+
129+// Gets the offset previously set via gdk_memory_texture_builder_set_offset().
130+func (x *MemoryTextureBuilder) GetOffset(PlaneVar uint) uint {
131+
132+ cret := xMemoryTextureBuilderGetOffset(x.GoPointer(), PlaneVar)
133+ return cret
134+}
135+
127136 var xMemoryTextureBuilderGetStride func(uintptr) uint
128137
129138 // Gets the stride previously set via gdk_memory_texture_builder_set_stride().
@@ -133,6 +142,15 @@ func (x *MemoryTextureBuilder) GetStride() uint {
133142 return cret
134143 }
135144
145+var xMemoryTextureBuilderGetStrideForPlane func(uintptr, uint) uint
146+
147+// Gets the stride previously set via gdk_memory_texture_builder_set_stride_for_plane().
148+func (x *MemoryTextureBuilder) GetStrideForPlane(PlaneVar uint) uint {
149+
150+ cret := xMemoryTextureBuilderGetStrideForPlane(x.GoPointer(), PlaneVar)
151+ return cret
152+}
153+
136154 var xMemoryTextureBuilderGetUpdateRegion func(uintptr) *cairo.Region
137155
138156 // Gets the region previously set via gdk_memory_texture_builder_set_update_region()
@@ -209,13 +227,23 @@ var xMemoryTextureBuilderSetHeight func(uintptr, int)
209227
210228 // Sets the height of the texture.
211229 //
212-// The height must be set before calling [method@Gdk.MemoryTextureBuilder.build].
230+// The height must be set before calling [method@Gdk.MemoryTextureBuilder.build]
231+// and conform to size requirements of the provided format.
213232 func (x *MemoryTextureBuilder) SetHeight(HeightVar int) {
214233
215234 xMemoryTextureBuilderSetHeight(x.GoPointer(), HeightVar)
216235
217236 }
218237
238+var xMemoryTextureBuilderSetOffset func(uintptr, uint, uint)
239+
240+// Sets the offset of the texture for @plane.
241+func (x *MemoryTextureBuilder) SetOffset(PlaneVar uint, OffsetVar uint) {
242+
243+ xMemoryTextureBuilderSetOffset(x.GoPointer(), PlaneVar, OffsetVar)
244+
245+}
246+
219247 var xMemoryTextureBuilderSetStride func(uintptr, uint)
220248
221249 // Sets the rowstride of the bytes used.
@@ -227,6 +255,15 @@ func (x *MemoryTextureBuilder) SetStride(StrideVar uint) {
227255
228256 }
229257
258+var xMemoryTextureBuilderSetStrideForPlane func(uintptr, uint, uint)
259+
260+// Sets the stride of the texture for @plane.
261+func (x *MemoryTextureBuilder) SetStrideForPlane(PlaneVar uint, StrideVar uint) {
262+
263+ xMemoryTextureBuilderSetStrideForPlane(x.GoPointer(), PlaneVar, StrideVar)
264+
265+}
266+
230267 var xMemoryTextureBuilderSetUpdateRegion func(uintptr, *cairo.Region)
231268
232269 // Sets the region to be updated by this texture.
@@ -261,7 +298,8 @@ var xMemoryTextureBuilderSetWidth func(uintptr, int)
261298
262299 // Sets the width of the texture.
263300 //
264-// The width must be set before calling [method@Gdk.MemoryTextureBuilder.build].
301+// The width must be set before calling [method@Gdk.MemoryTextureBuilder.build]
302+// and conform to size requirements of the provided format.
265303 func (x *MemoryTextureBuilder) SetWidth(WidthVar int) {
266304
267305 xMemoryTextureBuilderSetWidth(x.GoPointer(), WidthVar)
@@ -300,7 +338,9 @@ func init() {
300338 core.PuregoSafeRegister(&xMemoryTextureBuilderGetColorState, libs, "gdk_memory_texture_builder_get_color_state")
301339 core.PuregoSafeRegister(&xMemoryTextureBuilderGetFormat, libs, "gdk_memory_texture_builder_get_format")
302340 core.PuregoSafeRegister(&xMemoryTextureBuilderGetHeight, libs, "gdk_memory_texture_builder_get_height")
341+ core.PuregoSafeRegister(&xMemoryTextureBuilderGetOffset, libs, "gdk_memory_texture_builder_get_offset")
303342 core.PuregoSafeRegister(&xMemoryTextureBuilderGetStride, libs, "gdk_memory_texture_builder_get_stride")
343+ core.PuregoSafeRegister(&xMemoryTextureBuilderGetStrideForPlane, libs, "gdk_memory_texture_builder_get_stride_for_plane")
304344 core.PuregoSafeRegister(&xMemoryTextureBuilderGetUpdateRegion, libs, "gdk_memory_texture_builder_get_update_region")
305345 core.PuregoSafeRegister(&xMemoryTextureBuilderGetUpdateTexture, libs, "gdk_memory_texture_builder_get_update_texture")
306346 core.PuregoSafeRegister(&xMemoryTextureBuilderGetWidth, libs, "gdk_memory_texture_builder_get_width")
@@ -308,7 +348,9 @@ func init() {
308348 core.PuregoSafeRegister(&xMemoryTextureBuilderSetColorState, libs, "gdk_memory_texture_builder_set_color_state")
309349 core.PuregoSafeRegister(&xMemoryTextureBuilderSetFormat, libs, "gdk_memory_texture_builder_set_format")
310350 core.PuregoSafeRegister(&xMemoryTextureBuilderSetHeight, libs, "gdk_memory_texture_builder_set_height")
351+ core.PuregoSafeRegister(&xMemoryTextureBuilderSetOffset, libs, "gdk_memory_texture_builder_set_offset")
311352 core.PuregoSafeRegister(&xMemoryTextureBuilderSetStride, libs, "gdk_memory_texture_builder_set_stride")
353+ core.PuregoSafeRegister(&xMemoryTextureBuilderSetStrideForPlane, libs, "gdk_memory_texture_builder_set_stride_for_plane")
312354 core.PuregoSafeRegister(&xMemoryTextureBuilderSetUpdateRegion, libs, "gdk_memory_texture_builder_set_update_region")
313355 core.PuregoSafeRegister(&xMemoryTextureBuilderSetUpdateTexture, libs, "gdk_memory_texture_builder_set_update_texture")
314356 core.PuregoSafeRegister(&xMemoryTextureBuilderSetWidth, libs, "gdk_memory_texture_builder_set_width")
M v4/gdk/gdkpopuplayout.go +3 -3
@@ -97,7 +97,7 @@ func (x *PopupLayout) Equal(OtherVar *PopupLayout) bool {
9797
9898 var xPopupLayoutGetAnchorHints func(uintptr) AnchorHints
9999
100-// Get the `GdkAnchorHints`.
100+// Get the anchor hints.
101101 func (x *PopupLayout) GetAnchorHints() AnchorHints {
102102
103103 cret := xPopupLayoutGetAnchorHints(x.GoPointer())
@@ -164,8 +164,8 @@ var xPopupLayoutSetAnchorHints func(uintptr, AnchorHints)
164164 //
165165 // The set @anchor_hints determines how @surface will be moved
166166 // if the anchor points cause it to move off-screen. For example,
167-// %GDK_ANCHOR_FLIP_X will replace %GDK_GRAVITY_NORTH_WEST with
168-// %GDK_GRAVITY_NORTH_EAST and vice versa if @surface extends
167+// `GDK_ANCHOR_FLIP_X` will replace `GDK_GRAVITY_NORTH_WEST` with
168+// `GDK_GRAVITY_NORTH_EAST` and vice versa if @surface extends
169169 // beyond the left or right edges of the monitor.
170170 func (x *PopupLayout) SetAnchorHints(AnchorHintsVar AnchorHints) {
171171
M v4/gdk/gdktexture.go +28 -10
@@ -100,8 +100,8 @@ var xNewTextureForPixbuf func(uintptr) uintptr
100100 // Creates a new texture object representing the `GdkPixbuf`.
101101 //
102102 // This function is threadsafe, so that you can e.g. use GTask
103-// and [method@Gio.Task.run_in_thread] to avoid blocking the main thread
104-// while loading a big image.
103+// and [method@Gio.Task.run_in_thread] to avoid blocking the main
104+// thread while loading a big image.
105105 func NewTextureForPixbuf(PixbufVar *gdkpixbuf.Pixbuf) *Texture {
106106 var cls *Texture
107107
@@ -122,11 +122,17 @@ var xNewTextureFromBytes func(*glib.Bytes, **glib.Error) uintptr
122122 // The file format is detected automatically. The supported formats
123123 // are PNG, JPEG and TIFF, though more formats might be available.
124124 //
125-// If %NULL is returned, then @error will be set.
125+// If `NULL` is returned, then @error will be set.
126126 //
127127 // This function is threadsafe, so that you can e.g. use GTask
128128 // and [method@Gio.Task.run_in_thread] to avoid blocking the main thread
129129 // while loading a big image.
130+//
131+// ::: warning
132+//
133+// Note that this function should not be used with untrusted data.
134+// Use a proper image loading framework such as libglycin, which can
135+// load many image formats into a `GdkTexture`.
130136 func NewTextureFromBytes(BytesVar *glib.Bytes) (*Texture, error) {
131137 var cls *Texture
132138 var cerr *glib.Error
@@ -152,11 +158,17 @@ var xNewTextureFromFile func(uintptr, **glib.Error) uintptr
152158 // The file format is detected automatically. The supported formats
153159 // are PNG, JPEG and TIFF, though more formats might be available.
154160 //
155-// If %NULL is returned, then @error will be set.
161+// If `NULL` is returned, then @error will be set.
156162 //
157163 // This function is threadsafe, so that you can e.g. use GTask
158164 // and [method@Gio.Task.run_in_thread] to avoid blocking the main thread
159165 // while loading a big image.
166+//
167+// ::: warning
168+//
169+// Note that this function should not be used with untrusted data.
170+// Use a proper image loading framework such as libglycin, which can
171+// load many image formats into a `GdkTexture`.
160172 func NewTextureFromFile(FileVar gio.File) (*Texture, error) {
161173 var cls *Texture
162174 var cerr *glib.Error
@@ -182,11 +194,17 @@ var xNewTextureFromFilename func(string, **glib.Error) uintptr
182194 // The file format is detected automatically. The supported formats
183195 // are PNG, JPEG and TIFF, though more formats might be available.
184196 //
185-// If %NULL is returned, then @error will be set.
197+// If `NULL` is returned, then @error will be set.
186198 //
187199 // This function is threadsafe, so that you can e.g. use GTask
188200 // and [method@Gio.Task.run_in_thread] to avoid blocking the main thread
189201 // while loading a big image.
202+//
203+// ::: warning
204+//
205+// Note that this function should not be used with untrusted data.
206+// Use a proper image loading framework such as libglycin, which can
207+// load many image formats into a `GdkTexture`.
190208 func NewTextureFromFilename(PathVar string) (*Texture, error) {
191209 var cls *Texture
192210 var cerr *glib.Error
@@ -210,7 +228,7 @@ var xNewTextureFromResource func(string) uintptr
210228 // Creates a new texture by loading an image from a resource.
211229 //
212230 // The file format is detected automatically. The supported formats
213-// are PNG and JPEG, though more formats might be available.
231+// are PNG, JPEG and TIFF, though more formats might be available.
214232 //
215233 // It is a fatal error if @resource_path does not specify a valid
216234 // image resource and the program will abort if that happens.
@@ -317,9 +335,9 @@ var xTextureSaveToPng func(uintptr, string) bool
317335 //
318336 // This is a utility function intended for debugging and testing.
319337 // If you want more control over formats, proper error handling or
320-// want to store to a [iface@Gio.File] or other location, you might want to
321-// use [method@Gdk.Texture.save_to_png_bytes] or look into the
322-// gdk-pixbuf library.
338+// want to store to a [iface@Gio.File] or other location, you might
339+// want to use [method@Gdk.Texture.save_to_png_bytes] or look into
340+// the libglycin library.
323341 func (x *Texture) SaveToPng(FilenameVar string) bool {
324342
325343 cret := xTextureSaveToPng(x.GoPointer(), FilenameVar)
@@ -337,7 +355,7 @@ var xTextureSaveToPngBytes func(uintptr) *glib.Bytes
337355 //
338356 // If you need more control over the generated image, such as
339357 // attaching metadata, you should look into an image handling
340-// library such as the gdk-pixbuf library.
358+// library such as the libglycin library.
341359 //
342360 // If you are dealing with high dynamic range float data, you
343361 // might also want to consider [method@Gdk.Texture.save_to_tiff_bytes]
M v4/gdk/gdktoplevel.go +68 -0
@@ -30,6 +30,8 @@ type Toplevel interface {
3030 BeginMove(DeviceVar *Device, ButtonVar int, XVar float64, YVar float64, TimestampVar uint32)
3131 BeginResize(EdgeVar SurfaceEdge, DeviceVar *Device, ButtonVar int, XVar float64, YVar float64, TimestampVar uint32)
3232 Focus(TimestampVar uint32)
33+ GetCapabilities() ToplevelCapabilities
34+ GetGravity() Gravity
3335 GetState() ToplevelState
3436 InhibitSystemShortcuts(EventVar *Event)
3537 Lower() bool
@@ -38,6 +40,7 @@ type Toplevel interface {
3840 RestoreSystemShortcuts()
3941 SetDecorated(DecoratedVar bool)
4042 SetDeletable(DeletableVar bool)
43+ SetGravity(GravityVar Gravity)
4144 SetIconList(SurfacesVar *glib.List)
4245 SetModal(ModalVar bool)
4346 SetStartupId(StartupIdVar string)
@@ -98,6 +101,21 @@ func (x *ToplevelBase) Focus(TimestampVar uint32) {
98101
99102 }
100103
104+// The capabilities that are available for this toplevel.
105+func (x *ToplevelBase) GetCapabilities() ToplevelCapabilities {
106+
107+ cret := XGdkToplevelGetCapabilities(x.GoPointer())
108+ return cret
109+}
110+
111+// Returns the gravity that is used when changing the toplevel
112+// size programmatically.
113+func (x *ToplevelBase) GetGravity() Gravity {
114+
115+ cret := XGdkToplevelGetGravity(x.GoPointer())
116+ return cret
117+}
118+
101119 // Gets the bitwise or of the currently active surface state flags,
102120 // from the `GdkToplevelState` enumeration.
103121 func (x *ToplevelBase) GetState() ToplevelState {
@@ -199,6 +217,14 @@ func (x *ToplevelBase) SetDeletable(DeletableVar bool) {
199217
200218 }
201219
220+// Sets the gravity that is used when changing the toplevel
221+// size programmatically.
222+func (x *ToplevelBase) SetGravity(GravityVar Gravity) {
223+
224+ XGdkToplevelSetGravity(x.GoPointer(), GravityVar)
225+
226+}
227+
202228 // Sets a list of icons for the surface.
203229 //
204230 // One of these will be used to represent the surface in iconic form.
@@ -295,6 +321,8 @@ func (x *ToplevelBase) TitlebarGesture(GestureVar TitlebarGesture) bool {
295321 var XGdkToplevelBeginMove func(uintptr, uintptr, int, float64, float64, uint32)
296322 var XGdkToplevelBeginResize func(uintptr, SurfaceEdge, uintptr, int, float64, float64, uint32)
297323 var XGdkToplevelFocus func(uintptr, uint32)
324+var XGdkToplevelGetCapabilities func(uintptr) ToplevelCapabilities
325+var XGdkToplevelGetGravity func(uintptr) Gravity
298326 var XGdkToplevelGetState func(uintptr) ToplevelState
299327 var XGdkToplevelInhibitSystemShortcuts func(uintptr, uintptr)
300328 var XGdkToplevelLower func(uintptr) bool
@@ -303,6 +331,7 @@ var XGdkToplevelPresent func(uintptr, *ToplevelLayout)
303331 var XGdkToplevelRestoreSystemShortcuts func(uintptr)
304332 var XGdkToplevelSetDecorated func(uintptr, bool)
305333 var XGdkToplevelSetDeletable func(uintptr, bool)
334+var XGdkToplevelSetGravity func(uintptr, Gravity)
306335 var XGdkToplevelSetIconList func(uintptr, *glib.List)
307336 var XGdkToplevelSetModal func(uintptr, bool)
308337 var XGdkToplevelSetStartupId func(uintptr, string)
@@ -312,6 +341,40 @@ var XGdkToplevelShowWindowMenu func(uintptr, uintptr) bool
312341 var XGdkToplevelSupportsEdgeConstraints func(uintptr) bool
313342 var XGdkToplevelTitlebarGesture func(uintptr, TitlebarGesture) bool
314343
344+// Reflects what features a `GdkToplevel` supports.
345+type ToplevelCapabilities int
346+
347+var xToplevelCapabilitiesGLibType func() types.GType
348+
349+func ToplevelCapabilitiesGLibType() types.GType {
350+ return xToplevelCapabilitiesGLibType()
351+}
352+
353+const (
354+
355+ // Whether tiled window states are supported.
356+ ToplevelCapabilitiesEdgeConstraintsValue ToplevelCapabilities = 1
357+ // Whether inhibiting system shortcuts is supported.
358+ // See [method@Gdk.Toplevel.inhibit_system_shortcuts].
359+ ToplevelCapabilitiesInhibitShortcutsValue ToplevelCapabilities = 2
360+ // Whether titlebar gestures are supported.
361+ // See [method@Gdk.Toplevel.titlebar_gesture].
362+ ToplevelCapabilitiesTitlebarGesturesValue ToplevelCapabilities = 4
363+ // Whether showing the window menu is supported.
364+ // See [method@Gdk.Toplevel.show_window_menu].
365+ ToplevelCapabilitiesWindowMenuValue ToplevelCapabilities = 8
366+ // Whether the toplevel can be maximized.
367+ ToplevelCapabilitiesMaximizeValue ToplevelCapabilities = 16
368+ // Whether the toplevel can be made fullscreen.
369+ ToplevelCapabilitiesFullscreenValue ToplevelCapabilities = 32
370+ // Whether the toplevel can be minimized.
371+ // See [method@Gdk.Toplevel.minimize].
372+ ToplevelCapabilitiesMinimizeValue ToplevelCapabilities = 64
373+ // Whether the toplevel can be lowered.
374+ // See [method@Gdk.Toplevel.lower].
375+ ToplevelCapabilitiesLowerValue ToplevelCapabilities = 128
376+)
377+
315378 // Specifies the state of a toplevel surface.
316379 //
317380 // On platforms that support information about individual edges, the
@@ -443,6 +506,8 @@ func init() {
443506 libs = append(libs, lib)
444507 }
445508
509+ core.PuregoSafeRegister(&xToplevelCapabilitiesGLibType, libs, "gdk_toplevel_capabilities_get_type")
510+
446511 core.PuregoSafeRegister(&xToplevelStateGLibType, libs, "gdk_toplevel_state_get_type")
447512
448513 core.PuregoSafeRegister(&xFullscreenModeGLibType, libs, "gdk_fullscreen_mode_get_type")
@@ -456,6 +521,8 @@ func init() {
456521 core.PuregoSafeRegister(&XGdkToplevelBeginMove, libs, "gdk_toplevel_begin_move")
457522 core.PuregoSafeRegister(&XGdkToplevelBeginResize, libs, "gdk_toplevel_begin_resize")
458523 core.PuregoSafeRegister(&XGdkToplevelFocus, libs, "gdk_toplevel_focus")
524+ core.PuregoSafeRegister(&XGdkToplevelGetCapabilities, libs, "gdk_toplevel_get_capabilities")
525+ core.PuregoSafeRegister(&XGdkToplevelGetGravity, libs, "gdk_toplevel_get_gravity")
459526 core.PuregoSafeRegister(&XGdkToplevelGetState, libs, "gdk_toplevel_get_state")
460527 core.PuregoSafeRegister(&XGdkToplevelInhibitSystemShortcuts, libs, "gdk_toplevel_inhibit_system_shortcuts")
461528 core.PuregoSafeRegister(&XGdkToplevelLower, libs, "gdk_toplevel_lower")
@@ -464,6 +531,7 @@ func init() {
464531 core.PuregoSafeRegister(&XGdkToplevelRestoreSystemShortcuts, libs, "gdk_toplevel_restore_system_shortcuts")
465532 core.PuregoSafeRegister(&XGdkToplevelSetDecorated, libs, "gdk_toplevel_set_decorated")
466533 core.PuregoSafeRegister(&XGdkToplevelSetDeletable, libs, "gdk_toplevel_set_deletable")
534+ core.PuregoSafeRegister(&XGdkToplevelSetGravity, libs, "gdk_toplevel_set_gravity")
467535 core.PuregoSafeRegister(&XGdkToplevelSetIconList, libs, "gdk_toplevel_set_icon_list")
468536 core.PuregoSafeRegister(&XGdkToplevelSetModal, libs, "gdk_toplevel_set_modal")
469537 core.PuregoSafeRegister(&XGdkToplevelSetStartupId, libs, "gdk_toplevel_set_startup_id")
M v4/gdk/gdktoplevellayout.go +6 -6
@@ -38,11 +38,11 @@ var xNewToplevelLayout func() *ToplevelLayout
3838
3939 // Create a toplevel layout description.
4040 //
41-// Used together with gdk_toplevel_present() to describe
41+// Used together with [method@Gdk.Toplevel.present] to describe
4242 // how a toplevel surface should be placed and behave on-screen.
4343 //
4444 // The size is in ”application pixels”, not
45-// ”device pixels” (see gdk_surface_get_scale_factor()).
45+// ”device pixels” (see [method@Gdk.Surface.get_scale]).
4646 func NewToplevelLayout() *ToplevelLayout {
4747
4848 cret := xNewToplevelLayout()
@@ -70,8 +70,8 @@ func (x *ToplevelLayout) Equal(OtherVar *ToplevelLayout) bool {
7070 var xToplevelLayoutGetFullscreen func(uintptr, bool) bool
7171
7272 // If the layout specifies whether to the toplevel should go fullscreen,
73-// the value pointed to by @fullscreen is set to %TRUE if it should go
74-// fullscreen, or %FALSE, if it should go unfullscreen.
73+// the value pointed to by @fullscreen is set to true if it should go
74+// fullscreen, or false, if it should go unfullscreen.
7575 func (x *ToplevelLayout) GetFullscreen(FullscreenVar bool) bool {
7676
7777 cret := xToplevelLayoutGetFullscreen(x.GoPointer(), FullscreenVar)
@@ -99,8 +99,8 @@ func (x *ToplevelLayout) GetFullscreenMonitor() *Monitor {
9999 var xToplevelLayoutGetMaximized func(uintptr, bool) bool
100100
101101 // If the layout specifies whether to the toplevel should go maximized,
102-// the value pointed to by @maximized is set to %TRUE if it should go
103-// fullscreen, or %FALSE, if it should go unmaximized.
102+// the value pointed to by @maximized is set to true if it should go
103+// maximized, or false, if it should go unmaximized.
104104 func (x *ToplevelLayout) GetMaximized(MaximizedVar bool) bool {
105105
106106 cret := xToplevelLayoutGetMaximized(x.GoPointer(), MaximizedVar)
M v4/gdk/gdktypes.go +32 -0
@@ -68,6 +68,18 @@ func (x *ColorState) Equal(OtherVar *ColorState) bool {
6868 return cret
6969 }
7070
71+var xColorStateEquivalent func(uintptr, *ColorState) bool
72+
73+// Compares two `GdkColorStates` for equivalence.
74+//
75+// Two objects that represent the same color state should be equivalent,
76+// even though they may not be equal in the sense of [method@Gdk.ColorState.equal].
77+func (x *ColorState) Equivalent(OtherVar *ColorState) bool {
78+
79+ cret := xColorStateEquivalent(x.GoPointer(), OtherVar)
80+ return cret
81+}
82+
7183 var xColorStateRef func(uintptr) *ColorState
7284
7385 // Increase the reference count of @self.
@@ -589,15 +601,33 @@ var xTextureDownloaderDownloadBytes func(uintptr, uint) *glib.Bytes
589601 // fails to allocate memory. If you think that may happen, you should handle
590602 // memory allocation yourself and use [method@Gdk.TextureDownloader.download_into]
591603 // once allocation succeeded.
604+//
605+// This function cannot be used with a multiplanar format. Use
606+// [method@Gdk.TextureDownloader.download_bytes_with_planes] for that purpose.
592607 func (x *TextureDownloader) DownloadBytes(OutStrideVar uint) *glib.Bytes {
593608
594609 cret := xTextureDownloaderDownloadBytes(x.GoPointer(), OutStrideVar)
595610 return cret
596611 }
597612
613+var xTextureDownloaderDownloadBytesWithPlanes func(uintptr, [4]uint, [4]uint) *glib.Bytes
614+
615+// Downloads the given texture pixels into a `GBytes`. The offsets and
616+// strides of the resulting buffer will be stored in the respective values.
617+//
618+// If the format does have less than 4 planes, the remaining offsets and strides will be
619+// set to `0`.
620+func (x *TextureDownloader) DownloadBytesWithPlanes(OutOffsetsVar [4]uint, OutStridesVar [4]uint) *glib.Bytes {
621+
622+ cret := xTextureDownloaderDownloadBytesWithPlanes(x.GoPointer(), OutOffsetsVar, OutStridesVar)
623+ return cret
624+}
625+
598626 var xTextureDownloaderDownloadInto func(uintptr, []byte, uint)
599627
600628 // Downloads the @texture into local memory.
629+//
630+// This function cannot be used with a multiplanar format.
601631 func (x *TextureDownloader) DownloadInto(DataVar []byte, StrideVar uint) {
602632
603633 xTextureDownloaderDownloadInto(x.GoPointer(), DataVar, StrideVar)
@@ -701,6 +731,7 @@ func init() {
701731
702732 core.PuregoSafeRegister(&xColorStateCreateCicpParams, libs, "gdk_color_state_create_cicp_params")
703733 core.PuregoSafeRegister(&xColorStateEqual, libs, "gdk_color_state_equal")
734+ core.PuregoSafeRegister(&xColorStateEquivalent, libs, "gdk_color_state_equivalent")
704735 core.PuregoSafeRegister(&xColorStateRef, libs, "gdk_color_state_ref")
705736 core.PuregoSafeRegister(&xColorStateUnref, libs, "gdk_color_state_unref")
706737
@@ -749,6 +780,7 @@ func init() {
749780
750781 core.PuregoSafeRegister(&xTextureDownloaderCopy, libs, "gdk_texture_downloader_copy")
751782 core.PuregoSafeRegister(&xTextureDownloaderDownloadBytes, libs, "gdk_texture_downloader_download_bytes")
783+ core.PuregoSafeRegister(&xTextureDownloaderDownloadBytesWithPlanes, libs, "gdk_texture_downloader_download_bytes_with_planes")
752784 core.PuregoSafeRegister(&xTextureDownloaderDownloadInto, libs, "gdk_texture_downloader_download_into")
753785 core.PuregoSafeRegister(&xTextureDownloaderFree, libs, "gdk_texture_downloader_free")
754786 core.PuregoSafeRegister(&xTextureDownloaderGetColorState, libs, "gdk_texture_downloader_get_color_state")
M v4/gdk/gdkvulkancontext.go +0 -50
@@ -6,7 +6,6 @@ import (
66
77 "github.com/jwijenbergh/purego"
88 "github.com/jwijenbergh/puregotk/pkg/core"
9- "github.com/jwijenbergh/puregotk/v4/gio"
109 "github.com/jwijenbergh/puregotk/v4/glib"
1110 "github.com/jwijenbergh/puregotk/v4/gobject"
1211 "github.com/jwijenbergh/puregotk/v4/gobject/types"
@@ -79,55 +78,6 @@ func (x *VulkanContext) ConnectImagesUpdated(cb *func(VulkanContext)) uint32 {
7978 return gobject.SignalConnect(x.GoPointer(), "images-updated", cbRefPtr)
8079 }
8180
82-// Initializes the object implementing the interface.
83-//
84-// This method is intended for language bindings. If writing in C,
85-// g_initable_new() should typically be used instead.
86-//
87-// The object must be initialized before any real use after initial
88-// construction, either with this function or g_async_initable_init_async().
89-//
90-// Implementations may also support cancellation. If @cancellable is not %NULL,
91-// then initialization can be cancelled by triggering the cancellable object
92-// from another thread. If the operation was cancelled, the error
93-// %G_IO_ERROR_CANCELLED will be returned. If @cancellable is not %NULL and
94-// the object doesn't support cancellable initialization the error
95-// %G_IO_ERROR_NOT_SUPPORTED will be returned.
96-//
97-// If the object is not initialized, or initialization returns with an
98-// error, then all operations on the object except g_object_ref() and
99-// g_object_unref() are considered to be invalid, and have undefined
100-// behaviour. See the [description][iface@Gio.Initable#description] for more details.
101-//
102-// Callers should not assume that a class which implements #GInitable can be
103-// initialized multiple times, unless the class explicitly documents itself as
104-// supporting this. Generally, a class’ implementation of init() can assume
105-// (and assert) that it will only be called once. Previously, this documentation
106-// recommended all #GInitable implementations should be idempotent; that
107-// recommendation was relaxed in GLib 2.54.
108-//
109-// If a class explicitly supports being initialized multiple times, it is
110-// recommended that the method is idempotent: multiple calls with the same
111-// arguments should return the same results. Only the first call initializes
112-// the object; further calls return the result of the first call.
113-//
114-// One reason why a class might need to support idempotent initialization is if
115-// it is designed to be used via the singleton pattern, with a
116-// #GObjectClass.constructor that sometimes returns an existing instance.
117-// In this pattern, a caller would expect to be able to call g_initable_init()
118-// on the result of g_object_new(), regardless of whether it is in fact a new
119-// instance.
120-func (x *VulkanContext) Init(CancellableVar *gio.Cancellable) (bool, error) {
121- var cerr *glib.Error
122-
123- cret := gio.XGInitableInit(x.GoPointer(), CancellableVar.GoPointer(), &cerr)
124- if cerr == nil {
125- return cret, nil
126- }
127- return cret, cerr
128-
129-}
130-
13181 func init() {
13282 core.SetPackageName("GDK", "gtk4")
13383 core.SetSharedLibraries("GDK", []string{"libgtk-4.so.1"})
M v4/gdkpixbuf/gdk-pixbuf-features.go +3 -3
@@ -7,13 +7,13 @@ const (
77 PIXBUF_MAJOR int = 2
88 // Micro version of gdk-pixbuf library, that is the "2" in
99 // "0.8.2" for example.
10- PIXBUF_MICRO int = 12
10+ PIXBUF_MICRO int = 3
1111 // Minor version of gdk-pixbuf library, that is the "8" in
1212 // "0.8.2" for example.
13- PIXBUF_MINOR int = 42
13+ PIXBUF_MINOR int = 44
1414 // Contains the full version of GdkPixbuf as a string.
1515 //
1616 // This is the version being compiled against; contrast with
1717 // `gdk_pixbuf_version`.
18- PIXBUF_VERSION string = "2.42.12"
18+ PIXBUF_VERSION string = "2.44.3"
1919 )
M v4/gdkpixbuf/gdk-pixbuf.go +0 -3
@@ -38,9 +38,6 @@ import (
3838 // function will compute an optimal rowstride so that rendering can be
3939 // performed with an efficient algorithm.
4040 //
41-// As a special case, you can use the [`ctor@GdkPixbuf.Pixbuf.new_from_xpm_data`]
42-// function to create a pixbuf from inline XPM image data.
43-//
4441 // You can also copy an existing pixbuf with the [method@Pixbuf.copy]
4542 // function. This is not the same as just acquiring a reference to
4643 // the old pixbuf instance: the copy function will actually duplicate
M v4/gio/gapplication.go +6 -6
@@ -198,7 +198,7 @@ func (x *ApplicationClass) GetLocalCommandLine() func(*Application, []string, in
198198 // invoked on the primary instance before 'activate', 'open',
199199 //
200200 // 'command-line' or any action invocation, gets the 'platform data' from
201-// the calling instance
201+// the calling instance. Must chain up
202202 func (x *ApplicationClass) OverrideBeforeEmit(cb func(*Application, *glib.Variant)) {
203203 if cb == nil {
204204 x.xBeforeEmit = 0
@@ -213,7 +213,7 @@ func (x *ApplicationClass) OverrideBeforeEmit(cb func(*Application, *glib.Varian
213213 // invoked on the primary instance before 'activate', 'open',
214214 //
215215 // 'command-line' or any action invocation, gets the 'platform data' from
216-// the calling instance
216+// the calling instance. Must chain up
217217 func (x *ApplicationClass) GetBeforeEmit() func(*Application, *glib.Variant) {
218218 if x.xBeforeEmit == 0 {
219219 return nil
@@ -229,7 +229,7 @@ func (x *ApplicationClass) GetBeforeEmit() func(*Application, *glib.Variant) {
229229 // invoked on the primary instance after 'activate', 'open',
230230 //
231231 // 'command-line' or any action invocation, gets the 'platform data' from
232-// the calling instance
232+// the calling instance. Must chain up
233233 func (x *ApplicationClass) OverrideAfterEmit(cb func(*Application, *glib.Variant)) {
234234 if cb == nil {
235235 x.xAfterEmit = 0
@@ -244,7 +244,7 @@ func (x *ApplicationClass) OverrideAfterEmit(cb func(*Application, *glib.Variant
244244 // invoked on the primary instance after 'activate', 'open',
245245 //
246246 // 'command-line' or any action invocation, gets the 'platform data' from
247-// the calling instance
247+// the calling instance. Must chain up
248248 func (x *ApplicationClass) GetAfterEmit() func(*Application, *glib.Variant) {
249249 if x.xAfterEmit == 0 {
250250 return nil
@@ -259,7 +259,7 @@ func (x *ApplicationClass) GetAfterEmit() func(*Application, *glib.Variant) {
259259 // OverrideAddPlatformData sets the callback function.
260260 // invoked (locally) to add 'platform data' to be sent to
261261 //
262-// the primary instance when activating, opening or invoking actions
262+// the primary instance when activating, opening or invoking actions. Must chain up
263263 func (x *ApplicationClass) OverrideAddPlatformData(cb func(*Application, *glib.VariantBuilder)) {
264264 if cb == nil {
265265 x.xAddPlatformData = 0
@@ -273,7 +273,7 @@ func (x *ApplicationClass) OverrideAddPlatformData(cb func(*Application, *glib.V
273273 // GetAddPlatformData gets the callback function.
274274 // invoked (locally) to add 'platform data' to be sent to
275275 //
276-// the primary instance when activating, opening or invoking actions
276+// the primary instance when activating, opening or invoking actions. Must chain up
277277 func (x *ApplicationClass) GetAddPlatformData() func(*Application, *glib.VariantBuilder) {
278278 if x.xAddPlatformData == 0 {
279279 return nil
M v4/gio/gdbuserror.go +41 -30
@@ -10,7 +10,7 @@ import (
1010 "github.com/jwijenbergh/puregotk/v4/glib"
1111 )
1212
13-// Struct used in g_dbus_error_register_error_domain().
13+// Struct used in [func@Gio.DBusError.register_error_domain].
1414 type DBusErrorEntry struct {
1515 _ structs.HostLayout
1616
@@ -25,17 +25,20 @@ func (x *DBusErrorEntry) GoPointer() uintptr {
2525
2626 var xDbusErrorEncodeGerror func(*glib.Error) string
2727
28-// Creates a D-Bus error name to use for @error. If @error matches
29-// a registered error (cf. g_dbus_error_register_error()), the corresponding
30-// D-Bus error name will be returned.
28+// Creates a D-Bus error name to use for @error.
29+//
30+// If @error matches a registered error (see
31+// [func@Gio.DBusError.register_error]), the corresponding D-Bus error name
32+// will be returned.
3133 //
3234 // Otherwise the a name of the form
3335 // `org.gtk.GDBus.UnmappedGError.Quark._ESCAPED_QUARK_NAME.Code_ERROR_CODE`
3436 // will be used. This allows other GDBus applications to map the error
35-// on the wire back to a #GError using g_dbus_error_new_for_dbus_error().
37+// on the wire back to a [type@GLib.Error] using
38+// [func@Gio.DBusError.new_for_dbus_error].
3639 //
3740 // This function is typically only used in object mappings to put a
38-// #GError on the wire. Regular applications should not use it.
41+// [type@GLib.Error] on the wire. Regular applications should not use it.
3942 func DbusErrorEncodeGerror(ErrorVar *glib.Error) string {
4043
4144 cret := xDbusErrorEncodeGerror(ErrorVar)
@@ -47,9 +50,9 @@ var xDbusErrorGetRemoteError func(*glib.Error) string
4750 // Gets the D-Bus error name used for @error, if any.
4851 //
4952 // This function is guaranteed to return a D-Bus error name for all
50-// #GErrors returned from functions handling remote method calls
51-// (e.g. g_dbus_connection_call_finish()) unless
52-// g_dbus_error_strip_remote_error() has been used on @error.
53+// [type@GLib.Error]s returned from functions handling remote method calls
54+// (for example, [method@Gio.DBusConnection.call_finish]) unless
55+// [func@Gio.DBusError.strip_remote_error] has already been used on @error.
5356 func DbusErrorGetRemoteError(ErrorVar *glib.Error) string {
5457
5558 cret := xDbusErrorGetRemoteError(ErrorVar)
@@ -58,8 +61,9 @@ func DbusErrorGetRemoteError(ErrorVar *glib.Error) string {
5861
5962 var xDbusErrorIsRemoteError func(*glib.Error) bool
6063
61-// Checks if @error represents an error received via D-Bus from a remote peer. If so,
62-// use g_dbus_error_get_remote_error() to get the name of the error.
64+// Checks if @error represents an error received via D-Bus from a remote peer.
65+//
66+// If so, use [func@Gio.DBusError.get_remote_error] to get the name of the error.
6367 func DbusErrorIsRemoteError(ErrorVar *glib.Error) bool {
6468
6569 cret := xDbusErrorIsRemoteError(ErrorVar)
@@ -68,32 +72,35 @@ func DbusErrorIsRemoteError(ErrorVar *glib.Error) bool {
6872
6973 var xDbusErrorNewForDbusError func(string, string) *glib.Error
7074
71-// Creates a #GError based on the contents of @dbus_error_name and
75+// Creates a [type@GLib.Error] based on the contents of @dbus_error_name and
7276 // @dbus_error_message.
7377 //
74-// Errors registered with g_dbus_error_register_error() will be looked
78+// Errors registered with [func@Gio.DBusError.register_error] will be looked
7579 // up using @dbus_error_name and if a match is found, the error domain
76-// and code is used. Applications can use g_dbus_error_get_remote_error()
80+// and code is used. Applications can use [func@Gio.DBusError.get_remote_error]
7781 // to recover @dbus_error_name.
7882 //
7983 // If a match against a registered error is not found and the D-Bus
80-// error name is in a form as returned by g_dbus_error_encode_gerror()
84+// error name is in a form as returned by [func@Gio.DBusError.encode_gerror]
8185 // the error domain and code encoded in the name is used to
82-// create the #GError. Also, @dbus_error_name is added to the error message
83-// such that it can be recovered with g_dbus_error_get_remote_error().
86+// create the [type@GLib.Error]. Also, @dbus_error_name is added to the error
87+// message such that it can be recovered with
88+// [func@Gio.DBusError.get_remote_error].
8489 //
85-// Otherwise, a #GError with the error code %G_IO_ERROR_DBUS_ERROR
86-// in the %G_IO_ERROR error domain is returned. Also, @dbus_error_name is
90+// Otherwise, a [type@GLib.Error] with the error code
91+// [error@Gio.IOErrorEnum.DBUS_ERROR]
92+// in the [error@Gio.IOErrorEnum] error domain is returned. Also, @dbus_error_name is
8793 // added to the error message such that it can be recovered with
88-// g_dbus_error_get_remote_error().
94+// [func@Gio.DBusError.get_remote_error].
8995 //
9096 // In all three cases, @dbus_error_name can always be recovered from the
91-// returned #GError using the g_dbus_error_get_remote_error() function
92-// (unless g_dbus_error_strip_remote_error() hasn't been used on the returned error).
97+// returned [type@GLib.Error] using the [func@Gio.DBusError.get_remote_error]
98+// function (unless [func@Gio.DBusError.strip_remote_error] hasn’t been used on
99+// the returned error).
93100 //
94101 // This function is typically only used in object mappings to prepare
95-// #GError instances for applications. Regular applications should not use
96-// it.
102+// [type@GLib.Error] instances for applications. Regular applications should not
103+// use it.
97104 func DbusErrorNewForDbusError(DbusErrorNameVar string, DbusErrorMessageVar string) *glib.Error {
98105
99106 cret := xDbusErrorNewForDbusError(DbusErrorNameVar, DbusErrorMessageVar)
@@ -102,10 +109,10 @@ func DbusErrorNewForDbusError(DbusErrorNameVar string, DbusErrorMessageVar strin
102109
103110 var xDbusErrorRegisterError func(glib.Quark, int, string) bool
104111
105-// Creates an association to map between @dbus_error_name and
106-// #GErrors specified by @error_domain and @error_code.
112+// Creates an association mapping between @dbus_error_name and
113+// [type@GLib.Error]s specified by @error_domain and @error_code.
107114 //
108-// This is typically done in the routine that returns the #GQuark for
115+// This is typically done in the function that returns the [type@GLib.Quark] for
109116 // an error domain.
110117 func DbusErrorRegisterError(ErrorDomainVar glib.Quark, ErrorCodeVar int, DbusErrorNameVar string) bool {
111118
@@ -115,7 +122,8 @@ func DbusErrorRegisterError(ErrorDomainVar glib.Quark, ErrorCodeVar int, DbusErr
115122
116123 var xDbusErrorRegisterErrorDomain func(string, uint, []DBusErrorEntry, uint)
117124
118-// Helper function for associating a #GError error domain with D-Bus error names.
125+// Helper function for associating a [type@GLib.Error] error domain with D-Bus
126+// error names.
119127 //
120128 // While @quark_volatile has a `volatile` qualifier, this is a historical
121129 // artifact and the argument passed to it should not be `volatile`.
@@ -128,7 +136,9 @@ func DbusErrorRegisterErrorDomain(ErrorDomainQuarkNameVar string, QuarkVolatileV
128136 var xDbusErrorStripRemoteError func(*glib.Error) bool
129137
130138 // Looks for extra information in the error message used to recover
131-// the D-Bus error name and strips it if found. If stripped, the
139+// the D-Bus error name and strips it if found.
140+//
141+// If stripped, the
132142 // message field in @error will correspond exactly to what was
133143 // received on the wire.
134144 //
@@ -141,7 +151,8 @@ func DbusErrorStripRemoteError(ErrorVar *glib.Error) bool {
141151
142152 var xDbusErrorUnregisterError func(glib.Quark, int, string) bool
143153
144-// Destroys an association previously set up with g_dbus_error_register_error().
154+// Destroys an association previously set up with
155+// [func@Gio.DBusError.register_error].
145156 func DbusErrorUnregisterError(ErrorDomainVar glib.Quark, ErrorCodeVar int, DbusErrorNameVar string) bool {
146157
147158 cret := xDbusErrorUnregisterError(ErrorDomainVar, ErrorCodeVar, DbusErrorNameVar)
M v4/gio/gdbusmessage.go +1 -1
@@ -228,7 +228,7 @@ func (x *DBusMessage) GetInterface() string {
228228 var xDBusMessageGetLocked func(uintptr) bool
229229
230230 // Checks whether @message is locked. To monitor changes to this
231-// value, conncet to the #GObject::notify signal to listen for changes
231+// value, connect to the #GObject::notify signal to listen for changes
232232 // on the #GDBusMessage:locked property.
233233 func (x *DBusMessage) GetLocked() bool {
234234
D v4/gio/gdesktopappinfo.go +0 -883
@@ -1,883 +0,0 @@
1-// Package gio was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT
2-package gio
3-
4-import (
5- "structs"
6- "unsafe"
7-
8- "github.com/jwijenbergh/purego"
9- "github.com/jwijenbergh/puregotk/pkg/core"
10- "github.com/jwijenbergh/puregotk/v4/glib"
11- "github.com/jwijenbergh/puregotk/v4/gobject"
12- "github.com/jwijenbergh/puregotk/v4/gobject/types"
13-)
14-
15-// During invocation, g_desktop_app_info_launch_uris_as_manager() may
16-// create one or more child processes. This callback is invoked once
17-// for each, providing the process ID.
18-type DesktopAppLaunchCallback func(uintptr, glib.Pid, uintptr)
19-
20-type DesktopAppInfoClass struct {
21- _ structs.HostLayout
22-
23- ParentClass gobject.ObjectClass
24-}
25-
26-func (x *DesktopAppInfoClass) GoPointer() uintptr {
27- return uintptr(unsafe.Pointer(x))
28-}
29-
30-// Interface that is used by backends to associate default
31-// handlers with URI schemes.
32-type DesktopAppInfoLookupIface struct {
33- _ structs.HostLayout
34-
35- GIface uintptr
36-
37- xGetDefaultForUriScheme uintptr
38-}
39-
40-func (x *DesktopAppInfoLookupIface) GoPointer() uintptr {
41- return uintptr(unsafe.Pointer(x))
42-}
43-
44-// OverrideGetDefaultForUriScheme sets the callback function.
45-// Virtual method for
46-//
47-// g_desktop_app_info_lookup_get_default_for_uri_scheme().
48-func (x *DesktopAppInfoLookupIface) OverrideGetDefaultForUriScheme(cb func(DesktopAppInfoLookup, string) *AppInfoBase) {
49- if cb == nil {
50- x.xGetDefaultForUriScheme = 0
51- } else {
52- x.xGetDefaultForUriScheme = purego.NewCallback(func(LookupVarp uintptr, UriSchemeVarp string) uintptr {
53- ret := cb(&DesktopAppInfoLookupBase{Ptr: LookupVarp}, UriSchemeVarp)
54- if ret == nil {
55- return 0
56- }
57- return ret.GoPointer()
58- })
59- }
60-}
61-
62-// GetGetDefaultForUriScheme gets the callback function.
63-// Virtual method for
64-//
65-// g_desktop_app_info_lookup_get_default_for_uri_scheme().
66-func (x *DesktopAppInfoLookupIface) GetGetDefaultForUriScheme() func(DesktopAppInfoLookup, string) *AppInfoBase {
67- if x.xGetDefaultForUriScheme == 0 {
68- return nil
69- }
70- var rawCallback func(LookupVarp uintptr, UriSchemeVarp string) uintptr
71- purego.RegisterFunc(&rawCallback, x.xGetDefaultForUriScheme)
72- return func(LookupVar DesktopAppInfoLookup, UriSchemeVar string) *AppInfoBase {
73- rawRet := rawCallback(LookupVar.GoPointer(), UriSchemeVar)
74- if rawRet == 0 {
75- return nil
76- }
77- ret := &AppInfoBase{}
78- ret.Ptr = rawRet
79- return ret
80- }
81-}
82-
83-// #GDesktopAppInfoLookup is an opaque data structure and can only be accessed
84-// using the following functions.
85-type DesktopAppInfoLookup interface {
86- GoPointer() uintptr
87- SetGoPointer(uintptr)
88- GetDefaultForUriScheme(UriSchemeVar string) *AppInfoBase
89-}
90-
91-var xDesktopAppInfoLookupGLibType func() types.GType
92-
93-func DesktopAppInfoLookupGLibType() types.GType {
94- return xDesktopAppInfoLookupGLibType()
95-}
96-
97-type DesktopAppInfoLookupBase struct {
98- Ptr uintptr
99-}
100-
101-func (x *DesktopAppInfoLookupBase) GoPointer() uintptr {
102- if x == nil {
103- return 0
104- }
105- return x.Ptr
106-}
107-
108-func (x *DesktopAppInfoLookupBase) SetGoPointer(ptr uintptr) {
109- x.Ptr = ptr
110-}
111-
112-// Gets the default application for launching applications
113-// using this URI scheme for a particular [iface@Gio.DesktopAppInfoLookup]
114-// implementation.
115-//
116-// The [iface@Gio.DesktopAppInfoLookup] interface and this function is used
117-// to implement [func@Gio.AppInfo.get_default_for_uri_scheme] backends
118-// in a GIO module. There is no reason for applications to use it
119-// directly. Applications should use
120-// [func@Gio.AppInfo.get_default_for_uri_scheme].
121-func (x *DesktopAppInfoLookupBase) GetDefaultForUriScheme(UriSchemeVar string) *AppInfoBase {
122- var cls *AppInfoBase
123-
124- cret := XGDesktopAppInfoLookupGetDefaultForUriScheme(x.GoPointer(), UriSchemeVar)
125-
126- if cret == 0 {
127- return nil
128- }
129- cls = &AppInfoBase{}
130- cls.Ptr = cret
131- return cls
132-}
133-
134-var XGDesktopAppInfoLookupGetDefaultForUriScheme func(uintptr, string) uintptr
135-
136-const (
137- // Extension point for default handler to URI association. See
138- // [Extending GIO](overview.html#extending-gio).
139- DESKTOP_APP_INFO_LOOKUP_EXTENSION_POINT_NAME string = "gio-desktop-app-info-lookup"
140-)
141-
142-// `GDesktopAppInfo` is an implementation of [iface@Gio.AppInfo] based on
143-// desktop files.
144-//
145-// Note that `&lt;gio/gdesktopappinfo.h&gt;` belongs to the UNIX-specific
146-// GIO interfaces, thus you have to use the `gio-unix-2.0.pc` pkg-config
147-// file or the `GioUnix-2.0` GIR namespace when using it.
148-type DesktopAppInfo struct {
149- gobject.Object
150-}
151-
152-var xDesktopAppInfoGLibType func() types.GType
153-
154-func DesktopAppInfoGLibType() types.GType {
155- return xDesktopAppInfoGLibType()
156-}
157-
158-func DesktopAppInfoNewFromInternalPtr(ptr uintptr) *DesktopAppInfo {
159- cls := &DesktopAppInfo{}
160- cls.Ptr = ptr
161- return cls
162-}
163-
164-var xNewDesktopAppInfo func(string) uintptr
165-
166-// Creates a new [class@Gio.DesktopAppInfo] based on a desktop file ID.
167-//
168-// A desktop file ID is the basename of the desktop file, including the
169-// `.desktop` extension. GIO is looking for a desktop file with this name
170-// in the `applications` subdirectories of the XDG
171-// data directories (i.e. the directories specified in the `XDG_DATA_HOME`
172-// and `XDG_DATA_DIRS` environment variables). GIO also supports the
173-// prefix-to-subdirectory mapping that is described in the
174-// [Menu Spec](http://standards.freedesktop.org/menu-spec/latest/)
175-// (i.e. a desktop ID of `kde-foo.desktop` will match
176-// `/usr/share/applications/kde/foo.desktop`).
177-func NewDesktopAppInfo(DesktopIdVar string) *DesktopAppInfo {
178- var cls *DesktopAppInfo
179-
180- cret := xNewDesktopAppInfo(DesktopIdVar)
181-
182- if cret == 0 {
183- return nil
184- }
185- cls = &DesktopAppInfo{}
186- cls.Ptr = cret
187- return cls
188-}
189-
190-var xNewDesktopAppInfoFromFilename func(string) uintptr
191-
192-// Creates a new [class@Gio.DesktopAppInfo].
193-func NewDesktopAppInfoFromFilename(FilenameVar string) *DesktopAppInfo {
194- var cls *DesktopAppInfo
195-
196- cret := xNewDesktopAppInfoFromFilename(FilenameVar)
197-
198- if cret == 0 {
199- return nil
200- }
201- cls = &DesktopAppInfo{}
202- cls.Ptr = cret
203- return cls
204-}
205-
206-var xNewDesktopAppInfoFromKeyfile func(*glib.KeyFile) uintptr
207-
208-// Creates a new [class@Gio.DesktopAppInfo].
209-func NewDesktopAppInfoFromKeyfile(KeyFileVar *glib.KeyFile) *DesktopAppInfo {
210- var cls *DesktopAppInfo
211-
212- cret := xNewDesktopAppInfoFromKeyfile(KeyFileVar)
213-
214- if cret == 0 {
215- return nil
216- }
217- cls = &DesktopAppInfo{}
218- cls.Ptr = cret
219- return cls
220-}
221-
222-var xDesktopAppInfoGetActionName func(uintptr, string) string
223-
224-// Gets the user-visible display name of the
225-// [‘additional application actions’](https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s11.html)
226-// specified by @action_name.
227-//
228-// This corresponds to the `Name` key within the keyfile group for the
229-// action.
230-func (x *DesktopAppInfo) GetActionName(ActionNameVar string) string {
231-
232- cret := xDesktopAppInfoGetActionName(x.GoPointer(), ActionNameVar)
233- return cret
234-}
235-
236-var xDesktopAppInfoGetBoolean func(uintptr, string) bool
237-
238-// Looks up a boolean value in the keyfile backing @info.
239-//
240-// The @key is looked up in the `Desktop Entry` group.
241-func (x *DesktopAppInfo) GetBoolean(KeyVar string) bool {
242-
243- cret := xDesktopAppInfoGetBoolean(x.GoPointer(), KeyVar)
244- return cret
245-}
246-
247-var xDesktopAppInfoGetCategories func(uintptr) string
248-
249-// Gets the categories from the desktop file.
250-func (x *DesktopAppInfo) GetCategories() string {
251-
252- cret := xDesktopAppInfoGetCategories(x.GoPointer())
253- return cret
254-}
255-
256-var xDesktopAppInfoGetFilename func(uintptr) string
257-
258-// When @info was created from a known filename, return it. In some
259-// situations such as a [class@Gio.DesktopAppInfo] returned from
260-// [ctor@Gio.DesktopAppInfo.new_from_keyfile], this function will return `NULL`.
261-func (x *DesktopAppInfo) GetFilename() string {
262-
263- cret := xDesktopAppInfoGetFilename(x.GoPointer())
264- return cret
265-}
266-
267-var xDesktopAppInfoGetGenericName func(uintptr) string
268-
269-// Gets the generic name from the desktop file.
270-func (x *DesktopAppInfo) GetGenericName() string {
271-
272- cret := xDesktopAppInfoGetGenericName(x.GoPointer())
273- return cret
274-}
275-
276-var xDesktopAppInfoGetIsHidden func(uintptr) bool
277-
278-// A desktop file is hidden if the
279-// [`Hidden` key](https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s06.html#key-hidden)
280-// in it is set to `True`.
281-func (x *DesktopAppInfo) GetIsHidden() bool {
282-
283- cret := xDesktopAppInfoGetIsHidden(x.GoPointer())
284- return cret
285-}
286-
287-var xDesktopAppInfoGetKeywords func(uintptr) []string
288-
289-// Gets the keywords from the desktop file.
290-func (x *DesktopAppInfo) GetKeywords() []string {
291-
292- cret := xDesktopAppInfoGetKeywords(x.GoPointer())
293- return cret
294-}
295-
296-var xDesktopAppInfoGetLocaleString func(uintptr, string) string
297-
298-// Looks up a localized string value in the keyfile backing @info
299-// translated to the current locale.
300-//
301-// The @key is looked up in the `Desktop Entry` group.
302-func (x *DesktopAppInfo) GetLocaleString(KeyVar string) string {
303-
304- cret := xDesktopAppInfoGetLocaleString(x.GoPointer(), KeyVar)
305- return cret
306-}
307-
308-var xDesktopAppInfoGetNodisplay func(uintptr) bool
309-
310-// Gets the value of the
311-// [`NoDisplay` key](https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s06.html#key-nodisplay)
312-//
313-// which helps determine if the application info should be shown in menus. See
314-//
315-// `G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY` and [method@Gio.AppInfo.should_show].
316-func (x *DesktopAppInfo) GetNodisplay() bool {
317-
318- cret := xDesktopAppInfoGetNodisplay(x.GoPointer())
319- return cret
320-}
321-
322-var xDesktopAppInfoGetShowIn func(uintptr, string) bool
323-
324-// Checks if the application info should be shown in menus that list available
325-// applications for a specific name of the desktop, based on the
326-// [`OnlyShowIn`](https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s06.html#key-onlyshowin)
327-// and [`NotShowIn`](https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s06.html#key-notshowin)
328-// keys.
329-//
330-// @desktop_env should typically be given as `NULL`, in which case the
331-// `XDG_CURRENT_DESKTOP` environment variable is consulted. If you want
332-// to override the default mechanism then you may specify @desktop_env,
333-// but this is not recommended.
334-//
335-// Note that [method@Gio.AppInfo.should_show] for @info will include this check
336-// (with `NULL` for @desktop_env) as well as additional checks.
337-func (x *DesktopAppInfo) GetShowIn(DesktopEnvVar string) bool {
338-
339- cret := xDesktopAppInfoGetShowIn(x.GoPointer(), DesktopEnvVar)
340- return cret
341-}
342-
343-var xDesktopAppInfoGetStartupWmClass func(uintptr) string
344-
345-// Retrieves the `StartupWMClass` field from @info. This represents the
346-// `WM_CLASS` property of the main window of the application, if launched
347-// through @info.
348-func (x *DesktopAppInfo) GetStartupWmClass() string {
349-
350- cret := xDesktopAppInfoGetStartupWmClass(x.GoPointer())
351- return cret
352-}
353-
354-var xDesktopAppInfoGetString func(uintptr, string) string
355-
356-// Looks up a string value in the keyfile backing @info.
357-//
358-// The @key is looked up in the `Desktop Entry` group.
359-func (x *DesktopAppInfo) GetString(KeyVar string) string {
360-
361- cret := xDesktopAppInfoGetString(x.GoPointer(), KeyVar)
362- return cret
363-}
364-
365-var xDesktopAppInfoGetStringList func(uintptr, string, uint) []string
366-
367-// Looks up a string list value in the keyfile backing @info.
368-//
369-// The @key is looked up in the `Desktop Entry` group.
370-func (x *DesktopAppInfo) GetStringList(KeyVar string, LengthVar uint) []string {
371-
372- cret := xDesktopAppInfoGetStringList(x.GoPointer(), KeyVar, LengthVar)
373- return cret
374-}
375-
376-var xDesktopAppInfoHasKey func(uintptr, string) bool
377-
378-// Returns whether @key exists in the `Desktop Entry` group
379-// of the keyfile backing @info.
380-func (x *DesktopAppInfo) HasKey(KeyVar string) bool {
381-
382- cret := xDesktopAppInfoHasKey(x.GoPointer(), KeyVar)
383- return cret
384-}
385-
386-var xDesktopAppInfoLaunchAction func(uintptr, string, uintptr)
387-
388-// Activates the named application action.
389-//
390-// You may only call this function on action names that were
391-// returned from [method@Gio.DesktopAppInfo.list_actions].
392-//
393-// Note that if the main entry of the desktop file indicates that the
394-// application supports startup notification, and @launch_context is
395-// non-`NULL`, then startup notification will be used when activating the
396-// action (and as such, invocation of the action on the receiving side
397-// must signal the end of startup notification when it is completed).
398-// This is the expected behaviour of applications declaring additional
399-// actions, as per the
400-// [desktop file specification](https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s11.html).
401-//
402-// As with [method@Gio.AppInfo.launch] there is no way to detect failures that
403-// occur while using this function.
404-func (x *DesktopAppInfo) LaunchAction(ActionNameVar string, LaunchContextVar *AppLaunchContext) {
405-
406- xDesktopAppInfoLaunchAction(x.GoPointer(), ActionNameVar, LaunchContextVar.GoPointer())
407-
408-}
409-
410-var xDesktopAppInfoLaunchUrisAsManager func(uintptr, *glib.List, uintptr, glib.SpawnFlags, uintptr, uintptr, uintptr, uintptr, **glib.Error) bool
411-
412-// This function performs the equivalent of [method@Gio.AppInfo.launch_uris],
413-// but is intended primarily for operating system components that
414-// launch applications. Ordinary applications should use
415-// [method@Gio.AppInfo.launch_uris].
416-//
417-// If the application is launched via GSpawn, then @spawn_flags, @user_setup
418-// and @user_setup_data are used for the call to [func@GLib.spawn_async].
419-// Additionally, @pid_callback (with @pid_callback_data) will be called to
420-// inform about the PID of the created process. See
421-// [func@GLib.spawn_async_with_pipes] for information on certain parameter
422-// conditions that can enable an optimized [`posix_spawn()`](man:posix_spawn(3))
423-// code path to be used.
424-//
425-// If application launching occurs via some other mechanism (for example, D-Bus
426-// activation) then @spawn_flags, @user_setup, @user_setup_data,
427-// @pid_callback and @pid_callback_data are ignored.
428-func (x *DesktopAppInfo) LaunchUrisAsManager(UrisVar *glib.List, LaunchContextVar *AppLaunchContext, SpawnFlagsVar glib.SpawnFlags, UserSetupVar *glib.SpawnChildSetupFunc, UserSetupDataVar uintptr, PidCallbackVar *DesktopAppLaunchCallback, PidCallbackDataVar uintptr) (bool, error) {
429- var cerr *glib.Error
430-
431- cret := xDesktopAppInfoLaunchUrisAsManager(x.GoPointer(), UrisVar, LaunchContextVar.GoPointer(), SpawnFlagsVar, glib.NewCallbackNullable(UserSetupVar), UserSetupDataVar, glib.NewCallbackNullable(PidCallbackVar), PidCallbackDataVar, &cerr)
432- if cerr == nil {
433- return cret, nil
434- }
435- return cret, cerr
436-
437-}
438-
439-var xDesktopAppInfoLaunchUrisAsManagerWithFds func(uintptr, *glib.List, uintptr, glib.SpawnFlags, uintptr, uintptr, uintptr, uintptr, int, int, int, **glib.Error) bool
440-
441-// Equivalent to [method@Gio.DesktopAppInfo.launch_uris_as_manager] but allows
442-// you to pass in file descriptors for the stdin, stdout and stderr streams
443-// of the launched process.
444-//
445-// If application launching occurs via some non-spawn mechanism (e.g. D-Bus
446-// activation) then @stdin_fd, @stdout_fd and @stderr_fd are ignored.
447-func (x *DesktopAppInfo) LaunchUrisAsManagerWithFds(UrisVar *glib.List, LaunchContextVar *AppLaunchContext, SpawnFlagsVar glib.SpawnFlags, UserSetupVar *glib.SpawnChildSetupFunc, UserSetupDataVar uintptr, PidCallbackVar *DesktopAppLaunchCallback, PidCallbackDataVar uintptr, StdinFdVar int, StdoutFdVar int, StderrFdVar int) (bool, error) {
448- var cerr *glib.Error
449-
450- cret := xDesktopAppInfoLaunchUrisAsManagerWithFds(x.GoPointer(), UrisVar, LaunchContextVar.GoPointer(), SpawnFlagsVar, glib.NewCallbackNullable(UserSetupVar), UserSetupDataVar, glib.NewCallbackNullable(PidCallbackVar), PidCallbackDataVar, StdinFdVar, StdoutFdVar, StderrFdVar, &cerr)
451- if cerr == nil {
452- return cret, nil
453- }
454- return cret, cerr
455-
456-}
457-
458-var xDesktopAppInfoListActions func(uintptr) []string
459-
460-// Returns the list of
461-// [‘additional application actions’](https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s11.html)
462-// supported on the desktop file, as per the desktop file specification.
463-//
464-// As per the specification, this is the list of actions that are
465-// explicitly listed in the `Actions` key of the `Desktop Entry` group.
466-func (x *DesktopAppInfo) ListActions() []string {
467-
468- cret := xDesktopAppInfoListActions(x.GoPointer())
469- return cret
470-}
471-
472-func (c *DesktopAppInfo) GoPointer() uintptr {
473- if c == nil {
474- return 0
475- }
476- return c.Ptr
477-}
478-
479-func (c *DesktopAppInfo) SetGoPointer(ptr uintptr) {
480- c.Ptr = ptr
481-}
482-
483-// Adds a content type to the application information to indicate the
484-// application is capable of opening files with the given content type.
485-func (x *DesktopAppInfo) AddSupportsType(ContentTypeVar string) (bool, error) {
486- var cerr *glib.Error
487-
488- cret := XGAppInfoAddSupportsType(x.GoPointer(), ContentTypeVar, &cerr)
489- if cerr == nil {
490- return cret, nil
491- }
492- return cret, cerr
493-
494-}
495-
496-// Obtains the information whether the [iface@Gio.AppInfo] can be deleted.
497-// See [method@Gio.AppInfo.delete].
498-func (x *DesktopAppInfo) CanDelete() bool {
499-
500- cret := XGAppInfoCanDelete(x.GoPointer())
501- return cret
502-}
503-
504-// Checks if a supported content type can be removed from an application.
505-func (x *DesktopAppInfo) CanRemoveSupportsType() bool {
506-
507- cret := XGAppInfoCanRemoveSupportsType(x.GoPointer())
508- return cret
509-}
510-
511-// Tries to delete a [iface@Gio.AppInfo].
512-//
513-// On some platforms, there may be a difference between user-defined
514-// [iface@Gio.AppInfo]s which can be deleted, and system-wide ones which cannot.
515-// See [method@Gio.AppInfo.can_delete].
516-func (x *DesktopAppInfo) Delete() bool {
517-
518- cret := XGAppInfoDelete(x.GoPointer())
519- return cret
520-}
521-
522-// Creates a duplicate of a [iface@Gio.AppInfo].
523-func (x *DesktopAppInfo) Dup() *AppInfoBase {
524- var cls *AppInfoBase
525-
526- cret := XGAppInfoDup(x.GoPointer())
527-
528- if cret == 0 {
529- return nil
530- }
531- cls = &AppInfoBase{}
532- cls.Ptr = cret
533- return cls
534-}
535-
536-// Checks if two [iface@Gio.AppInfo]s are equal.
537-//
538-// Note that the check *may not* compare each individual field, and only does
539-// an identity check. In case detecting changes in the contents is needed,
540-// program code must additionally compare relevant fields.
541-func (x *DesktopAppInfo) Equal(Appinfo2Var AppInfo) bool {
542-
543- cret := XGAppInfoEqual(x.GoPointer(), Appinfo2Var.GoPointer())
544- return cret
545-}
546-
547-// Gets the commandline with which the application will be
548-// started.
549-func (x *DesktopAppInfo) GetCommandline() string {
550-
551- cret := XGAppInfoGetCommandline(x.GoPointer())
552- return cret
553-}
554-
555-// Gets a human-readable description of an installed application.
556-func (x *DesktopAppInfo) GetDescription() string {
557-
558- cret := XGAppInfoGetDescription(x.GoPointer())
559- return cret
560-}
561-
562-// Gets the display name of the application. The display name is often more
563-// descriptive to the user than the name itself.
564-func (x *DesktopAppInfo) GetDisplayName() string {
565-
566- cret := XGAppInfoGetDisplayName(x.GoPointer())
567- return cret
568-}
569-
570-// Gets the executable’s name for the installed application.
571-//
572-// This is intended to be used for debugging or labelling what program is going
573-// to be run. To launch the executable, use [method@Gio.AppInfo.launch] and related
574-// functions, rather than spawning the return value from this function.
575-func (x *DesktopAppInfo) GetExecutable() string {
576-
577- cret := XGAppInfoGetExecutable(x.GoPointer())
578- return cret
579-}
580-
581-// Gets the icon for the application.
582-func (x *DesktopAppInfo) GetIcon() *IconBase {
583- var cls *IconBase
584-
585- cret := XGAppInfoGetIcon(x.GoPointer())
586-
587- if cret == 0 {
588- return nil
589- }
590- gobject.IncreaseRef(cret)
591- cls = &IconBase{}
592- cls.Ptr = cret
593- return cls
594-}
595-
596-// Gets the ID of an application. An id is a string that identifies the
597-// application. The exact format of the id is platform dependent. For instance,
598-// on Unix this is the desktop file id from the xdg menu specification.
599-//
600-// Note that the returned ID may be `NULL`, depending on how the @appinfo has
601-// been constructed.
602-func (x *DesktopAppInfo) GetId() string {
603-
604- cret := XGAppInfoGetId(x.GoPointer())
605- return cret
606-}
607-
608-// Gets the installed name of the application.
609-func (x *DesktopAppInfo) GetName() string {
610-
611- cret := XGAppInfoGetName(x.GoPointer())
612- return cret
613-}
614-
615-// Retrieves the list of content types that @app_info claims to support.
616-// If this information is not provided by the environment, this function
617-// will return `NULL`.
618-//
619-// This function does not take in consideration associations added with
620-// [method@Gio.AppInfo.add_supports_type], but only those exported directly by
621-// the application.
622-func (x *DesktopAppInfo) GetSupportedTypes() []string {
623-
624- cret := XGAppInfoGetSupportedTypes(x.GoPointer())
625- return cret
626-}
627-
628-// Launches the application. Passes @files to the launched application
629-// as arguments, using the optional @context to get information
630-// about the details of the launcher (like what screen it is on).
631-// On error, @error will be set accordingly.
632-//
633-// To launch the application without arguments pass a `NULL` @files list.
634-//
635-// Note that even if the launch is successful the application launched
636-// can fail to start if it runs into problems during startup. There is
637-// no way to detect this.
638-//
639-// Some URIs can be changed when passed through a GFile (for instance
640-// unsupported URIs with strange formats like mailto:), so if you have
641-// a textual URI you want to pass in as argument, consider using
642-// [method@Gio.AppInfo.launch_uris] instead.
643-//
644-// The launched application inherits the environment of the launching
645-// process, but it can be modified with [method@Gio.AppLaunchContext.setenv]
646-// and [method@Gio.AppLaunchContext.unsetenv].
647-//
648-// On UNIX, this function sets the `GIO_LAUNCHED_DESKTOP_FILE`
649-// environment variable with the path of the launched desktop file and
650-// `GIO_LAUNCHED_DESKTOP_FILE_PID` to the process id of the launched
651-// process. This can be used to ignore `GIO_LAUNCHED_DESKTOP_FILE`,
652-// should it be inherited by further processes. The `DISPLAY`,
653-// `XDG_ACTIVATION_TOKEN` and `DESKTOP_STARTUP_ID` environment
654-// variables are also set, based on information provided in @context.
655-func (x *DesktopAppInfo) Launch(FilesVar *glib.List, ContextVar *AppLaunchContext) (bool, error) {
656- var cerr *glib.Error
657-
658- cret := XGAppInfoLaunch(x.GoPointer(), FilesVar, ContextVar.GoPointer(), &cerr)
659- if cerr == nil {
660- return cret, nil
661- }
662- return cret, cerr
663-
664-}
665-
666-// Launches the application. This passes the @uris to the launched application
667-// as arguments, using the optional @context to get information
668-// about the details of the launcher (like what screen it is on).
669-// On error, @error will be set accordingly. If the application only supports
670-// one URI per invocation as part of their command-line, multiple instances
671-// of the application will be spawned.
672-//
673-// To launch the application without arguments pass a `NULL` @uris list.
674-//
675-// Note that even if the launch is successful the application launched
676-// can fail to start if it runs into problems during startup. There is
677-// no way to detect this.
678-func (x *DesktopAppInfo) LaunchUris(UrisVar *glib.List, ContextVar *AppLaunchContext) (bool, error) {
679- var cerr *glib.Error
680-
681- cret := XGAppInfoLaunchUris(x.GoPointer(), UrisVar, ContextVar.GoPointer(), &cerr)
682- if cerr == nil {
683- return cret, nil
684- }
685- return cret, cerr
686-
687-}
688-
689-// Async version of [method@Gio.AppInfo.launch_uris].
690-//
691-// The @callback is invoked immediately after the application launch, but it
692-// waits for activation in case of D-Bus–activated applications and also provides
693-// extended error information for sandboxed applications, see notes for
694-// [func@Gio.AppInfo.launch_default_for_uri_async].
695-func (x *DesktopAppInfo) LaunchUrisAsync(UrisVar *glib.List, ContextVar *AppLaunchContext, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) {
696-
697- XGAppInfoLaunchUrisAsync(x.GoPointer(), UrisVar, ContextVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar)
698-
699-}
700-
701-// Finishes a [method@Gio.AppInfo.launch_uris_async] operation.
702-func (x *DesktopAppInfo) LaunchUrisFinish(ResultVar AsyncResult) (bool, error) {
703- var cerr *glib.Error
704-
705- cret := XGAppInfoLaunchUrisFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr)
706- if cerr == nil {
707- return cret, nil
708- }
709- return cret, cerr
710-
711-}
712-
713-// Removes a supported type from an application, if possible.
714-func (x *DesktopAppInfo) RemoveSupportsType(ContentTypeVar string) (bool, error) {
715- var cerr *glib.Error
716-
717- cret := XGAppInfoRemoveSupportsType(x.GoPointer(), ContentTypeVar, &cerr)
718- if cerr == nil {
719- return cret, nil
720- }
721- return cret, cerr
722-
723-}
724-
725-// Sets the application as the default handler for the given file extension.
726-func (x *DesktopAppInfo) SetAsDefaultForExtension(ExtensionVar string) (bool, error) {
727- var cerr *glib.Error
728-
729- cret := XGAppInfoSetAsDefaultForExtension(x.GoPointer(), ExtensionVar, &cerr)
730- if cerr == nil {
731- return cret, nil
732- }
733- return cret, cerr
734-
735-}
736-
737-// Sets the application as the default handler for a given type.
738-func (x *DesktopAppInfo) SetAsDefaultForType(ContentTypeVar string) (bool, error) {
739- var cerr *glib.Error
740-
741- cret := XGAppInfoSetAsDefaultForType(x.GoPointer(), ContentTypeVar, &cerr)
742- if cerr == nil {
743- return cret, nil
744- }
745- return cret, cerr
746-
747-}
748-
749-// Sets the application as the last used application for a given type. This
750-// will make the application appear as first in the list returned by
751-// [func@Gio.AppInfo.get_recommended_for_type], regardless of the default
752-// application for that content type.
753-func (x *DesktopAppInfo) SetAsLastUsedForType(ContentTypeVar string) (bool, error) {
754- var cerr *glib.Error
755-
756- cret := XGAppInfoSetAsLastUsedForType(x.GoPointer(), ContentTypeVar, &cerr)
757- if cerr == nil {
758- return cret, nil
759- }
760- return cret, cerr
761-
762-}
763-
764-// Checks if the application info should be shown in menus that
765-// list available applications.
766-func (x *DesktopAppInfo) ShouldShow() bool {
767-
768- cret := XGAppInfoShouldShow(x.GoPointer())
769- return cret
770-}
771-
772-// Checks if the application accepts files as arguments.
773-func (x *DesktopAppInfo) SupportsFiles() bool {
774-
775- cret := XGAppInfoSupportsFiles(x.GoPointer())
776- return cret
777-}
778-
779-// Checks if the application supports reading files and directories from URIs.
780-func (x *DesktopAppInfo) SupportsUris() bool {
781-
782- cret := XGAppInfoSupportsUris(x.GoPointer())
783- return cret
784-}
785-
786-var xDesktopAppInfoGetImplementations func(string) *glib.List
787-
788-// Gets all applications that implement @interface.
789-//
790-// An application implements an interface if that interface is listed in
791-// the `Implements` line of the desktop file of the application.
792-func DesktopAppInfoGetImplementations(InterfaceVar string) *glib.List {
793-
794- cret := xDesktopAppInfoGetImplementations(InterfaceVar)
795- return cret
796-}
797-
798-var xDesktopAppInfoSearch func(string) uintptr
799-
800-// Searches desktop files for ones that match @search_string.
801-//
802-// The return value is an array of strvs. Each strv contains a list of
803-// applications that matched @search_string with an equal score. The
804-// outer list is sorted by score so that the first strv contains the
805-// best-matching applications, and so on.
806-// The algorithm for determining matches is undefined and may change at
807-// any time.
808-//
809-// None of the search results are subjected to the normal validation
810-// checks performed by [ctor@Gio.DesktopAppInfo.new] (for example, checking that
811-// the executable referenced by a result exists), and so it is possible for
812-// [ctor@Gio.DesktopAppInfo.new] to return `NULL` when passed an app ID returned
813-// by this function. It is expected that calling code will do this when
814-// subsequently creating a [class@Gio.DesktopAppInfo] for each result.
815-func DesktopAppInfoSearch(SearchStringVar string) uintptr {
816-
817- cret := xDesktopAppInfoSearch(SearchStringVar)
818- return cret
819-}
820-
821-var xDesktopAppInfoSetDesktopEnv func(string)
822-
823-// Sets the name of the desktop that the application is running in.
824-//
825-// This is used by [method@Gio.AppInfo.should_show] and
826-// [method@Gio.DesktopAppInfo.get_show_in] to evaluate the
827-// [`OnlyShowIn`](https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s06.html#key-onlyshowin)
828-// and [`NotShowIn`](https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s06.html#key-notshowin)
829-// keys.
830-//
831-// Should be called only once; subsequent calls are ignored.
832-func DesktopAppInfoSetDesktopEnv(DesktopEnvVar string) {
833-
834- xDesktopAppInfoSetDesktopEnv(DesktopEnvVar)
835-
836-}
837-
838-func init() {
839- core.SetPackageName("GIO", "gio-2.0")
840- core.SetSharedLibraries("GIO", []string{"libgio-2.0.so.0"})
841- var libs []uintptr
842- for _, libPath := range core.GetPaths("GIO") {
843- lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
844- if err != nil {
845- panic(err)
846- }
847- libs = append(libs, lib)
848- }
849-
850- core.PuregoSafeRegister(&xDesktopAppInfoGLibType, libs, "g_desktop_app_info_get_type")
851-
852- core.PuregoSafeRegister(&xNewDesktopAppInfo, libs, "g_desktop_app_info_new")
853- core.PuregoSafeRegister(&xNewDesktopAppInfoFromFilename, libs, "g_desktop_app_info_new_from_filename")
854- core.PuregoSafeRegister(&xNewDesktopAppInfoFromKeyfile, libs, "g_desktop_app_info_new_from_keyfile")
855-
856- core.PuregoSafeRegister(&xDesktopAppInfoGetActionName, libs, "g_desktop_app_info_get_action_name")
857- core.PuregoSafeRegister(&xDesktopAppInfoGetBoolean, libs, "g_desktop_app_info_get_boolean")
858- core.PuregoSafeRegister(&xDesktopAppInfoGetCategories, libs, "g_desktop_app_info_get_categories")
859- core.PuregoSafeRegister(&xDesktopAppInfoGetFilename, libs, "g_desktop_app_info_get_filename")
860- core.PuregoSafeRegister(&xDesktopAppInfoGetGenericName, libs, "g_desktop_app_info_get_generic_name")
861- core.PuregoSafeRegister(&xDesktopAppInfoGetIsHidden, libs, "g_desktop_app_info_get_is_hidden")
862- core.PuregoSafeRegister(&xDesktopAppInfoGetKeywords, libs, "g_desktop_app_info_get_keywords")
863- core.PuregoSafeRegister(&xDesktopAppInfoGetLocaleString, libs, "g_desktop_app_info_get_locale_string")
864- core.PuregoSafeRegister(&xDesktopAppInfoGetNodisplay, libs, "g_desktop_app_info_get_nodisplay")
865- core.PuregoSafeRegister(&xDesktopAppInfoGetShowIn, libs, "g_desktop_app_info_get_show_in")
866- core.PuregoSafeRegister(&xDesktopAppInfoGetStartupWmClass, libs, "g_desktop_app_info_get_startup_wm_class")
867- core.PuregoSafeRegister(&xDesktopAppInfoGetString, libs, "g_desktop_app_info_get_string")
868- core.PuregoSafeRegister(&xDesktopAppInfoGetStringList, libs, "g_desktop_app_info_get_string_list")
869- core.PuregoSafeRegister(&xDesktopAppInfoHasKey, libs, "g_desktop_app_info_has_key")
870- core.PuregoSafeRegister(&xDesktopAppInfoLaunchAction, libs, "g_desktop_app_info_launch_action")
871- core.PuregoSafeRegister(&xDesktopAppInfoLaunchUrisAsManager, libs, "g_desktop_app_info_launch_uris_as_manager")
872- core.PuregoSafeRegister(&xDesktopAppInfoLaunchUrisAsManagerWithFds, libs, "g_desktop_app_info_launch_uris_as_manager_with_fds")
873- core.PuregoSafeRegister(&xDesktopAppInfoListActions, libs, "g_desktop_app_info_list_actions")
874-
875- core.PuregoSafeRegister(&xDesktopAppInfoGetImplementations, libs, "g_desktop_app_info_get_implementations")
876- core.PuregoSafeRegister(&xDesktopAppInfoSearch, libs, "g_desktop_app_info_search")
877- core.PuregoSafeRegister(&xDesktopAppInfoSetDesktopEnv, libs, "g_desktop_app_info_set_desktop_env")
878-
879- core.PuregoSafeRegister(&xDesktopAppInfoLookupGLibType, libs, "g_desktop_app_info_lookup_get_type")
880-
881- core.PuregoSafeRegister(&XGDesktopAppInfoLookupGetDefaultForUriScheme, libs, "g_desktop_app_info_lookup_get_default_for_uri_scheme")
882-
883-}
M v4/gio/gfile.go +26 -13
@@ -5042,35 +5042,48 @@ func (x *FileBase) QueryFilesystemInfoFinish(ResVar AsyncResult) (*FileInfo, err
50425042 }
50435043
50445044 // Gets the requested information about specified @file.
5045-// The result is a #GFileInfo object that contains key-value
5045+//
5046+// The result is a [class@Gio.FileInfo] object that contains key-value
50465047 // attributes (such as the type or size of the file).
50475048 //
50485049 // The @attributes value is a string that specifies the file
50495050 // attributes that should be gathered. It is not an error if
5050-// it's not possible to read a particular requested attribute
5051-// from a file - it just won't be set. @attributes should be a
5052-// comma-separated list of attributes or attribute wildcards.
5053-// The wildcard "*" means all attributes, and a wildcard like
5054-// "standard::*" means all attributes in the standard namespace.
5055-// An example attribute query be "standard::*,owner::user".
5051+// it’s not possible to read a particular requested attribute
5052+// from a file — it just won't be set. In particular this means that if a file
5053+// is inaccessible (due to being in a folder with restrictive permissions), for
5054+// example, you can expect the returned [class@Gio.FileInfo] to have very few
5055+// attributes set. You should check whether an attribute is set using
5056+// [method@Gio.FileInfo.has_attribute] before trying to retrieve its value.
5057+//
5058+// It is guaranteed that if any of the following attributes are listed in
5059+// @attributes, they will always be set in the returned [class@Gio.FileInfo],
5060+// even if the user doesn’t have permissions to access the file:
5061+//
5062+// - [const@Gio.FILE_ATTRIBUTE_STANDARD_NAME]
5063+// - [const@Gio.FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME]
5064+//
5065+// @attributes should be a comma-separated list of attributes or attribute
5066+// wildcards. The wildcard `"*"` means all attributes, and a wildcard like
5067+// `"standard::*"` means all attributes in the standard namespace.
5068+// An example attribute query might be `"standard::*,owner::user"`.
50565069 // The standard attributes are available as defines, like
5057-// %G_FILE_ATTRIBUTE_STANDARD_NAME.
5070+// [const@Gio.FILE_ATTRIBUTE_STANDARD_NAME].
50585071 //
5059-// If @cancellable is not %NULL, then the operation can be cancelled
5072+// If @cancellable is not `NULL`, then the operation can be cancelled
50605073 // by triggering the cancellable object from another thread. If the
5061-// operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
5074+// operation was cancelled, the error [error@Gio.IOErrorEnum.CANCELLED] will be
50625075 // returned.
50635076 //
50645077 // For symlinks, normally the information about the target of the
50655078 // symlink is returned, rather than information about the symlink
5066-// itself. However if you pass %G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS
5079+// itself. However if you pass [flags@Gio.FileQueryInfoFlags.NOFOLLOW_SYMLINKS]
50675080 // in @flags the information about the symlink itself will be returned.
50685081 // Also, for symlinks that point to non-existing files the information
50695082 // about the symlink itself will be returned.
50705083 //
5071-// If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will be
5084+// If the file does not exist, the [error@Gio.IOErrorEnum.NOT_FOUND] error will be
50725085 // returned. Other errors are possible too, and depend on what kind of
5073-// filesystem the file is on.
5086+// file system the file is on.
50745087 func (x *FileBase) QueryInfo(AttributesVar string, FlagsVar FileQueryInfoFlags, CancellableVar *Cancellable) (*FileInfo, error) {
50755088 var cls *FileInfo
50765089 var cerr *glib.Error
D v4/gio/gfiledescriptorbased.go +0 -111
@@ -1,111 +0,0 @@
1-// Package gio was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT
2-package gio
3-
4-import (
5- "structs"
6- "unsafe"
7-
8- "github.com/jwijenbergh/purego"
9- "github.com/jwijenbergh/puregotk/pkg/core"
10- "github.com/jwijenbergh/puregotk/v4/gobject/types"
11-)
12-
13-// An interface for file descriptor based io objects.
14-type FileDescriptorBasedIface struct {
15- _ structs.HostLayout
16-
17- GIface uintptr
18-
19- xGetFd uintptr
20-}
21-
22-func (x *FileDescriptorBasedIface) GoPointer() uintptr {
23- return uintptr(unsafe.Pointer(x))
24-}
25-
26-// OverrideGetFd sets the callback function.
27-// Gets the underlying file descriptor.
28-func (x *FileDescriptorBasedIface) OverrideGetFd(cb func(FileDescriptorBased) int) {
29- if cb == nil {
30- x.xGetFd = 0
31- } else {
32- x.xGetFd = purego.NewCallback(func(FdBasedVarp uintptr) int {
33- return cb(&FileDescriptorBasedBase{Ptr: FdBasedVarp})
34- })
35- }
36-}
37-
38-// GetGetFd gets the callback function.
39-// Gets the underlying file descriptor.
40-func (x *FileDescriptorBasedIface) GetGetFd() func(FileDescriptorBased) int {
41- if x.xGetFd == 0 {
42- return nil
43- }
44- var rawCallback func(FdBasedVarp uintptr) int
45- purego.RegisterFunc(&rawCallback, x.xGetFd)
46- return func(FdBasedVar FileDescriptorBased) int {
47- return rawCallback(FdBasedVar.GoPointer())
48- }
49-}
50-
51-// `GFileDescriptorBased` is an interface for file descriptor based IO.
52-//
53-// It is implemented by streams (implementations of [class@Gio.InputStream] or
54-// [class@Gio.OutputStream]) that are based on file descriptors.
55-//
56-// Note that `&lt;gio/gfiledescriptorbased.h&gt;` belongs to the UNIX-specific
57-// GIO interfaces, thus you have to use the `gio-unix-2.0.pc` pkg-config
58-// file or the `GioUnix-2.0` GIR namespace when using it.
59-type FileDescriptorBased interface {
60- GoPointer() uintptr
61- SetGoPointer(uintptr)
62- GetFd() int
63-}
64-
65-var xFileDescriptorBasedGLibType func() types.GType
66-
67-func FileDescriptorBasedGLibType() types.GType {
68- return xFileDescriptorBasedGLibType()
69-}
70-
71-type FileDescriptorBasedBase struct {
72- Ptr uintptr
73-}
74-
75-func (x *FileDescriptorBasedBase) GoPointer() uintptr {
76- if x == nil {
77- return 0
78- }
79- return x.Ptr
80-}
81-
82-func (x *FileDescriptorBasedBase) SetGoPointer(ptr uintptr) {
83- x.Ptr = ptr
84-}
85-
86-// Gets the underlying file descriptor.
87-func (x *FileDescriptorBasedBase) GetFd() int {
88-
89- cret := XGFileDescriptorBasedGetFd(x.GoPointer())
90- return cret
91-}
92-
93-var XGFileDescriptorBasedGetFd func(uintptr) int
94-
95-func init() {
96- core.SetPackageName("GIO", "gio-2.0")
97- core.SetSharedLibraries("GIO", []string{"libgio-2.0.so.0"})
98- var libs []uintptr
99- for _, libPath := range core.GetPaths("GIO") {
100- lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
101- if err != nil {
102- panic(err)
103- }
104- libs = append(libs, lib)
105- }
106-
107- core.PuregoSafeRegister(&xFileDescriptorBasedGLibType, libs, "g_file_descriptor_based_get_type")
108-
109- core.PuregoSafeRegister(&XGFileDescriptorBasedGetFd, libs, "g_file_descriptor_based_get_fd")
110-
111-}
M v4/gio/gfilenamecompleter.go +7 -1
@@ -159,7 +159,10 @@ func NewFilenameCompleter() *FilenameCompleter {
159159
160160 var xFilenameCompleterGetCompletionSuffix func(uintptr, string) string
161161
162-// Obtains a completion for @initial_text from @completer.
162+// Obtains a suffix completion for @initial_text from @completer.
163+//
164+// Suffix will be an empty string if there's no shared suffix among matching
165+// completions. If there's no matching completions anyway, `NULL` is returned.
163166 func (x *FilenameCompleter) GetCompletionSuffix(InitialTextVar string) string {
164167
165168 cret := xFilenameCompleterGetCompletionSuffix(x.GoPointer(), InitialTextVar)
@@ -179,6 +182,9 @@ var xFilenameCompleterSetDirsOnly func(uintptr, bool)
179182
180183 // If @dirs_only is %TRUE, @completer will only
181184 // complete directory names, and not file names.
185+//
186+// This function needs to be called before waiting for results from the
187+// completer to be populated.
182188 func (x *FilenameCompleter) SetDirsOnly(DirsOnlyVar bool) {
183189
184190 xFilenameCompleterSetDirsOnly(x.GoPointer(), DirsOnlyVar)
M v4/gio/ginetaddress.go +45 -0
@@ -140,9 +140,33 @@ func NewInetAddressFromBytes(BytesVar []byte, FamilyVar SocketFamily) *InetAddre
140140 return cls
141141 }
142142
143+var xNewInetAddressFromBytesWithIpv6Info func([]byte, SocketFamily, uint32, uint32) uintptr
144+
145+// Creates a new [class@Gio.InetAddress] from the given @family, @bytes
146+// and @scope_id.
147+//
148+// @bytes must be 4 bytes for [enum@Gio.SocketFamily.IPV4] and 16 bytes for
149+// [enum@Gio.SocketFamily.IPV6].
150+func NewInetAddressFromBytesWithIpv6Info(BytesVar []byte, FamilyVar SocketFamily, FlowinfoVar uint32, ScopeIdVar uint32) *InetAddress {
151+ var cls *InetAddress
152+
153+ cret := xNewInetAddressFromBytesWithIpv6Info(BytesVar, FamilyVar, FlowinfoVar, ScopeIdVar)
154+
155+ if cret == 0 {
156+ return nil
157+ }
158+ cls = &InetAddress{}
159+ cls.Ptr = cret
160+ return cls
161+}
162+
143163 var xNewInetAddressFromString func(string) uintptr
144164
145165 // Parses @string as an IP address and creates a new #GInetAddress.
166+//
167+// If @address is an IPv6 address, it can also contain a scope ID
168+// (separated from the address by a `%`). Note that currently this
169+// behavior is platform specific. This may change in a future release.
146170 func NewInetAddressFromString(StringVar string) *InetAddress {
147171 var cls *InetAddress
148172
@@ -190,6 +214,15 @@ func (x *InetAddress) GetFamily() SocketFamily {
190214 return cret
191215 }
192216
217+var xInetAddressGetFlowinfo func(uintptr) uint32
218+
219+// Gets the value of [property@Gio.InetAddress:flowinfo].
220+func (x *InetAddress) GetFlowinfo() uint32 {
221+
222+ cret := xInetAddressGetFlowinfo(x.GoPointer())
223+ return cret
224+}
225+
193226 var xInetAddressGetIsAny func(uintptr) bool
194227
195228 // Tests whether @address is the "any" address for its family.
@@ -295,6 +328,15 @@ func (x *InetAddress) GetNativeSize() uint {
295328 return cret
296329 }
297330
331+var xInetAddressGetScopeId func(uintptr) uint32
332+
333+// Gets the value of [property@Gio.InetAddress:scope-id].
334+func (x *InetAddress) GetScopeId() uint32 {
335+
336+ cret := xInetAddressGetScopeId(x.GoPointer())
337+ return cret
338+}
339+
298340 var xInetAddressToBytes func(uintptr) byte
299341
300342 // Gets the raw binary address data from @address.
@@ -340,11 +382,13 @@ func init() {
340382
341383 core.PuregoSafeRegister(&xNewInetAddressAny, libs, "g_inet_address_new_any")
342384 core.PuregoSafeRegister(&xNewInetAddressFromBytes, libs, "g_inet_address_new_from_bytes")
385+ core.PuregoSafeRegister(&xNewInetAddressFromBytesWithIpv6Info, libs, "g_inet_address_new_from_bytes_with_ipv6_info")
343386 core.PuregoSafeRegister(&xNewInetAddressFromString, libs, "g_inet_address_new_from_string")
344387 core.PuregoSafeRegister(&xNewInetAddressLoopback, libs, "g_inet_address_new_loopback")
345388
346389 core.PuregoSafeRegister(&xInetAddressEqual, libs, "g_inet_address_equal")
347390 core.PuregoSafeRegister(&xInetAddressGetFamily, libs, "g_inet_address_get_family")
391+ core.PuregoSafeRegister(&xInetAddressGetFlowinfo, libs, "g_inet_address_get_flowinfo")
348392 core.PuregoSafeRegister(&xInetAddressGetIsAny, libs, "g_inet_address_get_is_any")
349393 core.PuregoSafeRegister(&xInetAddressGetIsLinkLocal, libs, "g_inet_address_get_is_link_local")
350394 core.PuregoSafeRegister(&xInetAddressGetIsLoopback, libs, "g_inet_address_get_is_loopback")
@@ -356,6 +400,7 @@ func init() {
356400 core.PuregoSafeRegister(&xInetAddressGetIsMulticast, libs, "g_inet_address_get_is_multicast")
357401 core.PuregoSafeRegister(&xInetAddressGetIsSiteLocal, libs, "g_inet_address_get_is_site_local")
358402 core.PuregoSafeRegister(&xInetAddressGetNativeSize, libs, "g_inet_address_get_native_size")
403+ core.PuregoSafeRegister(&xInetAddressGetScopeId, libs, "g_inet_address_get_scope_id")
359404 core.PuregoSafeRegister(&xInetAddressToBytes, libs, "g_inet_address_to_bytes")
360405 core.PuregoSafeRegister(&xInetAddressToString, libs, "g_inet_address_to_string")
361406
M v4/gio/ginetsocketaddress.go +6 -1
@@ -71,7 +71,8 @@ var xNewInetSocketAddressFromString func(string, uint) uintptr
7171 // Creates a new #GInetSocketAddress for @address and @port.
7272 //
7373 // If @address is an IPv6 address, it can also contain a scope ID
74-// (separated from the address by a `%`).
74+// (separated from the address by a `%`). Note that currently this
75+// behavior is platform specific. This may change in a future release.
7576 func NewInetSocketAddressFromString(AddressVar string, PortVar uint) *InetSocketAddress {
7677 var cls *InetSocketAddress
7778
@@ -106,6 +107,8 @@ var xInetSocketAddressGetFlowinfo func(uintptr) uint32
106107
107108 // Gets the `sin6_flowinfo` field from @address,
108109 // which must be an IPv6 address.
110+//
111+// If not overridden this value will be inherited from [property@Gio.InetSocketAddress:address].
109112 func (x *InetSocketAddress) GetFlowinfo() uint32 {
110113
111114 cret := xInetSocketAddressGetFlowinfo(x.GoPointer())
@@ -125,6 +128,8 @@ var xInetSocketAddressGetScopeId func(uintptr) uint32
125128
126129 // Gets the `sin6_scope_id` field from @address,
127130 // which must be an IPv6 address.
131+//
132+// If not overridden this value will be inherited from [property@Gio.InetSocketAddress:address].
128133 func (x *InetSocketAddress) GetScopeId() uint32 {
129134
130135 cret := xInetSocketAddressGetScopeId(x.GoPointer())
M v4/gio/gioenums.go +3 -2
@@ -131,8 +131,9 @@ const (
131131 // If another message bus connection owns the name and have
132132 // specified %G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT, then take the name from the other connection.
133133 GBusNameOwnerFlagsReplaceValue BusNameOwnerFlags = 2
134- // If another message bus connection owns the name, immediately
135- // return an error from g_bus_own_name() rather than entering the waiting queue for that name. (Since 2.54)
134+ // If another message bus connection owns the name, immediately return an error
135+ // from [func@Gio.bus_own_name] rather than entering the waiting queue for that
136+ // name.
136137 GBusNameOwnerFlagsDoNotQueueValue BusNameOwnerFlags = 4
137138 )
138139
M v4/gio/gsettingsbackend.go +1 -1
@@ -513,7 +513,7 @@ var xSettingsBackendKeysChanged func(uintptr, string, []string, uintptr)
513513 // end with '/' and must not contain '//').
514514 //
515515 // The meaning of this signal is that any of the key names resulting
516-// from the contatenation of @path with each item in @items may have
516+// from the concatenation of @path with each item in @items may have
517517 // changed.
518518 //
519519 // The same rules for when notifications must occur apply as per
M v4/gio/gsocketlistener.go +19 -0
@@ -434,6 +434,14 @@ var xSocketListenerAddAnyInetPort func(uintptr, uintptr, **glib.Error) uint16
434434 // This is useful if you need to have a socket for incoming connections
435435 // but don't care about the specific port number.
436436 //
437+// If possible, the [class@Gio.SocketListener] will listen on both IPv4 and
438+// IPv6 (listening on the same port on both). If listening on one of the socket
439+// families fails, the [class@Gio.SocketListener] will only listen on the other.
440+// If listening on both fails, an error will be returned.
441+//
442+// If you need to distinguish whether listening on IPv4 or IPv6 or both was
443+// successful, connect to [signal@Gio.SocketListener::event].
444+//
437445 // @source_object will be passed out in the various calls
438446 // to accept to identify this particular source, which is
439447 // useful if you're listening on multiple addresses and do
@@ -455,6 +463,14 @@ var xSocketListenerAddInetPort func(uintptr, uint16, uintptr, **glib.Error) bool
455463 // creates a TCP/IP socket listening on IPv4 and IPv6 (if
456464 // supported) on the specified port on all interfaces.
457465 //
466+// If possible, the [class@Gio.SocketListener] will listen on both IPv4 and
467+// IPv6 (listening on the same port on both). If listening on one of the socket
468+// families fails, the [class@Gio.SocketListener] will only listen on the other.
469+// If listening on both fails, an error will be returned.
470+//
471+// If you need to distinguish whether listening on IPv4 or IPv6 or both was
472+// successful, connect to [signal@Gio.SocketListener::event].
473+//
458474 // @source_object will be passed out in the various calls
459475 // to accept to identify this particular source, which is
460476 // useful if you're listening on multiple addresses and do
@@ -480,6 +496,9 @@ var xSocketListenerAddSocket func(uintptr, uintptr, uintptr, **glib.Error) bool
480496 // new clients from. The socket must be bound to a local
481497 // address and listened to.
482498 //
499+// For parallel calls to [class@Gio.SocketListener] methods to work, the socket
500+// must be in non-blocking mode. (See [property@Gio.Socket:blocking].)
501+//
483502 // @source_object will be passed out in the various calls
484503 // to accept to identify this particular source, which is
485504 // useful if you're listening on multiple addresses and do
D v4/gio/gunixfdmessage.go +0 -242
@@ -1,242 +0,0 @@
1-// Package gio was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT
2-package gio
3-
4-import (
5- "structs"
6- "unsafe"
7-
8- "github.com/jwijenbergh/purego"
9- "github.com/jwijenbergh/puregotk/pkg/core"
10- "github.com/jwijenbergh/puregotk/v4/glib"
11- "github.com/jwijenbergh/puregotk/v4/gobject"
12- "github.com/jwijenbergh/puregotk/v4/gobject/types"
13-)
14-
15-type UnixFDMessageClass struct {
16- _ structs.HostLayout
17-
18- ParentClass SocketControlMessageClass
19-
20- xGReserved1 uintptr
21-
22- xGReserved2 uintptr
23-}
24-
25-func (x *UnixFDMessageClass) GoPointer() uintptr {
26- return uintptr(unsafe.Pointer(x))
27-}
28-
29-// OverrideGReserved1 sets the callback function.
30-func (x *UnixFDMessageClass) OverrideGReserved1(cb func()) {
31- if cb == nil {
32- x.xGReserved1 = 0
33- } else {
34- x.xGReserved1 = purego.NewCallback(func() {
35- cb()
36- })
37- }
38-}
39-
40-// GetGReserved1 gets the callback function.
41-func (x *UnixFDMessageClass) GetGReserved1() func() {
42- if x.xGReserved1 == 0 {
43- return nil
44- }
45- var rawCallback func()
46- purego.RegisterFunc(&rawCallback, x.xGReserved1)
47- return func() {
48- rawCallback()
49- }
50-}
51-
52-// OverrideGReserved2 sets the callback function.
53-func (x *UnixFDMessageClass) OverrideGReserved2(cb func()) {
54- if cb == nil {
55- x.xGReserved2 = 0
56- } else {
57- x.xGReserved2 = purego.NewCallback(func() {
58- cb()
59- })
60- }
61-}
62-
63-// GetGReserved2 gets the callback function.
64-func (x *UnixFDMessageClass) GetGReserved2() func() {
65- if x.xGReserved2 == 0 {
66- return nil
67- }
68- var rawCallback func()
69- purego.RegisterFunc(&rawCallback, x.xGReserved2)
70- return func() {
71- rawCallback()
72- }
73-}
74-
75-type UnixFDMessagePrivate struct {
76- _ structs.HostLayout
77-}
78-
79-func (x *UnixFDMessagePrivate) GoPointer() uintptr {
80- return uintptr(unsafe.Pointer(x))
81-}
82-
83-// This [class@Gio.SocketControlMessage] contains a [class@Gio.UnixFDList].
84-// It may be sent using [method@Gio.Socket.send_message] and received using
85-// [method@Gio.Socket.receive_message] over UNIX sockets (ie: sockets in the
86-// `G_SOCKET_FAMILY_UNIX` family). The file descriptors are copied
87-// between processes by the kernel.
88-//
89-// For an easier way to send and receive file descriptors over
90-// stream-oriented UNIX sockets, see [method@Gio.UnixConnection.send_fd] and
91-// [method@Gio.UnixConnection.receive_fd].
92-//
93-// Note that `&lt;gio/gunixfdmessage.h&gt;` belongs to the UNIX-specific GIO
94-// interfaces, thus you have to use the `gio-unix-2.0.pc` pkg-config
95-// file or the `GioUnix-2.0` GIR namespace when using it.
96-type UnixFDMessage struct {
97- SocketControlMessage
98-}
99-
100-var xUnixFDMessageGLibType func() types.GType
101-
102-func UnixFDMessageGLibType() types.GType {
103- return xUnixFDMessageGLibType()
104-}
105-
106-func UnixFDMessageNewFromInternalPtr(ptr uintptr) *UnixFDMessage {
107- cls := &UnixFDMessage{}
108- cls.Ptr = ptr
109- return cls
110-}
111-
112-var xNewUnixFDMessage func() uintptr
113-
114-// Creates a new #GUnixFDMessage containing an empty file descriptor
115-// list.
116-func NewUnixFDMessage() *UnixFDMessage {
117- var cls *UnixFDMessage
118-
119- cret := xNewUnixFDMessage()
120-
121- if cret == 0 {
122- return nil
123- }
124- cls = &UnixFDMessage{}
125- cls.Ptr = cret
126- return cls
127-}
128-
129-var xNewUnixFDMessageWithFdList func(uintptr) uintptr
130-
131-// Creates a new #GUnixFDMessage containing @list.
132-func NewUnixFDMessageWithFdList(FdListVar *UnixFDList) *UnixFDMessage {
133- var cls *UnixFDMessage
134-
135- cret := xNewUnixFDMessageWithFdList(FdListVar.GoPointer())
136-
137- if cret == 0 {
138- return nil
139- }
140- cls = &UnixFDMessage{}
141- cls.Ptr = cret
142- return cls
143-}
144-
145-var xUnixFDMessageAppendFd func(uintptr, int, **glib.Error) bool
146-
147-// Adds a file descriptor to @message.
148-//
149-// The file descriptor is duplicated using dup(). You keep your copy
150-// of the descriptor and the copy contained in @message will be closed
151-// when @message is finalized.
152-//
153-// A possible cause of failure is exceeding the per-process or
154-// system-wide file descriptor limit.
155-func (x *UnixFDMessage) AppendFd(FdVar int) (bool, error) {
156- var cerr *glib.Error
157-
158- cret := xUnixFDMessageAppendFd(x.GoPointer(), FdVar, &cerr)
159- if cerr == nil {
160- return cret, nil
161- }
162- return cret, cerr
163-
164-}
165-
166-var xUnixFDMessageGetFdList func(uintptr) uintptr
167-
168-// Gets the #GUnixFDList contained in @message. This function does not
169-// return a reference to the caller, but the returned list is valid for
170-// the lifetime of @message.
171-func (x *UnixFDMessage) GetFdList() *UnixFDList {
172- var cls *UnixFDList
173-
174- cret := xUnixFDMessageGetFdList(x.GoPointer())
175-
176- if cret == 0 {
177- return nil
178- }
179- gobject.IncreaseRef(cret)
180- cls = &UnixFDList{}
181- cls.Ptr = cret
182- return cls
183-}
184-
185-var xUnixFDMessageStealFds func(uintptr, int) uintptr
186-
187-// Returns the array of file descriptors that is contained in this
188-// object.
189-//
190-// After this call, the descriptors are no longer contained in
191-// @message. Further calls will return an empty list (unless more
192-// descriptors have been added).
193-//
194-// The return result of this function must be freed with g_free().
195-// The caller is also responsible for closing all of the file
196-// descriptors.
197-//
198-// If @length is non-%NULL then it is set to the number of file
199-// descriptors in the returned array. The returned array is also
200-// terminated with -1.
201-//
202-// This function never returns %NULL. In case there are no file
203-// descriptors contained in @message, an empty array is returned.
204-func (x *UnixFDMessage) StealFds(LengthVar int) uintptr {
205-
206- cret := xUnixFDMessageStealFds(x.GoPointer(), LengthVar)
207- return cret
208-}
209-
210-func (c *UnixFDMessage) GoPointer() uintptr {
211- if c == nil {
212- return 0
213- }
214- return c.Ptr
215-}
216-
217-func (c *UnixFDMessage) SetGoPointer(ptr uintptr) {
218- c.Ptr = ptr
219-}
220-
221-func init() {
222- core.SetPackageName("GIO", "gio-2.0")
223- core.SetSharedLibraries("GIO", []string{"libgio-2.0.so.0"})
224- var libs []uintptr
225- for _, libPath := range core.GetPaths("GIO") {
226- lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
227- if err != nil {
228- panic(err)
229- }
230- libs = append(libs, lib)
231- }
232-
233- core.PuregoSafeRegister(&xUnixFDMessageGLibType, libs, "g_unix_fd_message_get_type")
234-
235- core.PuregoSafeRegister(&xNewUnixFDMessage, libs, "g_unix_fd_message_new")
236- core.PuregoSafeRegister(&xNewUnixFDMessageWithFdList, libs, "g_unix_fd_message_new_with_fd_list")
237-
238- core.PuregoSafeRegister(&xUnixFDMessageAppendFd, libs, "g_unix_fd_message_append_fd")
239- core.PuregoSafeRegister(&xUnixFDMessageGetFdList, libs, "g_unix_fd_message_get_fd_list")
240- core.PuregoSafeRegister(&xUnixFDMessageStealFds, libs, "g_unix_fd_message_steal_fds")
241-
242-}
D v4/gio/gunixinputstream.go +0 -333
@@ -1,333 +0,0 @@
1-// Package gio was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT
2-package gio
3-
4-import (
5- "structs"
6- "unsafe"
7-
8- "github.com/jwijenbergh/purego"
9- "github.com/jwijenbergh/puregotk/pkg/core"
10- "github.com/jwijenbergh/puregotk/v4/glib"
11- "github.com/jwijenbergh/puregotk/v4/gobject/types"
12-)
13-
14-type UnixInputStreamClass struct {
15- _ structs.HostLayout
16-
17- ParentClass InputStreamClass
18-
19- xGReserved1 uintptr
20-
21- xGReserved2 uintptr
22-
23- xGReserved3 uintptr
24-
25- xGReserved4 uintptr
26-
27- xGReserved5 uintptr
28-}
29-
30-func (x *UnixInputStreamClass) GoPointer() uintptr {
31- return uintptr(unsafe.Pointer(x))
32-}
33-
34-// OverrideGReserved1 sets the callback function.
35-func (x *UnixInputStreamClass) OverrideGReserved1(cb func()) {
36- if cb == nil {
37- x.xGReserved1 = 0
38- } else {
39- x.xGReserved1 = purego.NewCallback(func() {
40- cb()
41- })
42- }
43-}
44-
45-// GetGReserved1 gets the callback function.
46-func (x *UnixInputStreamClass) GetGReserved1() func() {
47- if x.xGReserved1 == 0 {
48- return nil
49- }
50- var rawCallback func()
51- purego.RegisterFunc(&rawCallback, x.xGReserved1)
52- return func() {
53- rawCallback()
54- }
55-}
56-
57-// OverrideGReserved2 sets the callback function.
58-func (x *UnixInputStreamClass) OverrideGReserved2(cb func()) {
59- if cb == nil {
60- x.xGReserved2 = 0
61- } else {
62- x.xGReserved2 = purego.NewCallback(func() {
63- cb()
64- })
65- }
66-}
67-
68-// GetGReserved2 gets the callback function.
69-func (x *UnixInputStreamClass) GetGReserved2() func() {
70- if x.xGReserved2 == 0 {
71- return nil
72- }
73- var rawCallback func()
74- purego.RegisterFunc(&rawCallback, x.xGReserved2)
75- return func() {
76- rawCallback()
77- }
78-}
79-
80-// OverrideGReserved3 sets the callback function.
81-func (x *UnixInputStreamClass) OverrideGReserved3(cb func()) {
82- if cb == nil {
83- x.xGReserved3 = 0
84- } else {
85- x.xGReserved3 = purego.NewCallback(func() {
86- cb()
87- })
88- }
89-}
90-
91-// GetGReserved3 gets the callback function.
92-func (x *UnixInputStreamClass) GetGReserved3() func() {
93- if x.xGReserved3 == 0 {
94- return nil
95- }
96- var rawCallback func()
97- purego.RegisterFunc(&rawCallback, x.xGReserved3)
98- return func() {
99- rawCallback()
100- }
101-}
102-
103-// OverrideGReserved4 sets the callback function.
104-func (x *UnixInputStreamClass) OverrideGReserved4(cb func()) {
105- if cb == nil {
106- x.xGReserved4 = 0
107- } else {
108- x.xGReserved4 = purego.NewCallback(func() {
109- cb()
110- })
111- }
112-}
113-
114-// GetGReserved4 gets the callback function.
115-func (x *UnixInputStreamClass) GetGReserved4() func() {
116- if x.xGReserved4 == 0 {
117- return nil
118- }
119- var rawCallback func()
120- purego.RegisterFunc(&rawCallback, x.xGReserved4)
121- return func() {
122- rawCallback()
123- }
124-}
125-
126-// OverrideGReserved5 sets the callback function.
127-func (x *UnixInputStreamClass) OverrideGReserved5(cb func()) {
128- if cb == nil {
129- x.xGReserved5 = 0
130- } else {
131- x.xGReserved5 = purego.NewCallback(func() {
132- cb()
133- })
134- }
135-}
136-
137-// GetGReserved5 gets the callback function.
138-func (x *UnixInputStreamClass) GetGReserved5() func() {
139- if x.xGReserved5 == 0 {
140- return nil
141- }
142- var rawCallback func()
143- purego.RegisterFunc(&rawCallback, x.xGReserved5)
144- return func() {
145- rawCallback()
146- }
147-}
148-
149-type UnixInputStreamPrivate struct {
150- _ structs.HostLayout
151-}
152-
153-func (x *UnixInputStreamPrivate) GoPointer() uintptr {
154- return uintptr(unsafe.Pointer(x))
155-}
156-
157-// `GUnixInputStream` implements [class@Gio.InputStream] for reading from a UNIX
158-// file descriptor, including asynchronous operations. (If the file
159-// descriptor refers to a socket or pipe, this will use `poll()` to do
160-// asynchronous I/O. If it refers to a regular file, it will fall back
161-// to doing asynchronous I/O in another thread.)
162-//
163-// Note that `&lt;gio/gunixinputstream.h&gt;` belongs to the UNIX-specific GIO
164-// interfaces, thus you have to use the `gio-unix-2.0.pc` pkg-config
165-// file or the `GioUnix-2.0` GIR namespace when using it.
166-type UnixInputStream struct {
167- InputStream
168-}
169-
170-var xUnixInputStreamGLibType func() types.GType
171-
172-func UnixInputStreamGLibType() types.GType {
173- return xUnixInputStreamGLibType()
174-}
175-
176-func UnixInputStreamNewFromInternalPtr(ptr uintptr) *UnixInputStream {
177- cls := &UnixInputStream{}
178- cls.Ptr = ptr
179- return cls
180-}
181-
182-var xNewUnixInputStream func(int, bool) uintptr
183-
184-// Creates a new #GUnixInputStream for the given @fd.
185-//
186-// If @close_fd is %TRUE, the file descriptor will be closed
187-// when the stream is closed.
188-func NewUnixInputStream(FdVar int, CloseFdVar bool) *UnixInputStream {
189- var cls *UnixInputStream
190-
191- cret := xNewUnixInputStream(FdVar, CloseFdVar)
192-
193- if cret == 0 {
194- return nil
195- }
196- cls = &UnixInputStream{}
197- cls.Ptr = cret
198- return cls
199-}
200-
201-var xUnixInputStreamGetCloseFd func(uintptr) bool
202-
203-// Returns whether the file descriptor of @stream will be
204-// closed when the stream is closed.
205-func (x *UnixInputStream) GetCloseFd() bool {
206-
207- cret := xUnixInputStreamGetCloseFd(x.GoPointer())
208- return cret
209-}
210-
211-var xUnixInputStreamGetFd func(uintptr) int
212-
213-// Return the UNIX file descriptor that the stream reads from.
214-func (x *UnixInputStream) GetFd() int {
215-
216- cret := xUnixInputStreamGetFd(x.GoPointer())
217- return cret
218-}
219-
220-var xUnixInputStreamSetCloseFd func(uintptr, bool)
221-
222-// Sets whether the file descriptor of @stream shall be closed
223-// when the stream is closed.
224-func (x *UnixInputStream) SetCloseFd(CloseFdVar bool) {
225-
226- xUnixInputStreamSetCloseFd(x.GoPointer(), CloseFdVar)
227-
228-}
229-
230-func (c *UnixInputStream) GoPointer() uintptr {
231- if c == nil {
232- return 0
233- }
234- return c.Ptr
235-}
236-
237-func (c *UnixInputStream) SetGoPointer(ptr uintptr) {
238- c.Ptr = ptr
239-}
240-
241-// Checks if @stream is actually pollable. Some classes may implement
242-// #GPollableInputStream but have only certain instances of that class
243-// be pollable. If this method returns %FALSE, then the behavior of
244-// other #GPollableInputStream methods is undefined.
245-//
246-// For any given stream, the value returned by this method is constant;
247-// a stream cannot switch from pollable to non-pollable or vice versa.
248-func (x *UnixInputStream) CanPoll() bool {
249-
250- cret := XGPollableInputStreamCanPoll(x.GoPointer())
251- return cret
252-}
253-
254-// Creates a #GSource that triggers when @stream can be read, or
255-// @cancellable is triggered or an error occurs. The callback on the
256-// source is of the #GPollableSourceFunc type.
257-//
258-// As with g_pollable_input_stream_is_readable(), it is possible that
259-// the stream may not actually be readable even after the source
260-// triggers, so you should use g_pollable_input_stream_read_nonblocking()
261-// rather than g_input_stream_read() from the callback.
262-//
263-// The behaviour of this method is undefined if
264-// g_pollable_input_stream_can_poll() returns %FALSE for @stream.
265-func (x *UnixInputStream) CreateSource(CancellableVar *Cancellable) *glib.Source {
266-
267- cret := XGPollableInputStreamCreateSource(x.GoPointer(), CancellableVar.GoPointer())
268- return cret
269-}
270-
271-// Checks if @stream can be read.
272-//
273-// Note that some stream types may not be able to implement this 100%
274-// reliably, and it is possible that a call to g_input_stream_read()
275-// after this returns %TRUE would still block. To guarantee
276-// non-blocking behavior, you should always use
277-// g_pollable_input_stream_read_nonblocking(), which will return a
278-// %G_IO_ERROR_WOULD_BLOCK error rather than blocking.
279-//
280-// The behaviour of this method is undefined if
281-// g_pollable_input_stream_can_poll() returns %FALSE for @stream.
282-func (x *UnixInputStream) IsReadable() bool {
283-
284- cret := XGPollableInputStreamIsReadable(x.GoPointer())
285- return cret
286-}
287-
288-// Attempts to read up to @count bytes from @stream into @buffer, as
289-// with g_input_stream_read(). If @stream is not currently readable,
290-// this will immediately return %G_IO_ERROR_WOULD_BLOCK, and you can
291-// use g_pollable_input_stream_create_source() to create a #GSource
292-// that will be triggered when @stream is readable.
293-//
294-// Note that since this method never blocks, you cannot actually
295-// use @cancellable to cancel it. However, it will return an error
296-// if @cancellable has already been cancelled when you call, which
297-// may happen if you call this method after a source triggers due
298-// to having been cancelled.
299-//
300-// The behaviour of this method is undefined if
301-// g_pollable_input_stream_can_poll() returns %FALSE for @stream.
302-func (x *UnixInputStream) ReadNonblocking(BufferVar []byte, CountVar uint, CancellableVar *Cancellable) (int, error) {
303- var cerr *glib.Error
304-
305- cret := XGPollableInputStreamReadNonblocking(x.GoPointer(), BufferVar, CountVar, CancellableVar.GoPointer(), &cerr)
306- if cerr == nil {
307- return cret, nil
308- }
309- return cret, cerr
310-
311-}
312-
313-func init() {
314- core.SetPackageName("GIO", "gio-2.0")
315- core.SetSharedLibraries("GIO", []string{"libgio-2.0.so.0"})
316- var libs []uintptr
317- for _, libPath := range core.GetPaths("GIO") {
318- lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
319- if err != nil {
320- panic(err)
321- }
322- libs = append(libs, lib)
323- }
324-
325- core.PuregoSafeRegister(&xUnixInputStreamGLibType, libs, "g_unix_input_stream_get_type")
326-
327- core.PuregoSafeRegister(&xNewUnixInputStream, libs, "g_unix_input_stream_new")
328-
329- core.PuregoSafeRegister(&xUnixInputStreamGetCloseFd, libs, "g_unix_input_stream_get_close_fd")
330- core.PuregoSafeRegister(&xUnixInputStreamGetFd, libs, "g_unix_input_stream_get_fd")
331- core.PuregoSafeRegister(&xUnixInputStreamSetCloseFd, libs, "g_unix_input_stream_set_close_fd")
332-
333-}
D v4/gio/gunixmounts.go +0 -1035
@@ -1,1035 +0,0 @@
1-// Package gio was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT
2-package gio
3-
4-import (
5- "structs"
6- "unsafe"
7-
8- "github.com/jwijenbergh/purego"
9- "github.com/jwijenbergh/puregotk/pkg/core"
10- "github.com/jwijenbergh/puregotk/v4/glib"
11- "github.com/jwijenbergh/puregotk/v4/gobject"
12- "github.com/jwijenbergh/puregotk/v4/gobject/types"
13-)
14-
15-// Defines a Unix mount entry (e.g. `/media/cdrom`).
16-// This corresponds roughly to a mtab entry.
17-type UnixMountEntry struct {
18- _ structs.HostLayout
19-}
20-
21-var xUnixMountEntryGLibType func() types.GType
22-
23-func UnixMountEntryGLibType() types.GType {
24- return xUnixMountEntryGLibType()
25-}
26-
27-func (x *UnixMountEntry) GoPointer() uintptr {
28- return uintptr(unsafe.Pointer(x))
29-}
30-
31-var xUnixMountEntryCompare func(uintptr, *UnixMountEntry) int
32-
33-// Compares two Unix mounts.
34-func (x *UnixMountEntry) Compare(Mount2Var *UnixMountEntry) int {
35-
36- cret := xUnixMountEntryCompare(x.GoPointer(), Mount2Var)
37- return cret
38-}
39-
40-var xUnixMountEntryCopy func(uintptr) *UnixMountEntry
41-
42-// Makes a copy of @mount_entry.
43-func (x *UnixMountEntry) Copy() *UnixMountEntry {
44-
45- cret := xUnixMountEntryCopy(x.GoPointer())
46- return cret
47-}
48-
49-var xUnixMountEntryFree func(uintptr)
50-
51-// Frees a Unix mount.
52-func (x *UnixMountEntry) Free() {
53-
54- xUnixMountEntryFree(x.GoPointer())
55-
56-}
57-
58-var xUnixMountEntryGetDevicePath func(uintptr) string
59-
60-// Gets the device path for a Unix mount.
61-func (x *UnixMountEntry) GetDevicePath() string {
62-
63- cret := xUnixMountEntryGetDevicePath(x.GoPointer())
64- return cret
65-}
66-
67-var xUnixMountEntryGetFsType func(uintptr) string
68-
69-// Gets the filesystem type for the Unix mount.
70-func (x *UnixMountEntry) GetFsType() string {
71-
72- cret := xUnixMountEntryGetFsType(x.GoPointer())
73- return cret
74-}
75-
76-var xUnixMountEntryGetMountPath func(uintptr) string
77-
78-// Gets the mount path for a Unix mount.
79-func (x *UnixMountEntry) GetMountPath() string {
80-
81- cret := xUnixMountEntryGetMountPath(x.GoPointer())
82- return cret
83-}
84-
85-var xUnixMountEntryGetOptions func(uintptr) string
86-
87-// Gets a comma separated list of mount options for the Unix mount.
88-//
89-// For example: `rw,relatime,seclabel,data=ordered`.
90-//
91-// This is similar to [func@GioUnix.MountPoint.get_options], but it takes
92-// a [struct@GioUnix.MountEntry] as an argument.
93-func (x *UnixMountEntry) GetOptions() string {
94-
95- cret := xUnixMountEntryGetOptions(x.GoPointer())
96- return cret
97-}
98-
99-var xUnixMountEntryGetRootPath func(uintptr) string
100-
101-// Gets the root of the mount within the filesystem. This is useful e.g. for
102-// mounts created by bind operation, or btrfs subvolumes.
103-//
104-// For example, the root path is equal to `/` for a mount created by
105-// `mount /dev/sda1 /mnt/foo` and `/bar` for
106-// `mount --bind /mnt/foo/bar /mnt/bar`.
107-func (x *UnixMountEntry) GetRootPath() string {
108-
109- cret := xUnixMountEntryGetRootPath(x.GoPointer())
110- return cret
111-}
112-
113-var xUnixMountEntryGuessCanEject func(uintptr) bool
114-
115-// Guesses whether a Unix mount entry can be ejected.
116-func (x *UnixMountEntry) GuessCanEject() bool {
117-
118- cret := xUnixMountEntryGuessCanEject(x.GoPointer())
119- return cret
120-}
121-
122-var xUnixMountEntryGuessIcon func(uintptr) uintptr
123-
124-// Guesses the icon of a Unix mount entry.
125-func (x *UnixMountEntry) GuessIcon() *IconBase {
126- var cls *IconBase
127-
128- cret := xUnixMountEntryGuessIcon(x.GoPointer())
129-
130- if cret == 0 {
131- return nil
132- }
133- cls = &IconBase{}
134- cls.Ptr = cret
135- return cls
136-}
137-
138-var xUnixMountEntryGuessName func(uintptr) string
139-
140-// Guesses the name of a Unix mount entry.
141-//
142-// The result is a translated string.
143-func (x *UnixMountEntry) GuessName() string {
144-
145- cret := xUnixMountEntryGuessName(x.GoPointer())
146- return cret
147-}
148-
149-var xUnixMountEntryGuessShouldDisplay func(uintptr) bool
150-
151-// Guesses whether a Unix mount entry should be displayed in the UI.
152-func (x *UnixMountEntry) GuessShouldDisplay() bool {
153-
154- cret := xUnixMountEntryGuessShouldDisplay(x.GoPointer())
155- return cret
156-}
157-
158-var xUnixMountEntryGuessSymbolicIcon func(uintptr) uintptr
159-
160-// Guesses the symbolic icon of a Unix mount entry.
161-func (x *UnixMountEntry) GuessSymbolicIcon() *IconBase {
162- var cls *IconBase
163-
164- cret := xUnixMountEntryGuessSymbolicIcon(x.GoPointer())
165-
166- if cret == 0 {
167- return nil
168- }
169- cls = &IconBase{}
170- cls.Ptr = cret
171- return cls
172-}
173-
174-var xUnixMountEntryIsReadonly func(uintptr) bool
175-
176-// Checks if a Unix mount is mounted read only.
177-func (x *UnixMountEntry) IsReadonly() bool {
178-
179- cret := xUnixMountEntryIsReadonly(x.GoPointer())
180- return cret
181-}
182-
183-var xUnixMountEntryIsSystemInternal func(uintptr) bool
184-
185-// Checks if a Unix mount is a system mount.
186-//
187-// This is the Boolean OR of
188-// [func@GioUnix.is_system_fs_type], [func@GioUnix.is_system_device_path] and
189-// [func@GioUnix.is_mount_path_system_internal] on @mount_entry’s properties.
190-//
191-// The definition of what a ‘system’ mount entry is may change over time as new
192-// file system types and device paths are ignored.
193-func (x *UnixMountEntry) IsSystemInternal() bool {
194-
195- cret := xUnixMountEntryIsSystemInternal(x.GoPointer())
196- return cret
197-}
198-
199-type UnixMountMonitorClass struct {
200- _ structs.HostLayout
201-}
202-
203-func (x *UnixMountMonitorClass) GoPointer() uintptr {
204- return uintptr(unsafe.Pointer(x))
205-}
206-
207-// Defines a Unix mount point (e.g. `/dev`).
208-// This corresponds roughly to a fstab entry.
209-type UnixMountPoint struct {
210- _ structs.HostLayout
211-}
212-
213-var xUnixMountPointGLibType func() types.GType
214-
215-func UnixMountPointGLibType() types.GType {
216- return xUnixMountPointGLibType()
217-}
218-
219-func (x *UnixMountPoint) GoPointer() uintptr {
220- return uintptr(unsafe.Pointer(x))
221-}
222-
223-var xUnixMountPointCompare func(uintptr, *UnixMountPoint) int
224-
225-// Compares two Unix mount points.
226-func (x *UnixMountPoint) Compare(Mount2Var *UnixMountPoint) int {
227-
228- cret := xUnixMountPointCompare(x.GoPointer(), Mount2Var)
229- return cret
230-}
231-
232-var xUnixMountPointCopy func(uintptr) *UnixMountPoint
233-
234-// Makes a copy of @mount_point.
235-func (x *UnixMountPoint) Copy() *UnixMountPoint {
236-
237- cret := xUnixMountPointCopy(x.GoPointer())
238- return cret
239-}
240-
241-var xUnixMountPointFree func(uintptr)
242-
243-// Frees a Unix mount point.
244-func (x *UnixMountPoint) Free() {
245-
246- xUnixMountPointFree(x.GoPointer())
247-
248-}
249-
250-var xUnixMountPointGetDevicePath func(uintptr) string
251-
252-// Gets the device path for a Unix mount point.
253-func (x *UnixMountPoint) GetDevicePath() string {
254-
255- cret := xUnixMountPointGetDevicePath(x.GoPointer())
256- return cret
257-}
258-
259-var xUnixMountPointGetFsType func(uintptr) string
260-
261-// Gets the file system type for the mount point.
262-func (x *UnixMountPoint) GetFsType() string {
263-
264- cret := xUnixMountPointGetFsType(x.GoPointer())
265- return cret
266-}
267-
268-var xUnixMountPointGetMountPath func(uintptr) string
269-
270-// Gets the mount path for a Unix mount point.
271-func (x *UnixMountPoint) GetMountPath() string {
272-
273- cret := xUnixMountPointGetMountPath(x.GoPointer())
274- return cret
275-}
276-
277-var xUnixMountPointGetOptions func(uintptr) string
278-
279-// Gets the options for the mount point.
280-func (x *UnixMountPoint) GetOptions() string {
281-
282- cret := xUnixMountPointGetOptions(x.GoPointer())
283- return cret
284-}
285-
286-var xUnixMountPointGuessCanEject func(uintptr) bool
287-
288-// Guesses whether a Unix mount point can be ejected.
289-func (x *UnixMountPoint) GuessCanEject() bool {
290-
291- cret := xUnixMountPointGuessCanEject(x.GoPointer())
292- return cret
293-}
294-
295-var xUnixMountPointGuessIcon func(uintptr) uintptr
296-
297-// Guesses the icon of a Unix mount point.
298-func (x *UnixMountPoint) GuessIcon() *IconBase {
299- var cls *IconBase
300-
301- cret := xUnixMountPointGuessIcon(x.GoPointer())
302-
303- if cret == 0 {
304- return nil
305- }
306- cls = &IconBase{}
307- cls.Ptr = cret
308- return cls
309-}
310-
311-var xUnixMountPointGuessName func(uintptr) string
312-
313-// Guesses the name of a Unix mount point.
314-//
315-// The result is a translated string.
316-func (x *UnixMountPoint) GuessName() string {
317-
318- cret := xUnixMountPointGuessName(x.GoPointer())
319- return cret
320-}
321-
322-var xUnixMountPointGuessSymbolicIcon func(uintptr) uintptr
323-
324-// Guesses the symbolic icon of a Unix mount point.
325-func (x *UnixMountPoint) GuessSymbolicIcon() *IconBase {
326- var cls *IconBase
327-
328- cret := xUnixMountPointGuessSymbolicIcon(x.GoPointer())
329-
330- if cret == 0 {
331- return nil
332- }
333- cls = &IconBase{}
334- cls.Ptr = cret
335- return cls
336-}
337-
338-var xUnixMountPointIsLoopback func(uintptr) bool
339-
340-// Checks if a Unix mount point is a loopback device.
341-func (x *UnixMountPoint) IsLoopback() bool {
342-
343- cret := xUnixMountPointIsLoopback(x.GoPointer())
344- return cret
345-}
346-
347-var xUnixMountPointIsReadonly func(uintptr) bool
348-
349-// Checks if a Unix mount point is read only.
350-func (x *UnixMountPoint) IsReadonly() bool {
351-
352- cret := xUnixMountPointIsReadonly(x.GoPointer())
353- return cret
354-}
355-
356-var xUnixMountPointIsUserMountable func(uintptr) bool
357-
358-// Checks if a Unix mount point is mountable by the user.
359-func (x *UnixMountPoint) IsUserMountable() bool {
360-
361- cret := xUnixMountPointIsUserMountable(x.GoPointer())
362- return cret
363-}
364-
365-var xUnixIsMountPathSystemInternal func(string) bool
366-
367-// Determines if @mount_path is considered an implementation of the
368-// OS.
369-//
370-// This is primarily used for hiding mountable and mounted volumes
371-// that only are used in the OS and has little to no relevance to the
372-// casual user.
373-func UnixIsMountPathSystemInternal(MountPathVar string) bool {
374-
375- cret := xUnixIsMountPathSystemInternal(MountPathVar)
376- return cret
377-}
378-
379-var xUnixIsSystemDevicePath func(string) bool
380-
381-// Determines if @device_path is considered a block device path which is only
382-// used in implementation of the OS.
383-//
384-// This is primarily used for hiding mounted volumes that are intended as APIs
385-// for programs to read, and system administrators at a shell; rather than
386-// something that should, for example, appear in a GUI. For example, the Linux
387-// `/proc` filesystem.
388-//
389-// The list of device paths considered ‘system’ ones may change over time.
390-func UnixIsSystemDevicePath(DevicePathVar string) bool {
391-
392- cret := xUnixIsSystemDevicePath(DevicePathVar)
393- return cret
394-}
395-
396-var xUnixIsSystemFsType func(string) bool
397-
398-// Determines if @fs_type is considered a type of file system which is only
399-// used in implementation of the OS.
400-//
401-// This is primarily used for hiding mounted volumes that are intended as APIs
402-// for programs to read, and system administrators at a shell; rather than
403-// something that should, for example, appear in a GUI. For example, the Linux
404-// `/proc` filesystem.
405-//
406-// The list of file system types considered ‘system’ ones may change over time.
407-func UnixIsSystemFsType(FsTypeVar string) bool {
408-
409- cret := xUnixIsSystemFsType(FsTypeVar)
410- return cret
411-}
412-
413-var xUnixMountAt func(string, uint64) *UnixMountEntry
414-
415-// Gets a [struct@GioUnix.MountEntry] for a given mount path.
416-//
417-// If @time_read is set, it will be filled with a Unix timestamp for checking
418-// if the mounts have changed since with
419-// [func@GioUnix.mount_entries_changed_since].
420-//
421-// If more mounts have the same mount path, the last matching mount
422-// is returned.
423-//
424-// This will return `NULL` if there is no mount point at @mount_path.
425-func UnixMountAt(MountPathVar string, TimeReadVar uint64) *UnixMountEntry {
426-
427- cret := xUnixMountAt(MountPathVar, TimeReadVar)
428- return cret
429-}
430-
431-var xUnixMountCompare func(*UnixMountEntry, *UnixMountEntry) int
432-
433-// Compares two Unix mounts.
434-func UnixMountCompare(Mount1Var *UnixMountEntry, Mount2Var *UnixMountEntry) int {
435-
436- cret := xUnixMountCompare(Mount1Var, Mount2Var)
437- return cret
438-}
439-
440-var xUnixMountCopy func(*UnixMountEntry) *UnixMountEntry
441-
442-// Makes a copy of @mount_entry.
443-func UnixMountCopy(MountEntryVar *UnixMountEntry) *UnixMountEntry {
444-
445- cret := xUnixMountCopy(MountEntryVar)
446- return cret
447-}
448-
449-var xUnixMountEntriesChangedSince func(uint64) bool
450-
451-// Checks if the Unix mounts have changed since a given Unix time.
452-//
453-// This can only work reliably if a [class@GioUnix.MountMonitor] is running in
454-// the process, otherwise changes in the mount entries file (such as
455-// `/proc/self/mountinfo` on Linux) cannot be detected and, as a result, this
456-// function has to conservatively always return `TRUE`.
457-//
458-// It is more efficient to use [signal@GioUnix.MountMonitor::mounts-changed] to
459-// be signalled of changes to the mount entries, rather than polling using this
460-// function. This function is more appropriate for infrequently determining
461-// cache validity.
462-func UnixMountEntriesChangedSince(TimeVar uint64) bool {
463-
464- cret := xUnixMountEntriesChangedSince(TimeVar)
465- return cret
466-}
467-
468-var xUnixMountEntriesGet func(uint64) *glib.List
469-
470-// Gets a list of [struct@GioUnix.MountEntry] instances representing the Unix
471-// mounts.
472-//
473-// If @time_read is set, it will be filled with the mount timestamp, allowing
474-// for checking if the mounts have changed with
475-// [func@GioUnix.mount_entries_changed_since].
476-func UnixMountEntriesGet(TimeReadVar uint64) *glib.List {
477-
478- cret := xUnixMountEntriesGet(TimeReadVar)
479- return cret
480-}
481-
482-var xUnixMountEntriesGetFromFile func(string, uint64, uint) uintptr
483-
484-// Gets an array of [struct@Gio.UnixMountEntry]s containing the Unix mounts
485-// listed in @table_path.
486-//
487-// This is a generalized version of [func@GioUnix.mount_entries_get], mainly
488-// intended for internal testing use. Note that [func@GioUnix.mount_entries_get]
489-// may parse multiple hierarchical table files, so this function is not a direct
490-// superset of its functionality.
491-//
492-// If there is an error reading or parsing the file, `NULL` will be returned
493-// and both out parameters will be set to `0`.
494-func UnixMountEntriesGetFromFile(TablePathVar string, TimeReadOutVar uint64, NEntriesOutVar uint) uintptr {
495-
496- cret := xUnixMountEntriesGetFromFile(TablePathVar, TimeReadOutVar, NEntriesOutVar)
497- return cret
498-}
499-
500-var xUnixMountEntryAt func(string, uint64) *UnixMountEntry
501-
502-// Gets a [struct@GioUnix.MountEntry] for a given mount path.
503-//
504-// If @time_read is set, it will be filled with a Unix timestamp for checking
505-// if the mounts have changed since with
506-// [func@GioUnix.mount_entries_changed_since].
507-//
508-// If more mounts have the same mount path, the last matching mount
509-// is returned.
510-//
511-// This will return `NULL` if there is no mount point at @mount_path.
512-func UnixMountEntryAt(MountPathVar string, TimeReadVar uint64) *UnixMountEntry {
513-
514- cret := xUnixMountEntryAt(MountPathVar, TimeReadVar)
515- return cret
516-}
517-
518-var xUnixMountEntryFor func(string, uint64) *UnixMountEntry
519-
520-// Gets a [struct@GioUnix.MountEntry] for a given file path.
521-//
522-// If @time_read is set, it will be filled with a Unix timestamp for checking
523-// if the mounts have changed since with
524-// [func@GioUnix.mount_entries_changed_since].
525-//
526-// If more mounts have the same mount path, the last matching mount
527-// is returned.
528-//
529-// This will return `NULL` if looking up the mount entry fails, if
530-// @file_path doesn’t exist or there is an I/O error.
531-func UnixMountEntryFor(FilePathVar string, TimeReadVar uint64) *UnixMountEntry {
532-
533- cret := xUnixMountEntryFor(FilePathVar, TimeReadVar)
534- return cret
535-}
536-
537-var xUnixMountFor func(string, uint64) *UnixMountEntry
538-
539-// Gets a [struct@GioUnix.MountEntry] for a given file path.
540-//
541-// If @time_read is set, it will be filled with a Unix timestamp for checking
542-// if the mounts have changed since with
543-// [func@GioUnix.mount_entries_changed_since].
544-//
545-// If more mounts have the same mount path, the last matching mount
546-// is returned.
547-//
548-// This will return `NULL` if looking up the mount entry fails, if
549-// @file_path doesn’t exist or there is an I/O error.
550-func UnixMountFor(FilePathVar string, TimeReadVar uint64) *UnixMountEntry {
551-
552- cret := xUnixMountFor(FilePathVar, TimeReadVar)
553- return cret
554-}
555-
556-var xUnixMountFree func(*UnixMountEntry)
557-
558-// Frees a Unix mount.
559-func UnixMountFree(MountEntryVar *UnixMountEntry) {
560-
561- xUnixMountFree(MountEntryVar)
562-
563-}
564-
565-var xUnixMountGetDevicePath func(*UnixMountEntry) string
566-
567-// Gets the device path for a Unix mount.
568-func UnixMountGetDevicePath(MountEntryVar *UnixMountEntry) string {
569-
570- cret := xUnixMountGetDevicePath(MountEntryVar)
571- return cret
572-}
573-
574-var xUnixMountGetFsType func(*UnixMountEntry) string
575-
576-// Gets the filesystem type for the Unix mount.
577-func UnixMountGetFsType(MountEntryVar *UnixMountEntry) string {
578-
579- cret := xUnixMountGetFsType(MountEntryVar)
580- return cret
581-}
582-
583-var xUnixMountGetMountPath func(*UnixMountEntry) string
584-
585-// Gets the mount path for a Unix mount.
586-func UnixMountGetMountPath(MountEntryVar *UnixMountEntry) string {
587-
588- cret := xUnixMountGetMountPath(MountEntryVar)
589- return cret
590-}
591-
592-var xUnixMountGetOptions func(*UnixMountEntry) string
593-
594-// Gets a comma separated list of mount options for the Unix mount.
595-//
596-// For example: `rw,relatime,seclabel,data=ordered`.
597-//
598-// This is similar to [func@GioUnix.MountPoint.get_options], but it takes
599-// a [struct@GioUnix.MountEntry] as an argument.
600-func UnixMountGetOptions(MountEntryVar *UnixMountEntry) string {
601-
602- cret := xUnixMountGetOptions(MountEntryVar)
603- return cret
604-}
605-
606-var xUnixMountGetRootPath func(*UnixMountEntry) string
607-
608-// Gets the root of the mount within the filesystem. This is useful e.g. for
609-// mounts created by bind operation, or btrfs subvolumes.
610-//
611-// For example, the root path is equal to `/` for a mount created by
612-// `mount /dev/sda1 /mnt/foo` and `/bar` for
613-// `mount --bind /mnt/foo/bar /mnt/bar`.
614-func UnixMountGetRootPath(MountEntryVar *UnixMountEntry) string {
615-
616- cret := xUnixMountGetRootPath(MountEntryVar)
617- return cret
618-}
619-
620-var xUnixMountGuessCanEject func(*UnixMountEntry) bool
621-
622-// Guesses whether a Unix mount entry can be ejected.
623-func UnixMountGuessCanEject(MountEntryVar *UnixMountEntry) bool {
624-
625- cret := xUnixMountGuessCanEject(MountEntryVar)
626- return cret
627-}
628-
629-var xUnixMountGuessIcon func(*UnixMountEntry) uintptr
630-
631-// Guesses the icon of a Unix mount entry.
632-func UnixMountGuessIcon(MountEntryVar *UnixMountEntry) *IconBase {
633- var cls *IconBase
634-
635- cret := xUnixMountGuessIcon(MountEntryVar)
636-
637- if cret == 0 {
638- return nil
639- }
640- cls = &IconBase{}
641- cls.Ptr = cret
642- return cls
643-}
644-
645-var xUnixMountGuessName func(*UnixMountEntry) string
646-
647-// Guesses the name of a Unix mount entry.
648-//
649-// The result is a translated string.
650-func UnixMountGuessName(MountEntryVar *UnixMountEntry) string {
651-
652- cret := xUnixMountGuessName(MountEntryVar)
653- return cret
654-}
655-
656-var xUnixMountGuessShouldDisplay func(*UnixMountEntry) bool
657-
658-// Guesses whether a Unix mount entry should be displayed in the UI.
659-func UnixMountGuessShouldDisplay(MountEntryVar *UnixMountEntry) bool {
660-
661- cret := xUnixMountGuessShouldDisplay(MountEntryVar)
662- return cret
663-}
664-
665-var xUnixMountGuessSymbolicIcon func(*UnixMountEntry) uintptr
666-
667-// Guesses the symbolic icon of a Unix mount entry.
668-func UnixMountGuessSymbolicIcon(MountEntryVar *UnixMountEntry) *IconBase {
669- var cls *IconBase
670-
671- cret := xUnixMountGuessSymbolicIcon(MountEntryVar)
672-
673- if cret == 0 {
674- return nil
675- }
676- cls = &IconBase{}
677- cls.Ptr = cret
678- return cls
679-}
680-
681-var xUnixMountIsReadonly func(*UnixMountEntry) bool
682-
683-// Checks if a Unix mount is mounted read only.
684-func UnixMountIsReadonly(MountEntryVar *UnixMountEntry) bool {
685-
686- cret := xUnixMountIsReadonly(MountEntryVar)
687- return cret
688-}
689-
690-var xUnixMountIsSystemInternal func(*UnixMountEntry) bool
691-
692-// Checks if a Unix mount is a system mount.
693-//
694-// This is the Boolean OR of
695-// [func@GioUnix.is_system_fs_type], [func@GioUnix.is_system_device_path] and
696-// [func@GioUnix.is_mount_path_system_internal] on @mount_entry’s properties.
697-//
698-// The definition of what a ‘system’ mount entry is may change over time as new
699-// file system types and device paths are ignored.
700-func UnixMountIsSystemInternal(MountEntryVar *UnixMountEntry) bool {
701-
702- cret := xUnixMountIsSystemInternal(MountEntryVar)
703- return cret
704-}
705-
706-var xUnixMountPointAt func(string, uint64) *UnixMountPoint
707-
708-// Gets a [struct@GioUnix.MountPoint] for a given mount path.
709-//
710-// If @time_read is set, it will be filled with a Unix timestamp for checking if
711-// the mount points have changed since with
712-// [func@GioUnix.mount_points_changed_since].
713-//
714-// If more mount points have the same mount path, the last matching mount point
715-// is returned.
716-func UnixMountPointAt(MountPathVar string, TimeReadVar uint64) *UnixMountPoint {
717-
718- cret := xUnixMountPointAt(MountPathVar, TimeReadVar)
719- return cret
720-}
721-
722-var xUnixMountPointsChangedSince func(uint64) bool
723-
724-// Checks if the Unix mount points have changed since a given Unix time.
725-//
726-// Unlike [func@GioUnix.mount_entries_changed_since], this function can work
727-// reliably without a [class@GioUnix.MountMonitor] running, as it accesses the
728-// static mount point information (such as `/etc/fstab` on Linux), which has a
729-// valid modification time.
730-//
731-// It is more efficient to use [signal@GioUnix.MountMonitor::mountpoints-changed]
732-// to be signalled of changes to the mount points, rather than polling using
733-// this function. This function is more appropriate for infrequently determining
734-// cache validity.
735-func UnixMountPointsChangedSince(TimeVar uint64) bool {
736-
737- cret := xUnixMountPointsChangedSince(TimeVar)
738- return cret
739-}
740-
741-var xUnixMountPointsGet func(uint64) *glib.List
742-
743-// Gets a list of [struct@GioUnix.MountPoint] instances representing the Unix
744-// mount points.
745-//
746-// If @time_read is set, it will be filled with the mount timestamp, allowing
747-// for checking if the mounts have changed with
748-// [func@GioUnix.mount_points_changed_since].
749-func UnixMountPointsGet(TimeReadVar uint64) *glib.List {
750-
751- cret := xUnixMountPointsGet(TimeReadVar)
752- return cret
753-}
754-
755-var xUnixMountPointsGetFromFile func(string, uint64, uint) uintptr
756-
757-// Gets an array of [struct@Gio.UnixMountPoint]s containing the Unix mount
758-// points listed in @table_path.
759-//
760-// This is a generalized version of [func@GioUnix.mount_points_get], mainly
761-// intended for internal testing use. Note that [func@GioUnix.mount_points_get]
762-// may parse multiple hierarchical table files, so this function is not a direct
763-// superset of its functionality.
764-//
765-// If there is an error reading or parsing the file, `NULL` will be returned
766-// and both out parameters will be set to `0`.
767-func UnixMountPointsGetFromFile(TablePathVar string, TimeReadOutVar uint64, NPointsOutVar uint) uintptr {
768-
769- cret := xUnixMountPointsGetFromFile(TablePathVar, TimeReadOutVar, NPointsOutVar)
770- return cret
771-}
772-
773-var xUnixMountsChangedSince func(uint64) bool
774-
775-// Checks if the Unix mounts have changed since a given Unix time.
776-func UnixMountsChangedSince(TimeVar uint64) bool {
777-
778- cret := xUnixMountsChangedSince(TimeVar)
779- return cret
780-}
781-
782-var xUnixMountsGet func(uint64) *glib.List
783-
784-// Gets a list of [struct@GioUnix.MountEntry] instances representing the Unix
785-// mounts.
786-//
787-// If @time_read is set, it will be filled with the mount timestamp, allowing
788-// for checking if the mounts have changed with
789-// [func@GioUnix.mount_entries_changed_since].
790-func UnixMountsGet(TimeReadVar uint64) *glib.List {
791-
792- cret := xUnixMountsGet(TimeReadVar)
793- return cret
794-}
795-
796-var xUnixMountsGetFromFile func(string, uint64, uint) uintptr
797-
798-// Gets an array of [struct@Gio.UnixMountEntry]s containing the Unix mounts
799-// listed in @table_path.
800-//
801-// This is a generalized version of [func@GioUnix.mount_entries_get], mainly
802-// intended for internal testing use. Note that [func@GioUnix.mount_entries_get]
803-// may parse multiple hierarchical table files, so this function is not a direct
804-// superset of its functionality.
805-//
806-// If there is an error reading or parsing the file, `NULL` will be returned
807-// and both out parameters will be set to `0`.
808-func UnixMountsGetFromFile(TablePathVar string, TimeReadOutVar uint64, NEntriesOutVar uint) uintptr {
809-
810- cret := xUnixMountsGetFromFile(TablePathVar, TimeReadOutVar, NEntriesOutVar)
811- return cret
812-}
813-
814-// Watches for changes to the set of mount entries and mount points in the
815-// system.
816-//
817-// Connect to the [signal@GioUnix.MountMonitor::mounts-changed] signal to be
818-// notified of changes to the [struct@GioUnix.MountEntry] list.
819-//
820-// Connect to the [signal@GioUnix.MountMonitor::mountpoints-changed] signal to
821-// be notified of changes to the [struct@GioUnix.MountPoint] list.
822-type UnixMountMonitor struct {
823- gobject.Object
824-}
825-
826-var xUnixMountMonitorGLibType func() types.GType
827-
828-func UnixMountMonitorGLibType() types.GType {
829- return xUnixMountMonitorGLibType()
830-}
831-
832-func UnixMountMonitorNewFromInternalPtr(ptr uintptr) *UnixMountMonitor {
833- cls := &UnixMountMonitor{}
834- cls.Ptr = ptr
835- return cls
836-}
837-
838-var xNewUnixMountMonitor func() uintptr
839-
840-// Deprecated alias for [func@GioUnix.MountMonitor.get].
841-//
842-// This function was never a true constructor, which is why it was
843-// renamed.
844-func NewUnixMountMonitor() *UnixMountMonitor {
845- var cls *UnixMountMonitor
846-
847- cret := xNewUnixMountMonitor()
848-
849- if cret == 0 {
850- return nil
851- }
852- cls = &UnixMountMonitor{}
853- cls.Ptr = cret
854- return cls
855-}
856-
857-var xUnixMountMonitorSetRateLimit func(uintptr, int)
858-
859-// This function does nothing.
860-//
861-// Before 2.44, this was a partially-effective way of controlling the
862-// rate at which events would be reported under some uncommon
863-// circumstances. Since @mount_monitor is a singleton, it also meant
864-// that calling this function would have side effects for other users of
865-// the monitor.
866-func (x *UnixMountMonitor) SetRateLimit(LimitMsecVar int) {
867-
868- xUnixMountMonitorSetRateLimit(x.GoPointer(), LimitMsecVar)
869-
870-}
871-
872-func (c *UnixMountMonitor) GoPointer() uintptr {
873- if c == nil {
874- return 0
875- }
876- return c.Ptr
877-}
878-
879-func (c *UnixMountMonitor) SetGoPointer(ptr uintptr) {
880- c.Ptr = ptr
881-}
882-
883-// Emitted when the Unix mount points have changed.
884-func (x *UnixMountMonitor) ConnectMountpointsChanged(cb *func(UnixMountMonitor)) uint32 {
885- cbPtr := uintptr(unsafe.Pointer(cb))
886- if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
887- return gobject.SignalConnect(x.GoPointer(), "mountpoints-changed", cbRefPtr)
888- }
889-
890- fcb := func(clsPtr uintptr) {
891- fa := UnixMountMonitor{}
892- fa.Ptr = clsPtr
893- cbFn := *cb
894-
895- cbFn(fa)
896-
897- }
898- cbRefPtr := purego.NewCallback(fcb)
899- glib.SaveCallback(cbPtr, cbRefPtr)
900- return gobject.SignalConnect(x.GoPointer(), "mountpoints-changed", cbRefPtr)
901-}
902-
903-// Emitted when the Unix mount entries have changed.
904-func (x *UnixMountMonitor) ConnectMountsChanged(cb *func(UnixMountMonitor)) uint32 {
905- cbPtr := uintptr(unsafe.Pointer(cb))
906- if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
907- return gobject.SignalConnect(x.GoPointer(), "mounts-changed", cbRefPtr)
908- }
909-
910- fcb := func(clsPtr uintptr) {
911- fa := UnixMountMonitor{}
912- fa.Ptr = clsPtr
913- cbFn := *cb
914-
915- cbFn(fa)
916-
917- }
918- cbRefPtr := purego.NewCallback(fcb)
919- glib.SaveCallback(cbPtr, cbRefPtr)
920- return gobject.SignalConnect(x.GoPointer(), "mounts-changed", cbRefPtr)
921-}
922-
923-var xUnixMountMonitorGet func() uintptr
924-
925-// Gets the [class@GioUnix.MountMonitor] for the current thread-default main
926-// context.
927-//
928-// The mount monitor can be used to monitor for changes to the list of
929-// mounted filesystems as well as the list of mount points (ie: fstab
930-// entries).
931-//
932-// You must only call [method@GObject.Object.unref] on the return value from
933-// under the same main context as you called this function.
934-func UnixMountMonitorGet() *UnixMountMonitor {
935- var cls *UnixMountMonitor
936-
937- cret := xUnixMountMonitorGet()
938-
939- if cret == 0 {
940- return nil
941- }
942- cls = &UnixMountMonitor{}
943- cls.Ptr = cret
944- return cls
945-}
946-
947-func init() {
948- core.SetPackageName("GIO", "gio-2.0")
949- core.SetSharedLibraries("GIO", []string{"libgio-2.0.so.0"})
950- var libs []uintptr
951- for _, libPath := range core.GetPaths("GIO") {
952- lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
953- if err != nil {
954- panic(err)
955- }
956- libs = append(libs, lib)
957- }
958-
959- core.PuregoSafeRegister(&xUnixIsMountPathSystemInternal, libs, "g_unix_is_mount_path_system_internal")
960- core.PuregoSafeRegister(&xUnixIsSystemDevicePath, libs, "g_unix_is_system_device_path")
961- core.PuregoSafeRegister(&xUnixIsSystemFsType, libs, "g_unix_is_system_fs_type")
962- core.PuregoSafeRegister(&xUnixMountAt, libs, "g_unix_mount_at")
963- core.PuregoSafeRegister(&xUnixMountCompare, libs, "g_unix_mount_compare")
964- core.PuregoSafeRegister(&xUnixMountCopy, libs, "g_unix_mount_copy")
965- core.PuregoSafeRegister(&xUnixMountEntriesChangedSince, libs, "g_unix_mount_entries_changed_since")
966- core.PuregoSafeRegister(&xUnixMountEntriesGet, libs, "g_unix_mount_entries_get")
967- core.PuregoSafeRegister(&xUnixMountEntriesGetFromFile, libs, "g_unix_mount_entries_get_from_file")
968- core.PuregoSafeRegister(&xUnixMountEntryAt, libs, "g_unix_mount_entry_at")
969- core.PuregoSafeRegister(&xUnixMountEntryFor, libs, "g_unix_mount_entry_for")
970- core.PuregoSafeRegister(&xUnixMountFor, libs, "g_unix_mount_for")
971- core.PuregoSafeRegister(&xUnixMountFree, libs, "g_unix_mount_free")
972- core.PuregoSafeRegister(&xUnixMountGetDevicePath, libs, "g_unix_mount_get_device_path")
973- core.PuregoSafeRegister(&xUnixMountGetFsType, libs, "g_unix_mount_get_fs_type")
974- core.PuregoSafeRegister(&xUnixMountGetMountPath, libs, "g_unix_mount_get_mount_path")
975- core.PuregoSafeRegister(&xUnixMountGetOptions, libs, "g_unix_mount_get_options")
976- core.PuregoSafeRegister(&xUnixMountGetRootPath, libs, "g_unix_mount_get_root_path")
977- core.PuregoSafeRegister(&xUnixMountGuessCanEject, libs, "g_unix_mount_guess_can_eject")
978- core.PuregoSafeRegister(&xUnixMountGuessIcon, libs, "g_unix_mount_guess_icon")
979- core.PuregoSafeRegister(&xUnixMountGuessName, libs, "g_unix_mount_guess_name")
980- core.PuregoSafeRegister(&xUnixMountGuessShouldDisplay, libs, "g_unix_mount_guess_should_display")
981- core.PuregoSafeRegister(&xUnixMountGuessSymbolicIcon, libs, "g_unix_mount_guess_symbolic_icon")
982- core.PuregoSafeRegister(&xUnixMountIsReadonly, libs, "g_unix_mount_is_readonly")
983- core.PuregoSafeRegister(&xUnixMountIsSystemInternal, libs, "g_unix_mount_is_system_internal")
984- core.PuregoSafeRegister(&xUnixMountPointAt, libs, "g_unix_mount_point_at")
985- core.PuregoSafeRegister(&xUnixMountPointsChangedSince, libs, "g_unix_mount_points_changed_since")
986- core.PuregoSafeRegister(&xUnixMountPointsGet, libs, "g_unix_mount_points_get")
987- core.PuregoSafeRegister(&xUnixMountPointsGetFromFile, libs, "g_unix_mount_points_get_from_file")
988- core.PuregoSafeRegister(&xUnixMountsChangedSince, libs, "g_unix_mounts_changed_since")
989- core.PuregoSafeRegister(&xUnixMountsGet, libs, "g_unix_mounts_get")
990- core.PuregoSafeRegister(&xUnixMountsGetFromFile, libs, "g_unix_mounts_get_from_file")
991-
992- core.PuregoSafeRegister(&xUnixMountEntryGLibType, libs, "g_unix_mount_entry_get_type")
993-
994- core.PuregoSafeRegister(&xUnixMountEntryCompare, libs, "g_unix_mount_entry_compare")
995- core.PuregoSafeRegister(&xUnixMountEntryCopy, libs, "g_unix_mount_entry_copy")
996- core.PuregoSafeRegister(&xUnixMountEntryFree, libs, "g_unix_mount_entry_free")
997- core.PuregoSafeRegister(&xUnixMountEntryGetDevicePath, libs, "g_unix_mount_entry_get_device_path")
998- core.PuregoSafeRegister(&xUnixMountEntryGetFsType, libs, "g_unix_mount_entry_get_fs_type")
999- core.PuregoSafeRegister(&xUnixMountEntryGetMountPath, libs, "g_unix_mount_entry_get_mount_path")
1000- core.PuregoSafeRegister(&xUnixMountEntryGetOptions, libs, "g_unix_mount_entry_get_options")
1001- core.PuregoSafeRegister(&xUnixMountEntryGetRootPath, libs, "g_unix_mount_entry_get_root_path")
1002- core.PuregoSafeRegister(&xUnixMountEntryGuessCanEject, libs, "g_unix_mount_entry_guess_can_eject")
1003- core.PuregoSafeRegister(&xUnixMountEntryGuessIcon, libs, "g_unix_mount_entry_guess_icon")
1004- core.PuregoSafeRegister(&xUnixMountEntryGuessName, libs, "g_unix_mount_entry_guess_name")
1005- core.PuregoSafeRegister(&xUnixMountEntryGuessShouldDisplay, libs, "g_unix_mount_entry_guess_should_display")
1006- core.PuregoSafeRegister(&xUnixMountEntryGuessSymbolicIcon, libs, "g_unix_mount_entry_guess_symbolic_icon")
1007- core.PuregoSafeRegister(&xUnixMountEntryIsReadonly, libs, "g_unix_mount_entry_is_readonly")
1008- core.PuregoSafeRegister(&xUnixMountEntryIsSystemInternal, libs, "g_unix_mount_entry_is_system_internal")
1009-
1010- core.PuregoSafeRegister(&xUnixMountPointGLibType, libs, "g_unix_mount_point_get_type")
1011-
1012- core.PuregoSafeRegister(&xUnixMountPointCompare, libs, "g_unix_mount_point_compare")
1013- core.PuregoSafeRegister(&xUnixMountPointCopy, libs, "g_unix_mount_point_copy")
1014- core.PuregoSafeRegister(&xUnixMountPointFree, libs, "g_unix_mount_point_free")
1015- core.PuregoSafeRegister(&xUnixMountPointGetDevicePath, libs, "g_unix_mount_point_get_device_path")
1016- core.PuregoSafeRegister(&xUnixMountPointGetFsType, libs, "g_unix_mount_point_get_fs_type")
1017- core.PuregoSafeRegister(&xUnixMountPointGetMountPath, libs, "g_unix_mount_point_get_mount_path")
1018- core.PuregoSafeRegister(&xUnixMountPointGetOptions, libs, "g_unix_mount_point_get_options")
1019- core.PuregoSafeRegister(&xUnixMountPointGuessCanEject, libs, "g_unix_mount_point_guess_can_eject")
1020- core.PuregoSafeRegister(&xUnixMountPointGuessIcon, libs, "g_unix_mount_point_guess_icon")
1021- core.PuregoSafeRegister(&xUnixMountPointGuessName, libs, "g_unix_mount_point_guess_name")
1022- core.PuregoSafeRegister(&xUnixMountPointGuessSymbolicIcon, libs, "g_unix_mount_point_guess_symbolic_icon")
1023- core.PuregoSafeRegister(&xUnixMountPointIsLoopback, libs, "g_unix_mount_point_is_loopback")
1024- core.PuregoSafeRegister(&xUnixMountPointIsReadonly, libs, "g_unix_mount_point_is_readonly")
1025- core.PuregoSafeRegister(&xUnixMountPointIsUserMountable, libs, "g_unix_mount_point_is_user_mountable")
1026-
1027- core.PuregoSafeRegister(&xUnixMountMonitorGLibType, libs, "g_unix_mount_monitor_get_type")
1028-
1029- core.PuregoSafeRegister(&xNewUnixMountMonitor, libs, "g_unix_mount_monitor_new")
1030-
1031- core.PuregoSafeRegister(&xUnixMountMonitorSetRateLimit, libs, "g_unix_mount_monitor_set_rate_limit")
1032-
1033- core.PuregoSafeRegister(&xUnixMountMonitorGet, libs, "g_unix_mount_monitor_get")
1034-
1035-}
D v4/gio/gunixoutputstream.go +0 -367
@@ -1,367 +0,0 @@
1-// Package gio was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT
2-package gio
3-
4-import (
5- "structs"
6- "unsafe"
7-
8- "github.com/jwijenbergh/purego"
9- "github.com/jwijenbergh/puregotk/pkg/core"
10- "github.com/jwijenbergh/puregotk/v4/glib"
11- "github.com/jwijenbergh/puregotk/v4/gobject/types"
12-)
13-
14-type UnixOutputStreamClass struct {
15- _ structs.HostLayout
16-
17- ParentClass OutputStreamClass
18-
19- xGReserved1 uintptr
20-
21- xGReserved2 uintptr
22-
23- xGReserved3 uintptr
24-
25- xGReserved4 uintptr
26-
27- xGReserved5 uintptr
28-}
29-
30-func (x *UnixOutputStreamClass) GoPointer() uintptr {
31- return uintptr(unsafe.Pointer(x))
32-}
33-
34-// OverrideGReserved1 sets the callback function.
35-func (x *UnixOutputStreamClass) OverrideGReserved1(cb func()) {
36- if cb == nil {
37- x.xGReserved1 = 0
38- } else {
39- x.xGReserved1 = purego.NewCallback(func() {
40- cb()
41- })
42- }
43-}
44-
45-// GetGReserved1 gets the callback function.
46-func (x *UnixOutputStreamClass) GetGReserved1() func() {
47- if x.xGReserved1 == 0 {
48- return nil
49- }
50- var rawCallback func()
51- purego.RegisterFunc(&rawCallback, x.xGReserved1)
52- return func() {
53- rawCallback()
54- }
55-}
56-
57-// OverrideGReserved2 sets the callback function.
58-func (x *UnixOutputStreamClass) OverrideGReserved2(cb func()) {
59- if cb == nil {
60- x.xGReserved2 = 0
61- } else {
62- x.xGReserved2 = purego.NewCallback(func() {
63- cb()
64- })
65- }
66-}
67-
68-// GetGReserved2 gets the callback function.
69-func (x *UnixOutputStreamClass) GetGReserved2() func() {
70- if x.xGReserved2 == 0 {
71- return nil
72- }
73- var rawCallback func()
74- purego.RegisterFunc(&rawCallback, x.xGReserved2)
75- return func() {
76- rawCallback()
77- }
78-}
79-
80-// OverrideGReserved3 sets the callback function.
81-func (x *UnixOutputStreamClass) OverrideGReserved3(cb func()) {
82- if cb == nil {
83- x.xGReserved3 = 0
84- } else {
85- x.xGReserved3 = purego.NewCallback(func() {
86- cb()
87- })
88- }
89-}
90-
91-// GetGReserved3 gets the callback function.
92-func (x *UnixOutputStreamClass) GetGReserved3() func() {
93- if x.xGReserved3 == 0 {
94- return nil
95- }
96- var rawCallback func()
97- purego.RegisterFunc(&rawCallback, x.xGReserved3)
98- return func() {
99- rawCallback()
100- }
101-}
102-
103-// OverrideGReserved4 sets the callback function.
104-func (x *UnixOutputStreamClass) OverrideGReserved4(cb func()) {
105- if cb == nil {
106- x.xGReserved4 = 0
107- } else {
108- x.xGReserved4 = purego.NewCallback(func() {
109- cb()
110- })
111- }
112-}
113-
114-// GetGReserved4 gets the callback function.
115-func (x *UnixOutputStreamClass) GetGReserved4() func() {
116- if x.xGReserved4 == 0 {
117- return nil
118- }
119- var rawCallback func()
120- purego.RegisterFunc(&rawCallback, x.xGReserved4)
121- return func() {
122- rawCallback()
123- }
124-}
125-
126-// OverrideGReserved5 sets the callback function.
127-func (x *UnixOutputStreamClass) OverrideGReserved5(cb func()) {
128- if cb == nil {
129- x.xGReserved5 = 0
130- } else {
131- x.xGReserved5 = purego.NewCallback(func() {
132- cb()
133- })
134- }
135-}
136-
137-// GetGReserved5 gets the callback function.
138-func (x *UnixOutputStreamClass) GetGReserved5() func() {
139- if x.xGReserved5 == 0 {
140- return nil
141- }
142- var rawCallback func()
143- purego.RegisterFunc(&rawCallback, x.xGReserved5)
144- return func() {
145- rawCallback()
146- }
147-}
148-
149-type UnixOutputStreamPrivate struct {
150- _ structs.HostLayout
151-}
152-
153-func (x *UnixOutputStreamPrivate) GoPointer() uintptr {
154- return uintptr(unsafe.Pointer(x))
155-}
156-
157-// `GUnixOutputStream` implements [class@Gio.OutputStream] for writing to a UNIX
158-// file descriptor, including asynchronous operations. (If the file
159-// descriptor refers to a socket or pipe, this will use `poll()` to do
160-// asynchronous I/O. If it refers to a regular file, it will fall back
161-// to doing asynchronous I/O in another thread.)
162-//
163-// Note that `&lt;gio/gunixoutputstream.h&gt;` belongs to the UNIX-specific GIO
164-// interfaces, thus you have to use the `gio-unix-2.0.pc` pkg-config file
165-// file or the `GioUnix-2.0` GIR namespace when using it.
166-type UnixOutputStream struct {
167- OutputStream
168-}
169-
170-var xUnixOutputStreamGLibType func() types.GType
171-
172-func UnixOutputStreamGLibType() types.GType {
173- return xUnixOutputStreamGLibType()
174-}
175-
176-func UnixOutputStreamNewFromInternalPtr(ptr uintptr) *UnixOutputStream {
177- cls := &UnixOutputStream{}
178- cls.Ptr = ptr
179- return cls
180-}
181-
182-var xNewUnixOutputStream func(int, bool) uintptr
183-
184-// Creates a new #GUnixOutputStream for the given @fd.
185-//
186-// If @close_fd, is %TRUE, the file descriptor will be closed when
187-// the output stream is destroyed.
188-func NewUnixOutputStream(FdVar int, CloseFdVar bool) *UnixOutputStream {
189- var cls *UnixOutputStream
190-
191- cret := xNewUnixOutputStream(FdVar, CloseFdVar)
192-
193- if cret == 0 {
194- return nil
195- }
196- cls = &UnixOutputStream{}
197- cls.Ptr = cret
198- return cls
199-}
200-
201-var xUnixOutputStreamGetCloseFd func(uintptr) bool
202-
203-// Returns whether the file descriptor of @stream will be
204-// closed when the stream is closed.
205-func (x *UnixOutputStream) GetCloseFd() bool {
206-
207- cret := xUnixOutputStreamGetCloseFd(x.GoPointer())
208- return cret
209-}
210-
211-var xUnixOutputStreamGetFd func(uintptr) int
212-
213-// Return the UNIX file descriptor that the stream writes to.
214-func (x *UnixOutputStream) GetFd() int {
215-
216- cret := xUnixOutputStreamGetFd(x.GoPointer())
217- return cret
218-}
219-
220-var xUnixOutputStreamSetCloseFd func(uintptr, bool)
221-
222-// Sets whether the file descriptor of @stream shall be closed
223-// when the stream is closed.
224-func (x *UnixOutputStream) SetCloseFd(CloseFdVar bool) {
225-
226- xUnixOutputStreamSetCloseFd(x.GoPointer(), CloseFdVar)
227-
228-}
229-
230-func (c *UnixOutputStream) GoPointer() uintptr {
231- if c == nil {
232- return 0
233- }
234- return c.Ptr
235-}
236-
237-func (c *UnixOutputStream) SetGoPointer(ptr uintptr) {
238- c.Ptr = ptr
239-}
240-
241-// Checks if @stream is actually pollable. Some classes may implement
242-// #GPollableOutputStream but have only certain instances of that
243-// class be pollable. If this method returns %FALSE, then the behavior
244-// of other #GPollableOutputStream methods is undefined.
245-//
246-// For any given stream, the value returned by this method is constant;
247-// a stream cannot switch from pollable to non-pollable or vice versa.
248-func (x *UnixOutputStream) CanPoll() bool {
249-
250- cret := XGPollableOutputStreamCanPoll(x.GoPointer())
251- return cret
252-}
253-
254-// Creates a #GSource that triggers when @stream can be written, or
255-// @cancellable is triggered or an error occurs. The callback on the
256-// source is of the #GPollableSourceFunc type.
257-//
258-// As with g_pollable_output_stream_is_writable(), it is possible that
259-// the stream may not actually be writable even after the source
260-// triggers, so you should use g_pollable_output_stream_write_nonblocking()
261-// rather than g_output_stream_write() from the callback.
262-//
263-// The behaviour of this method is undefined if
264-// g_pollable_output_stream_can_poll() returns %FALSE for @stream.
265-func (x *UnixOutputStream) CreateSource(CancellableVar *Cancellable) *glib.Source {
266-
267- cret := XGPollableOutputStreamCreateSource(x.GoPointer(), CancellableVar.GoPointer())
268- return cret
269-}
270-
271-// Checks if @stream can be written.
272-//
273-// Note that some stream types may not be able to implement this 100%
274-// reliably, and it is possible that a call to g_output_stream_write()
275-// after this returns %TRUE would still block. To guarantee
276-// non-blocking behavior, you should always use
277-// g_pollable_output_stream_write_nonblocking(), which will return a
278-// %G_IO_ERROR_WOULD_BLOCK error rather than blocking.
279-//
280-// The behaviour of this method is undefined if
281-// g_pollable_output_stream_can_poll() returns %FALSE for @stream.
282-func (x *UnixOutputStream) IsWritable() bool {
283-
284- cret := XGPollableOutputStreamIsWritable(x.GoPointer())
285- return cret
286-}
287-
288-// Attempts to write up to @count bytes from @buffer to @stream, as
289-// with g_output_stream_write(). If @stream is not currently writable,
290-// this will immediately return %G_IO_ERROR_WOULD_BLOCK, and you can
291-// use g_pollable_output_stream_create_source() to create a #GSource
292-// that will be triggered when @stream is writable.
293-//
294-// Note that since this method never blocks, you cannot actually
295-// use @cancellable to cancel it. However, it will return an error
296-// if @cancellable has already been cancelled when you call, which
297-// may happen if you call this method after a source triggers due
298-// to having been cancelled.
299-//
300-// Also note that if %G_IO_ERROR_WOULD_BLOCK is returned some underlying
301-// transports like D/TLS require that you re-send the same @buffer and
302-// @count in the next write call.
303-//
304-// The behaviour of this method is undefined if
305-// g_pollable_output_stream_can_poll() returns %FALSE for @stream.
306-func (x *UnixOutputStream) WriteNonblocking(BufferVar []byte, CountVar uint, CancellableVar *Cancellable) (int, error) {
307- var cerr *glib.Error
308-
309- cret := XGPollableOutputStreamWriteNonblocking(x.GoPointer(), BufferVar, CountVar, CancellableVar.GoPointer(), &cerr)
310- if cerr == nil {
311- return cret, nil
312- }
313- return cret, cerr
314-
315-}
316-
317-// Attempts to write the bytes contained in the @n_vectors @vectors to @stream,
318-// as with g_output_stream_writev(). If @stream is not currently writable,
319-// this will immediately return %@G_POLLABLE_RETURN_WOULD_BLOCK, and you can
320-// use g_pollable_output_stream_create_source() to create a #GSource
321-// that will be triggered when @stream is writable. @error will *not* be
322-// set in that case.
323-//
324-// Note that since this method never blocks, you cannot actually
325-// use @cancellable to cancel it. However, it will return an error
326-// if @cancellable has already been cancelled when you call, which
327-// may happen if you call this method after a source triggers due
328-// to having been cancelled.
329-//
330-// Also note that if %G_POLLABLE_RETURN_WOULD_BLOCK is returned some underlying
331-// transports like D/TLS require that you re-send the same @vectors and
332-// @n_vectors in the next write call.
333-//
334-// The behaviour of this method is undefined if
335-// g_pollable_output_stream_can_poll() returns %FALSE for @stream.
336-func (x *UnixOutputStream) WritevNonblocking(VectorsVar []OutputVector, NVectorsVar uint, BytesWrittenVar uint, CancellableVar *Cancellable) (PollableReturn, error) {
337- var cerr *glib.Error
338-
339- cret := XGPollableOutputStreamWritevNonblocking(x.GoPointer(), VectorsVar, NVectorsVar, BytesWrittenVar, CancellableVar.GoPointer(), &cerr)
340- if cerr == nil {
341- return cret, nil
342- }
343- return cret, cerr
344-
345-}
346-
347-func init() {
348- core.SetPackageName("GIO", "gio-2.0")
349- core.SetSharedLibraries("GIO", []string{"libgio-2.0.so.0"})
350- var libs []uintptr
351- for _, libPath := range core.GetPaths("GIO") {
352- lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
353- if err != nil {
354- panic(err)
355- }
356- libs = append(libs, lib)
357- }
358-
359- core.PuregoSafeRegister(&xUnixOutputStreamGLibType, libs, "g_unix_output_stream_get_type")
360-
361- core.PuregoSafeRegister(&xNewUnixOutputStream, libs, "g_unix_output_stream_new")
362-
363- core.PuregoSafeRegister(&xUnixOutputStreamGetCloseFd, libs, "g_unix_output_stream_get_close_fd")
364- core.PuregoSafeRegister(&xUnixOutputStreamGetFd, libs, "g_unix_output_stream_get_fd")
365- core.PuregoSafeRegister(&xUnixOutputStreamSetCloseFd, libs, "g_unix_output_stream_set_close_fd")
366-
367-}
M v4/gio/gzlibcompressor.go +28 -7
@@ -42,7 +42,7 @@ func ZlibCompressorNewFromInternalPtr(ptr uintptr) *ZlibCompressor {
4242
4343 var xNewZlibCompressor func(ZlibCompressorFormat, int) uintptr
4444
45-// Creates a new #GZlibCompressor.
45+// Creates a compressor.
4646 func NewZlibCompressor(FormatVar ZlibCompressorFormat, LevelVar int) *ZlibCompressor {
4747 var cls *ZlibCompressor
4848
@@ -58,7 +58,7 @@ func NewZlibCompressor(FormatVar ZlibCompressorFormat, LevelVar int) *ZlibCompre
5858
5959 var xZlibCompressorGetFileInfo func(uintptr) uintptr
6060
61-// Returns the #GZlibCompressor:file-info property.
61+// Gets the [property@Gio.ZlibCompressor:file-info] property.
6262 func (x *ZlibCompressor) GetFileInfo() *FileInfo {
6363 var cls *FileInfo
6464
@@ -73,22 +73,41 @@ func (x *ZlibCompressor) GetFileInfo() *FileInfo {
7373 return cls
7474 }
7575
76+var xZlibCompressorGetOs func(uintptr) int
77+
78+// Gets the [property@Gio.ZlibCompressor:os] property.
79+func (x *ZlibCompressor) GetOs() int {
80+
81+ cret := xZlibCompressorGetOs(x.GoPointer())
82+ return cret
83+}
84+
7685 var xZlibCompressorSetFileInfo func(uintptr, uintptr)
7786
78-// Sets @file_info in @compressor. If non-%NULL, and @compressor's
79-// #GZlibCompressor:format property is %G_ZLIB_COMPRESSOR_FORMAT_GZIP,
80-// it will be used to set the file name and modification time in
81-// the GZIP header of the compressed data.
87+// Sets the [property@Gio.ZlibCompressor:file-info] property.
8288 //
8389 // Note: it is an error to call this function while a compression is in
8490 // progress; it may only be called immediately after creation of @compressor,
85-// or after resetting it with g_converter_reset().
91+// or after resetting it with [method@Gio.Converter.reset].
8692 func (x *ZlibCompressor) SetFileInfo(FileInfoVar *FileInfo) {
8793
8894 xZlibCompressorSetFileInfo(x.GoPointer(), FileInfoVar.GoPointer())
8995
9096 }
9197
98+var xZlibCompressorSetOs func(uintptr, int)
99+
100+// Sets the [property@Gio.ZlibCompressor:os] property.
101+//
102+// Note: it is an error to call this function while a compression is in
103+// progress; it may only be called immediately after creation of @compressor,
104+// or after resetting it with [method@Gio.Converter.reset].
105+func (x *ZlibCompressor) SetOs(OsVar int) {
106+
107+ xZlibCompressorSetOs(x.GoPointer(), OsVar)
108+
109+}
110+
92111 func (c *ZlibCompressor) GoPointer() uintptr {
93112 if c == nil {
94113 return 0
@@ -231,6 +250,8 @@ func init() {
231250 core.PuregoSafeRegister(&xNewZlibCompressor, libs, "g_zlib_compressor_new")
232251
233252 core.PuregoSafeRegister(&xZlibCompressorGetFileInfo, libs, "g_zlib_compressor_get_file_info")
253+ core.PuregoSafeRegister(&xZlibCompressorGetOs, libs, "g_zlib_compressor_get_os")
234254 core.PuregoSafeRegister(&xZlibCompressorSetFileInfo, libs, "g_zlib_compressor_set_file_info")
255+ core.PuregoSafeRegister(&xZlibCompressorSetOs, libs, "g_zlib_compressor_set_os")
235256
236257 }
M v4/gio/gzlibdecompressor.go +2 -6
@@ -42,7 +42,7 @@ func ZlibDecompressorNewFromInternalPtr(ptr uintptr) *ZlibDecompressor {
4242
4343 var xNewZlibDecompressor func(ZlibCompressorFormat) uintptr
4444
45-// Creates a new #GZlibDecompressor.
45+// Creates a new decompressor.
4646 func NewZlibDecompressor(FormatVar ZlibCompressorFormat) *ZlibDecompressor {
4747 var cls *ZlibDecompressor
4848
@@ -58,11 +58,7 @@ func NewZlibDecompressor(FormatVar ZlibCompressorFormat) *ZlibDecompressor {
5858
5959 var xZlibDecompressorGetFileInfo func(uintptr) uintptr
6060
61-// Retrieves the #GFileInfo constructed from the GZIP header data
62-// of compressed data processed by @compressor, or %NULL if @decompressor's
63-// #GZlibDecompressor:format property is not %G_ZLIB_COMPRESSOR_FORMAT_GZIP,
64-// or the header data was not fully processed yet, or it not present in the
65-// data stream at all.
61+// Gets the [property@Gio.ZlibDecompressor:file-info] property.
6662 func (x *ZlibDecompressor) GetFileInfo() *FileInfo {
6763 var cls *FileInfo
6864
M v4/glib/garray.go +99 -92
@@ -10,7 +10,7 @@ import (
1010 "github.com/jwijenbergh/puregotk/v4/gobject/types"
1111 )
1212
13-// Contains the public fields of a GArray.
13+// Contains the public fields of a `GArray`.
1414 type Array struct {
1515 _ structs.HostLayout
1616
@@ -29,7 +29,7 @@ func (x *Array) GoPointer() uintptr {
2929 return uintptr(unsafe.Pointer(x))
3030 }
3131
32-// Contains the public fields of a GByteArray.
32+// Contains the public fields of a `GByteArray`.
3333 type ByteArray struct {
3434 _ structs.HostLayout
3535
@@ -331,7 +331,7 @@ func (x *Bytes) UnrefToData(SizeVar uint) uintptr {
331331 return cret
332332 }
333333
334-// Contains the public fields of a pointer array.
334+// Contains the public fields of a `GPtrArray`.
335335 type PtrArray struct {
336336 _ structs.HostLayout
337337
@@ -352,22 +352,23 @@ func (x *PtrArray) GoPointer() uintptr {
352352
353353 var xArrayNewTake func(uintptr, uint, bool, uint) uintptr
354354
355-// Creates a new #GArray with @data as array data, @len as length and a
355+// Creates a new `GArray` with @data as array data, @len as length and a
356356 // reference count of 1.
357357 //
358358 // This avoids having to copy the data manually, when it can just be
359359 // inherited.
360-// After this call, @data belongs to the #GArray and may no longer be
360+// After this call, @data belongs to the `GArray` and may no longer be
361361 // modified by the caller. The memory of @data has to be dynamically
362-// allocated and will eventually be freed with g_free().
362+// allocated and will eventually be freed with [func@GLib.free].
363363 //
364364 // In case the elements need to be cleared when the array is freed, use
365-// g_array_set_clear_func() to set a #GDestroyNotify function to perform
366-// such task.
365+// [func@GLib.Array.set_clear_func] to set a [callback@GLib.DestroyNotify]
366+// function to perform such task.
367+//
368+// Do not use it if @len or @element_size are greater than
367369 //
368-// Do not use it if @len or @element_size are greater than %G_MAXUINT.
369-// #GArray stores the length of its data in #guint, which may be shorter
370-// than #gsize.
370+// [`G_MAXUINT`](types.html#guint). `GArray` stores the length of its data in
371+// `guint`, which may be shorter than `gsize`.
371372 func ArrayNewTake(DataVar uintptr, LenVar uint, ClearVar bool, ElementSizeVar uint) uintptr {
372373
373374 cret := xArrayNewTake(DataVar, LenVar, ClearVar, ElementSizeVar)
@@ -376,48 +377,48 @@ func ArrayNewTake(DataVar uintptr, LenVar uint, ClearVar bool, ElementSizeVar ui
376377
377378 var xArrayNewTakeZeroTerminated func(uintptr, bool, uint) uintptr
378379
379-// Creates a new #GArray with @data as array data, computing the length of it
380+// Creates a new `GArray` with @data as array data, computing the length of it
380381 // and setting the reference count to 1.
381382 //
382383 // This avoids having to copy the data manually, when it can just be
383384 // inherited.
384-// After this call, @data belongs to the #GArray and may no longer be
385+// After this call, @data belongs to the `GArray` and may no longer be
385386 // modified by the caller. The memory of @data has to be dynamically
386-// allocated and will eventually be freed with g_free().
387+// allocated and will eventually be freed with [func@GLib.free].
387388 //
388-// The length is calculated by iterating through @data until the first %NULL
389+// The length is calculated by iterating through @data until the first `NULL`
389390 // element is found.
390391 //
391392 // In case the elements need to be cleared when the array is freed, use
392-// g_array_set_clear_func() to set a #GDestroyNotify function to perform
393-// such task.
393+// [func@GLib.Array.set_clear_func] to set a [callback@GLib.DestroyNotify]
394+// function to perform such task.
394395 //
395-// Do not use it if @data length or @element_size are greater than %G_MAXUINT.
396-// #GArray stores the length of its data in #guint, which may be shorter
397-// than #gsize.
396+// Do not use it if @data length or @element_size are greater than
397+// [`G_MAXUINT`](types.html#guint). `GArray` stores the length of its data in
398+// `guint`, which may be shorter than `gsize`.
398399 func ArrayNewTakeZeroTerminated(DataVar uintptr, ClearVar bool, ElementSizeVar uint) uintptr {
399400
400401 cret := xArrayNewTakeZeroTerminated(DataVar, ClearVar, ElementSizeVar)
401402 return cret
402403 }
403404
404-var xByteArrayAppend func([]byte, byte, uint) uintptr
405+var xByteArrayAppend func([]byte, []byte, uint) uintptr
405406
406-// Adds the given bytes to the end of the #GByteArray.
407+// Adds the given bytes to the end of the `GByteArray`.
407408 // The array will grow in size automatically if necessary.
408-func ByteArrayAppend(ArrayVar []byte, DataVar byte, LenVar uint) uintptr {
409+func ByteArrayAppend(ArrayVar []byte, DataVar []byte, LenVar uint) uintptr {
409410
410411 cret := xByteArrayAppend(ArrayVar, DataVar, LenVar)
411412 return cret
412413 }
413414
414-var xByteArrayFree func([]byte, bool) byte
415+var xByteArrayFree func([]byte, bool) uintptr
415416
416-// Frees the memory allocated by the #GByteArray. If @free_segment is
417-// %TRUE it frees the actual byte data. If the reference count of
418-// @array is greater than one, the #GByteArray wrapper is preserved but
417+// Frees the memory allocated by the `GByteArray`. If @free_segment is
418+// true it frees the actual byte data. If the reference count of
419+// @array is greater than one, the `GByteArray` wrapper is preserved but
419420 // the size of @array will be set to zero.
420-func ByteArrayFree(ArrayVar []byte, FreeSegmentVar bool) byte {
421+func ByteArrayFree(ArrayVar []byte, FreeSegmentVar bool) uintptr {
421422
422423 cret := xByteArrayFree(ArrayVar, FreeSegmentVar)
423424 return cret
@@ -425,14 +426,15 @@ func ByteArrayFree(ArrayVar []byte, FreeSegmentVar bool) byte {
425426
426427 var xByteArrayFreeToBytes func([]byte) *Bytes
427428
428-// Transfers the data from the #GByteArray into a new immutable #GBytes.
429+// Transfers the data from the `GByteArray` into a new immutable
430+// [struct@GLib.Bytes].
429431 //
430-// The #GByteArray is freed unless the reference count of @array is greater
431-// than one, the #GByteArray wrapper is preserved but the size of @array
432-// will be set to zero.
432+// The `GByteArray` is freed unless the reference count of @array is greater
433+// than one, in which the `GByteArray` wrapper is preserved but the size of
434+// @array will be set to zero.
433435 //
434-// This is identical to using g_bytes_new_take() and g_byte_array_free()
435-// together.
436+// This is identical to using [ctor@GLib.Bytes.new_take] and
437+// [func@GLib.ByteArray.free] together.
436438 func ByteArrayFreeToBytes(ArrayVar []byte) *Bytes {
437439
438440 cret := xByteArrayFreeToBytes(ArrayVar)
@@ -441,7 +443,7 @@ func ByteArrayFreeToBytes(ArrayVar []byte) *Bytes {
441443
442444 var xByteArrayNew func() uintptr
443445
444-// Creates a new #GByteArray with a reference count of 1.
446+// Creates a new `GByteArray` with a reference count of 1.
445447 func ByteArrayNew() uintptr {
446448
447449 cret := xByteArrayNew()
@@ -451,24 +453,24 @@ func ByteArrayNew() uintptr {
451453 var xByteArrayNewTake func([]byte, uint) uintptr
452454
453455 // Creates a byte array containing the @data.
454-// After this call, @data belongs to the #GByteArray and may no longer be
456+// After this call, @data belongs to the `GByteArray` and may no longer be
455457 // modified by the caller. The memory of @data has to be dynamically
456-// allocated and will eventually be freed with g_free().
458+// allocated and will eventually be freed with [func@GLib.free].
457459 //
458-// Do not use it if @len is greater than %G_MAXUINT. #GByteArray
459-// stores the length of its data in #guint, which may be shorter than
460-// #gsize.
460+// Do not use it if @len is greater than [`G_MAXUINT`](types.html#guint).
461+// `GByteArray` stores the length of its data in `guint`, which may be shorter
462+// than `gsize`.
461463 func ByteArrayNewTake(DataVar []byte, LenVar uint) uintptr {
462464
463465 cret := xByteArrayNewTake(DataVar, LenVar)
464466 return cret
465467 }
466468
467-var xByteArrayPrepend func([]byte, byte, uint) uintptr
469+var xByteArrayPrepend func([]byte, []byte, uint) uintptr
468470
469-// Adds the given data to the start of the #GByteArray.
471+// Adds the given data to the start of the `GByteArray`.
470472 // The array will grow in size automatically if necessary.
471-func ByteArrayPrepend(ArrayVar []byte, DataVar byte, LenVar uint) uintptr {
473+func ByteArrayPrepend(ArrayVar []byte, DataVar []byte, LenVar uint) uintptr {
472474
473475 cret := xByteArrayPrepend(ArrayVar, DataVar, LenVar)
474476 return cret
@@ -486,7 +488,7 @@ func ByteArrayRef(ArrayVar []byte) uintptr {
486488
487489 var xByteArrayRemoveIndex func([]byte, uint) uintptr
488490
489-// Removes the byte at the given index from a #GByteArray.
491+// Removes the byte at the given index from a `GByteArray`.
490492 // The following bytes are moved down one place.
491493 func ByteArrayRemoveIndex(ArrayVar []byte, IndexVar uint) uintptr {
492494
@@ -496,10 +498,10 @@ func ByteArrayRemoveIndex(ArrayVar []byte, IndexVar uint) uintptr {
496498
497499 var xByteArrayRemoveIndexFast func([]byte, uint) uintptr
498500
499-// Removes the byte at the given index from a #GByteArray. The last
501+// Removes the byte at the given index from a `GByteArray`. The last
500502 // element in the array is used to fill in the space, so this function
501-// does not preserve the order of the #GByteArray. But it is faster
502-// than g_byte_array_remove_index().
503+// does not preserve the order of the `GByteArray`. But it is faster
504+// than [func@GLib.ByteArray.remove_index].
503505 func ByteArrayRemoveIndexFast(ArrayVar []byte, IndexVar uint) uintptr {
504506
505507 cret := xByteArrayRemoveIndexFast(ArrayVar, IndexVar)
@@ -509,7 +511,7 @@ func ByteArrayRemoveIndexFast(ArrayVar []byte, IndexVar uint) uintptr {
509511 var xByteArrayRemoveRange func([]byte, uint, uint) uintptr
510512
511513 // Removes the given number of bytes starting at the given index from a
512-// #GByteArray. The following elements are moved to close the gap.
514+// `GByteArray`. The following elements are moved to close the gap.
513515 func ByteArrayRemoveRange(ArrayVar []byte, IndexVar uint, LengthVar uint) uintptr {
514516
515517 cret := xByteArrayRemoveRange(ArrayVar, IndexVar, LengthVar)
@@ -518,7 +520,7 @@ func ByteArrayRemoveRange(ArrayVar []byte, IndexVar uint, LengthVar uint) uintpt
518520
519521 var xByteArraySetSize func([]byte, uint) uintptr
520522
521-// Sets the size of the #GByteArray, expanding it if necessary.
523+// Sets the size of the `GByteArray`, expanding it if necessary.
522524 func ByteArraySetSize(ArrayVar []byte, LengthVar uint) uintptr {
523525
524526 cret := xByteArraySetSize(ArrayVar, LengthVar)
@@ -527,7 +529,7 @@ func ByteArraySetSize(ArrayVar []byte, LengthVar uint) uintptr {
527529
528530 var xByteArraySizedNew func(uint) uintptr
529531
530-// Creates a new #GByteArray with @reserved_size bytes preallocated.
532+// Creates a new `GByteArray` with @reserved_size bytes preallocated.
531533 // This avoids frequent reallocation, if you are going to add many
532534 // bytes to the array. Note however that the size of the array is still
533535 // 0.
@@ -540,7 +542,7 @@ func ByteArraySizedNew(ReservedSizeVar uint) uintptr {
540542 var xByteArraySort func([]byte, uintptr)
541543
542544 // Sorts a byte array, using @compare_func which should be a
543-// qsort()-style comparison function (returns less than zero for first
545+// `qsort()`-style comparison function (returns less than zero for first
544546 // arg is less than second arg, zero for equal, greater than zero if
545547 // first arg is greater than second arg).
546548 //
@@ -557,7 +559,7 @@ func ByteArraySort(ArrayVar []byte, CompareFuncVar *CompareFunc) {
557559
558560 var xByteArraySortWithData func([]byte, uintptr, uintptr)
559561
560-// Like g_byte_array_sort(), but the comparison function takes an extra
562+// Like [func@GLib.ByteArray.sort], but the comparison function takes an extra
561563 // user data argument.
562564 func ByteArraySortWithData(ArrayVar []byte, CompareFuncVar *CompareDataFunc, UserDataVar uintptr) {
563565
@@ -565,12 +567,12 @@ func ByteArraySortWithData(ArrayVar []byte, CompareFuncVar *CompareDataFunc, Use
565567
566568 }
567569
568-var xByteArraySteal func([]byte, uint) byte
570+var xByteArraySteal func([]byte, uint) uintptr
569571
570572 // Frees the data in the array and resets the size to zero, while
571573 // the underlying array is preserved for use elsewhere and returned
572574 // to the caller.
573-func ByteArraySteal(ArrayVar []byte, LenVar uint) byte {
575+func ByteArraySteal(ArrayVar []byte, LenVar uint) uintptr {
574576
575577 cret := xByteArraySteal(ArrayVar, LenVar)
576578 return cret
@@ -590,13 +592,14 @@ func ByteArrayUnref(ArrayVar []byte) {
590592
591593 var xPtrArrayFind func([]uintptr, uintptr, uint) bool
592594
593-// Checks whether @needle exists in @haystack. If the element is found, %TRUE is
594-// returned and the element’s index is returned in @index_ (if non-%NULL).
595-// Otherwise, %FALSE is returned and @index_ is undefined. If @needle exists
595+// Checks whether @needle exists in @haystack. If the element is found, true
596+// is returned and the element’s index is returned in @index_ (if non-`NULL`).
597+// Otherwise, false is returned and @index_ is undefined. If @needle exists
596598 // multiple times in @haystack, the index of the first instance is returned.
597599 //
598600 // This does pointer comparisons only. If you want to use more complex equality
599-// checks, such as string comparisons, use g_ptr_array_find_with_equal_func().
601+// checks, such as string comparisons, use
602+// [func@GLib.PtrArray.find_with_equal_func].
600603 func PtrArrayFind(HaystackVar []uintptr, NeedleVar uintptr, IndexVar uint) bool {
601604
602605 cret := xPtrArrayFind(HaystackVar, NeedleVar, IndexVar)
@@ -606,13 +609,13 @@ func PtrArrayFind(HaystackVar []uintptr, NeedleVar uintptr, IndexVar uint) bool
606609 var xPtrArrayFindWithEqualFunc func([]uintptr, uintptr, uintptr, uint) bool
607610
608611 // Checks whether @needle exists in @haystack, using the given @equal_func.
609-// If the element is found, %TRUE is returned and the element’s index is
610-// returned in @index_ (if non-%NULL). Otherwise, %FALSE is returned and @index_
612+// If the element is found, true is returned and the element’s index is
613+// returned in @index_ (if non-`NULL`). Otherwise, false is returned and @index_
611614 // is undefined. If @needle exists multiple times in @haystack, the index of
612615 // the first instance is returned.
613616 //
614617 // @equal_func is called with the element from the array as its first parameter,
615-// and @needle as its second parameter. If @equal_func is %NULL, pointer
618+// and @needle as its second parameter. If @equal_func is `NULL`, pointer
616619 // equality is used.
617620 func PtrArrayFindWithEqualFunc(HaystackVar []uintptr, NeedleVar uintptr, EqualFuncVar *EqualFunc, IndexVar uint) bool {
618621
@@ -622,22 +625,23 @@ func PtrArrayFindWithEqualFunc(HaystackVar []uintptr, NeedleVar uintptr, EqualFu
622625
623626 var xPtrArrayNewFromArray func([]uintptr, uint, uintptr, uintptr, uintptr) uintptr
624627
625-// Creates a new #GPtrArray, copying @len pointers from @data, and setting
628+// Creates a new `GPtrArray`, copying @len pointers from @data, and setting
626629 // the array’s reference count to 1.
627630 //
628631 // This avoids having to manually add each element one by one.
629632 //
630633 // If @copy_func is provided, then it is used to copy each element before
631-// adding them to the new array. If it is %NULL then the pointers are copied
634+// adding them to the new array. If it is `NULL` then the pointers are copied
632635 // directly.
633636 //
634637 // It also sets @element_free_func for freeing each element when the array is
635-// destroyed either via g_ptr_array_unref(), when g_ptr_array_free() is called
636-// with @free_segment set to %TRUE or when removing elements.
638+// destroyed either via [func@GLib.PtrArray.unref], when
639+// [func@GLib.PtrArray.free] is called with @free_segment set to true or when
640+// removing elements.
637641 //
638-// Do not use it if @len is greater than %G_MAXUINT. #GPtrArray
639-// stores the length of its data in #guint, which may be shorter than
640-// #gsize.
642+// Do not use it if @len is greater than [`G_MAXUINT`](types.html#guint).
643+// `GPtrArray` stores the length of its data in `guint`, which may be shorter
644+// than `gsize`.
641645 func PtrArrayNewFromArray(DataVar []uintptr, LenVar uint, CopyFuncVar *CopyFunc, CopyFuncUserDataVar uintptr, ElementFreeFuncVar *DestroyNotify) uintptr {
642646
643647 cret := xPtrArrayNewFromArray(DataVar, LenVar, NewCallbackNullable(CopyFuncVar), CopyFuncUserDataVar, NewCallbackNullable(ElementFreeFuncVar))
@@ -646,18 +650,19 @@ func PtrArrayNewFromArray(DataVar []uintptr, LenVar uint, CopyFuncVar *CopyFunc,
646650
647651 var xPtrArrayNewFromNullTerminatedArray func([]uintptr, uintptr, uintptr, uintptr) uintptr
648652
649-// Creates a new #GPtrArray copying the pointers from @data after having
653+// Creates a new `GPtrArray` copying the pointers from @data after having
650654 // computed the length of it and with a reference count of 1.
651655 // This avoids having to manually add each element one by one.
652656 // If @copy_func is provided, then it is used to copy the data in the new
653657 // array.
654-// It also set @element_free_func for freeing each element when the array is
655-// destroyed either via g_ptr_array_unref(), when g_ptr_array_free() is called
656-// with @free_segment set to %TRUE or when removing elements.
658+// It also sets @element_free_func for freeing each element when the array is
659+// destroyed either via [func@GLib.PtrArray.unref], when
660+// [func@GLib.PtrArray.free] is called with @free_segment set to true or when
661+// removing elements.
657662 //
658-// Do not use it if the @data has more than %G_MAXUINT elements. #GPtrArray
659-// stores the length of its data in #guint, which may be shorter than
660-// #gsize.
663+// Do not use it if the @data has more than [`G_MAXUINT`](types.html#guint)
664+// elements. `GPtrArray` stores the length of its data in `guint`, which may be
665+// shorter than `gsize`.
661666 func PtrArrayNewFromNullTerminatedArray(DataVar []uintptr, CopyFuncVar *CopyFunc, CopyFuncUserDataVar uintptr, ElementFreeFuncVar *DestroyNotify) uintptr {
662667
663668 cret := xPtrArrayNewFromNullTerminatedArray(DataVar, NewCallbackNullable(CopyFuncVar), CopyFuncUserDataVar, NewCallbackNullable(ElementFreeFuncVar))
@@ -666,21 +671,22 @@ func PtrArrayNewFromNullTerminatedArray(DataVar []uintptr, CopyFuncVar *CopyFunc
666671
667672 var xPtrArrayNewTake func([]uintptr, uint, uintptr) uintptr
668673
669-// Creates a new #GPtrArray with @data as pointers, @len as length and a
674+// Creates a new `GPtrArray` with @data as pointers, @len as length and a
670675 // reference count of 1.
671676 //
672677 // This avoids having to copy such data manually.
673-// After this call, @data belongs to the #GPtrArray and may no longer be
678+// After this call, @data belongs to the `GPtrArray` and may no longer be
674679 // modified by the caller. The memory of @data has to be dynamically
675-// allocated and will eventually be freed with g_free().
680+// allocated and will eventually be freed with [func@GLib.free].
676681 //
677682 // It also sets @element_free_func for freeing each element when the array is
678-// destroyed either via g_ptr_array_unref(), when g_ptr_array_free() is called
679-// with @free_segment set to %TRUE or when removing elements.
683+// destroyed either via [func@GLib.PtrArray.unref], when
684+// [func@GLib.PtrArray.free] is called with @free_segment set to true or when
685+// removing elements.
680686 //
681-// Do not use it if @len is greater than %G_MAXUINT. #GPtrArray
682-// stores the length of its data in #guint, which may be shorter than
683-// #gsize.
687+// Do not use it if @len is greater than [`G_MAXUINT`](types.html#guint).
688+// `GPtrArray` stores the length of its data in `guint`, which may be shorter
689+// than `gsize`.
684690 func PtrArrayNewTake(DataVar []uintptr, LenVar uint, ElementFreeFuncVar *DestroyNotify) uintptr {
685691
686692 cret := xPtrArrayNewTake(DataVar, LenVar, NewCallbackNullable(ElementFreeFuncVar))
@@ -689,24 +695,25 @@ func PtrArrayNewTake(DataVar []uintptr, LenVar uint, ElementFreeFuncVar *Destroy
689695
690696 var xPtrArrayNewTakeNullTerminated func([]uintptr, uintptr) uintptr
691697
692-// Creates a new #GPtrArray with @data as pointers, computing the length of it
698+// Creates a new `GPtrArray` with @data as pointers, computing the length of it
693699 // and setting the reference count to 1.
694700 //
695701 // This avoids having to copy such data manually.
696-// After this call, @data belongs to the #GPtrArray and may no longer be
702+// After this call, @data belongs to the `GPtrArray` and may no longer be
697703 // modified by the caller. The memory of @data has to be dynamically
698-// allocated and will eventually be freed with g_free().
704+// allocated and will eventually be freed with [func@GLib.free].
699705 //
700-// The length is calculated by iterating through @data until the first %NULL
706+// The length is calculated by iterating through @data until the first `NULL`
701707 // element is found.
702708 //
703709 // It also sets @element_free_func for freeing each element when the array is
704-// destroyed either via g_ptr_array_unref(), when g_ptr_array_free() is called
705-// with @free_segment set to %TRUE or when removing elements.
710+// destroyed either via [func@GLib.PtrArray.unref], when
711+// [func@GLib.PtrArray.free] is called with @free_segment set to true or when
712+// removing elements.
706713 //
707-// Do not use it if the @data length is greater than %G_MAXUINT. #GPtrArray
708-// stores the length of its data in #guint, which may be shorter than
709-// #gsize.
714+// Do not use it if the @data length is greater than
715+// [`G_MAXUINT`](types.html#guint). `GPtrArray` stores the length of its data
716+// in `guint`, which may be shorter than `gsize`.
710717 func PtrArrayNewTakeNullTerminated(DataVar []uintptr, ElementFreeFuncVar *DestroyNotify) uintptr {
711718
712719 cret := xPtrArrayNewTakeNullTerminated(DataVar, NewCallbackNullable(ElementFreeFuncVar))
M v4/glib/gatomic.go +24 -24
@@ -6,7 +6,7 @@ import (
66 "github.com/jwijenbergh/puregotk/pkg/core"
77 )
88
9-var xAtomicIntAdd func(int, int) int
9+var xAtomicIntAdd func(uintptr, int) int
1010
1111 // Atomically adds @val to the value of @atomic.
1212 //
@@ -20,13 +20,13 @@ var xAtomicIntAdd func(int, int) int
2020 //
2121 // While @atomic has a `volatile` qualifier, this is a historical artifact and
2222 // the pointer passed to it should not be `volatile`.
23-func AtomicIntAdd(AtomicVar int, ValVar int) int {
23+func AtomicIntAdd(AtomicVar uintptr, ValVar int) int {
2424
2525 cret := xAtomicIntAdd(AtomicVar, ValVar)
2626 return cret
2727 }
2828
29-var xAtomicIntAnd func(uint, uint) uint
29+var xAtomicIntAnd func(uintptr, uint) uint
3030
3131 // Performs an atomic bitwise 'and' of the value of @atomic and @val,
3232 // storing the result back in @atomic.
@@ -38,13 +38,13 @@ var xAtomicIntAnd func(uint, uint) uint
3838 //
3939 // While @atomic has a `volatile` qualifier, this is a historical artifact and
4040 // the pointer passed to it should not be `volatile`.
41-func AtomicIntAnd(AtomicVar uint, ValVar uint) uint {
41+func AtomicIntAnd(AtomicVar uintptr, ValVar uint) uint {
4242
4343 cret := xAtomicIntAnd(AtomicVar, ValVar)
4444 return cret
4545 }
4646
47-var xAtomicIntCompareAndExchange func(int, int, int) bool
47+var xAtomicIntCompareAndExchange func(uintptr, int, int) bool
4848
4949 // Compares @atomic to @oldval and, if equal, sets it to @newval.
5050 // If @atomic was not equal to @oldval then no change occurs.
@@ -58,13 +58,13 @@ var xAtomicIntCompareAndExchange func(int, int, int) bool
5858 //
5959 // While @atomic has a `volatile` qualifier, this is a historical artifact and
6060 // the pointer passed to it should not be `volatile`.
61-func AtomicIntCompareAndExchange(AtomicVar int, OldvalVar int, NewvalVar int) bool {
61+func AtomicIntCompareAndExchange(AtomicVar uintptr, OldvalVar int, NewvalVar int) bool {
6262
6363 cret := xAtomicIntCompareAndExchange(AtomicVar, OldvalVar, NewvalVar)
6464 return cret
6565 }
6666
67-var xAtomicIntCompareAndExchangeFull func(int, int, int, int) bool
67+var xAtomicIntCompareAndExchangeFull func(uintptr, int, int, int) bool
6868
6969 // Compares @atomic to @oldval and, if equal, sets it to @newval.
7070 // If @atomic was not equal to @oldval then no change occurs.
@@ -78,13 +78,13 @@ var xAtomicIntCompareAndExchangeFull func(int, int, int, int) bool
7878 // This call acts as a full compiler and hardware memory barrier.
7979 //
8080 // See also g_atomic_int_compare_and_exchange()
81-func AtomicIntCompareAndExchangeFull(AtomicVar int, OldvalVar int, NewvalVar int, PrevalVar int) bool {
81+func AtomicIntCompareAndExchangeFull(AtomicVar uintptr, OldvalVar int, NewvalVar int, PrevalVar int) bool {
8282
8383 cret := xAtomicIntCompareAndExchangeFull(AtomicVar, OldvalVar, NewvalVar, PrevalVar)
8484 return cret
8585 }
8686
87-var xAtomicIntDecAndTest func(int) bool
87+var xAtomicIntDecAndTest func(uintptr) bool
8888
8989 // Decrements the value of @atomic by 1.
9090 //
@@ -95,13 +95,13 @@ var xAtomicIntDecAndTest func(int) bool
9595 //
9696 // While @atomic has a `volatile` qualifier, this is a historical artifact and
9797 // the pointer passed to it should not be `volatile`.
98-func AtomicIntDecAndTest(AtomicVar int) bool {
98+func AtomicIntDecAndTest(AtomicVar uintptr) bool {
9999
100100 cret := xAtomicIntDecAndTest(AtomicVar)
101101 return cret
102102 }
103103
104-var xAtomicIntExchange func(int, int) int
104+var xAtomicIntExchange func(uintptr, int) int
105105
106106 // Sets the @atomic to @newval and returns the old value from @atomic.
107107 //
@@ -111,24 +111,24 @@ var xAtomicIntExchange func(int, int) int
111111 // `{ tmp = *atomic; *atomic = val; return tmp; }`.
112112 //
113113 // This call acts as a full compiler and hardware memory barrier.
114-func AtomicIntExchange(AtomicVar int, NewvalVar int) int {
114+func AtomicIntExchange(AtomicVar uintptr, NewvalVar int) int {
115115
116116 cret := xAtomicIntExchange(AtomicVar, NewvalVar)
117117 return cret
118118 }
119119
120-var xAtomicIntExchangeAndAdd func(int, int) int
120+var xAtomicIntExchangeAndAdd func(uintptr, int) int
121121
122122 // This function existed before g_atomic_int_add() returned the prior
123123 // value of the integer (which it now does). It is retained only for
124124 // compatibility reasons. Don't use this function in new code.
125-func AtomicIntExchangeAndAdd(AtomicVar int, ValVar int) int {
125+func AtomicIntExchangeAndAdd(AtomicVar uintptr, ValVar int) int {
126126
127127 cret := xAtomicIntExchangeAndAdd(AtomicVar, ValVar)
128128 return cret
129129 }
130130
131-var xAtomicIntGet func(int) int
131+var xAtomicIntGet func(uintptr) int
132132
133133 // Gets the current value of @atomic.
134134 //
@@ -137,13 +137,13 @@ var xAtomicIntGet func(int) int
137137 //
138138 // While @atomic has a `volatile` qualifier, this is a historical artifact and
139139 // the pointer passed to it should not be `volatile`.
140-func AtomicIntGet(AtomicVar int) int {
140+func AtomicIntGet(AtomicVar uintptr) int {
141141
142142 cret := xAtomicIntGet(AtomicVar)
143143 return cret
144144 }
145145
146-var xAtomicIntInc func(int)
146+var xAtomicIntInc func(uintptr)
147147
148148 // Increments the value of @atomic by 1.
149149 //
@@ -153,13 +153,13 @@ var xAtomicIntInc func(int)
153153 //
154154 // While @atomic has a `volatile` qualifier, this is a historical artifact and
155155 // the pointer passed to it should not be `volatile`.
156-func AtomicIntInc(AtomicVar int) {
156+func AtomicIntInc(AtomicVar uintptr) {
157157
158158 xAtomicIntInc(AtomicVar)
159159
160160 }
161161
162-var xAtomicIntOr func(uint, uint) uint
162+var xAtomicIntOr func(uintptr, uint) uint
163163
164164 // Performs an atomic bitwise 'or' of the value of @atomic and @val,
165165 // storing the result back in @atomic.
@@ -171,13 +171,13 @@ var xAtomicIntOr func(uint, uint) uint
171171 //
172172 // While @atomic has a `volatile` qualifier, this is a historical artifact and
173173 // the pointer passed to it should not be `volatile`.
174-func AtomicIntOr(AtomicVar uint, ValVar uint) uint {
174+func AtomicIntOr(AtomicVar uintptr, ValVar uint) uint {
175175
176176 cret := xAtomicIntOr(AtomicVar, ValVar)
177177 return cret
178178 }
179179
180-var xAtomicIntSet func(int, int)
180+var xAtomicIntSet func(uintptr, int)
181181
182182 // Sets the value of @atomic to @newval.
183183 //
@@ -186,13 +186,13 @@ var xAtomicIntSet func(int, int)
186186 //
187187 // While @atomic has a `volatile` qualifier, this is a historical artifact and
188188 // the pointer passed to it should not be `volatile`.
189-func AtomicIntSet(AtomicVar int, NewvalVar int) {
189+func AtomicIntSet(AtomicVar uintptr, NewvalVar int) {
190190
191191 xAtomicIntSet(AtomicVar, NewvalVar)
192192
193193 }
194194
195-var xAtomicIntXor func(uint, uint) uint
195+var xAtomicIntXor func(uintptr, uint) uint
196196
197197 // Performs an atomic bitwise 'xor' of the value of @atomic and @val,
198198 // storing the result back in @atomic.
@@ -204,7 +204,7 @@ var xAtomicIntXor func(uint, uint) uint
204204 //
205205 // While @atomic has a `volatile` qualifier, this is a historical artifact and
206206 // the pointer passed to it should not be `volatile`.
207-func AtomicIntXor(AtomicVar uint, ValVar uint) uint {
207+func AtomicIntXor(AtomicVar uintptr, ValVar uint) uint {
208208
209209 cret := xAtomicIntXor(AtomicVar, ValVar)
210210 return cret
M v4/glib/gbacktrace.go +2 -2
@@ -56,7 +56,7 @@ var xOnErrorQuery func(string)
5656 // This function may cause different actions on non-UNIX platforms.
5757 //
5858 // On Windows consider using the `G_DEBUGGER` environment
59-// variable (see [Running GLib Applications](glib-running.html)) and
59+// variable (see [Running GLib Applications](running.html)) and
6060 // calling g_on_error_stack_trace() instead.
6161 func OnErrorQuery(PrgNameVar string) {
6262
@@ -78,7 +78,7 @@ var xOnErrorStackTrace func(string)
7878 // g_on_error_query(). If called directly, it will raise an
7979 // exception, which will crash the program. If the `G_DEBUGGER` environment
8080 // variable is set, a debugger will be invoked to attach and
81-// handle that exception (see [Running GLib Applications](glib-running.html)).
81+// handle that exception (see [Running GLib Applications](running.html)).
8282 func OnErrorStackTrace(PrgNameVar string) {
8383
8484 xOnErrorStackTrace(PrgNameVar)
M v4/glib/gbitlock.go +37 -6
@@ -6,7 +6,7 @@ import (
66 "github.com/jwijenbergh/puregotk/pkg/core"
77 )
88
9-var xBitLock func(int, int)
9+var xBitLock func(uintptr, int)
1010
1111 // Sets the indicated @lock_bit in @address. If the bit is already
1212 // set, this call will block until g_bit_unlock() unsets the
@@ -22,13 +22,26 @@ var xBitLock func(int, int)
2222 // @address must be atomic in order for this function to work
2323 // reliably. While @address has a `volatile` qualifier, this is a historical
2424 // artifact and the argument passed to it should not be `volatile`.
25-func BitLock(AddressVar int, LockBitVar int) {
25+func BitLock(AddressVar uintptr, LockBitVar int) {
2626
2727 xBitLock(AddressVar, LockBitVar)
2828
2929 }
3030
31-var xBitTrylock func(int, int) bool
31+var xBitLockAndGet func(uintptr, uint, int)
32+
33+// Sets the indicated @lock_bit in @address and atomically returns the new value.
34+//
35+// This is like [func@GLib.bit_lock], except it can atomically return the new value at
36+// @address (right after obtaining the lock). Thus the value returned in @out_val
37+// always has the @lock_bit set.
38+func BitLockAndGet(AddressVar uintptr, LockBitVar uint, OutValVar int) {
39+
40+ xBitLockAndGet(AddressVar, LockBitVar, OutValVar)
41+
42+}
43+
44+var xBitTrylock func(uintptr, int) bool
3245
3346 // Sets the indicated @lock_bit in @address, returning %TRUE if
3447 // successful. If the bit is already set, returns %FALSE immediately.
@@ -43,13 +56,13 @@ var xBitTrylock func(int, int) bool
4356 // @address must be atomic in order for this function to work
4457 // reliably. While @address has a `volatile` qualifier, this is a historical
4558 // artifact and the argument passed to it should not be `volatile`.
46-func BitTrylock(AddressVar int, LockBitVar int) bool {
59+func BitTrylock(AddressVar uintptr, LockBitVar int) bool {
4760
4861 cret := xBitTrylock(AddressVar, LockBitVar)
4962 return cret
5063 }
5164
52-var xBitUnlock func(int, int)
65+var xBitUnlock func(uintptr, int)
5366
5467 // Clears the indicated @lock_bit in @address. If another thread is
5568 // currently blocked in g_bit_lock() on this same bit then it will be
@@ -59,12 +72,28 @@ var xBitUnlock func(int, int)
5972 // @address must be atomic in order for this function to work
6073 // reliably. While @address has a `volatile` qualifier, this is a historical
6174 // artifact and the argument passed to it should not be `volatile`.
62-func BitUnlock(AddressVar int, LockBitVar int) {
75+func BitUnlock(AddressVar uintptr, LockBitVar int) {
6376
6477 xBitUnlock(AddressVar, LockBitVar)
6578
6679 }
6780
81+var xBitUnlockAndSet func(uintptr, uint, int, int)
82+
83+// This is like [func@GLib.bit_unlock] but also atomically sets @address to
84+// @val.
85+//
86+// If @preserve_mask is not zero, then the @preserve_mask bits will be
87+// preserved in @address and are not set to @val.
88+//
89+// Note that the @lock_bit bit will always be unset regardless of
90+// @val, @preserve_mask and the currently set value in @address.
91+func BitUnlockAndSet(AddressVar uintptr, LockBitVar uint, NewValVar int, PreserveMaskVar int) {
92+
93+ xBitUnlockAndSet(AddressVar, LockBitVar, NewValVar, PreserveMaskVar)
94+
95+}
96+
6897 var xPointerBitLock func(uintptr, int)
6998
7099 // This is equivalent to g_bit_lock, but working on pointers (or other
@@ -164,8 +193,10 @@ func init() {
164193 }
165194
166195 core.PuregoSafeRegister(&xBitLock, libs, "g_bit_lock")
196+ core.PuregoSafeRegister(&xBitLockAndGet, libs, "g_bit_lock_and_get")
167197 core.PuregoSafeRegister(&xBitTrylock, libs, "g_bit_trylock")
168198 core.PuregoSafeRegister(&xBitUnlock, libs, "g_bit_unlock")
199+ core.PuregoSafeRegister(&xBitUnlockAndSet, libs, "g_bit_unlock_and_set")
169200 core.PuregoSafeRegister(&xPointerBitLock, libs, "g_pointer_bit_lock")
170201 core.PuregoSafeRegister(&xPointerBitLockAndGet, libs, "g_pointer_bit_lock_and_get")
171202 core.PuregoSafeRegister(&xPointerBitLockMaskPtr, libs, "g_pointer_bit_lock_mask_ptr")
M v4/glib/gdate.go +35 -0
@@ -287,6 +287,22 @@ func (x *Date) GetSundayWeekOfYear() uint {
287287 return cret
288288 }
289289
290+var xDateGetWeekOfYear func(uintptr, DateWeekday) uint
291+
292+// Calculates the week of the year during which this date falls.
293+//
294+// The result depends on which day is considered the first day of the week,
295+// which varies by locale. Both `date` and `first_day_of_week` must be valid.
296+//
297+// If @date is before the start of the first week of the year (for example,
298+// before the first Monday in January if @first_day_of_week is
299+// [enum@GLib.DateWeekday.MONDAY]) then zero will be returned.
300+func (x *Date) GetWeekOfYear(FirstDayOfWeekVar DateWeekday) uint {
301+
302+ cret := xDateGetWeekOfYear(x.GoPointer(), FirstDayOfWeekVar)
303+ return cret
304+}
305+
290306 var xDateGetWeekday func(uintptr) DateWeekday
291307
292308 // Returns the day of the week for a #GDate. The date must be valid.
@@ -664,6 +680,23 @@ func DateGetSundayWeeksInYear(YearVar DateYear) byte {
664680 return cret
665681 }
666682
683+var xDateGetWeeksInYear func(DateYear, DateWeekday) byte
684+
685+// Calculates the number of weeks in the year.
686+//
687+// The result depends on which day is considered the first day of the week,
688+// which varies by locale. `first_day_of_week` must be valid.
689+//
690+// The result will be either 52 or 53. Years always have 52 seven-day periods,
691+// plus one or two extra days depending on whether it’s a leap year. This
692+// function effectively calculates how many @first_day_of_week days there are in
693+// the year.
694+func DateGetWeeksInYear(YearVar DateYear, FirstDayOfWeekVar DateWeekday) byte {
695+
696+ cret := xDateGetWeeksInYear(YearVar, FirstDayOfWeekVar)
697+ return cret
698+}
699+
667700 var xDateIsLeapYear func(DateYear) bool
668701
669702 // Returns %TRUE if the year is a leap year.
@@ -775,6 +808,7 @@ func init() {
775808 core.PuregoSafeRegister(&xDateGetDaysInMonth, libs, "g_date_get_days_in_month")
776809 core.PuregoSafeRegister(&xDateGetMondayWeeksInYear, libs, "g_date_get_monday_weeks_in_year")
777810 core.PuregoSafeRegister(&xDateGetSundayWeeksInYear, libs, "g_date_get_sunday_weeks_in_year")
811+ core.PuregoSafeRegister(&xDateGetWeeksInYear, libs, "g_date_get_weeks_in_year")
778812 core.PuregoSafeRegister(&xDateIsLeapYear, libs, "g_date_is_leap_year")
779813 core.PuregoSafeRegister(&xDateStrftime, libs, "g_date_strftime")
780814 core.PuregoSafeRegister(&xDateValidDay, libs, "g_date_valid_day")
@@ -806,6 +840,7 @@ func init() {
806840 core.PuregoSafeRegister(&xDateGetMondayWeekOfYear, libs, "g_date_get_monday_week_of_year")
807841 core.PuregoSafeRegister(&xDateGetMonth, libs, "g_date_get_month")
808842 core.PuregoSafeRegister(&xDateGetSundayWeekOfYear, libs, "g_date_get_sunday_week_of_year")
843+ core.PuregoSafeRegister(&xDateGetWeekOfYear, libs, "g_date_get_week_of_year")
809844 core.PuregoSafeRegister(&xDateGetWeekday, libs, "g_date_get_weekday")
810845 core.PuregoSafeRegister(&xDateGetYear, libs, "g_date_get_year")
811846 core.PuregoSafeRegister(&xDateIsFirstOfMonth, libs, "g_date_is_first_of_month")
M v4/glib/gfileutils.go +2 -2
@@ -507,8 +507,8 @@ var xFileSetContentsFull func(string, []byte, int, FileSetContentsFlags, int, **
507507 // to 7 characters to @filename.
508508 //
509509 // If the file didn’t exist before and is created, it will be given the
510-// permissions from @mode. Otherwise, the permissions of the existing file may
511-// be changed to @mode depending on @flags, or they may remain unchanged.
510+// permissions from @mode. Otherwise, the permissions of the existing file will
511+// remain unchanged.
512512 func FileSetContentsFull(FilenameVar string, ContentsVar []byte, LengthVar int, FlagsVar FileSetContentsFlags, ModeVar int) (bool, error) {
513513 var cerr *Error
514514
M v4/glib/gkeyfile.go +5 -0
@@ -786,6 +786,11 @@ var xKeyFileSetComment func(uintptr, string, string, string, **Error) bool
786786 // If both @key and @group_name are `NULL`, then @comment will be
787787 // written above the first group in the file.
788788 //
789+// Passing a non-existent @group_name or @key to this function returns
790+// false and populates @error. (In contrast, passing a non-existent
791+// `group_name` or `key` to [method@GLib.KeyFile.set_string]
792+// creates the associated group name and key.)
793+//
789794 // Note that this function prepends a `#` comment marker to
790795 // each line of @comment.
791796 func (x *KeyFile) SetComment(GroupNameVar string, KeyVar string, CommentVar string) (bool, error) {
M v4/glib/glibconfig.go +2 -2
@@ -70,13 +70,13 @@ const (
7070 // Like #gtk_micro_version, but from the headers used at
7171 // application compile time, rather than from the library
7272 // linked against at application run time.
73- MICRO_VERSION int = 4
73+ MICRO_VERSION int = 0
7474 // The minor version number of the GLib library.
7575 //
7676 // Like #gtk_minor_version, but from the headers used at
7777 // application compile time, rather than from the library
7878 // linked against at application run time.
79- MINOR_VERSION int = 84
79+ MINOR_VERSION int = 86
8080
8181 MODULE_SUFFIX string = "so"
8282 // A format specifier that can be used in printf()-style format strings
M v4/glib/gmain.go +331 -234
@@ -133,8 +133,9 @@ func NewMainContextWithFlags(FlagsVar MainContextFlags) *MainContext {
133133 var xMainContextAcquire func(uintptr) bool
134134
135135 // Tries to become the owner of the specified context.
136+//
136137 // If some other thread is the owner of the context,
137-// returns %FALSE immediately. Ownership is properly
138+// returns false immediately. Ownership is properly
138139 // recursive: the owner can require ownership again
139140 // and will release ownership when [method@GLib.MainContext.release]
140141 // is called as many times as [method@GLib.MainContext.acquire].
@@ -144,7 +145,7 @@ var xMainContextAcquire func(uintptr) bool
144145 // [method@GLib.MainContext.check], [method@GLib.MainContext.dispatch],
145146 // [method@GLib.MainContext.release].
146147 //
147-// Since 2.76 @context can be %NULL to use the global-default
148+// Since 2.76 @context can be `NULL` to use the global-default
148149 // main context.
149150 func (x *MainContext) Acquire() bool {
150151
@@ -155,8 +156,10 @@ func (x *MainContext) Acquire() bool {
155156 var xMainContextAddPoll func(uintptr, *PollFD, int)
156157
157158 // Adds a file descriptor to the set of file descriptors polled for
158-// this context. This will very seldom be used directly. Instead
159-// a typical event source will use `g_source_add_unix_fd` instead.
159+// this context.
160+//
161+// This will very seldom be used directly. Instead
162+// a typical event source will use `g_source_add_unix_fd()` instead.
160163 func (x *MainContext) AddPoll(FdVar *PollFD, PriorityVar int) {
161164
162165 xMainContextAddPoll(x.GoPointer(), FdVar, PriorityVar)
@@ -165,7 +168,9 @@ func (x *MainContext) AddPoll(FdVar *PollFD, PriorityVar int) {
165168
166169 var xMainContextCheck func(uintptr, int, []PollFD, int) bool
167170
168-// Passes the results of polling back to the main loop. You should be
171+// Passes the results of polling back to the main loop.
172+//
173+// You should be
169174 // careful to pass @fds and its length @n_fds as received from
170175 // [method@GLib.MainContext.query], as this functions relies on assumptions
171176 // on how @fds is filled.
@@ -173,7 +178,7 @@ var xMainContextCheck func(uintptr, int, []PollFD, int) bool
173178 // You must have successfully acquired the context with
174179 // [method@GLib.MainContext.acquire] before you may call this function.
175180 //
176-// Since 2.76 @context can be %NULL to use the global-default
181+// Since 2.76 @context can be `NULL` to use the global-default
177182 // main context.
178183 func (x *MainContext) Check(MaxPriorityVar int, FdsVar []PollFD, NFdsVar int) bool {
179184
@@ -188,7 +193,7 @@ var xMainContextDispatch func(uintptr)
188193 // You must have successfully acquired the context with
189194 // [method@GLib.MainContext.acquire] before you may call this function.
190195 //
191-// Since 2.76 @context can be %NULL to use the global-default
196+// Since 2.76 @context can be `NULL` to use the global-default
192197 // main context.
193198 func (x *MainContext) Dispatch() {
194199
@@ -198,8 +203,9 @@ func (x *MainContext) Dispatch() {
198203
199204 var xMainContextFindSourceByFuncsUserData func(uintptr, *SourceFuncs, uintptr) *Source
200205
201-// Finds a source with the given source functions and user data. If
202-// multiple sources exist with the same source function and user data,
206+// Finds a source with the given source functions and user data.
207+//
208+// If multiple sources exist with the same source function and user data,
203209 // the first one found will be returned.
204210 func (x *MainContext) FindSourceByFuncsUserData(FuncsVar *SourceFuncs, UserDataVar uintptr) *Source {
205211
@@ -209,7 +215,7 @@ func (x *MainContext) FindSourceByFuncsUserData(FuncsVar *SourceFuncs, UserDataV
209215
210216 var xMainContextFindSourceById func(uintptr, uint) *Source
211217
212-// Finds a #GSource given a pair of context and ID.
218+// Finds a [struct@GLib.Source] given a pair of context and ID.
213219 //
214220 // It is a programmer error to attempt to look up a non-existent source.
215221 //
@@ -229,8 +235,9 @@ func (x *MainContext) FindSourceById(SourceIdVar uint) *Source {
229235
230236 var xMainContextFindSourceByUserData func(uintptr, uintptr) *Source
231237
232-// Finds a source with the given user data for the callback. If
233-// multiple sources exist with the same user data, the first
238+// Finds a source with the given user data for the callback.
239+//
240+// If multiple sources exist with the same user data, the first
234241 // one found will be returned.
235242 func (x *MainContext) FindSourceByUserData(UserDataVar uintptr) *Source {
236243
@@ -252,13 +259,13 @@ var xMainContextInvoke func(uintptr, uintptr, uintptr)
252259 // Invokes a function in such a way that @context is owned during the
253260 // invocation of @function.
254261 //
255-// If @context is %NULL then the global-default main context — as
262+// If @context is `NULL` then the global-default main context — as
256263 // returned by [func@GLib.MainContext.default] — is used.
257264 //
258265 // If @context is owned by the current thread, @function is called
259266 // directly. Otherwise, if @context is the thread-default main context
260-// of the current thread and [method@GLib.MainContext.acquire] succeeds, then
261-// @function is called and [method@GLib.MainContext.release] is called
267+// of the current thread and [method@GLib.MainContext.acquire] succeeds,
268+// then @function is called and [method@GLib.MainContext.release] is called
262269 // afterwards.
263270 //
264271 // In any other case, an idle source is created to call @function and
@@ -267,9 +274,9 @@ var xMainContextInvoke func(uintptr, uintptr, uintptr)
267274 // priority. If you want a different priority, use
268275 // [method@GLib.MainContext.invoke_full].
269276 //
270-// Note that, as with normal idle functions, @function should probably
271-// return %FALSE. If it returns %TRUE, it will be continuously run in a
272-// loop (and may prevent this call from returning).
277+// Note that, as with normal idle functions, @function should probably return
278+// [const@GLib.SOURCE_REMOVE]. If it returns [const@GLib.SOURCE_CONTINUE], it
279+// will be continuously run in a loop (and may prevent this call from returning).
273280 func (x *MainContext) Invoke(FunctionVar *SourceFunc, DataVar uintptr) {
274281
275282 xMainContextInvoke(x.GoPointer(), NewCallback(FunctionVar), DataVar)
@@ -283,9 +290,10 @@ var xMainContextInvokeFull func(uintptr, int, uintptr, uintptr, uintptr)
283290 //
284291 // This function is the same as [method@GLib.MainContext.invoke] except that it
285292 // lets you specify the priority in case @function ends up being
286-// scheduled as an idle and also lets you give a #GDestroyNotify for @data.
293+// scheduled as an idle and also lets you give a [callback@GLib.DestroyNotify]
294+// for @data.
287295 //
288-// @notify should not assume that it is called from any particular
296+// The @notify function should not assume that it is called from any particular
289297 // thread or with any particular context acquired.
290298 func (x *MainContext) InvokeFull(PriorityVar int, FunctionVar *SourceFunc, DataVar uintptr, NotifyVar *DestroyNotify) {
291299
@@ -296,7 +304,9 @@ func (x *MainContext) InvokeFull(PriorityVar int, FunctionVar *SourceFunc, DataV
296304 var xMainContextIsOwner func(uintptr) bool
297305
298306 // Determines whether this thread holds the (recursive)
299-// ownership of this [struct@GLib.MainContext]. This is useful to
307+// ownership of this [struct@GLib.MainContext].
308+//
309+// This is useful to
300310 // know before waiting on another thread that may be
301311 // blocking to get ownership of @context.
302312 func (x *MainContext) IsOwner() bool {
@@ -307,17 +317,18 @@ func (x *MainContext) IsOwner() bool {
307317
308318 var xMainContextIteration func(uintptr, bool) bool
309319
310-// Runs a single iteration for the given main loop. This involves
320+// Runs a single iteration for the given main loop.
321+//
322+// This involves
311323 // checking to see if any event sources are ready to be processed,
312-// then if no events sources are ready and @may_block is %TRUE, waiting
324+// then if no events sources are ready and @may_block is true, waiting
313325 // for a source to become ready, then dispatching the highest priority
314-// events sources that are ready. Otherwise, if @may_block is %FALSE
315-// sources are not waited to become ready, only those highest priority
316-// events sources will be dispatched (if any), that are ready at this
317-// given moment without further waiting.
326+// events sources that are ready. Otherwise, if @may_block is false,
327+// this function does not wait for sources to become ready, and only the highest
328+// priority sources which are already ready (if any) will be dispatched.
318329 //
319-// Note that even when @may_block is %TRUE, it is still possible for
320-// [method@GLib.MainContext.iteration] to return %FALSE, since the wait may
330+// Note that even when @may_block is true, it is still possible for
331+// [method@GLib.MainContext.iteration] to return false, since the wait may
321332 // be interrupted for other reasons than an event source becoming ready.
322333 func (x *MainContext) Iteration(MayBlockVar bool) bool {
323334
@@ -346,7 +357,9 @@ func (x *MainContext) PopThreadDefault() {
346357
347358 var xMainContextPrepare func(uintptr, int) bool
348359
349-// Prepares to poll sources within a main loop. The resulting information
360+// Prepares to poll sources within a main loop.
361+//
362+// The resulting information
350363 // for polling is determined by calling [method@GLib.MainContext.query].
351364 //
352365 // You must have successfully acquired the context with
@@ -377,8 +390,8 @@ var xMainContextPushThreadDefault func(uintptr)
377390 // the new [struct@GLib.MainContext] to be the default for the whole lifecycle
378391 // of the thread.
379392 //
380-// If you don't have control over how the new thread was created (e.g.
381-// in the new thread isn't newly created, or if the thread life
393+// If you don’t have control over how the new thread was created (e.g.
394+// in the new thread isn’t newly created, or if the thread life
382395 // cycle is managed by a #GThreadPool), it is always suggested to wrap
383396 // the logic that needs to use the new [struct@GLib.MainContext] inside a
384397 // [method@GLib.MainContext.push_thread_default] /
@@ -396,8 +409,8 @@ var xMainContextPushThreadDefault func(uintptr)
396409 // started while the non-default context is active.
397410 //
398411 // Beware that libraries that predate this function may not correctly
399-// handle being used from a thread with a thread-default context. Eg,
400-// see g_file_supports_thread_contexts().
412+// handle being used from a thread with a thread-default context. For example,
413+// see `g_file_supports_thread_contexts()`.
401414 func (x *MainContext) PushThreadDefault() {
402415
403416 xMainContextPushThreadDefault(x.GoPointer())
@@ -454,9 +467,11 @@ func (x *MainContext) PusherNew() *MainContextPusher {
454467
455468 var xMainContextQuery func(uintptr, int, int, []PollFD, int) int
456469
457-// Determines information necessary to poll this main loop. You should
470+// Determines information necessary to poll this main loop.
471+//
472+// You should
458473 // be careful to pass the resulting @fds array and its length @n_fds
459-// as is when calling [method@GLib.MainContext.check], as this function relies
474+// as-is when calling [method@GLib.MainContext.check], as this function relies
460475 // on assumptions made when the array is filled.
461476 //
462477 // You must have successfully acquired the context with
@@ -479,7 +494,9 @@ func (x *MainContext) Ref() *MainContext {
479494 var xMainContextRelease func(uintptr)
480495
481496 // Releases ownership of a context previously acquired by this thread
482-// with [method@GLib.MainContext.acquire]. If the context was acquired multiple
497+// with [method@GLib.MainContext.acquire].
498+//
499+// If the context was acquired multiple
483500 // times, the ownership will be released only when [method@GLib.MainContext.release]
484501 // is called as many times as it was acquired.
485502 //
@@ -503,10 +520,11 @@ func (x *MainContext) RemovePoll(FdVar *PollFD) {
503520
504521 var xMainContextSetPollFunc func(uintptr, uintptr)
505522
506-// Sets the function to use to handle polling of file descriptors. It
507-// will be used instead of the poll() system call
508-// (or GLib's replacement function, which is used where
509-// poll() isn't available).
523+// Sets the function to use to handle polling of file descriptors.
524+//
525+// It will be used instead of the [`poll()`](man:poll(2)) system call
526+// (or GLib’s replacement function, which is used where
527+// `poll()` isn’t available).
510528 //
511529 // This function could possibly be used to integrate the GLib event
512530 // loop with an external event loop.
@@ -529,8 +547,10 @@ func (x *MainContext) Unref() {
529547
530548 var xMainContextWait func(uintptr, *Cond, *Mutex) bool
531549
532-// Tries to become the owner of the specified context,
533-// as with [method@GLib.MainContext.acquire]. But if another thread
550+// Tries to become the owner of the specified context, and waits on @cond if
551+// another thread is the owner.
552+//
553+// This is the same as [method@GLib.MainContext.acquire], but if another thread
534554 // is the owner, atomically drop @mutex and wait on @cond until
535555 // that owner releases ownership or until @cond is signaled, then
536556 // try again (once) to become the owner.
@@ -542,10 +562,13 @@ func (x *MainContext) Wait(CondVar *Cond, MutexVar *Mutex) bool {
542562
543563 var xMainContextWakeup func(uintptr)
544564
545-// If @context is currently blocking in [method@GLib.MainContext.iteration]
546-// waiting for a source to become ready, cause it to stop blocking
547-// and return. Otherwise, cause the next invocation of
548-// [method@GLib.MainContext.iteration] to return without blocking.
565+// Wake up @context if it’s currently blocking in
566+// [method@GLib.MainContext.iteration], causing it to stop blocking.
567+//
568+// The @context could be blocking waiting for a source to become ready.
569+// Otherwise, if @context is not currently blocking, this function causes the
570+// next invocation of [method@GLib.MainContext.iteration] to return without
571+// blocking.
549572 //
550573 // This API is useful for low-level control over [struct@GLib.MainContext]; for
551574 // example, integrating it with main loop implementations such as
@@ -554,7 +577,7 @@ var xMainContextWakeup func(uintptr)
554577 // Another related use for this function is when implementing a main
555578 // loop with a termination condition, computed from multiple threads:
556579 //
557-// |[&lt;!-- language="C" --&gt;
580+// ```c
558581 //
559582 // #define NUM_TASKS 10
560583 // static gint tasks_remaining = NUM_TASKS; // (atomic)
@@ -563,17 +586,17 @@ var xMainContextWakeup func(uintptr)
563586 // while (g_atomic_int_get (&amp;tasks_remaining) != 0)
564587 // g_main_context_iteration (NULL, TRUE);
565588 //
566-// ]|
589+// ```
567590 //
568591 // Then in a thread:
569-// |[&lt;!-- language="C" --&gt;
592+// ```c
570593 //
571-// perform_work();
594+// perform_work ();
572595 //
573596 // if (g_atomic_int_dec_and_test (&amp;tasks_remaining))
574597 // g_main_context_wakeup (NULL);
575598 //
576-// ]|
599+// ```
577600 func (x *MainContext) Wakeup() {
578601
579602 xMainContextWakeup(x.GoPointer())
@@ -649,7 +672,8 @@ func (x *MainLoop) Ref() *MainLoop {
649672 var xMainLoopRun func(uintptr)
650673
651674 // Runs a main loop until [method@GLib.MainLoop.quit] is called on the loop.
652-// If this is called for the thread of the loop's #GMainContext,
675+//
676+// If this is called from the thread of the loop’s [struct@GLib.MainContext],
653677 // it will process events from the loop, otherwise it will
654678 // simply wait.
655679 func (x *MainLoop) Run() {
@@ -660,8 +684,9 @@ func (x *MainLoop) Run() {
660684
661685 var xMainLoopUnref func(uintptr)
662686
663-// Decreases the reference count on a [struct@GLib.MainLoop] object by one. If
664-// the result is zero, free the loop and free all associated memory.
687+// Decreases the reference count on a [struct@GLib.MainLoop] object by one.
688+//
689+// If the result is zero, the loop and all associated memory are freed.
665690 func (x *MainLoop) Unref() {
666691
667692 xMainLoopUnref(x.GoPointer())
@@ -712,12 +737,14 @@ func (x *Source) GoPointer() uintptr {
712737
713738 var xNewSource func(*SourceFuncs, uint) *Source
714739
715-// Creates a new [struct@GLib.Source] structure. The size is specified to
740+// Creates a new [struct@GLib.Source] structure.
741+//
742+// The size is specified to
716743 // allow creating structures derived from [struct@GLib.Source] that contain
717744 // additional data. The size passed in must be at least
718745 // `sizeof (GSource)`.
719746 //
720-// The source will not initially be associated with any #GMainContext
747+// The source will not initially be associated with any [struct@GLib.MainContext]
721748 // and must be added to one with [method@GLib.Source.attach] before it will be
722749 // executed.
723750 func NewSource(SourceFuncsVar *SourceFuncs, StructSizeVar uint) *Source {
@@ -728,24 +755,25 @@ func NewSource(SourceFuncsVar *SourceFuncs, StructSizeVar uint) *Source {
728755
729756 var xSourceAddChildSource func(uintptr, *Source)
730757
731-// Adds @child_source to @source as a "polled" source; when @source is
732-// added to a [struct@GLib.MainContext], @child_source will be automatically
733-// added with the same priority, when @child_source is triggered, it will
734-// cause @source to dispatch (in addition to calling its own
735-// callback), and when @source is destroyed, it will destroy
736-// @child_source as well. (@source will also still be dispatched if
737-// its own prepare/check functions indicate that it is ready.)
758+// Adds @child_source to @source as a ‘polled’ source.
738759 //
739-// If you don't need @child_source to do anything on its own when it
740-// triggers, you can call g_source_set_dummy_callback() on it to set a
741-// callback that does nothing (except return %TRUE if appropriate).
760+// When @source is added to a [struct@GLib.MainContext], @child_source will be
761+// automatically added with the same priority. When @child_source is triggered,
762+// it will cause @source to dispatch (in addition to calling its own callback),
763+// and when @source is destroyed, it will destroy @child_source as well.
742764 //
743-// @source will hold a reference on @child_source while @child_source
765+// The @source will also still be dispatched if its own prepare/check functions
766+// indicate that it is ready.
767+//
768+// If you don’t need @child_source to do anything on its own when it
769+// triggers, you can call `g_source_set_dummy_callback()` on it to set a
770+// callback that does nothing (except return true if appropriate).
771+//
772+// The @source will hold a reference on @child_source while @child_source
744773 // is attached to it.
745774 //
746-// This API is only intended to be used by implementations of
747-// [struct@GLib.Source]. Do not call this API on a [struct@GLib.Source] that
748-// you did not create.
775+// This API is only intended to be used by implementations of [struct@GLib.Source].
776+// Do not call this API on a [struct@GLib.Source] that you did not create.
749777 func (x *Source) AddChildSource(ChildSourceVar *Source) {
750778
751779 xSourceAddChildSource(x.GoPointer(), ChildSourceVar)
@@ -755,17 +783,19 @@ func (x *Source) AddChildSource(ChildSourceVar *Source) {
755783 var xSourceAddPoll func(uintptr, *PollFD)
756784
757785 // Adds a file descriptor to the set of file descriptors polled for
758-// this source. This is usually combined with [ctor@GLib.Source.new] to add an
759-// event source. The event source's check function will typically test
760-// the @revents field in the #GPollFD struct and return %TRUE if events need
761-// to be processed.
786+// this source.
787+//
788+// This is usually combined with [ctor@GLib.Source.new] to add an
789+// event source. The event source’s check function will typically test
790+// the @revents field in the [struct@GLib.PollFD] struct and return true if
791+// events need to be processed.
762792 //
763793 // This API is only intended to be used by implementations of [struct@GLib.Source].
764794 // Do not call this API on a [struct@GLib.Source] that you did not create.
765795 //
766796 // Using this API forces the linear scanning of event sources on each
767797 // main loop iteration. Newly-written event sources should try to use
768-// `g_source_add_unix_fd` instead of this API.
798+// `g_source_add_unix_fd()` instead of this API.
769799 func (x *Source) AddPoll(FdVar *PollFD) {
770800
771801 xSourceAddPoll(x.GoPointer(), FdVar)
@@ -777,14 +807,14 @@ var xSourceAddUnixFd func(uintptr, int, IOCondition) uintptr
777807 // Monitors @fd for the IO events in @events.
778808 //
779809 // The tag returned by this function can be used to remove or modify the
780-// monitoring of the fd using [method@GLib.Source.remove_unix_fd] or
810+// monitoring of the @fd using [method@GLib.Source.remove_unix_fd] or
781811 // [method@GLib.Source.modify_unix_fd].
782812 //
783-// It is not necessary to remove the fd before destroying the source; it
784-// will be cleaned up automatically.
813+// It is not necessary to remove the file descriptor before destroying the
814+// source; it will be cleaned up automatically.
785815 //
786-// This API is only intended to be used by implementations of #GSource.
787-// Do not call this API on a #GSource that you did not create.
816+// This API is only intended to be used by implementations of [struct@GLib.Source].
817+// Do not call this API on a [struct@GLib.Source] that you did not create.
788818 //
789819 // As the name suggests, this function is not available on Windows.
790820 func (x *Source) AddUnixFd(FdVar int, EventsVar IOCondition) uintptr {
@@ -796,7 +826,9 @@ func (x *Source) AddUnixFd(FdVar int, EventsVar IOCondition) uintptr {
796826 var xSourceAttach func(uintptr, *MainContext) uint
797827
798828 // Adds a [struct@GLib.Source] to a @context so that it will be executed within
799-// that context. Remove it by calling [method@GLib.Source.destroy].
829+// that context.
830+//
831+// Remove it by calling [method@GLib.Source.destroy].
800832 //
801833 // This function is safe to call from any thread, regardless of which thread
802834 // the @context is running in.
@@ -808,8 +840,10 @@ func (x *Source) Attach(ContextVar *MainContext) uint {
808840
809841 var xSourceDestroy func(uintptr)
810842
811-// Removes a source from its [struct@GLib.MainContext], if any, and mark it as
812-// destroyed. The source cannot be subsequently added to another
843+// Removes a source from its [struct@GLib.MainContext], if any, and marks it as
844+// destroyed.
845+//
846+// The source cannot be subsequently added to another
813847 // context. It is safe to call this on sources which have already been
814848 // removed from their context.
815849 //
@@ -821,18 +855,33 @@ var xSourceDestroy func(uintptr)
821855 //
822856 // If the source is currently attached to a [struct@GLib.MainContext],
823857 // destroying it will effectively unset the callback similar to calling
824-// [method@GLib.Source.set_callback]. This can mean, that the data's
825-// #GDestroyNotify gets called right away.
858+// [method@GLib.Source.set_callback]. This can mean, that the data’s
859+// [callback@GLib.DestroyNotify] gets called right away.
826860 func (x *Source) Destroy() {
827861
828862 xSourceDestroy(x.GoPointer())
829863
830864 }
831865
866+var xSourceDupContext func(uintptr) *MainContext
867+
868+// Gets a reference to the [struct@GLib.MainContext] with which the source is
869+// associated.
870+//
871+// You can call this on a source that has been destroyed. You can
872+// always call this function on the source returned from
873+// [func@GLib.main_current_source].
874+func (x *Source) DupContext() *MainContext {
875+
876+ cret := xSourceDupContext(x.GoPointer())
877+ return cret
878+}
879+
832880 var xSourceGetCanRecurse func(uintptr) bool
833881
834882 // Checks whether a source is allowed to be called recursively.
835-// see [method@GLib.Source.set_can_recurse].
883+//
884+// See [method@GLib.Source.set_can_recurse].
836885 func (x *Source) GetCanRecurse() bool {
837886
838887 cret := xSourceGetCanRecurse(x.GoPointer())
@@ -849,6 +898,10 @@ var xSourceGetContext func(uintptr) *MainContext
849898 // always call this function on the source returned from
850899 // [func@GLib.main_current_source]. But calling this function on a source
851900 // whose [struct@GLib.MainContext] has been destroyed is an error.
901+//
902+// If the associated [struct@GLib.MainContext] could be destroy concurrently from
903+// a different thread, then this function is not safe to call and
904+// [method@GLib.Source.dup_context] should be used instead.
852905 func (x *Source) GetContext() *MainContext {
853906
854907 cret := xSourceGetContext(x.GoPointer())
@@ -867,7 +920,9 @@ func (x *Source) GetCurrentTime(TimevalVar *TimeVal) {
867920
868921 var xSourceGetId func(uintptr) uint
869922
870-// Returns the numeric ID for a particular source. The ID of a source
923+// Returns the numeric ID for a particular source.
924+//
925+// The ID of a source
871926 // is a positive integer which is unique within a particular main loop
872927 // context. The reverse mapping from ID to source is done by
873928 // [method@GLib.MainContext.find_source_by_id].
@@ -885,8 +940,10 @@ func (x *Source) GetId() uint {
885940
886941 var xSourceGetName func(uintptr) string
887942
888-// Gets a name for the source, used in debugging and profiling. The
889-// name may be #NULL if it has never been set with [method@GLib.Source.set_name].
943+// Gets a name for the source, used in debugging and profiling.
944+//
945+// The
946+// name may be `NULL` if it has never been set with [method@GLib.Source.set_name].
890947 func (x *Source) GetName() string {
891948
892949 cret := xSourceGetName(x.GoPointer())
@@ -904,10 +961,10 @@ func (x *Source) GetPriority() int {
904961
905962 var xSourceGetReadyTime func(uintptr) int64
906963
907-// Gets the "ready time" of @source, as set by
964+// Gets the ‘ready time’ of @source, as set by
908965 // [method@GLib.Source.set_ready_time].
909966 //
910-// Any time before or equal to the current monotonic time (including 0)
967+// Any time before or equal to the current monotonic time (including zero)
911968 // is an indication that the source will fire immediately.
912969 func (x *Source) GetReadyTime() int64 {
913970
@@ -917,7 +974,9 @@ func (x *Source) GetReadyTime() int64 {
917974
918975 var xSourceGetTime func(uintptr) int64
919976
920-// Gets the time to be used when checking this source. The advantage of
977+// Gets the time to be used when checking this source.
978+//
979+// The advantage of
921980 // calling this function over calling [func@GLib.get_monotonic_time] directly is
922981 // that when checking multiple sources, GLib can cache a single value
923982 // instead of having to repeatedly get the system monotonic time.
@@ -938,7 +997,7 @@ var xSourceIsDestroyed func(uintptr) bool
938997 // from within idle handlers, but may have freed the object
939998 // before the dispatch of your idle handler.
940999 //
941-// |[&lt;!-- language="C" --&gt;
1000+// ```c
9421001 // static gboolean
9431002 // idle_callback (gpointer data)
9441003 //
@@ -985,7 +1044,7 @@ var xSourceIsDestroyed func(uintptr) bool
9851044 // G_OBJECT_CLASS (parent_class)-&gt;finalize (object);
9861045 // }
9871046 //
988-// ]|
1047+// ```
9891048 //
9901049 // This will fail in a multi-threaded application if the
9911050 // widget is destroyed before the idle handler fires due
@@ -993,7 +1052,7 @@ var xSourceIsDestroyed func(uintptr) bool
9931052 // this particular problem, is to check to if the source
9941053 // has already been destroy within the callback.
9951054 //
996-// |[&lt;!-- language="C" --&gt;
1055+// ```c
9971056 // static gboolean
9981057 // idle_callback (gpointer data)
9991058 //
@@ -1010,10 +1069,10 @@ var xSourceIsDestroyed func(uintptr) bool
10101069 // return FALSE;
10111070 // }
10121071 //
1013-// ]|
1072+// ```
10141073 //
10151074 // Calls to this function from a thread other than the one acquired by the
1016-// [struct@GLib.MainContext] the #GSource is attached to are typically
1075+// [struct@GLib.MainContext] the [struct@GLib.Source] is attached to are typically
10171076 // redundant, as the source could be destroyed immediately after this function
10181077 // returns. However, once a source is destroyed it cannot be un-destroyed, so
10191078 // this function can be used for opportunistic checks from any thread.
@@ -1025,15 +1084,15 @@ func (x *Source) IsDestroyed() bool {
10251084
10261085 var xSourceModifyUnixFd func(uintptr, uintptr, IOCondition)
10271086
1028-// Updates the event mask to watch for the fd identified by @tag.
1087+// Updates the event mask to watch for the file descriptor identified by @tag.
10291088 //
1030-// @tag is the tag returned from [method@GLib.Source.add_unix_fd].
1089+// The @tag is the tag returned from [method@GLib.Source.add_unix_fd].
10311090 //
1032-// If you want to remove a fd, don't set its event mask to zero.
1091+// If you want to remove a file descriptor, don’t set its event mask to zero.
10331092 // Instead, call [method@GLib.Source.remove_unix_fd].
10341093 //
1035-// This API is only intended to be used by implementations of #GSource.
1036-// Do not call this API on a #GSource that you did not create.
1094+// This API is only intended to be used by implementations of [struct@GLib.Source].
1095+// Do not call this API on a [struct@GLib.Source] that you did not create.
10371096 //
10381097 // As the name suggests, this function is not available on Windows.
10391098 func (x *Source) ModifyUnixFd(TagVar uintptr, NewEventsVar IOCondition) {
@@ -1044,14 +1103,14 @@ func (x *Source) ModifyUnixFd(TagVar uintptr, NewEventsVar IOCondition) {
10441103
10451104 var xSourceQueryUnixFd func(uintptr, uintptr) IOCondition
10461105
1047-// Queries the events reported for the fd corresponding to @tag on
1048-// @source during the last poll.
1106+// Queries the events reported for the file descriptor corresponding to @tag
1107+// on @source during the last poll.
10491108 //
10501109 // The return value of this function is only defined when the function
10511110 // is called from the check or dispatch functions for @source.
10521111 //
1053-// This API is only intended to be used by implementations of #GSource.
1054-// Do not call this API on a #GSource that you did not create.
1112+// This API is only intended to be used by implementations of [struct@GLib.Source].
1113+// Do not call this API on a [struct@GLib.Source] that you did not create.
10551114 //
10561115 // As the name suggests, this function is not available on Windows.
10571116 func (x *Source) QueryUnixFd(TagVar uintptr) IOCondition {
@@ -1073,8 +1132,8 @@ var xSourceRemoveChildSource func(uintptr, *Source)
10731132
10741133 // Detaches @child_source from @source and destroys it.
10751134 //
1076-// This API is only intended to be used by implementations of #GSource.
1077-// Do not call this API on a #GSource that you did not create.
1135+// This API is only intended to be used by implementations of [struct@GLib.Source].
1136+// Do not call this API on a [struct@GLib.Source] that you did not create.
10781137 func (x *Source) RemoveChildSource(ChildSourceVar *Source) {
10791138
10801139 xSourceRemoveChildSource(x.GoPointer(), ChildSourceVar)
@@ -1098,12 +1157,12 @@ var xSourceRemoveUnixFd func(uintptr, uintptr)
10981157
10991158 // Reverses the effect of a previous call to [method@GLib.Source.add_unix_fd].
11001159 //
1101-// You only need to call this if you want to remove an fd from being
1160+// You only need to call this if you want to remove a file descriptor from being
11021161 // watched while keeping the same source around. In the normal case you
11031162 // will just want to destroy the source.
11041163 //
1105-// This API is only intended to be used by implementations of #GSource.
1106-// Do not call this API on a #GSource that you did not create.
1164+// This API is only intended to be used by implementations of [struct@GLib.Source].
1165+// Do not call this API on a [struct@GLib.Source] that you did not create.
11071166 //
11081167 // As the name suggests, this function is not available on Windows.
11091168 func (x *Source) RemoveUnixFd(TagVar uintptr) {
@@ -1115,17 +1174,17 @@ func (x *Source) RemoveUnixFd(TagVar uintptr) {
11151174 var xSourceSetCallback func(uintptr, uintptr, uintptr, uintptr)
11161175
11171176 // Sets the callback function for a source. The callback for a source is
1118-// called from the source's dispatch function.
1177+// called from the source’s dispatch function.
11191178 //
11201179 // The exact type of @func depends on the type of source; ie. you
11211180 // should not count on @func being called with @data as its first
11221181 // parameter. Cast @func with [func@GLib.SOURCE_FUNC] to avoid warnings about
11231182 // incompatible function types.
11241183 //
1125-// See [mainloop memory management](main-loop.html#memory-management-of-sources) for details
1184+// See [main loop memory management](main-loop.html#memory-management-of-sources) for details
11261185 // on how to handle memory management of @data.
11271186 //
1128-// Typically, you won't use this function. Instead use functions specific
1187+// Typically, you won’t use this function. Instead use functions specific
11291188 // to the type of source you are using, such as [func@GLib.idle_add] or
11301189 // [func@GLib.timeout_add].
11311190 //
@@ -1143,12 +1202,14 @@ func (x *Source) SetCallback(FuncVar *SourceFunc, DataVar uintptr, NotifyVar *De
11431202
11441203 var xSourceSetCallbackIndirect func(uintptr, uintptr, *SourceCallbackFuncs)
11451204
1146-// Sets the callback function storing the data as a refcounted callback
1147-// "object". This is used internally. Note that calling
1205+// Sets the callback function storing the data as a reference counted callback
1206+// ‘object’.
1207+//
1208+// This is used internally. Note that calling
11481209 // [method@GLib.Source.set_callback_indirect] assumes
11491210 // an initial reference count on @callback_data, and thus
1150-// @callback_funcs-&gt;unref will eventually be called once more
1151-// than @callback_funcs-&gt;ref.
1211+// `callback_funcs-&gt;unref` will eventually be called once more than
1212+// `callback_funcs-&gt;ref`.
11521213 //
11531214 // It is safe to call this function multiple times on a source which has already
11541215 // been attached to a context. The changes will take effect for the next time
@@ -1161,9 +1222,10 @@ func (x *Source) SetCallbackIndirect(CallbackDataVar uintptr, CallbackFuncsVar *
11611222
11621223 var xSourceSetCanRecurse func(uintptr, bool)
11631224
1164-// Sets whether a source can be called recursively. If @can_recurse is
1165-// %TRUE, then while the source is being dispatched then this source
1166-// will be processed normally. Otherwise, all processing of this
1225+// Sets whether a source can be called recursively.
1226+//
1227+// If @can_recurse is true, then while the source is being dispatched then this
1228+// source will be processed normally. Otherwise, all processing of this
11671229 // source is blocked until the dispatch function returns.
11681230 func (x *Source) SetCanRecurse(CanRecurseVar bool) {
11691231
@@ -1173,23 +1235,26 @@ func (x *Source) SetCanRecurse(CanRecurseVar bool) {
11731235
11741236 var xSourceSetDisposeFunction func(uintptr, uintptr)
11751237
1176-// Set @dispose as dispose function on @source. @dispose will be called once
1177-// the reference count of @source reaches 0 but before any of the state of the
1178-// source is freed, especially before the finalize function is called.
1238+// Set @dispose as dispose function on @source.
1239+//
1240+// The @dispose function will be called once the reference count of @source
1241+// reaches zero but before any of the state of the source is freed, especially
1242+// before the finalize function (set as part of the [type@GLib.SourceFuncs]) is
1243+// called.
11791244 //
11801245 // This means that at this point @source is still a valid [struct@GLib.Source]
11811246 // and it is allow for the reference count to increase again until @dispose
11821247 // returns.
11831248 //
1184-// The dispose function can be used to clear any "weak" references to the
1185-// @source in other data structures in a thread-safe way where it is possible
1186-// for another thread to increase the reference count of @source again while
1187-// it is being freed.
1249+// The dispose function can be used to clear any ‘weak’ references to
1250+// the @source in other data structures in a thread-safe way where it is
1251+// possible for another thread to increase the reference count of @source again
1252+// while it is being freed.
11881253 //
1189-// The finalize function can not be used for this purpose as at that point
1190-// @source is already partially freed and not valid anymore.
1254+// The finalize function can not be used for this purpose as at that
1255+// point @source is already partially freed and not valid any more.
11911256 //
1192-// This should only ever be called from #GSource implementations.
1257+// This should only ever be called from [struct@GLib.Source] implementations.
11931258 func (x *Source) SetDisposeFunction(DisposeVar *SourceDisposeFunc) {
11941259
11951260 xSourceSetDisposeFunction(x.GoPointer(), NewCallback(DisposeVar))
@@ -1198,8 +1263,10 @@ func (x *Source) SetDisposeFunction(DisposeVar *SourceDisposeFunc) {
11981263
11991264 var xSourceSetFuncs func(uintptr, *SourceFuncs)
12001265
1201-// Sets the source functions (can be used to override
1202-// default implementations) of an unattached source.
1266+// Sets the source functions of an unattached source.
1267+//
1268+// These can be used to override the default implementations for the type
1269+// of @source.
12031270 func (x *Source) SetFuncs(FuncsVar *SourceFuncs) {
12041271
12051272 xSourceSetFuncs(x.GoPointer(), FuncsVar)
@@ -1209,16 +1276,18 @@ func (x *Source) SetFuncs(FuncsVar *SourceFuncs) {
12091276 var xSourceSetName func(uintptr, string)
12101277
12111278 // Sets a name for the source, used in debugging and profiling.
1212-// The name defaults to #NULL.
1279+//
1280+// The name defaults to `NULL`.
12131281 //
12141282 // The source name should describe in a human-readable way
1215-// what the source does. For example, "X11 event queue"
1216-// or "GTK repaint idle handler" or whatever it is.
1283+// what the source does. For example, ‘X11 event queue’
1284+// or ‘GTK repaint idle handler’.
12171285 //
12181286 // It is permitted to call this function multiple times, but is not
12191287 // recommended due to the potential performance impact. For example,
1220-// one could change the name in the "check" function of a #GSourceFuncs
1221-// to include details like the event type in the source name.
1288+// one could change the name in the `check` function of a
1289+// [struct@GLib.SourceFuncs] to include details like the event type in the
1290+// source name.
12221291 //
12231292 // Use caution if changing the name while another thread may be
12241293 // accessing it with [method@GLib.Source.get_name]; that function does not copy
@@ -1234,7 +1303,9 @@ func (x *Source) SetName(NameVar string) {
12341303
12351304 var xSourceSetPriority func(uintptr, int)
12361305
1237-// Sets the priority of a source. While the main loop is being run, a
1306+// Sets the priority of a source.
1307+//
1308+// While the main loop is being run, a
12381309 // source will be dispatched if it is ready to be dispatched and no
12391310 // sources at a higher (numerically smaller) priority are ready to be
12401311 // dispatched.
@@ -1250,12 +1321,14 @@ func (x *Source) SetPriority(PriorityVar int) {
12501321
12511322 var xSourceSetReadyTime func(uintptr, int64)
12521323
1253-// Sets a #GSource to be dispatched when the given monotonic time is
1254-// reached (or passed). If the monotonic time is in the past (as it
1255-// always will be if @ready_time is 0) then the source will be
1324+// Sets a source to be dispatched when the given monotonic time is
1325+// reached (or passed).
1326+//
1327+// If the monotonic time is in the past (as it
1328+// always will be if @ready_time is `0`) then the source will be
12561329 // dispatched immediately.
12571330 //
1258-// If @ready_time is -1 then the source is never woken up on the basis
1331+// If @ready_time is `-1` then the source is never woken up on the basis
12591332 // of the passage of time.
12601333 //
12611334 // Dispatching the source does not reset the ready time. You should do
@@ -1267,11 +1340,11 @@ var xSourceSetReadyTime func(uintptr, int64)
12671340 // for both sources is reached during the same main context iteration,
12681341 // then the order of dispatch is undefined.
12691342 //
1270-// It is a no-op to call this function on a #GSource which has already been
1271-// destroyed with [method@GLib.Source.destroy].
1343+// It is a no-op to call this function on a [struct@GLib.Source] which has
1344+// already been destroyed with [method@GLib.Source.destroy].
12721345 //
1273-// This API is only intended to be used by implementations of #GSource.
1274-// Do not call this API on a #GSource that you did not create.
1346+// This API is only intended to be used by implementations of [struct@GLib.Source].
1347+// Do not call this API on a [struct@GLib.Source] that you did not create.
12751348 func (x *Source) SetReadyTime(ReadyTimeVar int64) {
12761349
12771350 xSourceSetReadyTime(x.GoPointer(), ReadyTimeVar)
@@ -1291,8 +1364,9 @@ func (x *Source) SetStaticName(NameVar string) {
12911364
12921365 var xSourceUnref func(uintptr)
12931366
1294-// Decreases the reference count of a source by one. If the
1295-// resulting reference count is zero the source and associated
1367+// Decreases the reference count of a source by one.
1368+//
1369+// If the resulting reference count is zero the source and associated
12961370 // memory will be destroyed.
12971371 func (x *Source) Unref() {
12981372
@@ -1503,15 +1577,15 @@ var xChildWatchAdd func(Pid, uintptr, uintptr) uint
15031577 //
15041578 // If you obtain @pid from [func@GLib.spawn_async] or
15051579 // [func@GLib.spawn_async_with_pipes] you will need to pass
1506-// %G_SPAWN_DO_NOT_REAP_CHILD as flag to the spawn function for the child
1507-// watching to work.
1580+// [flags@GLib.SpawnFlags.DO_NOT_REAP_CHILD] as a flag to the spawn function for
1581+// the child watching to work.
15081582 //
1509-// Note that on platforms where #GPid must be explicitly closed
1583+// Note that on platforms where [type@GLib.Pid] must be explicitly closed
15101584 // (see [func@GLib.spawn_close_pid]) @pid must not be closed while the
15111585 // source is still active. Typically, you will want to call
15121586 // [func@GLib.spawn_close_pid] in the callback function for the source.
15131587 //
1514-// GLib supports only a single callback per process id.
1588+// GLib supports only a single callback per process ID.
15151589 // On POSIX platforms, the same restrictions mentioned for
15161590 // [func@GLib.child_watch_source_new] apply to this function.
15171591 //
@@ -1532,19 +1606,19 @@ var xChildWatchAddFull func(int, Pid, uintptr, uintptr, uintptr) uint
15321606 //
15331607 // If you obtain @pid from [func@GLib.spawn_async] or
15341608 // [func@GLib.spawn_async_with_pipes] you will need to pass
1535-// %G_SPAWN_DO_NOT_REAP_CHILD as flag to the spawn function for the child
1536-// watching to work.
1609+// [flags@GLib.SpawnFlags.DO_NOT_REAP_CHILD] as a flag to the spawn function for
1610+// the child watching to work.
15371611 //
15381612 // In many programs, you will want to call [func@GLib.spawn_check_wait_status]
15391613 // in the callback to determine whether or not the child exited
15401614 // successfully.
15411615 //
1542-// Also, note that on platforms where #GPid must be explicitly closed
1616+// Also, note that on platforms where [type@GLib.Pid] must be explicitly closed
15431617 // (see [func@GLib.spawn_close_pid]) @pid must not be closed while the source
15441618 // is still active. Typically, you should invoke [func@GLib.spawn_close_pid]
15451619 // in the callback function for the source.
15461620 //
1547-// GLib supports only a single callback per process id.
1621+// GLib supports only a single callback per process ID.
15481622 // On POSIX platforms, the same restrictions mentioned for
15491623 // [func@GLib.child_watch_source_new] apply to this function.
15501624 //
@@ -1560,16 +1634,16 @@ func ChildWatchAddFull(PriorityVar int, PidVar Pid, FunctionVar *ChildWatchFunc,
15601634
15611635 var xChildWatchSourceNew func(Pid) *Source
15621636
1563-// Creates a new child_watch source.
1637+// Creates a new child watch source.
15641638 //
15651639 // The source will not initially be associated with any
15661640 // [struct@GLib.MainContext] and must be added to one with
15671641 // [method@GLib.Source.attach] before it will be executed.
15681642 //
15691643 // Note that child watch sources can only be used in conjunction with
1570-// `g_spawn...` when the %G_SPAWN_DO_NOT_REAP_CHILD flag is used.
1644+// `g_spawn...` when the [flags@GLib.SpawnFlags.DO_NOT_REAP_CHILD] flag is used.
15711645 //
1572-// Note that on platforms where #GPid must be explicitly closed
1646+// Note that on platforms where [type@GLib.Pid] must be explicitly closed
15731647 // (see [func@GLib.spawn_close_pid]) @pid must not be closed while the
15741648 // source is still active. Typically, you will want to call
15751649 // [func@GLib.spawn_close_pid] in the callback function for the source.
@@ -1577,29 +1651,29 @@ var xChildWatchSourceNew func(Pid) *Source
15771651 // On POSIX platforms, the following restrictions apply to this API
15781652 // due to limitations in POSIX process interfaces:
15791653 //
1580-// - @pid must be a child of this process
1581-// - @pid must be positive
1582-// - the application must not call `waitpid` with a non-positive
1583-// first argument, for instance in another thread
1584-// - the application must not wait for @pid to exit by any other
1654+// - @pid must be a child of this process.
1655+// - @pid must be positive.
1656+// - The application must not call [`waitpid()`](man:waitpid(1)) with a
1657+// non-positive first argument, for instance in another thread.
1658+// - The application must not wait for @pid to exit by any other
15851659 // mechanism, including `waitpid(pid, ...)` or a second child-watch
1586-// source for the same @pid
1587-// - the application must not ignore `SIGCHLD`
1588-// - Before 2.78, the application could not send a signal (`kill()`) to the
1660+// source for the same @pid.
1661+// - The application must not ignore `SIGCHLD`.
1662+// - Before 2.78, the application could not send a signal ([`kill()`](man:kill(2))) to the
15891663 // watched @pid in a race free manner. Since 2.78, you can do that while the
15901664 // associated [struct@GLib.MainContext] is acquired.
15911665 // - Before 2.78, even after destroying the [struct@GLib.Source], you could not
1592-// be sure that @pid wasn't already reaped. Hence, it was also not
1666+// be sure that @pid wasn’t already reaped. Hence, it was also not
15931667 // safe to `kill()` or `waitpid()` on the process ID after the child watch
15941668 // source was gone. Destroying the source before it fired made it
15951669 // impossible to reliably reap the process.
15961670 //
15971671 // If any of those conditions are not met, this and related APIs will
15981672 // not work correctly. This can often be diagnosed via a GLib warning
1599-// stating that `ECHILD` was received by `waitpid`.
1673+// stating that `ECHILD` was received by `waitpid()`.
16001674 //
1601-// Calling `waitpid` for specific processes other than @pid remains a
1602-// valid thing to do.
1675+// Calling [`waitpid()`](man:waitpid(2)) for specific processes other than @pid
1676+// remains a valid thing to do.
16031677 func ChildWatchSourceNew(PidVar Pid) *Source {
16041678
16051679 cret := xChildWatchSourceNew(PidVar)
@@ -1608,9 +1682,9 @@ func ChildWatchSourceNew(PidVar Pid) *Source {
16081682
16091683 var xClearHandleId func(uint, uintptr)
16101684
1611-// Clears a numeric handler, such as a #GSource ID.
1685+// Clears a numeric handler, such as a [struct@GLib.Source] ID.
16121686 //
1613-// @tag_ptr must be a valid pointer to the variable holding the handler.
1687+// The @tag_ptr must be a valid pointer to the variable holding the handler.
16141688 //
16151689 // If the ID is zero then this function does nothing.
16161690 // Otherwise, @clear_func is called with the ID as a parameter, and the tag is
@@ -1626,7 +1700,10 @@ func ClearHandleId(TagPtrVar uint, ClearFuncVar *ClearHandleFunc) {
16261700
16271701 var xGetCurrentTime func(*TimeVal)
16281702
1629-// Equivalent to the UNIX gettimeofday() function, but portable.
1703+// Queries the system wall-clock time.
1704+//
1705+// This is equivalent to the UNIX [`gettimeofday()`](man:gettimeofday(2))
1706+// function, but portable.
16301707 //
16311708 // You may find [func@GLib.get_real_time] to be more convenient.
16321709 func GetCurrentTime(ResultVar *TimeVal) {
@@ -1639,13 +1716,14 @@ var xGetMonotonicTime func() int64
16391716
16401717 // Queries the system monotonic time.
16411718 //
1642-// The monotonic clock will always increase and doesn't suffer
1719+// The monotonic clock will always increase and doesn’t suffer
16431720 // discontinuities when the user (or NTP) changes the system time. It
16441721 // may or may not continue to tick during times where the machine is
16451722 // suspended.
16461723 //
16471724 // We try to use the clock that corresponds as closely as possible to
1648-// the passage of time as measured by system calls such as poll() but it
1725+// the passage of time as measured by system calls such as
1726+// [`poll()`](man:poll(2)) but it
16491727 // may not always be possible to do this.
16501728 func GetMonotonicTime() int64 {
16511729
@@ -1657,9 +1735,8 @@ var xGetRealTime func() int64
16571735
16581736 // Queries the system wall-clock time.
16591737 //
1660-// This call is functionally equivalent to [func@GLib.get_current_time] except
1661-// that the return value is often more convenient than dealing with a
1662-// #GTimeVal.
1738+// This is equivalent to the UNIX [`gettimeofday()`](man:gettimeofday(2))
1739+// function, but portable.
16631740 //
16641741 // You should only use this call if you are actually interested in the real
16651742 // wall-clock time. [func@GLib.get_monotonic_time] is probably more useful for
@@ -1673,12 +1750,14 @@ func GetRealTime() int64 {
16731750 var xIdleAdd func(uintptr, uintptr) uint
16741751
16751752 // Adds a function to be called whenever there are no higher priority
1676-// events pending to the default main loop. The function is given the
1753+// events pending to the default main loop.
1754+//
1755+// The function is given the
16771756 // default idle priority, [const@GLib.PRIORITY_DEFAULT_IDLE]. If the function
1678-// returns %FALSE it is automatically removed from the list of event
1679-// sources and will not be called again.
1757+// returns [const@GLib.SOURCE_REMOVE] it is automatically removed from the list
1758+// of event sources and will not be called again.
16801759 //
1681-// See [mainloop memory management](main-loop.html#memory-management-of-sources) for details
1760+// See [main loop memory management](main-loop.html#memory-management-of-sources) for details
16821761 // on how to handle the return value and memory management of @data.
16831762 //
16841763 // This internally creates a main loop source using [func@GLib.idle_source_new]
@@ -1697,10 +1776,10 @@ var xIdleAddFull func(int, uintptr, uintptr, uintptr) uint
16971776 // Adds a function to be called whenever there are no higher priority
16981777 // events pending.
16991778 //
1700-// If the function returns [const@GLib.SOURCE_REMOVE] or %FALSE it is automatically
1779+// If the function returns [const@GLib.SOURCE_REMOVE] it is automatically
17011780 // removed from the list of event sources and will not be called again.
17021781 //
1703-// See [mainloop memory management](main-loop.html#memory-management-of-sources) for details
1782+// See [main loop memory management](main-loop.html#memory-management-of-sources) for details
17041783 // on how to handle the return value and memory management of @data.
17051784 //
17061785 // This internally creates a main loop source using [func@GLib.idle_source_new]
@@ -1717,7 +1796,9 @@ func IdleAddFull(PriorityVar int, FunctionVar *SourceFunc, DataVar uintptr, Noti
17171796 var xIdleAddOnce func(uintptr, uintptr) uint
17181797
17191798 // Adds a function to be called whenever there are no higher priority
1720-// events pending to the default main loop. The function is given the
1799+// events pending to the default main loop.
1800+//
1801+// The function is given the
17211802 // default idle priority, [const@GLib.PRIORITY_DEFAULT_IDLE].
17221803 //
17231804 // The function will only be called once and then the source will be
@@ -1757,9 +1838,11 @@ func IdleSourceNew() *Source {
17571838
17581839 var xMainContextDefault func() *MainContext
17591840
1760-// Returns the global-default main context. This is the main context
1841+// Returns the global-default main context.
1842+//
1843+// This is the main context
17611844 // used for main loop functions when a main loop is not explicitly
1762-// specified, and corresponds to the "main" main loop. See also
1845+// specified, and corresponds to the ‘main’ main loop. See also
17631846 // [func@GLib.MainContext.get_thread_default].
17641847 func MainContextDefault() *MainContext {
17651848
@@ -1769,14 +1852,15 @@ func MainContextDefault() *MainContext {
17691852
17701853 var xMainContextGetThreadDefault func() *MainContext
17711854
1772-// Gets the thread-default #GMainContext for this thread. Asynchronous
1773-// operations that want to be able to be run in contexts other than
1855+// Gets the thread-default main context for this thread.
1856+//
1857+// Asynchronous operations that want to be able to be run in contexts other than
17741858 // the default one should call this method or
17751859 // [func@GLib.MainContext.ref_thread_default] to get a
17761860 // [struct@GLib.MainContext] to add their [struct@GLib.Source]s to. (Note that
17771861 // even in single-threaded programs applications may sometimes want to
17781862 // temporarily push a non-default context, so it is not safe to assume that
1779-// this will always return %NULL if you are running in the default thread.)
1863+// this will always return `NULL` if you are running in the default thread.)
17801864 //
17811865 // If you need to hold a reference on the context, use
17821866 // [func@GLib.MainContext.ref_thread_default] instead.
@@ -1788,13 +1872,16 @@ func MainContextGetThreadDefault() *MainContext {
17881872
17891873 var xMainContextRefThreadDefault func() *MainContext
17901874
1791-// Gets the thread-default [struct@GLib.MainContext] for this thread, as with
1792-// [func@GLib.MainContext.get_thread_default], but also adds a reference to
1793-// it with [method@GLib.MainContext.ref]. In addition, unlike
1875+// Gets a reference to the thread-default [struct@GLib.MainContext] for this
1876+// thread
1877+//
1878+// This is the same as [func@GLib.MainContext.get_thread_default], but it also
1879+// adds a reference to the returned main context with [method@GLib.MainContext.ref].
1880+// In addition, unlike
17941881 // [func@GLib.MainContext.get_thread_default], if the thread-default context
17951882 // is the global-default context, this will return that
17961883 // [struct@GLib.MainContext] (with a ref added to it) rather than returning
1797-// %NULL.
1884+// `NULL`.
17981885 func MainContextRefThreadDefault() *MainContext {
17991886
18001887 cret := xMainContextRefThreadDefault()
@@ -1814,16 +1901,17 @@ var xMainDepth func() int
18141901
18151902 // Returns the depth of the stack of calls to
18161903 // [method@GLib.MainContext.dispatch] on any #GMainContext in the current thread.
1817-// That is, when called from the toplevel, it gives 0. When
1904+//
1905+// That is, when called from the top level, it gives `0`. When
18181906 // called from within a callback from [method@GLib.MainContext.iteration]
1819-// (or [method@GLib.MainLoop.run], etc.) it returns 1. When called from within
1907+// (or [method@GLib.MainLoop.run], etc.) it returns `1`. When called from within
18201908 // a callback to a recursive call to [method@GLib.MainContext.iteration],
1821-// it returns 2. And so forth.
1909+// it returns `2`. And so forth.
18221910 //
18231911 // This function is useful in a situation like the following:
1824-// Imagine an extremely simple "garbage collected" system.
1912+// Imagine an extremely simple ‘garbage collected’ system.
18251913 //
1826-// |[&lt;!-- language="C" --&gt;
1914+// ```c
18271915 // static GList *free_list;
18281916 //
18291917 // gpointer
@@ -1855,16 +1943,16 @@ var xMainDepth func() int
18551943 // free_allocated_memory();
18561944 // }
18571945 //
1858-// ]|
1946+// ```
18591947 //
18601948 // This works from an application, however, if you want to do the same
18611949 // thing from a library, it gets more difficult, since you no longer
18621950 // control the main loop. You might think you can simply use an idle
1863-// function to make the call to free_allocated_memory(), but that
1864-// doesn't work, since the idle function could be called from a
1951+// function to make the call to `free_allocated_memory()`, but that
1952+// doesn’t work, since the idle function could be called from a
18651953 // recursive callback. This can be fixed by using [func@GLib.main_depth]
18661954 //
1867-// |[&lt;!-- language="C" --&gt;
1955+// ```c
18681956 // gpointer
18691957 // allocate_memory (gsize size)
18701958 //
@@ -1898,25 +1986,25 @@ var xMainDepth func() int
18981986 // }
18991987 // }
19001988 //
1901-// ]|
1989+// ```
19021990 //
19031991 // There is a temptation to use [func@GLib.main_depth] to solve
19041992 // problems with reentrancy. For instance, while waiting for data
19051993 // to be received from the network in response to a menu item,
19061994 // the menu item might be selected again. It might seem that
1907-// one could make the menu item's callback return immediately
1995+// one could make the menu item’s callback return immediately
19081996 // and do nothing if [func@GLib.main_depth] returns a value greater than 1.
19091997 // However, this should be avoided since the user then sees selecting
1910-// the menu item do nothing. Furthermore, you'll find yourself adding
1998+// the menu item do nothing. Furthermore, you’ll find yourself adding
19111999 // these checks all over your code, since there are doubtless many,
19122000 // many things that the user could do. Instead, you can use the
19132001 // following techniques:
19142002 //
1915-// 1. Use gtk_widget_set_sensitive() or modal dialogs to prevent
2003+// 1. Use `gtk_widget_set_sensitive()` or modal dialogs to prevent
19162004 // the user from interacting with elements while the main
19172005 // loop is recursing.
19182006 //
1919-// 2. Avoid main loop recursion in situations where you can't handle
2007+// 2. Avoid main loop recursion in situations where you can’t handle
19202008 // arbitrary callbacks. Instead, structure your code so that you
19212009 // simply return to the main loop and then get called again when
19222010 // there is more work to do.
@@ -1928,10 +2016,12 @@ func MainDepth() int {
19282016
19292017 var xSourceRemove func(uint) bool
19302018
1931-// Removes the source with the given ID from the default main context. You must
2019+// Removes the source with the given ID from the default main context.
2020+//
2021+// You must
19322022 // use [method@GLib.Source.destroy] for sources added to a non-default main context.
19332023 //
1934-// The ID of a #GSource is given by [method@GLib.Source.get_id], or will be
2024+// The ID of a [struct@GLib.Source] is given by [method@GLib.Source.get_id], or will be
19352025 // returned by the functions [method@GLib.Source.attach], [func@GLib.idle_add],
19362026 // [func@GLib.idle_add_full], [func@GLib.timeout_add],
19372027 // [func@GLib.timeout_add_full], [func@GLib.child_watch_add],
@@ -1957,8 +2047,10 @@ func SourceRemove(TagVar uint) bool {
19572047 var xSourceRemoveByFuncsUserData func(*SourceFuncs, uintptr) bool
19582048
19592049 // Removes a source from the default main loop context given the
1960-// source functions and user data. If multiple sources exist with the
1961-// same source functions and user data, only one will be destroyed.
2050+// source functions and user data.
2051+//
2052+// If multiple sources exist with the same source functions and user data, only
2053+// one will be destroyed.
19622054 func SourceRemoveByFuncsUserData(FuncsVar *SourceFuncs, UserDataVar uintptr) bool {
19632055
19642056 cret := xSourceRemoveByFuncsUserData(FuncsVar, UserDataVar)
@@ -1968,8 +2060,9 @@ func SourceRemoveByFuncsUserData(FuncsVar *SourceFuncs, UserDataVar uintptr) boo
19682060 var xSourceRemoveByUserData func(uintptr) bool
19692061
19702062 // Removes a source from the default main loop context given the user
1971-// data for the callback. If multiple sources exist with the same user
1972-// data, only one will be destroyed.
2063+// data for the callback.
2064+//
2065+// If multiple sources exist with the same user data, only one will be destroyed.
19732066 func SourceRemoveByUserData(UserDataVar uintptr) bool {
19742067
19752068 cret := xSourceRemoveByUserData(UserDataVar)
@@ -2006,7 +2099,7 @@ var xTimeoutAdd func(uint, uintptr, uintptr) uint
20062099 // priority, [const@GLib.PRIORITY_DEFAULT].
20072100 //
20082101 // The given @function is called repeatedly until it returns
2009-// [const@GLib.SOURCE_REMOVE] or %FALSE, at which point the timeout is
2102+// [const@GLib.SOURCE_REMOVE], at which point the timeout is
20102103 // automatically destroyed and the function will not be called again. The first
20112104 // call to the function will be at the end of the first @interval.
20122105 //
@@ -2014,12 +2107,12 @@ var xTimeoutAdd func(uint, uintptr, uintptr) uint
20142107 // event sources. Thus they should not be relied on for precise timing.
20152108 // After each call to the timeout function, the time of the next
20162109 // timeout is recalculated based on the current time and the given interval
2017-// (it does not try to 'catch up' time lost in delays).
2110+// (it does not try to ‘catch up’ time lost in delays).
20182111 //
2019-// See [mainloop memory management](main-loop.html#memory-management-of-sources) for details
2112+// See [main loop memory management](main-loop.html#memory-management-of-sources) for details
20202113 // on how to handle the return value and memory management of @data.
20212114 //
2022-// If you want to have a timer in the "seconds" range and do not care
2115+// If you want to have a timer in the ‘seconds’ range and do not care
20232116 // about the exact time of the first call of the timer, use the
20242117 // [func@GLib.timeout_add_seconds] function; this function allows for more
20252118 // optimizations and more efficient system power usage.
@@ -2044,8 +2137,11 @@ func TimeoutAdd(IntervalVar uint, FunctionVar *SourceFunc, DataVar uintptr) uint
20442137 var xTimeoutAddFull func(int, uint, uintptr, uintptr, uintptr) uint
20452138
20462139 // Sets a function to be called at regular intervals, with the given
2047-// priority. The function is called repeatedly until it returns
2048-// %FALSE, at which point the timeout is automatically destroyed and
2140+// priority.
2141+//
2142+// The function is called repeatedly until it returns
2143+// [const@GLib.SOURCE_REMOVE], at which point the timeout is automatically
2144+// destroyed and
20492145 // the function will not be called again. The @notify function is
20502146 // called when the timeout is destroyed. The first call to the
20512147 // function will be at the end of the first @interval.
@@ -2054,9 +2150,9 @@ var xTimeoutAddFull func(int, uint, uintptr, uintptr, uintptr) uint
20542150 // event sources. Thus they should not be relied on for precise timing.
20552151 // After each call to the timeout function, the time of the next
20562152 // timeout is recalculated based on the current time and the given interval
2057-// (it does not try to 'catch up' time lost in delays).
2153+// (it does not try to ‘catch up’ time lost in delays).
20582154 //
2059-// See [mainloop memory management](main-loop.html#memory-management-of-sources) for details
2155+// See [main loop memory management](main-loop.html#memory-management-of-sources) for details
20602156 // on how to handle the return value and memory management of @data.
20612157 //
20622158 // This internally creates a main loop source using
@@ -2094,8 +2190,8 @@ var xTimeoutAddSeconds func(uint, uintptr, uintptr) uint
20942190 // Sets a function to be called at regular intervals with the default
20952191 // priority, [const@GLib.PRIORITY_DEFAULT].
20962192 //
2097-// The function is called repeatedly until it returns [const@GLib.SOURCE_REMOVE]
2098-// or %FALSE, at which point the timeout is automatically destroyed
2193+// The function is called repeatedly until it returns [const@GLib.SOURCE_REMOVE],
2194+// at which point the timeout is automatically destroyed
20992195 // and the function will not be called again.
21002196 //
21012197 // This internally creates a main loop source using
@@ -2109,7 +2205,7 @@ var xTimeoutAddSeconds func(uint, uintptr, uintptr) uint
21092205 // of one second. If you need finer precision and have such a timeout,
21102206 // you may want to use [func@GLib.timeout_add] instead.
21112207 //
2112-// See [mainloop memory management](main-loop.html#memory-management-of-sources) for details
2208+// See [main loop memory management](main-loop.html#memory-management-of-sources) for details
21132209 // on how to handle the return value and memory management of @data.
21142210 //
21152211 // The interval given is in terms of monotonic time, not wall clock
@@ -2124,15 +2220,15 @@ var xTimeoutAddSecondsFull func(int, uint, uintptr, uintptr, uintptr) uint
21242220
21252221 // Sets a function to be called at regular intervals, with @priority.
21262222 //
2127-// The function is called repeatedly until it returns [const@GLib.SOURCE_REMOVE]
2128-// or %FALSE, at which point the timeout is automatically destroyed and
2223+// The function is called repeatedly until it returns [const@GLib.SOURCE_REMOVE],
2224+// at which point the timeout is automatically destroyed and
21292225 // the function will not be called again.
21302226 //
21312227 // Unlike [func@GLib.timeout_add], this function operates at whole second
21322228 // granularity. The initial starting point of the timer is determined by the
21332229 // implementation and the implementation is expected to group multiple timers
2134-// together so that they fire all at the same time. To allow this grouping, the
2135-// @interval to the first timer is rounded and can deviate up to one second
2230+// together so that they fire all at the same time. To allow this grouping,
2231+// the @interval to the first timer is rounded and can deviate up to one second
21362232 // from the specified interval. Subsequent timer iterations will generally run
21372233 // at the specified interval.
21382234 //
@@ -2141,7 +2237,7 @@ var xTimeoutAddSecondsFull func(int, uint, uintptr, uintptr, uintptr) uint
21412237 // After each call to the timeout function, the time of the next
21422238 // timeout is recalculated based on the current time and the given @interval
21432239 //
2144-// See [mainloop memory management](main-loop.html#memory-management-of-sources) for details
2240+// See [main loop memory management](main-loop.html#memory-management-of-sources) for details
21452241 // on how to handle the return value and memory management of @data.
21462242 //
21472243 // If you want timing more precise than whole seconds, use
@@ -2149,7 +2245,7 @@ var xTimeoutAddSecondsFull func(int, uint, uintptr, uintptr, uintptr) uint
21492245 //
21502246 // The grouping of timers to fire at the same time results in a more power
21512247 // and CPU efficient behavior so if your timer is in multiples of seconds
2152-// and you don't require the first timer exactly one second from now, the
2248+// and you don’t require the first timer exactly one second from now, the
21532249 // use of [func@GLib.timeout_add_seconds] is preferred over
21542250 // [func@GLib.timeout_add].
21552251 //
@@ -2306,6 +2402,7 @@ func init() {
23062402 core.PuregoSafeRegister(&xSourceAddUnixFd, libs, "g_source_add_unix_fd")
23072403 core.PuregoSafeRegister(&xSourceAttach, libs, "g_source_attach")
23082404 core.PuregoSafeRegister(&xSourceDestroy, libs, "g_source_destroy")
2405+ core.PuregoSafeRegister(&xSourceDupContext, libs, "g_source_dup_context")
23092406 core.PuregoSafeRegister(&xSourceGetCanRecurse, libs, "g_source_get_can_recurse")
23102407 core.PuregoSafeRegister(&xSourceGetContext, libs, "g_source_get_context")
23112408 core.PuregoSafeRegister(&xSourceGetCurrentTime, libs, "g_source_get_current_time")
M v4/glib/gmarkup.go +4 -0
@@ -334,6 +334,10 @@ func (x *MarkupParseContext) Unref() {
334334 // errors are intended to be set from these callbacks. If you set an error
335335 // from a callback, g_markup_parse_context_parse() will report that error
336336 // back to its caller.
337+//
338+// Refer to the [GMarkup](../glib/markup.html) documentation to understand
339+// the scope and limitations of `GMarkupParser`. In particular, it is not a
340+// full XML parser and it must not be used to process untrusted data.
337341 type MarkupParser struct {
338342 _ structs.HostLayout
339343
M v4/glib/gmessages.go +41 -1
@@ -218,6 +218,45 @@ func LogDefaultHandler(LogDomainVar string, LogLevelVar LogLevelFlags, MessageVa
218218
219219 }
220220
221+var xLogGetAlwaysFatal func() LogLevelFlags
222+
223+// Gets the current fatal mask.
224+//
225+// This is mostly used by custom log writers to make fatal messages
226+// (`fatal-warnings`, `fatal-criticals`) work as expected, when using the
227+// `G_DEBUG` environment variable (see [Running GLib Applications](running.html)).
228+//
229+// An example usage is shown below:
230+//
231+// ```c
232+// static GLogWriterOutput
233+// my_custom_log_writer_fn (GLogLevelFlags log_level,
234+//
235+// const GLogField *fields,
236+// gsize n_fields,
237+// gpointer user_data)
238+//
239+// {
240+//
241+// // abort if the message was fatal
242+// if (log_level &amp; g_log_get_always_fatal ())
243+// g_abort ();
244+//
245+// // custom log handling code
246+// ...
247+// ...
248+//
249+// // success
250+// return G_LOG_WRITER_HANDLED;
251+// }
252+//
253+// ```
254+func LogGetAlwaysFatal() LogLevelFlags {
255+
256+ cret := xLogGetAlwaysFatal()
257+ return cret
258+}
259+
221260 var xLogGetDebugEnabled func() bool
222261
223262 // Return whether debug output from the GLib logging system is enabled.
@@ -257,7 +296,7 @@ var xLogSetAlwaysFatal func(LogLevelFlags) LogLevelFlags
257296 //
258297 // You can also make some message levels fatal at runtime by setting
259298 // the `G_DEBUG` environment variable (see
260-// [Running GLib Applications](glib-running.html)).
299+// [Running GLib Applications](running.html)).
261300 //
262301 // Libraries should not call this function, as it affects all messages logged
263302 // by a process, including those from other libraries.
@@ -936,6 +975,7 @@ func init() {
936975 core.PuregoSafeRegister(&xAssertWarning, libs, "g_assert_warning")
937976 core.PuregoSafeRegister(&xLog, libs, "g_log")
938977 core.PuregoSafeRegister(&xLogDefaultHandler, libs, "g_log_default_handler")
978+ core.PuregoSafeRegister(&xLogGetAlwaysFatal, libs, "g_log_get_always_fatal")
939979 core.PuregoSafeRegister(&xLogGetDebugEnabled, libs, "g_log_get_debug_enabled")
940980 core.PuregoSafeRegister(&xLogRemoveHandler, libs, "g_log_remove_handler")
941981 core.PuregoSafeRegister(&xLogSetAlwaysFatal, libs, "g_log_set_always_fatal")
M v4/glib/gpathbuf.go +1 -1
@@ -262,7 +262,7 @@ var xPathBufEqual func(uintptr, uintptr) bool
262262 // Compares two path buffers for equality and returns `TRUE`
263263 // if they are equal.
264264 //
265-// The path inside the paths buffers are not going to be normalized,
265+// The paths inside the path buffers are not going to be normalized,
266266 // so `X/Y/Z/A/..`, `X/./Y/Z` and `X/Y/Z` are not going to be considered
267267 // equal.
268268 //
M v4/glib/gregex.go +339 -59
@@ -133,6 +133,9 @@ var xMatchInfoFetchNamedPos func(uintptr, string, int, int) bool
133133 // If @name is a valid sub pattern name but it didn't match anything
134134 // (e.g. sub pattern `"X"`, matching `"b"` against `"(?P&lt;X&gt;a)?b"`)
135135 // then @start_pos and @end_pos are set to -1 and %TRUE is returned.
136+//
137+// As @end_pos is set to the byte after the final byte of the match (on success),
138+// the length of the match can be calculated as `end_pos - start_pos`.
136139 func (x *MatchInfo) FetchNamedPos(NameVar string, StartPosVar int, EndPosVar int) bool {
137140
138141 cret := xMatchInfoFetchNamedPos(x.GoPointer(), NameVar, StartPosVar, EndPosVar)
@@ -141,19 +144,213 @@ func (x *MatchInfo) FetchNamedPos(NameVar string, StartPosVar int, EndPosVar int
141144
142145 var xMatchInfoFetchPos func(uintptr, int, int, int) bool
143146
144-// Retrieves the position in bytes of the @match_num'th capturing
145-// parentheses. 0 is the full text of the match, 1 is the first
146-// paren set, 2 the second, and so on.
147+// Returns the start and end positions (in bytes) of a successfully matching
148+// capture parenthesis.
147149 //
148-// If @match_num is a valid sub pattern but it didn't match anything
149-// (e.g. sub pattern 1, matching "b" against "(a)?b") then @start_pos
150-// and @end_pos are set to -1 and %TRUE is returned.
150+// Valid values for @match_num are `0` for the full text of the match,
151+// `1` for the first paren set, `2` for the second, and so on.
151152 //
152-// If the match was obtained using the DFA algorithm, that is using
153-// g_regex_match_all() or g_regex_match_all_full(), the retrieved
154-// position is not that of a set of parentheses but that of a matched
155-// substring. Substrings are matched in reverse order of length, so
156-// 0 is the longest match.
153+// As @end_pos is set to the byte after the final byte of the match (on success),
154+// the length of the match can be calculated as `end_pos - start_pos`.
155+//
156+// As a best practice, initialize @start_pos and @end_pos to identifiable
157+// values, such as `G_MAXINT`, so that you can test if
158+// `g_match_info_fetch_pos()` actually changed the value for a given
159+// capture parenthesis.
160+//
161+// The parameter @match_num corresponds to a matched capture parenthesis. The
162+// actual value you use for @match_num depends on the method used to generate
163+// @match_info. The following sections describe those methods.
164+//
165+// ## Methods Using Non-deterministic Finite Automata Matching
166+//
167+// The methods [method@GLib.Regex.match] and [method@GLib.Regex.match_full]
168+// return a [struct@GLib.MatchInfo] using traditional (greedy) pattern
169+// matching, also known as
170+// [Non-deterministic Finite Automaton](https://en.wikipedia.org/wiki/Nondeterministic_finite_automaton)
171+// (NFA) matching. You pass the returned `GMatchInfo` from these methods to
172+// `g_match_info_fetch_pos()` to determine the start and end positions
173+// of capture parentheses. The values for @match_num correspond to the capture
174+// parentheses in order, with `0` corresponding to the entire matched string.
175+//
176+// @match_num can refer to a capture parenthesis with no match. For example,
177+// the string `b` matches against the pattern `(a)?b`, but the capture
178+// parenthesis `(a)` has no match. In this case, `g_match_info_fetch_pos()`
179+// returns true and sets @start_pos and @end_pos to `-1` when called with
180+// `match_num` as `1` (for `(a)`).
181+//
182+// For an expanded example, a regex pattern is `(a)?(.*?)the (.*)`,
183+// and a candidate string is `glib regexes are the best`. In this scenario
184+// there are four capture parentheses numbered 0–3: an implicit one
185+// for the entire string, and three explicitly declared in the regex pattern.
186+//
187+// Given this example, the following table describes the return values
188+// from `g_match_info_fetch_pos()` for various values of @match_num.
189+//
190+// `match_num` | Contents | Return value | Returned `start_pos` | Returned `end_pos`
191+// ----------- | -------- | ------------ | -------------------- | ------------------
192+// 0 | Matches entire string | True | 0 | 25
193+// 1 | Does not match first character | True | -1 | -1
194+// 2 | All text before `the ` | True | 0 | 17
195+// 3 | All text after `the ` | True | 21 | 25
196+// 4 | Capture paren out of range | False | Unchanged | Unchanged
197+//
198+// The following code sample and output implements this example.
199+//
200+// ``` { .c }
201+// #include &lt;glib.h&gt;
202+//
203+// int
204+// main (int argc, char *argv[])
205+//
206+// {
207+// g_autoptr(GError) local_error = NULL;
208+// const char *regex_pattern = "(a)?(.*?)the (.*)";
209+// const char *test_string = "glib regexes are the best";
210+// g_autoptr(GRegex) regex = NULL;
211+//
212+// regex = g_regex_new (regex_pattern,
213+// G_REGEX_DEFAULT,
214+// G_REGEX_MATCH_DEFAULT,
215+// &amp;local_error);
216+// if (regex == NULL)
217+// {
218+// g_printerr ("Error creating regex: %s\n", local_error-&gt;message);
219+// return 1;
220+// }
221+//
222+// g_autoptr(GMatchInfo) match_info = NULL;
223+// g_regex_match (regex, test_string, G_REGEX_MATCH_DEFAULT, &amp;match_info);
224+//
225+// int n_matched_strings = g_match_info_get_match_count (match_info);
226+//
227+// // Print header line
228+// g_print ("match_num Contents Return value returned start_pos returned end_pos\n");
229+//
230+// // Iterate over each capture paren, including one that is out of range as a demonstration.
231+// for (int match_num = 0; match_num &lt;= n_matched_strings; match_num++)
232+// {
233+// gboolean found_match;
234+// g_autofree char *paren_string = NULL;
235+// int start_pos = G_MAXINT;
236+// int end_pos = G_MAXINT;
237+//
238+// found_match = g_match_info_fetch_pos (match_info,
239+// match_num,
240+// &amp;start_pos,
241+// &amp;end_pos);
242+//
243+// // If no match, display N/A as the found string.
244+// if (start_pos == G_MAXINT || start_pos == -1)
245+// paren_string = g_strdup ("N/A");
246+// else
247+// paren_string = g_strndup (test_string + start_pos, end_pos - start_pos);
248+//
249+// g_print ("%-9d %-25s %-12d %-18d %d\n", match_num, paren_string, found_match, start_pos, end_pos);
250+// }
251+//
252+// return 0;
253+// }
254+//
255+// ```
256+//
257+// ```
258+// match_num Contents Return value returned start_pos returned end_pos
259+// 0 glib regexes are the best 1 0 25
260+// 1 N/A 1 -1 -1
261+// 2 glib regexes are 1 0 17
262+// 3 best 1 21 25
263+// 4 N/A 0 2147483647 2147483647
264+// ```
265+// ## Methods Using Deterministic Finite Automata Matching
266+//
267+// The methods [method@GLib.Regex.match_all] and
268+// [method@GLib.Regex.match_all_full]
269+// return a `GMatchInfo` using
270+// [Deterministic Finite Automaton](https://en.wikipedia.org/wiki/Deterministic_finite_automaton)
271+// (DFA) pattern matching. This algorithm detects overlapping matches. You pass
272+// the returned `GMatchInfo` from these methods to `g_match_info_fetch_pos()`
273+// to determine the start and end positions of each overlapping match. Use the
274+// method [method@GLib.MatchInfo.get_match_count] to determine the number
275+// of overlapping matches.
276+//
277+// For example, a regex pattern is `&lt;.*&gt;`, and a candidate string is
278+// `&lt;a&gt; &lt;b&gt; &lt;c&gt;`. In this scenario there are three implicit capture
279+// parentheses: one for the entire string, one for `&lt;a&gt; &lt;b&gt;`, and one for `&lt;a&gt;`.
280+//
281+// Given this example, the following table describes the return values from
282+// `g_match_info_fetch_pos()` for various values of @match_num.
283+//
284+// `match_num` | Contents | Return value | Returned `start_pos` | Returned `end_pos`
285+// ----------- | -------- | ------------ | -------------------- | ------------------
286+// 0 | Matches entire string | True | 0 | 11
287+// 1 | Matches `&lt;a&gt; &lt;b&gt;` | True | 0 | 7
288+// 2 | Matches `&lt;a&gt;` | True | 0 | 3
289+// 3 | Capture paren out of range | False | Unchanged | Unchanged
290+//
291+// The following code sample and output implements this example.
292+//
293+// ``` { .c }
294+// #include &lt;glib.h&gt;
295+//
296+// int
297+// main (int argc, char *argv[])
298+//
299+// {
300+// g_autoptr(GError) local_error = NULL;
301+// const char *regex_pattern = "&lt;.*&gt;";
302+// const char *test_string = "&lt;a&gt; &lt;b&gt; &lt;c&gt;";
303+// g_autoptr(GRegex) regex = NULL;
304+//
305+// regex = g_regex_new (regex_pattern,
306+// G_REGEX_DEFAULT,
307+// G_REGEX_MATCH_DEFAULT,
308+// &amp;local_error);
309+// if (regex == NULL)
310+// {
311+// g_printerr ("Error creating regex: %s\n", local_error-&gt;message);
312+// return -1;
313+// }
314+//
315+// g_autoptr(GMatchInfo) match_info = NULL;
316+// g_regex_match_all (regex, test_string, G_REGEX_MATCH_DEFAULT, &amp;match_info);
317+//
318+// int n_matched_strings = g_match_info_get_match_count (match_info);
319+//
320+// // Print header line
321+// g_print ("match_num Contents Return value returned start_pos returned end_pos\n");
322+//
323+// // Iterate over each capture paren, including one that is out of range as a demonstration.
324+// for (int match_num = 0; match_num &lt;= n_matched_strings; match_num++)
325+// {
326+// gboolean found_match;
327+// g_autofree char *paren_string = NULL;
328+// int start_pos = G_MAXINT;
329+// int end_pos = G_MAXINT;
330+//
331+// found_match = g_match_info_fetch_pos (match_info, match_num, &amp;start_pos, &amp;end_pos);
332+//
333+// // If no match, display N/A as the found string.
334+// if (start_pos == G_MAXINT || start_pos == -1)
335+// paren_string = g_strdup ("N/A");
336+// else
337+// paren_string = g_strndup (test_string + start_pos, end_pos - start_pos);
338+//
339+// g_print ("%-9d %-25s %-12d %-18d %d\n", match_num, paren_string, found_match, start_pos, end_pos);
340+// }
341+//
342+// return 0;
343+// }
344+//
345+// ```
346+//
347+// ```
348+// match_num Contents Return value returned start_pos returned end_pos
349+// 0 &lt;a&gt; &lt;b&gt; &lt;c&gt; 1 0 11
350+// 1 &lt;a&gt; &lt;b&gt; 1 0 7
351+// 2 &lt;a&gt; 1 0 3
352+// 3 N/A 0 2147483647 2147483647
353+// ```
157354 func (x *MatchInfo) FetchPos(MatchNumVar int, StartPosVar int, EndPosVar int) bool {
158355
159356 cret := xMatchInfoFetchPos(x.GoPointer(), MatchNumVar, StartPosVar, EndPosVar)
@@ -296,58 +493,141 @@ func (x *MatchInfo) Unref() {
296493
297494 }
298495
299-// A `GRegex` is the "compiled" form of a regular expression pattern.
496+// A `GRegex` is a compiled form of a regular expression.
497+//
498+// After instantiating a `GRegex`, you can use its methods to find matches
499+// in a string, replace matches within a string, or split the string at matches.
300500 //
301501 // `GRegex` implements regular expression pattern matching using syntax and
302-// semantics similar to Perl regular expression. See the
303-// [PCRE documentation](man:pcrepattern(3)) for the syntax definition.
304-//
305-// Some functions accept a @start_position argument, setting it differs
306-// from just passing over a shortened string and setting %G_REGEX_MATCH_NOTBOL
307-// in the case of a pattern that begins with any kind of lookbehind assertion.
308-// For example, consider the pattern "\Biss\B" which finds occurrences of "iss"
309-// in the middle of words. ("\B" matches only if the current position in the
310-// subject is not a word boundary.) When applied to the string "Mississipi"
311-// from the fourth byte, namely "issipi", it does not match, because "\B" is
312-// always false at the start of the subject, which is deemed to be a word
313-// boundary. However, if the entire string is passed , but with
314-// @start_position set to 4, it finds the second occurrence of "iss" because
315-// it is able to look behind the starting point to discover that it is
316-// preceded by a letter.
317-//
318-// Note that, unless you set the %G_REGEX_RAW flag, all the strings passed
319-// to these functions must be encoded in UTF-8. The lengths and the positions
320-// inside the strings are in bytes and not in characters, so, for instance,
321-// "\xc3\xa0" (i.e. "à") is two bytes long but it is treated as a
322-// single character. If you set %G_REGEX_RAW the strings can be non-valid
323-// UTF-8 strings and a byte is treated as a character, so "\xc3\xa0" is two
324-// bytes and two characters long.
325-//
326-// When matching a pattern, "\n" matches only against a "\n" character in
327-// the string, and "\r" matches only a "\r" character. To match any newline
328-// sequence use "\R". This particular group matches either the two-character
329-// sequence CR + LF ("\r\n"), or one of the single characters LF (linefeed,
330-// U+000A, "\n"), VT vertical tab, U+000B, "\v"), FF (formfeed, U+000C, "\f"),
331-// CR (carriage return, U+000D, "\r"), NEL (next line, U+0085), LS (line
332-// separator, U+2028), or PS (paragraph separator, U+2029).
502+// semantics (such as character classes, quantifiers, and capture groups)
503+// similar to Perl regular expression. See the
504+// [PCRE documentation](man:pcre2pattern(3)) for details.
505+//
506+// A typical scenario for regex pattern matching is to check if a string
507+// matches a pattern. The following statements implement this scenario.
508+//
509+// ``` { .c }
510+// const char *regex_pattern = ".*GLib.*";
511+// const char *string_to_search = "You will love the GLib implementation of regex";
512+// g_autoptr(GMatchInfo) match_info = NULL;
513+// g_autoptr(GRegex) regex = NULL;
514+//
515+// regex = g_regex_new (regex_pattern, G_REGEX_DEFAULT, G_REGEX_MATCH_DEFAULT, NULL);
516+// g_assert (regex != NULL);
517+//
518+// if (g_regex_match (regex, string_to_search, G_REGEX_MATCH_DEFAULT, &amp;match_info))
519+//
520+// {
521+// int start_pos, end_pos;
522+// g_match_info_fetch_pos (match_info, 0, &amp;start_pos, &amp;end_pos);
523+// g_print ("Match successful! Overall pattern matches bytes %d to %d\n", start_pos, end_pos);
524+// }
525+//
526+// else
527+//
528+// {
529+// g_print ("No match!\n");
530+// }
531+//
532+// ```
533+//
534+// The constructor for `GRegex` includes two sets of bitmapped flags:
535+//
536+// * [flags@GLib.RegexCompileFlags]—These flags
537+// control how GLib compiles the regex. There are options for case
538+// sensitivity, multiline, ignoring whitespace, etc.
539+// * [flags@GLib.RegexMatchFlags]—These flags control
540+// `GRegex`’s matching behavior, such as anchoring and customizing definitions
541+// for newline characters.
542+//
543+// Some regex patterns include backslash assertions, such as `\d` (digit) or
544+// `\D` (non-digit). The regex pattern must escape those backslashes. For
545+// example, the pattern `"\\d\\D"` matches a digit followed by a non-digit.
546+//
547+// GLib’s implementation of pattern matching includes a `start_position`
548+// argument for some of the match, replace, and split methods. Specifying
549+// a start position provides flexibility when you want to ignore the first
550+// _n_ characters of a string, but want to incorporate backslash assertions
551+// at character _n_ - 1. For example, a database field contains inconsistent
552+// spelling for a job title: `healthcare provider` and `health-care provider`.
553+// The database manager wants to make the spelling consistent by adding a
554+// hyphen when it is missing. The following regex pattern tests for the string
555+// `care` preceded by a non-word boundary character (instead of a hyphen)
556+// and followed by a space.
557+//
558+// ``` { .c }
559+// const char *regex_pattern = "\\Bcare\\s";
560+// ```
561+//
562+// An efficient way to match with this pattern is to start examining at
563+// `start_position` 6 in the string `healthcare` or `health-care`.
564+//
565+// ``` { .c }
566+// const char *regex_pattern = "\\Bcare\\s";
567+// const char *string_to_search = "healthcare provider";
568+// g_autoptr(GMatchInfo) match_info = NULL;
569+// g_autoptr(GRegex) regex = NULL;
570+//
571+// regex = g_regex_new (
572+//
573+// regex_pattern,
574+// G_REGEX_DEFAULT,
575+// G_REGEX_MATCH_DEFAULT,
576+// NULL);
577+//
578+// g_assert (regex != NULL);
579+//
580+// g_regex_match_full (
581+//
582+// regex,
583+// string_to_search,
584+// -1,
585+// 6, // position of 'c' in the test string.
586+// G_REGEX_MATCH_DEFAULT,
587+// &amp;match_info,
588+// NULL);
589+//
590+// ```
591+//
592+// The method [method@GLib.Regex.match_full] (and other methods implementing
593+// `start_pos`) allow for lookback before the start position to determine if
594+// the previous character satisfies an assertion.
595+//
596+// Unless you set the [flags@GLib.RegexCompileFlags.RAW] as one of
597+// the `GRegexCompileFlags`, all the strings passed to `GRegex` methods must
598+// be encoded in UTF-8. The lengths and the positions inside the strings are
599+// in bytes and not in characters, so, for instance, `\xc3\xa0` (i.e., `à`)
600+// is two bytes long but it is treated as a single character. If you set
601+// `G_REGEX_RAW`, the strings can be non-valid UTF-8 strings and a byte is
602+// treated as a character, so `\xc3\xa0` is two bytes and two characters long.
603+//
604+// Regarding line endings, `\n` matches a `\n` character, and `\r` matches
605+// a `\r` character. More generally, `\R` matches all typical line endings:
606+// CR + LF (`\r\n`), LF (linefeed, U+000A, `\n`), VT (vertical tab, U+000B,
607+// `\v`), FF (formfeed, U+000C, `\f`), CR (carriage return, U+000D, `\r`),
608+// NEL (next line, U+0085), LS (line separator, U+2028), and PS (paragraph
609+// separator, U+2029).
333610 //
334611 // The behaviour of the dot, circumflex, and dollar metacharacters are
335-// affected by newline characters, the default is to recognize any newline
336-// character (the same characters recognized by "\R"). This can be changed
337-// with `G_REGEX_NEWLINE_CR`, `G_REGEX_NEWLINE_LF` and `G_REGEX_NEWLINE_CRLF`
338-// compile options, and with `G_REGEX_MATCH_NEWLINE_ANY`,
339-// `G_REGEX_MATCH_NEWLINE_CR`, `G_REGEX_MATCH_NEWLINE_LF` and
340-// `G_REGEX_MATCH_NEWLINE_CRLF` match options. These settings are also
341-// relevant when compiling a pattern if `G_REGEX_EXTENDED` is set, and an
342-// unescaped "#" outside a character class is encountered. This indicates
343-// a comment that lasts until after the next newline.
344-//
345-// Creating and manipulating the same `GRegex` structure from different
346-// threads is not a problem as `GRegex` does not modify its internal
347-// state between creation and destruction, on the other hand `GMatchInfo`
348-// is not threadsafe.
349-//
350-// The regular expressions low-level functionalities are obtained through
612+// affected by newline characters. By default, `GRegex` matches any newline
613+// character matched by `\R`. You can limit the matched newline characters by
614+// specifying the [flags@GLib.RegexMatchFlags.NEWLINE_CR],
615+// [flags@GLib.RegexMatchFlags.NEWLINE_LF], and
616+// [flags@GLib.RegexMatchFlags.NEWLINE_CRLF] compile options, and
617+// with [flags@GLib.RegexMatchFlags.NEWLINE_ANY],
618+// [flags@GLib.RegexMatchFlags.NEWLINE_CR],
619+// [flags@GLib.RegexMatchFlags.NEWLINE_LF] and
620+// [flags@GLib.RegexMatchFlags.NEWLINE_CRLF] match options.
621+// These settings are also relevant when compiling a pattern if
622+// [flags@GLib.RegexCompileFlags.EXTENDED] is set and an unescaped
623+// `#` outside a character class is encountered. This indicates a comment
624+// that lasts until after the next newline.
625+//
626+// Because `GRegex` does not modify its internal state between creation and
627+// destruction, you can create and modify the same `GRegex` instance from
628+// different threads. In contrast, [struct@GLib.MatchInfo] is not thread safe.
629+//
630+// The regular expression low-level functionalities are obtained through
351631 // the excellent [PCRE](http://www.pcre.org/) library written by Philip Hazel.
352632 type Regex struct {
353633 _ structs.HostLayout
M v4/glib/gspawn.go +3 -2
@@ -138,8 +138,9 @@ var xSpawnAsync func(string, []string, []string, SpawnFlags, uintptr, uintptr, *
138138
139139 // Executes a child program asynchronously.
140140 //
141-// See g_spawn_async_with_pipes() for a full description; this function
142-// simply calls the g_spawn_async_with_pipes() without any pipes.
141+// See g_spawn_async_with_pipes_and_fds() for a full description; this function
142+// simply calls the g_spawn_async_with_pipes() without any pipes, which in turn
143+// calls g_spawn_async_with_pipes_and_fds().
143144 //
144145 // You should call g_spawn_close_pid() on the returned child process
145146 // reference when you don't need it any more.
M v4/glib/gstdio.go +10 -0
@@ -146,6 +146,13 @@ var xFopen func(string, string) uintptr
146146 // currently impossible to close a file if the application C library and the C library
147147 // used by GLib are different. Convenience functions like g_file_set_contents_full()
148148 // avoid this problem.
149+//
150+// Since GLib 2.86, the `e` option is supported in @mode on all platforms. On
151+// Unix platforms it will set `O_CLOEXEC` on the opened file descriptor. On
152+// Windows platforms it will be converted to the
153+// [`N` modifier](https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/fopen-wfopen?view=msvc-170).
154+// It is recommended to set `e` unconditionally, unless you know the returned
155+// file should be shared between this process and a new fork.
149156 func Fopen(FilenameVar string, ModeVar string) uintptr {
150157
151158 cret := xFopen(FilenameVar, ModeVar)
@@ -158,6 +165,9 @@ var xFreopen func(string, string, uintptr) uintptr
158165 // opens a file and associates it with an existing stream.
159166 //
160167 // See your C library manual for more details about freopen().
168+//
169+// Since GLib 2.86, the `e` option is supported in @mode on all platforms. See
170+// the documentation for [func@GLib.fopen] for more details.
161171 func Freopen(FilenameVar string, ModeVar string, StreamVar uintptr) uintptr {
162172
163173 cret := xFreopen(FilenameVar, ModeVar, StreamVar)
M v4/glib/gstring.go +14 -1
@@ -69,7 +69,7 @@ var xNewStringTake func(string) *String
6969 // Creates a new #GString, initialized with the given string.
7070 //
7171 // After this call, @init belongs to the #GString and may no longer be
72-// modified by the caller. The memory of @data has to be dynamically
72+// modified by the caller. The memory of @init has to be dynamically
7373 // allocated and will eventually be freed with g_free().
7474 func NewStringTake(InitVar string) *String {
7575
@@ -199,6 +199,18 @@ func (x *String) Assign(RvalVar string) *String {
199199 return cret
200200 }
201201
202+var xStringCopy func(uintptr) *String
203+
204+// Copies the [struct@GLib.String] instance and its contents.
205+//
206+// This will preserve the allocation length of the [struct@GLib.String] in the
207+// copy.
208+func (x *String) Copy() *String {
209+
210+ cret := xStringCopy(x.GoPointer())
211+ return cret
212+}
213+
202214 var xStringDown func(uintptr) *String
203215
204216 // Converts a #GString to lowercase.
@@ -494,6 +506,7 @@ func init() {
494506 core.PuregoSafeRegister(&xStringAsciiDown, libs, "g_string_ascii_down")
495507 core.PuregoSafeRegister(&xStringAsciiUp, libs, "g_string_ascii_up")
496508 core.PuregoSafeRegister(&xStringAssign, libs, "g_string_assign")
509+ core.PuregoSafeRegister(&xStringCopy, libs, "g_string_copy")
497510 core.PuregoSafeRegister(&xStringDown, libs, "g_string_down")
498511 core.PuregoSafeRegister(&xStringEqual, libs, "g_string_equal")
499512 core.PuregoSafeRegister(&xStringErase, libs, "g_string_erase")
M v4/glib/gtestutils.go +2 -2
@@ -428,7 +428,7 @@ var xTestAddDataFuncFull func(string, uintptr, uintptr, uintptr)
428428
429429 // Creates a new test case.
430430 //
431-// In constract to [func@GLib.test_add_data_func], this function
431+// In contrast to [func@GLib.test_add_data_func], this function
432432 // is freeing @test_data after the test run is complete.
433433 func TestAddDataFuncFull(TestpathVar string, TestDataVar uintptr, TestFuncVar *TestDataFunc, DataFreeFuncVar *DestroyNotify) {
434434
@@ -1345,7 +1345,7 @@ var xTestTrapSubprocessWithEnvp func(string, []string, uint64, TestSubprocessFla
13451345 // }
13461346 //
13471347 // // Reruns this same test in a subprocess
1348-// g_autoptr(GStrv) envp = g_get_environ ();
1348+// g_auto(GStrv) envp = g_get_environ ();
13491349 // envp = g_environ_setenv (g_steal_pointer (&amp;envp), "USER", "charlie", TRUE);
13501350 // g_test_trap_subprocess_with_envp (NULL, envp, 0, G_TEST_SUBPROCESS_DEFAULT);
13511351 // g_test_trap_assert_passed ();
M v4/glib/gunicode.go +4 -4
@@ -1584,7 +1584,7 @@ func Utf8TruncateMiddle(StringVar string, TruncateLengthVar uint) string {
15841584 return cret
15851585 }
15861586
1587-var xUtf8Validate func([]byte, int, string) bool
1587+var xUtf8Validate func([]byte, int, []byte) bool
15881588
15891589 // Validates UTF-8 encoded text.
15901590 //
@@ -1603,19 +1603,19 @@ var xUtf8Validate func([]byte, int, string) bool
16031603 // routines require valid UTF-8 as input; so data read from a file
16041604 // or the network should be checked with `g_utf8_validate()` before
16051605 // doing anything else with it.
1606-func Utf8Validate(StrVar []byte, MaxLenVar int, EndVar string) bool {
1606+func Utf8Validate(StrVar []byte, MaxLenVar int, EndVar []byte) bool {
16071607
16081608 cret := xUtf8Validate(StrVar, MaxLenVar, EndVar)
16091609 return cret
16101610 }
16111611
1612-var xUtf8ValidateLen func([]byte, uint, string) bool
1612+var xUtf8ValidateLen func([]byte, uint, []byte) bool
16131613
16141614 // Validates UTF-8 encoded text.
16151615 //
16161616 // As with [func@GLib.utf8_validate], but @max_len must be set, and hence this
16171617 // function will always return `FALSE` if any of the bytes of @str are nul.
1618-func Utf8ValidateLen(StrVar []byte, MaxLenVar uint, EndVar string) bool {
1618+func Utf8ValidateLen(StrVar []byte, MaxLenVar uint, EndVar []byte) bool {
16191619
16201620 cret := xUtf8ValidateLen(StrVar, MaxLenVar, EndVar)
16211621 return cret
M v4/gmodule/gmodule.go +4 -0
@@ -25,6 +25,10 @@ type ModuleUnload func(*Module)
2525 // The #GModule struct is an opaque data structure to represent a
2626 // [dynamically-loaded module](modules.html#dynamic-loading-of-modules).
2727 // It should only be accessed via the following functions.
28+//
29+// To ensure correct lock ordering, these functions must not be called from
30+// global constructors (for example, those using GCC’s
31+// `__attribute__((constructor))` attribute).
2832 type Module struct {
2933 _ structs.HostLayout
3034 }
M v4/gobject/genums.go +4 -4
@@ -80,7 +80,7 @@ func (x *FlagsValue) GoPointer() uintptr {
8080 return uintptr(unsafe.Pointer(x))
8181 }
8282
83-var xEnumCompleteTypeInfo func(types.GType, *TypeInfo, *EnumValue)
83+var xEnumCompleteTypeInfo func(types.GType, *TypeInfo, []EnumValue)
8484
8585 // This function is meant to be called from the `complete_type_info`
8686 // function of a #GTypePlugin implementation, as in the following
@@ -105,7 +105,7 @@ var xEnumCompleteTypeInfo func(types.GType, *TypeInfo, *EnumValue)
105105 // }
106106 //
107107 // ]|
108-func EnumCompleteTypeInfo(GEnumTypeVar types.GType, InfoVar *TypeInfo, ConstValuesVar *EnumValue) {
108+func EnumCompleteTypeInfo(GEnumTypeVar types.GType, InfoVar *TypeInfo, ConstValuesVar []EnumValue) {
109109
110110 xEnumCompleteTypeInfo(GEnumTypeVar, InfoVar, ConstValuesVar)
111111
@@ -163,12 +163,12 @@ func EnumToString(GEnumTypeVar types.GType, ValueVar int) string {
163163 return cret
164164 }
165165
166-var xFlagsCompleteTypeInfo func(types.GType, *TypeInfo, *FlagsValue)
166+var xFlagsCompleteTypeInfo func(types.GType, *TypeInfo, []FlagsValue)
167167
168168 // This function is meant to be called from the complete_type_info()
169169 // function of a #GTypePlugin implementation, see the example for
170170 // g_enum_complete_type_info() above.
171-func FlagsCompleteTypeInfo(GFlagsTypeVar types.GType, InfoVar *TypeInfo, ConstValuesVar *FlagsValue) {
171+func FlagsCompleteTypeInfo(GFlagsTypeVar types.GType, InfoVar *TypeInfo, ConstValuesVar []FlagsValue) {
172172
173173 xFlagsCompleteTypeInfo(GFlagsTypeVar, InfoVar, ConstValuesVar)
174174
M v4/gobject/gobject.go +0 -1
@@ -1660,7 +1660,6 @@ func (x *Object) Ref() *Object {
16601660 if cret == 0 {
16611661 return nil
16621662 }
1663- IncreaseRef(cret)
16641663 cls = &Object{}
16651664 cls.Ptr = cret
16661665 return cls
M v4/gobject/gtype.go +0 -13
@@ -1011,18 +1011,6 @@ func TypeClassPeekStatic(TypeVar types.GType) *TypeClass {
10111011 return cret
10121012 }
10131013
1014-var xTypeClassRef func(types.GType) *TypeClass
1015-
1016-// Increments the reference count of the class structure belonging to
1017-// @type.
1018-//
1019-// This function will demand-create the class if it doesn't exist already.
1020-func TypeClassRef(TypeVar types.GType) *TypeClass {
1021-
1022- cret := xTypeClassRef(TypeVar)
1023- return cret
1024-}
1025-
10261014 var xTypeCreateInstance func(types.GType) *TypeInstance
10271015
10281016 // Creates and initializes an instance of @type if @type is valid and
@@ -1573,7 +1561,6 @@ func init() {
15731561 core.PuregoSafeRegister(&xTypeClassGet, libs, "g_type_class_get")
15741562 core.PuregoSafeRegister(&xTypeClassPeek, libs, "g_type_class_peek")
15751563 core.PuregoSafeRegister(&xTypeClassPeekStatic, libs, "g_type_class_peek_static")
1576- core.PuregoSafeRegister(&xTypeClassRef, libs, "g_type_class_ref")
15771564 core.PuregoSafeRegister(&xTypeCreateInstance, libs, "g_type_create_instance")
15781565 core.PuregoSafeRegister(&xTypeDefaultInterfaceGet, libs, "g_type_default_interface_get")
15791566 core.PuregoSafeRegister(&xTypeDefaultInterfacePeek, libs, "g_type_default_interface_peek")
M v4/gobject/gtypemodule.go +4 -4
@@ -244,7 +244,7 @@ func (x *TypeModule) AddInterface(InstanceTypeVar types.GType, InterfaceTypeVar
244244
245245 }
246246
247-var xTypeModuleRegisterEnum func(uintptr, string, *EnumValue) types.GType
247+var xTypeModuleRegisterEnum func(uintptr, string, []EnumValue) types.GType
248248
249249 // Looks up or registers an enumeration that is implemented with a particular
250250 // type plugin. If a type with name @type_name was previously registered,
@@ -256,13 +256,13 @@ var xTypeModuleRegisterEnum func(uintptr, string, *EnumValue) types.GType
256256 //
257257 // Since 2.56 if @module is %NULL this will call g_type_register_static()
258258 // instead. This can be used when making a static build of the module.
259-func (x *TypeModule) RegisterEnum(NameVar string, ConstStaticValuesVar *EnumValue) types.GType {
259+func (x *TypeModule) RegisterEnum(NameVar string, ConstStaticValuesVar []EnumValue) types.GType {
260260
261261 cret := xTypeModuleRegisterEnum(x.GoPointer(), NameVar, ConstStaticValuesVar)
262262 return cret
263263 }
264264
265-var xTypeModuleRegisterFlags func(uintptr, string, *FlagsValue) types.GType
265+var xTypeModuleRegisterFlags func(uintptr, string, []FlagsValue) types.GType
266266
267267 // Looks up or registers a flags type that is implemented with a particular
268268 // type plugin. If a type with name @type_name was previously registered,
@@ -274,7 +274,7 @@ var xTypeModuleRegisterFlags func(uintptr, string, *FlagsValue) types.GType
274274 //
275275 // Since 2.56 if @module is %NULL this will call g_type_register_static()
276276 // instead. This can be used when making a static build of the module.
277-func (x *TypeModule) RegisterFlags(NameVar string, ConstStaticValuesVar *FlagsValue) types.GType {
277+func (x *TypeModule) RegisterFlags(NameVar string, ConstStaticValuesVar []FlagsValue) types.GType {
278278
279279 cret := xTypeModuleRegisterFlags(x.GoPointer(), NameVar, ConstStaticValuesVar)
280280 return cret
M v4/gobject/gvalue.go +97 -41
@@ -12,21 +12,30 @@ import (
1212 )
1313
1414 // The type of value transformation functions which can be registered with
15-// g_value_register_transform_func().
15+// [func@GObject.Value.register_transform_func].
1616 //
1717 // @dest_value will be initialized to the correct destination type.
1818 type ValueTransform func(*Value, *Value)
1919
2020 // An opaque structure used to hold different types of values.
2121 //
22+// Before it can be used, a `GValue` has to be initialized to a specific type by
23+// calling [method@GObject.Value.init] on it.
24+//
25+// Many types which are stored within a `GValue` need to allocate data on the
26+// heap, so [method@GObject.Value.unset] must always be called on a `GValue` to
27+// free any such data once you’re finished with the `GValue`, even if the
28+// `GValue` itself is stored on the stack.
29+//
2230 // The data within the structure has protected scope: it is accessible only
23-// to functions within a #GTypeValueTable structure, or implementations of
24-// the g_value_*() API. That is, code portions which implement new fundamental
25-// types.
31+// to functions within a [struct@GObject.TypeValueTable] structure, or
32+// implementations of the `g_value_*()` API. That is, code which implements new
33+// fundamental types.
2634 //
27-// #GValue users cannot make any assumptions about how data is stored
35+// `GValue` users cannot make any assumptions about how data is stored
2836 // within the 2 element @data union, and the @g_type member should
29-// only be accessed through the G_VALUE_TYPE() macro.
37+// only be accessed through the [func@GObject.VALUE_TYPE] macro and related
38+// macros.
3039 type Value struct {
3140 _ structs.HostLayout
3241
@@ -123,6 +132,7 @@ func (x *Value) DupVariant() *glib.Variant {
123132 var xValueFitsPointer func(uintptr) bool
124133
125134 // Determines if @value will fit inside the size of a pointer value.
135+//
126136 // This is an internal function introduced mainly for C marshallers.
127137 func (x *Value) FitsPointer() bool {
128138
@@ -340,7 +350,21 @@ func (x *Value) GetVariant() *glib.Variant {
340350
341351 var xValueInit func(uintptr, types.GType) *Value
342352
343-// Initializes @value with the default value of @type.
353+// Initializes @value to store values of the given @type, and sets its value
354+// to the default for @type.
355+//
356+// This must be called before any other methods on a [struct@GObject.Value], so
357+// the value knows what type it’s meant to store.
358+//
359+// ```c
360+//
361+// GValue value = G_VALUE_INIT;
362+//
363+// g_value_init (&amp;value, SOME_G_TYPE);
364+// …
365+// g_value_unset (&amp;value);
366+//
367+// ```
344368 func (x *Value) Init(GTypeVar types.GType) *Value {
345369
346370 cret := xValueInit(x.GoPointer(), GTypeVar)
@@ -349,13 +373,15 @@ func (x *Value) Init(GTypeVar types.GType) *Value {
349373
350374 var xValueInitFromInstance func(uintptr, *TypeInstance)
351375
352-// Initializes and sets @value from an instantiatable type via the
353-// value_table's collect_value() function.
376+// Initializes and sets @value from an instantiatable type.
377+//
378+// This calls the [callback@GObject.TypeValueCollectFunc] function for the type
379+// the [struct@GObject.Value] contains.
354380 //
355381 // Note: The @value will be initialised with the exact type of
356-// @instance. If you wish to set the @value's type to a different GType
357-// (such as a parent class GType), you need to manually call
358-// g_value_init() and g_value_set_instance().
382+// @instance. If you wish to set the @value’s type to a different
383+// [type@GObject.Type] (such as a parent class type), you need to manually call
384+// [method@GObject.Value.init] and [method@GObject.Value.set_instance].
359385 func (x *Value) InitFromInstance(InstanceVar *TypeInstance) {
360386
361387 xValueInitFromInstance(x.GoPointer(), InstanceVar)
@@ -364,8 +390,11 @@ func (x *Value) InitFromInstance(InstanceVar *TypeInstance) {
364390
365391 var xValuePeekPointer func(uintptr) uintptr
366392
367-// Returns the value contents as pointer. This function asserts that
368-// g_value_fits_pointer() returned %TRUE for the passed in value.
393+// Returns the value contents as a pointer.
394+//
395+// This function asserts that [method@GObject.Value.fits_pointer] returned true
396+// for the passed in value.
397+//
369398 // This is an internal function introduced mainly for C marshallers.
370399 func (x *Value) PeekPointer() uintptr {
371400
@@ -376,7 +405,8 @@ func (x *Value) PeekPointer() uintptr {
376405 var xValueReset func(uintptr) *Value
377406
378407 // Clears the current value in @value and resets it to the default value
379-// (as if the value had just been initialized).
408+// (as if the value had just been initialized using
409+// [method@GObject.Value.init]).
380410 func (x *Value) Reset() *Value {
381411
382412 cret := xValueReset(x.GoPointer())
@@ -466,8 +496,10 @@ func (x *Value) SetGtype(VGtypeVar types.GType) {
466496
467497 var xValueSetInstance func(uintptr, uintptr)
468498
469-// Sets @value from an instantiatable type via the
470-// value_table's collect_value() function.
499+// Sets @value from an instantiatable type.
500+//
501+// This calls the [callback@GObject.TypeValueCollectFunc] function for the type
502+// the [struct@GObject.Value] contains.
471503 func (x *Value) SetInstance(InstanceVar uintptr) {
472504
473505 xValueSetInstance(x.GoPointer(), InstanceVar)
@@ -752,12 +784,17 @@ func (x *Value) TakeVariant(VariantVar *glib.Variant) {
752784 var xValueTransform func(uintptr, *Value) bool
753785
754786 // Tries to cast the contents of @src_value into a type appropriate
755-// to store in @dest_value, e.g. to transform a %G_TYPE_INT value
756-// into a %G_TYPE_FLOAT value. Performing transformations between
757-// value types might incur precision lossage. Especially
758-// transformations into strings might reveal seemingly arbitrary
759-// results and shouldn't be relied upon for production code (such
760-// as rcfile value or object property serialization).
787+// to store in @dest_value.
788+//
789+// If a transformation is not possible, @dest_value is not modified.
790+//
791+// For example, this could transform a `G_TYPE_INT` value into a `G_TYPE_FLOAT`
792+// value.
793+//
794+// Performing transformations between value types might incur precision loss.
795+// Especially transformations into strings might reveal seemingly arbitrary
796+// results and the format of particular transformations to strings is not
797+// guaranteed over time.
761798 func (x *Value) Transform(DestValueVar *Value) bool {
762799
763800 cret := xValueTransform(x.GoPointer(), DestValueVar)
@@ -766,10 +803,11 @@ func (x *Value) Transform(DestValueVar *Value) bool {
766803
767804 var xValueUnset func(uintptr)
768805
769-// Clears the current value in @value (if any) and "unsets" the type,
770-// this releases all resources associated with this GValue. An unset
771-// value is the same as an uninitialized (zero-filled) #GValue
772-// structure.
806+// Clears the current value in @value (if any) and ‘unsets’ the type.
807+//
808+// This releases all resources associated with this [struct@GObject.Value]. An
809+// unset value is the same as a cleared (zero-filled)
810+// [struct@GObject.Value] structure set to `G_VALUE_INIT`.
773811 func (x *Value) Unset() {
774812
775813 xValueUnset(x.GoPointer())
@@ -777,21 +815,37 @@ func (x *Value) Unset() {
777815 }
778816
779817 const (
780- // For string values, indicates that the string contained is canonical and will
781- // exist for the duration of the process. See g_value_set_interned_string().
818+ // Flag to indicate that a string in a [struct@GObject.Value] is canonical and
819+ // will exist for the duration of the process.
820+ //
821+ // See [method@GObject.Value.set_interned_string].
822+ //
823+ // This flag should be checked by implementations of
824+ // [callback@GObject.TypeValueFreeFunc], [callback@GObject.TypeValueCollectFunc]
825+ // and [callback@GObject.TypeValueLCopyFunc].
782826 VALUE_INTERNED_STRING int = 268435456
783- // If passed to G_VALUE_COLLECT(), allocated data won't be copied
784- // but used verbatim. This does not affect ref-counted types like
785- // objects. This does not affect usage of g_value_copy(), the data will
827+ // Flag to indicate that allocated data in a [struct@GObject.Value] shouldn’t be
828+ // copied.
829+ //
830+ // If passed to [func@GObject.VALUE_COLLECT], allocated data won’t be copied
831+ // but used verbatim. This does not affect ref-counted types like objects.
832+ //
833+ // This does not affect usage of [method@GObject.Value.copy]: the data will
786834 // be copied if it is not ref-counted.
835+ //
836+ // This flag should be checked by implementations of
837+ // [callback@GObject.TypeValueFreeFunc], [callback@GObject.TypeValueCollectFunc]
838+ // and [callback@GObject.TypeValueLCopyFunc].
787839 VALUE_NOCOPY_CONTENTS int = 134217728
788840 )
789841
790842 var xValueRegisterTransformFunc func(types.GType, types.GType, uintptr)
791843
792-// Registers a value transformation function for use in g_value_transform().
793-// A previously registered transformation function for @src_type and @dest_type
794-// will be replaced.
844+// Registers a value transformation function for use in
845+// [method@GObject.Value.transform].
846+//
847+// Any previously registered transformation function for @src_type and
848+// @dest_type will be replaced.
795849 func ValueRegisterTransformFunc(SrcTypeVar types.GType, DestTypeVar types.GType, TransformFuncVar *ValueTransform) {
796850
797851 xValueRegisterTransformFunc(SrcTypeVar, DestTypeVar, glib.NewCallback(TransformFuncVar))
@@ -800,8 +854,8 @@ func ValueRegisterTransformFunc(SrcTypeVar types.GType, DestTypeVar types.GType,
800854
801855 var xValueTypeCompatible func(types.GType, types.GType) bool
802856
803-// Returns whether a #GValue of type @src_type can be copied into
804-// a #GValue of type @dest_type.
857+// Checks whether a [method@GObject.Value.copy] is able to copy values of type
858+// @src_type into values of type @dest_type.
805859 func ValueTypeCompatible(SrcTypeVar types.GType, DestTypeVar types.GType) bool {
806860
807861 cret := xValueTypeCompatible(SrcTypeVar, DestTypeVar)
@@ -810,10 +864,12 @@ func ValueTypeCompatible(SrcTypeVar types.GType, DestTypeVar types.GType) bool {
810864
811865 var xValueTypeTransformable func(types.GType, types.GType) bool
812866
813-// Check whether g_value_transform() is able to transform values
814-// of type @src_type into values of type @dest_type. Note that for
815-// the types to be transformable, they must be compatible or a
816-// transformation function must be registered.
867+// Checks whether [method@GObject.Value.transform] is able to transform values
868+// of type @src_type into values of type @dest_type.
869+//
870+// Note that for the types to be transformable, they must be compatible or a
871+// transformation function must be registered using
872+// [func@GObject.Value.register_transform_func].
817873 func ValueTypeTransformable(SrcTypeVar types.GType, DestTypeVar types.GType) bool {
818874
819875 cret := xValueTypeTransformable(SrcTypeVar, DestTypeVar)
A v4/gsk/gskcomponenttransfer.go +32 -0
@@ -0,0 +1,32 @@
1+// Package gsk was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT
2+package gsk
3+
4+import (
5+ "github.com/jwijenbergh/purego"
6+ "github.com/jwijenbergh/puregotk/pkg/core"
7+)
8+
9+var xComponentTransferEqual func(uintptr, uintptr) bool
10+
11+// Compares two component transfers for equality.
12+func ComponentTransferEqual(SelfVar uintptr, OtherVar uintptr) bool {
13+
14+ cret := xComponentTransferEqual(SelfVar, OtherVar)
15+ return cret
16+}
17+
18+func init() {
19+ core.SetPackageName("GSK", "gtk4")
20+ core.SetSharedLibraries("GSK", []string{"libgtk-4.so.1"})
21+ var libs []uintptr
22+ for _, libPath := range core.GetPaths("GSK") {
23+ lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
24+ if err != nil {
25+ panic(err)
26+ }
27+ libs = append(libs, lib)
28+ }
29+
30+ core.PuregoSafeRegister(&xComponentTransferEqual, libs, "gsk_component_transfer_equal")
31+
32+}
M v4/gsk/gskenums.go +2 -0
@@ -384,6 +384,8 @@ const (
384384 StrokeNodeValue RenderNodeType = 29
385385 // A node that possibly redirects part of the scene graph to a subsurface.
386386 SubsurfaceNodeValue RenderNodeType = 30
387+ // A node that applies some function to each color component.
388+ ComponentTransferNodeValue RenderNodeType = 31
387389 )
388390
389391 // The filters used when scaling texture data.
M v4/gsk/gskpath.go +30 -1
@@ -17,7 +17,11 @@ import (
1717 //
1818 // Each contour of the path starts with a @GSK_PATH_MOVE operation.
1919 // Closed contours end with a @GSK_PATH_CLOSE operation.
20-type PathForeachFunc func(PathOperation, *graphene.Point, uint, float32, uintptr) bool
20+type PathForeachFunc func(PathOperation, []graphene.Point, uint, float32, uintptr) bool
21+
22+// Prototype of the callback to iterate through the
23+// intersections of two paths.
24+type PathIntersectionFunc func(*Path, *PathPoint, *Path, *PathPoint, PathIntersection, uintptr) bool
2125
2226 // Flags that can be passed to gsk_path_foreach() to influence what
2327 // kinds of operations the path is decomposed into.
@@ -46,6 +50,29 @@ const (
4650 PathForeachAllowConicValue PathForeachFlags = 4
4751 )
4852
53+// The values of this enumeration classify intersections
54+// between paths.
55+type PathIntersection int
56+
57+var xPathIntersectionGLibType func() types.GType
58+
59+func PathIntersectionGLibType() types.GType {
60+ return xPathIntersectionGLibType()
61+}
62+
63+const (
64+
65+ // No intersection
66+ PathIntersectionNoneValue PathIntersection = 0
67+ // A normal intersection, where the two paths
68+ // cross each other
69+ PathIntersectionNormalValue PathIntersection = 1
70+ // The start of a segment where the two paths coincide
71+ PathIntersectionStartValue PathIntersection = 2
72+ // The end of a segment where the two paths coincide
73+ PathIntersectionEndValue PathIntersection = 3
74+)
75+
4976 var xPathParse func(string) *Path
5077
5178 // Constructs a path from a serialized form.
@@ -92,6 +119,8 @@ func init() {
92119
93120 core.PuregoSafeRegister(&xPathForeachFlagsGLibType, libs, "gsk_path_foreach_flags_get_type")
94121
122+ core.PuregoSafeRegister(&xPathIntersectionGLibType, libs, "gsk_path_intersection_get_type")
123+
95124 core.PuregoSafeRegister(&xPathParse, libs, "gsk_path_parse")
96125
97126 }
M v4/gsk/gsktypes.go +236 -1
@@ -14,6 +14,188 @@ import (
1414 "github.com/jwijenbergh/puregotk/v4/pango"
1515 )
1616
17+// Specifies a transfer function for a color component to be applied
18+// while rendering.
19+//
20+// The available functions include linear, piecewise-linear,
21+// gamma and step functions.
22+//
23+// Note that the transfer function is applied to un-premultiplied
24+// values, and all results are clamped to the [0, 1] range.
25+type ComponentTransfer struct {
26+ _ structs.HostLayout
27+}
28+
29+var xComponentTransferGLibType func() types.GType
30+
31+func ComponentTransferGLibType() types.GType {
32+ return xComponentTransferGLibType()
33+}
34+
35+func (x *ComponentTransfer) GoPointer() uintptr {
36+ return uintptr(unsafe.Pointer(x))
37+}
38+
39+var xNewComponentTransferDiscrete func(uint, []float32) *ComponentTransfer
40+
41+// Creates a new component transfer that applies
42+// a step function.
43+//
44+// The new value is computed as
45+//
46+// C' = values[k]
47+//
48+// where k is the smallest value such that
49+//
50+// k / n &lt;= C &lt; (k + 1) / n
51+//
52+// &lt;figure&gt;
53+//
54+// &lt;picture&gt;
55+// &lt;source srcset="discrete-dark.png" media="(prefers-color-scheme: dark)"&gt;
56+// &lt;img alt="Component transfer: discrete" src="discrete-light.png"&gt;
57+// &lt;/picture&gt;
58+//
59+// &lt;/figure&gt;
60+func NewComponentTransferDiscrete(NVar uint, ValuesVar []float32) *ComponentTransfer {
61+
62+ cret := xNewComponentTransferDiscrete(NVar, ValuesVar)
63+ return cret
64+}
65+
66+var xNewComponentTransferGamma func(float32, float32, float32) *ComponentTransfer
67+
68+// Creates a new component transfer that applies
69+// a gamma transform.
70+//
71+// The new value is computed as
72+//
73+// C' = amp * pow (C, exp) + ofs
74+//
75+// &lt;figure&gt;
76+//
77+// &lt;picture&gt;
78+// &lt;source srcset="gamma-dark.png" media="(prefers-color-scheme: dark)"&gt;
79+// &lt;img alt="Component transfer: gamma" src="gamma-light.png"&gt;
80+// &lt;/picture&gt;
81+//
82+// &lt;/figure&gt;
83+func NewComponentTransferGamma(AmpVar float32, ExpVar float32, OfsVar float32) *ComponentTransfer {
84+
85+ cret := xNewComponentTransferGamma(AmpVar, ExpVar, OfsVar)
86+ return cret
87+}
88+
89+var xNewComponentTransferIdentity func() *ComponentTransfer
90+
91+// Creates a new component transfer that doesn't
92+// change the component value.
93+//
94+// &lt;figure&gt;
95+//
96+// &lt;picture&gt;
97+// &lt;source srcset="identity-dark.png" media="(prefers-color-scheme: dark)"&gt;
98+// &lt;img alt="Component transfer: identity" src="identity-light.png"&gt;
99+// &lt;/picture&gt;
100+//
101+// &lt;/figure&gt;
102+func NewComponentTransferIdentity() *ComponentTransfer {
103+
104+ cret := xNewComponentTransferIdentity()
105+ return cret
106+}
107+
108+var xNewComponentTransferLevels func(float32) *ComponentTransfer
109+
110+// Creates a new component transfer that limits
111+// the values of the component to `n` levels.
112+//
113+// The new value is computed as
114+//
115+// C' = (floor (C * n) + 0.5) / n
116+//
117+// &lt;figure&gt;
118+//
119+// &lt;picture&gt;
120+// &lt;source srcset="levels-dark.png" media="(prefers-color-scheme: dark)"&gt;
121+// &lt;img alt="Component transfer: levels" src="levels-light.png"&gt;
122+// &lt;/picture&gt;
123+//
124+// &lt;/figure&gt;
125+func NewComponentTransferLevels(NVar float32) *ComponentTransfer {
126+
127+ cret := xNewComponentTransferLevels(NVar)
128+ return cret
129+}
130+
131+var xNewComponentTransferLinear func(float32, float32) *ComponentTransfer
132+
133+// Creates a new component transfer that applies
134+// a linear transform.
135+//
136+// The new value is computed as
137+//
138+// C' = C * m + b
139+//
140+// &lt;figure&gt;
141+//
142+// &lt;picture&gt;
143+// &lt;source srcset="linear-dark.png" media="(prefers-color-scheme: dark)"&gt;
144+// &lt;img alt="Component transfer: linear" src="linear-light.png"&gt;
145+// &lt;/picture&gt;
146+//
147+// &lt;/figure&gt;
148+func NewComponentTransferLinear(MVar float32, BVar float32) *ComponentTransfer {
149+
150+ cret := xNewComponentTransferLinear(MVar, BVar)
151+ return cret
152+}
153+
154+var xNewComponentTransferTable func(uint, []float32) *ComponentTransfer
155+
156+// Creates a new component transfer that applies
157+// a piecewise linear function.
158+//
159+// The new value is computed as
160+//
161+// C' = values[k] + (C - k / (n - 1)) * n * (values[k + 1] - values[k])
162+//
163+// where k is the smallest value such that
164+//
165+// k / (n - 1) &lt;= C &lt; (k + 1) / (n - 1)
166+//
167+// &lt;figure&gt;
168+//
169+// &lt;picture&gt;
170+// &lt;source srcset="table-dark.png" media="(prefers-color-scheme: dark)"&gt;
171+// &lt;img alt="Component transfer: table" src="table-light.png"&gt;
172+// &lt;/picture&gt;
173+//
174+// &lt;/figure&gt;
175+func NewComponentTransferTable(NVar uint, ValuesVar []float32) *ComponentTransfer {
176+
177+ cret := xNewComponentTransferTable(NVar, ValuesVar)
178+ return cret
179+}
180+
181+var xComponentTransferCopy func(uintptr) *ComponentTransfer
182+
183+// Creates a copy of @other.
184+func (x *ComponentTransfer) Copy() *ComponentTransfer {
185+
186+ cret := xComponentTransferCopy(x.GoPointer())
187+ return cret
188+}
189+
190+var xComponentTransferFree func(uintptr)
191+
192+// Frees a component transfer.
193+func (x *ComponentTransfer) Free() {
194+
195+ xComponentTransferFree(x.GoPointer())
196+
197+}
198+
17199 // Describes lines and curves that are more complex than simple rectangles.
18200 //
19201 // Paths can used for rendering (filling or stroking) and for animations
@@ -69,6 +251,29 @@ func (x *Path) Foreach(FlagsVar PathForeachFlags, FuncVar *PathForeachFunc, User
69251 return cret
70252 }
71253
254+var xPathForeachIntersection func(uintptr, *Path, uintptr, uintptr) bool
255+
256+// Finds intersections between two paths.
257+//
258+// This function finds intersections between @path1 and @path2,
259+// and calls @func for each of them, in increasing order for @path1.
260+//
261+// If @path2 is not provided or equal to @path1, the function finds
262+// non-trivial self-intersections of @path1.
263+//
264+// When segments of the paths coincide, the callback is called once
265+// for the start of the segment, with @GSK_PATH_INTERSECTION_START, and
266+// once for the end of the segment, with @GSK_PATH_INTERSECTION_END.
267+// Note that other intersections may occur between the start and end
268+// of such a segment.
269+//
270+// If @func returns `FALSE`, the iteration is stopped.
271+func (x *Path) ForeachIntersection(Path2Var *Path, FuncVar *PathIntersectionFunc, UserDataVar uintptr) bool {
272+
273+ cret := xPathForeachIntersection(x.GoPointer(), Path2Var, glib.NewCallback(FuncVar), UserDataVar)
274+ return cret
275+}
276+
72277 var xPathGetBounds func(uintptr, *graphene.Rect) bool
73278
74279 // Computes the bounds of the given path.
@@ -1005,7 +1210,7 @@ var xStrokeSetLineWidth func(uintptr, float32)
10051210
10061211 // Sets the line width to be used when stroking.
10071212 //
1008-// The line width must be &gt; 0.
1213+// The line width must be &gt;= 0.
10091214 func (x *Stroke) SetLineWidth(LineWidthVar float32) {
10101215
10111216 xStrokeSetLineWidth(x.GoPointer(), LineWidthVar)
@@ -1122,6 +1327,22 @@ func (x *Transform) Matrix(MatrixVar *graphene.Matrix) *Transform {
11221327 return cret
11231328 }
11241329
1330+var xTransformMatrix2d func(uintptr, float32, float32, float32, float32, float32, float32) *Transform
1331+
1332+// Multiplies @next with the matrix [ xx yx x0; xy yy y0; 0 0 1 ].
1333+//
1334+// The result of calling [method@Gsk.Transform.to_2d] on the returned
1335+// [struct@Gsk.Transform] should match the input passed to this
1336+// function.
1337+//
1338+// This function consumes @next. Use [method@Gsk.Transform.ref] first
1339+// if you want to keep it around.
1340+func (x *Transform) Matrix2d(XxVar float32, YxVar float32, XyVar float32, YyVar float32, DxVar float32, DyVar float32) *Transform {
1341+
1342+ cret := xTransformMatrix2d(x.GoPointer(), XxVar, YxVar, XyVar, YyVar, DxVar, DyVar)
1343+ return cret
1344+}
1345+
11251346 var xTransformPerspective func(uintptr, float32) *Transform
11261347
11271348 // Applies a perspective projection transform.
@@ -1429,9 +1650,22 @@ func init() {
14291650 libs = append(libs, lib)
14301651 }
14311652
1653+ core.PuregoSafeRegister(&xComponentTransferGLibType, libs, "gsk_component_transfer_get_type")
1654+
1655+ core.PuregoSafeRegister(&xNewComponentTransferDiscrete, libs, "gsk_component_transfer_new_discrete")
1656+ core.PuregoSafeRegister(&xNewComponentTransferGamma, libs, "gsk_component_transfer_new_gamma")
1657+ core.PuregoSafeRegister(&xNewComponentTransferIdentity, libs, "gsk_component_transfer_new_identity")
1658+ core.PuregoSafeRegister(&xNewComponentTransferLevels, libs, "gsk_component_transfer_new_levels")
1659+ core.PuregoSafeRegister(&xNewComponentTransferLinear, libs, "gsk_component_transfer_new_linear")
1660+ core.PuregoSafeRegister(&xNewComponentTransferTable, libs, "gsk_component_transfer_new_table")
1661+
1662+ core.PuregoSafeRegister(&xComponentTransferCopy, libs, "gsk_component_transfer_copy")
1663+ core.PuregoSafeRegister(&xComponentTransferFree, libs, "gsk_component_transfer_free")
1664+
14321665 core.PuregoSafeRegister(&xPathGLibType, libs, "gsk_path_get_type")
14331666
14341667 core.PuregoSafeRegister(&xPathForeach, libs, "gsk_path_foreach")
1668+ core.PuregoSafeRegister(&xPathForeachIntersection, libs, "gsk_path_foreach_intersection")
14351669 core.PuregoSafeRegister(&xPathGetBounds, libs, "gsk_path_get_bounds")
14361670 core.PuregoSafeRegister(&xPathGetClosestPoint, libs, "gsk_path_get_closest_point")
14371671 core.PuregoSafeRegister(&xPathGetEndPoint, libs, "gsk_path_get_end_point")
@@ -1521,6 +1755,7 @@ func init() {
15211755 core.PuregoSafeRegister(&xTransformGetCategory, libs, "gsk_transform_get_category")
15221756 core.PuregoSafeRegister(&xTransformInvert, libs, "gsk_transform_invert")
15231757 core.PuregoSafeRegister(&xTransformMatrix, libs, "gsk_transform_matrix")
1758+ core.PuregoSafeRegister(&xTransformMatrix2d, libs, "gsk_transform_matrix_2d")
15241759 core.PuregoSafeRegister(&xTransformPerspective, libs, "gsk_transform_perspective")
15251760 core.PuregoSafeRegister(&xTransformPrint, libs, "gsk_transform_print")
15261761 core.PuregoSafeRegister(&xTransformRef, libs, "gsk_transform_ref")
A v4/gsk/main.go +100 -0
@@ -0,0 +1,100 @@
1+// Package gsk was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT
2+package gsk
3+
4+import (
5+ "github.com/jwijenbergh/purego"
6+ "github.com/jwijenbergh/puregotk/pkg/core"
7+ "github.com/jwijenbergh/puregotk/v4/gobject"
8+ "github.com/jwijenbergh/puregotk/v4/gobject/types"
9+)
10+
11+type ComponentTransferNode struct {
12+ RenderNode
13+}
14+
15+var xComponentTransferNodeGLibType func() types.GType
16+
17+func ComponentTransferNodeGLibType() types.GType {
18+ return xComponentTransferNodeGLibType()
19+}
20+
21+func ComponentTransferNodeNewFromInternalPtr(ptr uintptr) *ComponentTransferNode {
22+ cls := &ComponentTransferNode{}
23+ cls.Ptr = ptr
24+ return cls
25+}
26+
27+var xNewComponentTransferNode func(uintptr, *ComponentTransfer, *ComponentTransfer, *ComponentTransfer, *ComponentTransfer) uintptr
28+
29+// Creates a render node that will apply component
30+// transfers to a child node.
31+func NewComponentTransferNode(ChildVar *RenderNode, RVar *ComponentTransfer, GVar *ComponentTransfer, BVar *ComponentTransfer, AVar *ComponentTransfer) *ComponentTransferNode {
32+ var cls *ComponentTransferNode
33+
34+ cret := xNewComponentTransferNode(ChildVar.GoPointer(), RVar, GVar, BVar, AVar)
35+
36+ if cret == 0 {
37+ return nil
38+ }
39+ cls = &ComponentTransferNode{}
40+ cls.Ptr = cret
41+ return cls
42+}
43+
44+var xComponentTransferNodeGetChild func(uintptr) uintptr
45+
46+// Gets the child node that is getting drawn by the given @node.
47+func (x *ComponentTransferNode) GetChild() *RenderNode {
48+ var cls *RenderNode
49+
50+ cret := xComponentTransferNodeGetChild(x.GoPointer())
51+
52+ if cret == 0 {
53+ return nil
54+ }
55+ gobject.IncreaseRef(cret)
56+ cls = &RenderNode{}
57+ cls.Ptr = cret
58+ return cls
59+}
60+
61+var xComponentTransferNodeGetTransfer func(uintptr, uint) *ComponentTransfer
62+
63+// Gets the component transfer for one of the components.
64+func (x *ComponentTransferNode) GetTransfer(ComponentVar uint) *ComponentTransfer {
65+
66+ cret := xComponentTransferNodeGetTransfer(x.GoPointer(), ComponentVar)
67+ return cret
68+}
69+
70+func (c *ComponentTransferNode) GoPointer() uintptr {
71+ if c == nil {
72+ return 0
73+ }
74+ return c.Ptr
75+}
76+
77+func (c *ComponentTransferNode) SetGoPointer(ptr uintptr) {
78+ c.Ptr = ptr
79+}
80+
81+func init() {
82+ core.SetPackageName("GSK", "gtk4")
83+ core.SetSharedLibraries("GSK", []string{"libgtk-4.so.1"})
84+ var libs []uintptr
85+ for _, libPath := range core.GetPaths("GSK") {
86+ lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
87+ if err != nil {
88+ panic(err)
89+ }
90+ libs = append(libs, lib)
91+ }
92+
93+ core.PuregoSafeRegister(&xComponentTransferNodeGLibType, libs, "gsk_component_transfer_node_get_type")
94+
95+ core.PuregoSafeRegister(&xNewComponentTransferNode, libs, "gsk_component_transfer_node_new")
96+
97+ core.PuregoSafeRegister(&xComponentTransferNodeGetChild, libs, "gsk_component_transfer_node_get_child")
98+ core.PuregoSafeRegister(&xComponentTransferNodeGetTransfer, libs, "gsk_component_transfer_node_get_transfer")
99+
100+}
M v4/gtk/gtkapplication.go +3 -6
@@ -168,10 +168,8 @@ const (
168168 // [A simple example](https://gitlab.gnome.org/GNOME/gtk/tree/main/examples/bp/bloatpad.c)
169169 // is available in the GTK source code repository
170170 //
171-// `GtkApplication` optionally registers with a session manager of the
172-// users session (if you set the [property@Gtk.Application:register-session]
173-// property) and offers various functionality related to the session
174-// life-cycle.
171+// `GtkApplication` registers with a session manager if possible and
172+// offers various functionality related to the session life-cycle.
175173 //
176174 // An application can block various ways to end the session with
177175 // the [method@Gtk.Application.inhibit] function. Typical use cases for
@@ -520,8 +518,7 @@ func (c *Application) SetGoPointer(ptr uintptr) {
520518
521519 // Emitted when the session manager is about to end the session.
522520 //
523-// This signal is only emitted if [property@Gtk.Application:register-session]
524-// is true. Applications can connect to this signal and call
521+// Applications can connect to this signal and call
525522 // [method@Gtk.Application.inhibit] with [flags@Gtk.ApplicationInhibitFlags.logout]
526523 // to delay the end of the session until state has been saved.
527524 func (x *Application) ConnectQueryEnd(cb *func(Application)) uint32 {
M v4/gtk/gtkcalendar.go +23 -15
@@ -22,17 +22,15 @@ import (
2222 //
2323 // A `GtkCalendar` can be created with [ctor@Gtk.Calendar.new].
2424 //
25-// The date that is currently displayed can be altered with
26-// [method@Gtk.Calendar.select_day].
25+// The selected date can be retrieved from a `GtkCalendar` using
26+// [method@Gtk.Calendar.get_date].
27+// It can be altered with [method@Gtk.Calendar.set_date].
2728 //
2829 // To place a visual marker on a particular day, use
2930 // [method@Gtk.Calendar.mark_day] and to remove the marker,
3031 // [method@Gtk.Calendar.unmark_day]. Alternative, all
3132 // marks can be cleared with [method@Gtk.Calendar.clear_marks].
3233 //
33-// The selected date can be retrieved from a `GtkCalendar` using
34-// [method@Gtk.Calendar.get_date].
35-//
3634 // Users should be aware that, although the Gregorian calendar is the
3735 // legal calendar in most countries, it was adopted progressively
3836 // between 1582 and 1929. Display before these dates is likely to be
@@ -219,12 +217,21 @@ func (x *Calendar) SelectDay(DateVar *glib.DateTime) {
219217
220218 }
221219
220+var xCalendarSetDate func(uintptr, *glib.DateTime)
221+
222+// Switches to @date's year and month and selects its day.
223+func (x *Calendar) SetDate(DateVar *glib.DateTime) {
224+
225+ xCalendarSetDate(x.GoPointer(), DateVar)
226+
227+}
228+
222229 var xCalendarSetDay func(uintptr, int)
223230
224231 // Sets the day for the selected date.
225232 //
226-// The new date must be valid. For example, setting 31 for the day when the
227-// month is February, fails.
233+// The new date must be valid. For example, setting the day to 31 when the
234+// month is February will fail.
228235 func (x *Calendar) SetDay(DayVar int) {
229236
230237 xCalendarSetDay(x.GoPointer(), DayVar)
@@ -235,8 +242,8 @@ var xCalendarSetMonth func(uintptr, int)
235242
236243 // Sets the month for the selected date.
237244 //
238-// The new date must be valid. For example, setting 1 (February) for the month
239-// when the day is 31, fails.
245+// The new date must be valid. For example, setting the month to 1 (February)
246+// when the day is 31 will fail.
240247 func (x *Calendar) SetMonth(MonthVar int) {
241248
242249 xCalendarSetMonth(x.GoPointer(), MonthVar)
@@ -277,8 +284,8 @@ var xCalendarSetYear func(uintptr, int)
277284
278285 // Sets the year for the selected date.
279286 //
280-// The new date must be valid. For example, setting 2023 for the year when then
281-// the date is 2024-02-29, fails.
287+// The new date must be valid. For example, setting the year to 2023 when the
288+// date is February 29 will fail.
282289 func (x *Calendar) SetYear(YearVar int) {
283290
284291 xCalendarSetYear(x.GoPointer(), YearVar)
@@ -325,7 +332,7 @@ func (x *Calendar) ConnectDaySelected(cb *func(Calendar)) uint32 {
325332 return gobject.SignalConnect(x.GoPointer(), "day-selected", cbRefPtr)
326333 }
327334
328-// Emitted when the user switched to the next month.
335+// Emitted when the user switches to the next month.
329336 func (x *Calendar) ConnectNextMonth(cb *func(Calendar)) uint32 {
330337 cbPtr := uintptr(unsafe.Pointer(cb))
331338 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
@@ -345,7 +352,7 @@ func (x *Calendar) ConnectNextMonth(cb *func(Calendar)) uint32 {
345352 return gobject.SignalConnect(x.GoPointer(), "next-month", cbRefPtr)
346353 }
347354
348-// Emitted when user switched to the next year.
355+// Emitted when user switches to the next year.
349356 func (x *Calendar) ConnectNextYear(cb *func(Calendar)) uint32 {
350357 cbPtr := uintptr(unsafe.Pointer(cb))
351358 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
@@ -365,7 +372,7 @@ func (x *Calendar) ConnectNextYear(cb *func(Calendar)) uint32 {
365372 return gobject.SignalConnect(x.GoPointer(), "next-year", cbRefPtr)
366373 }
367374
368-// Emitted when the user switched to the previous month.
375+// Emitted when the user switches to the previous month.
369376 func (x *Calendar) ConnectPrevMonth(cb *func(Calendar)) uint32 {
370377 cbPtr := uintptr(unsafe.Pointer(cb))
371378 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
@@ -385,7 +392,7 @@ func (x *Calendar) ConnectPrevMonth(cb *func(Calendar)) uint32 {
385392 return gobject.SignalConnect(x.GoPointer(), "prev-month", cbRefPtr)
386393 }
387394
388-// Emitted when user switched to the previous year.
395+// Emitted when user switches to the previous year.
389396 func (x *Calendar) ConnectPrevYear(cb *func(Calendar)) uint32 {
390397 cbPtr := uintptr(unsafe.Pointer(cb))
391398 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
@@ -710,6 +717,7 @@ func init() {
710717 core.PuregoSafeRegister(&xCalendarGetYear, libs, "gtk_calendar_get_year")
711718 core.PuregoSafeRegister(&xCalendarMarkDay, libs, "gtk_calendar_mark_day")
712719 core.PuregoSafeRegister(&xCalendarSelectDay, libs, "gtk_calendar_select_day")
720+ core.PuregoSafeRegister(&xCalendarSetDate, libs, "gtk_calendar_set_date")
713721 core.PuregoSafeRegister(&xCalendarSetDay, libs, "gtk_calendar_set_day")
714722 core.PuregoSafeRegister(&xCalendarSetMonth, libs, "gtk_calendar_set_month")
715723 core.PuregoSafeRegister(&xCalendarSetShowDayNames, libs, "gtk_calendar_set_show_day_names")
M v4/gtk/gtkcolordialog.go +3 -0
@@ -79,6 +79,9 @@ func (x *ColorDialog) ChooseRgba(ParentVar *Window, InitialColorVar *gdk.RGBA, C
7979 var xColorDialogChooseRgbaFinish func(uintptr, uintptr, **glib.Error) *gdk.RGBA
8080
8181 // Finishes the [method@Gtk.ColorDialog.choose_rgba] call
82+//
83+// Note that this function returns a [error@Gtk.DialogError.DISMISSED]
84+// error if the user cancels the dialog.
8285 func (x *ColorDialog) ChooseRgbaFinish(ResultVar gio.AsyncResult) (*gdk.RGBA, error) {
8386 var cerr *glib.Error
8487
M v4/gtk/gtkdebug.go +4 -2
@@ -36,7 +36,7 @@ const (
3636 DebugIconthemeValue DebugFlags = 32
3737 // Information about printing
3838 DebugPrintingValue DebugFlags = 64
39-
39+ // Trace GtkBuilder operation
4040 DebugBuilderTraceValue DebugFlags = 128
4141 // Information about size requests
4242 DebugSizeRequestValue DebugFlags = 256
@@ -44,6 +44,8 @@ const (
4444 DebugNoCssCacheValue DebugFlags = 512
4545 // Open the GTK inspector
4646 DebugInteractiveValue DebugFlags = 1024
47+ // Show touch UI elements for pointer events.
48+ DebugTouchscreenValue DebugFlags = 2048
4749 // Information about actions and menu models
4850 DebugActionsValue DebugFlags = 4096
4951 // Information from layout managers
@@ -62,7 +64,7 @@ const (
6264 DebugInvertTextDirValue DebugFlags = 524288
6365 // Information about deprecated CSS features.
6466 DebugCssValue DebugFlags = 1048576
65- // Trace GtkBuilder operation
67+ // Information about deprecated GtkBuilder features.
6668 DebugBuilderValue DebugFlags = 2097152
6769 )
6870
M v4/gtk/gtkentry.go +30 -0
@@ -499,6 +499,20 @@ func (x *Entry) GetMaxLength() int {
499499 return cret
500500 }
501501
502+var xEntryGetMenuEntryIconText func(uintptr, EntryIconPosition) string
503+
504+// Gets the text that will be used in the context menu of the `GtkEntry`
505+// when the specified icon is activatable. Selecting this item in the menu
506+// results, from all aspects, the same than clicking on the specified icon.
507+// This greatly simplifies making accessible applications, because the icons
508+// aren't focusable when using keyboard navigation. This is why Gtk recommends
509+// to add the same action to the context menu.
510+func (x *Entry) GetMenuEntryIconText(IconPosVar EntryIconPosition) string {
511+
512+ cret := xEntryGetMenuEntryIconText(x.GoPointer(), IconPosVar)
513+ return cret
514+}
515+
502516 var xEntryGetOverwriteMode func(uintptr) bool
503517
504518 // Gets whether the `GtkEntry` is in overwrite mode.
@@ -868,6 +882,20 @@ func (x *Entry) SetMaxLength(MaxVar int) {
868882
869883 }
870884
885+var xEntrySetMenuEntryIconText func(uintptr, EntryIconPosition, string)
886+
887+// Sets the text that will be used in the context menu of the `GtkEntry`
888+// when the specified icon is activatable. Selecting this item in the menu
889+// results, from all aspects, the same than clicking on the specified icon.
890+// This greatly simplifies making accessible applications, because the icons
891+// aren't focusable when using keyboard navigation. This is why Gtk recommends
892+// to add the same action to the context menu.
893+func (x *Entry) SetMenuEntryIconText(IconPosVar EntryIconPosition, TextVar string) {
894+
895+ xEntrySetMenuEntryIconText(x.GoPointer(), IconPosVar, TextVar)
896+
897+}
898+
871899 var xEntrySetOverwriteMode func(uintptr, bool)
872900
873901 // Sets whether the text is overwritten when typing in the `GtkEntry`.
@@ -1647,6 +1675,7 @@ func init() {
16471675 core.PuregoSafeRegister(&xEntryGetInputPurpose, libs, "gtk_entry_get_input_purpose")
16481676 core.PuregoSafeRegister(&xEntryGetInvisibleChar, libs, "gtk_entry_get_invisible_char")
16491677 core.PuregoSafeRegister(&xEntryGetMaxLength, libs, "gtk_entry_get_max_length")
1678+ core.PuregoSafeRegister(&xEntryGetMenuEntryIconText, libs, "gtk_entry_get_menu_entry_icon_text")
16501679 core.PuregoSafeRegister(&xEntryGetOverwriteMode, libs, "gtk_entry_get_overwrite_mode")
16511680 core.PuregoSafeRegister(&xEntryGetPlaceholderText, libs, "gtk_entry_get_placeholder_text")
16521681 core.PuregoSafeRegister(&xEntryGetProgressFraction, libs, "gtk_entry_get_progress_fraction")
@@ -1676,6 +1705,7 @@ func init() {
16761705 core.PuregoSafeRegister(&xEntrySetInputPurpose, libs, "gtk_entry_set_input_purpose")
16771706 core.PuregoSafeRegister(&xEntrySetInvisibleChar, libs, "gtk_entry_set_invisible_char")
16781707 core.PuregoSafeRegister(&xEntrySetMaxLength, libs, "gtk_entry_set_max_length")
1708+ core.PuregoSafeRegister(&xEntrySetMenuEntryIconText, libs, "gtk_entry_set_menu_entry_icon_text")
16791709 core.PuregoSafeRegister(&xEntrySetOverwriteMode, libs, "gtk_entry_set_overwrite_mode")
16801710 core.PuregoSafeRegister(&xEntrySetPlaceholderText, libs, "gtk_entry_set_placeholder_text")
16811711 core.PuregoSafeRegister(&xEntrySetProgressFraction, libs, "gtk_entry_set_progress_fraction")
M v4/gtk/gtkenums.go +62 -2
@@ -360,7 +360,7 @@ const (
360360 // Value type: double
361361 AccessiblePropertyValueNowValue AccessibleProperty = 17
362362 // Defines the human readable text alternative
363- // of aria-valuenow for a range widget. Value type: string
363+ // of [enum@Gtk.AccessibleProperty.VALUE_NOW] for a range widget. Value type: string
364364 AccessiblePropertyValueTextValue AccessibleProperty = 18
365365 // Defines a string value that provides a description of non-standard keyboard
366366 // interactions of the current element. Value type: string
@@ -434,7 +434,7 @@ const (
434434 // Value type: integer
435435 AccessibleRelationRowIndexValue AccessibleRelation = 14
436436 // Defines a human readable text
437- // alternative of aria-rowindex. Value type: string
437+ // alternative of [enum@Gtk.AccessibleRelation.ROW_INDEX]. Value type: string
438438 AccessibleRelationRowIndexTextValue AccessibleRelation = 15
439439 // Defines the number of rows spanned by a
440440 // cell or gridcell within a table, grid, or treegrid. Value type: integer
@@ -1231,6 +1231,62 @@ const (
12311231 InputPurposeTerminalValue InputPurpose = 10
12321232 )
12331233
1234+// Values for the [property@Gtk.Settings:gtk-interface-color-scheme]
1235+// and [property@Gtk.CssProvider:prefers-color-scheme] properties
1236+// that indicates what color scheme is used.
1237+//
1238+// This information can be used inside CSS via media queries.
1239+//
1240+// More values may be added to this enumeration. Unknown values
1241+// should be treated the same as `GTK_INTERFACE_COLOR_SCHEME_DEFAULT`.
1242+type InterfaceColorScheme int
1243+
1244+var xInterfaceColorSchemeGLibType func() types.GType
1245+
1246+func InterfaceColorSchemeGLibType() types.GType {
1247+ return xInterfaceColorSchemeGLibType()
1248+}
1249+
1250+const (
1251+
1252+ // The system doesn't support color schemes
1253+ InterfaceColorSchemeUnsupportedValue InterfaceColorScheme = 0
1254+ // The default color scheme is used
1255+ InterfaceColorSchemeDefaultValue InterfaceColorScheme = 1
1256+ // A dark color scheme is used
1257+ InterfaceColorSchemeDarkValue InterfaceColorScheme = 2
1258+ // A light color scheme is used
1259+ InterfaceColorSchemeLightValue InterfaceColorScheme = 3
1260+)
1261+
1262+// Values for the [property@Gtk.Settings:gtk-interface-contrast]
1263+// and [property@Gtk.CssProvider:prefers-contrast] properties
1264+// that indicates the preferred level of contrast.
1265+//
1266+// This information can be used inside CSS via media queries.
1267+//
1268+// More values may be added to this enumeration. Unknown values
1269+// should be treated the same as `GTK_INTERFACE_CONTRAST_NO_PREFERENCE`.
1270+type InterfaceContrast int
1271+
1272+var xInterfaceContrastGLibType func() types.GType
1273+
1274+func InterfaceContrastGLibType() types.GType {
1275+ return xInterfaceContrastGLibType()
1276+}
1277+
1278+const (
1279+
1280+ // The system doesn't support contrast levels
1281+ InterfaceContrastUnsupportedValue InterfaceContrast = 0
1282+ // No particular preference for contrast
1283+ InterfaceContrastNoPreferenceValue InterfaceContrast = 1
1284+ // More contrast is preferred
1285+ InterfaceContrastMoreValue InterfaceContrast = 2
1286+ // Less contrast is preferred
1287+ InterfaceContrastLessValue InterfaceContrast = 3
1288+)
1289+
12341290 // Used for justifying the text inside a [class@Label] widget.
12351291 type Justification int
12361292
@@ -2143,6 +2199,10 @@ func init() {
21432199
21442200 core.PuregoSafeRegister(&xInputPurposeGLibType, libs, "gtk_input_purpose_get_type")
21452201
2202+ core.PuregoSafeRegister(&xInterfaceColorSchemeGLibType, libs, "gtk_interface_color_scheme_get_type")
2203+
2204+ core.PuregoSafeRegister(&xInterfaceContrastGLibType, libs, "gtk_interface_contrast_get_type")
2205+
21462206 core.PuregoSafeRegister(&xJustificationGLibType, libs, "gtk_justification_get_type")
21472207
21482208 core.PuregoSafeRegister(&xLevelBarModeGLibType, libs, "gtk_level_bar_mode_get_type")
M v4/gtk/gtkeventcontrollerscroll.go +3 -0
@@ -42,6 +42,9 @@ const (
4242 EventControllerScrollDiscreteValue EventControllerScrollFlags = 4
4343 // Emit ::decelerate after continuous scroll finishes.
4444 EventControllerScrollKineticValue EventControllerScrollFlags = 8
45+ // A #GtkEventControllerScrollFlags value to prefer physical direction over
46+ // logical direction (i.e. oblivious to natural scroll).
47+ EventControllerScrollPhysicalDirectionValue EventControllerScrollFlags = 16
4548 // Emit scroll on both axes.
4649 EventControllerScrollBothAxesValue EventControllerScrollFlags = 3
4750 )
M v4/gtk/gtkexpander.go +4 -9
@@ -74,22 +74,17 @@ import (
7474 //
7575 // # GtkExpander as GtkBuildable
7676 //
77-// The `GtkExpander` implementation of the `GtkBuildable` interface supports
78-// placing a child in the label position by specifying “label” as the
79-// “type” attribute of a `&lt;child&gt;` element. A normal content child can be
80-// specified without specifying a `&lt;child&gt;` type attribute.
81-//
8277 // An example of a UI definition fragment with GtkExpander:
8378 //
8479 // ```xml
8580 // &lt;object class="GtkExpander"&gt;
8681 //
87-// &lt;child type="label"&gt;
82+// &lt;property name="label-widget"&gt;
8883 // &lt;object class="GtkLabel" id="expander-label"/&gt;
89-// &lt;/child&gt;
90-// &lt;child&gt;
84+// &lt;/property&gt;
85+// &lt;property name="child"&gt;
9186 // &lt;object class="GtkEntry" id="expander-content"/&gt;
92-// &lt;/child&gt;
87+// &lt;/property&gt;
9388 //
9489 // &lt;/object&gt;
9590 // ```
M v4/gtk/gtkexpression.go +22 -0
@@ -455,6 +455,28 @@ func (c *ConstantExpression) SetGoPointer(ptr uintptr) {
455455 //
456456 // ```
457457 //
458+// String (`type='gchararray'`) constants can be marked for translation with the
459+// `translatable=` attribute, and will then be looked up in the
460+// [property@Gtk.Builder:translation-domain] when the expression is constructed.
461+//
462+// ```xml
463+//
464+// &lt;constant type='gchararray' translatable='yes'&gt;I'm translatable!&lt;/constant&gt;
465+//
466+// ```
467+//
468+// As with other translatable strings in [type@Gtk.Builder], constants can
469+// also have a context and/or translation comment:
470+//
471+// ```xml
472+//
473+// &lt;constant type='gchararray'
474+// translatable='yes'
475+// context='example'
476+// comments='A sample string'&gt;I'm translatable!&lt;/constant&gt;
477+//
478+// ```
479+//
458480 // To create a closure expression, use the `&lt;closure&gt;` element. The `function`
459481 // attribute specifies what function to use for the closure, and the `type`
460482 // attribute specifies its return type. The content of the element contains the
M v4/gtk/gtkfilechooserdialog.go +1 -1
@@ -138,7 +138,7 @@ import (
138138 // - To save a file under a different name, use %GTK_FILE_CHOOSER_ACTION_SAVE,
139139 // and set the existing file with [method@Gtk.FileChooser.set_file].
140140 //
141-// - To choose a folder instead of a filem use %GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER.
141+// - To choose a folder instead of a file, use %GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER.
142142 //
143143 // In general, you should only cause the file chooser to show a specific
144144 // folder when it is appropriate to use [method@Gtk.FileChooser.set_file],
M v4/gtk/gtkfiledialog.go +32 -8
@@ -178,7 +178,7 @@ var xFileDialogOpen func(uintptr, uintptr, uintptr, uintptr, uintptr)
178178 //
179179 // The file chooser dialog will be set up to select a single file.
180180 //
181-// The @callback will be called when the dialog is dismissed.
181+// The @callback will be called when the dialog is closed.
182182 func (x *FileDialog) Open(ParentVar *Window, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) {
183183
184184 xFileDialogOpen(x.GoPointer(), ParentVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar)
@@ -188,6 +188,9 @@ func (x *FileDialog) Open(ParentVar *Window, CancellableVar *gio.Cancellable, Ca
188188 var xFileDialogOpenFinish func(uintptr, uintptr, **glib.Error) uintptr
189189
190190 // Finishes the [method@Gtk.FileDialog.open] call.
191+//
192+// Note that this function returns a [error@Gtk.DialogError.DISMISSED]
193+// error if the user cancels the dialog.
191194 func (x *FileDialog) OpenFinish(ResultVar gio.AsyncResult) (*gio.FileBase, error) {
192195 var cls *gio.FileBase
193196 var cerr *glib.Error
@@ -215,7 +218,7 @@ var xFileDialogOpenMultiple func(uintptr, uintptr, uintptr, uintptr, uintptr)
215218 // The file chooser dialog will initially be opened in the directory
216219 // [property@Gtk.FileDialog:initial-folder].
217220 //
218-// The @callback will be called when the dialog is dismissed.
221+// The @callback will be called when the dialog is closed.
219222 func (x *FileDialog) OpenMultiple(ParentVar *Window, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) {
220223
221224 xFileDialogOpenMultiple(x.GoPointer(), ParentVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar)
@@ -225,6 +228,9 @@ func (x *FileDialog) OpenMultiple(ParentVar *Window, CancellableVar *gio.Cancell
225228 var xFileDialogOpenMultipleFinish func(uintptr, uintptr, **glib.Error) uintptr
226229
227230 // Finishes the [method@Gtk.FileDialog.open] call.
231+//
232+// Note that this function returns a [error@Gtk.DialogError.DISMISSED]
233+// error if the user cancels the dialog.
228234 func (x *FileDialog) OpenMultipleFinish(ResultVar gio.AsyncResult) (*gio.ListModelBase, error) {
229235 var cls *gio.ListModelBase
230236 var cerr *glib.Error
@@ -255,7 +261,7 @@ var xFileDialogOpenMultipleTextFiles func(uintptr, uintptr, uintptr, uintptr, ui
255261 // In contrast to [method@Gtk.FileDialog.open], this function
256262 // lets the user select the text encoding for the files, if possible.
257263 //
258-// The @callback will be called when the dialog is dismissed.
264+// The @callback will be called when the dialog is closed.
259265 func (x *FileDialog) OpenMultipleTextFiles(ParentVar *Window, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) {
260266
261267 xFileDialogOpenMultipleTextFiles(x.GoPointer(), ParentVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar)
@@ -265,6 +271,9 @@ func (x *FileDialog) OpenMultipleTextFiles(ParentVar *Window, CancellableVar *gi
265271 var xFileDialogOpenMultipleTextFilesFinish func(uintptr, uintptr, string, **glib.Error) uintptr
266272
267273 // Finishes the [method@Gtk.FileDialog.open] call.
274+//
275+// Note that this function returns a [error@Gtk.DialogError.DISMISSED]
276+// error if the user cancels the dialog.
268277 func (x *FileDialog) OpenMultipleTextFilesFinish(ResultVar gio.AsyncResult, EncodingVar string) (*gio.ListModelBase, error) {
269278 var cls *gio.ListModelBase
270279 var cerr *glib.Error
@@ -291,7 +300,7 @@ var xFileDialogOpenTextFile func(uintptr, uintptr, uintptr, uintptr, uintptr)
291300 // In contrast to [method@Gtk.FileDialog.open], this function
292301 // lets the user select the text encoding for the file, if possible.
293302 //
294-// The @callback will be called when the dialog is dismissed.
303+// The @callback will be called when the dialog is closed.
295304 func (x *FileDialog) OpenTextFile(ParentVar *Window, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) {
296305
297306 xFileDialogOpenTextFile(x.GoPointer(), ParentVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar)
@@ -307,6 +316,9 @@ var xFileDialogOpenTextFileFinish func(uintptr, uintptr, string, **glib.Error) u
307316 // for the file, then @encoding will be set to a codeset name that
308317 // is suitable for passing to iconv_open(). Otherwise, it will
309318 // be `NULL`.
319+//
320+// Note that this function returns a [error@Gtk.DialogError.DISMISSED]
321+// error if the user cancels the dialog.
310322 func (x *FileDialog) OpenTextFileFinish(ResultVar gio.AsyncResult, EncodingVar string) (*gio.FileBase, error) {
311323 var cls *gio.FileBase
312324 var cerr *glib.Error
@@ -331,7 +343,7 @@ var xFileDialogSave func(uintptr, uintptr, uintptr, uintptr, uintptr)
331343 //
332344 // The file chooser dialog will be save mode.
333345 //
334-// The @callback will be called when the dialog is dismissed.
346+// The @callback will be called when the dialog is closed.
335347 func (x *FileDialog) Save(ParentVar *Window, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) {
336348
337349 xFileDialogSave(x.GoPointer(), ParentVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar)
@@ -341,6 +353,9 @@ func (x *FileDialog) Save(ParentVar *Window, CancellableVar *gio.Cancellable, Ca
341353 var xFileDialogSaveFinish func(uintptr, uintptr, **glib.Error) uintptr
342354
343355 // Finishes the [method@Gtk.FileDialog.save] call.
356+//
357+// Note that this function returns a [error@Gtk.DialogError.DISMISSED]
358+// error if the user cancels the dialog.
344359 func (x *FileDialog) SaveFinish(ResultVar gio.AsyncResult) (*gio.FileBase, error) {
345360 var cls *gio.FileBase
346361 var cerr *glib.Error
@@ -368,7 +383,7 @@ var xFileDialogSaveTextFile func(uintptr, uintptr, uintptr, uintptr, uintptr)
368383 // lets the user select the text encoding and line endings for
369384 // the text file, if possible.
370385 //
371-// The @callback will be called when the dialog is dismissed.
386+// The @callback will be called when the dialog is closed.
372387 func (x *FileDialog) SaveTextFile(ParentVar *Window, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) {
373388
374389 xFileDialogSaveTextFile(x.GoPointer(), ParentVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar)
@@ -387,6 +402,9 @@ var xFileDialogSaveTextFileFinish func(uintptr, uintptr, string, string, **glib.
387402 //
388403 // The @line_ending will be set to one of "\n", "\r\n", "\r" or "",
389404 // where the latter means to preserve existing line endings.
405+//
406+// Note that this function returns a [error@Gtk.DialogError.DISMISSED]
407+// error if the user cancels the dialog.
390408 func (x *FileDialog) SaveTextFileFinish(ResultVar gio.AsyncResult, EncodingVar string, LineEndingVar string) (*gio.FileBase, error) {
391409 var cls *gio.FileBase
392410 var cerr *glib.Error
@@ -415,7 +433,7 @@ var xFileDialogSelectFolder func(uintptr, uintptr, uintptr, uintptr, uintptr)
415433 // be opened in the parent directory of that folder, otherwise, it
416434 // will be in the directory [property@Gtk.FileDialog:initial-folder].
417435 //
418-// The @callback will be called when the dialog is dismissed.
436+// The @callback will be called when the dialog is closed.
419437 func (x *FileDialog) SelectFolder(ParentVar *Window, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) {
420438
421439 xFileDialogSelectFolder(x.GoPointer(), ParentVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar)
@@ -425,6 +443,9 @@ func (x *FileDialog) SelectFolder(ParentVar *Window, CancellableVar *gio.Cancell
425443 var xFileDialogSelectFolderFinish func(uintptr, uintptr, **glib.Error) uintptr
426444
427445 // Finishes the [method@Gtk.FileDialog.select_folder] call.
446+//
447+// Note that this function returns a [error@Gtk.DialogError.DISMISSED]
448+// error if the user cancels the dialog.
428449 func (x *FileDialog) SelectFolderFinish(ResultVar gio.AsyncResult) (*gio.FileBase, error) {
429450 var cls *gio.FileBase
430451 var cerr *glib.Error
@@ -453,7 +474,7 @@ var xFileDialogSelectMultipleFolders func(uintptr, uintptr, uintptr, uintptr, ui
453474 // The file chooser dialog will initially be opened in the
454475 // directory [property@Gtk.FileDialog:initial-folder].
455476 //
456-// The @callback will be called when the dialog is dismissed.
477+// The @callback will be called when the dialog is closed.
457478 func (x *FileDialog) SelectMultipleFolders(ParentVar *Window, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) {
458479
459480 xFileDialogSelectMultipleFolders(x.GoPointer(), ParentVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar)
@@ -463,6 +484,9 @@ func (x *FileDialog) SelectMultipleFolders(ParentVar *Window, CancellableVar *gi
463484 var xFileDialogSelectMultipleFoldersFinish func(uintptr, uintptr, **glib.Error) uintptr
464485
465486 // Finishes the [method@Gtk.FileDialog.select_multiple_folders] call.
487+//
488+// Note that this function returns a [error@Gtk.DialogError.DISMISSED]
489+// error if the user cancels the dialog.
466490 func (x *FileDialog) SelectMultipleFoldersFinish(ResultVar gio.AsyncResult) (*gio.ListModelBase, error) {
467491 var cls *gio.ListModelBase
468492 var cerr *glib.Error
M v4/gtk/gtkfilter.go +17 -0
@@ -278,6 +278,8 @@ func (x *FilterClass) GetGtkReserved8() func() {
278278 // If you are writing an implementation and are not sure which
279279 // value to pass, `GTK_FILTER_CHANGE_DIFFERENT` is always a correct
280280 // choice.
281+//
282+// New values may be added in the future.
281283 type FilterChange int
282284
283285 var xFilterChangeGLibType func() types.GType
@@ -299,6 +301,21 @@ const (
299301 // it was before: All items that it used to return false
300302 // still return false, others now may, too.
301303 FilterChangeMoreStrictValue FilterChange = 2
304+ // Similar to [enum@Gtk.FilterChange.DIFFERENT],
305+ // but signs that item watches should be recreated. This is used by
306+ // [class@Gtk.FilterListModel] to keep the list up-to-date when items
307+ // change.
308+ FilterChangeDifferentRewatchValue FilterChange = 3
309+ // Similar to [enum@Gtk.FilterChange.LESS_STRICT],
310+ // but signs that item watches should be recreated. This is used by
311+ // [class@Gtk.FilterListModel] to keep the list up-to-date when items
312+ // change.
313+ FilterChangeLessStrictRewatchValue FilterChange = 4
314+ // Similar to [enum@Gtk.FilterChange.MORE_STRICT],
315+ // but signs that item watches should be recreated. This is used by
316+ // [class@Gtk.FilterListModel] to keep the list up-to-date when items
317+ // change.
318+ FilterChangeMoreStrictRewatchValue FilterChange = 5
302319 )
303320
304321 // Describes the known strictness of a filter.
M v4/gtk/gtkfilterlistmodel.go +28 -0
@@ -134,6 +134,17 @@ func (x *FilterListModel) GetPending() uint {
134134 return cret
135135 }
136136
137+var xFilterListModelGetWatchItems func(uintptr) bool
138+
139+// Returns whether watching items is enabled.
140+//
141+// See [method@Gtk.FilterListModel.set_watch_items].
142+func (x *FilterListModel) GetWatchItems() bool {
143+
144+ cret := xFilterListModelGetWatchItems(x.GoPointer())
145+ return cret
146+}
147+
137148 var xFilterListModelSetFilter func(uintptr, uintptr)
138149
139150 // Sets the filter used to filter items.
@@ -181,6 +192,21 @@ func (x *FilterListModel) SetModel(ModelVar gio.ListModel) {
181192
182193 }
183194
195+var xFilterListModelSetWatchItems func(uintptr, bool)
196+
197+// Sets the filter model to monitor properties of its items.
198+//
199+// This allows implementations of [class@Gtk.Filter] that support expression
200+// watching to react to property changes. This property has no effect if the
201+// current filter doesn't support watching items.
202+//
203+// By default, watching items is disabled.
204+func (x *FilterListModel) SetWatchItems(WatchItemsVar bool) {
205+
206+ xFilterListModelSetWatchItems(x.GoPointer(), WatchItemsVar)
207+
208+}
209+
184210 func (c *FilterListModel) GoPointer() uintptr {
185211 if c == nil {
186212 return 0
@@ -335,8 +361,10 @@ func init() {
335361 core.PuregoSafeRegister(&xFilterListModelGetIncremental, libs, "gtk_filter_list_model_get_incremental")
336362 core.PuregoSafeRegister(&xFilterListModelGetModel, libs, "gtk_filter_list_model_get_model")
337363 core.PuregoSafeRegister(&xFilterListModelGetPending, libs, "gtk_filter_list_model_get_pending")
364+ core.PuregoSafeRegister(&xFilterListModelGetWatchItems, libs, "gtk_filter_list_model_get_watch_items")
338365 core.PuregoSafeRegister(&xFilterListModelSetFilter, libs, "gtk_filter_list_model_set_filter")
339366 core.PuregoSafeRegister(&xFilterListModelSetIncremental, libs, "gtk_filter_list_model_set_incremental")
340367 core.PuregoSafeRegister(&xFilterListModelSetModel, libs, "gtk_filter_list_model_set_model")
368+ core.PuregoSafeRegister(&xFilterListModelSetWatchItems, libs, "gtk_filter_list_model_set_watch_items")
341369
342370 }
M v4/gtk/gtkfontdialog.go +11 -3
@@ -83,6 +83,9 @@ func (x *FontDialog) ChooseFace(ParentVar *Window, InitialValueVar *pango.FontFa
8383 var xFontDialogChooseFaceFinish func(uintptr, uintptr, **glib.Error) uintptr
8484
8585 // Finishes the [method@Gtk.FontDialog.choose_face] call.
86+//
87+// Note that this function returns a [error@Gtk.DialogError.DISMISSED]
88+// error if the user cancels the dialog.
8689 func (x *FontDialog) ChooseFaceFinish(ResultVar gio.AsyncResult) (*pango.FontFace, error) {
8790 var cls *pango.FontFace
8891 var cerr *glib.Error
@@ -116,9 +119,8 @@ var xFontDialogChooseFamilyFinish func(uintptr, uintptr, **glib.Error) uintptr
116119
117120 // Finishes the [method@Gtk.FontDialog.choose_family] call.
118121 //
119-// This function never returns an error. If the operation is
120-// not finished successfully, the value passed as @initial_value
121-// to [method@Gtk.FontDialog.choose_family] is returned.
122+// Note that this function returns a [error@Gtk.DialogError.DISMISSED]
123+// error if the user cancels the dialog.
122124 func (x *FontDialog) ChooseFamilyFinish(ResultVar gio.AsyncResult) (*pango.FontFamily, error) {
123125 var cls *pango.FontFamily
124126 var cerr *glib.Error
@@ -172,6 +174,9 @@ var xFontDialogChooseFontAndFeaturesFinish func(uintptr, uintptr, **pango.FontDe
172174 //
173175 // The selected font and features are returned in @font_desc and
174176 // @font_features.
177+//
178+// Note that this function returns a [error@Gtk.DialogError.DISMISSED]
179+// error if the user cancels the dialog.
175180 func (x *FontDialog) ChooseFontAndFeaturesFinish(ResultVar gio.AsyncResult, FontDescVar **pango.FontDescription, FontFeaturesVar string, LanguageVar **pango.Language) (bool, error) {
176181 var cerr *glib.Error
177182
@@ -186,6 +191,9 @@ func (x *FontDialog) ChooseFontAndFeaturesFinish(ResultVar gio.AsyncResult, Font
186191 var xFontDialogChooseFontFinish func(uintptr, uintptr, **glib.Error) *pango.FontDescription
187192
188193 // Finishes the [method@Gtk.FontDialog.choose_font] call.
194+//
195+// Note that this function returns a [error@Gtk.DialogError.DISMISSED]
196+// error if the user cancels the dialog.
189197 func (x *FontDialog) ChooseFontFinish(ResultVar gio.AsyncResult) (*pango.FontDescription, error) {
190198 var cerr *glib.Error
191199
M v4/gtk/gtkframe.go +5 -9
@@ -66,21 +66,17 @@ func (x *FrameClass) GetComputeChildAllocation() func(*Frame, *Allocation) {
6666 //
6767 // # GtkFrame as GtkBuildable
6868 //
69-// The `GtkFrame` implementation of the `GtkBuildable` interface supports
70-// placing a child in the label position by specifying “label” as the
71-// “type” attribute of a `&lt;child&gt;` element. A normal content child can
72-// be specified without specifying a `&lt;child&gt;` type attribute.
73-//
7469 // An example of a UI definition fragment with GtkFrame:
70+//
7571 // ```xml
7672 // &lt;object class="GtkFrame"&gt;
7773 //
78-// &lt;child type="label"&gt;
74+// &lt;property name="label-widget"&gt;
7975 // &lt;object class="GtkLabel" id="frame_label"/&gt;
80-// &lt;/child&gt;
81-// &lt;child&gt;
76+// &lt;/property&gt;
77+// &lt;property name="child"&gt;
8278 // &lt;object class="GtkEntry" id="frame_content"/&gt;
83-// &lt;/child&gt;
79+// &lt;/property&gt;
8480 //
8581 // &lt;/object&gt;
8682 // ```
A v4/gtk/gtkiconpaintable.go +296 -0
@@ -0,0 +1,296 @@
1+// Package gtk was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT
2+package gtk
3+
4+import (
5+ "structs"
6+ "unsafe"
7+
8+ "github.com/jwijenbergh/purego"
9+ "github.com/jwijenbergh/puregotk/pkg/core"
10+ "github.com/jwijenbergh/puregotk/v4/gdk"
11+ "github.com/jwijenbergh/puregotk/v4/gio"
12+ "github.com/jwijenbergh/puregotk/v4/gobject"
13+ "github.com/jwijenbergh/puregotk/v4/gobject/types"
14+)
15+
16+type IconPaintableClass struct {
17+ _ structs.HostLayout
18+
19+ ParentClass gobject.ObjectClass
20+}
21+
22+func (x *IconPaintableClass) GoPointer() uintptr {
23+ return uintptr(unsafe.Pointer(x))
24+}
25+
26+// Contains information found when looking up an icon in `GtkIconTheme`
27+// or loading it from a file.
28+//
29+// `GtkIconPaintable` implements `GdkPaintable` and `GtkSymbolicPaintable`.
30+type IconPaintable struct {
31+ gobject.Object
32+}
33+
34+var xIconPaintableGLibType func() types.GType
35+
36+func IconPaintableGLibType() types.GType {
37+ return xIconPaintableGLibType()
38+}
39+
40+func IconPaintableNewFromInternalPtr(ptr uintptr) *IconPaintable {
41+ cls := &IconPaintable{}
42+ cls.Ptr = ptr
43+ return cls
44+}
45+
46+var xNewIconPaintableForFile func(uintptr, int, int) uintptr
47+
48+// Creates a `GtkIconPaintable` for a file with a given size and scale.
49+//
50+// The icon can then be rendered by using it as a `GdkPaintable`.
51+func NewIconPaintableForFile(FileVar gio.File, SizeVar int, ScaleVar int) *IconPaintable {
52+ var cls *IconPaintable
53+
54+ cret := xNewIconPaintableForFile(FileVar.GoPointer(), SizeVar, ScaleVar)
55+
56+ if cret == 0 {
57+ return nil
58+ }
59+ cls = &IconPaintable{}
60+ cls.Ptr = cret
61+ return cls
62+}
63+
64+var xIconPaintableGetFile func(uintptr) uintptr
65+
66+// Gets the `GFile` that was used to load the icon.
67+//
68+// Returns %NULL if the icon was not loaded from a file.
69+func (x *IconPaintable) GetFile() *gio.FileBase {
70+ var cls *gio.FileBase
71+
72+ cret := xIconPaintableGetFile(x.GoPointer())
73+
74+ if cret == 0 {
75+ return nil
76+ }
77+ cls = &gio.FileBase{}
78+ cls.Ptr = cret
79+ return cls
80+}
81+
82+var xIconPaintableGetIconName func(uintptr) string
83+
84+// Get the icon name being used for this icon.
85+//
86+// When an icon looked up in the icon theme was not available, the
87+// icon theme may use fallback icons - either those specified to
88+// gtk_icon_theme_lookup_icon() or the always-available
89+// "image-missing". The icon chosen is returned by this function.
90+//
91+// If the icon was created without an icon theme, this function
92+// returns %NULL.
93+func (x *IconPaintable) GetIconName() string {
94+
95+ cret := xIconPaintableGetIconName(x.GoPointer())
96+ return cret
97+}
98+
99+var xIconPaintableIsSymbolic func(uintptr) bool
100+
101+// Checks if the icon is symbolic or not.
102+//
103+// This currently uses only the file name and not the file contents
104+// for determining this. This behaviour may change in the future.
105+func (x *IconPaintable) IsSymbolic() bool {
106+
107+ cret := xIconPaintableIsSymbolic(x.GoPointer())
108+ return cret
109+}
110+
111+func (c *IconPaintable) GoPointer() uintptr {
112+ if c == nil {
113+ return 0
114+ }
115+ return c.Ptr
116+}
117+
118+func (c *IconPaintable) SetGoPointer(ptr uintptr) {
119+ c.Ptr = ptr
120+}
121+
122+// Compute a concrete size for the `GdkPaintable`.
123+//
124+// Applies the sizing algorithm outlined in the
125+// [CSS Image spec](https://drafts.csswg.org/css-images-3/#default-sizing)
126+// to the given @paintable. See that link for more details.
127+//
128+// It is not necessary to call this function when both @specified_width
129+// and @specified_height are known, but it is useful to call this
130+// function in GtkWidget:measure implementations to compute the
131+// other dimension when only one dimension is given.
132+func (x *IconPaintable) ComputeConcreteSize(SpecifiedWidthVar float64, SpecifiedHeightVar float64, DefaultWidthVar float64, DefaultHeightVar float64, ConcreteWidthVar float64, ConcreteHeightVar float64) {
133+
134+ gdk.XGdkPaintableComputeConcreteSize(x.GoPointer(), SpecifiedWidthVar, SpecifiedHeightVar, DefaultWidthVar, DefaultHeightVar, ConcreteWidthVar, ConcreteHeightVar)
135+
136+}
137+
138+// Gets an immutable paintable for the current contents displayed by @paintable.
139+//
140+// This is useful when you want to retain the current state of an animation,
141+// for example to take a screenshot of a running animation.
142+//
143+// If the @paintable is already immutable, it will return itself.
144+func (x *IconPaintable) GetCurrentImage() *gdk.PaintableBase {
145+ var cls *gdk.PaintableBase
146+
147+ cret := gdk.XGdkPaintableGetCurrentImage(x.GoPointer())
148+
149+ if cret == 0 {
150+ return nil
151+ }
152+ cls = &gdk.PaintableBase{}
153+ cls.Ptr = cret
154+ return cls
155+}
156+
157+// Get flags for the paintable.
158+//
159+// This is oftentimes useful for optimizations.
160+//
161+// See [flags@Gdk.PaintableFlags] for the flags and what they mean.
162+func (x *IconPaintable) GetFlags() gdk.PaintableFlags {
163+
164+ cret := gdk.XGdkPaintableGetFlags(x.GoPointer())
165+ return cret
166+}
167+
168+// Gets the preferred aspect ratio the @paintable would like to be displayed at.
169+//
170+// The aspect ratio is the width divided by the height, so a value of 0.5
171+// means that the @paintable prefers to be displayed twice as high as it
172+// is wide. Consumers of this interface can use this to preserve aspect
173+// ratio when displaying the paintable.
174+//
175+// This is a purely informational value and does not in any way limit the
176+// values that may be passed to [method@Gdk.Paintable.snapshot].
177+//
178+// Usually when a @paintable returns nonzero values from
179+// [method@Gdk.Paintable.get_intrinsic_width] and
180+// [method@Gdk.Paintable.get_intrinsic_height] the aspect ratio
181+// should conform to those values, though that is not required.
182+//
183+// If the @paintable does not have a preferred aspect ratio,
184+// it returns 0. Negative values are never returned.
185+func (x *IconPaintable) GetIntrinsicAspectRatio() float64 {
186+
187+ cret := gdk.XGdkPaintableGetIntrinsicAspectRatio(x.GoPointer())
188+ return cret
189+}
190+
191+// Gets the preferred height the @paintable would like to be displayed at.
192+//
193+// Consumers of this interface can use this to reserve enough space to draw
194+// the paintable.
195+//
196+// This is a purely informational value and does not in any way limit the
197+// values that may be passed to [method@Gdk.Paintable.snapshot].
198+//
199+// If the @paintable does not have a preferred height, it returns 0.
200+// Negative values are never returned.
201+func (x *IconPaintable) GetIntrinsicHeight() int {
202+
203+ cret := gdk.XGdkPaintableGetIntrinsicHeight(x.GoPointer())
204+ return cret
205+}
206+
207+// Gets the preferred width the @paintable would like to be displayed at.
208+//
209+// Consumers of this interface can use this to reserve enough space to draw
210+// the paintable.
211+//
212+// This is a purely informational value and does not in any way limit the
213+// values that may be passed to [method@Gdk.Paintable.snapshot].
214+//
215+// If the @paintable does not have a preferred width, it returns 0.
216+// Negative values are never returned.
217+func (x *IconPaintable) GetIntrinsicWidth() int {
218+
219+ cret := gdk.XGdkPaintableGetIntrinsicWidth(x.GoPointer())
220+ return cret
221+}
222+
223+// Called by implementations of `GdkPaintable` to invalidate their contents.
224+//
225+// Unless the contents are invalidated, implementations must guarantee that
226+// multiple calls of [method@Gdk.Paintable.snapshot] produce the same output.
227+//
228+// This function will emit the [signal@Gdk.Paintable::invalidate-contents]
229+// signal.
230+//
231+// If a @paintable reports the %GDK_PAINTABLE_STATIC_CONTENTS flag,
232+// it must not call this function.
233+func (x *IconPaintable) InvalidateContents() {
234+
235+ gdk.XGdkPaintableInvalidateContents(x.GoPointer())
236+
237+}
238+
239+// Called by implementations of `GdkPaintable` to invalidate their size.
240+//
241+// As long as the size is not invalidated, @paintable must return the same
242+// values for its intrinsic width, height and aspect ratio.
243+//
244+// This function will emit the [signal@Gdk.Paintable::invalidate-size]
245+// signal.
246+//
247+// If a @paintable reports the %GDK_PAINTABLE_STATIC_SIZE flag,
248+// it must not call this function.
249+func (x *IconPaintable) InvalidateSize() {
250+
251+ gdk.XGdkPaintableInvalidateSize(x.GoPointer())
252+
253+}
254+
255+// Snapshots the given paintable with the given @width and @height.
256+//
257+// The paintable is drawn at the current (0,0) offset of the @snapshot.
258+// If @width and @height are not larger than zero, this function will
259+// do nothing.
260+func (x *IconPaintable) Snapshot(SnapshotVar *gdk.Snapshot, WidthVar float64, HeightVar float64) {
261+
262+ gdk.XGdkPaintableSnapshot(x.GoPointer(), SnapshotVar.GoPointer(), WidthVar, HeightVar)
263+
264+}
265+
266+// Snapshots the paintable with the given colors.
267+//
268+// If less than 4 colors are provided, GTK will pad the array with default
269+// colors.
270+func (x *IconPaintable) SnapshotSymbolic(SnapshotVar *gdk.Snapshot, WidthVar float64, HeightVar float64, ColorsVar []gdk.RGBA, NColorsVar uint) {
271+
272+ XGtkSymbolicPaintableSnapshotSymbolic(x.GoPointer(), SnapshotVar.GoPointer(), WidthVar, HeightVar, ColorsVar, NColorsVar)
273+
274+}
275+
276+func init() {
277+ core.SetPackageName("GTK", "gtk4")
278+ core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"})
279+ var libs []uintptr
280+ for _, libPath := range core.GetPaths("GTK") {
281+ lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
282+ if err != nil {
283+ panic(err)
284+ }
285+ libs = append(libs, lib)
286+ }
287+
288+ core.PuregoSafeRegister(&xIconPaintableGLibType, libs, "gtk_icon_paintable_get_type")
289+
290+ core.PuregoSafeRegister(&xNewIconPaintableForFile, libs, "gtk_icon_paintable_new_for_file")
291+
292+ core.PuregoSafeRegister(&xIconPaintableGetFile, libs, "gtk_icon_paintable_get_file")
293+ core.PuregoSafeRegister(&xIconPaintableGetIconName, libs, "gtk_icon_paintable_get_icon_name")
294+ core.PuregoSafeRegister(&xIconPaintableIsSymbolic, libs, "gtk_icon_paintable_is_symbolic")
295+
296+}
M v4/gtk/gtkicontheme.go +0 -257
@@ -63,255 +63,6 @@ func IconThemeErrorQuark() glib.Quark {
6363 return cret
6464 }
6565
66-// Contains information found when looking up an icon in `GtkIconTheme`.
67-//
68-// `GtkIconPaintable` implements `GdkPaintable`.
69-type IconPaintable struct {
70- gobject.Object
71-}
72-
73-var xIconPaintableGLibType func() types.GType
74-
75-func IconPaintableGLibType() types.GType {
76- return xIconPaintableGLibType()
77-}
78-
79-func IconPaintableNewFromInternalPtr(ptr uintptr) *IconPaintable {
80- cls := &IconPaintable{}
81- cls.Ptr = ptr
82- return cls
83-}
84-
85-var xNewIconPaintableForFile func(uintptr, int, int) uintptr
86-
87-// Creates a `GtkIconPaintable` for a file with a given size and scale.
88-//
89-// The icon can then be rendered by using it as a `GdkPaintable`.
90-func NewIconPaintableForFile(FileVar gio.File, SizeVar int, ScaleVar int) *IconPaintable {
91- var cls *IconPaintable
92-
93- cret := xNewIconPaintableForFile(FileVar.GoPointer(), SizeVar, ScaleVar)
94-
95- if cret == 0 {
96- return nil
97- }
98- cls = &IconPaintable{}
99- cls.Ptr = cret
100- return cls
101-}
102-
103-var xIconPaintableGetFile func(uintptr) uintptr
104-
105-// Gets the `GFile` that was used to load the icon.
106-//
107-// Returns %NULL if the icon was not loaded from a file.
108-func (x *IconPaintable) GetFile() *gio.FileBase {
109- var cls *gio.FileBase
110-
111- cret := xIconPaintableGetFile(x.GoPointer())
112-
113- if cret == 0 {
114- return nil
115- }
116- cls = &gio.FileBase{}
117- cls.Ptr = cret
118- return cls
119-}
120-
121-var xIconPaintableGetIconName func(uintptr) string
122-
123-// Get the icon name being used for this icon.
124-//
125-// When an icon looked up in the icon theme was not available, the
126-// icon theme may use fallback icons - either those specified to
127-// gtk_icon_theme_lookup_icon() or the always-available
128-// "image-missing". The icon chosen is returned by this function.
129-//
130-// If the icon was created without an icon theme, this function
131-// returns %NULL.
132-func (x *IconPaintable) GetIconName() string {
133-
134- cret := xIconPaintableGetIconName(x.GoPointer())
135- return cret
136-}
137-
138-var xIconPaintableIsSymbolic func(uintptr) bool
139-
140-// Checks if the icon is symbolic or not.
141-//
142-// This currently uses only the file name and not the file contents
143-// for determining this. This behaviour may change in the future.
144-func (x *IconPaintable) IsSymbolic() bool {
145-
146- cret := xIconPaintableIsSymbolic(x.GoPointer())
147- return cret
148-}
149-
150-func (c *IconPaintable) GoPointer() uintptr {
151- if c == nil {
152- return 0
153- }
154- return c.Ptr
155-}
156-
157-func (c *IconPaintable) SetGoPointer(ptr uintptr) {
158- c.Ptr = ptr
159-}
160-
161-// Compute a concrete size for the `GdkPaintable`.
162-//
163-// Applies the sizing algorithm outlined in the
164-// [CSS Image spec](https://drafts.csswg.org/css-images-3/#default-sizing)
165-// to the given @paintable. See that link for more details.
166-//
167-// It is not necessary to call this function when both @specified_width
168-// and @specified_height are known, but it is useful to call this
169-// function in GtkWidget:measure implementations to compute the
170-// other dimension when only one dimension is given.
171-func (x *IconPaintable) ComputeConcreteSize(SpecifiedWidthVar float64, SpecifiedHeightVar float64, DefaultWidthVar float64, DefaultHeightVar float64, ConcreteWidthVar float64, ConcreteHeightVar float64) {
172-
173- gdk.XGdkPaintableComputeConcreteSize(x.GoPointer(), SpecifiedWidthVar, SpecifiedHeightVar, DefaultWidthVar, DefaultHeightVar, ConcreteWidthVar, ConcreteHeightVar)
174-
175-}
176-
177-// Gets an immutable paintable for the current contents displayed by @paintable.
178-//
179-// This is useful when you want to retain the current state of an animation,
180-// for example to take a screenshot of a running animation.
181-//
182-// If the @paintable is already immutable, it will return itself.
183-func (x *IconPaintable) GetCurrentImage() *gdk.PaintableBase {
184- var cls *gdk.PaintableBase
185-
186- cret := gdk.XGdkPaintableGetCurrentImage(x.GoPointer())
187-
188- if cret == 0 {
189- return nil
190- }
191- cls = &gdk.PaintableBase{}
192- cls.Ptr = cret
193- return cls
194-}
195-
196-// Get flags for the paintable.
197-//
198-// This is oftentimes useful for optimizations.
199-//
200-// See [flags@Gdk.PaintableFlags] for the flags and what they mean.
201-func (x *IconPaintable) GetFlags() gdk.PaintableFlags {
202-
203- cret := gdk.XGdkPaintableGetFlags(x.GoPointer())
204- return cret
205-}
206-
207-// Gets the preferred aspect ratio the @paintable would like to be displayed at.
208-//
209-// The aspect ratio is the width divided by the height, so a value of 0.5
210-// means that the @paintable prefers to be displayed twice as high as it
211-// is wide. Consumers of this interface can use this to preserve aspect
212-// ratio when displaying the paintable.
213-//
214-// This is a purely informational value and does not in any way limit the
215-// values that may be passed to [method@Gdk.Paintable.snapshot].
216-//
217-// Usually when a @paintable returns nonzero values from
218-// [method@Gdk.Paintable.get_intrinsic_width] and
219-// [method@Gdk.Paintable.get_intrinsic_height] the aspect ratio
220-// should conform to those values, though that is not required.
221-//
222-// If the @paintable does not have a preferred aspect ratio,
223-// it returns 0. Negative values are never returned.
224-func (x *IconPaintable) GetIntrinsicAspectRatio() float64 {
225-
226- cret := gdk.XGdkPaintableGetIntrinsicAspectRatio(x.GoPointer())
227- return cret
228-}
229-
230-// Gets the preferred height the @paintable would like to be displayed at.
231-//
232-// Consumers of this interface can use this to reserve enough space to draw
233-// the paintable.
234-//
235-// This is a purely informational value and does not in any way limit the
236-// values that may be passed to [method@Gdk.Paintable.snapshot].
237-//
238-// If the @paintable does not have a preferred height, it returns 0.
239-// Negative values are never returned.
240-func (x *IconPaintable) GetIntrinsicHeight() int {
241-
242- cret := gdk.XGdkPaintableGetIntrinsicHeight(x.GoPointer())
243- return cret
244-}
245-
246-// Gets the preferred width the @paintable would like to be displayed at.
247-//
248-// Consumers of this interface can use this to reserve enough space to draw
249-// the paintable.
250-//
251-// This is a purely informational value and does not in any way limit the
252-// values that may be passed to [method@Gdk.Paintable.snapshot].
253-//
254-// If the @paintable does not have a preferred width, it returns 0.
255-// Negative values are never returned.
256-func (x *IconPaintable) GetIntrinsicWidth() int {
257-
258- cret := gdk.XGdkPaintableGetIntrinsicWidth(x.GoPointer())
259- return cret
260-}
261-
262-// Called by implementations of `GdkPaintable` to invalidate their contents.
263-//
264-// Unless the contents are invalidated, implementations must guarantee that
265-// multiple calls of [method@Gdk.Paintable.snapshot] produce the same output.
266-//
267-// This function will emit the [signal@Gdk.Paintable::invalidate-contents]
268-// signal.
269-//
270-// If a @paintable reports the %GDK_PAINTABLE_STATIC_CONTENTS flag,
271-// it must not call this function.
272-func (x *IconPaintable) InvalidateContents() {
273-
274- gdk.XGdkPaintableInvalidateContents(x.GoPointer())
275-
276-}
277-
278-// Called by implementations of `GdkPaintable` to invalidate their size.
279-//
280-// As long as the size is not invalidated, @paintable must return the same
281-// values for its intrinsic width, height and aspect ratio.
282-//
283-// This function will emit the [signal@Gdk.Paintable::invalidate-size]
284-// signal.
285-//
286-// If a @paintable reports the %GDK_PAINTABLE_STATIC_SIZE flag,
287-// it must not call this function.
288-func (x *IconPaintable) InvalidateSize() {
289-
290- gdk.XGdkPaintableInvalidateSize(x.GoPointer())
291-
292-}
293-
294-// Snapshots the given paintable with the given @width and @height.
295-//
296-// The paintable is drawn at the current (0,0) offset of the @snapshot.
297-// If @width and @height are not larger than zero, this function will
298-// do nothing.
299-func (x *IconPaintable) Snapshot(SnapshotVar *gdk.Snapshot, WidthVar float64, HeightVar float64) {
300-
301- gdk.XGdkPaintableSnapshot(x.GoPointer(), SnapshotVar.GoPointer(), WidthVar, HeightVar)
302-
303-}
304-
305-// Snapshots the paintable with the given colors.
306-//
307-// If less than 4 colors are provided, GTK will pad the array with default
308-// colors.
309-func (x *IconPaintable) SnapshotSymbolic(SnapshotVar *gdk.Snapshot, WidthVar float64, HeightVar float64, ColorsVar []gdk.RGBA, NColorsVar uint) {
310-
311- XGtkSymbolicPaintableSnapshotSymbolic(x.GoPointer(), SnapshotVar.GoPointer(), WidthVar, HeightVar, ColorsVar, NColorsVar)
312-
313-}
314-
31566 // Loads themed icons.
31667 //
31768 // The main reason for using a name rather than simply providing a filename
@@ -682,14 +433,6 @@ func init() {
682433
683434 core.PuregoSafeRegister(&xIconThemeErrorQuark, libs, "gtk_icon_theme_error_quark")
684435
685- core.PuregoSafeRegister(&xIconPaintableGLibType, libs, "gtk_icon_paintable_get_type")
686-
687- core.PuregoSafeRegister(&xNewIconPaintableForFile, libs, "gtk_icon_paintable_new_for_file")
688-
689- core.PuregoSafeRegister(&xIconPaintableGetFile, libs, "gtk_icon_paintable_get_file")
690- core.PuregoSafeRegister(&xIconPaintableGetIconName, libs, "gtk_icon_paintable_get_icon_name")
691- core.PuregoSafeRegister(&xIconPaintableIsSymbolic, libs, "gtk_icon_paintable_is_symbolic")
692-
693436 core.PuregoSafeRegister(&xIconThemeGLibType, libs, "gtk_icon_theme_get_type")
694437
695438 core.PuregoSafeRegister(&xNewIconTheme, libs, "gtk_icon_theme_new")
M v4/gtk/gtkimage.go +25 -11
@@ -41,7 +41,7 @@ const (
4141
4242 // Displays an image.
4343 //
44-// picture&gt;
44+// &lt;picture&gt;
4545 //
4646 // &lt;source srcset="image-dark.png" media="(prefers-color-scheme: dark)"&gt;
4747 // &lt;img alt="An example GtkImage" src="image.png"&gt;
@@ -59,9 +59,9 @@ const (
5959 // If the file isn’t loaded successfully, the image will contain a
6060 // “broken image” icon similar to that used in many web browsers.
6161 //
62-// If you want to handle errors in loading the file yourself,
63-// for example by displaying an error message, then load the image with
64-// [ctor@Gdk.Texture.new_from_file], then create the `GtkImage` with
62+// If you want to handle errors in loading the file yourself, for example
63+// by displaying an error message, then load the image with an image
64+// loading framework such as libglycin, then create the `GtkImage` with
6565 // [ctor@Gtk.Image.new_from_paintable].
6666 //
6767 // Sometimes an application will want to avoid depending on external data
@@ -124,9 +124,9 @@ var xNewImageFromFile func(string) uintptr
124124 // will display a “broken image” icon. This function never returns %NULL,
125125 // it always returns a valid `GtkImage` widget.
126126 //
127-// If you need to detect failures to load the file, use
128-// [ctor@Gdk.Texture.new_from_file] to load the file yourself,
129-// then create the `GtkImage` from the texture.
127+// If you need to detect failures to load the file, use an
128+// image loading framework such as libglycin to load the file
129+// yourself, then create the `GtkImage` from the texture.
130130 //
131131 // The storage type (see [method@Gtk.Image.get_storage_type])
132132 // of the returned image is not defined, it will be whatever
@@ -197,6 +197,13 @@ var xNewImageFromPaintable func(uintptr) uintptr
197197 //
198198 // The `GtkImage` will track changes to the @paintable and update
199199 // its size and contents in response to it.
200+//
201+// Note that paintables are still subject to the icon size that is
202+// set on the image. If you want to display a paintable at its intrinsic
203+// size, use [class@Gtk.Picture] instead.
204+//
205+// If @paintable is a [iface@Gtk.SymbolicPaintable], then it will be
206+// recolored with the symbolic palette from the theme.
200207 func NewImageFromPaintable(PaintableVar gdk.Paintable) *Image {
201208 var cls *Image
202209
@@ -247,9 +254,9 @@ var xNewImageFromResource func(string) uintptr
247254 // display a “broken image” icon. This function never returns %NULL,
248255 // it always returns a valid `GtkImage` widget.
249256 //
250-// If you need to detect failures to load the file, use
251-// [ctor@GdkPixbuf.Pixbuf.new_from_file] to load the file yourself,
252-// then create the `GtkImage` from the pixbuf.
257+// If you need to detect failures to load the file, use an
258+// image loading framework such as libglycin to load the file
259+// yourself, then create the `GtkImage` from the texture.
253260 //
254261 // The storage type (see [method@Gtk.Image.get_storage_type]) of
255262 // the returned image is not defined, it will be whatever is
@@ -371,6 +378,13 @@ var xImageSetFromFile func(uintptr, string)
371378 // Sets a `GtkImage` to show a file.
372379 //
373380 // See [ctor@Gtk.Image.new_from_file] for details.
381+//
382+// ::: warning
383+//
384+// Note that this function should not be used with untrusted data.
385+// Use a proper image loading framework such as libglycin, which can
386+// load many image formats into a `GdkTexture`, and then use
387+// [method@Gtk.Image.set_from_paintable].
374388 func (x *Image) SetFromFile(FilenameVar string) {
375389
376390 xImageSetFromFile(x.GoPointer(), FilenameVar)
@@ -450,7 +464,7 @@ var xImageSetPixelSize func(uintptr, int)
450464 // Sets the pixel size to use for named icons.
451465 //
452466 // If the pixel size is set to a value != -1, it is used instead
453-// of the icon size set by [method@Gtk.Image.set_from_icon_name].
467+// of the icon size set by [method@Gtk.Image.set_icon_size].
454468 func (x *Image) SetPixelSize(PixelSizeVar int) {
455469
456470 xImageSetPixelSize(x.GoPointer(), PixelSizeVar)
M v4/gtk/gtklistview.go +1 -1
@@ -124,7 +124,7 @@ func (x *ListViewClass) GoPointer() uintptr {
124124 // rubberband selection, a node with name `rubberband` is used.
125125 //
126126 // The main listview node may also carry style classes to select
127-// the style of [list presentation](ListContainers.html#list-styles):
127+// the style of [list presentation](section-list-widget.html#list-styles):
128128 // .rich-list, .navigation-sidebar or .data-table.
129129 //
130130 // # Accessibility
M v4/gtk/gtkmenubutton.go +1 -1
@@ -435,7 +435,7 @@ var xMenuButtonSetPopover func(uintptr, uintptr)
435435 //
436436 // If [property@Gtk.MenuButton:menu-model] is set, the menu model is dissociated
437437 // from the @menu_button, and the property is set to %NULL.
438-func (x *MenuButton) SetPopover(PopoverVar *Widget) {
438+func (x *MenuButton) SetPopover(PopoverVar *Popover) {
439439
440440 xMenuButtonSetPopover(x.GoPointer(), PopoverVar.GoPointer())
441441
M v4/gtk/gtkpadcontroller.go +10 -1
@@ -56,6 +56,8 @@ const (
5656 PadActionRingValue PadActionType = 1
5757 // Action is triggered by a pad strip
5858 PadActionStripValue PadActionType = 2
59+ // Action is triggered by a pad dial
60+ PadActionDialValue PadActionType = 3
5961 )
6062
6163 // Handles input from the pads found in drawing tablets.
@@ -102,9 +104,16 @@ const (
102104 // pad_controller = gtk_pad_controller_new (action_group, NULL);
103105 // ```
104106 //
105-// The actions belonging to rings/strips will be activated with a parameter
107+// The actions belonging to rings/strips/dials will be activated with a parameter
106108 // of type %G_VARIANT_TYPE_DOUBLE bearing the value of the given axis, it
107109 // is required that those are made stateful and accepting this `GVariantType`.
110+// For rings the value is the angle of the ring position in degrees with 0
111+// facing up. For strips the value is the absolute position on the strip, normalized
112+// to the [0.0, 1.0] range.
113+// For dials the value is the relative movement of the dial, normalized so that the
114+// value 120 represents one logical scroll wheel detent in the positive direction.
115+// Devices that support high-resolution scrolling may send events with fractions of
116+// 120 to signify a smaller motion.
108117 type PadController struct {
109118 EventController
110119 }
M v4/gtk/gtkpicture.go +21 -7
@@ -26,7 +26,7 @@ func (x *PictureClass) GoPointer() uintptr {
2626
2727 // Displays a `GdkPaintable`.
2828 //
29-// picture&gt;
29+// &lt;picture&gt;
3030 //
3131 // &lt;source srcset="picture-dark.png" media="(prefers-color-scheme: dark)"&gt;
3232 // &lt;img alt="An example GtkPicture" src="picture.png"&gt;
@@ -45,8 +45,8 @@ func (x *PictureClass) GoPointer() uintptr {
4545 // “broken image” icon similar to that used in many web browsers.
4646 // If you want to handle errors in loading the file yourself,
4747 // for example by displaying an error message, then load the image with
48-// [ctor@Gdk.Texture.new_from_file], then create the `GtkPicture` with
49-// [ctor@Gtk.Picture.new_for_paintable].
48+// and image loading framework such as libglycin, then create the `GtkPicture`
49+// with [ctor@Gtk.Picture.new_for_paintable].
5050 //
5151 // Sometimes an application will want to avoid depending on external data
5252 // files, such as image files. See the documentation of `GResource` for details.
@@ -115,9 +115,9 @@ var xNewPictureForFile func(uintptr) uintptr
115115 // If the file isn’t found or can’t be loaded, the resulting
116116 // `GtkPicture` is empty.
117117 //
118-// If you need to detect failures to load the file, use
119-// [ctor@Gdk.Texture.new_from_file] to load the file yourself,
120-// then create the `GtkPicture` from the texture.
118+// If you need to detect failures to load the file, use an
119+// image loading framework such as libglycin to load the file
120+// yourself, then create the `GtkPicture` from the texture.
121121 func NewPictureForFile(FileVar gio.File) *Picture {
122122 var cls *Picture
123123
@@ -340,6 +340,13 @@ var xPictureSetFile func(uintptr, uintptr)
340340 // Makes @self load and display @file.
341341 //
342342 // See [ctor@Gtk.Picture.new_for_file] for details.
343+//
344+// ::: warning
345+//
346+// Note that this function should not be used with untrusted data.
347+// Use a proper image loading framework such as libglycin, which can
348+// load many image formats into a `GdkTexture`, and then use
349+// [method@Gtk.Image.set_from_paintable].
343350 func (x *Picture) SetFile(FileVar gio.File) {
344351
345352 xPictureSetFile(x.GoPointer(), FileVar.GoPointer())
@@ -351,6 +358,13 @@ var xPictureSetFilename func(uintptr, string)
351358 // Makes @self load and display the given @filename.
352359 //
353360 // This is a utility function that calls [method@Gtk.Picture.set_file].
361+//
362+// ::: warning
363+//
364+// Note that this function should not be used with untrusted data.
365+// Use a proper image loading framework such as libglycin, which can
366+// load many image formats into a `GdkTexture`, and then use
367+// [method@Gtk.Image.set_from_paintable].
354368 func (x *Picture) SetFilename(FilenameVar string) {
355369
356370 xPictureSetFilename(x.GoPointer(), FilenameVar)
@@ -377,7 +391,7 @@ var xPictureSetPaintable func(uintptr, uintptr)
377391
378392 // Makes @self display the given @paintable.
379393 //
380-// If @paintable is %NULL, nothing will be displayed.
394+// If @paintable is `NULL`, nothing will be displayed.
381395 //
382396 // See [ctor@Gtk.Picture.new_for_paintable] for details.
383397 func (x *Picture) SetPaintable(PaintableVar gdk.Paintable) {
M v4/gtk/gtkpopover.go +1 -1
@@ -270,7 +270,7 @@ func (x *Popover) GetMnemonicsVisible() bool {
270270
271271 var xPopoverGetOffset func(uintptr, int, int)
272272
273-// Gets the offset previous set with [method@Gtk.Popover.set_offset()].
273+// Gets the offset previous set with [method@Gtk.Popover.set_offset].
274274 func (x *Popover) GetOffset(XOffsetVar int, YOffsetVar int) {
275275
276276 xPopoverGetOffset(x.GoPointer(), XOffsetVar, YOffsetVar)
M v4/gtk/gtkpopovermenu.go +5 -3
@@ -99,8 +99,10 @@ import (
9999 //
100100 // The following attributes are used when constructing submenus:
101101 //
102-// - "label": a user-visible string to display
103-// - "icon": icon name to display
102+// - "label": a user-visible string to display
103+// - "icon": icon name to display
104+// - "gtk-macos-special": (macOS only, ignored by others) Add special meaning to a menu
105+// in the macOS menu bar. See [Using GTK on Apple macOS](osx.html).
104106 //
105107 // Menu items will also show accelerators, which are usually associated
106108 // with actions via [method@Gtk.Application.set_accels_for_action],
@@ -241,7 +243,7 @@ func (x *PopoverMenu) GetMenuModel() *gio.MenuModel {
241243 var xPopoverMenuRemoveChild func(uintptr, uintptr) bool
242244
243245 // Removes a widget that has previously been added with
244-// [method@Gtk.PopoverMenu.add_child()]
246+// [method@Gtk.PopoverMenu.add_child]
245247 func (x *PopoverMenu) RemoveChild(ChildVar *Widget) bool {
246248
247249 cret := xPopoverMenuRemoveChild(x.GoPointer(), ChildVar.GoPointer())
M v4/gtk/gtkprintdialog.go +9 -0
@@ -246,6 +246,9 @@ var xPrintDialogPrintFileFinish func(uintptr, uintptr, **glib.Error) bool
246246
247247 // Finishes the [method@Gtk.PrintDialog.print_file] call and
248248 // returns the results.
249+//
250+// Note that this function returns a [error@Gtk.DialogError.DISMISSED]
251+// error if the user cancels the dialog.
249252 func (x *PrintDialog) PrintFileFinish(ResultVar gio.AsyncResult) (bool, error) {
250253 var cerr *glib.Error
251254
@@ -271,6 +274,9 @@ var xPrintDialogPrintFinish func(uintptr, uintptr, **glib.Error) uintptr
271274 // closed automatically if you just unref it). Be aware that the close
272275 // call may not be instant as it operation will for the printer to finish
273276 // printing.
277+//
278+// Note that this function returns a [error@Gtk.DialogError.DISMISSED]
279+// error if the user cancels the dialog.
274280 func (x *PrintDialog) PrintFinish(ResultVar gio.AsyncResult) (*gio.OutputStream, error) {
275281 var cls *gio.OutputStream
276282 var cerr *glib.Error
@@ -364,6 +370,9 @@ var xPrintDialogSetupFinish func(uintptr, uintptr, **glib.Error) *PrintSetup
364370 // If the call was successful, it returns a [struct@Gtk.PrintSetup]
365371 // which contains the print settings and page setup information that
366372 // will be used to print.
373+//
374+// Note that this function returns a [error@Gtk.DialogError.DISMISSED]
375+// error if the user cancels the dialog.
367376 func (x *PrintDialog) SetupFinish(ResultVar gio.AsyncResult) (*PrintSetup, error) {
368377 var cerr *glib.Error
369378
M v4/gtk/gtkprogressbar.go +3 -1
@@ -60,7 +60,9 @@ import (
6060 //
6161 // # Accessibility
6262 //
63-// `GtkProgressBar` uses the [enum@Gtk.AccessibleRole.progress_bar] role.
63+// `GtkProgressBar` uses the [enum@Gtk.AccessibleRole.progress_bar] role
64+// and sets the [enum@Gtk.AccessibleProperty.value_min], [enum@Gtk.AccessibleProperty.value_max] and [enum@Gtk.AccessibleProperty.value_now] properties to reflect
65+// the progress.
6466 type ProgressBar struct {
6567 Widget
6668 }
M v4/gtk/gtksignallistitemfactory.go +1 -1
@@ -53,7 +53,7 @@ func (x *SignalListItemFactoryClass) GoPointer() uintptr {
5353 //
5454 // Note that during the signal emissions, changing properties on the listitems
5555 // passed will not trigger notify signals as the listitem's notifications are
56-// frozen. See [method@GObject.Object.freeze_notify()] for details.
56+// frozen. See [method@GObject.Object.freeze_notify] for details.
5757 //
5858 // For tracking changes in other properties in the listitem, the
5959 // ::notify signal is recommended. The signal can be connected in the
M v4/gtk/gtksnapshot.go +16 -0
@@ -379,6 +379,20 @@ func (x *Snapshot) PushColorMatrix(ColorMatrixVar *graphene.Matrix, ColorOffsetV
379379
380380 }
381381
382+var xSnapshotPushComponentTransfer func(uintptr, *gsk.ComponentTransfer, *gsk.ComponentTransfer, *gsk.ComponentTransfer, *gsk.ComponentTransfer)
383+
384+// Modifies the colors of an image by applying a transfer
385+// function for each component.
386+//
387+// The transfer functions operate on unpremultiplied colors.
388+//
389+// The image is recorded until the next call to [method@Gtk.Snapshot.pop].
390+func (x *Snapshot) PushComponentTransfer(RedVar *gsk.ComponentTransfer, GreenVar *gsk.ComponentTransfer, BlueVar *gsk.ComponentTransfer, AlphaVar *gsk.ComponentTransfer) {
391+
392+ xSnapshotPushComponentTransfer(x.GoPointer(), RedVar, GreenVar, BlueVar, AlphaVar)
393+
394+}
395+
382396 var xSnapshotPushCrossFade func(uintptr, float64)
383397
384398 // Snapshots a cross-fade operation between two images with the
@@ -417,6 +431,7 @@ var xSnapshotPushFill func(uintptr, *gsk.Path, gsk.FillRule)
417431 // The image is recorded until the next call to [method@Gtk.Snapshot.pop].
418432 //
419433 // If you want to fill the path with a color, [method@Gtk.Snapshot.append_fill]
434+// than rendering new ones, use [method@Gtk.Snapshot.append_fill]
420435 // may be more convenient.
421436 func (x *Snapshot) PushFill(PathVar *gsk.Path, FillRuleVar gsk.FillRule) {
422437
@@ -807,6 +822,7 @@ func init() {
807822 core.PuregoSafeRegister(&xSnapshotPushBlur, libs, "gtk_snapshot_push_blur")
808823 core.PuregoSafeRegister(&xSnapshotPushClip, libs, "gtk_snapshot_push_clip")
809824 core.PuregoSafeRegister(&xSnapshotPushColorMatrix, libs, "gtk_snapshot_push_color_matrix")
825+ core.PuregoSafeRegister(&xSnapshotPushComponentTransfer, libs, "gtk_snapshot_push_component_transfer")
810826 core.PuregoSafeRegister(&xSnapshotPushCrossFade, libs, "gtk_snapshot_push_cross_fade")
811827 core.PuregoSafeRegister(&xSnapshotPushDebug, libs, "gtk_snapshot_push_debug")
812828 core.PuregoSafeRegister(&xSnapshotPushFill, libs, "gtk_snapshot_push_fill")
M v4/gtk/gtkspinner.go +4 -0
@@ -28,6 +28,10 @@ import (
2828 // `GtkSpinner` has a single CSS node with the name spinner.
2929 // When the animation is active, the :checked pseudoclass is
3030 // added to this node.
31+//
32+// # Accessibility
33+//
34+// `GtkSpinner` uses the [enum@Gtk.AccessibleRole.progress_bar] role.
3135 type Spinner struct {
3236 Widget
3337 }
M v4/gtk/gtkstatusbar.go +1 -1
@@ -14,7 +14,7 @@ import (
1414 // A `GtkStatusbar` widget is usually placed along the bottom of an application's
1515 // main [class@Gtk.Window].
1616 //
17-// picture&gt;
17+// &lt;picture&gt;
1818 //
1919 // &lt;source srcset="statusbar-dark.png" media="(prefers-color-scheme: dark)"&gt;
2020 // &lt;img alt="An example GtkStatusbar" src="statusbar.png"&gt;
M v4/gtk/gtktext.go +2 -0
@@ -51,6 +51,7 @@ import (
5151 // - &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;Y&lt;/kbd&gt; or &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;Shift&lt;/kbd&gt;+&lt;kbd&gt;Z&lt;/kbd&gt;
5252 // redoes the last undone modification.
5353 // - &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;Shift&lt;/kbd&gt;+&lt;kbd&gt;T&lt;/kbd&gt; toggles the text direction.
54+// - &lt;kbd&gt;Clear&lt;/kbd&gt; clears the content.
5455 //
5556 // Additionally, the following signals have default keybindings:
5657 //
@@ -80,6 +81,7 @@ import (
8081 // - `selection.select-all` selects all of the widgets content.
8182 // - `text.redo` redoes the last change to the contents.
8283 // - `text.undo` undoes the last change to the contents.
84+// - `text.clear` removes all content.
8385 //
8486 // # CSS nodes
8587 //
M v4/gtk/gtktextview.go +3 -1
@@ -538,6 +538,7 @@ const (
538538 // - &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;Z&lt;/kbd&gt; undoes the last modification.
539539 // - &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;Y&lt;/kbd&gt; or &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;Shift&lt;/kbd&gt;+&lt;kbd&gt;Z&lt;/kbd&gt;
540540 // redoes the last undone modification.
541+// - &lt;kbd&gt;Clear&lt;/kbd&gt; clears the content.
541542 //
542543 // Additionally, the following signals have default keybindings:
543544 //
@@ -566,6 +567,7 @@ const (
566567 // - `selection.select-all` selects all of the widgets content.
567568 // - `text.redo` redoes the last change to the contents.
568569 // - `text.undo` undoes the last change to the contents.
570+// - `text.clear` clears the content.
569571 //
570572 // ## CSS nodes
571573 //
@@ -1141,7 +1143,7 @@ var xTextViewGetVisibleOffset func(uintptr, float64, float64)
11411143 // the textview's text contents.
11421144 //
11431145 // This allows for more-precise positioning than what is provided by
1144-// [method@Gtk.TextView.get_visible_rect()] as you can discover what
1146+// [method@Gtk.TextView.get_visible_rect] as you can discover what
11451147 // device pixel is being quantized for text positioning.
11461148 //
11471149 // You might want this when making ulterior widgets align with quantized
M v4/gtk/gtkurilauncher.go +14 -0
@@ -66,6 +66,19 @@ func NewUriLauncher(UriVar string) *UriLauncher {
6666 return cls
6767 }
6868
69+var xUriLauncherCanLaunch func(uintptr, uintptr) bool
70+
71+// Returns whether the launcher is likely to succeed
72+// in launching an application for its uri.
73+//
74+// This can be used to disable controls that trigger
75+// the launcher when they are known not to work.
76+func (x *UriLauncher) CanLaunch(ParentVar *Window) bool {
77+
78+ cret := xUriLauncherCanLaunch(x.GoPointer(), ParentVar.GoPointer())
79+ return cret
80+}
81+
6982 var xUriLauncherGetUri func(uintptr) string
7083
7184 // Gets the uri that will be opened.
@@ -137,6 +150,7 @@ func init() {
137150
138151 core.PuregoSafeRegister(&xNewUriLauncher, libs, "gtk_uri_launcher_new")
139152
153+ core.PuregoSafeRegister(&xUriLauncherCanLaunch, libs, "gtk_uri_launcher_can_launch")
140154 core.PuregoSafeRegister(&xUriLauncherGetUri, libs, "gtk_uri_launcher_get_uri")
141155 core.PuregoSafeRegister(&xUriLauncherLaunch, libs, "gtk_uri_launcher_launch")
142156 core.PuregoSafeRegister(&xUriLauncherLaunchFinish, libs, "gtk_uri_launcher_launch_finish")
M v4/gtk/gtkversion.go +4 -4
@@ -10,11 +10,11 @@ const (
1010 // Like [func@get_binary_age], but from the headers used at
1111 // application compile time, rather than from the library linked
1212 // against at application run time.
13- BINARY_AGE int = 1806
13+ BINARY_AGE int = 2002
1414 // Like [func@get_interface_age], but from the headers used at
1515 // application compile time, rather than from the library linked
1616 // against at application run time.
17- INTERFACE_AGE int = 6
17+ INTERFACE_AGE int = 2
1818 // Like [func@get_major_version], but from the headers used at
1919 // application compile time, rather than from the library linked
2020 // against at application run time.
@@ -22,11 +22,11 @@ const (
2222 // Like [func@get_micro_version], but from the headers used at
2323 // application compile time, rather than from the library linked
2424 // against at application run time.
25- MICRO_VERSION int = 6
25+ MICRO_VERSION int = 2
2626 // Like [func@get_minor_version], but from the headers used at
2727 // application compile time, rather than from the library linked
2828 // against at application run time.
29- MINOR_VERSION int = 18
29+ MINOR_VERSION int = 20
3030 )
3131
3232 var xCheckVersion func(uint, uint, uint) string
M v4/gtk/gtkwindow.go +74 -1
@@ -176,6 +176,56 @@ func (x *WindowGroupPrivate) GoPointer() uintptr {
176176 return uintptr(unsafe.Pointer(x))
177177 }
178178
179+// Determines which point or edge of a window is meant to remain fixed
180+// when a window changes size.
181+type WindowGravity int
182+
183+var xWindowGravityGLibType func() types.GType
184+
185+func WindowGravityGLibType() types.GType {
186+ return xWindowGravityGLibType()
187+}
188+
189+const (
190+
191+ // The top left corner
192+ WindowGravityTopLeftValue WindowGravity = 0
193+ // The top edge
194+ WindowGravityTopValue WindowGravity = 1
195+ // The top right corner
196+ WindowGravityTopRightValue WindowGravity = 2
197+ // The left edge
198+ WindowGravityLeftValue WindowGravity = 3
199+ // The center pointer
200+ WindowGravityCenterValue WindowGravity = 4
201+ // The right edge
202+ WindowGravityRightValue WindowGravity = 5
203+ // The bottom left corner
204+ WindowGravityBottomLeftValue WindowGravity = 6
205+ // the bottom edge
206+ WindowGravityBottomValue WindowGravity = 7
207+ // The bottom right corner
208+ WindowGravityBottomRightValue WindowGravity = 8
209+ // The top left or top right corner,
210+ // depending on the text direction
211+ WindowGravityTopStartValue WindowGravity = 9
212+ // The top right or top left corner,
213+ // depending on the text direction
214+ WindowGravityTopEndValue WindowGravity = 10
215+ // The left or right edge,
216+ // depending on the text direction
217+ WindowGravityStartValue WindowGravity = 11
218+ // The right or left edge,
219+ // depending on the text direction
220+ WindowGravityEndValue WindowGravity = 12
221+ // The bottom left or top right corner,
222+ // depending on the text direction
223+ WindowGravityBottomStartValue WindowGravity = 13
224+ // The bottom right or top left corner,
225+ // depending on the text direction
226+ WindowGravityBottomEndValue WindowGravity = 14
227+)
228+
179229 // A toplevel window which can contain other widgets.
180230 //
181231 // &lt;picture&gt;
@@ -483,6 +533,15 @@ func (x *Window) GetFocusVisible() bool {
483533 return cret
484534 }
485535
536+var xWindowGetGravity func(uintptr) WindowGravity
537+
538+// Returns the gravity that is used when changing the window size programmatically.
539+func (x *Window) GetGravity() WindowGravity {
540+
541+ cret := xWindowGetGravity(x.GoPointer())
542+ return cret
543+}
544+
486545 var xWindowGetGroup func(uintptr) uintptr
487546
488547 // Returns the group for the window.
@@ -929,6 +988,15 @@ func (x *Window) SetFocusVisible(SettingVar bool) {
929988
930989 }
931990
991+var xWindowSetGravity func(uintptr, WindowGravity)
992+
993+// Sets the gravity that is used when changing the window size programmatically.
994+func (x *Window) SetGravity(GravityVar WindowGravity) {
995+
996+ xWindowSetGravity(x.GoPointer(), GravityVar)
997+
998+}
999+
9321000 var xWindowSetHandleMenubarAccel func(uintptr, bool)
9331001
9341002 // Sets whether this window should react to &lt;kbd&gt;F10&lt;/kbd&gt;
@@ -1017,7 +1085,8 @@ var xWindowSetStartupId func(uintptr, string)
10171085 // [method@Gtk.Window.present] or any equivalent function generating
10181086 // a window map event.
10191087 //
1020-// This function is only useful on X11, not with other GTK targets.
1088+// This function is only useful on Wayland or X11, not with other GDK
1089+// backends.
10211090 func (x *Window) SetStartupId(StartupIdVar string) {
10221091
10231092 xWindowSetStartupId(x.GoPointer(), StartupIdVar)
@@ -1743,6 +1812,8 @@ func init() {
17431812 libs = append(libs, lib)
17441813 }
17451814
1815+ core.PuregoSafeRegister(&xWindowGravityGLibType, libs, "gtk_window_gravity_get_type")
1816+
17461817 core.PuregoSafeRegister(&xWindowGLibType, libs, "gtk_window_get_type")
17471818
17481819 core.PuregoSafeRegister(&xNewWindow, libs, "gtk_window_new")
@@ -1760,6 +1831,7 @@ func init() {
17601831 core.PuregoSafeRegister(&xWindowGetDestroyWithParent, libs, "gtk_window_get_destroy_with_parent")
17611832 core.PuregoSafeRegister(&xWindowGetFocus, libs, "gtk_window_get_focus")
17621833 core.PuregoSafeRegister(&xWindowGetFocusVisible, libs, "gtk_window_get_focus_visible")
1834+ core.PuregoSafeRegister(&xWindowGetGravity, libs, "gtk_window_get_gravity")
17631835 core.PuregoSafeRegister(&xWindowGetGroup, libs, "gtk_window_get_group")
17641836 core.PuregoSafeRegister(&xWindowGetHandleMenubarAccel, libs, "gtk_window_get_handle_menubar_accel")
17651837 core.PuregoSafeRegister(&xWindowGetHideOnClose, libs, "gtk_window_get_hide_on_close")
@@ -1789,6 +1861,7 @@ func init() {
17891861 core.PuregoSafeRegister(&xWindowSetDisplay, libs, "gtk_window_set_display")
17901862 core.PuregoSafeRegister(&xWindowSetFocus, libs, "gtk_window_set_focus")
17911863 core.PuregoSafeRegister(&xWindowSetFocusVisible, libs, "gtk_window_set_focus_visible")
1864+ core.PuregoSafeRegister(&xWindowSetGravity, libs, "gtk_window_set_gravity")
17921865 core.PuregoSafeRegister(&xWindowSetHandleMenubarAccel, libs, "gtk_window_set_handle_menubar_accel")
17931866 core.PuregoSafeRegister(&xWindowSetHideOnClose, libs, "gtk_window_set_hide_on_close")
17941867 core.PuregoSafeRegister(&xWindowSetIconName, libs, "gtk_window_set_icon_name")
M v4/pango/pango-features.go +3 -3
@@ -5,9 +5,9 @@ const (
55 // The major component of the version of Pango available at compile-time.
66 VERSION_MAJOR int = 1
77 // The micro component of the version of Pango available at compile-time.
8- VERSION_MICRO int = 3
8+ VERSION_MICRO int = 0
99 // The minor component of the version of Pango available at compile-time.
10- VERSION_MINOR int = 56
10+ VERSION_MINOR int = 57
1111 // A string literal containing the version of Pango available at compile-time.
12- VERSION_STRING string = "1.56.3"
12+ VERSION_STRING string = "1.57.0"
1313 )
M v4/pango/pango-font.go +55 -0
@@ -338,6 +338,18 @@ func (x *FontDescription) Free() {
338338
339339 }
340340
341+var xFontDescriptionGetColor func(uintptr) FontColor
342+
343+// Returns the color field of the font description.
344+//
345+// This field determines whether the font description should
346+// match fonts that have color glyphs, or fonts that don't.
347+func (x *FontDescription) GetColor() FontColor {
348+
349+ cret := xFontDescriptionGetColor(x.GoPointer())
350+ return cret
351+}
352+
341353 var xFontDescriptionGetFamily func(uintptr) string
342354
343355 // Gets the family name field of a font description.
@@ -514,6 +526,18 @@ func (x *FontDescription) SetAbsoluteSize(SizeVar float64) {
514526
515527 }
516528
529+var xFontDescriptionSetColor func(uintptr, FontColor)
530+
531+// Sets the color field of a font description.
532+//
533+// This field determines whether the font description should
534+// match fonts that have color glyphs, or fonts that don't.
535+func (x *FontDescription) SetColor(ColorVar FontColor) {
536+
537+ xFontDescriptionSetColor(x.GoPointer(), ColorVar)
538+
539+}
540+
517541 var xFontDescriptionSetFamily func(uintptr, string)
518542
519543 // Sets the family name field of a font description.
@@ -1355,6 +1379,27 @@ const (
13551379 FontMaskVariationsValue FontMask = 128
13561380 // OpenType font features are specified.
13571381 FontMaskFeaturesValue FontMask = 256
1382+ // Font color is specified.
1383+ FontMaskColorValue FontMask = 512
1384+)
1385+
1386+// Specifies whether a font should or should not have color glyphs.
1387+type FontColor int
1388+
1389+var xFontColorGLibType func() types.GType
1390+
1391+func FontColorGLibType() types.GType {
1392+ return xFontColorGLibType()
1393+}
1394+
1395+const (
1396+
1397+ // The font should not have color glyphs
1398+ FontColorForbiddenValue FontColor = 0
1399+ // The font should have color glyphs
1400+ FontColorRequiredValue FontColor = 1
1401+ // The font may or may not use color
1402+ FontColorDontCareValue FontColor = 2
13581403 )
13591404
13601405 // An enumeration specifying the width of the font relative to other designs
@@ -1518,6 +1563,9 @@ var xFontDescriptionFromString func(string) *FontDescription
15181563 // "Not-Rotated", "South", "Upside-Down", "North", "Rotated-Left",
15191564 // "East", "Rotated-Right", "West".
15201565 //
1566+// The following words are understood as color values:
1567+// "With-Color", "Without-Color".
1568+//
15211569 // VARIATIONS is a comma-separated list of font variations
15221570 // of the form @<U+200D>axis1=value,axis2=value,...
15231571 //
@@ -1601,6 +1649,9 @@ func (x *Font) GetCoverage(LanguageVar *Language) *Coverage {
16011649 var xFontGetFace func(uintptr) uintptr
16021650
16031651 // Gets the `PangoFontFace` to which @font belongs.
1652+//
1653+// Note that this function can return `NULL` in cases
1654+// where the font outlives its font map.
16041655 func (x *Font) GetFace() *FontFace {
16051656 var cls *FontFace
16061657
@@ -2113,6 +2164,8 @@ func init() {
21132164
21142165 core.PuregoSafeRegister(&xFontMaskGLibType, libs, "pango_font_mask_get_type")
21152166
2167+ core.PuregoSafeRegister(&xFontColorGLibType, libs, "pango_font_color_get_type")
2168+
21162169 core.PuregoSafeRegister(&xStretchGLibType, libs, "pango_stretch_get_type")
21172170
21182171 core.PuregoSafeRegister(&xStyleGLibType, libs, "pango_style_get_type")
@@ -2132,6 +2185,7 @@ func init() {
21322185 core.PuregoSafeRegister(&xFontDescriptionCopyStatic, libs, "pango_font_description_copy_static")
21332186 core.PuregoSafeRegister(&xFontDescriptionEqual, libs, "pango_font_description_equal")
21342187 core.PuregoSafeRegister(&xFontDescriptionFree, libs, "pango_font_description_free")
2188+ core.PuregoSafeRegister(&xFontDescriptionGetColor, libs, "pango_font_description_get_color")
21352189 core.PuregoSafeRegister(&xFontDescriptionGetFamily, libs, "pango_font_description_get_family")
21362190 core.PuregoSafeRegister(&xFontDescriptionGetFeatures, libs, "pango_font_description_get_features")
21372191 core.PuregoSafeRegister(&xFontDescriptionGetGravity, libs, "pango_font_description_get_gravity")
@@ -2147,6 +2201,7 @@ func init() {
21472201 core.PuregoSafeRegister(&xFontDescriptionMerge, libs, "pango_font_description_merge")
21482202 core.PuregoSafeRegister(&xFontDescriptionMergeStatic, libs, "pango_font_description_merge_static")
21492203 core.PuregoSafeRegister(&xFontDescriptionSetAbsoluteSize, libs, "pango_font_description_set_absolute_size")
2204+ core.PuregoSafeRegister(&xFontDescriptionSetColor, libs, "pango_font_description_set_color")
21502205 core.PuregoSafeRegister(&xFontDescriptionSetFamily, libs, "pango_font_description_set_family")
21512206 core.PuregoSafeRegister(&xFontDescriptionSetFamilyStatic, libs, "pango_font_description_set_family_static")
21522207 core.PuregoSafeRegister(&xFontDescriptionSetFeatures, libs, "pango_font_description_set_features")
M v4/pango/pango-fontmap.go +2 -2
@@ -300,13 +300,13 @@ func (x *FontMap) AddFontFile(FilenameVar string) (bool, error) {
300300
301301 var xFontMapChanged func(uintptr)
302302
303-// Forces a change in the context, which will cause any `PangoContext`
303+// Forces a change in the fontmap, which will cause any `PangoContext`
304304 // using this fontmap to change.
305305 //
306306 // This function is only useful when implementing a new backend
307307 // for Pango, something applications won't do. Backends should
308308 // call this function if they have attached extra data to the
309-// context and such data is changed.
309+// fontmap and such data is changed.
310310 func (x *FontMap) Changed() {
311311
312312 xFontMapChanged(x.GoPointer())

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 102

↑↓ moveenter openesc close