v0.2.1 c0399be

gtkscrollbar.go RawHistoryFolder

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

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