1// Package adw was automatically generated by github.com/bnema/puregotk DO NOT EDIT
2package adw
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/glib"
12 "github.com/bnema/puregotk/v4/gobject"
13 "github.com/bnema/puregotk/v4/gobject/types"
14 "github.com/bnema/puregotk/v4/gtk"
15)
16
17type PreferencesRowClass struct {
18 _ structs.HostLayout
19
20 ParentClass gtk.ListBoxRowClass
21
22 Padding [4]uintptr
23}
24
25func (x *PreferencesRowClass) GoPointer() uintptr {
26 return uintptr(unsafe.Pointer(x))
27}
28
29// A [class@Gtk.ListBoxRow] used to present preferences.
30//
31// The `AdwPreferencesRow` widget has a title that [class@PreferencesDialog]
32// will use to let the user look for a preference. It doesn't present the title
33// in any way and lets you present the preference as you please.
34//
35// [class@ActionRow] and its derivatives are convenient to use as preference
36// rows as they take care of presenting the preference's title while letting you
37// compose the inputs of the preference around it.
38type PreferencesRow struct {
39 gtk.ListBoxRow
40}
41
42var xPreferencesRowGLibType func() types.GType
43
44func PreferencesRowGLibType() types.GType {
45 return xPreferencesRowGLibType()
46}
47
48func PreferencesRowNewFromInternalPtr(ptr uintptr) *PreferencesRow {
49 cls := &PreferencesRow{}
50 cls.Ptr = ptr
51 return cls
52}
53
54var xNewPreferencesRow func() uintptr
55
56// Creates a new `AdwPreferencesRow`.
57func NewPreferencesRow() *PreferencesRow {
58 var cls *PreferencesRow
59
60 cret := xNewPreferencesRow()
61
62 if cret == 0 {
63 return nil
64 }
65 gobject.IncreaseRef(cret)
66 cls = &PreferencesRow{}
67 cls.Ptr = cret
68 return cls
69}
70
71var xPreferencesRowGetTitle func(uintptr) string
72
73// Gets the title of the preference represented by @self.
74func (x *PreferencesRow) GetTitle() string {
75
76 cret := xPreferencesRowGetTitle(x.GoPointer())
77 return cret
78}
79
80var xPreferencesRowGetTitleSelectable func(uintptr) bool
81
82// Gets whether the user can copy the title from the label
83func (x *PreferencesRow) GetTitleSelectable() bool {
84
85 cret := xPreferencesRowGetTitleSelectable(x.GoPointer())
86 return cret
87}
88
89var xPreferencesRowGetUseMarkup func(uintptr) bool
90
91// Gets whether to use Pango markup for the title label.
92func (x *PreferencesRow) GetUseMarkup() bool {
93
94 cret := xPreferencesRowGetUseMarkup(x.GoPointer())
95 return cret
96}
97
98var xPreferencesRowGetUseUnderline func(uintptr) bool
99
100// Gets whether an embedded underline in the title indicates a mnemonic.
101func (x *PreferencesRow) GetUseUnderline() bool {
102
103 cret := xPreferencesRowGetUseUnderline(x.GoPointer())
104 return cret
105}
106
107var xPreferencesRowSetTitle func(uintptr, string)
108
109// Sets the title of the preference represented by @self.
110//
111// The title is interpreted as Pango markup unless
112// [property@PreferencesRow:use-markup] is set to `FALSE`.
113func (x *PreferencesRow) SetTitle(TitleVar string) {
114
115 xPreferencesRowSetTitle(x.GoPointer(), TitleVar)
116
117}
118
119var xPreferencesRowSetTitleSelectable func(uintptr, bool)
120
121// Sets whether the user can copy the title from the label
122//
123// See also [property@Gtk.Label:selectable].
124func (x *PreferencesRow) SetTitleSelectable(TitleSelectableVar bool) {
125
126 xPreferencesRowSetTitleSelectable(x.GoPointer(), TitleSelectableVar)
127
128}
129
130var xPreferencesRowSetUseMarkup func(uintptr, bool)
131
132// Sets whether to use Pango markup for the title label.
133//
134// Subclasses may also use it for other labels, such as subtitle.
135//
136// See also [func@Pango.parse_markup].
137func (x *PreferencesRow) SetUseMarkup(UseMarkupVar bool) {
138
139 xPreferencesRowSetUseMarkup(x.GoPointer(), UseMarkupVar)
140
141}
142
143var xPreferencesRowSetUseUnderline func(uintptr, bool)
144
145// Sets whether an embedded underline in the title indicates a mnemonic.
146func (x *PreferencesRow) SetUseUnderline(UseUnderlineVar bool) {
147
148 xPreferencesRowSetUseUnderline(x.GoPointer(), UseUnderlineVar)
149
150}
151
152func (c *PreferencesRow) GoPointer() uintptr {
153 if c == nil {
154 return 0
155 }
156 return c.Ptr
157}
158
159func (c *PreferencesRow) SetGoPointer(ptr uintptr) {
160 c.Ptr = ptr
161}
162
163// SetPropertyTitle sets the "title" property.
164// The title of the preference represented by this row.
165//
166// The title is interpreted as Pango markup unless
167// [property@PreferencesRow:use-markup] is set to `FALSE`.
168func (x *PreferencesRow) SetPropertyTitle(value string) {
169 var v gobject.Value
170 v.Init(gobject.TypeStringVal)
171 v.SetString(&value)
172 x.SetProperty("title", &v)
173}
174
175// GetPropertyTitle gets the "title" property.
176// The title of the preference represented by this row.
177//
178// The title is interpreted as Pango markup unless
179// [property@PreferencesRow:use-markup] is set to `FALSE`.
180func (x *PreferencesRow) GetPropertyTitle() string {
181 var v gobject.Value
182 x.GetProperty("title", &v)
183 return v.GetString()
184}
185
186// SetPropertyTitleSelectable sets the "title-selectable" property.
187// Whether the user can copy the title from the label.
188//
189// See also [property@Gtk.Label:selectable].
190func (x *PreferencesRow) SetPropertyTitleSelectable(value bool) {
191 var v gobject.Value
192 v.Init(gobject.TypeBooleanVal)
193 v.SetBoolean(value)
194 x.SetProperty("title-selectable", &v)
195}
196
197// GetPropertyTitleSelectable gets the "title-selectable" property.
198// Whether the user can copy the title from the label.
199//
200// See also [property@Gtk.Label:selectable].
201func (x *PreferencesRow) GetPropertyTitleSelectable() bool {
202 var v gobject.Value
203 x.GetProperty("title-selectable", &v)
204 return v.GetBoolean()
205}
206
207// SetPropertyUseMarkup sets the "use-markup" property.
208// Whether to use Pango markup for the title label.
209//
210// Subclasses may also use it for other labels, such as subtitle.
211//
212// See also [func@Pango.parse_markup].
213func (x *PreferencesRow) SetPropertyUseMarkup(value bool) {
214 var v gobject.Value
215 v.Init(gobject.TypeBooleanVal)
216 v.SetBoolean(value)
217 x.SetProperty("use-markup", &v)
218}
219
220// GetPropertyUseMarkup gets the "use-markup" property.
221// Whether to use Pango markup for the title label.
222//
223// Subclasses may also use it for other labels, such as subtitle.
224//
225// See also [func@Pango.parse_markup].
226func (x *PreferencesRow) GetPropertyUseMarkup() bool {
227 var v gobject.Value
228 x.GetProperty("use-markup", &v)
229 return v.GetBoolean()
230}
231
232// SetPropertyUseUnderline sets the "use-underline" property.
233// Whether an embedded underline in the title indicates a mnemonic.
234func (x *PreferencesRow) SetPropertyUseUnderline(value bool) {
235 var v gobject.Value
236 v.Init(gobject.TypeBooleanVal)
237 v.SetBoolean(value)
238 x.SetProperty("use-underline", &v)
239}
240
241// GetPropertyUseUnderline gets the "use-underline" property.
242// Whether an embedded underline in the title indicates a mnemonic.
243func (x *PreferencesRow) GetPropertyUseUnderline() bool {
244 var v gobject.Value
245 x.GetProperty("use-underline", &v)
246 return v.GetBoolean()
247}
248
249// Requests the user's screen reader to announce the given message.
250//
251// This kind of notification is useful for messages that
252// either have only a visual representation or that are not
253// exposed visually at all, e.g. a notification about a
254// successful operation.
255//
256// Also, by using this API, you can ensure that the message
257// does not interrupts the user's current screen reader output.
258func (x *PreferencesRow) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) {
259
260 gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar)
261
262}
263
264// Retrieves the accessible parent for an accessible object.
265//
266// This function returns `NULL` for top level widgets.
267func (x *PreferencesRow) GetAccessibleParent() *gtk.AccessibleBase {
268 var cls *gtk.AccessibleBase
269
270 cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer())
271
272 if cret == 0 {
273 return nil
274 }
275 cls = >k.AccessibleBase{}
276 cls.Ptr = cret
277 return cls
278}
279
280// Retrieves the accessible role of an accessible object.
281func (x *PreferencesRow) GetAccessibleRole() gtk.AccessibleRole {
282
283 cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer())
284 return cret
285}
286
287// Retrieves the implementation for the given accessible object.
288func (x *PreferencesRow) GetAtContext() *gtk.ATContext {
289 var cls *gtk.ATContext
290
291 cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer())
292
293 if cret == 0 {
294 return nil
295 }
296 cls = >k.ATContext{}
297 cls.Ptr = cret
298 return cls
299}
300
301// Queries the coordinates and dimensions of this accessible
302//
303// This functionality can be overridden by `GtkAccessible`
304// implementations, e.g. to get the bounds from an ignored
305// child widget.
306func (x *PreferencesRow) GetBounds(XVar *int, YVar *int, WidthVar *int, HeightVar *int) bool {
307
308 cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar)
309 return cret
310}
311
312// Retrieves the first accessible child of an accessible object.
313func (x *PreferencesRow) GetFirstAccessibleChild() *gtk.AccessibleBase {
314 var cls *gtk.AccessibleBase
315
316 cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer())
317
318 if cret == 0 {
319 return nil
320 }
321 cls = >k.AccessibleBase{}
322 cls.Ptr = cret
323 return cls
324}
325
326// Retrieves the next accessible sibling of an accessible object
327func (x *PreferencesRow) GetNextAccessibleSibling() *gtk.AccessibleBase {
328 var cls *gtk.AccessibleBase
329
330 cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer())
331
332 if cret == 0 {
333 return nil
334 }
335 cls = >k.AccessibleBase{}
336 cls.Ptr = cret
337 return cls
338}
339
340// Queries a platform state, such as focus.
341//
342// This functionality can be overridden by `GtkAccessible`
343// implementations, e.g. to get platform state from an ignored
344// child widget, as is the case for `GtkText` wrappers.
345func (x *PreferencesRow) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool {
346
347 cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar)
348 return cret
349}
350
351// Resets the accessible property to its default value.
352func (x *PreferencesRow) ResetProperty(PropertyVar gtk.AccessibleProperty) {
353
354 gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar)
355
356}
357
358// Resets the accessible relation to its default value.
359func (x *PreferencesRow) ResetRelation(RelationVar gtk.AccessibleRelation) {
360
361 gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar)
362
363}
364
365// Resets the accessible state to its default value.
366func (x *PreferencesRow) ResetState(StateVar gtk.AccessibleState) {
367
368 gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar)
369
370}
371
372// Sets the parent and sibling of an accessible object.
373//
374// This function is meant to be used by accessible implementations that are
375// not part of the widget hierarchy, and but act as a logical bridge between
376// widgets. For instance, if a widget creates an object that holds metadata
377// for each child, and you want that object to implement the `GtkAccessible`
378// interface, you will use this function to ensure that the parent of each
379// child widget is the metadata object, and the parent of each metadata
380// object is the container widget.
381func (x *PreferencesRow) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) {
382
383 gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer())
384
385}
386
387// Updates the next accessible sibling.
388//
389// That might be useful when a new child of a custom accessible
390// is created, and it needs to be linked to a previous child.
391func (x *PreferencesRow) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) {
392
393 gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer())
394
395}
396
397// Informs ATs that the platform state has changed.
398//
399// This function should be used by `GtkAccessible` implementations that
400// have a platform state but are not widgets. Widgets handle platform
401// states automatically.
402func (x *PreferencesRow) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) {
403
404 gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar)
405
406}
407
408// Updates a list of accessible properties.
409//
410// See the [enum@Gtk.AccessibleProperty] documentation for the
411// value types of accessible properties.
412//
413// This function should be called by `GtkWidget` types whenever
414// an accessible property change must be communicated to assistive
415// technologies.
416//
417// Example:
418// ```c
419// value = gtk_adjustment_get_value (adjustment);
420// gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button),
421//
422// GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value,
423// -1);
424//
425// ```
426func (x *PreferencesRow) UpdateProperty(FirstPropertyVar gtk.AccessibleProperty, varArgs ...interface{}) {
427
428 gtk.XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...)
429
430}
431
432// Updates an array of accessible properties.
433//
434// This function should be called by `GtkWidget` types whenever an accessible
435// property change must be communicated to assistive technologies.
436//
437// This function is meant to be used by language bindings.
438func (x *PreferencesRow) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gtk.AccessibleProperty, ValuesVar []gobject.Value) {
439
440 gtk.XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar)
441
442}
443
444// Updates a list of accessible relations.
445//
446// This function should be called by `GtkWidget` types whenever an accessible
447// relation change must be communicated to assistive technologies.
448//
449// If the [enum@Gtk.AccessibleRelation] requires a list of references,
450// you should pass each reference individually, followed by `NULL`, e.g.
451//
452// ```c
453// gtk_accessible_update_relation (accessible,
454//
455// GTK_ACCESSIBLE_RELATION_CONTROLS,
456// ref1, NULL,
457// GTK_ACCESSIBLE_RELATION_LABELLED_BY,
458// ref1, ref2, ref3, NULL,
459// -1);
460//
461// ```
462func (x *PreferencesRow) UpdateRelation(FirstRelationVar gtk.AccessibleRelation, varArgs ...interface{}) {
463
464 gtk.XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...)
465
466}
467
468// Updates an array of accessible relations.
469//
470// This function should be called by `GtkWidget` types whenever an accessible
471// relation change must be communicated to assistive technologies.
472//
473// This function is meant to be used by language bindings.
474func (x *PreferencesRow) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk.AccessibleRelation, ValuesVar []gobject.Value) {
475
476 gtk.XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar)
477
478}
479
480// Updates a list of accessible states.
481//
482// See the [enum@Gtk.AccessibleState] documentation for the
483// value types of accessible states.
484//
485// This function should be called by `GtkWidget` types whenever
486// an accessible state change must be communicated to assistive
487// technologies.
488//
489// Example:
490//
491// ```c
492// value = GTK_ACCESSIBLE_TRISTATE_MIXED;
493// gtk_accessible_update_state (GTK_ACCESSIBLE (check_button),
494//
495// GTK_ACCESSIBLE_STATE_CHECKED, value,
496// -1);
497//
498// ```
499func (x *PreferencesRow) UpdateState(FirstStateVar gtk.AccessibleState, varArgs ...interface{}) {
500
501 gtk.XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...)
502
503}
504
505// Updates an array of accessible states.
506//
507// This function should be called by `GtkWidget` types whenever an accessible
508// state change must be communicated to assistive technologies.
509//
510// This function is meant to be used by language bindings.
511func (x *PreferencesRow) UpdateStateValue(NStatesVar int, StatesVar []gtk.AccessibleState, ValuesVar []gobject.Value) {
512
513 gtk.XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar)
514
515}
516
517// Gets the action name for @actionable.
518func (x *PreferencesRow) GetActionName() string {
519
520 cret := gtk.XGtkActionableGetActionName(x.GoPointer())
521 return cret
522}
523
524// Gets the current target value of @actionable.
525func (x *PreferencesRow) GetActionTargetValue() *glib.Variant {
526
527 cret := gtk.XGtkActionableGetActionTargetValue(x.GoPointer())
528 return cret
529}
530
531// Specifies the name of the action with which this widget should be
532// associated.
533//
534// If @action_name is %NULL then the widget will be unassociated from
535// any previous action.
536//
537// Usually this function is used when the widget is located (or will be
538// located) within the hierarchy of a `GtkApplicationWindow`.
539//
540// Names are of the form “win.save” or “app.quit” for actions on the
541// containing [class@ApplicationWindow] or its associated [class@Application],
542// respectively. This is the same form used for actions in the [class@Gio.Menu]
543// associated with the window.
544func (x *PreferencesRow) SetActionName(ActionNameVar *string) {
545
546 ActionNameVarPtr := core.GStrdupNullable(ActionNameVar)
547 defer core.GFreeNullable(ActionNameVarPtr)
548
549 gtk.XGtkActionableSetActionName(x.GoPointer(), ActionNameVarPtr)
550
551}
552
553// Sets the target of an actionable widget.
554//
555// This is a convenience function that calls [ctor@GLib.Variant.new] for
556// @format_string and uses the result to call
557// [method@Gtk.Actionable.set_action_target_value].
558//
559// If you are setting a string-valued target and want to set
560// the action name at the same time, you can use
561// [method@Gtk.Actionable.set_detailed_action_name].
562func (x *PreferencesRow) SetActionTarget(FormatStringVar string, varArgs ...interface{}) {
563
564 gtk.XGtkActionableSetActionTarget(x.GoPointer(), FormatStringVar, varArgs...)
565
566}
567
568// Sets the target value of an actionable widget.
569//
570// If @target_value is %NULL then the target value is unset.
571//
572// The target value has two purposes. First, it is used as the parameter
573// to activation of the action associated with the `GtkActionable` widget.
574// Second, it is used to determine if the widget should be rendered as
575// “active” — the widget is active if the state is equal to the given target.
576//
577// Consider the example of associating a set of buttons with a [iface@Gio.Action]
578// with string state in a typical “radio button” situation. Each button
579// will be associated with the same action, but with a different target
580// value for that action. Clicking on a particular button will activate
581// the action with the target of that button, which will typically cause
582// the action’s state to change to that value. Since the action’s state
583// is now equal to the target value of the button, the button will now
584// be rendered as active (and the other buttons, with different targets,
585// rendered inactive).
586func (x *PreferencesRow) SetActionTargetValue(TargetValueVar *glib.Variant) {
587
588 gtk.XGtkActionableSetActionTargetValue(x.GoPointer(), TargetValueVar)
589
590}
591
592// Sets the action-name and associated string target value of an
593// actionable widget.
594//
595// @detailed_action_name is a string in the format accepted by
596// [func@Gio.Action.parse_detailed_name].
597func (x *PreferencesRow) SetDetailedActionName(DetailedActionNameVar string) {
598
599 gtk.XGtkActionableSetDetailedActionName(x.GoPointer(), DetailedActionNameVar)
600
601}
602
603// Gets the ID of the @buildable object.
604//
605// `GtkBuilder` sets the name based on the ID attribute
606// of the `<object>` tag used to construct the @buildable.
607func (x *PreferencesRow) GetBuildableId() string {
608
609 cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer())
610 return cret
611}
612
613func init() {
614 core.SetPackageName("ADW", "libadwaita-1")
615 core.SetSharedLibraries("ADW", []string{"libadwaita-1.so.0"})
616 var libs []uintptr
617 for _, libPath := range core.GetPaths("ADW") {
618 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
619 if err != nil {
620 panic(err)
621 }
622 libs = append(libs, lib)
623 }
624
625 core.PuregoSafeRegister(&xPreferencesRowGLibType, libs, "adw_preferences_row_get_type")
626
627 core.PuregoSafeRegister(&xNewPreferencesRow, libs, "adw_preferences_row_new")
628
629 core.PuregoSafeRegister(&xPreferencesRowGetTitle, libs, "adw_preferences_row_get_title")
630 core.PuregoSafeRegister(&xPreferencesRowGetTitleSelectable, libs, "adw_preferences_row_get_title_selectable")
631 core.PuregoSafeRegister(&xPreferencesRowGetUseMarkup, libs, "adw_preferences_row_get_use_markup")
632 core.PuregoSafeRegister(&xPreferencesRowGetUseUnderline, libs, "adw_preferences_row_get_use_underline")
633 core.PuregoSafeRegister(&xPreferencesRowSetTitle, libs, "adw_preferences_row_set_title")
634 core.PuregoSafeRegister(&xPreferencesRowSetTitleSelectable, libs, "adw_preferences_row_set_title_selectable")
635 core.PuregoSafeRegister(&xPreferencesRowSetUseMarkup, libs, "adw_preferences_row_set_use_markup")
636 core.PuregoSafeRegister(&xPreferencesRowSetUseUnderline, libs, "adw_preferences_row_set_use_underline")
637
638}