v0.2.1 c0399be

gtkassistant.go RawHistoryFolder

1// Package gtk was automatically generated by github.com/bnema/puregotk DO NOT EDIT
2package gtk
3
4import (
5	"unsafe"
6
7	"github.com/ebitengine/purego"
8
9	"github.com/bnema/puregotk/pkg/core"
10	"github.com/bnema/puregotk/v4/gdk"
11	"github.com/bnema/puregotk/v4/gio"
12	"github.com/bnema/puregotk/v4/glib"
13	"github.com/bnema/puregotk/v4/gobject"
14	"github.com/bnema/puregotk/v4/gobject/types"
15	"github.com/bnema/puregotk/v4/gsk"
16)
17
18// Type of callback used to calculate the next page in a `GtkAssistant`.
19//
20// It’s called both for computing the next page when the user presses the
21// “forward” button and for handling the behavior of the “last” button.
22//
23// See [method@Gtk.Assistant.set_forward_page_func].
24type AssistantPageFunc func(int, uintptr) int
25
26// Determines the role of a page inside a `GtkAssistant`.
27//
28// The role is used to handle buttons sensitivity and visibility.
29//
30// Note that an assistant needs to end its page flow with a page of type
31// %GTK_ASSISTANT_PAGE_CONFIRM, %GTK_ASSISTANT_PAGE_SUMMARY or
32// %GTK_ASSISTANT_PAGE_PROGRESS to be correct.
33//
34// The Cancel button will only be shown if the page isn’t “committed”.
35// See gtk_assistant_commit() for details.
36type AssistantPageType int
37
38var xAssistantPageTypeGLibType func() types.GType
39
40func AssistantPageTypeGLibType() types.GType {
41	return xAssistantPageTypeGLibType()
42}
43
44const (
45
46	// The page has regular contents. Both the
47	//  Back and forward buttons will be shown.
48	AssistantPageContentValue AssistantPageType = 0
49	// The page contains an introduction to the
50	//  assistant task. Only the Forward button will be shown if there is a
51	//   next page.
52	AssistantPageIntroValue AssistantPageType = 1
53	// The page lets the user confirm or deny the
54	//  changes. The Back and Apply buttons will be shown.
55	AssistantPageConfirmValue AssistantPageType = 2
56	// The page informs the user of the changes
57	//  done. Only the Close button will be shown.
58	AssistantPageSummaryValue AssistantPageType = 3
59	// Used for tasks that take a long time to
60	//  complete, blocks the assistant until the page is marked as complete.
61	//   Only the back button will be shown.
62	AssistantPageProgressValue AssistantPageType = 4
63	// Used for when other page types are not
64	//  appropriate. No buttons will be shown, and the application must
65	//  add its own buttons through gtk_assistant_add_action_widget().
66	AssistantPageCustomValue AssistantPageType = 5
67)
68
69// `GtkAssistant` is used to represent a complex as a series of steps.
70//
71// <picture>
72//
73//	<source srcset="assistant-dark.png" media="(prefers-color-scheme: dark)">
74//	<img alt="An example GtkAssistant" src="assistant.png">
75//
76// </picture>
77//
78// Each step consists of one or more pages. `GtkAssistant` guides the user
79// through the pages, and controls the page flow to collect the data needed
80// for the operation.
81//
82// `GtkAssistant` handles which buttons to show and to make sensitive based
83// on page sequence knowledge and the [enum@Gtk.AssistantPageType] of each
84// page in addition to state information like the *completed* and *committed*
85// page statuses.
86//
87// If you have a case that doesn’t quite fit in `GtkAssistant`s way of
88// handling buttons, you can use the %GTK_ASSISTANT_PAGE_CUSTOM page
89// type and handle buttons yourself.
90//
91// `GtkAssistant` maintains a `GtkAssistantPage` object for each added
92// child, which holds additional per-child properties. You
93// obtain the `GtkAssistantPage` for a child with [method@Gtk.Assistant.get_page].
94//
95// # GtkAssistant as GtkBuildable
96//
97// The `GtkAssistant` implementation of the `GtkBuildable` interface
98// exposes the @action_area as internal children with the name
99// “action_area”.
100//
101// To add pages to an assistant in `GtkBuilder`, simply add it as a
102// child to the `GtkAssistant` object. If you need to set per-object
103// properties, create a `GtkAssistantPage` object explicitly, and
104// set the child widget as a property on it.
105//
106// # CSS nodes
107//
108// `GtkAssistant` has a single CSS node with the name window and style
109// class .assistant.
110type Assistant struct {
111	Window
112}
113
114var xAssistantGLibType func() types.GType
115
116func AssistantGLibType() types.GType {
117	return xAssistantGLibType()
118}
119
120func AssistantNewFromInternalPtr(ptr uintptr) *Assistant {
121	cls := &Assistant{}
122	cls.Ptr = ptr
123	return cls
124}
125
126var xNewAssistant func() uintptr
127
128// Creates a new `GtkAssistant`.
129func NewAssistant() *Assistant {
130	var cls *Assistant
131
132	cret := xNewAssistant()
133
134	if cret == 0 {
135		return nil
136	}
137	gobject.IncreaseRef(cret)
138	cls = &Assistant{}
139	cls.Ptr = cret
140	return cls
141}
142
143var xAssistantAddActionWidget func(uintptr, uintptr)
144
145// Adds a widget to the action area of a `GtkAssistant`.
146func (x *Assistant) AddActionWidget(ChildVar *Widget) {
147
148	xAssistantAddActionWidget(x.GoPointer(), ChildVar.GoPointer())
149
150}
151
152var xAssistantAppendPage func(uintptr, uintptr) int
153
154// Appends a page to the @assistant.
155func (x *Assistant) AppendPage(PageVar *Widget) int {
156
157	cret := xAssistantAppendPage(x.GoPointer(), PageVar.GoPointer())
158	return cret
159}
160
161var xAssistantCommit func(uintptr)
162
163// Erases the visited page history.
164//
165// GTK will then hide the back button on the current page,
166// and removes the cancel button from subsequent pages.
167//
168// Use this when the information provided up to the current
169// page is hereafter deemed permanent and cannot be modified
170// or undone. For example, showing a progress page to track
171// a long-running, unreversible operation after the user has
172// clicked apply on a confirmation page.
173func (x *Assistant) Commit() {
174
175	xAssistantCommit(x.GoPointer())
176
177}
178
179var xAssistantGetCurrentPage func(uintptr) int
180
181// Returns the page number of the current page.
182func (x *Assistant) GetCurrentPage() int {
183
184	cret := xAssistantGetCurrentPage(x.GoPointer())
185	return cret
186}
187
188var xAssistantGetNPages func(uintptr) int
189
190// Returns the number of pages in the @assistant
191func (x *Assistant) GetNPages() int {
192
193	cret := xAssistantGetNPages(x.GoPointer())
194	return cret
195}
196
197var xAssistantGetNthPage func(uintptr, int) uintptr
198
199// Returns the child widget contained in page number @page_num.
200func (x *Assistant) GetNthPage(PageNumVar int) *Widget {
201	var cls *Widget
202
203	cret := xAssistantGetNthPage(x.GoPointer(), PageNumVar)
204
205	if cret == 0 {
206		return nil
207	}
208	gobject.IncreaseRef(cret)
209	cls = &Widget{}
210	cls.Ptr = cret
211	return cls
212}
213
214var xAssistantGetPage func(uintptr, uintptr) uintptr
215
216// Returns the `GtkAssistantPage` object for @child.
217func (x *Assistant) GetPage(ChildVar *Widget) *AssistantPage {
218	var cls *AssistantPage
219
220	cret := xAssistantGetPage(x.GoPointer(), ChildVar.GoPointer())
221
222	if cret == 0 {
223		return nil
224	}
225	gobject.IncreaseRef(cret)
226	cls = &AssistantPage{}
227	cls.Ptr = cret
228	return cls
229}
230
231var xAssistantGetPageComplete func(uintptr, uintptr) bool
232
233// Gets whether @page is complete.
234func (x *Assistant) GetPageComplete(PageVar *Widget) bool {
235
236	cret := xAssistantGetPageComplete(x.GoPointer(), PageVar.GoPointer())
237	return cret
238}
239
240var xAssistantGetPageTitle func(uintptr, uintptr) string
241
242// Gets the title for @page.
243func (x *Assistant) GetPageTitle(PageVar *Widget) string {
244
245	cret := xAssistantGetPageTitle(x.GoPointer(), PageVar.GoPointer())
246	return cret
247}
248
249var xAssistantGetPageType func(uintptr, uintptr) AssistantPageType
250
251// Gets the page type of @page.
252func (x *Assistant) GetPageType(PageVar *Widget) AssistantPageType {
253
254	cret := xAssistantGetPageType(x.GoPointer(), PageVar.GoPointer())
255	return cret
256}
257
258var xAssistantGetPages func(uintptr) uintptr
259
260// Gets a list model of the assistant pages.
261func (x *Assistant) GetPages() *gio.ListModelBase {
262	var cls *gio.ListModelBase
263
264	cret := xAssistantGetPages(x.GoPointer())
265
266	if cret == 0 {
267		return nil
268	}
269	cls = &gio.ListModelBase{}
270	cls.Ptr = cret
271	return cls
272}
273
274var xAssistantInsertPage func(uintptr, uintptr, int) int
275
276// Inserts a page in the @assistant at a given position.
277func (x *Assistant) InsertPage(PageVar *Widget, PositionVar int) int {
278
279	cret := xAssistantInsertPage(x.GoPointer(), PageVar.GoPointer(), PositionVar)
280	return cret
281}
282
283var xAssistantNextPage func(uintptr)
284
285// Navigate to the next page.
286//
287// It is a programming error to call this function when
288// there is no next page.
289//
290// This function is for use when creating pages of the
291// %GTK_ASSISTANT_PAGE_CUSTOM type.
292func (x *Assistant) NextPage() {
293
294	xAssistantNextPage(x.GoPointer())
295
296}
297
298var xAssistantPrependPage func(uintptr, uintptr) int
299
300// Prepends a page to the @assistant.
301func (x *Assistant) PrependPage(PageVar *Widget) int {
302
303	cret := xAssistantPrependPage(x.GoPointer(), PageVar.GoPointer())
304	return cret
305}
306
307var xAssistantPreviousPage func(uintptr)
308
309// Navigate to the previous visited page.
310//
311// It is a programming error to call this function when
312// no previous page is available.
313//
314// This function is for use when creating pages of the
315// %GTK_ASSISTANT_PAGE_CUSTOM type.
316func (x *Assistant) PreviousPage() {
317
318	xAssistantPreviousPage(x.GoPointer())
319
320}
321
322var xAssistantRemoveActionWidget func(uintptr, uintptr)
323
324// Removes a widget from the action area of a `GtkAssistant`.
325func (x *Assistant) RemoveActionWidget(ChildVar *Widget) {
326
327	xAssistantRemoveActionWidget(x.GoPointer(), ChildVar.GoPointer())
328
329}
330
331var xAssistantRemovePage func(uintptr, int)
332
333// Removes the @page_num’s page from @assistant.
334func (x *Assistant) RemovePage(PageNumVar int) {
335
336	xAssistantRemovePage(x.GoPointer(), PageNumVar)
337
338}
339
340var xAssistantSetCurrentPage func(uintptr, int)
341
342// Switches the page to @page_num.
343//
344// Note that this will only be necessary in custom buttons,
345// as the @assistant flow can be set with
346// gtk_assistant_set_forward_page_func().
347func (x *Assistant) SetCurrentPage(PageNumVar int) {
348
349	xAssistantSetCurrentPage(x.GoPointer(), PageNumVar)
350
351}
352
353var xAssistantSetForwardPageFunc func(uintptr, uintptr, uintptr, uintptr)
354
355// Sets the page forwarding function to be @page_func.
356//
357// This function will be used to determine what will be
358// the next page when the user presses the forward button.
359// Setting @page_func to %NULL will make the assistant to
360// use the default forward function, which just goes to the
361// next visible page.
362func (x *Assistant) SetForwardPageFunc(PageFuncVar *AssistantPageFunc, DataVar uintptr, DestroyVar *glib.DestroyNotify) {
363
364	var PageFuncVarRef uintptr
365	if PageFuncVar != nil {
366		PageFuncVarPtr := uintptr(unsafe.Pointer(PageFuncVar))
367		if cbRefPtr, ok := glib.GetCallback(PageFuncVarPtr); ok {
368			PageFuncVarRef = cbRefPtr
369		} else {
370			fcb := func(arg0 int, arg1 uintptr) int {
371				cbFn := *PageFuncVar
372				return cbFn(arg0, arg1)
373			}
374			PageFuncVarRef = purego.NewCallback(fcb)
375			glib.SaveCallbackWithClosure(PageFuncVarPtr, PageFuncVarRef, PageFuncVar)
376		}
377	}
378
379	var DestroyVarRef uintptr
380	if DestroyVar != nil {
381		DestroyVarPtr := uintptr(unsafe.Pointer(DestroyVar))
382		if cbRefPtr, ok := glib.GetCallback(DestroyVarPtr); ok {
383			DestroyVarRef = cbRefPtr
384		} else {
385			fcb := func(arg0 uintptr) {
386				cbFn := *DestroyVar
387				cbFn(arg0)
388			}
389			DestroyVarRef = purego.NewCallback(fcb)
390			glib.SaveCallbackWithClosure(DestroyVarPtr, DestroyVarRef, DestroyVar)
391		}
392	}
393
394	xAssistantSetForwardPageFunc(x.GoPointer(), PageFuncVarRef, DataVar, DestroyVarRef)
395
396}
397
398var xAssistantSetPageComplete func(uintptr, uintptr, bool)
399
400// Sets whether @page contents are complete.
401//
402// This will make @assistant update the buttons state
403// to be able to continue the task.
404func (x *Assistant) SetPageComplete(PageVar *Widget, CompleteVar bool) {
405
406	xAssistantSetPageComplete(x.GoPointer(), PageVar.GoPointer(), CompleteVar)
407
408}
409
410var xAssistantSetPageTitle func(uintptr, uintptr, string)
411
412// Sets a title for @page.
413//
414// The title is displayed in the header area of the assistant
415// when @page is the current page.
416func (x *Assistant) SetPageTitle(PageVar *Widget, TitleVar string) {
417
418	xAssistantSetPageTitle(x.GoPointer(), PageVar.GoPointer(), TitleVar)
419
420}
421
422var xAssistantSetPageType func(uintptr, uintptr, AssistantPageType)
423
424// Sets the page type for @page.
425//
426// The page type determines the page behavior in the @assistant.
427func (x *Assistant) SetPageType(PageVar *Widget, TypeVar AssistantPageType) {
428
429	xAssistantSetPageType(x.GoPointer(), PageVar.GoPointer(), TypeVar)
430
431}
432
433var xAssistantUpdateButtonsState func(uintptr)
434
435// Forces @assistant to recompute the buttons state.
436//
437// GTK automatically takes care of this in most situations,
438// e.g. when the user goes to a different page, or when the
439// visibility or completeness of a page changes.
440//
441// One situation where it can be necessary to call this
442// function is when changing a value on the current page
443// affects the future page flow of the assistant.
444func (x *Assistant) UpdateButtonsState() {
445
446	xAssistantUpdateButtonsState(x.GoPointer())
447
448}
449
450func (c *Assistant) GoPointer() uintptr {
451	if c == nil {
452		return 0
453	}
454	return c.Ptr
455}
456
457func (c *Assistant) SetGoPointer(ptr uintptr) {
458	c.Ptr = ptr
459}
460
461// SetPropertyUseHeaderBar sets the "use-header-bar" property.
462// %TRUE if the assistant uses a `GtkHeaderBar` for action buttons
463// instead of the action-area.
464//
465// For technical reasons, this property is declared as an integer
466// property, but you should only set it to %TRUE or %FALSE.
467func (x *Assistant) SetPropertyUseHeaderBar(value int) {
468	var v gobject.Value
469	v.Init(gobject.TypeIntVal)
470	v.SetInt(value)
471	x.SetProperty("use-header-bar", &v)
472}
473
474// GetPropertyUseHeaderBar gets the "use-header-bar" property.
475// %TRUE if the assistant uses a `GtkHeaderBar` for action buttons
476// instead of the action-area.
477//
478// For technical reasons, this property is declared as an integer
479// property, but you should only set it to %TRUE or %FALSE.
480func (x *Assistant) GetPropertyUseHeaderBar() int {
481	var v gobject.Value
482	x.GetProperty("use-header-bar", &v)
483	return v.GetInt()
484}
485
486// Emitted when the apply button is clicked.
487//
488// The default behavior of the `GtkAssistant` is to switch to the page
489// after the current page, unless the current page is the last one.
490//
491// A handler for the ::apply signal should carry out the actions for
492// which the wizard has collected data. If the action takes a long time
493// to complete, you might consider putting a page of type
494// %GTK_ASSISTANT_PAGE_PROGRESS after the confirmation page and handle
495// this operation within the [signal@Gtk.Assistant::prepare] signal of
496// the progress page.
497func (x *Assistant) ConnectApply(cb *func(Assistant)) uint {
498	cbPtr := uintptr(unsafe.Pointer(cb))
499	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
500		handlerID := gobject.SignalConnect(x.GoPointer(), "apply", cbRefPtr)
501		glib.SaveHandlerMapping(handlerID, cbPtr)
502		return handlerID
503	}
504
505	fcb := func(clsPtr uintptr) {
506		fa := Assistant{}
507		fa.Ptr = clsPtr
508		cbFn := *cb
509
510		cbFn(fa)
511
512	}
513	cbRefPtr := purego.NewCallback(fcb)
514	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
515	handlerID := gobject.SignalConnect(x.GoPointer(), "apply", cbRefPtr)
516	glib.SaveHandlerMapping(handlerID, cbPtr)
517	return handlerID
518}
519
520// Emitted when then the cancel button is clicked.
521func (x *Assistant) ConnectCancel(cb *func(Assistant)) uint {
522	cbPtr := uintptr(unsafe.Pointer(cb))
523	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
524		handlerID := gobject.SignalConnect(x.GoPointer(), "cancel", cbRefPtr)
525		glib.SaveHandlerMapping(handlerID, cbPtr)
526		return handlerID
527	}
528
529	fcb := func(clsPtr uintptr) {
530		fa := Assistant{}
531		fa.Ptr = clsPtr
532		cbFn := *cb
533
534		cbFn(fa)
535
536	}
537	cbRefPtr := purego.NewCallback(fcb)
538	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
539	handlerID := gobject.SignalConnect(x.GoPointer(), "cancel", cbRefPtr)
540	glib.SaveHandlerMapping(handlerID, cbPtr)
541	return handlerID
542}
543
544// Emitted either when the close button of a summary page is clicked,
545// or when the apply button in the last page in the flow (of type
546// %GTK_ASSISTANT_PAGE_CONFIRM) is clicked.
547func (x *Assistant) ConnectClose(cb *func(Assistant)) uint {
548	cbPtr := uintptr(unsafe.Pointer(cb))
549	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
550		handlerID := gobject.SignalConnect(x.GoPointer(), "close", cbRefPtr)
551		glib.SaveHandlerMapping(handlerID, cbPtr)
552		return handlerID
553	}
554
555	fcb := func(clsPtr uintptr) {
556		fa := Assistant{}
557		fa.Ptr = clsPtr
558		cbFn := *cb
559
560		cbFn(fa)
561
562	}
563	cbRefPtr := purego.NewCallback(fcb)
564	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
565	handlerID := gobject.SignalConnect(x.GoPointer(), "close", cbRefPtr)
566	glib.SaveHandlerMapping(handlerID, cbPtr)
567	return handlerID
568}
569
570// The action signal for the Escape binding.
571func (x *Assistant) ConnectEscape(cb *func(Assistant)) uint {
572	cbPtr := uintptr(unsafe.Pointer(cb))
573	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
574		handlerID := gobject.SignalConnect(x.GoPointer(), "escape", cbRefPtr)
575		glib.SaveHandlerMapping(handlerID, cbPtr)
576		return handlerID
577	}
578
579	fcb := func(clsPtr uintptr) {
580		fa := Assistant{}
581		fa.Ptr = clsPtr
582		cbFn := *cb
583
584		cbFn(fa)
585
586	}
587	cbRefPtr := purego.NewCallback(fcb)
588	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
589	handlerID := gobject.SignalConnect(x.GoPointer(), "escape", cbRefPtr)
590	glib.SaveHandlerMapping(handlerID, cbPtr)
591	return handlerID
592}
593
594// Emitted when a new page is set as the assistant's current page,
595// before making the new page visible.
596//
597// A handler for this signal can do any preparations which are
598// necessary before showing @page.
599func (x *Assistant) ConnectPrepare(cb *func(Assistant, uintptr)) uint {
600	cbPtr := uintptr(unsafe.Pointer(cb))
601	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
602		handlerID := gobject.SignalConnect(x.GoPointer(), "prepare", cbRefPtr)
603		glib.SaveHandlerMapping(handlerID, cbPtr)
604		return handlerID
605	}
606
607	fcb := func(clsPtr uintptr, PageVarp uintptr) {
608		fa := Assistant{}
609		fa.Ptr = clsPtr
610		cbFn := *cb
611
612		cbFn(fa, PageVarp)
613
614	}
615	cbRefPtr := purego.NewCallback(fcb)
616	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
617	handlerID := gobject.SignalConnect(x.GoPointer(), "prepare", cbRefPtr)
618	glib.SaveHandlerMapping(handlerID, cbPtr)
619	return handlerID
620}
621
622// Requests the user's screen reader to announce the given message.
623//
624// This kind of notification is useful for messages that
625// either have only a visual representation or that are not
626// exposed visually at all, e.g. a notification about a
627// successful operation.
628//
629// Also, by using this API, you can ensure that the message
630// does not interrupts the user's current screen reader output.
631func (x *Assistant) Announce(MessageVar string, PriorityVar AccessibleAnnouncementPriority) {
632
633	XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar)
634
635}
636
637// Retrieves the accessible parent for an accessible object.
638//
639// This function returns `NULL` for top level widgets.
640func (x *Assistant) GetAccessibleParent() *AccessibleBase {
641	var cls *AccessibleBase
642
643	cret := XGtkAccessibleGetAccessibleParent(x.GoPointer())
644
645	if cret == 0 {
646		return nil
647	}
648	cls = &AccessibleBase{}
649	cls.Ptr = cret
650	return cls
651}
652
653// Retrieves the accessible role of an accessible object.
654func (x *Assistant) GetAccessibleRole() AccessibleRole {
655
656	cret := XGtkAccessibleGetAccessibleRole(x.GoPointer())
657	return cret
658}
659
660// Retrieves the implementation for the given accessible object.
661func (x *Assistant) GetAtContext() *ATContext {
662	var cls *ATContext
663
664	cret := XGtkAccessibleGetAtContext(x.GoPointer())
665
666	if cret == 0 {
667		return nil
668	}
669	cls = &ATContext{}
670	cls.Ptr = cret
671	return cls
672}
673
674// Queries the coordinates and dimensions of this accessible
675//
676// This functionality can be overridden by `GtkAccessible`
677// implementations, e.g. to get the bounds from an ignored
678// child widget.
679func (x *Assistant) GetBounds(XVar *int, YVar *int, WidthVar *int, HeightVar *int) bool {
680
681	cret := XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar)
682	return cret
683}
684
685// Retrieves the first accessible child of an accessible object.
686func (x *Assistant) GetFirstAccessibleChild() *AccessibleBase {
687	var cls *AccessibleBase
688
689	cret := XGtkAccessibleGetFirstAccessibleChild(x.GoPointer())
690
691	if cret == 0 {
692		return nil
693	}
694	cls = &AccessibleBase{}
695	cls.Ptr = cret
696	return cls
697}
698
699// Retrieves the next accessible sibling of an accessible object
700func (x *Assistant) GetNextAccessibleSibling() *AccessibleBase {
701	var cls *AccessibleBase
702
703	cret := XGtkAccessibleGetNextAccessibleSibling(x.GoPointer())
704
705	if cret == 0 {
706		return nil
707	}
708	cls = &AccessibleBase{}
709	cls.Ptr = cret
710	return cls
711}
712
713// Queries a platform state, such as focus.
714//
715// This functionality can be overridden by `GtkAccessible`
716// implementations, e.g. to get platform state from an ignored
717// child widget, as is the case for `GtkText` wrappers.
718func (x *Assistant) GetPlatformState(StateVar AccessiblePlatformState) bool {
719
720	cret := XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar)
721	return cret
722}
723
724// Resets the accessible property to its default value.
725func (x *Assistant) ResetProperty(PropertyVar AccessibleProperty) {
726
727	XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar)
728
729}
730
731// Resets the accessible relation to its default value.
732func (x *Assistant) ResetRelation(RelationVar AccessibleRelation) {
733
734	XGtkAccessibleResetRelation(x.GoPointer(), RelationVar)
735
736}
737
738// Resets the accessible state to its default value.
739func (x *Assistant) ResetState(StateVar AccessibleState) {
740
741	XGtkAccessibleResetState(x.GoPointer(), StateVar)
742
743}
744
745// Sets the parent and sibling of an accessible object.
746//
747// This function is meant to be used by accessible implementations that are
748// not part of the widget hierarchy, and but act as a logical bridge between
749// widgets. For instance, if a widget creates an object that holds metadata
750// for each child, and you want that object to implement the `GtkAccessible`
751// interface, you will use this function to ensure that the parent of each
752// child widget is the metadata object, and the parent of each metadata
753// object is the container widget.
754func (x *Assistant) SetAccessibleParent(ParentVar Accessible, NextSiblingVar Accessible) {
755
756	XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer())
757
758}
759
760// Updates the next accessible sibling.
761//
762// That might be useful when a new child of a custom accessible
763// is created, and it needs to be linked to a previous child.
764func (x *Assistant) UpdateNextAccessibleSibling(NewSiblingVar Accessible) {
765
766	XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer())
767
768}
769
770// Informs ATs that the platform state has changed.
771//
772// This function should be used by `GtkAccessible` implementations that
773// have a platform state but are not widgets. Widgets handle platform
774// states automatically.
775func (x *Assistant) UpdatePlatformState(StateVar AccessiblePlatformState) {
776
777	XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar)
778
779}
780
781// Updates a list of accessible properties.
782//
783// See the [enum@Gtk.AccessibleProperty] documentation for the
784// value types of accessible properties.
785//
786// This function should be called by `GtkWidget` types whenever
787// an accessible property change must be communicated to assistive
788// technologies.
789//
790// Example:
791// ```c
792// value = gtk_adjustment_get_value (adjustment);
793// gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button),
794//
795//	GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value,
796//	-1);
797//
798// ```
799func (x *Assistant) UpdateProperty(FirstPropertyVar AccessibleProperty, varArgs ...interface{}) {
800
801	XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...)
802
803}
804
805// Updates an array of accessible properties.
806//
807// This function should be called by `GtkWidget` types whenever an accessible
808// property change must be communicated to assistive technologies.
809//
810// This function is meant to be used by language bindings.
811func (x *Assistant) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []AccessibleProperty, ValuesVar []gobject.Value) {
812
813	XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar)
814
815}
816
817// Updates a list of accessible relations.
818//
819// This function should be called by `GtkWidget` types whenever an accessible
820// relation change must be communicated to assistive technologies.
821//
822// If the [enum@Gtk.AccessibleRelation] requires a list of references,
823// you should pass each reference individually, followed by `NULL`, e.g.
824//
825// ```c
826// gtk_accessible_update_relation (accessible,
827//
828//	GTK_ACCESSIBLE_RELATION_CONTROLS,
829//	  ref1, NULL,
830//	GTK_ACCESSIBLE_RELATION_LABELLED_BY,
831//	  ref1, ref2, ref3, NULL,
832//	-1);
833//
834// ```
835func (x *Assistant) UpdateRelation(FirstRelationVar AccessibleRelation, varArgs ...interface{}) {
836
837	XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...)
838
839}
840
841// Updates an array of accessible relations.
842//
843// This function should be called by `GtkWidget` types whenever an accessible
844// relation change must be communicated to assistive technologies.
845//
846// This function is meant to be used by language bindings.
847func (x *Assistant) UpdateRelationValue(NRelationsVar int, RelationsVar []AccessibleRelation, ValuesVar []gobject.Value) {
848
849	XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar)
850
851}
852
853// Updates a list of accessible states.
854//
855// See the [enum@Gtk.AccessibleState] documentation for the
856// value types of accessible states.
857//
858// This function should be called by `GtkWidget` types whenever
859// an accessible state change must be communicated to assistive
860// technologies.
861//
862// Example:
863//
864// ```c
865// value = GTK_ACCESSIBLE_TRISTATE_MIXED;
866// gtk_accessible_update_state (GTK_ACCESSIBLE (check_button),
867//
868//	GTK_ACCESSIBLE_STATE_CHECKED, value,
869//	-1);
870//
871// ```
872func (x *Assistant) UpdateState(FirstStateVar AccessibleState, varArgs ...interface{}) {
873
874	XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...)
875
876}
877
878// Updates an array of accessible states.
879//
880// This function should be called by `GtkWidget` types whenever an accessible
881// state change must be communicated to assistive technologies.
882//
883// This function is meant to be used by language bindings.
884func (x *Assistant) UpdateStateValue(NStatesVar int, StatesVar []AccessibleState, ValuesVar []gobject.Value) {
885
886	XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar)
887
888}
889
890// Gets the ID of the @buildable object.
891//
892// `GtkBuilder` sets the name based on the ID attribute
893// of the `<object>` tag used to construct the @buildable.
894func (x *Assistant) GetBuildableId() string {
895
896	cret := XGtkBuildableGetBuildableId(x.GoPointer())
897	return cret
898}
899
900// Returns the renderer that is used for this `GtkNative`.
901func (x *Assistant) GetRenderer() *gsk.Renderer {
902	var cls *gsk.Renderer
903
904	cret := XGtkNativeGetRenderer(x.GoPointer())
905
906	if cret == 0 {
907		return nil
908	}
909	gobject.IncreaseRef(cret)
910	cls = &gsk.Renderer{}
911	cls.Ptr = cret
912	return cls
913}
914
915// Returns the surface of this `GtkNative`.
916func (x *Assistant) GetSurface() *gdk.Surface {
917	var cls *gdk.Surface
918
919	cret := XGtkNativeGetSurface(x.GoPointer())
920
921	if cret == 0 {
922		return nil
923	}
924	gobject.IncreaseRef(cret)
925	cls = &gdk.Surface{}
926	cls.Ptr = cret
927	return cls
928}
929
930// Retrieves the surface transform of @self.
931//
932// This is the translation from @self's surface coordinates into
933// @self's widget coordinates.
934func (x *Assistant) GetSurfaceTransform(XVar *float64, YVar *float64) {
935
936	XGtkNativeGetSurfaceTransform(x.GoPointer(), XVar, YVar)
937
938}
939
940// Realizes a `GtkNative`.
941//
942// This should only be used by subclasses.
943func (x *Assistant) Realize() {
944
945	XGtkNativeRealize(x.GoPointer())
946
947}
948
949// Unrealizes a `GtkNative`.
950//
951// This should only be used by subclasses.
952func (x *Assistant) Unrealize() {
953
954	XGtkNativeUnrealize(x.GoPointer())
955
956}
957
958// Returns the display that this `GtkRoot` is on.
959func (x *Assistant) GetDisplay() *gdk.Display {
960	var cls *gdk.Display
961
962	cret := XGtkRootGetDisplay(x.GoPointer())
963
964	if cret == 0 {
965		return nil
966	}
967	gobject.IncreaseRef(cret)
968	cls = &gdk.Display{}
969	cls.Ptr = cret
970	return cls
971}
972
973// Retrieves the current focused widget within the root.
974//
975// Note that this is the widget that would have the focus
976// if the root is active; if the root is not focused then
977// `gtk_widget_has_focus (widget)` will be %FALSE for the
978// widget.
979func (x *Assistant) GetFocus() *Widget {
980	var cls *Widget
981
982	cret := XGtkRootGetFocus(x.GoPointer())
983
984	if cret == 0 {
985		return nil
986	}
987	gobject.IncreaseRef(cret)
988	cls = &Widget{}
989	cls.Ptr = cret
990	return cls
991}
992
993// If @focus is not the current focus widget, and is focusable, sets
994// it as the focus widget for the root.
995//
996// If @focus is %NULL, unsets the focus widget for the root.
997//
998// To set the focus to a particular widget in the root, it is usually
999// more convenient to use [method@Gtk.Widget.grab_focus] instead of
1000// this function.
1001func (x *Assistant) SetFocus(FocusVar *Widget) {
1002
1003	XGtkRootSetFocus(x.GoPointer(), FocusVar.GoPointer())
1004
1005}
1006
1007// `GtkAssistantPage` is an auxiliary object used by `GtkAssistant`.
1008type AssistantPage struct {
1009	gobject.Object
1010}
1011
1012var xAssistantPageGLibType func() types.GType
1013
1014func AssistantPageGLibType() types.GType {
1015	return xAssistantPageGLibType()
1016}
1017
1018func AssistantPageNewFromInternalPtr(ptr uintptr) *AssistantPage {
1019	cls := &AssistantPage{}
1020	cls.Ptr = ptr
1021	return cls
1022}
1023
1024var xAssistantPageGetChild func(uintptr) uintptr
1025
1026// Returns the child to which @page belongs.
1027func (x *AssistantPage) GetChild() *Widget {
1028	var cls *Widget
1029
1030	cret := xAssistantPageGetChild(x.GoPointer())
1031
1032	if cret == 0 {
1033		return nil
1034	}
1035	gobject.IncreaseRef(cret)
1036	cls = &Widget{}
1037	cls.Ptr = cret
1038	return cls
1039}
1040
1041func (c *AssistantPage) GoPointer() uintptr {
1042	if c == nil {
1043		return 0
1044	}
1045	return c.Ptr
1046}
1047
1048func (c *AssistantPage) SetGoPointer(ptr uintptr) {
1049	c.Ptr = ptr
1050}
1051
1052// SetPropertyComplete sets the "complete" property.
1053// Whether all required fields are filled in.
1054//
1055// GTK uses this information to control the sensitivity
1056// of the navigation buttons.
1057func (x *AssistantPage) SetPropertyComplete(value bool) {
1058	var v gobject.Value
1059	v.Init(gobject.TypeBooleanVal)
1060	v.SetBoolean(value)
1061	x.SetProperty("complete", &v)
1062}
1063
1064// GetPropertyComplete gets the "complete" property.
1065// Whether all required fields are filled in.
1066//
1067// GTK uses this information to control the sensitivity
1068// of the navigation buttons.
1069func (x *AssistantPage) GetPropertyComplete() bool {
1070	var v gobject.Value
1071	x.GetProperty("complete", &v)
1072	return v.GetBoolean()
1073}
1074
1075// SetPropertyTitle sets the "title" property.
1076// The title of the page.
1077func (x *AssistantPage) SetPropertyTitle(value string) {
1078	var v gobject.Value
1079	v.Init(gobject.TypeStringVal)
1080	v.SetString(&value)
1081	x.SetProperty("title", &v)
1082}
1083
1084// GetPropertyTitle gets the "title" property.
1085// The title of the page.
1086func (x *AssistantPage) GetPropertyTitle() string {
1087	var v gobject.Value
1088	x.GetProperty("title", &v)
1089	return v.GetString()
1090}
1091
1092func init() {
1093	core.SetPackageName("GTK", "gtk4")
1094	core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"})
1095	var libs []uintptr
1096	for _, libPath := range core.GetPaths("GTK") {
1097		lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
1098		if err != nil {
1099			panic(err)
1100		}
1101		libs = append(libs, lib)
1102	}
1103
1104	core.PuregoSafeRegister(&xAssistantPageTypeGLibType, libs, "gtk_assistant_page_type_get_type")
1105
1106	core.PuregoSafeRegister(&xAssistantGLibType, libs, "gtk_assistant_get_type")
1107
1108	core.PuregoSafeRegister(&xNewAssistant, libs, "gtk_assistant_new")
1109
1110	core.PuregoSafeRegister(&xAssistantAddActionWidget, libs, "gtk_assistant_add_action_widget")
1111	core.PuregoSafeRegister(&xAssistantAppendPage, libs, "gtk_assistant_append_page")
1112	core.PuregoSafeRegister(&xAssistantCommit, libs, "gtk_assistant_commit")
1113	core.PuregoSafeRegister(&xAssistantGetCurrentPage, libs, "gtk_assistant_get_current_page")
1114	core.PuregoSafeRegister(&xAssistantGetNPages, libs, "gtk_assistant_get_n_pages")
1115	core.PuregoSafeRegister(&xAssistantGetNthPage, libs, "gtk_assistant_get_nth_page")
1116	core.PuregoSafeRegister(&xAssistantGetPage, libs, "gtk_assistant_get_page")
1117	core.PuregoSafeRegister(&xAssistantGetPageComplete, libs, "gtk_assistant_get_page_complete")
1118	core.PuregoSafeRegister(&xAssistantGetPageTitle, libs, "gtk_assistant_get_page_title")
1119	core.PuregoSafeRegister(&xAssistantGetPageType, libs, "gtk_assistant_get_page_type")
1120	core.PuregoSafeRegister(&xAssistantGetPages, libs, "gtk_assistant_get_pages")
1121	core.PuregoSafeRegister(&xAssistantInsertPage, libs, "gtk_assistant_insert_page")
1122	core.PuregoSafeRegister(&xAssistantNextPage, libs, "gtk_assistant_next_page")
1123	core.PuregoSafeRegister(&xAssistantPrependPage, libs, "gtk_assistant_prepend_page")
1124	core.PuregoSafeRegister(&xAssistantPreviousPage, libs, "gtk_assistant_previous_page")
1125	core.PuregoSafeRegister(&xAssistantRemoveActionWidget, libs, "gtk_assistant_remove_action_widget")
1126	core.PuregoSafeRegister(&xAssistantRemovePage, libs, "gtk_assistant_remove_page")
1127	core.PuregoSafeRegister(&xAssistantSetCurrentPage, libs, "gtk_assistant_set_current_page")
1128	core.PuregoSafeRegister(&xAssistantSetForwardPageFunc, libs, "gtk_assistant_set_forward_page_func")
1129	core.PuregoSafeRegister(&xAssistantSetPageComplete, libs, "gtk_assistant_set_page_complete")
1130	core.PuregoSafeRegister(&xAssistantSetPageTitle, libs, "gtk_assistant_set_page_title")
1131	core.PuregoSafeRegister(&xAssistantSetPageType, libs, "gtk_assistant_set_page_type")
1132	core.PuregoSafeRegister(&xAssistantUpdateButtonsState, libs, "gtk_assistant_update_buttons_state")
1133
1134	core.PuregoSafeRegister(&xAssistantPageGLibType, libs, "gtk_assistant_page_get_type")
1135
1136	core.PuregoSafeRegister(&xAssistantPageGetChild, libs, "gtk_assistant_page_get_child")
1137
1138}

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