v0.2.2 9100209

adw-view-switcher.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 ViewSwitcherClass struct {
17	_ structs.HostLayout
18
19	ParentClass gtk.WidgetClass
20}
21
22func (x *ViewSwitcherClass) GoPointer() uintptr {
23	return uintptr(unsafe.Pointer(x))
24}
25
26// Describes the adaptive modes of [class@ViewSwitcher].
27type ViewSwitcherPolicy int
28
29var xViewSwitcherPolicyGLibType func() types.GType
30
31func ViewSwitcherPolicyGLibType() types.GType {
32	return xViewSwitcherPolicyGLibType()
33}
34
35const (
36
37	// Force the narrow mode
38	ViewSwitcherPolicyNarrowValue ViewSwitcherPolicy = 0
39	// Force the wide mode
40	ViewSwitcherPolicyWideValue ViewSwitcherPolicy = 1
41)
42
43// An adaptive view switcher.
44//
45// <picture>
46//
47//	<source srcset="view-switcher-dark.png" media="(prefers-color-scheme: dark)">
48//	<img src="view-switcher.png" alt="view-switcher">
49//
50// </picture>
51//
52// An adaptive view switcher designed to switch between multiple views
53// contained in a [class@ViewStack] in a similar fashion to
54// [class@Gtk.StackSwitcher].
55//
56// `AdwViewSwitcher` buttons always have an icon and a label. They can be
57// displayed side by side, or icon on top of the label. This can be controlled
58// via the [property@ViewSwitcher:policy] property.
59//
60// `AdwViewSwitcher` is intended to be used in a header bar together with
61// [class@ViewSwitcherBar] at the bottom of the window, and a [class@Breakpoint]
62// showing the view switcher bar on narrow sizes, while removing the view
63// switcher from the header bar, as follows:
64//
65// ```xml
66// <object class="AdwWindow">
67//
68//	<child>
69//	  <object class="AdwBreakpoint">
70//	    <condition>max-width: 550sp</condition>
71//	    <setter object="switcher_bar" property="reveal">True</setter>
72//	    <setter object="header_bar" property="title-widget"/>
73//	  </object>
74//	</child>
75//	<property name="content">
76//	  <object class="AdwToolbarView">
77//	    <child type="top">
78//	      <object class="AdwHeaderBar" id="header_bar">
79//	        <property name="title-widget">
80//	          <object class="AdwViewSwitcher">
81//	            <property name="stack">stack</property>
82//	            <property name="policy">wide</property>
83//	          </object>
84//	        </property>
85//	      </object>
86//	    </child>
87//	    <property name="content">
88//	      <object class="AdwViewStack" id="stack"/>
89//	    </property>
90//	    <child type="bottom">
91//	      <object class="AdwViewSwitcherBar" id="switcher_bar">
92//	        <property name="stack">stack</property>
93//	      </object>
94//	    </child>
95//	  </object>
96//	</property>
97//
98// </object>
99// ```
100//
101// It's recommended to set [property@ViewSwitcher:policy] to
102// `ADW_VIEW_SWITCHER_POLICY_WIDE` in this case.
103//
104// You may have to adjust the breakpoint condition for your specific pages.
105//
106// ## CSS nodes
107//
108// `AdwViewSwitcher` has a single CSS node with name `viewswitcher`. It can have
109// the style classes `.wide` and `.narrow`, matching its policy.
110//
111// ## Accessibility
112//
113// `AdwViewSwitcher` uses the `GTK_ACCESSIBLE_ROLE_TAB_LIST` role and uses the
114// `GTK_ACCESSIBLE_ROLE_TAB` for its buttons.
115type ViewSwitcher struct {
116	gtk.Widget
117}
118
119var xViewSwitcherGLibType func() types.GType
120
121func ViewSwitcherGLibType() types.GType {
122	return xViewSwitcherGLibType()
123}
124
125func ViewSwitcherNewFromInternalPtr(ptr uintptr) *ViewSwitcher {
126	cls := &ViewSwitcher{}
127	cls.Ptr = ptr
128	return cls
129}
130
131var xNewViewSwitcher func() uintptr
132
133// Creates a new `AdwViewSwitcher`.
134func NewViewSwitcher() *ViewSwitcher {
135	var cls *ViewSwitcher
136
137	cret := xNewViewSwitcher()
138
139	if cret == 0 {
140		return nil
141	}
142	gobject.IncreaseRef(cret)
143	cls = &ViewSwitcher{}
144	cls.Ptr = cret
145	return cls
146}
147
148var xViewSwitcherGetPolicy func(uintptr) ViewSwitcherPolicy
149
150// Gets the policy of @self.
151func (x *ViewSwitcher) GetPolicy() ViewSwitcherPolicy {
152
153	cret := xViewSwitcherGetPolicy(x.GoPointer())
154	return cret
155}
156
157var xViewSwitcherGetStack func(uintptr) uintptr
158
159// Gets the stack controlled by @self.
160func (x *ViewSwitcher) GetStack() *ViewStack {
161	var cls *ViewStack
162
163	cret := xViewSwitcherGetStack(x.GoPointer())
164
165	if cret == 0 {
166		return nil
167	}
168	gobject.IncreaseRef(cret)
169	cls = &ViewStack{}
170	cls.Ptr = cret
171	return cls
172}
173
174var xViewSwitcherSetPolicy func(uintptr, ViewSwitcherPolicy)
175
176// Sets the policy of @self.
177func (x *ViewSwitcher) SetPolicy(PolicyVar ViewSwitcherPolicy) {
178
179	xViewSwitcherSetPolicy(x.GoPointer(), PolicyVar)
180
181}
182
183var xViewSwitcherSetStack func(uintptr, uintptr)
184
185// Sets the stack controlled by @self.
186func (x *ViewSwitcher) SetStack(StackVar *ViewStack) {
187
188	xViewSwitcherSetStack(x.GoPointer(), StackVar.GoPointer())
189
190}
191
192func (c *ViewSwitcher) GoPointer() uintptr {
193	if c == nil {
194		return 0
195	}
196	return c.Ptr
197}
198
199func (c *ViewSwitcher) SetGoPointer(ptr uintptr) {
200	c.Ptr = ptr
201}
202
203// Requests the user's screen reader to announce the given message.
204//
205// This kind of notification is useful for messages that
206// either have only a visual representation or that are not
207// exposed visually at all, e.g. a notification about a
208// successful operation.
209//
210// Also, by using this API, you can ensure that the message
211// does not interrupts the user's current screen reader output.
212func (x *ViewSwitcher) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) {
213
214	gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar)
215
216}
217
218// Retrieves the accessible parent for an accessible object.
219//
220// This function returns `NULL` for top level widgets.
221func (x *ViewSwitcher) GetAccessibleParent() *gtk.AccessibleBase {
222	var cls *gtk.AccessibleBase
223
224	cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer())
225
226	if cret == 0 {
227		return nil
228	}
229	cls = &gtk.AccessibleBase{}
230	cls.Ptr = cret
231	return cls
232}
233
234// Retrieves the accessible role of an accessible object.
235func (x *ViewSwitcher) GetAccessibleRole() gtk.AccessibleRole {
236
237	cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer())
238	return cret
239}
240
241// Retrieves the implementation for the given accessible object.
242func (x *ViewSwitcher) GetAtContext() *gtk.ATContext {
243	var cls *gtk.ATContext
244
245	cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer())
246
247	if cret == 0 {
248		return nil
249	}
250	cls = &gtk.ATContext{}
251	cls.Ptr = cret
252	return cls
253}
254
255// Queries the coordinates and dimensions of this accessible
256//
257// This functionality can be overridden by `GtkAccessible`
258// implementations, e.g. to get the bounds from an ignored
259// child widget.
260func (x *ViewSwitcher) GetBounds(XVar *int, YVar *int, WidthVar *int, HeightVar *int) bool {
261
262	cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar)
263	return cret
264}
265
266// Retrieves the first accessible child of an accessible object.
267func (x *ViewSwitcher) GetFirstAccessibleChild() *gtk.AccessibleBase {
268	var cls *gtk.AccessibleBase
269
270	cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer())
271
272	if cret == 0 {
273		return nil
274	}
275	cls = &gtk.AccessibleBase{}
276	cls.Ptr = cret
277	return cls
278}
279
280// Retrieves the next accessible sibling of an accessible object
281func (x *ViewSwitcher) GetNextAccessibleSibling() *gtk.AccessibleBase {
282	var cls *gtk.AccessibleBase
283
284	cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer())
285
286	if cret == 0 {
287		return nil
288	}
289	cls = &gtk.AccessibleBase{}
290	cls.Ptr = cret
291	return cls
292}
293
294// Queries a platform state, such as focus.
295//
296// This functionality can be overridden by `GtkAccessible`
297// implementations, e.g. to get platform state from an ignored
298// child widget, as is the case for `GtkText` wrappers.
299func (x *ViewSwitcher) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool {
300
301	cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar)
302	return cret
303}
304
305// Resets the accessible property to its default value.
306func (x *ViewSwitcher) ResetProperty(PropertyVar gtk.AccessibleProperty) {
307
308	gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar)
309
310}
311
312// Resets the accessible relation to its default value.
313func (x *ViewSwitcher) ResetRelation(RelationVar gtk.AccessibleRelation) {
314
315	gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar)
316
317}
318
319// Resets the accessible state to its default value.
320func (x *ViewSwitcher) ResetState(StateVar gtk.AccessibleState) {
321
322	gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar)
323
324}
325
326// Sets the parent and sibling of an accessible object.
327//
328// This function is meant to be used by accessible implementations that are
329// not part of the widget hierarchy, and but act as a logical bridge between
330// widgets. For instance, if a widget creates an object that holds metadata
331// for each child, and you want that object to implement the `GtkAccessible`
332// interface, you will use this function to ensure that the parent of each
333// child widget is the metadata object, and the parent of each metadata
334// object is the container widget.
335func (x *ViewSwitcher) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) {
336
337	gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer())
338
339}
340
341// Updates the next accessible sibling.
342//
343// That might be useful when a new child of a custom accessible
344// is created, and it needs to be linked to a previous child.
345func (x *ViewSwitcher) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) {
346
347	gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer())
348
349}
350
351// Informs ATs that the platform state has changed.
352//
353// This function should be used by `GtkAccessible` implementations that
354// have a platform state but are not widgets. Widgets handle platform
355// states automatically.
356func (x *ViewSwitcher) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) {
357
358	gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar)
359
360}
361
362// Updates a list of accessible properties.
363//
364// See the [enum@Gtk.AccessibleProperty] documentation for the
365// value types of accessible properties.
366//
367// This function should be called by `GtkWidget` types whenever
368// an accessible property change must be communicated to assistive
369// technologies.
370//
371// Example:
372// ```c
373// value = gtk_adjustment_get_value (adjustment);
374// gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button),
375//
376//	GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value,
377//	-1);
378//
379// ```
380func (x *ViewSwitcher) UpdateProperty(FirstPropertyVar gtk.AccessibleProperty, varArgs ...interface{}) {
381
382	gtk.XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...)
383
384}
385
386// Updates an array of accessible properties.
387//
388// This function should be called by `GtkWidget` types whenever an accessible
389// property change must be communicated to assistive technologies.
390//
391// This function is meant to be used by language bindings.
392func (x *ViewSwitcher) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gtk.AccessibleProperty, ValuesVar []gobject.Value) {
393
394	gtk.XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar)
395
396}
397
398// Updates a list of accessible relations.
399//
400// This function should be called by `GtkWidget` types whenever an accessible
401// relation change must be communicated to assistive technologies.
402//
403// If the [enum@Gtk.AccessibleRelation] requires a list of references,
404// you should pass each reference individually, followed by `NULL`, e.g.
405//
406// ```c
407// gtk_accessible_update_relation (accessible,
408//
409//	GTK_ACCESSIBLE_RELATION_CONTROLS,
410//	  ref1, NULL,
411//	GTK_ACCESSIBLE_RELATION_LABELLED_BY,
412//	  ref1, ref2, ref3, NULL,
413//	-1);
414//
415// ```
416func (x *ViewSwitcher) UpdateRelation(FirstRelationVar gtk.AccessibleRelation, varArgs ...interface{}) {
417
418	gtk.XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...)
419
420}
421
422// Updates an array of accessible relations.
423//
424// This function should be called by `GtkWidget` types whenever an accessible
425// relation change must be communicated to assistive technologies.
426//
427// This function is meant to be used by language bindings.
428func (x *ViewSwitcher) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk.AccessibleRelation, ValuesVar []gobject.Value) {
429
430	gtk.XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar)
431
432}
433
434// Updates a list of accessible states.
435//
436// See the [enum@Gtk.AccessibleState] documentation for the
437// value types of accessible states.
438//
439// This function should be called by `GtkWidget` types whenever
440// an accessible state change must be communicated to assistive
441// technologies.
442//
443// Example:
444//
445// ```c
446// value = GTK_ACCESSIBLE_TRISTATE_MIXED;
447// gtk_accessible_update_state (GTK_ACCESSIBLE (check_button),
448//
449//	GTK_ACCESSIBLE_STATE_CHECKED, value,
450//	-1);
451//
452// ```
453func (x *ViewSwitcher) UpdateState(FirstStateVar gtk.AccessibleState, varArgs ...interface{}) {
454
455	gtk.XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...)
456
457}
458
459// Updates an array of accessible states.
460//
461// This function should be called by `GtkWidget` types whenever an accessible
462// state change must be communicated to assistive technologies.
463//
464// This function is meant to be used by language bindings.
465func (x *ViewSwitcher) UpdateStateValue(NStatesVar int, StatesVar []gtk.AccessibleState, ValuesVar []gobject.Value) {
466
467	gtk.XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar)
468
469}
470
471// Gets the ID of the @buildable object.
472//
473// `GtkBuilder` sets the name based on the ID attribute
474// of the `<object>` tag used to construct the @buildable.
475func (x *ViewSwitcher) GetBuildableId() string {
476
477	cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer())
478	return cret
479}
480
481func init() {
482	core.SetPackageName("ADW", "libadwaita-1")
483	core.SetSharedLibraries("ADW", []string{"libadwaita-1.so.0"})
484	var libs []uintptr
485	for _, libPath := range core.GetPaths("ADW") {
486		lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
487		if err != nil {
488			panic(err)
489		}
490		libs = append(libs, lib)
491	}
492
493	core.PuregoSafeRegister(&xViewSwitcherPolicyGLibType, libs, "adw_view_switcher_policy_get_type")
494
495	core.PuregoSafeRegister(&xViewSwitcherGLibType, libs, "adw_view_switcher_get_type")
496
497	core.PuregoSafeRegister(&xNewViewSwitcher, libs, "adw_view_switcher_new")
498
499	core.PuregoSafeRegister(&xViewSwitcherGetPolicy, libs, "adw_view_switcher_get_policy")
500	core.PuregoSafeRegister(&xViewSwitcherGetStack, libs, "adw_view_switcher_get_stack")
501	core.PuregoSafeRegister(&xViewSwitcherSetPolicy, libs, "adw_view_switcher_set_policy")
502	core.PuregoSafeRegister(&xViewSwitcherSetStack, libs, "adw_view_switcher_set_stack")
503
504}

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