v0.2.2 9100209

adw-multi-layout-view.go RawHistoryFolder

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/gobject"
12	"github.com/bnema/puregotk/v4/gobject/types"
13	"github.com/bnema/puregotk/v4/gtk"
14)
15
16type MultiLayoutViewClass struct {
17	_ structs.HostLayout
18
19	ParentClass gtk.WidgetClass
20}
21
22func (x *MultiLayoutViewClass) GoPointer() uintptr {
23	return uintptr(unsafe.Pointer(x))
24}
25
26// A widget for switching between different layouts.
27//
28// `AdwMultiLayoutView` contains layouts and children. Each child has
29// an ID, each layout has slots inside it, each slot also has an ID. When
30// switching layouts, children are inserted into slots with matching IDs. The
31// [property@Gtk.Widget:visible] property of each slot is updated to match
32// that of the inserted child.
33//
34// This can be useful for rearranging children when it's difficult to do so
35// otherwise, for example to move a child from a sidebar to a bottom bar.
36//
37// The currently used layout can be switched using the
38// [property@MultiLayoutView:layout] or [property@MultiLayoutView:layout-name]
39// properties. For example, it can be done via a [class@Adw.Breakpoint] setter
40// to change layouts depending on the window size.
41//
42// ## AdwMultiLayoutView as GtkBuildable
43//
44// The `AdwMultiLayoutView` implementation of the [iface@Gtk.Buildable]
45// interface supports adding layouts via `<child>` element with the `type`
46// attribute omitted.
47//
48// It also supports setting children via `<child type="ID">`.
49//
50// Example of an `AdwMultiLayoutView` UI definition that can display a secondary
51// child as either a sidebar or a bottom sheet.
52//
53// ```xml
54// <object class="AdwMultiLayoutView">
55//
56//	<child>
57//	  <object class="AdwLayout">
58//	    <property name="name">sidebar</property>
59//	    <property name="content">
60//	      <object class="AdwOverlaySplitView">
61//	        <property name="sidebar">
62//	          <object class="AdwLayoutSlot">
63//	            <property name="id">secondary</property>
64//	          </object>
65//	        </property>
66//	        <property name="content">
67//	          <object class="AdwLayoutSlot">
68//	            <property name="id">primary</property>
69//	          </object>
70//	        </property>
71//	      </object>
72//	    </property>
73//	  </object>
74//	</child>
75//	<child>
76//	  <object class="AdwLayout">
77//	    <property name="name">bottom-sheet</property>
78//	    <property name="content">
79//	      <object class="AdwBottomSheet">
80//	        <property name="open">True</property>
81//	        <property name="content">
82//	          <object class="AdwLayoutSlot">
83//	            <property name="id">primary</property>
84//	          </object>
85//	        </property>
86//	        <property name="sheet">
87//	          <object class="AdwLayoutSlot">
88//	            <property name="id">secondary</property>
89//	          </object>
90//	        </property>
91//	      </object>
92//	    </property>
93//	  </object>
94//	</child>
95//	<child type="primary">
96//	  <!-- ... -->
97//	</child>
98//	<child type="secondary">
99//	  <!-- ... -->
100//	</child>
101//
102// </object>
103// ```
104//
105// ## CSS nodes
106//
107// `AdwMultiLayoutView` has a single CSS node with name `multi-layout-view`.
108type MultiLayoutView struct {
109	gtk.Widget
110}
111
112var xMultiLayoutViewGLibType func() types.GType
113
114func MultiLayoutViewGLibType() types.GType {
115	return xMultiLayoutViewGLibType()
116}
117
118func MultiLayoutViewNewFromInternalPtr(ptr uintptr) *MultiLayoutView {
119	cls := &MultiLayoutView{}
120	cls.Ptr = ptr
121	return cls
122}
123
124var xNewMultiLayoutView func() uintptr
125
126// Creates a new `AdwMultiLayoutView`.
127func NewMultiLayoutView() *MultiLayoutView {
128	var cls *MultiLayoutView
129
130	cret := xNewMultiLayoutView()
131
132	if cret == 0 {
133		return nil
134	}
135	gobject.IncreaseRef(cret)
136	cls = &MultiLayoutView{}
137	cls.Ptr = cret
138	return cls
139}
140
141var xMultiLayoutViewAddLayout func(uintptr, uintptr)
142
143// Adds @layout to @self.
144func (x *MultiLayoutView) AddLayout(LayoutVar *Layout) {
145
146	xMultiLayoutViewAddLayout(x.GoPointer(), LayoutVar.GoPointer())
147
148}
149
150var xMultiLayoutViewGetChild func(uintptr, string) uintptr
151
152// Gets the child for @id to @self.
153func (x *MultiLayoutView) GetChild(IdVar string) *gtk.Widget {
154	var cls *gtk.Widget
155
156	cret := xMultiLayoutViewGetChild(x.GoPointer(), IdVar)
157
158	if cret == 0 {
159		return nil
160	}
161	gobject.IncreaseRef(cret)
162	cls = &gtk.Widget{}
163	cls.Ptr = cret
164	return cls
165}
166
167var xMultiLayoutViewGetLayout func(uintptr) uintptr
168
169// Gets the currently used layout of @self.
170func (x *MultiLayoutView) GetLayout() *Layout {
171	var cls *Layout
172
173	cret := xMultiLayoutViewGetLayout(x.GoPointer())
174
175	if cret == 0 {
176		return nil
177	}
178	gobject.IncreaseRef(cret)
179	cls = &Layout{}
180	cls.Ptr = cret
181	return cls
182}
183
184var xMultiLayoutViewGetLayoutByName func(uintptr, string) uintptr
185
186// Gets layout with the name @name from @self, or `NULL` if it doesn't exist.
187//
188// See [property@Layout:name].
189func (x *MultiLayoutView) GetLayoutByName(NameVar string) *Layout {
190	var cls *Layout
191
192	cret := xMultiLayoutViewGetLayoutByName(x.GoPointer(), NameVar)
193
194	if cret == 0 {
195		return nil
196	}
197	gobject.IncreaseRef(cret)
198	cls = &Layout{}
199	cls.Ptr = cret
200	return cls
201}
202
203var xMultiLayoutViewGetLayoutName func(uintptr) string
204
205// Returns the name of the currently used layout of @self.
206func (x *MultiLayoutView) GetLayoutName() string {
207
208	cret := xMultiLayoutViewGetLayoutName(x.GoPointer())
209	return cret
210}
211
212var xMultiLayoutViewRemoveLayout func(uintptr, uintptr)
213
214// Removes @layout from @self.
215func (x *MultiLayoutView) RemoveLayout(LayoutVar *Layout) {
216
217	xMultiLayoutViewRemoveLayout(x.GoPointer(), LayoutVar.GoPointer())
218
219}
220
221var xMultiLayoutViewSetChild func(uintptr, string, uintptr)
222
223// Sets @child as the child for @id in @self.
224//
225// When changing layouts, it will be inserted into the slot with @id.
226func (x *MultiLayoutView) SetChild(IdVar string, ChildVar *gtk.Widget) {
227
228	xMultiLayoutViewSetChild(x.GoPointer(), IdVar, ChildVar.GoPointer())
229
230}
231
232var xMultiLayoutViewSetLayout func(uintptr, uintptr)
233
234// Makes @layout the current layout of @self.
235func (x *MultiLayoutView) SetLayout(LayoutVar *Layout) {
236
237	xMultiLayoutViewSetLayout(x.GoPointer(), LayoutVar.GoPointer())
238
239}
240
241var xMultiLayoutViewSetLayoutName func(uintptr, string)
242
243// Makes the layout with @name the current layout of @self.
244//
245// See [property@Layout:name].
246func (x *MultiLayoutView) SetLayoutName(NameVar string) {
247
248	xMultiLayoutViewSetLayoutName(x.GoPointer(), NameVar)
249
250}
251
252func (c *MultiLayoutView) GoPointer() uintptr {
253	if c == nil {
254		return 0
255	}
256	return c.Ptr
257}
258
259func (c *MultiLayoutView) SetGoPointer(ptr uintptr) {
260	c.Ptr = ptr
261}
262
263// SetPropertyLayoutName sets the "layout-name" property.
264// The name of the currently used layout.
265//
266// See [property@Layout:name].
267func (x *MultiLayoutView) SetPropertyLayoutName(value string) {
268	var v gobject.Value
269	v.Init(gobject.TypeStringVal)
270	v.SetString(&value)
271	x.SetProperty("layout-name", &v)
272}
273
274// GetPropertyLayoutName gets the "layout-name" property.
275// The name of the currently used layout.
276//
277// See [property@Layout:name].
278func (x *MultiLayoutView) GetPropertyLayoutName() string {
279	var v gobject.Value
280	x.GetProperty("layout-name", &v)
281	return v.GetString()
282}
283
284// Requests the user's screen reader to announce the given message.
285//
286// This kind of notification is useful for messages that
287// either have only a visual representation or that are not
288// exposed visually at all, e.g. a notification about a
289// successful operation.
290//
291// Also, by using this API, you can ensure that the message
292// does not interrupts the user's current screen reader output.
293func (x *MultiLayoutView) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) {
294
295	gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar)
296
297}
298
299// Retrieves the accessible parent for an accessible object.
300//
301// This function returns `NULL` for top level widgets.
302func (x *MultiLayoutView) GetAccessibleParent() *gtk.AccessibleBase {
303	var cls *gtk.AccessibleBase
304
305	cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer())
306
307	if cret == 0 {
308		return nil
309	}
310	cls = &gtk.AccessibleBase{}
311	cls.Ptr = cret
312	return cls
313}
314
315// Retrieves the accessible role of an accessible object.
316func (x *MultiLayoutView) GetAccessibleRole() gtk.AccessibleRole {
317
318	cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer())
319	return cret
320}
321
322// Retrieves the implementation for the given accessible object.
323func (x *MultiLayoutView) GetAtContext() *gtk.ATContext {
324	var cls *gtk.ATContext
325
326	cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer())
327
328	if cret == 0 {
329		return nil
330	}
331	cls = &gtk.ATContext{}
332	cls.Ptr = cret
333	return cls
334}
335
336// Queries the coordinates and dimensions of this accessible
337//
338// This functionality can be overridden by `GtkAccessible`
339// implementations, e.g. to get the bounds from an ignored
340// child widget.
341func (x *MultiLayoutView) GetBounds(XVar *int, YVar *int, WidthVar *int, HeightVar *int) bool {
342
343	cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar)
344	return cret
345}
346
347// Retrieves the first accessible child of an accessible object.
348func (x *MultiLayoutView) GetFirstAccessibleChild() *gtk.AccessibleBase {
349	var cls *gtk.AccessibleBase
350
351	cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer())
352
353	if cret == 0 {
354		return nil
355	}
356	cls = &gtk.AccessibleBase{}
357	cls.Ptr = cret
358	return cls
359}
360
361// Retrieves the next accessible sibling of an accessible object
362func (x *MultiLayoutView) GetNextAccessibleSibling() *gtk.AccessibleBase {
363	var cls *gtk.AccessibleBase
364
365	cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer())
366
367	if cret == 0 {
368		return nil
369	}
370	cls = &gtk.AccessibleBase{}
371	cls.Ptr = cret
372	return cls
373}
374
375// Queries a platform state, such as focus.
376//
377// This functionality can be overridden by `GtkAccessible`
378// implementations, e.g. to get platform state from an ignored
379// child widget, as is the case for `GtkText` wrappers.
380func (x *MultiLayoutView) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool {
381
382	cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar)
383	return cret
384}
385
386// Resets the accessible property to its default value.
387func (x *MultiLayoutView) ResetProperty(PropertyVar gtk.AccessibleProperty) {
388
389	gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar)
390
391}
392
393// Resets the accessible relation to its default value.
394func (x *MultiLayoutView) ResetRelation(RelationVar gtk.AccessibleRelation) {
395
396	gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar)
397
398}
399
400// Resets the accessible state to its default value.
401func (x *MultiLayoutView) ResetState(StateVar gtk.AccessibleState) {
402
403	gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar)
404
405}
406
407// Sets the parent and sibling of an accessible object.
408//
409// This function is meant to be used by accessible implementations that are
410// not part of the widget hierarchy, and but act as a logical bridge between
411// widgets. For instance, if a widget creates an object that holds metadata
412// for each child, and you want that object to implement the `GtkAccessible`
413// interface, you will use this function to ensure that the parent of each
414// child widget is the metadata object, and the parent of each metadata
415// object is the container widget.
416func (x *MultiLayoutView) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) {
417
418	gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer())
419
420}
421
422// Updates the next accessible sibling.
423//
424// That might be useful when a new child of a custom accessible
425// is created, and it needs to be linked to a previous child.
426func (x *MultiLayoutView) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) {
427
428	gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer())
429
430}
431
432// Informs ATs that the platform state has changed.
433//
434// This function should be used by `GtkAccessible` implementations that
435// have a platform state but are not widgets. Widgets handle platform
436// states automatically.
437func (x *MultiLayoutView) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) {
438
439	gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar)
440
441}
442
443// Updates a list of accessible properties.
444//
445// See the [enum@Gtk.AccessibleProperty] documentation for the
446// value types of accessible properties.
447//
448// This function should be called by `GtkWidget` types whenever
449// an accessible property change must be communicated to assistive
450// technologies.
451//
452// Example:
453// ```c
454// value = gtk_adjustment_get_value (adjustment);
455// gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button),
456//
457//	GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value,
458//	-1);
459//
460// ```
461func (x *MultiLayoutView) UpdateProperty(FirstPropertyVar gtk.AccessibleProperty, varArgs ...interface{}) {
462
463	gtk.XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...)
464
465}
466
467// Updates an array of accessible properties.
468//
469// This function should be called by `GtkWidget` types whenever an accessible
470// property change must be communicated to assistive technologies.
471//
472// This function is meant to be used by language bindings.
473func (x *MultiLayoutView) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gtk.AccessibleProperty, ValuesVar []gobject.Value) {
474
475	gtk.XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar)
476
477}
478
479// Updates a list of accessible relations.
480//
481// This function should be called by `GtkWidget` types whenever an accessible
482// relation change must be communicated to assistive technologies.
483//
484// If the [enum@Gtk.AccessibleRelation] requires a list of references,
485// you should pass each reference individually, followed by `NULL`, e.g.
486//
487// ```c
488// gtk_accessible_update_relation (accessible,
489//
490//	GTK_ACCESSIBLE_RELATION_CONTROLS,
491//	  ref1, NULL,
492//	GTK_ACCESSIBLE_RELATION_LABELLED_BY,
493//	  ref1, ref2, ref3, NULL,
494//	-1);
495//
496// ```
497func (x *MultiLayoutView) UpdateRelation(FirstRelationVar gtk.AccessibleRelation, varArgs ...interface{}) {
498
499	gtk.XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...)
500
501}
502
503// Updates an array of accessible relations.
504//
505// This function should be called by `GtkWidget` types whenever an accessible
506// relation change must be communicated to assistive technologies.
507//
508// This function is meant to be used by language bindings.
509func (x *MultiLayoutView) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk.AccessibleRelation, ValuesVar []gobject.Value) {
510
511	gtk.XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar)
512
513}
514
515// Updates a list of accessible states.
516//
517// See the [enum@Gtk.AccessibleState] documentation for the
518// value types of accessible states.
519//
520// This function should be called by `GtkWidget` types whenever
521// an accessible state change must be communicated to assistive
522// technologies.
523//
524// Example:
525//
526// ```c
527// value = GTK_ACCESSIBLE_TRISTATE_MIXED;
528// gtk_accessible_update_state (GTK_ACCESSIBLE (check_button),
529//
530//	GTK_ACCESSIBLE_STATE_CHECKED, value,
531//	-1);
532//
533// ```
534func (x *MultiLayoutView) UpdateState(FirstStateVar gtk.AccessibleState, varArgs ...interface{}) {
535
536	gtk.XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...)
537
538}
539
540// Updates an array of accessible states.
541//
542// This function should be called by `GtkWidget` types whenever an accessible
543// state change must be communicated to assistive technologies.
544//
545// This function is meant to be used by language bindings.
546func (x *MultiLayoutView) UpdateStateValue(NStatesVar int, StatesVar []gtk.AccessibleState, ValuesVar []gobject.Value) {
547
548	gtk.XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar)
549
550}
551
552// Gets the ID of the @buildable object.
553//
554// `GtkBuilder` sets the name based on the ID attribute
555// of the `<object>` tag used to construct the @buildable.
556func (x *MultiLayoutView) GetBuildableId() string {
557
558	cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer())
559	return cret
560}
561
562func init() {
563	core.SetPackageName("ADW", "libadwaita-1")
564	core.SetSharedLibraries("ADW", []string{"libadwaita-1.so.0"})
565	var libs []uintptr
566	for _, libPath := range core.GetPaths("ADW") {
567		lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
568		if err != nil {
569			panic(err)
570		}
571		libs = append(libs, lib)
572	}
573
574	core.PuregoSafeRegister(&xMultiLayoutViewGLibType, libs, "adw_multi_layout_view_get_type")
575
576	core.PuregoSafeRegister(&xNewMultiLayoutView, libs, "adw_multi_layout_view_new")
577
578	core.PuregoSafeRegister(&xMultiLayoutViewAddLayout, libs, "adw_multi_layout_view_add_layout")
579	core.PuregoSafeRegister(&xMultiLayoutViewGetChild, libs, "adw_multi_layout_view_get_child")
580	core.PuregoSafeRegister(&xMultiLayoutViewGetLayout, libs, "adw_multi_layout_view_get_layout")
581	core.PuregoSafeRegister(&xMultiLayoutViewGetLayoutByName, libs, "adw_multi_layout_view_get_layout_by_name")
582	core.PuregoSafeRegister(&xMultiLayoutViewGetLayoutName, libs, "adw_multi_layout_view_get_layout_name")
583	core.PuregoSafeRegister(&xMultiLayoutViewRemoveLayout, libs, "adw_multi_layout_view_remove_layout")
584	core.PuregoSafeRegister(&xMultiLayoutViewSetChild, libs, "adw_multi_layout_view_set_child")
585	core.PuregoSafeRegister(&xMultiLayoutViewSetLayout, libs, "adw_multi_layout_view_set_layout")
586	core.PuregoSafeRegister(&xMultiLayoutViewSetLayoutName, libs, "adw_multi_layout_view_set_layout_name")
587
588}

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