1// Package gtk was automatically generated by github.com/bnema/puregotk DO NOT EDIT
2package gtk
3
4import (
5 "structs"
6 "unsafe"
7
8 "github.com/ebitengine/purego"
9
10 "github.com/bnema/puregotk/pkg/core"
11 "github.com/bnema/puregotk/v4/gobject"
12 "github.com/bnema/puregotk/v4/gobject/types"
13)
14
15type ShortcutsGroupClass struct {
16 _ structs.HostLayout
17}
18
19func (x *ShortcutsGroupClass) GoPointer() uintptr {
20 return uintptr(unsafe.Pointer(x))
21}
22
23// A `GtkShortcutsGroup` represents a group of related keyboard shortcuts
24// or gestures.
25//
26// The group has a title. It may optionally be associated with a view
27// of the application, which can be used to show only relevant shortcuts
28// depending on the application context.
29//
30// This widget is only meant to be used with [class@Gtk.ShortcutsWindow].
31//
32// The recommended way to construct a `GtkShortcutsGroup` is with
33// [class@Gtk.Builder], by using the `<child>` tag to populate a
34// `GtkShortcutsGroup` with one or more [class@Gtk.ShortcutsShortcut]
35// instances.
36//
37// If you need to add a shortcut programmatically, use
38// [method@Gtk.ShortcutsGroup.add_shortcut].
39type ShortcutsGroup struct {
40 Box
41}
42
43var xShortcutsGroupGLibType func() types.GType
44
45func ShortcutsGroupGLibType() types.GType {
46 return xShortcutsGroupGLibType()
47}
48
49func ShortcutsGroupNewFromInternalPtr(ptr uintptr) *ShortcutsGroup {
50 cls := &ShortcutsGroup{}
51 cls.Ptr = ptr
52 return cls
53}
54
55var xShortcutsGroupAddShortcut func(uintptr, uintptr)
56
57// Adds a shortcut to the shortcuts group.
58//
59// This is the programmatic equivalent to using [class@Gtk.Builder] and a
60// `<child>` tag to add the child. Adding children with other API is not
61// appropriate as `GtkShortcutsGroup` manages its children internally.
62func (x *ShortcutsGroup) AddShortcut(ShortcutVar *ShortcutsShortcut) {
63
64 xShortcutsGroupAddShortcut(x.GoPointer(), ShortcutVar.GoPointer())
65
66}
67
68func (c *ShortcutsGroup) GoPointer() uintptr {
69 if c == nil {
70 return 0
71 }
72 return c.Ptr
73}
74
75func (c *ShortcutsGroup) SetGoPointer(ptr uintptr) {
76 c.Ptr = ptr
77}
78
79// GetPropertyHeight gets the "height" property.
80// A rough measure for the number of lines in this group.
81//
82// This is used internally by GTK, and is not useful for applications.
83func (x *ShortcutsGroup) GetPropertyHeight() uint {
84 var v gobject.Value
85 x.GetProperty("height", &v)
86 return v.GetUint()
87}
88
89// SetPropertyTitle sets the "title" property.
90// The title for this group of shortcuts.
91func (x *ShortcutsGroup) SetPropertyTitle(value string) {
92 var v gobject.Value
93 v.Init(gobject.TypeStringVal)
94 v.SetString(&value)
95 x.SetProperty("title", &v)
96}
97
98// GetPropertyTitle gets the "title" property.
99// The title for this group of shortcuts.
100func (x *ShortcutsGroup) GetPropertyTitle() string {
101 var v gobject.Value
102 x.GetProperty("title", &v)
103 return v.GetString()
104}
105
106// SetPropertyView sets the "view" property.
107// An optional view that the shortcuts in this group are relevant for.
108//
109// The group will be hidden if the [property@Gtk.ShortcutsWindow:view-name]
110// property does not match the view of this group.
111//
112// Set this to %NULL to make the group always visible.
113func (x *ShortcutsGroup) SetPropertyView(value string) {
114 var v gobject.Value
115 v.Init(gobject.TypeStringVal)
116 v.SetString(&value)
117 x.SetProperty("view", &v)
118}
119
120// GetPropertyView gets the "view" property.
121// An optional view that the shortcuts in this group are relevant for.
122//
123// The group will be hidden if the [property@Gtk.ShortcutsWindow:view-name]
124// property does not match the view of this group.
125//
126// Set this to %NULL to make the group always visible.
127func (x *ShortcutsGroup) GetPropertyView() string {
128 var v gobject.Value
129 x.GetProperty("view", &v)
130 return v.GetString()
131}
132
133// Requests the user's screen reader to announce the given message.
134//
135// This kind of notification is useful for messages that
136// either have only a visual representation or that are not
137// exposed visually at all, e.g. a notification about a
138// successful operation.
139//
140// Also, by using this API, you can ensure that the message
141// does not interrupts the user's current screen reader output.
142func (x *ShortcutsGroup) Announce(MessageVar string, PriorityVar AccessibleAnnouncementPriority) {
143
144 XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar)
145
146}
147
148// Retrieves the accessible parent for an accessible object.
149//
150// This function returns `NULL` for top level widgets.
151func (x *ShortcutsGroup) GetAccessibleParent() *AccessibleBase {
152 var cls *AccessibleBase
153
154 cret := XGtkAccessibleGetAccessibleParent(x.GoPointer())
155
156 if cret == 0 {
157 return nil
158 }
159 cls = &AccessibleBase{}
160 cls.Ptr = cret
161 return cls
162}
163
164// Retrieves the accessible role of an accessible object.
165func (x *ShortcutsGroup) GetAccessibleRole() AccessibleRole {
166
167 cret := XGtkAccessibleGetAccessibleRole(x.GoPointer())
168 return cret
169}
170
171// Retrieves the implementation for the given accessible object.
172func (x *ShortcutsGroup) GetAtContext() *ATContext {
173 var cls *ATContext
174
175 cret := XGtkAccessibleGetAtContext(x.GoPointer())
176
177 if cret == 0 {
178 return nil
179 }
180 cls = &ATContext{}
181 cls.Ptr = cret
182 return cls
183}
184
185// Queries the coordinates and dimensions of this accessible
186//
187// This functionality can be overridden by `GtkAccessible`
188// implementations, e.g. to get the bounds from an ignored
189// child widget.
190func (x *ShortcutsGroup) GetBounds(XVar *int, YVar *int, WidthVar *int, HeightVar *int) bool {
191
192 cret := XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar)
193 return cret
194}
195
196// Retrieves the first accessible child of an accessible object.
197func (x *ShortcutsGroup) GetFirstAccessibleChild() *AccessibleBase {
198 var cls *AccessibleBase
199
200 cret := XGtkAccessibleGetFirstAccessibleChild(x.GoPointer())
201
202 if cret == 0 {
203 return nil
204 }
205 cls = &AccessibleBase{}
206 cls.Ptr = cret
207 return cls
208}
209
210// Retrieves the next accessible sibling of an accessible object
211func (x *ShortcutsGroup) GetNextAccessibleSibling() *AccessibleBase {
212 var cls *AccessibleBase
213
214 cret := XGtkAccessibleGetNextAccessibleSibling(x.GoPointer())
215
216 if cret == 0 {
217 return nil
218 }
219 cls = &AccessibleBase{}
220 cls.Ptr = cret
221 return cls
222}
223
224// Queries a platform state, such as focus.
225//
226// This functionality can be overridden by `GtkAccessible`
227// implementations, e.g. to get platform state from an ignored
228// child widget, as is the case for `GtkText` wrappers.
229func (x *ShortcutsGroup) GetPlatformState(StateVar AccessiblePlatformState) bool {
230
231 cret := XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar)
232 return cret
233}
234
235// Resets the accessible property to its default value.
236func (x *ShortcutsGroup) ResetProperty(PropertyVar AccessibleProperty) {
237
238 XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar)
239
240}
241
242// Resets the accessible relation to its default value.
243func (x *ShortcutsGroup) ResetRelation(RelationVar AccessibleRelation) {
244
245 XGtkAccessibleResetRelation(x.GoPointer(), RelationVar)
246
247}
248
249// Resets the accessible state to its default value.
250func (x *ShortcutsGroup) ResetState(StateVar AccessibleState) {
251
252 XGtkAccessibleResetState(x.GoPointer(), StateVar)
253
254}
255
256// Sets the parent and sibling of an accessible object.
257//
258// This function is meant to be used by accessible implementations that are
259// not part of the widget hierarchy, and but act as a logical bridge between
260// widgets. For instance, if a widget creates an object that holds metadata
261// for each child, and you want that object to implement the `GtkAccessible`
262// interface, you will use this function to ensure that the parent of each
263// child widget is the metadata object, and the parent of each metadata
264// object is the container widget.
265func (x *ShortcutsGroup) SetAccessibleParent(ParentVar Accessible, NextSiblingVar Accessible) {
266
267 XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer())
268
269}
270
271// Updates the next accessible sibling.
272//
273// That might be useful when a new child of a custom accessible
274// is created, and it needs to be linked to a previous child.
275func (x *ShortcutsGroup) UpdateNextAccessibleSibling(NewSiblingVar Accessible) {
276
277 XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer())
278
279}
280
281// Informs ATs that the platform state has changed.
282//
283// This function should be used by `GtkAccessible` implementations that
284// have a platform state but are not widgets. Widgets handle platform
285// states automatically.
286func (x *ShortcutsGroup) UpdatePlatformState(StateVar AccessiblePlatformState) {
287
288 XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar)
289
290}
291
292// Updates a list of accessible properties.
293//
294// See the [enum@Gtk.AccessibleProperty] documentation for the
295// value types of accessible properties.
296//
297// This function should be called by `GtkWidget` types whenever
298// an accessible property change must be communicated to assistive
299// technologies.
300//
301// Example:
302// ```c
303// value = gtk_adjustment_get_value (adjustment);
304// gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button),
305//
306// GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value,
307// -1);
308//
309// ```
310func (x *ShortcutsGroup) UpdateProperty(FirstPropertyVar AccessibleProperty, varArgs ...interface{}) {
311
312 XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...)
313
314}
315
316// Updates an array of accessible properties.
317//
318// This function should be called by `GtkWidget` types whenever an accessible
319// property change must be communicated to assistive technologies.
320//
321// This function is meant to be used by language bindings.
322func (x *ShortcutsGroup) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []AccessibleProperty, ValuesVar []gobject.Value) {
323
324 XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar)
325
326}
327
328// Updates a list of accessible relations.
329//
330// This function should be called by `GtkWidget` types whenever an accessible
331// relation change must be communicated to assistive technologies.
332//
333// If the [enum@Gtk.AccessibleRelation] requires a list of references,
334// you should pass each reference individually, followed by `NULL`, e.g.
335//
336// ```c
337// gtk_accessible_update_relation (accessible,
338//
339// GTK_ACCESSIBLE_RELATION_CONTROLS,
340// ref1, NULL,
341// GTK_ACCESSIBLE_RELATION_LABELLED_BY,
342// ref1, ref2, ref3, NULL,
343// -1);
344//
345// ```
346func (x *ShortcutsGroup) UpdateRelation(FirstRelationVar AccessibleRelation, varArgs ...interface{}) {
347
348 XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...)
349
350}
351
352// Updates an array of accessible relations.
353//
354// This function should be called by `GtkWidget` types whenever an accessible
355// relation change must be communicated to assistive technologies.
356//
357// This function is meant to be used by language bindings.
358func (x *ShortcutsGroup) UpdateRelationValue(NRelationsVar int, RelationsVar []AccessibleRelation, ValuesVar []gobject.Value) {
359
360 XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar)
361
362}
363
364// Updates a list of accessible states.
365//
366// See the [enum@Gtk.AccessibleState] documentation for the
367// value types of accessible states.
368//
369// This function should be called by `GtkWidget` types whenever
370// an accessible state change must be communicated to assistive
371// technologies.
372//
373// Example:
374//
375// ```c
376// value = GTK_ACCESSIBLE_TRISTATE_MIXED;
377// gtk_accessible_update_state (GTK_ACCESSIBLE (check_button),
378//
379// GTK_ACCESSIBLE_STATE_CHECKED, value,
380// -1);
381//
382// ```
383func (x *ShortcutsGroup) UpdateState(FirstStateVar AccessibleState, varArgs ...interface{}) {
384
385 XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...)
386
387}
388
389// Updates an array of accessible states.
390//
391// This function should be called by `GtkWidget` types whenever an accessible
392// state change must be communicated to assistive technologies.
393//
394// This function is meant to be used by language bindings.
395func (x *ShortcutsGroup) UpdateStateValue(NStatesVar int, StatesVar []AccessibleState, ValuesVar []gobject.Value) {
396
397 XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar)
398
399}
400
401// Gets the ID of the @buildable object.
402//
403// `GtkBuilder` sets the name based on the ID attribute
404// of the `<object>` tag used to construct the @buildable.
405func (x *ShortcutsGroup) GetBuildableId() string {
406
407 cret := XGtkBuildableGetBuildableId(x.GoPointer())
408 return cret
409}
410
411// Retrieves the orientation of the @orientable.
412func (x *ShortcutsGroup) GetOrientation() Orientation {
413
414 cret := XGtkOrientableGetOrientation(x.GoPointer())
415 return cret
416}
417
418// Sets the orientation of the @orientable.
419func (x *ShortcutsGroup) SetOrientation(OrientationVar Orientation) {
420
421 XGtkOrientableSetOrientation(x.GoPointer(), OrientationVar)
422
423}
424
425func init() {
426 core.SetPackageName("GTK", "gtk4")
427 core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"})
428 var libs []uintptr
429 for _, libPath := range core.GetPaths("GTK") {
430 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
431 if err != nil {
432 panic(err)
433 }
434 libs = append(libs, lib)
435 }
436
437 core.PuregoSafeRegister(&xShortcutsGroupGLibType, libs, "gtk_shortcuts_group_get_type")
438
439 core.PuregoSafeRegister(&xShortcutsGroupAddShortcut, libs, "gtk_shortcuts_group_add_shortcut")
440
441}